Basics on Numerical Methods for Hyperbolic Equations

Similar documents
Non-linear Methods for Scalar Equations

Advection / Hyperbolic PDEs. PHY 604: Computational Methods in Physics and Astrophysics II

Non-linear Scalar Equations

RESEARCH HIGHLIGHTS. WAF: Weighted Average Flux Method

VISCOUS FLUX LIMITERS

Simplified ADER schemes based on a time-reconstruction GRP solver

Numerical Solutions for Hyperbolic Systems of Conservation Laws: from Godunov Method to Adaptive Mesh Refinement

Linear Hyperbolic Systems

ENO and WENO schemes. Further topics and time Integration

Conservation Laws and Finite Volume Methods

7 Hyperbolic Differential Equations

DEVELOPMENT AND APPLICATION OF GENERALIZED MUSTA SCHEMES

The RAMSES code and related techniques I. Hydro solvers

PDEs, part 3: Hyperbolic PDEs

Numerical Methods for Hyperbolic Conservation Laws Lecture 4

Math 660-Lecture 23: Gudonov s method and some theories for FVM schemes

Riemann Solvers and Numerical Methods for Fluid Dynamics

FDM for wave equations

Lecture Notes on Numerical Schemes for Flow and Transport Problems

The one-dimensional equations for the fluid dynamics of a gas can be written in conservation form as follows:

Ordinary Differential Equations

Conservation Laws and Finite Volume Methods

2.2. Methods for Obtaining FD Expressions. There are several methods, and we will look at a few:

Lecture Notes on Numerical Schemes for Flow and Transport Problems

3.4. Monotonicity of Advection Schemes

AMath 574 February 11, 2011

Finite Volume Schemes: an introduction

A New Fourth-Order Non-Oscillatory Central Scheme For Hyperbolic Conservation Laws

Chapter 10 Exercises

ADER Schemes on Adaptive Triangular Meshes for Scalar Conservation Laws

Tutorial 2. Introduction to numerical schemes

Part 1. The diffusion equation

A numerical study of SSP time integration methods for hyperbolic conservation laws

Basic Aspects of Discretization

SMOOTHNESS INDICATORS FOR WENO SCHEME USING UNDIVIDED DIFFERENCES

2.29 Numerical Fluid Mechanics Spring 2015 Lecture 13

Introduction to Partial Differential Equations

MIT (Spring 2014)

Chapter 3. Finite Difference Methods for Hyperbolic Equations Introduction Linear convection 1-D wave equation

NUMERICAL SOLUTION OF HYPERBOLIC PARTIAL DIFFERENTIAL EQUATIONS

ME Computational Fluid Mechanics Lecture 5

A Higher-Order Finite Volume Method for Non-Conservative Equations on 2D Unstructured Quadrilateral Grids

Comparison of Approximate Riemann Solvers

Finite Difference Method for PDE. Y V S S Sanyasiraju Professor, Department of Mathematics IIT Madras, Chennai 36

Sung-Ik Sohn and Jun Yong Shin

Applied Mathematics 205. Unit III: Numerical Calculus. Lecturer: Dr. David Knezevic

Two-waves PVM-WAF method for non-conservative systems

Notes: Outline. Shock formation. Notes: Notes: Shocks in traffic flow

A parametrized maximum principle preserving flux limiter for finite difference RK-WENO schemes with applications in incompressible flows.

Numerical methods Revised March 2001

Basics of Discretization Methods

A Multi-Dimensional Limiter for Hybrid Grid

Dissipation and Dispersion

Weighted Essentially Non-Oscillatory limiters for Runge-Kutta Discontinuous Galerkin Methods

1D Heat equation and a finite-difference solver

Solution Methods. Steady State Diffusion Equation. Lecture 04

College of Aeronatics Report No.8907 June 1989

Numerical Methods for Conservation Laws WPI, January 2006 C. Ringhofer C2 b 2

Relevant self-assessment exercises: [LIST SELF-ASSESSMENT EXERCISES HERE]

Time stepping methods

On the Comparison of the Finite Volume and Discontinuous Galerkin Methods

Finite Differences: Consistency, Stability and Convergence

Method of Lines. Received April 20, 2009; accepted July 9, 2009

Hyperbolic Partial Differential Equations

Large Time Step Scheme Behaviour with Different Entropy Fix

Finite difference methods for the diffusion equation

Cranfield ^91. College of Aeronautics Report No.9007 March The Dry-Bed Problem in Shallow-Water Flows. E F Toro

Scientific Computing: An Introductory Survey

The Center for Astrophysical Thermonuclear Flashes. FLASH Hydrodynamics

HIGH ORDER FINITE VOLUME SCHEMES BASED ON RECONSTRUCTION OF STATES FOR SOLVING HYPERBOLIC SYSTEMS WITH NONCONSERVATIVE PRODUCTS

Entropy stable schemes for degenerate convection-diffusion equations

International Engineering Research Journal

TOTAL VARIATION DIMINISHING RUNGE-KUTTA SCHEMES

ALGEBRAIC FLUX CORRECTION FOR FINITE ELEMENT DISCRETIZATIONS OF COUPLED SYSTEMS

HIGH ORDER LAX-WENDROFF-TYPE SCHEMES FOR LINEAR WAVE PROPAGATION

Strong Stability-Preserving (SSP) High-Order Time Discretization Methods

MASSACHUSETTS INSTITUTE OF TECHNOLOGY DEPARTMENT OF MECHANICAL ENGINEERING CAMBRIDGE, MASSACHUSETTS NUMERICAL FLUID MECHANICS FALL 2011

Implicit schemes of Lax-Friedrichs type for systems with source terms

Multi-Factor Finite Differences

Finite difference method for elliptic problems: I

AMS 529: Finite Element Methods: Fundamentals, Applications, and New Trends

Finite volume method for conservation laws V

Introduction to numerical schemes

Generalised Summation-by-Parts Operators and Variable Coefficients

Numerically Solving Partial Differential Equations

The Riemann problem. The Riemann problem Rarefaction waves and shock waves

Bound-preserving high order schemes in computational fluid dynamics Chi-Wang Shu

Scientific Computing I

arxiv: v1 [physics.comp-ph] 22 Feb 2013

Universität des Saarlandes. Fachrichtung 6.1 Mathematik

Positivity-preserving high order schemes for convection dominated equations

Advanced numerical methods for nonlinear advectiondiffusion-reaction. Peter Frolkovič, University of Heidelberg

Francis X. Giraldo,

ECE539 - Advanced Theory of Semiconductors and Semiconductor Devices. Numerical Methods and Simulation / Umberto Ravaioli

Numerical Solution Techniques in Mechanical and Aerospace Engineering

AM 205: lecture 14. Last time: Boundary value problems Today: Numerical solution of PDEs

A THEORETICAL INTRODUCTION TO NUMERICAL ANALYSIS

Diffusion / Parabolic Equations. PHY 688: Numerical Methods for (Astro)Physics

Flood Routing by the Non-Linear Muskingum Model: Conservation of Mass and Momentum

Notes: Outline. Diffusive flux. Notes: Notes: Advection-diffusion

Transcription:

Basics on Numerical Methods for Hyperbolic Equations Professor Dr. E F Toro Laboratory of Applied Mathematics University of Trento, Italy eleuterio.toro@unitn.it http://www.ing.unitn.it/toro October 8, 4 / 57

We introduce finite difference methods as applied to the linear advection equation in one space dimension We derive the most well-known schemes applicable to hyperbolic systems and highlight their basic features We reformulate some of these finite difference methods in conservative form, as applied to systems of hyperbolic equations / 57

Initial-Boundary Value Problem (IBVP) We consider the initial-boundary value problem (IBVP) for the linear advection equation PDE: t q + λ x q =, x [a, b], t >, IC: q(x, ) = h(x), x [a, b], t =, BCs: q(a, t) = b L (t) ; q(b, t) = b R (t), t. () [a, b] defines the spatial domain h(x) is the initial condition (IC) at the initial time t =, a prescribed function of x b L (t) and b R (t) are prescribed functions of time and define boundary conditions (BCs) at x = a (left) and at x = b (right) 3 / 57

Discretising the domain Partition of the spatial domain [a, b] into M + equidistant points x i = a + i x, i =,..., M +, x = b a M +. () See Fig.. M interior points: x, x,..., x M, and two boundary points: x = a and x M+ = b. Partition of the temporal domain [, T out ] into a set of time points, or time levels, t n = n t, n =,..., N out,.... (3) See Fig.. t = : initial time, T out = tn out, t: timestep. Assume fixed relationship between t and x of the form x = t K, K : constant 4 / 57

Fig.. Finite difference mesh. 5 / 57

Discrete values As a consequence of having replaced the continuous domain [a, b] [, ) by a mesh made up of a finite number of points (x i, t n ) we first need to replace the continuous distribution of the function q(x, t) by a finite number of discrete values q(x i, t n ) associated with these points. Then in order to solve the differential equation in this discrete setting we also need to represent in discrete form the partial derivatives t q(x, t) and x q(x, t) in (). Here we do so by finite difference approximations. In this manner the partial differential equation is represented by a difference equation, an expression that relates approximate discrete values of the solution at neighbouring points. The differential operator is replaced by a numerical operator, as we shall see. 6 / 57

Finite difference approximation to derivatives Fig.. Finite difference approximation to derivatives. Assume a smooth function g(z), a point z and all the derivatives g (k) (z ) at z. From Taylor s theorem we may find g(z + z) as g(z + z) = g(z )+ zg (z )+ z g () (z )+ 6 z3 g (3) (z )+O( z 4 ). Here O( z 4 ) is the asymptotic form of the truncating error. (4) 7 / 57

Then we make use of (4) for obtaing an approximation to the derivatives of g. For example we can write g(z + z) g(z ) = zg (z ) + z g () (z ) + 6 z3 g (3) (z ) + O( z 4 ) and on division through by z and rearranging we obtain g (z ) = g(z + z) g(z ) z + O( z). (5) By neglecting O( z) we obtain an approximation to g (z ) This approximation to g (z ) is a one-sided approximation, called forward approximation to the derivative Note the form of the error in the approximation (5), said to be of first order, as it involves a first power of the distance z. 8 / 57

An alternative to the forward approximation (5) results from using z and its left neighbour z z. From Taylor s theorem g(z z) = g(z ) zg (z )+ z g () (z ) 6 z3 g (3) (z )+O( z 4 ), from which we obtain g (z ) = g(z ) g(z z) z (6) + O( z). (7) This first-order one-sided approximation is called backward approximation to the derivative. A more accurate approximation to g (z ) can be obtained by substracting (6) from (5), performing some manipulations, leading to g (z ) = g(z + z) g(z z) z + O( z ). (8) which is a second-order approximation, called the centred approximation, as it uses information from the left and right of the centre point z. Fig. illustrates the true and approximate first derivatives of g(z). 9 / 57

Example: one-sided second order approximation Find a second-order approximation to the derivative g (z ) using the three equidistant points z z, z z and z. : Consider Taylor expansions at z z and z z g(z z) = g(z ) zg (z )+ ( z) g () (z ) 6 ( z)3 g (3) (z )+O( z 4 ) g(z z) = g(z ) zg (z )+ z g () (z ) 6 z3 g (3) (z )+O( z 4 ). () Multiplying () by 4 and substracting (9) gives g (z ) = 3g(z ) 4g(z z) + g(z z) z (9) + O( z ), () a second-order one-sided approximation to g (z ) at the point z. Exercise. Using (4) and (6) show that g (z ) = g(z + z) g(z ) + g(z z) z + O( z ). () / 57

The method of finite differences The finite difference method replaces the continuous domain of the problem by a finite number mesh of (x i, t n ), called the mesh The exact value q(x i, t n ) at the mesh point (x i, t n ) is approximated by qi n, that is qi n q(x i, t n ). (3) Subscript i in qi n denotes the spatial position and Supercript n (not an exponent) denotes the time level. The partial derivatives t q(x, t) and x q(x, t) in the PDE in () are then replaced by appropriate finite difference approximations, as seen in what follows. / 57

Consider the generic point (x i, t n ) of the mesh. The temporal partial derivative t q(x, t) can be approximated in a variety of ways, such as t q(x i, t n ) = q(x i, t n+ ) q(x i, t n ) + O( t), Forward, t q(x i, t n ) q(x i, t n ) + O( t), Backward, t q(x i, t n+ ) q(x i, t n ) + O( t ), Centred. t Analogously, for the spatial partial derivative x q(x, t) in () at the point (x i, t n ) we write x q(x i, t n ) = (4) q(x i+, t n ) q(x i, t n ) + O( x), Forward, x q(x i, t n ) q(x i, t n ) + O( x), Backward, x q(x i+, t n ) q(x i, t n ) + O( x ), Centred. x (5) / 57

The method of Godunov: finite difference version This method uses the following approximations to partial derivatives t q(x i, t n ) = q(x i, t n+ ) q(x i, t n ) + O( t) t q(x i, t n ) q(x i, t n ) + O( x) if λ > x q(x i, t n ) = x q(x i+, t n ) q(x i, t n ) + O( x) if λ < x (6) The time derivative is approximated forward-in-time The space derivate is approximated by a one-sided, upwind, space derivate discretisation, according to the sign of the speed For linear equations the method was first proposed Courant, Isaacson and Rees (95) Godunov (959) extended the upwind method in conservation form to solve non-linear equations 3 / 57

The differential operator in () is L e (q) t q(x, t) + λ x q(x, t) =, (7) which when applied to the point (x i, t n ) of the mesh, for λ >, becomes L e (q(x i, t n )) = t q(x i, t n ) + λ x q(x i, t n ) = q(x i, t n+ ) q(x i, t n ) t + O( t) +λ[ q(x i, t n ) q(x i, t n ) ] + O( x) x =. Suppressing O( t) + O( x) and replacing q(x i, t n ) by qi n qi n+ qi n ( q n + λ i q n ) i =. t x Solving for q n+ i we obtain the numerical scheme q n+ i = q n i λ t x gives (8) ( q n i qi n ). (9) 4 / 57

The Courant-Friedrichs-Lewy number, or the CFL number, or simply Courant number is defined as c = λ t x = λ x/ t. () This is a dimensionless quantity, it is the ratio of the speed λ in the PDE in () and the mesh speed x/ t. Then the upwind scheme becomes q n+ i = q n i c ( q n i q n i ). () n + n i i i+ Fig. 3. Stencil for Godunov s method for positive characteristic speed λ. 5 / 57

For negative speed, λ <, the upwind scheme resulting from (6) reads q n+ i = q n i c(q n i+ q n i ). () n + n i i i+ Fig. 4. Stencil for Godunov s upwind method for negative speed λ. The Godunov scheme is always upwind, as it always looks for information in the upwind direction, the direction from where the wind arrives. 6 / 57

A numerical example by hand In order to illustrate the Godunov finite difference method we apply it here to a specific example of an initial-boundary value problem PDE: t q + λ x q =, x [a, b], t >, IC: q(x, ) = h(x), x [a, b], t =, (3) BCs: q(a, t) = b L (t) ; q(b, t) = b R (t), t. We choose λ =, a = 5, b = 5, M = 9, x =. We choose CFL number c = so that the time step is t =. As initial condition we take if x, q(x, ) = h(x) = (4) if x >. 7 / 57

To simplify the problem, as boundary conditions we take q(, t) = b L (t) = t ; q(b, t) = b R (t) = t. (5) qi = qi c(q i q i ) = ( ) =, for i =,, 3, q4 = q4 c(q 4 q 3 ) = ( ) =, q5 = q5 c(q 5 q 4 ) = ( ) =, q6 = q6 c(q 6 q 5 ) = ( ) =, q 7 = q 7 c(q 7 q 6 ) = ( ) =, qi = qi c(q i q i ) = ( ) =, for i = 8, 9. (6) 8 / 57

t n q n q n q n q3 n q4 n q5 n q6 n q7 n q8 n q9 n q n.5.5.5..5.75.75.5 Table. values q n i according to the Godunov scheme..8 t = t =.5 t =.6.4. 5 4 3 3 4 5 x Fig. 5 Numerical results for two time steps from Godunov s method. 9 / 57

Other well-known finite difference methods The FTCS method (Forward-in-Time Centred-in-Space) results from the following approximations to partial derivatives t q(x i, t n ) = q(x i, t n+ ) q(x i, t n ) + O( t), t (7) x q(x i, t n ) = q(x i+, t n ) q(x i, t n ) + O( x ). x Substitution into the PDE, having suppressed the errors, we obtain qi n+ qi n ( q n + λ i+ q n ) i =. (8) t x Solving for q n+ i we obtain the FTCS numerical scheme q n+ i = q n i c(qn i+ q n i ). (9) Fig. 5 shows the stencil. / 57

n + n i i i+ Fig. 6. Stencil for the FTCS method. Unfortunately, FTCS is useless; it is unconditionally unstable FTCS uses the same approximation to the time derivative as the Godunov method But the spatial derivative is approximated via a centred, second-order accurate, approximation Naively, one would have expected a better method than Godunov s method There are two ways to rescue FTCS. One modification results in the explicit Lax-Friedrichs scheme. The other way is to resort to an implicit version. / 57

The Lax-Friedrichs method results from replacing qi n in the approximation to the time derivative of FTCS by a mean value, that is q n i (qn i + q n i+). Then qi n+ (qn i + qn i+ ) ( q n + λ i+ q n ) i =, (3) t x yielding the Lax-Friedrichs scheme q n+ i = ( + c)qn i + ( c)qn i+. (3) n + n i i i+ Fig. 7. Stencil for the Lax-Friedrichs method. / 57

The Lax-Wendroff method (96) The solution at (x i, t n+ ) is expressed as a Taylor series in time q(x i, t n+ ) = q(x i, t n ) + t t q(x i, t n ) + t () t q(x i, t n ) + O( t 3 ). (3) By means of the Cauchy-Kowalewski (or Lax-Wendroff) procedure one uses the PDE in () to replace time derivatives by space derivatives t q(x, t) = λ x q(x, t), () t q(x, t) = λ () x q(x, t). (33) In fact, for any order k, one can prove (k) t q(x, t) = ( λ) k x (k) q(x, t). (34) By substituting (33) into (3) one obtains q(x i, t n+ ) = q(x i, t n ) tλ x q(x i, t n )+ t λ x () q(x i, t n )+O( t 3 ) (35) Here the only derivative present are spatial derivatives. The spatial derivatives are approximated by centred finite differences 3 / 57

Finite difference approximations: x q(x i, t n ) = q(x i+, t n ) q(x i, t n ) x + O( x ), () x q(x i, t n ) = q(x i+, t n ) q(x i, t n ) + q(x i, t n ) x + O( x ). Finally, by substituting (36) into (35), neglecting truncation errors and replacing exact values q(x i, t n ) by qi n one obtains (36) q n+ i = c( + c)qn i + ( c )q n i c( c)qn i+. (37) n + n i i i+ Fig. 8. Stencil for the Lax-Wendroff method. 4 / 57

The FORCE method (Toro, 996). The finite difference version of FORCE [4], [5] results from an arithmetic mean of the Lax-Friedrichs and Lax-Wendroff schemes, namely: q n+ i = + giving the FORCE scheme [ ( + c)qn i + ( c)qn i+] [ c( + c)qn i + ( c )qi n c( ] (38) c)qn i+, q n+ i = 4 ( + c) q n i + ( c )q n i + 4 ( c) q n i+. (39) n + n i i i+ Fig. 9. Stencil for the FORCE method. 5 / 57

Monotone Schemes ω Lax-Wendroff scheme Non Monotone Schemes Godunov scheme Force scheme Lax-Friedrichs scheme Fig.. Weighted-type FORCE methods as convex average of Lax-Wendroff and Lax-Friedrichs in c ω plane. Here c is Courant number and ω is weight. Consider convex average: q force,ω = ( ω)q LF + ωq LW The line ω = /( + c ) denotes the Godunov s upwind method Godunov separates monotone methods from non-monotone methods Numerical viscosity (error) grows linearly with decreasing ω Godunov has the smallest error in the family of monotone methods FORCE has the smallest error in family of constant ω, with ω = / Lax-Friedrichs is the least accurate method c 6 / 57

Implicit methods: an example Consider again the model IBVP () and Approximate the temporal partial derivative as in (7) Approximate the spatial derivative as follows x q(x i, t n ) = q(x i+, t n+ ) q(x i, t n+ ) + O( x ) (4) x using values at the future time level n + By substituting the finite difference approximations into the PDE in (), neglecting errors and substituting exact values by approximate values one obtains ( qi n+ qi n q n+ i+ + λ ) qn+ i =. (4) t x Then solving for q n+ i gives implicit the numerical scheme qi n+ = qi n c ( qi+ n+ qn+ i ). (4) 7 / 57

Scheme (4) can be written as cqn+ i + qn+ i + cqn+ i+ = qn i, i =,..., M. (43) For i = the value qi n+ on the left boundary results from enforcing boundary conditions Analogously, for i = M the value qi+ n+ results from enforcing boundary conditions on the right boundary Therefore we have the following linear algebraic system AX = B, (44) where A is the coefficient matrix, X is the vector on unknowns and the right-hand side vector B is a known vector. System (44) is a tri-diagonal linear algebraic system and can be solved using the Thomas algorithm. 8 / 57

Conservative methods. The scalar case Consider a general scalar conservation law t q(x, t) + x f(q(x, t)) =, (45) where f(q) is the physical flux. A conservative method to solve (45) is a method of the form qi n+ = qi n t ( ) f x i+ f i, (46) where f i+ called the numerical flux, expressed as f i+ = f i+ (qi l n,..., qn i, qi+, n..., qi+r) n, (47) is required to where l and r are two non-negative integers. The flux f i+ satisfy: Continuity: f i+ : R l+r R is a continuous real-valued function Consistency: when all arguments of f i+ are identical f i+ (ˆq,..., ˆq) = f(ˆq). (48) 9 / 57

For general scalar equation t q(x, t) + x f(q(x, t)) = with flux f(q), well-known fluxes are given as q LW i+ = (qn i + qn i+ ) t x [ f(q n i+ ) f(q n i )] Lax W endroff f i+ = f(q LW ) i+ q GodC i+ f GodunovCentred i+ = (qn i + qn i+ ) t [ x f(q n i+ ) f(qi n)] = f(q GodC ) i+ (49) Lax F riedrichs f i+ f F orce i+ = = [ f(q n i ) + f(qi+ n )] x t (qn i+ qn i ) [ f LF i+ ] + f LW i+ 3 / 57

For the linear advection equation the flux reads = β k (au n i+k ), (5) f i+ k= with coefficients β k for a range of schemes. β β β β LF c ( + c) c ( c) 4c force 4c ( c) GODu ( + sign(c)) ( sign(c)) GODc ( + c) ( c) LW ( + c) ( c) WB, a > ( c) (3 c) WB, a < (3 + c) ( + c) FR, a > 4 ( c) 4 ( c) FR, a < 4 ( + c) 4 ( + c) Coefficients β k in the expression for the intercell flux for various schemes. 3 / 57

General form of a scheme and monotonicity All explicit schemes studied so far can be written in the general form q n+ i = H(q n i l,..., qn i,..., q n i+r), (5) with l, r two non-negative integers and H(...) a real-valued function of l + r + arguments. Definition: monotone method. A numerical scheme of the form (5) is said to be monotone if H is an increasing (non-decreasing) function of all its arguments q n k H(q n i l, qn i l+,..., qn i,..., q n i+r), i l k i + r (5) Example: Godunov s method. q n+ i = H(q n i, q n i ) = cq n i + ( c)q n i. (53) 3 / 57

Proposition. If a three-point conservative scheme qi n+ = qi n t ( ) f x i+ f i (54) for a non-linear conservation law is monotone then f i+ (qi n, q n i+) and f i+ (qi n, qi+) n. (55) q n i q n i q n i+ Proof. First we recall the general form (5) of a scheme and then define H(qi, n qi n, qi+) n qi n t ( ) f x i+ (qi n, qi+) n f i (qi, n qi n ). (56) From the definition of monotonicity it is easily proved that q n i+ H(q n i, q n i, q n i+) q n i H(q n i, q n i, q n i+) q n i+ f i (qi, n qi n ). f i+ (qi n, qi+) n, Hence the flux is an increasing function of its first argument and a decreasing function of its second argument and the claimed result is proved. (57) 33 / 57

Conservative methods. Non-linear systems A conservative method to solve the system of conservation laws is a numerical scheme of the form in which F i+ Q n+ i t Q + x F(Q) =, (58) = Q n i t x ( F i+ F i is the numerical flux and has the form F i+ ), (59) = F i+ (Q n i l,..., Qn i, Q n i+,..., Q n i+r), (6) where l and r are two non-negative integers. As defined, scheme (59) is explicit In an implicit conservative scheme the flux function F i+ includes arguments at time level n + Finite volume schemes are, by construction, conservative methods. 34 / 57

Finite difference methods as conservative methods Some conventional finite difference methods can also be re-interpreted as conservative methods. Here we study some examples. The Lax-Friedrichs method. The finite difference Lax-Friedrichs scheme Q n+ i = ( Q n i + Q n t ( i+) F(Q n x i+ ) F(Q n i ) ) (6) can be rewritten as a conservative method (59) with numerical flux F LF i+ Q LW a i+ = = ( F(Q n i ) + F(Q n i+) ) x ( Q n t i+ Q n ) i. (6) Lax-Wendroff methods. A well-known version of the Lax-Wendroff method is the two-step scheme F LW a = F(Q LW a ), i+ i+ ( Q n i + Q n t i+) x [F(Qn i+) F(Q n i )]. (63) 35 / 57

Another version of the Lax-Wendroff method has numerical flux F LW b i+ = [F(Qn i ) + F(Q n i+)] t x A i+ [F(Q n i+) F(Q n i )]. (64) Two choices for the interface matrix are ( ( A i+ = A Q n i + Q n ) ) i+, A i+ = [A(Qn i ) + A(Q n i+)]. (65) Note that flux (64) can be written as F LW b = ( I + t ) i+ x A i+ F(Q n i ) + ( I t ) x A i+ F(Q n i+). (66) A third version of the Lax-Wendroff flux is F LW c i+ = [F(Qn i ) + F(Q n i+)] t x A i+ ( Q n i+ Q n ) i. (67) 36 / 57

The FORCE method The FORCE method has numerical flux ( F F O F LF i+ i+ = ) + F LW i+. (68) In the original derivation of the FORCE flux [4], [5] the Lax-Wendroff flux that entered the average was F LW a i+ One could also use the other versions F LW b i+ and F LW c. i+ For theoretical aspects of FORCE for one-dimensional systems see [] For recent developments for multidimensional systems on unstructured meshes see [6], [] and [3] The Lax-Friedrichs and FORCE schemes are first order accurate and also monotone (for the scalar case) The Lax-Wendroff scheme is second order accurate in space and time but not monotone All three schemes are called centred, or symmetric and are distinct from upwind schemes, such as Godunov s method 37 / 57

Telescopic property of conservative methods Summation applied to formula (59), premultiplied by x i, gives i=i Right xq n+ i = i=i Left i=i Right i=i Left xq n i t ( F Right+ F Left ). (69) Here i Left and i Right are the leftmost and rightmost cells F Left and F Right+ are leftmost and rightmost intercell boundaries fluxes (69) says that the total amount of Q changes only due to the fluxes through the end boundaries The telescopic property also holds in multiple space dimensions Shock waves and conservation. Shock waves are captured with the correct propagation speed by conservative methods (Lax and Wendroff, 96) Non-conservative methods will compute shock waves with the wrong speed (Hou and LeFloch, 994) 38 / 57

Time step t and the CFL condition The choice of t for explicit methods is constraint by a stability condition, called the CFL condition, or the Courant condition In general one chooses t as x t = C cfl Smax n (7) C cfl is a Courant or CFL coefficient, specified by the user, satisfying < C cfl C lim (7) C lim is the linearized stability limit of the scheme Smax n is an estimate for the largest wave speed present time level n. For systems with eigenvalues λ n k,i, k =,..., m in cell i at time n { } Smax n = max max λ n k,i (7) i k A practical choice for the coefficient C cfl is C cfl =.9 C lim (73) 39 / 57

Boundary conditions Add fictitious cells I and I M+ on left and right of domain, Fig. 8 Prescribe data values in I and I M+, adjacent to I and I M Boundary Riemann problems with data (Q n, Qn ) and (Qn M, Qn M+ ) are generated Corresponding numerical fluxes F and F M+ are computed, as done for the interior cells Boundary conditions are a physical issue and great care is required in their numerical implementation. For the Godunov method the concept of boundary Riemann problems helps. Left boundary Right boundary Left fictious cell Computational domain Right fictious cell a M b M + Fig. : Boundary conditions. Fictitious cells outside the computational domain are created. 4 / 57

Shallow water equations Transmissive boundary conditions: h n = h n ; u n = u n Left boundary h n M+ = h n M ; un M+ = u n M Left boundary (74) Reflective boundary conditions: h n = h n ; u n = u n + u LB Left boundary h n M+ = h n M ; un M+ = u n M + u RB Left boundary (75) u LB and u LB are prescribed velocities of left and right boundaries. 4 / 57

Blood flow equations Transmissive boundary conditions: A n = A n ; u n = u n Left boundary A n M+ = A n M ; un M+ = u n M Reflective boundary conditions: Left boundary (76) A n = A n ; u n = u n + u LB Left boundary A n M+ = A n M ; un M+ = u n M + u RB Left boundary (77) u LB and u LB are prescribed velocities of left and right boundaries. 4 / 57

A Case Study: Computational Example for the Linear Advection Equation 43 / 57

The problem We solve the initial-boundary value problem (IBVP) for the linear advection equation PDE: t q + λ x q =, x [a, b], t >, IC: q(x, ) = h(x), x [a, b], t =, (78) Periodic BCs: q(a, t) = q(b, t), t >, with λ =, a = 5, b = 5 and periodic boundary conditions We use 6 methods: Lax-Friedrichs, FORCE, Godunov, Lax-Wendroff, Warming-Beam and Fromm We solve one problem with smooth solution and another with discontinuous solution We compare results with the exact solution and discuss the performance of six methods used 44 / 57

We consider two types of initial conditions h(x), a smooth Gaussian profile q(x, ) = h(x) = αe βx, α =, β =, x [a, b] (79) and a (discontinous) square wave given as if a = 5 x <, q(x, ) = h(x) = if x, if < x b = 5. The mesh details are as as follows x = b a mesh spacing, M + M number of interior points, M + number of sub-intervals of [a, b], M + total number of finite difference points in [a, b], x = a first mesh point (lies on left boundary), x M+ = b last mesh point (lies on right boundary), x, x,..., x M interior mesh points (solution to be computed). (8) (8) 45 / 57

Implementation of periodic boundary conditions We proceed as follows: Set initial conditions at t = in the entire domain q i = h(x i ), for i =,,..., M, M +. (8) Apply periodic boundary conditions as follows Left boundary: q n = q n M+, q n = q n M, Right boundary: qm+ n = q n, qm+3 n = q n. (83) Note that from the periodic boundary conditions of the problem we enforce q n = qn M+ n >. 3 Compute the solution on points applying the numerical scheme. x, x,..., x M, x M+ (84) 46 / 57

Computational results and discussion We solve problem using: Lax-Friedrichs, FORCE, Godunov, Lax-Wendroff, Warming-Beam and Fromm. We C cfl =.9 and the time step is calculated as t = C cfl x λ. (85) We display results at the fixed output time T out = units, which corresponds to cycles for the periodic solution. For each method and each test results are shown for three meshes, M = 5, M = and M =. Results are displayed in Figs. to 3. 47 / 57

