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

Bug: Setting the turbine type with a list causes power setpoints to be ignored #958

Open
paulf81 opened this issue Aug 8, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@paulf81
Copy link
Collaborator

paulf81 commented Aug 8, 2024

Setting the turbine type with a list causes power setpoints to be ignored

I've noticed an issue where if the turbine type is provided via a list, power_setpoints applied will be ignored.

How to reproduce

Adding this a test file into the examples folder will show the issue

from floris import (
    FlorisModel,
    TimeSeries,
)
import numpy as np

# Create a FlorisModel instance with simple derating
fmodel = FlorisModel("inputs/emgauss.yaml")
fmodel.set_operation_model("simple-derating")

# make a time series of 2 wind speeds
time_series = TimeSeries(
    wind_speeds=np.array([8.0, 9.0]), wind_directions=270.0, turbulence_intensities=0.06
)

# Set to a 2 turbine layout
fmodel.set(layout_x=[0.0, 126 * 5], layout_y=[0.0, 0.0], wind_data=time_series)

# Set all power setpoints to 0
power_setpoints = np.zeros((2, 2))
fmodel.set(power_setpoints=power_setpoints)
fmodel.run()

# Correctly prints out a 2x2 matrix of 0s
print(fmodel.get_turbine_powers())

# Specify the turbine types using a list
fmodel.set(turbine_type=["nrel_5mw", "nrel_5mw"])
fmodel.set(power_setpoints=power_setpoints)
fmodel.run()
# Now ignores the power setpoints
print(fmodel.get_turbine_powers())

Relevant output

The first printout is (correct)

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

The second (ignores the power setpoints)

[[1753954.45917917  678834.8317748 ]
 [2496427.86183577  987681.57314292]]

Floris version

Develop branch

System Information

macOS

@paulf81 paulf81 added the bug Something isn't working label Aug 8, 2024
@misi9170
Copy link
Collaborator

misi9170 commented Aug 8, 2024

I think this is happening because the NREL-5MW, by default, uses the "cosine-loss" operation model. So, when fmodel.set(turbine_type=["nrel_5mw", "nrel_5mw"]) is executed, the operation model is set to "cosine-loss", which doesn't respond to a power setpoint.

It's a little unclear what the "correct" behavior is here. For now, I think running

# Specify the turbine types using a list
fmodel.set(turbine_type=["nrel_5mw", "nrel_5mw"])
fmodel.set_operation_model("simple-derating")
fmodel.set(power_setpoints=power_setpoints)
fmodel.run()

should work (i.e., specifying the "simple-derating" operation model after setting the turbine types).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants