foxes 1.5__py3-none-any.whl → 1.5.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.
- examples/abl_states/run.py +58 -56
- examples/dyn_wakes/run.py +110 -118
- examples/field_data_nc/run.py +22 -20
- examples/multi_height/run.py +8 -6
- examples/scan_row/run.py +89 -87
- examples/sector_management/run.py +40 -38
- examples/states_lookup_table/run.py +6 -4
- examples/streamline_wakes/run.py +8 -6
- examples/timelines/run.py +100 -98
- examples/timeseries/run.py +71 -76
- examples/wind_rose/run.py +27 -25
- examples/yawed_wake/run.py +82 -80
- foxes/core/algorithm.py +1 -0
- foxes/engines/pool.py +1 -0
- foxes/utils/xarray_utils.py +20 -12
- {foxes-1.5.dist-info → foxes-1.5.1.dist-info}/METADATA +1 -1
- {foxes-1.5.dist-info → foxes-1.5.1.dist-info}/RECORD +21 -21
- {foxes-1.5.dist-info → foxes-1.5.1.dist-info}/WHEEL +0 -0
- {foxes-1.5.dist-info → foxes-1.5.1.dist-info}/entry_points.txt +0 -0
- {foxes-1.5.dist-info → foxes-1.5.1.dist-info}/licenses/LICENSE +0 -0
- {foxes-1.5.dist-info → foxes-1.5.1.dist-info}/top_level.txt +0 -0
|
@@ -104,10 +104,6 @@ if __name__ == "__main__":
|
|
|
104
104
|
wake_frame="rotor_wd",
|
|
105
105
|
partial_wakes=args.pwakes,
|
|
106
106
|
mbook=mbook,
|
|
107
|
-
engine=args.engine,
|
|
108
|
-
n_procs=args.n_cpus,
|
|
109
|
-
chunk_size_states=args.chunksize_states,
|
|
110
|
-
chunk_size_points=args.chunksize_points,
|
|
111
107
|
)
|
|
112
108
|
|
|
113
109
|
outputs = [
|
|
@@ -124,43 +120,49 @@ if __name__ == "__main__":
|
|
|
124
120
|
FV.WEIGHT,
|
|
125
121
|
]
|
|
126
122
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
123
|
+
with foxes.Engine.new(
|
|
124
|
+
engine_type=args.engine,
|
|
125
|
+
n_procs=args.n_cpus,
|
|
126
|
+
chunk_size_states=args.chunksize_states,
|
|
127
|
+
chunk_size_points=args.chunksize_points,
|
|
128
|
+
):
|
|
129
|
+
time0 = time.time()
|
|
130
|
+
farm_results = algo.calc_farm(outputs=outputs)
|
|
131
|
+
time1 = time.time()
|
|
130
132
|
|
|
131
|
-
|
|
133
|
+
print("\nCalc time =", time1 - time0, "\n")
|
|
132
134
|
|
|
133
|
-
|
|
135
|
+
print(farm_results)
|
|
134
136
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
fr = farm_results.to_dataframe()
|
|
138
|
+
sel = fr[FV.MAX_P].dropna().index
|
|
139
|
+
fr = fr.loc[sel]
|
|
140
|
+
print(fr)
|
|
139
141
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
if not args.nofig:
|
|
143
|
+
fig = plt.figure(figsize=(12, 4))
|
|
144
|
+
ax1 = fig.add_subplot(121, polar=True)
|
|
145
|
+
ax2 = fig.add_subplot(122, polar=True)
|
|
144
146
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
147
|
+
o = foxes.output.RosePlotOutput(farm_results)
|
|
148
|
+
o.get_figure(
|
|
149
|
+
16,
|
|
150
|
+
FV.P,
|
|
151
|
+
[0, 100, 1000, 2000, 4000, 5001, 7000],
|
|
152
|
+
turbine=0,
|
|
153
|
+
title="Power turbine 0",
|
|
154
|
+
fig=fig,
|
|
155
|
+
ax=ax1,
|
|
156
|
+
)
|
|
155
157
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
158
|
+
o = foxes.output.RosePlotOutput(farm_results)
|
|
159
|
+
o.get_figure(
|
|
160
|
+
16,
|
|
161
|
+
FV.P,
|
|
162
|
+
[0, 100, 1000, 2000, 4000, 5001, 7000],
|
|
163
|
+
turbine=1,
|
|
164
|
+
title="Power turbine 1",
|
|
165
|
+
fig=fig,
|
|
166
|
+
ax=ax2,
|
|
167
|
+
)
|
|
168
|
+
plt.show()
|
|
@@ -117,13 +117,15 @@ if __name__ == "__main__":
|
|
|
117
117
|
wake_frame="rotor_wd",
|
|
118
118
|
partial_wakes=args.pwakes,
|
|
119
119
|
mbook=mbook,
|
|
120
|
-
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
with foxes.Engine.new(
|
|
123
|
+
engine_type=args.engine,
|
|
121
124
|
n_procs=args.n_cpus,
|
|
122
125
|
chunk_size_states=args.chunksize_states,
|
|
123
126
|
chunk_size_points=args.chunksize_points,
|
|
124
|
-
)
|
|
125
|
-
|
|
126
|
-
farm_results = algo.calc_farm()
|
|
127
|
+
):
|
|
128
|
+
farm_results = algo.calc_farm()
|
|
127
129
|
|
|
128
130
|
fr = farm_results.to_dataframe()
|
|
129
131
|
print(fr[[FV.WD, FV.H, FV.AMB_REWS, FV.REWS, FV.AMB_P, FV.P, FV.CT, FV.WEIGHT]])
|
examples/streamline_wakes/run.py
CHANGED
|
@@ -129,15 +129,17 @@ if __name__ == "__main__":
|
|
|
129
129
|
wake_deflection=args.deflection,
|
|
130
130
|
partial_wakes=args.pwakes,
|
|
131
131
|
mbook=mbook,
|
|
132
|
-
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
with foxes.Engine.new(
|
|
135
|
+
engine_type=args.engine,
|
|
133
136
|
n_procs=args.n_cpus,
|
|
134
137
|
chunk_size_states=args.chunksize_states,
|
|
135
138
|
chunk_size_points=args.chunksize_points,
|
|
136
|
-
)
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
time1 = time.time()
|
|
139
|
+
):
|
|
140
|
+
time0 = time.time()
|
|
141
|
+
farm_results = algo.calc_farm()
|
|
142
|
+
time1 = time.time()
|
|
141
143
|
|
|
142
144
|
print("\nCalc time =", time1 - time0, "\n")
|
|
143
145
|
|
examples/timelines/run.py
CHANGED
|
@@ -173,119 +173,121 @@ if __name__ == "__main__":
|
|
|
173
173
|
wake_deflection=args.deflection,
|
|
174
174
|
partial_wakes=args.pwakes,
|
|
175
175
|
mbook=mbook,
|
|
176
|
-
engine=args.engine,
|
|
177
|
-
n_procs=args.n_cpus,
|
|
178
|
-
chunk_size_states=args.chunksize_states,
|
|
179
|
-
chunk_size_points=args.chunksize_points,
|
|
180
176
|
verbosity=1,
|
|
181
177
|
)
|
|
182
178
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
179
|
+
with foxes.Engine.new(
|
|
180
|
+
engine_type=args.engine,
|
|
181
|
+
n_procs=args.n_cpus,
|
|
182
|
+
chunk_size_states=args.chunksize_states,
|
|
183
|
+
chunk_size_points=args.chunksize_points,
|
|
184
|
+
):
|
|
185
|
+
time0 = time.time()
|
|
186
|
+
farm_results = algo.calc_farm()
|
|
187
|
+
time1 = time.time()
|
|
186
188
|
|
|
187
|
-
|
|
189
|
+
print("\nCalc time =", time1 - time0, "\n")
|
|
188
190
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
191
|
+
o = foxes.output.FarmResultsEval(farm_results)
|
|
192
|
+
o.add_capacity(algo)
|
|
193
|
+
o.add_capacity(algo, ambient=True)
|
|
194
|
+
o.add_efficiency()
|
|
193
195
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
+
print("\nFarm results:\n")
|
|
197
|
+
print(farm_results)
|
|
196
198
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
199
|
+
# state-turbine results
|
|
200
|
+
farm_df = farm_results.to_dataframe()
|
|
201
|
+
print("\nFarm results data:\n")
|
|
202
|
+
print(
|
|
203
|
+
farm_df[
|
|
204
|
+
[
|
|
205
|
+
FV.X,
|
|
206
|
+
FV.Y,
|
|
207
|
+
FV.WD,
|
|
208
|
+
FV.AMB_REWS,
|
|
209
|
+
FV.REWS,
|
|
210
|
+
FV.AMB_TI,
|
|
211
|
+
FV.TI,
|
|
212
|
+
FV.AMB_P,
|
|
213
|
+
FV.P,
|
|
214
|
+
FV.EFF,
|
|
215
|
+
]
|
|
213
216
|
]
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
print(farm_df[[FV.AMB_REWS, FV.REWS, FV.CT, FV.EFF]].describe())
|
|
217
|
+
)
|
|
218
|
+
print()
|
|
219
|
+
print(farm_df[[FV.AMB_REWS, FV.REWS, FV.CT, FV.EFF]].describe())
|
|
218
220
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
221
|
+
# power results
|
|
222
|
+
P0 = o.calc_mean_farm_power(ambient=True)
|
|
223
|
+
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} %")
|
|
225
227
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
228
|
+
if not args.nofig:
|
|
229
|
+
sts = np.arange(farm_results.sizes["state"])
|
|
230
|
+
plt.plot(sts, farm_results.REWS[:, 4], label="Turbine 4")
|
|
231
|
+
plt.plot(sts, farm_results.REWS[:, 7], label="Turbine 7")
|
|
232
|
+
plt.legend()
|
|
233
|
+
plt.xlabel("State")
|
|
234
|
+
plt.ylabel("REWS [m/s]")
|
|
235
|
+
plt.show()
|
|
234
236
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
+
if not args.nofig and args.animation:
|
|
238
|
+
print("\nCalculating animation")
|
|
237
239
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
240
|
+
fig, axs = plt.subplots(
|
|
241
|
+
2, 1, figsize=(5.2, 7), gridspec_kw={"height_ratios": [3, 1]}
|
|
242
|
+
)
|
|
241
243
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
244
|
+
anim = foxes.output.Animator(fig)
|
|
245
|
+
of = foxes.output.FlowPlots2D(algo, farm_results)
|
|
246
|
+
anim.add_generator(
|
|
247
|
+
of.gen_states_fig_xy(
|
|
248
|
+
FV.WS,
|
|
249
|
+
resolution=30,
|
|
250
|
+
quiver_pars=dict(angles="xy", scale_units="xy", scale=0.013),
|
|
251
|
+
quiver_n=35,
|
|
252
|
+
xmax=5000,
|
|
253
|
+
ymax=5000,
|
|
254
|
+
vmin=0,
|
|
255
|
+
fig=fig,
|
|
256
|
+
ax=axs[0],
|
|
257
|
+
ret_im=True,
|
|
258
|
+
title=None,
|
|
259
|
+
animated=True,
|
|
260
|
+
rotor_color="red",
|
|
261
|
+
)
|
|
259
262
|
)
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
263
|
+
anim.add_generator(
|
|
264
|
+
o.gen_stdata(
|
|
265
|
+
turbines=[4, 7],
|
|
266
|
+
variable=FV.REWS,
|
|
267
|
+
fig=fig,
|
|
268
|
+
ax=axs[1],
|
|
269
|
+
ret_im=True,
|
|
270
|
+
legloc="upper left",
|
|
271
|
+
animated=True,
|
|
272
|
+
)
|
|
270
273
|
)
|
|
271
|
-
)
|
|
272
274
|
|
|
273
|
-
|
|
275
|
+
ani = anim.animate()
|
|
274
276
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
277
|
+
lo = foxes.output.FarmLayoutOutput(farm)
|
|
278
|
+
lo.get_figure(
|
|
279
|
+
fig=fig,
|
|
280
|
+
ax=axs[0],
|
|
281
|
+
title="",
|
|
282
|
+
annotate=1,
|
|
283
|
+
anno_delx=-120,
|
|
284
|
+
anno_dely=-60,
|
|
285
|
+
alpha=0,
|
|
286
|
+
)
|
|
285
287
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
288
|
+
fpath = Path(args.ani_file)
|
|
289
|
+
print("Writing file", fpath)
|
|
290
|
+
if fpath.suffix == ".gif":
|
|
291
|
+
ani.save(filename=fpath, writer="pillow", fps=args.fps)
|
|
292
|
+
else:
|
|
293
|
+
ani.save(filename=fpath, writer="ffmpeg", fps=args.fps)
|
examples/timeseries/run.py
CHANGED
|
@@ -99,15 +99,6 @@ if __name__ == "__main__":
|
|
|
99
99
|
plt.show()
|
|
100
100
|
plt.close(ax.get_figure())
|
|
101
101
|
|
|
102
|
-
engine = foxes.Engine.new(
|
|
103
|
-
args.engine,
|
|
104
|
-
n_procs=args.n_cpus,
|
|
105
|
-
chunk_size_states=args.chunksize_states,
|
|
106
|
-
chunk_size_points=args.chunksize_points,
|
|
107
|
-
verbosity=1,
|
|
108
|
-
)
|
|
109
|
-
engine.initialize()
|
|
110
|
-
|
|
111
102
|
Algo = foxes.algorithms.Iterative if args.iterative else foxes.algorithms.Downwind
|
|
112
103
|
algo = Algo(
|
|
113
104
|
farm,
|
|
@@ -120,71 +111,75 @@ if __name__ == "__main__":
|
|
|
120
111
|
verbosity=1,
|
|
121
112
|
)
|
|
122
113
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
114
|
+
with foxes.Engine.new(
|
|
115
|
+
engine_type=args.engine,
|
|
116
|
+
n_procs=args.n_cpus,
|
|
117
|
+
chunk_size_states=args.chunksize_states,
|
|
118
|
+
chunk_size_points=args.chunksize_points,
|
|
119
|
+
):
|
|
120
|
+
time0 = time.time()
|
|
121
|
+
farm_results = algo.calc_farm()
|
|
122
|
+
time1 = time.time()
|
|
123
|
+
|
|
124
|
+
print("\nFarm results:\n")
|
|
125
|
+
print(farm_results)
|
|
126
|
+
|
|
127
|
+
print("\nCalc time =", time1 - time0, "\n")
|
|
128
|
+
|
|
129
|
+
o = foxes.output.FarmResultsEval(farm_results)
|
|
130
|
+
o.add_capacity(algo)
|
|
131
|
+
o.add_capacity(algo, ambient=True)
|
|
132
|
+
o.add_efficiency()
|
|
133
|
+
|
|
134
|
+
print("\nFarm results:\n")
|
|
135
|
+
print(farm_results)
|
|
136
|
+
|
|
137
|
+
# state-turbine results
|
|
138
|
+
farm_df = farm_results.to_dataframe()
|
|
139
|
+
print("\nFarm results data:\n")
|
|
140
|
+
print(
|
|
141
|
+
farm_df[
|
|
142
|
+
[
|
|
143
|
+
FV.X,
|
|
144
|
+
FV.WD,
|
|
145
|
+
FV.AMB_REWS,
|
|
146
|
+
FV.REWS,
|
|
147
|
+
FV.AMB_TI,
|
|
148
|
+
FV.TI,
|
|
149
|
+
FV.AMB_P,
|
|
150
|
+
FV.P,
|
|
151
|
+
FV.EFF,
|
|
152
|
+
]
|
|
155
153
|
]
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
o = foxes.output.StateTurbineMap(farm_results)
|
|
189
|
-
ax = o.plot_map(FV.P, cmap="inferno", figsize=(6, 7))
|
|
190
|
-
plt.show()
|
|
154
|
+
)
|
|
155
|
+
print()
|
|
156
|
+
|
|
157
|
+
# results by turbine
|
|
158
|
+
turbine_results = o.reduce_states(
|
|
159
|
+
{
|
|
160
|
+
FV.AMB_P: "weights",
|
|
161
|
+
FV.P: "weights",
|
|
162
|
+
FV.AMB_CAP: "weights",
|
|
163
|
+
FV.CAP: "weights",
|
|
164
|
+
}
|
|
165
|
+
)
|
|
166
|
+
turbine_results[FV.AMB_YLD] = o.calc_turbine_yield(
|
|
167
|
+
algo=algo, annual=True, ambient=True
|
|
168
|
+
)
|
|
169
|
+
turbine_results[FV.YLD] = o.calc_turbine_yield(algo=algo, annual=True)
|
|
170
|
+
turbine_results[FV.EFF] = turbine_results[FV.P] / turbine_results[FV.AMB_P]
|
|
171
|
+
print("\nResults by turbine:\n")
|
|
172
|
+
print(turbine_results)
|
|
173
|
+
|
|
174
|
+
# power results
|
|
175
|
+
P0 = o.calc_mean_farm_power(ambient=True)
|
|
176
|
+
P = o.calc_mean_farm_power()
|
|
177
|
+
print(f"\nFarm power : {P / 1000:.1f} MW")
|
|
178
|
+
print(f"Farm ambient power: {P0 / 1000:.1f} MW")
|
|
179
|
+
print(f"Farm efficiency : {o.calc_farm_efficiency() * 100:.2f} %")
|
|
180
|
+
print(f"Annual farm yield : {turbine_results[FV.YLD].sum():.2f} GWh")
|
|
181
|
+
|
|
182
|
+
if not args.nofig:
|
|
183
|
+
o = foxes.output.StateTurbineMap(farm_results)
|
|
184
|
+
ax = o.plot_map(FV.P, cmap="inferno", figsize=(6, 7))
|
|
185
|
+
plt.show()
|
examples/wind_rose/run.py
CHANGED
|
@@ -105,37 +105,39 @@ if __name__ == "__main__":
|
|
|
105
105
|
wake_frame="rotor_wd",
|
|
106
106
|
partial_wakes=args.pwakes,
|
|
107
107
|
mbook=mbook,
|
|
108
|
-
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
with foxes.Engine.new(
|
|
111
|
+
engine_type=args.engine,
|
|
109
112
|
n_procs=args.n_cpus,
|
|
110
113
|
chunk_size_states=args.chunksize_states,
|
|
111
114
|
chunk_size_points=args.chunksize_points,
|
|
112
|
-
)
|
|
115
|
+
):
|
|
116
|
+
if not args.nofig:
|
|
117
|
+
o = foxes.output.StatesRosePlotOutput(states, point=[0.0, 0.0, 100.0])
|
|
118
|
+
o.get_figure(16, FV.AMB_WS, [0, 3.5, 6, 10, 15, 20], add_inf=True)
|
|
119
|
+
plt.show()
|
|
113
120
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
plt.show()
|
|
118
|
-
|
|
119
|
-
time0 = time.time()
|
|
120
|
-
farm_results = algo.calc_farm()
|
|
121
|
-
time1 = time.time()
|
|
121
|
+
time0 = time.time()
|
|
122
|
+
farm_results = algo.calc_farm()
|
|
123
|
+
time1 = time.time()
|
|
122
124
|
|
|
123
|
-
|
|
125
|
+
print("\nCalc time =", time1 - time0, "\n")
|
|
124
126
|
|
|
125
|
-
|
|
127
|
+
print(farm_results)
|
|
126
128
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
+
fr = farm_results.to_dataframe()
|
|
130
|
+
print(fr[[FV.WD, FV.H, FV.AMB_REWS, FV.REWS, FV.AMB_P, FV.P, FV.WEIGHT]])
|
|
129
131
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
132
|
+
o = foxes.output.FarmResultsEval(farm_results)
|
|
133
|
+
P0 = o.calc_mean_farm_power(ambient=True)
|
|
134
|
+
P = o.calc_mean_farm_power()
|
|
135
|
+
print(f"\nFarm power : {P / 1000:.1f} MW")
|
|
136
|
+
print(f"Farm ambient power: {P0 / 1000:.1f} MW")
|
|
137
|
+
print(f"Farm efficiency : {o.calc_farm_efficiency() * 100:.2f} %")
|
|
138
|
+
print(f"Annual farm yield : {o.calc_farm_yield(algo=algo):.2f} GWh")
|
|
137
139
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
if not args.nofig and args.calc_mean:
|
|
141
|
+
o = foxes.output.FlowPlots2D(algo, farm_results)
|
|
142
|
+
fig = o.get_mean_fig_xy(FV.WS, resolution=30)
|
|
143
|
+
plt.show()
|