pressureControl: Added p.correctBoundaryConditions() after the pressure limiting

to ensure boundary consistency.
This commit is contained in:
Henry Weller
2019-02-18 12:26:52 +00:00
parent e9f3811218
commit d2bddb8cca
8 changed files with 19 additions and 24 deletions

View File

@ -85,14 +85,16 @@ else
}
}
if (pressureControl.limit(p))
{
p.correctBoundaryConditions();
}
bool limitedp = pressureControl.limit(p);
// Thermodynamic density update
thermo.correctRho(psi*p - psip0);
if (limitedp)
{
rho = thermo.rho();
}
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"

View File

@ -99,14 +99,16 @@ else
}
}
if (pressureControl.limit(p))
{
p.correctBoundaryConditions();
}
bool limitedp = pressureControl.limit(p);
// Thermodynamic density update
thermo.correctRho(psi*p - psip0);
if (limitedp)
{
rho = thermo.rho();
}
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"

View File

@ -87,7 +87,7 @@ U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
fvOptions.correct(U);
bool pLimited = pressureControl.limit(p);
pressureControl.limit(p);
// For closed-volume cases adjust the pressure and density levels
// to obey overall mass continuity
@ -95,10 +95,6 @@ if (closedVolume)
{
p += (initialMass - fvc::domainIntegrate(psi*p))
/fvc::domainIntegrate(psi);
}
if (pLimited || closedVolume)
{
p.correctBoundaryConditions();
}

View File

@ -100,7 +100,7 @@ U = HbyA - rAtU*fvc::grad(p);
U.correctBoundaryConditions();
fvOptions.correct(U);
bool pLimited = pressureControl.limit(p);
pressureControl.limit(p);
// For closed-volume cases adjust the pressure and density levels
// to obey overall mass continuity
@ -108,10 +108,6 @@ if (closedVolume)
{
p += (initialMass - fvc::domainIntegrate(psi*p))
/fvc::domainIntegrate(psi);
}
if (pLimited || closedVolume)
{
p.correctBoundaryConditions();
}

View File

@ -87,6 +87,7 @@
{
p += (initialMass - fvc::domainIntegrate(psi*p))
/fvc::domainIntegrate(psi);
p.correctBoundaryConditions();
}
rho = thermo.rho();

View File

@ -93,10 +93,7 @@ constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF);
p = p_rgh + rho*gh;
if (pressureControl.limit(p))
{
p.correctBoundaryConditions();
}
pressureControl.limit(p);
// Thermodynamic density update
if (!mesh.steady())

View File

@ -66,7 +66,6 @@ p = p_rgh + rho*gh;
if (pressureControl.limit(p))
{
p.correctBoundaryConditions();
p_rgh = p - rho*gh;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -258,6 +258,8 @@ bool Foam::pressureControl::limit(volScalarField& p) const
}
}
p.correctBoundaryConditions();
return true;
}
else