mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: pressureTools function object - storing pressure result on database
This commit is contained in:
@ -218,6 +218,37 @@ Foam::pressureTools::pressureTools
|
|||||||
}
|
}
|
||||||
|
|
||||||
read(dict);
|
read(dict);
|
||||||
|
|
||||||
|
if (active_)
|
||||||
|
{
|
||||||
|
dimensionSet pDims(dimPressure);
|
||||||
|
|
||||||
|
if (calcCoeff_)
|
||||||
|
{
|
||||||
|
pDims /= dimPressure;
|
||||||
|
}
|
||||||
|
|
||||||
|
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
||||||
|
|
||||||
|
volScalarField* pPtr
|
||||||
|
(
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
pName(),
|
||||||
|
mesh.time().timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimensionedScalar("0", pDims, 0.0)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
mesh.objectRegistry::store(pPtr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -279,17 +310,13 @@ void Foam::pressureTools::write()
|
|||||||
{
|
{
|
||||||
const volScalarField& p = obr_.lookupObject<volScalarField>(pName_);
|
const volScalarField& p = obr_.lookupObject<volScalarField>(pName_);
|
||||||
|
|
||||||
volScalarField pResult
|
volScalarField& pResult =
|
||||||
(
|
const_cast<volScalarField&>
|
||||||
IOobject
|
|
||||||
(
|
(
|
||||||
pName(),
|
obr_.lookupObject<volScalarField>(pName())
|
||||||
obr_.time().timeName(),
|
);
|
||||||
obr_,
|
|
||||||
IOobject::NO_READ
|
pResult == convertToCoeff(rhoScale(p)*p + pDyn(p) + pRef());
|
||||||
),
|
|
||||||
convertToCoeff(rhoScale(p)*p + pDyn(p) + pRef())
|
|
||||||
);
|
|
||||||
|
|
||||||
pResult.write();
|
pResult.write();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user