Mean wind speed profiles

Define how the mean wind speed varies with y and z.

For example, the spatial variation of U could be a power law by height, which is the wind profile specified in IEC 61400-1 Eds. 3 and 4. A user can also specify a custom function to model the wind speed variation as a function of y and z. See the notes in get_wsp_values below for more details.

pyconturb.wind_profiles.constant_profile(spat_df, u_ref=0, **kwargs)[source]

Constant (or zero) mean wind speed on longitudinal turbulence components.

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

  • u_ref (int/float, optional) – [m/s] Mean wind speed at all locations.

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

Returns

wsp_values – [m/s] Mean wind speeds at the specified location(s).

Return type

np.array

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

Mean wind speed 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! If a component is requested for which there is no constraint, then this function will return power profile for u and 0 for v and w. 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, 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 the Kaimal spectrum. Default is True.

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

Returns

wsp_values – [m/s] Mean wind speed(s) at the specified location(s).

Return type

np.array

pyconturb.wind_profiles.get_wsp_values(spat_df, wsp_func, **kwargs)[source]

Mean wind speed for points/components in spat_df.

The wsp_func must be a function of the form:

wsp_values = wsp_func(spat_df, **kwargs)

where spat_df is the spatial dataframe. You can use the profile functions built into PyConTurb (see below) or define your own custom functions. 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, x, y, z], and each of the n_sp rows corresponds to a different spatial location and turbuine component (u, v or w).

  • wsp_func (function) – Function to map y and z to a wind speed in m/s.

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

Returns

wsp_values – [m/s] Mean wind speeds for the given spatial locations(s)/component(s). Dimension is (n_sp,).

Return type

np.array

pyconturb.wind_profiles.power_profile(spat_df, u_ref=0, z_ref=90, alpha=0.2, **kwargs)[source]

Power-law profile with height.

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

  • u_ref (int/float, optional) – [m/s] Mean wind speed at reference height.

  • z_ref (int/float, optional) – [m] Reference height.

  • alpha (int/float, optional) – [-] Coefficient for the power law.

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

Returns

wsp_values – [m/s] Mean wind speed(s) at the specified location(s).

Return type

np.array