ENH: pressureTools - added check if reference pressure level is zero for coeff calculation

This commit is contained in:
andy
2014-01-30 14:50:06 +00:00
parent ce5c58c451
commit 1c0996478d

View File

@ -285,6 +285,17 @@ void Foam::pressureTools::read(const dictionary& dict)
dict.lookup("pInf") >> pInf_;
dict.lookup("UInf") >> UInf_;
dict.lookup("rhoInf") >> rhoInf_;
scalar zeroCheck = 0.5*rhoInf_*magSqr(UInf_) + pInf_;
if (mag(zeroCheck) < ROOTVSMALL)
{
WarningIn("void Foam::pressureTools::read(const dictionary&)")
<< type() << " " << name_ << ": "
<< "Coefficient calculation requested, but reference "
<< "pressure level is zero. Please check the supplied "
<< "values of pInf, UInf and rhoInf" << endl;
}
}
}
}