foxes 0.7.0.6__py3-none-any.whl → 0.7.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of foxes might be problematic. Click here for more details.
- foxes/VERSION +1 -1
- foxes/algorithms/downwind/downwind.py +4 -4
- foxes/core/wake_frame.py +4 -4
- foxes/models/model_book.py +328 -222
- foxes/models/wake_models/wind/bastankhah14.py +1 -1
- foxes/models/wake_models/wind/turbopark.py +67 -17
- foxes/models/wake_superpositions/__init__.py +4 -4
- foxes/models/wake_superpositions/ws_linear.py +156 -0
- foxes/models/wake_superpositions/ws_max.py +158 -0
- foxes/models/wake_superpositions/ws_pow.py +161 -0
- foxes/models/wake_superpositions/ws_quadratic.py +155 -0
- foxes/utils/__init__.py +1 -0
- foxes/utils/factory.py +333 -0
- {foxes-0.7.0.6.dist-info → foxes-0.7.1.dist-info}/METADATA +1 -1
- {foxes-0.7.0.6.dist-info → foxes-0.7.1.dist-info}/RECORD +19 -18
- {foxes-0.7.0.6.dist-info → foxes-0.7.1.dist-info}/LICENSE +0 -0
- {foxes-0.7.0.6.dist-info → foxes-0.7.1.dist-info}/WHEEL +0 -0
- {foxes-0.7.0.6.dist-info → foxes-0.7.1.dist-info}/top_level.txt +0 -0
- {foxes-0.7.0.6.dist-info → foxes-0.7.1.dist-info}/zip-safe +0 -0
foxes/models/model_book.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
from math import sqrt
|
|
1
2
|
import foxes.models as fm
|
|
2
3
|
import foxes.variables as FV
|
|
3
|
-
from foxes.utils import Dict
|
|
4
|
+
from foxes.utils import Dict, FDict
|
|
4
5
|
|
|
5
6
|
from foxes.core import (
|
|
6
7
|
PointDataModel,
|
|
@@ -79,17 +80,46 @@ class ModelBook:
|
|
|
79
80
|
self.point_models = Dict(name="point_models")
|
|
80
81
|
self.point_models["tke2ti"] = fm.point_models.TKE2TI()
|
|
81
82
|
|
|
82
|
-
self.rotor_models =
|
|
83
|
+
self.rotor_models = FDict(name="rotor_models")
|
|
83
84
|
rvars = [FV.REWS, FV.REWS2, FV.REWS3, FV.TI, FV.RHO]
|
|
84
85
|
self.rotor_models["centre"] = fm.rotor_models.CentreRotor(calc_vars=rvars)
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
86
|
+
|
|
87
|
+
def _n2n(n2):
|
|
88
|
+
n2 = float(n2)
|
|
89
|
+
n = int(sqrt(n2))
|
|
90
|
+
if n**2 != n2:
|
|
91
|
+
raise Exception(f"GridRotor factory: Value {n2} is not the square of an integer")
|
|
92
|
+
return n
|
|
93
|
+
self.rotor_models.add_factory(
|
|
94
|
+
fm.rotor_models.GridRotor,
|
|
95
|
+
"grid<n2>",
|
|
96
|
+
kwargs=dict(calc_vars=rvars, reduce=True),
|
|
97
|
+
var2arg={"n2": "n"},
|
|
98
|
+
n2=_n2n,
|
|
99
|
+
hints={"n2": "(Number of points in square grid)"},
|
|
100
|
+
)
|
|
101
|
+
self.rotor_models.add_factory(
|
|
102
|
+
fm.rotor_models.GridRotor,
|
|
103
|
+
"raw_grid<n2>",
|
|
104
|
+
kwargs=dict(calc_vars=rvars, reduce=False),
|
|
105
|
+
var2arg={"n2": "n"},
|
|
106
|
+
n2=_n2n,
|
|
107
|
+
hints={"n2": "(Number of points in square grid)"},
|
|
108
|
+
)
|
|
109
|
+
self.rotor_models.add_factory(
|
|
110
|
+
fm.rotor_models.LevelRotor,
|
|
111
|
+
"level<n>",
|
|
112
|
+
kwargs=dict(calc_vars=rvars, reduce=True),
|
|
113
|
+
n=lambda x: int(x),
|
|
114
|
+
hints={"n": "(Number of vertical levels)"},
|
|
115
|
+
)
|
|
116
|
+
self.rotor_models.add_factory(
|
|
117
|
+
fm.rotor_models.LevelRotor,
|
|
118
|
+
"raw_level<n>",
|
|
119
|
+
kwargs=dict(calc_vars=rvars, reduce=False),
|
|
120
|
+
n=lambda x: int(x),
|
|
121
|
+
hints={"n": "(Number of vertical levels)"},
|
|
122
|
+
)
|
|
93
123
|
|
|
94
124
|
self.turbine_types = Dict(name="turbine_types")
|
|
95
125
|
self.turbine_types["null_type"] = fm.turbine_types.NullType()
|
|
@@ -108,21 +138,46 @@ class ModelBook:
|
|
|
108
138
|
if Pct_file is not None:
|
|
109
139
|
self.turbine_types["Pct"] = fm.turbine_types.PCtFile(Pct_file)
|
|
110
140
|
|
|
111
|
-
self.turbine_models =
|
|
141
|
+
self.turbine_models = FDict(
|
|
112
142
|
name="turbine_models",
|
|
113
143
|
kTI=fm.turbine_models.kTI(),
|
|
114
|
-
kTI_02=fm.turbine_models.kTI(kTI=0.2),
|
|
115
|
-
kTI_04=fm.turbine_models.kTI(kTI=0.4),
|
|
116
|
-
kTI_05=fm.turbine_models.kTI(kTI=0.5),
|
|
117
144
|
kTI_amb=fm.turbine_models.kTI(ti_var=FV.AMB_TI),
|
|
118
|
-
kTI_amb_02=fm.turbine_models.kTI(ti_var=FV.AMB_TI, kTI=0.2),
|
|
119
|
-
kTI_amb_04=fm.turbine_models.kTI(ti_var=FV.AMB_TI, kTI=0.4),
|
|
120
|
-
kTI_amb_05=fm.turbine_models.kTI(ti_var=FV.AMB_TI, kTI=0.5),
|
|
121
145
|
thrust2ct=fm.turbine_models.Thrust2Ct(),
|
|
122
146
|
PMask=fm.turbine_models.PowerMask(),
|
|
123
147
|
yaw2yawm=fm.turbine_models.YAW2YAWM(),
|
|
124
148
|
yawm2yaw=fm.turbine_models.YAWM2YAW(),
|
|
125
149
|
)
|
|
150
|
+
self.turbine_models.add_factory(
|
|
151
|
+
fm.turbine_models.kTI,
|
|
152
|
+
"kTI_<kTI>",
|
|
153
|
+
kTI=lambda x: float(f"0.{x[1:]}" if x[0] == "0" else float(x)),
|
|
154
|
+
hints={"kTI": "(Value, e.g. 004 for 0.04)"},
|
|
155
|
+
)
|
|
156
|
+
self.turbine_models.add_factory(
|
|
157
|
+
fm.turbine_models.kTI,
|
|
158
|
+
"kTI_amb_<kTI>",
|
|
159
|
+
kwargs=dict(ti_var=FV.AMB_TI),
|
|
160
|
+
kTI=lambda x: float(f"0.{x[1:]}" if x[0] == "0" else float(x)),
|
|
161
|
+
hints={"kTI": "(Value, e.g. 004 for 0.04)"},
|
|
162
|
+
)
|
|
163
|
+
self.turbine_models.add_factory(
|
|
164
|
+
fm.turbine_models.kTI,
|
|
165
|
+
"kTI_<kTI>_<kb>",
|
|
166
|
+
kTI=lambda x: float(f"0.{x[1:]}" if x[0] == "0" else float(x)),
|
|
167
|
+
kb=lambda x: float(f"0.{x[1:]}" if x[0] == "0" else float(x)),
|
|
168
|
+
hints={"kTI": "(Value, e.g. 004 for 0.04)",
|
|
169
|
+
"kb": "(Value, e.g. 004 for 0.04)"},
|
|
170
|
+
)
|
|
171
|
+
self.turbine_models.add_factory(
|
|
172
|
+
fm.turbine_models.kTI,
|
|
173
|
+
"kTI_amb_<kTI>_<kb>",
|
|
174
|
+
kwargs=dict(ti_var=FV.AMB_TI),
|
|
175
|
+
kTI=lambda x: float(f"0.{x[1:]}" if x[0] == "0" else float(x)),
|
|
176
|
+
kb=lambda x: float(f"0.{x[1:]}" if x[0] == "0" else float(x)),
|
|
177
|
+
hints={"kTI": "(Value, e.g. 004 for 0.04)",
|
|
178
|
+
"kb": "(Value, e.g. 004 for 0.04)"},
|
|
179
|
+
)
|
|
180
|
+
|
|
126
181
|
self.turbine_models["hubh_data"] = fm.turbine_models.RotorCentreCalc(
|
|
127
182
|
{
|
|
128
183
|
f"{FV.WD}_HH": FV.WD,
|
|
@@ -145,58 +200,71 @@ class ModelBook:
|
|
|
145
200
|
basic_ctrl=fm.farm_controllers.BasicFarmController(),
|
|
146
201
|
)
|
|
147
202
|
|
|
148
|
-
self.partial_wakes =
|
|
203
|
+
self.partial_wakes = FDict(
|
|
149
204
|
name="partial_wakes",
|
|
150
205
|
rotor_points=fm.partial_wakes.RotorPoints(),
|
|
151
206
|
top_hat=fm.partial_wakes.PartialTopHat(),
|
|
152
207
|
centre=fm.partial_wakes.PartialCentre(),
|
|
153
208
|
)
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
209
|
+
self.partial_wakes.add_factory(
|
|
210
|
+
fm.partial_wakes.PartialAxiwake,
|
|
211
|
+
"axiwake<n>",
|
|
212
|
+
n=lambda x: int(x),
|
|
213
|
+
hints={"n": "(Number of evaluation points)"},
|
|
214
|
+
)
|
|
215
|
+
self.partial_wakes.add_factory(
|
|
216
|
+
fm.partial_wakes.PartialGrid,
|
|
217
|
+
"grid<n2>",
|
|
218
|
+
var2arg={"n2": "n"},
|
|
219
|
+
n2=_n2n,
|
|
220
|
+
hints={"n2": "(Number of points in square grid)"},
|
|
221
|
+
)
|
|
159
222
|
|
|
160
|
-
self.wake_frames =
|
|
223
|
+
self.wake_frames = FDict(
|
|
161
224
|
name="wake_frames",
|
|
162
225
|
rotor_wd=fm.wake_frames.RotorWD(var_wd=FV.WD),
|
|
163
226
|
rotor_wd_farmo=fm.wake_frames.FarmOrder(),
|
|
164
227
|
yawed=fm.wake_frames.YawedWakes(),
|
|
165
|
-
yawed_k002=fm.wake_frames.YawedWakes(k=0.02),
|
|
166
|
-
yawed_k004=fm.wake_frames.YawedWakes(k=0.04),
|
|
167
228
|
)
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
)
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
("30min", 30),
|
|
188
|
-
]
|
|
229
|
+
self.wake_frames.add_factory(
|
|
230
|
+
fm.wake_frames.YawedWakes,
|
|
231
|
+
"yawed_k<k>",
|
|
232
|
+
k=lambda x: float(f"0.{x[1:]}" if x[0] == "0" else float(x)),
|
|
233
|
+
hints={"k": "(Value, e.g. 004 for 0.04)"},
|
|
234
|
+
)
|
|
235
|
+
self.wake_frames.add_factory(
|
|
236
|
+
fm.wake_frames.Streamlines2D,
|
|
237
|
+
"streamlines_<step>",
|
|
238
|
+
step=lambda x: float(x),
|
|
239
|
+
hints={"step": "(Step size in m)"},
|
|
240
|
+
)
|
|
241
|
+
self.wake_frames.add_factory(
|
|
242
|
+
fm.wake_frames.Streamlines2D,
|
|
243
|
+
"streamlines_<step>",
|
|
244
|
+
step=lambda x: float(x),
|
|
245
|
+
hints={"step": "(Step size in m)"},
|
|
246
|
+
)
|
|
247
|
+
|
|
189
248
|
self.wake_frames["timelines"] = fm.wake_frames.Timelines()
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
self.wake_frames
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
249
|
+
def _todt(x):
|
|
250
|
+
if x[-1] == "s":
|
|
251
|
+
return float(x[:-1])/60
|
|
252
|
+
elif x[-3:] == "min":
|
|
253
|
+
return float(x[:-3])
|
|
254
|
+
self.wake_frames.add_factory(
|
|
255
|
+
fm.wake_frames.Timelines,
|
|
256
|
+
"timelines_<dt>",
|
|
257
|
+
dt=_todt,
|
|
258
|
+
var2arg={"dt": "dt_min"},
|
|
259
|
+
hints={"dt": "(Time step, e.g '10s', '1min' etc.)"},
|
|
260
|
+
)
|
|
261
|
+
self.wake_frames.add_factory(
|
|
262
|
+
fm.wake_frames.SeqDynamicWakes,
|
|
263
|
+
"seq_dyn_wakes_<dt>",
|
|
264
|
+
dt=_todt,
|
|
265
|
+
var2arg={"dt": "dt_min"},
|
|
266
|
+
hints={"dt": "(Time step, e.g '10s', '1min' etc.)"},
|
|
267
|
+
)
|
|
200
268
|
|
|
201
269
|
self.wake_superpositions = Dict(
|
|
202
270
|
name="wake_superpositions",
|
|
@@ -208,6 +276,8 @@ class ModelBook:
|
|
|
208
276
|
ws_linear_amb_lim=fm.wake_superpositions.WSLinear(
|
|
209
277
|
scale_amb=True, lim_low=1e-4
|
|
210
278
|
),
|
|
279
|
+
ws_linear_loc=fm.wake_superpositions.WSLinearLocal(),
|
|
280
|
+
ws_linear_loc_lim=fm.wake_superpositions.WSLinearLocal(lim_low=1e-4),
|
|
211
281
|
ws_quadratic=fm.wake_superpositions.WSQuadratic(scale_amb=False),
|
|
212
282
|
ws_quadratic_lim=fm.wake_superpositions.WSQuadratic(
|
|
213
283
|
scale_amb=False, lim_low=1e-4
|
|
@@ -216,12 +286,20 @@ class ModelBook:
|
|
|
216
286
|
ws_quadratic_amb_lim=fm.wake_superpositions.WSQuadratic(
|
|
217
287
|
scale_amb=True, lim_low=1e-4
|
|
218
288
|
),
|
|
289
|
+
ws_quadratic_loc=fm.wake_superpositions.WSQuadraticLocal(),
|
|
290
|
+
ws_quadratic_loc_lim=fm.wake_superpositions.WSQuadraticLocal(lim_low=1e-4),
|
|
219
291
|
ws_cubic=fm.wake_superpositions.WSPow(pow=3, scale_amb=False),
|
|
220
292
|
ws_cubic_amb=fm.wake_superpositions.WSPow(pow=3, scale_amb=True),
|
|
293
|
+
ws_cubic_loc=fm.wake_superpositions.WSPowLocal(pow=3),
|
|
294
|
+
ws_cubic_loc_lim=fm.wake_superpositions.WSPowLocal(pow=3, lim_low=1e-4),
|
|
221
295
|
ws_quartic=fm.wake_superpositions.WSPow(pow=4, scale_amb=False),
|
|
222
296
|
ws_quartic_amb=fm.wake_superpositions.WSPow(pow=4, scale_amb=True),
|
|
297
|
+
ws_quartic_loc=fm.wake_superpositions.WSPowLocal(pow=4),
|
|
298
|
+
ws_quartic_loc_lim=fm.wake_superpositions.WSPowLocal(pow=4, lim_low=1e-4),
|
|
223
299
|
ws_max=fm.wake_superpositions.WSMax(scale_amb=False),
|
|
224
300
|
ws_max_amb=fm.wake_superpositions.WSMax(scale_amb=True),
|
|
301
|
+
ws_max_loc=fm.wake_superpositions.WSMaxLocal(),
|
|
302
|
+
ws_max_loc_lim=fm.wake_superpositions.WSMaxLocal(lim_low=1e-4),
|
|
225
303
|
ws_product=fm.wake_superpositions.WSProduct(),
|
|
226
304
|
ws_product_lim=fm.wake_superpositions.WSProduct(lim_low=1e-4),
|
|
227
305
|
ti_linear=fm.wake_superpositions.TILinear(superp_to_amb="quadratic"),
|
|
@@ -237,181 +315,203 @@ class ModelBook:
|
|
|
237
315
|
fm.axial_induction_models.MadsenAxialInduction()
|
|
238
316
|
)
|
|
239
317
|
|
|
240
|
-
self.wake_models =
|
|
241
|
-
slist = [
|
|
242
|
-
"linear",
|
|
243
|
-
"linear_lim",
|
|
244
|
-
"linear_amb",
|
|
245
|
-
"linear_amb_lim",
|
|
246
|
-
"quadratic",
|
|
247
|
-
"quadratic_lim",
|
|
248
|
-
"quadratic_amb",
|
|
249
|
-
"quadratic_amb_lim",
|
|
250
|
-
"cubic",
|
|
251
|
-
"cubic_amb",
|
|
252
|
-
"quartic",
|
|
253
|
-
"quartic_amb",
|
|
254
|
-
"wmax",
|
|
255
|
-
"max_amb",
|
|
256
|
-
"product",
|
|
257
|
-
"product_lim",
|
|
258
|
-
]
|
|
259
|
-
for s in slist:
|
|
260
|
-
self.wake_models[f"Jensen_{s}"] = fm.wake_models.wind.JensenWake(
|
|
261
|
-
superposition=f"ws_{s}"
|
|
262
|
-
)
|
|
263
|
-
self.wake_models[f"Jensen_{s}_k002"] = fm.wake_models.wind.JensenWake(
|
|
264
|
-
k=0.02, superposition=f"ws_{s}"
|
|
265
|
-
)
|
|
266
|
-
self.wake_models[f"Jensen_{s}_k004"] = fm.wake_models.wind.JensenWake(
|
|
267
|
-
k=0.04, superposition=f"ws_{s}"
|
|
268
|
-
)
|
|
269
|
-
self.wake_models[f"Jensen_{s}_k007"] = fm.wake_models.wind.JensenWake(
|
|
270
|
-
k=0.07, superposition=f"ws_{s}"
|
|
271
|
-
)
|
|
272
|
-
self.wake_models[f"Jensen_{s}_k0075"] = fm.wake_models.wind.JensenWake(
|
|
273
|
-
k=0.075, superposition=f"ws_{s}"
|
|
274
|
-
)
|
|
275
|
-
|
|
276
|
-
self.wake_models[f"Bastankhah2014_{s}"] = (
|
|
277
|
-
fm.wake_models.wind.Bastankhah2014(
|
|
278
|
-
superposition=f"ws_{s}", sbeta_factor=0.2
|
|
279
|
-
)
|
|
280
|
-
)
|
|
281
|
-
self.wake_models[f"Bastankhah2014_{s}_k002"] = (
|
|
282
|
-
fm.wake_models.wind.Bastankhah2014(
|
|
283
|
-
k=0.02, sbeta_factor=0.2, superposition=f"ws_{s}"
|
|
284
|
-
)
|
|
285
|
-
)
|
|
286
|
-
self.wake_models[f"Bastankhah2014_{s}_k004"] = (
|
|
287
|
-
fm.wake_models.wind.Bastankhah2014(
|
|
288
|
-
k=0.04, sbeta_factor=0.2, superposition=f"ws_{s}"
|
|
289
|
-
)
|
|
290
|
-
)
|
|
318
|
+
self.wake_models = FDict(name="wake_models")
|
|
291
319
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
)
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
)
|
|
320
|
+
self.wake_models.add_factory(
|
|
321
|
+
fm.wake_models.wind.JensenWake,
|
|
322
|
+
"Jensen_<superposition>",
|
|
323
|
+
superposition=lambda s: f"ws_{s}",
|
|
324
|
+
hints={"superposition": "(Superposition, e.g. linear for ws_linear)"},
|
|
325
|
+
)
|
|
326
|
+
self.wake_models.add_factory(
|
|
327
|
+
fm.wake_models.wind.JensenWake,
|
|
328
|
+
"Jensen_<superposition>_k<k>",
|
|
329
|
+
superposition=lambda s: f"ws_{s}",
|
|
330
|
+
k=lambda x: float(f"0.{x[1:]}" if x[0] == "0" else float(x)),
|
|
331
|
+
hints={"superposition": "(Superposition, e.g. linear for ws_linear)",
|
|
332
|
+
"k": "(Value, e.g. 004 for 0.04)"},
|
|
333
|
+
)
|
|
307
334
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
)
|
|
335
|
+
self.wake_models.add_factory(
|
|
336
|
+
fm.wake_models.wind.Bastankhah2014,
|
|
337
|
+
"Bastankhah2014_<superposition>",
|
|
338
|
+
kwargs=dict(sbeta_factor=0.2),
|
|
339
|
+
superposition=lambda s: f"ws_{s}",
|
|
340
|
+
hints={"superposition": "(Superposition, e.g. linear for ws_linear)"},
|
|
341
|
+
)
|
|
342
|
+
self.wake_models.add_factory(
|
|
343
|
+
fm.wake_models.wind.Bastankhah2014,
|
|
344
|
+
"Bastankhah2014_<superposition>_k<k>",
|
|
345
|
+
kwargs=dict(sbeta_factor=0.2),
|
|
346
|
+
superposition=lambda s: f"ws_{s}",
|
|
347
|
+
k=lambda x: float(f"0.{x[1:]}" if x[0] == "0" else float(x)),
|
|
348
|
+
hints={"superposition": "(Superposition, e.g. linear for ws_linear)",
|
|
349
|
+
"k": "(Value, e.g. 004 for 0.04)"},
|
|
350
|
+
)
|
|
351
|
+
self.wake_models.add_factory(
|
|
352
|
+
fm.wake_models.wind.Bastankhah2014,
|
|
353
|
+
"Bastankhah2014B_<superposition>",
|
|
354
|
+
kwargs=dict(sbeta_factor=0.2, induction="Betz"),
|
|
355
|
+
superposition=lambda s: f"ws_{s}",
|
|
356
|
+
hints={"superposition": "(Superposition, e.g. linear for ws_linear)"},
|
|
357
|
+
)
|
|
358
|
+
self.wake_models.add_factory(
|
|
359
|
+
fm.wake_models.wind.Bastankhah2014,
|
|
360
|
+
"Bastankhah2014B_<superposition>_k<k>",
|
|
361
|
+
kwargs=dict(sbeta_factor=0.2, induction="Betz"),
|
|
362
|
+
superposition=lambda s: f"ws_{s}",
|
|
363
|
+
k=lambda x: float(f"0.{x[1:]}" if x[0] == "0" else float(x)),
|
|
364
|
+
hints={"superposition": "(Superposition, e.g. linear for ws_linear)",
|
|
365
|
+
"k": "(Value, e.g. 004 for 0.04)"},
|
|
366
|
+
)
|
|
367
|
+
self.wake_models.add_factory(
|
|
368
|
+
fm.wake_models.wind.Bastankhah2014,
|
|
369
|
+
"Bastankhah025_<superposition>",
|
|
370
|
+
kwargs=dict(sbeta_factor=0.25),
|
|
371
|
+
superposition=lambda s: f"ws_{s}",
|
|
372
|
+
hints={"superposition": "(Superposition, e.g. linear for ws_linear)"},
|
|
373
|
+
)
|
|
374
|
+
self.wake_models.add_factory(
|
|
375
|
+
fm.wake_models.wind.Bastankhah2014,
|
|
376
|
+
"Bastankhah025_<superposition>_k<k>",
|
|
377
|
+
kwargs=dict(sbeta_factor=0.25),
|
|
378
|
+
superposition=lambda s: f"ws_{s}",
|
|
379
|
+
k=lambda x: float(f"0.{x[1:]}" if x[0] == "0" else float(x)),
|
|
380
|
+
hints={"superposition": "(Superposition, e.g. linear for ws_linear)",
|
|
381
|
+
"k": "(Value, e.g. 004 for 0.04)"},
|
|
382
|
+
)
|
|
383
|
+
self.wake_models.add_factory(
|
|
384
|
+
fm.wake_models.wind.Bastankhah2014,
|
|
385
|
+
"Bastankhah025B_<superposition>",
|
|
386
|
+
kwargs=dict(sbeta_factor=0.25, induction="Betz"),
|
|
387
|
+
superposition=lambda s: f"ws_{s}",
|
|
388
|
+
hints={"superposition": "(Superposition, e.g. linear for ws_linear)"},
|
|
389
|
+
)
|
|
390
|
+
self.wake_models.add_factory(
|
|
391
|
+
fm.wake_models.wind.Bastankhah2014,
|
|
392
|
+
"Bastankhah025B_<superposition>_k<k>",
|
|
393
|
+
kwargs=dict(sbeta_factor=0.25, induction="Betz"),
|
|
394
|
+
superposition=lambda s: f"ws_{s}",
|
|
395
|
+
k=lambda x: float(f"0.{x[1:]}" if x[0] == "0" else float(x)),
|
|
396
|
+
hints={"superposition": "(Superposition, e.g. linear for ws_linear)",
|
|
397
|
+
"k": "(Value, e.g. 004 for 0.04)"},
|
|
398
|
+
)
|
|
321
399
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
)
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
400
|
+
self.wake_models.add_factory(
|
|
401
|
+
fm.wake_models.wind.Bastankhah2016,
|
|
402
|
+
"Bastankhah2016_<superposition>",
|
|
403
|
+
superposition=lambda s: f"ws_{s}",
|
|
404
|
+
hints={"superposition": "(Superposition, e.g. linear for ws_linear)"},
|
|
405
|
+
)
|
|
406
|
+
self.wake_models.add_factory(
|
|
407
|
+
fm.wake_models.wind.Bastankhah2016,
|
|
408
|
+
"Bastankhah2016_<superposition>_k<k>",
|
|
409
|
+
superposition=lambda s: f"ws_{s}",
|
|
410
|
+
k=lambda x: float(f"0.{x[1:]}" if x[0] == "0" else float(x)),
|
|
411
|
+
hints={"superposition": "(Superposition, e.g. linear for ws_linear)",
|
|
412
|
+
"k": "(Value, e.g. 004 for 0.04)"},
|
|
413
|
+
)
|
|
414
|
+
self.wake_models.add_factory(
|
|
415
|
+
fm.wake_models.wind.Bastankhah2016,
|
|
416
|
+
"Bastankhah2016B_<superposition>",
|
|
417
|
+
kwargs=dict(induction="Betz"),
|
|
418
|
+
superposition=lambda s: f"ws_{s}",
|
|
419
|
+
hints={"superposition": "(Superposition, e.g. linear for ws_linear)"},
|
|
420
|
+
)
|
|
421
|
+
self.wake_models.add_factory(
|
|
422
|
+
fm.wake_models.wind.Bastankhah2016,
|
|
423
|
+
"Bastankhah2016B_<superposition>_k<k>",
|
|
424
|
+
kwargs=dict(induction="Betz"),
|
|
425
|
+
superposition=lambda s: f"ws_{s}",
|
|
426
|
+
k=lambda x: float(f"0.{x[1:]}" if x[0] == "0" else float(x)),
|
|
427
|
+
hints={"superposition": "(Superposition, e.g. linear for ws_linear)",
|
|
428
|
+
"k": "(Value, e.g. 004 for 0.04)"},
|
|
429
|
+
)
|
|
337
430
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
431
|
+
self.wake_models.add_factory(
|
|
432
|
+
fm.wake_models.wind.TurbOParkWake,
|
|
433
|
+
"TurbOPark_<superposition>",
|
|
434
|
+
superposition=lambda s: f"ws_{s}",
|
|
435
|
+
hints={"superposition": "(Superposition, e.g. linear for ws_linear)"},
|
|
436
|
+
)
|
|
437
|
+
self.wake_models.add_factory(
|
|
438
|
+
fm.wake_models.wind.TurbOParkWake,
|
|
439
|
+
"TurbOPark_<superposition>_k<k>",
|
|
440
|
+
superposition=lambda s: f"ws_{s}",
|
|
441
|
+
k=lambda x: float(f"0.{x[1:]}" if x[0] == "0" else float(x)),
|
|
442
|
+
hints={"superposition": "(Superposition, e.g. linear for ws_linear)",
|
|
443
|
+
"k": "(Value, e.g. 004 for 0.04)"},
|
|
444
|
+
)
|
|
445
|
+
self.wake_models.add_factory(
|
|
446
|
+
fm.wake_models.wind.TurbOParkWake,
|
|
447
|
+
"TurbOParkB_<superposition>",
|
|
448
|
+
kwargs=dict(induction="Betz"),
|
|
449
|
+
superposition=lambda s: f"ws_{s}",
|
|
450
|
+
hints={"superposition": "(Superposition, e.g. linear for ws_linear)"},
|
|
451
|
+
)
|
|
452
|
+
self.wake_models.add_factory(
|
|
453
|
+
fm.wake_models.wind.TurbOParkWake,
|
|
454
|
+
"TurbOParkB_<superposition>_k<k>",
|
|
455
|
+
kwargs=dict(induction="Betz"),
|
|
456
|
+
superposition=lambda s: f"ws_{s}",
|
|
457
|
+
k=lambda x: float(f"0.{x[1:]}" if x[0] == "0" else float(x)),
|
|
458
|
+
hints={"superposition": "(Superposition, e.g. linear for ws_linear)",
|
|
459
|
+
"k": "(Value, e.g. 004 for 0.04)"},
|
|
460
|
+
)
|
|
347
461
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
)
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
)
|
|
357
|
-
)
|
|
358
|
-
self.wake_models[f"Bastankhah2016B_{s}_k004"] = (
|
|
359
|
-
fm.wake_models.wind.Bastankhah2016(
|
|
360
|
-
superposition=f"ws_{s}", k=0.04, induction="Betz"
|
|
361
|
-
)
|
|
362
|
-
)
|
|
462
|
+
self.wake_models.add_factory(
|
|
463
|
+
fm.wake_models.wind.TurbOParkWakeIX,
|
|
464
|
+
"TurbOParkIX_<superposition>_dx<dx>",
|
|
465
|
+
superposition=lambda s: f"ws_{s}",
|
|
466
|
+
dx=lambda x: float(x),
|
|
467
|
+
hints={"superposition": "(Superposition, e.g. linear for ws_linear)",
|
|
468
|
+
"dx": "(Integration step in m)"},
|
|
469
|
+
)
|
|
363
470
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
)
|
|
471
|
+
self.wake_models.add_factory(
|
|
472
|
+
fm.wake_models.wind.TurbOParkWakeIX,
|
|
473
|
+
"TurbOParkIX_<superposition>_k<k>_dx<dx>",
|
|
474
|
+
superposition=lambda s: f"ws_{s}",
|
|
475
|
+
k=lambda x: float(f"0.{x[1:]}" if x[0] == "0" else float(x)),
|
|
476
|
+
dx=lambda x: float(x),
|
|
477
|
+
hints={"superposition": "(Superposition, e.g. linear for ws_linear)",
|
|
478
|
+
"k": "(Value, e.g. 004 for 0.04)",
|
|
479
|
+
"dx": "(Integration step in m)"},
|
|
480
|
+
)
|
|
370
481
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
A=0.04, superposition=f"ws_{s}", induction="Betz"
|
|
379
|
-
)
|
|
380
|
-
)
|
|
482
|
+
self.wake_models.add_factory(
|
|
483
|
+
fm.wake_models.ti.CrespoHernandezTIWake,
|
|
484
|
+
"CrespoHernandez_<superposition>",
|
|
485
|
+
kwargs=dict(use_ambti=False),
|
|
486
|
+
superposition=lambda s: f"ti_{s}",
|
|
487
|
+
hints={"superposition": "(Superposition, e.g. linear for ti_linear)"},
|
|
488
|
+
)
|
|
381
489
|
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
)
|
|
392
|
-
)
|
|
393
|
-
|
|
394
|
-
slist = ["linear", "quadratic", "cubic", "quartic", "max"]
|
|
395
|
-
for s in slist:
|
|
396
|
-
self.wake_models[f"CrespoHernandez_{s}"] = (
|
|
397
|
-
fm.wake_models.ti.CrespoHernandezTIWake(superposition=f"ti_{s}")
|
|
398
|
-
)
|
|
399
|
-
self.wake_models[f"CrespoHernandez_ambti_{s}"] = (
|
|
400
|
-
fm.wake_models.ti.CrespoHernandezTIWake(
|
|
401
|
-
superposition=f"ti_{s}", use_ambti=True
|
|
402
|
-
)
|
|
403
|
-
)
|
|
404
|
-
self.wake_models[f"CrespoHernandez_{s}_k002"] = (
|
|
405
|
-
fm.wake_models.ti.CrespoHernandezTIWake(k=0.02, superposition=f"ti_{s}")
|
|
406
|
-
)
|
|
490
|
+
self.wake_models.add_factory(
|
|
491
|
+
fm.wake_models.ti.CrespoHernandezTIWake,
|
|
492
|
+
"CrespoHernandez_<superposition>_k<k>",
|
|
493
|
+
kwargs=dict(use_ambti=False),
|
|
494
|
+
superposition=lambda s: f"ti_{s}",
|
|
495
|
+
k=lambda x: float(f"0.{x[1:]}" if x[0] == "0" else float(x)),
|
|
496
|
+
hints={"superposition": "(Superposition, e.g. linear for ti_linear)",
|
|
497
|
+
"k": "(Value, e.g. 004 for 0.04)"},
|
|
498
|
+
)
|
|
407
499
|
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
500
|
+
self.wake_models.add_factory(
|
|
501
|
+
fm.wake_models.ti.IECTIWake,
|
|
502
|
+
"IECTI2005_<superposition>",
|
|
503
|
+
kwargs=dict(iec_type="2005"),
|
|
504
|
+
superposition=lambda s: f"ti_{s}",
|
|
505
|
+
hints={"superposition": "(Superposition, e.g. linear for ti_linear)"},
|
|
506
|
+
)
|
|
411
507
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
508
|
+
self.wake_models.add_factory(
|
|
509
|
+
fm.wake_models.ti.IECTIWake,
|
|
510
|
+
"IECTI2019_<superposition>",
|
|
511
|
+
kwargs=dict(iec_type="2019"),
|
|
512
|
+
superposition=lambda s: f"ti_{s}",
|
|
513
|
+
hints={"superposition": "(Superposition, e.g. linear for ti_linear)"},
|
|
514
|
+
)
|
|
415
515
|
|
|
416
516
|
self.wake_models[f"RHB"] = fm.wake_models.induction.RankineHalfBody()
|
|
417
517
|
self.wake_models[f"Rathmann"] = fm.wake_models.induction.Rathmann()
|
|
@@ -468,6 +568,7 @@ class ModelBook:
|
|
|
468
568
|
String that has to be part of the model name
|
|
469
569
|
|
|
470
570
|
"""
|
|
571
|
+
|
|
471
572
|
for k in sorted(list(self.sources.keys())):
|
|
472
573
|
ms = self.sources[k]
|
|
473
574
|
if subset is None or k in subset:
|
|
@@ -477,6 +578,11 @@ class ModelBook:
|
|
|
477
578
|
for mname in sorted(list(ms.keys())):
|
|
478
579
|
if search is None or search in mname:
|
|
479
580
|
print(f"{mname}: {ms[mname]}")
|
|
581
|
+
if isinstance(ms, FDict):
|
|
582
|
+
for f in ms.factories:
|
|
583
|
+
if search is None or search in f.name_template:
|
|
584
|
+
print()
|
|
585
|
+
print(f)
|
|
480
586
|
else:
|
|
481
587
|
print("(none)")
|
|
482
588
|
print()
|