db7fac3f24
git-svn-id: https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Core/OpenFOAM-1.5-dev@1731 e4e07f05-0c2f-0410-a05a-b8ba57e0c909
19 lines
714 B
C
19 lines
714 B
C
if (!(runTime.timeIndex() % 5))
|
|
{
|
|
volScalarField kineticEnergy = magSqr(Dcorr);
|
|
dimensionedScalar intKineticEnergy = fvc::domainIntegrate(kineticEnergy);
|
|
Info<< "kineticEnergy = " << intKineticEnergy.value() << endl;
|
|
|
|
volScalarField kineticPower = (Dcorr - Dcorr.oldTime()) & Dcorr;
|
|
dimensionedScalar intKineticPower = fvc::domainIntegrate(kineticPower);
|
|
Info<< "kineticPower = " << intKineticPower.value() << endl;
|
|
|
|
scalar smi = intKineticPower.value()/(intKineticEnergy.value() + VSMALL);
|
|
Info<< "smi = " << smi << endl;
|
|
|
|
if (smi < -SMALL)
|
|
{
|
|
Info<< "Resetting Dcorr to 0" << endl;
|
|
Dcorr == dimensionedVector("0", Dcorr.dimensions(), vector::zero);
|
|
}
|
|
}
|