You are on page 1of 57

Time stepping methods

ATHENS course: Introduction into Finite Elements


Delft Institute of Applied Mathematics, TU Delft

Matthias Mller (m.moller@tudelft.nl)


18 March 2015

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 1 / 57


Objectives of this lecture

In this lecture you will learn about


single- and multi-step time integration methods
general concepts for time-stepping
explicit and implicit schemes
predictor-corrector approach
higher-order methods
the modified equation approach for stability analysis
advanced time-stepping methods with stabilizing properties
adaptive control of the time-step size

Slides and handouts are available at my website:


http://ta.twi.tudelft.nl/nw/users/matthias/teaching.html

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 2 / 57


Part I
Space-Time Discretization

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 3 / 57


Space-Time discretization
Initial-boundary value problem (IBVP)
u(x,t)


t + Lu(x, t) = f in (0, T ) time-dependent PDE


on 0 (0, T )




u(x, t) = g0

n u(x, t) = g1 on 1 (0, T ) boundary conditions

n u(x, t) + u(x) = g2 on 2 (0, T )







u(x, 0) = u0 in at t = 0 initial condition

Observation: transient term u


t represents linear convection with
unit velocity along the t-direction (forward in time)

Interpret n-dimensional IBVP as n + 1-dimensional space-time BVP

Use FEM-space discretization technique to approximate the


n + 1-dimensional BVP by a set of algebraic equations

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 4 / 57


Example: Transient heat equation
Experiment: rod with initial constant
temperature is heated from the left

Transient heat equation in 1D


2
u
t
xu2 = 0 in (0, L) (0, T ) time-dependent PDE
u(0, t) = 1 at x = 0, in (0, T ) Dirichlet boundary conditions
u(1,t)
x
=0 at x = L, in (0, T ) Neumann boundary conditions
u(x, 0) = u0 in (0, L), at t = 0 initial condition

2
final
T
Space-time heat equation L := t
x2

Lu = 0 in stationary PDE
u=1 on 0 Dirichlet boundary conditions
0 1
u
x
=0 on 1 Neumann boundary conditions
u = u0 on init Dirichlet boundary conditions 0
0 init L

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 5 / 57


Example: Transient heat equation
Transient heat equation Space-time heat equation

2.0 sec

1.5 sec

1.0 sec

0.5 sec

Grid: x = 0.05, t = 0.01


0.0 sec
u
Attains steady-state limit u 1, that is, t 0 for time t

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 6 / 57


Take home lessons #1

Time-dependent IBVPs in nD can be interpreted as stationary BVPs in


(n + 1)D subject to additional boundary conditions at init

Solution values for all time levels can be computed simultaneously

Space-time discretization can become computationally expensive (large


memory requirements and computing times especially in 3D)

Final time T must be known a priori and cannot be changed

Mesh generation in 4D is non-trivial (need for special elements)

Solutions to boundary value problems can be computed by marching


the solution of the associated transient problem to the steady state

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 7 / 57


Part II
Single-Step Methods

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 8 / 57


Time-stepping techniques
time
Idea: Unsteady flows are parabolic in time future
zone of influence
use time-stepping methods to advance present
domain of
transient solutions step-by-step in time past dependence

space

Time discretization: 0 = t0 < t1 < t2 < tM = T and solve


IBVP on short time intervals (tn , tn+1 ), where tn+1 = tn + t
t1 t2
tn tn+1 T
t0

Initialize solution values by the initial condition u0 u0 in

Given un u(tn ) use it as initial condition to compute un+1 u(tn+1 )

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 9 / 57


Time-stepping techniques
u(x, t)
Time-dependent PDE + Lu(x, t) = f in (0, T )
t

Observation: The space and time variables x and t are essentially


decoupled and can be discretized independently
Space discretization by the FEM yields time-dependent unknowns uh (t)

Method of lines (MOL): L Lh yields ODE system for ui (t)


duh (t)
+ Lh uh (t) = fh on (tn , tn+1 ) semi-discretized equations
dt

Remark: It is also possible to perform the time discretization before the


discretization in space (later in this lecture)

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 10 / 57


Method of lines (MOL)
duh (t)
MOL dt + Lh uh (t) = fh , R(t, uh (t)) = fh Lh uh (t)

duh (t)
(
dt = R(t, uh (t))
Initial value problem on (tn , tn+1 )
uh (t ) = unh
n

R tn+1 R tn+1
Exact integration tn
duh
dt dt = un+1
h unh = tn
R(t, uh (t)) dt

Mean value theorem: (tn , tn+1 )


R(, uh ( ))
un+1
h = unh + R( , uh ( ))t, t = tn+1 tn
tn tn+1

Idea: evaluate the integral numerically using a suitable quadrature rule

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 11 / 57


Two-level time-stepping schemes
Numerical integration on the time interval (tn , tn+1 )
R R R R

t t t t
tn tn+1 tn tn+1 tn tn+1 tn tn+1
left endpoint right endpoint trapezoidal rule midpoint rule

Forward Euler un+1


h = un
h + R(tn , un
h )t + O(t2 )
Backward Euler un+1
h = un
h + R(tn+1 , un+1
h ) t + O(t2 )
un+1 = un 1
R(tn , un n+1
, un+1 ) t + O(t3 )
 
Crank-Nicolson h h + 2 h ) + R(t h
n+1/2
Leapfrog method un+1
h = un
h + R(tn+1/2 , uh )t + O(t3 )

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 12 / 57


Two-level -time-stepping schemes

Standard finite difference discretization of the time derivative


un+1 unh
h
= R(tn+1 , un+1
h ) + (1 )R(tn , unh ), 01
t

where 0 1 is the implicitness parameter

=0 forward Euler O(t) explicit update of un+1


h
= 1/2 Crank-Nicolson O(t2 ) solution of (linear)
implicit
=1 backward Euler O(t) algebraic system

1
For 2 the -scheme is A-stable ( numerical solution is bounded)

So, what it the best time-stepping method then? It depends

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 13 / 57


Properties of the -scheme
The optimal choice of the time-stepping scheme depends on its purpose:

to march the numerical solution to a steady state limit (intermediate


results are immaterial) use large t to reach convergence quickly
or
to obtain a time-accurate discretization of a highly dynamic flow
problem (evolution details are essential and must be captured) use
sufficiently small time steps t to reduce temporal errors

Time discretization t0 t1 t2 . . . tn = nt . . . T = M t
T
Accumulation of truncation errors n = 0, 1, . . . , M 1, M= t

loc p
= O(t ) glob
= M loc
= O(t
p1
)
The order of a time-stepping method (i.e., the asymptotic rate at which the
error is reduced as t 0) is not the sole indicator of accuracy

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 14 / 57


Explicit vs. implicit time-stepping schemes

Explicit time-stepping schemes

easy to implement and parallelize, low cost per time step

a good starting point for the development of CFD software

small time steps are required for stability reasons, especially


if the velocity and/or mesh size are varying strongly
extremely inefficient for solution of stationary problems
unless local time-stepping i.e. t = t(x) is employed

Remark: Use the forward Euler method ( = 0) with care since


it may be unconditionally unstable (e.g., for standard Galerkin in space)

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 15 / 57


Explicit vs. implicit time-stepping schemes

Implicit time-stepping schemes

stable over a wide range of time steps, sometimes unconditionally

constitute excellent iterative solvers for steady-state problems

difficult to implement and parallelize, high cost per time step

insufficiently accurate for truly transient problems at large t

convergence of linear solvers deteriorates/fails as t increases

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 16 / 57


Galerkin method of lines
Continuous problem: find u V such that
Z  
u
v + Lu f dx = 0 v V, t (tn , tn+1 )
t

N
uni u(xi , tn )
P
FEM approximation uh (x, t) = uj (t)j (x),
j=1

Semi-discrete problem: find uh Vh such that


N Z N Z
i = 1, . . . , N,
  Z
X duj X
i j dx + i Lj dx uj = i f dx,
j=1 | {z
dt j=1 | t (tn , tn+1 )
} {z } | {z }
mij aij bi

du
Differential-Algebraic Equation (DAE) + Au = b MC
dt
where MC = {mij } is the mass matrix and u(t) = [u1 (t), . . . , uN (t)]T

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 17 / 57


Galerkin method of lines
Galerkin MOL MC du
dt + Au = b, R(t, u) = MC1 [b Au]

[MC tA]un+1 = [MC + (1 )tA]un + tbn+

where bn+ = bn+1 + (1 )bn , 0 1, n = 0, 1, . . . , M 1

Linear algebraic system needs to be solved even for explicit scheme ( = 0)

Idea: Replace MC by the lumped mass matrix ML = diag{mi } where


P R P R P
mi = mij = i , j dx = i dx since 1
j j j

for most finite elements. 1D case FDM=FVM=FEM+mass lumping

Lumped-Galerkin MOL ML du
dt + Au = b, R(t, u) = ML1 [b Au]

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 18 / 57


Take home lessons #2

Due to the parabolic nature of unsteady flows, time-stepping


schemes can be used to advance transient solutions step-by-step

Space discretizations techniques yield a first-order ODE system


which is integrated forward in time numerically (method of lines)

Galerkin method of lines leads to differential-algebraic equations un-


less the consistent mass matrix is replaced by the lumped mass matrix

The optimal choice of the time-stepping scheme depends on its


purpose (steady-state vs. dynamic flows, explicit vs. implicit)

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 19 / 57


Part III
Multi-Step and other Advanced Methods

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 20 / 57


Fractional-step -scheme
Given parameters (0, 1), = 1 2, and [0, 1] subdivide time
interval (tn , tn+1 ) into three substeps and update the solution as follows

Step 1. un+ = un + [R(tn+ , un+ )


+ (1 )R(tn , un )]t

Step 2. un+1 = un+ + [(1 )R(tn+1 , un+1 )


+ R(tn+ , un+ )]

Step 3. un+1 = un+1 + [R(tn+1 , un+1 )


+ (1 )R(tn+1 , un+1 )]t

Properties of this time-stepping method



second-order accurate in the special case = 1 2
2
coefficient matrices are the same for all substeps if = 12
1
combine the advantages of Crank-Nicolson and backward Euler

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 21 / 57


Predictor-corrector and multipoint methods
Objective: to combine the simplicity of explicit schemes and robustness
of implicit ones in the framework of a fractional-step algorithm, e.g.,

1. Predictor un+1 = un + R(tn , un )t forward Euler


n+1 n 1 n n
2. Corrector u =u + 2 [R(t , u ) Crank-Nicolson
n+1 n+1
+R(t , u )]t
n+1 n n+1 n+1
or u = u + R(t , u )t backward Euler

Stability still leaves a lot to be desired, additional correction steps


usually do not pay off since iterations may diverge if t is too large

Order barrier: two-level methods are at most second-order accurate, so


extra points are needed to construct higher-order integration schemes
t1 t2
tn2 tn tn+1 T
t0 tn1

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 22 / 57


Adams methods
R
Derivation: polynomial fitting past present future

Truncation error: glob


= O(tp )
for polynomials of degree p 1 which
t
interpolate function values at p points tn2 tn1 tn tn+1

Adams-Bashforth methods (explicit)


p=1 un+1 = un + tR(tn , un ) forward Euler
n+1 n
p=2 u =u + t
2
[3R(tn , un ) R(tn1 , un1 )]
p=3 un+1 = un + t
12
[23R(tn , un ) 16R(tn1 , un1 ) + 5R(tn2 , un2 )]

Adams-Moulton methods (implicit)


p=1 un+1 = un + tR(tn+1 , un+1 ) backward Euler
p=2 un+1 = un + t
2
[R(tn+1 , un+1 ) + R(tn , un )] Crank-Nicolson
n+1 n
p=3 u =u + t
12
[5R(tn+1 , un+1 ) + 8R(tn , un ) R(tn1 , un1 )]

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 23 / 57


Adams methods
Predictor-corrector algorithm
1 Compute un+1 using an Adams-Bashforth method of order p 1

2 Compute un+1 using an Adams-Moulton method of order p


with predicted value R(tn+1 , un+1 ) instead of R(tn+1 , un+1 )

methods of any order are easy to derive and implement


only one function evaluation per time step is performed
error estimators for ODEs can be used to adapt the order
other methods are needed to start/restart the calculation
time step is difficult to change (coefficients are different)
tend to be unstable and produce nonphysical oscillations

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 24 / 57


Runge-Kutta methods

Multipredictor-multicorrector algorithms of order p


p=2 u(1) = un + t
2
R(tn , un ) forward Euler / predictor

un+1 = un + tR(tn + 12 t, u(1) ) midpoint rule / corrector

p=4 u(1) = un + t
2
R(tn , un ) forward Euler / predictor

u(2) = un + t
2
R(tn + 12 t, u(1) ) backward Euler / corrector

u(3) = un + tR(tn + 12 t, u(2) ) midpoint rule / predictor

un+1 = un + t
6
[R(tn , un ) + 2R(tn + 12 t, u(1) ) Simpson rule

+ 2R(tn + 12 t, u(2) ) + R(tn+1 , u(3) )] corrector

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 25 / 57


Runge-Kutta methods
Another view on Runge-Kutta methods (p = 4)

t
u(1) = un + R(tn , un ), k (1) = R(tn , u(0) )
2
t
u(2) = un + R(tn + 0.5t, u(1) ) k (2) = R(tn + 0.5t, u(1) )
2
u(3) = un + tR(tn + 0.5t, u(2) ) k (3) = R(tn + 0.5t, u(2) )

t
un+1 = un + [R(tn , un )+
6
2R(tn + 0.5t, u(1) )+
2R(tn + 0.5t, u(2) )+
R(tn + t, u(3) )]

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 26 / 57


Runge-Kutta methods

Another view on Runge-Kutta methods (p = 4)

k (1) = R(tn , un )
t (1)
k (2) = R(tn + 0.5t, un + k )
2
t (2)
k (3) = R(tn + 0.5t, un + k )
2
k (4) = R(tn + 1.0t, un + tk (3) )

t (1)
un+1 = un + [k + 2k (2) + 2k (3) + k (4) ]
6

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 27 / 57


Runge-Kutta methods

Generic s-step explicit Runge-Kutta method

k (1) = R(tn , un )
(2)
k = R(tn + c2 t, un + t(a21 k (1) ))
k (3) = R(tn + c3 t, un + t(a31 k (1) + a32 k (2) ))
..
.
k (s) = R(tn + cs t, un + t(as1 k (1) + as2 k (2) + + as,s1 k (s1) ))

un+1 = un + t[b1 k (1) + b2 k (2) + + bs k (s) ]

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 28 / 57


Runge-Kutta methods
Butcher tableau of generic s-step explicit Runge-Kutta method
0
c2 a21
c3 a31 a32
.. .. ..
. . .
c2 as1 as2 ... as,s1
b1 b2 ... bs1 bs
b1 b2 ... bs1 bs
Embedded Runge-Kutta methods compute solutions of order p and p 1
un+1 = un + t[b1 k (1) + b2 k (2) + + bs k (s) ]
u = un + t[b1 k (1) + b2 k (2) + + bs k (s) ]
and estimate the error of the solution as follows
en+1 = un+1 u = (b1 b1 )k (1) + (b2 b2 )k (2) + + (bs bs )k (s)

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 29 / 57


Runge-Kutta methods
Runge-Kutta methods

self-starting, easy to operate with variable time steps

more stable and accurate than Adams methods of the same order

universal implementation via Butcher tableaux

high order approximations are rather difficult to derive;


p function evaluations per time step are required
more expensive than Adams methods of comparable order

Use of variable time step sizes makes it possible to achieve


the desired accuracy at a relatively low computational cost

Explicit method: use the largest time step satisfying the stability condition

Implicit method: estimate the error and adjust the time step if necessary

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 30 / 57


Take home lessons #3

Advantages of Crank-Nicolson and backward Euler method


can be combined by using the fractional-step -scheme

Second-order barrier of two-level methods can be avoided by


adding extra points from previous time steps (Adams methods)

Simple time-stepping schemes can be combined in a predictor-corrector


algorithm (Runge-Kutta methods)

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 31 / 57


Part IV
Analysis of numerical dissipation and dispersion

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 32 / 57


Properties of numerical methods
Example: convection-dominated / hyperbolic PDEs P e  1, Re  1

u u
+v = 0, v>0
t x

High-order numerical method


wiggles (phase errors)

Low-order numerical method


smearing (amplitude errors)

Objective: to analyze the creation of wiggles and the smearing of solu-


tions; design accurate methods which do not lead to spurious oscillations

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 33 / 57


Modified equation method
Motivation: PDEs are difficult or impossible to solve analytically but their
qualitative behavior is easier to predict than that of discretized equations

Observation: exact solution (no roundoff errors) of the discretized equa-


tions satisfies a PDE which is generally different from the one to be solved

Original PDE Numerical method solves modified equation



u u X 2p u X 2p+1 u
+ Lu = 0 + Lu = 2p 2p + 2p+1 2p+1
t t p=1
x p=1
x

1 Expand all nodal values in the difference scheme in a double Taylor


series about a single point (xi , tn ) of the space-time mesh PDE

2 Express high-order time derivatives and mixed derivatives in this


PDE in terms of space derivatives only modified equation

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 34 / 57


Derivation of the modified equation
u
Example: pure convection equation t + v u
x = 0, v > 0 discretized by

BDS in space un+1 uni un uni1


FE in time
i
+v i = 0 (upwind)
t x

Taylor series expansions about the point (xi , tn )


 n  n
u n (t)2 2u (t)3 3u
un+1 = un

i i + t t i
+ 2 t2
+ 6 t3
+ ...
i i
 n  n
u n (x)2 2u (x)3 3u
un n

i1 = ui x x i
+ 2 x2
6 x3
+ ...
i i

Substitution into the difference scheme yields


 n  n  n  n
u
n 2u (t)2 3u 2u v(x)2 3u
() t
+ v u
x i
= t
2 t2
6 t3
+ vx
2 x2
6 x3
+ ...
i i i i

Next step: Replace high-order time derivatives by space derivatives

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 35 / 57


Derivation of the modified equation
Differentiate () with respect to t to obtain

2u u2 3 (t)2 4 u vx 3 u v(x)2 4 u
(1) t2 + v xt = t u
2 t3 6 t4 + 2 x2 t 6 x3 t + ...

Differentiate () with respect to x and multiply by v to obtain


2
u 2 3 v(t)2 4 u v 2 x 3 u v 2 (x)2 4 u
(2) v tx + v 2 xu2 = vt u
2 t2 x 6 t3 x + 2 x3 6 x4 + ...

Subtract (2) from (1) and drop high-order terms to obtain


h 3 i h i
2u 2 3
3u 2 3u
(3) t2
= v 2 xu2 + t
2
t3u + v t2 x
u
+ O(t) + x
2
v x2 t v x3 + O(x)

Replace 3rd order time derivative and mixed derivatives by space derivatives

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 36 / 57


Derivation of the modified equation
Differentiate (2) with respect to x and divide by v to obtain
3u 3
(4) x2 t = v xu3 + O[t, x]

Differentiate (3) with respect to t and x to obtain respectively


3u u 3
3u 3
(5) t3 = v 2 x2 t + O[t, x] and (6) t2 x = v 2 xu3 + O[t, x]

3u 3
Equations (5) and (4) imply (7) t3 = v 3 xu3 + O[t, x]

Plugging equations (4), (6), and (7) into (3) yields


2u 2 3
(8) t2 = v 2 xu2 + v 2 (vt x) xu3 + O[t, x]

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 37 / 57


Derivation of the modified equation
Substitute (7) and (8) into () to obtain the modified equation
h i
u 2
2u 3 v 3 (t)2 3 u vx 2 u v(x)2 3 u
t
+ v u
x
= v t
2 x2
+ (vt x) xu3 + 6 x3
+ 2 x2
6 x3
+...

t
Reformulation in terms of the Courant number = v x yields

Modified equation for FE/BDS discretization of


u
t
+ v u
x
= 0, v > 0
u u vx 2u v(x)2 3u
+v = (1 ) 2 + (3 2 2 1) 3 + . . .
|t {z x} |2 {z x } | 6 {z x }
original PDE numerical dissipation numerical dispersion

Remark: the CFL stability condition 1 must be satisfied for the discrete
problem to be well-posed. In the case > 1, the numerical diffusion coefficient
vx
2 (1 ) is negative, which corresponds to a backward heat equation.

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 38 / 57


Significance of terms in the modified equation
Exact solution of the discretized equation satisfies the modified equation

u X 2p u X 2p+1 u
+ Lu = 2p 2p + 2p+1 2p+1 , with L=v
t p=1
x p=1
x x

2p u
Even-order derivatives x2p

cause numerical dissipation


smearing (amplitude errors)

2p+1 u
Odd-order derivatives x2p+1

cause numerical dispersion


wiggles (phase errors)

Qualitative analysis: the numerical behavior of the discretization scheme largely


depends on the relative importance of dispersive and dissipative effects

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 39 / 57


Forward Euler central difference scheme
Stability condition (necessary but not sufficient)
Coefficients of the even-order derivatives in the modified equation must have
alternating signs, the one for the second-order term being positive

Modified equation for the FE/CDS scheme

u u vx 2 u v(x)2 3u
+v = 2 (1 + 2 2 ) 3 + . . .
t x 2 x 6 x
t
where = v x is the Courant number

FE/CDS scheme is unconditionally unstable since the coefficient

vx v 2 t
= <0 v 6= 0
2 2
of the second-order term is negative for nonzero velocity

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 40 / 57


Forward Euler finite element method
Stability condition (necessary but not sufficient)
Coefficients of the even-order derivatives in the modified equation must have
alternating signs, the one for the second-order term being positive

t
Modified equation for the FE/FEM scheme with = v x

u u vx 2 u v(x)2 2 3 u
+v = 2 + ...
t x 2 x 3 x3
Elimination of leading dispersion error due to space discretization

FE/FEM scheme is unconditionally unstable since the coefficient

vx v 2 t
= <0 v 6= 0
2 2
of the second-order term is negative for nonzero velocity

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 41 / 57


Stabilization by means of artificial diffusion
Stabilization strategy: if the necessary stability condition is violated, it
can be enforced by adding artificial diffusion to the numerical scheme:

Stabilized methods
+(v )2 u streamline diffusion

Nonoscillatory methods
+(v )2 u + (u)u shock-capturing viscosity

2u
Remark: in the one-dimensional case both terms are proportional to x2

Free parameters depending on the mesh size h and the residual R(u)
c h
= 1+|v| , (u) = c h2 R(u)

Problem: how to determine proper values of the constants c and c ? ? ?

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 42 / 57


Take home lessons #4

The exact solution of the discretized equations does not


satisfy the original PDE but the modified equation

Even-order derivatives in the modified equation cause numerical


dissipation which affects to amplitude errors ( smearing )

Odd-order derivatives in the modified equation cause numerical


dispersion which affects the phase errors ( wiggles)

For stability, the coefficients of the even-order derivatives must have


alternating sign, the one for the second-order term being positive

Numerical schemes can be stabilized by adding artificial diffusion

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 43 / 57


Part V
Lax-Wendroff Time-Stepping Method

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 44 / 57


Lax-Wendroff method
Objective: to use a high-order time-stepping method for stabilization

u
Consider a time-dependent PDE t + Lu = 0 in (0, T )

1 Discretize it in time by means of the Taylor series expansion


n (t)2  2 u n
un+1 = un + t u t + 2 t2 + O(t3 )

2 Transform time derivatives into space derivatives using the PDE


u 2u u u
 2
t = Lu, t2 = t t = t (Lu) = L t = L u

3 Substitute the resulting expressions into the Taylor series


(t)2 2 n
un+1 = un tLun + 2 L u + O(t3 )

4 Perform space discretization using the FDM / FVM / FEM

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 45 / 57


Lax-Wendroff central difference scheme
u
Example: pure convection equation t + v u
x = 0
u 2u 2
Time derivatives L = v x t = v u
x , t2 = v 2 xu2

2 2
 n
u n 2u
+ v (t)

Semi-discrete scheme un+1 = un vt x 2 x2 + O(t3 )

Central difference approximation (CDS) in space


 2 
u
 ui+1 ui1 2 u ui+1 2ui +ui1
x i = 2x + O(x ), x2 = (x)2 + O(x2 )
i

Fully discrete LW/CDS scheme


un+1 un un un v 2 t un n n
i+1 2ui + ui1
i i
+ v i+1 i1
= 2
+O[t2 , x2 ]
| t {z 2x } | 2 (x)
{z }
FE/CDS scheme numerical dissipation

FE/CDS scheme stabilized by artificial diffusion (no adjustable parameter)

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 46 / 57


Lax-Wendroff central difference scheme
Modified equation for the LW/CDS scheme

u u v(x)2 3 u v(x)3 4u
+v = (1 2 ) 3 (1 2 ) 4
t x 6 x 8 x
v(x)4 5u
(1 + 5 2 6 4 ) 5 + . . . , t
= v x
120 x

conditionally stable for 2 1 in 1D, 2 1


8
in 2D, 2 1
27
in 3D

the second-order derivative (leading dissipation error) has been eliminated

the leading truncation error vanishes for 2 = 1 (unit CFL property)

the negative dispersion coefficient corresponds to a lagging phase error i. e.


harmonics travel too slow, spurious oscillations occur behind steep fronts

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 47 / 57


Lax-Wendroff finite element method
Modified equation for the LW/FEM scheme

u u v(x)2 2 3 u v(x)3 4u
+v = 3
(1 3 2 ) 4
t x 6 x 24 x
v(x)4 15 5u
+ (1 2 + 9 4 ) 5 + . . . , t
= v x
180 2 x

conditionally stable for 2 1


3
in 1D, 2 1
24
in 2D, 2 1
81
in 3D

the second-order derivative (leading dissipation error) has been eliminated

the truncation error does not vanish for 2 = 1 (no unit CFL property)

the positive dispersion coefficient corresponds to a leading phase error i. e.


harmonics travel too fast, spurious oscillations occur ahead of steep fronts

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 48 / 57


Part VI
Taylor-Galerkin Time-Stepping Methods

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 49 / 57


Taylor-Galerkin methods
TG methods: family of high-order time-stepping schemes which stabilize
the convective terms by means of intrinsic streamline diffusion (Donea 84)

Generic procedure (to be adapted for a particular scheme)

1 Taylor series expansion(s) in time up to the third/fourth order


un+1 = un + . . . , un = un+1 . . . or un1 = un . . .

2 Transform time derivatives into space derivatives avoiding third-


order space derivatives. As example, let u
t + Lu = 0 then
u 2u 3u n+1
un
t = Lu, t2 = L2 u, t3 = L2 u
t = L
2u
t + O(t)

3 Substitute the resulting expressions into the Taylor series and


perform space discretization using the FEM / FDM / FVM

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 50 / 57


Euler Taylor-Galerkin scheme
u
Consider convection-dominated PDE t + Lu = 0 in (0, T )

Taylor series expansion up to the third order


 n  n
u n
 (t)2 2u (t)3 3u
un+1 = un + t t + 2 t2 + 6 t3 + O(t3 )

2u 3u n+1
un
Substitution of u
t
= Lu, t2
= L2 u, t3
= L2 u t
+ O(t)

yields the semi-discrete FE/TG scheme


(t)2 2 n (t)2 2 n+1
un+1 = un tLun + 2 L u + 6 L (u un ) + O(t4 )

The Lax-Wendroff scheme is recovered for un+1 = un (steady state)

h i
(t)2 2 un+1 un t 2 n
Equivalent form I 6 L t = Lun + 2 L u

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 51 / 57


Euler Taylor-Galerkin scheme
u
Example: pure convection equation t + v u
x = 0,

L = v x
discretized in space by the Galerkin FEM with linear elements

Modified equation for the FE/TG scheme

u u v(x)3 4u
+v = (1 2 ) 4 t
= v x
t x 24 x
v(x)4 5u
+ (1 5 2 + 4 4 ) 5 + . . .
180 x

conditionally stable for 2 1 in 1D, 2 1


8
in 2D, 2 1
27
in 3D

the leading truncation error vanishes for 2 = 1 (unit CFL property)

the leading dispersion error is of higher order than that for LW/FEM

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 52 / 57


Take home lessons #5

Numerical methods can be stabilized using high-order time-stepping


schemes which introduce artificial diffusion (no free parameter)

Such methods can be constructed by the three-step approach:


discretize the PDE in time by a Taylor series expansion
replace time derivatives by space derivatives using the PDE
perform discretization in space by FDM / FVM / FEM

Lax-Wendroff methods involve space derivative which may be


3u
significantly higher than in the original PDE (e.g. t3 = L3 u)

Taylor-Galerkin methods avoid higher-order space derivatives but


their derivation needs to be adapted for each particular scheme

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 53 / 57


Part VII
Adaptive Time-Step Control

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 54 / 57


Automatic time step control
Objective: to make sure that ku ut k T OL (prescribed tolerance)
Assume that the error at t = tn is equal to zero (no accumulation)

Local truncation error Heuristic error analysis


ut = u + t2 e(u) + O(t4 ) umt ut
e(u)
umt = u + m2 t2 e(u) + O(t4 ) t2 (m2 1)

Estimate of the relative error


 2
t kumt ut k
ku ut k = T OL
t m2 1

Adaptive time stepping Richardson extrapolation


2 2
t (m 1) m2 ut umt
t2 = T OL u= + O(t4 )
kut umt k m2 1

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 55 / 57


Practical implementation
Given the old solution un do:
1 Make one large time step of size mt to compute umt
2 Make m small time steps each of size t to compute ut
3 Evaluate the relative solution changes kut umt k
4 Calculate the optimal value t for the next time step
5 If t  t, reset the solution and go back to the beginning
6 Set un+1 = ut or perform Richardson extrapolation

enhance robustness and overall efficiency of the code


simulation results are more credible due to estimated error
cost per time step increases substantially (umt may be as expensive to
obtain as ut due to slow convergence at large time steps)

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 56 / 57


Take home lessons #6

Adaptive time-stepping enhances the robustness of the code,


the overall efficiency and the credibility of simulation results

Automatic time step control is based on local truncation error analysis

M. Mller (DIAM@TUDelft) Time stepping 18-03-2015 57 / 57

You might also like