eddyDissipationModelBase.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 
29 
30 namespace Foam
31 {
32 namespace combustionModels
33 {
34 
35 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
36 
37 template<class ReactionThermo, class ThermoType>
38 eddyDissipationModelBase<ReactionThermo, ThermoType>::eddyDissipationModelBase
39 (
40  const word& modelType,
41  ReactionThermo& thermo,
43  const word& combustionProperties
44 )
45 :
46  singleStepCombustion<ReactionThermo, ThermoType>
47  (
48  modelType,
49  thermo,
50  turb,
51  combustionProperties
52  ),
53  CEDC_(this->coeffs().getScalar("CEDC"))
54 {}
55 
56 
57 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
58 
59 template<class ReactionThermo, class ThermoType>
62 {}
63 
64 
65 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
66 
67 template<class ReactionThermo, class ThermoType>
70 {
71  return
72  CEDC_*this->turbulence().epsilon()
73  / max
74  (
75  this->turbulence().k(),
76  dimensionedScalar("SMALL",sqr(dimVelocity), SMALL)
77  );
78 }
79 
80 
81 template<class ReactionThermo, class ThermoType>
83 {
85 
86  if (this->active())
87  {
88  this->singleMixturePtr_->fresCorrect();
89 
90  const label fuelI = this->singleMixturePtr_->fuelIndex();
91 
92  const volScalarField& YFuel = this->thermo_.composition().Y()[fuelI];
93 
94  const dimensionedScalar s = this->singleMixturePtr_->s();
95 
96  if (this->thermo_.composition().contains("O2"))
97  {
98  const volScalarField& YO2 = this->thermo_.composition().Y("O2");
99 
100  this->wFuel_ ==
101  this->rho()
102  * min(YFuel, YO2/s.value())
103  * timeScale();
104  }
105  else
106  {
108  << "You selected a combustion model that requires O2 mass"
109  << " to be present in the mixture"
110  << exit(FatalError);
111  }
112  }
113 }
114 
115 
116 template<class ReactionThermo, class ThermoType>
118 {
120  {
121  this->coeffs().readEntry("CEDC", CEDC_);
122  return true;
123  }
124 
125  return false;
126 }
127 
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 } // End namespace combustionModels
132 } // End namespace Foam
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
eddyDissipationModelBase.H
Foam::combustionModels::eddyDissipationModelBase::correct
void correct()
Correct combustion rate.
Definition: eddyDissipationModelBase.C:83
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
s
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Definition: gmvOutputSpray.H:25
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::combustionModels::eddyDissipationModelBase::~eddyDissipationModelBase
virtual ~eddyDissipationModelBase()
Destructor.
Definition: eddyDissipationModelBase.C:62
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
Foam::dimVelocity
const dimensionSet dimVelocity
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
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
Foam::combustionModels::singleStepCombustion
Base class for combustion models using singleStepReactingMixture.
Definition: singleStepCombustion.H:58
Foam::dimTime
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:53
Foam::combustionModels::eddyDissipationModelBase::read
virtual bool read()
Update properties.
Definition: eddyDissipationModelBase.C:118
Foam::combustionModels::eddyDissipationModelBase::rtTurb
tmp< volScalarField > rtTurb() const
Return the reciprocal of the turbulent mixing time scale.
Definition: eddyDissipationModelBase.C:70
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
Foam::FatalError
error FatalError
Foam::dimensioned< scalar >
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::dimMass
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:51
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
Foam::sqr
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Definition: dimensionedSymmTensor.C:51
k
label k
Boltzmann constant.
Definition: LISASMDCalcMethod2.H:41
Foam::dimVolume
const dimensionSet dimVolume(pow3(dimLength))
Definition: dimensionSets.H:60
Foam::GeometricField< scalar, fvPatchField, volMesh >
turb
compressible::turbulenceModel & turb
Definition: setRegionFluidFields.H:10
zeroGradientFvPatchFields.H
Foam::compressibleTurbulenceModel
Abstract base class for turbulence models (RAS, LES and laminar).
Definition: compressibleTurbulenceModel.H:54