38 const scalar stoichCoeff =
reaction_.
lhs()[i].stoichCoeff;
47 const scalar stoichCoeff =
reaction_.
rhs()[i].stoichCoeff;
60 const label O2Index = thermo_.species()[
"O2"];
61 const scalar Wu = thermo_.WiValue(fuelIndex_);
65 thermo_.WiValue(thermo_.defaultSpecie())
66 *specieStoichCoeffs_[thermo_.defaultSpecie()]
67 + thermo_.WiValue(O2Index)*
mag(specieStoichCoeffs_[O2Index])
68 )/(Wu*
mag(specieStoichCoeffs_[fuelIndex_]));
70 s_ = thermo_.WiValue(O2Index)*
mag(specieStoichCoeffs_[O2Index])
71 /(Wu*
mag(specieStoichCoeffs_[fuelIndex_]));
73 Info <<
"stoichiometric air-fuel ratio: " << stoicRatio_.value() <<
endl;
74 Info <<
"stoichiometric oxygen-fuel ratio: " << s_.value() <<
endl;
81 scalar totalMol = 0.0;
84 label speciei = reaction_.rhs()[i].index;
85 totalMol +=
mag(specieStoichCoeffs_[speciei]);
92 const label speciei = reaction_.rhs()[i].index;
93 Xi[i] =
mag(specieStoichCoeffs_[speciei])/totalMol;
94 Wm += Xi[i]*thermo_.WiValue(speciei);
99 const label speciei = reaction_.rhs()[i].index;
100 Yprod0_[speciei] = thermo_.WiValue(speciei)/Wm*Xi[i];
103 Info <<
"Maximum products mass concentrations: " <<
nl;
108 Info<<
" " << thermo_.species()[i] <<
": " << Yprod0_[i] <<
nl;
113 forAll(specieStoichCoeffs_, i)
115 specieStoichCoeffs_[i] =
116 specieStoichCoeffs_[i]*thermo_.WiValue(i)
117 /(thermo_.WiValue(fuelIndex_)*
mag(specieStoichCoeffs_[fuelIndex_]));
126 const word& modelType,
129 const word& combustionProperties
133 reaction_(thermo_.species(), this->subDict(
"reaction")),
137 specieStoichCoeffs_(thermo_.species().size(), 0.0),
138 Yprod0_(thermo_.species().size(), 0.0),
139 fres_(Yprod0_.size()),
140 fuelIndex_(thermo_.species()[
thermo.properties().lookup(
"fuel")]),
141 specieProd_(Yprod0_.size(), 1),
146 this->
thermo().phasePropertyName(
"wFuel"),
155 semiImplicit_(
readBool(this->coeffs_.lookup(
"semiImplicit")))
162 this->mesh().time().name(),
186 Info<<
"Combustion mode: semi-implicit" <<
endl;
190 Info<<
"Combustion mode: explicit" <<
endl;
206 return wFuel_()*specieStoichCoeffs()[speciei];
213 const label specieI = thermo_.species()[
Y.member()];
217 wFuel_*specieStoichCoeffs()[specieI]
222 const label fNorm = specieProd()[specieI];
224 wSpecie /=
max(fNorm*(
Y - fres), scalar(1
e-2));
226 return -fNorm*wSpecie*fres + fNorm*
fvm::Sp(wSpecie,
Y);
230 return wSpecie +
fvm::Sp(0.0*wSpecie,
Y);
238 const label fuelI = fuelIndex();
242 return -qFuel()*(
R(YFuel) & YFuel);
261 const label O2Index = thermo_.species()[
"O2"];
266 forAll(reaction_.lhs(), i)
268 const label speciei = reaction_.lhs()[i].index;
269 if (speciei == fuelIndex_)
271 fres_[speciei] =
max(YFuel - YO2/s_, scalar(0));
273 else if (speciei == O2Index)
275 fres_[speciei] =
max(YO2 - YFuel*s_, scalar(0));
280 forAll(reaction_.rhs(), i)
282 const label speciei = reaction_.rhs()[i].index;
283 if (speciei != thermo_.defaultSpecie())
285 forAll(fres_[speciei], celli)
287 if (fres_[fuelIndex_][celli] > 0.0)
290 fres_[speciei][celli] =
292 * (1.0 + YO2[celli]/s_.value() - YFuel[celli]);
297 fres_[speciei][celli] =
301 - YO2[celli]/s_.value()*stoicRatio_.value()
302 + 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.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimless
void mag(LagrangianPatchField< scalar > &f, const LagrangianPatchField< Type > &f1)
const dimensionSet dimTime
const dimensionSet dimVolume
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
static scalar R(const scalar a, const scalar x)
void sqr(LagrangianPatchField< typename outerProduct< Type, Type >::type > &f, const LagrangianPatchField< Type > &f1)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
const dimensionSet dimMass
const dimensionSet dimVelocity
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
PtrList< volScalarField > & Y
fluidMulticomponentThermo & thermo