foxes.models.wake_models.induction.rathmann

Classes

Rathmann

The Rathmann induction wake model

Module Contents

class foxes.models.wake_models.induction.rathmann.Rathmann(superposition: str = 'ws_linear', induction: str = 'Madsen', pre_rotor_only: bool = False)[source]

Bases: foxes.models.wake_models.turbine_induction_model.TurbineInductionModel

The Rathmann induction wake model

The individual wake effects are superposed linearly, without invoking a wake superposition model.

Notes

Reference: Forsting, Alexander R. Meyer, et al. “On the accuracy of predicting wind-farm blockage.” Renewable Energy (2023). https://www.sciencedirect.com/science/article/pii/S0960148123007620

Parameters:
superposition

The wind speed superposition

induction

The induction model

pre_rotor_only

Calculate only the pre-rotor region

contribute(algo: foxes.core.algorithm.Algorithm, mdata: foxes.core.data.MData, fdata: foxes.core.data.FData, tdata: foxes.core.data.TData, downwind_index: int, wake_coos: numpy.ndarray, wake_deltas: dict[str, numpy.ndarray]) None[source]

Modifies wake deltas at target points by contributions from the specified wake source turbines.

Parameters:
algo

The calculation algorithm

mdata

The model data

fdata

The farm data

tdata

The target point data

downwind_index

The index of the wake causing turbine in the downwind order

wake_coos

The wake frame coordinates of the evaluation points, shape: (n_states, n_targets, n_tpoints, 3)

wake_deltas

The wake deltas. Key: variable name, value (n_states, n_targets, n_tpoints, …)

finalize(algo: foxes.core.algorithm.Algorithm, verbosity: int = 0) None

Finalize the model.

Parameters:
algo

The calculation algorithm.

verbosity

The verbosity level; 0 is silent.

finalize_wake_deltas(algo: foxes.core.algorithm.Algorithm, mdata: foxes.core.data.MData, fdata: foxes.core.data.FData, tdata: foxes.core.data.TData, wake_deltas: dict[str, numpy.ndarray]) None

Finalize the wake calculation.

Modifies wake_deltas on the fly.

Parameters:
algo

The calculation algorithm

mdata

The model data

fdata

The farm data

tdata

The target point data

wake_deltas

The wake deltas object at the selected target turbines. Keys are variable names and values are arrays with shape (n_states, n_targets, n_tpoints)

get_data(variable: str, target: str, lookup: str = 'smfp', mdata: foxes.core.data.MData | None = None, fdata: foxes.core.data.FData | None = None, tdata: foxes.core.data.TData | None = None, downwind_index: int | None = None, accept_none: False = False, accept_nan: bool = True, algo: foxes.core.algorithm.Algorithm | None = None, upcast: bool = False, selection: numpy.ndarray[Any, Any] | tuple[Any, ...] | list[Any] | None = None) numpy.ndarray[Any, Any]
get_data(variable: str, target: str, lookup: str = 'smfp', mdata: foxes.core.data.MData | None = None, fdata: foxes.core.data.FData | None = None, tdata: foxes.core.data.TData | None = None, downwind_index: int | None = None, accept_none: True = True, accept_nan: bool = True, algo: foxes.core.algorithm.Algorithm | None = None, upcast: bool = False, selection: numpy.ndarray[Any, Any] | tuple[Any, ...] | list[Any] | None = None) numpy.ndarray[Any, Any] | None

Getter for a data entry in the model object or provided data sources

Parameters:
variable

The variable name used as the data key.

target

The dimensions identifier for the output: FC.STATE_TURBINE, FC.STATE_TARGET, or FC.STATE_TARGET_TPOINT.

lookup

The order of data sources. Combination of: 's' for self, 'm' for mdata, 'f' for fdata, 't' for tdata, and 'w' for wake-modeling data.

mdata

The model data.

fdata

The farm data.

tdata

The target point data.

downwind_index

The index in the downwind order.

accept_none

Do not raise an error if the data entry is None.

accept_nan

Do not raise an error if the data entry is np.nan.

algo

The algorithm, needed for data from previous iterations.

upcast

Ensure the target dimensions are present. If expansion is needed, the result is a read-only broadcasted view.

selection

Apply this selection to the result, for state-turbine, state-target, or state-target-tpoint outputs.

initialize(algo: foxes.core.algorithm.Algorithm, loaded_data: foxes.core.model.LoadedData | None = None, force: bool = False, verbosity: int = 0) foxes.core.model.LoadedData[source]

Initializes the model.

Parameters:
algo

The calculation algorithm

loaded_data

