65

V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

Chapter �

Hyperbolic Problems

��� Vector Systems and Characteristics

Let�s resume the study of �nite di�erence techniques for hyperbolic conservation laws by

examining the characteristics of one�dimensional vector systems having the form

ut � f�u�x � b�x� t�u�� ��a�

Here� u�x� t�� f�u�� and b�x� t�u� are m�dimensional vectors As in Chapter � it is

sometimes convenient to write ��a� in the convective form

ut �Aux � b� ��b�

where the Jacobian

A�u� � fu�u� ��c�

is an m�m matrix

De�nition ������ If A has m real and distinct eigenvalues �� � �� � � � � � �m and�

hence� m linearly independent eigenvectors p���� p���� � � � �p�m�� then ������a� is said to

be hyperbolic�

Physical problems where dissipative e�ects can be neglected often lead to hyperbolic

systems Areas where these arise include acoustics� dynamic elasticity� electromagnetics�

and gas dynamics

Page 2: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

� Hyperbolic Problems

Let

P � p����p���� � � � �p�m�� ���a�

and write the eigenvalue�eigenvector relation in matrix form as

AP � P�� ���b�

where

� �

�������

��

�m

����� ���c�

Multiplication of ��b� by P�� and the use of ���b� gives

P��ut �P��Aux � P��ut ��P��ux � P��b�

Let

w � P��u ����

so that

wt ��wx � P��ut � �P���tu �� P��ux � �P���xu��

Using ����

wt ��wx � Qw � g� ���a�

where

Q � �P���t ���P���x�P� g � P��b� ���b�

In component form� ���a� is

�wi�t � �i�wi�x �mXj��

qi�jwj � gi� i � � �� � � � � m� ���c�

Thus� the transformation ���� has uncoupled the di�erentiated terms of the original

system ��b�

Page 3: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� Vector Systems and Characteristics �

As in Chapter � consider the directional derivative of each component wi� i �

� �� � � � � m� of w�dwi

dt� �wi�t � �wi�x

dx

dt� i � � �� � � � � m�

in the directions

dx

dt� �i� i � � �� � � � � m� ����

and use ���c� to obtain

dwi

dt�

mXj��

qi�jwj � gi� i � � �� � � � � m� ����

As a reminder� the curves ���� are the characteristics of the system ��a� �b�

The partial di�erential system ��b� may be solved by integrating the �m ordinary

di�erential equations ���� ��� This system is uncoupled through its di�erentiated

terms but coupled through Q and g This method of solution is� quite naturally� called

the method of characteristics While we could develop e�ective numerical methods based

on the method of characteristics� they are generally not e�cient when m � �

In Chapter � we studied homogeneous �b � �� scalar problems �m � � and found

that the solution u did not change along the characteristic Examining ����� we see

that wi will change along the characteristic unless the right side of ���� vanishes This

generally requires both b � � and P to be constant Similarly� we�ll have to modify the

de�nition of domain of dependence that was introduced in Chapter � to accommodate

the inhomogeneous term in ��b�

De�nition ������ The set of all points that determine the solution at a point P �x�� t��

is called the domain of dependence of P �

Consider the arbitrary point P �x�� t�� and the characteristics passing through it as

shown in Figure � The solution u�x�� t�� depends on the initial data on the interval

A�B� and on the values of b in the region APB� bounded by A�B� and the characteristic

curves �x � �� and �x � �m Thus� the region APB is the domain of dependence of P

Example ����� Consider the initial value problem for the forced wave equation

utt � a�uxx � q�x�� �� � x ��� t � ��

Page 4: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

� Hyperbolic Problems

dx/dt =

x

1dx/dt =

P(x ,t )

A B

t

��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

0 0

λ

Figure �� Domain of dependence of a point P �x�� t�� The solution at P depends onthe initial data on the line A�B� and the values of b within the region APB boundedby the characteristic curves dx�dt � ��� �m

u�x� �� � u��x�� ut�x� �� � �u��x�� �� � x ���

If u�x� t� corresponds to the transverse displacement of a taut string� then the constant

a� � T��� where T is the tension and � is the linear density of the string� and q�x�

is a lateral load applied to the string in the direction of u The lateral load could� for

example� represent the weight of the string

We�ll transform the wave equation to a �rst�order system by letting

u� � ut� u� � aux�

Physically� u��x� t� is the velocity and u��x� t� is the stress at point x and time t in the

string

The transformation gives

�u��t � a�u��x � q

and the compatibility condition

�u��t � auxt � autx � a�u��x�

Thus� the �rst�order system has the form of ��b� with

u �

�u�u�

�� A �

�� �a�a �

�� b �

�q�

��

Page 5: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� Vector Systems and Characteristics �

The initial conditions become

u��x� �� � �u��x�� u��x� �� � au�x�x�� �� � x ���

The eigenvalues of A are � � �a� the characteristics are

�x � �a�

and the eigenvectors are

P �p�

� �

��

Since P�� � P� we may use ���� to determine the canonical variables as

w� �u� � u�p

�� w� �

u� � u�p�

From ����� the canonical form of the problem is

�w��t � a�w��x �qp�� �w��t � a�w��x �

qp��

The characteristics integrate to

x � x� � at� x � x� � at�

and along the characteristics� we have

dwk

dt�

qp�� k � � ��

Integrating� we �nd

w��x� t� � w���x�� �

p�

Z t

q�x� � a��d�

or

w��x� t� � w���x���

ap�

Z x��at

x�

q���d��

It�s usual to eliminate x� by using the characteristic equation to obtain

w��x� t� � w���x � at��

ap�

Z x

x�at

q���d��

Likewise

w��x� t� � w���x� at� �

ap�

Z x

x�at

q���d��

Page 6: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

� Hyperbolic Problems

0

0

t

dx/dt = -adx/dt = a

0P(x ,t )

x

x - at x + at0

��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

0 0

Figure ��� The domain of dependence of a point P �x�� t�� for Example � is thetriangle connecting the points P � �x� � at�� ��� and �x� � at�� ��

The domain of dependence of a point P �x�� t�� is shown in Figure �� Using the

bounding characteristics� it is the triangle connecting the points �x�� t��� �x� � at�� ���

and �x� � at�� �� �Actually� with q being a function of x only� the domain of dependence

only involves values of q�x� on the subinterval �x� � at�� �� to �x� � at�� ���

Transforming back to the physical variables

u��x� t� �p��w� � w�� �

p� w�

��x� at� � w���x� at�� �

�a

Z x�at

x�at

q���d��

u��x� t� �p��w��w�� �

p� w�

��x� at��w���x� at���

�a

Z x

x�at

q���d��

Z x

x�at

q���d���

Suppose� for simplicity� that �u��x� � �� then

u��x� �� � � �p� w�

��x� � w���x���

u��x� �� � au�x�x� �p� w�

��x�� w���x���

Thus�

w���x� � �w�

��x� �au�x�x�p

��

and

u��x� t� �a

� u�x�x � at�� u�x�x� at�� �

�a

Z x�at

x�at

q���d��

Page 7: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� Vector Systems and Characteristics �

u��x� t� �a

� u�x�x� at� � u�x�x� at���

�a

Z x

x�at

q���d� �

Z x

x�at

q���d���

Since u� � aux� we can integrate to �nd the solution in the original variables In order

to simplify the manipulations� let�s do this for the homogeneous system �q�x� � �� In

this case� we have

u��x� t� �a

� u�x�x � at� � u�x�x� at���

hence�

u�x� t� �

� u��x� at� � u��x� at���

The solution for an initial value problem when

u��x� �

x� � if � � x � �� x� if � � x � �� otherwise

is shown in Figure �� The initial data splits into two waves having half the initial

amplitude and traveling in the positive and negative x directions with speeds a and �a�respectively

u(x,0)

x-1 1

-1 1 x

-1 1

-1 1

x

x

u(x,1/2a)

u(x,1/a) u(x,3/2a)

Figure ��� Solution of Example � at t � � �upper left�� ��a �upper right�� �a�lower left�� and ���a �lower right�

Page 8: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

� Hyperbolic Problems

��� The Courant� Friedrichs� Lewy Theorem

All �nite di�erence schemes that we have developed and studied for scalar problems

extend to vector systems of the form ��a� or ��b� Thus� for example� the Lax�

Friedrichs scheme for ��b� is

Un��j � �Un

j�� �Unj�����

�t�An

j

Unj�� �Un

j��

��x� bnj �

where Anj � A�j�x� n�tUn

j �� etc� The Courant� Friedrichs� Lewy Theorem also applies

to vector systems of the form ��b�

Theorem ������ �Courant� Friedrichs� Lewy�� A necessary condition for the conver�

gence of a �nite di�erence scheme is that its domain of dependence contain the domain

of dependence of the partial di�erential system ������b��

Proof� We�ll prove the theorem for constant�coe�cient problems Proofs in more general

situations are similar The matrix Q of ���b� is zero for constant�coe�cient problems

and the canonical form of ��b� becomes

wt ��wx � g� ����

The eigenvalues �� � �� � � � � � �m are constant and the characteristics are straight

lines A typical set of characteristics passing through an arbitrary point P �x�� t�� is

shown in Figure �� Again� for simplicity� suppose that a four�point one�level explicit

�nite di�erence scheme

Wn��j � C��W

nj�� �C�W

nj �C�W

nj�� ��tgnj � �����

is used to obtain the numerical solution of ���� The stencil of this di�erence scheme

and its domain of dependence are shown in Figure ��� The domain of dependence of

the �nite di�erence scheme is the region ABP � which is bounded by the x axis and the

lines of slope ��t��x The domain of dependence of the partial di�erential equation

is shown as the region CDP in Figures �� and ��� We suppose that the domain

of dependence of the partial di�erential equation does not contain that of the di�erence

Page 9: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� The CFL Theorem �

t

dx/dt = dx/dt = λλ

P(x ,t )

m

0 0

1

C D

x

Figure ��� Characteristics and domain of dependence for a constant coe�cient problemof the form ��b�

����

����

������������

����������������

���������� ���������� ����

���� ���������� ���������� ���� ����

����������������������������������

���������� ���� ���������� ���������� ���� ���������� ����

������

t

dx/dt = dx/dt = λλ

P(x ,t )

m

0 0

1

C DA B

x

Figure ���� Sample domains of dependence of constant coe�cient partial di�erentialequation of the form ��b� and a di�erence scheme of the form of �����

scheme� again� as shown in Figure ��� Consider a problem where the initial data

vanishes on AB and the source g vanishes on ABP The �nite di�erence solution at P

is� therefore� trivial However� if the initial data is nonzero on CA or BD or the source

g is nonzero on CAP or BDP � the solution of the partial di�erential system need not

Page 10: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

� Hyperbolic Problems

be zero at P Moreover� the solution of the di�erence scheme cannot converge to that of

the partial di�erential equation as long as the mesh is re�ned with �t��x �xed� since

the solution of the di�erence equation will always be zero at P We� therefore� have a

generalization of the Courant� Friedrichs� Lewy Theorem considered in Chapter �

Remark � The Courant� Friedrichs� Lewy Theorem restricts all explicit �nite di�er�

ence schemes to satisfy

max��i�m

j�ij�t�x

� � �����

Remark � The Courant� Friedrichs� Lewy Theorem is usually stated as a stability

restriction rather than a convergence restriction Our proof would have to be supple�

mented by the Lax equivalence theorem in order to demonstrate that it also imposes a

stability restriction

The von Neumann method can be used to study the stability of homogeneous �b � ��

constant coe�cient systems with periodic initial data Thus� consider

ut �Aux � �� �� � x ��� t � �� ����a�

u�x� �� � ��x�� �� � x ��� ����b�

where A is constant and ��x� is periodic in x As an example� consider a one�level �nite

di�erence scheme having the form

Xjsj�S

DsUn��j�s �

Xjsj�S

CsUnj�s� �����

where Cs and Ds are m�m matrices and S is an integer

As in the scalar case� assume a solution in the form of a discrete Fourier series

Unj �

J��Xk��

Anke

��ijk�J � �����

Substituting ����� into �����

Xjsj�S

J��Xk��

DsAn��k e��i�j�s�k�J �CsA

nke

��i�j�s�k�J � � ��

Page 11: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� The CFL Theorem

Rearranging the sums

J��Xk��

Xjsj�S

DsAn��k e��iks�J �Cse

��iks�JAnk �e

��ijk�J � ��

Using the orthogonality condition ������ we �nd

Xjsj�S

Dse��iks�JAn��

k �Xjsj�S

Cse��iks�JAn

k � �����

Solving for Ank

Ank � �Mk�

nA�k� ����a�

where

Mk �

��X

jsj�S

Dse��iks�J

A

����X

jsj�S

Cse��iks�J

A � ����b�

The ampli�cation factor Mk is an m �m matrix In order to demonstrate the stability

of the di�erence scheme ������ we must �nd a constant C such that

k�Mk�nk � C� �t� �� n�t � T� �����

The von Neumann necessary condition for stability implies that there exists a constant

c such that

��Mk� � max��i�m

j�i�Mk�j � � c�t� �t� �� ����a�

For absolute stability� we require

��Mk� � � ����b�

Conditions ����� and ����� may be quite di�cult to verify in practice We may try

to bound the eigenvalues� but such bounds must be accurate in order to draw conclusions

about stability

Page 12: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

� Hyperbolic Problems

��� Dissipation and Dispersion

As a prelude to understanding those di�erence schemes that will be e�ective for solving

nonlinear problems with discontinuous solutions� let us return to the linear scalar initial

value problem

ut � aux � �� t � �� u�x� �� � e��ikx� �� � x ��� ����

Many of the results developed in this section are qualitatively the same for nonlinear

problems and vector systems� but� naturally� more di�cult to analyze

Consider an explicit �nite di�erence approximation of ���� having the form

Un��j � Un

j �

��Un

j�� � Unj��� �

��Un

j�� � �Unj � Un

j���� �����

where

� a�t

�x�����

is the Courant number Several popular di�erence schemes have this form for di�erent

values of and some are listed in Table �� The centered scheme is not absolutely stable

for any choice of � whereas the other schemes are absolutely stable for some range of

�Chapter �� and we seek to understand the reasons why this is so For completeness�

we�ll also include the leap frog scheme

Un��j � Un��

j � �Unj�� � Un

j��� �����

in our study

Method �

Centered � �Lax�Wendro� � a��t��Upwind jj jaj�x��Lax�Friedrichs �x����t

Table ��� Values of the parameters and � for several di�erence schemes having theform of �����

Page 13: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� Dissipation and Dispersion �

The scheme ����� may also be regarded as an approximation of the convection�

di�usion problem

ut � aux � �uxx� t � �� u�x� �� � e��ikx� �� � x ��� ����a�

with forward time and centered space di�erencing The exact solution of this problem is

u�x� t� � e�����k�te��ik�x�at�� ����b�

We have already seen that�

� The term �uxx in ����a� is dissipative or di�usive It decreases the L� energy of

the system �Section �� When � � � the L� energy of the system is conserved

� The dissipation is frequency dependent with the higher frequency terms having the

greatest decrease in amplitude

� When ����k�t� � the solution of ����a� is a good approximation of the solution

of ����

We have also seen that instabilities in �nite di�erence schemes result in a rapid growth

in the amplitudes of the high�frequency modes of the discrete solution This suggests the

addition of a small di�usion term �e�g�� a discrete approximation of �uxx� to a �nite

di�erence scheme to kill the growth of the high�frequency oscillations without greatly

a�ecting accuracy of the solution

The methods of Table �� are meant to approximate ����� however� with the ex�

ception of the centered scheme� they can also be regarded as discrete approximations of

����a� with various di�usivities For example�

� The Lax�Wendro� scheme is an approximation of ����a� with forward time dif�

ferences� centered space di�erences and � � �x����t � a��t�� Since the di�u�

sivity � � O��t�� the Lax�Wendro� scheme is consistent with ���� as �t � �

The di�usivity is arti�cial since it is proportional to a numerical parameter ��t�

� The upwind scheme is an approximation of ����a� using forward time and centered

space di�erences with � � �x����t � jaj�x��

Page 14: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

� Hyperbolic Problems

� Similarly� the Lax�Friedrichs scheme approximates ����a� with the same di�er�

encing and � � �x����t � �x����t

The solution of ����� for the special initial conditions ���� is �cf� Problem ����

Unj � �Mk�

ne��ikj�J � ����a�

where

Mk � � � sin� � i sin � � ����b�

and

� k��J� ����c�

The magnitude of the ampli�cation factor is

jMkj� � � �� � �� sin� � � ��� � sin� � ����d�

The magnitude of the ampli�cation factor when � ���� is shown as a function of in

Figure �� for each of the schemes given in Table �� The centered scheme ampli�es

the initial data for all values of while the upwind� Lax�Friedrichs� and Lax�Wendro�

schemes dissipate the initial amplitude for virtually all frequencies

De�nition ������ A �nite di�erence scheme is dissipative of order r if there exists a

constant c � �� independent of �t and �x� such that

jMk� �j � � cj j�r� � � � ���� ����a�

There are other equivalent de�nitions First� observe that it su�ces to �nd a constant

�c � � satisfying

jMk� �j� � � �cj j�r� � � � ���� ����b�

Strikwerda ��� Section �� observes that many common schemes have an ampli�cation

factor satisfying

jMk� �j� � � �c sin�r � � � � ���� ����c�

Page 15: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� Dissipation and Dispersion �

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.60

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

Figure ��� Magnitudes of the ampli�cation factors when � ���� as functions of � k��J for the centered �o�� Lax�Wendro� �x�� upwind ���� Lax�Friedrichs ���� andleap frog ���� schemes

with �c � � Since sin � � � � ���� ����a� and ����c� are equivalent

Example ���� Using De�nition �� and ����d�� let�s examine the order of dissi�

pation of the Lax�Wendro�� upwind� Lax�Friedrichs� and centered schemes Beginning

with the Lax�Wendro� scheme� we set � � in ����d� to obtain

jMkj� � � ��� �� sin� � � ���� �� sin� �

Using the double angle formula

jMkj� � � ���� �� sin� �

Thus� the Lax�Wendro� scheme is dissipative of order four

Page 16: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

� Hyperbolic Problems

For upwind di�erencing� we set � jj in ����d� and �nd

jMkj� � � �jj�� jj� sin� �

Thus� upwind di�erencing is dissipative of order two The Lax�Wendro� scheme with

fourth�order dissipation gives a more accurate representation of the lower�frequency

modes than upwind di�erencing and greater dissipation of the high�frequency modes

For the Lax�Friedrichs scheme� we set � in ����d� and obtain

jMkj� � � �� �� sin� � �

For small � we can �nd a constant c � ������ so that ����a� is satis�ed However�

this bound will not hold when ��� Thus� the Lax�Friedrichs scheme is not strictly

dissipative It will reduce the magnitude of the ampli�cation factor for most frequencies�

but not those of the highest�frequency modes �Figure ���

Finally� the centered space scheme has jMk� �j � � � � � ���� and is not dissipa�

tive

Using the von Neumann method on the leap frog scheme ������ we �nd the two

ampli�cation factors as �cf� Problem at the end of this Section�

M�k � i sin � �

p� � sin� � � ����a�

There are two ampli�cation factors since the leap frog method is a two�level scheme and�

as described in Section ��� the discrete solution involves a linear combination of the two

Assuming that jj � � we see that both factors have unit magnitude� i�e��

jM�k j� � � ����b�

Thus� the leap frog scheme neither dissipates nor ampli�es the magnitudes of the initial

data for any frequency �Figure ���

With the prescribed initial data� the exact solution of ���� has unit magnitude

Thus� the leap frog scheme has no amplitude error The question� of course� is if the leap

frog scheme has no amplitude error� what error does it have� In order to answer this

query� write the ampli�cation factor �either ����b� or ����a� in the polar form

Mk � jMkje�i�k ����a�

Page 17: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� Dissipation and Dispersion �

where

tan�k � sin �

� � sin� ����b�

for ����b� and

tan��k � � sin � p� � sin� �

����c�

for ����a� Using ����a�� the solution of the di�erence equation ����� may be written

in the form

Unj � jMkjne�in�ke��ikj�J � jMkjne��ik�xj��ktn� ����a�

where

xj � j�x �j

J� tn � n�t� �k �

�k��k�t

� ����b�

We will also regard this as being one component of the solution of the leap frog scheme

����� when ����c� is used for �

The phase speed of a wave of the form

ei��x��t�

is the quantity ��� It is the speed at which waves of frequency � propagate If the phase

speed depends on the wave number � then the wave is said to be dispersive� otherwise it

is non�dispersive The exact solution of the model problem ���� is

u�x� t� � e��ik�x�at��

Hence� � � ��ka and � � ��k The phase speed is a and the wave is non�dispersive

However� the phase speed �k of either �nite di�erence scheme ����� or ����� depends

on k and� hence� these waves are dispersive Normalized phase speeds ��k�a� are shown

as functions of for the schemes of Table �� and the leap frog scheme ����� Jumps

in the phase speed correspond to branch cuts in the arctangent function While phase

speeds appear reasonable when is small� all have large errors when is near ��� With

� ���� for example� both ����b� and ����c� give tan�k � � and� consequently�

Page 18: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

� Hyperbolic Problems

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6−1.5

−1

−0.5

0

0.5

1

1.5

Figure ���� Normalized phase speeds �k�a when � ���� as functions of � k��J forthe centered �o�� Lax�Wendro� �x�� upwind ���� Lax�Friedrichs ���� and leap frog ����schemes

�k � � �Figure ���b� Thus� instead of having speed a� waves of both schemes �����

and ����� are practically stationary when ���

In order to get additional qualitative information about the degradation of the phase

speed with increasing � let�s expand ����b� in a series about � � Thus�

tan�k � �� � ����� � � �� � � � �� � �����

For small z� tan�� z z � z���� thus�

�k � � � �

�� � �� � ����

Using ����b�

�k ��k

��k�t ��k��J��a�t��x�

��k�t � � �

�� � �� � ���

Page 19: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� Dissipation and Dispersion �

Method Approximate �k

Centered � a � � �� � ������Lax�Wendro� � a � � ��� �����Upwind jj a � � ��� ��� �����Lax�Friedrichs a � � ��� �����Leap frog �a � � ��� �����

Table ���� Approximate phase speeds for the di�erence schemes ����� and �����when ��

or

�k a � � �

�� � �� � ���� ���a�

The results are summarized in Table �� for the four schemes of Table �� A similar

analysis of the leap frog scheme gives �cf� Problem at the end of this Section�

�k �a � � �

��� ���� ���b�

Clearly� the positive sign corresponds to the correct solution and the negative sign to a

parasitic solution introduced by the multi�level scheme

Comparing the data in Figure ��� and Table ��� all schemes considered have ap�

proximately the correct phase speed for low�frequency waves � � �� but have large

errors when ��� Assuming that � � � � the data of Table �� indicates that

low�frequency waves travel slower than the correct speed for the centered scheme� the

Lax�Wendro� scheme� the leap frog scheme� and the upwind scheme when � �� Un�

der the same assumption� low�frequency waves travel faster than the correct speed for

the Lax�Friedrichs scheme and the upwind scheme when � �� These conclusions are

veri�ed for � ���� in Figure ���

Since the high�frequency waves have large phase�speed errors� it seems appropriate

to dissipate them The upwind and Lax�Wendro� schemes dissipate the high�frequency

waves the most �Figure ���� thus� they would be good schemes to use when high�

frequency information is present The leap frog scheme� on the other hand� does not

dissipate waves of any frequency and would not be a good one to use in connection with

high�frequency data While the Lax�Friedrichs scheme is dissipative for most frequencies�

Page 20: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

�� Hyperbolic Problems

it is less so for the highest�frequency modes Finally� the centered scheme is not dissipative

and should not be used

Problems

Use the Von Neumann method to show that the ampli�cation factors of the Leap

frog di�erence scheme ����� for the initial value problem ���� are given by

����a� Show that the amplitudes and phase speeds of the ampli�cation factors

are given by ����b� and ����c�� respectively Obtain approximations of the phase

speeds for small and large values of Compare the approximate and true phase

speeds

��� Nonlinear Problems

The time step restriction implied by the Courant� Friedrichs� Lewy Theorem is not re�

strictive for many hyperbolic problems� thus� explicit �nite di�erence schemes will often

be acceptable Implicit schemes are useful when �i� a problem involves widely disparate

characteristic speeds� �ii� a steady�state �time independent� solution is sought� or �iii�

reactions are involved The treatment of implicit schemes for hyperbolic systems is

fundamentally the same as for parabolic systems� so we�ll concentrate on the simpler

explicit schemes for solving a system of one�dimensional conservation laws having the

form ��a�

We have just learned that the Lax�Wendro� scheme has good dissipative properties�

particularly regarding high�frequency modes It is� however� di�cult to use because it

generally requires knowledge of the derivatives of the Jacobian A �cf� ��c and Section

��� An analogy with Runge�Kutta methods for ordinary di�erential equations would

suggest that derivatives of A could be avoided at the expense of additional evaluations

of the �ux f This typically leads to predictor�corrector methods and the �rst one that

we will study is due to Richtmyer � ��� Section ��� Using this method� a predicted

solution of ��a� is calculated by using the Lax�Friedrichs scheme for one�half time

step� i�e��

Un����j���� � �xU

nj���� �

�t

��x�xf

nj���� �

Unj�� �Un

j

�� �t

��x�fnj�� � fnj �� ���a�

Page 21: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� Nonlinear Problems �

This solution is corrected using the leap frog scheme

Un��j � Un

j ��t

�x�xf

n����j � Un

j ��t

�x�f

n����j���� � fn����

j���� �� ���b�

The computational stencils of the predictor and corrector steps of this scheme� which we�ll

call the Richtmyer two�step method� are shown in Figure �� The local discretization

error can be shown to be O��t�� �O��x�� The O��t�� error is due to the centering of

the leap frog corrector about tn����

���� ���� ����

����

������j j + 1j - 1 j - 1 j + 1j

n

n + 1

Figure ��� Computational stencils of the predictor �left� and corrector �right� stagesof the Richtmyer two�step method ���� Predicted solutions are shown in light blue

���� ������ ���� ����

����

j j + 1j - 1 j - 1 j + 1j

n

n + 1

Figure ���� Computational stencils of the predictor �left� and corrector �right� stagesof MacCormack�s method ����� Predicted solutions are shown in light blue

The Richtmyer two�step and Lax�Wendro� schemes are identical when f�u� � Au and

A is a constant However� the Richtmyer two�step scheme is much simpler to implement

than the Lax�Wendro� scheme for nonlinear systems The equivalence of the two methods

implies that the Richtmyer two�step scheme has similar properties to the Lax�Wendro�

scheme Indeed� both are stable for linear problems when the Courant� Friedrichs� Lewy

condition max��i�m j�ij�t��x � � is satis�ed Here �i� � i � m� is an eigenvalue of

A

Page 22: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

�� Hyperbolic Problems

MacCormack�s scheme �cf� ��� Section ��� uses a forward time�backward space

predictor and a backward time�forward space corrector for one�half time step� i�e��

�Un��j � Un

j ��t

�xrxf

nj � Un

j ��t

�x�fnj � fnj���� ����a�

Un��j �

Unj � �Un��

j

�� �t

��x�x

�fn��j �

Unj � �Un��

j

�� �t

��x��fn��j�� � �fn��

j � ����b�

where �fn��j � f� �Un��

j �

The computational stencils of the predictor and corrector stages of MacCormack�s

scheme are shown in Figure ��� MacCormack�s scheme can be shown to possess the

properties noted for the Richtmyer two�step scheme� including identity with the Lax�

Wendro� scheme for linear constant�coe�cient problems Finally� MacCormack�s scheme

can also be used in reverse order as

�Un��j � Un

j ��t

�x�xf

nj � Un

j ��t

�x�fnj�� � fnj �� ����a�

Un��j �

Unj � �Un��

j

�� �t

��xrx

�fn��j �

Unj � �Un��

j

�� �t

��x��fn��j � �fn��

j�� �� ����b�

����� Arti�cial Viscosity

We have seen that nonlinear conservation laws can give rise to discontinuous solutions

such as shock waves and contact surfaces The principal computational approaches to

treat problems with discontinuities involve �i� explicit tracking and �ii� implicit cap�

turing! Tracking is the more accurate of the two� but it is di�cult to implement for

problems in two and three dimensions We�ll concentrate on shock�capturing schemes

that isolate discontinuities without knowing their locations Let us begin with a simple

scalar problem

Example ������ Consider the Riemann problem for the inviscid Burgers� equation �cf�

Problem ��

ut ��u��x�

� �� �� � x ��� t � �� ����a�

Page 23: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� Nonlinear Problems ��

t

1/u

1/u

R

L

ξ

x

t

1/u1/uR

L

x

Figure ���� Shock �top� and expansion �bottom� wave characteristics of the Riemannproblem �����

u�x� �� �

�uL� if x � �uR� if x �

� ����b�

Recall that a Riemann problem is a Cauchy �initial value� problem with piecewise con�

stant initial data If uL � uR the solution of ����� features the shock wave

u�x� t� �

�uL� if x�t � ��

uR� if x�t ��� �� �

uL � uR�

� ����a�

If uL � uR the solution of ����� has the expansion

u�x� t� �

uL� if x�t � uLx�t� if uL � x�t � uRuR� if x�t uR

� ����b�

Page 24: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

�� Hyperbolic Problems

The characteristics of the shock and expansion solutions are shown in Figure ��� The

characteristics are straight lines with slopes of �uL for x�t � uL and �uR for x�t uR

No characteristics are generated within the expansion wave The entropy condition that

shocks can only exist when characteristics intersect can be used to infer that the two

characteristic families are not separated by a shock Viscosity arguments can be used to

construct the expansion fan ��

Consider solving a shock problem for ����� with uL � and uR � � by the Lax�

Friedrichs scheme

Un��j �

