diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/StandardChemistryModel/StandardChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/StandardChemistryModel/StandardChemistryModel.C index a8864b5256..9308097051 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/StandardChemistryModel/StandardChemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/StandardChemistryModel/StandardChemistryModel.C @@ -255,8 +255,7 @@ Foam::StandardChemistryModel::tc() const const label nReaction = reactions_.size(); - scalar pf, cf, pr, cr; - label lRef, rRef; + scalar omegaf, omegar; if (this->chemistry_) { @@ -279,12 +278,11 @@ Foam::StandardChemistryModel::tc() const forAll(reactions_, i) { const Reaction& R = reactions_[i]; - - R.omega(pi, Ti, c_, celli, pf, cf, lRef, pr, cr, rRef); + R.omega(pi, Ti, c_, celli, omegaf, omegar); forAll(R.rhs(), s) { - tc[celli] += R.rhs()[s].stoichCoeff*pf*cf; + tc[celli] += R.rhs()[s].stoichCoeff*omegaf; } } @@ -360,8 +358,7 @@ Foam::StandardChemistryModel::calculateRR reactionEvaluationScope scope(*this); - scalar pf, cf, pr, cr; - label lRef, rRef; + scalar omegaf, omegar; forAll(rho, celli) { @@ -376,16 +373,13 @@ Foam::StandardChemistryModel::calculateRR } const Reaction& R = reactions_[ri]; - const scalar omegai = R.omega - ( - pi, Ti, c_, celli, pf, cf, lRef, pr, cr, rRef - ); + const scalar omegaI = R.omega(pi, Ti, c_, celli, omegaf, omegar); forAll(R.lhs(), s) { if (si == R.lhs()[s].index) { - RR[celli] -= R.lhs()[s].stoichCoeff*omegai; + RR[celli] -= R.lhs()[s].stoichCoeff*omegaI; } } @@ -393,7 +387,7 @@ Foam::StandardChemistryModel::calculateRR { if (si == R.rhs()[s].index) { - RR[celli] += R.rhs()[s].stoichCoeff*omegai; + RR[celli] += R.rhs()[s].stoichCoeff*omegaI; } } diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.C index dd14ae8e29..4d51cf081b 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.C @@ -135,8 +135,7 @@ void Foam::TDACChemistryModel::omega { const bool reduced = mechRed_->active(); - scalar pf, cf, pr, cr; - label lRef, rRef; + scalar omegaf, omegar; dcdt = Zero; @@ -145,33 +144,26 @@ void Foam::TDACChemistryModel::omega if (!reactionsDisabled_[i]) { const Reaction& R = this->reactions_[i]; - - scalar omegai = R.omega - ( - p, T, c, li, pf, cf, lRef, pr, cr, rRef - ); + const scalar omegaI = R.omega(p, T, c, li, omegaf, omegar); forAll(R.lhs(), s) { - label si = R.lhs()[s].index; - if (reduced) - { - si = completeToSimplifiedIndex_[si]; - } - + const label si = + reduced + ? completeToSimplifiedIndex_[R.lhs()[s].index] + : R.lhs()[s].index; const scalar sl = R.lhs()[s].stoichCoeff; - dcdt[si] -= sl*omegai; + dcdt[si] -= sl*omegaI; } + forAll(R.rhs(), s) { - label si = R.rhs()[s].index; - if (reduced) - { - si = completeToSimplifiedIndex_[si]; - } - + const label si = + reduced + ? completeToSimplifiedIndex_[R.rhs()[s].index] + : R.rhs()[s].index; const scalar sr = R.rhs()[s].stoichCoeff; - dcdt[si] += sr*omegai; + dcdt[si] += sr*omegaI; } } } diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/DAC/DAC.C b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/DAC/DAC.C index 68f179e2c3..a4dc6fc309 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/DAC/DAC.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/DAC/DAC.C @@ -263,14 +263,13 @@ void Foam::chemistryReductionMethods::DAC::reduceMechanism // Index of the other species involved in the rABNum RectangularMatrix