Skip to content

Commit 013f409

Browse files
Birgit SchachlerBirgit Schachler
authored andcommitted
Merge branch 'dev' of github.com:wind-python/windpowerlib into dev
2 parents cf87e74 + ff7eb6b commit 013f409

File tree

6 files changed

+118
-112
lines changed

6 files changed

+118
-112
lines changed

windpowerlib/data/cp_curves.csv

Lines changed: 91 additions & 91 deletions
Large diffs are not rendered by default.

windpowerlib/density.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ def temperature_gradient(temp_air, temp_height, hub_height):
4242
with:
4343
T: temperature [K], h: height [m]
4444
45-
:math:`h_{T,data}` is the height in which the temperature is measured.
45+
:math:`h_{T,data}` is the height in which the temperature :math:`T_{air}`
46+
is measured and :math:`T_{hub}` is the temperature at hub height
47+
:math:`h_{hub}` of the wind turbine.
4648
4749
Assumptions:
4850
@@ -143,7 +145,7 @@ def rho_barometric(pressure, pressure_height, hub_height, temp_hub):
143145
:math:`h_{p,data}` is the height of the measurement or model data for
144146
pressure, :math:`p_0` the ambient air pressure, :math:`\rho_0` the ambient
145147
density of air, :math:`T_0` the ambient temperature and :math:`T_{hub}` the
146-
temperature at hub height.
148+
temperature at hub height :math:`h_{hub}`.
147149
148150
Assumptions:
149151
@@ -198,8 +200,10 @@ def rho_ideal_gas(pressure, pressure_height, hub_height, temp_hub):
198200
with:
199201
T: temperature [K], :math:`\rho`: density [kg/m³], p: pressure [Pa]
200202
201-
:math:`R_s` is the specific gas constant of dry air (287.058 J/(kg*K)) and
202-
:math:`p_{hub}` is the pressure at hub height.
203+
:math:`h_{p,data}` is the height of the measurement or model data for
204+
pressure, :math:`R_s` is the specific gas constant of dry air
205+
(287.058 J/(kg*K)) and :math:`p_{hub}` is the pressure at hub height
206+
:math:`h_{hub}`.
203207
204208
References
205209
----------

windpowerlib/power_output.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,14 @@ def p_curve(p_values, v_wind):
133133
p_values : pandas.DataFrame
134134
Power curve of the wind turbine.
135135
Indices are the wind speeds of the power curve in m/s, the
136-
corresponding power values in W are in the column 'P'.
136+
corresponding power values are in the column 'P'.
137137
v_wind : pandas.Series or array
138138
Wind speed at hub height in m/s.
139139
140140
Returns
141141
-------
142142
power_output : pandas.Series
143-
Electrical power output of the wind turbine in W.
143+
Electrical power output of the wind turbine in the unit of `p_values`.
144144
145145
Notes
146146
-------
@@ -178,13 +178,13 @@ def p_curve_density_corr(v_wind, rho_hub, p_values):
178178
Density of air at hub height in kg/m³.
179179
p_values : pandas.DataFrame
180180
Power curve of the wind turbine.
181-
The indices are the corresponding wind speeds of the power curve, the
182-
power values containing column is called 'P'.
181+
Indices are the wind speeds of the power curve in m/s, the
182+
corresponding power values are in the column 'P'.
183183
184184
Returns
185185
-------
186186
power_output : pandas.Series
187-
Electrical power output of the wind turbine in W.
187+
Electrical power output of the wind turbine in the unit of `p_values`.
188188
189189
Notes
190190
-----
@@ -204,9 +204,11 @@ def p_curve_density_corr(v_wind, rho_hub, p_values):
204204
v: wind speed [m/s], :math:`\rho`: density [kg/m³]
205205
206206
:math:`v_{std}` is the standard wind speed in the power curve
207-
(:math:`v_{std}`, :math:`P_{std}`).
207+
(:math:`v_{std}`, :math:`P_{std}`),
208208
:math:`v_{site}` is the density corrected wind speed for the power curve
209-
(:math:`v_{site}`, :math:`P_{std}`).
209+
(:math:`v_{site}`, :math:`P_{std}`),
210+
:math:`\rho_0` is the ambient density (1.225 kg/m³)
211+
and :math:`\rho_{site}` the density at site conditions (and hub height).
210212
211213
It is assumed that the power output for wind speeds above the maximum
212214
wind speed given in the power curve is zero.

windpowerlib/tests/modelchain_tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,14 @@ def test_rho_hub(self):
9191

9292
def test_run_model(self):
9393
# Test with default parameters of modelchain (power curve)
94-
power_output_exp = pd.Series(data=[1731887.39768, 3820152.27489])
94+
power_output_exp = pd.Series(data=[1731.8874, 3820.15227])
9595
test_mc = mc.ModelChain(self.test_wt)
9696
test_mc.run_model(self.weather, self.data_height)
9797
assert_series_equal(test_mc.power_output, power_output_exp)
9898

9999
def test_different_models(self):
100100
# Test with density corrected power curve
101-
power_output_exp = pd.Series(data=[1430312.76771, 3746075.21279])
101+
power_output_exp = pd.Series(data=[1430.31277, 3746.07521])
102102
self.test_modelchain['density_corr'] = True
103103
test_wt = wt.WindTurbine(**self.test_turbine)
104104
test_mc = mc.ModelChain(test_wt, **self.test_modelchain)

windpowerlib/wind_speed.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ def logarithmic_wind_profile(v_wind, v_wind_height, hub_height, z_0,
5757
.. math:: v_{wind,hub}=v_{wind,data}\cdot\frac{\ln\left(\frac{h_{hub}}
5858
{z_{0}}\right)}{\ln\left(\frac{h_{data}}{z_{0}}\right)}
5959
60-
:math:`h_{data}` is the height at which the wind speed
61-
:math:`v_{wind,data}` is measured.
60+
:math:`h_{data}` is the height in which the wind speed
61+
:math:`v_{wind,data}` is measured and :math:`v_{wind,hub}` is the wind
62+
speed at hub height :math:`h_{hub}` of the wind turbine.
6263
6364
Parameters `v_wind_height`, `z_0`, `hub_height` and `obstacle_height` have
6465
to be of the same unit.
@@ -114,8 +115,7 @@ def v_wind_hellman(v_wind, v_wind_height, hub_height, hellman_exp=None,
114115
115116
Notes
116117
-----
117-
The following equation is used [1]_,
118-
[2]_, [3]_:
118+
The following equation is used [1]_, [2]_, [3]_:
119119
120120
.. math:: v_{wind,hub}=v_{wind,data}\cdot \left(\frac{h_{hub}}{h_{data}}
121121
\right)^\alpha
@@ -124,8 +124,8 @@ def v_wind_hellman(v_wind, v_wind_height, hub_height, hellman_exp=None,
124124
v: wind speed, h: height, :math:`\alpha`: Hellman exponent
125125
126126
:math:`h_{data}` is the height in which the wind speed
127-
:math:`v_{wind,data}` is measured and :math:`h_{hub}` is the hub height of
128-
the wind turbine.
127+
:math:`v_{wind,data}` is measured and :math:`v_{wind,hub}` is the wind
128+
speed at hub height :math:`h_{hub}` of the wind turbine.
129129
130130
For the Hellman exponent :math:`\alpha` many studies use a value of 1/7 for
131131
onshore and a value of 1/9 for offshore. The Hellman exponent can also

windpowerlib/wind_turbine.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,12 @@ def restructure_data():
163163
data = np.delete(data, 0, 0)
164164
df = pd.DataFrame(data, columns=['v_wind', self.fetch_curve])
165165
df.set_index('v_wind', drop=True, inplace=True)
166-
nominal_power = wpp_df['p_nom'].iloc[0] * 1000
166+
nominal_power = wpp_df['p_nom'].iloc[0]
167167
return df, nominal_power
168168
if self.fetch_curve == 'P':
169169
filename = 'P_curves.csv'
170170
p_values, p_nom = restructure_data()
171-
self.p_values = p_values * 1000
171+
self.p_values = p_values
172172
else:
173173
filename = 'cp_curves.csv'
174174
self.cp_values, p_nom = restructure_data()

0 commit comments

Comments
 (0)