You are on page 1of 38

Numerical Simulations with the

Finite Element Method


Mathem. Analysis and Computational
Practice, Lecture 13 & 14
Malte Braack
1
, Thomas Richter
2
1
Mathematical Seminar, Kiel University
2
Institute of Applied Mathematics, University of
Heidelberg
Universidad National de Trujillo, March 10-21, 2014
1 / 37
Convection-Diusion Equation in 1D
In intervall I = (0, 1) with diusion parameter > 0:
u

+ u

= f x I
u(0) = u
0
, u(1) = u
1
-0.1
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
0 0.2 0.4 0.6 0.8 1
epsilon=0.1
epsilon=0.05
epsilon=0.01
0
0.2
0.4
0.6
0.8
1
1.2
0 0.2 0.4 0.6 0.8 1
epsilon=0.1
epsilon=0.05
epsilon=0.01
Examples for 0.1, 0.05, 0.01 with f = 1 (left) and f = 0 (right).:
Boundary layers for 0
2 / 37
Exponential boundary layer
Exact solution for f = 1 and u
0
= u
1
= 0:
u(x) = x

1
(exp(x/) 1)
with = exp(1/).
0 x < 1 lim
0
u(x) = x: Hence for 0 a < 1:
lim
xa
lim
0
u(x) = a
lim
0
lim
xa
u(x) = a
But for a = 1:
lim
x1
lim
0
u(x) = 1
lim
0
lim
x1
u(x) = 0
A qualitative dierent behavour in x = 1. We call this a singular
perturbed problem.
3 / 37
Scaling of the derivatives
[[u[[
L

(I )
= 1 ,
[[u

[[
L

(I )
= sup
x(0,1)

1

(1 )
exp(x/)

1 +
exp(1/)
(1 )
1 +
2

,
[[u

[[
L

(I )
1 +
2

2
.
Upper bound for higher derivatives:
[[u
(k)
[[
L

(I )
C
k
, k 2 .
4 / 37
Central dierences for 1D convection-diusion
Central dierence quotient for 1. derivatives (of 2. order):
u

(x
i
)
1
2h
(u
i +1
u
i 1
) .
Central dierence quotient for 2. derivatives (of 2. order):
u

(x
i
)
1
h
2
(u
i +1
2u
i
+ u
i 1
) .
Linear system for approximate solution with U
0
= U
N
= 0:
_
_
_
_
_
_
_
_
_
a c
b
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
c
b a
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
U
1
.
.
.
.
.
.
U
N1
_
_
_
_
_
_
=
_
_
_
_
_
_
1
.
.
.
.
.
.
1
_
_
_
_
_
_
with a = 2/h
2
, and b = /h
2
1/(2h), and c = /h
2
+ 1/(2h).
5 / 37
Diagonal elements a are always positive
a =
2
h
2
> 0
O-diagonal elements b, c are negative for h < 2:
b =

h
2

1
2h
c
c =

h
2
+
1
2h
< 0
But for h > 2 we obtain positive o-diagonal elements:
c =

h
2
+
1
2h
> 0
No DMP !
6 / 37
Good and bad news for central dierences
Good news:
Formally of 2. order.
DMP if h < 2
Bad news:
No DMP if h 2
In many practical applications h < 2 in unfeasable, because often
10
8
10
5
.
The violation of a DMP leads to strong numerical artefacs:
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
0 0.2 0.4 0.6 0.8 1
eps=0.01, N=10
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
0 0.2 0.4 0.6 0.8 1
eps=0.01, N=20
-0.2
0
0.2
0.4
0.6
0.8
1
0 0.2 0.4 0.6 0.8 1
eps=0.01, N=40
= 0.01 and N = 10, 20, 40 (from left to right)
7 / 37
For << 2h, f = 0, U
0
= 0 and U
N
= 1:
1
2h
_
_
_
_
_
_
_
_
_
0 1
1
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1
1 0
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
U
1
.
.
.
.
.
.
U
N1
_
_
_
_
_
_
=
1
2h
_
_
_
_
_
_
0
.
.
.
.
.
.
1
_
_
_
_
_
_
+O()
This leads for odd N to
U
2
U
4
. . . 0 (even indices)
. . . U
N2
U
N
= 1 (odd indices)
Whereas the exact solution is
U(x
i
) =
q
i
h
1
q
N
h
1
.
with q
h
:= (2 + h)/(2 h)
8 / 37
Articial diusion
Idea: Ensure 2h by changing to a augmented diusion coecient:

h
:= max(2h, )
Use
h
instead of in the discrete equation.
0
0.2
0.4
0.6
0.8
1
0 0.2 0.4 0.6 0.8 1
eps=0.01, N=10
eps=0.01, N=20
eps=0.01, N=40
Drawback: Very diusive and only of 1. order.
9 / 37
Upwinding in 1D
Idea: Use one-sided dierence quotient for the rst derivatives instead of
a central dierence quotient:
u

(x
i
)
1
h
(U
i
U
i 1
)
Resulting linear system:
bU
i 1
+ aU
i
+ cU
i +1
= f
i
With positive diagonal elements a and negative o-diagonal elements
b, c:
a =
2
h
2
+
1
h
> 0
b =

h
2

1
h
< 0
c =

h
2
< 0
10 / 37
Upwinding in 1D (contd)
More general convection-diusion-reaction equation with varying
coecients:
u

+ bu

+ cu = f x I
The dierence quotient depends on the direction of the convective part:
u

(x
i
)
_
h
1
(U
i
U
i 1
) if b(x
i
) > 0
h
1
(U
i +1
U
i
) if b(x
i
) < 0
Leads to DMP in 1D.
11 / 37
Scalar convection-diusion problem
Convection-diusion problem:
u + ( )u u = f
u = 0 on
Variational formulation in V = H
1
0
():
u V : A(u, ) = f , V
with bilinear form:
A(u, ) := (u + ( )u, )

+ (u, )

Existence and uniqueness of solutions due to Lax-Milgram.


12 / 37
Existence and uniqueness for scalar convection-diusion
problem
Theorem
Let , L

() and > 0. If there exists a constant c


0
, s.t.

1
2
div c
0
> 0 a.e. in
the variational formulation features for each f L
2
() a unique solution
u H
1
0
().
Proof.
Continuity:
[A(u, )[ [[u[[[[[[ + [[u[[[[[[ +[[[[
L

()
[[u[[[[[[
C
,,
([[u[[ +[[u[[) ([[[[ +[[[[)
With Poincare inequality we obtain continuity.
13 / 37
Coercivity:
A(u, u) = (u + ( )u, u) + [[u[[
2
Reformulation of the convective part:
(( )u, u) = (u, u)
= (u, div (u)) +
_

u
2
n
= (u, div ()u) (u, ( )u)
Hence
(( )u, u) =
1
2
(u, u div )
(u + ( )u, u) = ((
1
2
), u
2
) c
0
[[u[[
2
Therefore, we get:
A(u, u) c
0
[[u[[
2
+ [[u[[
2
minc
0
, ([[u[[
2
+[[u[[
2
)
The conditions for Lax-Milgram are fullled.
14 / 37
Numerical schemes for convection-diusion-reaction
problems
Still challenging for dominating convection, i.e. [[[[ >> .
Apperance of interior and boundary layers, small subregions with
large gradients
Width of layers are often smaller than the mesh size.
Then, sucient resolution of sharp gradients are not possible.
Spurious nonphysical oszillations.
Extensive research in the last decades.
15 / 37
Standard Galerkin formulation
Standard Galerkin formulation: Seek u
h
V
h
s.t.
A(u
h
, ) = (f , )

V
h
A priori estimate in the norm
[[u[[

:=
_
[[u[[
2
+[[u[[
2
_
1/2
.
Theorem
Under the conditions of the previous Thm. and H
r +1
-regularity of the
solution u the P
r
(or Q
r
) FE solution of the CDR problem fullls the
following a priori estimate:
[[u u
h
[[

Ch
r
[u[
H
r +1
()
with C = C(, , , , ).
This is not satisfactory because e.g. for r = 1:
[[(u u
h
)[[
h

[u[
H
2
()
and lim
0
[u[
H
2
()
= .
16 / 37
Instabilities of the pure Galerkin formulation
Diusion coecent = 0.01, convection = (1, 1)
T
.
The Galerkin formulation stabilizes only on sucient ne meshes:
No DMP
if h >

2[[
= unphysical oscillations
Convergence for P
1
(or Q
1
) elements of pure Galerkin:
[[(u u
h
)[[
h

[u[
H
2
()
Galerkin formulation of rst order term is equivalent to central
dierence scheme.
17 / 37
Numerical diusion with FEM
Similar strategies are possible with FEM: Adding the term
(hu
h
, )

to the bilinear form A(, ).


Diusion in streamline direction only: Adding
(h( )u
h
, ( ))

Only 1. order !
Accuracy of 1. order methods can be worse than pure Galerkin (see
Brooks & Hughes)
18 / 37
Stabilized nite elements
19 / 37
Stabilized nite elements
Stabilized form:
u
h
V
h
: A(u
h
, ) + S
h
(u
h
, ) = F
h
, V
h
Such stabilization is called fully consistent, if the strong solution u
still fullls the discrete equation.
Pure Galerkin formulation for
S
h
(u
h
, ) = 0 and F
h
= F
Several choices are possible, e.g.
- SUPG: Streamline upwind Petrov Galerkin
- LPS: Local projection stabliization
- EOS: edge oriented stabilization / IP: interior penalty
20 / 37
Stabilized nite elements
Stabilized form:
u
h
V
h
: A(u
h
, ) + S
h
(u
h
, ) = F
h
, V
h
Such stabilization is called fully consistent, if the strong solution u
still fullls the discrete equation.
Pure Galerkin formulation for
S
h
(u
h
, ) = 0 and F
h
= F
Several choices are possible, e.g.
- SUPG: Streamline Upwind Petrov Galerkin
- LPS: Local projection stabliization
- EOS: edge oriented stabilization / IP: interior penalty
20 / 37
Idea of Streamline Upwind Petrov Galerkin (SUPG)
Add a diusion in term in direction of the streamlines, i.e.
(( )u
h
, ( ))
choose a clever weigthing s.t. a balance of sucient diusion and
accuracy is obtained:

TT
h

T
(( )u
h
, ( ))
T
Introduce further consistency terms:

TT
h

T
(u
h
+ ( )u
h
u
h
, ( ))
T
No additional diusion in crosswind direction.
21 / 37
SUPG for convection-diusion problems
Idea: Add a consisting term with diusion term in direction of the
ow:
S(u
h
, ) :=

TT
h
(u
h
+ ( )u
h
u
h
,
h
( ))
T
F
h
, := F, +

TT
h
(f ,
h
( ))
T
SUPG is fully consistent: The strong solution u fullls the discrete
equation.
The parameter
h
is mesh size dependent,
T
:=
h
[
T
.
Local Peclet number
Pe[
T
:=
h
T
[[[[
L

(T)

Pe[
T
> 1/2: convection dominated region

T
:=
h
T
[[[[
L

(T)
Pe[
T
1/2: diusion dominated region

T
:=
h
2
T

22 / 37
Coercivity of the SUPG stabilization form
For P
1
elements (u cell-wise bilinear):
S(u, u) =

TT
h
(u + ( )u u,
T
( )u)
T
=

TT
h
_

T
[[( )u[[
2
T
+ (u,
T
( )u)
T
_

TT
h
_

T
[[( )u[[
2
T
[[u[[
T

T
[[( )u[[
T
_

TT
h
_

T
[[( )u[[
2
T


T
2
[[u[[
2
T


T
2
[[( )u[[
2
T
_
=
1
2

TT
h

T
_
[[( )u[[
2
T
[[u[[
2
T
_
23 / 37
Coercivity of the SUPG bilinear form
For P
1
elements (u cell-wise bilinear):
A(u, u) + S(u, u) c[[u[[
2
+ [[u[[
2
+
1
2

TT
h

T
_
[[( )u[[
2
T
[[u[[
2
T
_
with
c

= [[(1
h
/2)
1
2
div [[
L

()
By Lax-Milgramm we obtain:
Theorem
Under the condition that
h
1 and
div a.e.
the SUPG formulation of the convection-diusion-reaction system with
P
1
elements has a unique discrete solution u
h
P
1
(T
h
).
24 / 37
A priori estimate for SUPG
[[[u[[[
h
:= [[u[[
2
+ [[u[[
2
+

TT
h

T
[[( )u[[
2
T
Theorem
Under the smoothness assumption u H
r +1
() it holds for P
r
-elements
[[[u u
h
[[[
h
C

TT
h
a
t
h
r
T
[u[
H
r +1
(T)
with a
T
:= ( + h
T
[[[[
L

(T)
+ h
T

1/2
)
1/2
.
25 / 37
Proof
Aim: Bound the discretization error by a multiple of
H
h
(u) :=

TT
h
a
t
h
r
T
[u[
H
r +1
(T)
Splitting the error in approximation error and projection error:
u u
h
= (u I
h
u) + (I
h
u u
h
)
The approximation error
h
= u I
h
u is properly bounded by
standard interpolation results:
[[[u
h
I
h
u[[[
h
CH
h
(u)
The projection error
h
:= I
h
u u
h
V
h
can be bounded by help of
the coercivity:

1
2
[[[
h
[[[
2
h
A(
h
,
h
) + S
h
(
h
,
h
)
Use Galerkin orthogonality:
A(u u
h
,
h
) + S
h
(u u
h
,
h
) F F
h
,
h
= 0
26 / 37

1
2
[[[
h
[[[
2
h
A(
h
,
h
) A(u u
h
,
h
)
+S
h
(
h
,
h
) S
h
(u u
h
,
h
) +F F
h
,
h

= A(I
h
u u,
h
) + S
h
(I
h
u u,
h
) +F F
h
,
h

Individual bounds
A(
h
,
h
) H
h
(u)[[[
h
[[[
h
S
h
(
h
,
h
) H
h
(u)[[[
h
[[[
h
F F
h
,
h
H
h
(u)[[[
h
[[[
h
e.g. for the Galerkin terms arising in A(
h
,
h
):
(
h
,
h
)
1/2
[[
h
[[[[[
h
[[[
h
(( )
h
,
h
) = (
h
, ( )
h
)

1/2
h
[[
h
[[[[[
h
[[[
h
(
h
,
h
)
1/2
[[
h
[[[[[
h
[[[
h
27 / 37
With a priori bounds on [[
h
[[, [[
h
[[:
A(
h
,
h
)
_

1/2
[[
h
[[ +
1/2
h
[[
h
[[ +
1/2
[[
h
[[
_
. .
(
1/2
h+
1/2
h
h+
1/2
)h
r
|u|
H
r +1
[[[
h
[[[
h
H
h
(u)[[[
h
[[[
h
The other terms S
h
(
h
,
h
) and F F
h
,
h
are bounded as well.
28 / 37
Eect of SUPG stabilization
Diusion = 0.01, convection = (1, 1)
T
.
The SUPG formulation stabilizes much earlier.
Over- and undershots still remain on coarse meshes:
Unphysical oszillations still are problematic (positivity of physical
quantities, shocks in compressible ows, deterioration of nonlinear
problems)
29 / 37
SOLD methods
Solutions with SUPG may still exhibit spurious oszillations.
SOLD = Spurious Oscillations at Layers Diminishing methods add
additional nonlinear diusion terms:
S
sold
(u
h
, ) := (

Du
h
, )
with projection onto the line or plane orthogonal to
D = I

[[
2
(if ,= 0)
and with cell-wise parameters: (Johnson)

= max0,
:=
sold
[[h
3/2
T
For large parameter
sold
high amount of nonlinearity.
non-consistent
Other wording: shock capturing, crosswind diusion
30 / 37
SOLD methods for higher order elements
Higher order SOLD methods must be residual based.
R
h
(u
h
) = u
h
+ ( )u
h
u
h
f
Consistent method for higher order:
:=
sold
[R
h
(u
h
)[
h
T
2[u
h
[
31 / 37
Discontinuous Galerkin
32 / 37
Discontinuous Galerkin (DG)
Continuous problem:
u V : A(u, ) = f , V
with
A(u, ) :=

TT
h
_
u + (b )u,
_
L
2
(T)
+
_
u,
_
L
2
(T)
.
So far: Continuous Galerkin:
V
(r )
h
=
_
u
h
C
0
(

) : u
h
[
T
P
r
T T
h
_
V
Idea: Use discontinuous test- and ansatz functions:
V
(r ),dg
h
:= u
h
L
2
() : u
h
[
T
P
r
T T
h

and enforce continuity weakly by adding jump terms to the bilinear


form.
33 / 37
Discontinuous Galerkin (DG)
Discrete bilinear form reads
A
h
(u, ) := A(u, ) + B
h
(u, ) .
with dg terms
B
h
(u, ) :=

eE
h
_
e
[b n[[u]
e

+
ds
+

eE
h
_
e

_
[u] n u n[]
_
+
e
[u][] ds .
Edge mean values:
v

(x) := lim
0
v(x n) , v :=
1
2
(v
+
+ v

) .
Edge jumps:
[v]
e
:= v
+
v

: Symmetric interior penalty (SIP)


+: Non-symmetric interior penalty(NIP)
34 / 37
Explanation of the additional terms
Penalization of the jumps

e
[u][]
with
e
= /h
e
(vanishes for u H
1
).
Upwind term for the convection
[b n[[u]
e

+
(vanishes for u H
1
).
Consistency terms due to partial integration of :
u n[]
Necessary to derive weak formulation with discontinuous .
Helps to obtain coercivity (NIP) or symmetry (SIP):
([u] n)
(vanishes for u H
1
).
35 / 37
Coercivity
We assume
d := inf
x
ess
_
(x)
1
2
div b(x)
_
c
0
> 0.
Hence, this is a norm on V + V
h
:
[[u[[
dG,h
:=
_
_
d[[u[[
2
L
2
()
+

eE
h
_
e
_
1
2
[b n[[u]
2
+
e
[u]
2
_
ds
_
_
1/2
Lemma
The NIP method is coercive on arbitrary triangulations:
A
h
(u, u) c[[u[[
2
dG,h
u V + V
h
.
The SIP is coercive on shape-uniform meshes and the choice
0
> 0
suciently large.
36 / 37
A priori estimate
Theorem
The NIP and the SIP method (on shape-uniform meshes) satisfy for
u H
2
() the following a priori estimate:
[[u u
h
[[
dG,h
C( + h)
1/2
h[[u[[
H
2
()
.
Advantages of DG:
Appropriate for convection dominated ow.
Possibility of p-adaptivity
Disadvantages of DG:
Many degrees of freedom without enhancement of accuracy.
Low order dg(1) still very diusive.
37 / 37

You might also like