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  {
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_.sizeGroups()[1].phase().rho())
135  );
136 
138  (
139  "sigma",
141  gAverage
142  (
143  popBal_.sigmaWithContinuousPhase
144  (
145  popBal_.sizeGroups()[1].phase()
146  )()
147  )
148  );
149 
150  forAll(popBal_.sizeGroups(), i)
151  {
152  const sizeGroup& fi = popBal_.sizeGroups()[i];
153 
154  dimensionedScalar uTerminal("uTerminal", dimVelocity, 0.2);
155  dimensionedScalar Cd("Cd", dimless, 0.44);
156  dimensionedScalar CdEllipse("CdEllipse", dimless, 1);
157 
158  dimensionedScalar Re(uTerminal*fi.dSph()/nuc);
159  const dimensionedScalar Eo
160  (
161  mag(g)*mag(rhoc - rhod)*sqr(fi.dSph())/sigma
162  );
163 
166  const dimensionedScalar uTerminalX("uTerminalX", dimVelocity, 1e-5);
167  dimensionedScalar ReX("ReX", dimless, Re.value());
168  dimensionedScalar CdX("CdX", dimless, Cd.value());
169  dimensionedScalar dCd("dCd", Cd.dimensions()/dimVelocity, Zero);
170 
171  int n = 0;
172 
173  while (mag(F.value()) >= 1.0e-05 && n++ <= 20)
174  {
175  Re = uTerminal*fi.dSph()/nuc;
176 
177  Cd =
178  pos0(1000 - Re)*24/Re*(1 + 0.1*pow(Re, 0.75))
179  + neg(1000 - Re)*0.44;
180 
181  CdEllipse = 0.6666*sqrt(Eo);
182 
183  Cd =
184  pos0(CdEllipse - Cd)
185  *min(CdEllipse.value(), 8.0/3.0)
186  + neg(CdEllipse - Cd)*Cd;
187 
188  F =
189  4.0/3.0*(rhoc - rhod)*mag(g)*fi.dSph()
190  - rhoc*Cd*sqr(uTerminal);
191 
192  ReX = (uTerminal + uTerminalX)*fi.dSph()/nuc;
193 
194  CdX =
195  pos0(1000 - ReX)
196  *24/ReX*(1 + 0.1*pow(ReX, 0.75))
197  + neg(1000 - ReX)*0.44;
198 
199  CdX =
200  pos0(CdEllipse - CdX)
201  *min(CdEllipse.value(), 2.66667)
202  + neg(CdEllipse - CdX)*CdX;
203 
204  dCd = (CdX - Cd)/uTerminalX;
205 
206  dF = -(2*rhoc*uTerminal*Cd + rhoc*sqr(uTerminal)*dCd);
207 
208  uTerminal -= F/dF;
209  }
210 
211  uTerminal_.append(new dimensionedScalar("uTerminal", uTerminal));
212 
213  Cd_.append(new dimensionedScalar("Cd", Cd));
214  }
215  }
216 }
217 
218 
219 // ************************************************************************* //
label n
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:433
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
virtual void precompute()
Precompute diameter independent expressions.
Definition: LiaoBase.C:93
LiaoBase(const populationBalanceModel &popBal, const dictionary &dict)
Definition: LiaoBase.C:34
Model for tracking the evolution of a dispersed phase size distribution due to coalescence (synonymou...
Single size class fraction field representing a fixed particle volume as defined by the user through ...
Definition: sizeGroup.H:96
const dimensionedScalar & dSph() const
Return representative spherical diameter of the sizeGroup.
Definition: sizeGroupI.H:51
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.
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].
tmp< VolField< typename outerProduct< vector, Type >::type > > grad(const SurfaceField< Type > &ssf)
Definition: fvcGrad.C:46
static const zero Zero
Definition: zero.H:97
const doubleScalar e
Definition: doubleScalar.H:106
dimensionedScalar pos0(const dimensionedScalar &ds)
const dimensionSet dimKinematicViscosity
void pow025(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
const dimensionSet dimless
const dimensionSet dimLength
const dimensionSet dimForce
void mag(LagrangianPatchField< scalar > &f, const LagrangianPatchField< Type > &f1)
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
void symm(LagrangianPatchField< tensor > &f, const LagrangianPatchField< tensor > &f1)
void pow(LagrangianPatchField< typename powProduct< Type, r >::type > &f, const LagrangianPatchField< Type > &f1)
const dimensionSet dimDensity
void pow3(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
dimensionedScalar neg(const dimensionedScalar &ds)
void sqr(LagrangianPatchField< typename outerProduct< Type, Type >::type > &f, const LagrangianPatchField< Type > &f1)
Type gAverage(const FieldField< Field, Type > &f)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
const dimensionSet dimVelocity
const dimensionSet dimArea
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