Note
Go to the end to download the full example code.
Elas4#
Plate with a hole subjected to uniform tensile loading.
==================== Mesh ====================
Element type: TRI10
Ne = 104, Nn = 511
==================== Model ====================
Isotropic:
E = 2.10e+05, v = 0.3
planeStress = True
thickness = 1.00e+00
solver:scipy
============= Boundary Conditions =============
Unspecified.
=================== Results ===================
W def = 5.04
Svm max = 127.24
Evm max = 0.07 %
Ux max = 1.27e-02
Ux min = 0.00e+00
Uy max = 0.00e+00
Uy min = -4.89e-03
=================== TicTac ===================
Mesh: 11.694 ms
Boundary Conditions: 14.782 µs
Matrix: 7.452 ms
Solver: 4.315 ms
Display: 69.976 ms
PostProcessing: 590.801 µs
13 import matplotlib.pyplot as plt
14
15 from EasyFEA import Display, ElemType, Models, Simulations
16 from EasyFEA.Geoms import Point, Points, Domain, Circle
17
18 if __name__ == "__main__":
19 Display.Clear()
20
21 # ----------------------------------------------
22 # Configuration
23 # ----------------------------------------------
24
25 dim = 2
26 isSymmetric = True
27
28 # geom
29 a = 10
30 l = 50
31 h = 20
32 thickness = 1
33
34 # ----------------------------------------------
35 # Mesh
36 # ----------------------------------------------
37
38 meshSize = h / 4
39
40 if isSymmetric:
41 p0 = Point(0, 0, r=-a)
42 p1 = Point(l, 0)
43 p2 = Point(l, h)
44 p3 = Point(0, h)
45 contour = Points([p0, p1, p2, p3], meshSize)
46 inclusions = []
47 else:
48 p0 = Point(-l, -h)
49 p1 = Point(l, h)
50 contour = Domain(p0, p1, meshSize)
51 inclusions = [Circle(Point(), 2 * a, meshSize)]
52
53 if dim == 2:
54 mesh = contour.Mesh_2D(inclusions, elemType=ElemType.TRI10)
55 else:
56 mesh = contour.Mesh_Extrude(
57 inclusions, [0, 0, thickness], [1], ElemType.PRISM18
58 )
59
60 # ----------------------------------------------
61 # Simu
62 # ----------------------------------------------
63 material = Models.Elastic.Isotropic(
64 dim, E=210000, v=0.3, planeStress=True, thickness=thickness
65 )
66 simu = Simulations.Elastic(mesh, material)
67
68 if isSymmetric:
69 nodes_x0 = mesh.Nodes_Conditions(lambda x, y, z: x == 0)
70 nodes_y0 = mesh.Nodes_Conditions(lambda x, y, z: y == 0)
71 nodes_xl = mesh.Nodes_Conditions(lambda x, y, z: x == l)
72 simu.add_dirichlet(nodes_x0, [0], ["x"])
73 simu.add_dirichlet(nodes_y0, [0], ["y"])
74 simu.add_surfLoad(nodes_xl, [800 / 20], ["x"])
75 else:
76 nodes_pl = mesh.Nodes_Conditions(lambda x, y, z: x == l)
77 nodes_ml = mesh.Nodes_Conditions(lambda x, y, z: x == -l)
78 nodes_y0 = mesh.Nodes_Conditions(lambda x, y, z: y == 0)
79 simu.add_dirichlet(nodes_y0, [0], ["y"])
80 simu.add_surfLoad(nodes_pl, [800 / 20], ["x"])
81 simu.add_surfLoad(nodes_ml, [-800 / 20], ["x"])
82
83 simu.Solve()
84
85 # ----------------------------------------------
86 # Results
87 # ----------------------------------------------
88 uxMax = simu.Result("ux").max()
89 Display.Plot_Mesh(simu, deformFactor=2 / uxMax)
90 Display.Plot_BoundaryConditions(simu)
91
92 Display.Plot_Result(simu, "ux", ncolors=10)
93 Display.Plot_Result(simu, "uy", ncolors=10)
94 Display.Plot_Result(simu, "Svm", ncolors=10, nodeValues=False, plotMesh=True)
95
96 print(simu)
97
98 plt.show()
Total running time of the script: (0 minutes 0.327 seconds)




