Skip to content

Commit

Permalink
Remove setpoints and wind condition specifics from calculate_XX_plane…
Browse files Browse the repository at this point in the history
… methods (#868)

* remove yaw angles argument; switch to deepcopies.

* No longer allowed to pass wd, ws, ti---instead, specify a findex (or set a single ws, wd, ti).

* Remove erroneous type hints.

* update tests.

* Ruff formatting.

* Update examples. Note that previous calculate_XX_planes altered the rotor_diameters field on fmodel.

* Update Helix viz.

* calculate_horizontal_plane_with_turbines now consistent with calculate_horizontal_plane.

* remove now-redundant check_wind_condition_for_viz

* Clean up TODOs and docstrings.
  • Loading branch information
misi9170 committed Apr 8, 2024
1 parent 27b67ab commit 0e41d9b
Show file tree
Hide file tree
Showing 7 changed files with 140 additions and 253 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,31 +41,23 @@
x_resolution=200,
y_resolution=100,
height=150.0,
awc_modes=awc_modes,
awc_amplitudes=awc_amplitudes
)

y_plane_baseline = fmodel.calculate_y_plane(
x_resolution=200,
z_resolution=100,
crossstream_dist=0.0,
awc_modes=awc_modes,
awc_amplitudes=awc_amplitudes
)
y_plane_helix = fmodel.calculate_y_plane(
x_resolution=200,
z_resolution=100,
crossstream_dist=-3*D,
awc_modes=awc_modes,
awc_amplitudes=awc_amplitudes
)

cross_plane = fmodel.calculate_cross_plane(
y_resolution=100,
z_resolution=100,
downstream_dist=720.0,
awc_modes=awc_modes,
awc_amplitudes=awc_amplitudes
)

# Create the plots
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
show_flow_cuts = True
num_in_row = 5

yaw_angles = np.zeros((1, num_in_row))


# Define function for visualizing wakes
def generate_wake_visualization(fmodel: FlorisModel, title=None):
# Using the FlorisModel functions, get 2D slices.
Expand All @@ -38,15 +35,13 @@ def generate_wake_visualization(fmodel: FlorisModel, title=None):
height=horizontal_plane_location,
x_bounds=x_bounds,
y_bounds=y_bounds,
yaw_angles=yaw_angles,
)
y_plane = fmodel.calculate_y_plane(
x_resolution=200,
z_resolution=100,
crossstream_dist=streamwise_plane_location,
x_bounds=x_bounds,
z_bounds=z_bounds,
yaw_angles=yaw_angles,
)
cross_planes = []
for cpl in cross_plane_locations:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,13 @@ def generate_wake_visualization(fmodel, title=None):
height=horizontal_plane_location,
x_bounds=x_bounds,
y_bounds=y_bounds,
yaw_angles=yaw_angles
)
y_plane = fmodel.calculate_y_plane(
x_resolution=200,
z_resolution=100,
crossstream_dist=streamwise_plane_location,
x_bounds=x_bounds,
z_bounds=z_bounds,
yaw_angles=yaw_angles
)
cross_planes = []
for cpl in cross_plane_locations:
Expand Down
5 changes: 2 additions & 3 deletions examples/examples_visualizations/001_layout_visualizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@

# Plot 2: Show turbine rotors on flow
ax = axarr[2]
horizontal_plane = fmodel.calculate_horizontal_plane(
height=90.0, yaw_angles=np.array([[0.0, 30.0, 0.0, 0.0, 0.0]])
)
fmodel.set(yaw_angles=np.array([[0., 30., 0., 0., 0.]]))
horizontal_plane = fmodel.calculate_horizontal_plane(height=90.0)
visualize_cut_plane(horizontal_plane, ax=ax, min_speed=MIN_WS, max_speed=MAX_WS)
layoutviz.plot_turbine_rotors(fmodel, ax=ax, yaw_angles=np.array([[0.0, 30.0, 0.0, 0.0, 0.0]]))
ax.set_title("Flow visualization with yawed turbine")
Expand Down
Loading

0 comments on commit 0e41d9b

Please sign in to comment.