コード例 #1
0
'''

t0 = time()
# PREPARING MESH
speed_of_sound = 331.2  # speed of sound at 0ºC
density = 1.204
air = Fluid('air', density, speed_of_sound)
steel = Material('Steel', 7860, young_modulus=210e9, poisson_ratio=0.3)
offset = [0.005, 0.005]
element_type = 'pipe_1'
cross_section = CrossSection(0.05,
                             0.008,
                             offset_y=offset[0],
                             offset_z=offset[1],
                             poisson_ratio=steel.poisson_ratio)
cross_section.update_properties()
preprocessor = Preprocessor()

preprocessor.generate('examples/iges_files/tube_2.iges', 0.01)
# preprocessor.set_acoustic_pressure_bc_by_node([50], 1e5 + 0j)
# preprocessor.set_specific_impedance_bc_by_node(1086, speed_of_sound * density+ 0j)
preprocessor.set_prescribed_dofs_bc_by_node([1136, 1236], np.zeros(6) + 0j)

preprocessor.set_element_type_by_element('all', element_type)
preprocessor.set_fluid_by_element('all', air)
preprocessor.set_material_by_element('all', steel)
preprocessor.set_cross_section_by_element('all', cross_section)
preprocessor.set_structural_load_bc_by_node([50],
                                            np.array([1, 1, 1, 0, 0, 0]) + 0j)

f_max = 200
コード例 #2
0
ファイル: main.py プロジェクト: open-pulse/OpenPulse
from pulse.preprocessing.cross_section import CrossSection
from pulse.preprocessing.material import Material
from pulse.preprocessing.fluid import Fluid
from pulse.preprocessing.preprocessor import Preprocessor
from pulse.processing.assembly_acoustic import AssemblyAcoustic
from pulse.processing.solution_acoustic import SolutionAcoustic
from pulse.postprocessing.plot_acoustic_data import get_acoustic_frf

# Fluid setup
speed_of_sound = 343.21
density = 1.2041
air = Fluid('air', 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, offset_z=0)
cross_section.update_properties()
cross_section_expansion = CrossSection(0.288, 0.008, offset_y=0, offset_z=0)
cross_section_expansion.update_properties()
cross_section_branch = CrossSection(0.025, 0.004, offset_y=0, offset_z=0)
cross_section_branch.update_properties()

# Preprocessor init
preprocessor = Preprocessor()
preprocessor.generate('examples/iges_files/tube_2.iges', 0.01)
preprocessor.set_material_by_element('all', steel)
preprocessor.set_acoustic_pressure_bc_by_node(50, 1 + 0j)

unflanged = True
flanged = False
if unflanged:
    preprocessor.set_radiation_impedance_bc_by_node(1086 , 1)
コード例 #3
0
# Tube setup
section_parameters = {
    "outer_diameter": 0.04859,
    "thickness": 0.003,
    "offset_y": 0,
    "offset_z": 0,
    "insulation_thickness": 0,
    "insulation_density": 0
}

pipe_section_info = {
    "section_type_label": "Pipe section",
    "section_parameters": section_parameters
}
cross_section1 = CrossSection(pipe_section_info=pipe_section_info)
cross_section1.update_properties()

section_parameters = {
    "outer_diameter": 0.04044,
    "thickness": 0.003,
    "offset_y": 0,
    "offset_z": 0,
    "insulation_thickness": 0,
    "insulation_density": 0
}

pipe_section_info = {
    "section_type_label": "Pipe section",
    "section_parameters": section_parameters
}
cross_section2 = CrossSection(pipe_section_info=pipe_section_info)