MassTransferPhaseSystem.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-2022 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::MassTransferPhaseSystem
28 
29 Description
30  Class for mass transfer between phases
31 
32 SourceFiles
33  MassTransferPhaseSystem.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef Foam_multiphaseInter_MassTransferPhaseSystem_H
38 #define Foam_multiphaseInter_MassTransferPhaseSystem_H
39 
40 #include "multiphaseInterSystem.H"
41 #include "HashPtrTable.H"
42 #include "interfaceCompositionModel.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 using namespace multiphaseInter;
50 
51 /*---------------------------------------------------------------------------*\
52  Class MassTransferPhaseSystem Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 template<class BasePhaseSystem>
57 :
58  public BasePhaseSystem
59 {
60 public:
61 
62  // Public typedefs
63 
64  typedef
65  HashTable
66  <
70  >
72 
73 
75 
76 protected:
77 
78  // Protected typedefs
79 
80  typedef
82  <
86  >
87  dmdtTable;
88 
89 
90  // Protected Data
91 
92  //- Overall inter-phase mass transfer rates [Kg/s]
93  dmdtTable dmdt_;
94 
95  //- Mass transfer models
96  massTransferModelTable massTransferModels_;
97 
98 
99  // Protected Member Functions
100 
101  //- Calculate L between phases
102  tmp<volScalarField> calculateL
103  (
104  const volScalarField& dmdtNetki,
105  const phasePairKey& keyik,
106  const phasePairKey& keyki,
107  const volScalarField& T
108  ) const;
109 
110 
111 public:
112 
113  // Constructors
114 
115  //- Construct from fvMesh
116  explicit MassTransferPhaseSystem(const fvMesh&);
117 
118 
119  //- Destructor
120  virtual ~MassTransferPhaseSystem() = default;
121 
122 
123  // Member Functions
124 
125  //- Return total interfacial mass flow rate
126  tmp<volScalarField> dmdt(const phasePairKey& key) const;
127 
128 
129  // Mass transfer functions
130 
131  //- Return the heat transfer matrix
132  // NOTE: Call KSu and KSp with T as variable,if not provided uses dmdt.
133  virtual tmp<fvScalarMatrix> heatTransfer(const volScalarField& T);
134 
135  //- Return the volumetric rate transfer matrix
136  // NOTE: Call KSu and KSp with p as variable,if not provided uses dmdt.
137  virtual tmp<fvScalarMatrix> volTransfer(const volScalarField& p);
138 
139  //- Correct/calculates mass sources dmdt for phases
140  // NOTE: Call the kexp() for all the mass transfer models.
141  virtual void correctMassSources(const volScalarField& T);
142 
143  //- Calculate mass transfer for alpha's
144  virtual void alphaTransfer(SuSpTable& Su, SuSpTable& Sp);
145 
146  //- Calculate mass transfer for species
147  virtual void massSpeciesTransfer
148  (
149  const Foam::phaseModel& phase,
152  const word speciesName
153  );
154 
155  //- Add volume change in pEq
156  virtual bool includeVolChange();
157 };
158 
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 } // End namespace Foam
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #ifdef NoRepository
167 # include "MassTransferPhaseSystem.C"
168 #endif
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 #endif
173 
174 // ************************************************************************* //
Class for mass transfer between phases.
zeroField Su
Definition: alphaSuSp.H:1
A HashTable of pointers to objects of type <T>, with deallocation management of the pointers...
Definition: HashPtrTable.H:51
Hashing functor for phasePairKey.
Definition: phasePairKey.H:138
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:81
A class for handling words, derived from Foam::string.
Definition: word.H:63
A HashTable similar to std::unordered_map.
Definition: HashTable.H:108
An ordered or unorder pair of phase names. Typically specified as follows.
Definition: phasePairKey.H:61
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
Definition: foamGltfBase.H:103
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phase.H:50
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
volScalarField & p
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phaseModel.H:53
Namespace for OpenFOAM.
zeroField Sp
Definition: alphaSuSp.H:2