Turbulence standard deviation

Define how the turbulence standard deviation varies with k, y and z.

You can either use the built-in models (see below) or create your own function to model the spatial variation of the turbulence standard deviation.

pyconturb.sig_models.constant_sig(spat_df, sig_vals, comps, **kwargs)[source]

Constant standard deviation.

Parameters
  • spat_df (pandas.DataFrame) – Spatial information on the points to simulate. Must have columns [k, p_id, x, y, z], and each of the n_sp rows corresponds to a different spatial location and turbuine component (u, v or w).

  • sig_vals (iterable) – [m/s] Iterable of standard deviations corresponding to the components in comps.

  • comps (iterable of integers) – [-] Iterable of the integers k identifying which components should be assigned the standard deviations in sig_vals. Components u, v, and/or w should be indicated by 0, 1, and/or 2, respectively.

  • **kwargs – Unused (optional) keyword arguments.

Returns

sig_values – [m/s] Turbulence standard deviation(s) at the specified location(s). Dimension is (n_sp,).

Return type

np.array

pyconturb.sig_models.data_sig(spat_df, con_tc=None, warn_datacon=True, **kwargs)[source]

Turbulence standard deviation interpolated from a TimeConstraint object.

See the Examples and/or Reference Guide for details on the interpolator logic or for how to construct a TimeConstraint object. Note that this function uses the biased estimator for the standard deviation (i.e., NumPy’s default np.std).

Note! If a component is requested for which there is no constraint, then this function will try to use iec_sig instead. Use the warn_datacon option to disable the warning about this.

Parameters
  • spat_df (pandas.DataFrame) – Spatial information on the points to simulate. Must have columns [k, p_id, x, y, z], and each of the n_sp rows corresponds to a different spatial location and turbuine component (u, v or w).

  • con_tc (pyconturb.TimeConstraint) – [-] Constraint object. Must have correct format; see documentation on PyConTurb’s TimeConstraint object for more details.

  • warn_datacon (boolean) – [-] Warn if a requested component does not have a constraint, which results in an attempt at using IEC values. Default is True.

  • **kwargs – Unused (optional) keyword arguments.

Returns

sig_values – [m/s] Turbulence standard deviation(s) at the specified location(s). Dimension is (n_sp,).

Return type

np.array

pyconturb.sig_models.get_sig_values(spat_df, sig_func, **kwargs)[source]

Turbulence standard deviation for points/components in spat_df.

The sig_func must be a function of the form:

sig_values = sig_func(spat_df, **kwargs)

where k, y and z can be floats, np.arrays or pandas.Series. You can use the functions built into PyConTurb (see below) or define your own custom function. The output is assumed to be in m/s.

Parameters
  • spat_df (pandas.DataFrame) – Spatial information on the points to simulate. Must have columns [k, p_id, x, y, z], and each of the n_sp rows corresponds to a different spatial location and turbuine component (u, v or w).

  • sig_func (function) – Function to map k, y and z to the turbulence standard deviation in m/s.

  • **kwargs – Keyword arguments to pass into sig_func.

Returns

sig_values – [m/s] Turbulence standard deviation(s) for the given spatial locations(s) /component(s). Dimension is (n_sp,).

Return type

np.array

pyconturb.sig_models.iec_sig(spat_df, turb_class='A', **kwargs)[source]

Turbulence standard deviation as specified in IEC 61400-1 Ed. 3.

Parameters
  • spat_df (pandas.DataFrame) – Spatial information on the points to simulate. Must have columns [k, p_id, x, y, z], and each of the n_sp rows corresponds to a different spatial location and turbuine component (u, v or w).

  • z (array-like) – [m] Location of point(s) in the vertical direction. Can be int/float, np.array or pandas.Series.

  • turb_class (str, optional) – [-] Turbulence class.

  • **kwargs – Unused (optional) keyword arguments.

Returns

sig_values – [m/s] Turbulence standard deviation(s) at the specified location(s). Dimension is (n_sp,).

Return type

np.array