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.
This commit is contained in:
Henry Weller
2018-03-25 22:23:49 +01:00
parent 19576d14a0
commit 26db5f0405

View File

@ -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_;