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

Update yaw and layout optimization tools for 4D #790

Merged
merged 19 commits into from
Feb 20, 2024

Conversation

bayc
Copy link
Collaborator

@bayc bayc commented Feb 1, 2024

Update yaw and layout optimization tools and examples to new 4D format.

This PR makes the changes necessary for the yaw and layout optimization capabilities in FLORIS to support the new 4D wind condition format. It updates both the necessary tools and the related examples. It mainly focuses on eliminating the now extra dimension and introducing a wind speed array and a turbulence intensity array where necessary. It also removes the layout symmetry functionality as it would not work well with the new timeseries focus of the inputs.

Related issue

None

Impacted areas of the software

floris/tools/opitmization
examples

Additional supporting information

These changes were evaluated compared to the execution and results of the same examples in the v3 develop branch (a88a154). Note that for the examples to produce the exact same results, the older turbine performance data needed to be used with the new turbine definition file format (specifically, this version of the NREL 5MW was used: https://github.com/NREL/floris/blob/8e6fb6b54c1a7824d801499cf90037dd4bb59fb4/floris/turbine_library/nrel_5MW_v4converted.yaml).

Note that with the new support for time series as input, certain features were excluded from this update, specifically exploit_layout_symmetry. The related code was removed.

Also, verify_convergence is currently broken and needs to be updated. I noticed results that would eliminate yaw angles under certain conditions (e.g. a full wind rose) and not under other (e.g. a couple wind directions with one wind speed). I believe this could be due to some normalization that is happening, but I have not confirmed that.

I believe it would be worth while to add tests to some basic optimization results, just so we can track if results shift through other code development or updates in dependencies.

Test results, if applicable

See above to produce test results.

@bayc bayc force-pushed the update_opt_tools_to_4d branch from e319ea3 to 912e480 Compare February 15, 2024 05:20
@bayc bayc marked this pull request as ready for review February 15, 2024 05:20
@bayc bayc self-assigned this Feb 15, 2024
@bayc bayc added enhancement An improvement of an existing feature floris.tools floris.optimization v4 Focus of FLORIS v4 labels Feb 15, 2024
@bayc bayc added this to the v4.0 milestone Feb 15, 2024
@paulf81
Copy link
Collaborator

paulf81 commented Feb 16, 2024

This looks great @bayc ! I just left a few small comments for your considerations

@bayc bayc changed the title snapshot of updating yaw opt to 4d Update yaw and layout optimization tools for 4D Feb 16, 2024
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.

Thanks for taking care of this @bayc. I left a few comments, but one other comment throughout is that in addition to introducing the wind speed array to a lot of the optimization function calls, does the TI array also need to be added? (for example in fi.reinitialize and self._calculate_farm_power) I think so because self.fi.floris.flow_field.turbulence_intensities is now defined as an array with the same length as the wind direction and wind speed arrays.

examples/12_optimize_yaw.py Outdated Show resolved Hide resolved
@bayc
Copy link
Collaborator Author

bayc commented Feb 17, 2024

Thanks for taking care of this @bayc. I left a few comments, but one other comment throughout is that in addition to introducing the wind speed array to a lot of the optimization function calls, does the TI array also need to be added? (for example in fi.reinitialize and self._calculate_farm_power) I think so because self.fi.floris.flow_field.turbulence_intensities is now defined as an array with the same length as the wind direction and wind speed arrays.

Good call @ejsimley , I have updated throughout where I believe the ti_array should be added, if you want to look at the latest commits.

@paulf81 paulf81 self-requested a review February 19, 2024 16:49
Copy link
Collaborator

@paulf81 paulf81 left a comment

Choose a reason for hiding this comment

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

Thank you for addressing my comments @bayc , approve!

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've looked through the changes and pulled down and run the examples---all looks good to me. Thanks @bayc!

@bayc bayc requested a review from ejsimley February 19, 2024 19:30
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.

Hi @bayc, the changes to add the turbulence intensity array inputs look good. I just found a couple places in parallel_computing_interface where I think they're needed as well.

floris/tools/parallel_computing_interface.py Outdated Show resolved Hide resolved
floris/tools/parallel_computing_interface.py Outdated Show resolved Hide resolved
@rafmudaf rafmudaf merged commit 12e3166 into NREL:v4 Feb 20, 2024
8 checks passed
@misi9170 misi9170 mentioned this pull request Apr 8, 2024
4 tasks
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 floris.optimization floris.tools v4 Focus of FLORIS v4
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants