buoyantPimpleFoam: Added support for incompressible closed-volume simulations

Resolves bug-report https://bugs.openfoam.org/view.php?id=2617
This commit is contained in:
Henry Weller
2017-07-17 16:48:27 +01:00
parent 12d5d001d2
commit 40ddc72045
3 changed files with 21 additions and 1 deletions

View File

@ -71,6 +71,21 @@ volScalarField p_rgh
// Force p_rgh to be consistent with p
p_rgh = p - rho*gh;
label pRefCell = 0;
scalar pRefValue = 0.0;
if (thermo.incompressible())
{
setRefCell
(
p,
p_rgh,
pimple.dict(),
pRefCell,
pRefValue
);
}
mesh.setFluxRequired(p_rgh.name());
Info<< "Creating field dpdt\n" << endl;

View File

@ -41,6 +41,11 @@ while (pimple.correctNonOrthogonal())
- fvm::laplacian(rhorAUf, p_rgh)
);
if (thermo.incompressible())
{
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
}
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
if (pimple.finalNonOrthogonalIter())

View File

@ -56,7 +56,7 @@
// For closed-volume cases adjust the pressure level
// to obey overall mass continuity
if (closedVolume)
if (!thermo.incompressible() && closedVolume)
{
p += (initialMass - fvc::domainIntegrate(psi*p))
/fvc::domainIntegrate(psi);