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

Feature: Add wind speed dependency in heterogeneous inflows #698

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

Bartdoekemeijer
Copy link
Collaborator

Expand heterogeneous inflows to allow different speed-ups per ambient wind speed

This feature allows users to specify a different speed-up factor for each ambient wind speed in the heterogeneous inflow functionality.

Related issue

There is no dedicated issue, but the problem is nicely highlighted in this post: #578 (comment).

Impacted areas of the software

FLORIS core simulation.

Additional supporting information

This change is API breaking, because it forces the heterogeneous inflow definition to match the shape (n_wind_directions, n_wind_speeds, n_hetmap_coordinates).

Test results, if applicable

Here is a piece of code where I compare nominal solutions at 10.0 and 9.0 m/s with the heterogeneous inflow solutions where I use a freestream inflow of 5.0 and 6.0 m/s, respectively, with speed-up factors of 2.0 and 1.5. These two solutions in theory should be equal.

import numpy as np

from floris.tools import FlorisInterface
from floris.tools.visualization import visualize_cut_plane

# Initialize FLORIS with the given input file via FlorisInterface.
# Note the heterogeneous inflow is defined in the input file.
fi = FlorisInterface("inputs/gch_heterogeneous_inflow.yaml")

# Calculate nominal solutions without speed-ups
heterogenous_inflow_config = {
    'speed_multipliers': [[[1.0, 1.0, 1.0, 1.0]]],
    'x': [-5000.0, -5000.0, 5000.0, 5000.0],
    'y': [ -5000.0, 5000.0, -5000.0, 5000.0],
}
fi.reinitialize(wind_shear=0.0, layout_x=[-299, 299], layout_y=[0., 0.], heterogenous_inflow_config=heterogenous_inflow_config)

fi.reinitialize(wind_speeds=[10.0], wind_directions=[270.],)
fi.calculate_wake()
turbine_powers_10ms_270deg = fi.get_turbine_powers().flatten() / 1000.

fi.reinitialize(wind_speeds=[9.0], wind_directions=[275.],)
fi.calculate_wake()
turbine_powers_9ms_275deg = fi.get_turbine_powers().flatten() / 1000.

# Now calculate solutions with heterogeneous inflows
speed_multipliers = [
    [
        [2.0, 2.0, 2.0, 2.0],  # Wind direction 270, Wind speed 5.0, four locations (x,y)
        [1.5, 1.5, 1.5, 1.5],  # Wind direction 270, Wind speed 6.0, four locations (x,y)
    ],
    [
        [2.0, 2.0, 2.0, 2.0],  # Wind direction 275, Wind speed 5.0, four locations (x,y)
        [1.5, 1.5, 1.5, 1.5],  # Wind direction 275, Wind speed 6.0, four locations (x,y)
    ],
]
heterogenous_inflow_config["speed_multipliers"]= speed_multipliers
fi.reinitialize(
    wind_directions=[270.0, 275.0],
    wind_speeds=[5.0, 6.0],
    heterogenous_inflow_config=heterogenous_inflow_config
)
fi.calculate_wake()
turbine_powers = fi.get_turbine_powers() / 1000.
turbine_powers_5ms_270deg_hetmultiplier2 = turbine_powers[0, 0, :].flatten()
turbine_powers_6ms_275deg_hetmultiplier15 = turbine_powers[1, 1, :].flatten()

# Now cross-compare
print("Evaluation with 270 deg, 10 m/s:")
print(f"  Nominal: {turbine_powers_10ms_270deg}")
print(f"  5 m/s with heterogeneous multiplier of 2.0: {turbine_powers_5ms_270deg_hetmultiplier2}")

print("Evaluation with 275 deg, 9.0 m/s:")
print(f"  Nominal: {turbine_powers_9ms_275deg}")
print(f"  6.0 m/s with heterogeneous multiplier of 1.5: {turbine_powers_6ms_275deg_hetmultiplier15}")

And they are equal:

Evaluation with 270 deg, 10 m/s:
  Nominal: [3329.10062735  368.38870676]
  5 m/s with heterogeneous multiplier of 2.0: [3329.10062735  368.38870676]
Evaluation with 275 deg, 9.0 m/s:
  Nominal: [2430.57780918  986.0126126 ]
  6.0 m/s with heterogeneous multiplier of 1.5: [2430.57780918  986.0126126 ]

@paulf81 paulf81 requested review from bayc and rafmudaf August 4, 2023 14:58
@misi9170
Copy link
Collaborator

Hi @Bartdoekemeijer , I think this is now addressed in Floris v4. The heterogeneous_inflow_config can simply be set for every findex, but we now also have capability for specifying heterogeneity by wd and ws bin in the WindRose format, which was introduced in #902.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants