Bug In AWC Operation Model

by ADMIN 27 views

The AWC (Active Wake Control) operation model in Floris is a crucial component for simulating the behavior of wind turbines in a wind farm. However, a bug has been discovered in the computation of power and thrust of actuated turbines, specifically those set to 'helix' as opposed to 'baseline'. This bug stems from the use of the any() function in the operation_models.py file of the Floris repository.

How to Reproduce the Bug

To reproduce the bug, we can use a minimal example that demonstrates the issue. The following code snippet sets up two Floris models, one for the baseline case and one for the AWC case, and then runs them to calculate the turbine powers.

import numpy as np 
from floris import (
    FlorisModel,
    WindRose,
)
cases = ["Baseline","AWC",]
fmodels = {}
fmodels['Baseline'] = FlorisModel("../floris/examples/inputs/emgauss_helix.yaml")
fmodels['AWC'] = FlorisModel("../floris/examples/inputs/emgauss_helix.yaml")
awc_array = ['helix','baseline','baseline']
baseline_array = ['baseline','baseline','baseline']
awc_amplitudes = [4,4,4]

fmodels['Baseline'].set_operation_model("awc")
fmodels['Baseline'].set(
    awc_modes=np.array([baseline_array]),
    awc_amplitudes=np.array([awc_amplitudes])
    )

fmodels['AWC'].set_operation_model("awc")
fmodels['AWC'].set(
    awc_modes=np.array([awc_array]),
    awc_amplitudes=np.array([awc_amplitudes])
    )

turbine_powers = {}
for case in cases:
    floris_model = fmodels[case]
    floris_model.run_no_wake()
    turbine_powers[case] = floris_model.get_turbine_powers()/1000
    print(case,": ",turbine_powers[case])

Running this code will produce the following output:

Baseline :  [[6301.1399872 6301.1399872 6301.1399872]]
AWC :  [[5908.03837044 5908.03837044 5908.03837044]]

However, the correct output should be:

Baseline :  [[6301.1399872 6301.1399872 6301.1399872]]
AWC :  [[5908.03837044 6301.1399872  6301.1399872 ]]

Impact of the Bug

The bug in the AWC operation model has a significant impact on the results of wind farm simulations. Specifically, it causes the power of all turbines to be reduced, even if only one turbine is set to 'helix'. This can lead to incorrect estimates of AEP (Annual Energy Production) and other performance metrics.

Minimal Example with Wind Sweep

To further demonstrate the impact of the bug, we can use a minimal example with two wind conditions. The following code snippet sets up two Floris models, one for the baseline case and one for the AWC case, and then runs them to calculate the turbine powers at two different wind speeds.

for caseiter, case in enumerate(cases):
    fmodel = fmodels[case]
    fmodel.set(
    wind_directions=np.array([270.0, 270.0]),
    wind_speeds=[5.0, 12.0],
    turbulence_intensities=np.array([0.06, 0.06]),
    )
    baseline_setting =  np.array([['baseline', 'baseline', 'baseline'],['baseline', 'baseline', 'baseline']])
    awc_setting =  np.array([['helix', 'baseline', 'baseline'],['baseline', 'baseline', 'baseline']])
    awc_amps = np.array([awc_amplitudes]*2)
    if 'Baseline' in case:
        fmodel.set(awc_modes=baseline_setting,awc_amplitudes=awc_amps)
    else:
        fmodel.set(awc_modes=awc_setting,awc_amplitudes=awc_amps)
    fmodel.run()

turbine_powers = {}
for case in cases:
    floris_model = fmodels[case]
    floris_model.run_no_wake()
    turbine_powers[case] = floris_model.get_turbine_powers()/1000
    print(case,": ",turbine_powers[case])

Running this code will produce the following output:

Baseline :  [[ 1375.2462449  1375.2462449  1375.2462449]
 [15000.        15000.        15000.       ]]
