foxes 1.2.5__py3-none-any.whl → 1.4__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.
- docs/source/conf.py +3 -3
- examples/abl_states/run.py +2 -2
- examples/compare_rotors_pwakes/run.py +1 -1
- examples/compare_wakes/run.py +1 -2
- examples/dyn_wakes/run.py +29 -6
- examples/induction/run.py +3 -3
- examples/multi_height/run.py +1 -1
- examples/power_mask/run.py +2 -2
- examples/quickstart/run.py +16 -0
- examples/random_timeseries/run.py +3 -4
- examples/scan_row/run.py +3 -3
- examples/sequential/run.py +33 -10
- examples/single_state/run.py +3 -4
- examples/states_lookup_table/run.py +3 -3
- examples/streamline_wakes/run.py +27 -4
- examples/tab_file/run.py +3 -3
- examples/timelines/run.py +29 -5
- examples/timeseries/run.py +3 -3
- examples/timeseries_slurm/run.py +3 -3
- examples/wind_rose/run.py +3 -3
- examples/yawed_wake/run.py +16 -8
- foxes/__init__.py +22 -18
- foxes/algorithms/__init__.py +6 -6
- foxes/algorithms/downwind/__init__.py +2 -2
- foxes/algorithms/downwind/downwind.py +53 -27
- foxes/algorithms/downwind/models/__init__.py +6 -6
- foxes/algorithms/downwind/models/farm_wakes_calc.py +22 -14
- foxes/algorithms/downwind/models/init_farm_data.py +4 -5
- foxes/algorithms/downwind/models/point_wakes_calc.py +7 -13
- foxes/algorithms/downwind/models/reorder_farm_output.py +5 -1
- foxes/algorithms/downwind/models/set_amb_point_results.py +7 -7
- foxes/algorithms/iterative/__init__.py +7 -3
- foxes/algorithms/iterative/iterative.py +1 -2
- foxes/algorithms/iterative/models/__init__.py +7 -3
- foxes/algorithms/iterative/models/farm_wakes_calc.py +15 -8
- foxes/algorithms/sequential/__init__.py +3 -3
- foxes/algorithms/sequential/models/__init__.py +2 -2
- foxes/algorithms/sequential/models/seq_state.py +0 -18
- foxes/algorithms/sequential/sequential.py +8 -22
- foxes/config/__init__.py +5 -1
- foxes/constants.py +22 -0
- foxes/core/__init__.py +45 -22
- foxes/core/algorithm.py +0 -1
- foxes/core/data.py +56 -29
- foxes/core/engine.py +28 -14
- foxes/core/farm_controller.py +2 -2
- foxes/core/farm_data_model.py +1 -0
- foxes/core/ground_model.py +4 -13
- foxes/core/model.py +5 -5
- foxes/core/partial_wakes_model.py +147 -10
- foxes/core/point_data_model.py +2 -3
- foxes/core/rotor_model.py +42 -38
- foxes/core/states.py +4 -50
- foxes/core/turbine.py +2 -1
- foxes/core/wake_deflection.py +130 -0
- foxes/core/wake_model.py +222 -9
- foxes/core/wake_superposition.py +122 -4
- foxes/core/wind_farm.py +6 -6
- foxes/data/__init__.py +7 -2
- foxes/data/states/weibull_sectors_12.csv +13 -0
- foxes/data/states/weibull_sectors_12.nc +0 -0
- foxes/engines/__init__.py +14 -15
- foxes/engines/dask.py +39 -14
- foxes/engines/numpy.py +0 -3
- foxes/input/__init__.py +3 -3
- foxes/input/farm_layout/__init__.py +8 -8
- foxes/input/farm_layout/from_csv.py +1 -1
- foxes/input/farm_layout/ring.py +0 -1
- foxes/input/states/__init__.py +22 -11
- foxes/input/states/create/__init__.py +3 -2
- foxes/input/states/field_data_nc.py +48 -84
- foxes/input/states/multi_height.py +40 -60
- foxes/input/states/one_point_flow.py +22 -25
- foxes/input/states/scan.py +6 -19
- foxes/input/states/single.py +6 -18
- foxes/input/states/states_table.py +25 -44
- foxes/input/states/weibull_sectors.py +225 -0
- foxes/input/states/wrg_states.py +151 -37
- foxes/input/yaml/__init__.py +9 -3
- foxes/input/yaml/dict.py +19 -19
- foxes/input/yaml/windio/__init__.py +10 -5
- foxes/input/yaml/windio/read_attributes.py +2 -2
- foxes/input/yaml/windio/read_farm.py +5 -5
- foxes/input/yaml/windio/read_fields.py +4 -2
- foxes/input/yaml/windio/read_site.py +52 -0
- foxes/input/yaml/windio/windio.py +1 -1
- foxes/models/__init__.py +15 -14
- foxes/models/axial_induction/__init__.py +2 -2
- foxes/models/farm_controllers/__init__.py +1 -1
- foxes/models/farm_models/__init__.py +1 -1
- foxes/models/ground_models/__init__.py +3 -2
- foxes/models/ground_models/wake_mirror.py +3 -3
- foxes/models/model_book.py +175 -49
- foxes/models/partial_wakes/__init__.py +6 -6
- foxes/models/partial_wakes/axiwake.py +30 -5
- foxes/models/partial_wakes/centre.py +47 -0
- foxes/models/partial_wakes/rotor_points.py +45 -9
- foxes/models/partial_wakes/segregated.py +2 -20
- foxes/models/partial_wakes/top_hat.py +27 -2
- foxes/models/point_models/__init__.py +4 -4
- foxes/models/rotor_models/__init__.py +3 -3
- foxes/models/rotor_models/centre.py +6 -4
- foxes/models/turbine_models/__init__.py +11 -11
- foxes/models/turbine_models/set_farm_vars.py +0 -1
- foxes/models/turbine_types/PCt_file.py +0 -2
- foxes/models/turbine_types/PCt_from_two.py +0 -2
- foxes/models/turbine_types/__init__.py +9 -9
- foxes/models/vertical_profiles/__init__.py +7 -7
- foxes/models/wake_deflections/__init__.py +3 -0
- foxes/models/{wake_frames/yawed_wakes.py → wake_deflections/bastankhah2016.py} +32 -111
- foxes/models/wake_deflections/jimenez.py +277 -0
- foxes/models/wake_deflections/no_deflection.py +94 -0
- foxes/models/wake_frames/__init__.py +6 -7
- foxes/models/wake_frames/dynamic_wakes.py +12 -3
- foxes/models/wake_frames/rotor_wd.py +3 -1
- foxes/models/wake_frames/seq_dynamic_wakes.py +45 -8
- foxes/models/wake_frames/streamlines.py +8 -6
- foxes/models/wake_frames/timelines.py +19 -3
- foxes/models/wake_models/__init__.py +7 -7
- foxes/models/wake_models/dist_sliced.py +50 -84
- foxes/models/wake_models/gaussian.py +20 -0
- foxes/models/wake_models/induction/__init__.py +5 -5
- foxes/models/wake_models/induction/rankine_half_body.py +30 -71
- foxes/models/wake_models/induction/rathmann.py +65 -64
- foxes/models/wake_models/induction/self_similar.py +65 -68
- foxes/models/wake_models/induction/self_similar2020.py +0 -3
- foxes/models/wake_models/induction/vortex_sheet.py +71 -75
- foxes/models/wake_models/ti/__init__.py +2 -2
- foxes/models/wake_models/ti/crespo_hernandez.py +5 -3
- foxes/models/wake_models/ti/iec_ti.py +6 -4
- foxes/models/wake_models/top_hat.py +58 -7
- foxes/models/wake_models/wind/__init__.py +6 -4
- foxes/models/wake_models/wind/bastankhah14.py +25 -7
- foxes/models/wake_models/wind/bastankhah16.py +35 -3
- foxes/models/wake_models/wind/jensen.py +15 -2
- foxes/models/wake_models/wind/turbopark.py +28 -2
- foxes/models/wake_superpositions/__init__.py +18 -9
- foxes/models/wake_superpositions/ti_linear.py +4 -4
- foxes/models/wake_superpositions/ti_max.py +4 -4
- foxes/models/wake_superpositions/ti_pow.py +4 -4
- foxes/models/wake_superpositions/ti_quadratic.py +4 -4
- foxes/models/wake_superpositions/wind_vector.py +257 -0
- foxes/models/wake_superpositions/ws_linear.py +9 -10
- foxes/models/wake_superpositions/ws_max.py +8 -8
- foxes/models/wake_superpositions/ws_pow.py +8 -8
- foxes/models/wake_superpositions/ws_product.py +4 -4
- foxes/models/wake_superpositions/ws_quadratic.py +8 -8
- foxes/output/__init__.py +21 -19
- foxes/output/farm_layout.py +14 -6
- foxes/output/farm_results_eval.py +51 -27
- foxes/output/flow_plots_2d/__init__.py +2 -2
- foxes/output/flow_plots_2d/get_fig.py +4 -2
- foxes/output/rose_plot.py +23 -5
- foxes/output/seq_plugins/__init__.py +2 -2
- foxes/output/seq_plugins/seq_flow_ani_plugin.py +0 -3
- foxes/output/seq_plugins/seq_wake_debug_plugin.py +0 -1
- foxes/output/slice_data.py +16 -19
- foxes/output/turbine_type_curves.py +7 -8
- foxes/utils/__init__.py +37 -19
- foxes/utils/abl/__init__.py +4 -4
- foxes/utils/cubic_roots.py +1 -1
- foxes/utils/data_book.py +4 -3
- foxes/utils/dict.py +3 -3
- foxes/utils/exec_python.py +5 -5
- foxes/utils/factory.py +1 -3
- foxes/utils/geom2d/__init__.py +7 -5
- foxes/utils/geopandas_utils.py +2 -2
- foxes/utils/pandas_utils.py +4 -3
- foxes/utils/tab_files.py +0 -1
- foxes/utils/weibull.py +28 -0
- foxes/utils/wrg_utils.py +3 -1
- foxes/utils/xarray_utils.py +9 -2
- foxes/variables.py +67 -9
- {foxes-1.2.5.dist-info → foxes-1.4.dist-info}/METADATA +14 -21
- foxes-1.4.dist-info/RECORD +320 -0
- {foxes-1.2.5.dist-info → foxes-1.4.dist-info}/WHEEL +1 -1
- tests/0_consistency/iterative/test_iterative.py +2 -3
- tests/0_consistency/partial_wakes/test_partial_wakes.py +2 -2
- tests/1_verification/flappy_0_6/PCt_files/flappy/run.py +2 -3
- tests/1_verification/flappy_0_6/PCt_files/test_PCt_files.py +48 -56
- tests/1_verification/flappy_0_6/abl_states/flappy/run.py +0 -1
- tests/1_verification/flappy_0_6/abl_states/test_abl_states.py +33 -36
- tests/1_verification/flappy_0_6/partial_top_hat/flappy/run.py +0 -1
- tests/1_verification/flappy_0_6/partial_top_hat/test_partial_top_hat.py +0 -2
- tests/1_verification/flappy_0_6/row_Jensen_linear_centre/test_row_Jensen_linear_centre.py +3 -3
- tests/1_verification/flappy_0_6/row_Jensen_linear_tophat/test_row_Jensen_linear_tophat.py +3 -4
- tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2005/test_row_Jensen_linear_tophat_IECTI_2005.py +3 -4
- tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2019/test_row_Jensen_linear_tophat_IECTI_2019.py +3 -4
- tests/1_verification/flappy_0_6/row_Jensen_quadratic_centre/test_row_Jensen_quadratic_centre.py +3 -4
- tests/1_verification/flappy_0_6_2/grid_rotors/flappy/run.py +0 -2
- tests/1_verification/flappy_0_6_2/grid_rotors/test_grid_rotors.py +3 -3
- tests/1_verification/flappy_0_6_2/row_Bastankhah_Crespo/test_row_Bastankhah_Crespo.py +3 -3
- tests/1_verification/flappy_0_6_2/row_Bastankhah_linear_centre/flappy/run.py +0 -1
- tests/1_verification/flappy_0_6_2/row_Bastankhah_linear_centre/test_row_Bastankhah_linear_centre.py +3 -4
- tests/3_examples/test_examples.py +3 -2
- foxes/output/round.py +0 -10
- foxes/utils/pandas_helpers.py +0 -178
- foxes-1.2.5.dist-info/RECORD +0 -312
- {foxes-1.2.5.dist-info → foxes-1.4.dist-info}/entry_points.txt +0 -0
- {foxes-1.2.5.dist-info → foxes-1.4.dist-info/licenses}/LICENSE +0 -0
- {foxes-1.2.5.dist-info → foxes-1.4.dist-info}/top_level.txt +0 -0
docs/source/conf.py
CHANGED
|
@@ -22,7 +22,7 @@ from foxes import __version__
|
|
|
22
22
|
# -- Project information -----------------------------------------------------
|
|
23
23
|
|
|
24
24
|
project = "foxes"
|
|
25
|
-
copyright = "
|
|
25
|
+
copyright = "2025, Fraunhofer IWES"
|
|
26
26
|
author = "Fraunhofer IWES"
|
|
27
27
|
|
|
28
28
|
# The short X.Y version
|
|
@@ -67,9 +67,8 @@ intersphinx_mapping = {
|
|
|
67
67
|
# autosummary_generate = False
|
|
68
68
|
|
|
69
69
|
# The suffix(es) of source filenames.
|
|
70
|
-
# You can specify multiple suffix as a list of string:
|
|
71
70
|
#
|
|
72
|
-
source_suffix =
|
|
71
|
+
source_suffix = {'.rst': 'restructuredtext', '.md': 'restructuredtext'}
|
|
73
72
|
|
|
74
73
|
# The master toctree document.
|
|
75
74
|
master_doc = "index"
|
|
@@ -337,6 +336,7 @@ python_apigen_modules = {
|
|
|
337
336
|
"foxes.models.vertical_profiles": "_foxes/models/vertical_profiles/",
|
|
338
337
|
"foxes.models.axial_induction": "_foxes/models/axial_induction",
|
|
339
338
|
"foxes.models.ground_models": "_foxes/models/ground_models",
|
|
339
|
+
"foxes.models.wake_deflections": "_foxes/models/wake_deflections",
|
|
340
340
|
"foxes.models.wake_frames": "_foxes/models/wake_frames/",
|
|
341
341
|
"foxes.models.wake_models": "_foxes/models/wake_models/",
|
|
342
342
|
"foxes.models.wake_models.induction": "_foxes/models/wake_models/induction/",
|
examples/abl_states/run.py
CHANGED
|
@@ -154,7 +154,7 @@ if __name__ == "__main__":
|
|
|
154
154
|
# power results
|
|
155
155
|
P0 = o.calc_mean_farm_power(ambient=True)
|
|
156
156
|
P = o.calc_mean_farm_power()
|
|
157
|
-
print(f"\nFarm power : {P/1000:.1f} MW")
|
|
158
|
-
print(f"Farm ambient power: {P0/1000:.1f} MW")
|
|
157
|
+
print(f"\nFarm power : {P / 1000:.1f} MW")
|
|
158
|
+
print(f"Farm ambient power: {P0 / 1000:.1f} MW")
|
|
159
159
|
print(f"Farm efficiency : {o.calc_farm_efficiency():.2f}")
|
|
160
160
|
print(f"Annual farm yield : {turbine_results[FV.YLD].sum():.2f} GWh.")
|
examples/compare_wakes/run.py
CHANGED
|
@@ -7,7 +7,6 @@ import foxes.variables as FV
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
def calc(mbook, farm, states, wakes, points, args):
|
|
10
|
-
|
|
11
10
|
algo = foxes.algorithms.Downwind(
|
|
12
11
|
farm,
|
|
13
12
|
states,
|
|
@@ -232,7 +231,7 @@ if __name__ == "__main__":
|
|
|
232
231
|
ax.plot(xlist / D, results[0], label=wake)
|
|
233
232
|
ax.set_ylabel(args.var)
|
|
234
233
|
|
|
235
|
-
ax.set_title(
|
|
234
|
+
ax.set_title("y = 0")
|
|
236
235
|
ax.set_xlabel("x/D")
|
|
237
236
|
ax.legend(loc="best")
|
|
238
237
|
ax.grid()
|
examples/dyn_wakes/run.py
CHANGED
|
@@ -73,7 +73,6 @@ if __name__ == "__main__":
|
|
|
73
73
|
parser.add_argument(
|
|
74
74
|
"-p", "--pwakes", help="The partial wakes models", default=None, nargs="+"
|
|
75
75
|
)
|
|
76
|
-
parser.add_argument("-sc", "--scheduler", help="The scheduler choice", default=None)
|
|
77
76
|
parser.add_argument(
|
|
78
77
|
"-w",
|
|
79
78
|
"--wakes",
|
|
@@ -82,6 +81,16 @@ if __name__ == "__main__":
|
|
|
82
81
|
nargs="+",
|
|
83
82
|
)
|
|
84
83
|
parser.add_argument("-f", "--frame", help="The wake frame", default="dyn_wakes")
|
|
84
|
+
parser.add_argument(
|
|
85
|
+
"-d", "--deflection", help="The wake deflection", default="no_deflection"
|
|
86
|
+
)
|
|
87
|
+
parser.add_argument(
|
|
88
|
+
"-y",
|
|
89
|
+
"--yawm",
|
|
90
|
+
help="The uniform yaw misalignment value",
|
|
91
|
+
type=float,
|
|
92
|
+
default=None,
|
|
93
|
+
)
|
|
85
94
|
parser.add_argument(
|
|
86
95
|
"-m", "--tmodels", help="The turbine models", default=[], nargs="+"
|
|
87
96
|
)
|
|
@@ -121,6 +130,19 @@ if __name__ == "__main__":
|
|
|
121
130
|
max_length_km=8
|
|
122
131
|
)
|
|
123
132
|
|
|
133
|
+
# optionally set turbines in yaw:
|
|
134
|
+
N = int(args.n_turbines**0.5)
|
|
135
|
+
if args.yawm is None:
|
|
136
|
+
ymodels = []
|
|
137
|
+
else:
|
|
138
|
+
yawm = np.zeros((1, N * N), dtype=np.float64)
|
|
139
|
+
yawm[:, :N] = args.yawm
|
|
140
|
+
mbook.turbine_models["set_yawm"] = foxes.models.turbine_models.SetFarmVars(
|
|
141
|
+
pre_rotor=True
|
|
142
|
+
)
|
|
143
|
+
mbook.turbine_models["set_yawm"].add_var(FV.YAWM, yawm)
|
|
144
|
+
ymodels = ["set_yawm"]
|
|
145
|
+
|
|
124
146
|
if args.background0:
|
|
125
147
|
States = foxes.input.states.Timeseries
|
|
126
148
|
kwargs = {}
|
|
@@ -147,13 +169,12 @@ if __name__ == "__main__":
|
|
|
147
169
|
)
|
|
148
170
|
|
|
149
171
|
farm = foxes.WindFarm()
|
|
150
|
-
N = int(args.n_turbines**0.5)
|
|
151
172
|
foxes.input.farm_layout.add_grid(
|
|
152
173
|
farm,
|
|
153
174
|
xy_base=np.array([0.0, 0.0]),
|
|
154
175
|
step_vectors=np.array([[1000.0, 0], [0, 800.0]]),
|
|
155
176
|
steps=(N, N),
|
|
156
|
-
turbine_models=args.tmodels + [ttype.name],
|
|
177
|
+
turbine_models=ymodels + args.tmodels + [ttype.name],
|
|
157
178
|
)
|
|
158
179
|
|
|
159
180
|
if not args.nofig and args.show_layout:
|
|
@@ -175,6 +196,7 @@ if __name__ == "__main__":
|
|
|
175
196
|
rotor_model=args.rotor,
|
|
176
197
|
wake_models=args.wakes,
|
|
177
198
|
wake_frame=args.frame,
|
|
199
|
+
wake_deflection=args.deflection,
|
|
178
200
|
partial_wakes=args.pwakes,
|
|
179
201
|
mbook=mbook,
|
|
180
202
|
max_it=args.max_it,
|
|
@@ -221,9 +243,9 @@ if __name__ == "__main__":
|
|
|
221
243
|
# power results
|
|
222
244
|
P0 = o.calc_mean_farm_power(ambient=True)
|
|
223
245
|
P = o.calc_mean_farm_power()
|
|
224
|
-
print(f"\nFarm power : {P/1000:.1f} MW")
|
|
225
|
-
print(f"Farm ambient power: {P0/1000:.1f} MW")
|
|
226
|
-
print(f"Farm efficiency : {o.calc_farm_efficiency()*100:.2f} %")
|
|
246
|
+
print(f"\nFarm power : {P / 1000:.1f} MW")
|
|
247
|
+
print(f"Farm ambient power: {P0 / 1000:.1f} MW")
|
|
248
|
+
print(f"Farm efficiency : {o.calc_farm_efficiency() * 100:.2f} %")
|
|
227
249
|
|
|
228
250
|
engine.finalize()
|
|
229
251
|
|
|
@@ -262,6 +284,7 @@ if __name__ == "__main__":
|
|
|
262
284
|
title=None,
|
|
263
285
|
animated=True,
|
|
264
286
|
precalc=True,
|
|
287
|
+
rotor_color="red",
|
|
265
288
|
)
|
|
266
289
|
next(ofg)
|
|
267
290
|
|
examples/induction/run.py
CHANGED
|
@@ -147,9 +147,9 @@ if __name__ == "__main__":
|
|
|
147
147
|
# power results
|
|
148
148
|
P0 = o.calc_mean_farm_power(ambient=True)
|
|
149
149
|
P = o.calc_mean_farm_power()
|
|
150
|
-
print(f"\nFarm power : {P/1000:.1f} MW")
|
|
151
|
-
print(f"Farm ambient power: {P0/1000:.1f} MW")
|
|
152
|
-
print(f"Farm efficiency : {o.calc_farm_efficiency()*100:.2f} %")
|
|
150
|
+
print(f"\nFarm power : {P / 1000:.1f} MW")
|
|
151
|
+
print(f"Farm ambient power: {P0 / 1000:.1f} MW")
|
|
152
|
+
print(f"Farm efficiency : {o.calc_farm_efficiency() * 100:.2f} %")
|
|
153
153
|
print(f"Annual farm yield : {turbine_results[FV.YLD].sum():.2f} GWh.")
|
|
154
154
|
|
|
155
155
|
# horizontal flow plot
|
examples/multi_height/run.py
CHANGED
|
@@ -110,4 +110,4 @@ if __name__ == "__main__":
|
|
|
110
110
|
o = foxes.output.FarmResultsEval(farm_results)
|
|
111
111
|
P0 = o.calc_mean_farm_power(ambient=True)
|
|
112
112
|
P = o.calc_mean_farm_power()
|
|
113
|
-
print(f"\nFarm power: {P/1000:.1f} MW, Efficiency = {P/P0*100:.2f} %")
|
|
113
|
+
print(f"\nFarm power: {P / 1000:.1f} MW, Efficiency = {P / P0 * 100:.2f} %")
|
examples/power_mask/run.py
CHANGED
|
@@ -162,7 +162,7 @@ if __name__ == "__main__":
|
|
|
162
162
|
o = foxes.output.FarmResultsEval(farm_results)
|
|
163
163
|
P0 = o.calc_mean_farm_power(ambient=True)
|
|
164
164
|
P = o.calc_mean_farm_power()
|
|
165
|
-
print(f"\nFarm power: {P/1000:.1f} MW, Efficiency = {P/P0*100:.2f} %")
|
|
165
|
+
print(f"\nFarm power: {P / 1000:.1f} MW, Efficiency = {P / P0 * 100:.2f} %")
|
|
166
166
|
|
|
167
167
|
o1 = foxes.output.StateTurbineMap(farm_results)
|
|
168
168
|
|
|
@@ -180,7 +180,7 @@ if __name__ == "__main__":
|
|
|
180
180
|
o = foxes.output.FarmResultsEval(farm_results)
|
|
181
181
|
P0 = o.calc_mean_farm_power(ambient=True)
|
|
182
182
|
P = o.calc_mean_farm_power()
|
|
183
|
-
print(f"\nFarm power: {P/1000:.1f} MW, Efficiency = {P/P0*100:.2f} %")
|
|
183
|
+
print(f"\nFarm power: {P / 1000:.1f} MW, Efficiency = {P / P0 * 100:.2f} %")
|
|
184
184
|
|
|
185
185
|
if not args.nofig:
|
|
186
186
|
o0 = foxes.output.StateTurbineMap(farm_results)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import foxes
|
|
2
|
+
|
|
3
|
+
if __name__ == "__main__":
|
|
4
|
+
states = foxes.input.states.Timeseries(
|
|
5
|
+
"timeseries_3000.csv.gz", ["WS", "WD", "TI", "RHO"]
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
farm = foxes.WindFarm()
|
|
9
|
+
foxes.input.farm_layout.add_from_file(
|
|
10
|
+
farm, "test_farm_67.csv", turbine_models=["NREL5MW"]
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
algo = foxes.algorithms.Downwind(farm, states, ["Jensen_linear_k007"])
|
|
14
|
+
farm_results = algo.calc_farm()
|
|
15
|
+
|
|
16
|
+
print(farm_results)
|
|
@@ -99,7 +99,6 @@ if __name__ == "__main__":
|
|
|
99
99
|
chunk_size_states=args.chunksize_states,
|
|
100
100
|
chunk_size_points=args.chunksize_points,
|
|
101
101
|
):
|
|
102
|
-
|
|
103
102
|
if not args.nofig:
|
|
104
103
|
fig = plt.figure(figsize=(14.5, 7))
|
|
105
104
|
ax1 = fig.add_subplot(121)
|
|
@@ -204,7 +203,7 @@ if __name__ == "__main__":
|
|
|
204
203
|
# power results
|
|
205
204
|
P0 = o.calc_mean_farm_power(ambient=True)
|
|
206
205
|
P = o.calc_mean_farm_power()
|
|
207
|
-
print(f"\nFarm power : {P/1000:.1f} MW")
|
|
208
|
-
print(f"Farm ambient power: {P0/1000:.1f} MW")
|
|
209
|
-
print(f"Farm efficiency : {o.calc_farm_efficiency()*100:.2f} %")
|
|
206
|
+
print(f"\nFarm power : {P / 1000:.1f} MW")
|
|
207
|
+
print(f"Farm ambient power: {P0 / 1000:.1f} MW")
|
|
208
|
+
print(f"Farm efficiency : {o.calc_farm_efficiency() * 100:.2f} %")
|
|
210
209
|
print(f"Annual farm yield : {turbine_results[FV.YLD].sum():.2f} GWh")
|
examples/scan_row/run.py
CHANGED
|
@@ -161,9 +161,9 @@ if __name__ == "__main__":
|
|
|
161
161
|
# power results
|
|
162
162
|
P0 = o.calc_mean_farm_power(ambient=True)
|
|
163
163
|
P = o.calc_mean_farm_power()
|
|
164
|
-
print(f"\nFarm power : {P/1000:.1f} MW")
|
|
165
|
-
print(f"Farm ambient power: {P0/1000:.1f} MW")
|
|
166
|
-
print(f"Farm efficiency : {o.calc_farm_efficiency()*100:.2f} %")
|
|
164
|
+
print(f"\nFarm power : {P / 1000:.1f} MW")
|
|
165
|
+
print(f"Farm ambient power: {P0 / 1000:.1f} MW")
|
|
166
|
+
print(f"Farm efficiency : {o.calc_farm_efficiency() * 100:.2f} %")
|
|
167
167
|
print(f"Annual farm yield : {turbine_results[FV.YLD].sum():.2f} GWh.")
|
|
168
168
|
print()
|
|
169
169
|
|
examples/sequential/run.py
CHANGED
|
@@ -24,9 +24,7 @@ if __name__ == "__main__":
|
|
|
24
24
|
type=int,
|
|
25
25
|
default=4,
|
|
26
26
|
)
|
|
27
|
-
parser.add_argument(
|
|
28
|
-
"-d", "--debug", help="Switch on wake debugging", action="store_true"
|
|
29
|
-
)
|
|
27
|
+
parser.add_argument("--debug", help="Switch on wake debugging", action="store_true")
|
|
30
28
|
parser.add_argument(
|
|
31
29
|
"-S",
|
|
32
30
|
"--n_states",
|
|
@@ -83,6 +81,16 @@ if __name__ == "__main__":
|
|
|
83
81
|
type=float,
|
|
84
82
|
)
|
|
85
83
|
parser.add_argument("-e", "--engine", help="The engine", default="NumpyEngine")
|
|
84
|
+
parser.add_argument(
|
|
85
|
+
"-d", "--deflection", help="The wake deflection", default="no_deflection"
|
|
86
|
+
)
|
|
87
|
+
parser.add_argument(
|
|
88
|
+
"-y",
|
|
89
|
+
"--yawm",
|
|
90
|
+
help="The uniform yaw misalignment value",
|
|
91
|
+
type=float,
|
|
92
|
+
default=None,
|
|
93
|
+
)
|
|
86
94
|
parser.add_argument(
|
|
87
95
|
"-n", "--n_cpus", help="The number of cpus", default=None, type=int
|
|
88
96
|
)
|
|
@@ -109,21 +117,34 @@ if __name__ == "__main__":
|
|
|
109
117
|
ttype = foxes.models.turbine_types.PCtFile(args.turbine_file)
|
|
110
118
|
mbook.turbine_types[ttype.name] = ttype
|
|
111
119
|
|
|
120
|
+
# optionally set turbines in yaw:
|
|
121
|
+
N = 3
|
|
122
|
+
if args.yawm is None:
|
|
123
|
+
ymodels = []
|
|
124
|
+
else:
|
|
125
|
+
yawm = np.zeros((args.n_states, N * N), dtype=np.float64)
|
|
126
|
+
yawm[:, :N] = args.yawm
|
|
127
|
+
mbook.turbine_models["set_yawm"] = foxes.models.turbine_models.SetFarmVars(
|
|
128
|
+
pre_rotor=True
|
|
129
|
+
)
|
|
130
|
+
mbook.turbine_models["set_yawm"].add_var(FV.YAWM, yawm)
|
|
131
|
+
ymodels = ["set_yawm"]
|
|
132
|
+
|
|
112
133
|
states = foxes.input.states.Timeseries(
|
|
113
134
|
data_source="timeseries_3000.csv.gz",
|
|
114
135
|
output_vars=[FV.WS, FV.WD, FV.TI, FV.RHO],
|
|
115
|
-
|
|
136
|
+
# fixed_vars={FV.WD: 270},
|
|
137
|
+
var2col={FV.WD: "WD", FV.WS: "WS", FV.TI: "TI", FV.RHO: "RHO"},
|
|
116
138
|
states_sel=range(240, 240 + args.n_states),
|
|
117
139
|
)
|
|
118
140
|
|
|
119
141
|
farm = foxes.WindFarm()
|
|
120
|
-
N = 3
|
|
121
142
|
foxes.input.farm_layout.add_grid(
|
|
122
143
|
farm,
|
|
123
144
|
xy_base=np.array([0.0, 0.0]),
|
|
124
145
|
step_vectors=np.array([[1000.0, 0], [0, 800.0]]),
|
|
125
146
|
steps=(N, N),
|
|
126
|
-
turbine_models=args.tmodels + [ttype.name],
|
|
147
|
+
turbine_models=ymodels + args.tmodels + [ttype.name],
|
|
127
148
|
)
|
|
128
149
|
|
|
129
150
|
if not args.nofig and args.show_layout:
|
|
@@ -143,6 +164,7 @@ if __name__ == "__main__":
|
|
|
143
164
|
rotor_model=args.rotor,
|
|
144
165
|
wake_models=args.wakes,
|
|
145
166
|
wake_frame=args.frame,
|
|
167
|
+
wake_deflection=args.deflection,
|
|
146
168
|
partial_wakes=args.pwakes,
|
|
147
169
|
mbook=mbook,
|
|
148
170
|
verbosity=0,
|
|
@@ -157,14 +179,15 @@ if __name__ == "__main__":
|
|
|
157
179
|
levels=None,
|
|
158
180
|
quiver_pars=dict(scale=0.01),
|
|
159
181
|
quiver_n=307,
|
|
160
|
-
xmin=-
|
|
161
|
-
ymin=-
|
|
162
|
-
xmax=
|
|
163
|
-
ymax=
|
|
182
|
+
xmin=-1000,
|
|
183
|
+
ymin=-1000,
|
|
184
|
+
xmax=4000,
|
|
185
|
+
ymax=3000,
|
|
164
186
|
vmin=0,
|
|
165
187
|
vmax=args.max_variable,
|
|
166
188
|
title=None,
|
|
167
189
|
animated=True,
|
|
190
|
+
rotor_color="red",
|
|
168
191
|
)
|
|
169
192
|
algo.plugins.append(anigen)
|
|
170
193
|
|
examples/single_state/run.py
CHANGED
|
@@ -172,13 +172,12 @@ if __name__ == "__main__":
|
|
|
172
172
|
# power results
|
|
173
173
|
P0 = o.calc_mean_farm_power(ambient=True)
|
|
174
174
|
P = o.calc_mean_farm_power()
|
|
175
|
-
print(f"\nFarm power : {P/1000:.1f} MW")
|
|
176
|
-
print(f"Farm ambient power: {P0/1000:.1f} MW")
|
|
177
|
-
print(f"Farm efficiency : {o.calc_farm_efficiency()*100:.2f} %")
|
|
175
|
+
print(f"\nFarm power : {P / 1000:.1f} MW")
|
|
176
|
+
print(f"Farm ambient power: {P0 / 1000:.1f} MW")
|
|
177
|
+
print(f"Farm efficiency : {o.calc_farm_efficiency() * 100:.2f} %")
|
|
178
178
|
print(f"Annual farm yield : {turbine_results[FV.YLD].sum():.2f} GWh.")
|
|
179
179
|
|
|
180
180
|
if not args.nofig:
|
|
181
|
-
|
|
182
181
|
# horizontal flow plot
|
|
183
182
|
o = foxes.output.FlowPlots2D(algo, farm_results)
|
|
184
183
|
g = o.gen_states_fig_xy(
|
|
@@ -131,7 +131,7 @@ if __name__ == "__main__":
|
|
|
131
131
|
o = foxes.output.FarmResultsEval(farm_results)
|
|
132
132
|
P0 = o.calc_mean_farm_power(ambient=True)
|
|
133
133
|
P = o.calc_mean_farm_power()
|
|
134
|
-
print(f"\nFarm power : {P/1000:.1f} MW")
|
|
135
|
-
print(f"Farm ambient power: {P0/1000:.1f} MW")
|
|
136
|
-
print(f"Farm efficiency : {o.calc_farm_efficiency()*100:.2f} %")
|
|
134
|
+
print(f"\nFarm power : {P / 1000:.1f} MW")
|
|
135
|
+
print(f"Farm ambient power: {P0 / 1000:.1f} MW")
|
|
136
|
+
print(f"Farm efficiency : {o.calc_farm_efficiency() * 100:.2f} %")
|
|
137
137
|
print(f"Annual farm yield : {o.calc_farm_yield(algo=algo):.2f} GWh")
|
examples/streamline_wakes/run.py
CHANGED
|
@@ -25,7 +25,16 @@ if __name__ == "__main__":
|
|
|
25
25
|
parser.add_argument(
|
|
26
26
|
"-p", "--pwakes", help="The partial wakes models", default="centre", nargs="+"
|
|
27
27
|
)
|
|
28
|
-
parser.add_argument(
|
|
28
|
+
parser.add_argument(
|
|
29
|
+
"-d", "--deflection", help="The wake deflection", default="no_deflection"
|
|
30
|
+
)
|
|
31
|
+
parser.add_argument(
|
|
32
|
+
"-y",
|
|
33
|
+
"--yawm",
|
|
34
|
+
help="The uniform yaw misalignment value",
|
|
35
|
+
type=float,
|
|
36
|
+
default=None,
|
|
37
|
+
)
|
|
29
38
|
parser.add_argument(
|
|
30
39
|
"-w",
|
|
31
40
|
"--wakes",
|
|
@@ -45,7 +54,7 @@ if __name__ == "__main__":
|
|
|
45
54
|
parser.add_argument(
|
|
46
55
|
"-lm",
|
|
47
56
|
"--load_mode",
|
|
48
|
-
help="
|
|
57
|
+
help="Dataset load mode",
|
|
49
58
|
default="preload",
|
|
50
59
|
)
|
|
51
60
|
parser.add_argument("-e", "--engine", help="The engine", default="process")
|
|
@@ -75,6 +84,19 @@ if __name__ == "__main__":
|
|
|
75
84
|
ttype = foxes.models.turbine_types.PCtFile(args.turbine_file)
|
|
76
85
|
mbook.turbine_types[ttype.name] = ttype
|
|
77
86
|
|
|
87
|
+
# optionally set turbines in yaw:
|
|
88
|
+
N = int(args.n_turbines**0.5)
|
|
89
|
+
if args.yawm is None:
|
|
90
|
+
ymodels = []
|
|
91
|
+
else:
|
|
92
|
+
yawm = np.zeros((1, N * N), dtype=np.float64)
|
|
93
|
+
yawm[:, :N] = args.yawm
|
|
94
|
+
mbook.turbine_models["set_yawm"] = foxes.models.turbine_models.SetFarmVars(
|
|
95
|
+
pre_rotor=True
|
|
96
|
+
)
|
|
97
|
+
mbook.turbine_models["set_yawm"].add_var(FV.YAWM, yawm)
|
|
98
|
+
ymodels = ["set_yawm"]
|
|
99
|
+
|
|
78
100
|
states = foxes.input.states.FieldDataNC(
|
|
79
101
|
args.file_pattern,
|
|
80
102
|
states_coord="state",
|
|
@@ -90,13 +112,12 @@ if __name__ == "__main__":
|
|
|
90
112
|
)
|
|
91
113
|
|
|
92
114
|
farm = foxes.WindFarm()
|
|
93
|
-
N = int(args.n_turbines**0.5)
|
|
94
115
|
foxes.input.farm_layout.add_grid(
|
|
95
116
|
farm,
|
|
96
117
|
xy_base=np.array([500.0, 500.0]),
|
|
97
118
|
step_vectors=np.array([[500.0, 0], [0, 500.0]]),
|
|
98
119
|
steps=(N, N),
|
|
99
|
-
turbine_models=args.tmodels + [ttype.name],
|
|
120
|
+
turbine_models=ymodels + args.tmodels + [ttype.name],
|
|
100
121
|
)
|
|
101
122
|
|
|
102
123
|
algo = foxes.algorithms.Downwind(
|
|
@@ -105,6 +126,7 @@ if __name__ == "__main__":
|
|
|
105
126
|
rotor_model=args.rotor,
|
|
106
127
|
wake_models=args.wakes,
|
|
107
128
|
wake_frame=args.wake_frame,
|
|
129
|
+
wake_deflection=args.deflection,
|
|
108
130
|
partial_wakes=args.pwakes,
|
|
109
131
|
mbook=mbook,
|
|
110
132
|
engine=args.engine,
|
|
@@ -136,6 +158,7 @@ if __name__ == "__main__":
|
|
|
136
158
|
xmax=2500,
|
|
137
159
|
ymin=0,
|
|
138
160
|
ymax=2500,
|
|
161
|
+
rotor_color="red",
|
|
139
162
|
):
|
|
140
163
|
plt.show()
|
|
141
164
|
plt.close(fig)
|
examples/tab_file/run.py
CHANGED
|
@@ -131,9 +131,9 @@ if __name__ == "__main__":
|
|
|
131
131
|
o = foxes.output.FarmResultsEval(farm_results)
|
|
132
132
|
P0 = o.calc_mean_farm_power(ambient=True)
|
|
133
133
|
P = o.calc_mean_farm_power()
|
|
134
|
-
print(f"\nFarm power : {P/1000:.1f} MW")
|
|
135
|
-
print(f"Farm ambient power: {P0/1000:.1f} MW")
|
|
136
|
-
print(f"Farm efficiency : {o.calc_farm_efficiency()*100:.2f} %")
|
|
134
|
+
print(f"\nFarm power : {P / 1000:.1f} MW")
|
|
135
|
+
print(f"Farm ambient power: {P0 / 1000:.1f} MW")
|
|
136
|
+
print(f"Farm efficiency : {o.calc_farm_efficiency() * 100:.2f} %")
|
|
137
137
|
print(f"Annual farm yield : {o.calc_farm_yield(algo=algo):.2f} GWh")
|
|
138
138
|
|
|
139
139
|
if not args.nofig and args.calc_mean:
|
examples/timelines/run.py
CHANGED
|
@@ -66,7 +66,6 @@ if __name__ == "__main__":
|
|
|
66
66
|
parser.add_argument(
|
|
67
67
|
"-p", "--pwakes", help="The partial wakes models", default=None, nargs="+"
|
|
68
68
|
)
|
|
69
|
-
parser.add_argument("-sc", "--scheduler", help="The scheduler choice", default=None)
|
|
70
69
|
parser.add_argument(
|
|
71
70
|
"-w",
|
|
72
71
|
"--wakes",
|
|
@@ -75,6 +74,16 @@ if __name__ == "__main__":
|
|
|
75
74
|
nargs="+",
|
|
76
75
|
)
|
|
77
76
|
parser.add_argument("-f", "--frame", help="The wake frame", default="timelines")
|
|
77
|
+
parser.add_argument(
|
|
78
|
+
"-d", "--deflection", help="The wake deflection", default="no_deflection"
|
|
79
|
+
)
|
|
80
|
+
parser.add_argument(
|
|
81
|
+
"-y",
|
|
82
|
+
"--yawm",
|
|
83
|
+
help="The uniform yaw misalignment value",
|
|
84
|
+
type=float,
|
|
85
|
+
default=None,
|
|
86
|
+
)
|
|
78
87
|
parser.add_argument(
|
|
79
88
|
"-m", "--tmodels", help="The turbine models", default=[], nargs="+"
|
|
80
89
|
)
|
|
@@ -111,6 +120,19 @@ if __name__ == "__main__":
|
|
|
111
120
|
ttype = foxes.models.turbine_types.PCtFile(args.turbine_file)
|
|
112
121
|
mbook.turbine_types[ttype.name] = ttype
|
|
113
122
|
|
|
123
|
+
# optionally set turbines in yaw:
|
|
124
|
+
N = int(args.n_turbines**0.5)
|
|
125
|
+
if args.yawm is None:
|
|
126
|
+
ymodels = []
|
|
127
|
+
else:
|
|
128
|
+
yawm = np.zeros((1, N * N), dtype=np.float64)
|
|
129
|
+
yawm[:, :N] = args.yawm
|
|
130
|
+
mbook.turbine_models["set_yawm"] = foxes.models.turbine_models.SetFarmVars(
|
|
131
|
+
pre_rotor=True
|
|
132
|
+
)
|
|
133
|
+
mbook.turbine_models["set_yawm"].add_var(FV.YAWM, yawm)
|
|
134
|
+
ymodels = ["set_yawm"]
|
|
135
|
+
|
|
114
136
|
if not args.background:
|
|
115
137
|
States = foxes.input.states.Timeseries
|
|
116
138
|
kwargs = {}
|
|
@@ -134,7 +156,7 @@ if __name__ == "__main__":
|
|
|
134
156
|
xy_base=np.array([0.0, 0.0]),
|
|
135
157
|
step_vectors=np.array([[1000.0, 0], [0, 800.0]]),
|
|
136
158
|
steps=(N, N),
|
|
137
|
-
turbine_models=args.tmodels + [ttype.name],
|
|
159
|
+
turbine_models=ymodels + args.tmodels + [ttype.name],
|
|
138
160
|
)
|
|
139
161
|
|
|
140
162
|
if not args.nofig and args.show_layout:
|
|
@@ -148,6 +170,7 @@ if __name__ == "__main__":
|
|
|
148
170
|
rotor_model=args.rotor,
|
|
149
171
|
wake_models=args.wakes,
|
|
150
172
|
wake_frame=args.frame,
|
|
173
|
+
wake_deflection=args.deflection,
|
|
151
174
|
partial_wakes=args.pwakes,
|
|
152
175
|
mbook=mbook,
|
|
153
176
|
engine=args.engine,
|
|
@@ -196,9 +219,9 @@ if __name__ == "__main__":
|
|
|
196
219
|
# power results
|
|
197
220
|
P0 = o.calc_mean_farm_power(ambient=True)
|
|
198
221
|
P = o.calc_mean_farm_power()
|
|
199
|
-
print(f"\nFarm power : {P/1000:.1f} MW")
|
|
200
|
-
print(f"Farm ambient power: {P0/1000:.1f} MW")
|
|
201
|
-
print(f"Farm efficiency : {o.calc_farm_efficiency()*100:.2f} %")
|
|
222
|
+
print(f"\nFarm power : {P / 1000:.1f} MW")
|
|
223
|
+
print(f"Farm ambient power: {P0 / 1000:.1f} MW")
|
|
224
|
+
print(f"Farm efficiency : {o.calc_farm_efficiency() * 100:.2f} %")
|
|
202
225
|
|
|
203
226
|
if not args.nofig:
|
|
204
227
|
sts = np.arange(farm_results.sizes["state"])
|
|
@@ -232,6 +255,7 @@ if __name__ == "__main__":
|
|
|
232
255
|
ret_im=True,
|
|
233
256
|
title=None,
|
|
234
257
|
animated=True,
|
|
258
|
+
rotor_color="red",
|
|
235
259
|
)
|
|
236
260
|
)
|
|
237
261
|
anim.add_generator(
|
examples/timeseries/run.py
CHANGED
|
@@ -177,9 +177,9 @@ if __name__ == "__main__":
|
|
|
177
177
|
# power results
|
|
178
178
|
P0 = o.calc_mean_farm_power(ambient=True)
|
|
179
179
|
P = o.calc_mean_farm_power()
|
|
180
|
-
print(f"\nFarm power : {P/1000:.1f} MW")
|
|
181
|
-
print(f"Farm ambient power: {P0/1000:.1f} MW")
|
|
182
|
-
print(f"Farm efficiency : {o.calc_farm_efficiency()*100:.2f} %")
|
|
180
|
+
print(f"\nFarm power : {P / 1000:.1f} MW")
|
|
181
|
+
print(f"Farm ambient power: {P0 / 1000:.1f} MW")
|
|
182
|
+
print(f"Farm efficiency : {o.calc_farm_efficiency() * 100:.2f} %")
|
|
183
183
|
print(f"Annual farm yield : {turbine_results[FV.YLD].sum():.2f} GWh")
|
|
184
184
|
|
|
185
185
|
engine.finalize()
|
examples/timeseries_slurm/run.py
CHANGED
|
@@ -179,7 +179,7 @@ if __name__ == "__main__":
|
|
|
179
179
|
# power results
|
|
180
180
|
P0 = o.calc_mean_farm_power(ambient=True)
|
|
181
181
|
P = o.calc_mean_farm_power()
|
|
182
|
-
print(f"\nFarm power : {P/1000:.1f} MW")
|
|
183
|
-
print(f"Farm ambient power: {P0/1000:.1f} MW")
|
|
184
|
-
print(f"Farm efficiency : {o.calc_farm_efficiency()*100:.2f} %")
|
|
182
|
+
print(f"\nFarm power : {P / 1000:.1f} MW")
|
|
183
|
+
print(f"Farm ambient power: {P0 / 1000:.1f} MW")
|
|
184
|
+
print(f"Farm efficiency : {o.calc_farm_efficiency() * 100:.2f} %")
|
|
185
185
|
print(f"Annual farm yield : {turbine_results[FV.YLD].sum():.2f} GWh")
|
examples/wind_rose/run.py
CHANGED
|
@@ -130,9 +130,9 @@ if __name__ == "__main__":
|
|
|
130
130
|
o = foxes.output.FarmResultsEval(farm_results)
|
|
131
131
|
P0 = o.calc_mean_farm_power(ambient=True)
|
|
132
132
|
P = o.calc_mean_farm_power()
|
|
133
|
-
print(f"\nFarm power : {P/1000:.1f} MW")
|
|
134
|
-
print(f"Farm ambient power: {P0/1000:.1f} MW")
|
|
135
|
-
print(f"Farm efficiency : {o.calc_farm_efficiency()*100:.2f} %")
|
|
133
|
+
print(f"\nFarm power : {P / 1000:.1f} MW")
|
|
134
|
+
print(f"Farm ambient power: {P0 / 1000:.1f} MW")
|
|
135
|
+
print(f"Farm efficiency : {o.calc_farm_efficiency() * 100:.2f} %")
|
|
136
136
|
print(f"Annual farm yield : {o.calc_farm_yield(algo=algo):.2f} GWh")
|
|
137
137
|
|
|
138
138
|
if not args.nofig and args.calc_mean:
|
examples/yawed_wake/run.py
CHANGED
|
@@ -34,18 +34,24 @@ if __name__ == "__main__":
|
|
|
34
34
|
"-w",
|
|
35
35
|
"--wakes",
|
|
36
36
|
help="The wake models",
|
|
37
|
-
default=["
|
|
37
|
+
default=["TurbOPark_vector_ambka004", "CrespoHernandez_quadratic_ambka04"],
|
|
38
38
|
nargs="+",
|
|
39
39
|
)
|
|
40
|
+
parser.add_argument(
|
|
41
|
+
"-d", "--deflection", help="The wake deflection", default="Jimenez"
|
|
42
|
+
)
|
|
40
43
|
parser.add_argument("-r", "--rotor", help="The rotor model", default="centre")
|
|
41
44
|
parser.add_argument(
|
|
42
45
|
"-p", "--pwakes", help="The partial wakes models", default=None, nargs="+"
|
|
43
46
|
)
|
|
44
|
-
parser.add_argument("-f", "--frame", help="The wake frame", default="
|
|
47
|
+
parser.add_argument("-f", "--frame", help="The wake frame", default="rotor_wd")
|
|
45
48
|
parser.add_argument(
|
|
46
49
|
"-m", "--tmodels", help="The turbine models", default=[], nargs="+"
|
|
47
50
|
)
|
|
48
51
|
parser.add_argument("-v", "--var", help="The plot variable", default=FV.WS)
|
|
52
|
+
parser.add_argument(
|
|
53
|
+
"-it", "--iterative", help="Use iterative algorithm", action="store_true"
|
|
54
|
+
)
|
|
49
55
|
parser.add_argument("-e", "--engine", help="The engine", default="process")
|
|
50
56
|
parser.add_argument(
|
|
51
57
|
"-n", "--n_cpus", help="The number of cpus", default=None, type=int
|
|
@@ -96,12 +102,14 @@ if __name__ == "__main__":
|
|
|
96
102
|
)
|
|
97
103
|
|
|
98
104
|
# create algorithm
|
|
99
|
-
|
|
105
|
+
Algo = foxes.algorithms.Iterative if args.iterative else foxes.algorithms.Downwind
|
|
106
|
+
algo = Algo(
|
|
100
107
|
farm,
|
|
101
108
|
states=states,
|
|
102
109
|
rotor_model=args.rotor,
|
|
103
110
|
wake_models=args.wakes,
|
|
104
111
|
wake_frame=args.frame,
|
|
112
|
+
wake_deflection=args.deflection,
|
|
105
113
|
partial_wakes=args.pwakes,
|
|
106
114
|
mbook=mbook,
|
|
107
115
|
engine=args.engine,
|
|
@@ -119,7 +127,7 @@ if __name__ == "__main__":
|
|
|
119
127
|
print("\nHorizontal flow figure output:")
|
|
120
128
|
o = foxes.output.FlowPlots2D(algo, farm_results)
|
|
121
129
|
g = o.gen_states_fig_xy(
|
|
122
|
-
args.var, resolution=10, xmin=-
|
|
130
|
+
args.var, resolution=10, xmin=-500, xmax=3000, rotor_color="red"
|
|
123
131
|
)
|
|
124
132
|
fig = next(g)
|
|
125
133
|
plt.show()
|
|
@@ -130,7 +138,7 @@ if __name__ == "__main__":
|
|
|
130
138
|
o = foxes.output.FlowPlots2D(algo, farm_results)
|
|
131
139
|
g = o.gen_states_fig_yz(
|
|
132
140
|
args.var,
|
|
133
|
-
resolution=
|
|
141
|
+
resolution=5,
|
|
134
142
|
x=750,
|
|
135
143
|
ymin=-200,
|
|
136
144
|
ymax=200,
|
|
@@ -190,7 +198,7 @@ if __name__ == "__main__":
|
|
|
190
198
|
# power results
|
|
191
199
|
P0 = o.calc_mean_farm_power(ambient=True)
|
|
192
200
|
P = o.calc_mean_farm_power()
|
|
193
|
-
print(f"\nFarm power : {P/1000:.1f} MW")
|
|
194
|
-
print(f"Farm ambient power: {P0/1000:.1f} MW")
|
|
195
|
-
print(f"Farm efficiency : {o.calc_farm_efficiency()*100:.2f} %")
|
|
201
|
+
print(f"\nFarm power : {P / 1000:.1f} MW")
|
|
202
|
+
print(f"Farm ambient power: {P0 / 1000:.1f} MW")
|
|
203
|
+
print(f"Farm efficiency : {o.calc_farm_efficiency() * 100:.2f} %")
|
|
196
204
|
print(f"Annual farm yield : {turbine_results[FV.YLD].sum():.2f} GWh.")
|