Skip to content

Commit

Permalink
Fix DLC 11 counter and DLC 64 wind speeds
Browse files Browse the repository at this point in the history
  • Loading branch information
dzalkind committed Aug 9, 2024
1 parent 176900d commit f5ee1c1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions weis/dlc_driver/dlc_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))


Expand Down Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions weis/dlc_driver/test/test_DLC_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit f5ee1c1

Please sign in to comment.