interfaceCompositionModel.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2015-2023 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
27 #include "phaseModel.H"
28 #include "phaseSystem.H"
30 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
38 }
39 
40 
41 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42 
44 (
45  const dictionary& dict,
46  const phaseInterface& interface
47 )
48 :
49  interface_
50  (
51  interface.modelCast<interfaceCompositionModel, sidedPhaseInterface>()
52  ),
53  species_(dict.lookup("species")),
54  Le_("Le", dimless, dict),
55  thermo_
56  (
57  refCast<const rhoFluidMulticomponentThermo>(interface_.phase().thermo())
58  ),
59  otherThermo_(interface_.otherPhase().thermo())
60 {}
61 
62 
63 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
64 
66 {}
67 
68 
69 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
70 
72 (
73  const word& speciesName,
74  const volScalarField& Tf
75 ) const
76 {
77  const label speciei = thermo().species()[speciesName];
78 
79  return Yf(speciesName, Tf) - thermo().Y()[speciei];
80 }
81 
82 
84 (
85  const word& speciesName,
86  const volScalarField& Tf
87 ) const
88 {
89  return YfPrime(speciesName, Tf);
90 }
91 
92 
94 (
95  const word& speciesName
96 ) const
97 {
98  const label speciei = thermo().species()[speciesName];
99  const volScalarField& p(thermo_.p());
100  const volScalarField& T(thermo_.T());
101 
102  return volScalarField::New
103  (
104  IOobject::groupName("D" + speciesName, interface_.name()),
105  thermo().kappai(speciei, p, T)
106  /thermo().Cpi(speciei, p, T)
107  /thermo().rhoi(speciei, p, T)
108  /Le_
109  );
110 }
111 
112 
113 // ************************************************************************* //
Generic GeometricField class.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Internal &, const PtrList< PatchField< Type >> &, const HashPtrTable< Source > &=HashPtrTable< Source >())
Return a temporary field constructed from name,.
static word groupName(Name name, const word &group)
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Generic base class for interface composition models. These models describe the composition in phase 1...
interfaceCompositionModel(const dictionary &dict, const phaseInterface &interface)
Construct from a dictionary and an interface.
tmp< volScalarField > D(const word &speciesName) const
Mass diffusivity.
tmp< volScalarField > dY(const word &speciesName, const volScalarField &Tf) const
Mass fraction difference between the interface and the field.
tmp< volScalarField > dYfPrime(const word &speciesName, const volScalarField &Tf) const
Mass fraction difference between the interface and the field.
virtual const speciesTable & species() const =0
The table of species.
virtual PtrList< volScalarField > & Y()=0
Access the mass-fraction fields.
Class to represent an interface between phases. Derivations can further specify the configuration of ...
Base-class for multi-component fluid thermodynamic properties based on density.
Class to represent a certain side of an interface between phases.
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:129
const dimensionSet dimless
defineTypeNameAndDebug(combustionModel, 0)
defineSidedInterfacialModelTypeNameAndDebug(blendedDiffusiveMassTransferModel, 0)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
dictionary dict
volScalarField & p
fluidMulticomponentThermo & thermo
Definition: createFields.H:31