Skip to content

Commit 5cb7a41

Browse files
committed
Merge branch 'features/wind_farms_and_clusters' into dev
# Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
1 parent 1c2e603 commit 5cb7a41

File tree

1 file changed

+3
-55
lines changed

1 file changed

+3
-55
lines changed

windpowerlib/turbine_cluster_modelchain.py

Lines changed: 3 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ class TurbineClusterModelChain(object):
2222
A :class:`~.wind_farm.WindFarm` object representing the wind farm or
2323
a :class:`~.wind_turbine_cluster.WindTurbineCluster` object
2424
representing the wind turbine cluster.
25-
density_correction : Boolean
26-
If True a density correction will be applied to the power curves
27-
before the summation. Default: False.
2825
wake_losses_method : String
2926
Defines the method for talking wake losses within the farm into
3027
consideration. Options: 'wind_efficiency_curve', 'constant_efficiency'
@@ -41,11 +38,6 @@ class TurbineClusterModelChain(object):
4138
'Staffell_Pfenninger'.
4239
Default in :py:func:`~.power_curves.smooth_power_curve`:
4340
'turbulence_intensity'.
44-
density_correction_order : String
45-
Defines when the density correction takes place if `density_correction`
46-
is True. Options: 'turbine_power_curves' (to the single turbine power
47-
curves), 'wind_farm_power_curves' or 'cluster_power_curve'.
48-
Default: 'wind_farm_power_curves'.
4941
smoothing_order : String
5042
Defines when the smoothing takes place if `smoothing` is True. Options:
5143
'turbine_power_curves' (to the single turbine power curves),
@@ -58,9 +50,6 @@ class TurbineClusterModelChain(object):
5850
A :class:`~.wind_farm.WindFarm` object representing the wind farm or
5951
a :class:`~.wind_turbine_cluster.WindTurbineCluster` object
6052
representing the wind turbine cluster.
61-
density_correction : Boolean
62-
If True a density correction will be applied to the power curves
63-
before the summation. Default: False.
6453
wake_losses_method : String
6554
Defines the method for talking wake losses within the farm into
6655
consideration. Options: 'wind_efficiency_curve', 'constant_efficiency'
@@ -79,41 +68,30 @@ class TurbineClusterModelChain(object):
7968
'turbulence_intensity'.
8069
power_output : pandas.Series
8170
Electrical power output of the wind turbine in W.
82-
density_correction_order : String
83-
Defines when the density correction takes place if `density_correction`
84-
is True. Options: 'turbine_power_curves' (to the single turbine power
85-
curves), 'wind_farm_power_curves' or 'cluster_power_curve'.
86-
Default: 'wind_farm_power_curves'.
8771
smoothing_order : String
8872
Defines when the smoothing takes place if `smoothing` is True. Options:
8973
'turbine_power_curves' (to the single turbine power curves),
9074
'wind_farm_power_curves' or 'cluster_power_curve'.
9175
Default: 'wind_farm_power_curves'.
9276
9377
"""
94-
def __init__(self, wind_object, density_correction=False,
95-
wake_losses_method='wind_efficiency_curve', smoothing=True,
96-
block_width=0.5,
78+
def __init__(self, wind_object, wake_losses_method='wind_efficiency_curve',
79+
smoothing=True, block_width=0.5,
9780
standard_deviation_method='turbulence_intensity',
98-
density_correction_order='wind_farm_power_curves',
9981
smoothing_order='wind_farm_power_curves'):
10082

10183
self.wind_object = wind_object
102-
self.density_correction = density_correction
10384
self.wake_losses_method = wake_losses_method
10485
self.smoothing = smoothing
10586
self.block_width = block_width
10687
self.standard_deviation_method = standard_deviation_method
107-
self.density_correction_order = density_correction_order
10888
self.smoothing_order = smoothing_order
10989

11090
self.power_output = None
11191

11292
if (isinstance(self.wind_object, wind_farm.WindFarm) and
113-
self.density_correction_order == 'cluster_power_curve' or
11493
self.smoothing_order == 'cluster_power_curve'):
115-
raise ValueError("`density_correction_order` and " +
116-
"`smoothing_order` can only be " +
94+
raise ValueError("`smoothing_order` can only be " +
11795
"'cluster_power_curve' if you calculate a " +
11896
"cluster but `wind_object` is an object of the " +
11997
"class WindFarm.")
@@ -131,15 +109,6 @@ def wind_farm_power_curve(self, wind_farm, **kwargs):
131109
wind_farm : WindFarm
132110
A :class:`~.wind_farm.WindFarm` object representing the wind farm.
133111
134-
# density_df : pandas.DataFrame
135-
# DataFrame with time series for density `density` in kg/m³.
136-
# The columns of the DataFrame are a MultiIndex where the first level
137-
# contains the variable name (density) and the second level
138-
# contains the height at which it applies (e.g. 10, if it was
139-
# measured at a height of 10 m).
140-
# See :py:func:`~.run_model()` for an example on how to
141-
# create the density_df DataFrame.
142-
143112
Other Parameters
144113
----------------
145114
roughness_length : Float, optional.
@@ -174,8 +143,6 @@ def wind_farm_power_curve(self, wind_farm, **kwargs):
174143
"'turbulence_intensity' as " +
175144
"`standard_deviation_method` if " +
176145
"`turbulence_intensity` is not given")
177-
# if self. density_correction:
178-
# pass # TODO: restrictions (density needed)
179146
if self.wake_losses_method is not None:
180147
if wind_farm.efficiency is None:
181148
raise KeyError(
@@ -189,11 +156,6 @@ def wind_farm_power_curve(self, wind_farm, **kwargs):
189156
power_curve = pd.DataFrame(
190157
turbine_type_dict['wind_turbine'].power_curve)
191158
# Editions to power curve before the summation
192-
# if (self.density_correction and
193-
# self.density_correction_order == 'turbine_power_curves'):
194-
# power_curve = power_curves.density_correct_power_curve(
195-
# density_df, power_curve['wind_speed'], # Note: density at hub height has to be passed
196-
# power_curve['power'])
197159
if (self.smoothing and
198160
self.smoothing_order == 'turbine_power_curves'):
199161
power_curve = power_curves.smooth_power_curve(
@@ -219,12 +181,6 @@ def wind_farm_power_curve(self, wind_farm, **kwargs):
219181
list(summarized_power_curve['power'].values)]).transpose()
220182
summarized_power_curve_df.columns = ['wind_speed', 'power']
221183
# Editions to power curve after the summation
222-
# if (self.density_correction and
223-
# self.density_correction_order == 'wind_farm_power_curves'):
224-
# summarized_power_curve_df = (
225-
# power_curves.density_correct_power_curve(
226-
# density_df, summarized_power_curve_df['wind_speed'],
227-
# summarized_power_curve_df['power'])) # Note: density at hub height has to be passed
228184
if (self.smoothing and
229185
self.smoothing_order == 'wind_farm_power_curves'):
230186
summarized_power_curve_df = power_curves.smooth_power_curve(
@@ -429,14 +385,6 @@ def run_model(self, weather_df, **kwargs):
429385
self.assign_power_curve(**kwargs)
430386
# Get modelchain parameters
431387
modelchain_data = self.get_modelchain_data(**kwargs)
432-
# Density correction to cluster power curve # TODO test
433-
if (self.density_correction and
434-
self.density_correction_order == 'wind_farm_power_curves'):
435-
# Note actually for 'cluster_power_curve'. however, probably the
436-
# density correcton will always be done at the end
437-
modelchain_data['density_correction'] = True
438-
else:
439-
modelchain_data['density_correction'] = False
440388
# Run modelchain
441389
mc = modelchain.ModelChain(
442390
self.wind_object, **modelchain_data).run_model(weather_df)

0 commit comments

Comments
 (0)