Skip to content

Commit 3c3ef66

Browse files
committed
Merge branch 'features/wind_farms_and_clusters' into dev
2 parents 5cb7a41 + 5c06c13 commit 3c3ef66

File tree

8 files changed

+533
-236
lines changed

8 files changed

+533
-236
lines changed

windpowerlib/data/wind_efficiency_curves.csv

Lines changed: 0 additions & 52 deletions
This file was deleted.
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
wind_speed,dena_mean,dena_extreme2,dena_extreme1
2+
0,1,1,1
3+
0.9238,0.99496,0.990716,0.987041
4+
0.9661,0.994957,0.990705,0.987035
5+
0.9819,0.994955,0.990701,0.987033
6+
1.4526,0.994914,0.990712,0.98709
7+
1.4843,0.994911,0.990729,0.987111
8+
1.9602,0.99487,0.990707,0.987156
9+
1.9814,0.994868,0.990666,0.987107
10+
2.4679,0.994826,0.990571,0.987104
11+
2.4891,0.994824,0.990703,0.987305
12+
2.9544,0.994783,0.991409,0.9871
13+
2.9756,0.994781,0.990859,0.986268
14+
3.002,0.994779,0.990024,0.985044
15+
3.0601,0.992179,0.987622,0.981665
16+
3.0972,0.990059,0.985718,0.979058
17+
3.1606,0.987498,0.981896,0.973908
18+
3.24,0.984817,0.976401,0.966572
19+
3.351,0.981497,0.968113,0.955514
20+
3.3933,0.978096,0.964935,0.951255
21+
3.4198,0.977073,0.962972,0.948617
22+
3.4409,0.976254,0.961416,0.946522
23+
3.4832,0.974616,0.958358,0.942385
24+
3.5626,0.971735,0.952794,0.934812
25+
3.6366,0.968855,0.947806,0.927998
26+
3.6947,0.965694,0.944029,0.922836
27+
3.7423,0.963094,0.941034,0.918753
28+
3.7952,0.960974,0.937818,0.914384
29+
3.8798,0.958573,0.932945,0.907829
30+
3.9062,0.956213,0.931499,0.905908
31+
3.9486,0.953053,0.929273,0.902984
32+
4.012,0.951642,0.926171,0.899013
33+
4.0331,0.951172,0.925211,0.897822
34+
4.0543,0.950906,0.924292,0.8967
35+
4.2024,0.94905,0.919214,0.890883
36+
4.4192,0.947209,0.915603,0.887247
37+
4.4774,0.946721,0.914954,0.886529
38+
4.4985,0.946543,0.914689,0.886233
39+
4.6625,0.945167,0.911934,0.883393
40+
4.8211,0.943806,0.909145,0.880311
41+
4.9216,0.943346,0.907805,0.878463
42+
4.985,0.943055,0.907192,0.877406
43+
5.0749,0.942643,0.906548,0.876094
44+
5.2917,0.941482,0.905503,0.873595
45+
5.4715,0.940741,0.904601,0.871882
46+
5.5138,0.940567,0.904327,0.871481
47+
5.535,0.94048,0.904179,0.871277
48+
5.7412,0.940478,0.902561,0.869337
49+
5.921,0.940397,0.901344,0.868349
50+
5.958,0.940407,0.901188,0.868278
51+
6.0003,0.940418,0.901077,0.868253
52+
6.0691,0.940436,0.901083,0.868319
53+
6.2436,0.940874,0.901978,0.868907
54+
6.4445,0.941555,0.903474,0.870066
55+
6.4868,0.941699,0.903722,0.870354
56+
6.5027,0.941752,0.903809,0.870465
57+
6.6772,0.942271,0.904611,0.871782
58+
6.9046,0.943389,0.905646,0.873729
59+
6.9733,0.943729,0.906049,0.87435
60+
6.9945,0.943833,0.906189,0.874543
61+
7.1796,0.944747,0.907804,0.876266
62+
7.3964,0.946265,0.910267,0.878414
63+
7.4599,0.946614,0.910985,0.879079
64+
7.481,0.94673,0.911217,0.879306
65+
7.5709,0.947224,0.912155,0.880293
66+
7.8617,0.948381,0.914866,0.88369
67+
7.9675,0.948895,0.915781,0.884966
68+
7.9887,0.948998,0.915962,0.885222
69+
8.0838,0.94946,0.91677,0.886372
70+
8.3059,0.950858,0.918643,0.889063
71+
8.454,0.952057,0.919913,0.890876
72+
8.4752,0.952169,0.920097,0.891138
73+
8.6497,0.953095,0.921644,0.893294
74+
8.9299,0.954613,0.924205,0.896553
75+
8.9617,0.954787,0.924499,0.896894
76+
9.004,0.95502,0.924893,0.897339
77+
9.2789,0.95653,0.927504,0.900116
78+
9.4482,0.957382,0.929209,0.901871
79+
9.5328,0.957808,0.930102,0.902809
80+
9.5328,0.957808,0.930102,0.902809
81+
9.8236,0.959726,0.933063,0.90652
82+
9.8924,0.960072,0.933686,0.907496
83+
9.9981,0.960604,0.934576,0.909045
84+
10.1568,0.961403,0.935808,0.911358
85+
10.4,0.962693,0.937559,0.914322
86+
10.4053,0.962721,0.937596,0.914378
87+
10.4635,0.962969,0.938001,0.914971
88+
10.8072,0.964438,0.940416,0.918234
89+
10.9923,0.965399,0.941837,0.920077
90+
11.1456,0.966195,0.943156,0.921809
91+
11.4259,0.967593,0.945712,0.925336
92+
11.4576,0.967724,0.945993,0.925732
93+
11.4788,0.967812,0.946179,0.925993
94+
11.7538,0.96895,0.94848,0.92912
95+
11.9865,0.970044,0.950309,0.931429
96+
12.034,0.970268,0.950672,0.931868
97+
12.3355,0.971786,0.952937,0.934541
98+
12.4518,0.972375,0.953825,0.935609
99+
12.5153,0.972696,0.95432,0.936225
100+
12.8325,0.974302,0.956836,0.939705
101+
12.9383,0.974695,0.957661,0.940885
102+
12.9806,0.974852,0.957986,0.941341
103+
13.1763,0.975579,0.959454,0.943345
104+
13.4883,0.976985,0.961657,0.946544
105+
13.5041,0.977056,0.961763,0.946718
106+
13.5094,0.977078,0.961798,0.946777
107+
13.906,0.978693,0.96438,0.951255
108+
13.9748,0.9791,0.964853,0.951893
109+
14.1017,0.979852,0.965765,0.95291
110+
14.4454,0.981049,0.968285,0.955299
111+
14.5036,0.981225,0.968689,0.955726
112+
14.5247,0.981289,0.968831,0.955889
113+
14.9319,0.982525,0.971309,0.959689
114+
14.9478,0.982597,0.971405,0.959842
115+
14.9689,0.982693,0.971535,0.960045
116+
15.3285,0.984322,0.973748,0.963098
117+
15.4554,0.984555,0.974441,0.964041
118+
15.7622,0.985118,0.975828,0.966114
119+
16.0054,0.985847,0.976759,0.967557
120+
16.0266,0.98591,0.976836,0.967673
121+
16.0953,0.986116,0.977087,0.96804
122+
16.3967,0.986873,0.978172,0.969537
123+
16.5131,0.987108,0.978592,0.970113
124+
16.8304,0.98775,0.979783,0.971774
125+
16.9361,0.987855,0.980189,0.972306
126+
16.9784,0.987897,0.980352,0.972509
127+
17.3486,0.988266,0.981758,0.974256
128+
17.4861,0.988623,0.982265,0.975065
129+
17.8245,0.989502,0.983449,0.977558
130+
17.9726,0.989814,0.983949,0.978421
131+
17.9937,0.989858,0.984021,0.978519
132+
18.3163,0.990538,0.98508,0.97955
133+
18.5014,0.991218,0.985617,0.980043
134+
18.5437,0.991373,0.985727,0.980176
135+
18.7182,0.992015,0.986141,0.980898
136+
18.9667,0.992231,0.986685,0.982093
137+
18.9879,0.99225,0.986733,0.982175
138+
19.173,0.992411,0.987179,0.98271
139+
19.4321,0.992677,0.987802,0.983209
140+
19.4532,0.992699,0.987849,0.983247
141+
19.6753,0.992927,0.988303,0.983643
142+
20.0032,0.993258,0.988785,0.984165
143+
20.0244,0.993279,0.988804,0.984193
144+
20.0296,0.993284,0.988809,0.984199
145+
20.4685,0.993281,0.988801,0.984481
146+
20.9127,0.993277,0.988797,0.984463
147+
20.9551,0.993277,0.988803,0.984477
148+
21.1613,0.993275,0.988838,0.984615
149+
21.4839,0.993316,0.988953,0.984953
150+
21.9492,0.993374,0.989269,0.985429
151+
22.4146,0.993433,0.989266,0.985728
152+
22.4569,0.993438,0.989279,0.985745
153+
22.9592,0.993501,0.989568,0.985887
154+
22.9857,0.993506,0.989581,0.985895
155+
23.0068,0.99351,0.989591,0.985901
156+
23.3876,0.993578,0.989698,0.986144
157+
23.451,0.993649,0.989726,0.986217
158+
23.4722,0.993673,0.989737,0.986244
159+
23.5991,0.993816,0.989821,0.986412
160+
23.9957,0.994133,0.990186,0.98685
161+
24.001,0.994155,0.990191,0.986853
162+
24.0221,0.994244,0.990213,0.986864
163+
24.3183,0.99549,0.990479,0.986873
164+
24.4663,0.996441,0.990529,0.986848
165+
24.5086,0.996713,0.990532,0.986849
166+
24.5298,0.996849,0.990531,0.986852
167+
24.7889,0.997687,0.990473,0.986976
168+
25,0.998325,0.990383,0.987165
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
wind_speed,knorr_mean,knorr_extreme1,knorr_extreme2,knorr_extreme3
2+
0,1,1,1,1
3+
0.0224,1,0.999963,1,1
4+
0.0455,1,0.999816,1,1
5+
0.057,1,0.999742,0.999989,1
6+
0.0732,0.999999,0.999638,0.999881,0.999989
7+
0.5068,0.999823,0.996865,0.996984,0.993882
8+
0.6916,0.999749,0.995252,0.995749,0.99128
9+
0.7138,0.99974,0.995058,0.995601,0.991026
10+
1.2223,0.999521,0.990616,0.992203,0.985212
11+
1.2566,0.999506,0.990317,0.991973,0.984816
12+
1.3177,0.99948,0.989859,0.991565,0.98411
13+
1.7754,0.997956,0.986439,0.988507,0.978832
14+
1.776,0.997952,0.986434,0.988502,0.978824
15+
1.9831,0.996783,0.984886,0.987118,0.975828
16+
1.9832,0.996782,0.984885,0.98711,0.975827
17+
2.0298,0.996519,0.981121,0.983851,0.975152
18+
2.1453,0.995867,0.971801,0.97578,0.96455
19+
2.2697,0.995165,0.962421,0.967089,0.953133
20+
2.3187,0.994777,0.958723,0.963662,0.948632
21+
2.562,0.992851,0.940367,0.946258,0.926289
22+
2.6554,0.992112,0.933232,0.939576,0.917711
23+
2.7823,0.991108,0.923541,0.9305,0.906872
24+
2.8742,0.989766,0.916527,0.923931,0.899027
25+
2.9903,0.98807,0.907657,0.913399,0.889105
26+
3.0029,0.987887,0.904739,0.912261,0.888033
27+
3.0132,0.987736,0.902342,0.911326,0.886818
28+
3.112,0.986293,0.879376,0.892128,0.875173
29+
3.1887,0.984676,0.861547,0.877224,0.866132
30+
3.2694,0.982975,0.844662,0.861546,0.856622
31+
3.4321,0.979547,0.810629,0.829003,0.837454
32+
3.4967,0.978185,0.797099,0.816066,0.828746
33+
3.5967,0.975045,0.776188,0.79607,0.815286
34+
3.6984,0.971851,0.755017,0.775724,0.80159
35+
3.8764,0.969173,0.717953,0.740104,0.777613
36+
4.0048,0.967242,0.687958,0.714419,0.760323
37+
4.0126,0.967125,0.687922,0.712858,0.759273
38+
4.0151,0.967088,0.68791,0.712368,0.759185
39+
4.0727,0.966221,0.687644,0.712367,0.757114
40+
4.074,0.966202,0.687638,0.712387,0.757067
41+
4.1197,0.965515,0.68843,0.713098,0.755428
42+
4.449,0.966778,0.69415,0.71823,0.743597
43+
4.5902,0.965749,0.696601,0.720429,0.738526
44+
4.7969,0.964242,0.70019,0.723649,0.730355
45+
4.9252,0.964389,0.702419,0.725649,0.725281
46+
5.4557,0.964995,0.71163,0.733914,0.715213
47+
6.0207,0.965562,0.721441,0.742717,0.704489
48+
6.0887,0.96563,0.721013,0.743776,0.703198
49+
6.206,0.965748,0.720274,0.742924,0.700971
50+
7.0026,0.965036,0.715257,0.737138,0.685853
51+
7.0345,0.965007,0.715056,0.736906,0.685716
52+
7.0356,0.965006,0.715049,0.736922,0.685711
53+
7.0663,0.964979,0.715473,0.737346,0.685579
54+
7.5603,0.96624,0.72231,0.744183,0.683453
55+
7.6808,0.966502,0.723977,0.74585,0.682934
56+
8.0058,0.967209,0.730065,0.750348,0.681536
57+
8.0724,0.967354,0.731312,0.751269,0.681857
58+
8.1059,0.967427,0.732176,0.751733,0.682019
59+
8.2557,0.967753,0.736036,0.75537,0.682742
60+
8.9625,0.969462,0.754253,0.772534,0.686153
61+
9.2988,0.970275,0.76292,0.780699,0.689181
62+
9.8331,0.972059,0.776692,0.793675,0.693995
63+
9.8916,0.972254,0.778199,0.79513,0.694521
64+
10.2186,0.973346,0.787105,0.803272,0.697467
65+
10.4333,0.974062,0.79295,0.808616,0.701084
66+
10.7428,0.975093,0.801378,0.81632,0.706299
67+
10.9047,0.975632,0.805789,0.820698,0.709029
68+
11.0134,0.975995,0.809595,0.823637,0.710861
69+
11.2148,0.976665,0.816644,0.829079,0.715853
70+
11.4946,0.977597,0.826439,0.838253,0.72279
71+
11.9461,0.979697,0.842245,0.853058,0.733985
72+
12.032,0.980096,0.845251,0.855874,0.736623
73+
12.4583,0.982079,0.860177,0.869422,0.749722
74+
12.7404,0.983391,0.868803,0.878384,0.758387
75+
12.8952,0.984111,0.87354,0.883306,0.763659
76+
13.0684,0.984916,0.878837,0.887875,0.769554
77+
13.2877,0.985936,0.884796,0.893661,0.777019
78+
13.3788,0.986139,0.887271,0.896064,0.78012
79+
13.6671,0.986779,0.895104,0.903269,0.789934
80+
13.855,0.987197,0.899678,0.907965,0.796331
81+
13.9085,0.987348,0.90098,0.909301,0.798151
82+
14.0471,0.987739,0.904354,0.911306,0.802869
83+
14.4154,0.988778,0.910804,0.916635,0.815407
84+
14.6115,0.989331,0.91424,0.920078,0.822083
85+
14.6601,0.989468,0.914974,0.920932,0.82374
86+
14.8876,0.989836,0.918409,0.924926,0.831484
87+
14.9846,0.989993,0.919872,0.926118,0.834784
88+
15.1184,0.990209,0.921892,0.927764,0.838841
89+
15.464,0.990769,0.925877,0.932015,0.849321
90+
15.5934,0.990978,0.927754,0.933606,0.853244
91+
15.6135,0.991004,0.928044,0.933853,0.853852
92+
15.9479,0.991437,0.932892,0.937165,0.863991
93+
15.963,0.991457,0.933037,0.937314,0.864449
94+
16.5469,0.992213,0.938643,0.943097,0.879906
95+
16.5634,0.992235,0.938801,0.943223,0.880342
96+
16.9274,0.992584,0.942295,0.94602,0.889979
97+
16.9992,0.992653,0.942807,0.946571,0.89188
98+
17.5841,0.993215,0.946976,0.951064,0.901493
99+
17.6065,0.993237,0.947136,0.951211,0.901861
100+
17.9208,0.993376,0.949376,0.953281,0.907027
101+
18.4026,0.99359,0.95281,0.956456,0.914099
102+
18.7229,0.993732,0.954442,0.958565,0.9188
103+
18.8173,0.993852,0.954923,0.959188,0.920186
104+
19.0613,0.994162,0.956166,0.960258,0.923767
105+
19.7111,0.994988,0.959476,0.963109,0.930075
106+
20.0278,0.99505,0.96109,0.964499,0.93315
107+
20.0507,0.995054,0.96116,0.9646,0.933372
108+
20.2597,0.995095,0.961801,0.965192,0.935401
109+
20.9556,0.995229,0.963934,0.967162,0.939966
110+
21.169,0.995665,0.964588,0.967767,0.941366
111+
21.3418,0.996017,0.965201,0.968256,0.942499
112+
21.4497,0.996237,0.965583,0.968506,0.943207
113+
21.6197,0.996235,0.966186,0.9689,0.944322
114+
22.255,0.996229,0.968438,0.970371,0.947411
115+
22.4255,0.996382,0.969043,0.970766,0.948241
116+
22.7136,0.996641,0.969724,0.971433,0.949642
117+
23.2565,0.997128,0.971009,0.973058,0.952282
118+
23.3713,0.997231,0.971281,0.973401,0.952723
119+
23.5667,0.997499,0.971743,0.973986,0.953474
120+
23.9203,0.997985,0.972545,0.975044,0.954831
121+
23.9355,0.99798,0.972579,0.97509,0.95489
122+
24.4774,0.997796,0.973808,0.975909,0.95697
123+
24.689,0.997724,0.974306,0.976228,0.957783
124+
24.9086,0.998481,0.974822,0.97656,0.958626
125+
24.9501,0.998625,0.97492,0.976623,0.958785
126+
24.9846,0.998744,0.975001,0.976675,0.958918
127+
25,0.998787,0.975031,0.976694,0.958965

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)