foxes 0.6.1__py3-none-any.whl → 0.7__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 +131 -65
- foxes/algorithms/downwind/models/__init__.py +2 -1
- foxes/algorithms/downwind/models/farm_wakes_calc.py +87 -55
- foxes/algorithms/downwind/models/init_farm_data.py +134 -0
- foxes/algorithms/downwind/models/point_wakes_calc.py +54 -65
- foxes/algorithms/downwind/models/{calc_order.py → reorder_farm_output.py} +28 -26
- foxes/algorithms/iterative/iterative.py +100 -51
- foxes/algorithms/iterative/models/convergence.py +3 -3
- foxes/algorithms/iterative/models/farm_wakes_calc.py +55 -48
- foxes/algorithms/sequential/models/seq_state.py +7 -6
- foxes/algorithms/sequential/sequential.py +81 -44
- foxes/constants.py +33 -18
- foxes/core/__init__.py +2 -2
- foxes/core/algorithm.py +31 -12
- foxes/core/data.py +335 -41
- foxes/core/data_calc_model.py +27 -23
- foxes/core/farm_controller.py +27 -28
- foxes/core/farm_data_model.py +26 -4
- foxes/core/model.py +186 -129
- foxes/core/partial_wakes_model.py +84 -81
- foxes/core/point_data_model.py +51 -18
- foxes/core/rotor_model.py +59 -77
- foxes/core/states.py +6 -6
- foxes/core/turbine_model.py +4 -4
- foxes/core/turbine_type.py +24 -0
- foxes/core/vertical_profile.py +3 -3
- foxes/core/wake_frame.py +91 -50
- foxes/core/wake_model.py +74 -43
- foxes/core/wake_superposition.py +29 -26
- foxes/input/farm_layout/__init__.py +1 -0
- foxes/input/farm_layout/from_random.py +49 -0
- foxes/input/states/__init__.py +1 -1
- foxes/input/states/create/__init__.py +1 -0
- foxes/input/states/create/random_abl_states.py +6 -2
- foxes/input/states/create/random_timeseries.py +56 -0
- foxes/input/states/field_data_nc.py +12 -8
- foxes/input/states/multi_height.py +24 -14
- foxes/input/states/scan_ws.py +13 -17
- foxes/input/states/single.py +28 -20
- foxes/input/states/states_table.py +22 -18
- foxes/models/axial_induction_models/betz.py +1 -1
- foxes/models/farm_models/turbine2farm.py +2 -2
- foxes/models/model_book.py +40 -14
- foxes/models/partial_wakes/__init__.py +2 -2
- foxes/models/partial_wakes/axiwake.py +73 -200
- foxes/models/partial_wakes/centre.py +40 -0
- foxes/models/partial_wakes/grid.py +7 -63
- foxes/models/partial_wakes/rotor_points.py +53 -147
- foxes/models/partial_wakes/segregated.py +158 -0
- foxes/models/partial_wakes/top_hat.py +88 -196
- foxes/models/point_models/set_uniform_data.py +4 -4
- foxes/models/point_models/tke2ti.py +4 -4
- foxes/models/point_models/wake_deltas.py +4 -4
- foxes/models/rotor_models/centre.py +15 -19
- foxes/models/rotor_models/grid.py +2 -1
- foxes/models/rotor_models/levels.py +2 -1
- foxes/models/turbine_models/__init__.py +0 -1
- foxes/models/turbine_models/calculator.py +11 -7
- foxes/models/turbine_models/kTI_model.py +13 -11
- foxes/models/turbine_models/lookup_table.py +22 -9
- foxes/models/turbine_models/power_mask.py +81 -51
- foxes/models/turbine_models/rotor_centre_calc.py +17 -20
- foxes/models/turbine_models/sector_management.py +5 -6
- foxes/models/turbine_models/set_farm_vars.py +49 -20
- foxes/models/turbine_models/table_factors.py +5 -5
- foxes/models/turbine_models/thrust2ct.py +9 -5
- foxes/models/turbine_models/yaw2yawm.py +7 -13
- foxes/models/turbine_models/yawm2yaw.py +7 -11
- foxes/models/turbine_types/PCt_file.py +84 -3
- foxes/models/turbine_types/PCt_from_two.py +7 -3
- foxes/models/turbine_types/null_type.py +2 -2
- foxes/models/turbine_types/wsrho2PCt_from_two.py +2 -2
- foxes/models/turbine_types/wsti2PCt_from_two.py +6 -2
- foxes/models/wake_frames/farm_order.py +26 -22
- foxes/models/wake_frames/rotor_wd.py +32 -31
- foxes/models/wake_frames/seq_dynamic_wakes.py +112 -64
- foxes/models/wake_frames/streamlines.py +51 -47
- foxes/models/wake_frames/timelines.py +59 -47
- foxes/models/wake_frames/yawed_wakes.py +63 -40
- foxes/models/wake_models/axisymmetric.py +31 -35
- foxes/models/wake_models/dist_sliced.py +50 -56
- foxes/models/wake_models/gaussian.py +33 -35
- foxes/models/wake_models/induction/rankine_half_body.py +79 -87
- foxes/models/wake_models/induction/rathmann.py +56 -63
- foxes/models/wake_models/induction/self_similar.py +59 -62
- foxes/models/wake_models/ti/crespo_hernandez.py +83 -74
- foxes/models/wake_models/ti/iec_ti.py +65 -75
- foxes/models/wake_models/top_hat.py +60 -69
- foxes/models/wake_models/wake_mirror.py +49 -54
- foxes/models/wake_models/wind/bastankhah14.py +44 -66
- foxes/models/wake_models/wind/bastankhah16.py +84 -111
- foxes/models/wake_models/wind/jensen.py +67 -89
- foxes/models/wake_models/wind/turbopark.py +93 -133
- foxes/models/wake_superpositions/ti_linear.py +33 -27
- foxes/models/wake_superpositions/ti_max.py +33 -27
- foxes/models/wake_superpositions/ti_pow.py +35 -27
- foxes/models/wake_superpositions/ti_quadratic.py +33 -27
- foxes/models/wake_superpositions/ws_linear.py +39 -32
- foxes/models/wake_superpositions/ws_max.py +40 -33
- foxes/models/wake_superpositions/ws_pow.py +39 -32
- foxes/models/wake_superpositions/ws_product.py +35 -28
- foxes/models/wake_superpositions/ws_quadratic.py +39 -32
- foxes/opt/constraints/min_dist.py +1 -1
- foxes/opt/objectives/farm_vars.py +1 -1
- foxes/opt/problems/layout/farm_layout.py +38 -97
- foxes/output/__init__.py +1 -0
- foxes/output/farm_results_eval.py +1 -1
- foxes/output/flow_plots_2d/flow_plots.py +2 -0
- foxes/output/flow_plots_2d/get_fig.py +2 -0
- foxes/output/grids.py +1 -1
- foxes/output/rose_plot.py +3 -3
- foxes/output/rotor_point_plots.py +117 -0
- foxes/output/turbine_type_curves.py +2 -2
- foxes/utils/__init__.py +2 -1
- foxes/utils/load.py +29 -0
- foxes/utils/random_xy.py +56 -0
- foxes/utils/runners/runners.py +13 -1
- foxes/utils/windrose_plot.py +1 -1
- foxes/variables.py +10 -0
- {foxes-0.6.1.dist-info → foxes-0.7.dist-info}/METADATA +13 -7
- {foxes-0.6.1.dist-info → foxes-0.7.dist-info}/RECORD +126 -122
- {foxes-0.6.1.dist-info → foxes-0.7.dist-info}/WHEEL +1 -1
- foxes/models/partial_wakes/distsliced.py +0 -322
- foxes/models/partial_wakes/mapped.py +0 -252
- foxes/models/turbine_models/set_XYHD.py +0 -130
- {foxes-0.6.1.dist-info → foxes-0.7.dist-info}/LICENSE +0 -0
- {foxes-0.6.1.dist-info → foxes-0.7.dist-info}/top_level.txt +0 -0
- {foxes-0.6.1.dist-info → foxes-0.7.dist-info}/zip-safe +0 -0
|
@@ -37,48 +37,56 @@ class TIPow(WakeSuperposition):
|
|
|
37
37
|
self.pow = pow
|
|
38
38
|
self.superp_to_amb = superp_to_amb
|
|
39
39
|
|
|
40
|
-
def
|
|
40
|
+
def __repr__(self):
|
|
41
|
+
return (
|
|
42
|
+
f"{type(self).__name__}(pow={self.pow}, superp_to_amb={self.superp_to_amb})"
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
def add_wake(
|
|
41
46
|
self,
|
|
42
47
|
algo,
|
|
43
48
|
mdata,
|
|
44
49
|
fdata,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
50
|
+
tdata,
|
|
51
|
+
downwind_index,
|
|
52
|
+
st_sel,
|
|
48
53
|
variable,
|
|
49
54
|
wake_delta,
|
|
50
55
|
wake_model_result,
|
|
51
56
|
):
|
|
52
57
|
"""
|
|
53
|
-
Add a wake delta to previous wake deltas
|
|
58
|
+
Add a wake delta to previous wake deltas,
|
|
59
|
+
at rotor points.
|
|
54
60
|
|
|
55
61
|
Parameters
|
|
56
62
|
----------
|
|
57
63
|
algo: foxes.core.Algorithm
|
|
58
64
|
The calculation algorithm
|
|
59
|
-
mdata: foxes.core.
|
|
65
|
+
mdata: foxes.core.MData
|
|
60
66
|
The model data
|
|
61
|
-
fdata: foxes.core.
|
|
67
|
+
fdata: foxes.core.FData
|
|
62
68
|
The farm data
|
|
63
|
-
|
|
64
|
-
The
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
The selection of
|
|
69
|
+
tdata: foxes.core.TData
|
|
70
|
+
The target point data
|
|
71
|
+
downwind_index: int
|
|
72
|
+
The index of the wake causing turbine
|
|
73
|
+
in the downwnd order
|
|
74
|
+
st_sel: numpy.ndarray of bool
|
|
75
|
+
The selection of targets, shape: (n_states, n_targets)
|
|
70
76
|
variable: str
|
|
71
77
|
The variable name for which the wake deltas applies
|
|
72
78
|
wake_delta: numpy.ndarray
|
|
73
|
-
The original wake deltas, shape:
|
|
79
|
+
The original wake deltas, shape:
|
|
80
|
+
(n_states, n_targets, n_tpoints, ...)
|
|
74
81
|
wake_model_result: numpy.ndarray
|
|
75
|
-
The new wake deltas of the selected
|
|
76
|
-
shape: (
|
|
82
|
+
The new wake deltas of the selected rotors,
|
|
83
|
+
shape: (n_st_sel, n_tpoints, ...)
|
|
77
84
|
|
|
78
85
|
Returns
|
|
79
86
|
-------
|
|
80
87
|
wdelta: numpy.ndarray
|
|
81
|
-
The updated wake deltas, shape:
|
|
88
|
+
The updated wake deltas, shape:
|
|
89
|
+
(n_states, n_targets, n_tpoints, ...)
|
|
82
90
|
|
|
83
91
|
"""
|
|
84
92
|
if variable != FV.TI:
|
|
@@ -86,7 +94,7 @@ class TIPow(WakeSuperposition):
|
|
|
86
94
|
f"Superposition '{self.name}': Expecting wake variable {FV.TI}, got {variable}"
|
|
87
95
|
)
|
|
88
96
|
|
|
89
|
-
wake_delta[
|
|
97
|
+
wake_delta[st_sel] += wake_model_result**self.pow
|
|
90
98
|
return wake_delta
|
|
91
99
|
|
|
92
100
|
def calc_final_wake_delta(
|
|
@@ -94,7 +102,6 @@ class TIPow(WakeSuperposition):
|
|
|
94
102
|
algo,
|
|
95
103
|
mdata,
|
|
96
104
|
fdata,
|
|
97
|
-
pdata,
|
|
98
105
|
variable,
|
|
99
106
|
amb_results,
|
|
100
107
|
wake_delta,
|
|
@@ -107,24 +114,25 @@ class TIPow(WakeSuperposition):
|
|
|
107
114
|
----------
|
|
108
115
|
algo: foxes.core.Algorithm
|
|
109
116
|
The calculation algorithm
|
|
110
|
-
mdata: foxes.core.
|
|
117
|
+
mdata: foxes.core.MData
|
|
111
118
|
The model data
|
|
112
|
-
fdata: foxes.core.
|
|
119
|
+
fdata: foxes.core.FData
|
|
113
120
|
The farm data
|
|
114
|
-
pdata: foxes.core.Data
|
|
115
|
-
The evaluation point data
|
|
116
121
|
variable: str
|
|
117
122
|
The variable name for which the wake deltas applies
|
|
118
123
|
amb_results: numpy.ndarray
|
|
119
|
-
The ambient results
|
|
124
|
+
The ambient results at targets,
|
|
125
|
+
shape: (n_states, n_targets, n_tpoints)
|
|
120
126
|
wake_delta: numpy.ndarray
|
|
121
|
-
The wake deltas, shape:
|
|
127
|
+
The wake deltas at targets, shape:
|
|
128
|
+
(n_states, n_targets, n_tpoints)
|
|
122
129
|
|
|
123
130
|
Returns
|
|
124
131
|
-------
|
|
125
132
|
final_wake_delta: numpy.ndarray
|
|
126
133
|
The final wake delta, which will be added to the ambient
|
|
127
|
-
results by simple plus operation. Shape:
|
|
134
|
+
results by simple plus operation. Shape:
|
|
135
|
+
(n_states, n_targets, n_tpoints)
|
|
128
136
|
|
|
129
137
|
"""
|
|
130
138
|
# linear superposition to ambient:
|
|
@@ -32,48 +32,54 @@ class TIQuadratic(WakeSuperposition):
|
|
|
32
32
|
super().__init__()
|
|
33
33
|
self.superp_to_amb = superp_to_amb
|
|
34
34
|
|
|
35
|
-
def
|
|
35
|
+
def __repr__(self):
|
|
36
|
+
return f"{type(self).__name__}(superp_to_amb={self.superp_to_amb})"
|
|
37
|
+
|
|
38
|
+
def add_wake(
|
|
36
39
|
self,
|
|
37
40
|
algo,
|
|
38
41
|
mdata,
|
|
39
42
|
fdata,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
tdata,
|
|
44
|
+
downwind_index,
|
|
45
|
+
st_sel,
|
|
43
46
|
variable,
|
|
44
47
|
wake_delta,
|
|
45
48
|
wake_model_result,
|
|
46
49
|
):
|
|
47
50
|
"""
|
|
48
|
-
Add a wake delta to previous wake deltas
|
|
51
|
+
Add a wake delta to previous wake deltas,
|
|
52
|
+
at rotor points.
|
|
49
53
|
|
|
50
54
|
Parameters
|
|
51
55
|
----------
|
|
52
56
|
algo: foxes.core.Algorithm
|
|
53
57
|
The calculation algorithm
|
|
54
|
-
mdata: foxes.core.
|
|
58
|
+
mdata: foxes.core.MData
|
|
55
59
|
The model data
|
|
56
|
-
fdata: foxes.core.
|
|
60
|
+
fdata: foxes.core.FData
|
|
57
61
|
The farm data
|
|
58
|
-
|
|
59
|
-
The
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
The selection of
|
|
62
|
+
tdata: foxes.core.TData
|
|
63
|
+
The target point data
|
|
64
|
+
downwind_index: int
|
|
65
|
+
The index of the wake causing turbine
|
|
66
|
+
in the downwnd order
|
|
67
|
+
st_sel: numpy.ndarray of bool
|
|
68
|
+
The selection of targets, shape: (n_states, n_targets)
|
|
65
69
|
variable: str
|
|
66
70
|
The variable name for which the wake deltas applies
|
|
67
71
|
wake_delta: numpy.ndarray
|
|
68
|
-
The original wake deltas, shape:
|
|
72
|
+
The original wake deltas, shape:
|
|
73
|
+
(n_states, n_targets, n_tpoints, ...)
|
|
69
74
|
wake_model_result: numpy.ndarray
|
|
70
|
-
The new wake deltas of the selected
|
|
71
|
-
shape: (
|
|
75
|
+
The new wake deltas of the selected rotors,
|
|
76
|
+
shape: (n_st_sel, n_tpoints, ...)
|
|
72
77
|
|
|
73
78
|
Returns
|
|
74
79
|
-------
|
|
75
80
|
wdelta: numpy.ndarray
|
|
76
|
-
The updated wake deltas, shape:
|
|
81
|
+
The updated wake deltas, shape:
|
|
82
|
+
(n_states, n_targets, n_tpoints, ...)
|
|
77
83
|
|
|
78
84
|
"""
|
|
79
85
|
if variable != FV.TI:
|
|
@@ -81,7 +87,7 @@ class TIQuadratic(WakeSuperposition):
|
|
|
81
87
|
f"Superposition '{self.name}': Expecting wake variable {FV.TI}, got {variable}"
|
|
82
88
|
)
|
|
83
89
|
|
|
84
|
-
wake_delta[
|
|
90
|
+
wake_delta[st_sel] += wake_model_result**2
|
|
85
91
|
return wake_delta
|
|
86
92
|
|
|
87
93
|
def calc_final_wake_delta(
|
|
@@ -89,7 +95,6 @@ class TIQuadratic(WakeSuperposition):
|
|
|
89
95
|
algo,
|
|
90
96
|
mdata,
|
|
91
97
|
fdata,
|
|
92
|
-
pdata,
|
|
93
98
|
variable,
|
|
94
99
|
amb_results,
|
|
95
100
|
wake_delta,
|
|
@@ -102,24 +107,25 @@ class TIQuadratic(WakeSuperposition):
|
|
|
102
107
|
----------
|
|
103
108
|
algo: foxes.core.Algorithm
|
|
104
109
|
The calculation algorithm
|
|
105
|
-
mdata: foxes.core.
|
|
110
|
+
mdata: foxes.core.MData
|
|
106
111
|
The model data
|
|
107
|
-
fdata: foxes.core.
|
|
112
|
+
fdata: foxes.core.FData
|
|
108
113
|
The farm data
|
|
109
|
-
pdata: foxes.core.Data
|
|
110
|
-
The evaluation point data
|
|
111
114
|
variable: str
|
|
112
115
|
The variable name for which the wake deltas applies
|
|
113
116
|
amb_results: numpy.ndarray
|
|
114
|
-
The ambient results
|
|
117
|
+
The ambient results at targets,
|
|
118
|
+
shape: (n_states, n_targets, n_tpoints)
|
|
115
119
|
wake_delta: numpy.ndarray
|
|
116
|
-
The wake deltas, shape:
|
|
120
|
+
The wake deltas at targets, shape:
|
|
121
|
+
(n_states, n_targets, n_tpoints)
|
|
117
122
|
|
|
118
123
|
Returns
|
|
119
124
|
-------
|
|
120
125
|
final_wake_delta: numpy.ndarray
|
|
121
126
|
The final wake delta, which will be added to the ambient
|
|
122
|
-
results by simple plus operation. Shape:
|
|
127
|
+
results by simple plus operation. Shape:
|
|
128
|
+
(n_states, n_targets, n_tpoints)
|
|
123
129
|
|
|
124
130
|
"""
|
|
125
131
|
# linear superposition to ambient:
|
|
@@ -44,6 +44,10 @@ class WSLinear(WakeSuperposition):
|
|
|
44
44
|
self.lim_low = lim_low
|
|
45
45
|
self.lim_high = lim_high
|
|
46
46
|
|
|
47
|
+
def __repr__(self):
|
|
48
|
+
a = f"scale_amb={self.scale_amb}, lim_low={self.lim_low}, lim_high={self.lim_high}"
|
|
49
|
+
return f"{type(self).__name__}({a})"
|
|
50
|
+
|
|
47
51
|
def input_farm_vars(self, algo):
|
|
48
52
|
"""
|
|
49
53
|
The variables which are needed for running
|
|
@@ -62,48 +66,51 @@ class WSLinear(WakeSuperposition):
|
|
|
62
66
|
"""
|
|
63
67
|
return [FV.AMB_REWS] if self.scale_amb else [FV.REWS]
|
|
64
68
|
|
|
65
|
-
def
|
|
69
|
+
def add_wake(
|
|
66
70
|
self,
|
|
67
71
|
algo,
|
|
68
72
|
mdata,
|
|
69
73
|
fdata,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
74
|
+
tdata,
|
|
75
|
+
downwind_index,
|
|
76
|
+
st_sel,
|
|
73
77
|
variable,
|
|
74
78
|
wake_delta,
|
|
75
79
|
wake_model_result,
|
|
76
80
|
):
|
|
77
81
|
"""
|
|
78
|
-
Add a wake delta to previous wake deltas
|
|
82
|
+
Add a wake delta to previous wake deltas,
|
|
83
|
+
at rotor points.
|
|
79
84
|
|
|
80
85
|
Parameters
|
|
81
86
|
----------
|
|
82
87
|
algo: foxes.core.Algorithm
|
|
83
88
|
The calculation algorithm
|
|
84
|
-
mdata: foxes.core.
|
|
89
|
+
mdata: foxes.core.MData
|
|
85
90
|
The model data
|
|
86
|
-
fdata: foxes.core.
|
|
91
|
+
fdata: foxes.core.FData
|
|
87
92
|
The farm data
|
|
88
|
-
|
|
89
|
-
The
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
The selection of
|
|
93
|
+
tdata: foxes.core.TData
|
|
94
|
+
The target point data
|
|
95
|
+
downwind_index: int
|
|
96
|
+
The index of the wake causing turbine
|
|
97
|
+
in the downwnd order
|
|
98
|
+
st_sel: numpy.ndarray of bool
|
|
99
|
+
The selection of targets, shape: (n_states, n_targets)
|
|
95
100
|
variable: str
|
|
96
101
|
The variable name for which the wake deltas applies
|
|
97
102
|
wake_delta: numpy.ndarray
|
|
98
|
-
The original wake deltas, shape:
|
|
103
|
+
The original wake deltas, shape:
|
|
104
|
+
(n_states, n_targets, n_tpoints, ...)
|
|
99
105
|
wake_model_result: numpy.ndarray
|
|
100
|
-
The new wake deltas of the selected
|
|
101
|
-
shape: (
|
|
106
|
+
The new wake deltas of the selected rotors,
|
|
107
|
+
shape: (n_st_sel, n_tpoints, ...)
|
|
102
108
|
|
|
103
109
|
Returns
|
|
104
110
|
-------
|
|
105
111
|
wdelta: numpy.ndarray
|
|
106
|
-
The updated wake deltas, shape:
|
|
112
|
+
The updated wake deltas, shape:
|
|
113
|
+
(n_states, n_targets, n_tpoints, ...)
|
|
107
114
|
|
|
108
115
|
"""
|
|
109
116
|
if variable not in [FV.REWS, FV.REWS2, FV.REWS3, FV.WS]:
|
|
@@ -111,19 +118,19 @@ class WSLinear(WakeSuperposition):
|
|
|
111
118
|
f"Superposition '{self.name}': Expecting wind speed variable, got {variable}"
|
|
112
119
|
)
|
|
113
120
|
|
|
114
|
-
if np.any(
|
|
121
|
+
if np.any(st_sel):
|
|
115
122
|
scale = self.get_data(
|
|
116
123
|
FV.AMB_REWS if self.scale_amb else FV.REWS,
|
|
117
|
-
FC.
|
|
124
|
+
FC.STATE_TARGET,
|
|
118
125
|
lookup="w",
|
|
119
126
|
algo=algo,
|
|
120
127
|
fdata=fdata,
|
|
121
|
-
|
|
128
|
+
tdata=tdata,
|
|
129
|
+
downwind_index=downwind_index,
|
|
122
130
|
upcast=True,
|
|
123
|
-
|
|
124
|
-
)[sel_sp]
|
|
131
|
+
)[st_sel, None]
|
|
125
132
|
|
|
126
|
-
wake_delta[
|
|
133
|
+
wake_delta[st_sel] += scale * wake_model_result
|
|
127
134
|
|
|
128
135
|
return wake_delta
|
|
129
136
|
|
|
@@ -132,7 +139,6 @@ class WSLinear(WakeSuperposition):
|
|
|
132
139
|
algo,
|
|
133
140
|
mdata,
|
|
134
141
|
fdata,
|
|
135
|
-
pdata,
|
|
136
142
|
variable,
|
|
137
143
|
amb_results,
|
|
138
144
|
wake_delta,
|
|
@@ -145,24 +151,25 @@ class WSLinear(WakeSuperposition):
|
|
|
145
151
|
----------
|
|
146
152
|
algo: foxes.core.Algorithm
|
|
147
153
|
The calculation algorithm
|
|
148
|
-
mdata: foxes.core.
|
|
154
|
+
mdata: foxes.core.MData
|
|
149
155
|
The model data
|
|
150
|
-
fdata: foxes.core.
|
|
156
|
+
fdata: foxes.core.FData
|
|
151
157
|
The farm data
|
|
152
|
-
pdata: foxes.core.Data
|
|
153
|
-
The evaluation point data
|
|
154
158
|
variable: str
|
|
155
159
|
The variable name for which the wake deltas applies
|
|
156
160
|
amb_results: numpy.ndarray
|
|
157
|
-
The ambient results
|
|
161
|
+
The ambient results at targets,
|
|
162
|
+
shape: (n_states, n_targets, n_tpoints)
|
|
158
163
|
wake_delta: numpy.ndarray
|
|
159
|
-
The wake deltas, shape:
|
|
164
|
+
The wake deltas at targets, shape:
|
|
165
|
+
(n_states, n_targets, n_tpoints)
|
|
160
166
|
|
|
161
167
|
Returns
|
|
162
168
|
-------
|
|
163
169
|
final_wake_delta: numpy.ndarray
|
|
164
170
|
The final wake delta, which will be added to the ambient
|
|
165
|
-
results by simple plus operation. Shape:
|
|
171
|
+
results by simple plus operation. Shape:
|
|
172
|
+
(n_states, n_targets, n_tpoints)
|
|
166
173
|
|
|
167
174
|
"""
|
|
168
175
|
w = wake_delta
|
|
@@ -44,6 +44,10 @@ class WSMax(WakeSuperposition):
|
|
|
44
44
|
self.lim_low = lim_low
|
|
45
45
|
self.lim_high = lim_high
|
|
46
46
|
|
|
47
|
+
def __repr__(self):
|
|
48
|
+
a = f"scale_amb={self.scale_amb}, lim_low={self.lim_low}, lim_high={self.lim_high}"
|
|
49
|
+
return f"{type(self).__name__}({a})"
|
|
50
|
+
|
|
47
51
|
def input_farm_vars(self, algo):
|
|
48
52
|
"""
|
|
49
53
|
The variables which are needed for running
|
|
@@ -62,48 +66,51 @@ class WSMax(WakeSuperposition):
|
|
|
62
66
|
"""
|
|
63
67
|
return [FV.AMB_REWS] if self.scale_amb else [FV.REWS]
|
|
64
68
|
|
|
65
|
-
def
|
|
69
|
+
def add_wake(
|
|
66
70
|
self,
|
|
67
71
|
algo,
|
|
68
72
|
mdata,
|
|
69
73
|
fdata,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
74
|
+
tdata,
|
|
75
|
+
downwind_index,
|
|
76
|
+
st_sel,
|
|
73
77
|
variable,
|
|
74
78
|
wake_delta,
|
|
75
79
|
wake_model_result,
|
|
76
80
|
):
|
|
77
81
|
"""
|
|
78
|
-
Add a wake delta to previous wake deltas
|
|
82
|
+
Add a wake delta to previous wake deltas,
|
|
83
|
+
at rotor points.
|
|
79
84
|
|
|
80
85
|
Parameters
|
|
81
86
|
----------
|
|
82
87
|
algo: foxes.core.Algorithm
|
|
83
88
|
The calculation algorithm
|
|
84
|
-
mdata: foxes.core.
|
|
89
|
+
mdata: foxes.core.MData
|
|
85
90
|
The model data
|
|
86
|
-
fdata: foxes.core.
|
|
91
|
+
fdata: foxes.core.FData
|
|
87
92
|
The farm data
|
|
88
|
-
|
|
89
|
-
The
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
The selection of
|
|
93
|
+
tdata: foxes.core.TData
|
|
94
|
+
The target point data
|
|
95
|
+
downwind_index: int
|
|
96
|
+
The index of the wake causing turbine
|
|
97
|
+
in the downwnd order
|
|
98
|
+
st_sel: numpy.ndarray of bool
|
|
99
|
+
The selection of targets, shape: (n_states, n_targets)
|
|
95
100
|
variable: str
|
|
96
101
|
The variable name for which the wake deltas applies
|
|
97
102
|
wake_delta: numpy.ndarray
|
|
98
|
-
The original wake deltas, shape:
|
|
103
|
+
The original wake deltas, shape:
|
|
104
|
+
(n_states, n_targets, n_tpoints, ...)
|
|
99
105
|
wake_model_result: numpy.ndarray
|
|
100
|
-
The new wake deltas of the selected
|
|
101
|
-
shape: (
|
|
106
|
+
The new wake deltas of the selected rotors,
|
|
107
|
+
shape: (n_st_sel, n_tpoints, ...)
|
|
102
108
|
|
|
103
109
|
Returns
|
|
104
110
|
-------
|
|
105
111
|
wdelta: numpy.ndarray
|
|
106
|
-
The updated wake deltas, shape:
|
|
112
|
+
The updated wake deltas, shape:
|
|
113
|
+
(n_states, n_targets, n_tpoints, ...)
|
|
107
114
|
|
|
108
115
|
"""
|
|
109
116
|
if variable not in [FV.REWS, FV.REWS2, FV.REWS3, FV.WS]:
|
|
@@ -111,22 +118,22 @@ class WSMax(WakeSuperposition):
|
|
|
111
118
|
f"Superposition '{self.name}': Expecting wind speed variable, got {variable}"
|
|
112
119
|
)
|
|
113
120
|
|
|
114
|
-
if np.any(
|
|
121
|
+
if np.any(st_sel):
|
|
115
122
|
scale = self.get_data(
|
|
116
123
|
FV.AMB_REWS if self.scale_amb else FV.REWS,
|
|
117
|
-
FC.
|
|
124
|
+
FC.STATE_TARGET,
|
|
118
125
|
lookup="w",
|
|
119
126
|
algo=algo,
|
|
120
127
|
fdata=fdata,
|
|
121
|
-
|
|
128
|
+
tdata=tdata,
|
|
129
|
+
downwind_index=downwind_index,
|
|
122
130
|
upcast=True,
|
|
123
|
-
|
|
124
|
-
)[sel_sp]
|
|
131
|
+
)[st_sel, None]
|
|
125
132
|
|
|
126
133
|
wake_model_result = np.abs(scale * wake_model_result)
|
|
127
|
-
odelta = wake_delta[
|
|
134
|
+
odelta = wake_delta[st_sel]
|
|
128
135
|
|
|
129
|
-
wake_delta[
|
|
136
|
+
wake_delta[st_sel] = np.maximum(odelta, wake_model_result)
|
|
130
137
|
|
|
131
138
|
return wake_delta
|
|
132
139
|
|
|
@@ -135,7 +142,6 @@ class WSMax(WakeSuperposition):
|
|
|
135
142
|
algo,
|
|
136
143
|
mdata,
|
|
137
144
|
fdata,
|
|
138
|
-
pdata,
|
|
139
145
|
variable,
|
|
140
146
|
amb_results,
|
|
141
147
|
wake_delta,
|
|
@@ -148,24 +154,25 @@ class WSMax(WakeSuperposition):
|
|
|
148
154
|
----------
|
|
149
155
|
algo: foxes.core.Algorithm
|
|
150
156
|
The calculation algorithm
|
|
151
|
-
mdata: foxes.core.
|
|
157
|
+
mdata: foxes.core.MData
|
|
152
158
|
The model data
|
|
153
|
-
fdata: foxes.core.
|
|
159
|
+
fdata: foxes.core.FData
|
|
154
160
|
The farm data
|
|
155
|
-
pdata: foxes.core.Data
|
|
156
|
-
The evaluation point data
|
|
157
161
|
variable: str
|
|
158
162
|
The variable name for which the wake deltas applies
|
|
159
163
|
amb_results: numpy.ndarray
|
|
160
|
-
The ambient results
|
|
164
|
+
The ambient results at targets,
|
|
165
|
+
shape: (n_states, n_targets, n_tpoints)
|
|
161
166
|
wake_delta: numpy.ndarray
|
|
162
|
-
The wake deltas, shape:
|
|
167
|
+
The wake deltas at targets, shape:
|
|
168
|
+
(n_states, n_targets, n_tpoints)
|
|
163
169
|
|
|
164
170
|
Returns
|
|
165
171
|
-------
|
|
166
172
|
final_wake_delta: numpy.ndarray
|
|
167
173
|
The final wake delta, which will be added to the ambient
|
|
168
|
-
results by simple plus operation. Shape:
|
|
174
|
+
results by simple plus operation. Shape:
|
|
175
|
+
(n_states, n_targets, n_tpoints)
|
|
169
176
|
|
|
170
177
|
"""
|
|
171
178
|
w = -wake_delta
|