From 23b99b5e3b9455424b3761e29dd55c5dd778031c Mon Sep 17 00:00:00 2001 From: sergio Date: Thu, 17 Dec 2015 15:02:01 -0800 Subject: [PATCH] ENH: Adding pRef handling in pEqn.H for incompressible eqOfState in buoyantSimpleFoam --- .../heatTransfer/buoyantSimpleFoam/pEqn.H | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H index dafbf707e7..2d08a681ed 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H @@ -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; }