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

Disable user-provided tilt angle settings in wake calculation #651

Merged
merged 4 commits into from
May 12, 2023

Conversation

paulf81
Copy link
Collaborator

@paulf81 paulf81 commented May 9, 2023

Comment out tilt angles from calc wake function

floris_interface's calculate_wake function currently accepts tilt_angles as an input, but does not apparently apply them. Propose to comment these out (and not delete in the assumption we will want to offer this function some day)

Impacted areas of the software

floris_interface.py

@paulf81 paulf81 added the enhancement An improvement of an existing feature label May 9, 2023
@paulf81 paulf81 added this to the v3.4 milestone May 9, 2023
@paulf81 paulf81 requested review from bayc, rafmudaf and misi9170 May 9, 2023 18:08
@rafmudaf
Copy link
Collaborator

rafmudaf commented May 9, 2023

@paulf81 I see that they're used throughout the farm module: https://github.com/paulf81/floris/blob/feature/remove_tilt_from_calc_wake/floris/simulation/farm.py. Are they set in another way if it's removed from this function?

@bayc
Copy link
Collaborator

bayc commented May 10, 2023

@paulf81 I see that they're used throughout the farm module: https://github.com/paulf81/floris/blob/feature/remove_tilt_from_calc_wake/floris/simulation/farm.py. Are they set in another way if it's removed from this function?

Hey @rafmudaf, I believe @paulf81 is right that the input right now doesn't assign the tilt angles in such a way that they get used. I believe I confirmed this with the test code below. I was able to track down that the tilt angles were not being initialized in the same was as the yaw angles when they are supplied to calculate_wake which I updated in the latest commit. The new output is shown below under Output 2.

Code:

from floris.tools import FlorisInterface
import numpy as np

fi = FlorisInterface("inputs/gch.yaml")

print(fi.floris.farm.tilt_angles)
print(fi.floris.farm.tilt_angles_sorted)

fi.calculate_wake()

print(fi.floris.farm.tilt_angles)
print(fi.floris.farm.tilt_angles_sorted)

fi.calculate_wake(tilt_angles=np.array([0.0, 0.0, 0.0]))

print(fi.floris.farm.tilt_angles)
print(fi.floris.farm.tilt_angles_sorted)

Output:

[[[5. 5. 5.]]]
[[[5. 5. 5.]]]
[[[5. 5. 5.]]]
[[[5. 5. 5.]]]
[[[5. 5. 5.]]]
[[[5. 5. 5.]]]

Output 2:

[[[5. 5. 5.]]]
[[[5. 5. 5.]]]
[[[5. 5. 5.]]]
[[[5. 5. 5.]]]
[[[0. 0. 0.]]]
[[[0. 0. 0.]]]

@misi9170
Copy link
Collaborator

misi9170 commented May 10, 2023

@bayc This does seem to work, but I don't fully understand the behavior when the turbine is defined with floating_correct_cp_ct_for_tilt: True and when the definition yaml has a floating_tilt_table field.

With your changes, running

from floris.tools import FlorisInterface
import numpy as np

#fi = FlorisInterface("inputs_floating/gch_fixed.yaml")
#fi = FlorisInterface("inputs_floating/gch_floating_defined_floating.yaml")
fi = FlorisInterface("inputs_floating/gch_floating.yaml")

fi.reinitialize(layout_x = [0, 5*126, 10*126], layout_y = [0, 0, 0])

# print(fi.floris.farm.tilt_angles)
# print(fi.floris.farm.tilt_angles_sorted)

fi.calculate_wake(tilt_angles=np.array([[[5.0, 5.0, 5.0]]]))

# print(fi.floris.farm.tilt_angles)
# print(fi.floris.farm.tilt_angles_sorted)

print(fi.get_turbine_powers()/1000)

fi.calculate_wake(tilt_angles=np.array([[[0.0, 0.0, 0.0]]]))

# print(fi.floris.farm.tilt_angles)
# print(fi.floris.farm.tilt_angles_sorted)

print(fi.get_turbine_powers()/1000)

I get identical power at the first turbine (and very similar power at the other turbines). Is that expected?

[[[1688.97519743  429.74855125  477.00790152]]]
<vertical deflection warning>
[[[1688.97519743  429.74457429  476.60162974]]]

Moreover, if we are going to let calculate_wake() accept a tilt_angles argument, I think that other methods on FlorisInterface should accept them too (e.g. calculate_no_wake(), calculate_horizontal_plane(), calculate_cross_plane(), etc), which is probably a bigger task to deal with.

It seems to me the most straightforward path for v3.4 is to remove tilt_angles as an input from calculate_wake() as @paulf81 proposed, and create an issue to build out the code for allowing users to manually specify the tilt angle.

@rafmudaf rafmudaf changed the title Comment out tilt angles from calc wake Disable user-provided tilt angle settings in wake calculation May 11, 2023
@rafmudaf
Copy link
Collaborator

See #653 for an ongoing discussion on handling tilt angles

@rafmudaf rafmudaf merged commit 77fa715 into NREL:develop May 12, 2023
@paulf81 paulf81 deleted the feature/remove_tilt_from_calc_wake branch May 16, 2023 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement of an existing feature
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants