class foxes.algorithms.Iterative(foxes.algorithms.Downwind)[source]

Iterative calculation of farm data.

Attributes

max_it: int

The maximal number of iterations

conv_crit: foxes.algorithms.iterative.ConvCrit

The convergence criteria

prev_farm_results: xarray.Dataset

Results from the previous iteration

Public members

classmethod get_model(name)[source]

Get the algorithm specific model

Iterative(*args, max_it=None, conv_crit='default', ...)[source]

Constructor.

property farm_results_downwind

Gets the all-chunks farm results in downwind order from the previous iteration

set_urelax(entry_point, **urel)[source]

Sets under-relaxation parameters.

initialize()[source]

Initializes the algorithm.

property urelax

Returns the under-relaxation parameters

property iterations

The current iteration number

property final_iteration

Flag for the final iteration

calc_farm(finalize=True, ret_dwnd_order=False, **kwargs)[source]

Calculate farm data.

DEFAULT_FARM_OUTPUTS = ['X', 'Y', 'H', 'D', 'AMB_WD', 'AMB_REWS', 'AMB_TI', 'AMB_RHO', 'AMB_CT', 'AMB_P', 'WD', 'REWS', 'YAW', 'TI', 'CT', 'P', 'order', 'weight']
property states

The states

property rotor_model

The rotor model

property wake_models

The wake models

property wake_frame

The wake frame

property partial_wakes

The partial wakes models

property ground_models

The ground models

property farm_controller

The farm controller

print_deco(func_name=None, n_points=None)[source]

Helper function for printing model names

init_states()[source]

Initialize states, if needed.

sub_models()[source]

List of all sub-models

calc_points(farm_results, points, point_models=None, ...)[source]

Calculate data at a given set of points.

property farm

The wind farm

property mbook

The model book

property dbook

The data book

property idata_mem

The current idata memory

property chunk_store

The current chunk store

print(*args, vlim=1, **kwargs)[source]

Print function, based on verbosity.

store_model_data(model, idata, force=False)[source]

Store model data

get_model_data(model)[source]

Gets model data from memory

del_model_data(model)[source]

Remove stored model data

update_n_turbines()[source]

Reset the number of turbines, according to self.farm

get_models_idata()[source]

Returns idata object of models

get_models_data(idata=None, sel=None, isel=None)[source]

Creates xarray from model input data.

new_point_data(points, states_indices=None, n_states=None)[source]

Creates a point data xarray object, containing only points.

find_chunk_in_store(mdata, tdata=None, prev_s=0, prev_t=0, ...)[source]

Finds indices in chunk store

add_to_chunk_store(name, data, mdata, tdata=None, copy=True)[source]

Add data to the chunk store

get_from_chunk_store(name, mdata, tdata=None, prev_s=0, ...)[source]

Get data to the chunk store

reset_chunk_store(new_chunk_store=None)[source]

Resets the chunk store

block_convergence(**kwargs)[source]

Switch on convergence block during iterative run

eval_conv_block()[source]

Evaluate convergence block, removing blocks on the fly

set_running(algo, data_stash, sel=None, isel=None, verbosity=0)[source]

Sets this model status to running, and moves all large data to stash.

unset_running(algo, data_stash, sel=None, isel=None, verbosity=0)[source]

Sets this model status to not running, recovering large data from stash

finalize(clear_mem=False)[source]

Finalizes the algorithm.

classmethod new(algo_type, *args, **kwargs)[source]

Run-time algorithm factory.

__repr__()[source]

Return repr(self).

property model_id

Unique id based on the model type.

var(v)[source]

Creates a model specific variable name.

property initialized

Initialization flag.

load_data(algo, verbosity=0)[source]

Load and/or create all model data that is subject to chunking.

property running

Flag for currently running models

get_data(variable, target, lookup='smfp', mdata=None, ...)[source]

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