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-2015 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 "twoPhaseSystem.H"
31 #include "fvMatrix.H"
33 #include "gravityMeshObject.H"
34 
35 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
36 
37 namespace Foam
38 {
39 namespace diameterModels
40 {
41  defineTypeNameAndDebug(IATEsource, 0);
42  defineRunTimeSelectionTable(IATEsource, dictionary);
43 }
44 }
45 
46 
47 // * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
48 
51 (
52  const word& type,
53  const IATE& iate,
54  const dictionary& dict
55 )
56 {
57  auto* ctorPtr = dictionaryConstructorTable(type);
58 
59  if (!ctorPtr)
60  {
62  (
63  dict,
64  "IATEsource",
65  type,
66  *dictionaryConstructorTablePtr_
67  ) << exit(FatalIOError);
68  }
69 
70  return autoPtr<IATEsource>(ctorPtr(iate, dict));
71 }
72 
73 
74 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
75 
77 {
79  meshObjects::gravity::New(phase().U().time());
80 
81  return
82  sqrt(2.0)
83  *pow025
84  (
85  fluid().sigma()*mag(g)
86  *(otherPhase().rho() - phase().rho())
87  /sqr(otherPhase().rho())
88  )
89  *pow(max(1 - phase(), scalar(0)), 1.75);
90 }
91 
92 
94 {
95  return sqrt(2*otherPhase().turbulence().k());
96 }
97 
98 
100 {
101  return max(Ur()*phase().d()/otherPhase().nu(), scalar(1.0e-3));
102 }
103 
104 
106 {
107  const volScalarField Eo(this->Eo());
108  const volScalarField Re(this->Re());
109 
110  return
111  max
112  (
113  min
114  (
115  (16/Re)*(1 + 0.15*pow(Re, 0.687)),
116  48/Re
117  ),
118  8*Eo/(3*(Eo + 4))
119  );
120 }
121 
122 
124 {
126  meshObjects::gravity::New(phase().U().time());
127 
128  return
129  mag(g)*pow4(otherPhase().nu())*sqr(otherPhase().rho())
130  *(otherPhase().rho() - phase().rho())
131  /pow3(fluid().sigma());
132 }
133 
134 
136 {
138  meshObjects::gravity::New(phase().U().time());
139 
140  return
141  mag(g)*sqr(phase().d())
142  *(otherPhase().rho() - phase().rho())
143  /fluid().sigma();
144 }
145 
146 
148 {
149  return otherPhase().rho()*sqr(Ur())*phase().d()/fluid().sigma();
150 }
151 
152 
153 // ************************************************************************* //
Foam::diameterModels::IATEsource::We
tmp< volScalarField > We() const
Definition: IATEsource.C:133
turbulence
Info<< "Reading field U\n"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);volScalarField rho(IOobject("rho", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), thermo.rho());volVectorField rhoU(IOobject("rhoU", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *U);volScalarField rhoE(IOobject("rhoE", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *(e+0.5 *magSqr(U)));surfaceScalarField pos(IOobject("pos", runTime.timeName(), mesh), mesh, dimensionedScalar("pos", dimless, 1.0));surfaceScalarField neg(IOobject("neg", runTime.timeName(), mesh), mesh, dimensionedScalar("neg", dimless, -1.0));surfaceScalarField phi("phi", fvc::flux(rhoU));Info<< "Creating turbulence model\n"<< endl;autoPtr< compressible::turbulenceModel > turbulence(compressible::turbulenceModel::New(rho, U, phi, thermo))
Definition: createFields.H:94
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:57
Foam::diameterModels::IATEsource::Eo
tmp< volScalarField > Eo() const
Definition: IATEsource.C:122
gravityMeshObject.H
Foam::FatalIOError
IOerror FatalIOError
fvMatrix.H
fluid
twoPhaseSystem & fluid
Definition: setRegionFluidFields.H:3
PhaseCompressibleTurbulenceModel.H
Foam::min
label min(const labelHashSet &set, label minValue=labelMax)
Definition: hashSets.C:26
Foam::pow025
dimensionedScalar pow025(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:126
nu
volScalarField & nu
Definition: readMechanicalProperties.H:176
Foam::pow4
dimensionedScalar pow4(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:93
FatalIOErrorInLookup
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Definition: error.H:502
Foam::diameterModels::IATEsource::Re
tmp< volScalarField > Re() const
Definition: IATEsource.C:89
Foam::pow3
dimensionedScalar pow3(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:82
Foam::diameterModels::defineTypeNameAndDebug
defineTypeNameAndDebug(constant, 0)
Foam::uniformDimensionedVectorField
UniformDimensionedField< vector > uniformDimensionedVectorField
Definition: uniformDimensionedFields.H:46
Foam::diameterModels::IATEsource::CD
tmp< volScalarField > CD() const
Definition: IATEsource.C:94
rho
rho
Definition: readInitialConditions.H:88
Foam::diameterModels::IATEsource::Ur
tmp< volScalarField > Ur() const
Definition: IATEsource.C:68
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:53
Foam::pow
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Definition: dimensionedScalar.C:68
Foam::max
label max(const labelHashSet &set, label maxValue=labelMin)
Definition: hashSets.C:40
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::diameterModels::IATEsource::Mo
tmp< volScalarField > Mo() const
Definition: IATEsource.C:111
g
const uniformDimensionedVectorField & g
Definition: createFluidFields.H:26
Foam
Definition: atmBoundaryLayer.C:26
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:125
Foam::diameterModels::IATEsource::Ut
tmp< volScalarField > Ut() const
Definition: IATEsource.C:84
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:49
U
U
Definition: pEqn.H:72
Foam::sqr
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Definition: dimensionedSymmTensor.C:44
Foam::sqrt
dimensionedScalar sqrt(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:137
Foam::mag
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Definition: POSIX.C:717
k
label k
Definition: LISASMDCalcMethod2.H:41
Foam::constant::electromagnetic::e
const dimensionedScalar e
Definition: createFields.H:11
Foam::Re
scalarField Re(const UList< complex > &cf)
Definition: complexField.C:152
Foam::diameterModels::defineRunTimeSelectionTable
defineRunTimeSelectionTable(binaryBreakupModel, dictionary)
Foam::roots::type
type
Definition: Roots.H:52
Foam::diameterModels::IATEsource::New
static autoPtr< IATEsource > New(const word &type, const IATE &iate, const dictionary &dict)
Definition: IATEsource.C:43
IATEsource.H
sigma
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
Foam::meshObjects::gravity::New
static const gravity & New(const Time &runTime)
Definition: gravityMeshObject.H:89