Unj�� � Un

j��

�� �

� �Un

j���� � �Un

j�����

and the Richtmyer two�step ���� scheme

Un����j���� �

Unj�� � Un

j

�� �

� �Un

j���� � �Un

j ����

Un��j � Un

j ��

� �U

n����j���� �

� � �Un����j���� �

���

where

� ��t

�x� �����

Selecting �x � �� and � � ����� we show solutions obtained by the two methods

for �ve time steps in Figure ��� The two numerical solutions are compared with the

exact solution at t � ���� in Figure ��� The Lax�Friedrichs solution is a monotone

decreasing function of x through the shock while the Richtmyer two step solution has an

overshoot

This situation is the same as the one that we observed for convection�di�usion systems

�Section �����

� �rst�order �nite di�erence methods preserve monotonicity of the solution near a

discontinuity but have excess dissipation and

� higher�order methods introduce oscillation near discontinuities

Let us formally explore these notions� at least for scalar problems

Page 25: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� Nonlinear Problems ��

−0.5

0

0.5

0

0.1

0.2

0.3

0.40

0.2

0.4

0.6

0.8

1

−0.5

0

0.5

0

0.1

0.2

0.3

0.40

0.2

0.4

0.6

0.8

1

1.2

1.4

xt

U

Figure ���� Shock wave solution of the Riemann problem ����� using the Lax�Friedrichs �top� and Richtmyer two�step �botom� schemes for �ve time steps

Page 26: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

�� Hyperbolic Problems

−0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4 0.50

0.2

0.4

0.6

0.8

1

1.2

1.4

x

u

Figure ���� Comparison of the exact� Lax�Friedrichs� and Richtmyer two�step solutionsof ����� at t � ��t

De�nition ������ A �nite�di�erence approximation of ������a� is in conservation form

if it can be written as

Un��j �Un

j

�t�Fnj���� � Fn

j����

�x� � ����a�

where

Fnj���� � F�Un

j�S���Unj�S��� � � � �U

nj�S� ����b�

and

Fnj���� � F�Un

j�S�Unj�S��� � � � �U

nj�S��� ����c�

for some integer S � �� The function F is called the numerical �ux and it is consistent

with the physical �ux f if

F�v�v� � � � �v� � f�v� ����d�

for any smooth function v�

Page 27: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� Nonlinear Problems ��

Remark � Consistency� in this situation� implies that the numerical and exact �uxes

agree for uniform data You might check whether or not this is equivalent to our usual

notion of consistency

De�nition ������ A scalar �nite di�erence scheme having the form

Un��j � G�Un

j�S� Unj�S��� � � � � U

nj�S� ����a�

is monotone if it is a monotone non�decreasing function of its arguments� i�e�� if

�G

�Unj�k

�� jkj � S� ����b�

For conservative schemes ����� ��

G�Unj�S� U

nj�S��� � � � � U

nj�S� � Un

j � ��F nj���� � F n

j������ ����c�

Remark This de�nition applies to vector systems of conservation laws� however�

we present it for scalar equations for simplicity

Example ���� Consider the Lax�Friedrichs scheme for a scalar conservation law

having the form ��a�

Un��j � G�Un

j��� Unj � U

nj��� �

Unj�� � Un

j��

�� �

� f�Un

j���� f�Unj�����

Di�erentiating

�G

�Unj��

� � �Un

j���

��

�G

�Unj

� ���G

�Unj��

�� �Un

j���

��

where

�v� �a�v��t

�x� a�v� � f ��v��

Thus��G

�Unk

�� k � j� j � �

and the scheme is monotone when jj �

De�ne

F nj���� � F �Un

j � Unj��� � �

���Un

j�� � Unj � �

fnj�� � fnj�

Page 28: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

�� Hyperbolic Problems

and

F nj���� � F �Un

j��� Unj � � �

���Un

j � Unj��� �

fnj � fnj��

Thus� the Lax�Friedrichs scheme can be written in conservation form ����� In a similar

fashion� we can show that the Richtmyer two�step scheme ���� can be written in

conservation form but it is not monotone �cf� Problem at the end of this Section�

Monotone di�erence schemes produce smooth transitions near discontinuities� how�

ever� as indicated by the following theorem� their existence is limited

Theorem ������ A monotone �nite di�erence scheme in the conservation form ������a�

must be �rst�order accurate�

Proof� cf� Sod �� or Harten� et al� ��

The results of Section �� �Figure ��� indicate that the Lax�Wendro� �hence� the

Richtmyer two�step� scheme has less dissipation for moderately high frequencies than

either the Lax�Friedrichs or upwind schemes Since discontinuous solutions have all fre�

quencies present� perhaps the oscillations could be reduced by adding even more viscosity

Consider any second�order di�erence scheme and add a di�usive term to its right�hand

side having the form

�x

�x�Qj�xUnj �

�x��

��x Qj�����U

nj�� �Un

j ��Qj�����Unj �Un

j����� ����a�

where Qj���� � Qj�����Unj �U

nj��� is an m�m matrix that vanishes when Un

j���Unj � �

Arti�cial viscosity terms of this form were originally studied by Lax and Wendro� ��

and are discussed in Richtmyer and Morton ��� Section ��� and Sod ��� Section ��

For scalar problems� Lax and Wendro� �� chose

Qj�����Unj � U

nj��� �

�janj�� � anj j� ����b�

where � is a parameter of order unity Thus� for example� the Lax�Wendro� scheme with

arti�cial viscosity would become �cf� Section ���

Un��j � Un

j � nj �x�xU

nj � �n

j ����xU

nj �

�t

��x�x�Qj�xU

nj �� ����c�

where nj is the Courant number

Page 29: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� Nonlinear Problems ��

Extending the arti�cial viscosity model to vector systems of conservation laws is more

di�cult Lax and Wendro� �� de�ne the matrix Qj���� in ����a� to have eigenvalues

�ij�i�j�� � �i�jj� i � � �� � � � � m� where �i�j� i � � �� � � � � m� are the eigenvalues of the

Jacobian A�Unj � � fu�U

nj � and �i� i � � �� � � � � m� are approximately one This eigen�

value condition is not su�cient to uniquely determine Qj���� and Lax and Wendro� ��

required Qj���� to commute with A They did this by prescribing Qj���� as m � th

degree polynomials in A

Let us illustrate the performance of the arti�cial viscosity technique using a simple

example

Example ����� Consider an initial value problem for the inviscid Burgers� equation

����a� with the data

u�x� �� � ��x� �

� if x � �� x� if � � x � �� if � x

Recall �Section �� that the exact solution is

u�x� t� �

� if x � tx��t��

� if t � x � �� if � x

� t � �

u�x� t� �

�� if x � �t� ����� if x �t� ���

� t �

The initial ramp steepens into a shock wave at t � For t � � the shock travels in the

positive x direction with speed ��

We solved this problem using upwind di�erencing� the Lax�Friedrichs method� and

the Richtmyer two�step method with and without the arti�cial viscosity model �����

Sod �� solved the same problem using other methods as well as these In each case� we

used �x � ����� �t � ���� and the arti�cial viscosity parameter � � ��� Solutions are

shown in Figures ��� � ��� as functions of x for t � ���� �� and ��

The solution shown in Figure ��� using the Lax�Friedrichs scheme has the greatest

dissipation The compression wave and shock have been spread over several computa�

tional cells The upwind scheme� shown in Figure ���� has much less apparent dissi�

pation As expected� the Richtmyer two�step scheme has oscillations trailing the shock�

Page 30: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

�� Hyperbolic Problems

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 20

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 20

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 20

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Figure ���� Comparison of exact and upwind�di�erence solutions of Example ��� att � ���� ��� ��� �top to bottom�

Page 31: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� Nonlinear Problems �

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 20

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 20

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 20

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Figure ���� Comparison of exact and Lax�Friedrichs solutions of Example ��� att � ���� ��� ��� �top to bottom�

Page 32: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

�� Hyperbolic Problems

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 20

0.2

0.4

0.6

0.8

1

1.2

1.4

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 20

0.2

0.4

0.6

0.8

1

1.2

1.4

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 20

0.2

0.4

0.6

0.8

1

1.2

1.4

Figure ���� Comparison of exact and Richtmyer two�step solutions of Example ��� att � ���� ��� ��� �top to bottom�

Page 33: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� Nonlinear Problems ��

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 20

0.2

0.4

0.6

0.8

1

1.2

1.4

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 20

0.2

0.4

0.6

0.8

1

1.2

1.4

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 20

0.2

0.4

0.6

0.8

1

1.2

1.4

Figure ���� Comparison of exact and Richtmyer two�step with added viscosity solutionsof Example ��� at t � ���� ��� ��� �top to bottom�

Page 34: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

�� Hyperbolic Problems

however� accuracy when the solution is continuous is quite good The oscillations of the

Richtmyer two�step scheme are reduced when arti�cial viscosity is added �Figure ����

For shock waves� the excess dissipation does not spread as time increases This is not the

case with the linear waves studied in Section �� The intersecting characteristics tend

to con�ne the excess dissipation to the vicinity of the shock This does not happen for

linear problems where discontinuities propagate along characteristics

Problems

Show that the Richtmyer two�step scheme ���� can be written in conservation

form but is not monotone What is the numerical �ux function�

� Consider the initial value problem

ut � f�u�x � g�u�� u�x� �� � ��

where u� f � g� and � are m�vectors that are periodic in x with period

� Write a computer program to solve the above initial value problem on � �

x � � � � t � T using the Richtmyer two�step procedure ����

�� Let m � �� u� � u� u� � v� and consider the linear wave equation

ut � vx � �� vt � ux � ��

with the initial conditions on � � x � given as

u�x� �� � �� v�x� �� �

�� if � � x � ���� if �� � x �

Solve the problem on � � t � T � for all combinations of J�N � �� ��� ��

such that � � �t��x � Calculate the exact solution and plot the exact

and numerical values of u�� u� as functions of x for t � �� ���� ��� ����

Calculate the errors in the maximum norm at t � for each component of the

solution and each mesh Comment on the accuracy and convergence rate

�� Let m � � u � u�� and consider the inviscid Burgers� equation ����a� with

the initial conditions on � � x � given as

u�x� �� �

� if � � x � ������ if ���� � x � ����� if ���� � x �

Page 35: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� Godunov Schemes ��

Solve this problem on � � t � T � � for the same combinations of J and

N given in Part � Calculate the exact solution and compare the exact and

numerical solutions at by plotting them at t � �� ��� � �� � Calculate errors

in the maximum norm at t � � Comment on the accuracy and estimate the

convergence rate

��� Godunov Schemes

The shock capturing �nite di�erence schemes for nonlinear hyperbolic problems have

not been very satisfying To reiterate� the �rst�order methods can preserve solution

monotonicity near discontinuities by introducing excess dissipation and the higher�order

methods oscillate near discontinuities In this section� we will study some modern ap�

proaches that try to alleviate these di�culties The problem is not solved and the subject

matter is still an active area of research Thus� our results will be somewhat tentative

Once again� let us focus on a one�dimensional system of conservation laws having

the form ��� When discontinuities are present� solutions are expected to satisfy the

integrated form of ��a�

d

dt

Z b

a

udx � �f�u�jba ����

on any interval a � x � b �cf� Section �� Discontinuities move according to the

Rankine�Hugoniot conditions

���uR � uL� � f�uR�� f�uL�� �����

where uR and uL are solutions values immediately to the right and left� respectively� of the

discontinuity The Rankine�Hugoniot conditions do not necessarily determine a unique

shock speed for vector systems ��� A way of introducing discontinuities directly into

the solution is to construct a weak form! of the problem using Galerkin�s method Weak

solutions automatically satisfy the partial di�erential system ��a� in regions where u

is smooth and the Rankine�Hugoniot conditions ����� across jumps Galerkin�s method

is at the core of the �nite element method While we won�t discuss this approach here�

we will note that problems still exist Weak solutions are not uniquely determined from

Page 36: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

�� Hyperbolic Problems

the initial data The expansion wave of Example �� illustrates this One way of

eliminating the non�uniqueness is to view solutions of ��� as limiting solutions of a

viscous problem� e�g��

ut � f�u�x � �uxx� �����

as the viscosity � � � The proper form of the viscous term may not be known and

di�erent limiting solutions may result from di�erent viscous models

An alternate and preferable means of eliminating the non�uniqueness of solutions is

through the use of an entropy function Again� we will not develop this topic further but

note that additional material may be found in� e�g�� Harten and Lax �� and Je�rey and

Taniuti ��

Having studied Riemann problems in Section ��� let us attempt to use their solutions

to construct numerical schemes Thus� let v�x�t�uL�uR� be the solution of a Riemann

problem for ��a� with the piecewise�constant initial data

u�x� �� �

�uL� if x � �uR� if x �

� �����

Example ����� The solution of the Riemann problem for the inviscid Burgers� equa�

tion ����a� is

v�x�t� uL� uR� �

�uL� if x�t � �uL � uR���uR� if x�t �uL � uR���

� if uL � uR�

and

v�x�t� uL� uR� �

uL� if x�t � uLx�t� if uL � x�t � uRuR� if x�t uR

� if uL � uR�

Godunov �� was the �rst to use solutions of Riemann problems to construct �nite�

di�erence procedures Glimm �� introduced a random component into the solution of

Riemann problems like ��a� ���� as an analytical tool to study existence and unique�

ness of solutions of initial value problems for ��� Chorin �� showed that Glimm�s

study could be used to create a numerical technique called the random choice method!

There are several variants of Chorin�s approach and Sod ��� Section ��� discusses

some of them The di�erence between the Glimm�Chorin random choice procedure and

Page 37: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� Godunov Schemes ��

Godunov�s �nite�di�erence scheme and its successors is that the former renders shocks

as exact discontinuities Shock speeds will generally only be correct on average� but the

discontinuities will not have any dissipation associated with them Godunov schemes are

shock capturing schemes that have dissipation associated with them and� thus� spread

discontinuities over a few computational cells

Shocks do not have to be perfectly sharp for most applications Some dissipation is

generally acceptable Additionally� exact solution of the associated Riemann problem

may neither be possible nor practical Let us� thus� consider the construction of �nite�

di�erence schemes that are based on the approximate solution of Riemann problems

and we�ll begin with a di�erence approximation of ��� in conservative form �����

Lax and Wendro� �� and Sod ��� Section ��� show that �nite di�erence schemes in

conservation form converge as �x and �t approach zero to functions w�x� t� that are

weak solutions of ��a�

n + 1

n

j - 1/2 j + 3/2j j + 1j + 1/2

U Uj j+1

nn

Figure ��� Grid structure for Godunov�s method

Let us introduce a uniform grid of spacing �x ��t and regard the solution at time

level n as being a piecewise constant function of x given by

Un�x� � Unj � �j � ����x � x � �j � ����x� �� � j ��� �����

�Figure ��� The solution of a Riemann problem breaking! at �xj����� tn� with this

piecewise constant data is v��x�xj�������t� tn��Unj �U

nj���� x � �xj� xj���� t � �tn� tn����

provided that solutions of Riemann problems on neighboring subintervals do not interact

This will be the case if time steps are selected to satisfy the Courant� Friedrichs� Lewy

Page 38: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

�� Hyperbolic Problems

condition

maxj

max��i�m

j�i�Anj �j

�t

�x�

�� ����a�

where �i� i � � �� � � � � m� are the eigenvalue of Anj Assuming ����a� is satis�ed� the

solution of all of the local Riemann problems can be written in the compact form

V�x� t� � v��x� xj�������t� tn��Unj �U

nj���� x � �xj� xj���� t � �tn� tn����

����b�

With Godunov�s �� method� the solution of an initial value problem at time tn�� is

obtained by projecting the solution of the Riemann problems onto piecewise constant

functions� i�e��

Un��j �

�x

Z xj����

xj����

V�x� tn���dx� �����

Since V�x� t� is an exact solution of the the partial di�erential system ��a��

� �

Z xj����

xj����

Z tn��

tn

Vt � fx�V��dxdt �

Z xj����

xj����

V�x� t�jtn��tn dx�

Z tn��

tn

f�V�jxj����xj����dt�

�����

However� V�xj����� t� � v���Unj���U

nj � and V�xj����� t� � v���Un

j �Unj��� are indepen�

dent of t� thus�

Z tn��

tn

f�V�jxj����xj����dt � f�v���Unj �U

nj����� f�v���Un

j���Unj ����t�

Using this and ����� in ����� yields

Un��j � Un

j � � f�v���Unj �U

nj����� f�v���Un

j���Unj ��� ����a�

where � � �t��x This is Godunov�s �� method It clearly has the conservation form

����� with the numerical �ux

FG�Unj �U

nj��� � f�v���Un

j �Unj����� ����b�

The subscript G is used merely to identify the numerical �ux associated with Godunov�s

method

Page 39: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� Godunov Schemes ��

Example ���� Using the solution of the Riemann problem for the inviscid Burgers�

equation of Example ��� we have

v��� uL� uR� �

���������

uL� if uL� uR � �uR� if uL� uR � ��� if uL � �� uR � �uL� if uL � �� uR � �� �uL � uR��� � �uR� if uL � �� uR � �� �uL � uR��� � �

The characteristics for these solutions are illustrated in Figure ��� The numerical �ux

is

FG�uL� uR� �

���������

u�L��� if uL� uR � �u�R��� if uL� uR � ��� if uL � �� uR � �u�L��� if uL � �� uR � �� �uL � uR��� � �u�R��� if uL � �� uR � �� �uL � uR��� � �

This �ux can be written more compactly by letting

u� � max�u� ��� u� � min�u� ��� ����a�

Then

FG�uL� uR� � max �u�L����� �u�R�

����� ����b�

Several schemes deriving from Godunov�s �� early work are now available We�ll

describe techniques developed by Roe ��� van Leer ���� and Cockburn and Shu ��

����� Roe�s Method

Roe �� developed a scheme having the conservation law form ����� with the numerical

�ux

FR�Unj �U

nj��� � f�w���Un

j �Unj����� ���a�

where w�x�t�uL�uR� is the exact solution of the linearized Riemann problem

wt � �A�uL�uR�wx � �� ���b�

The m�m matrix �A is an approximation of the Jacobian fusatisfying

f�uR�� f�uL� � �A�uL�uR��uR � uL�� ���c�

Page 40: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

�� Hyperbolic Problems

t

x

t

t

x

x

xx

t

t

t

x

Figure ���� Characteristics of Riemann problems for Burgers� equation when uL� uR � ��top�� uL� uR � � �center�� uL � �� uR � �� �uL � uR��� � � �bottom left�� anduL � �� uR � � �bottom right�

Example ���� The �ux for the inviscid Burgers� equation is f�u� � u��� and

���c� becomes

�u�R � u�L��� � �A�uL� uR��uR � uL��

Page 41: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� Godunov Schemes �

Thus� for this scalar problem

�A�uL� uR� � �uR � uL��� � ���

where �� is the shock speed Thus� Roe�s numerical �ux for the inviscid Burgers� equation

is

FR�uL� uR� �

�u�L��� if �� �

u�R��� if �� � ��

The approximate Riemann solver is exact when uL � uR and a shock is produced�

however� shocks are also produced when uL � uR and an expansion wave should occur

Thus� Roe�s scheme violates the entropy condition Harten and Hyman �� introduced a

modi�cation that eliminates the entropy violation We�ll depart from their development

and present an approach due to Harten� Lax� and van Leer � Both approaches appear

in Sod ��� Section ��

Let �min �max� be the minimum and maximum signal speeds associated with a Rie�

mann problem breaking at �xj����� tn� �Figure ���� The solution for

x� xj����

t� tn� �max

is uR Similarly� the solution for

x� xj����

t� tn� �min

is uL �Figure ���� Several solution states may exist between these extremes In order

to simplify the resulting di�erence method� Harten� Lax� and van Leer � considered

approximations with one and two states between the maximum and minimum signals

We�ll illustrate their method when one state is present In this case� their approximate

Riemann solution is

w�x�t�uL�uR� �

uL� if x�t � �min

u�� if �min � x�t � �max

uR� if �max � x�t� �����

In order to determine the intermediate state u�� they integrate the conservation law

��a� over the cell �xj� xj���� �tn� tn��� �Figure ���� to obtain

� �

Z xj��

xj

Z tn��

tn

ut � fx�u��dxdt �

Z xj��

xj

u�x� t�jtn��tn dx �

Z tn��

tn

f�u�jxj��xjdt�

Page 42: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

�� Hyperbolic Problems

j j + 1j + 1/2

n

n + 1

u

u

u

*

L R

ννmaxmin

Figure ���� Computational cell for the Riemann problem for Roe�s method The mini�mum �min and maximum �max signal speeds are assumed to be separated by one constantstate u�

Since the solutions at x � xj and xj�� are uL and uR� respectively� we have

Z xj��

xj

u�x� t�jtn��tn dx��t f�uR�� f�uL�� � �

From ������ we have

u�x� tn� �

�uL� if xj � x � xj����

uR� if xj���� � x � xj��

and

u�x� tn��� �

uL� if xj�� � x � xj���� � �min�tu�� if xj���� � �min�t � x � xj���� � �max�tuR� if xj���� � �max�t � x � xj��

�The speed �min has been assumed positive and not as shown in Figure ���� Thus� the

remaining integral may be evaluated to obtain

��x

�� �min�t�uL � ��max � �min��tu� � �

�x

�� �max�t�uR � �x

��uL � uR�

��t f�uR�� f�uL�� � �

or

u� ��maxuR � �minuL

�max � �min

� f�uR�� f�uL��max � �min

� �����

Harten� Lax� and van Leer � show that the modi�ed Roe�s scheme ����� ��a�

���� ���� no longer violates the entropy condition

Page 43: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� Godunov Schemes ��

Harten and Hyman �� described a procedure for calculating the signal speeds �min

and �max� which we describe for scalar problems They begin by selecting "�min and "�max�

respectively� as approximate speeds of the left and right ends of an expansion fan centered

at x � xj���� These may be taken as

"�min � min�����

�A�uL� �� �uL � uR�� ����a�

"�max � max�����

�A��� �uL � uR� uR�� ����b�

Their search over values of u � uL� uR� seeks to identify minimum and maximum signal

speeds that are not at the extreme values of uL and uR

They then select their signal speeds as

�min � �A�uL� uR�� � �A�uL� uR�� "�min�� ����c�

and

�max � �A�uL� uR� � �"�max � �A�uL� uR���� ����d�

Using ���c� in ������ they compute u� as

u� ��A�uL� uR�� �min

�max � �min

uL ��max � �A�uL� uR�

�max � �min

uR ����e�

The approximate solution of the Riemann problem is obtained from ����� translated

to �xj����� tn� Equations ����� may also be applied to vector systems that have been

put into canonical form by the transformation ���� � ��� Section ���

Example ����� For the inviscid Burgers� equation� we have �A�uL� uR� � �uL�uR��� �

�� �Example ���� Using ����a�

"�min � min�����

uL � �� �uL � uR�

� min�����

��� �uL � uR�

Since the argument of the minimization is a linear function of for Burgers� equation�

extreme values occur at � ��

"�min � min�uL�uL � uR

�� � min�uL� ����

Page 44: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

�� Hyperbolic Problems

Similarly� using ����b�

"�max � max�����

�� �uL � � � �uR�

� max� ��� uR��

In an expansion region� uL � �� � uR and "�min � uL and "�max � uR Using these

in ����c� ���d� yields �min � uL and �max � uR� which are the exact speeds of the

endpoints of the expansion fan Using these in ����e� gives u� � �� and� from ������

w�x�t� uL� uR� �

uL� if x�t � uL��� if uL � x�t � uRuR� if uR � x�t

For a shock� uL � �� � uR� so "�min � �� and "�max � �� Substitution into ����c�

���d� yields �min � �max � �� The intermediate solution disappears from ����� and

the solution of the Riemann problem is

w�x�t� uL� uR� �

�uL� if x�t � ��

uR� if �� � x�t�

����� Van Leer�s Method

Van Leer�s ��� technique is simplest to present for the linear scalar problem

ut � aux � �� �����

Suppose that we have an approximate solutionW n�x� at time tn� withW��x� correspond�

ing to the prescribed initial data Using the mesh structure of Figure ��� construct a

piecewise�constant approximation Un�x� of W n�x� as

Un�x� � Unj �

�x

Z xj����

xj����

W n�x�dx� x � �xj����� xj������ ����a�

The solution W n���x� at tn�� is obtained as the exact solution of ������ thus�

W n���x� � Un�x� a�t�� ����b�

The process is repeated for the next time step The steps in the procedure are illustrated

in Figure ��� If the Courant� Friedrichs� Lewy condition jaj�t��x � is satis�ed�

then the translation of Un�x� by the amount a�t does not exceed �x

Page 45: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� Godunov Schemes ��

x x x

xx

x x x

x

jj-1

j-2

j-2

j-2

j-1

j-1

j

j

W (x)n+1

W (x)n+1

W (x)n

U (x)n

U (x)n+1

Figure ���� Projection of W n�x� onto a piecewise constant function Un�x� �top� Con�vection of the piecewise constant functions Un�x� �center� to obtainW n���x� Projectionof W n���x� onto the piecewise constant function Un���x� �bottom�

Page 46: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

�� Hyperbolic Problems

If a � � then

W n���x� �

�Unj��� if xj���� � x � xj���� � a�t

Unj � if xj���� � a�t � x � xj����

Substituting this into ����a� and performing the integration yields

Un��j � a�Un

j�� � �� a��Unj � Un

j � a��Unj � Un

j���� �����

which is recognized as the �rst�order upwind di�erence scheme

Van Leer ��� extended this approach to higher orders of accuracy For example� he

obtained a second�order method by projecting W n�x� onto a space of piecewise linear

polynomials When this is done� one must �gure a way of determining the slope of

the solution on each subinterval Van Leer ��� describes several possibilities and some

of these also appear in Sod ��� Section �� One possibility uses centered di�erence

approximations from solution values on neighboring subintervals The description of a

second approach using moments follows

����� HigherOrder Methods

Higher order methods can achieve excellent accuracy and performance in regions where

the solution is smooth We�ll describe a method of constructing high�order methods that

uses moments of the solution� however� instead of following the traditional approach ����

we�ll describe an alternative treatment� called the discontinuous Galerkin method� as

developed by Cockburn and Shu ��

We�ll use a method of lines formulation and let W�x� t� be a piecewise linear approx�

imation of u�x� t� whose restriction to �xj����� xj����� is �Figure ����

W�x� t� � Uj�t� �DUj�t��x� xj� �����

where Uj�t� and DUj�t� are approximations of u�xj� t� and ux�xj� tn�� respectively Let

us use the integral form of the conservation law ���� with ����� to obtain

d

dt

Z xj����

xj����

W�x� t�dx � �f�W�jxj����xj���� �

Using the representation ����� and replacing f by a numerical �ux yields

�x �Uj�t� � �Fj���� � Fj���� ����a�

Page 47: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� Godunov Schemes ��

x x xxj-2 j-1 j j+1

x

W(x,t)

Figure ���� Piecewise linear function W n�x� used for the method of Cockburn andShu ��

where

Fj���� � Fj�����Uj�t� ��x

�DUj�t��Uj���t�� �x

�DUj���t��� ����b�

The gradient DUj is determined by taking a moment of ��a�� thus� we multiply

��a� by x � xj� integrate over the subinterval �xj����� xj������ and replace the exact

solution by the approximation ����� to obtain

d

dt

Z xj����

xj����

�x� xj�W�x� t�dx�

Z xj����

xj����

�x� xj�fx�W�dx � �

Integrating the �ux term by parts

d

dt

Z xj����

xj����

�x� xj�W�x� t�dx� �x� xj�f�W�jxj����xj���� �

Z xj����

xj����

f�W�dx�

Using �����

�x�

��DUj �

�x

� Fj���� � Fj����� �

Z xj����

xj����

f�W�dx� ����c�

Equations ����b� and ����c� are two vector ��m scalar� equations for the un�

knowns Uj�t� and DUj�t� To complete the speci�cation of the scheme ����� �����

we must �i� choose a numerical �ux� �ii� evaluate the integral on the right of ����c��

�iii� choose a time integration strategy� and �iv� de�ne initial conditions

Page 48: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

�� Hyperbolic Problems

The �ux can be evaluated by a Riemann or other numerical �ux Cockburn and

Shu �� describe several choices Perhaps the simplest is the Lax�Friedrichs �ux which�

in this context� is

Fj�����WL�WR� �

� f�WL� � f�WR��max�j�minj� j�maxj��WR �WL�� �����a�

where� using ������

WL � Uj�t� ��x

�DUj�t�� WR � Uj���t�� �x

�DUj���t� �����b�

are the solutions to the immediate left and right� respectively� of xj���� and �min and

�max are� respectively� the minimum and maximum eigenvalues of fu�u��WL � u �WR

The integral on the right of ����c� is usually evaluated numerically With the

midpoint rule� we have

Z xj����

xj����

f�W�dx � �xf�Uj� �O��x��� �����c�

Cockburn and Shu �� recommend a total variation diminishing �TVD� Runge�Kutta

scheme Biswas et al� � found that classical Runge�Kutta formulas gave similar results

With forward Euler integration and �����c�� the scheme ����� becomes

Un��j � Un

j ��t

�x Fn

j���� � Fnj����� ����a�

DUn��j � DUn

j ���t

�x� Fn

j���� � Fnj���� � �f�Un

j ��� ����b�

While the forward Euler method may be used for time integration� a second�order method

would be more compatible with the higher spatial accuracy

Finally� initial conditions may also be obtained by taking moments

Z xj����

xj����

W�x� ��� ��x��dx � ��

Z xj����

xj����

�x� xj� W�x� ��� ��x��dx � �� ������

The scheme may be recognized by some as a Galerkin method� which is the principal

technique used with �nite element methods It uses a discontinuous solution representa�

tion� hence� the name discontinuous Galerkin method It has several advantages�

Page 49: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� Godunov Schemes ��

� it readily extends to higher orders of accuracy by using higher�degree polynomials

and taking higher�order moments of the conservation law ��a� �� ��

� it may be used in two and three dimensions in much the same way as in one

dimension � ���

� it extends to unstructured meshes of triangular or tetrahedral elements ��� and

� it has a compact structure that is suitable for parallel computation

Unfortunately� since it is second order� it will have oscillations near discontinuities These

can be reduced by limiting the computed solution With limiting� the gradient DUj�t�

variable is reevaluated to eliminate overshoots in the solution In particular DUj is

modi�ed so that�

the linear function ����� does not take on values outside of the adjacent grid

averages �Figure ���� upper left��

� local extrema are set to zero �Figure ���� upper right�� and

� the gradient is replaced by zero if its sign is not consistent with its neighbors �Figure

���� lower center�

A formula for accomplishing these goals can be summarized concisely using the minimum

modulus function as

DUj�mod � minmod�DUj�rUj��Uj� �����a�

where

minmod�a� b� c� �

�sgn�a�min�jaj� jbj� jcj�� if sgn�a� � sgn�b� � sgn�c��� otherwise

�����b�

and r and � are the backward and forward di�erence operators� respectively

Example ����� Biswas et al� � solve the inviscid Burgers� equation ����a� with the

initial data

u�x� �� � � sin x

��

Page 50: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

�� Hyperbolic Problems

������������������������������������������������������������������������������������������

������������������������������������������������������������������������������������������

������������������������������������������������������������������������������������������������������������������������

������������������������������������������������������������������������������������������������������������������������

������������������������������������������������������������������������������������������

������������������������������������������������������������������������������������������

��������������������������������������������������������������������������������������������������������������������������������������������

��������������������������������������������������������������������������������������������������������������������������������������������

�������������������������������������������������������������������������������������������������������������������

�������������������������������������������������������������������������������������������������������������������

��������������������������������������������������������������������������������������������������������������������������������������������

��������������������������������������������������������������������������������������������������������������������������������������������

������������������������������������������������������������������������������������������������������������

������������������������������������������������������������������������������������������������������������

�������������������������������������������������������������������������������������������������������������������

�������������������������������������������������������������������������������������������������������������������

�������������������������������������������������������������������������������������������������������������������������������������������������

�������������������������������������������������������������������������������������������������������������������������������������������������j

j

j

Figure ���� Solution limiting� reduce slopes to be within neighboring averages �upperleft�� set local extrema to zero �upper right�� and set slopes to zero if they disagree withneighboring trends

They use an upwind numerical �ux

Fj�����WL�WR� �

�f�WL�� if f ��Uj� �f�WR�� if f ��Uj� � �

and solve problems with �x � ��� using �rst�� second� and third�order methods The

�rst�order method is obtained from ����a� by setting DUj � �� j � �� � � � � � J This

is just upwind di�erencing The second�order method is ����� ���#����� with the

upwind numerical �ux The third�order method is derived in the same manner as the

Page 51: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� Godunov Schemes �

second�order method using a piecewise quadratic function to represent the solution Time

integration was done using classical Runge�Kutta methods of orders ��� respectively� for

the �rst�� second�� and third�order methods The solutions are shown in Figure ���

The piecewise polynomial functions used to represent the solution are plotted at eleven

points on each subinterval

The �rst�order solution �upper left of Figure ���� is characteristically di�usive The

second�order solution �upper right of Figure ���� has greatly reduced the di�usion while

not introducing any spurious oscillations The minimum modulus limiter ������ has a

tendency to �atten solutions near extrema This can be seen in the third�order solution

shown at the lower left of Figure ��� There is a loss of �local� monotonicity near the

shocks �Average solution values are monotone and this is all that the limiter ������

was designed to produce� Biswas et al� � developed an adaptive limiter that reduces

�attening! and does a better job of preserving local monotonicity near discontinuities

The solution with this limiter is shown in the lower portion of Figure ���

Evaluating numerical �uxes and using limiting for vector systems is more complicated

than indicated by the previous scalar example Cockburn and Shu �� reported problems

when applying limiting component�wise At the price of additional computation� they

applied limiting to the characteristic �elds obtained by diagonalizing the Jacobian fu

Biswas et al� � proceeded in a similar manner Flux�vector splitting! may provide a

compromise between the two extremes As an example� consider the solution and �ux

vectors for the one�dimensional Euler equations of compressible �ow

u �

�� ��ue

�� � f�u� �

�� �u

�u� � pu�e� p�

�� �����a�

where �� u� e� and

p � �� � ��e� �u���� �����b�

are� respectively� the �uid�s density� velocity� internal energy per unit volume� and pres�

sure

For this and related di�erential systems� the �ux vector is a homogeneous function

Page 52: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

�� Hyperbolic Problems

Figure ���� Exact �line� and numerical solutions of Example � for methods with piece�wise polynomial approximations of degrees p � �� � and � Solutions with a minmodlimiter and an adaptive limiter of Biswas et al � are shown for p � �

that may be expressed as

f�u� � Au � fu�u�u� �����a�

Page 53: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� Boundary Conditions ��

Since the system is hyperbolic� the Jacobian A may be diagonalized as described in

Section � to yield

f�u� � P���Pu �����b�

where the diagonal matrix � contains the eigenvalues of A

� �

�������

��

�m

����� �

�� u� c

uu� c

�� � �����c�

The variable c �p�p��� is the speed of sound in the �uid The matrix � can be

decomposed into components

� � �� ��� �����a�

where �� and �� are� respectively� composed of the non�negative and non�positive com�

ponents of �

��i ��i � j�ij

�� i � � �� � � � � m� �����b�

Writing the �ux vector in similar fashion using ������

f�u� � P����� ����Pu � f�u�� � f�u��� ������

Split �uxes for the Euler equations were presented by Steger and Warming ��� Van

Leer ��� found an improvement that provided improvements near sonic and stagnation

points of the �ow The split �uxes are evaluated by upwind techniques LettingWL and

WR be solution vectors on the left and right of an interface �e�g�� at xj������ then f� is

evaluated using WL and f� is evaluated using WR

��� Nonlinear Instability and Boundary Conditions

Linear stability analyses �e�g�� using von Neumann�s method� are necessary for stability�

but� possibly� not su�cient because of nonlinearity or boundary conditions In order to

illustrate this e�ect� consider solving the inviscid Burgers� equation

ut � uux � �

Page 54: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

�� Hyperbolic Problems

by the leap frog scheme

Un��j � Un��

j � �Unj �U

nj�� � Un

j���� ����

where � � �t��x In order to analyze the sensitivity of ���� to small perturbations�

let

Unj � �Un

j � �Unj �����

where �Unj is a solution of ���� and �Un

j is a perturbation Substituting ����� into

����

�Un��j � �Un

j�� � Un��j � �Un��

j � �� �Unj � �Un

j � ��Unj�� � �Un

j���� � �Unj�� � �Un

j�����

Expanding the above expression while using the fact that �Unj satis�es ���� and ne�

glecting squares and products of perturbations� we �nd

�Un��j � �Un��

j � � �Unj ��U

nj�� � �Un

j���� ��Unj � �U

nj�� � �Un

j���� ����a�

The di�erence equation ����a� is linear� but has variable coe�cients In order to use a

von Neumann stability analysis we would also have to assume that �Unj � �U � a constant

Were this done� ����a� would become

�Un��j � �Un��

j � � �U��Unj�� � �Un

j���� ����b�

Using the von Neumann method �Problem ���� we would conclude that the leap frog

scheme is absolutely stable when the Courant� Friedrichs� Lewy condition j �U j� � is

satis�ed We would like to use this condition as a local stability analysis �cf� Section ���

to infer that the leap frog scheme is absolutely stable for this nonlinear problem when

�maxjjUn

j j � � ����c�

A local stability analysis works for many �nite di�erence schemes and problems� however�

if disturbances are su�ciently strong� they may cause nonlinear instabilities Gary ��

introduced an example where the solution of ���� has the form

Unj � �U � cn cos �j�� � sn sin�j�� � vn cos �j� �����

Page 55: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� Boundary Conditions ��

The trigonometric terms may be regarded as high�frequency perturbations to a constant

solution �U By substituting ����� into ���� we may show that cn� sn� and vn satisfy

the di�erence equations

cn�� � cn�� � ��sn�vn � �U�� ����a�

sn�� � sn�� � ��cn�vn � �U�� ����b�

vn�� � vn��� ����c�

The solution of ����c� only takes on two values

vn �

�A� if n is evenB� if n is odd

� ����d�

We may use ����d� to eliminate vn and sn from ����a� ���b� to get

cn�� � ��cn � cn�� � �� ����a�

where

� � � ����B � �U��A� �U�� ����b�

The constant�coe�cient di�erence equation ����a� may be solved to yield

cn � C�rn� � C�r

n� ����a�

where

r� � ��� ip

� ��� ����b�

The constants C� and C� are determined from the initial and starting conditions

The coe�cients cn� n �� will not grow as n increases as long as jr�j � This

in turn requires that j�j � Using ����#����� we may show that the local linear

stability condition ����c� is satis�ed when the following two inequalities are satis�ed�

� j �U j�max�jAj� jBj�� � ����a�

and

� � ���B � �U��A� �U�� ����b�

Under these conditions�

Page 56: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

�� Hyperbolic Problems

� If jAj � �U � jBj � �U � and the linear stability conditions ����a� ���b� are satis�ed

then j�j �

� If jAj and jBj are not bounded by �U � then it is possible to satisfy ����a� ���b�

with j�j � For example� choose A � �� B � �U � �� with �U and � positive Then�

����b� is satis�ed since

��� �U � ��

Choosing � such that

��� �U � �� �

ensures that ����a� is satis�ed However� using ����b��

� � � ���� �U � �

Thus� solutions will grow in magnitude This example illustrates that high�frequency

modes of a solution may interact with other modes to cause a nonlinear instability

This provides another reason to choose a scheme that dissipates high�frequency

modes �Section ���

����� Boundary Conditions

