modified mass matrices and positivity preservation for hyperbolic and parabolic pdes

8
COMMUNICATIONS IN NUMERICAL METHODS IN ENGINEERING Commun. Numer. Meth. Engng 2001; 17:659–666 (DOI: 10.1002/cnm.436) Modied mass matrices and positivity preservation for hyperbolic and parabolic PDEs M. Berzins Computational PDEs Unit; School of Computing; The University of Leeds; Leeds LS2 9JT; U.K. SUMMARY Modications to the standard nite element mass matrix are considered with the aim of preserving the positivity of the discrete solution. The approach is used in connection with calculating the initial time derivative values for parabolic equations and in connection with non-linear Petrov–Galerkin schemes for hyperbolic equations in one space dimension. The extension of the ideas to unstructured meshes in two and three space dimensions is indicated. Copyright ? 2001 John Wiley & Sons, Ltd. KEY WORDS: positivity preservation; mass matrices; nite element methods 1. INTRODUCTION There are many situations in the numerical solution of partial dierential equations in which the computed solution values should, on physical grounds, remain non-negative. One of the simplest examples is that of the simple advection equation with non-negative initial data while other cases are those of concentrations of chemical compounds in reacting ow calculations. In the latter case preserving positivity is essential to avoid the numerical calculation becoming meaningless. Consider the solution of the advection equation with appropriate initial and boundary condition by using the standard Galerkin method with linear basis (hat) functions i (x) on a uniformly spaced mesh x i ;i =1;:::;N to get xi+1 xi1 @U @t i (x) dx = xi+1 xi1 @U @x i (x) dx; i =1;:::;N (1) where the approximate solution to this p.d.e. as dened by U (x; t )= N i=1 i (x)U i (t ) where i (x j )= ij . Evaluating the integrals gives rise to the numerical scheme dened by 1 6 [ ˙ U i1 +4 ˙ U i + ˙ U i+1 ]= 1 2x (U i+1 U i1 ) (2) Correspondence to: M. Berzins, School of Computing, The University of Leeds, Leeds LS2 9JT, U.K. Received 16 January 2001 Copyright ? 2001 John Wiley & Sons, Ltd. Accepted 28 March 2001

Upload: m-berzins

Post on 11-Jun-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Modified mass matrices and positivity preservation for hyperbolic and parabolic PDEs

COMMUNICATIONS IN NUMERICAL METHODS IN ENGINEERINGCommun. Numer. Meth. Engng 2001; 17:659–666 (DOI: 10.1002/cnm.436)

Modi%ed mass matrices and positivity preservation forhyperbolic and parabolic PDEs

M. Berzins∗

Computational PDEs Unit; School of Computing; The University of Leeds; Leeds LS2 9JT; U.K.

SUMMARY

Modi%cations to the standard %nite element mass matrix are considered with the aim of preserving thepositivity of the discrete solution. The approach is used in connection with calculating the initial timederivative values for parabolic equations and in connection with non-linear Petrov–Galerkin schemesfor hyperbolic equations in one space dimension. The extension of the ideas to unstructured meshes intwo and three space dimensions is indicated. Copyright ? 2001 John Wiley & Sons, Ltd.

KEY WORDS: positivity preservation; mass matrices; %nite element methods

1. INTRODUCTION

There are many situations in the numerical solution of partial diBerential equations in whichthe computed solution values should, on physical grounds, remain non-negative. One of thesimplest examples is that of the simple advection equation with non-negative initial data whileother cases are those of concentrations of chemical compounds in reacting Cow calculations. Inthe latter case preserving positivity is essential to avoid the numerical calculation becomingmeaningless. Consider the solution of the advection equation with appropriate initial andboundary condition by using the standard Galerkin method with linear basis (hat) functions�i(x) on a uniformly spaced mesh xi; i=1; : : : ; N to get

∫ xi+1

xi−1

@U@t

�i(x) dx=∫ xi+1

xi−1

−@U@x

�i(x) dx; i=1; : : : ; N (1)

where the approximate solution to this p.d.e. as de%ned by U (x; t)=∑N

i=1 �i(x)Ui(t) where�i(xj)= �ij. Evaluating the integrals gives rise to the numerical scheme de%ned by

16[U̇i−1 + 4U̇i + U̇i+1]=

−12�x

(Ui+1 −Ui−1) (2)

∗Correspondence to: M. Berzins, School of Computing, The University of Leeds, Leeds LS2 9JT, U.K.

Received 16 January 2001Copyright ? 2001 John Wiley & Sons, Ltd. Accepted 28 March 2001

Page 2: Modified mass matrices and positivity preservation for hyperbolic and parabolic PDEs

660 M. BERZINS

where �x is the uniform mesh spacing in this case and where U̇i =dU1=dt. De%ning thetime-dependent vector U by U =[U1; : : : ; UN ]T allows this system of equations to be rewrittenin the form

AU̇ (t)=F(U (t)) (3)

where the matriex A is referred to as the mass matrix.It is well known that this scheme is unsatisfactory in a very similar way to that of linear

central diBerence schemes [1]. Many modi%ed Galerkin methods have been proposed toremedy this situation. A survey of such methods is given in Reference [1] and includes stream-line upwind Petrov–Galerkin (SUPG) methods [2] in which the test functions are modi%edto improve the behaviour of the method and discontinuous Galerkin (DG) methods [3; 2]in which discontinuous basis functions are used. There are many other approaches such asthe modi%ed Petrov–Galerkin method of Cardle [4] in which the test function is modi%eddiBerently for the spatial and temporal terms. In this case the numerical scheme that resultsis given by

U̇i +16(1− �)[U̇i−1 − 2U̇i + U̇i+1]=

−12�x

(Ui+1 −Ui−1) +�2�x

[Ui−1 − 2Ui +Ui+1] (4)

where � and � are the constants multiplying the Petrov–Galerkin additional polynomials intime (cubic polynomial) and space (quadratic polynomial), see Reference [4].In the case of many of these methods it is clear that the magnitude of unphysical values is

not as large as with the standard Galerkin method and in the case of DG methods the massmatrix is the identity matrix; this makes it much easier to prove properties such as positivitypreservation. The de%nition used here for a positivity preserving scheme for the advectionequation is one (see Reference [5]) for which the numerical solution at time tn+1 may bewritten in terms of the numerical solution at time tn in the form

Ui(tn+1)=∑jajUj(tn) where

∑jaj =1 and aj¿0 (5)

The key observation with regard to preserving positivity is due to Godunov [6] who provedthat any scheme of better than %rst order which preserves positivity for the advection equationmust be non-linear. That is, the coeJcients aj in (5) above must depend on the numericalsolution to the p.d.e. This means that � and � in (4) must also depend on the solution.In investigating positivity preserving mass matrices and Galerkin %nite element methods

for transient problems, the starting point will be to rewrite the mass matrix as a positivitypreserving matrix. This will be applied to the solution of a parabolic equation. The sameidea will then be applied to hyperbolic equations and linked to the work of Cardle [4] andto the work on non-linear %nite diBerence schemes. Finally, the extension of the approach tounstructured triangular and tetrahedral meshes will be considered.

2. MODIFIED MASS MATRICES AND THE INITIALIZATION OFPARABOLIC EQUATIONS

In trying to solve parabolic equations using a Galerkin method-of-lines approach Skeel andBerzins [7] showed that the initial time derivatives may have the wrong sign. This is because

Copyright ? 2001 John Wiley & Sons, Ltd. Commun. Numer. Meth. Engng 2001; 17:659–666

Page 3: Modified mass matrices and positivity preservation for hyperbolic and parabolic PDEs

MODIFIED FINITE ELEMENT MASS MATRIX 661

the inverse of the mass matrix A may have had negative entries. Suppose that the parabolicequation is discretized in space to get a system of equations of the form of (3) with Fi¿ 0.The initial values of the time derivatives are given by solving Equations (3) for the initialvalues of the time derivatives U̇ (0). In computational experiments, time derivatives with thewrong sign slow down the integration and may give physically misleading solution values.For these reasons Skeel and Berzins devised a scheme that may be viewed as a lumped %niteelement scheme in which the mass matrix is replaced by the identity matrix.The issue of when a matrix may have an inverse consisting of positive entries is considered

in a large body of work on M matrices. See, for example, Berman and Plemmons [8] whoshow that if A is a diagonally dominant M matrix with negative oB diagonal entries, then itsinverse A−1 has only positive entries. The task is thus to modify the mass matrix so that ithas negative oB-diagonal entries.

2.1. Derivation of modi)ed mass matrix

For simplicity consider the case when linear basis functions are used on a uniform spatialmesh as in Equations (1). The jth row of the mass matrix is then given by

U̇j(�j; �j) + U̇j+1(�j; �j+1) + U̇j−1(�j; �j−1)=Fj (6)

Using the identity that [xj−1; xj+1]�j + �j−1 + �j+1 =1 gives

U̇j(�j; 1) + (U̇j+1 − U̇j)(�j; �j+1) + (U̇j−1 − U̇j)(�j; �j−1)=Fj (7)

De%ning the ratio sj =(U̇j+1 − U̇j)=(Uj − Uj−1) allows the jth row of the mass matrix to berewritten as

U̇j(�j; 1) + (U̇j − U̇j+1)[(�j; �j−1)

sj− (�j; �j+1)

]=Fj (8)

The matrix is an M matrix if [: : :] is positive (on a uniform mesh this requires 0¡sj¡1) asthen the matrix is diagonally dominant with negative oB-diagonal entries. In the case whensj¿1 on a uniform mesh the jth row is written as

U̇j(�j; 1) + (U̇j − U̇j−1)[(�j; �j+1)sj − (�j; �j−1)]=Fj (9)

which again is a row of an M matrix as [: : :] is positive. In the case when sj¡0, there appearsno alternative but to diagonalize (lump) the matrix as U̇j[(�j; �j) + (�j; �j−1) + (�j; �j+1)].The modi%ed matrix may also be written as (with appropriate modi%cations if sj =0)

U̇j +(sj + |sj|)12|sj| [U̇j−1 − 2U̇j + U̇j+1]=

Fj

�x(10)

In solving Equations (8) and (9) for the initial values of the time derivatives, it is thusnecessary to iteratively solve non-linear equations. Let U̇m

j and smj be the values calculated at

Copyright ? 2001 John Wiley & Sons, Ltd. Commun. Numer. Meth. Engng 2001; 17:659–666

Page 4: Modified mass matrices and positivity preservation for hyperbolic and parabolic PDEs

662 M. BERZINS

Figure 1. Mass matrix calculation for time derivatives: (-) true; (∗) new; (−) original.

iteration m. The equations solved in the case when smj ¿1 are then given by

U̇m+1j + �(U̇m+1

j − U̇mj−1)=

Fj

�xwhere �=

[smj − 1

6

](11)

In the case when 0¡smj ¡1 the iteration is de%ned by

U̇m+1j + �(U̇m+1

j − U̇mj+1)=

Fj

�xwhere �=

[1=smj − 1

6

](12)

In order to illustrate that this procedure produces initial values of the time derivatives with theright sign, the following example is used. Skeel and Berzins [7] consider test examples suchas the case when the right-hand side of Equation (3) is given by Fj ≈ Ut(xj; 0)=C=(Cxj+1:1)where C=0:1 if x¡0 and C=1:0 otherwise. For a uniform mesh of 11 and 21 points acrossthe interval [−1; 1], Figure 1 shows that the method does result in time derivatives of thecorrect sign without the overshoots and undershoots of a standard Galerkin approach. Theissue of preserving positivity for the diBusion equation has been considered in very recentwork by Farago and Horvath [9]. They show that for a d dimensional problem using the� time-integration method, it is necessary to restrict the choice of the parameter � and thetimestep �t by d=6�¡�t=�x2¡1=3d(1− �), where d=1; 2. Their results also extends to threespace dimensions.

Copyright ? 2001 John Wiley & Sons, Ltd. Commun. Numer. Meth. Engng 2001; 17:659–666

Page 5: Modified mass matrices and positivity preservation for hyperbolic and parabolic PDEs

MODIFIED FINITE ELEMENT MASS MATRIX 663

3. MODIFIED MASS MATRICES AND HYPERBOLIC EQUATIONS

In general, the time derivatives may not have constant sign and it is the non-negativity ofthe solution that must be considered. In the case of the advection equation, it is possible torewrite Equation (4) as a simple explicit method for hyperbolic equations:

AU (tn+1)=AU (tn) + �tF(U (tn)) (13)

In using the modi%ed mass matrix approach as part of a method for hyperbolic equations, it isinstructive to note other similar approaches. The approximation of Ux by a standard Galerkinmethod is identical to that of central %nite diBerences. A non-linear central diBerence methodfor hyperbolic equations is given by Swanson and Turkel [10] as

U̇j =−12�x

(Uj+1 −Uj−1) +12�x

[Lj+1(Uj+1 −Uj)− Lj(Uj −Uj−1)] (14)

where Lj = |1− r̂j|=(1+ |r̂j|) and r̂j =(Uj−1 −Uj−2=Uj −Uj−1). The right-hand side of this mayalso be interpreted as a non-linear Petrov–Galerkin method in which the test function is �̂(x),where

�̂(x)=�(x) + �xL∗ d�(x)dx

(15)

in which L∗=Lj if xj−1¡x¡xj+1 and L∗=Lj+1 otherwise. Although this scheme is positivitypreserving it is quite diBuse. A less diBuse scheme is one in which L∗ is de%ned by L∗=1 − V (rj)=rj if xj+1¿x¿xj and L∗=1 − V (rj−1)=rj−1 if xj¿x¿xj−1, where V (rj)= (rj +|rj|)=(1+ |rj|) and rj =(Uj+1−Uj)=(Uj−Uj−1). Routine manipulation shows that this de%nitiongives the well-known van Leer scheme, e.g. Reference [5]:

U̇j(t)=−1�x

�j(Uj(t)−Uj−1(t)) where �j =[1 +

V (rj)2

− V (rj−1)2rj−1

](16)

An alternative view of this scheme is thus as a non-linear Petrov-Galerkin method. Requiringpositivity for forward Euler timestepping requires the CFL type restriction 06�i¡�x=�t.The non-linear extension of the type of Petrov–Galerkin method given by (3) is thus givenby Equation (10) with Fj de%ned by the right-hand side of (16). An outline proof that,when combined with forward Euler timestepping, this is positivity preserving follows from amodi%ed version of (11). (The proof for the case in (12) is similar.) The iteration from (11)may be written as

U̇m+1j (t)=

11 + �

[�U̇m

j−1(t) +Fj

�x

]; m=0; 1; : : :

where � is de%ned as in Equation (11) and so depends on smj and where Fj=�x is de%ned bythe right-hand side of Equation (16). Hence this equation may also be written as

U̇m+1j (t)=

11 + �

[�U̇m

j−1(t)−�j

�x(Uj(t)−Uj−1(t))

]; m=0; 1; : : : (17)

Copyright ? 2001 John Wiley & Sons, Ltd. Commun. Numer. Meth. Engng 2001; 17:659–666

Page 6: Modified mass matrices and positivity preservation for hyperbolic and parabolic PDEs

664 M. BERZINS

The predicted values, U̇ 0j−1(tn+1), are given by Equation (16). An outline of the approach used

to de%ne solution positivity in terms of Equation (5) may now be given. The initial guessesfor the time derivatives are given by Equation (16):

U̇ 0j−1(tn+1)=− 1

�x[Uj−1(tn)−Uj−2(tn)]�j−1 (18)

where �j−1 is also de%ned as in (16). Substituting for U̇ 0j−1 in (17) and applying forward

Euler timestepping gives

U 1j (tn+1)=Uj(tn)− �t

�x(1 + �)[�j(Uj(tn)−Uj−1(tn)) + ��j−1(Uj−1(tn)−Uj−2(tn))] (19)

where U 1j (tn+1) is the %rst iteration estimate for Uj(tn+1). This may be rewritten as

U 1j (tn+1)=(1− �jE)Uj(tn) + (�j − ��j−1)E Uj−1(tn) + (��j−1)E Uj−2(tn) (20)

where

E =�t�x

1(1 + �)

In proving positivity of this, consider the worst case in equation (19) and suppose that�j(Uj(tn) − Uj−1(tn)) has a diBerent sign to �j−1(Uj−1(tn) − Uj−2(tn)). It then follows thatrj−1 is negative and hence that �j =

[1 + v(rj)=2

]and �j−1 =

[1− V (rj−2)=2rj−2

]. Hence

�j − ��j−1 = 1 +V (rj)2

− �+ �V (rj−2)2rj−2

and in order to guarantee a positive solution at the end of the %rst iteration we need to imposethe condition �¡1:0 and hence from Equations (11) and (12) the iterative method is onlyapplied if

17¡smj ¡7

The same approach can then be used inductively to prove positivity for second and subsequentiterations. Figure 2 shows the numerical results obtained when the method is applied to theadvection of a square pulse function from x=0:2 to 0.7 using a spatial mesh of 51 equallyspaced points. The %gure compares the solution obtained with the van Leer method with thenew approach and shows that the eBect of using a mass matrix is to give a still positive butmore skewed pro%le than that obtained from the van Leer method.

4. EXTENSION TO TRIANGULAR AND TETRAHEDRAL MESHES

In the case of triangular mesh examples, it is possible to use the same idea as in one spacedimension. In this case, for example, the mass matrix for a mesh fragment consisting of threetriangles with node i in common and a perimeter consisting of nodes j; k and l is given by

U̇i(�i; 1) + (U̇j − U̇i)(�j; �i) + (U̇k − U̇i)(�k; �i) + (U̇l − U̇i)(�l; �i) (21)

