Skip to content

Commit

Permalink
new external_loads flag for easier WEIS glue coding
Browse files Browse the repository at this point in the history
  • Loading branch information
gbarter committed Oct 25, 2020
1 parent 4fd9921 commit 5295b70
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 29 deletions.
4 changes: 4 additions & 0 deletions wisdem/glue_code/gc_LoadInputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ def set_run_flags(self):
# Offshore flag
self.modeling_options['offshore'] = 'water_depth' in self.wt_init['environment'] and self.wt_init['environment']['water_depth'] > 0.0

# External loads flag for when WISDEM is coupled to OpenFAST in WEIS or other codes
# This will always be False here and only set to True from the external code
self.modeling_options['flags']['external_loads'] = False

# Put in some logic about what needs to be in there
flags = self.modeling_options['flags']

Expand Down
52 changes: 28 additions & 24 deletions wisdem/glue_code/glue_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,12 @@ def setup(self):
# self.connect('sse.powercurve.rated_V', 'rlds.aero_rated.V_load')
if modeling_options['Analysis_Flags']['ServoSE']:
self.connect('sse.powercurve.rated_V', 'sse.gust.V_hub')
self.connect('sse.gust.V_gust', ['rlds.aero_gust.V_load', 'rlds.aero_hub_loads.V_load'])
self.connect('env.shear_exp', ['sse.powercurve.shearExp', 'rlds.aero_gust.shearExp'])
self.connect('sse.powercurve.rated_Omega', ['rlds.Omega_load', 'rlds.tot_loads_gust.aeroloads_Omega', 'rlds.constr.rated_Omega'])
self.connect('sse.powercurve.rated_pitch', ['rlds.pitch_load', 'rlds.tot_loads_gust.aeroloads_pitch'])
self.connect('env.shear_exp', 'sse.powercurve.shearExp')
if not modeling_options['flags']['external_loads']:
self.connect('sse.gust.V_gust', ['rlds.aero_gust.V_load', 'rlds.aero_hub_loads.V_load'])
self.connect('env.shear_exp', 'rlds.aero_gust.shearExp')
self.connect('sse.powercurve.rated_Omega', ['rlds.Omega_load', 'rlds.tot_loads_gust.aeroloads_Omega', 'rlds.constr.rated_Omega'])
self.connect('sse.powercurve.rated_pitch', ['rlds.pitch_load', 'rlds.tot_loads_gust.aeroloads_pitch'])

# Connections to ServoSE
if modeling_options['Analysis_Flags']['ServoSE']:
Expand Down Expand Up @@ -192,18 +194,19 @@ def setup(self):
self.connect('ccblade.alpha', 'stall_check.aoa_along_span')

# Connections to rotor load analysis
self.connect('blade.interp_airfoils.cl_interp','rlds.airfoils_cl')
self.connect('blade.interp_airfoils.cd_interp','rlds.airfoils_cd')
self.connect('blade.interp_airfoils.cm_interp','rlds.airfoils_cm')
self.connect('airfoils.aoa', 'rlds.airfoils_aoa')
self.connect('airfoils.Re', 'rlds.airfoils_Re')
self.connect('assembly.rotor_radius', 'rlds.Rtip')
self.connect('hub.radius', 'rlds.Rhub')
self.connect('env.rho_air', 'rlds.rho')
self.connect('env.mu_air', 'rlds.mu')
self.connect('env.shear_exp', 'rlds.aero_hub_loads.shearExp')
self.connect('assembly.hub_height', 'rlds.hub_height')
self.connect('configuration.n_blades', 'rlds.nBlades')
if not modeling_options['flags']['external_loads']:
self.connect('blade.interp_airfoils.cl_interp','rlds.airfoils_cl')
self.connect('blade.interp_airfoils.cd_interp','rlds.airfoils_cd')
self.connect('blade.interp_airfoils.cm_interp','rlds.airfoils_cm')
self.connect('airfoils.aoa', 'rlds.airfoils_aoa')
self.connect('airfoils.Re', 'rlds.airfoils_Re')
self.connect('assembly.rotor_radius', 'rlds.Rtip')
self.connect('hub.radius', 'rlds.Rhub')
self.connect('env.rho_air', 'rlds.rho')
self.connect('env.mu_air', 'rlds.mu')
self.connect('env.shear_exp', 'rlds.aero_hub_loads.shearExp')
self.connect('assembly.hub_height', 'rlds.hub_height')
self.connect('configuration.n_blades', 'rlds.nBlades')
self.connect('assembly.r_blade', 'rlds.r')
self.connect('hub.cone', 'rlds.precone')
self.connect('nacelle.uptilt', 'rlds.tilt')
Expand Down Expand Up @@ -266,15 +269,15 @@ def setup(self):
self.connect('control.rated_power', 'drivese.machine_rating')
self.connect('tower.diameter', 'drivese.D_top', src_indices=[-1])

self.connect('rlds.aero_hub_loads.Fxyz_hub_aero', 'drivese.F_hub')
self.connect('rlds.aero_hub_loads.Mxyz_hub_aero', 'drivese.M_hub')
self.connect('rlds.frame.root_M', 'drivese.pitch_system.BRFM', src_indices=[1])
if not modeling_options['flags']['external_loads']:
self.connect('rlds.aero_hub_loads.Fxyz_hub_aero', 'drivese.F_hub')
self.connect('rlds.aero_hub_loads.Mxyz_hub_aero', 'drivese.M_hub')
self.connect('rlds.frame.root_M', 'drivese.pitch_system.BRFM', src_indices=[1])

self.connect('blade.pa.chord_param', 'drivese.blade_root_diameter', src_indices=[0])
self.connect('elastic.precomp.blade_mass', 'drivese.blade_mass')
self.connect('elastic.precomp.mass_all_blades', 'drivese.blades_mass')
self.connect('elastic.precomp.I_all_blades', 'drivese.blades_I')

self.connect('nacelle.distance_hub2mb', 'drivese.L_h1')
self.connect('nacelle.distance_mb2mb', 'drivese.L_12')
self.connect('nacelle.L_generator', 'drivese.L_generator')
Expand Down Expand Up @@ -608,7 +611,8 @@ def setup(self):
self.connect('env.shear_exp', 'landbosse.wind_shear_exponent')
self.connect('assembly.rotor_diameter', 'landbosse.rotor_diameter_m')
self.connect('configuration.n_blades', 'landbosse.number_of_blades')
if modeling_options['Analysis_Flags']['ServoSE']:

if not modeling_options['flags']['external_loads'] and modeling_options['Analysis_Flags']['ServoSE']:
self.connect('sse.powercurve.rated_T', 'landbosse.rated_thrust_N')
self.connect('towerse.tower_mass', 'landbosse.tower_mass')
self.connect('drivese.nacelle_mass', 'landbosse.nacelle_mass')
Expand All @@ -624,7 +628,7 @@ def setup(self):
self.connect('bos.interconnect_voltage', 'landbosse.interconnect_voltage_kV')

# Inputs to plantfinancese from wt group
if modeling_options['Analysis_Flags']['ServoSE']:
if not modeling_options['flags']['external_loads'] and modeling_options['Analysis_Flags']['ServoSE']:
self.connect('sse.AEP', 'financese.turbine_aep')

self.connect('tcc.turbine_cost_kW', 'financese.tcc_per_kW')
Expand All @@ -646,8 +650,8 @@ def setup(self):
self.connect('costs.fixed_charge_rate', 'financese.fixed_charge_rate')

