-
Notifications
You must be signed in to change notification settings - Fork 147
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
Bug report: calling reinitialize_flow_field
leads to incorrect turbine model information in FLORIS 2.4
#712
Comments
The root of the issue seems to be these lines in turbine_map = TurbineMap(
layout_array[0],
layout_array[1],
[
copy.deepcopy(self.floris.farm.turbines[0])
for ii in range(len(layout_array[0]))
],
) where we see that the first turbine's information is used to overwrite those of the other turbines. |
Thanks for documenting this nicely @pjireland. Unfortunately, I don't recall why we used the first turbine for all in the reinitialize routine in v2. Have you checked whether it's valid to do this: # change this
copy.deepcopy(self.floris.farm.turbines[0])
# to this
copy.deepcopy(self.floris.farm.turbines[ii]) If the indexes in the layout array do not correspond to the correct indexes in the |
@rafmudaf Thanks for the feedback. It looks like that works if you already have 4 turbines in Perhaps something like this could work? assert len(self.floris.farm.turbines) in [1, len(layout_array[0])]
...
turbine_map = TurbineMap(
layout_array[0],
layout_array[1],
[
copy.deepcopy(self.floris.farm.turbines[0])
if len(self.floris.farm.turbines) == 1
else copy.deepcopy(self.floris.farm.turbines[ii])
for ii in range(len(layout_array[0]))
],
) |
Without having tested it, that looks right to me. Regarding incorporating a fix, we haven't considered how to maintain FLORIS v2 in the case of users being tied to functionality that isn't available in v3. However, this and #684 seem like straightforward changes and easy enough to include as patches. I'll discuss it with the NREL team and let you know what we decide. |
Hey @pjireland if you're interested to submit a pull request with this change and any corresponding tests showing that it fixes the bug, I'm happy to review, merge, and complete the release process for a bug fix. After some discussion, we've described the policy regarding v2 updates in #715, for reference. |
Thanks for the feedback, @rafmudaf. For now, we have a workaround that will allow us to continue v2.4, but I'll submit a pull request if this capability becomes necessary. |
Bug report: calling
reinitialize_flow_field
leads to incorrect turbine model information in FLORIS 2.4When calling
FlorisInterface.reinitialize_flow_field
withlayout_array
notNone
, turbine-model-specific settings (e.g., hub height, rotor diameter, power-thrust curves) are overwritten with settings from the first turbine. This leads to problems if I want to simulate turbines of different models on the same farm when changing the farm layout.Note that I haven't explored FLORIS 3.x to see if this issue persists, but given the significant restructuring in FLORIS 3.x, I would assume it does not. However, I am focused on using FLORIS 2.4 in my work, since FLORIS 3.x does not have support for wind direction heterogeneity, which is an important feature I need for simulations of large farms (see #441).
How to reproduce
First set up an example wind farm (based on the AEP example in FLORIS 2.4):
Then modify the rotor diameter of the last turbine.
Finally, reinitialize the flow field, changing just the layout and notice the the rotor diameter of the last turbine is now incorrectly equal to that of the first turbine:
Floris version
2.4
System Information
The text was updated successfully, but these errors were encountered: