reactingParcelFoam: Updated density handling for consistency with rhoPimpleFoam

This commit is contained in:
Henry Weller
2020-01-29 15:02:50 +00:00
parent b55bc28698
commit 58b2efd622
2 changed files with 15 additions and 5 deletions

View File

@ -64,7 +64,9 @@ while (pimple.correctNonOrthogonal())
p = p_rgh + rho*gh;
if (pressureControl.limit(p))
bool limitedp = pressureControl.limit(p);
if (limitedp)
{
p_rgh = p - rho*gh;
}
@ -72,6 +74,11 @@ if (pressureControl.limit(p))
// Thermodynamic density update
thermo.correctRho(psi*p - psip0);
if (limitedp)
{
rho = thermo.rho();
}
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -94,7 +94,10 @@ int main(int argc, char *argv[])
if (solvePrimaryRegion)
{
#include "rhoEqn.H"
if (pimple.firstPimpleIter() && !pimple.simpleRho())
{
#include "rhoEqn.H"
}
// --- PIMPLE loop
while (pimple.loop())
@ -114,10 +117,10 @@ int main(int argc, char *argv[])
turbulence->correct();
}
}
rho = thermo.rho();
}
rho = thermo.rho();
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"