Skip to content

Commit 4d7733c

Browse files
authored
Merge pull request #325 from bayc/feature/multiple_turbine_types
Support multiple turbine types
2 parents ea75bf1 + 8c5ea48 commit 4d7733c

32 files changed

+1237
-824
lines changed

examples/10_multiple_turbine_types.py

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Copyright 2021 NREL
2+
3+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4+
# use this file except in compliance with the License. You may obtain a copy of
5+
# the License at http://www.apache.org/licenses/LICENSE-2.0
6+
7+
# Unless required by applicable law or agreed to in writing, software
8+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10+
# License for the specific language governing permissions and limitations under
11+
# the License.
12+
13+
# See https://floris.readthedocs.io for documentation
14+
15+
16+
import matplotlib.pyplot as plt
17+
import numpy as np
18+
19+
from floris.tools import FlorisInterface
20+
from floris.tools.visualization import visualize_cut_plane
21+
22+
"""
23+
This example uses an input file where multiple turbine types are defined.
24+
The first two turbines are the NREL 5MW, and the third turbine is the IEA 10MW.
25+
"""
26+
27+
# Initialize FLORIS with the given input file via FlorisInterface.
28+
# For basic usage, FlorisInterface provides a simplified and expressive
29+
# entry point to the simulation routines.
30+
fi = FlorisInterface("inputs/gch_multiple_turbine_types.yaml")
31+
32+
# Using the FlorisInterface functions for generating plots, run FLORIS
33+
# and extract 2D planes of data.
34+
horizontal_plane = fi.calculate_horizontal_plane(x_resolution=200, y_resolution=100, height=90)
35+
y_plane = fi.calculate_y_plane(x_resolution=200, z_resolution=100)
36+
cross_plane = fi.calculate_cross_plane(y_resolution=100, z_resolution=100)
37+
38+
# Create the plots
39+
fig, ax_list = plt.subplots(3, 1, figsize=(10, 8))
40+
ax_list = ax_list.flatten()
41+
visualize_cut_plane(horizontal_plane, ax=ax_list[0], title="Horizontal")
42+
visualize_cut_plane(y_plane, ax=ax_list[1], title="Streamwise profile")
43+
visualize_cut_plane(cross_plane, ax=ax_list[2], title="Spanwise profile")
44+
45+
plt.show()

examples/inputs/cc.yaml

+2-156
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ farm:
2424
- 0.0
2525
- 0.0
2626
- 0.0
27+
turbine_type:
28+
- nrel_5MW
2729

2830
flow_field:
2931
air_density: 1.225
@@ -85,159 +87,3 @@ wake:
8587
constant: 0.9
8688
ai: 0.83
8789
downstream: -0.25
88-
89-
turbine:
90-
generator_efficiency: 1.0
91-
hub_height: 90.0
92-
pP: 1.88
93-
pT: 1.88
94-
rotor_diameter: 126.0
95-
TSR: 8.0
96-
power_thrust_table:
97-
power:
98-
- 0.0
99-
- 0.0
100-
- 0.1780851
101-
- 0.28907459
102-
- 0.34902166
103-
- 0.3847278
104-
- 0.40605878
105-
- 0.4202279
106-
- 0.42882274
107-
- 0.43387274
108-
- 0.43622267
109-
- 0.43684468
110-
- 0.43657497
111-
- 0.43651053
112-
- 0.4365612
113-
- 0.43651728
114-
- 0.43590309
115-
- 0.43467276
116-
- 0.43322955
117-
- 0.43003137
118-
- 0.37655587
119-
- 0.33328466
120-
- 0.29700574
121-
- 0.26420779
122-
- 0.23839379
123-
- 0.21459275
124-
- 0.19382354
125-
- 0.1756635
126-
- 0.15970926
127-
- 0.14561785
128-
- 0.13287856
129-
- 0.12130194
130-
- 0.11219941
131-
- 0.10311631
132-
- 0.09545392
133-
- 0.08813781
134-
- 0.08186763
135-
- 0.07585005
136-
- 0.07071926
137-
- 0.06557558
138-
- 0.06148104
139-
- 0.05755207
140-
- 0.05413366
141-
- 0.05097969
142-
- 0.04806545
143-
- 0.04536883
144-
- 0.04287006
145-
- 0.04055141
146-
thrust:
147-
- 1.19187945
148-
- 1.17284634
149-
- 1.09860817
150-
- 1.02889592
151-
- 0.97373036
152-
- 0.92826162
153-
- 0.89210543
154-
- 0.86100905
155-
- 0.835423
156-
- 0.81237673
157-
- 0.79225789
158-
- 0.77584769
159-
- 0.7629228
160-
- 0.76156073
161-
- 0.76261984
162-
- 0.76169723
163-
- 0.75232027
164-
- 0.74026851
165-
- 0.72987175
166-
- 0.70701647
167-
- 0.54054532
168-
- 0.45509459
169-
- 0.39343381
170-
- 0.34250785
171-
- 0.30487242
172-
- 0.27164979
173-
- 0.24361964
174-
- 0.21973831
175-
- 0.19918151
176-
- 0.18131868
177-
- 0.16537679
178-
- 0.15103727
179-
- 0.13998636
180-
- 0.1289037
181-
- 0.11970413
182-
- 0.11087113
183-
- 0.10339901
184-
- 0.09617888
185-
- 0.09009926
186-
- 0.08395078
187-
- 0.0791188
188-
- 0.07448356
189-
- 0.07050731
190-
- 0.06684119
191-
- 0.06345518
192-
- 0.06032267
193-
- 0.05741999
194-
- 0.05472609
195-
wind_speed:
196-
- 2.0
197-
- 2.5
198-
- 3.0
199-
- 3.5
200-
- 4.0
201-
- 4.5
202-
- 5.0
203-
- 5.5
204-
- 6.0
205-
- 6.5
206-
- 7.0
207-
- 7.5
208-
- 8.0
209-
- 8.5
210-
- 9.0
211-
- 9.5
212-
- 10.0
213-
- 10.5
214-
- 11.0
215-
- 11.5
216-
- 12.0
217-
- 12.5
218-
- 13.0
219-
- 13.5
220-
- 14.0
221-
- 14.5
222-
- 15.0
223-
- 15.5
224-
- 16.0
225-
- 16.5
226-
- 17.0
227-
- 17.5
228-
- 18.0
229-
- 18.5
230-
- 19.0
231-
- 19.5
232-
- 20.0
233-
- 20.5
234-
- 21.0
235-
- 21.5
236-
- 22.0
237-
- 22.5
238-
- 23.0
239-
- 23.5
240-
- 24.0
241-
- 24.5
242-
- 25.0
243-
- 25.5

