ENH: Further update to pressure tools function object

This commit is contained in:
andy
2012-11-22 11:14:09 +00:00
parent be3793b7bb
commit 9f850b6cea
2 changed files with 10 additions and 5 deletions

View File

@ -154,14 +154,15 @@ Foam::tmp<Foam::volScalarField> Foam::pressureTools::pDyn
Foam::tmp<Foam::volScalarField> Foam::pressureTools::convertToCoeff Foam::tmp<Foam::volScalarField> Foam::pressureTools::convertToCoeff
( (
const volScalarField& p const volScalarField& pCalculated,
const volScalarField& pIn
) const ) const
{ {
tmp<volScalarField> tCoeff(p); tmp<volScalarField> tCoeff(pCalculated);
if (calcCoeff_) if (calcCoeff_)
{ {
tCoeff() /= pDyn(p); tCoeff() /= pDyn(pIn) + dimensionedScalar("p0", dimPressure, SMALL);
} }
return tCoeff; return tCoeff;
@ -271,7 +272,7 @@ void Foam::pressureTools::write()
obr_, obr_,
IOobject::NO_READ IOobject::NO_READ
), ),
convertToCoeff(rhoScale(p)*p + pDyn(p) + pRef()) convertToCoeff(rhoScale(p)*p + pDyn(p) + pRef(), p)
); );
pResult.write(); pResult.write();

View File

@ -153,7 +153,11 @@ class pressureTools
tmp<volScalarField> pDyn(const volScalarField& p) const; tmp<volScalarField> pDyn(const volScalarField& p) const;
//- Convert to coeff data by applying the pDyn scaling //- Convert to coeff data by applying the pDyn scaling
tmp<volScalarField> convertToCoeff(const volScalarField& p) const; tmp<volScalarField> convertToCoeff
(
const volScalarField& pCalculated,
const volScalarField& pIn
) const;
//- Disallow default bitwise copy construct //- Disallow default bitwise copy construct
pressureTools(const pressureTools&); pressureTools(const pressureTools&);