dragModel.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) 2011-2020 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 "dragModel.H"
27 #include "phasePair.H"
28 #include "noSwarm.H"
29 #include "surfaceInterpolate.H"
31 
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36  defineTypeNameAndDebug(dragModel, 0);
38  defineRunTimeSelectionTable(dragModel, dictionary);
39 }
40 
41 const Foam::dimensionSet Foam::dragModel::dimK(1, -3, -1, 0, 0);
42 
43 
44 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
45 
47 (
48  const phasePair& pair,
49  const bool registerObject
50 )
51 :
52  regIOobject
53  (
54  IOobject
55  (
56  IOobject::groupName(typeName, pair.name()),
57  pair.phase1().mesh().time().timeName(),
58  pair.phase1().mesh(),
59  IOobject::NO_READ,
60  IOobject::NO_WRITE,
61  registerObject
62  )
63  ),
64  pair_(pair)
65 {}
66 
67 
69 (
70  const dictionary& dict,
71  const phasePair& pair,
72  const bool registerObject
73 )
74 :
76  (
77  IOobject
78  (
79  IOobject::groupName(typeName, pair.name()),
80  pair.phase1().mesh().time().timeName(),
81  pair.phase1().mesh(),
84  registerObject
85  )
86  ),
87  pair_(pair),
89  (
90  dict.found("swarmCorrection")
91  ? swarmCorrection::New
92  (
93  dict.subDict("swarmCorrection"),
94  pair
95  )
96  : autoPtr<swarmCorrection>(new swarmCorrections::noSwarm(dict, pair))
97  )
98 {}
99 
100 
101 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
102 
104 {}
105 
106 
107 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
108 
110 {
111  return
112  0.75
113  *CdRe()
114  *swarmCorrection_->Cs()
115  *pair_.continuous().rho()
116  *pair_.continuous().thermo().nu()
117  /sqr(pair_.dispersed().d());
118 }
119 
120 
122 {
123  return max(pair_.dispersed(), pair_.dispersed().residualAlpha())*Ki();
124 }
125 
126 
128 {
129  return
130  max
131  (
134  )*fvc::interpolate(Ki());
135 }
136 
137 
138 bool Foam::dragModel::writeData(Ostream& os) const
139 {
140  return os.good();
141 }
142 
143 
144 // ************************************************************************* //
dictionary dict
const word & name() const
Return name.
Definition: IOobject.H:303
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
IOobject(const word &name, const fileName &instance, const objectRegistry &registry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true)
Construct from name, instance, registry, io options.
Definition: IOobject.C:177
virtual tmp< volScalarField > rho() const =0
Return the density field.
tmp< volScalarField > d() const
Return the Sauter-mean diameter.
static autoPtr< dragModel > New(const dictionary &dict, const phasePair &pair)
regIOobject(const IOobject &, const bool isTime=false)
Construct from IOobject. Optional flag for if IOobject is the.
Definition: regIOobject.C:42
virtual ~dragModel()
Destructor.
virtual tmp< surfaceScalarField > Kf() const
Return the drag coefficient Kf.
virtual tmp< volScalarField > K() const
Return the drag coefficient K.
Dimension set for the base types.
Definition: dimensionSet.H:120
dynamicFvMesh & mesh
virtual const phaseModel & continuous() const
Continuous phase.
bool writeData(Ostream &os) const
Dummy write for regIOobject.
const rhoThermo & thermo() const
Return const-access to phase rhoThermo.
Definition: phaseModel.H:120
static word groupName(Name name, const word &group)
dragModel(const phasePair &pair, const bool registerObject)
word timeName
Definition: getTimeIndex.H:3
virtual tmp< volScalarField > Ki() const
Return the phase-intensive drag coefficient Ki.
const dimensionedScalar & residualAlpha() const
Return the residual phase-fraction for given phase.
virtual const phaseModel & dispersed() const
Dispersed phase.
const phasePair & pair_
Phase pair.
Definition: dragModel.H:62
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
defineTypeNameAndDebug(combustionModel, 0)
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
static tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
static const dimensionSet dimK
Coefficient dimensions.
Definition: dragModel.H:93
const Time & time() const
Return time.
Definition: IOobject.C:328
virtual tmp< volScalarField > CdRe() const
Drag coefficient.
autoPtr< swarmCorrection > swarmCorrection_
Swarm correction.
Definition: dragModel.H:65
virtual tmp< volScalarField > nu() const
Kinematic viscosity of mixture [m^2/s].
Definition: fluidThermo.C:91
#define defineBlendedInterfacialModelTypeNameAndDebug(ModelType, DebugSwitch)
A class for managing temporary objects.
Definition: PtrList.H:53
bool & registerObject()
Register object created from this IOobject with registry if true.
Definition: IOobject.H:339
bool found
Namespace for OpenFOAM.