From fd2e8f1f4d356ebc48264e2179c4324bb2e6c70e Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Thu, 20 Oct 2022 13:14:56 +0100 Subject: [PATCH] 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. --- .../modules/fluid/isothermalFluid/correctPressure.C | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/applications/solvers/modules/fluid/isothermalFluid/correctPressure.C b/applications/solvers/modules/fluid/isothermalFluid/correctPressure.C index a77c5492dd..8ba793019e 100644 --- a/applications/solvers/modules/fluid/isothermalFluid/correctPressure.C +++ b/applications/solvers/modules/fluid/isothermalFluid/correctPressure.C @@ -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()) {