floris.cut_plane#

Functions

calculate_power(cross_plane, x1_loc, x2_loc, ...)

Calculate maximum power available in a given cross plane.

calculate_wind_speed(cross_plane, x1_loc, ...)

Calculate effective wind speed within specified range of a point.

change_resolution(cut_plane[, resolution])

Modify default resolution of a CutPlane object.

get_plane_from_flow_data(flow_data[, ...])

Get a plane of data, in form of DataFrame, from a FlowData object.

get_power_profile(cross_plane, x2_loc, ...)

interpolate_onto_array(cut_plane_in, ...)

Interpolate a CutPlane object onto specified coordinate arrays.

nudge_outward(x)

Avoid numerical issue in grid data by slightly expanding input x.

project_onto(cut_plane_a, cut_plane_b)

Project cut_plane_a onto the x1, x2 of cut_plane_b

rescale_axis(cut_plane[, x1_factor, x2_factor])

Stretch or compress CutPlane coordinates.

set_origin(cut_plane[, center_x1, center_x2])

Establish the origin of a CutPlane object.

wind_speed_profile(cross_plane, R, x2_loc[, ...])

Classes

CutPlane(df, x1_resolution, x2_resolution, ...)

A CutPlane object represents a 2D slice through the flow of a FLORIS simulation, or other such as SOWFA result.

floris.cut_plane.nudge_outward(x)[source]#

Avoid numerical issue in grid data by slightly expanding input x. TODO: expand this description - What numerical issues? - Whats the scenario when I would need this?

Args:

x (np.array): Vector of values.

Returns:

np.array: Expanded vector.

floris.cut_plane.get_plane_from_flow_data(flow_data, normal_vector='z', x3_value=100)[source]#

Get a plane of data, in form of DataFrame, from a FlowData object. This is used to get planes from SOWFA results and FLORIS simulations with fixed grids, i.e. curl.

Args:
flow_data (np.array): 3D vector field of velocity data. #TODO: is this

supposed to be a FlowData object?

normal_vector (string, optional): Vector normal to plane.

Defaults to z.

x3_value (float, optional): Value of normal vector to slice through.

Defaults to 100.

Returns:

pandas.DataFrame: Extracted data.

class floris.cut_plane.CutPlane(df, x1_resolution, x2_resolution, normal_vector)[source]#

A CutPlane object represents a 2D slice through the flow of a FLORIS simulation, or other such as SOWFA result.

floris.cut_plane.set_origin(cut_plane, center_x1=0.0, center_x2=0.0)[source]#

Establish the origin of a CutPlane object.

Args:
cut_plane (CutPlane):

Plane of data.

center_x1 (float, optional): x1-coordinate of origin.

Defaults to 0.0.

center_x2 (float, optional): x2-coordinate of origin.

Defaults to 0.0.

Returns:
cut_plane (CutPlane):

Updated plane of data.

floris.cut_plane.change_resolution(cut_plane, resolution=(100, 100))[source]#

Modify default resolution of a CutPlane object.

Args:
cut_plane (CutPlane):

Plane of data.

resolution (tuple, optional): Desired resolution in x1 and x2.

Defaults to (100, 100).

Returns:
cut_plane (CutPlane):

Updated plane of data.

floris.cut_plane.interpolate_onto_array(cut_plane_in, x1_array, x2_array)[source]#

Interpolate a CutPlane object onto specified coordinate arrays.

Args:
cut_plane (CutPlane):

Plane of data.

x1_array (np.array): Specified x1-coordinate. x2_array (np.array): Specified x2-coordinate.

Returns:
cut_plane (CutPlane):

Updated plane of data.

floris.cut_plane.rescale_axis(cut_plane, x1_factor=1.0, x2_factor=1.0)[source]#

Stretch or compress CutPlane coordinates.

Args:
cut_plane (CutPlane):

Plane of data.

x1_factor (float): Scaling factor for x1-coordinate. x2_factor (float): Scaling factor for x2-coordinate.

Returns:
cut_plane (CutPlane):

Updated plane of data.

floris.cut_plane.project_onto(cut_plane_a, cut_plane_b)[source]#

Project cut_plane_a onto the x1, x2 of cut_plane_b

Args:
cut_plane_a (CutPlane):

Plane of data to project from.

cut_plane_b (CutPlane):

Plane of data to project onto.

Returns:
cut_plane (CutPlane):

Cut_plane_a projected onto cut_plane_b's axis.

floris.cut_plane.calculate_wind_speed(cross_plane, x1_loc, x2_loc, R)[source]#

Calculate effective wind speed within specified range of a point.

Args:
cross_plane (floris.cut_plane.CrossPlane):

plane of data.

x1_loc (float): x1-coordinate of point of interest. x2_loc (float): x2-coordinate of point of interest. R (float): radius from point of interest to consider

Returns:

(float): effective wind speed

floris.cut_plane.wind_speed_profile(cross_plane, R, x2_loc, resolution=100, x1_locs=None)[source]#
floris.cut_plane.calculate_power(cross_plane, x1_loc, x2_loc, R, ws_array, cp_array, air_density=1.225)[source]#

Calculate maximum power available in a given cross plane.

Args:
cross_plane (floris.cut_plane.CrossPlane):

plane of data.

x1_loc (float): x1-coordinate of point of interest. x2_loc (float): x2-coordinate of point of interest. R (float): Radius of wind turbine rotor. ws_array (np.array): reference wind speed for cp curve. cp_array (np.array): cp curve at reference wind speeds. air_density (float, optional): air density. Defaults to 1.225.

Returns:

float: Power!

floris.cut_plane.get_power_profile(cross_plane, x2_loc, ws_array, cp_array, R, air_density=1.225, resolution=100, x1_locs=None)[source]#