From db4a63ed07b95e181995af4db0fcc4867952b438 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Thu, 30 Sep 2010 23:01:27 +0100 Subject: [PATCH] Added velocity magnitude messaging from flux --- .../compressible/compressibleCourantNo.H | 20 ++++++++++++------- .../cfdTools/incompressible/CourantNo.H | 13 +++++++----- 2 files changed, 21 insertions(+), 12 deletions(-) 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; // ************************************************************************* //