Skip to content
Snippets Groups Projects
Commit 9df7208d authored by Henry's avatar Henry
Browse files

DyM solvers: rationalized handling of time update

parent e26498ee
No related branches found
No related tags found
No related merge requests found
...@@ -70,18 +70,20 @@ int main(int argc, char *argv[]) ...@@ -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;
......
...@@ -66,18 +66,20 @@ int main(int argc, char *argv[]) ...@@ -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;
......
...@@ -67,24 +67,19 @@ int main(int argc, char *argv[]) ...@@ -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; #include "CourantNo.H"
#include "setDeltaT.H"
scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime(); runTime++;
// Do any mesh changes Info<< "Time = " << runTime.timeName() << nl << endl;
mesh.update();
if (mesh.changing()) // Do any mesh changes
{ mesh.update();
Info<< "Execution time for mesh.update() = "
<< runTime.elapsedCpuTime() - timeBeforeMeshUpdate
<< " s" << endl;
if (correctPhi) 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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment