solvers/modules/fluid/isothermalFluid/correctPressure: Corrected transonic option for moving meshes

This change resolves a mass-conservation issue caused by the handling of
absolute and relative fluxes in the construction of the transonic pressure
equation.
This commit is contained in:
Henry Weller
2022-10-20 13:14:56 +01:00
parent 64455c60f5
commit fd2e8f1f4d

View File

@ -83,16 +83,17 @@ void Foam::solvers::isothermalFluid::correctPressure()
if (pimple.transonic())
{
const surfaceScalarField phiHbyArel(fvc::relative(phiHbyA, rho, U));
const surfaceScalarField phid
(
"phid",
(fvc::interpolate(psi)/fvc::interpolate(rho))
*fvc::relative(phiHbyA, rho, U)
(fvc::interpolate(psi)/fvc::interpolate(rho))*phiHbyArel
);
// Subtract the compressible part
// The resulting flux will be zero for a perfect gas
phiHbyA -= fvc::interpolate(psi*p)*phiHbyA/fvc::interpolate(rho);
phiHbyA -= fvc::interpolate(psi*p)*phiHbyArel/fvc::interpolate(rho);
if (pimple.consistent())
{