BUG: pressure FO - corrected handling of enumeration in calcPressure function. See #1356

This commit is contained in:
Andrew Heather
2019-07-09 11:44:52 +01:00
parent 1159aaa810
commit 5bd7c4b5bb

View File

@ -146,16 +146,15 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::pressure::calcPressure
const tmp<volScalarField>& tp
) const
{
switch (mode_)
{
case TOTAL:
if (mode_ & TOTAL)
{
return
tp
+ dimensionedScalar("pRef", dimPressure, pRef_)
+ rhoScale(p, 0.5*magSqr(lookupObject<volVectorField>(UName_)));
}
case ISENTROPIC:
if (mode_ & ISENTROPIC)
{
const basicThermo* thermoPtr =
p.mesh().lookupObjectPtr<basicThermo>(basicThermo::dictName);
@ -177,13 +176,8 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::pressure::calcPressure
return tp()*(pow(1 + (gamma - 1)/2*sqr(Mb), gamma/(gamma - 1)));
}
default:
{
return
tp
+ dimensionedScalar("pRef", dimPressure, pRef_);
}
}
return tp + dimensionedScalar("pRef", dimPressure, pRef_);
}
@ -207,11 +201,9 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::pressure::coeff
return tpCoeff;
}
else
{
return std::move(tp);
}
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //