From 308f1765112867d37b1e81f23aff28f67e7f0fa3 Mon Sep 17 00:00:00 2001 From: Chris Bay <12664940+bayc@users.noreply.github.com> Date: Thu, 22 Feb 2024 15:16:51 -0700 Subject: [PATCH] Update multidimensional turbine model to use absolute power (#818) --- floris/simulation/turbine/turbine.py | 25 +- .../iea_15MW_multi_dim_Tp_Hs.csv | 406 +++++++++--------- tests/conftest.py | 20 +- tests/turbine_multi_dim_unit_test.py | 54 +-- 4 files changed, 252 insertions(+), 253 deletions(-) diff --git a/floris/simulation/turbine/turbine.py b/floris/simulation/turbine/turbine.py index 6389bf9b0..191072ce6 100644 --- a/floris/simulation/turbine/turbine.py +++ b/floris/simulation/turbine/turbine.py @@ -520,21 +520,16 @@ def _initialize_multidim_power_thrust_table(self): data = df2.loc[key] # Build the interpolants - power_thrust_table_.update({ - key: { - "wind_speed": data['ws'].values, - "power": ( - # NOTE: generator_efficiency hardcoded to 0.944 here (NREL 5MW default). - # This code will be - # removed in a separate PR when power is specified as an absolute value for - # mutlidimensional turbines - 0.5 * self.rotor_area * data['Cp'].values * 0.944 - * data['ws'].values ** 3 * power_thrust_table_ref["ref_air_density"] / 1000 - ), # TODO: convert this to 'power' or 'P' in data tables, as per PR #765 - "thrust_coefficient": data['Ct'].values, - **power_thrust_table_ref - }, - }) + power_thrust_table_.update( + { + key: { + "wind_speed": data['ws'].values, + "power": data['power'].values, + "thrust_coefficient": data['thrust_coefficient'].values, + **power_thrust_table_ref + }, + } + ) # Add reference information at the lower level # Set on-object version diff --git a/floris/turbine_library/iea_15MW_multi_dim_Tp_Hs.csv b/floris/turbine_library/iea_15MW_multi_dim_Tp_Hs.csv index b30eac5a3..70fcef234 100644 --- a/floris/turbine_library/iea_15MW_multi_dim_Tp_Hs.csv +++ b/floris/turbine_library/iea_15MW_multi_dim_Tp_Hs.csv @@ -1,213 +1,217 @@ -Tp,Hs,ws,Cp,Ct +Tp,Hs,ws,power,thrust_coefficient 2,1,0,0,0 -2,1,3,0.049361236,0.817533319 -2,1,3.54953237,0.224324252,0.792115292 -2,1,4.067900771,0.312216418,0.786401899 -2,1,4.553906848,0.36009987,0.788898744 -2,1,5.006427063,0.38761204,0.790774576 -2,1,5.424415288,0.404010164,0.79208669 -2,1,5.806905228,0.413979324,0.79185809 -2,1,6.153012649,0.420083692,0.7903853 -2,1,6.461937428,0.423787764,0.788253035 -2,1,6.732965398,0.425977895,0.785845184 -2,1,6.965470002,0.427193272,0.783367164 -2,1,7.158913742,0.427183505,0.77853469 -2,1,7.312849418,0.426860928,0.77853469 -2,1,7.426921164,0.426617959,0.77853469 -2,1,7.500865272,0.426458783,0.77853469 -2,1,7.534510799,0.426385957,0.77853469 -2,1,7.541241633,0.426371389,0.77853469 -2,1,7.58833327,0.426268826,0.77853469 -2,1,7.675676842,0.426077456,0.77853469 -2,1,7.803070431,0.425795302,0.77853469 -2,1,7.970219531,0.425420049,0.77853469 -2,1,8.176737731,0.424948854,0.77853469 -2,1,8.422147605,0.424379028,0.77853469 -2,1,8.70588182,0.423707714,0.77853469 -2,1,9.027284445,0.422932811,0.77853469 -2,1,9.385612468,0.422052556,0.77853469 -2,1,9.780037514,0.421065815,0.77853469 -2,1,10.20964776,0.419972455,0.77853469 -2,1,10.67345004,0.419400676,0.781531069 -2,1,10.86770694,0.418981957,0.758935311 -2,1,11.17037214,0.385839135,0.614478855 -2,1,11.6992653,0.335840083,0.498687801 -2,1,12.25890683,0.29191329,0.416354609 -2,1,12.84800295,0.253572514,0.351944846 -2,1,13.46519181,0.220278082,0.299832337 -2,1,14.10904661,0.191477908,0.256956606 -2,1,14.77807889,0.166631343,0.221322169 -2,1,15.470742,0.145236797,0.19150758 -2,1,16.18543466,0.126834289,0.166435523 -2,1,16.92050464,0.111011925,0.145263684 -2,1,17.67425264,0.097406118,0.127319849 -2,1,18.44493615,0.085699408,0.11206048 -2,1,19.23077353,0.075616912,0.099042189 -2,1,20.02994808,0.066922115,0.087901155 -2,1,20.8406123,0.059412477,0.078337446 -2,1,21.66089211,0.052915227,0.07010295 -2,1,22.4888912,0.04728299,0.062991402 -2,1,23.32269542,0.042390922,0.056831647 -2,1,24.1603772,0.038132739,0.05148062 -2,1,25,0.03441828,0.046818787 +2,1,2.9,0,0 +2,1,3,42.733312,0.80742173 +2,1,3.54953237,292.585981,0.784655297 +2,1,4.067900771,607.966543,0.781771245 +2,1,4.553906848,981.097693,0.785377072 +2,1,5.006427063,1401.98084,0.788045584 +2,1,5.424415288,1858.67086,0.789922119 +2,1,5.806905228,2337.575997,0.790464625 +2,1,6.153012649,2824.097302,0.789868339 +2,1,6.461937428,3303.06456,0.788727582 +2,1,6.732965398,3759.432328,0.787359348 +2,1,6.965470002,4178.637714,0.785895402 +2,1,7.158913742,4547.19121,0.778275899 +2,1,7.312849418,4855.342682,0.778275899 +2,1,7.426921164,5091.537139,0.778275899 +2,1,7.500865272,5248.453137,0.778275899 +2,1,7.534510799,5320.793207,0.778275899 +2,1,7.541241633,5335.345498,0.778275899 +2,1,7.58833327,5437.90563,0.778275899 +2,1,7.675676842,5631.253025,0.778275899 +2,1,7.803070431,5920.980626,0.778275899 +2,1,7.970219531,6315.115602,0.778275899 +2,1,8.176737731,6824.470067,0.778275899 +2,1,8.422147605,7462.846389,0.778275899 +2,1,8.70588182,8238.359448,0.778275899 +2,1,9.027284445,9167.96703,0.778275899 +2,1,9.385612468,10285.211,0.778275899 +2,1,9.780037514,11617.23699,0.778275899 +2,1,10.20964776,13194.41511,0.778275899 +2,1,10.67345004,15000,0.77176172 +2,1,10.86770694,15000,0.747149663 +2,1,11.17037214,15000,0.562338457 +2,1,11.6992653,15000,0.463477777 +2,1,12.25890683,15000,0.389083718 +2,1,12.84800295,15000,0.329822385 +2,1,13.46519181,15000,0.281465071 +2,1,14.10904661,15000,0.241494345 +2,1,14.77807889,15000,0.208180574 +2,1,15.470742,15000,0.180257568 +2,1,16.18543466,15000,0.156747535 +2,1,16.92050464,15000,0.136877529 +2,1,17.67425264,15000,0.120026379 +2,1,18.44493615,15000,0.105689427 +2,1,19.23077353,15000,0.093453742 +2,1,20.02994808,15000,0.082979637 +2,1,20.8406123,15000,0.073986457 +2,1,21.66089211,15000,0.066241166 +2,1,22.4888912,15000,0.059552107 +2,1,23.32269542,15000,0.053756866 +2,1,24.1603772,15000,0.048721662 +2,1,25,15000,0.044334197 2,1,25.02,0,0 2,1,50,0,0 2,5,0,0,0 -2,5,3,0.024680618,0.40876666 -2,5,3.54953237,0.112162126,0.396057646 -2,5,4.067900771,0.156108209,0.39320095 -2,5,4.553906848,0.180049935,0.394449372 -2,5,5.006427063,0.19380602,0.395387288 -2,5,5.424415288,0.202005082,0.396043345 -2,5,5.806905228,0.206989662,0.395929045 -2,5,6.153012649,0.210041846,0.39519265 -2,5,6.461937428,0.211893882,0.394126518 -2,5,6.732965398,0.212988948,0.392922592 -2,5,6.965470002,0.213596636,0.391683582 -2,5,7.158913742,0.213591753,0.389267345 -2,5,7.312849418,0.213430464,0.389267345 -2,5,7.426921164,0.21330898,0.389267345 -2,5,7.500865272,0.213229392,0.389267345 -2,5,7.534510799,0.213192979,0.389267345 -2,5,7.541241633,0.213185695,0.389267345 -2,5,7.58833327,0.213134413,0.389267345 -2,5,7.675676842,0.213038728,0.389267345 -2,5,7.803070431,0.212897651,0.389267345 -2,5,7.970219531,0.212710025,0.389267345 -2,5,8.176737731,0.212474427,0.389267345 -2,5,8.422147605,0.212189514,0.389267345 -2,5,8.70588182,0.211853857,0.389267345 -2,5,9.027284445,0.211466406,0.389267345 -2,5,9.385612468,0.211026278,0.389267345 -2,5,9.780037514,0.210532908,0.389267345 -2,5,10.20964776,0.209986228,0.389267345 -2,5,10.67345004,0.209700338,0.390765535 -2,5,10.86770694,0.209490979,0.379467656 -2,5,11.17037214,0.192919568,0.307239428 -2,5,11.6992653,0.167920042,0.249343901 -2,5,12.25890683,0.145956645,0.208177305 -2,5,12.84800295,0.126786257,0.175972423 -2,5,13.46519181,0.110139041,0.149916169 -2,5,14.10904661,0.095738954,0.128478303 -2,5,14.77807889,0.083315672,0.110661085 -2,5,15.470742,0.072618399,0.09575379 -2,5,16.18543466,0.063417145,0.083217762 -2,5,16.92050464,0.055505963,0.072631842 -2,5,17.67425264,0.048703059,0.063659925 -2,5,18.44493615,0.042849704,0.05603024 -2,5,19.23077353,0.037808456,0.049521095 -2,5,20.02994808,0.033461058,0.043950578 -2,5,20.8406123,0.029706239,0.039168723 -2,5,21.66089211,0.026457614,0.035051475 -2,5,22.4888912,0.023641495,0.031495701 -2,5,23.32269542,0.021195461,0.028415824 -2,5,24.1603772,0.01906637,0.02574031 -2,5,25,0.01720914,0.023409394 +2,5,2.9,0,0 +2,5,3,21.366656,0.403710865 +2,5,3.54953237,146.2929905,0.392327649 +2,5,4.067900771,303.9832715,0.390885623 +2,5,4.553906848,490.5488465,0.392688536 +2,5,5.006427063,700.99042,0.394022792 +2,5,5.424415288,929.33543,0.39496106 +2,5,5.806905228,1168.787999,0.395232313 +2,5,6.153012649,1412.048651,0.39493417 +2,5,6.461937428,1651.53228,0.394363791 +2,5,6.732965398,1879.716164,0.393679674 +2,5,6.965470002,2089.318857,0.392947701 +2,5,7.158913742,2273.595605,0.38913795 +2,5,7.312849418,2427.671341,0.38913795 +2,5,7.426921164,2545.76857,0.38913795 +2,5,7.500865272,2624.226569,0.38913795 +2,5,7.534510799,2660.396604,0.38913795 +2,5,7.541241633,2667.672749,0.38913795 +2,5,7.58833327,2718.952815,0.38913795 +2,5,7.675676842,2815.626513,0.38913795 +2,5,7.803070431,2960.490313,0.38913795 +2,5,7.970219531,3157.557801,0.38913795 +2,5,8.176737731,3412.235034,0.38913795 +2,5,8.422147605,3731.423195,0.38913795 +2,5,8.70588182,4119.179724,0.38913795 +2,5,9.027284445,4583.983515,0.38913795 +2,5,9.385612468,5142.6055,0.38913795 +2,5,9.780037514,5808.618495,0.38913795 +2,5,10.20964776,6597.207555,0.38913795 +2,5,10.67345004,7500,0.38588086 +2,5,10.86770694,7500,0.373574832 +2,5,11.17037214,7500,0.281169229 +2,5,11.6992653,7500,0.231738889 +2,5,12.25890683,7500,0.194541859 +2,5,12.84800295,7500,0.164911193 +2,5,13.46519181,7500,0.140732536 +2,5,14.10904661,7500,0.120747173 +2,5,14.77807889,7500,0.104090287 +2,5,15.470742,7500,0.090128784 +2,5,16.18543466,7500,0.078373768 +2,5,16.92050464,7500,0.068438765 +2,5,17.67425264,7500,0.06001319 +2,5,18.44493615,7500,0.052844714 +2,5,19.23077353,7500,0.046726871 +2,5,20.02994808,7500,0.041489819 +2,5,20.8406123,7500,0.036993229 +2,5,21.66089211,7500,0.033120583 +2,5,22.4888912,7500,0.029776054 +2,5,23.32269542,7500,0.026878433 +2,5,24.1603772,7500,0.024360831 +2,5,25,7500,0.022167099 2,5,25.02,0,0 2,5,50,0,0 4,1,0,0,0 -4,1,3,0.012340309,0.20438333 -4,1,3.54953237,0.056081063,0.198028823 -4,1,4.067900771,0.078054105,0.196600475 -4,1,4.553906848,0.090024968,0.197224686 -4,1,5.006427063,0.09690301,0.197693644 -4,1,5.424415288,0.101002541,0.198021673 -4,1,5.806905228,0.103494831,0.197964523 -4,1,6.153012649,0.105020923,0.197596325 -4,1,6.461937428,0.105946941,0.197063259 -4,1,6.732965398,0.106494474,0.196461296 -4,1,6.965470002,0.106798318,0.195841791 -4,1,7.158913742,0.106795876,0.194633673 -4,1,7.312849418,0.106715232,0.194633673 -4,1,7.426921164,0.10665449,0.194633673 -4,1,7.500865272,0.106614696,0.194633673 -4,1,7.534510799,0.106596489,0.194633673 -4,1,7.541241633,0.106592847,0.194633673 -4,1,7.58833327,0.106567207,0.194633673 -4,1,7.675676842,0.106519364,0.194633673 -4,1,7.803070431,0.106448826,0.194633673 -4,1,7.970219531,0.106355012,0.194633673 -4,1,8.176737731,0.106237214,0.194633673 -4,1,8.422147605,0.106094757,0.194633673 -4,1,8.70588182,0.105926929,0.194633673 -4,1,9.027284445,0.105733203,0.194633673 -4,1,9.385612468,0.105513139,0.194633673 -4,1,9.780037514,0.105266454,0.194633673 -4,1,10.20964776,0.104993114,0.194633673 -4,1,10.67345004,0.104850169,0.195382767 -4,1,10.86770694,0.104745489,0.189733828 -4,1,11.17037214,0.096459784,0.153619714 -4,1,11.6992653,0.083960021,0.12467195 -4,1,12.25890683,0.072978323,0.104088652 -4,1,12.84800295,0.063393129,0.087986212 -4,1,13.46519181,0.055069521,0.074958084 -4,1,14.10904661,0.047869477,0.064239152 -4,1,14.77807889,0.041657836,0.055330542 -4,1,15.470742,0.036309199,0.047876895 -4,1,16.18543466,0.031708572,0.041608881 -4,1,16.92050464,0.027752981,0.036315921 -4,1,17.67425264,0.02435153,0.031829962 -4,1,18.44493615,0.021424852,0.02801512 -4,1,19.23077353,0.018904228,0.024760547 -4,1,20.02994808,0.016730529,0.021975289 -4,1,20.8406123,0.014853119,0.019584362 -4,1,21.66089211,0.013228807,0.017525738 -4,1,22.4888912,0.011820748,0.015747851 -4,1,23.32269542,0.010597731,0.014207912 -4,1,24.1603772,0.009533185,0.012870155 -4,1,25,0.00860457,0.011704697 +4,1,2.9,0,0 +4,1,3,10.683328,0.201855433 +4,1,3.54953237,73.14649525,0.196163824 +4,1,4.067900771,151.9916358,0.195442811 +4,1,4.553906848,245.2744233,0.196344268 +4,1,5.006427063,350.49521,0.197011396 +4,1,5.424415288,464.667715,0.19748053 +4,1,5.806905228,584.3939993,0.197616156 +4,1,6.153012649,706.0243255,0.197467085 +4,1,6.461937428,825.76614,0.197181896 +4,1,6.732965398,939.858082,0.196839837 +4,1,6.965470002,1044.659429,0.196473851 +4,1,7.158913742,1136.797803,0.194568975 +4,1,7.312849418,1213.835671,0.194568975 +4,1,7.426921164,1272.884285,0.194568975 +4,1,7.500865272,1312.113284,0.194568975 +4,1,7.534510799,1330.198302,0.194568975 +4,1,7.541241633,1333.836375,0.194568975 +4,1,7.58833327,1359.476408,0.194568975 +4,1,7.675676842,1407.813256,0.194568975 +4,1,7.803070431,1480.245157,0.194568975 +4,1,7.970219531,1578.778901,0.194568975 +4,1,8.176737731,1706.117517,0.194568975 +4,1,8.422147605,1865.711597,0.194568975 +4,1,8.70588182,2059.589862,0.194568975 +4,1,9.027284445,2291.991758,0.194568975 +4,1,9.385612468,2571.30275,0.194568975 +4,1,9.780037514,2904.309248,0.194568975 +4,1,10.20964776,3298.603778,0.194568975 +4,1,10.67345004,3750,0.19294043 +4,1,10.86770694,3750,0.186787416 +4,1,11.17037214,3750,0.140584614 +4,1,11.6992653,3750,0.115869444 +4,1,12.25890683,3750,0.09727093 +4,1,12.84800295,3750,0.082455596 +4,1,13.46519181,3750,0.070366268 +4,1,14.10904661,3750,0.060373586 +4,1,14.77807889,3750,0.052045144 +4,1,15.470742,3750,0.045064392 +4,1,16.18543466,3750,0.039186884 +4,1,16.92050464,3750,0.034219382 +4,1,17.67425264,3750,0.030006595 +4,1,18.44493615,3750,0.026422357 +4,1,19.23077353,3750,0.023363436 +4,1,20.02994808,3750,0.020744909 +4,1,20.8406123,3750,0.018496614 +4,1,21.66089211,3750,0.016560292 +4,1,22.4888912,3750,0.014888027 +4,1,23.32269542,3750,0.013439217 +4,1,24.1603772,3750,0.012180416 +4,1,25,3750,0.011083549 4,1,25.02,0,0 4,1,50,0,0 4,5,0,0,0 -4,5,3,0.006170155,0.102191665 -4,5,3.54953237,0.028040532,0.099014412 -4,5,4.067900771,0.039027052,0.098300238 -4,5,4.553906848,0.045012484,0.098612343 -4,5,5.006427063,0.048451505,0.098846822 -4,5,5.424415288,0.050501271,0.099010836 -4,5,5.806905228,0.051747416,0.098982261 -4,5,6.153012649,0.052510462,0.098798163 -4,5,6.461937428,0.052973471,0.09853163 -4,5,6.732965398,0.053247237,0.098230648 -4,5,6.965470002,0.053399159,0.097920896 -4,5,7.158913742,0.053397938,0.097316836 -4,5,7.312849418,0.053357616,0.097316836 -4,5,7.426921164,0.053327245,0.097316836 -4,5,7.500865272,0.053307348,0.097316836 -4,5,7.534510799,0.053298245,0.097316836 -4,5,7.541241633,0.053296424,0.097316836 -4,5,7.58833327,0.053283603,0.097316836 -4,5,7.675676842,0.053259682,0.097316836 -4,5,7.803070431,0.053224413,0.097316836 -4,5,7.970219531,0.053177506,0.097316836 -4,5,8.176737731,0.053118607,0.097316836 -4,5,8.422147605,0.053047379,0.097316836 -4,5,8.70588182,0.052963464,0.097316836 -4,5,9.027284445,0.052866602,0.097316836 -4,5,9.385612468,0.05275657,0.097316836 -4,5,9.780037514,0.052633227,0.097316836 -4,5,10.20964776,0.052496557,0.097316836 -4,5,10.67345004,0.052425085,0.097691384 -4,5,10.86770694,0.052372745,0.094866914 -4,5,11.17037214,0.048229892,0.076809857 -4,5,11.6992653,0.041980011,0.062335975 -4,5,12.25890683,0.036489161,0.052044326 -4,5,12.84800295,0.031696564,0.043993106 -4,5,13.46519181,0.02753476,0.037479042 -4,5,14.10904661,0.023934739,0.032119576 -4,5,14.77807889,0.020828918,0.027665271 -4,5,15.470742,0.0181546,0.023938448 -4,5,16.18543466,0.015854286,0.020804441 -4,5,16.92050464,0.013876491,0.018157961 -4,5,17.67425264,0.012175765,0.015914981 -4,5,18.44493615,0.010712426,0.01400756 -4,5,19.23077353,0.009452114,0.012380274 -4,5,20.02994808,0.008365265,0.010987645 -4,5,20.8406123,0.00742656,0.009792181 -4,5,21.66089211,0.006614404,0.008762869 -4,5,22.4888912,0.005910374,0.007873925 -4,5,23.32269542,0.005298865,0.007103956 -4,5,24.1603772,0.004766593,0.006435078 -4,5,25,0.004302285,0.005852349 +4,5,2.9,0,0 +4,5,3,5.341664,0.100927716 +4,5,3.54953237,36.57324763,0.098081912 +4,5,4.067900771,75.99581788,0.097721406 +4,5,4.553906848,122.6372116,0.098172134 +4,5,5.006427063,175.247605,0.098505698 +4,5,5.424415288,232.3338575,0.098740265 +4,5,5.806905228,292.1969996,0.098808078 +4,5,6.153012649,353.0121628,0.098733542 +4,5,6.461937428,412.88307,0.098590948 +4,5,6.732965398,469.929041,0.098419919 +4,5,6.965470002,522.3297143,0.098236925 +4,5,7.158913742,568.3989013,0.097284487 +4,5,7.312849418,606.9178353,0.097284487 +4,5,7.426921164,636.4421424,0.097284487 +4,5,7.500865272,656.0566421,0.097284487 +4,5,7.534510799,665.0991509,0.097284487 +4,5,7.541241633,666.9181873,0.097284487 +4,5,7.58833327,679.7382038,0.097284487 +4,5,7.675676842,703.9066281,0.097284487 +4,5,7.803070431,740.1225783,0.097284487 +4,5,7.970219531,789.3894503,0.097284487 +4,5,8.176737731,853.0587584,0.097284487 +4,5,8.422147605,932.8557986,0.097284487 +4,5,8.70588182,1029.794931,0.097284487 +4,5,9.027284445,1145.995879,0.097284487 +4,5,9.385612468,1285.651375,0.097284487 +4,5,9.780037514,1452.154624,0.097284487 +4,5,10.20964776,1649.301889,0.097284487 +4,5,10.67345004,1875,0.096470215 +4,5,10.86770694,1875,0.093393708 +4,5,11.17037214,1875,0.070292307 +4,5,11.6992653,1875,0.057934722 +4,5,12.25890683,1875,0.048635465 +4,5,12.84800295,1875,0.041227798 +4,5,13.46519181,1875,0.035183134 +4,5,14.10904661,1875,0.030186793 +4,5,14.77807889,1875,0.026022572 +4,5,15.470742,1875,0.022532196 +4,5,16.18543466,1875,0.019593442 +4,5,16.92050464,1875,0.017109691 +4,5,17.67425264,1875,0.015003297 +4,5,18.44493615,1875,0.013211178 +4,5,19.23077353,1875,0.011681718 +4,5,20.02994808,1875,0.010372455 +4,5,20.8406123,1875,0.009248307 +4,5,21.66089211,1875,0.008280146 +4,5,22.4888912,1875,0.007444013 +4,5,23.32269542,1875,0.006719608 +4,5,24.1603772,1875,0.006090208 +4,5,25,1875,0.005541775 4,5,25.02,0,0 4,5,50,0,0 diff --git a/tests/conftest.py b/tests/conftest.py index 84c71fd45..65bc4f486 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -383,12 +383,20 @@ def __init__(self): } self.turbine_floating["correct_cp_ct_for_tilt"] = True - self.turbine_multi_dim = copy.deepcopy(self.turbine) - del self.turbine_multi_dim['power_thrust_table']['power'] - del self.turbine_multi_dim['power_thrust_table']['thrust_coefficient'] - del self.turbine_multi_dim['power_thrust_table']['wind_speed'] - self.turbine_multi_dim["multi_dimensional_cp_ct"] = True - self.turbine_multi_dim['power_thrust_table']["power_thrust_data_file"] = "" + self.turbine_multi_dim = { + "turbine_type": 'iea_15MW_multi_dim_cp_ct', + "hub_height": 150.0, + "rotor_diameter": 242.24, + "TSR": 8.0, + "multi_dimensional_cp_ct": True, + "power_thrust_table": { + "ref_air_density": 1.225, + "ref_tilt": 6.0, + "cosine_loss_exponent_yaw": 1.88, + "cosine_loss_exponent_tilt": 1.88, + "power_thrust_data_file": 'iea_15MW_multi_dim_Tp_Hs.csv', + } + } self.farm = { "layout_x": X_COORDS, diff --git a/tests/turbine_multi_dim_unit_test.py b/tests/turbine_multi_dim_unit_test.py index 7c0091d49..39f1b1f1a 100644 --- a/tests/turbine_multi_dim_unit_test.py +++ b/tests/turbine_multi_dim_unit_test.py @@ -17,10 +17,6 @@ from tests.conftest import SampleInputs, WIND_SPEEDS -TEST_DATA = Path(__file__).resolve().parent.parent / "floris" / "turbine_library" -CSV_INPUT = TEST_DATA / "iea_15MW_multi_dim_Tp_Hs.csv" - - # size 16 x 1 x 1 x 1 # 16 wind speed and wind direction combinations from conftest WIND_CONDITION_BROADCAST = np.reshape(np.array(WIND_SPEEDS), (-1, 1, 1, 1)) @@ -53,7 +49,6 @@ def test_turbine_init(): turbine_data = SampleInputs().turbine_multi_dim - turbine_data["power_thrust_table"]["power_thrust_data_file"] = CSV_INPUT turbine = Turbine.from_dict(turbine_data) condition = (2, 1) assert turbine.rotor_diameter == turbine_data["rotor_diameter"] @@ -77,7 +72,6 @@ def test_ct(): N_TURBINES = 4 turbine_data = SampleInputs().turbine_multi_dim - turbine_data["power_thrust_table"]["power_thrust_data_file"] = CSV_INPUT turbine = Turbine.from_dict(turbine_data) turbine_type_map = np.array(N_TURBINES * [turbine.turbine_type]) turbine_type_map = turbine_type_map[None, :] @@ -100,7 +94,7 @@ def test_ct(): multidim_condition=condition ) - np.testing.assert_allclose(thrust, np.array([[0.77853469]])) + np.testing.assert_allclose(thrust, np.array([[0.77815736]])) # Multiple turbines with index filter # 4 turbines with 3 x 3 grid arrays @@ -121,25 +115,25 @@ def test_ct(): assert len(thrusts[0]) == len(INDEX_FILTER) thrusts_truth = np.array([ - [0.77853469, 0.77853469], - [0.77853469, 0.77853469], - [0.77853469, 0.77853469], - [0.6957943, 0.6957943 ], - - [0.77853469, 0.77853469], - [0.77853469, 0.77853469], - [0.77853469, 0.77853469], - [0.6957943, 0.6957943 ], - - [0.77853469, 0.77853469], - [0.77853469, 0.77853469], - [0.77853469, 0.77853469], - [0.6957943, 0.6957943 ], - - [0.77853469, 0.77853469], - [0.77853469, 0.77853469], - [0.77853469, 0.77853469], - [0.6957943, 0.6957943 ], + [0.77815736, 0.77815736], + [0.77815736, 0.77815736], + [0.77815736, 0.77815736], + [0.66626835, 0.66626835 ], + + [0.77815736, 0.77815736], + [0.77815736, 0.77815736], + [0.77815736, 0.77815736], + [0.66626835, 0.66626835 ], + + [0.77815736, 0.77815736], + [0.77815736, 0.77815736], + [0.77815736, 0.77815736], + [0.66626835, 0.66626835 ], + + [0.77815736, 0.77815736], + [0.77815736, 0.77815736], + [0.77815736, 0.77815736], + [0.66626835, 0.66626835 ], ]) np.testing.assert_allclose(thrusts, thrusts_truth) @@ -148,7 +142,6 @@ def test_power(): AIR_DENSITY = 1.225 turbine_data = SampleInputs().turbine_multi_dim - turbine_data["power_thrust_table"]["power_thrust_data_file"] = CSV_INPUT turbine = Turbine.from_dict(turbine_data) turbine_type_map = np.array(N_TURBINES * [turbine.turbine_type]) turbine_type_map = turbine_type_map[None, :] @@ -169,7 +162,7 @@ def test_power(): multidim_condition=condition ) - power_truth = 3029825.10569982 + power_truth = 12424759.67683091 np.testing.assert_allclose(p, power_truth) @@ -206,13 +199,12 @@ def test_axial_induction(): N_TURBINES = 4 turbine_data = SampleInputs().turbine_multi_dim - turbine_data["power_thrust_table"]["power_thrust_data_file"] = CSV_INPUT turbine = Turbine.from_dict(turbine_data) turbine_type_map = np.array(N_TURBINES * [turbine.turbine_type]) turbine_type_map = turbine_type_map[None, :] condition = (2, 1) - baseline_ai = 0.2646995 + baseline_ai = np.array([[0.26447651]]) # Single turbine wind_speed = 10.0 @@ -250,7 +242,7 @@ def test_axial_induction(): assert len(ai[0]) == len(INDEX_FILTER) # Test the 10 m/s wind speed to use the same baseline as above - np.testing.assert_allclose(ai[2], baseline_ai) + np.testing.assert_allclose(ai[2][0], baseline_ai) def test_asdict(sample_inputs_fixture: SampleInputs):