From f5ee1c1612f77e65f4430ea92763238dab165aec Mon Sep 17 00:00:00 2001 From: dzalkind Date: Fri, 9 Aug 2024 14:03:19 -0600 Subject: [PATCH] Fix DLC 11 counter and DLC 64 wind speeds --- weis/dlc_driver/dlc_generator.py | 10 ++++++++-- weis/dlc_driver/test/test_DLC_generator.py | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/weis/dlc_driver/dlc_generator.py b/weis/dlc_driver/dlc_generator.py index 0ffeb1617..07c4da686 100644 --- a/weis/dlc_driver/dlc_generator.py +++ b/weis/dlc_driver/dlc_generator.py @@ -411,7 +411,7 @@ def generate_cases(self,generic_case_inputs,dlc_options): # Save number of DLC 1.1 cases (this info isn't passed back to generate_1p1) if dlc_options['label'] == '1.1': - dlc11_ws = [c.URef for c in dlc_generator.cases if c.label == '1.1'] + dlc11_ws = [c.URef for c in self.cases if c.label == '1.1'] self.n_ws_dlc11 = len(np.unique(dlc11_ws)) @@ -901,12 +901,18 @@ def generate_6p4(self, dlc_options): dlc_options['label'] = '6.4' dlc_options['sea_state'] = 'normal' dlc_options['IEC_WindType'] = 'NTM' + # Set wind speeds to DLC spec if not defined by the user + if not dlc_options['wind_speed']: + dlc_options['wind_speed'] = np.arange(self.ws_cut_in, 0.7 * self.V_ref, dlc_options['ws_bin_size']) + # Include V_ref + if dlc_options['wind_speed'][-1] != self.V_ref: + dlc_options['wind_speed'] = np.append(dlc_options['wind_speed'], self.V_ref) # Set dlc-specific options, like yaw_misalign, initial azimuth if 'yaw_misalign' in dlc_options: dlc_options['yaw_misalign'] = dlc_options['yaw_misalign'] else: # default - dlc_options['yaw_misalign'] = [-8.,8.] + dlc_options['yaw_misalign'] = [0.] # parked options dlc_options['turbine_status'] = 'parked-idling' diff --git a/weis/dlc_driver/test/test_DLC_generator.py b/weis/dlc_driver/test/test_DLC_generator.py index 78e84952e..36d4595a8 100644 --- a/weis/dlc_driver/test/test_DLC_generator.py +++ b/weis/dlc_driver/test/test_DLC_generator.py @@ -36,8 +36,8 @@ def test_generator(self): np.testing.assert_equal(dlc_generator.cases[11].URef, ws_cut_out) - np.testing.assert_equal(dlc_generator.n_ws_dlc11, 12) - np.testing.assert_equal(dlc_generator.n_cases, 63) + np.testing.assert_equal(dlc_generator.n_ws_dlc11, 6) + np.testing.assert_equal(dlc_generator.n_cases, 60) if __name__ == "__main__": unittest.main()