IATEsource.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) 2011-2018 OpenFOAM Foundation
9  Copyright (C) 2018-2021 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 "IATEsource.H"
30 #include "fvMatrix.H"
31 #include "phaseCompressibleTurbulenceModel.H"
33 
34 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35 
36 namespace Foam
37 {
38 namespace diameterModels
39 {
40  defineTypeNameAndDebug(IATEsource, 0);
41  defineRunTimeSelectionTable(IATEsource, dictionary);
42 }
43 }
44 
45 
46 // * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
47 
50 (
51  const word& type,
52  const IATE& iate,
53  const dictionary& dict
54 )
55 {
56  auto* ctorPtr = dictionaryConstructorTable(type);
57 
58  if (!ctorPtr)
59  {
61  (
62  dict,
63  "IATEsource",
64  type,
65  *dictionaryConstructorTablePtr_
66  ) << exit(FatalIOError);
67  }
68 
69  return autoPtr<IATEsource>(ctorPtr(iate, dict));
70 }
71 
72 
73 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
74 
76 {
78  phase().mesh().time().lookupObject<uniformDimensionedVectorField>("g");
79 
80  return
81  sqrt(2.0)
82  *pow025
83  (
84  fluid().sigma()*mag(g)
85  *(otherPhase().rho() - phase().rho())
86  /sqr(otherPhase().rho())
87  )
88  *pow(max(1 - phase(), scalar(0)), 1.75);
89 }
90 
92 {
93  return sqrt(2*otherPhase().k());
94 }
95 
97 {
98  return max(Ur()*phase().d()/otherPhase().nu(), scalar(1e-3));
99 }
100 
102 {
103  const volScalarField Eo(this->Eo());
104  const volScalarField Re(this->Re());
105 
106  return
107  max
108  (
109  min
110  (
111  (16/Re)*(1 + 0.15*pow(Re, 0.687)),
112  48/Re
113  ),
114  8*Eo/(3*(Eo + 4))
115  );
116 }
117 
119 {
121  phase().db().time().lookupObject<uniformDimensionedVectorField>("g");
122 
123  return
124  mag(g)*pow4(otherPhase().nu())*sqr(otherPhase().rho())
125  *(otherPhase().rho() - phase().rho())
126  /pow3(fluid().sigma());
127 }
128 
130 {
132  phase().db().time().lookupObject<uniformDimensionedVectorField>("g");
133 
134  return
135  mag(g)*sqr(phase().d())
136  *(otherPhase().rho() - phase().rho())
137  /fluid().sigma();
138 }
139 
141 {
142  return
143  otherPhase().rho()*sqr(Ur())*phase().d()/fluid().sigma();
144 }
145 
146 
147 // ************************************************************************* //
Foam::diameterModels::IATEsource::otherPhase
const phaseModel & otherPhase() const
Definition: IATEsource.H:150
Foam::diameterModels::IATEsource::We
tmp< volScalarField > We() const
Return the bubble Webber number.
Definition: IATEsource.C:140
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::phase
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phase.H:54
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::diameterModels::IATEsource::fluid
const twoPhaseSystem & fluid() const
Definition: IATEsource.H:145
Foam::diameterModels::IATEsource::Eo
tmp< volScalarField > Eo() const
Return the bubble Eotvos number.
Definition: IATEsource.C:129
Foam::diameterModels::IATE
IATE (Interfacial Area Transport Equation) bubble diameter model.
Definition: IATE.H:68
Foam::FatalIOError
IOerror FatalIOError
fvMatrix.H
fluid
twoPhaseSystem & fluid
Definition: setRegionFluidFields.H:3
rho
rho
Definition: readInitialConditions.H:88
Foam::min
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:33
IATEsource.H
Foam::pow025
dimensionedScalar pow025(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:133
nu
volScalarField & nu
Definition: readMechanicalProperties.H:176
Foam::pow4
dimensionedScalar pow4(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:100
FatalIOErrorInLookup
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
Definition: error.H:478
Foam::UniformDimensionedField< vector >
Foam::diameterModels::IATEsource::Re
tmp< volScalarField > Re() const
Return the bubble Reynolds number.
Definition: IATEsource.C:96
Foam::pow3
dimensionedScalar pow3(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:89
Foam::diameterModels::defineTypeNameAndDebug
defineTypeNameAndDebug(constant, 0)
Foam::diameterModels::IATEsource::CD
tmp< volScalarField > CD() const
Return the bubble drag coefficient.
Definition: IATEsource.C:101
Foam::diameterModels::IATEsource::Ur
tmp< volScalarField > Ur() const
Return the bubble relative velocity.
Definition: IATEsource.C:75
Foam::pow
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Definition: dimensionedScalar.C:75
Foam::max
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:47
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::diameterModels::IATEsource::Mo
tmp< volScalarField > Mo() const
Return the bubble Morton number.
Definition: IATEsource.C:118
Foam::diameterModels::IATEsource::phase
const phaseModel & phase() const
Definition: IATEsource.H:140
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
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::IATEsource::Ut
tmp< volScalarField > Ut() const
Return the bubble turbulent velocity.
Definition: IATEsource.C:91
uniformDimensionedFields.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::sqr
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Definition: dimensionedSymmTensor.C:51
Foam::sqrt
dimensionedScalar sqrt(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:144
Foam::mag
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
k
label k
Boltzmann constant.
Definition: LISASMDCalcMethod2.H:41
Foam::constant::electromagnetic::e
const dimensionedScalar e
Elementary charge.
Definition: createFields.H:11
Foam::Re
scalarField Re(const UList< complex > &cf)
Extract real component.
Definition: complexField.C:159
Foam::diameterModels::defineRunTimeSelectionTable
defineRunTimeSelectionTable(binaryBreakupModel, dictionary)
Foam::roots::type
type
Types of root.
Definition: Roots.H:54
Foam::diameterModels::IATEsource::New
static autoPtr< IATEsource > New(const word &type, const IATE &iate, const dictionary &dict)
Definition: IATEsource.C:50
sigma
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::phase::rho
const dimensionedScalar & rho() const
Return const-access to phase1 density.
Definition: phase.H:140