chtMultiRegionFoam,reactingParcelFoam: Improved pressure and density limiting

This commit is contained in:
Henry Weller
2019-02-15 10:28:15 +00:00
parent f9cb8e21d9
commit e9f3811218
2 changed files with 13 additions and 14 deletions

View File

@ -93,6 +93,11 @@ constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF);
p = p_rgh + rho*gh;
if (pressureControl.limit(p))
{
p.correctBoundaryConditions();
}
// Thermodynamic density update
if (!mesh.steady())
{
@ -117,8 +122,6 @@ else
#include "incompressible/continuityErrs.H"
}
// Pressure limiting
const bool pLimited = pressureControl.limit(p);
// For closed-volume compressible cases adjust the pressure level
// to obey overall mass continuity
@ -127,15 +130,11 @@ if (adjustMass)
p += (initialMass - fvc::domainIntegrate(thermo.rho()))
/fvc::domainIntegrate(psi);
p_rgh = p - rho*gh;
}
if (adjustMass || pLimited)
{
p.correctBoundaryConditions();
}
// Density updates
if (adjustMass || pLimited || mesh.steady() || pimple.simpleRho())
if (adjustMass || mesh.steady() || pimple.simpleRho())
{
rho = thermo.rho();
}

View File

@ -64,19 +64,19 @@ while (pimple.correctNonOrthogonal())
p = p_rgh + rho*gh;
if (pressureControl.limit(p))
{
p.correctBoundaryConditions();
p_rgh = p - rho*gh;
}
// Thermodynamic density update
thermo.correctRho(psi*p - psip0);
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"
if (pressureControl.limit(p))
{
p.correctBoundaryConditions();
rho = thermo.rho();
p_rgh = p - rho*gh;
}
else if (pimple.simpleRho())
if (pimple.simpleRho())
{
rho = thermo.rho();
}