From cf445bcb43c59499bd943a9fb6cba1a617c0a0e8 Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Fri, 3 Mar 2023 15:07:51 -0600 Subject: [PATCH 1/4] Add a regression test for calculate_no_wake --- tests/conftest.py | 2 +- .../floris_interface_regression_test.py | 126 ++++++++++++++++++ 2 files changed, 127 insertions(+), 1 deletion(-) create mode 100644 tests/reg_tests/floris_interface_regression_test.py diff --git a/tests/conftest.py b/tests/conftest.py index 2643db942..5d1cae6b4 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -395,7 +395,7 @@ def __init__(self): "wake": self.wake, "solver": { "type": "turbine_grid", - "turbine_grid_points": 5, + "turbine_grid_points": 3, }, "logging": { "console": {"enable": True, "level": 1}, diff --git a/tests/reg_tests/floris_interface_regression_test.py b/tests/reg_tests/floris_interface_regression_test.py new file mode 100644 index 000000000..3d91c9d04 --- /dev/null +++ b/tests/reg_tests/floris_interface_regression_test.py @@ -0,0 +1,126 @@ +# Copyright 2023 NREL + +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +# See https://floris.readthedocs.io for documentation + +import numpy as np + +from floris.tools import FlorisInterface +from tests.conftest import ( + N_TURBINES, + N_WIND_SPEEDS, + N_WIND_DIRECTIONS, + print_test_values, + assert_results_arrays, +) +from floris.simulation import Ct, power, axial_induction, average_velocity + + +DEBUG = False +VELOCITY_MODEL = "gauss" +DEFLECTION_MODEL = "gauss" + +baseline = np.array( + [ + # 8 m/s + [ + [7.9803783, 0.7634300, 1695368.7987130, 0.2568077], + [7.9803783, 0.7634300, 1695368.7987130, 0.2568077], + [7.9803783, 0.7634300, 1695368.7987130, 0.2568077], + ], + # 9 m/s + [ + [8.9779256, 0.7625731, 2413658.0981405, 0.2563676], + [8.9779256, 0.7625731, 2413658.0981405, 0.2563676], + [8.9779256, 0.7625731, 2413658.0981405, 0.2563676], + ], + # 10 m/s + [ + [9.9754729, 0.7527803, 3306006.2306084, 0.2513940], + [9.9754729, 0.7527803, 3306006.2306084, 0.2513940], + [9.9754729, 0.7527803, 3306006.2306084, 0.2513940], + ], + # 11 m/s + [ + [10.9730201, 0.7304328, 4373596.1594956, 0.2404007], + [10.9730201, 0.7304328, 4373596.1594956, 0.2404007], + [10.9730201, 0.7304328, 4373596.1594956, 0.2404007], + ], + ] +) + + +def test_calculate_no_wake(sample_inputs_fixture): + """ + The calculate_no_wake function calculates the power production of a wind farm + assuming no wake losses. It does this by initializing and finalizing the + floris simulation while skipping the wake calculation. The power for all wind + turbines should be the same for a uniform wind condition. The chosen wake model + is not important since it will not actually be used. However, it is left enabled + instead of using "None" so that additional tests can be constructed here such + as one with yaw activated. + """ + sample_inputs_fixture.floris["wake"]["model_strings"]["velocity_model"] = VELOCITY_MODEL + sample_inputs_fixture.floris["wake"]["model_strings"]["deflection_model"] = DEFLECTION_MODEL + + fi = FlorisInterface(sample_inputs_fixture.floris) + fi.calculate_no_wake() + + n_turbines = fi.floris.farm.n_turbines + n_wind_speeds = fi.floris.flow_field.n_wind_speeds + n_wind_directions = fi.floris.flow_field.n_wind_directions + + velocities = fi.floris.flow_field.u + yaw_angles = fi.floris.farm.yaw_angles + test_results = np.zeros((n_wind_directions, n_wind_speeds, n_turbines, 4)) + + farm_avg_velocities = average_velocity( + velocities, + ) + farm_cts = Ct( + velocities, + yaw_angles, + fi.floris.farm.turbine_fCts, + fi.floris.farm.turbine_type_map, + ) + farm_powers = power( + fi.floris.flow_field.air_density, + fi.floris.farm.ref_density_cp_cts, + velocities, + yaw_angles, + fi.floris.farm.pPs, + fi.floris.farm.turbine_power_interps, + fi.floris.farm.turbine_type_map, + ) + farm_axial_inductions = axial_induction( + velocities, + yaw_angles, + fi.floris.farm.turbine_fCts, + fi.floris.farm.turbine_type_map, + ) + for i in range(n_wind_directions): + for j in range(n_wind_speeds): + for k in range(n_turbines): + test_results[i, j, k, 0] = farm_avg_velocities[i, j, k] + test_results[i, j, k, 1] = farm_cts[i, j, k] + test_results[i, j, k, 2] = farm_powers[i, j, k] + test_results[i, j, k, 3] = farm_axial_inductions[i, j, k] + + if DEBUG: + print_test_values( + farm_avg_velocities, + farm_cts, + farm_powers, + farm_axial_inductions, + ) + + assert_results_arrays(test_results[0], baseline) From ba4219cc9cdd2255ca62aecd2e2f18747493dda5 Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Fri, 3 Mar 2023 15:08:34 -0600 Subject: [PATCH 2/4] Remove unit test in favor of regression test --- tests/floris_interface_test.py | 37 +--------------------------------- 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/tests/floris_interface_test.py b/tests/floris_interface_test.py index 39360338c..fcae562da 100644 --- a/tests/floris_interface_test.py +++ b/tests/floris_interface_test.py @@ -48,8 +48,7 @@ def test_calculate_no_wake(): """ In FLORIS v3.2, running calculate_no_wake twice incorrectly set the yaw angles when the first time has non-zero yaw settings but the second run had all-zero yaw settings. The test below - asserts that the yaw angles are correctly set in subsequent calls to calculate_no_wake. After - that test are additional tests to check the final values of calculate_no_wake. + asserts that the yaw angles are correctly set in subsequent calls to calculate_no_wake. """ fi = FlorisInterface(configuration=YAML_INPUT) yaw_angles = 20 * np.ones( @@ -72,40 +71,6 @@ def test_calculate_no_wake(): fi.calculate_no_wake(yaw_angles=yaw_angles) assert fi.floris.farm.yaw_angles == yaw_angles - # check finalized values of calculate_no_wake - fi_base = FlorisInterface(configuration=YAML_INPUT) - yaw_angles = np.zeros( - ( - fi_base.floris.flow_field.n_wind_directions, - fi_base.floris.flow_field.n_wind_speeds, - fi_base.floris.farm.n_turbines - ) - ) - fi_base.floris.farm.yaw_angles = yaw_angles - fi_base.floris.flow_field.initialize_velocity_field(fi_base.floris.grid) - fi_base.floris.farm.initialize(fi_base.floris.grid.sorted_indices) - fi_base.floris.finalize() - - fi = FlorisInterface(configuration=YAML_INPUT) - fi.calculate_no_wake() - - # check flow_field finalized values - assert np.allclose(fi_base.floris.flow_field.u, fi.floris.flow_field.u) - assert np.allclose(fi_base.floris.flow_field.v, fi.floris.flow_field.v) - assert np.allclose(fi_base.floris.flow_field.w, fi.floris.flow_field.w) - assert np.allclose( - fi_base.floris.flow_field.turbulence_intensity_field, - fi.floris.flow_field.turbulence_intensity_field - ) - - # check farm finalized values - assert np.allclose(fi_base.floris.farm.yaw_angles, fi.floris.farm.yaw_angles) - assert np.allclose(fi_base.floris.farm.hub_heights, fi.floris.farm.hub_heights) - assert np.allclose(fi_base.floris.farm.rotor_diameters, fi.floris.farm.rotor_diameters) - assert np.allclose(fi_base.floris.farm.TSRs, fi.floris.farm.TSRs) - assert np.allclose(fi_base.floris.farm.pPs, fi.floris.farm.pPs) - assert fi_base.floris.farm.turbine_type_map == fi.floris.farm.turbine_type_map - def test_reinitialize(): pass From 26f06d449da208ce64724b1463b07ad20746cbdc Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Mon, 6 Mar 2023 11:17:57 -0600 Subject: [PATCH 3/4] Use 3x3 turbine grid in regression tests (#599) --- tests/conftest.py | 2 +- .../cumulative_curl_regression_test.py | 100 +++++++------- tests/reg_tests/gauss_regression_test.py | 125 +++++++++--------- .../jensen_jimenez_regression_test.py | 52 ++++---- tests/reg_tests/none_regression_test.py | 26 ++-- tests/reg_tests/turbopark_regression_test.py | 50 +++---- 6 files changed, 178 insertions(+), 177 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 2643db942..5d1cae6b4 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -395,7 +395,7 @@ def __init__(self): "wake": self.wake, "solver": { "type": "turbine_grid", - "turbine_grid_points": 5, + "turbine_grid_points": 3, }, "logging": { "console": {"enable": True, "level": 1}, diff --git a/tests/reg_tests/cumulative_curl_regression_test.py b/tests/reg_tests/cumulative_curl_regression_test.py index a2c449fd2..9ef05897b 100644 --- a/tests/reg_tests/cumulative_curl_regression_test.py +++ b/tests/reg_tests/cumulative_curl_regression_test.py @@ -26,28 +26,28 @@ [ # 8 m/s [ - [7.9803783, 0.7634300, 1695368.7987130, 0.2568077], - [5.3585771, 0.8698045, 492577.1572448, 0.3195870], - [4.9669368, 0.8944963, 379718.4177412, 0.3375933], + [7.9736330, 0.7636044, 1691326.6483808, 0.2568973], + [5.4838164, 0.8620156, 529225.9172271, 0.3142687], + [5.0221433, 0.8907283, 394126.6156555, 0.3347186], ], # 9 m/s [ - [8.9779256, 0.7625731, 2413658.0981405, 0.2563676], - [6.0299374, 0.8340431, 719536.2896199, 0.2963110], - [5.5776779, 0.8570341, 560907.3153174, 0.3109458], + [8.9703371, 0.7625570, 2407841.6718785, 0.2563594], + [6.1712539, 0.8275295, 776795.0248898, 0.2923521], + [5.6500663, 0.8533298, 586018.0719934, 0.3085123], ], # 10 m/s [ - [9.9754729, 0.7527803, 3306006.2306084, 0.2513940], - [6.7205268, 0.8035032, 1012640.0064192, 0.2783602], - [6.2110904, 0.8256933, 792936.0055473, 0.2912497], + [9.9670412, 0.7529384, 3298067.1555604, 0.2514735], + [6.8779113, 0.7971705, 1085894.0434488, 0.2748170], + [6.2985764, 0.8216609, 828383.6208269, 0.2888489], ], # 11 m/s [ - [10.9730201, 0.7304328, 4373596.1594956, 0.2404007], - [7.4516751, 0.7774337, 1381908.5141696, 0.2641154], - [6.8606000, 0.7978670, 1077836.5443900, 0.2752040], - ] + [10.9637454, 0.7306256, 4363191.9880631, 0.2404936], + [7.6258784, 0.7725938, 1482932.7552807, 0.2615643], + [6.9611771, 0.7938200, 1124649.7898263, 0.2729648], + ], ] ) @@ -55,28 +55,28 @@ [ # 8 m/s [ - [7.9803783, 0.7605249, 1683956.5765064, 0.2548147], - [5.4029703, 0.8670436, 505567.9316776, 0.3176841], - [4.9742156, 0.8939700, 381463.8369041, 0.3371887], + [7.9736330, 0.7606986, 1679924.0721706, 0.2549029], + [5.5274362, 0.8596051, 543479.0426304, 0.3126534], + [5.0310723, 0.8901730, 396739.4832795, 0.3342992], ], # 9 m/s [ - [8.9779256, 0.7596713, 2397236.5542849, 0.2543815], - [6.0798421, 0.8317429, 739756.7356164, 0.2949042], - [5.5879702, 0.8565074, 564477.6027506, 0.3105979], + [8.9703371, 0.7596552, 2391434.0080674, 0.2543734], + [6.2202711, 0.8252701, 796655.8471824, 0.2909965], + [5.6617378, 0.8527326, 590066.7909898, 0.3081228], ], # 10 m/s [ - [9.9754729, 0.7499157, 3283591.8023665, 0.2494847], - [6.7754450, 0.8012935, 1038201.4571916, 0.2771174], - [6.2236744, 0.8251133, 798034.8027193, 0.2909027], + [9.9670412, 0.7500732, 3275671.6727516, 0.2495630], + [6.9317633, 0.7950036, 1110959.2451850, 0.2736173], + [6.3125748, 0.8210156, 834055.5094286, 0.2884673], ], # 11 m/s [ - [10.9730201, 0.7276532, 4344222.0129382, 0.2386508], - [7.5103951, 0.7755790, 1413728.7289467, 0.2631345], - [6.8746872, 0.7973002, 1084393.3749950, 0.2748890], - ] + [10.9637454, 0.7278454, 4333842.6695283, 0.2387424], + [7.6832308, 0.7711112, 1517301.5142304, 0.2607884], + [6.9761726, 0.7932167, 1131629.3899797, 0.2726328], + ], ] ) @@ -84,27 +84,27 @@ [ # 8 m/s [ - [7.9803783, 0.7605249, 1683956.5765064, 0.2548147], - [5.4219904, 0.8658607, 511133.7736997, 0.3168748], - [4.9901603, 0.8928170, 385287.3116696, 0.3363059], + [7.9736330, 0.7606986, 1679924.0721706, 0.2549029], + [5.5431146, 0.8588028, 548917.6953551, 0.3121189], + [5.0453462, 0.8892852, 400916.4566323, 0.3336309], ], # 9 m/s [ - [8.9779256, 0.7596713, 2397236.5542849, 0.2543815], - [6.1011855, 0.8307591, 748404.6404163, 0.2943055], - [5.6071092, 0.8555280, 571116.7279097, 0.3099527], + [8.9703371, 0.7596552, 2391434.0080674, 0.2543734], + [6.2378520, 0.8244598, 803779.2831349, 0.2905124], + [5.6785118, 0.8518742, 595885.4921489, 0.3075644], ], # 10 m/s [ - [9.9754729, 0.7499157, 3283591.8023665, 0.2494847], - [6.7984638, 0.8003672, 1048915.4794254, 0.2765986], - [6.2451030, 0.8241256, 806717.2493019, 0.2903131], + [9.9670412, 0.7500732, 3275671.6727516, 0.2495630], + [6.9507085, 0.7942413, 1119777.2268361, 0.2731968], + [6.3312183, 0.8201563, 841609.4907163, 0.2879601], ], # 11 m/s [ - [10.9730201, 0.7276532, 4344222.0129382, 0.2386508], - [7.5339320, 0.7749706, 1427833.3888763, 0.2628137], - [6.8970594, 0.7964000, 1094806.4414958, 0.2743897], + [10.9637454, 0.7278454, 4333842.6695283, 0.2387424], + [7.7025449, 0.7706119, 1528875.6023356, 0.2605276], + [6.9954994, 0.7924390, 1140624.9700319, 0.2722057], ], ] ) @@ -113,27 +113,27 @@ [ # 8 m/s [ - [7.9803783, 0.7605249, 1683956.5765064, 0.2548147], - [5.4029709, 0.8670436, 505568.1176628, 0.3176840], - [4.9790760, 0.8936185, 382629.3354701, 0.3369191], + [7.9736330, 0.7606986, 1679924.0721706, 0.2549029], + [5.5274367, 0.8596051, 543479.2092235, 0.3126534], + [5.0364358, 0.8898394, 398309.0269631, 0.3340477], ], # 9 m/s [ - [8.9779256, 0.7596713, 2397236.5542849, 0.2543815], - [6.0798429, 0.8317428, 739757.0246720, 0.2949042], - [5.5937356, 0.8562124, 566477.5644593, 0.3104033], + [8.9703371, 0.7596552, 2391434.0080674, 0.2543734], + [6.2202717, 0.8252701, 796656.0654567, 0.2909965], + [5.6680298, 0.8524106, 592249.4291781, 0.3079132], ], # 10 m/s [ - [9.9754729, 0.7499157, 3283591.8023665, 0.2494847], - [6.7754458, 0.8012934, 1038201.8164555, 0.2771174], - [6.2301672, 0.8248140, 800665.5335362, 0.2907239], + [9.9670412, 0.7500732, 3275671.6727516, 0.2495630], + [6.9317639, 0.7950036, 1110959.5162103, 0.2736173], + [6.3196140, 0.8206912, 836907.6633514, 0.2882756], ], # 11 m/s [ - [10.9730201, 0.7276532, 4344222.0129382, 0.2386508], - [7.5103959, 0.7755790, 1413729.2052485, 0.2631345], - [6.8816977, 0.7970181, 1087656.4020125, 0.2747324], + [10.9637454, 0.7278454, 4333842.6695283, 0.2387424], + [7.6832314, 0.7711112, 1517301.8723625, 0.2607884], + [6.9837299, 0.7929126, 1135146.9152189, 0.2724657], ], ] ) diff --git a/tests/reg_tests/gauss_regression_test.py b/tests/reg_tests/gauss_regression_test.py index 72e8a63e4..8e7513dca 100644 --- a/tests/reg_tests/gauss_regression_test.py +++ b/tests/reg_tests/gauss_regression_test.py @@ -26,28 +26,28 @@ [ # 8 m/s [ - [7.9803783, 0.7634300, 1695368.7987130, 0.2568077], - [5.8384411, 0.8436903, 651363.2435524, 0.3023199], - [5.9388958, 0.8385498, 686209.8630205, 0.2990957], + [7.9736330, 0.7636044, 1691326.6483808, 0.2568973], + [5.9535039, 0.8378023, 691277.2666766, 0.2986311], + [6.0197522, 0.8345126, 715409.4436445, 0.2965993], ], # 9 m/s [ - [8.9779256, 0.7625731, 2413658.0981405, 0.2563676], - [6.5698070, 0.8095679, 942487.9831258, 0.2818073], - [6.7192788, 0.8035535, 1012059.0934624, 0.2783886], + [8.9703371, 0.7625570, 2407841.6718785, 0.2563594], + [6.6995977, 0.8043454, 1002898.6210841, 0.2788357], + [6.8102318, 0.7998937, 1054392.8363310, 0.2763338], ], # 10 m/s [ - [9.9754729, 0.7527803, 3306006.2306084, 0.2513940], - [7.3198945, 0.7817588, 1312122.9051486, 0.2664185], - [7.4982017, 0.7759067, 1406547.1257826, 0.2633075], + [9.9670412, 0.7529384, 3298067.1555604, 0.2514735], + [7.4637061, 0.7770389, 1388279.6564701, 0.2639062], + [7.5999706, 0.7732635, 1467407.3821931, 0.2619157], ], # 11 m/s [ - [10.9730201, 0.7304328, 4373596.1594956, 0.2404007], - [8.1044931, 0.7626381, 1778226.0596889, 0.2564010], - [8.2645633, 0.7622021, 1887140.5106744, 0.2561774], - ] + [10.9637454, 0.7306256, 4363191.9880631, 0.2404936], + [8.2622911, 0.7622083, 1885594.4958198, 0.2561805], + [8.3719551, 0.7619095, 1960211.6949745, 0.2560274], + ], ] ) @@ -55,28 +55,28 @@ [ # 8 m/s [ - [7.9803783, 0.7605249, 1683956.3885389, 0.2548147], - [5.8728701, 0.8419285, 663305.9063892, 0.3012090], - [5.9429700, 0.8383413, 687622.7755572, 0.2989660], + [7.9736330, 0.7606986, 1679924.0721706, 0.2549029], + [5.9856445, 0.8361576, 702426.4817361, 0.2976127], + [6.0238963, 0.8343216, 717088.5782753, 0.2964819], ], # 9 m/s [ - [8.9779256, 0.7596713, 2397237.3791443, 0.2543815], - [6.6084797, 0.8080118, 960487.4337100, 0.2809177], - [6.7240659, 0.8033608, 1014286.5451750, 0.2782799], + [8.9703371, 0.7596552, 2391434.0080674, 0.2543734], + [6.7356851, 0.8028933, 1019695.3621240, 0.2780165], + [6.8150684, 0.7996991, 1056644.0444495, 0.2762251], ], # 10 m/s [ - [9.9754729, 0.7499157, 3283592.6005045, 0.2494847], - [7.3621010, 0.7803736, 1334472.7586013, 0.2656784], - [7.5035925, 0.7757548, 1409651.2478433, 0.2632273], + [9.9670412, 0.7500732, 3275671.6727516, 0.2495630], + [7.5030787, 0.7757681, 1409344.3206494, 0.2632343], + [7.6053686, 0.7731239, 1470642.1508821, 0.2618425], ], # 11 m/s [ - [10.9730201, 0.7276532, 4344217.6993801, 0.2386508], - [8.1489867, 0.7625169, 1808499.5183449, 0.2563388], - [8.2684171, 0.7621916, 1889761.4847929, 0.2561720], - ] + [10.9637454, 0.7278454, 4333842.6695283, 0.2387424], + [8.3037405, 0.7620954, 1913797.3425937, 0.2561227], + [8.3759415, 0.7618987, 1962924.0966747, 0.2560219], + ], ] ) @@ -146,27 +146,27 @@ [ # 8 m/s [ - [7.9803783, 0.7605249, 1683956.5765064, 0.2548147], - [5.8919486, 0.8409522, 669924.4096484, 0.3005960], - [5.9686695, 0.8370262, 696538.0378027, 0.2981500], + [7.9736330, 0.7606986, 1679924.0721706, 0.2549029], + [6.0012497, 0.8353654, 707912.6031236, 0.2971241], + [6.0458168, 0.8333112, 725970.3069204, 0.2958623], ], # 9 m/s [ - [8.9779256, 0.7596713, 2397236.5542849, 0.2543815], - [6.6298866, 0.8071504, 970451.8269047, 0.2804268], - [6.7523126, 0.8022243, 1027434.5597156, 0.2776401], + [8.9703371, 0.7596552, 2391434.0080674, 0.2543734], + [6.7531826, 0.8021893, 1027839.4859975, 0.2776204], + [6.8391301, 0.7987309, 1067843.4584263, 0.2756849], ], # 10 m/s [ - [9.9754729, 0.7499157, 3283591.8023665, 0.2494847], - [7.3851732, 0.7796164, 1346691.8170923, 0.2652748], - [7.5339044, 0.7749713, 1427816.8489148, 0.2628140], + [9.9670412, 0.7500732, 3275671.6727516, 0.2495630], + [7.5219279, 0.7752809, 1420639.8615893, 0.2629772], + [7.6309661, 0.7724622, 1485981.5768983, 0.2614954], ], # 11 m/s [ - [10.9730201, 0.7276532, 4344222.0129382, 0.2386508], - [8.1726065, 0.7624526, 1824571.5626205, 0.2563058], - [8.2991708, 0.7621078, 1910688.0574225, 0.2561290], + [10.9637454, 0.7278454, 4333842.6695283, 0.2387424], + [8.3229930, 0.7620429, 1926897.0262401, 0.2560958], + [8.4021717, 0.7618272, 1980771.5704442, 0.2559853], ], ] ) @@ -175,27 +175,27 @@ [ # 8 m/s [ - [7.9803783, 0.7605249, 1683956.5765064, 0.2548147], - [5.8919476, 0.8409523, 669924.0609678, 0.3005961], - [5.9630522, 0.8373137, 694589.4363406, 0.2983281], + [7.9736330, 0.7606986, 1679924.0721706, 0.2549029], + [6.0012490, 0.8353654, 707912.3201655, 0.2971241], + [6.0404040, 0.8335607, 723777.1688957, 0.2960151], ], # 9 m/s [ - [8.9779256, 0.7596713, 2397236.5542849, 0.2543815], - [6.6298855, 0.8071504, 970451.3019789, 0.2804268], - [6.7460763, 0.8024752, 1024531.8988965, 0.2777812], + [8.9703371, 0.7596552, 2391434.0080674, 0.2543734], + [6.7531818, 0.8021893, 1027839.1215598, 0.2776204], + [6.8331381, 0.7989720, 1065054.4872236, 0.2758193], ], # 10 m/s [ - [9.9754729, 0.7499157, 3283591.8023665, 0.2494847], - [7.3851720, 0.7796164, 1346691.1737223, 0.2652748], - [7.5271249, 0.7751465, 1423754.1608641, 0.2629064], + [9.9670412, 0.7500732, 3275671.6727516, 0.2495630], + [7.5219271, 0.7752809, 1420639.3564230, 0.2629773], + [7.6244680, 0.7726302, 1482087.5389477, 0.2615835], ], # 11 m/s [ - [10.9730201, 0.7276532, 4344222.0129382, 0.2386508], - [8.1726052, 0.7624526, 1824570.7175565, 0.2563058], - [8.2919410, 0.7621275, 1905768.7628771, 0.2561391], + [10.9637454, 0.7278454, 4333842.6695283, 0.2387424], + [8.3229921, 0.7620429, 1926896.4413586, 0.2560958], + [8.3952439, 0.7618461, 1976057.7564083, 0.2559949], ], ] ) @@ -204,27 +204,27 @@ [ # 8 m/s [ - [7.9803783, 0.7605249, 1683956.5765064, 0.2548147], - [5.8728728, 0.8419284, 663307.1901296, 0.3012089], - [5.9486952, 0.8380484, 689609.1551620, 0.2987839], + [7.9736330, 0.7606986, 1679924.0721706, 0.2549029], + [5.9856452, 0.8361576, 702426.7279908, 0.2976127], + [6.0294010, 0.8340678, 719318.9574833, 0.2963261], ], # 9 m/s [ - [8.9779256, 0.7596713, 2397236.5542849, 0.2543815], - [6.6084827, 0.8080116, 960489.4504135, 0.2809176], - [6.7304206, 0.8031051, 1017245.0103229, 0.2781358], + [8.9703371, 0.7596552, 2391434.0080674, 0.2543734], + [6.7356859, 0.8028933, 1019695.7325708, 0.2780165], + [6.8211610, 0.7994540, 1059479.8255425, 0.2760882], ], # 10 m/s [ - [9.9754729, 0.7499157, 3283591.8023665, 0.2494847], - [7.3621043, 0.7803735, 1334475.4570600, 0.2656784], - [7.5104978, 0.7755763, 1413790.2904370, 0.2631331], + [9.9670412, 0.7500732, 3275671.6727516, 0.2495630], + [7.5030795, 0.7757681, 1409344.8339510, 0.2632343], + [7.6119726, 0.7729532, 1474599.5989813, 0.2617529], ], # 11 m/s [ - [10.9730201, 0.7276532, 4344222.0129382, 0.2386508], - [8.1489900, 0.7625169, 1808502.4860052, 0.2563388], - [8.2757728, 0.7621716, 1894767.6143032, 0.2561617], + [10.9637454, 0.7278454, 4333842.6695283, 0.2387424], + [8.3037414, 0.7620954, 1913797.9363787, 0.2561227], + [8.3829757, 0.7618795, 1967710.2678086, 0.2560120], ], ] ) @@ -501,6 +501,7 @@ def test_regression_gch(sample_inputs_fixture): test_results[i, j, k, 2] = farm_powers[i, j, k] test_results[i, j, k, 3] = farm_axial_inductions[i, j, k] + # Don't use the test values here, gch is off! See the docstring. # if DEBUG: # print_test_values( # farm_avg_velocities, diff --git a/tests/reg_tests/jensen_jimenez_regression_test.py b/tests/reg_tests/jensen_jimenez_regression_test.py index a0be63048..a03b03078 100644 --- a/tests/reg_tests/jensen_jimenez_regression_test.py +++ b/tests/reg_tests/jensen_jimenez_regression_test.py @@ -28,28 +28,28 @@ [ # 8 m/s [ - [7.9803783, 0.7634300, 1695368.6455473, 0.2568077], - [6.1587079, 0.8281078, 771711.1397217, 0.2927005], - [5.6650109, 0.8525651, 591201.9530589, 0.3080137], + [7.9736330, 0.7636044, 1691326.6483808, 0.2568973], + [6.1528670, 0.8283770, 769344.9989547, 0.2928630], + [5.6590323, 0.8528710, 589128.2717851, 0.3082130], ], # 9 m/s [ - [8.9779256, 0.7625731, 2413659.0651694, 0.2563676], - [6.9320582, 0.7949917, 1111095.6755725, 0.2736108], - [6.5097475, 0.8119845, 914532.9508510, 0.2831962], + [8.9703371, 0.7625570, 2407841.6718785, 0.2563594], + [6.9262647, 0.7952248, 1108399.9545223, 0.2737395], + [6.5033542, 0.8122418, 911557.7945732, 0.2833446], ], # 10 m/s [ - [9.9754729, 0.7527803, 3306006.9741814, 0.2513940], - [7.7463875, 0.7694786, 1555147.9058151, 0.2599368], - [7.3516513, 0.7807166, 1328938.9807448, 0.2658614], + [9.9670412, 0.7529384, 3298067.1555604, 0.2514735], + [7.7391355, 0.7696661, 1550802.6855981, 0.2600344], + [7.3444882, 0.7809516, 1325146.7113373, 0.2659870], ], # 11 m/s [ - [10.9730201, 0.7304328, 4373591.7174990, 0.2404007], - [ 8.6282507, 0.7618324, 2145636.4122529, 0.2559879], - [ 8.1492608, 0.7625162, 1808686.0209504, 0.2563384], - ] + [10.9637454, 0.7306256, 4363191.9880631, 0.2404936], + [8.6200527, 0.7618150, 2139354.1087623, 0.2559790], + [8.1422116, 0.7625354, 1803890.3447532, 0.2563483], + ], ] ) @@ -57,28 +57,28 @@ [ # 8 m/s [ - [7.9803783, 0.7605249, 1683956.3885389, 0.2548147], - [6.1728455, 0.8274561, 777439.4138493, 0.2923080], - [5.6710199, 0.8522576, 593286.4075389, 0.3078136], + [7.9736330, 0.7606986, 1679924.0721706, 0.2549029], + [6.1670027, 0.8277254, 775072.5021192, 0.2924701], + [5.6650398, 0.8525636, 591212.2253601, 0.3080128], ], # 9 m/s [ - [8.9779256, 0.7596713, 2397237.3791443, 0.2543815], - [6.9479076, 0.7943540, 1118472.7182916, 0.2732589], - [6.5163795, 0.8117177, 917619.8050142, 0.2830424], + [8.9703371, 0.7596552, 2391434.0080674, 0.2543734], + [6.9420997, 0.7945877, 1115770.2903095, 0.2733878], + [6.5099782, 0.8119752, 914640.8879238, 0.2831909], ], # 10 m/s [ - [9.9754729, 0.7499157, 3283592.6005045, 0.2494847], - [7.7633174, 0.7690410, 1565293.2751215, 0.2597090], - [7.3579657, 0.7805093, 1332282.8722076, 0.2657508], + [9.9670412, 0.7500732, 3275671.6727516, 0.2495630], + [7.7560617, 0.7692286, 1560945.8383104, 0.2598066], + [7.3508004, 0.7807445, 1328489.3723384, 0.2658764], ], # 11 m/s [ - [10.9730201, 0.7276532, 4344217.6993801, 0.2386508], - [ 8.6453185, 0.7618685, 2158718.7235002, 0.2560064], - [ 8.1535724, 0.7625044, 1811619.6777321, 0.2563324], - ] + [10.9637454, 0.7278454, 4333842.6695283, 0.2387424], + [8.6371187, 0.7618512, 2152434.8973815, 0.2559975], + [8.1465243, 0.7625236, 1806824.8092631, 0.2563423], + ], ] ) diff --git a/tests/reg_tests/none_regression_test.py b/tests/reg_tests/none_regression_test.py index cb7784643..efd0a0b6d 100644 --- a/tests/reg_tests/none_regression_test.py +++ b/tests/reg_tests/none_regression_test.py @@ -29,28 +29,28 @@ [ # 8 m/s [ - [7.9803783, 0.7634300, 1695368.6455473, 0.2568077], - [7.9803783, 0.7634300, 1695368.6455473, 0.2568077], - [7.9803783, 0.7634300, 1695368.6455473, 0.2568077], + [7.9736330, 0.7636044, 1691326.6483808, 0.2568973], + [7.9736330, 0.7636044, 1691326.6483808, 0.2568973], + [7.9736330, 0.7636044, 1691326.6483808, 0.2568973], ], # 9 m/s [ - [8.9779256, 0.7625731, 2413659.0651694, 0.2563676], - [8.9779256, 0.7625731, 2413659.0651694, 0.2563676], - [8.9779256, 0.7625731, 2413659.0651694, 0.2563676], + [8.9703371, 0.7625570, 2407841.6718785, 0.2563594], + [8.9703371, 0.7625570, 2407841.6718785, 0.2563594], + [8.9703371, 0.7625570, 2407841.6718785, 0.2563594], ], # 10 m/s [ - [9.9754729, 0.7527803, 3306006.9741814, 0.2513940], - [9.9754729, 0.7527803, 3306006.9741814, 0.2513940], - [9.9754729, 0.7527803, 3306006.9741814, 0.2513940], + [9.9670412, 0.7529384, 3298067.1555604, 0.2514735], + [9.9670412, 0.7529384, 3298067.1555604, 0.2514735], + [9.9670412, 0.7529384, 3298067.1555604, 0.2514735], ], # 11 m/s [ - [10.9730201, 0.7304328, 4373591.7174990, 0.2404007], - [10.9730201, 0.7304328, 4373591.7174990, 0.2404007], - [10.9730201, 0.7304328, 4373591.7174990, 0.2404007], - ] + [10.9637454, 0.7306256, 4363191.9880631, 0.2404936], + [10.9637454, 0.7306256, 4363191.9880631, 0.2404936], + [10.9637454, 0.7306256, 4363191.9880631, 0.2404936], + ], ] ) diff --git a/tests/reg_tests/turbopark_regression_test.py b/tests/reg_tests/turbopark_regression_test.py index 8f9bcb6da..1d0708933 100644 --- a/tests/reg_tests/turbopark_regression_test.py +++ b/tests/reg_tests/turbopark_regression_test.py @@ -27,28 +27,28 @@ [ # 8 m/s [ - [7.9803783, 0.7634300, 1695368.7987130, 0.2568077], - [5.9727682, 0.8368165, 697959.8235188, 0.2980201], - [5.2985166, 0.8735399, 475001.6706942, 0.3221938], + [7.9736330, 0.7636044, 1691326.6483808, 0.2568973], + [6.0583922, 0.8327316, 731065.6226282, 0.2955077], + [5.4067009, 0.8668116, 506659.6232808, 0.3175251], ], # 9 m/s [ - [8.9779256, 0.7625731, 2413658.0981405, 0.2563676], - [6.7205904, 0.8035007, 1012669.5817438, 0.2783588], - [5.9649347, 0.8372174, 695242.4795890, 0.2982683], + [8.9703371, 0.7625570, 2407841.6718785, 0.2563594], + [6.8171892, 0.7996138, 1057631.1392858, 0.2761774], + [6.0917181, 0.8311955, 744568.6379292, 0.2945709], ], # 10 m/s [ - [9.9754729, 0.7527803, 3306006.2306084, 0.2513940], - [7.4838853, 0.7763766, 1398965.7050176, 0.2635558], - [6.6572765, 0.8060483, 983200.3589508, 0.2798003], + [9.9670412, 0.7529384, 3298067.1555604, 0.2514735], + [7.5908545, 0.7734991, 1461944.4626519, 0.2620395], + [6.7995666, 0.8003229, 1049428.7626183, 0.2765738], ], # 11 m/s [ - [10.9730201, 0.7304328, 4373596.1594956, 0.2404007], - [8.2806214, 0.7621583, 1898066.7453756, 0.2561549], - [7.3661298, 0.7802414, 1336607.2211998, 0.2656079], - ] + [10.9637454, 0.7306256, 4363191.9880631, 0.2404936], + [8.3975139, 0.7618399, 1977602.3128807, 0.2559918], + [7.5196816, 0.7753389, 1419293.7479312, 0.2630079], + ], ] ) @@ -57,27 +57,27 @@ [ # 8 m/s [ - [7.9803783, 0.7605249, 1683956.5765064, 0.2548147], - [5.9926862, 0.8357973, 704869.1763857, 0.2973903], - [5.3145419, 0.8725432, 479691.1339821, 0.3214945], + [7.9736330, 0.7606986, 1679924.0721706, 0.2549029], + [6.0772917, 0.8318604, 738723.3410291, 0.2949759], + [5.4215054, 0.8658908, 510991.8557577, 0.3168954], ], # 9 m/s [ - [8.9779256, 0.7596713, 2397236.5542849, 0.2543815], - [6.7429885, 0.8025994, 1023094.6963579, 0.2778511], - [5.9836502, 0.8362597, 701734.6626599, 0.2976758], + [8.9703371, 0.7596552, 2391434.0080674, 0.2543734], + [6.8384389, 0.7987587, 1067521.7514783, 0.2757004], + [6.1089600, 0.8304008, 751554.7217137, 0.2940879], ], # 10 m/s [ - [9.9754729, 0.7499157, 3283591.8023665, 0.2494847], - [7.5085974, 0.7756254, 1412651.4697014, 0.2631590], - [6.6781823, 0.8052071, 992930.8979929, 0.2793232], + [9.9670412, 0.7500732, 3275671.6727516, 0.2495630], + [7.6142906, 0.7728933, 1475988.7044752, 0.2617214], + [6.8186733, 0.7995541, 1058321.9413265, 0.2761440], ], # 11 m/s [ - [10.9730201, 0.7276532, 4344222.0129382, 0.2386508], - [8.3071319, 0.7620861, 1916104.8725891, 0.2561179], - [7.3875052, 0.7795398, 1347926.7384587, 0.2652341], + [10.9637454, 0.7278454, 4333842.6695283, 0.2387424], + [8.4226213, 0.7617715, 1994685.7970084, 0.2559567], + [7.5392355, 0.7748335, 1431011.5054545, 0.2627414], ], ] ) From 8dade243ec9824fcd399e86a6f72307d6de2be86 Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Mon, 6 Mar 2023 11:30:34 -0600 Subject: [PATCH 4/4] Update FlorisInterface reg test with 3x3 grid --- .../floris_interface_regression_test.py | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/reg_tests/floris_interface_regression_test.py b/tests/reg_tests/floris_interface_regression_test.py index 3d91c9d04..47f882b4a 100644 --- a/tests/reg_tests/floris_interface_regression_test.py +++ b/tests/reg_tests/floris_interface_regression_test.py @@ -33,27 +33,27 @@ [ # 8 m/s [ - [7.9803783, 0.7634300, 1695368.7987130, 0.2568077], - [7.9803783, 0.7634300, 1695368.7987130, 0.2568077], - [7.9803783, 0.7634300, 1695368.7987130, 0.2568077], + [7.9736330, 0.7636044, 1691326.6483808, 0.2568973], + [7.9736330, 0.7636044, 1691326.6483808, 0.2568973], + [7.9736330, 0.7636044, 1691326.6483808, 0.2568973], ], # 9 m/s [ - [8.9779256, 0.7625731, 2413658.0981405, 0.2563676], - [8.9779256, 0.7625731, 2413658.0981405, 0.2563676], - [8.9779256, 0.7625731, 2413658.0981405, 0.2563676], + [8.9703371, 0.7625570, 2407841.6718785, 0.2563594], + [8.9703371, 0.7625570, 2407841.6718785, 0.2563594], + [8.9703371, 0.7625570, 2407841.6718785, 0.2563594], ], # 10 m/s [ - [9.9754729, 0.7527803, 3306006.2306084, 0.2513940], - [9.9754729, 0.7527803, 3306006.2306084, 0.2513940], - [9.9754729, 0.7527803, 3306006.2306084, 0.2513940], + [9.9670412, 0.7529384, 3298067.1555604, 0.2514735], + [9.9670412, 0.7529384, 3298067.1555604, 0.2514735], + [9.9670412, 0.7529384, 3298067.1555604, 0.2514735], ], # 11 m/s [ - [10.9730201, 0.7304328, 4373596.1594956, 0.2404007], - [10.9730201, 0.7304328, 4373596.1594956, 0.2404007], - [10.9730201, 0.7304328, 4373596.1594956, 0.2404007], + [10.9637454, 0.7306256, 4363191.9880631, 0.2404936], + [10.9637454, 0.7306256, 4363191.9880631, 0.2404936], + [10.9637454, 0.7306256, 4363191.9880631, 0.2404936], ], ] )