Elmer
CSC – Tieteen tietotekniikan keskus Oy CSC – IT Center for Science Ltd.
Introduction into Elmer multi-physics FEM package
Thomas Zwinger
Contents• Elmer – Background
– History
– users, community
– contacts and links
• FEM formulation
– Weak form
– Test and weight functions
– Standard Galerkin• Elmer – Features
– Implemented models
– parallel computations
• Elmer – Modules
– Package modules
– Workflow
– Standard Galerkin
– Stabilization
• Something on numerics
– Elements
– Pre-conditioners and Solvers
Elmer - Background• Solution of partial differential equations by
FEM (Finite Element Method)
• Elmer development was started in 1995 as part of a national CFD program, also part of a national CFD program, also funded by Tekes (Finnish technol. agency)
• After the initial phase the development has been driven by applications (MEMS, Glaciology, medical application, …)
Elmer – Background ctd.• In September 2005 Elmer was published
under GNU Public Licence
• Goals of the open source publication:
– Expand the Elmer community– Expand the Elmer community
– New resources for code development
– Improved verification process
– Free software good adverticiment for CSC
• Roughly 300000 lines of code!
– IP stays with CSC
Elmer – BackgroundUse the force!
– elmerfem.org
• Wiki, Forum
– www.csc.fi/elmer– www.csc.fi/elmer
• Main Elmer page
– sourceforge.net
• Main distribution channel
– www.nic.funet.fi
• Manuals and binaries
Elmer - Features• Fluid Mechanics: RANS, VMS,
Reynolds, free surfaces
• Structural Mechanics: non-/linear elasticity, plates/
• Heat Transfer: phase change
• Electro-Magnetics
• Accoustics: Helmholtz equation
• Quantum Chemistry: DFT
Elmer – Features parallel
Scaling of wall clock time with dofs in the cavity lid case using GMRES+ILU0. Simulation Juha Ruokolainen, CSC, visualization Matti Gröhn, CSC .
Parallel Runs: using MPI; interfaces to external libraries: Hypre, MUMPS, Pardiso, SuperLU
Elmer - Modules
Pre-processing
• Generating geometry• Meshing the geomtry• Determining the physical and numerical simulation parameter
• Launching the simulation
Solution• Numbercrunching• Monitoring of convergence
Post-processing
• Visualization of results (3D, 4D)• Data output
FEM formulation
• Saddle point problem:
• S is not positive definite ↔ no minimization problem
• Usual way of solution: X= S-1F
– BUT: is S-1 ”well behaving”?
FEM formulation• Condition for stability:
– Depends on the space of the test-functions– Depends on the space of the test-functions
– Bad news: standard Galerkin + Stokes
= not stable
– Stabilization. Methods in Elmer:
1. Residual square methods
2. Residual free bubbles
FEM formulation
• Residual square method
= Stabilized Finite Elements
– Simplified example:
– Weak formulation (energy minimization):– Weak formulation (energy minimization):
– Adding (element-wise) residual of equation:
FEM formulation
• Residual free bubbles:
– Additional degrees of freedom
– Locally on elements
– Adding to the orginal system (condensation)– Adding to the orginal system (condensation)
equivalent to RSM
Something on numerics
• General advection-diffusion problem
– For instance, heat transfer problem:
– Coupled to (Navier-)Stokes via velocity: u
– Non-linearities via material parameters, e.g.,
Something on numerics• Weak formulation:
– Time integration
– Steady State:dependence on other variables
– Non-linear iteration: internal dependence
Something on numerics• Time integration – two different methods:
– Crank – Nicholson: Crank – Nicholson
– Backward Difference Formula: BDF
• BDF Order (if 1, then backward Euler – only • BDF Order (if 1, then backward Euler – only choice for adaptive time-stepping)
• Additional settings:– Time Derivative Order (if 2 then Bossak)
– Timestep Intervals
– Timestep Sizes
Something on numerics• Steady State Problem
– Mutual dependence between two segregated Solvers (e.g., Flow solution and convected temperature)
– Steady State Convergence Tolerance
– Steady State Max Iterations
– Steady State Relaxation Factor
Something on numerics• Nonlinear Problem:
– Nonlinear System Convergence Tolerance
– Nonlinear System Max Iterations
– Nonlinear System Relaxation Factor
Something on Numerics
• Solving the Linear(ized) Problem
• Keyword:Linear System Iterative Method
• 3 ways to do that in Elmer:1. Direct methods (= inversion of A)
2. Iterative methods (=working with approximations to A)
3. Multi-grid methods (not discussed here)
Something on numerics
• But, before we solve, we usually apply a pre-conditioner– Find P~A, but much easier to invert
– P-1A ~ I has favourable condition number– P-1A ~ I has favourable condition number
Linear System Preconditioning
• None
• Diagonal
• ILU n (n=0,1,2,...) and ILUT
Something on numerics
• Direct linear system solver
• Keyword: Linear System Direct Method
• Banded (default) LAPack
• UMFPACKUnsymmetric MultiFrontal method (only serial)
• MUMPSUnsymmetric MultiFrontal method (only parallel)
– Sometimes the only way to go (if bad conditioned)
– Costly: Elimination takes ~N3 operations and needs to store N2 unknows in memory