# Connections to outputs to screen
if modeling_options['Analysis_Flags']['ServoSE']:
if not modeling_options['flags']['external_loads'] and modeling_options['Analysis_Flags']['ServoSE']:
self.connect('sse.AEP', 'outputs_2_screen.aep')
self.connect('financese.lcoe', 'outputs_2_screen.lcoe')
self.connect('rlds.tip_pos.tip_deflection', 'outputs_2_screen.tip_deflection')
self.connect('elastic.precomp.blade_mass', 'outputs_2_screen.blade_mass')
self.connect('rlds.tip_pos.tip_deflection', 'outputs_2_screen.tip_deflection')
13 changes: 8 additions & 5 deletions wisdem/rotorse/rotor_loads_defl_strains.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,8 @@ def setup(self):
promoteListAeroLoads = ['r', 'theta', 'chord', 'Rtip', 'Rhub', 'hub_height', 'precone', 'tilt', 'airfoils_aoa', 'airfoils_Re', 'airfoils_cl', 'airfoils_cd', 'airfoils_cm', 'nBlades', 'rho', 'mu', 'Omega_load','pitch_load']
# self.add_subsystem('aero_rated', CCBladeLoads(modeling_options = modeling_options), promotes=promoteListAeroLoads)

self.add_subsystem('aero_gust', CCBladeLoads(modeling_options = modeling_options), promotes=promoteListAeroLoads)
if not modeling_options['flags']['external_loads']:
self.add_subsystem('aero_gust', CCBladeLoads(modeling_options = modeling_options), promotes=promoteListAeroLoads)
# self.add_subsystem('aero_storm_1yr', CCBladeLoads(modeling_options = modeling_options), promotes=promoteListAeroLoads)
# self.add_subsystem('aero_storm_50yr', CCBladeLoads(modeling_options = modeling_options), promotes=promoteListAeroLoads)
# Add centrifugal and gravity loading to aero loading
Expand All @@ -785,17 +786,19 @@ def setup(self):
promoteListFrame3DD = ['x_az','y_az','z_az','theta','r','A','EA','EIxx','EIyy','EIxy','GJ','rhoA','rhoJ','x_ec','y_ec','xu_strain_spar','xl_strain_spar','yu_strain_spar','yl_strain_spar','xu_strain_te','xl_strain_te','yu_strain_te','yl_strain_te']
self.add_subsystem('frame', RunFrame3DD(modeling_options = modeling_options), promotes=promoteListFrame3DD)
self.add_subsystem('tip_pos', TipDeflection(), promotes=['tilt','pitch_load'])
self.add_subsystem('aero_hub_loads', AeroHubLoads(modeling_options = modeling_options), promotes = promoteListAeroLoads)
if not modeling_options['flags']['external_loads']:
self.add_subsystem('aero_hub_loads', AeroHubLoads(modeling_options = modeling_options), promotes = promoteListAeroLoads)
self.add_subsystem('constr', DesignConstraints(modeling_options = modeling_options, opt_options = opt_options))

# if modeling_options['rotorse']['FatigueMode'] > 0:
# promoteListFatigue = ['r', 'gamma_f', 'gamma_m', 'E', 'Xt', 'Xc', 'x_tc', 'y_tc', 'EIxx', 'EIyy', 'pitch_axis', 'chord', 'layer_name', 'layer_mat', 'definition_layer', 'sc_ss_mats','sc_ps_mats','te_ss_mats','te_ps_mats','rthick']
# self.add_subsystem('fatigue', BladeFatigue(modeling_options = modeling_options, opt_options = opt_options), promotes=promoteListFatigue)

# Aero loads to total loads
self.connect('aero_gust.loads_Px', 'tot_loads_gust.aeroloads_Px')
self.connect('aero_gust.loads_Py', 'tot_loads_gust.aeroloads_Py')
self.connect('aero_gust.loads_Pz', 'tot_loads_gust.aeroloads_Pz')
if not modeling_options['flags']['external_loads']:
self.connect('aero_gust.loads_Px', 'tot_loads_gust.aeroloads_Px')
self.connect('aero_gust.loads_Py', 'tot_loads_gust.aeroloads_Py')
self.connect('aero_gust.loads_Pz', 'tot_loads_gust.aeroloads_Pz')
# self.connect('aero_rated.loads_Px', 'tot_loads_rated.aeroloads_Px')
# self.connect('aero_rated.loads_Py', 'tot_loads_rated.aeroloads_Py')
# self.connect('aero_rated.loads_Pz', 'tot_loads_rated.aeroloads_Pz')
Expand Down

0 comments on commit 5295b70

Please sign in to comment.