phasePair.C
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) 2014-2018 OpenFOAM Foundation
9  Copyright (C) 2018 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "phasePair.H"
30 #include "phaseSystem.H"
31 #include "surfaceTensionModel.H"
32 
33 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
34 
35 Foam::tmp<Foam::volScalarField> Foam::phasePair::EoH
36 (
37  const volScalarField& d
38 ) const
39 {
40  return
41  mag(dispersed().rho() - continuous().rho())
42  *mag(g())
43  *sqr(d)
44  /sigma();
45 }
46 
47 
48 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
49 
51 (
52  const phaseModel& phase1,
53  const phaseModel& phase2,
54  const bool ordered
55 )
56 :
57  phasePairKey(phase1.name(), phase2.name(), ordered),
58  phase1_(phase1),
59  phase2_(phase2),
60  g_(phase1.mesh().time().lookupObject<uniformDimensionedVectorField>("g"))
61 {}
62 
63 
64 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
65 
67 {}
68 
69 
70 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
71 
73 {
75  << "Requested dispersed phase from an unordered pair."
76  << exit(FatalError);
77 
78  return phase1_;
79 }
80 
81 
83 {
85  << "Requested continuous phase from an unordered pair."
86  << exit(FatalError);
87 
88  return phase1_;
89 }
90 
91 
93 {
94  word name2(second());
95  name2[0] = toupper(name2[0]);
96  return first() + "And" + name2;
97 }
98 
99 
101 {
102  word name1(first());
103  name1[0] = toupper(name1[0]);
104  return second() + "And" + name1;
105 }
106 
107 
109 {
110  return phase1()*phase1().rho() + phase2()*phase2().rho();
111 }
112 
113 
115 {
116  return mag(phase1().U() - phase2().U());
117 }
118 
119 
121 {
122  return dispersed().U() - continuous().U();
123 }
124 
125 
127 {
128  return magUr()*dispersed().d()/continuous().nu();
129 }
130 
131 
133 {
134  return
135  continuous().nu()
136  *continuous().thermo().Cpv()
137  *continuous().rho()
138  /continuous().kappa();
139 }
140 
141 
143 {
144  return EoH(dispersed().d());
145 }
146 
147 
149 {
150  return
151  EoH
152  (
153  dispersed().d()
154  *cbrt(1 + 0.163*pow(Eo(), 0.757))
155  );
156 }
157 
158 
160 {
161  return
162  EoH
163  (
164  dispersed().d()
165  /cbrt(E())
166  );
167 }
168 
169 
171 {
172  return
174  (
175  phasePair(phase1(), phase2())
176  ).sigma();
177 }
178 
179 
181 {
182  return
183  mag(g())
184  *continuous().nu()
185  *pow3
186  (
187  continuous().nu()
188  *continuous().rho()
189  /sigma()
190  );
191 }
192 
193 
195 {
196  return Re()*pow(Mo(), 0.23);
197 }
198 
199 
201 {
203  << "Requested aspect ratio of the dispersed phase in an unordered pair"
204  << exit(FatalError);
205 
206  return phase1();
207 }
208 
209 
210 // ************************************************************************* //
Foam::phasePair::Pr
tmp< volScalarField > Pr() const
Prandtl number.
Definition: phasePair.C:132
Foam::phaseModel
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phaseModel.H:54
phasePair.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::phasePair::otherName
virtual word otherName() const
Other pair name.
Definition: phasePair.C:100
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::phasePair::Re
tmp< volScalarField > Re() const
Reynolds number.
Definition: phasePair.C:126
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::surfaceTensionModel
Abstract base-class for surface tension models which return the surface tension coefficient field.
Definition: surfaceTensionModel.H:55
Foam::phasePair::dispersed
virtual const phaseModel & dispersed() const
Dispersed phase.
Definition: phasePair.C:72
Foam::phasePair::Ur
tmp< volVectorField > Ur() const
Relative velocity.
Definition: phasePair.C:120
Foam::phasePair::sigma
tmp< volScalarField > sigma() const
Surface tension coefficient.
Definition: phasePair.C:170
Foam::phasePair::Ta
tmp< volScalarField > Ta() const
Takahashi Number.
Definition: phasePair.C:194
Foam::phaseSystem::lookupSubModel
const modelType & lookupSubModel(const phasePair &key) const
Access a sub model between a phase pair.
Definition: phaseSystemTemplates.H:179
Foam::phasePair::g
const uniformDimensionedVectorField & g() const
Return gravitation acceleration.
Definition: phasePairI.H:93
rho
rho
Definition: readInitialConditions.H:88
nu
volScalarField & nu
Definition: readMechanicalProperties.H:176
Foam::pow3
dimensionedScalar pow3(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:89
Foam::uniformDimensionedVectorField
UniformDimensionedField< vector > uniformDimensionedVectorField
Definition: uniformDimensionedFields.H:50
Foam::phasePair::~phasePair
virtual ~phasePair()=default
Destructor.
Definition: phasePair.C:66
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
Foam::pow
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Definition: dimensionedScalar.C:75
Foam::phasePair::Eo
tmp< volScalarField > Eo() const
Eotvos number.
Definition: phasePair.C:142
phase2
phaseModel & phase2
Definition: setRegionFluidFields.H:6
Foam::FatalError
error FatalError
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
g
const uniformDimensionedVectorField & g
Definition: createFluidFields.H:26
Foam::phasePair::rho
tmp< volScalarField > rho() const
Average density.
Definition: phasePair.C:108
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
U
U
Definition: pEqn.H:72
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
Foam::sqr
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Definition: dimensionedSymmTensor.C:51
Foam::mag
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Foam::phasePair::name
virtual word name() const
Pair name.
Definition: phasePair.C:69
Foam::Re
scalarField Re(const UList< complex > &cf)
Extract real component.
Definition: complexField.C:159
Foam::phaseModel::fluid
const phaseSystem & fluid() const
Return the system to which this phase belongs.
Definition: phaseModel.C:100
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::phasePair::E
virtual tmp< volScalarField > E() const
Aspect ratio.
Definition: phasePair.C:200
Foam::phasePair::magUr
tmp< volScalarField > magUr() const
Relative velocity magnitude.
Definition: phasePair.C:114
Foam::phaseModel::rho
const dimensionedScalar & rho() const
Definition: phaseModel.H:167
sigma
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
phase1
phaseModel & phase1
Definition: setRegionFluidFields.H:5
Foam::phasePair::Mo
tmp< volScalarField > Mo() const
Morton Number.
Definition: phasePair.C:180
Foam::cbrt
dimensionedScalar cbrt(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:155
Foam::phasePair::continuous
virtual const phaseModel & continuous() const
Continuous phase.
Definition: phasePair.C:82
Foam::phasePair::EoH2
tmp< volScalarField > EoH2() const
Eotvos number based on hydraulic diameter type 2.
Definition: phasePair.C:159
Foam::phasePair::EoH1
tmp< volScalarField > EoH1() const
Eotvos number based on hydraulic diameter type 1.
Definition: phasePair.C:148
Foam::phasePair::phasePair
phasePair(const phaseModel &phase1, const phaseModel &phase2, const bool ordered=false)
Construct from two phases.
Definition: phasePair.C:35