ard.layout.spacing#

Functions

calculate_turbine_spacing(x_turbines, y_turbines)

Calculate the spacing between every pair of turbines with no duplicates.

calculate_turbine_spacing_jac(x_turbines, ...)

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

Classes

TurbineSpacing(**kwargs)

A class to return distances between each pair of turbines without duplicates.

class ard.layout.spacing.TurbineSpacing(**kwargs)[source]#

A class to return distances between each pair of turbines without duplicates.

Options#

modeling_optionsdict

a modeling options dictionary (inherited from FarmAeroTemplate)

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)

turbine_spacingnp.ndarray

a 1D numpy array indicating the distances between turbines, with length (N_turbines - 1)*N_turbines/2. where, for 3 turbines, turbine_spacing[0] is the distance between turbines 0 and 1, turbine_spacing[1] is the distance between turbines 0 and 2, and turbine_spacing[2] is the distance between turbines 1 and 2. The array is the flattened upper-triangular portion of the distance matrix.

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.layout.spacing.calculate_turbine_spacing(x_turbines, y_turbines)[source]#

Calculate the spacing between every pair of turbines with no duplicates.

Return type:

ndarray

Parameters:
  • x_turbines (np.ndarray) -- a 1D numpy array indicating the x-dimension locations of the turbines, with length N_turbines.

  • y_turbines (np.ndarray) -- a 1D numpy array indicating the y-dimension locations of the turbines, with length N_turbines.

Returns:

a 1D numpy array indicating the distances between turbines

with length (N_turbines - 1)*N_turbines/2. The array is the flattened upper-triangular portion of the distance matrix. For 3 turbines, turbine_spacing[0] is the distance between turbines 0 and 1, turbine_spacing[1] is the distance between turbines 0 and 2, and turbine_spacing[2] is the distance between turbines 1 and 2.

Return type:

turbine distances (np.ndarray)

ard.layout.spacing.calculate_turbine_spacing_jac(x_turbines, y_turbines)#

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

Return type:

ndarray

Parameters:
  • x_turbines (ndarray)

  • y_turbines (ndarray)