Confusion about the use of Foam::atan2 in turbine models
hcOnel opened this issue · comments
Hi,
I was reading through the actuator disk code and came across this line:
The actuator line code also has a similar line:
If I'm not mistaken, the Foam:atan2
function takes the arguments in y, x order:
https://github.com/OpenFOAM/OpenFOAM-2.4.x/blob/2b147f41daf9ca07d0fb4c6b0576dc3d10a435f3/src/OpenFOAM/primitives/Scalar/doubleScalar/doubleScalar.H#L95
but the function is used in x, y order in the SOWFA code.
I'm confused about this usage. If it is because of the local coordinate system definition of airfoil sections, I've read the rest of the code (especially the computeWindVectors
function) but still couldn't see how this order is justified.
Your input is highly appreciated
Best,
Hüseyin
EDIT: Since this angle is calculated with respect to the rotor plane tangent direction, x,y order kind of makes sense after drawing the vectors. However, the windVectors
variable seems to be never used in the rotor coordinates, there is another variable for that (bladeAlignedVectors
). Also I'm still having a hard time picturing the rotor CS by reading the code.
Hence, I'm sorry if the answer is too obvious but I still can't see it.
Hi Huseyin,
windVectors
is rotated into the "blade-oriented coordinates" defined by bladeAlignedVectors
. I think the important piece of information (and why this is potentially confusing) is to note that this coordinate system is set up with the "x" direction (i.e., component 0) aligned with the rotor disk normal direction:
So the arctangent of the normal component divided by the tangential component would give you the "wind angle", i.e., the aerodynamic angle of attack + the local blade geometric angle, relative to the rotor plane.
Hopefully this makes sense.
Eliot
Yes, it makes sense now. Thanks for clearing up the confusion!