From 896bd3fd1bcf840a8cb73b526ff24b8e294b7884 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 13 May 2014 17:23:53 +0100 Subject: [PATCH] ENH: rotorDiskSource - limit angle of attack to -pi to pi --- .../sources/derived/rotorDiskSource/rotorDiskSource.C | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.C b/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.C index f565a397..b568b6b8 100644 --- a/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.C +++ b/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.C @@ -566,6 +566,14 @@ void Foam::fv::rotorDiskSource::calculate // effective angle of attack scalar alphaEff = alphaGeom - atan2(-Uc.z(), Uc.y()); + if (alphaEff > mathematical::pi) + { + alphaEff -= mathematical::twoPi; + } + if (alphaEff < -mathematical::pi) + { + alphaEff += mathematical::twoPi; + } AOAmin = min(AOAmin, alphaEff); AOAmax = max(AOAmax, alphaEff);