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

[BUGFIX] Raise warning if turbine_type passed without updating reference_wind_height #809

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

misi9170
Copy link
Collaborator

Addresses #806 by raising a warning if FlorisInterface.reinitialize() is called with turbine_type specified and reference_wind_height unspecified.

The following code

from floris.tools import FlorisInterface

# Initialization uses NREL 5MW model with 90m hub height
fi = FlorisInterface("inputs/gch.yaml")
print(fi.floris.flow_field.reference_wind_height)

# Changing the turbine type without specifying reference_wind_height
fi.reinitialize(turbine_type=["iea_15mw"]*len(fi.layout_x))
print(fi.floris.flow_field.reference_wind_height)

# Changing the turbine type and specifying reference_wind_height
fi.reinitialize(turbine_type=["iea_15mw"]*len(fi.layout_x), reference_wind_height=150.2)
print(fi.floris.flow_field.reference_wind_height)

now raises the following warning for the line fi.reinitialize(turbine_type=["iea_15mw"]*len(fi.layout_x)):

floris.tools.floris_interface.FlorisInterface WARNING turbine_type has been changed without specifying a new reference_wind_height. reference_wind_height remains 90.00 m.

This "bug" is not specified to v4, and a similar change could be made for v3. However, since it is simply raising a warning, that may not be necessary.

@misi9170 misi9170 added bug Something isn't working floris.tools labels Feb 19, 2024
@misi9170 misi9170 changed the title [BUG] Raise warning if turbine_type passed without updating reference_wind_height [BUGFIX] Raise warning if turbine_type passed without updating reference_wind_height Feb 20, 2024
@misi9170
Copy link
Collaborator Author

I just saw this method that I had not noticed before (it's called in example 18): https://github.com/NREL/floris/blob/v4/floris/tools/floris_interface.py#L94. I could update the warning to tell the user that they may want to call this method.

@rafmudaf rafmudaf deleted the branch NREL:develop April 12, 2024 15:26
@rafmudaf rafmudaf closed this Apr 12, 2024
@rafmudaf rafmudaf reopened this Apr 12, 2024
@misi9170 misi9170 changed the base branch from v4 to develop April 29, 2024 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working floris.tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants