introduction to numerical methods to hyperbolic pde’sx =0 conservation of mass conservation of...

78
Introduction to numerical methods to hyperbolic PDE’s Lecture 1: Basic concepts Literature: Randy LeVeque: Computational Methods for Astrophysical Fluid Flow, Sass Fee lecture notes, Springer Verlag, 1998 download this from: http://www.mat.univie.ac.at/~obertsch/literatur/conservation_laws.pdf

Upload: others

Post on 20-May-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Introduction to numerical methods to hyperbolic PDE’s

Lecture 1: Basic concepts

Literature:

Randy LeVeque: Computational Methods for Astrophysical Fluid Flow, Sass Fee lecture notes, Springer Verlag, 1998

download this from: http://www.mat.univie.ac.at/~obertsch/literatur/conservation_laws.pdf

Page 2: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Outline of the first lecture

Page 3: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Euler equations of compressible gas dynamics:

(ρu)t + (ρu2 + p)x = 0

Et +!

u(E + p)"

x= 0

E =p

γ − 1+

1

2ρu2

ρt + (ρu)x = 0 conservation of mass

conservation of momentum

conservation of total energy

closure relationship - equation of state: polytropic gas

Here is a typical example of a system of PDEs we want to numerically discretise:

Page 4: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

a planar shock wave in a gas hitting three cylinders

t = 0

Page 5: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Given smooth initial data for such equations, the solution will evolve into something not smooth.

ut +

!

u2

2

"

x

= 0u = u(x, t)consider ∈ R Burgers equation:

u

x

In order to study the numerical discretization of such equations we first study simpler equations.

Page 6: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Linear advection equation

Page 7: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Numerical methods use space- and time discretization:

t

x

the state of the gas is given initially

t = 0we then need to

determine it at later times.

∆x = h

∆t = k

xi

tn

xi+1xi−1

Page 8: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Finite difference method

Page 9: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Finite volume method

Page 10: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Convergence

Page 11: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Local truncation error τ

Page 12: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Consistency

If

But:

Page 13: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Consistency + Stability = Convergence

Fundamental therom:

Page 14: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Lax-Richtmyer stabilty

Page 15: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Stability of upwind

Page 16: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Upwind as interpolation

Page 17: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

The CFL Condition

not sufficient

Page 18: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Numerical domain of dependence

Page 19: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

The CFL Condition

Page 20: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

CFL ConditionStencil

Lax-Wendroff

Page 21: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Hyperbolic systems

Page 22: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

3 equations with λ1 < 0 < λ2 < λ3

domain of dependence range of infuence

Page 23: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

CFL ConditionStencil

Page 24: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Upwind for a linear system

Page 25: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Symmetric methods

unstable

Page 26: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Numerical dissipation

Page 27: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

0 0.2 0.4 0.6 0.8 1ï0.5

0

0.5

1

1.5Upwind at t=1

0 0.2 0.4 0.6 0.8 1ï0.5

0

0.5

1

1.5Upwind at t = 5

0 0.2 0.4 0.6 0.8 1ï0.5

0

0.5

1

1.5LaxïWendroff at t = 1

0 0.2 0.4 0.6 0.8 1ï0.5

0

0.5

1

1.5LaxïWendroff at t = 5

0 0.2 0.4 0.6 0.8 1ï0.5

0

0.5

1

1.5BeamïWarming at t = 1

0 0.2 0.4 0.6 0.8 1ï0.5

0

0.5

1

1.5BeamïWarming at t = 5

Lax-Friedrichs Lax-Friedrichs

qt + qx = 0 with periodic boundary conditions

initial conditions

x

qq

x

Page 28: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Lax-Wendroff

Page 29: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Modified equations

Page 30: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Modified Equation for Lax-Wendroff

Page 31: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

0 0.2 0.4 0.6 0.8 1ï0.5

0

0.5

1

1.5Upwind at t=1

0 0.2 0.4 0.6 0.8 1ï0.5

0

0.5

1

1.5Upwind at t = 5

0 0.2 0.4 0.6 0.8 1ï0.5

0

0.5

1

1.5LaxïWendroff at t = 1

0 0.2 0.4 0.6 0.8 1ï0.5

0

0.5

1

1.5LaxïWendroff at t = 5

0 0.2 0.4 0.6 0.8 1ï0.5

0

0.5

1

1.5BeamïWarming at t = 1

0 0.2 0.4 0.6 0.8 1ï0.5

0

0.5

1

1.5BeamïWarming at t = 5

Page 32: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Dispersion relation

Page 33: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Dispersive behavior

Page 34: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

0 0.2 0.4 0.6 0.8 1ï1

ï0.5

0

0.5

1

1.5Upwind at t = 1

0 0.2 0.4 0.6 0.8 1ï1

ï0.5

0

0.5

1

1.5Upwind at t = 10

0 0.2 0.4 0.6 0.8 1ï1

ï0.5

0

0.5

1

1.5LaxïWendroff at t = 1

0 0.2 0.4 0.6 0.8 1ï1

ï0.5

0

0.5

1

1.5LaxïWendroff at t = 10

0 0.2 0.4 0.6 0.8 1ï1

ï0.5

0

0.5

1

1.5Superbee at t = 1

0 0.2 0.4 0.6 0.8 1ï1

ï0.5

0

0.5

1

1.5Superbee at t = 10

Page 35: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic
Page 36: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic
Page 37: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Introduction to numerical methods to hyperbolic PDE’s

Lecture 2: High resolution finite volume methods

download review from: http://www.mat.univie.ac.at/~obertsch/literatur/conservation_laws.pdf

Page 38: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Outline

Page 39: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Qn

i =1

h

! xi+ 1

2

xi−

12

q(x, tn)dx

qt + f(q)x = 0Finite volume method

Page 40: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Finite volume method

Page 41: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Godunov’s method for advection

Page 42: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Godunov’s method

Page 43: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

First order REA Algorithm

Page 44: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

First order REA Algorithm

Page 45: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Cell update

Page 46: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Second-order REA Algorithm

linear

Page 47: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Second-order REA Algorithm

Page 48: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Choice of slopes

Page 49: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Oscillations

Page 50: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

High-resolution methods

Page 51: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Minmod slope

Page 52: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Piecewise linear reconstruction

Page 53: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

TVD Methods

Page 54: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

TVD REA Algorithm

TV (qn) ≤ TV (Qn).with the property that

linear

Note:

Page 55: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Some popular limitersθj =

Uj − Uj−1

Uj+1 − Uj

Page 56: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

6.9 Slope-Limiter Methods 111

6.9 Slope-Limiter Methods

We now return to the derivation of numerical methods based on piecewise linear reconstruc-tion, and consider how to limit the slopes so that (6.23) is satisfied. Note that setting σ n

i ≡ 0works, since the piecewise constant function has the same TV as the discrete data. Hencethe first-order upwind method is TVD for the advection equation. The upwind method maysmear solutions but cannot introduce oscillations.

One choice of slope that gives second-order accuracy for smooth solutions while stillsatisfying the TVD property is the minmod slope

σ ni = minmod

(Qn

i − Qni−1

"x,

Qni+1 − Qn

i

"x

), (6.26)

where the minmod function of two arguments is defined by

minmod(a, b) =

⎧⎪⎨

⎪⎩

a if |a| < |b| and ab > 0,

b if |b| < |a| and ab > 0,

0 if ab ≤ 0.

(6.27)

If a and b have the same sign, then this selects the one that is smaller in modulus, else itreturns zero.

Rather than defining the slope on the i th cell by always using the downwind difference(which would give the Lax–Wendroff method), or by always using the upwind difference(which would give the Beam–Warming method), the minmod method compares the twoslopes and chooses the one that is smaller in magnitude. If the two slopes have differentsign, then the value Qn

i must be a local maximum or minimum, and it is easy to check inthis case that we must set σ n

i = 0 in order to satisfy (6.23).Figure 6.2(a) shows results using the minmod method for the advection problem con-

sidered previously. We see that the minmod method does a fairly good job of maintaininggood accuracy in the smooth hump and also sharp discontinuities in the square wave, withno oscillations.

Sharper resolution of discontinuities can be achieved with other limiters that do notreduce the slope as severely as minmod near a discontinuity. Figure 6.5(a) shows somesample data representing a discontinuity smeared over two cells, along with the minmodslopes. Figure 6.5(b) shows that we can increase the slopes in these two cells to twice thevalue of the minmod slopes and still have (6.23) satisfied. This sharper reconstruction willlead to sharper resolution of the discontinuity in the next time step than we would obtainwith the minmod slopes.

(a) (b)

Fig. 6.5. Grid values Qn and reconstructed qn(·, tn) using (a) minmod slopes, (b) superbee or MCslopes. Note that these steeper slopes can be used and still have the TVD property.

6.9 Slope-Limiter Methods 111

6.9 Slope-Limiter Methods

We now return to the derivation of numerical methods based on piecewise linear reconstruc-tion, and consider how to limit the slopes so that (6.23) is satisfied. Note that setting σ n

i ≡ 0works, since the piecewise constant function has the same TV as the discrete data. Hencethe first-order upwind method is TVD for the advection equation. The upwind method maysmear solutions but cannot introduce oscillations.

One choice of slope that gives second-order accuracy for smooth solutions while stillsatisfying the TVD property is the minmod slope

σ ni = minmod

(Qn

i − Qni−1

"x,

Qni+1 − Qn

i

"x

), (6.26)

where the minmod function of two arguments is defined by

minmod(a, b) =

⎧⎪⎨

⎪⎩

a if |a| < |b| and ab > 0,

b if |b| < |a| and ab > 0,

0 if ab ≤ 0.

(6.27)

If a and b have the same sign, then this selects the one that is smaller in modulus, else itreturns zero.

Rather than defining the slope on the i th cell by always using the downwind difference(which would give the Lax–Wendroff method), or by always using the upwind difference(which would give the Beam–Warming method), the minmod method compares the twoslopes and chooses the one that is smaller in magnitude. If the two slopes have differentsign, then the value Qn

i must be a local maximum or minimum, and it is easy to check inthis case that we must set σ n

i = 0 in order to satisfy (6.23).Figure 6.2(a) shows results using the minmod method for the advection problem con-

sidered previously. We see that the minmod method does a fairly good job of maintaininggood accuracy in the smooth hump and also sharp discontinuities in the square wave, withno oscillations.

Sharper resolution of discontinuities can be achieved with other limiters that do notreduce the slope as severely as minmod near a discontinuity. Figure 6.5(a) shows somesample data representing a discontinuity smeared over two cells, along with the minmodslopes. Figure 6.5(b) shows that we can increase the slopes in these two cells to twice thevalue of the minmod slopes and still have (6.23) satisfied. This sharper reconstruction willlead to sharper resolution of the discontinuity in the next time step than we would obtainwith the minmod slopes.

(a) (b)

Fig. 6.5. Grid values Qn and reconstructed qn(·, tn) using (a) minmod slopes, (b) superbee or MCslopes. Note that these steeper slopes can be used and still have the TVD property.

Piecewise linear reconstruction

6.9 Slope-Limiter Methods 111

6.9 Slope-Limiter Methods

We now return to the derivation of numerical methods based on piecewise linear reconstruc-tion, and consider how to limit the slopes so that (6.23) is satisfied. Note that setting σ n

i ≡ 0works, since the piecewise constant function has the same TV as the discrete data. Hencethe first-order upwind method is TVD for the advection equation. The upwind method maysmear solutions but cannot introduce oscillations.

One choice of slope that gives second-order accuracy for smooth solutions while stillsatisfying the TVD property is the minmod slope

σ ni = minmod

(Qn

i − Qni−1

"x,

Qni+1 − Qn

i

"x

), (6.26)

where the minmod function of two arguments is defined by

minmod(a, b) =

⎧⎪⎨

⎪⎩

a if |a| < |b| and ab > 0,

b if |b| < |a| and ab > 0,

0 if ab ≤ 0.

(6.27)

If a and b have the same sign, then this selects the one that is smaller in modulus, else itreturns zero.

Rather than defining the slope on the i th cell by always using the downwind difference(which would give the Lax–Wendroff method), or by always using the upwind difference(which would give the Beam–Warming method), the minmod method compares the twoslopes and chooses the one that is smaller in magnitude. If the two slopes have differentsign, then the value Qn

i must be a local maximum or minimum, and it is easy to check inthis case that we must set σ n

i = 0 in order to satisfy (6.23).Figure 6.2(a) shows results using the minmod method for the advection problem con-

sidered previously. We see that the minmod method does a fairly good job of maintaininggood accuracy in the smooth hump and also sharp discontinuities in the square wave, withno oscillations.

Sharper resolution of discontinuities can be achieved with other limiters that do notreduce the slope as severely as minmod near a discontinuity. Figure 6.5(a) shows somesample data representing a discontinuity smeared over two cells, along with the minmodslopes. Figure 6.5(b) shows that we can increase the slopes in these two cells to twice thevalue of the minmod slopes and still have (6.23) satisfied. This sharper reconstruction willlead to sharper resolution of the discontinuity in the next time step than we would obtainwith the minmod slopes.

(a) (b)

Fig. 6.5. Grid values Qn and reconstructed qn(·, tn) using (a) minmod slopes, (b) superbee or MCslopes. Note that these steeper slopes can be used and still have the TVD property.

6.9 Slope-Limiter Methods 111

6.9 Slope-Limiter Methods

We now return to the derivation of numerical methods based on piecewise linear reconstruc-tion, and consider how to limit the slopes so that (6.23) is satisfied. Note that setting σ n

i ≡ 0works, since the piecewise constant function has the same TV as the discrete data. Hencethe first-order upwind method is TVD for the advection equation. The upwind method maysmear solutions but cannot introduce oscillations.

One choice of slope that gives second-order accuracy for smooth solutions while stillsatisfying the TVD property is the minmod slope

σ ni = minmod

(Qn

i − Qni−1

"x,

Qni+1 − Qn

i

"x

), (6.26)

where the minmod function of two arguments is defined by

minmod(a, b) =

⎧⎪⎨

⎪⎩

a if |a| < |b| and ab > 0,

b if |b| < |a| and ab > 0,

0 if ab ≤ 0.

(6.27)

If a and b have the same sign, then this selects the one that is smaller in modulus, else itreturns zero.

Rather than defining the slope on the i th cell by always using the downwind difference(which would give the Lax–Wendroff method), or by always using the upwind difference(which would give the Beam–Warming method), the minmod method compares the twoslopes and chooses the one that is smaller in magnitude. If the two slopes have differentsign, then the value Qn

i must be a local maximum or minimum, and it is easy to check inthis case that we must set σ n

i = 0 in order to satisfy (6.23).Figure 6.2(a) shows results using the minmod method for the advection problem con-

sidered previously. We see that the minmod method does a fairly good job of maintaininggood accuracy in the smooth hump and also sharp discontinuities in the square wave, withno oscillations.

Sharper resolution of discontinuities can be achieved with other limiters that do notreduce the slope as severely as minmod near a discontinuity. Figure 6.5(a) shows somesample data representing a discontinuity smeared over two cells, along with the minmodslopes. Figure 6.5(b) shows that we can increase the slopes in these two cells to twice thevalue of the minmod slopes and still have (6.23) satisfied. This sharper reconstruction willlead to sharper resolution of the discontinuity in the next time step than we would obtainwith the minmod slopes.

(a) (b)

Fig. 6.5. Grid values Qn and reconstructed qn(·, tn) using (a) minmod slopes, (b) superbee or MCslopes. Note that these steeper slopes can be used and still have the TVD property.

6.9 Slope-Limiter Methods 111

6.9 Slope-Limiter Methods

We now return to the derivation of numerical methods based on piecewise linear reconstruc-tion, and consider how to limit the slopes so that (6.23) is satisfied. Note that setting σ n

i ≡ 0works, since the piecewise constant function has the same TV as the discrete data. Hencethe first-order upwind method is TVD for the advection equation. The upwind method maysmear solutions but cannot introduce oscillations.

One choice of slope that gives second-order accuracy for smooth solutions while stillsatisfying the TVD property is the minmod slope

σ ni = minmod

(Qn

i − Qni−1

"x,

Qni+1 − Qn

i

"x

), (6.26)

where the minmod function of two arguments is defined by

minmod(a, b) =

⎧⎪⎨

⎪⎩

a if |a| < |b| and ab > 0,

b if |b| < |a| and ab > 0,

0 if ab ≤ 0.

(6.27)

If a and b have the same sign, then this selects the one that is smaller in modulus, else itreturns zero.

Rather than defining the slope on the i th cell by always using the downwind difference(which would give the Lax–Wendroff method), or by always using the upwind difference(which would give the Beam–Warming method), the minmod method compares the twoslopes and chooses the one that is smaller in magnitude. If the two slopes have differentsign, then the value Qn

i must be a local maximum or minimum, and it is easy to check inthis case that we must set σ n

i = 0 in order to satisfy (6.23).Figure 6.2(a) shows results using the minmod method for the advection problem con-

sidered previously. We see that the minmod method does a fairly good job of maintaininggood accuracy in the smooth hump and also sharp discontinuities in the square wave, withno oscillations.

Sharper resolution of discontinuities can be achieved with other limiters that do notreduce the slope as severely as minmod near a discontinuity. Figure 6.5(a) shows somesample data representing a discontinuity smeared over two cells, along with the minmodslopes. Figure 6.5(b) shows that we can increase the slopes in these two cells to twice thevalue of the minmod slopes and still have (6.23) satisfied. This sharper reconstruction willlead to sharper resolution of the discontinuity in the next time step than we would obtainwith the minmod slopes.

(a) (b)

Fig. 6.5. Grid values Qn and reconstructed qn(·, tn) using (a) minmod slopes, (b) superbee or MCslopes. Note that these steeper slopes can be used and still have the TVD property.

6.9 Slope-Limiter Methods 111

6.9 Slope-Limiter Methods

We now return to the derivation of numerical methods based on piecewise linear reconstruc-tion, and consider how to limit the slopes so that (6.23) is satisfied. Note that setting σ n

i ≡ 0works, since the piecewise constant function has the same TV as the discrete data. Hencethe first-order upwind method is TVD for the advection equation. The upwind method maysmear solutions but cannot introduce oscillations.

One choice of slope that gives second-order accuracy for smooth solutions while stillsatisfying the TVD property is the minmod slope

σ ni = minmod

(Qn

i − Qni−1

"x,

Qni+1 − Qn

i

"x

), (6.26)

where the minmod function of two arguments is defined by

minmod(a, b) =

⎧⎪⎨

⎪⎩

a if |a| < |b| and ab > 0,

b if |b| < |a| and ab > 0,

0 if ab ≤ 0.

(6.27)

If a and b have the same sign, then this selects the one that is smaller in modulus, else itreturns zero.

Rather than defining the slope on the i th cell by always using the downwind difference(which would give the Lax–Wendroff method), or by always using the upwind difference(which would give the Beam–Warming method), the minmod method compares the twoslopes and chooses the one that is smaller in magnitude. If the two slopes have differentsign, then the value Qn

i must be a local maximum or minimum, and it is easy to check inthis case that we must set σ n

i = 0 in order to satisfy (6.23).Figure 6.2(a) shows results using the minmod method for the advection problem con-

