mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
StandardChemistryModel::calculateRR: Added specie stoichiometric coefficients to individual specie reaction rates
Used by specieReactionRates functionObject
This commit is contained in:
@ -118,7 +118,7 @@ void Foam::StandardChemistryModel<ReactionThermo, ThermoType>::omega
|
|||||||
{
|
{
|
||||||
const Reaction<ThermoType>& R = reactions_[i];
|
const Reaction<ThermoType>& R = reactions_[i];
|
||||||
|
|
||||||
scalar omegai = omega
|
const scalar omegai = omega
|
||||||
(
|
(
|
||||||
R, c, T, p, pf, cf, lRef, pr, cr, rRef
|
R, c, T, p, pf, cf, lRef, pr, cr, rRef
|
||||||
);
|
);
|
||||||
@ -587,9 +587,6 @@ Foam::StandardChemistryModel<ReactionThermo, ThermoType>::calculateRR
|
|||||||
const label si
|
const label si
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
scalar pf, cf, pr, cr;
|
|
||||||
label lRef, rRef;
|
|
||||||
|
|
||||||
tmp<volScalarField::Internal> tRR
|
tmp<volScalarField::Internal> tRR
|
||||||
(
|
(
|
||||||
new volScalarField::Internal
|
new volScalarField::Internal
|
||||||
@ -615,6 +612,9 @@ Foam::StandardChemistryModel<ReactionThermo, ThermoType>::calculateRR
|
|||||||
const scalarField& T = this->thermo().T();
|
const scalarField& T = this->thermo().T();
|
||||||
const scalarField& p = this->thermo().p();
|
const scalarField& p = this->thermo().p();
|
||||||
|
|
||||||
|
scalar pf, cf, pr, cr;
|
||||||
|
label lRef, rRef;
|
||||||
|
|
||||||
forAll(rho, celli)
|
forAll(rho, celli)
|
||||||
{
|
{
|
||||||
const scalar rhoi = rho[celli];
|
const scalar rhoi = rho[celli];
|
||||||
@ -627,21 +627,26 @@ Foam::StandardChemistryModel<ReactionThermo, ThermoType>::calculateRR
|
|||||||
c_[i] = rhoi*Yi/specieThermo_[i].W();
|
c_[i] = rhoi*Yi/specieThermo_[i].W();
|
||||||
}
|
}
|
||||||
|
|
||||||
const scalar w = omegaI
|
const Reaction<ThermoType>& R = reactions_[ri];
|
||||||
(
|
const scalar omegai = omega(R, c_, Ti, pi, pf, cf, lRef, pr, cr, rRef);
|
||||||
ri,
|
|
||||||
c_,
|
|
||||||
Ti,
|
|
||||||
pi,
|
|
||||||
pf,
|
|
||||||
cf,
|
|
||||||
lRef,
|
|
||||||
pr,
|
|
||||||
cr,
|
|
||||||
rRef
|
|
||||||
);
|
|
||||||
|
|
||||||
RR[celli] = w*specieThermo_[si].W();
|
forAll(R.lhs(), s)
|
||||||
|
{
|
||||||
|
if (si == R.lhs()[s].index)
|
||||||
|
{
|
||||||
|
RR[celli] -= R.lhs()[s].stoichCoeff*omegai;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
forAll(R.rhs(), s)
|
||||||
|
{
|
||||||
|
if (si == R.rhs()[s].index)
|
||||||
|
{
|
||||||
|
RR[celli] += R.rhs()[s].stoichCoeff*omegai;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RR[celli] *= specieThermo_[si].W();
|
||||||
}
|
}
|
||||||
|
|
||||||
return tRR;
|
return tRR;
|
||||||
|
|||||||
Reference in New Issue
Block a user