40 const scalar stoichCoeff =
reaction_.
lhs()[i].stoichCoeff;
49 const scalar stoichCoeff =
reaction_.
rhs()[i].stoichCoeff;
62 const label O2Index = thermo_.species()[
"O2"];
63 const scalar Wu = thermo_.WiValue(fuelIndex_);
67 thermo_.WiValue(thermo_.defaultSpecie())
68 *specieStoichCoeffs_[thermo_.defaultSpecie()]
69 + thermo_.WiValue(O2Index)*
mag(specieStoichCoeffs_[O2Index])
70 )/(Wu*
mag(specieStoichCoeffs_[fuelIndex_]));
72 s_ = thermo_.WiValue(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]*thermo_.WiValue(speciei);
101 const label speciei = reaction_.rhs()[i].index;
102 Yprod0_[speciei] = thermo_.WiValue(speciei)/Wm*Xi[i];
105 Info <<
"Maximum products mass concentrations: " <<
nl;
110 Info<<
" " << thermo_.species()[i] <<
": " << Yprod0_[i] <<
nl;
115 forAll(specieStoichCoeffs_, i)
117 specieStoichCoeffs_[i] =
118 specieStoichCoeffs_[i]*thermo_.WiValue(i)
119 /(thermo_.WiValue(fuelIndex_)*
mag(specieStoichCoeffs_[fuelIndex_]));
128 const word& modelType,
131 const word& combustionProperties
135 reaction_(thermo_.species(), this->subDict(
"reaction")),
139 specieStoichCoeffs_(thermo_.species().size(), 0.0),
140 Yprod0_(thermo_.species().size(), 0.0),
141 fres_(Yprod0_.size()),
142 fuelIndex_(thermo_.species()[
thermo.properties().lookup(
"fuel")]),
143 specieProd_(Yprod0_.size(), 1),
148 this->
thermo().phasePropertyName(
"wFuel"),
149 this->mesh().time().
name(),
157 semiImplicit_(
readBool(this->coeffs_.lookup(
"semiImplicit")))
164 this->mesh().time().name(),
188 Info<<
"Combustion mode: semi-implicit" <<
endl;
192 Info<<
"Combustion mode: explicit" <<
endl;
208 return wFuel_()*specieStoichCoeffs()[speciei];
215 const label specieI = thermo_.species()[
Y.member()];
219 wFuel_*specieStoichCoeffs()[specieI]
224 const label fNorm = specieProd()[specieI];
226 wSpecie /=
max(fNorm*(
Y - fres), scalar(1
e-2));
228 return -fNorm*wSpecie*fres + fNorm*
fvm::Sp(wSpecie,
Y);
232 return wSpecie +
fvm::Sp(0.0*wSpecie,
Y);
240 const label fuelI = fuelIndex();
244 return -qFuel()*(
R(YFuel) & YFuel);
263 const label O2Index = thermo_.species()[
"O2"];
268 forAll(reaction_.lhs(), i)
270 const label speciei = reaction_.lhs()[i].index;
271 if (speciei == fuelIndex_)
273 fres_[speciei] =
max(YFuel - YO2/s_, scalar(0));
275 else if (speciei == O2Index)
277 fres_[speciei] =
max(YO2 - YFuel*s_, scalar(0));
282 forAll(reaction_.rhs(), i)
284 const label speciei = reaction_.rhs()[i].index;
285 if (speciei != thermo_.defaultSpecie())
287 forAll(fres_[speciei], celli)
289 if (fres_[fuelIndex_][celli] > 0.0)
292 fres_[speciei][celli] =
294 * (1.0 + YO2[celli]/s_.value() - YFuel[celli]);
299 fres_[speciei][celli] =
303 - YO2[celli]/s_.value()*stoicRatio_.value()
304 + 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...
Base class for combustion models.
const fluidMulticomponentThermo & thermo_
Reference to the thermo.
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.
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.
virtual scalar hfiValue(const label speciei) const =0
Enthalpy of formation [J/kg].
virtual const speciesTable & species() const =0
The table of species.
virtual scalar WiValue(const label speciei) const =0
Molecular weight [kg/kmol].
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 > &)
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.
word name(const bool)
Return a word representation of a bool.
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
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
PtrList< volScalarField > & Y
fluidMulticomponentThermo & thermo