-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelpers.py
18 lines (16 loc) · 931 Bytes
/
helpers.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from floris.tools.floris_interface import FlorisInterface as DynFlorisInterface
def generate_model(floris_dir):
## GET SYSTEM INFORMATION
fi = DynFlorisInterface(floris_dir)
n_turbines = len(fi.floris.farm.turbines)
fi.max_downstream_dist = max(fi.floris.farm.turbine_map.coords[t].x1 for t in range(n_turbines))
fi.min_downstream_dist = min(fi.floris.farm.turbine_map.coords[t].x1 for t in range(n_turbines))
# exclude most downstream turbine
fi.turbine_indices = list(range(n_turbines))
fi.upstream_turbine_indices = [t for t in range(n_turbines)
if fi.floris.farm.turbine_map.coords[t].x1
< fi.max_downstream_dist]
fi.downstream_turbine_indices = [t for t in range(n_turbines)
if fi.floris.farm.turbine_map.coords[t].x1
> fi.min_downstream_dist]
return fi