Sensors

Sensors (base class)

class onwards.Sensors(i_bf: int, data_path: str, snrs_args: dict)

Bases: object

Prototype Sensors class.

Parameters
  • i_bf (int) – Index of the wind turbine

  • farm_data_dir (str) – Path to the data directory path.

  • snrs_args (dict) – Dictionary containing the parameters used for the turbines Sensors initialization (refer to Sensors).

get_buffer_data(fld: str, i_b: Optional[int] = None) float

Retrieves the current value of the measurement fld.

Parameters
  • fld (str) – Name of the measurement.

  • i_b (int, optional) – Blade index, by default None.

Returns

The current value of measurement fld (for blade i_b).

Return type

float

iterate()

Updates the Sensors object.

Returns

The new time in [sec].

Return type

float

reset(time: Optional[float] = None)

Reset the Sensors to its initial state.

SensorsPy

class onwards.sensors.SensorsPy(data_path: str, fs: float = None, field_names: List[float] = None, time_bnds: list[float] = None, zero_origin: bool = False, **kwargs)

Bases: onwards.sensors.Sensors

Inits a SensorPy object that extract data from AD output files.

This class allows to read data extracted by the Actuator Disks used within the high fidelity Large Eddy Simulation solver (developed at UCLouvain 1). The Actuator Disk provides a full description of the wind turbine operating settings (rotation speed, pitch angle, etc.) and loads. The later are obtained by projecting the disk loads over fictive blades.

The SensorsPy object serves as an interface between the High Fidelity numerical environment and the OnWaRDS framework.

Parameters
  • data_path (str) – Path to the data directory path.

  • fs (float, optional) – Sampling frequency in [Hz]. If None (by default), the original time sampling is preserved.

  • field_names (list, optional) – Name of the measurements to be extracted from the Actuator Disk data.

  • time_bnds (list[float], optional) – Data range to be extracted: time_bnds[0] is the simulation start time and time_bnds[-1] is the end time, by default None.

  • zero_origin (bool, optional) – If set to True, the time vector will be updated so that the initial time is set to 0, by default False.

Raises

KeyError – If the data field/measurement requested is not available.

References

1
  1. Moens, M. Duponcheel, G. Winckelmans, and P. Chatelain. An actuator disk method with tip-loss correction based on local effective upstream velocities. Wind Energy, 21(9):766-782, 2018.

get_buffer_data(fld, i_b=None)

Retrieves the current value of the measurement fld.

Parameters
  • fld (str) – Name of the measurement.

  • i_b (int, optional) – Blade index, by default None.

Returns

The current value of measurement fld (for blade i_b).

Return type

float

get_sensor_data(fld, t, i_b=None)
interp(fs: float = None, time_bnds: List[float] = None)

Reinterpolate the data within the specified bounds with the specified frequency.

Parameters
  • fs (float, optional) – Sampling frequency in [Hz]. If None (by default), the original time sampling is preserved.

  • time_bnds (list[float], optional) – Data range to be extracted: time_bnds[0] is the simulation start time and time_bnds[-1] is the end time, by default None.

Raises
  • ValueError – If the sensors time bounds selected fall outside the available range.

  • Exception – If reference LES data could not be cast to the correct format.

iterate()

Updates the Sensors object.

Returns

The new time in [sec].

Return type

float

reset(time: Optional[float] = None)

Reset the Sensors to its initial state.

SensorsPreprocessed

class onwards.sensors.SensorsPreprocessed(i_bf: int, farm_data_dir: str, name: str, fs: float, **kwargs)

Bases: onwards.sensors.SensorsPy

Imports the wind turbine estimated states from past simulations.

Along with the StateExport class, it allows direct feed through of the sensors measurements to the Farm.lag_solver.

This allows for fast computations when evaluating the performances of the Lagrangian (ie: skips the turbine states estimation step).

Parameters
  • i_bf (int) – Index of the wind turbine

  • farm_data_dir (str) – Path to the data directory path.

  • name (str) – Name of the subdirectory where the preprocessed sensor file where saved (ie: export_args[‘name’])

  • fs (float) – Sampling frequency in [Hz]. If None (by default), the original time sampling is preserved.