def test_direct_method(preprocessor):
    solution = SolutionStructural(preprocessor)
    frequencies = np.arange(0, 200 + 1, 2)

    direct_method = solution.direct_method(frequencies, is_viscous_lumped=True)
    correct_direct_method = np.load(
        'matrices\\structural_solution\\direct_method.npy')

    assert np.allclose(direct_method, correct_direct_method)
def test_modal_analysis(preprocessor):
    solution = SolutionStructural(preprocessor)
    natural_frequencies, modal_shape = solution.modal_analysis(
        modes=200, harmonic_analysis=True)
    correct_natural_frequencies = np.load(
        'matrices\\structural_solution\\natural_frequencies.npy')
    correct_modal_shape = np.load(
        'matrices\\structural_solution\\mode_shapes.npy')

    assert np.allclose(natural_frequencies, correct_natural_frequencies)
    assert np.allclose(modal_shape, correct_modal_shape)
def test_mode_superposition(preprocessor):
    solution = SolutionStructural(preprocessor)
    frequencies = np.arange(0, 200 + 1, 2)
    modes = 200

    mode_superposition = solution.mode_superposition(frequencies,
                                                     modes,
                                                     fastest=True)
    correct_mode_superposition = np.load(
        'matrices\\structural_solution\\mode_superposition.npy')

    assert np.allclose(mode_superposition, correct_mode_superposition)
Example #4
0
 def get_structural_solve(self):
     if self.analysis_ID in [5,6]:
         results = SolutionStructural(self.mesh, self.frequencies, acoustic_solution=self.solution_acoustic)
     else:
         results = SolutionStructural(self.mesh, self.frequencies)
     return results
Example #5
0
             Acoustic=True,
             Show_nodes=True,
             Undeformed=False,
             Deformed=False,
             Animate_Mode=True,
             Save=False)

#%%
## Structural Coupled ##
mesh.set_prescribed_DOFs_BC_by_node([1136, 1236, 1086], np.zeros(6))

mesh.add_spring_to_node([427], 1 * np.array([1e9, 1e9, 1e9, 0, 0, 0]))
mesh.add_mass_to_node([204], 0 * np.array([80, 80, 80, 0, 0, 0]))
mesh.add_damper_to_node([342], 0 * np.array([1e3, 1e3, 1e3, 0, 0, 0]))

solution_structural = SolutionStructural(mesh, acoustic_solution=direct)
modes = 200
natural_frequencies, mode_shapes = solution_structural.modal_analysis(
    modes=modes, harmonic_analysis=True)

# SOLVING THE PROBLEM BY TWO AVALIABLE METHODS
direct = solution_structural.direct_method(frequencies, is_viscous_lumped=True)
modal = solution_structural.mode_superposition(frequencies,
                                               modes,
                                               fastest=True)

column = 3

ms_results = np.real(modal)

load_reactions = solution_structural.get_reactions_at_fixed_nodes(
Example #6
0
from pulse.postprocessing.plot_data import get_frf

# PREPARING MESH
steel = Material('Steel', 7860, young_modulus=210e9, poisson_ratio=0.3)
cross_section = CrossSection(0.05, 0.034)
mesh = Mesh()
mesh.load_mesh('coord.dat', 'connect.dat')
mesh.set_material_by_element('all', steel)
mesh.set_cross_section_by_element('all', cross_section)
mesh.set_prescribed_dofs_bc_by_node([1, 1200, 1325], np.zeros(6))
mesh.set_structural_load_bc_by_node([361], np.array([1, 0, 0, 0, 0, 0]))

# SOLVING THE PROBLEM BY TWO AVALIABLE METHODS
frequencies = np.arange(0, 202, 2)
modes = 200
solution = SolutionStructural(mesh)
direct = solution.direct_method(frequencies)
modal = solution.mode_superposition(frequencies, modes)

# GETTING FRF
node = 711
local_dof = 2
x = frequencies
yd = get_frf(mesh, direct, node, local_dof)
ym = get_frf(mesh, modal, node, local_dof)

# PLOTTING RESULTS
plt.semilogy(x, yd)
plt.semilogy(x, ym)
plt.show()
Example #7
0
if load_file==1:
    mesh.generate('examples/iges_files/tube_1.iges', 0.01)
    mesh.set_prescribed_dofs_bc_by_node([40, 1424, 1324], np.zeros(6))
    mesh.set_structural_load_bc_by_node([359], np.array([1,0,0,0,0,0]))
if load_file==2:
    mesh.load_mesh('examples/mesh_files/Geometry_01/coord.dat', 'examples/mesh_files/Geometry_01/connect.dat')
    mesh.set_prescribed_dofs_bc_by_node([1, 1200, 1325], np.zeros(6))
    mesh.set_structural_load_bc_by_node([361], np.array([1,0,0,0,0,0]))

mesh.set_element_type_by_element('all', element_type)
mesh.set_material_by_element('all', steel)
offset = [0.005, 0.005]
cross_section = CrossSection(0.05, 0.008, offset[0], offset[1], steel.poisson_ratio, element_type=element_type, division_number=64)
mesh.set_cross_section_by_element('all', cross_section)

solution = SolutionStructural(mesh)
f_max = 200
df = 2
frequencies = np.arange(0, f_max+df, df)
modes = 200
direct = solution.direct_method(frequencies, is_viscous_lumped=True)
modal = solution.mode_superposition(frequencies, modes, fastest=True)
# natural_frequencies, modal_shape = solution.modal_analysis(modes=20)
dt = time()-t0
print('Total elapsed time:', dt,'[s]')

######################################################################################
##                       POST-PROCESSING THE RESULTS                                ##
######################################################################################

run=1
Example #8
0
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
df = 2
frequencies = np.arange(0.001, f_max + df, df)
modes = 200

# solution_acoustic = SolutionAcoustic(mesh, frequencies)
# direct_acoustic = solution_acoustic.direct_method()

solution_structural = SolutionStructural(
    preprocessor, frequencies)  #, acoustic_solution = direct_acoustic)
global_damping = (0, 0, 0, 0)

direct_structural = solution_structural.direct_method(
    global_damping=global_damping)
tf = time()
print('Structural direct solution time:', (tf - t0), '[s]')
column = 50

_, coord_def, _, _ = get_structural_response(preprocessor,
                                             direct_structural,
                                             column,
                                             Normalize=False)

solution_structural.stress_calculate(global_damping,
                                     pressure_external=0,
Example #9
0
                             area=area,
                             Iyy=Iyy,
                             Izz=Izz,
                             Iyz=Iyz,
                             additional_section_info=section_info)

# offset = [0.005, 0.005]
# cross_section = CrossSection(0.05, 0.008, offset[0], offset[1], steel.poisson_ratio, element_type=element_type, division_number=64)

preprocessor.set_cross_section_by_element('all', cross_section)

f_max = 200
df = 2
frequencies = np.arange(0, f_max + df, df)

solution = SolutionStructural(preprocessor, frequencies)

modes = 200
global_damping = [0, 0, 0, 0]
direct = solution.direct_method(global_damping)
modal = solution.mode_superposition(modes, global_damping, fastest=True)
# natural_frequencies, modal_shape = solution.modal_analysis(modes=20)
dt = time() - t0
print('Total elapsed time:', dt, '[s]')

######################################################################################
##                       POST-PROCESSING THE RESULTS                                ##
######################################################################################

run = 1