Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusion about the use of Foam::atan2 in turbine models #93

Open
hcOnel opened this issue Aug 11, 2022 · 2 comments
Open

Confusion about the use of Foam::atan2 in turbine models #93

hcOnel opened this issue Aug 11, 2022 · 2 comments

Comments

@hcOnel
Copy link

hcOnel commented Aug 11, 2022

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.

@ewquon
Copy link
Collaborator

ewquon commented Aug 16, 2022

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

@hcOnel
Copy link
Author

hcOnel commented Oct 11, 2022

Yes, it makes sense now. Thanks for clearing up the confusion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants