- 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¶
- 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']
- property states
The states
- property rotor_model
The rotor model
- property wake_models
The wake models
- property wake_frame
The wake frame
- property wake_deflection
The wake deflection
- property partial_wakes
The partial wakes models
- property ground_models
The ground models
- property farm_controller
The farm controller
- property population_model
The population model
- select_population_member(pop_farm_results, pop_index)[source]
Select a specific population member from the population model results.
- update_n_turbines()[source]
Reset the number of turbines, according to self.farm
-
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
-
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
- 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.
-
add_to_chunk_store(name, data, dims, mdata, tdata=
None, copy=True)[source] Add 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
- property model_id
Unique id based on the model type.
- property initialized
Initialization flag.
- 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