ENH: Adding pRef handling in pEqn.H for incompressible eqOfState in buoyantSimpleFoam

This commit is contained in:
sergio
2015-12-17 15:02:01 -08:00
parent fb504d8975
commit 23b99b5e3b

View File

@ -70,10 +70,22 @@
// For closed-volume cases adjust the pressure level
// to obey overall mass continuity
if (closedVolume && compressible)
if (closedVolume)
{
p += (initialMass - fvc::domainIntegrate(psi*p))
/fvc::domainIntegrate(psi);
if(!compressible)
{
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pRefCell)
);
}
else
{
p += (initialMass - fvc::domainIntegrate(psi*p))
/fvc::domainIntegrate(psi);
}
p_rgh = p - rho*gh;
}