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

Code for determining which turbines impact the power of a given turbine #70

Merged
merged 9 commits into from
Mar 2, 2023

Conversation

misi9170
Copy link
Collaborator

@misi9170 misi9170 commented Feb 23, 2023

Ready for review and merge.

New functionality added to floris_tools.py to compute which turbines impact and depend on a specified turbine, based on their variations in power predicted by FLORIS.

Tasks:

  • Implement code to determine which turbines impact a specified turbine
  • Implement code to determine which turbines depend on a specified turbine
  • Implement wrappers for both of the above to run over all turbines [Note: dependencies are available per turbine. impacting turbines are available only as a full set, due to code structure]
  • Create example that shows usage
  • Create tests

@misi9170
Copy link
Collaborator Author

Addresses #57

@misi9170 misi9170 marked this pull request as draft February 23, 2023 23:23
@codecov-commenter
Copy link

Codecov Report

Base: 27.23% // Head: 30.51% // Increases project coverage by +3.27% 🎉

Coverage data is based on head (972c807) compared to base (07bf1f0).
Patch coverage: 7.45% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #70      +/-   ##
===========================================
+ Coverage    27.23%   30.51%   +3.27%     
===========================================
  Files           32       40       +8     
  Lines         3565     4303     +738     
===========================================
+ Hits           971     1313     +342     
- Misses        2594     2990     +396     
Impacted Files Coverage Δ
flasc/energy_ratio/__init__.py 100.00% <ø> (ø)
flasc/energy_ratio/energy_ratio_suite.py 8.74% <4.47%> (-1.46%) ⬇️
flasc/energy_ratio/energy_ratio_gain.py 7.16% <7.16%> (ø)
flasc/turbine_analysis/find_sensor_faults.py 8.64% <10.16%> (-0.06%) ⬇️
flasc/floris_tools.py 46.73% <12.50%> (-2.92%) ⬇️
tests/floris_tools_test.py 100.00% <0.00%> (ø)
tests/optimization_test.py 100.00% <0.00%> (ø)
tests/yaw_power_curve_estimation_test.py 100.00% <0.00%> (ø)
tests/df_time_operations_test.py 100.00% <0.00%> (ø)
tests/dataframe_manipulations_test.py 100.00% <0.00%> (ø)
... and 3 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

…st_turbine, rather than the other way around as originally written. Renaming functions and updating documentation for clarity.
@Bartdoekemeijer
Copy link
Collaborator

Bartdoekemeijer commented Feb 24, 2023

These functions are super helpful, Misha, thanks! Have you already figured out how you want to do (1)?

@Bartdoekemeijer
Copy link
Collaborator

Maybe to continue this conversation, I'd like the same functionality and I had a look in the FLORIS code, here:
https://github.com/NREL/floris/blob/1d84538c334a502c6ad7df48b8cc2309d6a6436d/floris/simulation/solver.py#L161

which introduces the variable velocity_deficit. The function is called in a loop from 0 to n_turbines. The variable has dimensions (n_wind_directions, n_wind_speeds, n_wind_turbines, n_rotor_points, n_rotor_points). So you get one of these variables for each turbine, and it shows the wake losses it causes at all downstream and upstream turbines. With some basic logic, you can derive which turbines are impacting which downstream turbines, and hence vice versa, without rerunning any FLORIS code.

Note that this solution does not take care of wake summation so there may be some small differences between this and your method, but perhaps still relatively small. Could be worth considering, in case you hadn't made up your mind yet!

@misi9170
Copy link
Collaborator Author

@Bartdoekemeijer thanks for the comment here! I have now added a first pass for the first task, which simply rearranges the output of the "dependent turbine" function. It's a bit clunky though, because the returned impacting turbines are not ordered. Still, a possible fix is to generate this as a class and assign the size of the impacts (found in the dependent function to memory so that they can be later used for ordering in the impacting function). I'll also think about your suggestion some more

@misi9170 misi9170 marked this pull request as ready for review March 1, 2023 23:29
@misi9170
Copy link
Collaborator Author

misi9170 commented Mar 1, 2023

@Bartdoekemeijer, all intended functionality is now in. The new example (in examples/layout/turbine_dependencies.py) should give an idea of functionality. @paulf81 does this hit all the functionality you'd like to see?

@Bartdoekemeijer
Copy link
Collaborator

I actually have been using the get_all_impacting_turbines function for a new thing I have been working on internally and it's been great so far! The examples look good too. Thanks for doing this Misha!

@paulf81
Copy link
Collaborator

paulf81 commented Mar 2, 2023

Hi Misha this is great and indeeds include all the functionality I hoped for in a really neat arrangement! I added a few small comments (maybe check I am indeed explaining nomenclature right). Otherwise this is good to merge from my perspective.

@misi9170
Copy link
Collaborator Author

misi9170 commented Mar 2, 2023

@paulf81 Thanks, yes, your comments look good to me. Squashing and merging.

@misi9170 misi9170 merged commit 39257c7 into NREL:develop Mar 2, 2023
@misi9170 misi9170 deleted the feature/turbine-dependencies branch March 2, 2023 16:30
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.

4 participants