From 26db5f040568fe3a5d5c5b6ecefa3b6bc1d4a10c Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Sun, 25 Mar 2018 22:23:49 +0100 Subject: [PATCH] functionObjects::forceCoeffs: normalize liftDir, dragDir and pitchAxis It may be convenient to specify these directions un-normalized so it is necessary to normalize them before they are used to calculate the force coefficients. --- src/functionObjects/forces/forceCoeffs/forceCoeffs.C | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/functionObjects/forces/forceCoeffs/forceCoeffs.C b/src/functionObjects/forces/forceCoeffs/forceCoeffs.C index 27a95872a..cc920434e 100644 --- a/src/functionObjects/forces/forceCoeffs/forceCoeffs.C +++ b/src/functionObjects/forces/forceCoeffs/forceCoeffs.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -156,9 +156,16 @@ bool Foam::functionObjects::forceCoeffs::read(const dictionary& dict) forces::read(dict); // Directions for lift and drag forces, and pitch moment + // Normalize to ensure that the directions are unit vectors + dict.lookup("liftDir") >> liftDir_; + liftDir_ /= mag(liftDir_); + dict.lookup("dragDir") >> dragDir_; + dragDir_ /= mag(dragDir_); + dict.lookup("pitchAxis") >> pitchAxis_; + pitchAxis_ /= mag(pitchAxis_); // Free stream velocity magnitude dict.lookup("magUInf") >> magUInf_;