Geilo Winter School 2012
Lecture 6: Static hyperelasticity in FEniCS
Anders Logg
1/8
Course outline
Sunday
L1 Introduction to FEM
Monday
L2 Fundamentals of continuum mechanics (I)
L3 Fundamentals of continuum mechanics (II)
L4 Introduction to FEniCS
Tuesday
L5 Solid mechanics
L6 Static hyperelasticity in FEniCS
L7 Dynamic hyperelasticity in FEniCS
Wednesday
L8 Fluid mechanics
L9 Navier–Stokes in FEniCS
2/8
Static hyperelasticity
− div P = B in Ω
u=g on ΓD
P ·n=T on ΓN
• u is the displacement
• P = P (u) is the first Piola–Kirchoff stress tensor
• B is a given body force per unit volume
• g is a given boundary displacement
• T is a given boundary traction
3/8
Variational problem
Multiply by a test function v ∈ V̂ and integrate by parts:
Z Z Z
− div P · v dx = P : grad v dx − (P · n) · v ds
Ω Ω ∂Ω
Note that v = 0 on ΓD and P · n = T on ΓN
Find u ∈ V such that
Z Z Z
P : grad v dx = B · v dx + T · v ds
Ω Ω ΓN
for all v ∈ V̂
4/8
Stress–strain relations
• F = I + grad u is the deformation gradient
• C = F > F is the right Cauchy–Green tensor
• E = 21 (C − I) is the Green–Lagrange strain tensor
• W = W (E) is the strain energy density
∂W
• Sij = ∂E
ij
is the second Piola–Kirchoff stress tensor
• P = F S is the first Piola–Kirchoff stress tensor
St. Venant–Kirchoff strain energy function:
λ
W (E) = (tr(E))2 + µ tr(E 2 )
2
5/8
Useful FEniCS tools (I)
Defining subdomains/boundaries:
class MyBoundary ( SubDomain ) :
def inside ( self , x , on_boundary ) :
return on_boundary and \
x [ 0 ] > 1 . 0 - DOLFIN_EPS
Marking boundaries:
my_boundary_1 = MyBoundary1 ()
my_boundary_2 = MyBoundary2 ()
boundaries = FacetFunction ( " uint " , mesh )
boundaries . set_all ( 0 )
my_boundary_1 . mark ( boundaries , 1 )
my_boundary_2 . mark ( boundaries , 2 )
ds = ds [ boundaries ]
a = ... * ds ( 0 ) + ... * ds ( 1 ) + ... * ds ( 2 )
6/8
Useful FEniCS tools (II)
Computing derivatives of expressions:
E = variable (...)
W = ...
S = diff (W , E )
Computing derivatives of forms (linearization):
u = Function ( V )
du = TrialFunction ( V )
F = ... u ... * dx
J = derivative (F , u , du )
Solving nonlinear variational problems:
solve ( F = = 0 , u , bcs )
solve ( F = = 0 , u , bcs , J = J )
7/8
The FEniCS challenge!
Compute the deflection of a regular 10 × 2 LEGO brick. Use
the St. Venant–Kirchhoff model and assume that the LEGO
brick is made of PVC plastic. The LEGO brick is subject to
gravity of size g = −9.81 m/s2 and a downward traction of size
5000 N/m2 at its end point.
g = −9.81m/s2
T = 5000 N/m2
To check your solution, compute the average value of the
displacement in the z-direction.
The student(s) who first produce the right anwswer will be
rewarded with an exclusive FEniCS coffee mug!
8/8