Added velocity magnitude messaging from flux

This commit is contained in:
Hrvoje Jasak 2010-09-30 23:01:27 +01:00
parent 6b9a782226
commit db4a63ed07
2 changed files with 21 additions and 12 deletions

View file

@ -32,20 +32,26 @@ Description
scalar CoNum = 0.0; scalar CoNum = 0.0;
scalar meanCoNum = 0.0; scalar meanCoNum = 0.0;
scalar velMag = 0.0;
if (mesh.nInternalFaces()) if (mesh.nInternalFaces())
{ {
surfaceScalarField SfUfbyDelta = surfaceScalarField phiOverRho = mag(phi)/fvc::interpolate(rho);
mesh.surfaceInterpolation::deltaCoeffs()*mag(phi)/fvc::interpolate(rho);
CoNum = max(SfUfbyDelta/mesh.magSf()) surfaceScalarField SfUfbyDelta =
.value()*runTime.deltaT().value(); mesh.surfaceInterpolation::deltaCoeffs()*phiOverRho;
meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf())) CoNum = max(SfUfbyDelta/mesh.magSf()).value()*runTime.deltaT().value();
.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 Info<< "Courant Number mean: " << meanCoNum
<< " max: " << CoNum << endl; << " max: " << CoNum
<< " velocity magnitude: " << velMag
<< endl;
// ************************************************************************* // // ************************************************************************* //

View file

@ -36,8 +36,10 @@ scalar velMag = 0.0;
if (mesh.nInternalFaces()) if (mesh.nInternalFaces())
{ {
surfaceScalarField SfUfbyDelta = surfaceScalarField magPhi = mag(phi);
mesh.surfaceInterpolation::deltaCoeffs()*mag(phi);
surfaceScalarField SfUfbyDelta =
mesh.surfaceInterpolation::deltaCoeffs()*magPhi;
CoNum = max(SfUfbyDelta/mesh.magSf()) CoNum = max(SfUfbyDelta/mesh.magSf())
.value()*runTime.deltaT().value(); .value()*runTime.deltaT().value();
@ -45,11 +47,12 @@ if (mesh.nInternalFaces())
meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf())) meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
.value()*runTime.deltaT().value(); .value()*runTime.deltaT().value();
velMag = max(mag(phi)/mesh.magSf()).value(); velMag = max(magPhi/mesh.magSf()).value();
} }
Info<< "Courant Number mean: " << meanCoNum Info<< "Courant Number mean: " << meanCoNum
<< " max: " << CoNum << " max: " << CoNum
<< " velocity magnitude: " << velMag << endl; << " velocity magnitude: " << velMag
<< endl;
// ************************************************************************* // // ************************************************************************* //