How to use the floris.tools.cut_plane function in FLORIS

To help you get started, we’ve selected a few FLORIS examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NREL / floris / examples / example_0010a_optimize_yaw_robust.py View on Github external
unc_options={'std_wd': 4.95, 'std_yaw': 1.75,'pmf_res': 1.0, 'pdf_cutoff': 0.99}

# Initial power output without uncertainty
power_initial = fi.get_farm_power()

# Initial power output with uncertainty
power_initial_unc = fi.get_farm_power(include_unc=True,
                        unc_options=unc_options)

# =============================================================================
print('Plotting the FLORIS flowfield...')
# =============================================================================

# Initialize the horizontal cut
hor_plane = wfct.cut_plane.HorPlane(
    fi.get_hub_height_flow_data(),
    fi.floris.farm.turbines[0].hub_height
)

# Plot and show
fig, ax = plt.subplots(figsize=(7.0, 5.0))
wfct.visualization.visualize_cut_plane(hor_plane, ax=ax)
ax.set_title('Baseline Case for U = 8 m/s, Wind Direction = 273$^\circ$')

# =============================================================================
print('Finding optimal yaw angles in FLORIS...')
# =============================================================================
# Set bounds for allowable wake steering
min_yaw = 0.0
max_yaw = 25.0
github NREL / floris / examples / visualization / provisional / flow_changes_in_yaw.py View on Github external
# Calculate wake
fi.calculate_wake()

# Grab some cross planes
D = 126
cut_plane_base_5 = fi.get_cross_plane(5 * D)
cut_plane_base_7 = fi.get_cross_plane(7 * D)

# Calculate yaw
fi.calculate_wake(yaw_angles=[25])
cut_plane_yaw_5 = fi.get_cross_plane(5 * D)
cut_plane_yaw_7 = fi.get_cross_plane(7 * D)

# Get the difference planes
cut_plane_diff_5 = cp.subtract(cut_plane_yaw_5, cut_plane_base_5)
cut_plane_diff_7 = cp.subtract(cut_plane_yaw_7, cut_plane_base_7)


# Plot and show
fig, axarr = plt.subplots(2, 3, figsize=(15, 5))

ax = axarr[0, 0]
wfct.visualization.visualize_cut_plane(cut_plane_base_5, ax=ax, minSpeed=4, maxSpeed=8)
ax.set_title("Baseline, 5D")

ax = axarr[1, 0]
wfct.visualization.visualize_cut_plane(cut_plane_base_7, ax=ax, minSpeed=4, maxSpeed=8)
ax.set_title("Baseline, 7D")

ax = axarr[0, 1]
wfct.visualization.visualize_cut_plane(cut_plane_yaw_5, ax=ax, minSpeed=4, maxSpeed=8)
github NREL / floris / examples / sowfa_comparisons / sowfa_minus_floris.py View on Github external
fi.reinitialize_flow_field(
    wind_speed=[si.precursor_wind_speed],
    wind_direction=[si.precursor_wind_dir],
    layout_array=(si.layout_x, si.layout_y),
)

# Set the yaw angles
fi.calculate_wake(yaw_angles=si.yaw_angles)

# Show projected and unprojected cut planes
x_loc = 600

cut_plane_sowfa = si.get_cross_plane(x_loc)
cut_plane_floris = fi.get_cross_plane(x_loc)
cut_plane_floris_project = cp.project_onto(cut_plane_floris, cut_plane_sowfa)
cut_plane_difference = cp.subtract(cut_plane_sowfa, cut_plane_floris_project)

print(cut_plane_sowfa.df.head())
print(cut_plane_floris_project.df.head())
print(cut_plane_difference.df.head())

fig, axarr = plt.subplots(2, 2, figsize=(10, 10))

# SOWFA
ax = axarr[0, 0]
wfct.visualization.visualize_cut_plane(
    cut_plane_sowfa, ax=ax, minSpeed=minspeed, maxSpeed=maxspeed
)
ax.set_title("SOWFA")

# FLORIS
ax = axarr[0, 1]
github NREL / floris / examples / visualization / subtract_inflow.py View on Github external
fi = wfct.floris_interface.FlorisInterface("../example_input.json")

# Single turbine at 0,0
fi.reinitialize_flow_field(layout_array=([0], [0]))

# Calculate wake
fi.calculate_wake()

# Grab some cross planes
D = 126
cut_plane_base_5 = fi.get_cross_plane(5 * D)
cut_plane_base_in = fi.get_cross_plane(-5 * D)


# Get the difference planes
cut_plane_diff = cp.subtract(cut_plane_base_5, cut_plane_base_in)


# Plot and show
fig, axarr = plt.subplots(3, 1, figsize=(7, 10))

ax = axarr[0]
wfct.visualization.visualize_cut_plane(cut_plane_base_5, ax=ax, minSpeed=4, maxSpeed=8)
ax.set_title("Baseline, 5D")

ax = axarr[1]
wfct.visualization.visualize_cut_plane(cut_plane_base_in, ax=ax, minSpeed=4, maxSpeed=8)
ax.set_title("Baseline, Inflow")

ax = axarr[2]
wfct.visualization.visualize_cut_plane(cut_plane_diff, ax=ax, minSpeed=-2, maxSpeed=2)
ax.set_title("5D - INFLOW")
github NREL / floris / examples / sowfa_comparisons / open_and_vis_sowfa.py View on Github external
# Set turbine location as 0,0
hor_plane = wfct.cut_plane.set_origin(hor_plane, 250.0, 200.0)
ax = axarr[1, 0]
wfct.visualization.visualize_cut_plane(hor_plane, ax=ax)
ax.set_title("Turbine at origin")

# Increase the resolution
hor_plane = wfct.cut_plane.change_resolution(hor_plane, resolution=(1000, 1000))
ax = axarr[2, 0]
wfct.visualization.visualize_cut_plane(hor_plane, ax=ax)
ax.set_title("Increased Resolution (Interpolation)")

# # Interpolate onto new array
x1_array = np.linspace(-50, 300)
x2_array = np.linspace(-100, 100)
hor_plane = wfct.cut_plane.interpolate_onto_array(hor_plane, x1_array, x2_array)
ax = axarr[0, 1]
wfct.visualization.visualize_cut_plane(hor_plane, ax=ax)
ax.set_title("Provided Grid")

# Express axis in terms of D
D = 126.0  # m
hor_plane = wfct.cut_plane.rescale_axis(hor_plane, x1_factor=D, x2_factor=D)
ax = axarr[1, 1]
wfct.visualization.visualize_cut_plane(hor_plane, ax=ax)
ax.set_title("Axis in D")

# Invert x1
ax = axarr[2, 1]
wfct.visualization.visualize_cut_plane(hor_plane, ax=ax)
wfct.visualization.reverse_cut_plane_x_axis_in_plot(ax=ax)
ax.set_title("Invert x axis")
github NREL / floris / examples / example_0010a_optimize_yaw_robust.py View on Github external
# Initialize the horizontal cut without uncertainty
fi.calculate_wake(yaw_angles=yaw_angles)
hor_plane = wfct.cut_plane.HorPlane(
    fi.get_hub_height_flow_data(x_resolution=400,
                                 y_resolution=100),
    fi.floris.farm.turbines[0].hub_height
)

# Plot and show
fig, ax = plt.subplots(figsize=(7.0, 5.0))
wfct.visualization.visualize_cut_plane(hor_plane, ax=ax)
ax.set_title('Optimal Wake Steering without Uncertainty for U = 8 m/s, Wind Direction = 273$^\circ$')

# Initialize the horizontal cut for robust wake steering with uncertainty
fi.calculate_wake(yaw_angles=yaw_angles_unc)
hor_plane = wfct.cut_plane.HorPlane(
    fi.get_hub_height_flow_data(x_resolution=400,
                                 y_resolution=100),
    fi.floris.farm.turbines[0].hub_height
)

# Plot and show
fig, ax = plt.subplots(figsize=(7.0, 5.0))
wfct.visualization.visualize_cut_plane(hor_plane, ax=ax)
ax.set_title('Optimal Wake Steering with Uncertainty for U = 8 m/s, Wind Direction = 273$^\circ$')
plt.show()