diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/rhoPimpleDyMFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/rhoPimpleDyMFoam.C index 85c86b116989045af5786ccb01354ee089fae24a..72febbc9ce1daf769fa3aeffefdb5455f357a7e3 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/rhoPimpleDyMFoam.C +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/rhoPimpleDyMFoam.C @@ -70,18 +70,20 @@ int main(int argc, char *argv[]) while (runTime.run()) { #include "readControls.H" - #include "compressibleCourantNo.H" - - #include "setDeltaT.H" { - // Store divrhoU from the previous time-step/mesh for the correctPhi + // Store divrhoU from the previous mesh so that it can be mapped + // and used in correctPhi to ensure the corrected phi has the + // same divergence volScalarField divrhoU ( "divrhoU", fvc::div(fvc::absolute(phi, rho, U)) ); + #include "compressibleCourantNo.H" + #include "setDeltaT.H" + runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; diff --git a/applications/solvers/compressible/sonicFoam/sonicDyMFoam/sonicDyMFoam.C b/applications/solvers/compressible/sonicFoam/sonicDyMFoam/sonicDyMFoam.C index dce4eaab26d3349b348c8b0b89d73bf285efd8cd..7b65536a8cd313db88a2ac934d5e7f8b1afb243a 100644 --- a/applications/solvers/compressible/sonicFoam/sonicDyMFoam/sonicDyMFoam.C +++ b/applications/solvers/compressible/sonicFoam/sonicDyMFoam/sonicDyMFoam.C @@ -66,18 +66,20 @@ int main(int argc, char *argv[]) while (runTime.run()) { #include "readControls.H" - #include "compressibleCourantNo.H" - - #include "setDeltaT.H" { - // Store divrhoU from the previous time-step/mesh for the correctPhi + // Store divrhoU from the previous mesh so that it can be mapped + // and used in correctPhi to ensure the corrected phi has the + // same divergence volScalarField divrhoU ( "divrhoU", fvc::div(fvc::absolute(phi, rho, U)) ); + #include "compressibleCourantNo.H" + #include "setDeltaT.H" + runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; diff --git a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/cavitatingDyMFoam.C b/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/cavitatingDyMFoam.C index 55f5786e467a0de3c31a2b7b3618973995a5325b..be86aa80957b3687ab0fed035fcd2ff3912a8c72 100644 --- a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/cavitatingDyMFoam.C +++ b/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/cavitatingDyMFoam.C @@ -67,24 +67,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; + { + #include "CourantNo.H" + #include "setDeltaT.H" - scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime(); + runTime++; - // Do any mesh changes - mesh.update(); + Info<< "Time = " << runTime.timeName() << nl << endl; - if (mesh.changing()) - { - Info<< "Execution time for mesh.update() = " - << runTime.elapsedCpuTime() - timeBeforeMeshUpdate - << " s" << endl; + // Do any mesh changes + mesh.update(); - if (correctPhi) + if (mesh.changing() && correctPhi) { // Calculate absolute flux from the mapped surface velocity phi = mesh.Sf() & Uf;