foxes 0.8.2__py3-none-any.whl → 1.1.0.2__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 +353 -0
- examples/abl_states/run.py +160 -0
- examples/compare_rotors_pwakes/run.py +217 -0
- examples/compare_wakes/run.py +241 -0
- examples/dyn_wakes/run.py +311 -0
- examples/field_data_nc/run.py +121 -0
- examples/induction/run.py +201 -0
- examples/multi_height/run.py +113 -0
- examples/power_mask/run.py +249 -0
- examples/random_timeseries/run.py +210 -0
- examples/scan_row/run.py +193 -0
- examples/sector_management/run.py +162 -0
- examples/sequential/run.py +209 -0
- examples/single_state/run.py +201 -0
- examples/states_lookup_table/run.py +137 -0
- examples/streamline_wakes/run.py +138 -0
- examples/tab_file/run.py +142 -0
- examples/timelines/run.py +267 -0
- examples/timeseries/run.py +190 -0
- examples/timeseries_slurm/run.py +185 -0
- examples/wind_rose/run.py +141 -0
- examples/windio/run.py +29 -0
- examples/yawed_wake/run.py +196 -0
- foxes/__init__.py +4 -8
- foxes/algorithms/__init__.py +1 -1
- foxes/algorithms/downwind/downwind.py +247 -111
- foxes/algorithms/downwind/models/farm_wakes_calc.py +12 -7
- foxes/algorithms/downwind/models/init_farm_data.py +2 -2
- foxes/algorithms/downwind/models/point_wakes_calc.py +6 -7
- foxes/algorithms/downwind/models/reorder_farm_output.py +1 -2
- foxes/algorithms/downwind/models/set_amb_farm_results.py +1 -1
- foxes/algorithms/downwind/models/set_amb_point_results.py +5 -3
- foxes/algorithms/iterative/iterative.py +74 -34
- foxes/algorithms/iterative/models/farm_wakes_calc.py +12 -7
- foxes/algorithms/iterative/models/urelax.py +3 -3
- foxes/algorithms/sequential/models/plugin.py +5 -5
- foxes/algorithms/sequential/models/seq_state.py +1 -1
- foxes/algorithms/sequential/sequential.py +126 -255
- foxes/constants.py +22 -7
- foxes/core/__init__.py +1 -0
- foxes/core/algorithm.py +632 -147
- foxes/core/data.py +252 -20
- foxes/core/data_calc_model.py +15 -291
- foxes/core/engine.py +640 -0
- foxes/core/farm_controller.py +38 -10
- foxes/core/farm_data_model.py +16 -1
- foxes/core/ground_model.py +2 -2
- foxes/core/model.py +249 -182
- foxes/core/partial_wakes_model.py +1 -1
- foxes/core/point_data_model.py +17 -2
- foxes/core/rotor_model.py +27 -21
- foxes/core/states.py +17 -1
- foxes/core/turbine_type.py +28 -0
- foxes/core/wake_frame.py +30 -34
- foxes/core/wake_model.py +5 -5
- foxes/core/wake_superposition.py +1 -1
- foxes/data/windio/windio_5turbines_timeseries.yaml +31 -15
- foxes/engines/__init__.py +17 -0
- foxes/engines/dask.py +982 -0
- foxes/engines/default.py +75 -0
- foxes/engines/futures.py +72 -0
- foxes/engines/mpi.py +38 -0
- foxes/engines/multiprocess.py +71 -0
- foxes/engines/numpy.py +167 -0
- foxes/engines/pool.py +249 -0
- foxes/engines/ray.py +79 -0
- foxes/engines/single.py +141 -0
- foxes/input/farm_layout/__init__.py +1 -0
- foxes/input/farm_layout/from_csv.py +4 -0
- foxes/input/farm_layout/from_json.py +2 -2
- foxes/input/farm_layout/grid.py +2 -2
- foxes/input/farm_layout/ring.py +65 -0
- foxes/input/farm_layout/row.py +2 -2
- foxes/input/states/__init__.py +7 -0
- foxes/input/states/create/random_abl_states.py +1 -1
- foxes/input/states/field_data_nc.py +158 -33
- foxes/input/states/multi_height.py +128 -14
- foxes/input/states/one_point_flow.py +577 -0
- foxes/input/states/scan_ws.py +74 -3
- foxes/input/states/single.py +1 -1
- foxes/input/states/slice_data_nc.py +681 -0
- foxes/input/states/states_table.py +204 -35
- foxes/input/windio/__init__.py +2 -2
- foxes/input/windio/get_states.py +44 -23
- foxes/input/windio/read_attributes.py +48 -17
- foxes/input/windio/read_farm.py +116 -102
- foxes/input/windio/read_fields.py +16 -6
- foxes/input/windio/read_outputs.py +71 -24
- foxes/input/windio/runner.py +31 -17
- foxes/input/windio/windio.py +41 -23
- foxes/models/farm_models/turbine2farm.py +1 -1
- foxes/models/ground_models/wake_mirror.py +10 -6
- foxes/models/model_book.py +58 -20
- foxes/models/partial_wakes/axiwake.py +3 -3
- foxes/models/partial_wakes/rotor_points.py +3 -3
- foxes/models/partial_wakes/top_hat.py +2 -2
- foxes/models/point_models/set_uniform_data.py +1 -1
- foxes/models/point_models/tke2ti.py +1 -1
- foxes/models/point_models/wake_deltas.py +1 -1
- foxes/models/rotor_models/centre.py +4 -0
- foxes/models/rotor_models/grid.py +24 -25
- foxes/models/rotor_models/levels.py +4 -5
- foxes/models/turbine_models/calculator.py +4 -6
- foxes/models/turbine_models/kTI_model.py +22 -6
- foxes/models/turbine_models/lookup_table.py +30 -4
- foxes/models/turbine_models/rotor_centre_calc.py +4 -3
- foxes/models/turbine_models/set_farm_vars.py +103 -34
- foxes/models/turbine_types/PCt_file.py +27 -3
- foxes/models/turbine_types/PCt_from_two.py +27 -3
- foxes/models/turbine_types/TBL_file.py +80 -0
- foxes/models/turbine_types/__init__.py +2 -0
- foxes/models/turbine_types/lookup.py +316 -0
- foxes/models/turbine_types/null_type.py +51 -1
- foxes/models/turbine_types/wsrho2PCt_from_two.py +29 -5
- foxes/models/turbine_types/wsti2PCt_from_two.py +31 -7
- foxes/models/vertical_profiles/__init__.py +1 -1
- foxes/models/vertical_profiles/data_profile.py +1 -1
- foxes/models/wake_frames/__init__.py +1 -0
- foxes/models/wake_frames/dynamic_wakes.py +424 -0
- foxes/models/wake_frames/farm_order.py +25 -5
- foxes/models/wake_frames/rotor_wd.py +6 -4
- foxes/models/wake_frames/seq_dynamic_wakes.py +61 -74
- foxes/models/wake_frames/streamlines.py +21 -22
- foxes/models/wake_frames/timelines.py +330 -129
- foxes/models/wake_frames/yawed_wakes.py +7 -4
- foxes/models/wake_models/dist_sliced.py +2 -4
- foxes/models/wake_models/induction/rankine_half_body.py +5 -5
- foxes/models/wake_models/induction/rathmann.py +78 -24
- foxes/models/wake_models/induction/self_similar.py +78 -28
- foxes/models/wake_models/induction/vortex_sheet.py +86 -48
- foxes/models/wake_models/ti/crespo_hernandez.py +6 -4
- foxes/models/wake_models/ti/iec_ti.py +40 -21
- foxes/models/wake_models/top_hat.py +1 -1
- foxes/models/wake_models/wind/bastankhah14.py +8 -6
- foxes/models/wake_models/wind/bastankhah16.py +17 -16
- foxes/models/wake_models/wind/jensen.py +4 -3
- foxes/models/wake_models/wind/turbopark.py +16 -13
- foxes/models/wake_superpositions/ti_linear.py +1 -1
- foxes/models/wake_superpositions/ti_max.py +1 -1
- foxes/models/wake_superpositions/ti_pow.py +1 -1
- foxes/models/wake_superpositions/ti_quadratic.py +1 -1
- foxes/models/wake_superpositions/ws_linear.py +8 -7
- foxes/models/wake_superpositions/ws_max.py +8 -7
- foxes/models/wake_superpositions/ws_pow.py +8 -7
- foxes/models/wake_superpositions/ws_product.py +5 -5
- foxes/models/wake_superpositions/ws_quadratic.py +8 -7
- foxes/output/__init__.py +4 -1
- foxes/output/farm_layout.py +16 -12
- foxes/output/farm_results_eval.py +1 -1
- foxes/output/flow_plots_2d/__init__.py +0 -1
- foxes/output/flow_plots_2d/flow_plots.py +70 -30
- foxes/output/grids.py +92 -22
- foxes/output/results_writer.py +2 -2
- foxes/output/rose_plot.py +3 -3
- foxes/output/seq_plugins/__init__.py +2 -0
- foxes/output/{flow_plots_2d → seq_plugins}/seq_flow_ani_plugin.py +64 -22
- foxes/output/seq_plugins/seq_wake_debug_plugin.py +145 -0
- foxes/output/slice_data.py +131 -111
- foxes/output/state_turbine_map.py +19 -14
- foxes/output/state_turbine_table.py +19 -19
- foxes/utils/__init__.py +1 -1
- foxes/utils/abl/neutral.py +2 -2
- foxes/utils/abl/stable.py +2 -2
- foxes/utils/abl/unstable.py +2 -2
- foxes/utils/data_book.py +1 -1
- foxes/utils/dev_utils.py +42 -0
- foxes/utils/dict.py +24 -1
- foxes/utils/exec_python.py +1 -1
- foxes/utils/factory.py +176 -53
- foxes/utils/geom2d/circle.py +1 -1
- foxes/utils/geom2d/polygon.py +1 -1
- foxes/utils/geopandas_utils.py +2 -2
- foxes/utils/load.py +2 -2
- foxes/utils/pandas_helpers.py +3 -2
- foxes/utils/wind_dir.py +0 -2
- foxes/utils/xarray_utils.py +24 -14
- foxes/variables.py +39 -2
- {foxes-0.8.2.dist-info → foxes-1.1.0.2.dist-info}/METADATA +75 -33
- foxes-1.1.0.2.dist-info/RECORD +309 -0
- {foxes-0.8.2.dist-info → foxes-1.1.0.2.dist-info}/WHEEL +1 -1
- foxes-1.1.0.2.dist-info/top_level.txt +4 -0
- tests/0_consistency/iterative/test_iterative.py +92 -0
- tests/0_consistency/partial_wakes/test_partial_wakes.py +90 -0
- tests/1_verification/flappy_0_6/PCt_files/flappy/run.py +85 -0
- tests/1_verification/flappy_0_6/PCt_files/test_PCt_files.py +103 -0
- tests/1_verification/flappy_0_6/abl_states/flappy/run.py +85 -0
- tests/1_verification/flappy_0_6/abl_states/test_abl_states.py +87 -0
- tests/1_verification/flappy_0_6/partial_top_hat/flappy/run.py +82 -0
- tests/1_verification/flappy_0_6/partial_top_hat/test_partial_top_hat.py +82 -0
- tests/1_verification/flappy_0_6/row_Jensen_linear_centre/flappy/run.py +92 -0
- tests/1_verification/flappy_0_6/row_Jensen_linear_centre/test_row_Jensen_linear_centre.py +93 -0
- tests/1_verification/flappy_0_6/row_Jensen_linear_tophat/flappy/run.py +92 -0
- tests/1_verification/flappy_0_6/row_Jensen_linear_tophat/test_row_Jensen_linear_tophat.py +96 -0
- tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2005/flappy/run.py +94 -0
- tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2005/test_row_Jensen_linear_tophat_IECTI_2005.py +122 -0
- tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2019/flappy/run.py +94 -0
- tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2019/test_row_Jensen_linear_tophat_IECTI_2019.py +122 -0
- tests/1_verification/flappy_0_6/row_Jensen_quadratic_centre/flappy/run.py +92 -0
- tests/1_verification/flappy_0_6/row_Jensen_quadratic_centre/test_row_Jensen_quadratic_centre.py +93 -0
- tests/1_verification/flappy_0_6_2/grid_rotors/flappy/run.py +85 -0
- tests/1_verification/flappy_0_6_2/grid_rotors/test_grid_rotors.py +130 -0
- tests/1_verification/flappy_0_6_2/row_Bastankhah_Crespo/flappy/run.py +96 -0
- tests/1_verification/flappy_0_6_2/row_Bastankhah_Crespo/test_row_Bastankhah_Crespo.py +116 -0
- tests/1_verification/flappy_0_6_2/row_Bastankhah_linear_centre/flappy/run.py +93 -0
- tests/1_verification/flappy_0_6_2/row_Bastankhah_linear_centre/test_row_Bastankhah_linear_centre.py +99 -0
- tests/3_examples/test_examples.py +34 -0
- foxes/VERSION +0 -1
- foxes/output/flow_plots_2d.py +0 -0
- foxes/utils/geopandas_helpers.py +0 -294
- foxes/utils/runners/__init__.py +0 -1
- foxes/utils/runners/runners.py +0 -280
- foxes-0.8.2.dist-info/RECORD +0 -247
- foxes-0.8.2.dist-info/top_level.txt +0 -1
- foxes-0.8.2.dist-info/zip-safe +0 -1
- {foxes-0.8.2.dist-info → foxes-1.1.0.2.dist-info}/LICENSE +0 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
import time
|
|
3
|
+
import argparse
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
import flappy as fl
|
|
7
|
+
from flappy.config.variables import variables as FV
|
|
8
|
+
|
|
9
|
+
if __name__ == "__main__":
|
|
10
|
+
parser = argparse.ArgumentParser()
|
|
11
|
+
parser.add_argument(
|
|
12
|
+
"-c", "--chunksize", help="The maximal chunk size", type=int, default=500
|
|
13
|
+
)
|
|
14
|
+
parser.add_argument(
|
|
15
|
+
"-o", "--ofile", help="The output file name", default="results.csv.gz"
|
|
16
|
+
)
|
|
17
|
+
parser.add_argument(
|
|
18
|
+
"--n_cpus", help="The number of processors", type=int, default=4
|
|
19
|
+
)
|
|
20
|
+
args = parser.parse_args()
|
|
21
|
+
|
|
22
|
+
n_s = 30
|
|
23
|
+
n_t = 52
|
|
24
|
+
c = args.chunksize
|
|
25
|
+
p0 = np.array([0.0, 0.0])
|
|
26
|
+
stp = np.array([601.0, 15.0])
|
|
27
|
+
tfile = "../NREL-5MW-D126-H90.csv"
|
|
28
|
+
ofile = Path(args.ofile)
|
|
29
|
+
|
|
30
|
+
# init flappy:
|
|
31
|
+
fl.init_flappy(n_cpus=args.n_cpus)
|
|
32
|
+
|
|
33
|
+
# load model book:
|
|
34
|
+
mbook = fl.ModelBook(ct_power_curve_file=tfile)
|
|
35
|
+
|
|
36
|
+
# create wind farm:
|
|
37
|
+
farm = fl.WindFarm()
|
|
38
|
+
fl.input.add_turbine_row(
|
|
39
|
+
farm,
|
|
40
|
+
rotor_diameter=126.0,
|
|
41
|
+
hub_height=90.0,
|
|
42
|
+
rotor_model="centre",
|
|
43
|
+
wake_models=["Jensen007", "IEC_TI_2019_rotor"],
|
|
44
|
+
turbine_models=["ct_P_curves"],
|
|
45
|
+
base_point=p0,
|
|
46
|
+
step_vector=stp,
|
|
47
|
+
steps=n_t - 1,
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
# create states:
|
|
51
|
+
ws0 = 6.0
|
|
52
|
+
ws1 = 16.0
|
|
53
|
+
states = fl.input.AFSScan(
|
|
54
|
+
ws_min=ws0,
|
|
55
|
+
ws_delta=(ws1 - ws0) / (n_s - 1),
|
|
56
|
+
ws_n_bins=n_s,
|
|
57
|
+
func_pdf_ws=None,
|
|
58
|
+
wd_min=270.0,
|
|
59
|
+
wd_delta=1.0,
|
|
60
|
+
wd_n_bins=1,
|
|
61
|
+
func_pdf_wd=None,
|
|
62
|
+
ti_min=0.08,
|
|
63
|
+
ti_delta=0.01,
|
|
64
|
+
ti_n_bins=1,
|
|
65
|
+
func_pdf_ti=None,
|
|
66
|
+
rho_min=1.225,
|
|
67
|
+
rho_delta=0.001,
|
|
68
|
+
rho_n_bins=1,
|
|
69
|
+
func_pdf_rho=None,
|
|
70
|
+
max_chunk_size=c,
|
|
71
|
+
)
|
|
72
|
+
states.initialize()
|
|
73
|
+
|
|
74
|
+
time0 = time.time()
|
|
75
|
+
|
|
76
|
+
# run calculation:
|
|
77
|
+
results = farm.calculate(mbook, states, wake_superp=["wind_linear", "ti_max"])
|
|
78
|
+
|
|
79
|
+
time1 = time.time()
|
|
80
|
+
print("\nCalc time =", time1 - time0, "\n")
|
|
81
|
+
|
|
82
|
+
df = results.state_turbine_results[
|
|
83
|
+
[FV.WD, FV.AMB_WS, FV.WS, FV.AMB_P, FV.P, FV.AMB_TI, FV.TI, FV.AMB_CT, FV.CT]
|
|
84
|
+
]
|
|
85
|
+
|
|
86
|
+
print()
|
|
87
|
+
print("TRESULTS\n")
|
|
88
|
+
print(df)
|
|
89
|
+
|
|
90
|
+
print("\nWriting file", ofile)
|
|
91
|
+
df.to_csv(ofile)
|
|
92
|
+
|
|
93
|
+
# close flappy:
|
|
94
|
+
fl.shutdown_flappy()
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
import pandas as pd
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
import inspect
|
|
5
|
+
|
|
6
|
+
import foxes
|
|
7
|
+
import foxes.variables as FV
|
|
8
|
+
import foxes.constants as FC
|
|
9
|
+
|
|
10
|
+
thisdir = Path(inspect.getfile(inspect.currentframe())).parent
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def test():
|
|
14
|
+
n_s = 30
|
|
15
|
+
n_t = 52
|
|
16
|
+
wd = 270.0
|
|
17
|
+
ti = 0.08
|
|
18
|
+
rotor = "centre"
|
|
19
|
+
c = 100
|
|
20
|
+
p0 = np.array([0.0, 0.0])
|
|
21
|
+
stp = np.array([601.0, 15.0])
|
|
22
|
+
cfile = thisdir / "flappy" / "results.csv.gz"
|
|
23
|
+
tfile = thisdir / "NREL-5MW-D126-H90.csv"
|
|
24
|
+
|
|
25
|
+
ck = {FC.STATE: c}
|
|
26
|
+
|
|
27
|
+
mbook = foxes.models.ModelBook()
|
|
28
|
+
ttype = foxes.models.turbine_types.PCtFile(
|
|
29
|
+
data_source=tfile, var_ws_ct=FV.REWS, var_ws_P=FV.REWS
|
|
30
|
+
)
|
|
31
|
+
mbook.turbine_types[ttype.name] = ttype
|
|
32
|
+
|
|
33
|
+
states = foxes.input.states.ScanWS(
|
|
34
|
+
ws_list=np.linspace(6.0, 16.0, n_s), wd=wd, ti=ti, rho=1.225
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
farm = foxes.WindFarm()
|
|
38
|
+
foxes.input.farm_layout.add_row(
|
|
39
|
+
farm=farm,
|
|
40
|
+
xy_base=p0,
|
|
41
|
+
xy_step=stp,
|
|
42
|
+
n_turbines=n_t,
|
|
43
|
+
turbine_models=[ttype.name],
|
|
44
|
+
verbosity=1,
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
algo = foxes.algorithms.Downwind(
|
|
48
|
+
farm,
|
|
49
|
+
states,
|
|
50
|
+
mbook=mbook,
|
|
51
|
+
rotor_model=rotor,
|
|
52
|
+
wake_models=["Jensen_linear_k007", "IECTI2019_max"],
|
|
53
|
+
wake_frame="rotor_wd",
|
|
54
|
+
partial_wakes=["top_hat", "top_hat"],
|
|
55
|
+
chunks=ck,
|
|
56
|
+
verbosity=1,
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
data = algo.calc_farm()
|
|
60
|
+
|
|
61
|
+
df = data.to_dataframe()[
|
|
62
|
+
[
|
|
63
|
+
FV.X,
|
|
64
|
+
FV.Y,
|
|
65
|
+
FV.WD,
|
|
66
|
+
FV.AMB_REWS,
|
|
67
|
+
FV.REWS,
|
|
68
|
+
FV.AMB_TI,
|
|
69
|
+
FV.TI,
|
|
70
|
+
FV.AMB_CT,
|
|
71
|
+
FV.CT,
|
|
72
|
+
]
|
|
73
|
+
]
|
|
74
|
+
|
|
75
|
+
print("\nReading file", cfile)
|
|
76
|
+
fdata = pd.read_csv(cfile).set_index(["state", "turbine"])
|
|
77
|
+
|
|
78
|
+
print()
|
|
79
|
+
print("TRESULTS\n")
|
|
80
|
+
"""sel = (df[FV.P] > 0) & (fdata[FV.P] > 0)
|
|
81
|
+
df = df.loc[sel]
|
|
82
|
+
fdata = fdata.loc[sel]"""
|
|
83
|
+
print(df)
|
|
84
|
+
print(fdata)
|
|
85
|
+
|
|
86
|
+
print("\nVERIFYING\n")
|
|
87
|
+
df[FV.WS] = df["REWS"]
|
|
88
|
+
df[FV.AMB_WS] = df["AMB_REWS"]
|
|
89
|
+
|
|
90
|
+
delta = df - fdata
|
|
91
|
+
print(delta)
|
|
92
|
+
|
|
93
|
+
chk = delta.abs()
|
|
94
|
+
print(chk.max())
|
|
95
|
+
|
|
96
|
+
var = FV.WS
|
|
97
|
+
print(f"\nCHECKING {var}")
|
|
98
|
+
sel = chk[var] >= 3e-3
|
|
99
|
+
print(df.loc[sel])
|
|
100
|
+
print(fdata.loc[sel])
|
|
101
|
+
print(chk.loc[sel])
|
|
102
|
+
assert (chk[var] < 3e-3).all()
|
|
103
|
+
|
|
104
|
+
var = FV.TI
|
|
105
|
+
print(f"\nCHECKING {var}")
|
|
106
|
+
sel = chk[var] >= 3e-4
|
|
107
|
+
print(df.loc[sel])
|
|
108
|
+
print(fdata.loc[sel])
|
|
109
|
+
print(chk.loc[sel])
|
|
110
|
+
assert (chk[var] < 3e-4).all()
|
|
111
|
+
|
|
112
|
+
var = FV.CT
|
|
113
|
+
print(f"\nCHECKING {var}")
|
|
114
|
+
sel = chk[var] >= 3e-5
|
|
115
|
+
print(df.loc[sel])
|
|
116
|
+
print(fdata.loc[sel])
|
|
117
|
+
print(chk.loc[sel])
|
|
118
|
+
assert (chk[var] < 3e-5).all()
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
if __name__ == "__main__":
|
|
122
|
+
test()
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
import time
|
|
3
|
+
import argparse
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
import flappy as fl
|
|
7
|
+
from flappy.config.variables import variables as FV
|
|
8
|
+
|
|
9
|
+
if __name__ == "__main__":
|
|
10
|
+
parser = argparse.ArgumentParser()
|
|
11
|
+
parser.add_argument(
|
|
12
|
+
"-c", "--chunksize", help="The maximal chunk size", type=int, default=500
|
|
13
|
+
)
|
|
14
|
+
parser.add_argument(
|
|
15
|
+
"-o", "--ofile", help="The output file name", default="results.csv.gz"
|
|
16
|
+
)
|
|
17
|
+
parser.add_argument(
|
|
18
|
+
"--n_cpus", help="The number of processors", type=int, default=1
|
|
19
|
+
)
|
|
20
|
+
args = parser.parse_args()
|
|
21
|
+
|
|
22
|
+
n_s = 800
|
|
23
|
+
n_t = 76
|
|
24
|
+
c = args.chunksize
|
|
25
|
+
p0 = np.array([0.0, 0.0])
|
|
26
|
+
stp = np.array([497.0, 0.0])
|
|
27
|
+
tfile = "../NREL-5MW-D126-H90.csv"
|
|
28
|
+
ofile = Path(args.ofile)
|
|
29
|
+
|
|
30
|
+
# init flappy:
|
|
31
|
+
fl.init_flappy(n_cpus=args.n_cpus)
|
|
32
|
+
|
|
33
|
+
# load model book:
|
|
34
|
+
mbook = fl.ModelBook(ct_power_curve_file=tfile)
|
|
35
|
+
|
|
36
|
+
# create wind farm:
|
|
37
|
+
farm = fl.WindFarm()
|
|
38
|
+
fl.input.add_turbine_row(
|
|
39
|
+
farm,
|
|
40
|
+
rotor_diameter=126.0,
|
|
41
|
+
hub_height=90.0,
|
|
42
|
+
rotor_model="centre",
|
|
43
|
+
wake_models=["Jensen007_rotor"],
|
|
44
|
+
turbine_models=["ct_P_curves"],
|
|
45
|
+
base_point=p0,
|
|
46
|
+
step_vector=stp,
|
|
47
|
+
steps=n_t - 1,
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
# create states:
|
|
51
|
+
ws0 = 3.0
|
|
52
|
+
ws1 = 30.0
|
|
53
|
+
states = fl.input.AFSScan(
|
|
54
|
+
ws_min=ws0,
|
|
55
|
+
ws_delta=(ws1 - ws0) / (n_s - 1),
|
|
56
|
+
ws_n_bins=n_s,
|
|
57
|
+
func_pdf_ws=None,
|
|
58
|
+
wd_min=270.0,
|
|
59
|
+
wd_delta=1.0,
|
|
60
|
+
wd_n_bins=1,
|
|
61
|
+
func_pdf_wd=None,
|
|
62
|
+
ti_min=0.08,
|
|
63
|
+
ti_delta=0.01,
|
|
64
|
+
ti_n_bins=1,
|
|
65
|
+
func_pdf_ti=None,
|
|
66
|
+
rho_min=1.225,
|
|
67
|
+
rho_delta=0.001,
|
|
68
|
+
rho_n_bins=1,
|
|
69
|
+
func_pdf_rho=None,
|
|
70
|
+
max_chunk_size=c,
|
|
71
|
+
)
|
|
72
|
+
states.initialize()
|
|
73
|
+
|
|
74
|
+
time0 = time.time()
|
|
75
|
+
|
|
76
|
+
# run calculation:
|
|
77
|
+
results = farm.calculate(mbook, states, wake_superp=["wind_quadratic"])
|
|
78
|
+
|
|
79
|
+
time1 = time.time()
|
|
80
|
+
print("\nCalc time =", time1 - time0, "\n")
|
|
81
|
+
|
|
82
|
+
df = results.state_turbine_results[[FV.WD, FV.AMB_WS, FV.WS, FV.AMB_P, FV.P]]
|
|
83
|
+
|
|
84
|
+
print()
|
|
85
|
+
print("TRESULTS\n")
|
|
86
|
+
print(df)
|
|
87
|
+
|
|
88
|
+
print("\nWriting file", ofile)
|
|
89
|
+
df.to_csv(ofile)
|
|
90
|
+
|
|
91
|
+
# close flappy:
|
|
92
|
+
fl.shutdown_flappy()
|
tests/1_verification/flappy_0_6/row_Jensen_quadratic_centre/test_row_Jensen_quadratic_centre.py
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
import pandas as pd
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
import inspect
|
|
5
|
+
|
|
6
|
+
import foxes
|
|
7
|
+
import foxes.variables as FV
|
|
8
|
+
import foxes.constants as FC
|
|
9
|
+
|
|
10
|
+
thisdir = Path(inspect.getfile(inspect.currentframe())).parent
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def test():
|
|
14
|
+
n_s = 800
|
|
15
|
+
n_t = 76
|
|
16
|
+
c = 1000
|
|
17
|
+
p0 = np.array([0.0, 0.0])
|
|
18
|
+
stp = np.array([497.0, 0.0])
|
|
19
|
+
cfile = thisdir / "flappy" / "results.csv.gz"
|
|
20
|
+
tfile = thisdir / "NREL-5MW-D126-H90.csv"
|
|
21
|
+
|
|
22
|
+
mbook = foxes.models.ModelBook()
|
|
23
|
+
ttype = foxes.models.turbine_types.PCtFile(
|
|
24
|
+
data_source=tfile, var_ws_ct=FV.REWS, var_ws_P=FV.REWS
|
|
25
|
+
)
|
|
26
|
+
mbook.turbine_types[ttype.name] = ttype
|
|
27
|
+
|
|
28
|
+
states = foxes.input.states.ScanWS(
|
|
29
|
+
ws_list=np.linspace(3.0, 30.0, n_s), wd=270.0, ti=0.08, rho=1.225
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
farm = foxes.WindFarm()
|
|
33
|
+
foxes.input.farm_layout.add_row(
|
|
34
|
+
farm=farm,
|
|
35
|
+
xy_base=p0,
|
|
36
|
+
xy_step=stp,
|
|
37
|
+
n_turbines=n_t,
|
|
38
|
+
turbine_models=[ttype.name],
|
|
39
|
+
verbosity=0,
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
algo = foxes.algorithms.Downwind(
|
|
43
|
+
farm,
|
|
44
|
+
states,
|
|
45
|
+
mbook=mbook,
|
|
46
|
+
rotor_model="centre",
|
|
47
|
+
wake_models=["Jensen_quadratic_k007"],
|
|
48
|
+
wake_frame="rotor_wd",
|
|
49
|
+
partial_wakes={"Jensen_linear_k007": "centre"},
|
|
50
|
+
verbosity=0,
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
data = algo.calc_farm()
|
|
54
|
+
|
|
55
|
+
df = data.to_dataframe()[[FV.WD, FV.AMB_REWS, FV.REWS, FV.AMB_P, FV.P]]
|
|
56
|
+
|
|
57
|
+
print("\nReading file", cfile)
|
|
58
|
+
fdata = pd.read_csv(cfile).set_index(["state", "turbine"])
|
|
59
|
+
|
|
60
|
+
print()
|
|
61
|
+
print("TRESULTS\n")
|
|
62
|
+
sel = (df[FV.P] > 0) & (fdata[FV.P] > 0)
|
|
63
|
+
df = df.loc[sel]
|
|
64
|
+
fdata = fdata.loc[sel]
|
|
65
|
+
print(df.loc[sel])
|
|
66
|
+
print(fdata.loc[sel])
|
|
67
|
+
|
|
68
|
+
print("\nVERIFYING\n")
|
|
69
|
+
df[FV.WS] = df["REWS"]
|
|
70
|
+
df[FV.AMB_WS] = df["AMB_REWS"]
|
|
71
|
+
|
|
72
|
+
delta = df - fdata
|
|
73
|
+
print(delta)
|
|
74
|
+
|
|
75
|
+
chk = delta.abs()
|
|
76
|
+
print(chk.max())
|
|
77
|
+
|
|
78
|
+
var = FV.WS
|
|
79
|
+
print(f"\nCHECKING {var}")
|
|
80
|
+
sel = chk[var] >= 1e-7
|
|
81
|
+
print(df.loc[sel])
|
|
82
|
+
print(fdata.loc[sel])
|
|
83
|
+
print(chk.loc[sel])
|
|
84
|
+
assert (chk[var] < 1e-7).all()
|
|
85
|
+
|
|
86
|
+
var = FV.P
|
|
87
|
+
sel = chk[var] >= 1e-5
|
|
88
|
+
print(f"\nCHECKING {var}\n", delta.loc[sel])
|
|
89
|
+
assert (chk[var] < 1e-5).all()
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
if __name__ == "__main__":
|
|
93
|
+
test()
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
import pandas as pd
|
|
3
|
+
import time
|
|
4
|
+
import argparse
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
import flappy as fl
|
|
8
|
+
from flappy.config.variables import variables as FV
|
|
9
|
+
|
|
10
|
+
if __name__ == "__main__":
|
|
11
|
+
parser = argparse.ArgumentParser()
|
|
12
|
+
parser.add_argument(
|
|
13
|
+
"-c", "--chunksize", help="The maximal chunk size", type=int, default=500
|
|
14
|
+
)
|
|
15
|
+
parser.add_argument("-o", "--opath", help="The output file path", default=".")
|
|
16
|
+
parser.add_argument(
|
|
17
|
+
"--n_cpus", help="The number of processors", type=int, default=4
|
|
18
|
+
)
|
|
19
|
+
args = parser.parse_args()
|
|
20
|
+
|
|
21
|
+
c = args.chunksize
|
|
22
|
+
p0 = np.array([0.0, 0.0])
|
|
23
|
+
stp = np.array([500.0, 0.0])
|
|
24
|
+
opath = Path(args.opath)
|
|
25
|
+
tfile = "../NREL-5MW-D126-H90.csv"
|
|
26
|
+
sfile = "../states.csv.gz"
|
|
27
|
+
lfile = "../test_farm.csv"
|
|
28
|
+
cases = [
|
|
29
|
+
(["Bastankhah_rotor"], ["wind_linear"], "centre"),
|
|
30
|
+
(["Bastankhah_rotor"], ["wind_linear"], "grid4"),
|
|
31
|
+
(["Bastankhah_rotor"], ["wind_linear"], "grid16"),
|
|
32
|
+
(["Bastankhah_rotor"], ["wind_linear"], "grid64"),
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
# init flappy:
|
|
36
|
+
fl.init_flappy(n_cpus=args.n_cpus)
|
|
37
|
+
|
|
38
|
+
for i, (wakes, superp, rotor) in enumerate(cases):
|
|
39
|
+
print(f"\nCase {(wakes, superp, rotor)}")
|
|
40
|
+
|
|
41
|
+
# load model book:
|
|
42
|
+
mbook = fl.ModelBook(ct_power_curve_file=tfile)
|
|
43
|
+
|
|
44
|
+
# create wind farm:
|
|
45
|
+
farm = fl.WindFarm()
|
|
46
|
+
fl.input.add_turbines_from_csv(
|
|
47
|
+
farm,
|
|
48
|
+
lfile,
|
|
49
|
+
col_index="index",
|
|
50
|
+
col_x="x",
|
|
51
|
+
col_y="y",
|
|
52
|
+
rotor_diameter=126.0,
|
|
53
|
+
hub_height=90.0,
|
|
54
|
+
rotor_model=rotor,
|
|
55
|
+
wake_models=wakes,
|
|
56
|
+
turbine_models=["ct_P_curves"],
|
|
57
|
+
output_level=0,
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
# create states:
|
|
61
|
+
states = fl.input.AFSStatesTable(
|
|
62
|
+
data_file=sfile,
|
|
63
|
+
col_wd="wd",
|
|
64
|
+
col_ws_ref="ws",
|
|
65
|
+
col_ti="ti",
|
|
66
|
+
col_weight="weight",
|
|
67
|
+
air_density=1.225,
|
|
68
|
+
z0=0.1,
|
|
69
|
+
h_ref=100.0,
|
|
70
|
+
max_chunk_size=args.chunksize,
|
|
71
|
+
output_level=0,
|
|
72
|
+
)
|
|
73
|
+
states.initialize()
|
|
74
|
+
|
|
75
|
+
# run calculation:
|
|
76
|
+
results = farm.calculate(mbook, states, wake_superp=superp, output_level=0)
|
|
77
|
+
|
|
78
|
+
df = results.state_turbine_results[[FV.WD, FV.AMB_WS, FV.WS, FV.AMB_P, FV.P]]
|
|
79
|
+
|
|
80
|
+
ofile = opath / f"results_{i}.csv.gz"
|
|
81
|
+
print(f"Writing file {ofile}")
|
|
82
|
+
df.to_csv(ofile)
|
|
83
|
+
|
|
84
|
+
# close flappy:
|
|
85
|
+
fl.shutdown_flappy()
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import pandas as pd
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
import inspect
|
|
4
|
+
|
|
5
|
+
import foxes
|
|
6
|
+
import foxes.variables as FV
|
|
7
|
+
import foxes.constants as FC
|
|
8
|
+
|
|
9
|
+
thisdir = Path(inspect.getfile(inspect.currentframe())).parent
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def test():
|
|
13
|
+
c = 500
|
|
14
|
+
cpath = thisdir / "flappy"
|
|
15
|
+
tfile = thisdir / "NREL-5MW-D126-H90.csv"
|
|
16
|
+
sfile = thisdir / "states.csv.gz"
|
|
17
|
+
lfile = thisdir / "test_farm.csv"
|
|
18
|
+
cases = [
|
|
19
|
+
(["Basta"], "centre", "rotor_points"),
|
|
20
|
+
(["Basta"], "grid4", "grid4"),
|
|
21
|
+
(["Basta"], "grid16", "grid16"),
|
|
22
|
+
(["Basta"], "grid64", "grid64"),
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
ck = {FC.STATE: c}
|
|
26
|
+
|
|
27
|
+
for i, (wakes, rotor, pwake) in enumerate(cases):
|
|
28
|
+
print(f"\nENTERING CASE {(wakes, rotor, pwake)}\n")
|
|
29
|
+
|
|
30
|
+
mbook = foxes.models.ModelBook()
|
|
31
|
+
ttype = foxes.models.turbine_types.PCtFile(
|
|
32
|
+
data_source=tfile, var_ws_ct=FV.REWS, var_ws_P=FV.REWS
|
|
33
|
+
)
|
|
34
|
+
mbook.turbine_types[ttype.name] = ttype
|
|
35
|
+
|
|
36
|
+
mbook.wake_models["Basta"] = foxes.models.wake_models.wind.Bastankhah2014(
|
|
37
|
+
sbeta_factor=0.25, superposition="ws_linear", induction="Betz"
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
states = foxes.input.states.StatesTable(
|
|
41
|
+
data_source=sfile,
|
|
42
|
+
output_vars=[FV.WS, FV.WD, FV.TI, FV.RHO],
|
|
43
|
+
var2col={FV.WS: "ws", FV.WD: "wd", FV.TI: "ti"},
|
|
44
|
+
fixed_vars={FV.RHO: 1.225, FV.Z0: 0.1, FV.H: 100.0},
|
|
45
|
+
profiles={FV.WS: "ABLLogNeutralWsProfile"},
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
farm = foxes.WindFarm()
|
|
49
|
+
foxes.input.farm_layout.add_from_file(
|
|
50
|
+
farm,
|
|
51
|
+
lfile,
|
|
52
|
+
turbine_models=["kTI_amb_02", ttype.name],
|
|
53
|
+
verbosity=1,
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
algo = foxes.algorithms.Downwind(
|
|
57
|
+
farm,
|
|
58
|
+
states,
|
|
59
|
+
mbook=mbook,
|
|
60
|
+
rotor_model=rotor,
|
|
61
|
+
wake_models=wakes,
|
|
62
|
+
wake_frame="rotor_wd",
|
|
63
|
+
partial_wakes=pwake,
|
|
64
|
+
chunks=ck,
|
|
65
|
+
verbosity=1,
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
data = algo.calc_farm()
|
|
69
|
+
|
|
70
|
+
df = data.to_dataframe()[
|
|
71
|
+
[FV.AMB_WD, FV.WD, FV.AMB_REWS, FV.REWS, FV.AMB_P, FV.P]
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
cfile = cpath / f"results_{i}.csv.gz"
|
|
75
|
+
print("\nReading file", cfile)
|
|
76
|
+
fdata = pd.read_csv(cfile).set_index(["state", "turbine"])
|
|
77
|
+
|
|
78
|
+
print()
|
|
79
|
+
print("TRESULTS\n")
|
|
80
|
+
print(df)
|
|
81
|
+
print(fdata)
|
|
82
|
+
|
|
83
|
+
print("\nVERIFYING\n")
|
|
84
|
+
df[FV.WS] = df["REWS"]
|
|
85
|
+
df[FV.AMB_WS] = df["AMB_REWS"]
|
|
86
|
+
|
|
87
|
+
delta = df - fdata
|
|
88
|
+
print(delta)
|
|
89
|
+
chk = delta[[FV.AMB_WS, FV.AMB_P, FV.WS, FV.P]]
|
|
90
|
+
print(chk)
|
|
91
|
+
chk = chk.abs()
|
|
92
|
+
print(chk.max())
|
|
93
|
+
|
|
94
|
+
var = FV.AMB_WS
|
|
95
|
+
sel = chk[var] >= 1e-7
|
|
96
|
+
print(f"\nCHECKING {var}, {(wakes, rotor, pwake)}\n")
|
|
97
|
+
print(df.loc[sel])
|
|
98
|
+
print(fdata.loc[sel])
|
|
99
|
+
print(delta.loc[sel])
|
|
100
|
+
assert (chk[var] < 1e-7).all()
|
|
101
|
+
|
|
102
|
+
var = FV.AMB_P
|
|
103
|
+
sel = chk[var] >= 1e-5
|
|
104
|
+
print(f"\nCHECKING {var}, {(wakes, rotor, pwake)}\n")
|
|
105
|
+
print(df.loc[sel])
|
|
106
|
+
print(fdata.loc[sel])
|
|
107
|
+
print(delta.loc[sel])
|
|
108
|
+
assert (chk[var] < 1e-5).all()
|
|
109
|
+
|
|
110
|
+
var = FV.WS
|
|
111
|
+
sel = chk[var] >= 1.7e-3
|
|
112
|
+
print(f"\nCHECKING {var}, {(wakes, rotor, pwake)}\n")
|
|
113
|
+
print(df.loc[sel])
|
|
114
|
+
print(fdata.loc[sel])
|
|
115
|
+
print(delta.loc[sel])
|
|
116
|
+
assert (chk[var] < 1.7e-3).all()
|
|
117
|
+
|
|
118
|
+
var = FV.P
|
|
119
|
+
sel = chk[var] >= 1.51
|
|
120
|
+
print(f"\nCHECKING {var}, {(wakes, rotor, pwake)}\n")
|
|
121
|
+
print(df.loc[sel])
|
|
122
|
+
print(fdata.loc[sel])
|
|
123
|
+
print(delta.loc[sel])
|
|
124
|
+
assert (chk[var] < 1.51).all()
|
|
125
|
+
|
|
126
|
+
print()
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
if __name__ == "__main__":
|
|
130
|
+
test()
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
import time
|
|
3
|
+
import argparse
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
import flappy as fl
|
|
7
|
+
from flappy.config.variables import variables as FV
|
|
8
|
+
|
|
9
|
+
if __name__ == "__main__":
|
|
10
|
+
parser = argparse.ArgumentParser()
|
|
11
|
+
parser.add_argument(
|
|
12
|
+
"-o", "--ofile", help="The output file name", default="results.csv.gz"
|
|
13
|
+
)
|
|
14
|
+
parser.add_argument(
|
|
15
|
+
"--n_cpus", help="The number of processors", type=int, default=1
|
|
16
|
+
)
|
|
17
|
+
args = parser.parse_args()
|
|
18
|
+
|
|
19
|
+
n_s = 30
|
|
20
|
+
n_t = 52
|
|
21
|
+
wd = 270.0
|
|
22
|
+
ti = 0.08
|
|
23
|
+
rotor = "centre"
|
|
24
|
+
c = 100
|
|
25
|
+
p0 = np.array([0.0, 0.0])
|
|
26
|
+
stp = np.array([601.0, 15.0])
|
|
27
|
+
tfile = "../NREL-5MW-D126-H90.csv"
|
|
28
|
+
ofile = Path(args.ofile)
|
|
29
|
+
|
|
30
|
+
# init flappy:
|
|
31
|
+
fl.init_flappy(n_cpus=args.n_cpus)
|
|
32
|
+
|
|
33
|
+
# load model book:
|
|
34
|
+
mbook = fl.ModelBook(ct_power_curve_file=tfile)
|
|
35
|
+
|
|
36
|
+
# create wind farm:
|
|
37
|
+
farm = fl.WindFarm()
|
|
38
|
+
fl.input.add_turbine_row(
|
|
39
|
+
farm,
|
|
40
|
+
rotor_diameter=126.0,
|
|
41
|
+
hub_height=90.0,
|
|
42
|
+
rotor_model=rotor,
|
|
43
|
+
wake_models=["Bastankhah", "CrespoHernandez"],
|
|
44
|
+
turbine_models=["ct_P_curves"],
|
|
45
|
+
base_point=p0,
|
|
46
|
+
step_vector=stp,
|
|
47
|
+
steps=n_t - 1,
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
# create states:
|
|
51
|
+
ws0 = 6.0
|
|
52
|
+
ws1 = 16.0
|
|
53
|
+
states = fl.input.AFSScan(
|
|
54
|
+
ws_min=ws0,
|
|
55
|
+
ws_delta=(ws1 - ws0) / (n_s - 1),
|
|
56
|
+
ws_n_bins=n_s,
|
|
57
|
+
func_pdf_ws=None,
|
|
58
|
+
wd_min=wd,
|
|
59
|
+
wd_delta=1.0,
|
|
60
|
+
wd_n_bins=1,
|
|
61
|
+
func_pdf_wd=None,
|
|
62
|
+
ti_min=ti,
|
|
63
|
+
ti_delta=0.01,
|
|
64
|
+
ti_n_bins=1,
|
|
65
|
+
func_pdf_ti=None,
|
|
66
|
+
rho_min=1.225,
|
|
67
|
+
rho_delta=0.001,
|
|
68
|
+
rho_n_bins=1,
|
|
69
|
+
func_pdf_rho=None,
|
|
70
|
+
max_chunk_size=c,
|
|
71
|
+
)
|
|
72
|
+
states.initialize()
|
|
73
|
+
|
|
74
|
+
time0 = time.time()
|
|
75
|
+
|
|
76
|
+
# run calculation:
|
|
77
|
+
results = farm.calculate(mbook, states, wake_superp=["wind_quadratic", "ti_max"])
|
|
78
|
+
|
|
79
|
+
time1 = time.time()
|
|
80
|
+
print("\nCalc time =", time1 - time0, "\n")
|
|
81
|
+
|
|
82
|
+
df = results.state_turbine_results[
|
|
83
|
+
[FV.WD, FV.AMB_WS, FV.WS, FV.AMB_TI, FV.TI, FV.AMB_CT, FV.CT]
|
|
84
|
+
]
|
|
85
|
+
|
|
86
|
+
print(results.turbine_results[[FV.X, FV.Y]])
|
|
87
|
+
|
|
88
|
+
print()
|
|
89
|
+
print("TRESULTS\n")
|
|
90
|
+
print(df)
|
|
91
|
+
|
|
92
|
+
print("\nWriting file", ofile)
|
|
93
|
+
df.to_csv(ofile)
|
|
94
|
+
|
|
95
|
+
# close flappy:
|
|
96
|
+
fl.shutdown_flappy()
|