Comments on the results It is difficult to compute accurate solutions to this simple equation As the mesh is refined the numerical solution gets closer to the exact solution For Test, with smooth IC, second-order methods give more accurate results than first-order methods First-order methods have too much numerical viscosity and clipping of extrema is very severe For Test, with discontinuous IC, second-order methods produce large spurious oscillations, overshoots and undershoots In general, second-order methods are very inaccurate. The first-order methods used do not produce spurious oscillations involving new extrema, a property called monotonicity 48 / 57

Not all first-order methods are monotone First-order methods have inherent numerical viscosity that causes the discontinuities to spread as time evolves A technically monotone method can admit (internal) spurious oscillations, but with no new extrema. See the Lax-Friedrichs results of Fig. 8 The concept of resolution is used to describe the way a discontinuity is represented by the numerical method, that is, how large or small is the transition zone in the numerical solution This is determined by the number of points inside of the numerical solution that lie inside the transition zone Overall, the best first-order method is Godunov and the worst is Lax-Friedrichs. The best second-order method is Fromm and the worst is Warming-Beam From the results seen, we have not yet found the ideal numerical method. Better methods need to be constructed 49 / 57

Concluding Remarks We have introduced some basic concepts on numerical methods for hyperbolic equations using the model linear advection equation Most well-known finite difference methods have been considered Through a case study for the linear advection equation we have demonstrated the computational performance of all methods studied and have discussed their salient features In addition, we have formulated the basic finite difference methods as conservative methods, in terms of a numerical flux Conservative methods have been introduced both for scalar equations and as well as for non-linear systems Exercises are suggested on a separate document 5 / 57

5 4 3 3 4 5 Numerical (Lax Friedrichs) Numerical (Lax Friedrichs) Numerical (Lax Friedrichs).5.5.5 5 4 3 3 4 5 5 4 3 3 4 5 Fig.. Test. Results at time t = from the Lax-Friedrichs method (symbol) compared to the exact (line) solution for three meshes: M=5,,. Numerical (FORCE) Numerical (FORCE) Numerical (FORCE).5.5.5 5 4 3 3 4 5 5 4 3 3 4 5 5 4 3 3 4 5 Fig. 3. Test. Results at time t = from the FORCE method (symbol) compared to the exact (line) solution for three meshes: M=5,,. 5 / 57

5 4 3 3 4 5 Numerical (Godunov) Numerical (Godunov) Numerical (Godunov).5.5.5 5 4 3 3 4 5 5 4 3 3 4 5 Fig. 4. Test. Results at time t = from Godunov s method (symbol) compared to the exact (line) solution for three meshes: M=5,,. Numerical (Lax Wendroff) Numerical (Lax Wendroff) Numerical (Lax Wendroff).5.5.5 5 4 3 3 4 5 5 4 3 3 4 5 5 4 3 3 4 5 Fig. 5. Test. Results at time t = from the Lax-Wendroff method (symbol) compared to the exact (line) solution for three meshes: M=5,,. 5 / 57

5 4 3 3 4 5 Numerical (Warming Beam) Numerical (Warming Beam) Numerical (Warming Beam).5.5.5 5 4 3 3 4 5 5 4 3 3 4 5 Fig. 6. Test. Results at time t = from the Warming-Beam method (symbol) compared to the exact (line) solution for three meshes: M=5,,. Numerical (Fromm) Numerical (Fromm) Numerical (Fromm).5.5.5 5 4 3 3 4 5 5 4 3 3 4 5 5 4 3 3 4 5 Fig. 7. Test. Results at time t = from the Fromm method (symbol) compared to the exact (line) solution for three meshes: M=5,,. 53 / 57

5 4 3 3 4 5 Numerical (Lax Friedrichs) Numerical (Lax Friedrichs) Numerical (Lax Friedrichs).5.5.5 5 4 3 3 4 5 5 4 3 3 4 5 Fig. 8. Test. Results at time t = from the Lax-Friedrichs method (symbol) compared to the exact (line) solution for three meshes: M=5,,. Numerical (FORCE) Numerical (FORCE) Numerical (FORCE).5.5.5 5 4 3 3 4 5 5 4 3 3 4 5 5 4 3 3 4 5 Fig. 9. Test. Results at time t = from the FORCE method (symbol) compared to the exact (line) solution for three meshes: M=5,,. 54 / 57

5 4 3 3 4 5 Numerical (Godunov) Numerical (Godunov) Numerical (Godunov).5.5.5 5 4 3 3 4 5 5 4 3 3 4 5 Fig.. Test. Results at time t = from Godunov s method (symbol) compared to the exact (line) solution for three meshes: M=5,,. Numerical (Lax Wendroff) Numerical (Lax Wendroff) Numerical (Lax Wendroff).5.5.5 5 4 3 3 4 5 5 4 3 3 4 5 5 4 3 3 4 5 Fig.. Test. Results at time t = from the Lax-Wendroff method (symbol) compared to the exact (line) solution for three meshes: M=5,,. 55 / 57

5 4 3 3 4 5 Numerical (Warming Beam) Numerical (Warming Beam) Numerical (Warming Beam).5.5.5 5 4 3 3 4 5 5 4 3 3 4 5 Fig.. Test. Results at time t = from the Warming-Beam method (symbol) compared to the exact (line) solution for three meshes: M=5,,. Numerical (Fromm) Numerical (Fromm) Numerical (Fromm).5.5.5 5 4 3 3 4 5 5 4 3 3 4 5 5 4 3 3 4 5 Fig. 3. Test. Results at time t = from the Fromm method (symbol) compared to the exact (line) solution for three meshes: M=5,,. 56 / 57

G. Q. Chen and E. F. Toro. Centred Schemes for Non Linear Hyperbolic Equations. Journal of Hyperbolic Differential Equations, ():53 566, 4. Michael Dumbser, Manuel Castro, Carlos Parés, Eleuterio Toro, and Arturo Hidalgo. FORCE Schemes on Unstructured Meshes II: Non-conservative Hyperbolic Systems. Computer Methods in Applied Mechanics and Engineering, 99:65 647,. E. F. Toro. Riemann Solvers and Numerical Methods for Fluid Dynamics. A Practical Introduction. Third Edition. Springer Verlag, 9. E. F. Toro and S. J. Billett. Centred TVD Schemes for Hyperbolic Conservation Laws. Technical Report MMU 963, Department of Mathematics and Physics, Manchester Metropolitan University, UK, 996. 56 / 57

E. F. Toro and S. J. Billett. Centred TVD Schemes for Hyperbolic Conservation Laws. IMA J. Numerical Analysis, :47 79,. E. F. Toro, A. Hidalgo, and M. Dumbser. FORCE Schemes on Unstructured Meshes I: Conservative Hyperbolic Systems. J. Comput. Phys., 8:3368 3389, 9. 57 / 57

Exercises for basics on numerical methods for hyperbolic equations 57 / 57

Problem : finite difference approximation to derivatives. Consider a smooth function g(x) and a point x in its domain. Consider in addition the sequence of equidistant points x x, x x, x, x + x, x + x, with x a fixed positive length. Using Taylor s theorem derive approximations to first and second derivatives of g(x) at the point x as follows: Find a one-sided second order approximation to the first derivative g (x ) using the points x x, x x, x. Find a one-sided second order approximation to the first derivative g (x ) using the points x, x + x, x + x. 3 Find a centred second order approximation to the second derivative g (x ) using the points x x, x, x + x. 4 Find a one-sided approximation to the second derivative g (x ) using the points x x, x x, x. 5 Find a one-sided approximation to the second derivative g (x ) using the points x, x + x, x + x. Problem : Warming-Beam method. Consider the Warming-Beam 57 / 57

scheme q n+ i = c(c )qn i + c( c)q n i + (c )(c )qn i+ (86) for the linear advection equation for λ >, where c is the Courant number. Note that this method is upwind biased, as it uses only upwind information, and is second order accurate in space and time. Derive the scheme through the following steps: Perform a time Taylor series expansion of the solution at (x i, t n+ ) following the same procedure as for the Law-Wendroff method. Obtain suitable one-sided approximations to the first and second spatial derivatives using the points (x i, t n ), (x i, t n ) and (x i, t n ). Problem 3: Warming-Beam scheme for negative speed. Derive the Warming-Beam scheme for the linear advection equation for λ <. Problem 4: Fromm method. Consider the Fromm scheme q n+ i = 4 ( c)cqn i + 4 (5 c)cqn i + 4 ( c)(4+c)qn i+ 4 ( c)cqn i+ (87) 57 / 57

for the linear advection equation for λ >. This method is upwind biased but it also uses downwind information; the scheme is second order accurate in space and time. Derive the Fromm scheme through the following steps: Perform a time Taylor series expansion of the solution at (x i, t n+ ) following the same procedure as for the Law-Wendroff method. Obtain suitable finite difference approximations to the first and second spatial derivatives using the points (x i, t n ), (x i, t n ), (x i, t n ) and (x i+, t n ). Problem 5: Fromm scheme for negative speed. Derive the Fromm scheme for the linear advection equation for λ <. Problem 6: calculation by hand. Consider the initial-boundary value problem in the case study for the linear advection equation. Solve the problem by hand for two time steps and display the results on a table using the following methods: The FTCS method. The Lax-Friedrichs method. 3 The FORCE method. 4 The Lax-Wendroff method. 57 / 57

5 The Warming-Beam method. 6 The Fromm method. Use the same computational parameters as for the case study for the linear advection equation. We remark that it is necessary to extend the computational domain by adding one extra, fictitious, point to the left and one right of the computational domain, in order to be able to apply the second-order methods. See the computational example of Section 6. Problem 7: implicit Godunov method. Assume the temporal partial derivative to be approximated by the explicit forward formula but the spatial derivative to be approximated by a backward finite difference approximation calculated at the future time level n +, that is x q(x i, t n ) = q(x i, t n+ ) q(x i, t n+ ) x + O( x) (88) L a (qi n ) qn+ i qi n t + λ ( q n+ i q n+ i x ) =, (89) 57 / 57

Solving for qi n+ we obtain the implicit numerical scheme qi n+ = qi n c ( qi n+ qi n+ ), (9) or cqn+ i + qn+ i + cqn+ i+ = qn i, for i =,..., M. (9) Write the problem as a linear system. Write down the coefficient matrix A, the vector X of unknowns and the vector B of known terms. Apply the implicit Godunov method by hand to solve problem 6 above for two time steps and display the results on a table. 3 Compare the results of the various explicit methods, the implicit FTCS and the implicit Godunov method, along with the exact solution. 57 / 57