DyM solvers: rationalized handling of time update

This commit is contained in:
Henry
2015-02-16 21:48:00 +00:00
parent 74990ee915
commit e8e0c99790
3 changed files with 22 additions and 23 deletions

View File

@ -70,18 +70,20 @@ int main(int argc, char *argv[])
while (runTime.run()) while (runTime.run())
{ {
#include "readControls.H" #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 volScalarField divrhoU
( (
"divrhoU", "divrhoU",
fvc::div(fvc::absolute(phi, rho, U)) fvc::div(fvc::absolute(phi, rho, U))
); );
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
runTime++; runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -66,18 +66,20 @@ int main(int argc, char *argv[])
while (runTime.run()) while (runTime.run())
{ {
#include "readControls.H" #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 volScalarField divrhoU
( (
"divrhoU", "divrhoU",
fvc::div(fvc::absolute(phi, rho, U)) fvc::div(fvc::absolute(phi, rho, U))
); );
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
runTime++; runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -67,24 +67,19 @@ int main(int argc, char *argv[])
while (runTime.run()) while (runTime.run())
{ {
#include "readControls.H" #include "readControls.H"
#include "CourantNo.H"
#include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
// Do any mesh changes
mesh.update();
if (mesh.changing())
{ {
Info<< "Execution time for mesh.update() = " #include "CourantNo.H"
<< runTime.elapsedCpuTime() - timeBeforeMeshUpdate #include "setDeltaT.H"
<< " s" << endl;
if (correctPhi) runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
// Do any mesh changes
mesh.update();
if (mesh.changing() && correctPhi)
{ {
// Calculate absolute flux from the mapped surface velocity // Calculate absolute flux from the mapped surface velocity
phi = mesh.Sf() & Uf; phi = mesh.Sf() & Uf;