NREL / SOWFA

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

scalar windAng = Foam::atan2(windVectors[i][j][k].x(),windVectors[i][j][k].y())/degRad;

The actuator line code also has a similar line:
scalar windAng = Foam::atan2(windVectors[i][j][k].x(),windVectors[i][j][k].y())/degRad;

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:

// This vector points normal to the other two and toward downwind (not exactly downwind if
// the blade is coned). It points in the direction of the oncoming flow due to wind that the
// blade sees.
bladeAlignedVectors[i][j][0] = bladeAlignedVectors[i][j][1]^bladeAlignedVectors[i][j][2];
bladeAlignedVectors[i][j][0] = bladeAlignedVectors[i][j][0]/mag(bladeAlignedVectors[i][j][0]);

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!