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

A sequential calculation of states without chunking.

This is of use for the evaluation in simulation environments that do not support multi-state computations, like FMUs.

Attributes

ambient: bool

Flag for ambient calculation

calc_pars: dict

Parameters for model calculation. Key: model name str, value: parameter dict

states0: foxes.core.States

The original states

points: numpy.ndarray

The points of interest, shape: (n_states, n_points, 3)

plugins: list of foxes.algorithm.sequential.SequentialIterPlugin

The plugins, updated with every iteration

outputs: list of str

The output variables

Public members

classmethod get_model(name)[source]

Get the algorithm specific model

Sequential(farm, states, *args, points=None, ambient=False, ...)[source]

Constructor.

property iterating

Flag for running iteration

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

Creates xarray from model input data.

__iter__()[source]

Initialize the iterator

__next__()[source]

Run calculation for current step, then iterate to next

property size

The total number of iteration steps

property counter

The current index counter

property index

The current index

states_i0(counter, algo=None)[source]

Returns counter or index

property weight

The current weight array

property farm_results

The overall farm results

property farm_results_downwind

The overall farm results, with turbine dimension in downwind order

property cur_farm_results

The current farm results

property point_results

The overall point results

property cur_point_results

The current point results

calc_farm()[source]

Calculate farm data.

calc_points(farm_results, points, **kwargs)[source]

Calculate data at a given set of points.

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

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

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

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