ard.offshore.mooring_constraint#

Functions

calc_mooring_distances(mooring_points)

Calculate the minimum distances between each set of mooring lines

convert_inputs_x_y_to_xy(x_turbines, ...)

Convert from inputs of x for turbines, y for turbines, x for anchors, and y for anchors to single array for mooring specification that is of shape (n_turbines, n_anchors+1, 2).

convert_inputs_x_y_z_to_xyz(x_turbines, ...)

Convert from inputs of x for turbines, y for turbines, z for turbines, x for anchors, y for anchors, and z for anchors to single array for mooring specification that is of shape (n_turbines, n_anchors+1, 3).

distance_mooring_to_mooring(P_mooring_A, ...)

Calculate the distance from one set of mooring lines to another.

distance_point_to_mooring(point, P_mooring)

mooring_constraint_xy(x_turbines, ...)

Mooring distance calculation in 2 dimensions

mooring_constraint_xy_jac(x_turbines, ...)

Jacobian of mooring_constraint_xy with respect to positional argument(s) [0, 1, 2, 3].

mooring_constraint_xyz(x_turbines, ...)

Mooring distance calculation in 3 dimensions.

mooring_constraint_xyz_jac(x_turbines, ...)

Jacobian of mooring_constraint_xyz with respect to positional argument(s) [0, 1, 2, 3, 4].

Classes

MooringConstraint(**kwargs)

A class to calculate the mooring line spacing distance for use in optimization constraints.

class ard.offshore.mooring_constraint.MooringConstraint(**kwargs)[source]#

A class to calculate the mooring line spacing distance for use in optimization constraints. Mooring lines may be defined in 2D or 3D, but the turbine positions are always assumed to be at sea level (z=0).

Options#

modeling_optionsdict

a modeling options dictionary (inherited from FarmAeroTemplate)

wind_queryfloris.wind_data.WindRose

a WindQuery objects that specifies the wind conditions that are to be computed

bathymetry_dataard.geographic.BathymetryData

a BathymetryData object to specify the bathymetry mesh/sampling

Inputs#

x_turbinesnp.ndarray

a 1D numpy array indicating the x-dimension locations of the turbines, with length N_turbines (mirrored w.r.t. FarmAeroTemplate)

y_turbinesnp.ndarray

a 1D numpy array indicating the y-dimension locations of the turbines, with length N_turbines (mirrored w.r.t. FarmAeroTemplate)

x_anchorsnp.ndarray

a 1D numpy array indicating the x-dimension locations of the mooring system anchors, with shape N_turbines x N_anchors

y_anchorsnp.ndarray

a 1D numpy array indicating the y-dimension locations of the mooring system anchors, with shape N_turbines x N_anchors

z_anchors (optional)np.ndarray

a 1D numpy array indicating the z-dimension locations of the mooring system anchors, with shape N_turbines x N_anchors

initialize()[source]#

Initialization of the OpenMDAO component.

setup()[source]#

Setup of the OpenMDAO component.

setup_partials()[source]#

Derivative setup for the OpenMDAO component.

compute(inputs, outputs, discrete_inputs=None, discrete_outputs=None)[source]#

Computation for the OpenMDAO component.

compute_partials(inputs, partials, discrete_inputs=None)[source]#

Compute sub-jacobian parts. The model is assumed to be in an unscaled state.

Parameters:
  • inputs (Vector) -- Unscaled, dimensional input variables read via inputs[key].

  • partials (Jacobian) -- Sub-jac components written to partials[output_name, input_name]..

  • discrete_inputs (dict or None) -- If not None, dict containing discrete input values.

ard.offshore.mooring_constraint.mooring_constraint_xy(x_turbines, y_turbines, x_anchors, y_anchors)[source]#

Mooring distance calculation in 2 dimensions

Parameters:
  • x_turbines (np.ndarray) -- array of turbine x positions

  • y_turbines (np.ndarray) -- array of turbine y positions

  • x_anchors (np.ndarray) -- array of anchor x positions

  • y_anchors (np.ndarray) -- array of anchor y positions

Returns:

1D array of distances with length (n_turbines - 1)*n_turbines/2

Return type:

np.ndarray

ard.offshore.mooring_constraint.mooring_constraint_xy_jac(x_turbines, y_turbines, x_anchors, y_anchors)#

Jacobian of mooring_constraint_xy with respect to positional argument(s) [0, 1, 2, 3]. Takes the same arguments as mooring_constraint_xy but returns the jacobian of the output with respect to the arguments at positions [0, 1, 2, 3].

Parameters:
  • x_turbines (ndarray)

  • y_turbines (ndarray)

  • x_anchors (ndarray)

  • y_anchors (ndarray)

ard.offshore.mooring_constraint.mooring_constraint_xyz(x_turbines, y_turbines, x_anchors, y_anchors, z_anchors)[source]#

Mooring distance calculation in 3 dimensions. The third dimension is only required for the anchors since the turbine platforms are all assumed to be at sea level.

