Skip to content

Commit

Permalink
Add step wind type and DLC
Browse files Browse the repository at this point in the history
  • Loading branch information
abhineet-gupta committed Jan 16, 2025
1 parent a246e99 commit c515950
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 3 deletions.
5 changes: 5 additions & 0 deletions examples/19_controller_test_bench/testbench_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ DLC_driver:
analysis_time: 1000.
ramp_speeddelta: -20
ramp_duration: 1000.
- DLC: "Step" # Down
wind_speed: [18]
analysis_time: 100.
step_speeddelta: 2.0
step_time: 50.0
# - DLC: "Steady"
# wind_speed: [8]
# analysis_time: 10.
Expand Down
26 changes: 25 additions & 1 deletion weis/aeroelasticse/IEC_CoeherentGusts.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ def execute(self, dir, base_name, dlc):
self.EWS(dlc, wind_file_name)
elif dlc.IEC_WindType == 'Ramp':
self.Ramp(dlc, wind_file_name)
elif dlc.IEC_WindType == 'Step':
self.Step(dlc, wind_file_name)
elif dlc.IEC_WindType == 'Custom':
wind_file_name = dlc.wind_file
else:
Expand Down Expand Up @@ -249,6 +251,28 @@ def Ramp(self, dlc, wind_file_name):
hd = f'! Ramp wind starting from wind speed = {dlc.URef} to wind speed = {dlc.wind_speed+dlc.ramp_speeddelta}\n'
self.write_wnd(wind_file_name, data, hd)

def Step(self, dlc, wind_file_name):
# Step

T = dlc.total_time - dlc.transient_time
t = np.linspace(0., self.dt, 2)

# Contant variables
V = np.linspace(dlc.wind_speed,dlc.wind_speed+dlc.step_speeddelta,2)
V_dir = np.zeros_like(t)
V_vert = np.zeros_like(t)
shear_horz = np.zeros_like(t)
shear_vert = np.zeros_like(t)
shear_vert_lin = np.zeros_like(t)
V_gust = np.zeros_like(t)
upflow = np.zeros_like(t)


data = np.column_stack((t, V, V_dir, V_vert, shear_horz, shear_vert, shear_vert_lin, V_gust, upflow))
# Header
hd = f'! Step wind starting from wind speed = {dlc.URef} to wind speed = {dlc.wind_speed+dlc.step_speeddelta}\n'
self.write_wnd(wind_file_name, data, hd)

def write_wnd(self, fname, data, hd):

# Move transient event to user defined time
Expand All @@ -274,4 +298,4 @@ def write_wnd(self, fname, data, hd):
for row in data:
fid.write(' '+''.join([('%.6f' % val).center(12) for val in row]) + '\n')

fid.close()
fid.close()
42 changes: 42 additions & 0 deletions weis/dlc_driver/dlc_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,11 @@ def generate_cases(self,generic_case_inputs,dlc_options):
idlc.turbulent_wind = False
idlc.ramp_speeddelta = dlc_options['ramp_speeddelta']
idlc.ramp_duration = dlc_options['ramp_duration']
idlc.gust_wait_time = dlc_options['gust_wait_time']
elif dlc_options['IEC_WindType'] == 'Step':
idlc.turbulent_wind = False
idlc.step_speeddelta = dlc_options['step_speeddelta']
idlc.gust_wait_time = dlc_options['gust_wait_time']
elif dlc_options['IEC_WindType'] == 'Custom':
idlc.turbulent_wind = False
else:
Expand Down Expand Up @@ -873,6 +878,43 @@ def generate_Ramp(self, dlc_options):
generic_case_inputs.append(['yaw_misalign']) # group 2

self.generate_cases(generic_case_inputs,dlc_options)

def generate_Step(self, dlc_options):
# Power production Step wind

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

# DLC Specific options:
dlc_options['label'] = 'Step'
dlc_options['sea_state'] = 'normal'
dlc_options['IEC_WindType'] = 'Step'

# Set yaw_misalign, else default
if 'yaw_misalign' in dlc_options:
dlc_options['yaw_misalign'] = dlc_options['yaw_misalign']
else: # default
dlc_options['yaw_misalign'] = [0]

# Check options
if 'step_speeddelta' not in dlc_options:
raise Exception('step_speeddelta must be set for the Step DLC')
if 'step_time' in dlc_options:
if dlc_options['step_time'] > dlc_options['analysis_time']:
raise Exception('step_time must be less than analysis_time')
dlc_options['gust_wait_time'] = dlc_options['step_time']
else:
raise Exception('step_time must be set for the Step DLC')


# DLC-specific: define groups
# These options should be the same length and we will generate a matrix of all cases
generic_case_inputs = []
generic_case_inputs.append(['total_time','transient_time','wake_mod','wave_model']) # 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

self.generate_cases(generic_case_inputs,dlc_options)

def generate_2p1(self, dlc_options):
# Power production plus loss of electrical network
Expand Down
4 changes: 2 additions & 2 deletions weis/inputs/modeling_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3053,7 +3053,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', '7.1', '7.2', '12.1', 'Custom','AEP','Ramp','Steady']
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','AEP','Ramp','Steady','Step']
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 Expand Up @@ -3186,7 +3186,7 @@ properties:
IEC_WindType:
type: string
default: NTM
enum: ['NTM', '1ETM', '2ETM', '3ETM', '1EWM1', '2EWM1', '3EWM1', '1EWM50', '2EWM50', '3EWM50', 'ECD', 'EDC', 'EOG','EWS','Custom','Ramp','Steady']
enum: ['NTM', '1ETM', '2ETM', '3ETM', '1EWM1', '2EWM1', '3EWM1', '1EWM50', '2EWM50', '3EWM50', 'ECD', 'EDC', 'EOG','EWS','Custom','Ramp','Steady','Step']
description: IEC turbulence type ('NTM'=normal, 'xETM'=extreme turbulence, 'xEWM1'=extreme 1-year wind, 'xEWM50'=extreme 50-year wind, where x=wind turbine class 1, 2, or 3), 'ECD'=extreme coherent gust with direction change, 'EDC'=extreme direction change, 'EOG'=extreme operating gust. Normally the user does not need to define this entry, 'EWS'='extreme wind shear'
analysis_time:
type: number
Expand Down

0 comments on commit c515950

Please sign in to comment.