Skip to content

Commit

Permalink
Update default parameters for the Empirical Gaussian model (#723)
Browse files Browse the repository at this point in the history
* First update of defaults and minor subsequent improvements to examples.

* attrs defaults updated.

* Updating defaults in test setup, which causes regression test to fail.

* Updating expected output values for reg test.
  • Loading branch information
misi9170 authored Oct 26, 2023
1 parent e9c90aa commit 6c3ddb4
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 38 deletions.
2 changes: 1 addition & 1 deletion examples/26_empirical_gauss_velocity_deficit_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def generate_wake_visualization(fi: FlorisInterface, title=None):
# Increase the base recovery rate
fi_dict_mod = copy.deepcopy(fi_dict)
fi_dict_mod['wake']['wake_velocity_parameters']['empirical_gauss']\
['wake_expansion_rates'] = [0.02, 0.01]
['wake_expansion_rates'] = [0.03, 0.015]
fi = FlorisInterface(fi_dict_mod)
fi.reinitialize(
wind_speeds=[8.0],
Expand Down
2 changes: 2 additions & 0 deletions examples/27_empirical_gauss_deflection_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
yaw_angles = np.array(first_three_yaw_angles + [0.]*(num_in_row-3))\
[None, None, :]

print("Turbine yaw angles (degrees): ", yaw_angles[0,0,:])

# Define function for visualizing wakes
def generate_wake_visualization(fi, title=None):
# Using the FlorisInterface functions, get 2D slices.
Expand Down
4 changes: 2 additions & 2 deletions examples/29_floating_vs_fixedbottom_farm.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@
y.flatten(),
c=power_difference.flatten()/1000,
cmap="PuOr",
vmin=-100,
vmax=100,
vmin=-30,
vmax=30,
s=200,
)
ax.set_xlabel("x coordinate [m]")
Expand Down
6 changes: 3 additions & 3 deletions examples/inputs/emgauss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ wake:
empirical_gauss:
horizontal_deflection_gain_D: 3.0
vertical_deflection_gain_D: -1
deflection_rate: 15
deflection_rate: 30
mixing_gain_deflection: 0.0
yaw_added_mixing_gain: 0.0

Expand All @@ -88,8 +88,8 @@ wake:
we: 0.05
empirical_gauss:
wake_expansion_rates:
- 0.01
- 0.005
- 0.023
- 0.008
breakpoints_D:
- 10
sigma_0_D: 0.28
Expand Down
6 changes: 3 additions & 3 deletions examples/inputs_floating/emgauss_fixed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ wake:
empirical_gauss:
horizontal_deflection_gain_D: 3.0
vertical_deflection_gain_D: -1
deflection_rate: 15
deflection_rate: 30
mixing_gain_deflection: 0.0
yaw_added_mixing_gain: 0.0

Expand All @@ -88,8 +88,8 @@ wake:
we: 0.05
empirical_gauss:
wake_expansion_rates:
- 0.01
- 0.005
- 0.023
- 0.008
breakpoints_D:
- 10
sigma_0_D: 0.28
Expand Down
6 changes: 3 additions & 3 deletions examples/inputs_floating/emgauss_floating.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ wake:
empirical_gauss:
horizontal_deflection_gain_D: 3.0
vertical_deflection_gain_D: -1
deflection_rate: 15
deflection_rate: 30
mixing_gain_deflection: 0.0
yaw_added_mixing_gain: 0.0

Expand All @@ -88,8 +88,8 @@ wake:
we: 0.05
empirical_gauss:
wake_expansion_rates:
- 0.01
- 0.005
- 0.023
- 0.008
breakpoints_D:
- 10
sigma_0_D: 0.28
Expand Down
6 changes: 3 additions & 3 deletions examples/inputs_floating/emgauss_floating_fixedtilt15.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ wake:
empirical_gauss:
horizontal_deflection_gain_D: 3.0
vertical_deflection_gain_D: -1
deflection_rate: 15
deflection_rate: 30
mixing_gain_deflection: 0.0
yaw_added_mixing_gain: 0.0

Expand All @@ -84,8 +84,8 @@ wake:
we: 0.05
empirical_gauss:
wake_expansion_rates:
- 0.01
- 0.005
- 0.023
- 0.008
breakpoints_D:
- 10
sigma_0_D: 0.28
Expand Down
6 changes: 3 additions & 3 deletions examples/inputs_floating/emgauss_floating_fixedtilt5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ wake:
empirical_gauss:
horizontal_deflection_gain_D: 3.0
vertical_deflection_gain_D: -1
deflection_rate: 15
deflection_rate: 30
mixing_gain_deflection: 0.0
yaw_added_mixing_gain: 0.0

Expand All @@ -84,8 +84,8 @@ wake:
we: 0.05
empirical_gauss:
wake_expansion_rates:
- 0.01
- 0.005
- 0.023
- 0.008
breakpoints_D:
- 10
sigma_0_D: 0.28
Expand Down
2 changes: 1 addition & 1 deletion floris/simulation/wake_deflection/empirical_gauss.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class EmpiricalGaussVelocityDeflection(BaseModel):
"""
horizontal_deflection_gain_D: float = field(default=3.0)
vertical_deflection_gain_D: float = field(default=-1)
deflection_rate: float = field(default=15)
deflection_rate: float = field(default=30)
mixing_gain_deflection: float = field(default=0.0)
yaw_added_mixing_gain: float = field(default=0.0)

Expand Down
2 changes: 1 addition & 1 deletion floris/simulation/wake_velocity/empirical_gauss.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class EmpiricalGaussVelocityDeficit(BaseModel):
:style: unsrt
:filter: docname in docnames
"""
wake_expansion_rates: list = field(default=[0.01, 0.005])
wake_expansion_rates: list = field(default=[0.023, 0.008])
breakpoints_D: list = field(default=[10])
sigma_0_D: float = field(default=0.28)
smoothing_length_D: float = field(default=2.0)
Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def __init__(self):
"empirical_gauss": {
"horizontal_deflection_gain_D": 3.0,
"vertical_deflection_gain_D": -1,
"deflection_rate": 15,
"deflection_rate": 30,
"mixing_gain_deflection": 0.0,
"yaw_added_mixing_gain": 0.0
},
Expand Down Expand Up @@ -437,7 +437,7 @@ def __init__(self):
"sigma_max_rel": 4.0
},
"empirical_gauss": {
"wake_expansion_rates": [0.01, 0.005],
"wake_expansion_rates": [0.023, 0.008],
"breakpoints_D": [10],
"sigma_0_D": 0.28,
"smoothing_length_D": 2.0,
Expand Down
32 changes: 16 additions & 16 deletions tests/reg_tests/empirical_gauss_regression_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,26 @@
# 8 m/s
[
[7.9736330, 0.7636044, 1691326.6483808, 0.2568973],
[5.1827276, 0.8807411, 441118.3637433, 0.3273306],
[4.9925898, 0.8926413, 385869.8808447, 0.3361718],
[5.8890878, 0.8410986, 668931.9953790, 0.3006878],
[5.9448342, 0.8382459, 688269.8273350, 0.2989067],
],
# 9m/s
[
[8.9703371, 0.7625570, 2407841.6718785, 0.2563594],
[5.8355012, 0.8438407, 650343.4078478, 0.3024150],
[5.6871296, 0.8514332, 598874.9374620, 0.3072782],
[6.6288143, 0.8071935, 969952.7378773, 0.2804513],
[6.7440713, 0.8025559, 1023598.6805729, 0.2778266],
],
# 10 m/s
[
[9.9670412, 0.7529384, 3298067.1555604, 0.2514735],
[6.5341306, 0.8110034, 925882.5592972, 0.2826313],
[6.4005794, 0.8169593, 869713.2904634, 0.2860837],
[7.4019251, 0.7790665, 1355562.9527211, 0.2649822],
[7.5493339, 0.7745724, 1437063.0620195, 0.2626039],
],
# 11 m/s
[
[10.9637454, 0.7306256, 4363191.9880631, 0.2404936],
[7.3150380, 0.7819182, 1309551.0796815, 0.2665039],
[7.1452486, 0.7874908, 1219637.5477980, 0.2695064],
[8.2349756, 0.7622827, 1867008.5657835, 0.2562187],
[8.3523516, 0.7619629, 1946873.1634864, 0.2560548],
],
]
)
Expand All @@ -71,26 +71,26 @@
# 8 m/s
[
[7.9736330, 0.7606986, 1679924.0721706, 0.2549029],
[5.2892493, 0.8741162, 472289.7835635, 0.3225995],
[5.0661805, 0.8879895, 407013.1948403, 0.3326601],
[5.9257102, 0.8392246, 681635.9273649, 0.2995159],
[5.9615388, 0.8373911, 694064.4542077, 0.2983761],
],
# 9 m/s
[
[8.9703371, 0.7596552, 2391434.0080674, 0.2543734],
[5.9548519, 0.8377333, 691744.8624111, 0.2985883],
[5.7711008, 0.8471363, 628003.5991427, 0.3045110],
[6.6698959, 0.8055405, 989074.0018995, 0.2795122],
[6.7631531, 0.8017881, 1032480.2286024, 0.2773950],
],
# 10 m/s
[
[9.9670412, 0.7500732, 3275671.6727516, 0.2495630],
[6.6618693, 0.8058635, 985338.0488503, 0.2796954],
[6.4905463, 0.8128125, 906166.1389747, 0.2836741],
[7.4463751, 0.7776077, 1379101.8806016, 0.2642075],
[7.5701211, 0.7740351, 1449519.8581580, 0.2623212],
],
# 11 m/s
[
[10.9637454, 0.7278454, 4333842.6695283, 0.2387424],
[7.4437653, 0.7776933, 1377719.8294419, 0.2642530],
[7.2350472, 0.7845435, 1267191.1878400, 0.2679136],
[8.2809317, 0.7621575, 1898277.8462234, 0.2561545],
[8.3710828, 0.7619119, 1959618.1795131, 0.2560286],
],
]
)
Expand Down

0 comments on commit 6c3ddb4

Please sign in to comment.