floris.uncertain_floris_model#

Functions

map_turbine_powers_uncertain(...)

Calculates the power at each turbine in the wind farm based on uncertainty weights.

Classes

ApproxFlorisModel(configuration[, ...])

The ApproxFlorisModel overloads the UncertainFlorisModel with the special case that the wd_sample_points = [0].

UncertainFlorisModel(configuration[, ...])

An interface for handling uncertainty in wind farm simulations.

class floris.uncertain_floris_model.UncertainFlorisModel(configuration, wd_resolution=1.0, ws_resolution=1.0, ti_resolution=0.01, yaw_resolution=1.0, power_setpoint_resolution=100, awc_amplitude_resolution=0.1, wd_std=3.0, wd_sample_points=None, fix_yaw_to_nominal_direction=False, verbose=False)[source]#

An interface for handling uncertainty in wind farm simulations.

This class contains a FlorisModel object and adds functionality to handle uncertainty in wind direction. It is designed to be used similarly to FlorisModel. In the model, the turbine powers are computed for a set of expanded wind conditions, given by wd_sample_points, and then the powers are computed as a gaussian blend of these expanded conditions.

To reduce computational costs, the wind directions, wind speeds, turbulence intensities, yaw angles, and power setpoints are rounded to specified resolutions. Only unique conditions from within the expanded set of conditions are run.

Args:
configuration (dict): The Floris configuration dictionary or YAML file.
The configuration should have the following inputs specified.
  • flow_field: See floris.simulation.flow_field.FlowField for more details.

  • farm: See floris.simulation.farm.Farm for more details.

  • turbine: See floris.simulation.turbine.Turbine for more details.

  • wake: See floris.simulation.wake.WakeManager for more details.

  • logging: See floris.simulation.core.Core for more details.

wd_resolution (float, optional): The resolution of wind direction for generating

gaussian blends, in degrees. Defaults to 1.0.

ws_resolution (float, optional): The resolution of wind speed, in m/s. Defaults to 1.0. ti_resolution (float, optional): The resolution of turbulence intensity.

Defaults to 0.01.

yaw_resolution (float, optional): The resolution of yaw angle, in degrees.

Defaults to 1.0.

power_setpoint_resolution (int, optional): The resolution of power setpoints, in kW.

Defaults to 100.

wd_std (float, optional): The standard deviation of wind direction. Defaults to 3.0. wd_sample_points (list[float], optional): The sample points for wind direction.

If not provided, defaults to [-2 * wd_std, -1 * wd_std, 0, wd_std, 2 * wd_std].

fix_yaw_to_nominal_direction (bool, optional): Fix the yaw angle to the nominal

direction? When False, the yaw misalignment is the same across the sampled wind directions. When True, the turbine orientation is fixed to the nominal wind direction such that the yaw misalignment changes depending on the sampled wind direction. Defaults to False.

verbose (bool, optional): Verbosity flag for printing messages. Defaults to False.

Parameters:

configuration (dict | str | Path) --

set(**kwargs)[source]#

Set the wind farm conditions in the UncertainFlorisModel.

See FlorisModel.set() for details of the contents of kwargs.

Args:

**kwargs: The wind farm conditions to set.

reset_operation()[source]#

Reset the operation of the underlying FlorisModel object.

run()[source]#

Run the simulation in the underlying FlorisModel object.

run_no_wake()[source]#

Run the simulation in the underlying FlorisModel object without wakes.

get_turbine_powers()[source]#
Calculate the power at each turbine in the wind farm. If WindRose or

WindTIRose is passed in, result is reshaped to match

Returns:

NDArrayFloat: An array containing the powers at each turbine for each findex.

get_farm_power(turbine_weights=None, use_turbulence_correction=False)[source]#

Report wind plant power from instance of floris. Optionally includes uncertainty in wind direction and yaw position when determining power. Uncertainty is included by computing the mean wind farm power for a distribution of wind direction and yaw position deviations from the original wind direction and yaw angles.

Args:
turbine_weights (NDArrayFloat | list[float] | None, optional):

weighing terms that allow the user to emphasize power at particular turbines and/or completely ignore the power from other turbines. This is useful when, for example, you are modeling multiple wind farms in a single floris object. If you only want to calculate the power production for one of those farms and include the wake effects of the neighboring farms, you can set the turbine_weights for the neighboring farms' turbines to 0.0. The array of turbine powers from floris is multiplied with this array in the calculation of the objective function. If None, this is an array with all values 1.0 and with shape equal to (n_findex, n_turbines). Defaults to None.

use_turbulence_correction: (bool, optional): When True uses a

turbulence parameter to adjust power output calculations. Defaults to False. Not currently implemented.

Returns:

float: Sum of wind turbine powers in W.

get_expected_farm_power(freq=None, turbine_weights=None)[source]#

