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-2015 OpenFOAM Foundation
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 \*---------------------------------------------------------------------------*/
27 
28 #include "phasePair.H"
29 
30 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
31 
32 Foam::tmp<Foam::volScalarField> Foam::phasePair::EoH
33 (
34  const volScalarField& d
35 ) const
36 {
37  return
38  mag(dispersed().rho() - continuous().rho())
39  *mag(g())
40  *sqr(d)
41  /sigma();
42 }
43 
44 
45 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
46 
48 (
49  const phaseModel& phase1,
50  const phaseModel& phase2,
51  const dimensionedVector& g,
52  const scalarTable& sigmaTable,
53  const bool ordered
54 )
55 :
56  phasePairKey(phase1.name(), phase2.name(), ordered),
57  phase1_(phase1),
58  phase2_(phase2),
59  g_(g),
60  sigma_
61  (
62  "sigma",
63  dimensionSet(1, 0, -2, 0, 0),
64  sigmaTable
65  [
67  (
68  phase1.name(),
69  phase2.name(),
70  false
71  )
72  ]
73  )
74 {}
75 
76 
77 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
78 
80 {}
81 
82 
83 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
84 
86 {
88  << "Requested dispersed phase from an unordered pair."
89  << exit(FatalError);
90 
91  return phase1_;
92 }
93 
94 
96 {
98  << "Requested continuous phase from an unordered pair."
99  << exit(FatalError);
100 
101  return phase1_;
102 }
103 
104 
106 {
107  word name2(phase2().name());
108  name2[0] = toupper(name2[0]);
109  return phase1().name() + "And" + name2;
110 }
111 
112 
114 {
115  return phase1()*phase1().rho() + phase2()*phase2().rho();
116 }
117 
118 
120 {
121  return mag(phase1().U() - phase2().U());
122 }
123 
124 
126 {
127  return dispersed().U() - continuous().U();
128 }
129 
130 
132 {
133  return magUr()*dispersed().d()/continuous().nu();
134 }
135 
136 
138 {
139  return
140  continuous().nu()*continuous().Cp()*continuous().rho()
141  /continuous().kappa();
142 }
143 
144 
146 {
147  return EoH(dispersed().d());
148 }
149 
150 
152 {
153  return
154  EoH
155  (
156  dispersed().d()
157  *cbrt(1 + 0.163*pow(Eo(), 0.757))
158  );
159 }
160 
161 
163 {
164  return
165  EoH
166  (
167  dispersed().d()
168  /cbrt(E())
169  );
170 }
171 
172 
174 {
175  return
176  mag(g())
177  *continuous().nu()
178  *pow3(continuous().nu()*continuous().rho()/sigma());
179 }
180 
181 
183 {
184  return Re()*pow(Mo(), 0.23);
185 }
186 
187 
189 {
191  << "Requested aspect ratio of the dispersed phase in an unordered pair"
192  << exit(FatalError);
193 
194  return phase1();
195 }
196 
197 
198 // ************************************************************************* //
virtual const phaseModel & dispersed() const
Dispersed phase.
Definition: phasePair.C:65
tmp< volScalarField > sigma() const
Surface tension coefficient.
Definition: phasePair.C:163
virtual tmp< volScalarField > E() const
Aspect ratio.
Definition: phasePair.C:194
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:125
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
tmp< volScalarField > EoH2() const
Eotvos number based on hydraulic diameter type 2.
Definition: phasePair.C:152
tmp< volScalarField > magUr() const
Relative velocity magnitude.
Definition: phasePair.C:107
error FatalError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL ERROR&#39; header text and sta...
tmp< volScalarField > Mo() const
Morton Number.
Definition: phasePair.C:174
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:598
dimensionedSymmTensor sqr(const dimensionedVector &dv)
virtual const phaseModel & continuous() const
Continuous phase.
Definition: phasePair.C:75
virtual ~phasePair()=default
Destructor.
Definition: phasePair.C:59
tmp< volScalarField > Pr() const
Prandtl number.
Definition: phasePair.C:125
phaseModel & phase2
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
phasePair(const multiphaseInter::phaseModel &phase1, const multiphaseInter::phaseModel &phase2, const bool ordered=false)
Construct from two phases.
Definition: phasePair.C:28
tmp< volScalarField > Re() const
Reynolds number.
Definition: phasePair.C:119
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:81
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Definition: dimensionSet.H:105
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition: exprTraits.C:127
A class for handling words, derived from Foam::string.
Definition: word.H:63
dimensionedScalar cbrt(const dimensionedScalar &ds)
tmp< volScalarField > Ta() const
Takahashi Number.
Definition: phasePair.C:188
const uniformDimensionedVectorField & g() const
Return gravitation acceleration.
Definition: phasePairI.H:86
An ordered or unorder pair of phase names. Typically specified as follows.
Definition: phasePairKey.H:61
const uniformDimensionedVectorField & g
phaseModel & phase1
virtual word name() const
Pair name.
Definition: phasePair.C:62
scalarField Re(const UList< complex > &cmplx)
Extract real component.
Definition: complexField.C:207
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
tmp< volScalarField > Eo() const
Eotvos number.
Definition: phasePair.C:135
dimensionedScalar pow3(const dimensionedScalar &ds)
U
Definition: pEqn.H:72
const dimensionedScalar & rho() const
Definition: phaseModel.H:193
tmp< volScalarField > rho() const
Average density.
Definition: phasePair.C:101
const word & name() const
Definition: phaseModel.H:166
tmp< volScalarField > EoH1() const
Eotvos number based on hydraulic diameter type 1.
Definition: phasePair.C:141
A class for managing temporary objects.
Definition: HashPtrTable.H:50
tmp< volVectorField > Ur() const
Relative velocity.
Definition: phasePair.C:113
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phaseModel.H:53
volScalarField & nu