foxes.models.wake_superpositions.ws_pow¶
Classes¶
Power superposition of wind deficit results. |
Module Contents¶
-
class foxes.models.wake_superpositions.ws_pow.WSPow(pow: float, scale_amb: bool =
False, scale_target: bool =False, lim_low: float | None =None, lim_high: float | None =None)[source]¶ Bases:
foxes.core.WakeSuperpositionPower superposition of wind deficit results.
- Parameters:¶
- pow
Power to which wake results are raised.
- scale_amb
Flag for selecting ambient instead of waked wind speed.
- scale_target
Flag for selecting target instead of source turbine wind speed.
- lim_low
Lower limit of the final waked wind speed.
- lim_high
Upper limit of the final waked wind speed.
- add_wake(algo: foxes.core.algorithm.Algorithm, mdata: foxes.core.data.MData, fdata: foxes.core.data.FData, tdata: foxes.core.data.TData, downwind_index: int, st_sel: numpy.ndarray, variable: str, wake_delta: numpy.ndarray, wake_model_result: numpy.ndarray) numpy.ndarray[source]¶
Add a selected wake contribution to the accumulated deficit.
- calc_final_wake_delta(algo: foxes.core.algorithm.Algorithm, mdata: foxes.core.data.MData, fdata: foxes.core.data.FData, tdata: foxes.core.data.TData, variable: str, wake_delta: numpy.ndarray) numpy.ndarray[source]¶
Apply optional wind-speed limits to the accumulated deficit.
-
finalize(algo: foxes.core.algorithm.Algorithm, verbosity: int =
0) None¶ Finalize the model.
- Parameters:¶
- algo
The calculation algorithm.
- verbosity
The verbosity level;
0is silent.
-
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, orFC.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: LoadedData | None =
None, force: bool =False, verbosity: int =0) LoadedData¶ Initialize 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 entriesname_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.
- Returns:¶
- loaded_data
The loaded data, containing the keys “coords”, “data_vars”, and “extra_data”.
- input_farm_vars(algo: foxes.core.algorithm.Algorithm) list[str][source]¶
Return farm variables required for wake scaling.
-
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 entriesname_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(superp_type: str, *args: Any, **kwargs: Any) WakeSuperposition¶
Run-time wake superposition model factory.
- Parameters:¶
- superp_type
The selected derived class name
- args
Additional parameters for constructor
- kwargs
Additional parameters for constructor
-
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_runningafter 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;
0is silent.
-
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;
0is silent.
- property initialized : bool¶
Initialization flag.
- Returns:¶
- initialized
True if the model has been initialized.
-
lim_high =
None¶
-
lim_low =
None¶
- property model_id : int¶
Unique id based on the model type.
- Returns:¶
- int
Unique id of the model object
-
name =
'Model'¶
- pow¶
- property running : bool¶
Flag for currently running models
- Returns:¶
- running
True if currently running
-
scale_amb =
False¶
-
scale_target =
False¶