examples/inputs/gch.yaml

+2-156
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ farm:
2424
- 0.0
2525
- 0.0
2626
- 0.0
27+
turbine_type:
28+
- nrel_5MW
2729

2830
flow_field:
2931
air_density: 1.225
@@ -85,159 +87,3 @@ wake:
8587
constant: 0.5
8688
ai: 0.8
8789
downstream: -0.32
88-
89-
turbine:
90-
generator_efficiency: 1.0
91-
hub_height: 90.0
92-
pP: 1.88
93-
pT: 1.88
94-
rotor_diameter: 126.0
95-
TSR: 8.0
96-
power_thrust_table:
97-
power:
98-
- 0.0
99-
- 0.0
100-
- 0.1780851
101-
- 0.28907459
102-
- 0.34902166
103-
- 0.3847278
104-
- 0.40605878
105-
- 0.4202279
106-
- 0.42882274
107-
- 0.43387274
108-
- 0.43622267
109-
- 0.43684468
110-
- 0.43657497
111-
- 0.43651053
112-
- 0.4365612
113-
- 0.43651728
114-
- 0.43590309
115-
- 0.43467276
116-
- 0.43322955
117-
- 0.43003137
118-
- 0.37655587
119-
- 0.33328466
120-
- 0.29700574
121-
- 0.26420779
122-
- 0.23839379
123-
- 0.21459275
124-
- 0.19382354
125-
- 0.1756635
126-
- 0.15970926
127-
- 0.14561785
128-
- 0.13287856
129-
- 0.12130194
130-
- 0.11219941
131-
- 0.10311631
132-
- 0.09545392
133-
- 0.08813781
134-
- 0.08186763
135-
- 0.07585005
136-
- 0.07071926
137-
- 0.06557558
138-
- 0.06148104
139-
- 0.05755207
140-
- 0.05413366
141-
- 0.05097969
142-
- 0.04806545
143-
- 0.04536883
144-
- 0.04287006
145-
- 0.04055141
146-
thrust:
147-
- 1.19187945
148-
- 1.17284634
149-
- 1.09860817
150-
- 1.02889592
151-
- 0.97373036
152-
- 0.92826162
153-
- 0.89210543
154-
- 0.86100905
155-
- 0.835423
156-
- 0.81237673
157-
- 0.79225789
158-
- 0.77584769
159-
- 0.7629228
160-
- 0.76156073
161-
- 0.76261984
162-
- 0.76169723
163-
- 0.75232027
164-
- 0.74026851
165-
- 0.72987175
166-
- 0.70701647
167-
- 0.54054532
168-
- 0.45509459
169-
- 0.39343381
170-
- 0.34250785
171-
- 0.30487242
172-
- 0.27164979
173-
- 0.24361964
174-
- 0.21973831
175-
- 0.19918151
176-
- 0.18131868
177-
- 0.16537679
178-
- 0.15103727
179-
- 0.13998636
180-
- 0.1289037
181-
- 0.11970413
182-
- 0.11087113
183-
- 0.10339901
184-
- 0.09617888
185-
- 0.09009926
186-
- 0.08395078
187-
- 0.0791188
188-
- 0.07448356
189-
- 0.07050731
190-
- 0.06684119
191-
- 0.06345518
192-
- 0.06032267
193-
- 0.05741999
194-
- 0.05472609
195-
wind_speed:
196-
- 2.0
197-
- 2.5
198-
- 3.0
199-
- 3.5
200-
- 4.0
201-
- 4.5
202-
- 5.0
203-
- 5.5
204-
- 6.0
205-
- 6.5
206-
- 7.0
207-
- 7.5
208-
- 8.0
209-
- 8.5
210-
- 9.0
211-
- 9.5
212-
- 10.0
213-
- 10.5
214-
- 11.0
215-
- 11.5
216-
- 12.0
217-
- 12.5
218-
- 13.0
219-
- 13.5
220-
- 14.0
221-
- 14.5
222-
- 15.0
223-
- 15.5
224-
- 16.0
225-
- 16.5
226-
- 17.0
227-
- 17.5
228-
- 18.0
229-
- 18.5
230-
- 19.0
231-
- 19.5
232-
- 20.0
233-
- 20.5
234-
- 21.0
235-
- 21.5
236-
- 22.0
237-
- 22.5
238-
- 23.0
239-
- 23.5
240-
- 24.0
241-
- 24.5
242-
- 25.0
243-
- 25.5

0 commit comments

Comments
 (0)