SimulationResult

class py_wake.wind_farm_models.wind_farm_model.SimulationResult(windFarmModel, localWind, type_i, WS_eff_ilk, TI_eff_ilk, power_ilk, ct_ilk, **kwargs)[source]

Simulation result returned when calling a WindFarmModel object

aep_ilk([normalize_probabilities, ...])

Anual Energy Production of all turbines (i), wind directions (l) and wind speeds (k) in in GWh

aep([normalize_probabilities, ...])

Anual Energy Production (sum of all wind turbines, directions and speeds) in GWh.

flow_map([grid, wd, ws, time, D_dst])

Return a FlowMap object with WS_eff and TI_eff of all grid points

aep(normalize_probabilities=False, with_wake_loss=True, hours_pr_year=8760, linear_power_segments=False)[source]

Anual Energy Production (sum of all wind turbines, directions and speeds) in GWh.

See aep_ilk

aep_ilk(normalize_probabilities=False, with_wake_loss=True)[source]

Anual Energy Production of all turbines (i), wind directions (l) and wind speeds (k) in in GWh

Parameters:
  • normalize_propabilities (Optional bool, defaults to False) –

    In case only a subset of all wind speeds and/or wind directions is simulated, this parameter determines whether the returned AEP represents the energy produced in the fraction of a year where these flow cases occur or a whole year of only these cases. If for example, wd=[0], then - False means that the AEP only includes energy from the faction of year

    with northern wind (359.5-0.5deg), i.e. no power is produced the rest of the year. - True means that the AEP represents a whole year of northen wind.

  • with_wake_loss (Optional bool, defaults to True) –

    If True, wake loss is included, i.e. power is calculated using local effective wind speed

    If False, wake loss is neglected, i.e. power is calculated using local free flow wind speed

flow_map(grid=None, wd=None, ws=None, time=None, D_dst=0)[source]

Return a FlowMap object with WS_eff and TI_eff of all grid points

Parameters:
  • grid (Grid or tuple(X, Y, x, y, h)) –

    Grid, e.g. HorizontalGrid or

    tuple(X, Y, x, y, h) where X, Y is the meshgrid for visualizing data

    and x, y, h are the flattened grid points

  • wd (int, float, array_like or None) – Wind directions to include in the flow map (if more than one, an weighted average will be computed) The simulation result must include the requested wind directions. If None, an weighted average of all wind directions from the simulation results will be computed. Note, computing a flow map with multiple wind directions may be slow

  • ws (int, array_like or None) – Same as “wd”, but for wind speed

  • ws – Same as “wd”, but for time

  • D_dst (int, float or None) – In combination with a rotor average model, D_dst defines the downstream rotor diameter at which the deficits will be averaged

See also

pywake.wind_farm_models.flow_map.FlowMap

static load(filename, wfm)[source]

Manually trigger loading and/or computation of this dataset’s data from disk or a remote source into memory and return this dataset. Unlike compute, the original dataset is modified and returned.

Normally, it should not be necessary to call this method in user code, because all xarray functions should either work on deferred data or load data automatically. However, this method can be necessary when working with many file objects on disk.

Parameters:

**kwargs (dict) – Additional keyword arguments passed on to dask.compute.

See also

dask.compute

sel(indexers=None, method=None, tolerance=None, drop=False, **indexers_kwargs)[source]

Returns a new dataset with each array indexed by tick labels along the specified dimension(s).

In contrast to Dataset.isel, indexers for this method should use labels instead of integers.

Under the hood, this method is powered by using pandas’s powerful Index objects. This makes label based indexing essentially just as fast as using integer indexing.

It also means this method uses pandas’s (well documented) logic for indexing. This means you can use string shortcuts for datetime indexes (e.g., ‘2000-01’ to select all values in January 2000). It also means that slices are treated as inclusive of both the start and stop values, unlike normal Python indexing.

Parameters:
  • indexers (dict, optional) – A dict with keys matching dimensions and values given by scalars, slices or arrays of tick labels. For dimensions with multi-index, the indexer may also be a dict-like object with keys matching index level names. If DataArrays are passed as indexers, xarray-style indexing will be carried out. See indexing for the details. One of indexers or indexers_kwargs must be provided.

  • method ({None, "nearest", "pad", "ffill", "backfill", "bfill"}, optional) –

    Method to use for inexact matches:

    • None (default): only exact matches

    • pad / ffill: propagate last valid index value forward

    • backfill / bfill: propagate next valid index value backward

    • nearest: use nearest valid index value

  • tolerance (optional) – Maximum distance between original and new labels for inexact matches. The values of the index at the matching locations must satisfy the equation abs(index[indexer] - target) <= tolerance.

  • drop (bool, optional) – If drop=True, drop coordinates variables in indexers instead of making them scalar.

  • **indexers_kwargs ({dim: indexer, ...}, optional) – The keyword arguments form of indexers. One of indexers or indexers_kwargs must be provided.

Returns:

obj – A new Dataset with the same contents as this dataset, except each variable and dimension is indexed by the appropriate indexers. If indexer DataArrays have coordinates that do not conflict with this object, then these coordinates will be attached. In general, each array’s data will be a view of the array’s data in this dataset, unless vectorized indexing was triggered by using an array indexer, in which case the data will be a copy.

Return type:

Dataset

See also

Dataset.isel, DataArray.sel