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(),
78 RijPtr_[
k].storePrevIter();
83 const label fuelIndex = species.
find(fuelNames_[
k]);
84 const label oxidantIndex = species.
find(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(),
219 const label fuelIndex = species.
find(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.
find(fuelNames_[
k]);
251 const label oxidantIndex = species.
find(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>
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_);
static const word & zeroGradientType() noexcept
The type name for zeroGradient patch fields.
virtual void correct()
Correct combustion rate.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
void size(const label n)
Older name for setAddressableSize.
fvMatrix< scalar > fvScalarMatrix
const word zeroGradientType
A zeroGradient patch field type.
virtual tmp< volScalarField > Qdot() const
Heat release rate calculated from fuel consumption rate matrix.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
compressible::turbulenceModel & turb
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const speciesTable & species() const
Return the table of species.
label k
Boltzmann constant.
Ignore writing from objectRegistry::writeObject()
Lookup type of boundary radiation properties.
PtrList< volScalarField > & Y()
Return the mass-fraction fields.
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
Hold specie index and its coefficients in the reaction rate expression.
static word member(const word &name)
Return member (name without the extension)
#define forAll(list, i)
Loop across all elements in list.
psiReactionThermo & thermo
dimensionedScalar pos(const dimensionedScalar &ds)
const dimensionSet dimVolume(pow3(dimLength))
const dimensionedScalar e
Elementary charge.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
dimensionedScalar exp(const dimensionedScalar &ds)
Calculate the gradient of the given field.
A class for handling words, derived from Foam::string.
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
constexpr scalar pi(M_PI)
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Chemistry model wrapper for combustion models.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Abstract base class for turbulence models (RAS, LES and laminar).
int debug
Static debugging option.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry if present, and assign to T val. FatalIOError if it is found and the number of tokens i...
Diffusion based turbulent combustion model for multicomponent species.
Info<< "Reading field U\"<< 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\"<< endl;autoPtr< compressible::turbulenceModel > turbulence(compressible::turbulenceModel::New(rho, U, phi, thermo))
const dimensionSet dimEnergy
virtual tmp< fvScalarMatrix > R(volScalarField &Y) const
Fuel consumption rate matrix.
void relax(const scalar alpha)
Relax field (for steady-state solution).
A wordList with hashed named lookup, which can be faster in some situations than using the normal lis...
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
virtual bool read()
Update properties from given dictionary.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
PtrList< volScalarField > & Y
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Internal & ref(const bool updateAccessTime=true)
Same as internalFieldRef()
virtual basicSpecieMixture & composition()=0
Return the composition of the multi-component mixture.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
A class for managing temporary objects.
label find(const word &val) const
Find index of the value (searches the hash).
Defines the attributes of an object for which implicit objectRegistry management is supported...
Do not request registration (bool: false)
static constexpr const zero Zero
Global zero (0)