Skip to content
Snippets Groups Projects
Commit c9549fb0 authored by Ruth Sabariego's avatar Ruth Sabariego
Browse files

slightly clearer and straightforward...

parent 0af0b829
No related branches found
No related tags found
No related merge requests found
Pipeline #1958 passed
/* ------------------------------------------------------------------- /* -------------------------------------------------------------------
Tutorial 3 : linear elastic model of a wrench Tutorial 3 : linear elastic model of a wrench
Features: Features:
- "grad u" GetDP specific formulation for linear elasticity - "grad u" GetDP specific formulation for linear elasticity
- first and second order elements - first and second order elements
- triangular and quadrangular elements - triangular and quadrangular elements
To compute the solution interactively from the Gmsh GUI: To compute the solution in a terminal:
getdp wrench2D.pro -solve Elast_u -pos pos
To compute the solution interactively from the Gmsh GUI:
File > Open > wrench.pro File > Open > wrench.pro
Run (button at the bottom of the left panel) Run (button at the bottom of the left panel)
------------------------------------------------------------------- */ ------------------------------------------------------------------- */
/* Linear elasticity with GetDP: /*
Particularities of linear elasticity in GetDP:
GetDP has a peculiar way to deal with linear elasticity. Instead of a vector
field "u = Vector[ ux, uy, uz ]", the displacement field is regarded as two Instead of a vector field "u = Vector[ ux, uy, uz ]", the displacement field
(2D case) or 3 (3D case) scalar fields. Unlike conventional formulations is regarded as two (2D case) or three (3D case) scalar fields.
then, GetDP's formulation is written in terms of the gradient "grad u" of the Unlike conventional formulations, GetDP formulation is then written in terms
displacement field, which is a non-symmetric tensor, and the needed of the gradient "grad u" of the displacement field, which is a non-symmetric
symmetrization (to define the strain tensor and relate it to the stress tensor, and the needed symmetrization (to define the strain tensor and relate
tensor) is done through the constitutive relationship (Hooke law). The it to the stress tensor) is done via the constitutive relationship (Hooke law).
reason for this unusual formulation is to be able to use also for elastic This unusual formulation allows to take advantage of the powerful geometrical
problems the powerful geometrical and homological kernel of GetDP, which and homological GetDP kernel, which relies on the operators grad, curl and div.
relies on the operators grad, curl and div.
The "grad u" formulation entails a small increase of assembly work but makes
The "grad u" formulation entails a small increase of assembly work but makes in counterpart lots of geometrical features implemented in GetDP (change of
in counterpart lots of geometrical features implemented in GetDP (change of coordinates, function spaces, etc...) applicable to elastic problems
coordinates, function spaces, etc...) applicable to elastic problems out-of-the-box, since the scalar fields { ux, uy, uz } have exactly the same
out-of-the-box, since the scalar fields { ux, uy, uz } have exactly the same geometrical properties as, e.g. an electric scalar potential or a temperature
geometrical properties as, e.g. a scalar electric potential or a temperature field.
field. */ */
Include "wrench2D_common.pro"; Include "wrench2D_common.pro";
...@@ -54,24 +57,30 @@ Group { ...@@ -54,24 +57,30 @@ Group {
Sur_Clamp_Mec = Region[ Grip ]; Sur_Clamp_Mec = Region[ Grip ];
Sur_Force_Mec = Region[ Force ]; Sur_Force_Mec = Region[ Force ];
/* Signification of the abstract regions: /* Meaning of abstract regions:
- Vol_Mec : Elastic domain - Vol_Mec : Elastic domain
- Vol_Force_Mec : Region with imposed volumic force - Vol_Force_Mec : Region with imposed volume force
- Sur_Force_Mec : Surface with imposed surface traction - Sur_Force_Mec : Surface with imposed surface traction
- Sur_Clamp_Mec : Surface with imposed zero displacements (all components) */ - Sur_Clamp_Mec : Surface with imposed zero displacements (all components) */
} }
Function { Function {
/* Material coefficients. /*
No need to define them regionwise here ( E[{Wrench}] = ... ; ) Material coefficients
as there is only one region in this model. */ No need of regionwise definition ( E[{Wrench}] = ... ; )
as this model comprises only one region.
If there is more than one region and coefficients are not particularised,
the same value holds for all of them.
*/
E[] = Young; E[] = Young;
nu[] = Poisson; nu[] = Poisson;
/* Components of the volumic force applied to the region "Vol_Force_Mec" /*
Gravity could be defined here ( force_y[] = 7000*9.81; ) ; */ Volume force components applied to the region "Vol_Force_Mec"
Gravity could be defined here as well ( force_y[] = 7000*9.81; ) ;
*/
force_x[] = 0; force_x[] = 0;
force_y[] = 0; force_y[] = 0;
/* Components of the surface traction force applied to the region "Sur_Force_Mec" */ /* Surface traction force components applied to the region "Sur_Force_Mec" */
pressure_x[] = 0; pressure_x[] = 0;
pressure_y[] = -AppliedForce/(SurfaceArea[]*Thickness); // downward vertical force pressure_y[] = -AppliedForce/(SurfaceArea[]*Thickness); // downward vertical force
} }
...@@ -82,7 +91,7 @@ Function { ...@@ -82,7 +91,7 @@ Function {
sigma_ij = C_ijkl epsilon_ij sigma_ij = C_ijkl epsilon_ij
is represented in 2D by 4 2x2 tensors C_ij[], i,j=1,2, depending on the Lamé is represented in 2D by four 2x2 tensors C_ij[], i,j=1,2, depending on the Lamé
coefficients of the isotropic linear material, coefficients of the isotropic linear material,
lambda = E[]*nu[]/(1.+nu[])/(1.-2.*nu[]) lambda = E[]*nu[]/(1.+nu[])/(1.-2.*nu[])
...@@ -94,7 +103,8 @@ Function { ...@@ -94,7 +103,8 @@ Function {
EPD: a[] = lambda + 2 mu b[] = mu c[] = lambda EPD: a[] = lambda + 2 mu b[] = mu c[] = lambda
3D: a[] = lambda + 2 mu b[] = mu c[] = lambda 3D: a[] = lambda + 2 mu b[] = mu c[] = lambda
respectively for the 2D plane strain (EPD), 2D plane stress (EPS) and 3D cases. */ respectively for the 2D plane strain (EPD), 2D plane stress (EPS) and 3D cases.
*/
Function { Function {
Flag_EPC = 1; Flag_EPC = 1;
...@@ -128,7 +138,7 @@ Constraint { ...@@ -128,7 +138,7 @@ Constraint {
} }
} }
/* As explained above, the displacement field is discretized as two scalar /* As mentioned above, the displacement field is discretized as two scalar
fields "ux" and "uy", which are the spatial components of the vector field fields "ux" and "uy", which are the spatial components of the vector field
"u" in a fixed Cartesian coordinate system. "u" in a fixed Cartesian coordinate system.
...@@ -143,17 +153,17 @@ Constraint { ...@@ -143,17 +153,17 @@ Constraint {
u . n = ux Cos [th] + uy Sin [th] = ... ; u . n = ux Cos [th] + uy Sin [th] = ... ;
are less naturally accounted for within the "grad u" formulation; but they are less naturally accounted for within the "grad u" formulation; but they
could be easily implemented with a Lagrange multplier. could be easily implemented with e.g. a Lagrange multiplier.
Finite element shape (triangles or quadrangles) makes no difference in the The finite element shape (e.g. triangles or quadrangles in 2D) has no influence
definition of the FunctionSpaces. The appropriate shape functions to be used in the definition of the FunctionSpaces. The appropriate shape functions
are determined by GetDP at a much lower level on basis of the information are determined by GetDP at a much lower level on basis of the information
contained in the *.msh file. contained in the *.msh file.
Second order elements, on the other hand, are implemented in the hierarchical Second order elements are hierarchically implemented by adding to the first
fashion by adding to the first order node-based shape functions a set of order node-based shape functions a set of second order edge-based functions
second order edge-based functions to complete a basis for 2d order to complete a basis for 2D order polynomials on the reference element.
polynomials on the reference element. */ */
// Domain of definition of the "ux" and "uy" FunctionSpaces // Domain of definition of the "ux" and "uy" FunctionSpaces
Group { Group {
...@@ -217,8 +227,8 @@ Jacobian { ...@@ -217,8 +227,8 @@ Jacobian {
} }
} }
/* Adapt the number of Gauss points to the polynomial degree of the finite elements /* Adapting the number of Gauss points to the polynomial degree of the finite elements
is as simple as this: */ is simple: */
Integration { Integration {
{ Name Gauss_v; { Name Gauss_v;
Case { Case {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment