19.06.2015 Views

Mechanical modelling with FEniCS - A wish list - FEniCS Project

Mechanical modelling with FEniCS - A wish list - FEniCS Project

Mechanical modelling with FEniCS - A wish list - FEniCS Project

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Mechanical</strong> <strong>modelling</strong> <strong>with</strong> <strong>FEniCS</strong><br />

A <strong>wish</strong> <strong>list</strong><br />

Garth N. Wells<br />

Faculty of Civil Engineering and Geosciences<br />

Delft University of Technology, The Netherlands<br />

<strong>FEniCS</strong> ’05, Chicago<br />

1 / 37<br />

Delft University of Technology


Outline<br />

Interests<br />

Example applications of <strong>FEniCS</strong> components<br />

Wish <strong>list</strong><br />

Issues<br />

2 / 37<br />

Delft University of Technology


Interests and motivation<br />

◮ Rapid development and efficient solution of mechanical<br />

models.<br />

◮ Minimal simplicity versus computational speed compromise.<br />

◮ Significant productivity increase.<br />

◮ Open source.<br />

3 / 37<br />

Delft University of Technology


Interest<br />

Licensing: GPL or LGPL?<br />

◮ GPL/LGPL protects me from my project sponsors.<br />

◮ GPL might be too strong for some project sponsors.<br />

4 / 37<br />

Delft University of Technology


Problem hallmarks<br />

◮ Nonlinear.<br />

◮ Multiple fields.<br />

5 / 37<br />

Delft University of Technology


Porous media<br />

Classical Biot theory + Darcy flow<br />

p 2<br />

p 1<br />

PSfrag replacements<br />

<strong>Mechanical</strong> swelling due to fluid penetration<br />

6 / 37<br />

Delft University of Technology


Porous media<br />

PU = FiniteElement("Vector Lagrange", "triangle", 2)<br />

PP = FiniteElement("Lagrange", "triangle", 1)<br />

ME = PU + PP<br />

(v, q) = BasisFunctions(ME) # test functions<br />

(u, p) = BasisFunctions(ME) # trial functions<br />

.<br />

.<br />

# Bilinear and linear form for solid component<br />

