From 3c214e99df4bbbde044a7fc356f496c7c25a8779 Mon Sep 17 00:00:00 2001 From: Andrew Heather <> Date: Mon, 31 Oct 2022 12:20:44 +0000 Subject: [PATCH] ENH: propellerInfo - protection against Uref = 0 --- .../forces/propellerInfo/propellerInfo.C | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/functionObjects/forces/propellerInfo/propellerInfo.C b/src/functionObjects/forces/propellerInfo/propellerInfo.C index 5ea5e80224..b7d3d5d660 100644 --- a/src/functionObjects/forces/propellerInfo/propellerInfo.C +++ b/src/functionObjects/forces/propellerInfo/propellerInfo.C @@ -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_) { return; } + scalar URef = URef0; + if (mag(URef) < ROOTSMALL) + { + WarningInFunction + << "Magnitude of reference velocity should be greater than zero" + << endl; + + URef = ROOTVSMALL; + } + // Normalised velocity const vectorField UDisk(interpolate(U(), vector::uniform(nanValue_))()); const vectorField UrDisk(coordSysPtr_->localVector(UDisk));