windpowerlib package

Submodules

windpowerlib.basicmodel module

class windpowerlib.basicmodel.SimpleWindTurbine(wind_conv_type=None, h_hub=None, d_rotor=None, cp_values=None, nominal_power=None)[source]

Bases: object

Model to determine the output of a wind turbine

Parameters:
  • wind_conv_type (string) – Name of the wind converter type. Use get_wind_pp_types() to see a list of all possible wind converters.
  • h_hub (float) – Height of the hub of the wind turbine.
  • d_rotor (float) – Diameter of the rotor.
  • cp_values (pandas.DataFrame) – The index should be the wind speed and a column should be named ‘cp’.
  • nominal_power (float) – The nominal output of the wind power plant.
wind_conv_type

string – Name of the wind converter type. Use get_wind_pp_types() to see a list of all possible wind converters.

h_hub

float – Height of the hub of the wind turbine.

d_rotor

float – Diameter of the rotor.

cp_values

pandas.DataFrame – The index should be the wind speed and a column should be named ‘cp’.

nominal_power

float – The nominal output of the wind power plant.

Examples

>>> from windpowerlib import basicmodel
>>> enerconE126 = {
...    'h_hub': 135,
...    'd_rotor': 127,
...    'wind_conv_type': 'ENERCON E 126 7500'}
>>> e126 = basicmodel.SimpleWindTurbine(**enerconE126)
>>> print(e126.d_rotor)
127
cp_series(v_wind)[source]

Interpolates the cp value as a function of the wind velocity between data obtained from the power curve of the specified wind turbine type.

Parameters:v_wind (pandas.Series or numpy.array) – Wind speed at hub height [m/s]
Returns:
  • numpy.array – cp values, wind converter type, installed capacity
  • >>> import numpy
  • >>> from windpowerlib import basicmodel
  • >>> e126 = basicmodel.SimpleWindTurbine(‘ENERCON E 126 7500’)
  • >>> v_wind = numpy.array([1,2,3,4,5,6,7,8])
  • >>> print(e126.cp_series(v_wind))
  • [ 0. 0. 0.191 0.352 0.423 0.453 0.47 0.478]
fetch_wpp_data(**kwargs)[source]

Fetch data of the requested wind converter.

Returns:cp values and the nominal power of the requested wind converter
Return type:tuple with pandas.DataFrame and float

Examples

>>> from windpowerlib import basicmodel
>>> e126 = basicmodel.SimpleWindTurbine('ENERCON E 126 7500')
>>> print(e126.cp_values.cp[5.0])
0.423
>>> print(e126.nominal_power)
7500000.0
rho_hub(weather, data_height)[source]
Calculates the density of air in kg/m³ at hub height.
(temperature in K, height in m, pressure in Pa)
Parameters:
  • weather (DataFrame or Dictionary) – Containing columns or keys with the timeseries for Temperature (temp_air) and pressure (pressure).
  • data_height (DataFrame or Dictionary) – Containing columns or keys with the height of the measurement or model data for temperature (temp_air) and pressure (pressure).
Returns:

density of air in kg/m³ at hub height

Return type:

float

Notes

Assumptions:
  • Temperature gradient of -6.5 K/km
  • Pressure gradient of -1/8 hPa/m

The following equations are used [22]:

T_{hub}=T_{air, data}-0.0065\cdot\left(h_{hub}-h_{T,data}
\right)

p_{hub}=\left(p_{data}/100-\left(h_{hub}-h_{p,data}\right)
*\frac{1}{8}\right)/\left(2.8706\cdot T_{hub}\right)

with T: temperature [K], h: height [m], p: pressure [Pa]

ToDo: Check the equation and add references.

References

[22]ICAO-Standardatmosphäre (ISA). http://www.deutscher-wetterdienst.de/lexikon/download.php?file=Standardatmosphaere.pdf

See also

v_wind_hub()

turbine_power_output(weather, data_height)[source]

Calculates the power output in W of one wind turbine.

Parameters:
  • weather (feedinlib.weather.FeedinWeather object) – Instance of the feedinlib weather object (see class FeedinWeather for more details)
  • data_height (dictionary) – Containing the heights of the weather measurements or weather model in meters with the keys of the data parameter
  • TODO Move the following parameters to a better place (#) –
Returns:

Electrical power of the wind turbine

Return type:

pandas.Series

Notes

The following equation is used for the power output P_{wpp} [21]:

P_{wpp}=\frac{1}{8}\cdot\rho_{air,hub}\cdot d_{rotor}^{2}
\cdot\pi\cdot v_{wind}^{3}\cdot cp\left(v_{wind}\right)

with:
v: wind speed [m/s], d: diameter [m], \rho: density [kg/m³]

ToDo: Check the equation and add references.

References

[21]Gasch R., Twele J.: “Windkraftanlagen”. 6. Auflage, Wiesbaden, Vieweg + Teubner, 2010, pages 35ff, 208
v_wind_hub(weather, data_height)[source]

Calculates the wind speed in m/s at hub height.

Parameters:
  • weather (DataFrame or Dictionary) – Containing columns or keys with the timeseries for wind speed (v_wind) and roughness length (z0).
  • data_height (DataFrame or Dictionary) – Containing columns or keys with the height of the measurement or model data for temperature (temp_air) and pressure (pressure).
Returns:

wind speed [m/s] at hub height

Return type:

float

Notes

The following equation is used for the logarithmic wind profile [20]:

v_{wind,hub}=v_{wind,data}\cdot\frac{\ln\left(\frac{h_{hub}}
{z_{0}}\right)}{\ln\left(\frac{h_{data}}{z_{0}}\right)}

with:
v: wind speed [m/s], h: height [m], z0: roughness length [m]

h_{data} is the height in which the wind velocity is measured. (height in m, velocity in m/s)

ToDo: Check the equation and add references.

References

[20]Gasch R., Twele J.: “Windkraftanlagen”. 6. Auflage, Wiesbaden, Vieweg + Teubner, 2010, page 129

See also

rho_hub()

windpowerlib.basicmodel.get_wind_pp_types(print_out=True)[source]

Get the names of all possible wind converter types.

Parameters:print_out (boolean (default: True)) – Directly prints the list of types if set to True.

Examples

>>> from windpowerlib import basicmodel
>>> valid_types_df = basicmodel.get_wind_pp_types(print_out=False)
>>> valid_types_df.shape
(91, 2)
>>> print(valid_types_df.iloc[5])
rli_anlagen_id    DEWIND D8 2000
p_nenn                      2000
Name: 5, dtype: object
windpowerlib.basicmodel.read_wpp_data(**kwargs)[source]

Fetch cp values from a file or download it from a server.

The files are located in the data folder of the package root.

Returns:

cp values, wind converter type, installed capacity or the full table if the given wind converter cannot be found in the table.

Return type:

pandas.DataFrame

Other Parameters:
 
  • datapath (string, optional) – Path where the cp file is stored. Default: ‘$PACKAGE_ROOT/data’
  • filename (string, optional) – Filename of the cp file.

Module contents