NREL / hercules

Hercules
https://nrel.github.io/hercules/
Apache License 2.0
3 stars 7 forks source link

[BUGFIX] Force `yaw_angles` to zero in `FlorisStandin` when `power_setpoints` passed #109

Closed misi9170 closed 1 month ago

misi9170 commented 3 months ago

@genevievestarke pointed out that an error can occur when using the FlorisStandin with a changing wind direction when performing active power control of the turbines. This occurs because the FlorisStandin turbines do not perfectly track the wind direction when it changes, which causes a yaw misalignment. FLORIS is not yet capable of simultaneously simulating a yaw misalignment and a demanded power from a turbine, so the simulation errors out. See #108.

The behavior is expected, and is actually tested here. However, to allow both a changing wind direction and active power control, this pull request ensures that, if a power setpoint is given to a specific turbine, it's yaw angle is set to zero to avoid raising the FLORIS error.

This is not a perfect solution, because yawing is now possibly unrealistic. If, in future, we have a Floris turbine operation model that can handle simultaneous yawing and derating, we will switch to that in the FlorisStandin.

@genevievestarke , you should now be able to run your example of the hybrid wind/solar/battery plant.

Paul: Added some additional changes in the course of debugging tests:

  1. Removed unnecessary explicit install of FLORIS v4 in CI
  2. Updated the call to ruff to follow new ruff check syntax
  3. Added automatic testing of macos in addition to ubuntu-latest so in the future we will know if an issue is os-specific
misi9170 commented 3 months ago

These are failing tests due to a segmentation fault (the tests run fine for me locally). I'll try rerunning them again tomorrow.

misi9170 commented 1 month ago

After attempting to debug this, we decided it was an upstream bug (possibly from matplotlib). Because it is not affecting our processes locally, we have decided to merge this PR and hope that the bug will be fixed upstream in future. @genevievestarke , I'm going to go ahead and merge.

@paulf81 , please feel free to add any further comments from your attempt to debug the failing tests.