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) 2017-2021 OpenCFD Ltd.
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  Generic base class for interface models. Mass transfer models are
31  interface models between two thermos.
32  Abstract class for mass transfer functions
33 
34 SourceFiles
35  interfaceCompositionModel.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef interfaceCompositionModel_H
40 #define interfaceCompositionModel_H
41 
42 #include "volFields.H"
43 #include "dictionary.H"
44 #include "Enum.H"
45 #include "runTimeSelectionTables.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 // Forward Declarations
53 class phaseModel;
54 class phasePair;
55 
56 /*---------------------------------------------------------------------------*\
57  Class interfaceCompositionModel Declaration
58 \*---------------------------------------------------------------------------*/
59 
61 {
62 public:
63 
64  // Public Types
65 
66  //- Enumeration for variable based mass transfer models
67  enum modelVariable
68  {
69  T, /* temperature based */
70  P, /* pressure based */
71  Y, /* mass fraction based */
72  alpha /* alpha source */
73  };
74 
75 protected:
76 
77  // Protected Data
78 
79  //- Selection names for the modelVariable
81 
82  //- Enumeration for the model variable
84 
85  //- Add volume change in pEq
86  bool includeVolChange_;
87 
88  //- Phase pair
89  const phasePair& pair_;
90 
91  //- Names of the transferring specie
93 
94  //- Reference to mesh
95  const fvMesh& mesh_;
96 
97 
98 public:
99 
100  //- Runtime type information
101  TypeName("interfaceCompositionModel");
102 
103 
104  // Declare runtime construction
105 
107  (
108  autoPtr,
110  dictionary,
111  (
112  const dictionary& dict,
113  const phasePair& pair
114  ),
115  (dict, pair)
116  );
117 
118 
119  // Constructors
120 
121  //- Construct from a dictionary and a phase pair
123  (
124  const dictionary& dict,
125  const phasePair& pair
126  );
127 
128 
129  //- Destructor
130  virtual ~interfaceCompositionModel() = default;
131 
132 
133  // Selectors
134 
136  (
137  const dictionary& dict,
138  const phasePair& pair
139  );
140 
141 
142  // Member Functions
143 
144  //- Return the transferring species name
145  const word transferSpecie() const;
146 
147  //- The phase pair
148  const phasePair& pair() const;
149 
150  //- Interface mass fraction
151  virtual tmp<volScalarField> Yf
152  (
153  const word& speciesName,
154  const volScalarField& Tf
155  ) const = 0;
156 
157  //- Mass fraction difference between the interface and the field
158  virtual tmp<volScalarField> dY
159  (
160  const word& speciesName,
161  const volScalarField& Tf
162  ) const = 0;
163 
164  //- Mass diffusivity
165  virtual tmp<volScalarField> D
166  (
167  const word& speciesName
168  ) const = 0;
169 
170  //- Latent heat (delta Hc)
171  virtual tmp<volScalarField> L
172  (
173  const word& speciesName,
174  const volScalarField& Tf
175  ) const = 0;
176 
177  //- Explicit full mass transfer
178  virtual tmp<volScalarField> Kexp
179  (
180  const volScalarField& field
181  ) = 0;
182 
183  //- Implicit mass transfer
184  virtual tmp<volScalarField> KSp
185  (
186  label modelVariable,
187  const volScalarField& field
188  ) = 0;
189 
190  //- Explicit mass transfer
191  virtual tmp<volScalarField> KSu
192  (
193  label modelVariable,
194  const volScalarField& field
195  ) = 0;
196 
197  //- Reference value
198  virtual const dimensionedScalar& Tactivate() const noexcept = 0;
199 
200  //- Add/subtract alpha*div(U) as a source term
201  //- for alpha, substituting div(U) = mDot(1/rho1 - 1/rho2)
202  virtual bool includeDivU() const noexcept;
203 
204  //- Add volume change in pEq
205  bool includeVolChange();
206 
207  //- Returns the variable on which the model is based
208  const word& variable() const;
209 };
210 
211 
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213 
214 } // End namespace Foam
215 
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217 
218 #endif
219 
220 // ************************************************************************* //
volFields.H
Foam::phasePair
Description for mass transfer between a pair of phases. The direction of the mass transfer is from th...
Definition: phasePair.H:53
Foam::interfaceCompositionModel::New
static autoPtr< interfaceCompositionModel > New(const dictionary &dict, const phasePair &pair)
Definition: interfaceCompositionModel.C:79
Foam::Enum< modelVariable >
Foam::interfaceCompositionModel::Kexp
virtual tmp< volScalarField > Kexp(const volScalarField &field)=0
Explicit full mass transfer.
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::interfaceCompositionModel::~interfaceCompositionModel
virtual ~interfaceCompositionModel()=default
Destructor.
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::interfaceCompositionModel::D
virtual tmp< volScalarField > D(const word &speciesName) const =0
Mass diffusivity.
Foam::interfaceCompositionModel::pair
const phasePair & pair() const
The phase pair.
Definition: interfaceCompositionModel.C:122
Foam::interfaceCompositionModel::includeVolChange_
bool includeVolChange_
Add volume change in pEq.
Definition: interfaceCompositionModel.H:85
Foam::interfaceCompositionModel::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, interfaceCompositionModel, dictionary,(const dictionary &dict, const phasePair &pair),(dict, pair))
Foam::interfaceCompositionModel::modelVariableNames_
static const Enum< modelVariable > modelVariableNames_
Selection names for the modelVariable.
Definition: interfaceCompositionModel.H:79
Foam::interfaceCompositionModel::P
Definition: interfaceCompositionModel.H:69
Foam::interfaceCompositionModel::mesh_
const fvMesh & mesh_
Reference to mesh.
Definition: interfaceCompositionModel.H:94
Foam::interfaceCompositionModel::transferSpecie
const word transferSpecie() const
Return the transferring species name.
Definition: interfaceCompositionModel.C:116
Foam::interfaceCompositionModel::dY
virtual tmp< volScalarField > dY(const word &speciesName, const volScalarField &Tf) const =0
Mass fraction difference between the interface and the field.
Foam::interfaceCompositionModel
Generic base class for interface models. Mass transfer models are interface models between two thermo...
Definition: interfaceCompositionModel.H:59
Foam::interfaceCompositionModel::speciesName_
word speciesName_
Names of the transferring specie.
Definition: interfaceCompositionModel.H:91
Foam::interfaceCompositionModel::L
virtual tmp< volScalarField > L(const word &speciesName, const volScalarField &Tf) const =0
Latent heat (delta Hc)
Foam::interfaceCompositionModel::TypeName
TypeName("interfaceCompositionModel")
Runtime type information.
Foam::interfaceCompositionModel::pair_
const phasePair & pair_
Phase pair.
Definition: interfaceCompositionModel.H:88
field
rDeltaTY field()
Foam::interfaceCompositionModel::includeDivU
virtual bool includeDivU() const noexcept
Definition: interfaceCompositionModel.C:134
Foam::interfaceCompositionModel::KSu
virtual tmp< volScalarField > KSu(label modelVariable, const volScalarField &field)=0
Explicit mass transfer.
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::interfaceCompositionModel::includeVolChange
bool includeVolChange()
Add volume change in pEq.
Definition: interfaceCompositionModel.C:140
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::dimensioned< scalar >
Foam::interfaceCompositionModel::alpha
Definition: interfaceCompositionModel.H:71
Foam::interfaceCompositionModel::variable
const word & variable() const
Returns the variable on which the model is based.
Definition: interfaceCompositionModel.C:128
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::interfaceCompositionModel::KSp
virtual tmp< volScalarField > KSp(label modelVariable, const volScalarField &field)=0
Implicit mass transfer.
Foam::interfaceCompositionModel::Tactivate
virtual const dimensionedScalar & Tactivate() const noexcept=0
Reference value.
Foam::interfaceCompositionModel::modelVariable_
modelVariable modelVariable_
Enumeration for the model variable.
Definition: interfaceCompositionModel.H:82
Foam::interfaceCompositionModel::modelVariable
modelVariable
Enumeration for variable based mass transfer models.
Definition: interfaceCompositionModel.H:66
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::interfaceCompositionModel::interfaceCompositionModel
interfaceCompositionModel(const dictionary &dict, const phasePair &pair)
Construct from a dictionary and a phase pair.
Definition: interfaceCompositionModel.C:54
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::interfaceCompositionModel::T
Definition: interfaceCompositionModel.H:68
Foam::interfaceCompositionModel::Yf
virtual tmp< volScalarField > Yf(const word &speciesName, const volScalarField &Tf) const =0
Interface mass fraction.
dictionary.H
Foam::interfaceCompositionModel::Y
Definition: interfaceCompositionModel.H:70
Foam::GeometricField< scalar, fvPatchField, volMesh >
Enum.H