floris.core.flow_field#

Classes

FlowField(wind_speeds, wind_directions, ...)

class floris.core.flow_field.FlowField(wind_speeds, wind_directions, wind_veer, wind_shear, air_density, turbulence_intensities, reference_wind_height, heterogeneous_inflow_config=None, multidim_conditions=None)[source]#
Parameters:
  • wind_speeds (Iterable)

  • wind_directions (Iterable)

  • wind_veer (float)

  • wind_shear (float)

  • air_density (float)

  • turbulence_intensities (Iterable)

  • reference_wind_height (float)

  • heterogeneous_inflow_config (dict)

  • multidim_conditions (dict)

wind_speeds: NDArrayFloat#
wind_directions: NDArrayFloat#
wind_veer: float#
wind_shear: float#
air_density: float#
turbulence_intensities: NDArrayFloat#
reference_wind_height: float#
heterogeneous_inflow_config: dict#
multidim_conditions: dict#
n_findex: int#
u_initial_sorted: NDArrayFloat#
v_initial_sorted: NDArrayFloat#
w_initial_sorted: NDArrayFloat#
u_sorted: NDArrayFloat#
v_sorted: NDArrayFloat#
w_sorted: NDArrayFloat#
u: NDArrayFloat#
v: NDArrayFloat#
w: NDArrayFloat#
het_map: list#
dudz_initial_sorted: NDArrayFloat#
turbulence_intensity_field: NDArrayFloat#
turbulence_intensity_field_sorted: NDArrayFloat#
turbulence_intensity_field_sorted_avg: NDArrayFloat#
turbulence_intensities_validator(instance, value)[source]#
Return type:

None

Parameters:
  • instance (Attribute)

  • value (ndarray[Any, dtype[float64]])

wind_directions_validator(instance, value)[source]#
Return type:

None

Parameters:
  • instance (Attribute)

  • value (ndarray[Any, dtype[float64]])

wind_speeds_validator(instance, value)[source]#
Return type:

None

Parameters:
  • instance (Attribute)

  • value (ndarray[Any, dtype[float64]])

heterogeneous_config_validator(instance, value)[source]#

Using the validator method to check that the heterogeneous_inflow_config dictionary has the correct key-value pairs.

Return type:

None

Parameters:
  • instance (Attribute)

  • value (dict | None)

het_map_validator(instance, value)[source]#

Using this validator to make sure that the het_map has an interpolant defined for each findex.

Return type:

None

Parameters:
  • instance (Attribute)

  • value (list | None)

initialize_velocity_field(grid)[source]#
Return type:

None

Parameters:

grid (Grid)

finalize(unsorted_indices)[source]#
calculate_speed_ups(het_map, x, y, z=None)[source]#
generate_heterogeneous_wind_map()[source]#

This function creates the heterogeneous interpolant used to calculate heterogeneous inflows. The interpolant is for computing wind speed based on an x and y location in the flow field. This is computed using SciPy's LinearNDInterpolator and uses a fill value equal to the freestream for interpolated values outside of the user-defined heterogeneous map bounds.

Args:

heterogeneous_inflow_config (dict): The heterogeneous inflow configuration dictionary. The configuration should have the following inputs specified.

  • speed_multipliers (list): A list of speed up factors that will multiply

    the specified freestream wind speed. This 2-dimensional array should have an array of multiplicative factors defined for each wind direction.

  • x (list): A list of x locations at which the speed up factors are defined.

  • y: A list of y locations at which the speed up factors are defined.

  • z (optional): A list of z locations at which the speed up factors are defined.

static interpolate_multiplier_xy(x, y, multiplier, fill_value=1.0)[source]#

Return an interpolant for a 2D multiplier field.

Args:

x (NDArrayFloat): x locations y (NDArrayFloat): y locations multiplier (NDArrayFloat): multipliers fill_value (float): fill value for points outside the region

Returns:

LinearNDInterpolator: interpolant

Parameters:
  • x (ndarray[Any, dtype[float64]])

  • y (ndarray[Any, dtype[float64]])

  • multiplier (ndarray[Any, dtype[float64]])

  • fill_value (float)

static interpolate_multiplier_xyz(x, y, z, multiplier, fill_value=1.0)[source]#

Return an interpolant for a 3D multiplier field.

Args:

x (NDArrayFloat): x locations y (NDArrayFloat): y locations z (NDArrayFloat): z locations multiplier (NDArrayFloat): multipliers fill_value (float): fill value for points outside the region

Returns:

LinearNDInterpolator: interpolant

Parameters:
  • x (ndarray[Any, dtype[float64]])

  • y (ndarray[Any, dtype[float64]])

  • z (ndarray[Any, dtype[float64]])

  • multiplier (ndarray[Any, dtype[float64]])

  • fill_value (float)