|
| 1 | +example_0030_demo_energy_ratio.py |
| 2 | +====================================== |
| 3 | + |
| 4 | +The code for this example can be found here: |
| 5 | +`example_0030_demo_energy_ratio.py |
| 6 | +<https://github.com/NREL/floris/blob/develop/examples/example_0030_demo_energy_ratio.py>`_ |
| 7 | + |
| 8 | +This example uses FLORIS to demonstrate the energy ratio method used in analyzing field campagin data. |
| 9 | +A version of this code is used for example in the paper: |
| 10 | +`Initial results from a field campaign of wake steering applied at a commercial wind farm – Part 1 |
| 11 | +<https://www.wind-energ-sci.net/4/273/2019/wes-4-273-2019.html>`_ |
| 12 | + |
| 13 | +The example sets up a FLORIS farm in which a simulated controller (which simply sets an upstream |
| 14 | +turbine to have a fixed 20 deg offset is tested). The farm consists of a control turbine which implements |
| 15 | +the strategy, a downstream turbine effect by this change, and a reference turbine not-impacted. The farm is shown here: |
| 16 | + |
| 17 | +.. image:: ../../_static/images/EnergyRatioLayout.png |
| 18 | + |
| 19 | + |
| 20 | +After setting the farm, the farm is simulated using random wind speed directions with the upstream turbine aligned (Baseline) |
| 21 | +or set to 20 degrees offset in yaw (controlled). The power of the reference and test turbine are saved in arrays in this block |
| 22 | +for the baseline case: |
| 23 | + |
| 24 | +:: |
| 25 | + |
| 26 | + # Initialize the arrays for baseline |
| 27 | + ref_pow_base = np.zeros(n_sim) |
| 28 | + test_pow_base = np.zeros(n_sim) |
| 29 | + ws_base = np.random.uniform(low=5,high=15.,size=n_sim) |
| 30 | + wd_base = wd_var_scale * (np.random.rand(n_sim) - 0.5) + 270. |
| 31 | + |
| 32 | + # Run the baseline |
| 33 | + for i, (ws,wd) in enumerate(zip(ws_base,wd_base)): |
| 34 | + fi.reinitialize_flow_field(wind_speed=ws, wind_direction=wd) |
| 35 | + fi.calculate_wake() |
| 36 | + turb_powers = fi.get_turbine_power() |
| 37 | + ref_pow_base[i] = turb_powers[1] # The unaffacted second turbine |
| 38 | + test_pow_base[i] = turb_powers[2] # The downstream turbine |
| 39 | + |
| 40 | +These saved arrays are then used to demonstrate the balanced energy ratio methods in the final block |
| 41 | + |
| 42 | +:: |
| 43 | + |
| 44 | + fig, axarr = plt.subplots(3,1,sharex=True,figsize=(10,10)) |
| 45 | + |
| 46 | + plot_energy_ratio(ref_pow_base,test_pow_base,ws_base,wd_base, |
| 47 | + ref_pow_con,test_pow_con,ws_con,wd_con, |
| 48 | + wd_bins, plot_simple=False, axarr=axarr, label_array=['Field Baseline', 'Field Controlled'], |
| 49 | + label_pchange='Field Gain' ) |
0 commit comments