Timestepping 2014

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 54

Time stepping methods

ATHENS course: Introduction into Finite Elements


Delft Institute of Applied Mathematics, TU Delft

Matthias Mller (m.moller@tudelft.nl)


19 November 2014

M. Mller (DIAM@TUDelft) Time stepping 19-11-2014 1 / 54


Part I
Space-Time Discretization

M. Mller (DIAM@TUDelft) Time stepping 19-11-2014 2 / 54


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 19-11-2014 3 / 54


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 19-11-2014 4 / 54


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

2.0 sec 0.9

0.8

0.7

0.6

1.5 sec 0.5

u
0.4

0.3

0.2
1.0 sec 0.1

0
2

0.5 sec 0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
t
x

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 19-11-2014 5 / 54


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 19-11-2014 6 / 54


Part II
Single-Step Methods

M. Mller (DIAM@TUDelft) Time stepping 19-11-2014 7 / 54


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 19-11-2014 8 / 54


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 19-11-2014 9 / 54


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 19-11-2014 10 / 54


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 19-11-2014 11 / 54


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 19-11-2014 12 / 54


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 19-11-2014 13 / 54


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 19-11-2014 14 / 54


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 19-11-2014 15 / 54


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 19-11-2014 16 / 54


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 19-11-2014 17 / 54


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 19-11-2014 18 / 54


Part III
Multi-Step and other Advanced Methods

M. Mller (DIAM@TUDelft) Time stepping 19-11-2014 19 / 54


Fractional-step -scheme
Given parameters (0, 1), 0 = 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+ )]0

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 19-11-2014 20 / 54


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 n+1 = un + R(tn , un )t


u 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 19-11-2014 21 / 54


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 19-11-2014 22 / 54


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

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


with predicted value R(tn+1 , u
n+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 19-11-2014 23 / 54


Runge-Kutta methods
Multipredictor-multicorrector algorithms of order p
p=2 n+1/2 = un +
u t
2
R(tn , un ) forward Euler / predictor

un+1 = un + tR(tn+1/2 , u
n+1/2 ) midpoint rule / corrector

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

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

n+1 = un + tR(tn+1/2 , u
u n+1/2 ) midpoint rule / predictor

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

+ 2R(tn+1/2 , u
n+1/2 ) + R(tn+1 , u
n+1 )] corrector

There exist embedded Runge-Kutta methods which perform extra


steps in order to estimate the error and adjust t in an adaptive fashion

M. Mller (DIAM@TUDelft) Time stepping 19-11-2014 24 / 54


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

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 19-11-2014 25 / 54


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 19-11-2014 26 / 54


Part IV
Analysis of numerical dissipation and dispersion

M. Mller (DIAM@TUDelft) Time stepping 19-11-2014 27 / 54


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 19-11-2014 28 / 54


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 19-11-2014 29 / 54


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 19-11-2014 30 / 54


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 19-11-2014 31 / 54


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 19-11-2014 32 / 54


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 19-11-2014 33 / 54


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 19-11-2014 34 / 54


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 19-11-2014 35 / 54


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 19-11-2014 36 / 54


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 19-11-2014 37 / 54


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 19-11-2014 38 / 54


Part V
Lax-Wendroff Time-Stepping Method

M. Mller (DIAM@TUDelft) Time stepping 19-11-2014 39 / 54


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 19-11-2014 40 / 54


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 19-11-2014 41 / 54


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 19-11-2014 42 / 54


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 19-11-2014 43 / 54


Part VI
Taylor-Galerkin Time-Stepping Methods

M. Mller (DIAM@TUDelft) Time stepping 19-11-2014 44 / 54


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 19-11-2014 45 / 54


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 19-11-2014 46 / 54


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 19-11-2014 47 / 54


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 19-11-2014 48 / 54


Part VII
Adaptive Time-Step Control

M. Mller (DIAM@TUDelft) Time stepping 19-11-2014 49 / 54


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 19-11-2014 50 / 54


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 19-11-2014 51 / 54


Evolutionary PID controller
kun+1 un k
Idea: Monitor the relative changes en = kun k of an indicator
variable u and keep them close to some prescribed tolerance T OL

Strategy: Use proportional-integral-differential (PID) controller

M. Mller (DIAM@TUDelft) Time stepping 19-11-2014 52 / 54


Evolutionary PID controller
Given the old solution un do:
1 Make one step of size t to compute un+1
kun+1 un k
2 Compute the relative changes en = kun k

3 If en <  reject solution and repeat time step using t = en tn

4 Adjust time step smoothly to approach the prescribed tolerance


 k  k  2 kD
en1 P T OL I en1
tn+1 = tn
en en en en2
5 Limit the growth and reduction of the time step so that
tn+1
tmin tn+1 tmax , l L
tn

Empirical PID parameter kP = 0.075, kI = 0.175, kD = 0.01

M. Mller (DIAM@TUDelft) Time stepping 19-11-2014 53 / 54


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

PID controllers provide an easy to implement and cost effective


mechanism to keep the relative changes close to a prescribed tolerance

M. Mller (DIAM@TUDelft) Time stepping 19-11-2014 54 / 54

You might also like