twoPhaseSystem.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) 2013-2016 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::twoPhaseSystem
28
29Description
30
31SourceFiles
32 twoPhaseSystem.C
33
34\*---------------------------------------------------------------------------*/
35
36#ifndef twoPhaseSystem_H
37#define twoPhaseSystem_H
38
39#include "IOdictionary.H"
40#include "phaseModel.H"
41#include "phasePair.H"
42#include "orderedPhasePair.H"
43#include "volFields.H"
44#include "surfaceFields.H"
45#include "dragModel.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51
52class virtualMassModel;
53class heatTransferModel;
54class liftModel;
55class wallLubricationModel;
56class turbulentDispersionModel;
57
58class blendingMethod;
59template<class modelType> class BlendedInterfacialModel;
60
61/*---------------------------------------------------------------------------*\
62 Class twoPhaseSystem Declaration
63\*---------------------------------------------------------------------------*/
64
65class twoPhaseSystem
66:
67 public IOdictionary
68{
69 // Private data
70
71 //- Reference to the mesh
72 const fvMesh& mesh_;
73
74 //- Phase model 1
75 phaseModel phase1_;
76
77 //- Phase model 2
78 phaseModel phase2_;
79
80 //- Total volumetric flux
82
83 //- Dilatation term
84 volScalarField dgdt_;
85
86 //- Optional dispersion diffusivity
87 tmp<surfaceScalarField> pPrimeByA_;
88
89 //- Unordered phase pair
90 autoPtr<phasePair> pair_;
91
92 //- Phase pair for phase 1 dispersed in phase 2
93 autoPtr<orderedPhasePair> pair1In2_;
94
95 //- Phase pair for phase 2 dispersed in phase 1
96 autoPtr<orderedPhasePair> pair2In1_;
97
98 //- Blending methods
99 HashTable<autoPtr<blendingMethod>> blendingMethods_;
100
101 //- Drag model
102 autoPtr<BlendedInterfacialModel<dragModel>> drag_;
103
104 //- Virtual mass model
105 autoPtr<BlendedInterfacialModel<virtualMassModel>> virtualMass_;
106
107 //- Heat transfer model
108 autoPtr<BlendedInterfacialModel<heatTransferModel>> heatTransfer_;
109
110 //- Lift model
111 autoPtr<BlendedInterfacialModel<liftModel>> lift_;
112
113 //- Wall lubrication model
114 autoPtr<BlendedInterfacialModel<wallLubricationModel>>
115 wallLubrication_;
116
117 //- Wall lubrication model
118 autoPtr<BlendedInterfacialModel<turbulentDispersionModel>>
119 turbulentDispersion_;
120
121
122 // Private member functions
123
124 //- Return the mixture flux
125 tmp<surfaceScalarField> calcPhi() const;
126
127
128public:
129
130 // Constructors
131
132 //- Construct from fvMesh
133 twoPhaseSystem(const fvMesh&, const dimensionedVector& g);
134
135
136 //- Destructor
137 virtual ~twoPhaseSystem();
138
139
140 // Member Functions
141
142 //- Return the mixture density
143 tmp<volScalarField> rho() const;
144
145 //- Return the mixture velocity
146 tmp<volVectorField> U() const;
147
148 //- Return the drag coefficient
149 tmp<volScalarField> Kd() const;
150
151 //- Return the face drag coefficient
153
154 //- Return the virtual mass coefficient
155 tmp<volScalarField> Vm() const;
156
157 //- Return the face virtual mass coefficient
159
160 //- Return the heat transfer coefficient
161 tmp<volScalarField> Kh() const;
162
163 //- Return the combined force (lift + wall-lubrication)
164 tmp<volVectorField> F() const;
165
166 //- Return the combined face-force (lift + wall-lubrication)
168
169 //- Return the turbulent diffusivity
170 // Multiplies the phase-fraction gradient
171 tmp<volScalarField> D() const;
172
173 //- Solve for the two-phase-fractions
174 void solve();
175
176 //- Correct two-phase properties other than turbulence
177 void correct();
178
179 //- Correct two-phase turbulence
180 void correctTurbulence();
181
182 //- Read base phaseProperties dictionary
183 bool read();
184
185 // Access
186
187 //- Access a sub model between a phase pair
188 template<class modelType>
189 const modelType& lookupSubModel(const phasePair& key) const;
190
191 //- Access a sub model between two phases
192 template<class modelType>
193 const modelType& lookupSubModel
194 (
195 const phaseModel& dispersed,
196 const phaseModel& continuous
197 ) const;
198
199 //- Return the surface tension coefficient
200 const dimensionedScalar& sigma() const;
201
202 //- Return the mesh
203 inline const fvMesh& mesh() const;
204
205 //- Return phase model 1
206 inline const phaseModel& phase1() const;
207
208 //- Return non-const access to phase model 1
209 inline phaseModel& phase1();
210
211 //- Return phase model 2
212 inline const phaseModel& phase2() const;
213
214 //- Return non-const access to phase model 2
215 inline phaseModel& phase2();
216
217 //- Return the phase not given as an argument
218 inline const phaseModel& otherPhase(const phaseModel& phase) const;
219
220 //- Return the mixture flux
221 inline const surfaceScalarField& phi() const;
222
223 //- Return non-const access to the mixture flux
224 inline surfaceScalarField& phi();
225
226 //- Return the dilatation term
227 inline const volScalarField& dgdt() const;
228
229 //- Return non-const access to the dilatation parameter
230 inline volScalarField& dgdt();
231
232 //- Return non-const access to the dispersion diffusivity
234};
235
236
237// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238
239} // End namespace Foam
240
241// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
242
243#include "twoPhaseSystemI.H"
244
245// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
246
247#ifdef NoRepository
249#endif
250
251// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
252
253#endif
254
255// ************************************************************************* //
const uniformDimensionedVectorField & g
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phaseModel.H:61
Description for mass transfer between a pair of phases. The direction of the mass transfer is from th...
Definition: phasePair.H:56
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phase.H:57
A class for managing temporary objects.
Definition: tmp.H:65
tmp< surfaceScalarField > Ff() const
Return the combined face-force (lift + wall-lubrication)
tmp< volVectorField > F() const
Return the combined force (lift + wall-lubrication)
const phaseModel & phase2() const
Return phase model 2.
const phaseModel & otherPhase(const phaseModel &phase) const
Return the phase not given as an argument.
tmp< volScalarField > D() const
Return the turbulent diffusivity.
virtual ~twoPhaseSystem()
Destructor.
const surfaceScalarField & phi() const
Return the mixture flux.
tmp< volScalarField > Kd() const
Return the drag coefficient.
void correct()
Correct two-phase properties other than turbulence.
virtual ~twoPhaseSystem()
Destructor.
phaseModel & phase1_
Phase model 1.
tmp< surfaceScalarField > Kdf() const
Return the face drag coefficient.
tmp< surfaceScalarField > Vmf() const
Return the face virtual mass coefficient.
tmp< volScalarField > Vm() const
Return the virtual mass coefficient.
tmp< volVectorField > U() const
Return the mixture velocity.
const volScalarField & dgdt() const
Return the dilatation term.
const modelType & lookupSubModel(const phasePair &key) const
Access a sub model between a phase pair.
phaseModel & phase2_
Phase model 2.
tmp< surfaceScalarField > & pPrimeByA()
Return non-const access to the dispersion diffusivity.
tmp< surfaceScalarField > Kdf() const
Return the face drag coefficient.
tmp< volScalarField > Kd() const
Return the drag coefficient.
void correctTurbulence()
Correct two-phase turbulence.
const phaseModel & otherPhase(const phaseModel &phase) const
Return the phase not given as an argument.
phaseModel & phase1()
Return non-const access to phase model 1.
phaseModel & phase2()
Return non-const access to phase model 2.
const dimensionedScalar & sigma() const
Return the surface tension coefficient.
const phaseModel & phase1() const
Return phase model 1.
const fvMesh & mesh() const
Return the mesh.
tmp< volScalarField > sigma() const
Return the surface tension coefficient.
tmp< volScalarField > rho() const
Return the mixture density.
const modelType & lookupSubModel(const phaseModel &dispersed, const phaseModel &continuous) const
Access a sub model between two phases.
twoPhaseSystem(const fvMesh &)
Construct from fvMesh.
const phaseModel & phase1() const
Return phase model 1.
const phaseModel & phase2() const
Return phase model 2.
tmp< volScalarField > Kh() const
Return the heat transfer coefficient.
void solve()
Solve for the two-phase-fractions.
bool read()
Read base phaseProperties dictionary.
tmp< volScalarField > Vm() const
Return the virtual mass coefficient.
Namespace for OpenFOAM.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:82
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Foam::surfaceFields.