Skip to content

Commit 889c03f

Browse files
committed
Add option of wind efficiency curve to model chain
1 parent ce61b2d commit 889c03f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

windpowerlib/modelchain.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
__license__ = "GPLv3"
1010

1111
import logging
12-
from windpowerlib import wind_speed, density, temperature, power_output, tools
12+
from windpowerlib import (wind_speed, density, temperature, power_output,
13+
tools, wake_losses)
1314

1415

1516
class ModelChain(object):
@@ -365,7 +366,7 @@ def turbine_power_output(self, wind_speed_hub, density_hub):
365366
"`power_output_model` must be " +
366367
"'power_curve' or 'power_coefficient_curve'.")
367368

368-
def run_model(self, weather_df):
369+
def run_model(self, weather_df, wind_efficiency_curve_name=None):
369370
r"""
370371
Runs the model.
371372
@@ -382,6 +383,7 @@ def run_model(self, weather_df):
382383
contains the height at which it applies (e.g. 10, if it was
383384
measured at a height of 10 m). See below for an example on how to
384385
create the weather_df DataFrame.
386+
wind_efficiency_curve_name # TODO explain if stays
385387
386388
Returns
387389
-------
@@ -411,6 +413,11 @@ def run_model(self, weather_df):
411413
density_hub = (None if (self.power_output_model == 'power_curve' and
412414
self.density_correction is False)
413415
else self.density_hub(weather_df))
416+
# Reduce wind speed if wind efficiency curve name if given
417+
if wind_efficiency_curve_name is not None: # TODO raise error if wind efficiency curve is used for wind turbine
418+
wind_speed_hub = wake_losses.reduce_wind_speed(
419+
wind_speed_hub,
420+
wind_efficiency_curve_name=wind_efficiency_curve_name)
414421
self.power_output = self.turbine_power_output(wind_speed_hub,
415422
density_hub)
416423
return self

0 commit comments

Comments
 (0)