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