AWC :  [[ 1292.7915507  1292.7915507  1292.7915507]
 [13999.8581506 13999.8581506 13999.8581506]]

However, the correct output should be:

Baseline :  [[ 1375.2462449  1375.2462449  1375.2462449]
 [15000.        15000.        15000.       ]]
AWC :  [[ 1292.7915507  1375.2462449  1375.2462449]
 [15000.        15000.        15000.       ]]

Fixing the Bug

One way to fix the bug is to assume that awc_amplitudes applies even for 'baseline' turbines. However, this is confusing and error-prone, because if all turbines are 'baseline' then awc_amplitudes doesn't matter but if one turbine at one wind condition is 'helix' then awc_amplitude does matter for all 'baseline' turbines at all wind conditions.

A general fix is available on my branch of Floris here: https://github.com/gyalla/floris/tree/awc_fix, and I'm happy to open a pull request.

Floris Version

The bug was originally found with version 4.2.2 installed with conda.

The AWC (Active Wake Control) operation model in Floris is a crucial component for simulating the behavior of wind turbines in a wind farm. However, a bug has been discovered in the computation of power and thrust of actuated turbines, specifically those set to 'helix' as opposed to 'baseline'. In this article, we will answer some frequently asked questions about the bug and its impact on wind farm simulations.

Q: What is the bug in the AWC operation model?

A: The bug in the AWC operation model is caused by the use of the any() function in the operation_models.py file of the Floris repository. This function is used to check if any turbine is set to 'helix', and if so, it reduces the power of all turbines. However, this is not the intended behavior, and the bug causes the power of all turbines to be reduced, even if only one turbine is set to 'helix'.

Q: How does the bug impact wind farm simulations?

A: The bug in the AWC operation model has a significant impact on the results of wind farm simulations. Specifically, it causes the power of all turbines to be reduced, even if only one turbine is set to 'helix'. This can lead to incorrect estimates of AEP (Annual Energy Production) and other performance metrics.

Q: What is the correct behavior of the AWC operation model?

A: The correct behavior of the AWC operation model is to reduce the power of only the turbines that are set to 'helix', and not to reduce the power of all turbines. This is because the AWC operation model is designed to simulate the behavior of wind turbines in a wind farm, and it should only reduce the power of the turbines that are actively controlling the wake.

Q: How can I fix the bug in the AWC operation model?

A: One way to fix the bug is to assume that awc_amplitudes applies even for 'baseline' turbines. However, this is confusing and error-prone, because if all turbines are 'baseline' then awc_amplitudes doesn't matter but if one turbine at one wind condition is 'helix' then awc_amplitude does matter for all 'baseline' turbines at all wind conditions.

A general fix is available on my branch of Floris here: https://github.com/gyalla/floris/tree/awc_fix, and I'm happy to open a pull request.

Q: What is the impact of the bug on wind farm design and optimization?

A: The bug in the AWC operation model can have a significant impact on wind farm design and optimization. Specifically, it can lead to incorrect estimates of AEP and other performance metrics, which can result in suboptimal wind farm designs and layouts.

Q: How can I verify that the bug has been fixed?

A: To verify that the bug has been fixed, you can run the same simulations that you ran before the bug was introduced, and compare the results to the results you obtained before the bug was introduced. You can also use the awc_fix branch of Floris to run the simulations and verify that the bug has been fixed.

Q: What is the status of the bug fix?

A: The bug fix is currently available on my branch of Floris here: https://github.com/gyalla/floris/tree/awc_fix. I am happy to open a pull request to merge the fix into the main branch of Floris.

Q: How can I get involved in the bug fix process?

A: If you are interested in getting involved in the bug fix process, you can start by reviewing the awc_fix branch of Floris and providing feedback on the fix. You can also help to test the fix and provide feedback on its performance. If you are interested in contributing to the fix, you can open a pull request to merge your changes into the awc_fix branch.