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

Require TI must be length n_findex in core code #831

Merged
merged 46 commits into from
Mar 8, 2024

Conversation

paulf81
Copy link
Collaborator

@paulf81 paulf81 commented Mar 6, 2024

Require TI must be n_findex in core code

After some discussions we agreed that a consistent to handle a few issues would be for the "core" code to require the turbulence intensities must be n_findex. This avoids ambiguities and cases where the code might perform unexpectedly. However, to simplify things for the user, the wind_data objects, WindRose, WindTIRose and TimeSeries will each now include methods for broadcasting a provided float value to match the given dimensions.

Further, the approach proposed in PR #821, where heterogeneity can be described with respect to wd, in addition along findex, will be adapted in this pull request to be methods of the respective WindData objects. This enables that FlorisInterface can go back to requiring het_map to be have 0th dimension n_findex long, simplifying that code.

Steps in this draft then:

  • In flowfield: require that turbulence_intensities be length n_findex
  • In FlorisInterface: remove helper code to catch unchanged TI and set automatically
  • Update impacted tests to adjust to these changed requirements
  • Ensure all examples are working with new stricter rules
  • Enable broadcasting in the wind data objects
  • Add tests of broadcasting
  • Reorganize unpack function to TI appears before freq, consistent with inputs
  • Implement heterogeneity via wind direction in the wind data objects
  • Add tests of new heterogeneity functionality
  • Close Enable heterogeneity to work with new 4D framework and wind_data objects #814
  • Update the first example around these new rules

Related issue

PR #821

@paulf81 paulf81 added the v4 Focus of FLORIS v4 label Mar 6, 2024
@paulf81 paulf81 added this to the v4.0 milestone Mar 6, 2024
@paulf81 paulf81 self-assigned this Mar 6, 2024
@paulf81 paulf81 marked this pull request as ready for review March 6, 2024 22:26
@paulf81 paulf81 requested a review from ejsimley March 6, 2024 22:26
@paulf81
Copy link
Collaborator Author

paulf81 commented Mar 6, 2024

hi @rafmudaf @misi9170 and @ejsimley , I think this is now just about ready for review, I kept the checklist above up to date as I went so should provide a good overview of what changed and why. I originally thought it smart to update examples in this pull request but now think it's maybe best to separate that piece out, so crossed it out. If you could have a look would appreciate!

@paulf81
Copy link
Collaborator Author

paulf81 commented Mar 6, 2024

Ah shoot no, I need to update all the examples, sorry, one last thing

@paulf81
Copy link
Collaborator Author

paulf81 commented Mar 7, 2024

Ok I think all examples are fixed and this is ready for review

Copy link
Collaborator

@ejsimley ejsimley left a comment

Choose a reason for hiding this comment

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

Looks good to me, aside form some clarification in the docstrings about the heterogenous_inflow_config dimensions.

floris/tools/wind_data.py Outdated Show resolved Hide resolved
floris/tools/wind_data.py Show resolved Hide resolved
floris/tools/wind_data.py Outdated Show resolved Hide resolved
@paulf81 paulf81 requested a review from ejsimley March 7, 2024 21:42
Copy link
Collaborator

@ejsimley ejsimley left a comment

Choose a reason for hiding this comment

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

Made a few last docstring updates. I think it looks good now.

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.

I haven't pulled down and run, but this looks good overall to me

Mostly around the tab level for arguments that are split by line
floris/simulation/flow_field.py Outdated Show resolved Hide resolved
floris/tools/floris_interface.py Show resolved Hide resolved
@paulf81
Copy link
Collaborator Author

paulf81 commented Mar 8, 2024

Thanks for all the feedback gang, merging now!

@paulf81 paulf81 merged commit f17fd58 into NREL:v4 Mar 8, 2024
8 checks passed
@paulf81 paulf81 deleted the feature/strict_ti_rules branch March 8, 2024 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v4 Focus of FLORIS v4
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants