-
Notifications
You must be signed in to change notification settings - Fork 156
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
Bug fix: GCH effective yaw angle in FLORIS v2 #734
Conversation
As an installable package, sklearn is deprecated and the package is now called scikit-learn
Hey @RHammond2 I'm planning to merge this pull request into the |
@rafmudaf I really don't know on this, and can't find anything relating to it. I tried poking around the package management settings in another project I work on, and I can't find anything on the management of the latest release. If you find anything, I'd love to know more, but for some reason this is one of the rare things that seemingly no one has written a blog post about. |
Well we'll see. Here it goes! |
@fg320 After making a small mess of things, this is merged in the
|
@rafmudaf I tested installing floris with no version from PyPI and it does choose the highest version not the most recent release. |
Fix incorrect GCH effective yaw angle in FLORIS v2
This pull request addresses the issue in #684, where a bug in FLORIS v2 is pointed out regarding the GCH calculations for the effective yaw angle. The bug is in the
calculate_effective_yaw_angle
method in the filefloris/simulation/wake_deflection/gauss.py
.After defining the minimum and maximum limits for the effective yaw angles as
L300
min_yaw = -45.0
L301
max_yaw = 45.0
,the actual implementation introduces a second negative sign for the negative yaw angle
L347
if idx_1 == 90 or idx_2 == 90:
L348
yaw_effective = max_yaw
L350
elif idx_1 == 0 or idx_2 == 0:
L351
yaw_effective = -min_yaw
.This causes the application of a +45 deg effective yaw angle instead of a -45 deg one (refer to the example code and plots below). L351 should be replaced by
yaw_effective = +min_yaw
.Related issue
Issue #684Impacted areas of the software
`floris/simulation/wake_deflection/gauss.py`Example test
Please refer to the simple example code below, where `gauss_legacy_ste.json` is based on the available examples and included in the last section of this report.Example test output
The above case describes a simple 5x1 layout of NREL-5MW turbines in aligned conditions (270deg wind direction), 5% turbulence intensity, 8m/s uniform inflow. No wind shear and veer. The yaw angles (from the most upstream turbine) are, in degrees, [-25.0, -25.0, 0.0, 0.0, 0.0]. The resulting flow field with the bug is shown below. Clearly, the third turbine should experience a negative deflection (although its yaw angle is 0deg) due to secondary steering effects. Instead, a sudden shift is noticed with a positive deflection applied to the wake.
After fixing the bug, the flow field is physical, where a negative deflection is applied to the downstream wakes of non-yawed turbines.
In terms of turbine and farm power, the difference is minimal. However, the bug introduces an incorrect description of the flow field and discontinuities in the GCH farm power function, significantly affecting the performance of gradient-based optimisers such as SLSQP.
Input file
gauss_legacy_ste.json