Skip to content
Snippets Groups Projects
Commit 30d765d1 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

up

parent 58476bd7
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -13,40 +13,33 @@ ...@@ -13,40 +13,33 @@
/* Linear elasticity with GetDP: /* Linear elasticity with GetDP:
GetDP has a peculiar way to deal with linear elasticity. GetDP has a peculiar way to deal with linear elasticity. Instead of a vector
Instead of vector field "u = Vector[ ux, uy, uz ]", field "u = Vector[ ux, uy, uz ]", the displacement field is regarded as two
the displacement field is regarded as two (2D case) or 3 (3D case) scalar fields. (2D case) or 3 (3D case) scalar fields. Unlike conventional formulations
Unlike conventional formulations, GetDP's formulation is written then, GetDP's formulation is written in terms of the gradient "Grad u" of the
in terms of the gradient "Grad u" of the displacement field, displacement field, which is a non-symmetric tensor, and the needed
which is a non-symmetric tensor, and the needed symmetrization symmetrization (to define the strain tensor and relate it to the stress
(to define the strain tensor and relate it to the stress tensor) tensor) is done through the constitutive relationship (Hooke law). The
is done through the constitutive relationship (Hooke law). reason for this unusual formulation is to be able to use also for elastic
The reason for this unusual formulation is to be able to use also for elastic problems problems the powerful geometrical and homological kernel of GetDP, which
the powerful geometrical and homological kernel of GetDP, relies on the operators Grad, Curl and Div.
which 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 in counterpart lots of geometrical features implemented in GetDP (change of
but makes in counterpart lots of geometrical features coordinates, function spaces, etc...) applicable to elastic problems
implemented in GetDP (change of coordinates, function spaces, etc...) out-of-the-box, since the scalar fields { ux, uy, uz } have exactly the same
applicable to elastic problems out-of-the-box, geometrical properties as, e.g. a scalar electric potential or a temperature
since the scalar fields { ux, uy, uz } have exactly the same geometrical properties field. */
as, e.g. a scalar electrip potential or a temperature field.
*/
Include "wrench2D_common.pro"; Include "wrench2D_common.pro";
Young = 1e9 * Young = 1e9 * DefineNumber[ 200, Name "Material/Young modulus [GPa]"];
DefineNumber[ 200, Name "Material/Young modulus [GPa]"]; Poisson = DefineNumber[ 0.3, Name "Material/Poisson coefficient []"];
Poisson = AppliedForce = DefineNumber[ 100, Name "Material/Applied force [N]"];
DefineNumber[ 0.3, Name "Material/Poisson coefficient []"];
AppliedForce =
DefineNumber[ 100, Name "Material/Applied force [N]"];
// Approximation of the maximum deflection by an analytical model: // Approximation of the maximum deflection by an analytical model:
// Deflection = PL^3/(3EI) with I = Width^3*Thickness/12 // Deflection = PL^3/(3EI) with I = Width^3*Thickness/12
Deflection = Deflection = DefineNumber[4*AppliedForce*((LLength-0.018)/Width)^3/(Young*Thickness)*1e3,
DefineNumber[4*AppliedForce*((LLength-0.018)/Width)^3/(Young*Thickness)*1e3,
Name "Solution/Deflection (analytical) [mm]", ReadOnly 1]; Name "Solution/Deflection (analytical) [mm]", ReadOnly 1];
Group { Group {
...@@ -56,17 +49,16 @@ Group { ...@@ -56,17 +49,16 @@ Group {
Force = Region[ 3 ]; Force = Region[ 3 ];
// Abstract regions: // Abstract regions:
Vol_Elast_Mec = Region[ { Wrench } ]; Vol_Mec = Region[ Wrench ];
Vol_Force_Mec = Region[ { Wrench } ]; Vol_Force_Mec = Region[ Wrench ];
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: /* Signification of the abstract regions:
Vol_Elast_Mec Elastic domain - Vol_Mec : Elastic domain
Vol_Force_Mec Region with imposed volumic force - Vol_Force_Mec : Region with imposed volumic 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 {
...@@ -84,18 +76,17 @@ Function { ...@@ -84,18 +76,17 @@ Function {
pressure_y[] = -AppliedForce/(SurfaceArea[]*Thickness); // downward vertical force pressure_y[] = -AppliedForce/(SurfaceArea[]*Thickness); // downward vertical force
} }
/* Hooke's law
/* Hooke law
The material law The material law
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 is represented in 2D by 4 2x2 tensors C_ij[], i,j=1,2, depending on the Lamé
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[])
mu = E[]/2./(1.+nu[]); mu = E[]/2./(1.+nu[])
as follows as follows
...@@ -103,8 +94,7 @@ Function { ...@@ -103,8 +94,7 @@ 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;
...@@ -138,45 +128,40 @@ Constraint { ...@@ -138,45 +128,40 @@ Constraint {
} }
} }
/* As explained above, the displacement field is discretized /* As explained above, the displacement field is discretized as two scalar
as two scalar fields "ux" and "uy", which are the spatial components fields "ux" and "uy", which are the spatial components of the vector field
of the vector field "u" in a fixed Cartesian coordinate system. "u" in a fixed Cartesian coordinate system.
Boundary conditions like Boundary conditions like
ux = ... ; ux = ... ;
uy = ... ; uy = ... ;
translate naturally into Dirichlet constraints translate naturally into Dirichlet constraints on the scalar "ux" and "uy"
on the scalar "ux" and "uy" FunctionSpaces. FunctionSpaces. More exotic conditions like
Conditions like, however,
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. are less naturally accounted for within the "Grad u" formulation; but they
Fortunately, they are rather uncommon. could be easily implemented with a Lagrange multplier.
Finite element shape (triangles or quadrangles) makes no difference Finite element shape (triangles or quadrangles) makes no difference in the
in the definition of the FunctionSpaces. The appropriate shape functions to be used definition of the FunctionSpaces. The appropriate shape functions to be used
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 fashion Second order elements, on the other hand, are implemented in the hierarchical
by adding to the first order node-based shape functions fashion by adding to the first order node-based shape functions a set of
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 {
Dom_H_u_Mec = Region[ { Vol_Elast_Mec, Dom_H_u_Mec = Region[ { Vol_Mec, Sur_Force_Mec, Sur_Clamp_Mec} ];
Sur_Force_Mec,
Sur_Clamp_Mec} ];
} }
Flag_Degree = Flag_Degree = DefineNumber[ 0, Name "Geometry/Use degree 2 (hierarch.)",
DefineNumber[ 0, Name "Geometry/Use degree 2 (hierarch.)", Choices{0,1}, Visible 1]; Choices{0,1}, Visible 1];
FE_Degree = ( Flag_Degree == 0 ) ? 1 : 2; // Convert flag value into polynomial degree FE_Degree = ( Flag_Degree == 0 ) ? 1 : 2; // Convert flag value into polynomial degree
FunctionSpace { FunctionSpace {
...@@ -234,10 +219,10 @@ Jacobian { ...@@ -234,10 +219,10 @@ Jacobian {
/* Adapt the number of Gauss points to the polynomial degree of the finite elements /* Adapt the number of Gauss points to the polynomial degree of the finite elements
is as simple as this: */ is as simple as this: */
If (FE_Degree == 1)
Integration { Integration {
{ Name Gauss_v; { Name Gauss_v;
Case { Case {
If (FE_Degree == 1)
{ Type Gauss; { Type Gauss;
Case { Case {
{ GeoElement Line ; NumberOfPoints 3; } { GeoElement Line ; NumberOfPoints 3; }
...@@ -245,13 +230,7 @@ Integration { ...@@ -245,13 +230,7 @@ Integration {
{ GeoElement Quadrangle ; NumberOfPoints 4; } { GeoElement Quadrangle ; NumberOfPoints 4; }
} }
} }
} Else
}
}
ElseIf (FE_Degree == 2)
Integration {
{ Name Gauss_v;
Case {
{ Type Gauss; { Type Gauss;
Case { Case {
{ GeoElement Line ; NumberOfPoints 5; } { GeoElement Line ; NumberOfPoints 5; }
...@@ -259,10 +238,10 @@ Integration { ...@@ -259,10 +238,10 @@ Integration {
{ GeoElement Quadrangle ; NumberOfPoints 7; } { GeoElement Quadrangle ; NumberOfPoints 7; }
} }
} }
EndIf
} }
} }
} }
EndIf
Formulation { Formulation {
{ Name Elast_u ; Type FemEquation ; { Name Elast_u ; Type FemEquation ;
...@@ -272,13 +251,13 @@ Formulation { ...@@ -272,13 +251,13 @@ Formulation {
} }
Equation { Equation {
Integral { [ -C_xx[] * Dof{d ux}, {d ux} ] ; Integral { [ -C_xx[] * Dof{d ux}, {d ux} ] ;
In Vol_Elast_Mec ; Jacobian Vol ; Integration Gauss_v ; } In Vol_Mec ; Jacobian Vol ; Integration Gauss_v ; }
Integral { [ -C_xy[] * Dof{d uy}, {d ux} ] ; Integral { [ -C_xy[] * Dof{d uy}, {d ux} ] ;
In Vol_Elast_Mec ; Jacobian Vol ; Integration Gauss_v ; } In Vol_Mec ; Jacobian Vol ; Integration Gauss_v ; }
Integral { [ -C_yx[] * Dof{d ux}, {d uy} ] ; Integral { [ -C_yx[] * Dof{d ux}, {d uy} ] ;
In Vol_Elast_Mec ; Jacobian Vol ; Integration Gauss_v ; } In Vol_Mec ; Jacobian Vol ; Integration Gauss_v ; }
Integral { [ -C_yy[] * Dof{d uy}, {d uy} ] ; Integral { [ -C_yy[] * Dof{d uy}, {d uy} ] ;
In Vol_Elast_Mec ; Jacobian Vol ; Integration Gauss_v ; } In Vol_Mec ; Jacobian Vol ; Integration Gauss_v ; }
Integral { [ force_x[] , {ux} ]; Integral { [ force_x[] , {ux} ];
In Vol_Force_Mec ; Jacobian Vol ; Integration Gauss_v ; } In Vol_Force_Mec ; Jacobian Vol ; Integration Gauss_v ; }
...@@ -310,29 +289,36 @@ Resolution { ...@@ -310,29 +289,36 @@ Resolution {
PostProcessing { PostProcessing {
{ Name Elast_u ; NameOfFormulation Elast_u ; { Name Elast_u ; NameOfFormulation Elast_u ;
PostQuantity { PostQuantity {
{ Name u ; Value { Term { [ Vector[ {ux}, {uy}, 0 ]]; { Name u ; Value {
In Vol_Elast_Mec ; Jacobian Vol ; } } } Term { [ Vector[ {ux}, {uy}, 0 ]]; In Vol_Mec ; Jacobian Vol ; }
{ Name uy ; Value { Term { [ 1e3*{uy} ]; }
In Vol_Elast_Mec ; Jacobian Vol ; } } } }
{ Name sig_xx ; Value { Term { { Name uy ; Value {
[ CompX[ C_xx[]*{d ux} + C_xy[]*{d uy} ] ]; Term { [ 1e3*{uy} ]; In Vol_Mec ; Jacobian Vol ; }
In Vol_Elast_Mec ; Jacobian Vol ; } } } }
{ Name sig_xy ; Value { Term { }
[ CompY[ C_xx[]*{d ux} + C_xy[]*{d uy} ] ]; { Name sig_xx ; Value {
In Vol_Elast_Mec ; Jacobian Vol ; } } } Term { [ CompX[ C_xx[]*{d ux} + C_xy[]*{d uy} ] ];
{ Name sig_yy ; Value { Term { In Vol_Mec ; Jacobian Vol ; }
[ CompY [ C_yx[]*{d ux} + C_yy[]*{d uy} ] ]; }
In Vol_Elast_Mec ; Jacobian Vol ; } } } }
{ Name sig_xy ; Value {
Term { [ CompY[ C_xx[]*{d ux} + C_xy[]*{d uy} ] ];
In Vol_Mec ; Jacobian Vol ; }
}
}
{ Name sig_yy ; Value {
Term { [ CompY [ C_yx[]*{d ux} + C_yy[]*{d uy} ] ];
In Vol_Mec ; Jacobian Vol ; }
}
}
} }
} }
} }
PostOperation { PostOperation {
{ Name pos; NameOfPostProcessing Elast_u; { Name pos; NameOfPostProcessing Elast_u;
Operation { Operation {
If(FE_Degree == 1) If(FE_Degree == 1)
Print[ sig_xx, OnElementsOf Wrench, File "sigxx.pos" ]; Print[ sig_xx, OnElementsOf Wrench, File "sigxx.pos" ];
Print[ u, OnElementsOf Wrench, File "u.pos" ]; Print[ u, OnElementsOf Wrench, File "u.pos" ];
...@@ -356,7 +342,6 @@ PostOperation { ...@@ -356,7 +342,6 @@ PostOperation {
} }
} }
// Tell Gmsh which GetDP commands to execute when running the model. // Tell Gmsh which GetDP commands to execute when running the model.
DefineConstant[ DefineConstant[
R_ = {"Elast_u", Name "GetDP/1ResolutionChoices", Visible 0}, R_ = {"Elast_u", Name "GetDP/1ResolutionChoices", Visible 0},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment