interfaceCompositionModel.H
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-2026 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  Generic base class for interface composition models. These models describe
29  the composition in phase 1 of the supplied pair at the interface with phase
30  2.
31 
32 SourceFiles
33  interfaceCompositionModel.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef interfaceCompositionModel_H
38 #define interfaceCompositionModel_H
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 #include "volFields.H"
43 #include "dictionary.H"
44 #include "hashedWordList.H"
46 #include "runTimeSelectionTables.H"
47 #include "sidedPhaseInterface.H"
48 #include "SidedInterfacialModel.H"
49 
50 namespace Foam
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class interfaceCompositionModel Declaration
55 \*---------------------------------------------------------------------------*/
56 
58 {
59  // Private data
60 
61  //- Interface
62  const sidedPhaseInterface interface_;
63 
64  //- Names of the transferring species
65  const hashedWordList species_;
66 
67  //- Lewis number
68  const dimensionedScalar Le_;
69 
70  //- Multi-component thermo model for this side of the interface
71  const rhoFluidMulticomponentThermo& thermo_;
72 
73  //- General thermo model for the other side of the interface
74  const rhoThermo& otherThermo_;
75 
76 
77 public:
78 
79  //- Runtime type information
80  TypeName("interfaceCompositionModel");
81 
82 
83  // Declare runtime construction
84 
86  (
87  autoPtr,
89  dictionary,
90  (
91  const dictionary& dict,
93  ),
94  (dict, interface)
95  );
96 
97 
98  // Constructors
99 
100  //- Construct from a dictionary and an interface
102  (
103  const dictionary& dict,
105  );
106 
107 
108  //- Destructor
109  virtual ~interfaceCompositionModel();
110 
111 
112  // Selectors
113 
115  (
116  const dictionary& dict,
117  const phaseInterface& interface,
118  const bool outer = false
119  );
120 
122  (
123  const UPtrList<const dictionary>& subDicts,
125  );
126 
127 
128  // Member Functions
129 
130  // Access
131 
132  //- Return the interface
133  inline const sidedPhaseInterface& interface() const;
134 
135  //- Return the transferring species names
136  inline const hashedWordList& species() const;
137 
138  //- Return the thermo
139  inline const rhoFluidMulticomponentThermo& thermo() const;
140 
141  //- Return the other thermo
142  inline const rhoThermo& otherThermo() const;
143 
144  //- Return the other multicomponent thermo
145  inline const rhoFluidMulticomponentThermo&
147 
148 
149  // Evaluation
150 
151  //- Interface mass fraction
152  virtual tmp<volScalarField> Yf
153  (
154  const word& speciesName,
155  const volScalarField& Tf
156  ) const = 0;
157 
158  //- The interface mass fraction derivative w.r.t. temperature
160  (
161  const word& speciesName,
162  const volScalarField& Tf
163  ) const = 0;
164 
165  //- Mass fraction difference between the interface and the field
167  (
168  const word& speciesName,
169  const volScalarField& Tf
170  ) const;
171 
172  //- Mass fraction difference between the interface and the field
173  // derivative w.r.t. temperature
175  (
176  const word& speciesName,
177  const volScalarField& Tf
178  ) const;
179 
180  //- Mass diffusivity
182  (
183  const word& speciesName
184  ) const;
185 
186 
187  //- Update the composition
188  virtual void update(const volScalarField& Tf) = 0;
189 };
190 
191 
192 /*---------------------------------------------------------------------------*\
193  Class sidedInterfaceCompositionModel Declaration
194 \*---------------------------------------------------------------------------*/
195 
197 :
198  public SidedInterfacialModel<interfaceCompositionModel>
199 {
200 public:
201 
202  // Constructors
203 
204  //- Inherit base class constructors
205  using
208 
209 
210  // Selectors
211 
213  (
214  const UPtrList<const dictionary>& subDicts,
216  )
217  {
219  (
221  );
222  }
223 };
224 
225 
226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
227 
228 } // End namespace Foam
229 
230 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
231 
233 
234 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235 
236 #endif
237 
238 // ************************************************************************* //
Generic GeometricField class.
Wrapper class for interfacial models for which two instances of the model are used per interface; one...
const phaseInterface & interface() const
Access the interface.
SidedInterfacialModel(const UPtrList< const dictionary > &subDicts, const phaseInterface &interface, const Args &... args)
Construct from a dictionary and an interface.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: UPtrList.H:66
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
A wordList with hashed indices for faster lookup by name.
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.
declareRunTimeSelectionTable(autoPtr, interfaceCompositionModel, dictionary,(const dictionary &dict, const phaseInterface &interface),(dict, interface))
const sidedPhaseInterface & interface() const
Return the interface.
virtual tmp< volScalarField > Yf(const word &speciesName, const volScalarField &Tf) const =0
Interface mass fraction.
virtual void update(const volScalarField &Tf)=0
Update the composition.
tmp< volScalarField > dYfPrime(const word &speciesName, const volScalarField &Tf) const
Mass fraction difference between the interface and the field.
const rhoFluidMulticomponentThermo & thermo() const
Return the thermo.
TypeName("interfaceCompositionModel")
Runtime type information.
const rhoThermo & otherThermo() const
Return the other thermo.
static autoPtr< interfaceCompositionModel > New(const dictionary &dict, const phaseInterface &interface, const bool outer=false)
const hashedWordList & species() const
Return the transferring species names.
virtual tmp< volScalarField > YfPrime(const word &speciesName, const volScalarField &Tf) const =0
The interface mass fraction derivative w.r.t. temperature.
const rhoFluidMulticomponentThermo & otherMulticomponentThermo() const
Return the other multicomponent thermo.
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.
Base-class for thermodynamic properties based on density.
Definition: rhoThermo.H:54
static autoPtr< sidedInterfaceCompositionModel > New(const UPtrList< const dictionary > &subDicts, const phaseInterface &interface)
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:63
Namespace for OpenFOAM.
void outer(GeometricField< typename outerProduct< Type1, Type2 >::type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type1, GeoMesh, PrimitiveField2 > &gf1, const GeometricField< Type2, GeoMesh, PrimitiveField3 > &gf2)
Macros to ease declaration of run-time selection tables.
dictionary dict