コード例 #1
0
def test_structural_solver():

    # Material definition
    name = "Aluminiun"
    density = 0.0975
    young_modulus = 1e7
    shear_modulus = 3770000
    poisson_ratio = 0.33
    yield_strength = 350e6
    ultimate_strength = 420e6

    mat_aluminiun = basic_objects.Material(name, young_modulus, shear_modulus,
                                           poisson_ratio, density,
                                           yield_strength, ultimate_strength)

    # Section definition
    area = 1
    m_inertia_y = 0.08333333
    m_inertia_z = 0.08333333
    polar_moment = 0.1408333
    rotation = 0

    section = basic_objects.Section(area, rotation, m_inertia_y, m_inertia_z,
                                    polar_moment)

    # Structure points definition
    structure_points = np.array([[0, 0, 0], [10, 0, 0], [20, 0, 0]])

    # Structure beams definition
    beam_0 = basic_objects.Beam(structure_points, 0, 1, section, mat_aluminiun,
                                5)
    beam_1 = basic_objects.Beam(structure_points, 1, 2, section, mat_aluminiun,
                                5)

    beams = [beam_0, beam_1]

    # Structure definition
    structure = basic_objects.Structure(structure_points, beams)

    # Element Length
    element_length = 2

    # Loads definition
    force = basic_objects.Load(0, np.array([0, 100, 0, 0, 0, 0]))
    loads = [force]

    # Constraints definition
    constraint_1 = basic_objects.Constraint(1, [0, 0, 0, 0, 0, 0])
    constraint_2 = basic_objects.Constraint(2, [0, 0, 0, None, None, None])
    constraints = [constraint_1]

    print("# Testing structural_solver")
    start = time.time()
    deformed_grid, deformations, force_vector = finite_element_method.structural_solver(
        structure, loads, constraints, element_length)
    end = time.time()
    print(f"- Test completed in {end - start}")
コード例 #2
0
def test_create_global_FEM_matrices():

    # Material definition
    name = "Aluminiun"
    density = 0.0975
    young_modulus = 1e7
    shear_modulus = 3770000
    poisson_ratio = 0.33
    yield_strength = 350e6
    ultimate_strength = 420e6

    mat_aluminiun = basic_objects.Material(name, young_modulus, shear_modulus,
                                           poisson_ratio, density,
                                           yield_strength, ultimate_strength)

    # Section definition
    area = 1
    m_inertia_y = 0.08333333
    m_inertia_z = 0.08333333
    polar_moment = 0.1408333
    rotation = 0

    section = basic_objects.Section(area, rotation, m_inertia_y, m_inertia_z,
                                    polar_moment)

    # Structure points definition
    structure_points = np.array([[0, 0, 0], [10, 0, 0], [20, 0, 0]])

    # Structure beams definition

    beam_0 = basic_objects.Beam(structure_points, 0, 1, section, mat_aluminiun,
                                5)
    beam_1 = basic_objects.Beam(structure_points, 1, 2, section, mat_aluminiun,
                                5)

    beams = [beam_0, beam_1]

    # Structure definition
    structure = basic_objects.Structure(structure_points, beams)

    # Element Length
    element_length = 2

    nodes, fem_elements = finite_element_method.generate_FEM_mesh(
        structure, element_length)

    # Loads definition
    force = basic_objects.Load(1, np.array([0, 100, 0, 0, 0, 0]))
    loads = [force]

    print("# Testing create_global_FEM_matrices")
    start = time.time()
    K_global, F_global = finite_element_method.create_global_FEM_matrices(
        nodes, fem_elements, loads)
    end = time.time()
    print(f"- Test completed in {end - start}")
コード例 #3
0
def test_beam():

    structure_points = np.array([[0, 0, 0],
                                 [3, 3, 3]])

    point_A_index = 0
    point_B_index = 1

    name = "Steel"
    density = 8000
    young_modulus = 200e9
    shear_modulus = 80e9
    poisson_ratio = 0.25
    yield_strength = 350e6
    ultimate_strength = 420e6

    mat_steel = basic_objects.Material(name, young_modulus, shear_modulus, poisson_ratio, density, yield_strength, ultimate_strength)

    area = 2e-2
    m_inertia_y = 10e-5
    m_inertia_z = 20e-5
    polar_moment = 5e-5
    rotation = pi / 6

    section = basic_objects.Section(area, rotation, m_inertia_y, m_inertia_z, polar_moment)

    n_elements = 5

    beam = basic_objects.Beam(structure_points, point_A_index, point_B_index, section, mat_steel)
    print(beam.__dict__)

    print("# Mesh points: ")
    print(beam.mesh(n_elements))
コード例 #4
0
def test_plot_structure():

    name = "Steel"
    density = 8000
    young_modulus = 200e9
    shear_modulus = 80e9
    poisson_ratio = 0.25
    yield_strength = 350e6
    ultimate_strength = 420e6

    mat_steel = basic_objects.Material(name, young_modulus, shear_modulus, poisson_ratio, density, yield_strength, ultimate_strength)

    area = 2e-2
    m_inertia_y = 10e-5
    m_inertia_z = 20e-5
    polar_moment = 5e-5
    rotation = pi / 6

    section = basic_objects.Section(area, rotation, m_inertia_y, m_inertia_z, polar_moment)

    structure_points = np.array([[0, 0, 0],
                                 [2, 0, 0],
                                 [5, 0, 0],
                                 [5, 0, 1],
                                 [2, -5, 0.4],
                                 [2, 5, 0.4],
                                 [5, -2, 1],
                                 [5, 2, 1]])

    fuselage_frontal = basic_objects.Beam(structure_points, 0, 1, section, mat_steel, 5)
    fuselage_posterior = basic_objects.Beam(structure_points, 1, 2, section, mat_steel, 5)
    wing_left = basic_objects.Beam(structure_points, 1, 4, section, mat_steel, 5)
    wing_right = basic_objects.Beam(structure_points, 1, 5, section, mat_steel, 5)
    tail_vertical = basic_objects.Beam(structure_points, 2, 3, section, mat_steel, 5)
    tail_horizontal_left = basic_objects.Beam(structure_points, 3, 6, section, mat_steel, 5)
    tail_horizontal_right = basic_objects.Beam(structure_points, 3, 7, section, mat_steel, 5)

    beams = [fuselage_frontal,
             fuselage_posterior,
             wing_left,
             wing_right,
             tail_vertical,
             tail_horizontal_left,
             tail_horizontal_right]

    constraint = basic_objects.Constraint(1, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
    constraints = [[constraint]]

    lift_left_wing = basic_objects.Load(4, np.array([0, 10000, 0, 0, 100, 0]))
    lift_right_wing = basic_objects.Load(5, np.array([0, 10000, 0, 0, 100, 0]))

    loads = [lift_left_wing, lift_right_wing]

    aircraft_structure = basic_objects.Structure(structure_points, beams)

    visualization.plot_structure(aircraft_structure)
コード例 #5
0
rotation = 0

constraint = basic_objects.Constraint(1, [0, 0, 0, 0, 0, 0])
#circular_section = basic_objects.Section(section_area, rotation, m_inertia_y, m_inertia_z, polar_moment)
rectangular_section = basic_objects.Section(section_area, rotation,
                                            m_inertia_y, m_inertia_z,
                                            polar_moment)

# Structure
structure_points = np.array([[1, -5, 0], [1, -4.16667, 0], [1, -3.33333, 0],
                             [1, -2.5, 0], [1, -1.66667, 0], [1, -0.83333, 0],
                             [1, 0, 0], [1, 0.83333, 0], [1, 1.66667, 0],
                             [1, 2.5, 0], [1, 3.33333, 0], [1, 4.16666, 0],
                             [1, 5, 0]])

left_wing_0 = basic_objects.Beam(structure_points, 0, 1, rectangular_section,
                                 mat_aluminium7075, 1)
left_wing_1 = basic_objects.Beam(structure_points, 1, 2, rectangular_section,
                                 mat_aluminium7075, 1)
left_wing_2 = basic_objects.Beam(structure_points, 2, 3, rectangular_section,
                                 mat_aluminium7075, 1)
left_wing_3 = basic_objects.Beam(structure_points, 3, 4, rectangular_section,
                                 mat_aluminium7075, 1)
left_wing_4 = basic_objects.Beam(structure_points, 4, 5, rectangular_section,
                                 mat_aluminium7075, 1)
left_wing_5 = basic_objects.Beam(structure_points, 5, 6, rectangular_section,
                                 mat_aluminium7075, 1)
right_wing_0 = basic_objects.Beam(structure_points, 6, 7, rectangular_section,
                                  mat_aluminium7075, 1)
right_wing_1 = basic_objects.Beam(structure_points, 7, 8, rectangular_section,
                                  mat_aluminium7075, 1)
right_wing_2 = basic_objects.Beam(structure_points, 8, 9, rectangular_section,