Go to the documentation of this file.
36 template<
class ReactionThermo,
class ThermoType>
42 this->coeffs().readIfPresent(
"YoxStream", YoxStream_);
43 this->coeffs().readIfPresent(
"YfStream", YfStream_);
44 this->coeffs().readIfPresent(
"sigma", sigma_);
45 this->coeffs().readIfPresent(
"ftCorr", ftCorr_);
46 this->coeffs().readIfPresent(
"alpha", alpha_);
47 this->coeffs().readIfPresent(
"laminarIgn", laminarIgn_);
54 const label nReactions = reactions_.size();
56 for (label
k=0;
k < nReactions;
k++)
66 this->mesh_.time().timeName(),
74 zeroGradientFvPatchScalarField::typeName
78 RijPtr_[
k].storePrevIter();
83 const label fuelIndex = species[fuelNames_[
k]];
84 const label oxidantIndex = species[oxidantNames_[
k]];
86 const scalar Wu = specieThermo_[fuelIndex].W();
87 const scalar Wox = specieThermo_[oxidantIndex].W();
91 const label specieI = lhs[i].index;
92 specieStoichCoeffs[specieI] = -lhs[i].stoichCoeff;
94 specieThermo_[specieI].hc()*lhs[i].stoichCoeff/Wu;
99 const label specieI = rhs[i].index;
100 specieStoichCoeffs[specieI] = rhs[i].stoichCoeff;
102 specieThermo_[specieI].hc()*rhs[i].stoichCoeff/Wu;
105 Info <<
"Fuel heat of combustion : " << qFuel_[
k] <<
endl;
108 (Wox*
mag(specieStoichCoeffs[oxidantIndex]))
109 / (Wu*
mag(specieStoichCoeffs[fuelIndex]));
111 Info <<
"stoichiometric oxygen-fuel ratio : " << s_[
k] <<
endl;
113 stoicRatio_[
k] = s_[
k]*YfStream_[
k]/YoxStream_[
k];
115 Info <<
"stoichiometric air-fuel ratio : " << stoicRatio_[
k] <<
endl;
117 const scalar fStoich = 1.0/(1.0 + stoicRatio_[
k]);
119 Info <<
"stoichiometric mixture fraction : " << fStoich <<
endl;
126 template<
class ReactionThermo,
class ThermoType>
130 const word& modelType,
133 const word& combustionProperties
152 RijPtr_(reactions_.size()),
153 Ci_(reactions_.size(), 1.0),
154 fuelNames_(this->coeffs().
lookup(
"fuels")),
155 oxidantNames_(this->coeffs().
lookup(
"oxidants")),
156 qFuel_(reactions_.size()),
157 stoicRatio_(reactions_.size()),
158 s_(reactions_.size()),
159 YoxStream_(reactions_.size(), 0.23),
160 YfStream_(reactions_.size(), 1.0),
161 sigma_(reactions_.size(), 0.02),
162 oxidantRes_(this->coeffs().
lookup(
"oxidantRes")),
163 ftCorr_(reactions_.size(),
Zero),
173 template<
class ReactionThermo,
class ThermoType>
177 return this->chemistryPtr_->tc();
181 template<
class ReactionThermo,
class ThermoType>
190 const label nReactions = reactions_.size();
194 for (label
k=0;
k < nReactions;
k++)
204 this->mesh_.time().timeName(),
212 zeroGradientFvPatchScalarField::typeName
219 const label fuelIndex = species[fuelNames_[
k]];
223 Rijl.
ref() = -this->chemistryPtr_->calculateRR(
k, fuelIndex);
234 const label lIndex = lhs[l].index;
235 this->chemistryPtr_->RR(lIndex) =
241 const label rIndex = rhs[l].index;
242 this->chemistryPtr_->RR(rIndex) =
248 for (label
k=0;
k < nReactions;
k++)
250 const label fuelIndex = species[fuelNames_[
k]];
251 const label oxidantIndex = species[oxidantNames_[
k]];
263 s_[
k]*Yfuel - (Yox - YoxStream_[
k])
266 s_[
k]*YfStream_[
k] + YoxStream_[
k]
270 const scalar
sigma = sigma_[
k];
272 const scalar fStoich = 1.0/(1.0 + stoicRatio_[
k]) + ftCorr_[
k];
277 Yox/
max(oxidantRes_[
k], 1
e-3)
283 1.0 +
sqr(OAvailScaled)
311 min(RijkDiff, topHatFilter*RijlPtr[
k]*
pos(Yox)*
pos(Yfuel));
320 if (
debug && this->mesh_.time().writeTime())
330 scalar fuelStoic = 1.0;
333 const label lIndex = lhs[l].index;
334 if (lIndex == fuelIndex)
336 fuelStoic = lhs[l].stoichCoeff;
341 const scalar MwFuel = specieThermo_[fuelIndex].W();
346 const label lIndex = lhs[l].index;
348 const scalar stoichCoeff = lhs[l].stoichCoeff;
350 this->chemistryPtr_->RR(lIndex) +=
351 -Rijk*stoichCoeff*specieThermo_[lIndex].W()/fuelStoic/MwFuel;
358 const label rIndex = rhs[r].index;
360 const scalar stoichCoeff = rhs[r].stoichCoeff;
362 this->chemistryPtr_->RR(rIndex) +=
363 Rijk*stoichCoeff*specieThermo_[rIndex].W()/fuelStoic/MwFuel;
370 template<
class ReactionThermo,
class ThermoType>
383 const label specieI =
386 Su += this->chemistryPtr_->RR(specieI);
393 template<
class ReactionThermo,
class ThermoType>
413 zeroGradientFvPatchScalarField::typeName
420 Qdot = this->chemistryPtr_->Qdot();
427 template<
class ReactionThermo,
class ThermoType>
433 this->coeffs().readIfPresent(
"Ci", Ci_);
434 this->coeffs().readIfPresent(
"sigma", sigma_);
435 this->coeffs().readIfPresent(
"oxidantRes", oxidantRes_);
436 this->coeffs().readIfPresent(
"ftCorr", ftCorr_);
437 this->coeffs().readIfPresent(
"alpha", alpha_);
438 this->coeffs().readIfPresent(
"laminarIgn", laminarIgn_);
int debug
Static debugging option.
virtual tmp< volScalarField > Qdot() const
Heat release rate calculated from fuel consumption rate matrix.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
A class for handling words, derived from Foam::string.
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))
A class for managing temporary objects.
static constexpr const zero Zero
Global zero (0)
const dimensionSet dimEnergy
psiReactionThermo & thermo
const speciesTable & species() const
Return the table of species.
virtual tmp< fvScalarMatrix > R(volScalarField &Y) const
Fuel consumption rate matrix.
tmp< GeometricField< typename outerProduct< vector, Type >::type, faPatchField, areaMesh >> grad(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Ostream & endl(Ostream &os)
Add newline and flush stream.
const T * set(const label i) const
Return const pointer to element (can be nullptr),.
dimensionedScalar exp(const dimensionedScalar &ds)
PtrList< volScalarField > & Y()
Return the mass-fraction fields.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
#define forAll(list, i)
Loop across all elements in list.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
fvMatrix< scalar > fvScalarMatrix
A wordList with hashed named lookup, which can be faster in some situations than using the normal lis...
Chemistry model wrapper for combustion models.
messageStream Info
Information stream (stdout output on master, null elsewhere)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
virtual void correct()
Correct combustion rate.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Lookup type of boundary radiation properties.
Diffusion based turbulent combustion model for multicomponent species.
virtual basicSpecieMixture & composition()=0
Return the composition of the multi-component mixture.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
PtrList< volScalarField > & Y
virtual bool read()
Update properties from given dictionary.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
constexpr scalar pi(M_PI)
Internal & ref(const bool updateAccessTime=true)
Return a reference to the dimensioned internal field.
dimensionedScalar sqrt(const dimensionedScalar &ds)
Calculate the gradient of the given field.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label k
Boltzmann constant.
const dimensionedScalar e
Elementary charge.
void relax(const scalar alpha)
Relax field (for steady-state solution).
A special matrix type and solver, designed for finite volume solutions of scalar equations....
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type set(const label i, bool val=true)
A bitSet::set() method for a list of bool.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
const dimensionSet dimVolume(pow3(dimLength))
compressible::turbulenceModel & turb
Abstract base class for turbulence models (RAS, LES and laminar).
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
dimensionedScalar pos(const dimensionedScalar &ds)