From 296667d928a94575575664c55cd0add4e4b0b585 Mon Sep 17 00:00:00 2001 From: henry Date: Wed, 3 Mar 2010 09:39:29 +0000 Subject: [PATCH] Improvement to the Courant number calculation. --- .../compressible/rhoCentralFoam/rhoCentralFoam.C | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C b/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C index f01a2d5a..5ee598b8 100644 --- a/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C +++ b/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C @@ -101,14 +101,6 @@ int main(int argc, char *argv[]) surfaceScalarField amaxSf("amaxSf", max(mag(am), mag(ap))); - #include "compressibleCourantNo.H" - #include "readTimeControls.H" - #include "setDeltaT.H" - - runTime++; - - Info<< "Time = " << runTime.timeName() << nl << endl; - surfaceScalarField aSf = am*a_pos; if (fluxScheme == "Tadmor") @@ -125,6 +117,18 @@ int main(int argc, char *argv[]) surfaceScalarField aphiv_pos = phiv_pos - aSf; surfaceScalarField aphiv_neg = phiv_neg + aSf; + // Reuse amaxSf for the maximum positive and negative fluxes + // estimated by the central scheme + amaxSf = max(mag(aphiv_pos), mag(aphiv_neg)); + + #include "compressibleCourantNo.H" + #include "readTimeControls.H" + #include "setDeltaT.H" + + runTime++; + + Info<< "Time = " << runTime.timeName() << nl << endl; + surfaceScalarField phi("phi", aphiv_pos*rho_pos + aphiv_neg*rho_neg); surfaceVectorField phiUp = -- 2.11.4.GIT