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 : 19.989 ms
Boundary Conditions : 23.842 µs
Matrix : 12.647 ms
Solver : 14.188 ms
Display : 167.627 ms
PostProcessing : 1.047 ms
12 import matplotlib.pyplot as plt
13
14 from EasyFEA import Display, ElemType, Models, Simulations
15 from EasyFEA.Geoms import Point, Points, Domain, Circle
16
17 if __name__ == "__main__":
18 Display.Clear()
19
20 # ----------------------------------------------
21 # Configuration
22 # ----------------------------------------------
23
24 dim = 2
25 isSymmetric = True
26
27 # geom
28 a = 10
29 l = 50
30 h = 20
31 thickness = 1
32
33 # ----------------------------------------------
34 # Mesh
35 # ----------------------------------------------
36
37 meshSize = h / 4
38
39 if isSymmetric:
40 p0 = Point(0, 0, r=-a)
41 p1 = Point(l, 0)
42 p2 = Point(l, h)
43 p3 = Point(0, h)
44 contour = Points([p0, p1, p2, p3], meshSize)
45 inclusions = []
46 else:
47 p0 = Point(-l, -h)
48 p1 = Point(l, h)
49 contour = Domain(p0, p1, meshSize)
50 inclusions = [Circle(Point(), 2 * a, meshSize, isHollow=True)]
51
52 if dim == 2:
53 mesh = contour.Mesh_2D(inclusions, elemType=ElemType.TRI10)
54 else:
55 mesh = contour.Mesh_Extrude(
56 inclusions, [0, 0, thickness], [1], ElemType.PRISM18
57 )
58
59 # ----------------------------------------------
60 # Simu
61 # ----------------------------------------------
62 material = Models.Elastic.Isotropic(
63 dim, E=210000, v=0.3, planeStress=True, thickness=thickness
64 )
65 simu = Simulations.Elastic(mesh, material)
66
67 if isSymmetric:
68 nodes_x0 = mesh.Nodes_Conditions(lambda x, y, z: x == 0)
69 nodes_y0 = mesh.Nodes_Conditions(lambda x, y, z: y == 0)
70 nodes_xl = mesh.Nodes_Conditions(lambda x, y, z: x == l)
71 simu.add_dirichlet(nodes_x0, [0], ["x"])
72 simu.add_dirichlet(nodes_y0, [0], ["y"])
73 simu.add_surfLoad(nodes_xl, [800 / 20], ["x"])
74 else:
75 nodes_pl = mesh.Nodes_Conditions(lambda x, y, z: x == l)
76 nodes_ml = mesh.Nodes_Conditions(lambda x, y, z: x == -l)
77 nodes_y0 = mesh.Nodes_Conditions(lambda x, y, z: y == 0)
78 simu.add_dirichlet(nodes_y0, [0], ["y"])
79 simu.add_surfLoad(nodes_pl, [800 / 20], ["x"])
80 simu.add_surfLoad(nodes_ml, [-800 / 20], ["x"])
81
82 simu.Solve()
83
84 # ----------------------------------------------
85 # Results
86 # ----------------------------------------------
87 uxMax = simu.Result("ux").max()
88 Display.Plot_Mesh(simu, deformFactor=2 / uxMax)
89 Display.Plot_BoundaryConditions(simu)
90
91 Display.Plot_Result(simu, "ux", ncolors=10)
92 Display.Plot_Result(simu, "uy", ncolors=10)
93 Display.Plot_Result(simu, "Svm", ncolors=10, nodeValues=False, plotMesh=True)
94
95 print(simu)
96
97 plt.show()
Total running time of the script: (0 minutes 0.634 seconds)