Copyright ? 2001 John Wiley & Sons, Ltd. Commun. Numer. Meth. Engng 2001; 17:659–666

Page 7: Modified mass matrices and positivity preservation for hyperbolic and parabolic PDEs

MODIFIED FINITE ELEMENT MASS MATRIX 665

Figure 2. Numerical solution of advected square wave.

where (�i; �j)= 112 [Aijk + Aijl]; (�j; �j)= 1

12 [Aijk + Aijl + Ailk] and where Aijk is the area oftriangle with nodes i; j and k. The contribution of element ijk to the mass matrix is

Aijk

12[4U̇i + (U̇j − 2U̇i + U̇k)] (22)

The same ideas as in one space dimension may be used to rewrite U̇j − 2U̇i − U̇k by usingthe same approach as in Section 2.1. Consider the i; j; k triangle and let U̇( j+k)=2 be midpointsolution value on jk edge. The decomposition given by

U̇j − 2U̇i + U̇k =[U̇j − 2U̇( j+k)=2) + U̇k] + 2[U̇( j+k)=2) − U̇i] (23)

allows the terms on the right-hand side of this equation to be viewed as second-orderapproximations to second and %rst space derivatives. Hence in discarding these terms weintroduce second-order errors as in one space dimension.The same idea extends to tetrahedral mesh examples. Consider a single tetrahedron with

its four nodes labelled as i; j; k; l and associated linear basis functions �i; �j; �k and �l. Themass matrix integral associated with this tetrahedron is

Vijkl[U̇i(�i; �i) + U̇j(�j; �i) + U̇k(�k; �i) + U̇l(�l; �i)] (24)

Evaluating the volume integral gives

Vijkl20

[5U̇i + (U̇j − U̇i) + (U̇k − U̇i) + (U̇l − U̇i)] (25)

which may be rewritten as three terms of the form Vijkl=20[ 53 U̇i + 12(U̇j − 2U̇i + U̇k)] and same

ideas applied as in one and two space dimensions.

Copyright ? 2001 John Wiley & Sons, Ltd. Commun. Numer. Meth. Engng 2001; 17:659–666

Page 8: Modified mass matrices and positivity preservation for hyperbolic and parabolic PDEs

666 M. BERZINS

5. SUMMARY

In this paper a novel approach to preserving positivity has been taken. The approach relieson using a non-linear form of the mass matrix in conjunction with non-linear Petrov–Galerkintype terms. The approach has applications in one, two and three space dimensional cases, butfurther work is clearly needed to assess its usefulness.

REFERENCES

1. Segal A. Finite element methods for advection–diBusion equations. In Numerical Methods for AdvectionDi+usion Problems. Notes on Numerical Fluid Mechanics. Vol. 45, Vreugdenhil CB, Koren B (eds). Vieweg:Braunschweig=Wiesbaden, 1993; 195–214.

2. Johnson C. Numerical Solution of Partial Di+erential Equations by the Finite Element Method. CambridgeUniversity Press: Cambridge, 1987.

3. Cockburn B, Karniadakis GE, Shu C-W. (eds). Discontinuous Galerkin Methods; Theory Computations andApplications: Lecture Notes in Computational Science and Engineering, Vol. 11, Springer: Berlin, Heidelberg,2000; 3–53.

4. Cardle JA. A modi%cation of the Petrov–Galerkin method for the transient convection–diBusion equation.International Journal for Numerical Methods in Engineering 1995; 38:171–181.

5. Berzins M, Ware JM. Positive cell centered %nite volume discretisation methods for hyperbolic equations onirregular meshes. Applied Numerical Mathematics 1995; 16:417–438.

6. Godunov SK. Finite diBerence method for the numerical computation of discontinuous solutions of the equationsof Cuid dynamics. Math Sbornik 1959; 47:271–306.

7. Skeel RD, Berzins M. A method for the spatial discretisation of parabolic equations. SIAM Journal on Scienti)cComputing 1990; 11(1):1–32.

8. Berman A, Plemmons RJ. Nonnegative Matrices in the Mathematical Sciences. Academic Press: New York,1979.

9. Farago I, Horvath R. On the nonnegativity conservation of %nite element solution of parabolic problems. In 3DFinite Element Conference Proceedings Krizek M. et al. (eds). Gakkotosho Co.: Tokyo, 2001.

10. Swanson RC, Turkel E. On central-diBerence and upwind schemes. Journal of Computational Physics 1992;101:292–306.

Copyright ? 2001 John Wiley & Sons, Ltd. Commun. Numer. Meth. Engng 2001; 17:659–666