aSolid = dt*theta*dot(grad(v), stress(symgrad(u), p, mu, . . .<br />

LSolidInt = dt*theta*dot(grad(v), stress(symgrad(u0), p0, mu, . . .<br />

LSolidExt = dt*theta*v[1]*(rho*g)*dx<br />

# Bilinear and linear form for fluid component<br />

aFluid = q*comp*p*dx + q*alpha*Sw*div(u)*dx + . . .<br />

LFluidInt = dt*theta*q*comp*pr*dx + dt*theta*q*alpha*Sw* . . .<br />

LFluidExt = dt*theta*q*f*dx + dt*theta*perm*rhow*q.dx(1)*g*dx<br />

8 / 37<br />

Delft University of Technology


<strong>Mechanical</strong>ly-driven diffusion in elastic solids<br />

<strong>with</strong> Luisa Molari, University of Bologna<br />

<strong>Mechanical</strong> response<br />

∇ · σ + f = 0<br />

σ = C : ∇ s u − βIc<br />

+ B.C.<br />

Steady-state diffusion<br />

∇ · q = 0<br />

q = −κ∇c + M∇ (∇ · u)<br />

+ B.C.<br />

9 / 37<br />

Delft University of Technology


<strong>Mechanical</strong>ly-driven diffusion in elastic solids<br />

Find u h ∈ V h , e h ∈ S h , c h ∈ X h such that:<br />

(∇w h , C : ∇ s u h) (∇w − h , βIc h) ( )<br />

= w h , f<br />

Ω Ω<br />

∀ w h ∈ V h ,<br />

(v h , e h) Ω − (<br />

v h , ∇ · u h) Ω = 0 ∀ v h ∈ S h ,<br />

(∇q h , κ∇c h) Ω − (<br />

∇v h , M∇e h) Ω = 0 ∀ qh ∈ X h .<br />

10 / 37<br />

Delft University of Technology


<strong>Mechanical</strong>ly-driven diffusion in elastic solids<br />

E1 = FiniteElement("Vector Lagrange", "tetrahedron", 2)<br />

E2 = FiniteElement("Lagrange", "tetrahedron", 1)<br />

E3 = FiniteElement("Lagrange", "tetrahedron", 1)<br />

element = E1 + E2 + E3<br />

.<br />

.<br />

# Elasticity<br />

au = . . .<br />

# Divergence of u<br />

ae = . . .<br />

# Diffusion<br />

ac = . . .<br />

.<br />

.<br />

12 / 37<br />

Delft University of Technology


<strong>Mechanical</strong>ly-driven diffusion in elastic solids<br />

dilation<br />

13 / 37<br />

Delft University of Technology


<strong>Mechanical</strong>ly-driven diffusion in elastic solids<br />

concentration<br />

14 / 37<br />

Delft University of Technology


Cahn-Hilliard equation<br />

Model for phase separation<br />

◮ Important in material science and other fields.<br />

◮ Diffuse interface model.<br />

◮ Fourth-order in space nonlinear parabolic equation.<br />

ċ = ∇ · M (c) ∇ ( µ c (c) − λ∇ 2 c )<br />

in Ω<br />

Mλ∇c · n = 0 on ∂Ω<br />

M∇ ( µ c − λ∇ 2 c ) · n = 0 on ∂Ω<br />

◮ c: concentration 0 < c < 1<br />

◮ M: mobility<br />

◮ µc : chemical potential (= dΨ c /dc)<br />

◮ λ: surface energy term<br />

15 / 37<br />

Delft University of Technology


Cahn-Hilliard equation<br />

Chemical free-energy Ψ c<br />

0.06<br />

0.04<br />

0.02<br />

c<br />

Ψ<br />

0<br />

Surface free-energy Ψ s<br />

−0.02<br />

−0.04<br />

−0.06<br />

0 0.2 0.4 0.6 0.8 1<br />

c<br />

Ψ s = 1 2 λ∇c : ∇c 16 / 37<br />

Delft University of Technology


Cahn-Hilliard equation<br />

Mixed formulation:<br />

ċ = ∇ · (M ∇ (µ c − κ)) ,<br />

κ = λ∇ 2 c.<br />

Find c h ∈ S h × [0, T ] and κ h ∈ P h such that<br />

(w h , ċ h) ( (<br />

+ ∇w h , M h ∇ µ h c − κh)) = 0 ∀w h ∈ V h ,<br />

Ω Ω<br />

(v h , κ h) Ω + (<br />

∇v h , λ∇c h) Ω = 0 ∀v h ∈ Q h ,<br />

(<br />

( )<br />

w h , c (x, 0)<br />

)Ω = w h , c 0 (x)<br />

Ω<br />

∀w h ∈ V h .<br />

17 / 37<br />

Delft University of Technology


Cahn-Hilliard equation<br />

Benchmark<br />

1<br />

0.8<br />

c 1 = 0.71<br />

0.2<br />

1<br />

0.6<br />

0.4<br />

0.2<br />

0<br />

acements<br />

c 2 = 0.69<br />

0.2<br />

1<br />

18 / 37<br />

Delft University of Technology


Cahn-Hilliard equation<br />

Randomly perturbed initial conditions.<br />

concentration<br />

1<br />

0.9<br />

0.8<br />

0.7<br />

0.6<br />

0.5<br />

0.4<br />

0.3<br />

0.2<br />

0.1<br />

0<br />

Initial condition c = 0.63 + small random fluctuation.<br />

19 / 37<br />

Delft University of Technology


Cahn-Hilliard equation<br />

concentration<br />

0.9882<br />

0.9059<br />

0.8235<br />

0.7412<br />

0.6588<br />

0.5765<br />

0.4941<br />

0.4118<br />

0.3294<br />

0.2471<br />

0.1647<br />

0.0824<br />

0.0000<br />

concentration<br />

0.9882<br />

0.9059<br />

0.8235<br />

0.7412<br />

0.6588<br />

0.5765<br />

0.4941<br />

0.4118<br />

0.3294<br />

0.2471<br />

0.1647<br />

0.0824<br />

0.0000<br />

low surface energy<br />

higher surface energy<br />

20 / 37<br />

Delft University of Technology


Cahn-Hilliard equation<br />

C<br />

0.9882<br />

0.9059<br />

0.8235<br />

0.7412<br />

0.6588<br />

0.5765<br />

0.4941<br />

0.4118<br />

0.3294<br />

0.2471<br />

0.1647<br />

0.0824<br />

0.0000<br />

. . . even higher surface energy<br />

21 / 37<br />

Delft University of Technology


Cahn-Hilliard equation<br />

22 / 37<br />

Delft University of Technology


Cahn-Hilliard equation<br />

3D plane<br />

DOLFIN<br />

23 / 37<br />

Delft University of Technology


Cahn-Hilliard equation<br />

Problem: cannot find an iterative solver that works.<br />

24 / 37<br />

Delft University of Technology


Cahn-Hilliard primal formulation<br />

Find c h ∈ V h × [0, T ] such that<br />

(w h , ċ h) (<br />

(<br />

+ ∇w h , M h ∇µ h c<br />

Ω<br />

)Ω + ∇ 2 w h , M h λ∇ 2 c h) ˜Ω<br />

(<br />

+<br />

(∇w h , ∇M h λ∇ 2 c h)˜Ω − ∇w h 〈<br />

, M h λ∇ 2 c h〉)˜Γ<br />

(〈<br />

− M h λ∇ 2 w h〉 (<br />

,<br />

∇c h)˜Γ − ∇w h · n, M h λ∇ 2 c h) Γ<br />

(<br />

(<br />

)<br />

− M h λ∇ 2 w h , ∇c h · n<br />

)Γ + β∇w h · n, ∇c h · n<br />

Γ<br />

( <br />

+ β ∇w h <br />

, ∇c h)˜Γ = 0 ∀ w h ∈ V h 25 / 37<br />

Delft University of Technology


Modelling discontinuities<br />

Approach:<br />

u h = ū h + H s ũ h Γ s<br />

PSfrag replacements<br />

H s = 0<br />

H1<br />

s = 1<br />

n<br />

Discontinuity surface evolves.<br />

26 / 37<br />

Delft University of Technology


Modelling discontinuities<br />

Exploit partition of unity property (Melenk & Babuska, Duarte &<br />

Oden, Belytschko & Black)<br />

n∑ m∑<br />

u h = φ i a i +<br />

i=1 j=1<br />

H s φ j b i<br />

27 / 37<br />

Delft University of Technology


Crack propagation<br />

28 / 37<br />

Delft University of Technology


Delamination<br />

29 / 37<br />

Delft University of Technology


Delamination<br />

30 / 37<br />

Delft University of Technology


Crack propagation<br />

Requirements<br />

◮ Abstract evolving surface representation.<br />

◮ Integration on an evolving surface.<br />

Find . . .<br />

(∇ ¯w h , C : ∇ s ( ū h + H s ũ h)) Ω + (<br />

( (<br />

+ ˜w h , t ũ h)) (<br />

= w h , f<br />

Γ s<br />

( ∇ ˜w h , C : ∇ s ū h + H s ũ h)) Ω<br />

)<br />

+<br />

Ω<br />

∀ ¯w h ∈ ¯V h , ˜w h ∈ Ṽ h 31 / 37<br />

Delft University of Technology


General <strong>wish</strong>es (FFC)<br />

◮ Complex numbers.<br />

◮ Inter-element boundary integrals.<br />

◮ Simple polar coordinates.<br />

32 / 37<br />

Delft University of Technology


Compact notation for nonlinear problems<br />

◮ Variational problem compact.<br />

◮ Linearised and time-dependent form very large (decrease in<br />

readability).<br />

33 / 37<br />

Delft University of Technology


Issues<br />

◮ Students<br />

◮ Loss of transparency.<br />

◮ Don’t develop skills to implement models going beyond the<br />

current capabilities of FIAT/FFC/DOLFIN.<br />

◮ Penetration<br />

◮ Level of abstraction too high for old-style FE users.<br />

◮ Quadrilateral and brick elements.<br />

◮ Developers ready for users?<br />

◮ Preparedness/time to help novice users <strong>with</strong> trivial questions?<br />

◮ 0800-Anders-and-JohanJansson-help-desk (24 hour).<br />

34 / 37<br />

Delft University of Technology


DOLFIN needs . . .<br />

Most important aspect for dragging people over the threshold:<br />

simple, accessible demos <strong>with</strong> immediate postprocessing.<br />

Solver demos to key mechanical problems:<br />

◮ Linear-elasticity.<br />

◮ Classical plasticity.<br />

◮ Advection-diffusion.<br />

◮ Stokes flow / incompressible elasticity.<br />

◮ Incompressible Navier-Stokes.<br />

‘Extras’ section outside of DOLFIN src tree.<br />

35 / 37<br />

Delft University of Technology


Packaging and distribution<br />

◮ Bloat in number of required components.<br />

◮ Version dependencies becoming an issue.<br />

◮ Bundle components?<br />

36 / 37<br />

Delft University of Technology


Supporting <strong>FEniCS</strong><br />

Details<br />

◮ Sufficient financial structure to make contributions possible.<br />

How to spend it?<br />

◮ Meetings<br />

◮ Hardware, network<br />

◮ ???<br />

37 / 37<br />

Delft University of Technology

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!