### Finished 2D elasticity

parent 511d7f1b
 ========================= 2D linear elasticity ========================= In this first numerical tour, we will show how to compute a static solution for a 2D isotropic linear elastic medium, either in plane stress or in plane strain, using FEniCS in a tradtional displacement-based finite element formulation. We will illustrate this on the case of a cantilever beam modeled as a 2D medium of dimensions L x H. We first define the geometrical parameters and mesh density which will be used. The mesh is generated using the RectangleMesh function and we choose a crossed configuration for the mesh structure. We now define the material parameters which are here given in terms of a Young's modulus and a Poisson coefficient. In the following, we will need to define the constitutive relation relating \sigma as a function of \varepsilon. Let us recall that the general expression for a 3D medium of the linear elastic isotropic constitutive relation is given by : here we will consider a 2D model either in plane strain or in plane stress. Irrespective of this choice, we will work only with a 2D displacement vector u and will subsequently define the strain operator \epsilon as follows .. code-block:: python def eps(v): return sym(grad(v)) which computes the 2x2 plane components of the symmetrized gradient tensor of any 2D vectorial field. In the plane strain case, the full 3D strain tensor is defined as follows, so that the 2x2 plane part of the stress tensor is defined in the same way as for the 3D case. In the plane stress case, an out-of-plane \epsilon_{zz} Hence, the 2D constitutive relation can be defined as follows, by changing only the value of the Lamé coefficient \lambda. .. code-block:: python def sigma(v): dim = 2 if plane_stress: lmbda = lmbda_plane_stress else: lmbda = lmbda_plane_strain return lmbda*tr(eps(v))*Identity(dim) + 2.0*mu*eps(v)
 ... ... @@ -14,7 +14,8 @@ Introduction In this first numerical tour, we will show how to compute a small strain solution for a 2D isotropic linear elastic medium, either in plane stress or in plane strain, in a tradtional displacement-based finite element formulation. Extension to 3D in a tradtional displacement-based finite element formulation. The corresponding file can be obtained from :download:2D_elasticity.py.Extension to 3D is straightforward and an example can be found in the :ref:ModalAnalysis example. We consider here the case of a cantilever beam modeled as a 2D medium of dimensions ... ... @@ -160,4 +161,25 @@ Euler-Bernoulli beam theory which is here :math:w_{beam} = \dfrac{qL^4}{8EI}:: print("Beam theory deflection:", float(3*rho_g*L**4/2/E/H**3)) One finds :math:w_{FE} = 5.8638\text{e-3} against :math:w_{beam} = 5.8594\text{e-3} that is a 0.07% difference. \ No newline at end of file that is a 0.07% difference. The stress tensor must be projected on an appropriate function space in order to evaluate pointwise values or export it for Paraview vizualisation. Here we choose to describe it as a (2D) tensor and project it onto a piecewise constant function space:: Vsig = TensorFunctionSpace(mesh, "DG", degree=0) sig = Function(Vsig, name="Stress") sig.assign(project(sigma(u), Vsig)) print("Stress at (0,H):", sig(0, H)) Fields can be exported in a suitable format for vizualisation using Paraview. VTK-based extensions (.pvd,.vtu) are not suited for multiple fields and parallel writing/reading. Prefered output format is now .xdmf:: file_results = XDMFFile("elasticity_results.xdmf") file_results.parameters["flush_output"] = True file_results.parameters["functions_share_mesh"] = True file_results.write(u, 0.) file_results.write(sig, 0.) \ No newline at end of file
 ############# Introduction ############# Workflow : geometry with Gmsh, dolfin-convert, export Paraview ############### Linear problems ############### ... ... @@ -15,7 +22,7 @@ mixed formulation using Hu-Washizu -> volumetric locking Elastodynamics * time integration Newmark scheme, theta * time integration Newmark scheme, theta (lumped mass matrix, efficient solving) Poroelasticity ... ...
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment