From d28a72f14c9edba6fe77990c9dee6d7692725a57 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Wed, 17 Jun 2015 20:20:49 +0100 Subject: [PATCH] rhoCentralFoam: Updated Courant number calculation to be cell-based rather than face-based Now consistent with the way the Courant number is calculated for other solvers --- .../compressible/rhoCentralFoam/centralCourantNo.H | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/applications/solvers/compressible/rhoCentralFoam/centralCourantNo.H b/applications/solvers/compressible/rhoCentralFoam/centralCourantNo.H index 09c13ff24..d915d29ac 100644 --- a/applications/solvers/compressible/rhoCentralFoam/centralCourantNo.H +++ b/applications/solvers/compressible/rhoCentralFoam/centralCourantNo.H @@ -31,16 +31,12 @@ Description if (mesh.nInternalFaces()) { - surfaceScalarField amaxSfbyDelta - ( - mesh.surfaceInterpolation::deltaCoeffs()*amaxSf - ); + scalarField sumAmaxSf(fvc::surfaceSum(amaxSf)().internalField()); - CoNum = max(amaxSfbyDelta/mesh.magSf()).value()*runTime.deltaTValue(); + CoNum = 0.5*gMax(sumAmaxSf/mesh.V().field())*runTime.deltaTValue(); meanCoNum = - (sum(amaxSfbyDelta)/sum(mesh.magSf())).value() - *runTime.deltaTValue(); + 0.5*(gSum(sumAmaxSf)/gSum(mesh.V().field()))*runTime.deltaTValue(); } Info<< "Mean and max Courant Numbers = "