multiphaseEuler::cellPressureCorrector: Added p_rgh update before PISO loop

to ensure consistency between p_rgh, p and the current phase densities updated
after the phase energy solution.
This commit is contained in:
Henry Weller
2023-09-15 08:13:13 +01:00
parent 6c24251a37
commit 9c3a404533

View File

@ -45,6 +45,11 @@ void Foam::solvers::multiphaseEuler::cellPressureCorrector()
{ {
volScalarField& p(p_); volScalarField& p(p_);
volScalarField rho("rho", fluid.rho());
// Correct p_rgh for consistency with the current density
p_rgh = p - rho*buoyancy.gh - buoyancy.pRef;
// Face volume fractions // Face volume fractions
PtrList<surfaceScalarField> alphafs(phases.size()); PtrList<surfaceScalarField> alphafs(phases.size());
forAll(phases, phasei) forAll(phases, phasei)
@ -108,8 +113,6 @@ void Foam::solvers::multiphaseEuler::cellPressureCorrector()
fluid.invADVs(As, HVms, invADVs, invADVfs); fluid.invADVs(As, HVms, invADVs, invADVfs);
} }
volScalarField rho("rho", fluid.rho());
// Explicit force fluxes // Explicit force fluxes
PtrList<surfaceScalarField> alphaByADfs; PtrList<surfaceScalarField> alphaByADfs;
PtrList<surfaceScalarField> FgByADfs; PtrList<surfaceScalarField> FgByADfs;
@ -219,7 +222,6 @@ void Foam::solvers::multiphaseEuler::cellPressureCorrector()
} }
} }
// --- Pressure corrector loop // --- Pressure corrector loop
while (pimple.correct()) while (pimple.correct())
{ {
@ -511,7 +513,6 @@ void Foam::solvers::multiphaseEuler::cellPressureCorrector()
// Correct p_rgh for consistency with p and the updated densities // Correct p_rgh for consistency with p and the updated densities
rho = fluid.rho(); rho = fluid.rho();
p_rgh = p - rho*buoyancy.gh - buoyancy.pRef; p_rgh = p - rho*buoyancy.gh - buoyancy.pRef;
p_rgh.correctBoundaryConditions();
} }
UEqns.clear(); UEqns.clear();