Welcome to DWMpy’s documentation!

DWM_python.py

The core module of the DWMpy package

class DWMpy.DWMpy.DWM_linker(filename)

Class that links to the DWM DLL.

load(filename, working_dir=None)

Loads the DWM DLL using a HAWC2 input file (.htc) as an input.

Parameters
  • filename – The filename of the HAWC2 input file (.htc) relative to the working directory

  • working_dir – The file path to the working directory. Default is the current working directory.

unload()

Unloads the DWM DLL.

get_wsp(t, X, factor=1)

Returns the windspeed contribution from dynamic wake meandering at a time, t and global position, X.

Parameters
  • t (float) – Time [s].

  • X (list of floats) – position of the form [x, y, z].

  • factor (float) – Turbulent scaling factor.

Returns

windspeed – wind speed of the form [u, v, w].

Return type

list of floats

get_wake_pos(t, wake_ind=1)

Returns the wake center position in the rotorplane in meteorological coordinates (?).

Parameters
  • t (float) – Time [s].

  • wake_ind (int) – Index number of the wake.

Returns

position – wake position of the form [x, y].

Return type

list of floats

get_meander(meander_time, tint, origin, nrelease=8192)

Calculates a new wake meandering path based on the meandering turbulence box.

Parameters
  • meander_time (float) – The time (in seconds) the wake meanders from emmision until being observed.

  • tint (float) – Meandering turbulence intensity.

  • origin (list of floats) – Location of the source location of the form [x, y, z] in meteorological coordinates.

  • nrelease (int) – Number of wake tracer particles.

Returns

meander_path – The meandering path.

Return type

ndarray(shape=(nrelease, 3))

get_axial_induction(U, omega, pitch)

Calculates the axial induction of the rotor as a function of radial position.

Parameters
  • U (float) – Ambient wind speed [m/s].

  • omega (float) – Rotor speed [rad/s].

  • pitch (float) – Blade pitch angle [deg]

Returns

axial induction – Wake deficit data. Column 1: radial position, r [m] Column 2: axial induction, a [-]

Return type

ndarray(shape=(50, 3))

get_wake_deficit(U, tint, omega, pitch, D)

Calculates a the wake deficit as a function of radial position.

Parameters
  • U (float) – Ambient wind speed [m/s].

  • tint (float) – Ambient turbulence intensity [-].

  • omega (float) – Rotor speed [rad/s].

  • pitch (float) – Blade pitch angle [deg]

  • D (float) – Downstream distance of observed wake deficit [m]

Returns

wake_deficit – Wake deficit data. Column 1: radial position, r [m] Column 2: wake deficit, V [m/s] Column 3: dV/dr [m/s/m]

Return type

ndarray(shape=(500, 3))

get_wake_deficits(U, tint, omega, pitch, Ds)

Calculates a the wake deficit as a function of radial position. Same as get_wake_deficit, but can now take a list of Ds. to be integrated into get_wake_deficit in the future.

Parameters
  • U (float) – Ambient wind speed [m/s].

  • tint (float) – Ambient turbulence intensity [-].

  • omega (float) – Rotor speed [rad/s].

  • pitch (float) – Blade pitch angle [deg]

  • Ds (array) – Downstream distances of observed wake deficit [m]

Returns

wake_deficit – Wake deficit data. The three columns in axis=3 are:

Column 1: radial position, r [m]

Column 2: wake deficit, V [m/s]

Column 3: dV/dr [m/s/m]

Return type

ndarray(shape=(len(Ds), 500, 3))

get_far_wake_deficits(U, tint, R, rs, Udefs, Ds)

Calculates the far wake deficit as a function of radial position using a user-defined near wake deficit. takes a list of Ds.

Parameters
  • U (float) – Ambient wind speed [m/s].

  • tint (float) – Ambient turbulence intensity [-].

  • R (float) – Radius of the wake-generating turbine [m].

  • rs (array-like) – radial position [m].

  • Udefs (array-like) – freestream wind speed of the near deficit at radial positions defined in rs. [m/s]

  • Ds (array-like) – Downstream distances of observed wake deficit [m]

Returns

wake_deficit – Wake deficit data. The three columns in axis=3 are:

Column 1: radial position, r [m]

Column 2: wake deficit, V [m/s]

Column 3: dV/dr [m/s/m]

Return type

ndarray(shape=(len(Ds), 500, 3))

get_wake_turbulence(U, tint, omega, pitch, D)

Calculates a the wake turbulence scaling factor as a function of radial position.

Parameters
  • U (float) – Ambient wind speed [m/s].

  • tint (float) – Ambient turbulence intensity [-].

  • omega (float) – Rotor speed [rad/s].

  • pitch (float) – Blade pitch angle [deg]

  • D (float) – Downstream distance of observed wake deficit [m]

Returns

wake_deficit – Wake deficit data. Column 1: radial position, r [m] Column 2: wake turbulence scaling factor, K [-]

Return type

ndarray(shape=(500, 2))