modules/isothermalFluid: Consistent handling of rhoU_0 and rhoUf_0

This commit is contained in:
Will Bainbridge
2023-11-03 11:07:56 +00:00
parent 0cf048143e
commit 42e71682cc
3 changed files with 3 additions and 8 deletions

View File

@ -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);
}
}

View File

@ -156,10 +156,6 @@ protected:
// used for mesh-change to set rhoUf for introduced faces
autoPtr<volVectorField> rhoU;
//- Pointer to the old-time vol momentum field
// used for mesh-change to set rhoUf.oldTime() for introduced faces
autoPtr<volVectorField> rhoU0;
//- Pointer to the surface momentum field
// used to recreate the flux after mesh-change
autoPtr<surfaceVectorField> rhoUf;

View File

@ -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())
{