Note
Go to the end to download the full example code.
HyperElastic1#
A cantilever beam undergoing bending deformation.


12 from EasyFEA import (
13 Display,
14 ElemType,
15 Models,
16 Simulations,
17 PyVista,
18 )
19 from EasyFEA.Geoms import Domain
20
21 if __name__ == "__main__":
22 Display.Clear()
23
24 # ----------------------------------------------
25 # Configuration
26 # ----------------------------------------------
27
28 # geom
29 L = 120
30 h = 13
31
32 # model
33 lmbda = 121153.84615384616 # Mpa
34 mu = 80769.23076923077
35 rho = 7850 * 1e-9 # kg/mm3
36
37 # ----------------------------------------------
38 # Mesh
39 # ----------------------------------------------
40 meshSize = h / 2
41
42 contour = Domain((0, 0), (L, h), h / 3)
43
44 mesh = contour.Mesh_Extrude(
45 [], [0, 0, h], [h / meshSize], ElemType.HEXA20, isOrganised=True
46 )
47 nodesX0 = mesh.Nodes_Conditions(lambda x, y, z: x == 0)
48 nodesXL = mesh.Nodes_Conditions(lambda x, y, z: x == L)
49
50 # ----------------------------------------------
51 # Simulation
52 # ----------------------------------------------
53
54 mat = Models.SaintVenantKirchhoff(3, lmbda, mu)
55
56 simu = Simulations.HyperElasticSimu(mesh, mat)
57
58 simu.add_dirichlet(nodesX0, [0, 0, 0], simu.Get_unknowns())
59 simu.add_volumeLoad(mesh.nodes, [-rho * 9.81], ["y"])
60 simu.add_surfLoad(nodesXL, [-800 / h / h], ["y"])
61
62 simu.Solve()
63
64 # ----------------------------------------------
65 # Results
66 # ----------------------------------------------
67
68 PyVista.Plot_BoundaryConditions(simu).show()
69 PyVista.Plot(simu, "uy", 1, plotMesh=True).show()
Total running time of the script: (0 minutes 0.987 seconds)