utils
- off.utils.lg = <Logger off.utils (WARNING)>
Utilities for the OFF toolbox functions which are handy in multiple places but do not have a true parent object they could belong to.
- off.utils.ot_abs2uv(wind_speed_abs, wind_dir) ndarray
- off.utils.ot_abs_wind_speed(u, v) float
- off.utils.ot_deg2rad(deg) float
- off.utils.ot_get_closest_2_points_3d_sorted(ref_loc: ndarray, points: ndarray) List[int]
Function to find the index of the closest 2 points to a reference location in 3D. The function can expect the list of points to be sorted / trailing each other.
- Parameters:
ref_loc – [1 x 3] np.ndarray Reference location
points – [n x 3] np.ndarray Points
- Return type:
[1 x 2] int array
- off.utils.ot_get_closest_point_3d_sorted(ref_loc: ndarray, points: ndarray) int
Function to find the index of the closes point to a reference location in 3D. The function can expect the list of points to be sorted / trailing each other.
- Parameters:
ref_loc – [1 x 3] np.ndarray Reference location
points – [n x 3] np.ndarray Points
- Returns:
index
- Return type:
int
- off.utils.ot_get_orientation(wind_dir: float, yaw: float) float
Return the turbine orientation based on the wind direction and the yaw angle
- Parameters:
wind_dir (float) – Wind direction in LES degree (270 deg pointing along the x-axis, 190 deg along the y axis)
yaw (float) – Yaw angle in degree
- Returns:
Orientation in LES degree
- Return type:
float
- off.utils.ot_get_yaw(wind_dir: float, orientation: float) float
Return the turbine yaw angle based on the wind direction and turbine orientation
- Parameters:
wind_dir (float) – Wind direction in LES degree (270 deg pointing along the x-axis, 190 deg along the y axis)
orientation (float) – Turbine orientation in LES degree (270 deg pointing along the x-axis, 190 deg along the y axis)
- Returns:
yaw angle in LES degree (clockwise)
- Return type:
float
- off.utils.ot_isocell(n_rp: int) tuple
Isocell algorithm to discretize the rotor plane (or any circle) Masset et al.
https://orbi.uliege.be/bitstream/2268/91953/1/masset_isocell_orbi.pdf
We choose N = 3 here, 4 or 5 are also viable options, 3 is close to optimal
- Parameters:
n_rp (int) – desired number of Rotor points (algorithm can not work with all numbers, takes the closest one)
- Returns:
[yRP, zRP] : np.ndarray location of the rotor points with values between -0.5 and 0.5 w : float weight of the RPs (1/number)
- Return type:
tuple
- off.utils.ot_uv2abs(u, v) float
- off.utils.ot_uv2deg(u, v) float