ENH: propellerInfo - protection against Uref = 0

This commit is contained in:
Andrew Heather
2022-10-31 12:20:44 +00:00
parent 913c45afff
commit 3c214e99df

View File

@ -729,13 +729,23 @@ void Foam::functionObjects::propellerInfo::writeAxialWake
} }
void Foam::functionObjects::propellerInfo::writeWakeFields(const scalar URef) void Foam::functionObjects::propellerInfo::writeWakeFields(const scalar URef0)
{ {
if (!writeWakeFields_) if (!writeWakeFields_)
{ {
return; return;
} }
scalar URef = URef0;
if (mag(URef) < ROOTSMALL)
{
WarningInFunction
<< "Magnitude of reference velocity should be greater than zero"
<< endl;
URef = ROOTVSMALL;
}
// Normalised velocity // Normalised velocity
const vectorField UDisk(interpolate(U(), vector::uniform(nanValue_))()); const vectorField UDisk(interpolate(U(), vector::uniform(nanValue_))());
const vectorField UrDisk(coordSysPtr_->localVector(UDisk)); const vectorField UrDisk(coordSysPtr_->localVector(UDisk));