def setup(self): surface = self.options['surface'] promotes = [] if surface['struct_weight_relief']: promotes = promotes + list( set(['nodes', 'element_weights', 'load_factor'])) if surface['distributed_fuel_weight']: promotes = promotes + list(set(['nodes', 'load_factor'])) self.add_subsystem('struct_states', SpatialBeamStates(surface=surface), promotes_inputs=['K', 'forces', 'loads'] + promotes, promotes_outputs=['disp']) self.add_subsystem('def_mesh', DisplacementTransferGroup(surface=surface), promotes_inputs=['nodes', 'mesh', 'disp'], promotes_outputs=['def_mesh']) self.add_subsystem('aero_geom', VLMGeometry(surface=surface), promotes_inputs=['def_mesh'], promotes_outputs=[ 'b_pts', 'widths', 'cos_sweep', 'lengths', 'chords', 'normals', 'S_ref' ]) self.linear_solver = LinearRunOnce()
def setup(self): surface = self.options['surface'] self.add_subsystem('struct_states', SpatialBeamStates(surface=surface), promotes_inputs=[ 'K', 'forces', 'loads', 'element_weights', 'nodes' ], promotes_outputs=['disp']) self.add_subsystem('def_mesh', DisplacementTransfer(surface=surface), promotes_inputs=['mesh', 'disp'], promotes_outputs=['def_mesh']) self.add_subsystem('aero_geom', VLMGeometry(surface=surface), promotes_inputs=['def_mesh'], promotes_outputs=[ 'b_pts', 'c_pts', 'widths', 'cos_sweep', 'lengths', 'chords', 'normals', 'S_ref' ]) self.linear_solver = LinearRunOnce()
def setup(self): surface = self.options['surface'] promotes = [] if surface['struct_weight_relief']: promotes = promotes + list( set(['nodes', 'element_mass', 'load_factor'])) if surface['distributed_fuel_weight']: promotes = promotes + list(set(['nodes', 'load_factor'])) if 'n_point_masses' in surface.keys(): promotes = promotes + list( set([ 'point_mass_locations', 'point_masses', 'nodes', 'load_factor', 'engine_thrusts' ])) self.add_subsystem( 'struct_states', SpatialBeamStates(surface=surface), promotes_inputs=['local_stiff_transformed', 'forces', 'loads'] + promotes, promotes_outputs=['disp']) self.add_subsystem('def_mesh', DisplacementTransferGroup(surface=surface), promotes_inputs=['nodes', 'mesh', 'disp'], promotes_outputs=['def_mesh']) normals_name = 'undeflected_normals' self.add_subsystem('aero_geom', VLMGeometry(surface=surface), promotes_inputs=['def_mesh'], promotes_outputs=[ 'b_pts', 'widths', 'cos_sweep', 'lengths', 'chords', ('normals', normals_name), 'S_ref' ]) # Add control surfaces if 'control_surfaces' in surface: for ctrl_surf in surface['control_surfaces']: #TODO: fixed name only works with one control surface deflected_normals_name = "normals" #"{}_normals".format(ctrl_surf['name']) self.add_subsystem( ctrl_surf['name'], ControlSurface(surface=surface, panels=ctrl_surf['panels']), promotes_inputs=[('normals', normals_name), 'delta_aileron' ], #,f"delta_{control_surf['name']}"], promotes_outputs=[('deflected_normals', deflected_normals_name)]) #iterate through names normals_name = deflected_normals_name else: pass #No control surface to add #self.connect(normals_name,'normals') self.linear_solver = LinearRunOnce()
def setup(self): surface = self.options['surface'] promotes = [] if surface['struct_weight_relief']: promotes = promotes + list( set(['nodes', 'element_mass', 'load_factor'])) if surface['distributed_fuel_weight']: promotes = promotes + list(set(['nodes', 'load_factor'])) if 'n_point_masses' in surface.keys(): promotes = promotes + list( set([ 'point_mass_locations', 'point_masses', 'nodes', 'load_factor', 'engine_thrusts' ])) self.add_subsystem( 'struct_states', SpatialBeamStates(surface=surface), promotes_inputs=['local_stiff_transformed', 'forces', 'loads'] + promotes, promotes_outputs=['disp']) self.add_subsystem('def_mesh', DisplacementTransferGroup(surface=surface), promotes_inputs=['nodes', 'mesh', 'disp'], promotes_outputs=['def_mesh']) self.add_subsystem('aero_geom', VLMGeometry(surface=surface), promotes_inputs=['def_mesh'], promotes_outputs=[ 'b_pts', 'widths', 'cos_sweep', 'lengths', 'chords', 'S_ref' ]) # Add control surfaces if 'control_surfaces' in surface: self.add_subsystem( 'control_surfaces', ControlSurfacesGroup( control_surfaces=surface['control_surfaces'], mesh=surface['mesh']), promotes_inputs=['def_mesh']) self.linear_solver = om.LinearRunOnce()
def setup(self): surface = self.options['surface'] tube_promotes = [] if 'thickness_cp' in surface.keys(): tube_promotes.append('thickness_cp') self.add_subsystem('geometry', Geometry(surface=surface), promotes_inputs=[], promotes_outputs=['mesh']) if surface['fem_model_type'] == 'tube': self.add_subsystem('tube_group', TubeGroup(surface=surface), promotes_inputs=['mesh'], promotes_outputs=['A', 'Iy', 'Iz', 'J', 'radius', 'thickness'] + tube_promotes) elif surface['fem_model_type'] == 'wingbox': self.add_subsystem('wingbox_group', WingboxGroup(surface=surface), promotes_inputs=['mesh'], promotes_outputs=['A', 'Iy', 'Iz', 'J', 'radius', 'thickness'] + tube_promotes) else: raise NameError('Please select a valid `fem_model_type` from either `tube` or `wingbox`.') self.add_subsystem('struct_setup', SpatialBeamSetup(surface=surface), promotes_inputs=['mesh', 'A', 'Iy', 'Iz', 'J', 'load_factor'], promotes_outputs=['nodes', 'K', 'structural_weight', 'cg_location', 'element_weights']) self.add_subsystem('struct_states', SpatialBeamStates(surface=surface), promotes_inputs=['K', 'forces', 'loads', 'element_weights'], promotes_outputs=['disp']) self.add_subsystem('struct_funcs', SpatialBeamFunctionals(surface=surface), promotes_inputs=['thickness', 'radius', 'nodes', 'disp'], promotes_outputs=['thickness_intersects', 'vonmises', 'failure'])
def setup(self): surface = self.options['surface'] tube_promotes = [] tube_inputs = [] if 'thickness_cp' in surface.keys(): tube_promotes.append('thickness_cp') if 'radius_cp' not in surface.keys(): tube_inputs = ['mesh', 't_over_c'] self.add_subsystem('geometry', Geometry(surface=surface), promotes_inputs=[], promotes_outputs=['mesh', 't_over_c']) if surface['fem_model_type'] == 'tube': self.add_subsystem('tube_group', TubeGroup(surface=surface), promotes_inputs=tube_inputs, promotes_outputs=['A', 'Iy', 'Iz', 'J', 'radius', 'thickness'] + tube_promotes) elif surface['fem_model_type'] == 'wingbox': wingbox_promotes = [] if 'skin_thickness_cp' in surface.keys() and 'spar_thickness_cp' in surface.keys(): wingbox_promotes.append('skin_thickness_cp') wingbox_promotes.append('spar_thickness_cp') wingbox_promotes.append('skin_thickness') wingbox_promotes.append('spar_thickness') elif 'skin_thickness_cp' in surface.keys() or 'spar_thickness_cp' in surface.keys(): raise NameError('Please have both skin and spar thickness as design variables, not one or the other.') self.add_subsystem('wingbox_group', WingboxGroup(surface=surface), promotes_inputs=['mesh', 't_over_c'], promotes_outputs=['A', 'Iy', 'Iz', 'J', 'Qz', 'A_enc', 'A_int', 'htop', 'hbottom', 'hfront', 'hrear'] + wingbox_promotes) else: raise NameError('Please select a valid `fem_model_type` from either `tube` or `wingbox`.') if surface['fem_model_type'] == 'tube': self.add_subsystem('struct_setup', SpatialBeamSetup(surface=surface), promotes_inputs=['mesh', 'A', 'Iy', 'Iz', 'J'], promotes_outputs=['nodes', 'local_stiff_transformed', 'structural_mass', 'cg_location', 'element_mass']) else: self.add_subsystem('struct_setup', SpatialBeamSetup(surface=surface), promotes_inputs=['mesh', 'A', 'Iy', 'Iz', 'J', 'A_int'], promotes_outputs=['nodes', 'local_stiff_transformed', 'structural_mass', 'cg_location', 'element_mass', ]) promotes = [] if surface['struct_weight_relief']: promotes = promotes + list(set(['nodes', 'element_mass', 'load_factor'])) if surface['distributed_fuel_weight']: promotes = promotes + list(set(['nodes', 'load_factor'])) self.add_subsystem('struct_states', SpatialBeamStates(surface=surface), promotes_inputs=['local_stiff_transformed', 'forces', 'loads'] + promotes, promotes_outputs=['disp']) if surface['fem_model_type'] == 'tube': self.add_subsystem('struct_funcs', SpatialBeamFunctionals(surface=surface), promotes_inputs=['thickness', 'radius', 'nodes', 'disp'], promotes_outputs=['thickness_intersects', 'vonmises', 'failure']) else: self.add_subsystem('struct_funcs', SpatialBeamFunctionals(surface=surface), promotes_inputs=['spar_thickness', 'disp','Qz', 'J', 'A_enc', 'htop', 'hbottom', 'hfront', 'hrear', 'nodes'], promotes_outputs=['vonmises', 'failure'])