diff --git a/src/finiteVolume/cfdTools/compressible/compressibleCourantNo.H b/src/finiteVolume/cfdTools/compressible/compressibleCourantNo.H index e38344ada..09f74d75b 100644 --- a/src/finiteVolume/cfdTools/compressible/compressibleCourantNo.H +++ b/src/finiteVolume/cfdTools/compressible/compressibleCourantNo.H @@ -32,20 +32,26 @@ Description scalar CoNum = 0.0; scalar meanCoNum = 0.0; +scalar velMag = 0.0; if (mesh.nInternalFaces()) { - surfaceScalarField SfUfbyDelta = - mesh.surfaceInterpolation::deltaCoeffs()*mag(phi)/fvc::interpolate(rho); + surfaceScalarField phiOverRho = mag(phi)/fvc::interpolate(rho); - CoNum = max(SfUfbyDelta/mesh.magSf()) - .value()*runTime.deltaT().value(); + surfaceScalarField SfUfbyDelta = + mesh.surfaceInterpolation::deltaCoeffs()*phiOverRho; - meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf())) - .value()*runTime.deltaT().value(); + CoNum = max(SfUfbyDelta/mesh.magSf()).value()*runTime.deltaT().value(); + + meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf())).value()* + runTime.deltaT().value(); + + velMag = max(phiOverRho/mesh.magSf()).value(); } Info<< "Courant Number mean: " << meanCoNum - << " max: " << CoNum << endl; + << " max: " << CoNum + << " velocity magnitude: " << velMag + << endl; // ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/incompressible/CourantNo.H b/src/finiteVolume/cfdTools/incompressible/CourantNo.H index c14c44291..aabbc1174 100644 --- a/src/finiteVolume/cfdTools/incompressible/CourantNo.H +++ b/src/finiteVolume/cfdTools/incompressible/CourantNo.H @@ -36,8 +36,10 @@ scalar velMag = 0.0; if (mesh.nInternalFaces()) { - surfaceScalarField SfUfbyDelta = - mesh.surfaceInterpolation::deltaCoeffs()*mag(phi); + surfaceScalarField magPhi = mag(phi); + + surfaceScalarField SfUfbyDelta = + mesh.surfaceInterpolation::deltaCoeffs()*magPhi; CoNum = max(SfUfbyDelta/mesh.magSf()) .value()*runTime.deltaT().value(); @@ -45,11 +47,12 @@ if (mesh.nInternalFaces()) meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf())) .value()*runTime.deltaT().value(); - velMag = max(mag(phi)/mesh.magSf()).value(); + velMag = max(magPhi/mesh.magSf()).value(); } Info<< "Courant Number mean: " << meanCoNum - << " max: " << CoNum - << " velocity magnitude: " << velMag << endl; + << " max: " << CoNum + << " velocity magnitude: " << velMag + << endl; // ************************************************************************* //