def mesh_(): steel = Material('Steel', 7860, young_modulus=210e9, poisson_ratio=0.3) cross_section = CrossSection(0.05, 0.008) mesh = Mesh() mesh.generate('iges_files\\tube_1.iges', 0.01) mesh.set_prescribed_dofs_bc_by_node([40, 1424, 1324], np.zeros(6)) mesh.set_material_by_element('all', steel) mesh.set_cross_section_by_element('all', cross_section) return mesh
def reset_info(self): self.mesh = Mesh() self.analysis_ID = None self.analysis_type_label = "" self.analysis_method_label = "" self.damping = [0,0,0,0] self.modes = 0 self.frequencies = None self.f_min = 0 self.f_max = 0 self.f_step = 0 self.natural_frequencies_structural = [] self.solution_structural = None self.solution_acoustic = None self.flag_set_material = False self.flag_set_crossSection = False self.plot_pressure_field = False self.is_file_loaded = False
def model(): steel = Material('Steel', 7860, young_modulus=210e9, poisson_ratio=0.3) cross_section = CrossSection(0.05, 0.008) mesh = Mesh() mesh.generate('iges_files\\tube_1.iges', 0.01) mesh.set_prescribed_dofs_bc_by_node([40, 1424, 1324], np.zeros(6)) mesh.set_material_by_element('all', steel) mesh.set_cross_section_by_element('all', cross_section) assembly = AssemblyStructural(mesh) # We need to separate it in multiple atribute or functions as soon as possible. names = [ 'Kadd_lump', 'Madd_lump', 'K', 'M', 'Kr', 'Mr', 'K_lump', 'M_lump', 'C_lump', 'Kr_lump', 'Mr_lump', 'Cr_lump' ] answer = assembly.get_all_matrices() return dict(zip(names, answer))
from pulse.postprocessing.plot_acoustic_data import get_acoustic_frf, get_acoustic_response from pulse.animation.plot_function import plot_results ''' |=============================================================================| | Please, it's necessary to copy and paste main.py script at OpenPulse file | | then type "python main.py" in the terminal to run the code ! | |=============================================================================| ''' speed_of_sound = 350.337 density = 24.85 hydrogen = Fluid('hydrogen', density, speed_of_sound) steel = Material('Steel', 7860, young_modulus=210e9, poisson_ratio=0.3) # Tube setup cross_section = CrossSection(0.05, 0.008, offset_y=0.005, offset_z=0.005) # Mesh init mesh = Mesh() run = 2 anechoic_termination = True if run == 1: mesh.generate('examples/iges_files/tube_2.iges', 0.01) mesh.set_acoustic_pressure_BC_by_node([50], 1) # Anechoic termination if anechoic_termination: mesh.set_specific_impedance_BC_by_node(1086, speed_of_sound * density) if run == 2: mesh.load_mesh('examples/validation_acoustic/coord.dat', 'examples/validation_acoustic/connect.dat') # Acoustic boundary conditions - Prescribe pressure mesh.set_acoustic_pressure_BC_by_node([1], 1) # Anechoic termination if anechoic_termination: