Skip to content

Commit

Permalink
Adding True flags for contour lines to most relevant examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
misi9170 committed Oct 20, 2023
1 parent 89543b5 commit 57b3726
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 15 deletions.
30 changes: 21 additions & 9 deletions examples/02_visualizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@

import floris.tools.visualization as wakeviz
from floris.tools import FlorisInterface
from floris.tools.visualization import (
calculate_horizontal_plane_with_turbines,
visualize_cut_plane,
)


"""
Expand Down Expand Up @@ -78,23 +74,39 @@
# Create the plots
fig, ax_list = plt.subplots(3, 1, figsize=(10, 8))
ax_list = ax_list.flatten()
wakeviz.visualize_cut_plane(horizontal_plane, ax=ax_list[0], title="Horizontal")
wakeviz.visualize_cut_plane(y_plane, ax=ax_list[1], title="Streamwise profile")
wakeviz.visualize_cut_plane(cross_plane, ax=ax_list[2], title="Spanwise profile")
wakeviz.visualize_cut_plane(
horizontal_plane,
ax=ax_list[0],
label_contours=True,
title="Horizontal"
)
wakeviz.visualize_cut_plane(
y_plane,
ax=ax_list[1],
label_contours=True,
title="Streamwise profile"
)
wakeviz.visualize_cut_plane(
cross_plane,
ax=ax_list[2],
label_contours=True,
title="Spanwise profile"
)

# Some wake models may not yet have a visualization method included, for these cases can use
# a slower version which scans a turbine model to produce the horizontal flow
horizontal_plane_scan_turbine = calculate_horizontal_plane_with_turbines(
horizontal_plane_scan_turbine = wakeviz.calculate_horizontal_plane_with_turbines(
fi,
x_resolution=20,
y_resolution=10,
yaw_angles=np.array([[[25.,0.,0.]]]),
)

fig, ax = plt.subplots()
visualize_cut_plane(
wakeviz.visualize_cut_plane(
horizontal_plane_scan_turbine,
ax=ax,
label_contours=True,
title="Horizontal (coarse turbine scan method)",
)

Expand Down
28 changes: 22 additions & 6 deletions examples/16_heterogeneous_inflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,30 @@
# Create the plots
fig, ax_list = plt.subplots(3, 1, figsize=(10, 8))
ax_list = ax_list.flatten()
visualize_cut_plane(horizontal_plane_2d, ax=ax_list[0], title="Horizontal", color_bar=True)
visualize_cut_plane(
horizontal_plane_2d,
ax=ax_list[0],
title="Horizontal",
color_bar=True,
label_contours=True
)
ax_list[0].set_xlabel('x')
ax_list[0].set_ylabel('y')
visualize_cut_plane(y_plane_2d, ax=ax_list[1], title="Streamwise profile", color_bar=True)
visualize_cut_plane(
y_plane_2d,
ax=ax_list[1],
title="Streamwise profile",
color_bar=True,
label_contours=True
)
ax_list[1].set_xlabel('x')
ax_list[1].set_ylabel('z')
visualize_cut_plane(
cross_plane_2d,
ax=ax_list[2],
title="Spanwise profile at 500m downstream",
color_bar=True
color_bar=True,
label_contours=True
)
ax_list[2].set_xlabel('y')
ax_list[2].set_ylabel('z')
Expand Down Expand Up @@ -136,23 +149,26 @@
horizontal_plane_3d,
ax=ax_list[0],
title="Horizontal",
color_bar=True
color_bar=True,
label_contours=True
)
ax_list[0].set_xlabel('x')
ax_list[0].set_ylabel('y')
visualize_cut_plane(
y_plane_3d,
ax=ax_list[1],
title="Streamwise profile",
color_bar=True
color_bar=True,
label_contours=True
)
ax_list[1].set_xlabel('x')
ax_list[1].set_ylabel('z')
visualize_cut_plane(
cross_plane_3d,
ax=ax_list[2],
title="Spanwise profile at 500m downstream",
color_bar=True
color_bar=True,
label_contours=True
)
ax_list[2].set_xlabel('y')
ax_list[2].set_ylabel('z')
Expand Down

0 comments on commit 57b3726

Please sign in to comment.