sidered previously. We see that the minmod method does a fairly good job of maintaininggood accuracy in the smooth hump and also sharp discontinuities in the square wave, withno oscillations.

Sharper resolution of discontinuities can be achieved with other limiters that do notreduce the slope as severely as minmod near a discontinuity. Figure 6.5(a) shows somesample data representing a discontinuity smeared over two cells, along with the minmodslopes. Figure 6.5(b) shows that we can increase the slopes in these two cells to twice thevalue of the minmod slopes and still have (6.23) satisfied. This sharper reconstruction willlead to sharper resolution of the discontinuity in the next time step than we would obtainwith the minmod slopes.

(a) (b)

Fig. 6.5. Grid values Qn and reconstructed qn(·, tn) using (a) minmod slopes, (b) superbee or MCslopes. Note that these steeper slopes can be used and still have the TVD property.

Page 57: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Sweby diagram Regions in which function values must

lie in order to give TVD and second order TVD

methods.

φ(θ)

TVD TVD & 2nd order

TVD & 2nd orderTVD & 2nd order

all methods in this diagram leave the

TVD region

Page 58: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Order of accuracy isn’t everything

Page 59: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Upwind algorithmmonotone convection

Page 60: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Lax-Wendroff

Page 61: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

slope limited, MC limiter

Page 62: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Upwind algorithmWave packet:

Page 63: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Lax-Wendroff

Page 64: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

slope limited, Superbee limiter

Page 65: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Slope limiters and flux limiters

Page 66: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Wave limiters

Page 67: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Extension to linear systems

Page 68: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Nonlinear scalar conservation laws

Upwind methods for u > 0.

Page 69: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Weak solutions depend on the conservation law

Page 70: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Conservation form

Page 71: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Importance of conservation form

Page 72: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

nonconservative method

conservative method

Burgers' equation solved with an upwind method, to demonstrate that this does not approximate the weak solution properly.

Page 73: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Lax-Wendroff Theorem

Note:

Page 74: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Boundary conditions and ghost cells

Page 75: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Sample boundary conditions

Page 76: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Computed with 400 grid points and the MC limiter.

inflow

inflow

reflecting boundary

reflecting boundary

sinusoidal disturbance enters here

Acoustics equationsZero initial condition.

28 2 Conservation Laws and Differential Equations

and since p0 = P(ρ0), we obtain

p ≈ P ′(ρ0)ρ.

Also we have

ρu = (ρ0 + ρ)(u0 + u) = ρ0u0 + ρu0 + ρ0u + ρu,

and so

!ρu ≈ u0ρ + ρ0u.

Using these expressions in the equations (2.47) and performing some manipulations(Exercise 2.1) leads to the alternative form of the linear acoustics equations

pt + u0 px + K0ux = 0,

ρ0ut + px + ρ0u0ux = 0,(2.48)

where

K0 = ρ0 P ′(ρ0). (2.49)

The equations (2.48) can be written as a linear system"

pu

#

t

+"

u0 K0

1/ρ0 u0

# "pu

#

x

= 0. (2.50)

Here and from now on we will generally drop the tilde on p and u and use

q(x, t) ="

p(x, t)u(x, t)

#

to denote the pressure and velocity perturbations in acoustics.The system (2.50) can also be derived by first rewriting the conservation laws (2.38) as

a nonconservative set of equations for u and p, which is valid only for smooth solutions,and then linearizing this system; see Exercise 2.2.

An important special case of these equations is obtained by setting u0 = 0, so that weare linearizing about the motionless state. In this case the coefficient matrix A appearing inthe system (2.50) is

A ="

0 K0

1/ρ0 0

#(2.51)

and the equations reduce to

pt + K0ux = 0,

ρ0ut + px = 0.(2.52)

In Section 2.12 we will see that essentially the same set of equations can be derived forone-dimensional acoustics in an elastic solid. The parameter K0 is called the bulk modulusof compressibility of the material; see Section 22.1.2 for more about this parameter.

