h2integrate.converters.wind.tools.resource_tools#

Functions

average_wind_data_for_hubheight(...)

Compute the average of wind resource data at two resource heights.

calculate_air_density(elevation_m)

Calculate air density based on site elevation using the Barometric formula.

weighted_average_wind_data_for_hubheight(...)

Compute the weighted average of wind resource data at two resource heights.

h2integrate.converters.wind.tools.resource_tools.calculate_air_density(elevation_m)#

Calculate air density based on site elevation using the Barometric formula.

This function is based on Equation 1 from: https://en.wikipedia.org/wiki/Barometric_formula#Density_equations Imported constants are:

  • g: acceleration due to gravity (m/s2)

  • R: universal gas constant (J/mol-K)

Parameters:

elevation_m (float) – Elevation of site in meters

Returns:

float – Air density in kg/m^3 at elevation of site

Return type:

float

h2integrate.converters.wind.tools.resource_tools.weighted_average_wind_data_for_hubheight(wind_resource_data, bounding_resource_heights, hub_height, wind_resource_spec)#

Compute the weighted average of wind resource data at two resource heights.

Parameters:
  • wind_resource_data (dict) – dictionary of wind resource data

  • bounding_resource_heights (tuple[int] | list[int]) – resource heights that bound the hub-height, formatted as [lower_resource_height, upper_resource_height]

  • hub_height (float | int) – wind turbine hub-height in meters.

  • wind_resource_spec (str) – wind resource data key that is unique for each hub-height. Such as ‘wind_speed’ or ‘wind_direction’

Raises:

ValueError – if f’{wind_resource_spec}_{lower_resource_height}m’ or f’{wind_resource_spec}_{upper_resource_height}m’ are not found in wind_resource_data

Returns:

np.ndarray – wind resource data averaged between the two bounding heights.

h2integrate.converters.wind.tools.resource_tools.average_wind_data_for_hubheight(wind_resource_data, bounding_resource_heights, wind_resource_spec)#

Compute the average of wind resource data at two resource heights.

Parameters:
  • wind_resource_data (dict) – dictionary of wind resource data

  • bounding_resource_heights (tuple[int] | list[int]) – resource heights that bound the hub-height, formatted as [lower_resource_height, upper_resource_height]

  • wind_resource_spec (str) – wind resource data key that is unique for each hub-height. Such as ‘wind_speed’ or ‘wind_direction’

Raises:

ValueError – if f’{wind_resource_spec}_{lower_resource_height}m’ or f’{wind_resource_spec}_{upper_resource_height}m’ are not found in wind_resource_data

Returns:

np.ndarray – wind resource data averaged between the two bounding heights.