Upload
phamphuc
View
279
Download
5
Embed Size (px)
Citation preview
(Galerkin) Finite element approximations
The finite element method (FEM): special choice for the shape functions φ˜
.
x = a x = b
Ω4
Ne = 5
Ω2 Ω3 Ω5Ω1
Subdivide Ω into elements Ωe:
Ω =Ne⋃e=1
Ωe
Ωe1 ∩ Ωe2 = ∅
Approximate u on each element separately by a polynomial of some degree p, forexample by Lagrangian interpolation (using p+ 1 nodal points per element). Theend points of an element must be nodal points.
Example: linear elements
Global shape functions:
x3 x4 x5x1 = a x6 = bx2
Ω4
Ne = 5
Ω2 Ω3 Ω5Ω1
φ3(x)1 uh(x) =
n∑i=1
uiφi(x) = φ˜
T (x)u˜
n: number of global nodal points.
Local element shape functions:
xe1 xe
2 xe1 xe
2
1
φ2(x)φ1(x)
1
ueh(x) = ue1φ1(x)+ue2φ2(x) = φ˜
T (x)u˜e
with φ˜
T = [φ1(x), φ2(x)] and
φ1(x) =x− xe2xe1 − xe2
, φ2(x) =x− xe1xe2 − xe1
Example: quadratic elements
Local element shape functions:
φ1(x) φ2(x) φ3(x)
1
xe1 xe
3xe2 xe
1 xe3 xe
1 xe2 xe
3
1 1
xe2
ueh(x) = ue1φ1(x) + ue2φ2(x) = φ˜
T (x)u˜e
with φ˜
T = [φ1(x), φ2(x), φ3(x)] and
φ1(x) =(x− xe2)(x− xe3)
(xe1 − xe2)(xe1 − xe3), φ2(x) =
(x− xe1)(x− xe3)(xe2 − xe1)(xe2 − xe3)
,
φ3(x) =(x− xe1)(x− xe2)
(xe3 − xe1)(xe3 − xe2)
Example: higher-order elements
General polynomials of order p:
ueh(x) =p+1∑i=1
ueiφi(x) = φ˜
T (x)u˜e
with φ˜
T = [φ1, φ2, . . . , φp+1].
Various expansions possible:
B Gauss-Lobatto integration points (includes end points) and Lagrangianinterpolation (Spectral elements).
B Hierarchical base functions: end points are nodes but internal shape functionshave no nodes (similar to Legrende polynomials). (hp-FEM).
B Legrendre polynomials in discontinuous Galerkin methods.
Global numbering
Ω1 Ω2 Ω3
x3x2x1 = a x4 = b
u1
u3
u4
u2
Ne = 3 uh(x)
Ω1
1
Ω2 Ω3
φ3(x)Ne = 3
x3x2x1 = a x4 = b
uh(x) =4∑i=1
uiφi(x) = φ˜
T (x)u˜
u˜
=
u1
u2
u3
u4
, φ˜(x) =
φ1(x)φ2(x)φ3(x)φ4(x)
Local numbering in elements
Weak form: Find uh in Sh such that
(dvhdx
,Aduhdx
) + vh(b)hb = (vh, f) for all vh ∈ Vh
Split:Ne∑e=1
(dvhdx
,Aduhdx
) + vh(b)hb =Ne∑e=1
(vh, f) for all vh ∈ Vh
Write in each element e:
ueh(x) =2∑i=1
ueiφi(x) = φ˜
T (x)u˜e, veh(x) =
2∑i=1
veiφi(x) = φ˜
T (x)v˜e
where u˜Te = (ue1, u
e2) and φ
˜
T (x) = (φ1(x), φ2(x)).
Element matrix and vector
We get:Ne∑e=1
(v˜TeK
¯eu˜e) + vnhb =
Ne∑e=1
v˜Te f
˜e
where
K¯e =
(dφ˜dx,Adφ
˜
T
dx
)e
=∫
Ωe
dφ˜dxAdφ
˜
T
dxdx
f˜e = (φ
˜, f)e =
∫Ωe
φ˜f dx
are the element matrix K¯e and element vector f
˜e.
Local → global (assembling)
The local vectors u˜e and v
˜e are part of the global vectors:
u˜e = P
¯eu˜, v
˜e = P
¯ev˜,
So we get
Ne∑e=1
v˜TeK
¯eu˜e =
Ne∑e=1
v˜T P
¯TeK
¯eP
¯e︸ ︷︷ ︸
K¯e
u˜
= v˜T( Ne∑e=1
K¯e
)u˜
Ne∑e=1
v˜Te f
˜e =
Ne∑e=1
v˜T P
¯Te f
˜e︸ ︷︷ ︸
f˜e
= v˜T( Ne∑e=1
f˜e
)
Weak form
Substitution into the weak form:
v˜TK
¯u˜
= v˜Tf
˜for all v
˜
orK¯u˜
= f˜with
K¯
=Ne∑e=1
K¯e
f˜
=Ne∑e=1
f˜e
+
00...0−hb
Example (1)
For example:
u˜
2 =(u2
u3
)=(
0 1 0 00 0 1 0
)︸ ︷︷ ︸
P¯
2
u1
u2
u3
u4
= P¯
2u˜
K¯
2 = P¯T2K
¯2P
¯2 =
0 01 00 10 0
(K211 K2
12
K221 K2
22
)(0 1 0 00 0 1 0
)
=
0 0 0 00 K2
11 K212 0
0 K221 K2
22 00 0 0 0
Example (2)
Assembly of K¯
:
K¯
=
K1
11 K112 0 0
K121 K1
22 0 00 0 0 00 0 0 0
+
0 0 0 00 K2
11 K212 0
0 K221 K2
22 00 0 0 0
+
0 0 0 00 0 0 00 0 K3
11 K312
0 0 K321 K3
22
=
K1
11 K112 0 0
K121 K1
22 +K211 K2
12 00 K2
21 K222 +K3
11 K312
0 0 K321 K3
22
Similar for assembly of f
˜.
Exercise 5
The ‘bandwidth’ of K¯
for linear shape functions is 3. How large is the bandwidthfor K
¯when using polynomial shape functions of order k, k ≥ 1?
Dirichlet conditions
Renumber and split vector and matrix (‘u’ unknown, ‘p’ prescribed)
u˜
=(u˜u
u˜p
), v
˜=(v˜u
v˜p
), K
¯=(K¯uu K
¯up
K¯pu K
¯pp
), f
˜=(f˜u
f˜p
)Note: u
˜p prescribed values, v
˜p = 0
˜. Weak form
v˜TK
¯u˜
= v˜Tf
˜for all v
˜
with v˜p = 0
˜leads to
v˜Tu (K
¯uuu
˜u +K
¯upu
˜p) = v
˜Tuf
˜u for all v
˜u
orK¯uuu
˜u = f
˜u −K
¯upu
˜p
1D convection-diffusion-reaction equation
1D convection-diffusion-reaction Eq.: find u(x) such that for x ∈ (a, b)
∂u
∂t+ a
∂u
∂x− ∂
∂x(A∂u
∂x) + bu = f
and
u = ua(t), at x = a, t > 0 (ΓD)
−Adudx
= hb(t) at x = b, t > 0 (ΓN)
Notes:
B Strong form; Classical (strong) solution u(x, t)B f(x, t) ∈ C0(a, b) (continuous) then u ∈ C2(a, b) (twice continuously
differentiable)
Oldroyd-B/UCM viscoelastic model
λ5τ +τ = 2ηD
where5τ= τ −L · τ − τ ·LT
or∂τ
∂t︸︷︷︸∂u∂t
+ ~u · ∇τ︸ ︷︷ ︸a∂u∂x
−L · τ − τ ·LT +τ
λ︸ ︷︷ ︸bu
= 2η
λD︸ ︷︷ ︸f
Diffusion is missing (A = 0).
Dimensionless form (1)
Scaling:
t = tct∗ tc : characteristic time
u = Uu∗ U : characteristic value solution
x = Lx∗ L : characteristic length scale
Dimensionless variables: O(1).
U
tc
∂u∗
∂t∗+aU
L
∂u∗
∂x∗− AUL2
∂2u∗
∂x∗2+ bUu∗ = f
Relative to convection:
L
atc
∂u∗
∂t∗+∂u∗
∂x∗− 1
Pe∂2u∗
∂x∗2+bL
au∗ =
L
aUf
Pe =aL
A: Peclet number, convection/diffusion.
Dimensionless form (2)
Time scales:
B convection:L
a
B diffusion:L2
A
B source:1b
(’relaxation time’)
B time scales in b.c.
B externally or internally generated frequencies (’von Karman vortex’)
We choose tc = L/a (convection) and get
∂u∗
∂t∗+∂u∗
∂x∗− 1
Pe∂2u∗
∂x∗2+ b∗u∗ = f∗
with b∗ =bL
aand f∗ =
L
aUf . Pe > 1 : convection dominated
Exercise 6
Assume b = 0 and f = 0. We take for the typical time scale tc =L2
A(diffusion
time scale). Show that we now have the non-dimensional form
∂u∗
∂t∗+ Pe
∂u∗
∂x∗− ∂
2u∗
∂x∗2= 0
When will this non-dimensional form be preferable over the one on the previousslide?
Steady state 1D convection-diffusion-reaction equation
steady state: ∂u/∂t = 0
L(u) = adu
dx− d
dx(Adu
dx) + bu = f
L: linear operator, with b.c.
u = ua, at x = a (ΓD)
−Adudx
= hb at x = b (ΓN)
Weak form
Multiply with test function v and integrate:
(v,Lu− f) = 0 for all v
Partial integration of the diffusion term and inserting b.c. we get: Find u ∈ Ssuch that
(dv
dx,Adu
dx) + (v, a
du
dx) + (v, bu) + v(b)hb = (v, f) for all v ∈ V
where S and V are appropriate spaces.
Galerkin FEM approximations (1)
Approximation spaces Sh and Vh:
uh(x) =n∑i=1
uiφi(x) = φ˜
T (x)u˜
vh(x) =n∑i=1
viφi(x) = φ˜
T (x)v˜
where φ˜(x) are global shape functions. Substituting this into the weak form gives:
Find uh ∈ Sh such that
(dvhdx
,Aduhdx
) + (vh, aduhdx
) + (vh, buh) + vh(b)hb = (vh, f) for all vh ∈ Vh
orv˜TK
¯u˜
= v˜Tf
˜for all v
˜
Galerkin FEM approximations (2)
and thusK¯u˜
= f˜
with
K¯
= (dφ
˜dx,Adφ
˜
T
dx) or Kij = (
dφidx
,Adφjdx
)
+ (φ˜, adφ
˜
T
dx) + (φi, a
dφjdx
)
+ (φ˜, bφ
˜
T ) + (φi, bφj)
f˜
= (φ˜, f)− hbφ
˜(b) fi = (φi, f)− hbφi(b)
Galerkin FEM approximations (3)
Build from element matrices. For example with constant coefficients and linearelement shape functions:
(dφ
˜dx,dφ
˜
T
dx)e =
1h
(1 −1−1 1
)“stiffness matrix”
(φ˜,dφ
˜
T
dx)e =
12
(−1 1−1 1
)“convection matrix”
(φ˜, φ
˜
T )e =h
6
(2 11 2
)“mass matrix”
where h is the element length.
Global stiffness matrix
Global stiffness matrix (uniform element size):
1h
1 −1 0 . . . . . . . . . . . . . 0−1 2 −1 0 . . . . . . . . 00 −1 2 −1 0 . . . 0... ...... ...... ...0 . . . 0 −1 2 −1 00 . . . . . . . . 0 −1 2 −10 . . . . . . . . . . . . . 0 −1 1
Finite difference scheme: (divide by h)
−ui−1 + 2ui − ui+1
h2= −d
2u
dx2(xi) +O(h2)
Global convection matrix
Global convection matrix (uniform element size):
12
−1 1 0 . . . . . . . . . . . . . 0−1 0 1 0 . . . . . . . . 00 −1 0 1 0 . . . 0... ...... ...... ...0 . . . 0 −1 0 1 00 . . . . . . 0 −1 0 10 . . . . . . . . . . . 0 −1 1
Finite difference scheme: (divide by h)
−ui−1 + ui+1
2h=du
dx(xi) +O(h2)
Global mass matrix
Global mass matrix (uniform element size):
h
6
2 1 0 . . . . . . . . . 01 4 1 0 . . . . . . 00 1 4 1 0 . . . 0... ...... ...... ...0 . . . 0 1 4 1 00 . . . . . . 0 1 4 10 . . . . . . . . . 0 1 2
Finite difference scheme: (divide by h)
ui−1 + 4ui + ui+1
6= u(xi) +O(h2)
Global right-hand side
Sometimes the following approximation is applied:
f(x) ≈∑k
fkφk(x) fk : nodal point values of f
In that case:fi = (φi, f) =
∑k
(φi, φk)fk
with (φi, φk) the mass matrix.Finite difference scheme: (divide by h)
fi−1 + 4fi + fi+1
6= f(xi) +O(h2)
Note that the usual approach is to use numerical integration.
Exercise 7
a. Verify the element stiffness, convection and mass matrix by performing theintegrations.
b. Assume a non-equidistant grid and denote the element sizes by h1, h2,. . . ,hNe.How does the global stiffness matrix now look like? Has the global convectionmatrix still a zero on the diagonal?
Example: 1D steady convection-diffusion (1)
Equation:du
dx− 1
Ped2u
dx2= 0 on (0, 1)
with b.c.u(0) = 0, u(1) = 1
Exact solution:
u(x) =1− exp(Pex)1− exp(Pe)
Example: 1D steady convection-diffusion (2)
Ne = 10; Pe = 1, 10, 100.
-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
u(x)
x
Pe=1 exactPe=1 GFEMPe=10 exactPe=10 GFEMPe=100 exactPe=100 GFEM
Example: 1D steady convection-diffusion (2)
Ne = 10, 20; Pe = 25
-0.2
0
0.2
0.4
0.6
0.8
1
0 0.2 0.4 0.6 0.8 1
u(x)
x
Pe=25 exactPe=25 Ne=10Pe=25 Ne=20
Observations (1)
B Boundary layer of width1
Pe.
B Global upstream “wiggles” appear when the boundary layer is not resolved bythe mesh.
B Governed by the mesh Peclet number Peh:
Peh =ah
2A=
12h
LPe
where wiggles appear when
Peh > 1 orh
L>
2Pe
or wiggle-free whenh
L<
2Pe
Observations (2)
The problem is twofold:
1. Rapid change in the solution over small lengths (large gradients)
2. Mesh size h is too large to resolve the length scale
As long as the length scale is resolved GFEM works well for convection-diffusionproblems.
Example: 1D steady convection with source term (1)
Equation (Pe→∞):du
dx= f on (0, 1)
with
u(0) = 0, f =1√πσ
exp[−(x− 12)2
σ2]
Exact solution:
u(x) =12
[erf(
x− 12
σ) + erf(
12σ
)]
Notes:
B length scale σ
B for σ → 0u(x) = H(x− 1
2) (Heaviside)
du
dx= f(x) = δ(x− 1
2)
Example: 1D steady convection with source term (2)
Ne = 20; σ = 0.45, 0.15, 0.05.
-0.2
0
0.2
0.4
0.6
0.8
1
0 0.2 0.4 0.6 0.8 1
u(x)
x
σ=0.45 exactσ=0.45 GFEMσ=0.15 exactσ=0.15 GFEMσ=0.05 exactσ=0.05 GFEM
Example: 1D steady convection with source term (3)
Ne = 11, 20, 21; σ = 0.05
-0.2
0
0.2
0.4
0.6
0.8
1
0 0.2 0.4 0.6 0.8 1
u(x)
x
σ=0.05 exactσ=0.05 Ne=11σ=0.05 Ne=20σ=0.05 Ne=21
Observations
B Inaccurate solutions and upstream wiggles when layer with small length scaleσ is not resolved by the mesh.
B By experimentation we find that
h
σ<
12
to get good smooth solutions with GFEM.
B Strong mesh dependence when solution is underresolved.
Problem is again lack of resolution for rapidly changing solutions (large gradients).
Summary of the examples
B GFEM works well for smooth solutions and the mesh resolves rapidly changingsolutions.
B For non-smooth solutions and/or a too coarse mesh wiggles can easily appear.
B The GFEM is not robust and local errors can easily be amplified throughoutthe domain.
Some might consider the latter a good thing (“Don’t suppress wiggles they tellyou something”). However:
B In many practical problems resolving all large gradients is not an option andwould require too much computer resources.
B In viscoelastic flow problems the GFEM method often performs very poorly.
⇒ Stabilization necessary
Analysis of the discrete equations
Equidistant mesh (mesh size h), inner node i:
aui+1 − ui−1
2h−Aui+1 − 2ui + ui−1
h2=fi−1 + 4fi + fi+1
6
Notes:
B central differencing
B consistent averaging of source term
B for f = 0:
ui+1 − ui−1 − 1Peh
(ui+1 − 2ui + ui−1) = 0or
ui+1 − ui =1 + Peh1− Peh
(ui − ui−1)or
sign(ui+1 − ui) = − sign(ui − ui−1) for Peh > 1 Wiggles!
B for Peh →∞ (no diffusion): Simpson rule for integration, which is O(h4).
B for Peh →∞ (no diffusion), matrix:
a
2h
−1 1 0 . . . . . . . . . . . . . 0−1 0 1 0 . . . . . . . . 00 −1 0 1 0 . . . 0... ...... ...... ...0 . . . 0 −1 0 1 00 . . . . . . 0 −1 0 10 . . . . . . . . . . . 0 −1 1
= . . .
zeros on the diagonal, “leap frogging”.
Artificial diffusion (1)
For Peh =ah
2A= 1 we have a diffusivity of:
A = A =ah
2
Adding −Ad2u
dx2to the equations, or
adu
dx− (A+ A)
d2u
dx2= f
removes wiggles, but we solve a modified equation. New mesh Peclet:
Peh =ah
2(A+ ah2 )
=Peh
1 + Peh< 1
Artificial diffusion (2)
Discretized equations with equidistant mesh (mesh size h), inner node i:
aui+1 − ui−1
2h− (A+
ah
2)ui+1 − 2ui + ui−1
h2=fi−1 + 4fi + fi+1
6
or
aui − ui−1
h︸ ︷︷ ︸upwind differencing
−Aui+1 − 2ui + ui−1
h2=fi−1 + 4fi + fi+1
6
h h
xi+1xi
ui−1
uiui+1
xi−1
ui − ui−1
h=du
dx(xi) +O(h)
Artificial diffusion (2)
In general artificial diffusivity:
A = βah
2with examples:
B β = 1, upwind differencingB Peh = 1 for Peh > 1:
β =
0 for Peh ≤ 11− 1
Pehfor Peh > 1
B Exact nodal point values (’optimal’ value) for
adu
dx−Ad
2u
dx2= constant
gives:
β = coth(Peh)− 1Peh
β(Peh)
0
0.2
0.4
0.6
0.8
1
0 2 4 6 8 10
coth(x)-1/x1-1/x
x/3
Exercise 8
Show that for β 6= 0 the first-order derivative can be interpreted as beingdiscretized by the following finite difference scheme
12(1− β)
ui+1 − uih
+ 12(1 + β)
ui − ui−1
h=du
dx(xi) +O(h)
i.e. a linear combination of ‘downwind’ and ‘upwind’ differencing.
Example: 1D steady convection-diffusion
Ne = 10; Pe = 25 (Peh = 1.25)
-0.2
0
0.2
0.4
0.6
0.8
1
0 0.2 0.4 0.6 0.8 1
u(x)
x
Pe=25 exactGFEMβ=1β=0 for Peh≤1, 1-1/Peh for Peh>1β=coth(Peh)-1/Peh
Observations
B Upwind differencing rather inaccurate (first-order) near large gradients.
B Wiggles are gone. As expected the boundary layer is not resolved.
B ‘Optimal’ β(Peh) can reduce error significantly (weighted upwind/downwind).
B Away from the boundary layer the solution seems accurate.
Example: 1D steady convection with source term
Ne = 20, 40; σ = 0.05; β = 1
-0.2
0
0.2
0.4
0.6
0.8
1
1.2
0 0.2 0.4 0.6 0.8 1
u(x)
x
σ=0.05 exactGFEM Ne=20GFEM Ne=40AD β=1 Ne=20AD β=1 Ne=40
Example: 1D steady convection with source term
Error in solution. Ne = 100 (Galerkin), 3000 (β = 1); σ = 0.05
-0.002
-0.0015
-0.001
-0.0005
0
0.0005
0.001
0.0015
0.002
0 0.2 0.4 0.6 0.8 1
max
k|u k
-uex
act|
x
AD β=1 Ne=3000GFEM Ne=100
Observations
B GFEM: global wiggles and inaccuracy for Ne = 20 but very accurate forNe = 40 (fast convergence)
B Upwind: no wiggles (robust) but convergence is very slow near large gradients.Seems to be accurate outside the layer with large gradients.
Question: Can we combine the accuracy (fast convergence) of GFEM with therobustness of upwind?
Set of equations (flow of a visco-elastic fluid)
Rewrite: Find (~u, p, τ ) such that,
ρ(∂~u
∂t+ ~u · ∇~u)−∇ · (2ηsD) +∇p−∇ · τ = ρ~b, in Ω
∇ · ~u = 0, in Ω
λ(∂τ
∂t+ ~u · ∇τ −L · τ − τ ·LT ) + τ = 2ηD, in Ω
Weak form of modified equation by AD
Artificial diffusion solves the modified equation:
adu
dx− d
dx
((A+ A)
du
dx
)+ bu = f, with A = β
ah
2
where we assume also the modified boundary condition:
u = ua, at x = a (ΓD)
−(A+ A)du
dx= hb at x = b (ΓN)
For the weak form we get: Find u ∈ S such that
(dv
dx, (A+ A)
du
dx) + (v, a
du
dx) + (v, bu) + v(b)hb = (v, f) for all v ∈ V
Streamline upwinding (SU) (1)
Compared to standard weak form we have added the term
(dv
dx, Adu
dx) = (
dv
dx, βah
2du
dx) = (
βh
2dv
dx, adu
dx)
This suggest another form of the modified weak form:
(dv
dx,Adu
dx) + (v +
βh
2dv
dx, adu
dx) + (v, bu) + v(b)hb = (v, f) for all v ∈ V
the convection term has been weighted with a modified test function
v = v +βh
2dv
dx
⇒ streamline upwinding (SU). For constant a, uniform size h, 1D→ equivalent toAD (artificial diffusion). Very inaccurate (overly diffusive) with time-dependent,reaction and source terms (similar to AD).
Streamline upwinding (SU) (2)
For the Galerkin FEM:
vh = vh +βh
2dvhdx
= v˜T φ
˜with φ
˜= (φ
˜+βh
2dφ
˜dx)
where h may vary from element to element.
hi hi+1
β2
φi
φi
xi+1xixi−1
β2
Consistent weighting
Hughes & Brooks (1982): problem with SU in inconsistency : The exact solutiondoes not satisfy the weak form. Their solution is to modify the weighting of thedifferential equation from the standard form
(v,Lu− f) = 0 for all v
to
(v +βh
2dv
dx,Lu− f) = 0 for all v
where
L(u) = adu
dx− d
dx(Adu
dx) + bu
The space of the weight functions (not V !) is in effect different from the spaceof shape functions when applying “Vh = Uh” like in the Galerkin method (→Petrov-Galerkin).
Interpretation of second-derivatives
Interpretation of Hughes & Brooks (1982). Split:
(v +βh
2dv
dx,Lu− f) = (v,Lu− f)︸ ︷︷ ︸
I
+ (βh
2dv
dx,Lu− f)︸ ︷︷ ︸II
= 0 for all v
B Term I: partial integration of diffusion terms with fluxes on the boundary(standard procedure)
B Term II: interprete element wise:
(βh
2dv
dx,Lu− f) =
∑e
(βh
2dv
dx,Lu− f)e =
Streamline upwind Petrov-Galerkin (SUPG)
This leads to the SUPG method for the 1D steady convection-diffusion-reactionequation: Find u ∈ S such that
(dv
dx,Adu
dx) + (v, a
du
dx) + (v, bu) + v(b)hb
+∑e
( βh
2︸︷︷︸τa
dv
dx, adu
dx− d
dx(Adu
dx) + bu− f
)e
= (v, f) for all v ∈ V
Notes:
B A = 0 (no diffusion):∑e can be removed (viscoelastic CE)
B consistency
B usual definition: τa =βh
2with time scale τ
τ = βh
21a
= βah
21a2
= A1a2
B constant A, linear elements:d
dx(Adu
dx) = 0 in the interior of the element. If
reaction term bu and source term f are also absent (convection-diffusion only)SU=SUPG!
B optimal values of β(Peh) neccessary to improve accuracy of diffusion terms.
Example: 1D steady convection with source term (1)
Ne = 20; σ = 0.05
-0.2
0
0.2
0.4
0.6
0.8
1
1.2
0 0.2 0.4 0.6 0.8 1
u(x)
x
σ=0.05 exactGFEM Ne=20AD β=1 Ne=20SUPG β=1 Ne=20
Example: 1D steady convection with source term (2)
σ = 0.05; maximum nodal error as a function of number of elements Ne.
0.001
0.01
0.1
1
10 100
max
k|u k
-uex
act|
Ne
ADSUPGGFEM
Example: 1D steady convection with source term (3)
σ = 0.05; maximum nodal error as a function of number of elements Ne.
0.001
0.01
0.1
1
10 100
max
k|u k
-uex
act|
Ne
ADSUPGGFEM
7/x10/x2
Observations
B Compared to GFEM: SUPG greatly enhances the stability/robustness for coarsegrids in convection(-dominated) problems where solutions are non-smooth orunderresolved (no global wiggles).
B Compared to SU: SUPG is much more accurate because convergence is fasterthan linear.
Extension to 3D: convection-diffusion-reaction equation
Strong solution u(~x, t):
∂u
∂t+ ~a · ∇u−∇ · (A∇u) + bu︸ ︷︷ ︸
Lu= f on Ω
with boundary and initialconditions
u(~x, t = 0) = u0(~x) in Ω
u = uD on ΓD
−A∂u∂n
= −A~n · ∇u = hN on ΓN~n Ω
ΓD
~n: outside normal
ΓN
Weak form (1)
Multiply by testfunction v:
(v,∂u
∂t+ Lu− f) = 0 for all v
where the standard inner product on L2(Ω) is
(a, b) =∫
Ω
abdx
With∇ · (A∇u)v = ∇ · (A(∇u)v)
)−A∇u · ∇vand the divergence theorem (Gauss):∫
Ω
∇ · ~adx =∫
Γ
~n · ~adΓ
Weak form (2)
we get the weak form: Find u ∈ S such that
(v,∂u
∂t) + (v,~a · ∇u) + (∇v,A∇u) + (v, bu) + (v, hN)ΓN = (v, f)
for all v ∈ V . Notes:
B v = 0 on ΓD, u = uD on ΓDB we have silently introduced:
(~a,~b) =∫
Ω
~a ·~bdΩ
(a, b)Γ =∫
Γ
abdΓ
GFEM (1)
Ω = ∪eΩe, Ωe ∩ Ωf = ∅ for e 6= f
1 2
3
2
3
1
φ1(~x)
2
3
1
2
3
1
φ3(~x)φ2(~x)
GFEM (2)
Approximation spaces Sh and Vh:
uh(~x, t) =n∑i=1
ui(t)φi(~x) = φ˜
T (~x)u˜(t)
vh(~x, t) =n∑i=1
vi(t)φi(~x) = φ˜
T (~x)v˜(t)
where φ˜(~x) are global shape functions. Substituting into the weak form:
v˜TM
¯u˜
+ v˜TK
¯u˜
= v˜Tf
˜for all v
˜
orM¯u˜
+K¯u˜
= f˜
GFEM (2)
The ‘mass matrix’ M¯
is given by
M¯
= (φ˜, φ
˜
T ), Mij = (φi, φj)
and the ‘stiffnes matrix’ by
K¯
= (∇φ˜, A∇φ
˜
T ) or Kij = (∇φi, A∇φj)+ (φ
˜,~a · ∇φ
˜
T ) + (φi,~a · ∇φj)+ (φ
˜, bφ
˜
T ) + (φi, bφj)
f˜
= (φ˜, f)− (φ
˜, hN)ΓN fi = (φi, f)− (φi, hN)ΓN
Example: 2D steady convection with source term (1)
u = 0
u = 0
|~a| = 1
ax∂u
∂x+ ay
∂u
∂y= f on (0, 1)× (0, 1)
with (ax, ay) = (12
√2, 1
2
√2) and
u(x, 0) = 0, u(0, y) = 0, f =1√πσ
exp[−(x+ y − 1)2
2σ2]
Exact solution goes from 0 for x + y < 1 to 1 for x + y > 1 over a length scaleof σ.
Example: 2D steady convection with source term (2)
Ne = 15× 15; σ = 0.05; GFEM
−3.15E−01
−4.57E−02
2.23E−01
4.92E−01
7.61E−01
1.03E+00
max: 1.03E+00min:−3.15E−01
Example: 2D steady convection with source term (3)
Ne = 30× 30; σ = 0.05; GFEM
−3.08E−02
1.79E−01
3.89E−01
5.99E−01
8.08E−01
1.02E+00
max: 1.02E+00min:−3.08E−02
Example: 2D steady convection with source term (4)
Ne = 45× 45; σ = 0.05; GFEM
−1.61E−02
1.88E−01
3.91E−01
5.95E−01
7.99E−01
1.00E+00
max: 1.00E+00min:−1.61E−02
Example: 2D steady convection with source term (5)
Ne = 100× 100; σ = 0.05
−3.47E−03
1.98E−01
3.99E−01
6.00E−01
8.01E−01
1.00E+00
max: 1.00E+00min:−3.47E−03
Example: 2D steady convection with discontinuous inflow (1)
u = 0
u = 1|~a| = 1
ax∂u
∂x+ ay
∂u
∂y= 0 on (0, 1)× (0, 1)
with (ax, ay) = (12
√2, 1
2
√2) and
u(x, 0) = 0, u(0, y) = 1
Exact solution is: 1 for y > x
0 for y < x
Example: 2D steady convection with discontinuous inflow (2)
Ne = 15× 15; GFEM
−6.22E−02
1.63E−01
3.88E−01
6.13E−01
8.38E−01
1.06E+00
max: 1.06E+00min:−6.22E−02
Example: 2D steady convection with discontinuous inflow (3)
Ne = 30× 30; GFEM
−6.22E−02
1.63E−01
3.88E−01
6.13E−01
8.38E−01
1.06E+00
max: 1.06E+00min:−6.22E−02
Observations for GFEM in 2D
B Inaccurate solutions and global upstream wiggles when layer with small lengthscale σ is not resolved by the mesh.
B Almost wiggle free, very localized cross-stream jumps possible even for coarsemeshes.
B Strong mesh dependence when solution is underresolved.
Artificial diffusion (1)
1D added diffusion:
−Ad2u
dx2with A = β
ah
2which stabilizes
adu
dx3D added diffusion:
−∇(A∇u) with A = β|a|h
2which stabilizes
~a · ∇uhowever, in all directions. This is too much added diffusion. Only diffusion in thedirection of ~a is needed since
~a · ∇u = |~a|~e · ∇u = |~a|∂u∂e
with ~e =~a
|~a|
Artificial diffusion (2)
Add anisotropic diffusion using a tensorial diffusion coefficient, with a componentin the direction of ~e (i.e. the “streamline” direction) only:
−∇(A~e~e · ∇u)
or
−∇(A · ∇u) with A = A~e~e = A~a~a
|~a|2In the weak form we get an extra term:
(∇v, A · ∇u)
SU (1)
Diffusion added in AD method:
(∇v, A · ∇u) = (∇v, A ~a~a|~a|2 · ∇u)
=∫
Ω
∇v · A ~a~a|~a|2 · ∇u) dΩ
=∫
Ω
A
|~a|2(~a · ∇v)(~a · ∇u) dΩ
= (A
|~a|2~a · ∇v,~a · ∇u)
= (τ~a · ∇v,~a · ∇u)
with
τ =A
|~a|2 = βh
2|~a|
SU (2)
The weak form now becomes
· · ·+ (v + τ~a · ∇v,~a · ∇u)+ · · ·
i.e. the convection term is multiplied by a modified weighting function
v = v + τ~a · ∇v
SUPG
SU → SUPG: consistent weighting and interpret extra terms elementwise:
(v + τ~a · ∇v, ∂u
∂t+ Lu− f
)= 0
or (with elementwise interpretation):
(v,∂u
∂t+ Lu− f
)+∑e
(τ~a · ∇v, ∂u
∂t+ Lu− f
)Ωe
= 0
First term: partial integrate to standard weak form.
Notes on SUPG (1)
B τ =A
|~a|2, with A “the amount of streamline diffusion”. When the real diffusion
A 6= 0, we need to generalize A = β(Peh)ah
2to more dimensions. There are
various ways to do this. For example for a bilinear quadrilateral:
~e1
~e2
~a0~h1 = h1~e1
h1
h2
~h2 = h2~e2
A = β(Peh1)|~a · ~h1|
2+ β(Peh2)
|~a · ~h2|2
with
Peh1 =|~a · ~h1|
2A, Peh2 =
|~a · ~h2|2A
B For higher-order elements a constant τ is non-optimal.
Notes on SUPG (2)
B The choice of τ is somewhat arbitrary, in particular when diffusion is absent(A = 0). Note, that
τ =A
|~a|2 = βh
2|~a|In viscoelastic flow it is common to use:
τ =h
2U
where h is a characteristic element size and U is a characteristic velocity.There are various possible choices for h and U (see separate notes).
A bit of experimentation with the 1D “Gaussian distribution in the right-handside” example (source term, no diffusion) seems to suggest that the solutionis rather insensitive to the exact value of β in this case, as long as the scalingwith h is there.
Example: 2D steady convection with source term (1)
u = 0
u = 0
|~a| = 1
ax∂u
∂x+ ay
∂u
∂y= f on (0, 1)× (0, 1)
with (ax, ay) = (12
√2, 1
2
√2) and
u(x, 0) = 0, u(0, y) = 0, f =1√πσ
exp[−(x+ y − 1)2
2σ2]
Exact solution goes from 0 for x + y < 1 to 1 for x + y > 1 over a length scaleof σ.
Example: 2D steady convection with source term (2)
Ne = 15× 15; σ = 0.05; SUPG
−7.67E−03
1.98E−01
4.03E−01
6.08E−01
8.14E−01
1.02E+00
max: 1.02E+00min:−7.67E−03
Example: 2D steady convection with source term (3)
Ne = 30× 30; σ = 0.05; SUPG
−4.83E−04
2.00E−01
4.01E−01
6.02E−01
8.03E−01
1.00E+00
max: 1.00E+00min:−4.83E−04
Example: 2D steady convection with discontinuous inflow (1)
u = 0
u = 1|~a| = 1
ax∂u
∂x+ ay
∂u
∂y= 0 on (0, 1)× (0, 1)
with (ax, ay) = (12
√2, 1
2
√2) and
u(x, 0) = 0, u(0, y) = 1
Exact solution is: 1 for y > x
0 for y < x
Example: 2D steady convection with discontinuous inflow (2)
Ne = 15× 15; SUPG
−4.47E−02
1.73E−01
3.91E−01
6.09E−01
8.27E−01
1.05E+00
max: 1.05E+00min:−4.47E−02
Example: 2D steady convection with discontinuous inflow (3)
Ne = 30× 30; SUPG
−4.70E−02
1.72E−01
3.91E−01
6.11E−01
8.30E−01
1.05E+00
max: 1.05E+00min:−4.70E−02
Example: 2D steady convection with discontinuous inflow (4)
Ne = 30× 30; AD method with isotropic diffusion of |a|h/2
0.00E+00
2.00E−01
4.00E−01
6.00E−01
8.00E−01
1.00E+00
max: 1.00E+00min: 0.00E+00
Example: 2D steady convection with discontinuous inflow (5)
Ne = 100× 100; AD method with isotropic diffusion of |a|h/2
0.00E+00
2.00E−01
4.00E−01
6.00E−01
8.00E−01
1.00E+00
max: 1.00E+00min: 0.00E+00
Observations for SUPG in 2D
B In streamline direction: SUPG greatly enhances the stability/robustness forcoarse grids in convection(-dominated) problems where solutions are non-smooth or underresolved (no global wiggles).
B Normal to the streamline direction: SUPG shows a small ‘diffusion-like’smoothing that decreases with mesh size. The diffusion is much less than thediffusion in the AD method (when added isotropically).