From c1417d4c56fbceb4975120fef9f7e74afef22fa1 Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 16 Feb 2015 16:20:51 +0000 Subject: [PATCH] compressibleInterDyMFoam: cache divU before time advancement to ensure the old-time meshPhi are used to make phi absolute Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1531 --- .../compressibleInterDyMFoam.C | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C index 06444163..e4c1507f 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C @@ -73,17 +73,19 @@ int main(int argc, char *argv[]) while (runTime.run()) { #include "readControls.H" - #include "CourantNo.H" - - #include "setDeltaT.H" - - runTime++; - - Info<< "Time = " << runTime.timeName() << nl << endl; { - // Store divU from the previous mesh for the correctPhi - volScalarField divU(fvc::div(fvc::absolute(phi, U))); + // Store divU from the previous mesh so that it can be mapped + // and used in correctPhi to ensure the corrected phi has the + // same divergence + volScalarField divU("divU0", fvc::div(fvc::absolute(phi, U))); + + #include "CourantNo.H" + #include "setDeltaT.H" + + runTime++; + + Info<< "Time = " << runTime.timeName() << nl << endl; scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();