Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/DLC_RefactorCaseInputs' into DLC…
Browse files Browse the repository at this point in the history
…_RefactorCaseInputs
  • Loading branch information
dzalkind committed Oct 25, 2024
2 parents 31fafd1 + 2496640 commit b547d48
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 1 deletion.
95 changes: 95 additions & 0 deletions weis/dlc_driver/dlc_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,101 @@ def generate_6p4(self, dlc_options):
# This function does the rest and generates the individual cases for each DLC
self.generate_cases(generic_case_inputs,dlc_options)

def generate_7p1(self, dlc_options):
# Parked (standing still or idling) - extreme wind model 1-year return period - ultimate loads, usually larger (20 deg) yaw offset

# Get default options
dlc_options.update(self.default_options)

# Set DLC Specific options:
# These three are required
dlc_options['label'] = '7.1'
dlc_options['sea_state'] = '1-year'
dlc_options['IEC_WindType'] = self.wind_speed_class_num + 'EWM1'

# 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'] = [0.] # default

if not dlc_options['wind_speed']:
dlc_options['wind_speed'] = [self.V_e1]

# parked options
dlc_options['turbine_status'] = 'parked-idling'
dlc_options['wake_mod'] = 0
dlc_options['pitch_initial'] = 90.
dlc_options['rot_speed_initial'] = 0.
dlc_options['shutdown_time'] = 0.
dlc_options['final_blade_pitch'] = 90.

# DLC-specific: define groups
# Groups are dependent variables, the cases are a cross product of the independent groups
# The options in each group should have the same length
generic_case_inputs = []

group0 = ['total_time','transient_time','wake_mod','wave_model','pitch_initial',
'rot_speed_initial','shutdown_time','final_blade_pitch'] # group 0, (usually constants) turbine variables, DT, aero_modeling

if 'pitchfault_time1' in dlc_options:
group0.extend(['pitchfault_time1','pitchfault_blade1'])
if 'pitchfault_time2' in dlc_options:
group0.extend(['pitchfault_time2','pitchfault_blade2'])
if 'pitchfault_time3' in dlc_options:
group0.extend(['pitchfault_time3','pitchfault_blade3'])
if 'genfault_time' in dlc_options:
group0.extend(['genfault_time'])

generic_case_inputs.append(group0)
generic_case_inputs.append(['wind_speed','wave_height','wave_period', 'wind_seed', 'wave_seed']) # group 1, initial conditions will be added here, define some method that maps wind speed to ICs and add those variables to this group
generic_case_inputs.append(['yaw_misalign']) # group 2

# This function does the rest and generates the individual cases for each DLC
self.generate_cases(generic_case_inputs,dlc_options)

def generate_7p2(self, dlc_options):
# Parked (standing still or idling) - normal turbulence model - fatigue loads

# Get default options
dlc_options.update(self.default_options)

# Set DLC Specific options:
# These three are required
dlc_options['label'] = '7.2'
dlc_options['sea_state'] = 'normal'
dlc_options['IEC_WindType'] = 'NTM'

# Set wind speeds to DLC spec if not defined by the user
if len(dlc_options['wind_speed']) == 0:
dlc_options['wind_speed'] = np.arange(0,self.ws_cut_out, dlc_options['ws_bin_size'])
dlc_options['wind_speed'] = dlc_options['wind_speed'].tolist()

# 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'] = [0.]

# parked options
dlc_options['turbine_status'] = 'parked-idling'
dlc_options['wake_mod'] = 0
dlc_options['pitch_initial'] = 90.
dlc_options['rot_speed_initial'] = 0.
dlc_options['shutdown_time'] = 0.
dlc_options['final_blade_pitch'] = 90.

# DLC-specific: define groups
# Groups are dependent variables, the cases are a cross product of the independent groups
# The options in each group should have the same length
generic_case_inputs = []
generic_case_inputs.append(['total_time','transient_time','wake_mod','wave_model','pitch_initial',
'rot_speed_initial','shutdown_time','final_blade_pitch']) # group 0, (usually constants) turbine variables, DT, aero_modeling
generic_case_inputs.append(['wind_speed','wave_height','wave_period', 'wind_seed', 'wave_seed']) # group 1, initial conditions will be added here, define some method that maps wind speed to ICs and add those variables to this group
generic_case_inputs.append(['yaw_misalign']) # group 2

# This function does the rest and generates the individual cases for each DLC
self.generate_cases(generic_case_inputs,dlc_options)

def generate_new_dlc(self,dlc_options):
# Describe the new design load case
Expand Down
2 changes: 1 addition & 1 deletion weis/inputs/modeling_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3045,7 +3045,7 @@ properties:
DLC:
type: string
default: '1.1'
enum: ['1.1', '1.2', '1.3', '1.4', '1.5', '1.6', '2.1', '2.3', '3.1', '3.2', '3.3', '5.1', '6.1', '6.2', '6.3', '6.4', '6.5', '12.1', 'Custom']
enum: ['1.1', '1.2', '1.3', '1.4', '1.5', '1.6', '2.1', '2.3', '3.1', '3.2', '3.3', '5.1', '6.1', '6.2', '6.3', '6.4', '6.5', '7.1', '7.2', '12.1', 'Custom']
description: IEC design load case to run. The DLCs currently supported are 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 5.1, 6.1, 6.3, and 6.4
wind_speed:
type: array
Expand Down

0 comments on commit b547d48

Please sign in to comment.