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 | Copyright (C) 2015-2016 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 Class
25  Foam::InterfaceCompositionModel
26 
27 Description
28  Base class for interface composition models, templated on the two
29  thermodynamic models either side of the interface.
30 
31 SourceFiles
32  InterfaceCompositionModel.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef InterfaceCompositionModel_H
37 #define InterfaceCompositionModel_H
38 
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 class phaseModel;
47 class phasePair;
48 template<class ThermoType> class pureMixture;
49 template<class ThermoType> class multiComponentMixture;
50 
51 /*---------------------------------------------------------------------------*\
52  Class InterfaceCompositionModel Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 template<class Thermo, class OtherThermo>
57 :
59 {
60 protected:
61 
62  // Private data
63 
64  //- Thermo
65  const Thermo& thermo_;
66 
67  //- Other Thermo
68  const OtherThermo& otherThermo_;
69 
70  //- Lewis number
71  const dimensionedScalar Le_;
72 
73 
74  // Private member functions
75 
76  //- Get a reference to the local thermo for a pure mixture
77  template<class ThermoType>
80  (
81  const word& speciesName,
82  const pureMixture<ThermoType>& globalThermo
83  ) const;
84 
85  //- Get a reference to the local thermo for a multi component mixture
86  template<class ThermoType>
89  (
90  const word& speciesName,
91  const multiComponentMixture<ThermoType>& globalThermo
92  ) const;
93 
94 
95 public:
96 
97  // Constructors
98 
99  //- Construct from components
101  (
102  const dictionary& dict,
103  const phasePair& pair
104  );
105 
106 
107  //- Destructor
109 
110 
111  // Member Functions
112 
113  //- Mass fraction difference between the interface and the field
114  virtual tmp<volScalarField> dY
115  (
116  const word& speciesName,
117  const volScalarField& Tf
118  ) const;
119 
120  //- Mass diffusivity
121  virtual tmp<volScalarField> D
122  (
123  const word& speciesName
124  ) const;
125 
126  //- Latent heat
127  virtual tmp<volScalarField> L
128  (
129  const word& speciesName,
130  const volScalarField& Tf
131  ) const;
132 
133  //- Add latent heat flow rate to total
134  virtual void addMDotL
135  (
136  const volScalarField& K,
137  const volScalarField& Tf,
138  volScalarField& mDotL,
139  volScalarField& mDotLPrime
140  ) const;
141 };
142 
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 } // End namespace Foam
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 // Instantiation for multi-component-multi-component pairs
151 #define makeInterfaceCompositionType(Type, Thermo, Comp, Mix, Phys, OtherThermo, OtherComp, OtherMix, OtherPhys)\
152  \
153  typedef Thermo<Comp, SpecieMixture<Mix<Phys>>> \
154  Type##Thermo##Comp##Mix##Phys; \
155  \
156  typedef OtherThermo<OtherComp, OtherMix<OtherPhys>> \
157  Type##Other##OtherThermo##OtherComp##OtherMix##OtherPhys; \
158  \
159  addInterfaceCompositionToRunTimeSelectionTable \
160  ( \
161  Type, \
162  Type##Thermo##Comp##Mix##Phys, \
163  Type##Other##OtherThermo##OtherComp##OtherMix##OtherPhys \
164  )
165 
166 // Instantiation for multi-component-single-component pairs
167 #define makeSpecieInterfaceCompositionType(Type, Thermo, Comp, Mix, Phys, OtherThermo, OtherComp, OtherMix, OtherPhys)\
168  \
169  typedef Thermo<Comp, SpecieMixture<Mix<Phys>>> \
170  Type##Thermo##Comp##Mix##Phys; \
171  \
172  typedef OtherThermo<OtherComp, SpecieMixture<OtherMix<OtherPhys>>> \
173  Type##Other##OtherThermo##OtherComp##OtherMix##OtherPhys; \
174  \
175  addInterfaceCompositionToRunTimeSelectionTable \
176  ( \
177  Type, \
178  Type##Thermo##Comp##Mix##Phys, \
179  Type##Other##OtherThermo##OtherComp##OtherMix##OtherPhys \
180  )
181 
182 // Addition to the run-time selection table
183 #define addInterfaceCompositionToRunTimeSelectionTable(Type, Thermo, OtherThermo)\
184  \
185  typedef Type<Thermo, OtherThermo> \
186  Type##Thermo##OtherThermo; \
187  \
188  defineTemplateTypeNameAndDebugWithName \
189  ( \
190  Type##Thermo##OtherThermo, \
191  ( \
192  word(Type##Thermo##OtherThermo::typeName_()) + "<" \
193  + word(Thermo::typeName) + "," \
194  + word(OtherThermo::typeName) + ">" \
195  ).c_str(), \
196  0 \
197  ); \
198  \
199  addToRunTimeSelectionTable \
200  ( \
201  interfaceCompositionModel, \
202  Type##Thermo##OtherThermo, \
203  dictionary \
204  )
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 #ifdef NoRepository
209  #include "InterfaceCompositionModel.C"
210 #endif
211 
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213 
214 #endif
215 
216 // ************************************************************************* //
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
const OtherThermo & otherThermo_
Other Thermo.
virtual void addMDotL(const volScalarField &K, const volScalarField &Tf, volScalarField &mDotL, volScalarField &mDotLPrime) const
Add latent heat flow rate to total.
virtual tmp< volScalarField > dY(const word &speciesName, const volScalarField &Tf) const
Mass fraction difference between the interface and the field.
Base class for interface composition models, templated on the two thermodynamic models either side of...
virtual tmp< volScalarField > D(const word &speciesName) const
Mass diffusivity.
~InterfaceCompositionModel()
Destructor.
CGAL::Exact_predicates_exact_constructions_kernel K
virtual tmp< volScalarField > L(const word &speciesName, const volScalarField &Tf) const
Latent heat.
const pureMixture< ThermoType >::thermoType & getLocalThermo(const word &speciesName, const pureMixture< ThermoType > &globalThermo) const
Get a reference to the local thermo for a pure mixture.
Generic base class for interface composition models. These models describe the composition in phase 1...
Foam::pureMixture.
Definition: pureMixture.H:49
A class for handling words, derived from string.
Definition: word.H:59
const dimensionedScalar Le_
Lewis number.
Foam::multiComponentMixture.
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
Definition: pureMixture.H:64
A class for managing temporary objects.
Definition: PtrList.H:53
InterfaceCompositionModel(const dictionary &dict, const phasePair &pair)
Construct from components.
Namespace for OpenFOAM.