LiaoBase.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2021-2025 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "LiaoBase.H"
27 #include "fvcGrad.H"
30 
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32 
34 (
35  const populationBalanceModel& popBal,
36  const dictionary& dict
37 )
38 :
39  popBal_(popBal),
40  kolmogorovLengthScale_
41  (
42  IOobject
43  (
44  "kolmogorovLengthScale",
45  popBal_.time().name(),
46  popBal_.mesh()
47  ),
48  popBal_.mesh(),
50  (
51  "kolmogorovLengthScale",
52  dimLength,
53  Zero
54  )
55  ),
56  shearStrainRate_
57  (
58  IOobject
59  (
60  "shearStrainRate",
61  popBal_.time().name(),
62  popBal_.mesh()
63  ),
64  popBal_.mesh(),
66  (
67  "shearStrainRate",
69  Zero
70  )
71  ),
72  eddyStrainRate_
73  (
74  IOobject
75  (
76  "eddyStrainRate",
77  popBal_.time().name(),
78  popBal_.mesh()
79  ),
80  popBal_.mesh(),
82  (
83  "eddyStrainRate",
85  Zero
86  )
87  )
88 {}
89 
90 
91 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
92 
94 {
95  const volScalarField::Internal& rhoc = popBal_.continuousPhase().rho();
96 
97  tmp<volScalarField> tepsilonc(popBal_.continuousTurbulence().epsilon());
98  const volScalarField::Internal& epsilonc = tepsilonc();
99  tmp<volScalarField> tmu(popBal_.continuousPhase().fluidThermo().mu());
100  const volScalarField::Internal muc = tmu();
101  tmp<volScalarField> tnu(popBal_.continuousPhase().fluidThermo().nu());
102  const volScalarField::Internal nuc = tnu();
103 
104  kolmogorovLengthScale_ = pow025(pow3(nuc)/epsilonc);
105 
106  shearStrainRate_ =
107  sqrt(2.0)*mag(symm(fvc::grad(popBal_.continuousPhase().U())));
108 
109  eddyStrainRate_ = sqrt(rhoc*epsilonc/muc);
110 
111  if (uTerminal_.empty())
112  {
113  const uniformDimensionedVectorField& g =
114  popBal_.mesh().lookupObject<uniformDimensionedVectorField>("g");
115 
116  const dimensionedScalar nuc
117  (
118  "nuc",
120  gAverage(popBal_.continuousPhase().fluidThermo().nu()())
121  );
122 
123  const dimensionedScalar rhoc
124  (
125  "rhoc",
126  dimDensity,
127  gAverage(popBal_.continuousPhase().rho())
128  );
129 
130  const dimensionedScalar rhod
131  (
132  "rhod",
133  dimDensity,
134  gAverage(popBal_.phases().first().rho())
135  );
136 
138  (
139  "sigma",
141  gAverage(popBal_.sigmaWithContinuousPhase(0)())
142  );
143 
144  forAll(popBal_.phases(), i)
145  {
146  const dimensionedScalar& dSph = popBal_.dSph(i);
147 
148  dimensionedScalar uTerminal("uTerminal", dimVelocity, 0.2);
149  dimensionedScalar Cd("Cd", dimless, 0.44);
150  dimensionedScalar CdEllipse("CdEllipse", dimless, 1);
151 
152  dimensionedScalar Re(uTerminal*dSph/nuc);
153 
154  const dimensionedScalar Eo(mag(g)*mag(rhoc - rhod)*sqr(dSph)/sigma);
155 
158  const dimensionedScalar uTerminalX("uTerminalX", dimVelocity, 1e-5);
159  dimensionedScalar ReX("ReX", dimless, Re.value());
160  dimensionedScalar CdX("CdX", dimless, Cd.value());
161  dimensionedScalar dCd("dCd", Cd.dimensions()/dimVelocity, Zero);
162 
163  int n = 0;
164 
165  while (mag(F.value()) >= 1.0e-05 && n++ <= 20)
166  {
167  Re = uTerminal*dSph/nuc;
168 
169  Cd =
170  pos0(1000 - Re)*24/Re*(1 + 0.1*pow(Re, 0.75))
171  + neg(1000 - Re)*0.44;
172 
173  CdEllipse = 0.6666*sqrt(Eo);
174 
175  Cd =
176  pos0(CdEllipse - Cd)
177  *min(CdEllipse.value(), 8.0/3.0)
178  + neg(CdEllipse - Cd)*Cd;
179 
180  F =
181  4.0/3.0*(rhoc - rhod)*mag(g)*dSph
182  - rhoc*Cd*sqr(uTerminal);
183 
184  ReX = (uTerminal + uTerminalX)*dSph/nuc;
185 
186  CdX =
187  pos0(1000 - ReX)
188  *24/ReX*(1 + 0.1*pow(ReX, 0.75))
189  + neg(1000 - ReX)*0.44;
190 
191  CdX =
192  pos0(CdEllipse - CdX)
193  *min(CdEllipse.value(), 2.66667)
194  + neg(CdEllipse - CdX)*CdX;
195 
196  dCd = (CdX - Cd)/uTerminalX;
197 
198  dF = -(2*rhoc*uTerminal*Cd + rhoc*sqr(uTerminal)*dCd);
199 
200  uTerminal -= F/dF;
201  }
202 
203  uTerminal_.append(new dimensionedScalar("uTerminal", uTerminal));
204 
205  Cd_.append(new dimensionedScalar("Cd", Cd));
206  }
207  }
208 }
209 
210 
211 // ************************************************************************* //
label n
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:449
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:99
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
const dimensionSet & dimensions() const
Return const reference to dimensions.
const Type & value() const
Return const reference to value.
Model for tracking the evolution of a dispersed phase size distribution due to coalescence (synonymou...
virtual void precompute()
Pre-compute diameter independent expressions.
Definition: LiaoBase.C:93
LiaoBase(const populationBalanceModel &popBal, const dictionary &dict)
Definition: LiaoBase.C:34
A class for managing temporary objects.
Definition: tmp.H:55
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
Calculate the gradient of the given field.
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m^2/K^4].
const dimensionedScalar F
Faraday constant: default SI units: [C/mol].
const dimensionSet time
tmp< VolField< typename outerProduct< vector, Type >::type > > grad(const SurfaceField< Type > &ssf)
Definition: fvcGrad.C:46
const dimensionSet & dimForce
Definition: dimensions.C:159
static const zero Zero
Definition: zero.H:97
const doubleScalar e
Definition: doubleScalar.H:106
const dimensionSet & dimless
Definition: dimensions.C:138
const dimensionSet & dimKinematicViscosity
Definition: dimensions.C:171
dimensionedScalar pos0(const dimensionedScalar &ds)
Type gAverage(const UList< Type > &f, const label comm)
const dimensionSet & dimLength
Definition: dimensions.C:141
void pow025(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
tmp< DimensionedField< typename outerProduct< Type, Type >::type, GeoMesh, Field >> sqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
const dimensionSet & dimVelocity
Definition: dimensions.C:154
dimensioned< Type > min(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
const dimensionSet & dimDensity
Definition: dimensions.C:158
void symm(pointPatchField< tensor > &, const pointPatchField< tensor > &)
void pow3(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
dimensionedScalar neg(const dimensionedScalar &ds)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
tmp< DimensionedField< typename powProduct< Type, r >::type, GeoMesh, Field > > pow(const DimensionedField< Type, GeoMesh, PrimitiveField > &df, typename powProduct< Type, r >::type)
tmp< DimensionedField< scalar, GeoMesh, Field > > mag(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
const dimensionSet & dimArea
Definition: dimensions.C:149
void sqrt(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
scalarField Re(const UList< complex > &cf)
Definition: complexFields.C:97
dictionary dict
Typedefs for UniformDimensionedField.