Skip to content

Commit

Permalink
BUG: avoid calculation of rho field for every cell in PaSR combustion…
Browse files Browse the repository at this point in the history
… model
  • Loading branch information
andy committed Jul 5, 2012
1 parent 6d99f42 commit b8f3384
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions src/combustionModels/PaSR/PaSR.C
Expand Up @@ -94,35 +94,29 @@ void Foam::combustionModels::PaSR<CombThermoType>::correct()

if (turbulentReaction_)
{
tmp<volScalarField> trho(this->rho());
const volScalarField& rho = trho();
tmp<volScalarField> tepsilon(this->turbulence().epsilon());
const volScalarField& epsilon = tepsilon();
tmp<volScalarField> tmuEff(this->turbulence().muEff());
const volScalarField& muEff = tmuEff();
tmp<volScalarField> ttc(tc());
const volScalarField& tc = ttc();

const scalar dt = this->mesh().time().deltaTValue();

forAll(epsilon, i)
{
if (epsilon[i] > 0)
{
const dimensionedScalar e0
(
"e0",
sqr(dimLength)/pow3(dimTime), SMALL
);

scalar tk =
Cmix_.value()
*Foam::sqrt
(
muEff[i]/this->rho()()[i]/(epsilon[i] + e0.value())
);
*Foam::sqrt(muEff[i]/rho[i]/(epsilon[i] + SMALL));

// Chalmers PaSR model
if (!useReactionRate_)
{
kappa_[i] =
( this->mesh().time().deltaTValue() + tc[i])
/( this->mesh().time().deltaTValue() + tc[i] + tk);
kappa_[i] = (dt + tc[i])/(dt + tc[i] + tk);
}
else
{
Expand Down

0 comments on commit b8f3384

Please sign in to comment.