Data that has already been loaded, to be extended by this function. Keys are “coords”, a dict with entries dim_name_str -> dim_array; “data_vars”, a dict with entries name_str -> (dim_tuple, data_ndarray); and “extra_data”, a dict with non-array additional data.

force

Overwrite existing data

verbosity

The verbosity level, 0 = silent

Returns:
loaded_data

The loaded data, containing keys “coords”, “data_vars”, and “extra_data”. Keys are “coords”, a dict with entries dim_name_str -> dim_array; “data_vars”, a dict with entries name_str -> (dim_tuple, data_ndarray); and “extra_data”, a dict with non-array additional data.

load_data(algo: foxes.core.algorithm.Algorithm, loaded_data: LoadedData, force: bool = False, verbosity: int = 0) None

Load and/or create all data required for model calculations.

The function adds to loaded_data.

Parameters:
algo

The calculation algorithm.

loaded_data

Data that has already been loaded, to be extended by this function. Keys are “coords”, a dict with entries dim_name_str -> dim_array; “data_vars”, a dict with entries name_str -> (dim_tuple, data_ndarray); and “extra_data”, a dict with non-array additional data.

force

Overwrite existing data.

verbosity

The verbosity level, where 0 is silent.

classmethod new(wmodel_type: str, *args: Any, **kwargs: Any) TurbineInductionModel

Run-time turbine induction model factory.

Parameters:
wmodel_type

The selected derived class name

args

Additional parameters for constructor

kwargs

Additional parameters for constructor

new_wake_deltas(algo: foxes.core.algorithm.Algorithm, mdata: foxes.core.data.MData, fdata: foxes.core.data.FData, tdata: foxes.core.data.TData) dict[str, numpy.ndarray][source]

Creates new empty wake delta arrays.

Parameters:
algo

The calculation algorithm

mdata

The model data

fdata

The farm data

tdata

The target point data

Returns:
wake_deltas

Key: variable name, value: The zero filled wake deltas, shape: (n_states, n_targets, n_tpoints, …)

set_running(algo: foxes.core.algorithm.Algorithm, data_stash: dict[str, dict[str, Any]] | None, sel: dict[str, Any] | None = None, isel: dict[str, Any] | None = None, verbosity: int = 0) None

Set this model to the running state and move large data to the stash.

The stashed data is restored by unset_running after the calculation has finished.

Parameters:
algo

The calculation algorithm.

data_stash

The large-data stash. This function adds entries here when provided. Keys are model names and values are dictionaries of large model data.

sel

The subset selection dictionary.

isel

The index subset selection dictionary.

verbosity

The verbosity level; 0 is silent.

sub_models() list[foxes.core.model.Model][source]

List of all sub-models

Returns:
smdls

All sub models

unset_running(algo: foxes.core.algorithm.Algorithm, data_stash: dict[str, dict[str, Any]] | None, sel: dict[str, Any] | None = None, isel: dict[str, Any] | None = None, verbosity: int = 0) None

Set this model status to not running and recover large data from stash.

Parameters:
algo

The calculation algorithm.

data_stash

Reconstruct model data from this stash when provided. Keys are model names and values are dictionaries of large model data.

sel

The subset selection dictionary.

isel

The index subset selection dictionary.

verbosity

The verbosity level; 0 is silent.

unvar(vnm: str) str | None

Translate a model-specific variable name to the original variable name.

Parameters:
vnm

The model-specific variable name.

Returns:
v

The original variable name.

var(v: str) str

Create a model-specific variable name.

Parameters:
v

The variable name.

Returns:
vnm

The model-specific variable name.

waked_variables() list[str][source]

Returns a list of variable names that are affected by this wake model.

Returns:
waked_variables

A list of variable names affected by this wake model.

property affects_downwind : bool

Flag for downwind or upwind effects on other turbines

Returns:
affects_downwind

Flag for downwind effects by this model

property affects_ws : bool

Flag for wind speed wake models

Returns:
dws

If True, this model affects wind speed

property has_uv : bool

This model uses wind vector data

Returns:
has_uv

Flag for wind vector data

property has_vector_wind_superp : bool

This model uses a wind vector superposition

Returns:
has_vector_wind_superp

Flag for wind vector superposition

induction = 'Madsen'
property initialized : bool

Initialization flag.

Returns:
initialized

True if the model has been initialized.

property model_id : int

Unique id based on the model type.

Returns:
int

Unique id of the model object

name = 'Model'
other_superpositions
pre_rotor_only = False
property running : bool

Flag for currently running models

Returns:
running

True if currently running

superp : dict[str, Any]
vec_superp : Any | None = None
wind_superposition = None