40 const scalar stoichCoeff =
reaction_.
lhs()[i].stoichCoeff;
49 const scalar stoichCoeff =
reaction_.
rhs()[i].stoichCoeff;
62 const label O2Index = mixture_.species()[
"O2"];
63 const scalar Wu = mixture_.Wi(fuelIndex_);
67 mixture_.Wi(mixture_.defaultSpecie())
68 *specieStoichCoeffs_[mixture_.defaultSpecie()]
69 + mixture_.Wi(O2Index)*
mag(specieStoichCoeffs_[O2Index])
70 )/(Wu*
mag(specieStoichCoeffs_[fuelIndex_]));
72 s_ = mixture_.Wi(O2Index)*
mag(specieStoichCoeffs_[O2Index])
73 /(Wu*
mag(specieStoichCoeffs_[fuelIndex_]));
75 Info <<
"stoichiometric air-fuel ratio: " << stoicRatio_.value() <<
endl;
76 Info <<
"stoichiometric oxygen-fuel ratio: " << s_.value() <<
endl;
83 scalar totalMol = 0.0;
86 label speciei = reaction_.rhs()[i].index;
87 totalMol +=
mag(specieStoichCoeffs_[speciei]);
94 const label speciei = reaction_.rhs()[i].index;
95 Xi[i] =
mag(specieStoichCoeffs_[speciei])/totalMol;
96 Wm += Xi[i]*mixture_.Wi(speciei);
101 const label speciei = reaction_.rhs()[i].index;
102 Yprod0_[speciei] = mixture_.Wi(speciei)/Wm*Xi[i];
105 Info <<
"Maximum products mass concentrations: " <<
nl;
110 Info<<
" " << mixture_.species()[i] <<
": " << Yprod0_[i] <<
nl;
115 forAll(specieStoichCoeffs_, i)
117 specieStoichCoeffs_[i] =
118 specieStoichCoeffs_[i]*mixture_.Wi(i)
119 /(mixture_.Wi(fuelIndex_)*
mag(specieStoichCoeffs_[fuelIndex_]));
128 const word& modelType,
131 const word& combustionProperties
136 reaction_(mixture_.species(), this->subDict(
"reaction")),
140 specieStoichCoeffs_(mixture_.species().size(), 0.0),
141 Yprod0_(mixture_.species().size(), 0.0),
142 fres_(Yprod0_.size()),
143 fuelIndex_(mixture_.species()[
thermo.properties().lookup(
"fuel")]),
144 specieProd_(Yprod0_.size(), 1),
149 this->
thermo().phasePropertyName(
"wFuel"),
150 this->mesh().time().
name(),
158 semiImplicit_(
readBool(this->coeffs_.lookup(
"semiImplicit")))
165 this->mesh().time().name(),
189 Info<<
"Combustion mode: semi-implicit" <<
endl;
193 Info<<
"Combustion mode: explicit" <<
endl;
209 return wFuel_()*specieStoichCoeffs()[speciei];
216 const label specieI = mixture_.species()[
Y.member()];
220 wFuel_*specieStoichCoeffs()[specieI]
225 const label fNorm = specieProd()[specieI];
227 wSpecie /=
max(fNorm*(
Y - fres), scalar(1
e-2));
229 return -fNorm*wSpecie*fres + fNorm*
fvm::Sp(wSpecie,
Y);
233 return wSpecie +
fvm::Sp(0.0*wSpecie,
Y);
241 const label fuelI = fuelIndex();
245 return -qFuel()*(
R(YFuel) & YFuel);
264 const label O2Index = mixture_.species()[
"O2"];
269 forAll(reaction_.lhs(), i)
271 const label speciei = reaction_.lhs()[i].index;
272 if (speciei == fuelIndex_)
274 fres_[speciei] =
max(YFuel - YO2/s_, scalar(0));
276 else if (speciei == O2Index)
278 fres_[speciei] =
max(YO2 - YFuel*s_, scalar(0));
283 forAll(reaction_.rhs(), i)
285 const label speciei = reaction_.rhs()[i].index;
286 if (speciei != mixture_.defaultSpecie())
288 forAll(fres_[speciei], celli)
290 if (fres_[fuelIndex_][celli] > 0.0)
293 fres_[speciei][celli] =
295 * (1.0 + YO2[celli]/s_.value() - YFuel[celli]);
300 fres_[speciei][celli] =
304 - YO2[celli]/s_.value()*stoicRatio_.value()
305 + YFuel[celli]*stoicRatio_.value()
#define forAll(list, i)
Loop across all elements in list.
Generic GeometricField class.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Specialisation of basicMixture for a mixture consisting of a number for molecular species.
virtual scalar Wi(const label speciei) const =0
Molecular weight of the given specie [kg/kmol].
const speciesTable & species() const
Return the table of species.
virtual scalar Hf(const label speciei) const =0
Enthalpy of formation [J/kg].
Base class for combustion models.
const fvMesh & mesh() const
Return const access to the mesh database.
virtual bool read()
Update properties from given dictionary.
void fresCorrect()
Calculates the residual for all components.
label fuelIndex_
Fuel specie index.
void calculateMaxProducts()
Calculate maximum products at stoichiometric mixture.
reaction reaction_
The single-step reaction.
const basicSpecieMixture & mixture_
Reference to the mixture.
List< int > specieProd_
List to indicate if specie is produced/consumed.
PtrList< volScalarField > fres_
List of components residual.
singleStepCombustion(const word &modelType, const fluidMulticomponentThermo &thermo, const compressibleMomentumTransportModel &turb, const word &combustionProperties)
Construct from components.
void massAndAirStoichRatios()
Calculate air/fuel and oxygen/fuel ratio.
scalarList specieStoichCoeffs_
Stoichiometric coefficient for the reaction.
virtual tmp< volScalarField::Internal > R(const label speciei) const
Specie consumption rate field.
void calculateqFuel()
Calculate qFuel.
bool semiImplicit_
Semi-implicit (true) or explicit (false) treatment.
virtual ~singleStepCombustion()
Destructor.
virtual tmp< volScalarField > Qdot() const
Heat release rate [kg/m/s^3].
dimensionedScalar qFuel_
Heat of combustion [J/Kg].
virtual bool read()
Update properties from given dictionary.
Base class for single-phase compressible turbulence models.
const Type & value() const
Return const reference to value.
Base-class for multi-component fluid thermodynamic properties.
const List< specieCoeffs > & lhs() const
Return the components of the left hand side.
const List< specieCoeffs > & rhs() const
Return the components of the right hand side.
A class for managing temporary objects.
A class for handling words, derived from string.
Calculate the matrix for implicit and explicit sources.
tmp< fvMatrix< Type > > Sp(const volScalarField::Internal &, const VolField< Type > &)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimless
const dimensionSet dimTime
const dimensionSet dimVolume
dimensioned< scalar > mag(const dimensioned< Type > &)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
static scalar R(const scalar a, const scalar x)
const dimensionSet dimMass
const dimensionSet dimVelocity
word name(const complex &)
Return a string representation of a complex.
PtrList< volScalarField > & Y
fluidMulticomponentThermo & thermo