PrinceBlanch.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) 2018-2019 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 "PrinceBlanch.H"
28 #include "mathematicalConstants.H"
29 #include "phaseCompressibleTurbulenceModel.H"
30 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35 namespace diameterModels
36 {
37 namespace coalescenceModels
38 {
39  defineTypeNameAndDebug(PrinceBlanch, 0);
41  (
42  coalescenceModel,
43  PrinceBlanch,
44  dictionary
45  );
46 }
47 }
48 }
49 
51 
52 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
53 
56 (
57  const populationBalanceModel& popBal,
58  const dictionary& dict
59 )
60 :
61  coalescenceModel(popBal, dict),
62  C1_(dimensionedScalar::lookupOrDefault("C1", dict, dimless, 0.356)),
63  h0_
64  (
65  dimensionedScalar::lookupOrDefault
66  (
67  "h0",
68  dict,
69  dimLength,
70  1e-4
71  )
72  ),
73  hf_
74  (
75  dimensionedScalar::lookupOrDefault
76  (
77  "hf",
78  dict,
79  dimLength,
80  1e-8
81  )
82  ),
83  turbulence_(dict.lookup("turbulence")),
84  buoyancy_(dict.lookup("buoyancy")),
85  laminarShear_(dict.lookup("laminarShear"))
86 {}
87 
88 
89 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
90 
93 (
94  volScalarField& coalescenceRate,
95  const label i,
96  const label j
97 )
98 {
99  const phaseModel& continuousPhase = popBal_.continuousPhase();
100  const sizeGroup& fi = popBal_.sizeGroups()[i];
101  const sizeGroup& fj = popBal_.sizeGroups()[j];
104 
105  const dimensionedScalar rij(1.0/(1.0/fi.d() + 1.0/fj.d()));
106 
107  const volScalarField collisionEfficiency
108  (
109  exp
110  (
111  - sqrt
112  (
113  pow3(rij)*continuousPhase.rho()
114  /(16.0*popBal_.sigmaWithContinuousPhase(fi.phase()))
115  )
116  *log(h0_/hf_)
117  *cbrt(popBal_.continuousTurbulence().epsilon())/pow(rij, 2.0/3.0)
118  )
119  );
120 
121  if (turbulence_)
122  {
123  coalescenceRate +=
124  (
125  C1_*pi*sqr(fi.d() + fj.d())
127  *sqrt(pow(fi.d(), 2.0/3.0) + pow(fj.d(), 2.0/3.0))
128  )
129  *collisionEfficiency;
130  }
131 
132  if (buoyancy_)
133  {
134  const dimensionedScalar Sij(pi/4.0*sqr(fi.d() + fj.d()));
135 
136  coalescenceRate +=
137  (
138  Sij
139  *mag
140  (
141  sqrt
142  (
143  2.14*popBal_.sigmaWithContinuousPhase(fi.phase())
144  /(continuousPhase.rho()*fi.d()) + 0.505*mag(g)*fi.d()
145  )
146  - sqrt
147  (
148  2.14*popBal_.sigmaWithContinuousPhase(fi.phase())
149  /(continuousPhase.rho()*fj.d()) + 0.505*mag(g)*fj.d()
150  )
151  )
152  )
153  *collisionEfficiency;
154  }
155 
156  if (laminarShear_)
157  {
159  << "Laminar shear collision contribution not implemented for "
160  << this->type() << " coalescence model."
161  << exit(FatalError);
162  }
163 }
164 
165 
166 // ************************************************************************* //
dictionary dict
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
dimensionedScalar log(const dimensionedScalar &ds)
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
UniformDimensionedField< vector > uniformDimensionedVectorField
error FatalError
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:319
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar sqrt(const dimensionedScalar &ds)
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
Macros for easy insertion into run-time selection tables.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
stressControl lookup("compactNormalStress") >> compactNormalStress
dimensionedScalar exp(const dimensionedScalar &ds)
const phaseModel & continuousPhase() const
Return continuous phase.
PrinceBlanch(const populationBalanceModel &popBal, const dictionary &dict)
dimensionedScalar cbrt(const dimensionedScalar &ds)
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
const phaseCompressibleTurbulenceModel & continuousTurbulence() const
Return reference to turbulence model of the continuous phase.
const populationBalanceModel & popBal_
Reference to the populationBalanceModel.
defineTypeNameAndDebug(combustionModel, 0)
const UPtrList< sizeGroup > & sizeGroups() const
Return the sizeGroups belonging to this populationBalance.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
dimensionedScalar pow3(const dimensionedScalar &ds)
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:47
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:50
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
virtual tmp< volScalarField > epsilon() const =0
Return the turbulence kinetic energy dissipation rate.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
dimensioned< scalar > mag(const dimensioned< Type > &)
const fvMesh & mesh() const
Return reference to the mesh.
const tmp< volScalarField > sigmaWithContinuousPhase(const phaseModel &dispersedPhase) const
Return the surface tension coefficient between a given dispersed.
const doubleScalar e
Elementary charge.
Definition: doubleScalar.H:98
virtual void addToCoalescenceRate(volScalarField &coalescenceRate, const label i, const label j)
Add to coalescenceRate.
Namespace for OpenFOAM.