Skip to content

Commit 93cb7b8

Browse files
authored
Clarify turbine definition terms (#815)
* pP -> cosine_loss_exponent_yaw throughout. * pT -> cosine_loss_exponent_tilt throughout. * Remove unused generator_efficiency key on turbine definitions. * Comments updated to better explain the role of the cosine_loss_exponent_yaw. * ruff.
1 parent d4c6a1f commit 93cb7b8

21 files changed

+138
-101
lines changed

examples/33_specify_turbine_power_curve.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
file_name=None,
3232
generator_efficiency=1,
3333
hub_height=90,
34-
pP=1.88,
35-
pT=1.88,
34+
cosine_loss_exponent_yaw=1.88,
35+
cosine_loss_exponent_tilt=1.88,
3636
rotor_diameter=126,
3737
TSR=8,
3838
ref_air_density=1.225,

examples/inputs_floating/turbine_files/nrel_5MW_fixed.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
turbine_type: 'nrel_5MW_floating'
2-
generator_efficiency: 0.944
32
hub_height: 90.0
43
rotor_diameter: 125.88
54
TSR: 8.0
65
correct_cp_ct_for_tilt: True # Apply tilt correction to cp/ct
76
power_thrust_table:
87
ref_air_density: 1.225
98
ref_tilt: 5.0
10-
pP: 1.88
11-
pT: 1.88
9+
cosine_loss_exponent_yaw: 1.88
10+
cosine_loss_exponent_tilt: 1.88
1211
power:
1312
- 0.0
1413
- 0.0

examples/inputs_floating/turbine_files/nrel_5MW_floating.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
turbine_type: 'nrel_5MW_floating'
2-
generator_efficiency: 0.944
32
hub_height: 90.0
43
rotor_diameter: 125.88
54
TSR: 8.0
65
correct_cp_ct_for_tilt: True # Apply tilt correction to cp/ct
76
power_thrust_table:
87
ref_air_density: 1.225
98
ref_tilt: 5.0
10-
pP: 1.88
11-
pT: 1.88
9+
cosine_loss_exponent_yaw: 1.88
10+
cosine_loss_exponent_tilt: 1.88
1211
power:
1312
- 0.0
1413
- 0.0

examples/inputs_floating/turbine_files/nrel_5MW_floating_defined_floating.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
turbine_type: 'nrel_5MW_floating'
2-
generator_efficiency: 0.944
32
hub_height: 90.0
43
rotor_diameter: 125.88
54
TSR: 8.0
65
correct_cp_ct_for_tilt: False # Do not apply tilt correction to cp/ct
76
power_thrust_table:
87
ref_air_density: 1.225
98
ref_tilt: 5.0
10-
pP: 1.88
11-
pT: 1.88
9+
cosine_loss_exponent_yaw: 1.88
10+
cosine_loss_exponent_tilt: 1.88
1211
power:
1312
- 0.0
1413
- 0.0

examples/inputs_floating/turbine_files/nrel_5MW_floating_fixedtilt15.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
turbine_type: 'nrel_5MW_floating'
2-
generator_efficiency: 0.944
32
hub_height: 90.0
43
rotor_diameter: 125.88
54
TSR: 8.0
65
correct_cp_ct_for_tilt: True # Apply tilt correction to cp/ct
76
power_thrust_table:
87
ref_air_density: 1.225
98
ref_tilt: 5.0
10-
pP: 1.88
11-
pT: 1.88
9+
cosine_loss_exponent_yaw: 1.88
10+
cosine_loss_exponent_tilt: 1.88
1211
power:
1312
- 0.0
1413
- 0.0

examples/inputs_floating/turbine_files/nrel_5MW_floating_fixedtilt5.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
turbine_type: 'nrel_5MW_floating'
2-
generator_efficiency: 0.944
32
hub_height: 90.0
43
rotor_diameter: 125.88
54
TSR: 8.0
65
correct_cp_ct_for_tilt: True # Apply tilt correction to cp/ct
76
power_thrust_table:
87
ref_air_density: 1.225
98
ref_tilt: 5.0
10-
pP: 1.88
11-
pT: 1.88
9+
cosine_loss_exponent_yaw: 1.88
10+
cosine_loss_exponent_tilt: 1.88
1211
power:
1312
- 0.0
1413
- 0.0

floris/simulation/rotor_velocity.py

+13-10
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818

1919

2020
def rotor_velocity_yaw_correction(
21-
pP: float,
21+
cosine_loss_exponent_yaw: float,
2222
yaw_angles: NDArrayFloat,
2323
rotor_effective_velocities: NDArrayFloat,
2424
) -> NDArrayFloat:
2525
# Compute the rotor effective velocity adjusting for yaw settings
26-
pW = pP / 3.0 # Convert from pP to w
26+
pW = cosine_loss_exponent_yaw / 3.0 # Convert from cosine_loss_exponent_yaw to w
2727
# TODO: cosine loss hard coded
2828
rotor_effective_velocities = rotor_effective_velocities * cosd(yaw_angles) ** pW
2929

@@ -32,7 +32,7 @@ def rotor_velocity_yaw_correction(
3232
def rotor_velocity_tilt_correction(
3333
tilt_angles: NDArrayFloat,
3434
ref_tilt: NDArrayFloat,
35-
pT: float,
35+
cosine_loss_exponent_tilt: float,
3636
tilt_interp: NDArrayObject,
3737
correct_cp_ct_for_tilt: NDArrayBool,
3838
rotor_effective_velocities: NDArrayFloat,
@@ -50,7 +50,10 @@ def rotor_velocity_tilt_correction(
5050
# Compute the rotor effective velocity adjusting for tilt
5151
# TODO: cosine loss hard coded
5252
relative_tilt = tilt_angles - ref_tilt
53-
rotor_effective_velocities = rotor_effective_velocities * cosd(relative_tilt) ** (pT / 3.0)
53+
rotor_effective_velocities = (
54+
rotor_effective_velocities
55+
* cosd(relative_tilt) ** (cosine_loss_exponent_tilt / 3.0)
56+
)
5457
return rotor_effective_velocities
5558

5659
def simple_mean(array, axis=0):
@@ -177,8 +180,8 @@ def rotor_effective_velocity(
177180
yaw_angle: NDArrayFloat,
178181
tilt_angle: NDArrayFloat,
179182
ref_tilt: NDArrayFloat,
180-
pP: float,
181-
pT: float,
183+
cosine_loss_exponent_yaw: float,
184+
cosine_loss_exponent_tilt: float,
182185
tilt_interp: NDArrayObject,
183186
correct_cp_ct_for_tilt: NDArrayBool,
184187
turbine_type_map: NDArrayObject,
@@ -198,8 +201,8 @@ def rotor_effective_velocity(
198201
yaw_angle = yaw_angle[:, ix_filter]
199202
tilt_angle = tilt_angle[:, ix_filter]
200203
ref_tilt = ref_tilt[:, ix_filter]
201-
pP = pP[:, ix_filter]
202-
pT = pT[:, ix_filter]
204+
cosine_loss_exponent_yaw = cosine_loss_exponent_yaw[:, ix_filter]
205+
cosine_loss_exponent_tilt = cosine_loss_exponent_tilt[:, ix_filter]
203206
turbine_type_map = turbine_type_map[:, ix_filter]
204207

205208
# Compute the rotor effective velocity adjusting for air density
@@ -212,7 +215,7 @@ def rotor_effective_velocity(
212215

213216
# Compute the rotor effective velocity adjusting for yaw settings
214217
rotor_effective_velocities = rotor_velocity_yaw_correction(
215-
pP,
218+
cosine_loss_exponent_yaw,
216219
yaw_angle,
217220
rotor_effective_velocities
218221
)
@@ -222,7 +225,7 @@ def rotor_effective_velocity(
222225
turbine_type_map,
223226
tilt_angle,
224227
ref_tilt,
225-
pT,
228+
cosine_loss_exponent_tilt,
226229
tilt_interp,
227230
correct_cp_ct_for_tilt,
228231
rotor_effective_velocities,

floris/simulation/turbine/operation_models.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ class CosineLossTurbine(BaseOperationModel):
167167
"""
168168
Static class defining an actuator disk turbine model that may be misaligned with the flow.
169169
Nonzero tilt and yaw angles are handled via cosine relationships, with the power lost to yawing
170-
defined by the pP exponent. This turbine submodel is the default, and matches the turbine
171-
model in FLORIS v3.
170+
defined by the cosine of the yaw misalignment raised to the power of cosine_loss_exponent_yaw.
171+
This turbine submodel is the default, and matches the turbine model in FLORIS v3.
172172
173173
As with all turbine submodules, implements only static power() and thrust_coefficient() methods,
174174
which are called by power() and thrust_coefficient() on turbine.py, respectively. This class is
@@ -211,15 +211,15 @@ def power(
211211
)
212212

213213
rotor_effective_velocities = rotor_velocity_yaw_correction(
214-
pP=power_thrust_table["pP"],
214+
cosine_loss_exponent_yaw=power_thrust_table["cosine_loss_exponent_yaw"],
215215
yaw_angles=yaw_angles,
216216
rotor_effective_velocities=rotor_effective_velocities,
217217
)
218218

219219
rotor_effective_velocities = rotor_velocity_tilt_correction(
220220
tilt_angles=tilt_angles,
221221
ref_tilt=power_thrust_table["ref_tilt"],
222-
pT=power_thrust_table["pT"],
222+
cosine_loss_exponent_tilt=power_thrust_table["cosine_loss_exponent_tilt"],
223223
tilt_interp=tilt_interp,
224224
correct_cp_ct_for_tilt=correct_cp_ct_for_tilt,
225225
rotor_effective_velocities=rotor_effective_velocities,

floris/simulation/turbine/turbine.py

+14-13
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,12 @@ def power(
117117
"""
118118
# TODO: Change the order of input arguments to be consistent with the other
119119
# utility functions - velocities first...
120-
# Update to power calculation which replaces the fixed pP exponent with
121-
# an exponent pW, that changes the effective wind speed input to the power
122-
# calculation, rather than scaling the power. This better handles power
123-
# loss to yaw in above rated conditions
120+
# Update to power calculation which replaces the fixed cosine_loss_exponent_yaw exponent
121+
# (which applies to the cosine of the yaw misalignment) with an exponent pW, that changes the
122+
# effective wind speed input to the power calculation, rather than scaling the power. This
123+
# better handles power loss to yaw in above rated conditions
124124
#
125-
# based on the paper "Optimising yaw control at wind farm level" by
125+
# Based on the paper "Optimising yaw control at wind farm level" by
126126
# Ervin Bossanyi
127127

128128
# Down-select inputs if ix_filter is given
@@ -390,8 +390,6 @@ class Turbine(BaseClass):
390390
rotor_diameter (float): The rotor diameter in meters.
391391
hub_height (float): The hub height in meters.
392392
TSR (float): The Tip Speed Ratio of the turbine.
393-
generator_efficiency (float): The efficiency of the generator used to scale
394-
power production.
395393
power_thrust_table (dict[str, float]): Contains power coefficient and thrust coefficient
396394
values at a series of wind speeds to define the turbine performance.
397395
The dictionary must have the following three keys with equal length values:
@@ -403,10 +401,10 @@ class Turbine(BaseClass):
403401
or, contain a key "power_thrust_data_file" pointing to the power/thrust data.
404402
Optionally, power_thrust_table may include parameters for use in the turbine submodel,
405403
for example:
406-
pP (float): The cosine exponent relating the yaw misalignment angle to turbine
407-
power.
408-
pT (float): The cosine exponent relating the rotor tilt angle to turbine
409-
power.
404+
cosine_loss_exponent_yaw (float): The cosine exponent relating the yaw misalignment
405+
angle to turbine power.
406+
cosine_loss_exponent_tilt (float): The cosine exponent relating the rotor tilt angle
407+
to turbine power.
410408
ref_air_density (float): The density at which the provided Cp and Ct curves are
411409
defined.
412410
ref_tilt (float): The implicit tilt of the turbine for which the Cp and Ct
@@ -428,7 +426,6 @@ class Turbine(BaseClass):
428426
rotor_diameter: float = field()
429427
hub_height: float = field()
430428
TSR: float = field()
431-
generator_efficiency: float = field()
432429
power_thrust_table: dict = field(default={}) # conversion to numpy in __post_init__
433430
power_thrust_model: str = field(default="cosine-loss")
434431

@@ -527,7 +524,11 @@ def _initialize_multidim_power_thrust_table(self):
527524
key: {
528525
"wind_speed": data['ws'].values,
529526
"power": (
530-
0.5 * self.rotor_area * data['Cp'].values * self.generator_efficiency
527+
# NOTE: generator_efficiency hardcoded to 0.944 here (NREL 5MW default).
528+
# This code will be
529+
# removed in a separate PR when power is specified as an absolute value for
530+
# mutlidimensional turbines
531+
0.5 * self.rotor_area * data['Cp'].values * 0.944
531532
* data['ws'].values ** 3 * power_thrust_table_ref["ref_air_density"] / 1000
532533
), # TODO: convert this to 'power' or 'P' in data tables, as per PR #765
533534
"thrust_coefficient": data['Ct'].values,

floris/tools/convert_turbine_v3_to_v4.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
valid_properties = [
4646
"generator_efficiency",
4747
"hub_height",
48-
"pP",
49-
"pT",
48+
"cosine_loss_exponent_yaw",
49+
"cosine_loss_exponent_tilt",
5050
"rotor_diameter",
5151
"TSR",
5252
"ref_air_density",
@@ -55,8 +55,11 @@
5555

5656
turbine_properties = {k:v for k,v in v3_turbine_dict.items() if k in valid_properties}
5757
turbine_properties["ref_air_density"] = v3_turbine_dict["ref_density_cp_ct"]
58+
turbine_properties["cosine_loss_exponent_yaw"] = v3_turbine_dict["pP"]
5859
if "ref_tilt_cp_ct" in v3_turbine_dict:
5960
turbine_properties["ref_tilt"] = v3_turbine_dict["ref_tilt_cp_ct"]
61+
if "pT" in v3_turbine_dict:
62+
turbine_properties["cosine_loss_exponent_tilt"] = v3_turbine_dict["pT"]
6063

6164
# Convert to v4 and print new yaml
6265
v4_turbine_dict = build_cosine_loss_turbine_dict(

floris/turbine_library/iea_10MW.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22
# https://github.com/NREL/turbine-models/blob/master/Offshore/IEA_10MW_198_RWT.csv
33
# Note: Generator efficiency of 94% used. Small power variations above rated removed.
44
turbine_type: 'iea_10MW'
5-
generator_efficiency: 0.94
65
hub_height: 119.0
76
rotor_diameter: 198.0
87
TSR: 8.0
98
power_thrust_model: cosine-loss
109
power_thrust_table:
1110
ref_air_density: 1.225
1211
ref_tilt: 6.0
13-
pP: 1.88
14-
pT: 1.88
12+
cosine_loss_exponent_yaw: 1.88
13+
cosine_loss_exponent_tilt: 1.88
1514
power:
1615
- 0.0
1716
- 0.0

floris/turbine_library/iea_15MW.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
# https://github.com/IEAWindTask37/IEA-15-240-RWT/blob/master/Documentation/
33
# IEA-15-240-RWT_tabular.xlsx
44
# Note: Small power variations above rated removed.
5+
# Generator efficiency of 100% used.
56
turbine_type: 'iea_15MW'
6-
generator_efficiency: 1.0
77
hub_height: 150.0
88
rotor_diameter: 242.24
99
TSR: 8.0
1010
power_thrust_model: cosine-loss
1111
power_thrust_table:
1212
ref_air_density: 1.225
1313
ref_tilt: 6.0
14-
pP: 1.88
15-
pT: 1.88
14+
cosine_loss_exponent_yaw: 1.88
15+
cosine_loss_exponent_tilt: 1.88
1616
power:
1717
- 0.000000
1818
- 0.000000

floris/turbine_library/iea_15MW_floating_multi_dim_cp_ct.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
turbine_type: 'iea_15MW_floating'
2-
generator_efficiency: 1.0
32
hub_height: 150.0
43
rotor_diameter: 242.24
54
TSR: 8.0
65
multi_dimensional_cp_ct: True
76
power_thrust_table:
87
ref_air_density: 1.225
98
ref_tilt: 6.0
10-
pP: 1.88
11-
pT: 1.88
9+
cosine_loss_exponent_yaw: 1.88
10+
cosine_loss_exponent_tilt: 1.88
1211
power_thrust_data_file: 'iea_15MW_multi_dim_Tp_Hs.csv'
1312
floating_tilt_table:
1413
tilt:
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
turbine_type: 'iea_15MW_multi_dim_cp_ct'
2-
generator_efficiency: 1.0
32
hub_height: 150.0
43
rotor_diameter: 242.24
54
TSR: 8.0
65
multi_dimensional_cp_ct: True
76
power_thrust_table:
87
ref_air_density: 1.225
98
ref_tilt: 6.0
10-
pP: 1.88
11-
pT: 1.88
9+
cosine_loss_exponent_yaw: 1.88
10+
cosine_loss_exponent_tilt: 1.88
1211
power_thrust_data_file: 'iea_15MW_multi_dim_Tp_Hs.csv'

floris/turbine_library/nrel_5MW.yaml

+3-6
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@
22
# Data based on:
33
# https://github.com/NREL/turbine-models/blob/master/Offshore/NREL_5MW_126_RWT_corrected.csv
44
# Note: Small power variations above rated removed. Rotor diameter includes coning angle.
5+
# Note: generator efficiency of 94.4% is assumed for the NREL 5MW turbine.
56

67
###
78
# An ID for this type of turbine definition.
89
# This is not currently used, but it will be enabled in the future. This should typically
910
# match the root name of the file.
1011
turbine_type: 'nrel_5MW'
1112

12-
###
13-
# Setting for generator losses to power.
14-
generator_efficiency: 0.944
15-
1613
###
1714
# Hub height.
1815
hub_height: 90.0
@@ -39,9 +36,9 @@ power_thrust_table:
3936
# the effects of a floating platform on a turbine's power and wake.
4037
ref_tilt: 5.0
4138
# Cosine exponent for power loss due to tilt.
42-
pT: 1.88
39+
cosine_loss_exponent_tilt: 1.88
4340
# Cosine exponent for power loss due to yaw misalignment.
44-
pP: 1.88
41+
cosine_loss_exponent_yaw: 1.88
4542
### Power thrust table data
4643
wind_speed:
4744
- 0.0

0 commit comments

Comments
 (0)