28 2 Conservation Laws and Differential Equations

and since p0 = P(ρ0), we obtain

p ≈ P ′(ρ0)ρ.

Also we have

ρu = (ρ0 + ρ)(u0 + u) = ρ0u0 + ρu0 + ρ0u + ρu,

and so

!ρu ≈ u0ρ + ρ0u.

Using these expressions in the equations (2.47) and performing some manipulations(Exercise 2.1) leads to the alternative form of the linear acoustics equations

pt + u0 px + K0ux = 0,

ρ0ut + px + ρ0u0ux = 0,(2.48)

where

K0 = ρ0 P ′(ρ0). (2.49)

The equations (2.48) can be written as a linear system"

pu

#

t

+"

u0 K0

1/ρ0 u0

# "pu

#

x

= 0. (2.50)

Here and from now on we will generally drop the tilde on p and u and use

q(x, t) ="

p(x, t)u(x, t)

#

to denote the pressure and velocity perturbations in acoustics.The system (2.50) can also be derived by first rewriting the conservation laws (2.38) as

a nonconservative set of equations for u and p, which is valid only for smooth solutions,and then linearizing this system; see Exercise 2.2.

An important special case of these equations is obtained by setting u0 = 0, so that weare linearizing about the motionless state. In this case the coefficient matrix A appearing inthe system (2.50) is

A ="

0 K0

1/ρ0 0

#(2.51)

and the equations reduce to

pt + K0ux = 0,

ρ0ut + px = 0.(2.52)

In Section 2.12 we will see that essentially the same set of equations can be derived forone-dimensional acoustics in an elastic solid. The parameter K0 is called the bulk modulusof compressibility of the material; see Section 22.1.2 for more about this parameter.

28 2 Conservation Laws and Differential Equations

and since p0 = P(ρ0), we obtain

p ≈ P ′(ρ0)ρ.

Also we have

ρu = (ρ0 + ρ)(u0 + u) = ρ0u0 + ρu0 + ρ0u + ρu,

and so

!ρu ≈ u0ρ + ρ0u.

Using these expressions in the equations (2.47) and performing some manipulations(Exercise 2.1) leads to the alternative form of the linear acoustics equations

pt + u0 px + K0ux = 0,

ρ0ut + px + ρ0u0ux = 0,(2.48)

where

K0 = ρ0 P ′(ρ0). (2.49)

The equations (2.48) can be written as a linear system"

pu

#

t

+"

u0 K0

1/ρ0 u0

# "pu

#

x

= 0. (2.50)

Here and from now on we will generally drop the tilde on p and u and use

q(x, t) ="

p(x, t)u(x, t)

#

to denote the pressure and velocity perturbations in acoustics.The system (2.50) can also be derived by first rewriting the conservation laws (2.38) as

a nonconservative set of equations for u and p, which is valid only for smooth solutions,and then linearizing this system; see Exercise 2.2.

An important special case of these equations is obtained by setting u0 = 0, so that weare linearizing about the motionless state. In this case the coefficient matrix A appearing inthe system (2.50) is

A ="

0 K0

1/ρ0 0

#(2.51)

and the equations reduce to

pt + K0ux = 0,

ρ0ut + px = 0.(2.52)

In Section 2.12 we will see that essentially the same set of equations can be derived forone-dimensional acoustics in an elastic solid. The parameter K0 is called the bulk modulusof compressibility of the material; see Section 22.1.2 for more about this parameter.

Page 77: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

Advection equationZero initial condition.

inflow outflow

sinusoidal disturbance enters here

Page 78: Introduction to numerical methods to hyperbolic PDE’sx =0 conservation of mass conservation of momentum conservation of total energy closure relationship - equation of state: polytropic

A standing wave in a closed tube with solid wall boundary conditions.Acoustics equations

reflecting boundary

reflecting boundary

reflecting boundary

reflecting boundary

reflecting boundary