From 42e71682cc80824336655471bb85fc56751bce3c Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Fri, 3 Nov 2023 11:07:56 +0000 Subject: [PATCH] modules/isothermalFluid: Consistent handling of rhoU_0 and rhoUf_0 --- applications/modules/isothermalFluid/isothermalFluid.C | 4 ++-- applications/modules/isothermalFluid/isothermalFluid.H | 4 ---- applications/modules/isothermalFluid/moveMesh.C | 3 +-- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/applications/modules/isothermalFluid/isothermalFluid.C b/applications/modules/isothermalFluid/isothermalFluid.C index f81ce8bbf3..4d13684207 100644 --- a/applications/modules/isothermalFluid/isothermalFluid.C +++ b/applications/modules/isothermalFluid/isothermalFluid.C @@ -314,9 +314,9 @@ void Foam::solvers::isothermalFluid::preSolve() { rhoU = new volVectorField("rhoU", rho*U); - if (rhoUf().nOldTimes() > 1) + for (label i = 1; i <= rhoUf().nOldTimes(false); ++ i) { - rhoU0 = new volVectorField("rhoU_0", rho.oldTime()*U.oldTime()); + rhoU().oldTime(i) == rho.oldTime(i)*U.oldTime(i); } } diff --git a/applications/modules/isothermalFluid/isothermalFluid.H b/applications/modules/isothermalFluid/isothermalFluid.H index 1800c38172..7ad3945fd5 100644 --- a/applications/modules/isothermalFluid/isothermalFluid.H +++ b/applications/modules/isothermalFluid/isothermalFluid.H @@ -156,10 +156,6 @@ protected: // used for mesh-change to set rhoUf for introduced faces autoPtr rhoU; - //- Pointer to the old-time vol momentum field - // used for mesh-change to set rhoUf.oldTime() for introduced faces - autoPtr rhoU0; - //- Pointer to the surface momentum field // used to recreate the flux after mesh-change autoPtr rhoUf; diff --git a/applications/modules/isothermalFluid/moveMesh.C b/applications/modules/isothermalFluid/moveMesh.C index e6879bf983..ec9289ba78 100644 --- a/applications/modules/isothermalFluid/moveMesh.C +++ b/applications/modules/isothermalFluid/moveMesh.C @@ -36,10 +36,9 @@ void Foam::solvers::isothermalFluid::moveMesh() // Move the mesh mesh_.move(); - // The rhoU and rhoU0 fields can be cleared following mesh-motion + // The rhoU field can be cleared following mesh-motion // now the mesh has been re-stitched as necessary rhoU.clear(); - rhoU0.clear(); if (mesh.changing()) {