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

Expanded capabilities for heterogeneity #902

Merged
merged 32 commits into from
May 14, 2024

Conversation

paulf81
Copy link
Collaborator

@paulf81 paulf81 commented May 6, 2024

Expanded capabilities for heterogeneity

The over-arching goals of this pull request are to expand heterogeneity's capabilities in FLORIS while maintaining backward compatibility with 4.0, and to do so in a non-messy way. Main features to be added:

  • Heterogeneity scheduled against wind speed in addition to wind direction
  • Further built-in checking of the heterogeneous_inflow_config_by_wd dict as it gets more complicated, with clear errors\
  • Built in plotting of speedup maps (this is in addition to plotting cross-planes with wakes), this will follow the pattern of FLORISv4 / FLASCv2 that pure FLORIS operations belong in FLORIS and so certain plotting capabilities will move back from FLASC
  • General consolidation of heterogeneity functions into one place
  • Adds to heterogeneity examples
  • Add heterogeneity documentation

To do add the new features, we include a new class HeterogeneousMap, which is declared using parameters matched to the keywords heterogeneous_inflow_config_by_wd (plus wind_speeds) and does all the relevant checking so this doesn't need to be done by WindData objects. It also provides member functions for getting a findex-based heterogeneous_inflow_config which can be passed to FlorisModel.set() and will include plotting functions.

To avoid changing the API, the HeterogenousMap class is used within wind_data.py in such a way that either the former heterogeneous_inflow_config_by_wd parameter can be passed in, or a similar dictionary can be unpacked into a heterogenous_map parameter, or HeterogenousMap object can be passed in directly.
We may over time favor moving toward heterogenous_map only, however this is not urgent.

The plan of this pull request however is to update the examples (and documentation) to make direct use HeterogeneousMap as this is the clearer and more general syntax.

Additionally in this pull request:

  • A fix for a bug previously missed when an int was passed in place of a float to TimeSeries wind_directions, wind_speeds or turbulence_intensities
  • Tests for the new HeterogeneousMap class
  • Additional tests for WindData classes
  • Simplifies the function to plot a heterogenous cutplane by having it call existing functions
  • Sets the interpolant function used within flow_field to be a seperate static function so that the HetergenousMap can use exactly the same interpolation method when visualizing the flow field.
  • Fixed an issue that if called to visualize a FlorisModel with a het_map attached with multiple findices, the set_for_viz did not limit the speedup map to 1 findex

Finally, one test of WindData was removed since it was calling a lower-level function which is now handled in HeterogenousMap, this should not impact examples or practical useage.

Impacted areas of the software

wind_data.py

@paulf81 paulf81 added the enhancement An improvement of an existing feature label May 6, 2024
@paulf81 paulf81 requested a review from misi9170 May 6, 2024 22:28
@paulf81 paulf81 self-assigned this May 6, 2024
@misi9170 misi9170 changed the title Expanded capabilities for heterogenaity Expanded capabilities for heterogeneity May 7, 2024
@paulf81 paulf81 marked this pull request as ready for review May 9, 2024 20:18
@paulf81
Copy link
Collaborator Author

paulf81 commented May 9, 2024

@misi9170 , this is ready for your review!

Copy link
Collaborator

@misi9170 misi9170 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, this looks good. The main comment I have is about whether the wind_speeds and wind_directions arguments should be the same length (so, meshgridded and flattened?)

@misi9170 misi9170 self-requested a review May 13, 2024 22:05
@paulf81 paulf81 merged commit 0c437c4 into NREL:develop May 14, 2024
8 checks passed
@paulf81 paulf81 deleted the feature/expand_het branch May 14, 2024 15:04
@misi9170 misi9170 mentioned this pull request Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants