Skip to content

Commit c3d9a38

Browse files
authored
Merge pull request #64 from wind-python/features/improve_modelchain_documentation
Features/improve modelchain documentation
2 parents 1460c3c + baaaed0 commit c3d9a38

File tree

6 files changed

+160
-112
lines changed

6 files changed

+160
-112
lines changed

doc/modules.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ as the aggregated power curve of a :py:class:`~.wind_farm.WindFarm` object.
8383
.. autosummary::
8484
:toctree: temp/
8585

86+
wind_farm.WindFarm.check_and_complete_wind_turbine_fleet
87+
wind_farm.WindFarm.nominal_power
8688
wind_farm.WindFarm.mean_hub_height
87-
wind_farm.WindFarm.get_installed_power
8889
wind_farm.WindFarm.assign_power_curve
8990

9091
.. _wind_turbine_cluster_label:
@@ -100,6 +101,7 @@ the :py:class:`~.wind_farm.WindFarm` class.
100101
.. autosummary::
101102
:toctree: temp/
102103

104+
wind_turbine_cluster.WindTurbineCluster.nominal_power
103105
wind_turbine_cluster.WindTurbineCluster.mean_hub_height
104106
wind_turbine_cluster.WindTurbineCluster.get_installed_power
105107
wind_turbine_cluster.WindTurbineCluster.assign_power_curve

windpowerlib/modelchain.py

Lines changed: 71 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -16,71 +16,107 @@
1616
class ModelChain(object):
1717
r"""Model to determine the output of a wind turbine
1818
19+
The ModelChain class provides a standardized, high-level
20+
interface for all of the modeling steps necessary for calculating wind
21+
turbine power output from weather time series inputs.
22+
1923
Parameters
2024
----------
2125
power_plant : :class:`~.wind_turbine.WindTurbine`
2226
A :class:`~.wind_turbine.WindTurbine` object representing the wind
2327
turbine.
2428
wind_speed_model : str
2529
Parameter to define which model to use to calculate the wind speed at
26-
hub height. Valid options are 'logarithmic', 'hellman' and
27-
'interpolation_extrapolation', 'log_interpolation_extrapolation'.
30+
hub height. Valid options are:
31+
32+
* 'logarithmic' -
33+
See :func:`~.wind_speed.logarithmic_profile` for more information.
34+
The parameter `obstacle_height` can be used to set the height of
35+
obstacles in the surrounding area of the wind turbine.
36+
* 'hellman' -
37+
See :func:`~.wind_speed.hellman` for more information.
38+
* 'interpolation_extrapolation' -
39+
See :func:`~.tools.linear_interpolation_extrapolation` for more
40+
information.
41+
* 'log_interpolation_extrapolation' -
42+
See :func:`~.tools.logarithmic_interpolation_extrapolation` for more
43+
information.
44+
2845
Default: 'logarithmic'.
2946
temperature_model : str
3047
Parameter to define which model to use to calculate the temperature of
31-
air at hub height. Valid options are 'linear_gradient' and
32-
'interpolation_extrapolation'. Default: 'linear_gradient'.
48+
air at hub height. Valid options are:
49+
50+
* 'linear_gradient' -
51+
See :func:`~.temperature.linear_gradient` for more
52+
information.
53+
* 'interpolation_extrapolation' -
54+
See :func:`~.tools.linear_interpolation_extrapolation` for more
55+
information.
56+
57+
Default: 'linear_gradient'.
3358
density_model : str
3459
Parameter to define which model to use to calculate the density of air
35-
at hub height. Valid options are 'barometric', 'ideal_gas' and
36-
'interpolation_extrapolation'. Default: 'barometric'.
60+
at hub height. Valid options are:
61+
62+
* 'barometric' -
63+
See :func:`~.density.barometric` for more information.
64+
* 'ideal_gas' -
65+
See :func:`~.density.ideal_gas` for more information.
66+
* 'interpolation_extrapolation' -
67+
See :func:`~.tools.linear_interpolation_extrapolation` for more
68+
information.
69+
70+
Default: 'barometric'.
3771
power_output_model : str
3872
Parameter to define which model to use to calculate the turbine power
39-
output. Valid options are 'power_curve' and 'power_coefficient_curve'.
73+
output. Valid options are:
74+
75+
* 'power_curve' -
76+
See :func:`~.power_output.power_curve` for more information. In order
77+
to use the density corrected power curve to calculate the power
78+
output set parameter `density_correction` to True.
79+
* 'power_coefficient_curve' -
80+
See :func:`~.power_output.power_coefficient_curve` for more
81+
information.
82+
4083
Default: 'power_curve'.
4184
density_correction : bool
42-
If the parameter is True the density corrected power curve is used for
43-
the calculation of the turbine power output. Default: False.
85+
This parameter is only used if the parameter `power_output_model` is
86+
'power_curve'. For more information on this parameter see parameter
87+
`density_correction` in :func:`~.power_output.power_curve`.
88+
Default: False.
4489
obstacle_height : float
45-
Height of obstacles in the surrounding area of the wind turbine in m.
46-
Set `obstacle_height` to zero for wide spread obstacles. Default: 0.
90+
This parameter is only used if the parameter `wind_speed_model` is
91+
'logarithmic'. For more information on this parameter see parameter
92+
`obstacle_height` in :func:`~.wind_speed.logarithmic`. Default: 0.
4793
hellman_exp : float
48-
The Hellman exponent, which combines the increase in wind speed due to
49-
stability of atmospheric conditions and surface roughness into one
50-
constant. Default: None.
94+
This parameter is only used if the parameter `wind_speed_model` is
95+
'hellman'. For more information on this parameter see parameter
96+
`hellman_exponent` in :func:`~.wind_speed.hellman`. Default: None.
5197
5298
Attributes
5399
----------
54100
power_plant : :class:`~.wind_turbine.WindTurbine`
55101
A :class:`~.wind_turbine.WindTurbine` object representing the wind
56102
turbine.
57103
wind_speed_model : str
58-
Parameter to define which model to use to calculate the wind speed at
59-
hub height. Valid options are 'logarithmic', 'hellman' and
60-
'interpolation_extrapolation', 'log_interpolation_extrapolation'.
61-
Default: 'logarithmic'.
104+
Defines which model is used to calculate the wind speed at hub height.
62105
temperature_model : str
63-
Parameter to define which model to use to calculate the temperature of
64-
air at hub height. Valid options are 'linear_gradient' and
65-
'interpolation_extrapolation'. Default: 'linear_gradient'.
106+
Defines which model is used to calculate the temperature of air at hub
107+
height.
66108
density_model : str
67-
Parameter to define which model to use to calculate the density of air
68-
at hub height. Valid options are 'barometric', 'ideal_gas' and
69-
'interpolation_extrapolation'. Default: 'barometric'.
109+
Defines which model is used to calculate the density of air at hub
110+
height.
70111
power_output_model : str
71-
Parameter to define which model to use to calculate the turbine power
72-
output. Valid options are 'power_curve' and 'power_coefficient_curve'.
73-
Default: 'power_curve'.
112+
Defines which model is used to calculate the turbine power output.
74113
density_correction : bool
75-
If the parameter is True the density corrected power curve is used for
76-
the calculation of the turbine power output. Default: False.
77-
hellman_exp : float
78-
The Hellman exponent, which combines the increase in wind speed due to
79-
stability of atmospheric conditions and surface roughness into one
80-
constant. Default: None.
114+
Used to set `density_correction` parameter in
115+
:func:`~.power_output.power_curve`.
81116
obstacle_height : float
82-
Height of obstacles in the surrounding area of the wind turbine in m.
83-
Set `obstacle_height` to zero for wide spread obstacles. Default: 0.
117+
Used to set `obstacle_height` in :func:`~.wind_speed.logarithmic`.
118+
hellman_exp : float
119+
Used to set `hellman_exponent` in :func:`~.wind_speed.hellman`.
84120
power_output : :pandas:`pandas.Series<series>`
85121
Electrical power output of the wind turbine in W.
86122

windpowerlib/power_curves.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@
1111
import numpy as np
1212
import pandas as pd
1313
from windpowerlib import tools
14-
import warnings
1514

1615

1716
def smooth_power_curve(power_curve_wind_speeds, power_curve_values,
1817
block_width=0.5, wind_speed_range=15.0,
1918
standard_deviation_method='turbulence_intensity',
2019
mean_gauss=0, **kwargs):
2120
r"""
22-
Smoothes the input power curve values by using a Gauss distribution.
21+
Smoothes a power curve by using a Gauss distribution.
2322
2423
The smoothing serves for taking the distribution of wind speeds over space
2524
into account.

windpowerlib/power_output.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def power_curve(wind_speed, power_curve_wind_speeds, power_curve_values,
8888
This function is carried out when the parameter `power_output_model` of an
8989
instance of the :class:`~.modelchain.ModelChain` class is 'power_curve'. If
9090
the parameter `density_correction` is True the density corrected power
91-
curve (See :py:func:`~.power_curve_density_correction`) is used.
91+
curve (see :py:func:`~.power_curve_density_correction`) is used.
9292
9393
Parameters
9494
----------
@@ -104,8 +104,9 @@ def power_curve(wind_speed, power_curve_wind_speeds, power_curve_values,
104104
Density of air at hub height in kg/m³. This parameter is needed
105105
if `density_correction` is True. Default: None.
106106
density_correction : bool
107-
If the parameter is True the density corrected power curve is used for
108-
the calculation of the turbine power output. In this case `density`
107+
If the parameter is True the density corrected power curve (see
108+
:py:func:`~.power_curve_density_correction`) is used for the
109+
calculation of the turbine power output. In this case `density`
109110
cannot be None. Default: False.
110111
111112
Returns

windpowerlib/turbine_cluster_modelchain.py

Lines changed: 79 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -26,54 +26,81 @@ class TurbineClusterModelChain(ModelChain):
2626
representing the wind turbine cluster.
2727
wake_losses_model : str or None
2828
Defines the method for taking wake losses within the farm into
29-
consideration. Options: None, 'wind_farm_efficiency' or the name of a
30-
wind efficiency curve like 'dena_mean'. Default: 'dena_mean'.
31-
Use :py:func:`~.wake_losses.get_wind_efficiency_curve` for all provided
32-
wind efficiency curves.
29+
consideration.
30+
31+
* None -
32+
Wake losses are not taken into account.
33+
* 'wind_farm_efficiency' -
34+
The values of the wind farm power curve(s) are reduced by the wind
35+
farm efficiency, which needs to be set in the
36+
:py:class:`~.wind_farm.WindFarm` class. Note: The wind farm
37+
efficiency has no effect if `wake_losses_model` is not set to
38+
'wind_farm_efficiency'.
39+
See :func:`~.power_curves.wake_losses_to_power_curve` for more
40+
information.
41+
* 'dena_mean' or name of other wind efficiency curve -
42+
The values of the wind speed time series are reduced by the chosen
43+
wind efficiency curve in :func:`~.run_model` before the power output
44+
calculations.
45+
See :func:`~.wake_losses.reduce_wind_speed` for more information.
46+
Use :func:`~.wake_losses.get_wind_efficiency_curve` to get a
47+
DataFrame of all provided wind efficiency curves and see the provided
48+
example on how to plot the wind efficiency curves.
49+
50+
Default: 'dena_mean'.
3351
smoothing : bool
34-
If True the power curves will be smoothed before or after the
35-
aggregation of power curves depending on `smoothing_order`.
52+
If True the power curves will be smoothed to account for the
53+
distribution of wind speeds over space. Depending on the parameter
54+
`smoothing_order` the power curves are smoothed before or after
55+
aggregating wind turbine power curves to one representative power
56+
curve of the wind farm or cluster.
57+
See :func:`~.power_curves.smooth_power_curve` for more information.
58+
3659
Default: False.
3760
block_width : float
3861
Width between the wind speeds in the sum of the equation in
39-
:py:func:`~.power_curves.smooth_power_curve`. Default: 0.5.
62+
:py:func:`~.power_curves.smooth_power_curve`. This parameter is only
63+
used if `smoothing` is True. To achieve a smooth curve without steps a
64+
value not much higher than the step width between the power curve wind
65+
speeds should be chosen.
66+
67+
Default: 0.5.
4068
standard_deviation_method : str
4169
Method for calculating the standard deviation for the Gauss
42-
distribution. Options: 'turbulence_intensity', 'Staffell_Pfenninger'.
70+
distribution if `smoothing` is True.
71+
72+
* 'turbulence_intensity' -
73+
See :func:`~.power_curves.smooth_power_curve` for more information.
74+
* 'Staffell_Pfenninger' -
75+
See :func:`~.power_curves.smooth_power_curve` for more information.
76+
4377
Default: 'turbulence_intensity'.
4478
smoothing_order : str
45-
Defines when the smoothing takes place if `smoothing` is True. Options:
46-
'turbine_power_curves' (to the single turbine power curves),
47-
'wind_farm_power_curves'. Default: 'wind_farm_power_curves'.
79+
Defines when the smoothing takes place if `smoothing` is True.
80+
81+
* 'turbine_power_curves' -
82+
Smoothing is applied to wind turbine power curves.
83+
* 'wind_farm_power_curves' -
84+
Smoothing is applied to wind farm power curves.
85+
86+
Default: 'wind_farm_power_curves'.
4887
4988
Other Parameters
5089
----------------
51-
wind_speed_model : str
52-
Parameter to define which model to use to calculate the wind speed
53-
at hub height. Valid options are 'logarithmic', 'hellman' and
54-
'interpolation_extrapolation'.
55-
temperature_model : str
56-
Parameter to define which model to use to calculate the temperature
57-
of air at hub height. Valid options are 'linear_gradient' and
58-
'interpolation_extrapolation'.
59-
density_model : str
60-
Parameter to define which model to use to calculate the density of
61-
air at hub height. Valid options are 'barometric', 'ideal_gas' and
62-
'interpolation_extrapolation'.
63-
power_output_model : str
64-
Parameter to define which model to use to calculate the turbine
65-
power output. Valid options are 'power_curve' and
66-
'power_coefficient_curve'.
67-
density_correction : bool
68-
If the parameter is True the density corrected power curve is used
69-
for the calculation of the turbine power output.
70-
obstacle_height : float
71-
Height of obstacles in the surrounding area of the wind turbine in
72-
m. Set `obstacle_height` to zero for wide spread obstacles.
73-
hellman_exp : float
74-
The Hellman exponent, which combines the increase in wind speed due
75-
to stability of atmospheric conditions and surface roughness into
76-
one constant.
90+
wind_speed_model :
91+
See :py:class:`~.modelchain.ModelChain` for more information.
92+
temperature_model :
93+
See :py:class:`~.modelchain.ModelChain` for more information.
94+
density_model :
95+
See :py:class:`~.modelchain.ModelChain` for more information.
96+
power_output_model :
97+
See :py:class:`~.modelchain.ModelChain` for more information.
98+
density_correction :
99+
See :py:class:`~.modelchain.ModelChain` for more information.
100+
obstacle_height :
101+
See :py:class:`~.modelchain.ModelChain` for more information.
102+
hellman_exp :
103+
See :py:class:`~.modelchain.ModelChain` for more information.
77104
78105
Attributes
79106
----------
@@ -83,55 +110,38 @@ class TurbineClusterModelChain(ModelChain):
83110
representing the wind turbine cluster.
84111
wake_losses_model : str or None
85112
Defines the method for taking wake losses within the farm into
86-
consideration. Options: None, 'wind_farm_efficiency' or the name of a
87-
wind efficiency curve like 'dena_mean'. Default: 'dena_mean'.
88-
Use :py:func:`~.wake_losses.get_wind_efficiency_curve` for all provided
89-
wind efficiency curves.
113+
consideration.
90114
smoothing : bool
91-
If True the power curves will be smoothed before or after the
92-
aggregation of power curves depending on `smoothing_order`.
93-
Default: False.
115+
If True the power curves are smoothed.
94116
block_width : float
95117
Width between the wind speeds in the sum of the equation in
96-
:py:func:`~.power_curves.smooth_power_curve`. Default: 0.5.
118+
:py:func:`~.power_curves.smooth_power_curve`.
97119
standard_deviation_method : str
98120
Method for calculating the standard deviation for the Gauss
99-
distribution. Options: 'turbulence_intensity', 'Staffell_Pfenninger'.
100-
Default: 'turbulence_intensity'.
121+
distribution.
101122
smoothing_order : str
102-
Defines when the smoothing takes place if `smoothing` is True. Options:
103-
'turbine_power_curves' (to the single turbine power curves),
104-
'wind_farm_power_curves'. Default: 'wind_farm_power_curves'.
123+
Defines when the smoothing takes place if `smoothing` is True.
105124
power_output : :pandas:`pandas.Series<series>`
106125
Electrical power output of the wind turbine in W.
107126
power_curve : :pandas:`pandas.Dataframe<frame>` or None
108127
The calculated power curve of the wind farm.
109128
wind_speed_model : str
110-
Parameter to define which model to use to calculate the wind speed
111-
at hub height. Valid options are 'logarithmic', 'hellman' and
112-
'interpolation_extrapolation'.
129+
Defines which model is used to calculate the wind speed at hub height.
113130
temperature_model : str
114-
Parameter to define which model to use to calculate the temperature
115-
of air at hub height. Valid options are 'linear_gradient' and
116-
'interpolation_extrapolation'.
131+
Defines which model is used to calculate the temperature of air at hub
132+
height.
117133
density_model : str
118-
Parameter to define which model to use to calculate the density of
119-
air at hub height. Valid options are 'barometric', 'ideal_gas' and
120-
'interpolation_extrapolation'.
134+
Defines which model is used to calculate the density of air at hub
135+
height.
121136
power_output_model : str
122-
Parameter to define which model to use to calculate the turbine
123-
power output. Valid options are 'power_curve' and
124-
'power_coefficient_curve'.
137+
Defines which model is used to calculate the turbine power output.
125138
density_correction : bool
126-
If the parameter is True the density corrected power curve is used
127-
for the calculation of the turbine power output.
139+
Used to set `density_correction` parameter in
140+
:func:`~.power_output.power_curve`.
128141
obstacle_height : float
129-
Height of obstacles in the surrounding area of the wind turbine in
130-
m. Set `obstacle_height` to zero for wide spread obstacles.
142+
Used to set `obstacle_height` in :func:`~.wind_speed.logarithmic`.
131143
hellman_exp : float
132-
The Hellman exponent, which combines the increase in wind speed due
133-
to stability of atmospheric conditions and surface roughness into
134-
one constant.
144+
Used to set `hellman_exponent` in :func:`~.wind_speed.hellman`.
135145
136146
"""
137147
def __init__(self, power_plant, wake_losses_model='dena_mean',

0 commit comments

Comments
 (0)