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