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

Hetergenous map is sticking when expected behavior would be to remove #959

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

Comments

@paulf81
Copy link
Collaborator

paulf81 commented Aug 8, 2024

Hetergenous map is sticking when expected behavior would be to remove

When applying a wind_data object to an FlorisModel that doesn't contain a HeterogeneousMap, after having applied one that does, it appears the HeterogeneousMap is still there

How to reproduce

Add this code as a file in examples:

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

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

# make a time series of without het
time_series = TimeSeries(
    wind_speeds=np.array([8.0]), wind_directions=0.0, turbulence_intensities=0.06
)

# Make a second time series with a het map
het_map = HeterogeneousMap(
    wind_directions=np.array([0.0]),
    x = [-100, -100, 126*7, 126*7],
    y = [-500, 500, -500, 500],
    speed_multipliers = [[1, 1,2, 2]]
)

time_series_2 = TimeSeries(
    wind_speeds=np.array([8.0]), wind_directions=0.0, turbulence_intensities=0.06, heterogeneous_map=het_map
)

# Run without het
fmodel.set(layout_x=[10.0, 126 * 5], layout_y=[0.0, 0.0], wind_data=time_series)
fmodel.run()
print(fmodel.get_turbine_powers())

# Run with het
fmodel.set(wind_data=time_series_2)
fmodel.run()
print(fmodel.get_turbine_powers())

# Now without again
fmodel.set(layout_x=[10.0, 126 * 5], layout_y=[0.0, 0.0], wind_data=time_series)
fmodel.run()
print(fmodel.get_turbine_powers())

Relevant output

The expected output is:

[[1753954.45917917 1753954.45917917]]
[[2422719.54860612 5000000.        ]]
[[1753954.45917917 1753954.45917917]]

However the current output is:

[[1753954.45917917 1753954.45917917]]
[[2422719.54860612 5000000.        ]]
[[2422719.54860612 5000000.        ]]

Floris version

Develop

System Information

macos

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

1 participant