Skip to content

Commit

Permalink
Merge pull request #139 from wind-python/features/make_ready_for_rele…
Browse files Browse the repository at this point in the history
…ase_022

Features/make ready for release 022
  • Loading branch information
birgits committed Feb 20, 2024
2 parents 5af422d + d45c158 commit 8f11ea4
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 28 deletions.
6 changes: 3 additions & 3 deletions doc/getting_started.rst
Expand Up @@ -69,9 +69,9 @@ The basic usage of the windpowerlib is shown in the ModelChain example that is a
To run the example you need the example weather and turbine data used:

* :download:`Example weather data file <../example/weather.csv>`
* :download:`Example power curve data file <../example/data/power_curves.csv>`
* :download:`Example power coefficient curve data file <../example/data/power_coefficient_curves.csv>`
* :download:`Example nominal power data file <../example/data/turbine_data.csv>`
* :download:`Example power curve data file <../windpowerlib/data/default_turbine_data/power_curves.csv>`
* :download:`Example power coefficient curve data file <../windpowerlib/data/default_turbine_data/power_coefficient_curves.csv>`
* :download:`Example nominal power data file <../windpowerlib/data/default_turbine_data/turbine_data.csv>`

Furthermore, you have to install the windpowerlib and to run the notebook you also need to install `notebook` using pip3. To launch jupyter notebook type ``jupyter notebook`` in the terminal.
This will open a browser window. Navigate to the directory containing the notebook to open it. See the jupyter notebook quick start guide for more information on `how to install <http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/install.html>`_ and
Expand Down
5 changes: 3 additions & 2 deletions doc/whatsnew/v0-2-2.rst
@@ -1,4 +1,4 @@
v0.2.2 ()
v0.2.2 (February 20, 2024)
++++++++++++++++++++++++++++++

* Updated the code basis to work for newer versions of python (support for python 3.6 to
Expand All @@ -8,4 +8,5 @@ v0.2.2 ()

Contributors
############
* Birgit Schachler
* Birgit Schachler
* Florian Maurer
10 changes: 6 additions & 4 deletions setup.py
Expand Up @@ -8,7 +8,7 @@ def read(fname):

setup(
name="windpowerlib",
version="0.2.2dev0",
version="0.2.2",
description="Creating time series of wind power plants.",
url="http://github.com/wind-python/windpowerlib",
author="oemof developer group",
Expand All @@ -28,12 +28,14 @@ def read(fname):
install_requires=["pandas", "requests"],
extras_require={
"dev": [
"pytest",
"jupyter",
"sphinx_rtd_theme",
"numpy",
"matplotlib",
"nbsphinx",
"numpy",
"pytest",
"pytest-notebook",
"sphinx >= 1.4",
"sphinx_rtd_theme",
]
},
)
2 changes: 1 addition & 1 deletion windpowerlib/__init__.py
@@ -1,6 +1,6 @@
__copyright__ = "Copyright oemof developer group"
__license__ = "MIT"
__version__ = "0.2.2dev0"
__version__ = "0.2.2"

from .wind_turbine import WindTurbine # noqa: F401
from .data import get_turbine_types # noqa: F401
Expand Down
27 changes: 19 additions & 8 deletions windpowerlib/power_output.py
Expand Up @@ -178,6 +178,7 @@ def power_curve_density_correction(
Calculates the turbine power output using a density corrected power curve.
This function is carried out when the parameter `density_correction` of an
instance of the :class:`~.modelchain.ModelChain` class is True.
Parameters
----------
wind_speed : :pandas:`pandas.Series<series>` or numpy.array
Expand All @@ -190,25 +191,30 @@ def power_curve_density_correction(
`power_curve_wind_speeds`.
density : :pandas:`pandas.Series<series>` or numpy.array
Density of air at hub height in kg/m³.
Returns
-------
:pandas:`pandas.Series<series>` or numpy.array
Electrical power output of the wind turbine in W.
Data type depends on type of `wind_speed`.
Notes
-----
The following equation is used for the site specific power curve wind
speeds [1]_ [2]_ [3]_:
.. math:: v_{site}=v_{std}\cdot\left(\frac{\rho_0}
{\rho_{site}}\right)^{p(v)}
.. math:: v_{site}=v_{std}\cdot\left(\frac{\rho_0}{\rho_{site}}\right)^{p(v)}
with:
.. math:: p=\begin{cases}
\frac{1}{3} & v_{std} \leq 7.5\text{ m/s}\\
\frac{1}{15}\cdot v_{std}-\frac{1}{6} & 7.5
\text{ m/s}<v_{std}<12.5\text{ m/s}\\
\frac{2}{3} & \geq 12.5 \text{ m/s}
\end{cases},
v: wind speed [m/s], :math:`\rho`: density [kg/m³]
:math:`v_{std}` is the standard wind speed in the power curve
(:math:`v_{std}`, :math:`P_{std}`),
:math:`v_{site}` is the density corrected wind speed for the power curve
Expand All @@ -217,17 +223,19 @@ def power_curve_density_correction(
and :math:`\rho_{site}` the density at site conditions (and hub height).
It is assumed that the power output for wind speeds above the maximum
and below the minimum wind speed given in the power curve is zero.
References
----------
.. [1] Svenningsen, L.: "Power Curve Air Density Correction And Other
Power Curve Options in WindPRO". 1st edition, Aalborg,
EMD International A/S , 2010, p. 4
Power Curve Options in WindPRO". 1st edition, Aalborg,
EMD International A/S , 2010, p. 4
.. [2] Svenningsen, L.: "Proposal of an Improved Power Curve Correction".
EMD International A/S , 2010
EMD International A/S , 2010
.. [3] Biank, M.: "Methodology, Implementation and Validation of a
Variable Scale Simulation Model for Windpower based on the
Georeferenced Installation Register of Germany". Master's Thesis
at Reiner Lemoine Institute, 2014, p. 13
Variable Scale Simulation Model for Windpower based on the
Georeferenced Installation Register of Germany". Master's Thesis
at Reiner Lemoine Institute, 2014, p. 13
"""
if density is None:
raise TypeError(
Expand Down Expand Up @@ -269,6 +277,7 @@ def _get_power_output(
wind_speed, power_curve_wind_speeds, density, power_curve_values
):
"""Get the power output at each timestep using only numpy to speed up performance
Parameters
----------
wind_speed : :numpy:`numpy.ndarray`
Expand All @@ -281,10 +290,12 @@ def _get_power_output(
power_curve_values : :numpy:`numpy.ndarray`
Power curve values corresponding to wind speeds in
`power_curve_wind_speeds`.
Returns
-------
:numpy:`numpy.array`
Electrical power output of the wind turbine in W.
"""
# Calculate the power curves for each timestep using vectors
# NOTE: power_curves_per_ts.shape = [len(wind_speed), len(density)]
Expand Down
20 changes: 10 additions & 10 deletions windpowerlib/wind_speed.py
Expand Up @@ -36,7 +36,7 @@ def logarithmic_profile(
Roughness length.
obstacle_height : float
Height of obstacles in the surrounding area of the wind turbine. Set
`obstacle_height` to zero for wide spread obstacles. Default: 0.
`obstacle_height` to zero for widespread obstacles. Default: 0.
Returns
-------
Expand Down Expand Up @@ -122,14 +122,14 @@ def hellman(
Hub height of wind turbine.
roughness_length : :pandas:`pandas.Series<series>` or numpy.array or float
Roughness length. If given and `hellman_exponent` is None:
`hellman_exponent`=1 / ln(hub_height/roughness_length),
otherwise `hellman_exponent`=1/7. Default: None.
`hellman_exponent` = 1 / ln(hub_height/roughness_length),
otherwise `hellman_exponent` = 1/7. Default: None.
hellman_exponent : None or float
The Hellman exponent, which combines the increase in wind speed due to
stability of atmospheric conditions and surface roughness into one
constant. If None and roughness length is given
`hellman_exponent`=1 / ln(hub_height/roughness_length),
otherwise `hellman_exponent`=1/7. Default: None.
`hellman_exponent` = 1 / ln(hub_height/roughness_length),
otherwise `hellman_exponent` = 1/7. Default: None.
Returns
-------
Expand All @@ -152,7 +152,7 @@ def hellman(
For the Hellman exponent :math:`\alpha` many studies use a value of 1/7 for
onshore and a value of 1/9 for offshore. The Hellman exponent can also
be calulated by the following equation [2]_ [3]_:
be calculated by the following equation [2]_ [3]_:
.. math:: \alpha=\frac{1}{\ln\left(\frac{h_{hub}}{z_0} \right)}
Expand All @@ -165,12 +165,12 @@ def hellman(
References
----------
.. [1] Sharp, E.: "Spatiotemporal disaggregation of GB scenarios depicting
increased wind capacity and electrified heat demand in dwellings".
UCL, Energy Institute, 2015, p. 83
increased wind capacity and electrified heat demand in dwellings".
UCL, Energy Institute, 2015, p. 83
.. [2] Hau, E.: "Windkraftanlagen - Grundlagen, Technik, Einsatz,
Wirtschaftlichkeit". 4. Auflage, Springer-Verlag, 2008, p. 517
Wirtschaftlichkeit". 4. Auflage, Springer-Verlag, 2008, p. 517
.. [3] Quaschning V.: "Regenerative Energiesysteme". München, Hanser
Verlag, 2011, p. 279
Verlag, 2011, p. 279
"""
if hellman_exponent is None:
Expand Down

0 comments on commit 8f11ea4

Please sign in to comment.