Compute the expected (mean) power of the wind farm.

Return type:

float

Args:
freq (NDArrayFloat): NumPy array with shape (n_findex)

with the frequencies of each wind direction and wind speed combination. These frequencies should typically sum up to 1.0 and are used to weigh the wind farm power for every condition in calculating the wind farm's AEP. Defaults to None. If None and a WindData object was supplied, the WindData object's frequencies will be used. Otherwise, uniform frequencies are assumed (i.e., a simple mean over the findices is computed).

turbine_weights (NDArrayFloat | list[float] | None, optional):

weighing terms that allow the user to emphasize power at particular turbines and/or completely ignore the power from other turbines. This is useful when, for example, you are modeling multiple wind farms in a single floris object. If you only want to calculate the power production for one of those farms and include the wake effects of the neighboring farms, you can set the turbine_weights for the neighboring farms' turbines to 0.0. The array of turbine powers from floris is multiplied with this array in the calculation of the objective function. If None, this is an array with all values 1.0 and with shape equal to (n_findex, n_turbines). Defaults to None.

get_farm_AEP(freq=None, turbine_weights=None, hours_per_year=8760)[source]#

Estimate annual energy production (AEP) for distributions of wind speed, wind direction, frequency of occurrence, and yaw offset.

Return type:

float

Args:
freq (NDArrayFloat): NumPy array with shape (n_findex)

with the frequencies of each wind direction and wind speed combination. These frequencies should typically sum up to 1.0 and are used to weigh the wind farm power for every condition in calculating the wind farm's AEP. Defaults to None. If None and a WindData object was supplied, the WindData object's frequencies will be used. Otherwise, uniform frequencies are assumed.

turbine_weights (NDArrayFloat | list[float] | None, optional):

weighing terms that allow the user to emphasize power at particular turbines and/or completely ignore the power from other turbines. This is useful when, for example, you are modeling multiple wind farms in a single floris object. If you only want to calculate the power production for one of those farms and include the wake effects of the neighboring farms, you can set the turbine_weights for the neighboring farms' turbines to 0.0. The array of turbine powers from floris is multiplied with this array in the calculation of the objective function. If None, this is an array with all values 1.0 and with shape equal to (n_findex, n_turbines). Defaults to None.

hours_per_year (float, optional): Number of hours in a year. Defaults to 365 * 24.

Returns:
float:

The Annual Energy Production (AEP) for the wind farm in watt-hours.

copy()[source]#

Create an independent copy of the current UncertainFlorisModel object

property layout_x#

Wind turbine coordinate information.

Returns:

np.array: Wind turbine x-coordinate.

property layout_y#

Wind turbine coordinate information.

Returns:

np.array: Wind turbine y-coordinate.

property wind_directions#

Wind direction information.

Returns:

np.array: Wind direction.

property wind_speeds#

Wind speed information.

Returns:

np.array: Wind speed.

property turbulence_intensities#

Turbulence intensity information.

Returns:

np.array: Turbulence intensity.

property n_findex#

Number of unique wind conditions.

Returns:

int: Number of unique wind conditions.

property n_turbines#

Number of turbines in the wind farm.

Returns:

int: Number of turbines in the wind farm.

property core#

Returns the core of the unexpanded model.

Returns:

Floris: The core of the unexpanded model.

floris.uncertain_floris_model.map_turbine_powers_uncertain(unique_turbine_powers, map_to_expanded_inputs, weights, n_unexpanded, n_sample_points, n_turbines)[source]#

Calculates the power at each turbine in the wind farm based on uncertainty weights.

This function calculates the power at each turbine in the wind farm, considering the underlying turbine powers and applying a weighted sum to handle uncertainty.

Args:
unique_turbine_powers (NDArrayFloat): An array of unique turbine powers from the

underlying FlorisModel

map_to_expanded_inputs (NDArrayFloat): An array of indices mapping the unique powers to

the expanded powers

weights (NDArrayFloat): An array of weights for each wind direction sample point n_unexpanded (int): The number of unexpanded conditions n_sample_points (int): The number of wind direction sample points n_turbines (int): The number of turbines in the wind farm

Returns:

NDArrayFloat: An array containing the powers at each turbine for each findex.

class floris.uncertain_floris_model.ApproxFlorisModel(configuration, wd_resolution=1.0, ws_resolution=1.0, ti_resolution=0.01, yaw_resolution=1.0, power_setpoint_resolution=100, awc_amplitude_resolution=0.1, verbose=False)[source]#

The ApproxFlorisModel overloads the UncertainFlorisModel with the special case that the wd_sample_points = [0]. This is a special case where no uncertainty is added but the resolution of the values wind direction, wind speed etc are still reduced by the specified resolution. This allows for cases to be reused and a faster approximate result computed

Parameters:

configuration (dict | str | Path) --