Parameters:
  • x_turbines (np.ndarray) -- array of turbine x positions

  • y_turbines (np.ndarray) -- array of turbine y positions

  • x_anchors (np.ndarray) -- array of anchor x positions

  • y_anchors (np.ndarray) -- array of anchor y positions

  • z_anchors (np.ndarray) -- array of anchor z positions

Returns:

1D array of distances with length (n_turbines - 1)*n_turbines/2

Return type:

np.ndarray

ard.offshore.mooring_constraint.mooring_constraint_xyz_jac(x_turbines, y_turbines, x_anchors, y_anchors, z_anchors)#

Jacobian of mooring_constraint_xyz with respect to positional argument(s) [0, 1, 2, 3, 4]. Takes the same arguments as mooring_constraint_xyz but returns the jacobian of the output with respect to the arguments at positions [0, 1, 2, 3, 4].

Parameters:
  • x_turbines (ndarray)

  • y_turbines (ndarray)

  • x_anchors (ndarray)

  • y_anchors (ndarray)

  • z_anchors (ndarray)

ard.offshore.mooring_constraint.calc_mooring_distances(mooring_points)[source]#

Calculate the minimum distances between each set of mooring lines

Return type:

ndarray

Parameters:
  • mooring_points (np.ndarray) -- array of mooring points of shape

  • (n_turbines

  • n_anchors+1

  • 3 (n_dimensions) where n_dimensions may be 2 or)

Returns:

1D array of distances with length (n_turbines - 1)*n_turbines/2

Return type:

np.ndarray

ard.offshore.mooring_constraint.convert_inputs_x_y_to_xy(x_turbines, y_turbines, x_anchors, y_anchors)[source]#

Convert from inputs of x for turbines, y for turbines, x for anchors, and y for anchors to single array for mooring specification that is of shape (n_turbines, n_anchors+1, 2). for each set of points, the turbine position is given first followed by the anchor positions.

Return type:

ndarray

Parameters:
  • x_turbines (np.ndarray) -- array of turbine x positions

  • y_turbines (np.ndarray) -- array of turbine y positions

  • x_anchors (np.ndarray) -- array of anchor x positions

  • y_anchors (np.ndarray) -- array of anchor y positions

Returns:

all turbine and anchor location information combined into a single

array of shape (n_turbines, n_anchors+1, 2)

Return type:

np.ndarray

ard.offshore.mooring_constraint.convert_inputs_x_y_z_to_xyz(x_turbines, y_turbines, z_turbines, x_anchors, y_anchors, z_anchors)[source]#

Convert from inputs of x for turbines, y for turbines, z for turbines, x for anchors, y for anchors, and z for anchors to single array for mooring specification that is of shape (n_turbines, n_anchors+1, 3). for each set of points, the turbine position is given first followed by the anchor positions.

Return type:

ndarray

Parameters:
  • x_turbines (np.ndarray) -- array of turbine x positions

  • y_turbines (np.ndarray) -- array of turbine y positions

  • z_turbines (np.ndarray) -- array of turbine z positions

  • x_anchors (np.ndarray) -- array of anchor x positions

  • y_anchors (np.ndarray) -- array of anchor y positions

  • z_anchors (np.ndarray) -- array of anchor z positions

Returns:

all input information combined into a single array of shape (n_turbines, n_anchors+1, 3)

Return type:

np.ndarray

ard.offshore.mooring_constraint.distance_point_to_mooring(point, P_mooring)[source]#
Return type:

float

Parameters:
  • point (ndarray)

  • P_mooring (ndarray)

Find the distance from a point to a set of mooring lines for a single floating wind turbine.

While arguments may be given in either 2d ([x,y]) or 3d ([x,y,z]), the point of interest and the mooring line points must all be given with the same number of dimensions.

Parameters:
  • point (np.ndarray) -- Point of interest in 2d ([x,y]) or 3d ([x,y,z]).

  • P_mooring (np.ndarray) -- The set of points defining the mooring line layout. The first point should be the center, the rest of the points define the anchor points. Points may be given in 2d ([x,y]) or 3d ([x,y,z]).

Returns:

The shortest distance from the point of interest to the set of mooring lines.

Return type:

float

ard.offshore.mooring_constraint.distance_mooring_to_mooring(P_mooring_A, P_mooring_B)[source]#

Calculate the distance from one set of mooring lines to another. Moorings are defined with the center point (platform location) first, followed by the anchor points in no specific order.

Return type:

float

Parameters:
  • P_mooring_A (np.ndarray) -- ndarray of points of mooring A of shape (npoints, nd) (e.g. (4, (x, y, z))). Center point must come first.

  • P_mooring_B (np.ndarray) -- ndarray of points of mooring B of shape (npoints, nd) (e.g. (4, (x, y, z))). Center point must come first.

Returns:

shortest distance between the two sets of moorings

Return type:

float