PrinceBlanch.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) 2018-2019 OpenFOAM Foundation
9  Copyright (C) 2020 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 "PrinceBlanch.H"
31 #include "mathematicalConstants.H"
32 #include "phaseCompressibleTurbulenceModel.H"
33 
34 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35 
36 namespace Foam
37 {
38 namespace diameterModels
39 {
40 namespace coalescenceModels
41 {
42  defineTypeNameAndDebug(PrinceBlanch, 0);
44  (
45  coalescenceModel,
46  PrinceBlanch,
47  dictionary
48  );
49 }
50 }
51 }
52 
54 
55 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
56 
59 (
60  const populationBalanceModel& popBal,
61  const dictionary& dict
62 )
63 :
64  coalescenceModel(popBal, dict),
65  C1_(dimensionedScalar::getOrDefault("C1", dict, dimless, 0.356)),
66  h0_
67  (
68  dimensionedScalar::getOrDefault
69  (
70  "h0",
71  dict,
72  dimLength,
73  1e-4
74  )
75  ),
76  hf_
77  (
78  dimensionedScalar::getOrDefault
79  (
80  "hf",
81  dict,
82  dimLength,
83  1e-8
84  )
85  ),
86  turbulence_(dict.lookup("turbulence")),
87  buoyancy_(dict.lookup("buoyancy")),
88  laminarShear_(dict.lookup("laminarShear"))
89 {}
90 
91 
92 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
93 
96 (
97  volScalarField& coalescenceRate,
98  const label i,
99  const label j
100 )
101 {
102  const phaseModel& continuousPhase = popBal_.continuousPhase();
103  const sizeGroup& fi = popBal_.sizeGroups()[i];
104  const sizeGroup& fj = popBal_.sizeGroups()[j];
106  popBal_.mesh().time().lookupObject<uniformDimensionedVectorField>("g");
107 
108  const dimensionedScalar rij(1.0/(1.0/fi.d() + 1.0/fj.d()));
109 
110  const volScalarField collisionEfficiency
111  (
112  exp
113  (
114  - sqrt
115  (
116  pow3(rij)*continuousPhase.rho()
117  /(16.0*popBal_.sigmaWithContinuousPhase(fi.phase()))
118  )
119  *log(h0_/hf_)
120  *cbrt(popBal_.continuousTurbulence().epsilon())/pow(rij, 2.0/3.0)
121  )
122  );
123 
124  if (turbulence_)
125  {
126  coalescenceRate +=
127  (
128  C1_*pi*sqr(fi.d() + fj.d())
129  *cbrt(popBal_.continuousTurbulence().epsilon())
130  *sqrt(pow(fi.d(), 2.0/3.0) + pow(fj.d(), 2.0/3.0))
131  )
132  *collisionEfficiency;
133  }
134 
135  if (buoyancy_)
136  {
137  const dimensionedScalar Sij(pi/4.0*sqr(fi.d() + fj.d()));
138 
139  coalescenceRate +=
140  (
141  Sij
142  *mag
143  (
144  sqrt
145  (
146  2.14*popBal_.sigmaWithContinuousPhase(fi.phase())
147  /(continuousPhase.rho()*fi.d()) + 0.505*mag(g)*fi.d()
148  )
149  - sqrt
150  (
151  2.14*popBal_.sigmaWithContinuousPhase(fi.phase())
152  /(continuousPhase.rho()*fj.d()) + 0.505*mag(g)*fj.d()
153  )
154  )
155  )
156  *collisionEfficiency;
157  }
158 
159  if (laminarShear_)
160  {
162  << "Laminar shear collision contribution not implemented for "
163  << this->type() << " coalescence model."
164  << exit(FatalError);
165  }
166 }
167 
168 
169 // ************************************************************************* //
Foam::diameterModels::coalescenceModel
Base class for coalescence models.
Definition: coalescenceModel.H:52
Foam::phaseModel
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phaseModel.H:54
mathematicalConstants.H
Foam::diameterModels::sizeGroup::phase
const phaseModel & phase() const
Return const-reference to the phase.
Definition: sizeGroupI.H:38
Foam::dimLength
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:52
Foam::exp
dimensionedScalar exp(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:261
PrinceBlanch.H
Foam::UniformDimensionedField< vector >
Foam::diameterModels::coalescenceModels::PrinceBlanch::addToCoalescenceRate
virtual void addToCoalescenceRate(volScalarField &coalescenceRate, const label i, const label j)
Add to coalescenceRate.
Definition: PrinceBlanch.C:96
Foam::diameterModels::coalescenceModels::PrinceBlanch::PrinceBlanch
PrinceBlanch(const populationBalanceModel &popBal, const dictionary &dict)
Definition: PrinceBlanch.C:59
Foam::diameterModels::coalescenceModels::addToRunTimeSelectionTable
addToRunTimeSelectionTable(coalescenceModel, constantCoalescence, dictionary)
Foam::pow3
dimensionedScalar pow3(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:89
Foam::pow
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Definition: dimensionedScalar.C:75
Foam::diameterModels::sizeGroup
This class represents a single sizeGroup belonging to a velocityGroup. The main property of a sizeGro...
Definition: sizeGroup.H:96
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::FatalError
error FatalError
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::diameterModels::populationBalanceModel
Class that solves the univariate population balance equation by means of a class method (also called ...
Definition: populationBalanceModel.H:179
Foam::log
dimensionedScalar log(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:262
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam::dimensioned< scalar >
g
const uniformDimensionedVectorField & g
Definition: createFluidFields.H:26
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
Foam::diameterModels::sizeGroup::d
const dimensionedScalar & d() const
Return representative diameter of the sizeGroup.
Definition: sizeGroupI.H:52
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::constant::mathematical::pi
constexpr scalar pi(M_PI)
Foam::sqrt
dimensionedScalar sqrt(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:144
Foam::mag
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Foam::constant::electromagnetic::e
const dimensionedScalar e
Elementary charge.
Definition: createFields.H:11
Foam::roots::type
type
Types of root.
Definition: Roots.H:54
Foam::diameterModels::coalescenceModels::defineTypeNameAndDebug
defineTypeNameAndDebug(constantCoalescence, 0)
Foam::phaseModel::rho
const dimensionedScalar & rho() const
Definition: phaseModel.H:167
Foam::cbrt
dimensionedScalar cbrt(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:155
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::dimless
const dimensionSet dimless
Dimensionless.
Definition: dimensionSets.C:189