Generating turbulence

pyconturb.gen_turb(spat_df, T=600, nt=600, con_tc=None, coh_model='iec', coh_file=None, wsp_func=None, sig_func=None, spec_func=None, interp_data='none', seed=None, nf_chunk=1, dtype=<class 'numpy.float64'>, verbose=False, **kwargs)[source]

Generate a turbulence box (constrained or unconstrained).

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

  • T (float, optional) – Total length of time to simulate in seconds. Default is 600.

  • nt (int, optional) – Number of time steps for generated turbulence. Default is 600.

  • con_tc (pyconturb TimeConstraint, optional) – Optional constraining data for the simulation. The TimeConstraint object is built into PyConTurb; see documentation for more details.

  • coh_model (str, optional) – Spatial coherence model specifier. Default is IEC 61400-1, Ed. 4.

  • coh_file (str or pathlib.Path) – Path to file from which to load coherence. Assumed to be an HDF5 file with dataset “coherence” containing a 2D coherence array with dimensions (n_f, (n_sp + n_c)^2). See documentation for more details.

  • wsp_func (function, optional) – Function to specify spatial variation of mean wind speed. See details in Mean wind speed profiles section.

  • sig_func (function, optional) – Function to specify spatial variation of turbulence standard deviation. See details in Turbulence standard deviation section.

  • spec_func (function, optional) – Function to specify spatial variation of turbulence power spectrum. See details in Turbulence spectra section.

  • interp_data (str, optional) – Interpolate mean wind speed, standard deviation, and/or power spectra profile functions from provided constraint data. Possible options are 'none' (use provided/default profile functions), 'all' (interpolate all profile, functions), or a list containing and combination of 'wsp', 'sig' and 'spec' (interpolate the wind speed, standard deviation and/or power spectra). Default is IEC 61400-1 profiles (i.e., no interpolation).

  • seed (int, optional) – Optional random seed for turbulence generation. Use the same seed and settings to regenerate the same turbulence box.

  • nf_chunk (int, optional) – Number of frequencies in a chunk of analysis. Increasing this number may speed up computation but may result in more (or too much) memory used. Smaller grids may benefit from larger values for nf_chunk. Default is 1.

  • verbose (bool, optional) – Print extra information during turbulence generation. Default is False.

  • dtype (data type, optional) – Change precision of calculation (np.float32 or np.float64). Will reduce the storage, and might slightly reduce the computational time. Default is np.float64.

  • **kwargs – Optional keyword arguments to be fed into the spectral/turbulence/profile/etc. models.


turb_df – Generated turbulence box. Each row corresponds to a time step and each column corresponds to a point/component in spat_df.

Return type