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 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 transer 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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 #include "volFields.H"
45 #include "dictionary.H"
46 #include "runTimeSelectionTables.H"
47 #include "Enum.H"
48 
49 namespace Foam
50 {
51 
52 class phaseModel;
53 class phasePair;
54 
55 /*---------------------------------------------------------------------------*\
56  Class interfaceCompositionModel Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 class interfaceCompositionModel
60 {
61 public:
62 
63  // Public type
64 
65  //- Enumeration for variable based mass transfer models
66  enum modelVariable
67  {
68  T, /* temperature based */
69  P, /* pressure based */
70  Y /* mass fraction based */
71  };
72 
74 
75  //- Enumeration for model variables
77 
78 
79 protected:
80 
81  // Protected data
82 
83  //- Phase pair
84  const phasePair& pair_;
85 
86  //- Names of the transferring specie
88 
89  //- Reference to mesh
90  const fvMesh& mesh_;
91 
92 
93 public:
94 
95  //- Runtime type information
96  TypeName("interfaceCompositionModel");
97 
98 
99  // Declare runtime construction
100 
102  (
103  autoPtr,
105  dictionary,
106  (
107  const dictionary& dict,
108  const phasePair& pair
109  ),
110  (dict, pair)
111  );
112 
113 
114  // Constructors
115 
116  //- Construct from a dictionary and a phase pair
118  (
119  const dictionary& dict,
120  const phasePair& pair
121  );
122 
123 
124  //- Destructor
125  virtual ~interfaceCompositionModel() = default;
126 
127 
128  // Selectors
129 
131  (
132  const dictionary& dict,
133  const phasePair& pair
134  );
135 
136 
137  // Member Functions
138 
139 
140  //- Return the transferring species name
141  const word transferSpecie() const;
142 
143  //- Return pair
144  const phasePair& pair() const;
145 
146  //- Interface mass fraction
147  virtual tmp<volScalarField> Yf
148  (
149  const word& speciesName,
150  const volScalarField& Tf
151  ) const = 0;
152 
153  //- Mass fraction difference between the interface and the field
154  virtual tmp<volScalarField> dY
155  (
156  const word& speciesName,
157  const volScalarField& Tf
158  ) const = 0;
159 
160  //- Mass diffusivity
161  virtual tmp<volScalarField> D
162  (
163  const word& speciesName
164  ) const = 0;
165 
166  //- Latent heat (delta Hc)
167  virtual tmp<volScalarField> L
168  (
169  const word& speciesName,
170  const volScalarField& Tf
171  ) const = 0;
172 
173  //- Explicit mass transfer coefficient
174  virtual tmp<volScalarField> Kexp
175  (
177  const volScalarField& field
178  ) = 0;
179 
180  //- Reference value
181  virtual const dimensionedScalar& Tactivate() const = 0;
182 
183  //- Returns the variable on which the model is based
184  const word variable() const;
185 };
186 
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 } // End namespace Foam
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 #endif
195 
196 // ************************************************************************* //
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:51
Foam::interfaceCompositionModel::New
static autoPtr< interfaceCompositionModel > New(const dictionary &dict, const phasePair &pair)
Definition: newInterfaceCompositionModel.C:37
Foam::Enum< modelVariable >
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::interfaceCompositionModel::~interfaceCompositionModel
virtual ~interfaceCompositionModel()=default
Destructor.
Foam::tmp< volScalarField >
Foam::interfaceCompositionModel::D
virtual tmp< volScalarField > D(const word &speciesName) const =0
Mass diffusivity.
Foam::interfaceCompositionModel::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, interfaceCompositionModel, dictionary,(const dictionary &dict, const phasePair &pair),(dict, pair))
Foam::interfaceCompositionModel::Kexp
virtual tmp< volScalarField > Kexp(label modelVariable, const volScalarField &field)=0
Explicit mass transfer coefficient.
Foam::interfaceCompositionModel::variable
const word variable() const
Returns the variable on which the model is based.
Foam::interfaceCompositionModel::P
Definition: interfaceCompositionModel.H:68
Foam::interfaceCompositionModel::mesh_
const fvMesh & mesh_
Reference to mesh.
Definition: interfaceCompositionModel.H:89
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 composition models. These models describe the composition in phase 1...
Definition: interfaceCompositionModel.H:58
Foam::interfaceCompositionModel::pair
const phasePair & pair() const
Return pair.
Foam::interfaceCompositionModel::speciesName_
word speciesName_
Names of the transferring specie.
Definition: interfaceCompositionModel.H:86
Foam::interfaceCompositionModel::L
virtual tmp< volScalarField > L(const word &speciesName, const volScalarField &Tf) const =0
Latent heat.
Foam::label
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:62
Foam::interfaceCompositionModel::TypeName
TypeName("interfaceCompositionModel")
Runtime type information.
Foam::interfaceCompositionModel::pair_
const phasePair & pair_
Phase pair.
Definition: interfaceCompositionModel.H:65
field
rDeltaTY field()
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::interfaceCompositionModel::modelVariableNames
static const Enum< modelVariable > modelVariableNames
Definition: interfaceCompositionModel.H:72
Foam::dimensioned< scalar >
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:84
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::interfaceCompositionModel::Tactivate
virtual const dimensionedScalar & Tactivate() const =0
Reference value.
Foam::interfaceCompositionModel::modelVariable_
modelVariable modelVariable_
Enumeration for model variables.
Definition: interfaceCompositionModel.H:75
Foam::interfaceCompositionModel::transferSpecie
const word transferSpecie() const
Return the transferring species name.
Foam::interfaceCompositionModel::modelVariable
modelVariable
Enumeration for variable based mass transfer models.
Definition: interfaceCompositionModel.H:65
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:44
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::interfaceCompositionModel::T
Definition: interfaceCompositionModel.H:67
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:69
Foam::GeometricField< scalar, fvPatchField, volMesh >
Enum.H