eddyDissipationDiffusionModel.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) 2016-2019 OpenCFD Ltd
9 -------------------------------------------------------------------------------
10 License
11 
12  OpenFOAM is free software: you can redistribute it and/or modify it
13  under the terms of the GNU General Public License as published by
14  the Free Software Foundation, either version 3 of the License, or
15  (at your option) any later version.
16 
17  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
18  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20  for more details.
21 
22  You should have received a copy of the GNU General Public License
23  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
24 
25 \*---------------------------------------------------------------------------*/
26 
28 
29 namespace Foam
30 {
31 namespace combustionModels
32 {
33 
34 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
35 
36 template<class ReactionThermo, class ThermoType>
37 eddyDissipationDiffusionModel<ReactionThermo, ThermoType>::
38 eddyDissipationDiffusionModel
39 (
40  const word& modelType,
41  ReactionThermo& thermo,
43  const word& combustionProperties
44 )
45 :
46  eddyDissipationModelBase<ReactionThermo, ThermoType>
47  (
48  modelType,
49  thermo,
50  turb,
51  combustionProperties
52  ),
53  Cd_(this->coeffs().getScalar("Cd"))
54 {}
55 
56 
57 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
58 
59 template<class ReactionThermo, class ThermoType>
62 {}
63 
64 
65 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
66 
67 
68 template<class ReactionThermo, class ThermoType>
71 {
72  return (max(this->rtTurb(), this->rtDiff()));
73 }
74 
75 
76 template<class ReactionThermo, class ThermoType>
79 {
80  tmp<volScalarField> tdelta
81  (
82  new volScalarField
83  (
84  IOobject
85  (
86  "tdelta",
87  this->mesh().time().timeName(),
88  this->mesh(),
91  ),
92  this->mesh(),
94  zeroGradientFvPatchScalarField::typeName
95  )
96  );
97 
98  volScalarField& delta = tdelta.ref();
99  delta.ref() = cbrt(this->mesh().V());
100  delta.correctBoundaryConditions();
101 
102  // NOTE: Assume Prt = 1
103  return Cd_*this->turbulence().nuEff()/sqr(delta);
104 }
105 
106 
107 template<class ReactionThermo, class ThermoType>
109 {
111  {
112  this->coeffs().readEntry("Cd", Cd_);
113  return true;
114  }
115 
116  return false;
117 }
118 
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 } // End namespace combustionModels
123 } // End namespace Foam
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::IOobject::NO_WRITE
Definition: IOobject.H:195
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
Foam::combustionModels::eddyDissipationModelBase
Standard Eddy Dissipation Model based on the assumption that the reaction rates are controlled by the...
Definition: eddyDissipationModelBase.H:57
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
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::dimLength
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:52
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
eddyDissipationDiffusionModel.H
Foam::tmp::ref
T & ref() const
Definition: tmpI.H:227
Foam::combustionModels::eddyDissipationDiffusionModel::read
virtual bool read()
Update properties.
Definition: eddyDissipationDiffusionModel.C:109
delta
scalar delta
Definition: LISASMDCalcMethod2.H:8
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:42
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
timeName
word timeName
Definition: getTimeIndex.H:3
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::combustionModels::eddyDissipationDiffusionModel::rtDiff
tmp< volScalarField > rtDiff() const
Return the reciprocal of the diffusion time scale.
Definition: eddyDissipationDiffusionModel.C:79
Foam::sqr
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Definition: dimensionedSymmTensor.C:51
Foam::cbrt
dimensionedScalar cbrt(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:155
Foam::GeometricField< scalar, fvPatchField, volMesh >
turb
compressible::turbulenceModel & turb
Definition: setRegionFluidFields.H:10
Foam::IOobject::NO_READ
Definition: IOobject.H:188
Foam::combustionModels::eddyDissipationDiffusionModel::timeScale
virtual tmp< volScalarField > timeScale()
Calculate time scale.
Definition: eddyDissipationDiffusionModel.C:71
Foam::combustionModels::eddyDissipationDiffusionModel::~eddyDissipationDiffusionModel
virtual ~eddyDissipationDiffusionModel()
Destructor.
Definition: eddyDissipationDiffusionModel.C:62
Foam::compressibleTurbulenceModel
Abstract base class for turbulence models (RAS, LES and laminar).
Definition: compressibleTurbulenceModel.H:54