Skip to content
Snippets Groups Projects
Commit 0f192178 authored by Henry Weller's avatar Henry Weller
Browse files

reactingTwoPhaseEulerFoam: Update p_rgh following density changes

Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=2073
parent 940237b4
Branches
Tags
1 merge request!60Merge foundation
......@@ -85,6 +85,10 @@ while (pimple.correct())
{
// Update continuity errors due to temperature changes
fluid.correct();
volScalarField rho("rho", fluid.rho());
// Correct p_rgh for consistency with p and the updated densities
p_rgh = p - rho*gh;
// Correct fixed-flux BCs to be consistent with the velocity BCs
MRF.correctBoundaryFlux(U1, phi1);
......@@ -116,9 +120,6 @@ while (pimple.correct())
*rho2*U2.oldTime()/runTime.deltaT()
);
// Mean density for buoyancy force and p_rgh -> p
volScalarField rho("rho", fluid.rho());
surfaceScalarField ghSnGradRho
(
"ghSnGradRho",
......
......@@ -95,6 +95,10 @@ while (pimple.correct())
{
// Update continuity errors due to temperature changes
fluid.correct();
volScalarField rho("rho", fluid.rho());
// Correct p_rgh for consistency with p and the updated densities
p_rgh = p - rho*gh;
surfaceScalarField rhof1(fvc::interpolate(rho1));
surfaceScalarField rhof2(fvc::interpolate(rho2));
......@@ -115,7 +119,6 @@ while (pimple.correct())
max(alphaf2, phase2.residualAlpha())*rAUf2
);
volScalarField rho("rho", fluid.rho());
surfaceScalarField ghSnGradRho
(
"ghSnGradRho",
......@@ -389,12 +392,6 @@ while (pimple.correct())
}
}
Info<< "min(p) = " << min(p_rgh + rho*gh).value() << endl;
if (min(p_rgh + rho*gh) < pMin)
{
Info<< "Clipping p" << endl;
}
// Update and limit the static pressure
p = max(p_rgh + rho*gh, pMin);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment