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 | Copyright (C) 2011-2015 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 "IATEsource.H"
27 #include "fvMatrix.H"
30 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35 namespace diameterModels
36 {
37  defineTypeNameAndDebug(IATEsource, 0);
38  defineRunTimeSelectionTable(IATEsource, dictionary);
39 }
40 }
41 
42 
43 // * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
44 
47 (
48  const word& type,
49  const IATE& iate,
50  const dictionary& dict
51 )
52 {
53  dictionaryConstructorTable::iterator cstrIter =
54  dictionaryConstructorTablePtr_->find(type);
55 
56  if (cstrIter == dictionaryConstructorTablePtr_->end())
57  {
59  << "Unknown IATE source type "
60  << type << nl << nl
61  << "Valid IATE source types : " << endl
62  << dictionaryConstructorTablePtr_->sortedToc()
63  << exit(FatalError);
64  }
65 
66  return autoPtr<IATEsource>(cstrIter()(iate, dict));
67 }
68 
69 
70 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
71 
73 {
75  phase().db().lookupObject<uniformDimensionedVectorField>("g");
76 
77  return
78  sqrt(2.0)
79  *pow025
80  (
81  fluid().sigma()*mag(g)
82  *(otherPhase().rho() - phase().rho())
83  /sqr(otherPhase().rho())
84  )
85  *pow(max(1 - phase(), scalar(0)), 1.75);
86 }
87 
89 {
90  return sqrt(2*otherPhase().turbulence().k());
91 }
92 
94 {
95  return max(Ur()*phase().d()/otherPhase().nu(), scalar(1.0e-3));
96 }
97 
99 {
100  const volScalarField Eo(this->Eo());
101  const volScalarField Re(this->Re());
102 
103  return
104  max
105  (
106  min
107  (
108  (16/Re)*(1 + 0.15*pow(Re, 0.687)),
109  48/Re
110  ),
111  8*Eo/(3*(Eo + 4))
112  );
113 }
114 
116 {
118  phase().db().lookupObject<uniformDimensionedVectorField>("g");
119 
120  return
121  mag(g)*pow4(otherPhase().nu())*sqr(otherPhase().rho())
122  *(otherPhase().rho() - phase().rho())
123  /pow3(fluid().sigma());
124 }
125 
127 {
129  phase().db().lookupObject<uniformDimensionedVectorField>("g");
130 
131  return
132  mag(g)*sqr(phase().d())
133  *(otherPhase().rho() - phase().rho())
134  /fluid().sigma();
135 }
136 
138 {
139  return
140  otherPhase().rho()*sqr(Ur())*phase().d()/fluid().sigma();
141 }
142 
143 
144 // ************************************************************************* //
Foam::diameterModels::IATEsource::Mo
tmp< volScalarField > Mo() const
Return the bubble Morton number.
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
fluid
multiphaseSystem & fluid
Definition: createFields.H:10
Foam::defineRunTimeSelectionTable
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
Foam::diameterModels::IATEsource::CD
tmp< volScalarField > CD() const
Return the bubble drag coefficient.
Foam::Re
scalarField Re(const UList< complex > &cf)
Definition: complexFields.C:97
g
const dimensionedVector & g
Definition: setRegionFluidFields.H:33
fvMatrix.H
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::mag
dimensioned< scalar > mag(const dimensioned< Type > &)
Foam::pow025
dimensionedScalar pow025(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:131
nu
volScalarField & nu
Definition: readMechanicalProperties.H:179
Foam::pow4
dimensionedScalar pow4(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:98
turbulence
autoPtr< compressible::turbulenceModel > turbulence
Definition: createFields.H:23
Foam::pow3
dimensionedScalar pow3(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:87
Foam::nl
static const char nl
Definition: Ostream.H:260
Foam::uniformDimensionedVectorField
UniformDimensionedField< vector > uniformDimensionedVectorField
Definition: uniformDimensionedFields.H:48
Foam::diameterModels::IATEsource::Ut
tmp< volScalarField > Ut() const
Return the bubble turbulent velocity.
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
Foam::pow
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Definition: dimensionedScalar.C:73
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::FatalError
error FatalError
phaseCompressibleTurbulenceModel.H
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::e
const double e
Elementary charge.
Definition: doubleFloat.H:94
Foam::diameterModels::IATEsource::We
tmp< volScalarField > We() const
Return the bubble Webber number.
Foam::diameterModels::IATEsource::Eo
tmp< volScalarField > Eo() const
Return the bubble Eotvos number.
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
rho
rho
Definition: pEqn.H:3
Foam::max
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
uniformDimensionedFields.H
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:318
Foam::sqr
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Definition: dimensionedSymmTensor.C:49
Foam::diameterModels::IATEsource::New
static autoPtr< IATEsource > New(const word &type, const IATE &iate, const dictionary &dict)
Foam::sqrt
dimensionedScalar sqrt(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:142
k
label k
Boltzmann constant.
Definition: LISASMDCalcMethod2.H:41
Foam::constant::physicoChemical::sigma
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m2/K4].
Foam::diameterModels::IATEsource::Re
tmp< volScalarField > Re() const
Return the bubble Reynolds number.
Foam::type
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:588
Foam::diameterModels::IATEsource::Ur
tmp< volScalarField > Ur() const
Return the bubble relative velocity.
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
Foam::min
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)