InterfaceCompositionModel.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2015-2018 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::InterfaceCompositionModel
28 
29 Description
30  Base class for interface composition models, templated on the two
31  thermodynamic models either side of the interface.
32 
33 SourceFiles
34  InterfaceCompositionModel.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef InterfaceCompositionModel_H
39 #define InterfaceCompositionModel_H
40 
41 #include "interfaceCompositionModel.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 class phaseModel;
49 class phasePair;
50 template<class ThermoType> class pureMixture;
51 template<class ThermoType> class multiComponentMixture;
52 
53 /*---------------------------------------------------------------------------*\
54  Class InterfaceCompositionModel Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 template<class Thermo, class OtherThermo>
59 :
61 {
62 protected:
63 
64  // Protected Data
65 
66  //- Thermo
67  const Thermo& thermo_;
68 
69  //- Other Thermo
70  const OtherThermo& otherThermo_;
71 
72  //- Lewis number
73  const dimensionedScalar Le_;
74 
75 
76  // Protected Member Functions
77 
78  //- Get a reference to the local thermo for a pure mixture
79  template<class ThermoType>
82  (
83  const word& speciesName,
84  const pureMixture<ThermoType>& globalThermo
85  ) const;
86 
87  //- Get a reference to the local thermo for a multi component mixture
88  template<class ThermoType>
91  (
92  const word& speciesName,
93  const multiComponentMixture<ThermoType>& globalThermo
94  ) const;
95 
96 
97 public:
98 
99  // Constructors
100 
101  //- Construct from components
103  (
104  const dictionary& dict,
105  const phasePair& pair
106  );
107 
108 
109  //- Destructor
110  ~InterfaceCompositionModel() = default;
111 
112 
113  // Member Functions
114 
115  //- Mass fraction difference between the interface and the field
116  virtual tmp<volScalarField> dY
117  (
118  const word& speciesName,
119  const volScalarField& Tf
120  ) const;
121 
122  //- Mass diffusivity
123  virtual tmp<volScalarField> D
124  (
125  const word& speciesName
126  ) const;
127 
128  //- Latent heat
129  virtual tmp<volScalarField> L
130  (
131  const word& speciesName,
132  const volScalarField& Tf
133  ) const;
134 
135  //- Add latent heat flow rate to total
136  virtual void addMDotL
137  (
138  const volScalarField& K,
139  const volScalarField& Tf,
140  volScalarField& mDotL,
141  volScalarField& mDotLPrime
142  ) const;
143 };
144 
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 } // End namespace Foam
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 // Instantiation for multi-component-multi-component pairs
153 #define makeInterfaceCompositionType(Type, Thermo, Comp, Mix, Phys, OtherThermo, OtherComp, OtherMix, OtherPhys)\
154  \
155  typedef Thermo<Comp, SpecieMixture<Mix<Phys>>> \
156  Type##Thermo##Comp##Mix##Phys; \
157  \
158  typedef OtherThermo<OtherComp, OtherMix<OtherPhys>> \
159  Type##Other##OtherThermo##OtherComp##OtherMix##OtherPhys; \
160  \
161  addInterfaceCompositionToRunTimeSelectionTable \
162  ( \
163  Type, \
164  Type##Thermo##Comp##Mix##Phys, \
165  Type##Other##OtherThermo##OtherComp##OtherMix##OtherPhys \
166  )
167 
168 // Instantiation for multi-component-single-component pairs
169 #define makeSpecieInterfaceCompositionType(Type, Thermo, Comp, Mix, Phys, OtherThermo, OtherComp, OtherMix, OtherPhys)\
170  \
171  typedef Thermo<Comp, SpecieMixture<Mix<Phys>>> \
172  Type##Thermo##Comp##Mix##Phys; \
173  \
174  typedef OtherThermo<OtherComp, SpecieMixture<OtherMix<OtherPhys>>> \
175  Type##Other##OtherThermo##OtherComp##OtherMix##OtherPhys; \
176  \
177  addInterfaceCompositionToRunTimeSelectionTable \
178  ( \
179  Type, \
180  Type##Thermo##Comp##Mix##Phys, \
181  Type##Other##OtherThermo##OtherComp##OtherMix##OtherPhys \
182  )
183 
184 // Addition to the run-time selection table
185 #define addInterfaceCompositionToRunTimeSelectionTable(Type, Thermo, OtherThermo)\
186  \
187  typedef Type<Thermo, OtherThermo> \
188  Type##Thermo##OtherThermo; \
189  \
190  defineTemplateTypeNameAndDebugWithName \
191  ( \
192  Type##Thermo##OtherThermo, \
193  ( \
194  word(Type##Thermo##OtherThermo::typeName_()) + "<" \
195  + word(Thermo::typeName) + "," \
196  + word(OtherThermo::typeName) + ">" \
197  ).c_str(), \
198  0 \
199  ); \
200  \
201  addToRunTimeSelectionTable \
202  ( \
203  interfaceCompositionModel, \
204  Type##Thermo##OtherThermo, \
205  dictionary \
206  )
207 
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 
210 #ifdef NoRepository
211  #include "InterfaceCompositionModel.C"
212 #endif
213 
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 
216 #endif
217 
218 // ************************************************************************* //
Foam::phasePair
Description for mass transfer between a pair of phases. The direction of the mass transfer is from th...
Definition: phasePair.H:51
Foam::InterfaceCompositionModel
Base class for interface composition models, templated on the two thermodynamic models either side of...
Definition: InterfaceCompositionModel.H:57
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::pureMixture
Foam::pureMixture.
Definition: InterfaceCompositionModel.H:49
Foam::InterfaceCompositionModel::L
virtual tmp< volScalarField > L(const word &speciesName, const volScalarField &Tf) const
Latent heat.
Definition: InterfaceCompositionModel.C:163
Foam::tmp< volScalarField >
Foam::InterfaceCompositionModel::getLocalThermo
const pureMixture< ThermoType >::thermoType & getLocalThermo(const word &speciesName, const pureMixture< ThermoType > &globalThermo) const
Get a reference to the local thermo for a pure mixture.
Foam::InterfaceCompositionModel::Le_
const dimensionedScalar Le_
Lewis number.
Definition: InterfaceCompositionModel.H:72
Foam::InterfaceCompositionModel::~InterfaceCompositionModel
~InterfaceCompositionModel()=default
Destructor.
Foam::InterfaceCompositionModel::thermo_
const Thermo & thermo_
Thermo.
Definition: InterfaceCompositionModel.H:66
Foam::pureMixture::thermoType
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
Definition: pureMixture.H:66
Foam::interfaceCompositionModel
Generic base class for interface composition models. These models describe the composition in phase 1...
Definition: interfaceCompositionModel.H:58
Foam::interfaceCompositionModel::pair
const phasePair & pair() const
Return pair.
K
CGAL::Exact_predicates_exact_constructions_kernel K
Definition: CGALTriangulation3DKernel.H:58
Foam::InterfaceCompositionModel::InterfaceCompositionModel
InterfaceCompositionModel(const dictionary &dict, const phasePair &pair)
Construct from components.
Definition: InterfaceCompositionModel.C:74
Foam::InterfaceCompositionModel::otherThermo_
const OtherThermo & otherThermo_
Other Thermo.
Definition: InterfaceCompositionModel.H:69
Foam::multiComponentMixture
Foam::multiComponentMixture.
Definition: InterfaceCompositionModel.H:50
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::dimensioned< scalar >
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::InterfaceCompositionModel::addMDotL
virtual void addMDotL(const volScalarField &K, const volScalarField &Tf, volScalarField &mDotL, volScalarField &mDotLPrime) const
Add latent heat flow rate to total.
Definition: InterfaceCompositionModel.C:209
Foam::multiComponentMixture::thermoType
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
Definition: multiComponentMixture.H:88
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::InterfaceCompositionModel::D
virtual tmp< volScalarField > D(const word &speciesName) const
Mass diffusivity.
Definition: InterfaceCompositionModel.C:120
Foam::InterfaceCompositionModel::dY
virtual tmp< volScalarField > dY(const word &speciesName, const volScalarField &Tf) const
Mass fraction difference between the interface and the field.
Definition: InterfaceCompositionModel.C:103