diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H index ed802ba6d2cd197ff21bd5248d4ef1b2ab9c5b37..d1dcc87b410cf2e7d69604c7ae150aca89fd8189 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H @@ -1,4 +1,11 @@ -rho = thermo.rho(); +if (!pimple.SIMPLErho()) +{ + rho = thermo.rho(); +} + +// Thermodynamic density needs to be updated by psi*d(p) after the +// pressure solution +const volScalarField psip0(psi*p); volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); @@ -92,9 +99,11 @@ K = 0.5*magSqr(U); if (pressureControl.limit(p)) { p.correctBoundaryConditions(); - rho = thermo.rho(); } +thermo.correctRho(psi*p - psip0, rhoMin, rhoMax) ; +rho = thermo.rho(); + { rhoUf = fvc::interpolate(rho*U); surfaceVectorField n(mesh.Sf()/mesh.magSf());