@@ -62,26 +62,39 @@ class Farm(BaseClass):
62
62
)
63
63
64
64
turbine_definitions : list = field (init = False , validator = iter_validator (list , dict ))
65
+ coordinates : List [Vec3 ] = field (init = False )
66
+ turbine_fCts : tuple = field (init = False , default = [])
67
+ turbine_fTilts : list = field (init = False , default = [])
68
+
65
69
yaw_angles : NDArrayFloat = field (init = False )
66
70
yaw_angles_sorted : NDArrayFloat = field (init = False )
71
+
67
72
tilt_angles : NDArrayFloat = field (init = False )
68
73
tilt_angles_sorted : NDArrayFloat = field (init = False )
69
- coordinates : List [ Vec3 ] = field ( init = False )
74
+
70
75
hub_heights : NDArrayFloat = field (init = False )
71
76
hub_heights_sorted : NDArrayFloat = field (init = False , default = [])
72
- turbine_fCts : tuple = field (init = False , default = [])
77
+
78
+ turbine_type_map : NDArrayObject = field (init = False , default = [])
73
79
turbine_type_map_sorted : NDArrayObject = field (init = False , default = [])
80
+
81
+ rotor_diameters : NDArrayFloat = field (init = False , default = [])
74
82
rotor_diameters_sorted : NDArrayFloat = field (init = False , default = [])
83
+
84
+ TSRs : NDArrayFloat = field (init = False , default = [])
75
85
TSRs_sorted : NDArrayFloat = field (init = False , default = [])
86
+
76
87
pPs : NDArrayFloat = field (init = False , default = [])
77
88
pPs_sorted : NDArrayFloat = field (init = False , default = [])
89
+
78
90
pTs : NDArrayFloat = field (init = False , default = [])
79
91
pTs_sorted : NDArrayFloat = field (init = False , default = [])
92
+
80
93
ref_tilt_cp_cts : NDArrayFloat = field (init = False , default = [])
81
94
ref_tilt_cp_cts_sorted : NDArrayFloat = field (init = False , default = [])
95
+
82
96
correct_cp_ct_for_tilt : NDArrayFloat = field (init = False , default = [])
83
97
correct_cp_ct_for_tilt_sorted : NDArrayFloat = field (init = False , default = [])
84
- turbine_fTilts : list = field (init = False , default = [])
85
98
86
99
def __attrs_post_init__ (self ) -> None :
87
100
# Turbine definitions can be supplied in three ways:
@@ -301,15 +314,16 @@ def expand_farm_properties(
301
314
sorted_coord_indices ,
302
315
axis = 2
303
316
)
317
+
318
+ # NOTE: Tilt angles are sorted twice - here and in initialize()
304
319
self .tilt_angles_sorted = np .take_along_axis (
305
320
self .tilt_angles * template_shape ,
306
321
sorted_coord_indices ,
307
322
axis = 2
308
323
)
309
- self .turbine_type_names_sorted = [turb ["turbine_type" ] for turb in self .turbine_definitions ]
310
324
self .turbine_type_map_sorted = np .take_along_axis (
311
325
np .reshape (
312
- self .turbine_type_names_sorted * n_wind_directions ,
326
+ [ turb [ "turbine_type" ] for turb in self .turbine_definitions ] * n_wind_directions ,
313
327
np .shape (sorted_coord_indices )
314
328
),
315
329
sorted_coord_indices ,
@@ -366,6 +380,22 @@ def finalize(self, unsorted_indices):
366
380
unsorted_indices [:,:,:,0 ,0 ],
367
381
axis = 2
368
382
)
383
+ # TODO: do these need to be unsorted? Maybe we should just for completeness...
384
+ self .ref_density_cp_cts = np .take_along_axis (
385
+ self .ref_density_cp_cts_sorted ,
386
+ unsorted_indices [:,:,:,0 ,0 ],
387
+ axis = 2
388
+ )
389
+ self .ref_tilt_cp_cts = np .take_along_axis (
390
+ self .ref_tilt_cp_cts_sorted ,
391
+ unsorted_indices [:,:,:,0 ,0 ],
392
+ axis = 2
393
+ )
394
+ self .correct_cp_ct_for_tilt = np .take_along_axis (
395
+ self .correct_cp_ct_for_tilt_sorted ,
396
+ unsorted_indices [:,:,:,0 ,0 ],
397
+ axis = 2
398
+ )
369
399
self .pPs = np .take_along_axis (
370
400
self .pPs_sorted ,
371
401
unsorted_indices [:,:,:,0 ,0 ],
0 commit comments