Note
Go to the end to download the full example code.
HyperElastic0#
Attempt to implement hyperelasticity within an Eulerian framework.
Mesh node coordinates are updated at each loading iteration. WARNING: Implementation not validated.
5.00 %
10.00 %
15.00 %
20.00 %
25.00 %
30.00 %
35.00 %
40.00 %
45.00 %
50.00 %
55.00 %
60.00 %
65.00 %
70.00 %
75.00 %
80.00 %
85.00 %
90.00 %
95.00 %
100.00 %
==================== Mesh ====================
Element type: TRI6
Ne = 790, Nn = 1661, dof = 3322
==================== Model ====================
ElasIsot:
E = 2.10e+05, v = 0.25
planeStress = True
thickness = 5.00e+01
solver : pypardiso
============= Boundary Conditions =============
Unspecified.
=================== Results ===================
W def = 22730944.66
Svm max = 3415.39
Evm max = 1.83 %
Ux max = 1.44e-02
Ux min = -1.58e+01
Uy max = 1.35e+01
Uy min = -5.23e+00
=================== TicTac ===================
Mesh : 2.273 s
Boundary Conditions : 1.476 ms
Matrix : 2.762 s
Solver : 2.836 s
Display : 1.322 s
PostProcessing : 377.928 ms
PyVista_Interface : 28.326 s
Paraview : 818.761 ms
15 from EasyFEA import Display, Folder, Models, ElemType, Simulations, Paraview
16 from EasyFEA.Geoms import Point, Points
17
18 if __name__ == "__main__":
19 Display.Clear()
20
21 # ----------------------------------------------
22 # Configuration
23 # ----------------------------------------------
24 dim = 2
25
26 # outputs
27 folder = Folder.Join(Folder.RESULTS_DIR, "HyperElastic", "HyperElastic0")
28 makeParaview = False
29 useHyperElastic = True # eulerian approch
30
31 # geom
32 L = 250
33 thickness = 50
34 w = 50
35
36 # load
37 sigMax = 8 * 1e5 / (w * thickness)
38 uMax = 50
39
40 # ----------------------------------------------
41 # Mesh
42 # ----------------------------------------------
43 meshSize = L / 10
44
45 p1 = Point(0, 0)
46 p2 = Point(L, 0)
47 p3 = Point(L, L, r=50)
48 p4 = Point(2 * L - w, L)
49 p5 = Point(2 * L, L)
50 p6 = Point(2 * L, 2 * L)
51 p7 = Point(2 * L - w, 2 * L)
52 p8 = Point(0, 2 * L)
53
54 contour = Points([p1, p2, p3, p4, p5, p6, p7, p8], meshSize)
55
56 if dim == 2:
57 mesh = contour.Mesh_2D([], ElemType.TRI6)
58 else:
59 mesh = contour.Mesh_Extrude([], [0, 0, -thickness], [3], ElemType.PRISM6)
60
61 nodes_y0 = mesh.Nodes_Conditions(lambda x, y, z: y == 0)
62 nodes_Load = mesh.Nodes_Conditions(lambda x, y, z: x == 2 * L)
63
64 # ----------------------------------------------
65 # Simulation
66 # ----------------------------------------------
67 material = Models.ElasIsot(
68 dim, E=210000, v=0.25, planeStress=True, thickness=thickness
69 )
70
71 simu = Simulations.ElasticSimu(mesh, material)
72
73 N = 20
74 iter = 0
75
76 while iter < N:
77 iter += 1
78
79 print(f"{iter / N * 100:2.2f} %", end="\r")
80
81 simu.Bc_Init()
82 simu.add_dirichlet(nodes_y0, [0] * dim, simu.Get_unknowns())
83 # simu.add_dirichlet(nodes_Load, [uMax*iter/N], ['y'])
84 simu.add_surfLoad(nodes_Load, [sigMax * iter / N], ["y"])
85
86 simu.Solve()
87
88 simu.Save_Iter()
89
90 if useHyperElastic and iter != N:
91 # update the nodes coordinates
92
93 newMesh = simu.mesh.copy()
94 newMesh.coordGlob += simu.Results_displacement_matrix()
95
96 simu.mesh = newMesh
97
98 pass
99
100 # ----------------------------------------------
101 # Results
102 # ----------------------------------------------
103
104 Display.Plot_Mesh(simu, deformFactor=1)
105 Display.Plot_BoundaryConditions(simu)
106 Display.Plot_Result(simu, "ux")
107 Display.Plot_Result(simu, "uy")
108 Display.Plot_Result(simu, "Svm", nodeValues=False)
109 Display.Plot_Result(simu, "Evm", nodeValues=False)
110
111 print(simu)
112
113 if makeParaview:
114 Paraview.Save_simu(simu, folder, elementFields=["Strain"])
115
116 Display.plt.show()
Total running time of the script: (0 minutes 0.952 seconds)





