0% found this document useful (0 votes)
108 views93 pages

(Galerkin) Finite Element Approximations: e N e 1 e e e

The finite element method approximates solutions to partial differential equations by subdividing the domain into smaller elements and approximating the solution over each element using shape functions. This involves defining local element shape functions, assembling local element matrices and vectors into a global system, and solving the resulting global system of equations to obtain the finite element solution.

Uploaded by

Harish Lambadi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
108 views93 pages

(Galerkin) Finite Element Approximations: e N e 1 e e e

The finite element method approximates solutions to partial differential equations by subdividing the domain into smaller elements and approximating the solution over each element using shape functions. This involves defining local element shape functions, assembling local element matrices and vectors into a global system, and solving the resulting global system of equations to obtain the finite element solution.

Uploaded by

Harish Lambadi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 93

(Galerkin) Finite element approximations

The finite element method (FEM): special choice for the shape functions .

Ne = 5 Subdivide into elements e:
Ne
[
= e
e=1
1 2 3 4 5 e1 e2 =
x=a x=b
Approximate u on each element separately by a polynomial of some degree p, for
example by Lagrangian interpolation (using p + 1 nodal points per element). The
end points of an element must be nodal points.
Example: linear elements

Global shape functions:

Ne = 5 n
X
1 uh(x) = uii(x) = T (x)u
3(x)
i=1

1 2 3 4 5 n: number of global nodal points.


x1 = a x2 x3 x4 x5 x6 = b

Local element shape functions:

ueh(x) = ue11(x)+ue22(x) = T (x)ue


1(x) 2(x)
1 1
with T = [1(x), 2(x)] and

x xe2 x xe1
xe1 xe2 xe1 xe2 1(x) = e , 2(x) = e
x1 xe2 x2 xe1
Example: quadratic elements
Local element shape functions:

1(x) 2 (x) 3(x)


1 1 1

xe1 xe2 xe3 xe1 xe2 xe3 xe1 xe2 xe3

ueh(x) = ue11(x) + ue22(x) = T (x)ue



with T = [1(x), 2(x), 3(x)] and

(x xe2)(x xe3) (x xe1)(x xe3)
1(x) = e , 2(x) = e ,
(x1 xe2)(xe1 xe3) (x2 xe1)(xe2 xe3)
(x xe1)(x xe2)
3(x) = e
(x3 xe1)(xe3 xe2)
Example: higher-order elements

General polynomials of order p:


p+1
X
ueh(x) = ueii(x) = T (x)ue
i=1

with T = [1, 2, . . . , p+1].



Various expansions possible:

B Gauss-Lobatto integration points (includes end points) and Lagrangian


interpolation (Spectral elements).

B Hierarchical base functions: end points are nodes but internal shape functions
have no nodes (similar to Legrende polynomials). (hp-FEM).

B Legrendre polynomials in discontinuous Galerkin methods.


Global numbering

4
X
Ne = 3 uh(x) uh(x) = uii(x) = T (x)u
i=1
u2 u3
u1 u4 u1 1(x)
1 2 3 u2 2(x)
u=

, (x) =
x1 = a x2 x3 x4 = b u3
3(x)
1 u4 4(x)
Ne = 3 3(x)

1 2 3
x1 = a x2 x3 x4 = b
Local numbering in elements

Weak form: Find uh in Sh such that

dvh duh
( ,A ) + vh(b)hb = (vh, f ) for all vh Vh
dx dx

Split:
XNe XNe
dvh duh
( ,A ) + vh(b)hb = (vh, f ) for all vh Vh
e=1
dx dx e=1
Write in each element e:

2
X 2
X
ueh(x) = ueii(x) = T (x)ue, vhe (x) = viei(x) = T (x)v e
i=1 i=1

where uTe = (ue1, ue2) and T (x) = (1(x), 2(x)).



Element matrix and vector

We get:
Ne
X Ne
X
(v Te K eue) + vnhb = v Te f e
e=1
e=1

where

 d dT  Z
d dT
Ke = ,A = A dx
dx dx e e dx dx
Z
fe = (, f )e = f dx
e

are the element matrix K e and element vector f e.



Local global (assembling)

The local vectors ue and v e are part of the global vectors:



ue = P eu, v e = P ev ,

So we get

Ne
X Ne
X X
Ne 
v Te K eue = v T
P Te K eP e u
=v T
K e u
| {z }
e=1
e=1 e=1
K e

XNe XNe X
Ne 
v Te f e = v T P Te f e = v T f e
e=1
e=1
|
{z } e=1
f e

Weak form

Substitution into the weak form:

vT K u = vT f for all v

or
Ku = f

with
Ne
X
K= K e
e=1


0
Ne
X 0
.
f= f e +
.

e=1 0
hb
Example (1)

For example:
    u1
u2 0 1 0 0 u2 = P 2u
u2 = =
u3 0 0 1 0 u3
| {z }
P2 u4

0 0   
2
1 0 K11 K12 2
0 1 0 0
K 2 = P T2 K 2P 2 =
0 1 K21 2 2
K22 0 0 1 0
0 0

0 0 0 0
0 K11 2 2
K12 0
=
0 K21 K22 0
2 2

0 0 0 0
Example (2)

Assembly of K :

1 1

K11 K12 0 0 0 0 0 0 0 0 0 0
K211
K 1
0 0 0 K11 2
K122
0 0
K= 22 + + 0 0 0
0 0 0 0 0 K21 2
K222
0 0 3 3
0 K11 K12
3 3
0 0 0 0 0 0 0 0 0 0 K21 K22
1 1

K11 K12 0 0
K211 1
K22 2
+ K11 2
K12 0
= 2 2 3

3
0 K21 K22 + K11 K12
3 3
0 0 K21 K22

Similar for assembly of f .



Exercise 5

The bandwidth of K for linear shape functions is 3. How large is the bandwidth

for K when using polynomial shape functions of order k, k 1?

Dirichlet conditions

Renumber and split vector and matrix (u unknown, p prescribed)


       
uu vu K uu K up fu
u= , v= v , K= , f=
u p p K pu K pp f p

Note: up prescribed values, v p = 0. Weak form

vT K u = vT f for all v

with v p = 0 leads to

v Tu (K uuuu + K upup) = v Tu f u for all v u

or
K uuuu = f u K upup

1D convection-diffusion-reaction equation

1D convection-diffusion-reaction Eq.: find u(x) such that for x (a, b)

u u u
+ a (A ) + bu = f
t x x x
and

u = ua(t), at x = a, t > 0 (D )
du
A = hb(t) at x = b, t > 0 (N )
dx
Notes:

B Strong form; Classical (strong) solution u(x, t)


B f (x, t) C 0(a, b) (continuous) then u C 2(a, b) (twice continuously
differentiable)
Oldroyd-B/UCM viscoelastic model

5
+ = 2D
where
5
= L LT
or

+ ~u L LT + = 2 D
t
|{z} | {z } | {z } |
{z }
u a u bu f
t x

Diffusion is missing (A = 0).


Dimensionless form (1)

Scaling:

t = tct tc : characteristic time


u = U u U : characteristic value solution
x = Lx L : characteristic length scale

Dimensionless variables: O(1).

U u aU u AU 2u

+
2 2
+ bU u =f
tc t L x L x
Relative to convection:
L u u 1 2u bL L
+ + u = f
atc t x Pe x2 a aU
aL
Pe = : Peclet number, convection/diffusion.
A
Dimensionless form (2)
Time scales:

L
B convection:
a
2
L
B diffusion:
A
1
B source: (relaxation time)
b
B time scales in b.c.
B externally or internally generated frequencies (von Karman vortex)

We choose tc = L/a (convection) and get

u u 1 2u
+ + b u = f
t x Pe x2

bL L
with b = and f = f . Pe > 1 : convection dominated
a aU
Exercise 6

L2
Assume b = 0 and f = 0. We take for the typical time scale tc = (diffusion
A
time scale). Show that we now have the non-dimensional form

u u 2u

+ Pe 2 = 0
t x x

When will this non-dimensional form be preferable over the one on the previous
slide?
Steady state 1D convection-diffusion-reaction equation

steady state: u/t = 0

du d du
L(u) = a (A ) + bu = f
dx dx dx

L: linear operator, with b.c.

u = ua, at x = a (D )
du
A = hb at x = b (N )
dx
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 S
such that

dv du du
( , A ) + (v, a ) + (v, bu) + v(b)hb = (v, f ) for all v V
dx dx dx

where S and V are appropriate spaces.


Galerkin FEM approximations (1)

Approximation spaces Sh and Vh:


n
X
uh(x) = uii(x) = T (x)u
i=1
n
X
vh(x) = vii(x) = T (x)v
i=1

where (x) are global shape functions. Substituting this into the weak form gives:
Find uh Sh such that

dvh duh duh


( ,A ) + (vh, a ) + (vh, buh) + vh(b)hb = (vh, f ) for all vh Vh
dx dx dx
or
vT K u = vT f for all v

Galerkin FEM approximations (2)

and thus
Ku = f

with

d dT di dj
K = ( , A ) or Kij = ( ,A )
dx dx dx dx
dT dj
+ (, a ) + (i, a )
dx dx
+ (, bT ) + (i, bj )

f = (, f ) hb(b) fi = (i, f ) hbi(b)

Galerkin FEM approximations (3)

Build from element matrices. For example with constant coefficients and linear
element shape functions:
 
d dT 1 1 1
( , )e = stiffness matrix
dx dx h 1 1
 
dT 1 1 1
(, )e = convection matrix
dx 2 1 1
 
h 2 1
(, T )e = mass matrix
6 1 2

where h is the element length.


Global stiffness matrix

Global stiffness matrix (uniform element size):



1 1 0 . . . . . . . . . . . . . 0
1 2 1 0 . . . . . . . . 0

0 1 2 1 0 . . . 0
. ..
.
1
.. ..
h
.. ..


0 ... 0 1 2 1 0

0 . . . . . . . . 0 1 2 1
0 . . . . . . . . . . . . . 0 1 1

Finite difference scheme: (divide by h)

ui1 + 2ui ui+1 d2u 2


= (x i ) + O(h )
h2 dx2
Global convection matrix

Global convection matrix (uniform element size):



1 1 0 . . . . . . . . . . . . . 0
1 0 1 0 . . . . . . . . 0

0 1 0 1 0 ... 0
. ..
.
1
.. ..
2
.. ..


0 . . . 0 1 0 1 0

0 . . . . . . 0 1 0 1
0 . . . . . . . . . . . 0 1 1

Finite difference scheme: (divide by h)

ui1 + ui+1 du
= (xi) + O(h2)
2h dx
Global mass matrix

Global mass matrix (uniform element size):



2 1 0 ......... 0
1 4 1 0 . . . . . . 0

0 1 4 1 0 . . . 0
. ..
.
h .. ..
6
.. ..


0 . . . 0 1 4 1 0

0 . . . . . . 0 1 4 1
0 ......... 0 1 2

Finite difference scheme: (divide by h)


ui1 + 4ui + ui+1
= u(xi) + O(h2)
6
Global right-hand side

Sometimes the following approximation is applied:


X
f (x) fk k (x) fk : nodal point values of f
k

In that case: X
fi = (i, f ) = (i, k )fk
k
with (i, k ) the mass matrix.
Finite difference scheme: (divide by h)

fi1 + 4fi + fi+1


= f (xi) + O(h2)
6

Note that the usual approach is to use numerical integration.


Exercise 7

a. Verify the element stiffness, convection and mass matrix by performing the
integrations.

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 convection
matrix still a zero on the diagonal?
Example: 1D steady convection-diffusion (1)

Equation:
du 1 d2u
=0 on (0, 1)
dx Pe dx2
with b.c.
u(0) = 0, u(1) = 1
Exact solution:
1 exp(Pex)
u(x) =
1 exp(Pe)
Example: 1D steady convection-diffusion (2)

Ne = 10; Pe = 1, 10, 100.

1
Pe=1 exact
Pe=1 GFEM
0.8 Pe=10 exact
Pe=10 GFEM
0.6 Pe=100 exact
Pe=100 GFEM
0.4

0.2
u(x)

-0.2

-0.4

-0.6

-0.8
0 0.2 0.4 0.6 0.8 1
x
Example: 1D steady convection-diffusion (2)

Ne = 10, 20; Pe = 25

1
Pe=25 exact
Pe=25 Ne=10
Pe=25 Ne=20
0.8

0.6
u(x)

0.4

0.2

-0.2
0 0.2 0.4 0.6 0.8 1
x
Observations (1)

1
B Boundary layer of width .
Pe
B Global upstream wiggles appear when the boundary layer is not resolved by
the mesh.
B Governed by the mesh Peclet number Peh:

ah 1h
Peh = = Pe
2A 2 L
where wiggles appear when

h 2
Peh > 1 or >
L Pe
or wiggle-free when
h 2
<
L Pe
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-diffusion
problems.
Example: 1D steady convection with source term (1)

Equation (Pe ):
du
=f on (0, 1)
dx
with
1 (x 12 )2
u(0) = 0, f = exp[ ]
2
Exact solution:
1h x 21 1 i
u(x) = erf( ) + erf( )
2 2
Notes:

B length scale
B for 0
1
u(x) = H(x ) (Heaviside)
2
du 1
= f (x) = (x )
dx 2
Example: 1D steady convection with source term (2)

Ne = 20; = 0.45, 0.15, 0.05.

1
=0.45 exact
=0.45 GFEM
=0.15 exact
0.8 =0.15 GFEM
=0.05 exact
=0.05 GFEM
0.6
u(x)

0.4

0.2

-0.2
0 0.2 0.4 0.6 0.8 1
x
Example: 1D steady convection with source term (3)

Ne = 11, 20, 21; = 0.05

1
=0.05 exact
=0.05 Ne=11
=0.05 Ne=20
0.8 =0.05 Ne=21

0.6
u(x)

0.4

0.2

-0.2
0 0.2 0.4 0.6 0.8 1
x
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 1
<
2

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 changing
solutions.

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 throughout
the domain.

Some might consider the latter a good thing (Dont suppress wiggles they tell
you something). However:

B In many practical problems resolving all large gradients is not an option and
would 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:

ui+1 ui1 ui+1 2ui + ui1 fi1 + 4fi + fi+1


a A 2
=
2h h 6
Notes:

B central differencing

B consistent averaging of source term

B for f = 0:
1
ui+1 ui1 (ui+1 2ui + ui1) = 0
Peh
or
1 + Peh
ui+1 ui = (ui ui1)
1 Peh
or

sign(ui+1 ui) = sign(ui ui1) for Peh > 1 Wiggles!


B for Peh (no diffusion): Simpson rule for integration, which is O(h4).

B for Peh (no diffusion), matrix:



1 1 0 . . . . . . . . . . . . . 0
1 0 1 0 . . . . . . . . 0

0 1 0 1 0 . . . 0
. ..
.

a . .
. . = ...
2h . ..
.
0 . . . 0 1 0 1 0

0 . . . . . . 0 1 0 1
0 . . . . . . . . . . . 0 1 1

zeros on the diagonal, leap frogging.


Artificial diffusion (1)

ah
For Peh = = 1 we have a diffusivity of:
2A
ah
A = A =
2

d2 u
Adding A 2 to the equations, or
dx

du d2u
a (A + A) 2 = f
dx dx
removes wiggles, but we solve a modified equation. New mesh Peclet:

h= ah Peh
Pe ah
= <1
2(A + 2 ) 1 + Peh
Artificial diffusion (2)
Discretized equations with equidistant mesh (mesh size h), inner node i:

ui+1 ui1 ah ui+1 2ui + ui1 fi1 + 4fi + fi+1


a (A + ) 2
=
2h 2 h 6
or
ui ui1 ui+1 2ui + ui1 fi1 + 4fi + fi+1
a A 2
=
| {z }h h 6
upwind differencing

ui ui+1
ui1

xi1 xi xi+1
h h

ui ui1 du
= (xi) + O(h)
h dx
Artificial diffusion (2)
In general artificial diffusivity:
ah
A =
2
with examples:

B = 1, upwind differencing
h = 1 for Peh > 1:
B Pe
(
0 for Peh 1
=
1 Pe1 for Peh > 1
h

B Exact nodal point values (optimal value) for

du d2u
a A 2 = constant
dx dx
gives:
1
= coth(Peh)
Peh
(Peh)

1
coth(x)-1/x
1-1/x
x/3

0.8

0.6

0.4

0.2

0
0 2 4 6 8 10
Exercise 8

Show that for 6= 0 the first-order derivative can be interpreted as being


discretized by the following finite difference scheme

1 ui+1 ui 1 ui ui1 du
2 (1 )
h
+ 2 (1 + )
h
= (xi) + O(h)
dx

i.e. a linear combination of downwind and upwind differencing.


Example: 1D steady convection-diffusion

Ne = 10; Pe = 25 (Peh = 1.25)

1
Pe=25 exact
GFEM
0.8 =1
=0 for Peh1, 1-1/Peh for Peh>1
=coth(Peh)-1/Peh
0.6
u(x)

0.4

0.2

-0.2
0 0.2 0.4 0.6 0.8 1
x
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

1.2
=0.05 exact
GFEM Ne=20
1 GFEM Ne=40
AD =1 Ne=20
0.8 AD =1 Ne=40

0.6
u(x)

0.4

0.2

-0.2
0 0.2 0.4 0.6 0.8 1
x
Example: 1D steady convection with source term

Error in solution. Ne = 100 (Galerkin), 3000 ( = 1); = 0.05

0.002
AD =1 Ne=3000
0.0015 GFEM Ne=100

0.001
maxk|uk-uexact|

0.0005

-0.0005

-0.001

-0.0015

-0.002
0 0.2 0.4 0.6 0.8 1
x
Observations

B GFEM: global wiggles and inaccuracy for Ne = 20 but very accurate for
Ne = 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 the
robustness of upwind?
Set of equations (flow of a visco-elastic fluid)

Rewrite: Find (~u, p, ) such that,

~u
( + ~u ~u) (2sD) + p = ~b, in
t
~u = 0, in

( + ~u L LT ) + = 2D, in
t
Weak form of modified equation by AD

Artificial diffusion solves the modified equation:

du d du  ah
a (A + A) + bu = f, with A =
dx dx dx 2
where we assume also the modified boundary condition:

u = ua, at x = a (D )
du
(A + A) = hb at x = b (N )
dx
For the weak form we get: Find u S such that

dv du du
( , (A + A) ) + (v, a ) + (v, bu) + v(b)hb = (v, f ) for all v V
dx dx dx
Streamline upwinding (SU) (1)

Compared to standard weak form we have added the term


dv du dv ah du h dv du
( , A ) = ( , )=( ,a )
dx dx dx 2 dx 2 dx dx
This suggest another form of the modified weak form:
dv du h dv du
( , A ) + (v + , a ) + (v, bu) + v(b)hb = (v, f ) for all v V
dx dx 2 dx dx
the convection term has been weighted with a modified test function
h dv
v = v +
2 dx
streamline upwinding (SU). For constant a, uniform size h, 1D equivalent to
AD (artificial diffusion). Very inaccurate (overly diffusive) with time-dependent,
reaction and source terms (similar to AD).
Streamline upwinding (SU) (2)

For the Galerkin FEM:


h dvh T h d
vh = vh + = v with = ( + )
2 dx 2 dx
where h may vary from element to element.

xi1 xi xi+1
2

hi hi+1
Consistent weighting

Hughes & Brooks (1982): problem with SU in inconsistency : The exact solution
does not satisfy the weak form. Their solution is to modify the weighting of the
differential equation from the standard form

(v, Lu f ) = 0 for all v

to
h dv
(v + , Lu f ) = 0 for all v
2 dx
where
du d du
L(u) = a (A ) + bu
dx dx dx
The space of the weight functions (not V !) is in effect different from the space
of shape functions when applying Vh = Uh like in the Galerkin method (
Petrov-Galerkin).
Interpretation of second-derivatives

Interpretation of Hughes & Brooks (1982). Split:

h dv h dv
(v + , Lu f ) = (v, Lu f ) + ( , Lu f ) = 0 for all v
2 dx | {z } | 2 dx {z }
I II

B Term I: partial integration of diffusion terms with fluxes on the boundary


(standard procedure)

B Term II: interprete element wise:

h dv X h dv
( , Lu f ) = ( , Lu f )e =
2 dx e
2 dx
Streamline upwind Petrov-Galerkin (SUPG)

This leads to the SUPG method for the 1D steady convection-diffusion-reaction


equation: Find u S such that

dv du du
( , A ) + (v, a ) + (v, bu) + v(b)hb
dx dx dx
X  h dv du d du 
+ , a (A ) + bu f
2 dx dx dx dx e
e |{z}
a
= (v, f ) for all v V

Notes:
P
B A = 0 (no diffusion): e can be removed (viscoelastic CE)

B consistency
h
B usual definition: a = with time scale
2

h1 ah 1 1
= = = A
2a 2 a2 a2

d du
B constant A, linear elements: (A ) = 0 in the interior of the element. If
dx dx
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

1.2
=0.05 exact
GFEM Ne=20
1 AD =1 Ne=20
SUPG =1 Ne=20
0.8

0.6
u(x)

0.4

0.2

-0.2
0 0.2 0.4 0.6 0.8 1
x
Example: 1D steady convection with source term (2)

= 0.05; maximum nodal error as a function of number of elements Ne.

1
AD
SUPG
GFEM

0.1
maxk|uk-uexact|

0.01

0.001
10 100
Ne
Example: 1D steady convection with source term (3)

= 0.05; maximum nodal error as a function of number of elements Ne.

1
AD
SUPG
GFEM
7/x
10/x2

0.1
maxk|uk-uexact|

0.01

0.001
10 100
Ne
Observations

B Compared to GFEM: SUPG greatly enhances the stability/robustness for coarse


grids in convection(-dominated) problems where solutions are non-smooth or
underresolved (no global wiggles).

B Compared to SU: SUPG is much more accurate because convergence is faster


than linear.
Extension to 3D: convection-diffusion-reaction equation

Strong solution u(~x, t):

u
+ ~a u (Au) + bu = f on
t | {z }
Lu

with boundary and initial


conditions
D
u(~x, t = 0) = u0(~x) in
N
u = uD on D
~n
u
A = A~n u = hN on N ~n: outside normal
n
Weak form (1)

Multiply by testfunction v:

u
(v, + Lu f ) = 0 for all v
t
where the standard inner product on L2() is
Z
(a, b) = ab dx

With  
Au v = A(u)v) Au v
and the divergence theorem (Gauss):
Z Z
~a dx = ~n ~a d

Weak form (2)

we get the weak form: Find u S such that

u
(v, ) + (v, ~a u) + (v, Au) + (v, bu) + (v, hN )N = (v, f )
t

for all v V . Notes:

B v = 0 on D , u = uD on D
B we have silently introduced:
Z
(~a, ~b) = ~a ~b d

Z
(a, b) = ab d

GFEM (1)
= ee, e f = for e 6= f

1(~x) 3(~x)
30 2(~x)
1

1
0 1
0
1 2

03
1 03
1 03
1
1
0 1
0 1
0
1 1 1

1
0 1
0 1
0
2 2 2
GFEM (2)

Approximation spaces Sh and Vh:

n
X
uh(~x, t) = ui(t)i(~x) = T (~x)u(t)
i=1
n
X
vh(~x, t) = vi(t)i(~x) = T (~x)v (t)
i=1

where (~x) are global shape functions. Substituting into the weak form:

v T M u + v T K u = v T f for all v

or
M u + K u = f

GFEM (2)

The mass matrix M is given by



M = (, T ), Mij = (i, j )

and the stiffnes matrix by

K = (, AT ) or Kij = (i, Aj )
T
+ (, ~a ) + (i, ~a j )
T

+ (, b ) + (i, bj )

f = (, f ) (, hN )N fi = (i, f ) (i, hN )N

Example: 2D steady convection with source term (1)

|~a| = 1

u=0

u=0

u u
ax + ay =f on (0, 1) (0, 1)
x y
1
1
with (ax, ay ) = ( 2 2, 2 2) and

1 (x + y 1)2
u(x, 0) = 0, u(0, y) = 0, f = exp[ 2
]
2

Exact solution goes from 0 for x + y < 1 to 1 for x + y > 1 over a length scale
of .
Example: 2D steady convection with source term (2)

Ne = 15 15; = 0.05; GFEM

1.03E+00

7.61E01

4.92E01

2.23E01

4.57E02

3.15E01

max: 1.03E+00
min:3.15E01
Example: 2D steady convection with source term (3)

Ne = 30 30; = 0.05; GFEM

1.02E+00

8.08E01

5.99E01

3.89E01

1.79E01

3.08E02

max: 1.02E+00
min:3.08E02
Example: 2D steady convection with source term (4)

Ne = 45 45; = 0.05; GFEM

1.00E+00

7.99E01

5.95E01

3.91E01

1.88E01

1.61E02

max: 1.00E+00
min:1.61E02
Example: 2D steady convection with source term (5)

Ne = 100 100; = 0.05

1.00E+00

8.01E01

6.00E01

3.99E01

1.98E01

3.47E03

max: 1.00E+00
min:3.47E03
Example: 2D steady convection with discontinuous inflow (1)

|~a| = 1
u=1

u=0

u u
ax + ay =0 on (0, 1) (0, 1)
x y

with (ax, ay ) = ( 12 2, 12 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

1.06E+00

8.38E01

6.13E01

3.88E01

1.63E01

6.22E02

max: 1.06E+00
min:6.22E02
Example: 2D steady convection with discontinuous inflow (3)

Ne = 30 30; GFEM

1.06E+00

8.38E01

6.13E01

3.88E01

1.63E01

6.22E02

max: 1.06E+00
min:6.22E02
Observations for GFEM in 2D

B Inaccurate solutions and global upstream wiggles when layer with small length
scale is not resolved by the mesh.

B Almost wiggle free, very localized cross-stream jumps possible even for coarse
meshes.

B Strong mesh dependence when solution is underresolved.


Artificial diffusion (1)

1D added diffusion:
d2 u ah
A 2 with A =
dx 2
which stabilizes
du
a
dx
3D added diffusion:
|a|h
(Au) with A =
2
which stabilizes
~a u
however, in all directions. This is too much added diffusion. Only diffusion in the
direction of ~a is needed since
u ~a
~a u = |~a|~e u = |~a| with ~e =
e |~a|
Artificial diffusion (2)

Add anisotropic diffusion using a tensorial diffusion coefficient, with a component


in the direction of ~e (i.e. the streamline direction) only:

(A~e~e u)

or
~a~a
(A u) with A = A~e~e = A 2
|~a|
In the weak form we get an extra term:

(v, A u)
SU (1)

Diffusion added in AD method:


~a~a
(v, A u) = (v, A 2 u)
|~a|
Z
~a~a
= v A 2 u) d
|~a|
Z
A
= 2
(~a v)(~a u) d
|~
a|
A
=( 2
~a v, ~a u)
|~a|
= (~a v, ~a u)

with
A h
= 2=
|~a| 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:


 u 
v + ~a v, + Lu f = 0
t

or (with elementwise interpretation):

 u  X u 
v, + Lu f + ~a v, + Lu f =0
t e
t e

First term: partial integrate to standard weak form.


Notes on SUPG (1)

A
B = 2 , with A the amount of streamline diffusion. When the real diffusion
|~a|
ah
A 6= 0, we need to generalize A = (Peh) to more dimensions. There are
2
various ways to do this. For example for a bilinear quadrilateral:
~h1 = h1~e1 ~a0
~h2 = h2~e2

|~a ~h1| |~a ~h2|


~e2 A = (Peh1) + (Peh2)
2 2
h2
~e1 with

|~a ~h1| |~a ~h2|


Peh1 = , Peh2 =
h1 2A 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 h
= 2=
|~a| 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-hand
side example (source term, no diffusion) seems to suggest that the solution
is rather insensitive to the exact value of in this case, as long as the scaling
with h is there.
Example: 2D steady convection with source term (1)

|~a| = 1

u=0

u=0

u u
ax + ay =f on (0, 1) (0, 1)
x y
1
1
with (ax, ay ) = ( 2 2, 2 2) and

1 (x + y 1)2
u(x, 0) = 0, u(0, y) = 0, f = exp[ 2
]
2

Exact solution goes from 0 for x + y < 1 to 1 for x + y > 1 over a length scale
of .
Example: 2D steady convection with source term (2)

Ne = 15 15; = 0.05; SUPG

1.02E+00

8.14E01

6.08E01

4.03E01

1.98E01

7.67E03

max: 1.02E+00
min:7.67E03
Example: 2D steady convection with source term (3)

Ne = 30 30; = 0.05; SUPG

1.00E+00

8.03E01

6.02E01

4.01E01

2.00E01

4.83E04

max: 1.00E+00
min:4.83E04
Example: 2D steady convection with discontinuous inflow (1)

|~a| = 1
u=1

u=0

u u
ax + ay =0 on (0, 1) (0, 1)
x y

with (ax, ay ) = ( 12 2, 12 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

1.05E+00

8.27E01

6.09E01

3.91E01

1.73E01

4.47E02

max: 1.05E+00
min:4.47E02
Example: 2D steady convection with discontinuous inflow (3)

Ne = 30 30; SUPG

1.05E+00

8.30E01

6.11E01

3.91E01

1.72E01

4.70E02

max: 1.05E+00
min:4.70E02
Example: 2D steady convection with discontinuous inflow (4)

Ne = 30 30; AD method with isotropic diffusion of |a|h/2

1.00E+00

8.00E01

6.00E01

4.00E01

2.00E01

0.00E+00

max: 1.00E+00
min: 0.00E+00
Example: 2D steady convection with discontinuous inflow (5)

Ne = 100 100; AD method with isotropic diffusion of |a|h/2

1.00E+00

8.00E01

6.00E01

4.00E01

2.00E01

0.00E+00

max: 1.00E+00
min: 0.00E+00
Observations for SUPG in 2D

B In streamline direction: SUPG greatly enhances the stability/robustness for


coarse 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 the
diffusion in the AD method (when added isotropically).

You might also like