We need extra arti�cial! boundary conditions with centered �nite di�erence schemes

like the Lax�Friedrichs and Lax�Wendro� methods Let us illustrate this using a simple

linear problem

Example ������ Consider the initial�boundary value problem for the kinematic wave

equation

ut � ux � �� � � x � � t � �� ����a�

u�x� �� � ��x�� u�� t� � ��t�� ����b�

which has the exact solution

u�x� t� �

���x � t�� if x � t � ��x � t� �� if x � t �

Page 57: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� Boundary Conditions ��

Establishing a uniform grid on �� �� t � � and using a centered spatial scheme with the

four�point stencil shown in Figure ��� we see that additional information is needed to

compute the solution along the line x � �

t

x0 1 2

Figure ��� Uniform grid and four�point �nite di�erence scheme illustrating the needfor extra information at x � �

Consider� for example� a problem with ��x� � x The exact solution for x � t � is

u�x� t� � x � t Let�s solve this problem using the leap frog scheme

Un��j � Un��

j ��t

�x�Un

j�� � Unj��� ����a�

and the Lax�Friedrichs scheme

Un��j �

Unj�� � Un

j��

��

�t

��x�Un

j�� � Unj��� ����b�

with �t � �x � �� and simple constant extrapolation

Un��� � Un��

as a boundary condition at x � � We further use the exact solution to start the multi�

level leap frog scheme The results� for a few time steps are shown in Table ��

Both the leap frog and Lax�Friedrichs schemes produce the exact solution of this initial

value problem since the Courant number is unity Thus� the only errors arise due to the

boundary approximation From the table� we see that the Lax�Friedrichs scheme has

con�ned the rather inaccurate treatment of the solution at x � � to the one cell adjacent

to the boundary With the leap frog scheme� however� the poor boundary approximation

is polluting the accuracy of the solution in the interior of the domain The choice of proper

Page 58: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

�� Hyperbolic Problems

Leap Frog Lax�Friedrichsn j j

� � � � � �

� �� � �� �� �� � �� �� � �� �� �� �� �� �� ��� �� �� �� �� �� �� �� ��� �� �� �� �� �� �� �� ��� �� �� �� �� �� �� �� ��� �� �� �� �� �� �� �� ��

Table ��� Solution of Example �� using the leap frog and Lax�Friedrichs methodswith constant extrapolation at the boundary x � �

arti�cial boundary conditions for hyperbolic problems has been thoroughly studied A

good account of the theory and practice appears in Strikwerda ��� Chapter The two

principal methods of analyzing stability involve Laplace transforms and matrix methods

The former approach is often called the Gusta�son� Kreiss� Sundstr$om� and Osher theory

� ��� Section � The latter is the technique that we studied in Section �� We�ll be

much more brief and note that� as a rule of thumb� one should try to use dissipative

di�erence schemes and dissipative boundary conditions Thus� with the present example�

we could consider using the Lax�Friedrichs scheme in the interior and the forward time�

forward space scheme

Un��� � Un

� ��t

�x�Un

� � Un� �

at the boundary With unit Courant number� this combination gives the exact solution

Prescribing boundary conditions for m�m linear vector systems ��b� requires the

canonical form �w�

w�

�t

��� �

� ��

� �w�

w�

�x

� �� ���a�

where

AP � P�� � �

��� �

� ��

�� ���b�

�� �

�������

��

�p

����� � �� �

������p��

�p��

�m

����� � ���c�

Page 59: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� Boundary Conditions ��

0 1 x

t

w

w w

w

+

-

-

+

Figure ���� Boundary condition prescription for an initial�boundary value problem for��b�

with �� � �� � � � � � �p � � and �p�� � �p�� � � � � � �m � � Boundary conditions are

needed along those characteristics that enter the region Thus� for an initial boundary

value problem on � � x � � boundary conditions should be prescribed for w� at x � �

and for w� at x � �Figure ���� Arti�cial boundary conditions would� therefore� be

needed for w� at x � � and for w� at x �

Example ���� Initial�boundary value problems on in�nite domains must be approxi�

mated on �nite domains Arti�cial boundaries� placed far from the region of interest� can

cause spurious wave re�ections back into the domain The goal is to construct boundary

conditions on the arti�cial boundaries to eliminate or reduce these spurious re�ections

Let us partition P as

AP� � P���� AP� � P���� ����a�

For simplicity� assume that P is orthogonal in the sense that

�P��TP� � �� ����b�

Assuming that P is constant� the canonical transformation ���� may be di�erentiated

to obtain

�u � P �w � P� �w� �P� �w�

where �� � � d� ��dt

Page 60: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

�� Hyperbolic Problems

Let the arti�cial boundary be x � � of Figure ��� No waves will enter the region if

�w� � �� thus�

�u � P� �w�

or� multiplying by �P��T and using the orthogonality condition ����b��

�P��T �u � �� ����a�

There are many possibilities for evaluating the directional derivative

�u � ut � �xux� ����b�

Hedstrom �� evaluates ����b� along the line x � � Another possibility is to assume

that the initial data is trivial for x � �� thus� in particular ux � � In either case� the

nonre�ecting boundary conditions ����� become

�P��Tut � �� �����

Problems

For the solution ����� of the leap frog problem ���� verify that relations ����a#

���c�� ����a� ���b�� ����a� ���b�� and ����a� ���b� are satis�ed

� � ��� Section �� Consider the initial�boundary value problem ����� with the

initial and boundary conditions prescribed so that its exact solution is

u�x� t� � sin ���x� t��

� Solve this problem using the leap frog scheme ����a� with the following

arti�cial boundary conditions applied at x � ��

Un��� � Un��

� Constant extrapolationUn��� � Un

� Constant diagonal extrapolationUn��� � Un

� � ��Un� � Un

� � Upwind di�erencingUn��� � Un��

� � ���Un� � Un

� � Pseudo leap frogUn��� � �Un��

� � Un��� Linear extrapolation

Un��� � �Un

� � Un��� Linear diagonal extrapolation

Page 61: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� Boundary Conditions �

Use �x � ���� and � � ���� Display the solution at t � �� Comment on

the stability of each boundary condition based on the computational results

Stop any calculation prematurely if the computed solution exceeds two in

magnitude Display the solution at the last acceptable time in this case

�� Repeat the computation for the Lax�Wendro� scheme

Page 62: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

�� Hyperbolic Problems

Page 63: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

Bibliography

� R Biswas� KD Devine� and JE Flaherty Parallel adaptive �nite element methods

for conservation laws Applied Numerical Mathematics� �����#���� ���

�� AJ Chorin Random choice solution of hyperbolic systems Journal of Computa�

tional Physics� �����#���� ���

�� B Cockburn and C�W Shu TVB Runge�Kutta local projection discontinuous

�nite element method for conservation laws II� General framework Mathematics of

Computation� ����#���� ���

�� JE Flaherty� RM Loy� C $Ozturan� MS Shephard� BK Szymanski� JD Teresco�

and LH Ziantz Parallel structures and dynamic load balancing for adaptive �nite

element computation Applied Numerical Mathematics� �����#���� ���

�� J Gary Lecture notes on the numerical solution of partial di�erential equations

Technical report� University of Colorado� Boulder� ���

�� J Glimm Solutions in the large for nonlinear hyperbolic systems of equations

Communications on Pure and Applied Mathematics� �����#��� ���

�� SK Godunov A �nite di�erence method for the numerical computation of dis�

continuous solutions of the equations of �uid dynamics Mat� Sbornik�� �����#����

���

�� A Harten and JM Hyman Self�adjusting grid methods for one�dimensional hy�

perbolic conservation laws Technical Report LASL Report LA����� Los Alamos

Scienti�c Laboratory� Los Alamos� ���

��

Page 64: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

�� Hyperbolic Problems

�� A Harten� JM Hyman� and PD Lax On �nite�di�erence approximations and

entropy conditions for shocks Communications on Pure and Applied Mathematics�

������#���� ���

�� A Harten and PD Lax A random choice �nite di�erence scheme for hyperbolic

conservation laws SIAM Journal on Numerical Analysis� �����#��� ��

� A Harten� PD Lax� and B van Leer On upstream di�erence and Godunov�type

schemes for hyperbolic conservation laws SIAM Review� �����#�� ���

�� G Hedstrom Nonre�ecting boundary conditions for nonlinear hyperbolic systems

Journal of Computational Physics� ������#���� ���

�� A Je�rey and T Taniuti Non�linear Wave Propagation Academic Press� New

York� ���

�� PD Lax Hyperbolic Systems of Conservation Laws and the Mathematical Theory

of Shock Waves Regional Conference Series in Applied Mathematics� No SIAM�

Philadelphia� ���

�� PD Lax and B Wendro� Systems of conservation laws Communications on Pure

and Applied Mathematics� ����#���� ���

�� AR Mitchell and DF Gri�ths The Finite Di�erence Method in Partial Di�eren�

tial Equations John Wiley and Sons� Chichester� ���

�� RD Richtmyer and KW Morton Di�erence Methods for Initial Value Problems

John Wiley and Sons� New York� second edition� ���

�� PL Roe Approximate Riemann solvers� parameter vectors� and di�erence schemes

Journal of Computational Physics� ������#���� ��

�� GA Sod Numerical Methods in Fluid Dynamic Cambridge University Press�

Cambridge� ���

Page 65: V ector - Computer Science at RPIflaherje/pdf/pde6.pdf · 2005-04-01 · Hyp erb olic Problems V ector Systems and Characteristics Lets resume the study of nite dierence tec hniques

���� Boundary Conditions ��

��� JL Steger and RF Warming Flux vector splitting of the inviscid gasdynamic

equations with applications to �nite di�erence methods Journal of Computational

Physics� ������#���� ��

�� JC Strikwerda Finite Di�erence Schemes and Partial Di�erential Equations

Chapman and Hall� Paci�c Grove� ���

��� B van Leer Towards the ultimate conservation di�erence scheme IV A new ap�

proach of numerical convection Journal of Computational Physics� ������#����

���

��� B van Leer Flux�vector splitting gor the Euler equations Lecture Notes in Physics�

������#��� ���