4 numerical solution of the shallow water equations in 1d · lecture script numerical hydraulics 39...

12
Lecture Script Numerical Hydraulics 39 4 Numerical solution of the shallow water equations in 1D 4.1 Finite differences For the method of finite differences (FD) we start from the one-dimensional shallow water equa- tions for a prismatic channel, which read: h t + v h x + h v x = 0 (4-1) v t + v v x = gI S I E ( ) g h x (4-2) The equations have to be discretized by replacing the differential quotient by the difference quo- tient. The simplest difference scheme uses explicit differences in time. This means that all terms except of the time derivative terms are replaced by their values at the old time step (as a function of the old values v and h). Therefore, the values of v and h at the new time step only appear in the dis- cretized derivative term. Furthermore, the equation is linearized, as also the nonlinear terms only include known values of v and h at the old time step. So it follows: h i new h i old Δt + v i new h i old v i 1 old h i 1 old Δx = 0 (4-3) v i new v i old Δt + v i old v i old v i 1 old v i 1 old 2 Δx g( I s I E (v i old , h i old )) + g h i old h i 1 old Δx = 0 (4-4) with according to Strickler and R hy = hb 2h + b (for rectangular channels). Boundary conditions have to be determined for nodes i=1, i=Nx+1. For the wave breakthrough we choose the boundary conditions: Upstream: Inflow boundary, given hydrograph, and therefore given velocity v Downstream: h fixed (e.g., weir) This yields the following equations (for i=2, ..., Nx): h i new = h i old −Δt v i old h i old v i 1 old h i 1 old Δx = 0 (4-5) v i new = v i old −Δt v i old v i old v i 1 old v i 1 old 2 Δx gΔt h i old h i 1 old Δx g( I E (v i old , h i old ) I x )Δt (4-6) 3 4 2 2 / hy str E R k v I =

Upload: others

Post on 23-Aug-2020

7 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 4 Numerical solution of the shallow water equations in 1D · Lecture Script Numerical Hydraulics 39 4 Numerical solution of the shallow water equations in 1D 4.1 Finite differences

Lecture Script Numerical Hydraulics

39

4 Numerical solution of the shallow water equations in 1D

4.1 Finite differences For the method of finite differences (FD) we start from the one-dimensional shallow water equa-tions for a prismatic channel, which read:

∂h∂t

+ v ∂h∂x

+ h ∂v∂x

= 0 (4-1)

∂v∂t

+ v ∂v∂x

= g IS − IE( )− g ∂h∂x

(4-2)

The equations have to be discretized by replacing the differential quotient by the difference quo-tient. The simplest difference scheme uses explicit differences in time. This means that all terms except of the time derivative terms are replaced by their values at the old time step (as a function of the old values v and h). Therefore, the values of v and h at the new time step only appear in the dis-cretized derivative term. Furthermore, the equation is linearized, as also the nonlinear terms only include known values of v and h at the old time step. So it follows:

hinew − hi

old

Δt+ vi

newhiold − vi−1

oldhi−1old

Δx= 0 (4-3)

vinew − vi

old

Δt+ vi

oldviold − vi−1

oldvi−1old

2Δx− g(Is − IE (vi

old,hiold ))+ g hi

old − hi−1old

Δx= 0 (4-4)

with according to Strickler and Rhy =hb

2h + b (for rectangular channels).

Boundary conditions have to be determined for nodes i=1, i=Nx+1. For the wave breakthrough we choose the boundary conditions:

• Upstream: Inflow boundary, given hydrograph, and therefore given velocity v • Downstream: h fixed (e.g., weir) This yields the following equations (for i=2, ..., Nx):

hinew = hi

old − Δt violdhi

old − vi−1oldhi−1

old

Δx= 0 (4-5)

vinew = vi

old − Δt violdvi

old − vi−1oldvi−1

old

2Δx− gΔt hi

old − hi−1old

Δx− g(IE (vi

old,hiold )− Ix )Δt (4-6)

342

2

/hystr

E RkvI =

Page 2: 4 Numerical solution of the shallow water equations in 1D · Lecture Script Numerical Hydraulics 39 4 Numerical solution of the shallow water equations in 1D 4.1 Finite differences

Lecture Script Numerical Hydraulics

40

4.2 Method of Characteristics Before introducing the more commonly used Finite Volume formulation of the 1D shallow water equations, in the following, the method of characteristics is presented. The reason for presenting this method first is that many effects become clear when the characteristic information is under-stood. We start again with the one-dimensional shallow water equations (4-1) and (4-2) for a pris-matic channel:

0=∂∂+

∂∂+

∂∂

xvh

xhv

th

( )xhgIIg

xvv

tv

ES ∂∂−−=

∂∂+

∂∂

Since v = v(x,t) and h = h(x,t) we can write the total differentials as:

dtdx

xv

tv

DtDv ⋅

∂∂+

∂∂= (4-7)

Dh h h dxDt t x dt

∂ ∂= + ⋅∂ ∂

(4-8)

After multiplying Eq. (4-1) with an unknown parameter λ and adding to Eq. (4-2), we obtain:

( ) ( )ES IIgxhgv

th

xvhv

tv −=⎥⎦

⎤⎢⎣⎡

∂∂

⎟⎠⎞⎜

⎝⎛ ++

∂∂+⎥⎦

⎤⎢⎣⎡

∂∂++

∂∂

λλλ (4-9)

If one compares Eq. (4-9) with equations (4-7) and (4-8), one notes that (4-9) can be written in the form of a total differential when λ is defined as:

v + λh = dxdt

= v + gλ

(4-10)

λ1,2 = ± gh= ± gB

A (4-11)

Using the definition of the velocity of a gravity wave, i.e. c = g ⋅h rsp. λ1,2 = ±g c , Eq. (4-9) be-comes:

( )ES IIgDtDh

cg

DtDv −=+ valid along cv

dtdx += (4-12)

( )ES IIgDtDh

cg

DtDv −=− valid along cv

dtdx −= (4-13)

The two expressions dxdt

= v + c and dxdt

= v − c are called positive and negative characteristic. We

distinguish between three different cases sketched in the x/t-plane shown in Fig. 4-A.

Page 3: 4 Numerical solution of the shallow water equations in 1D · Lecture Script Numerical Hydraulics 39 4 Numerical solution of the shallow water equations in 1D 4.1 Finite differences

Lecture Script Numerical Hydraulics

41

Fig. 4-A: Characteristics for subcritical (left), critical (middle) and supercritical flow (right)

Considering from which region of the space/time diagram a point P receives information, one iden-tifies a region of dependence, i.e. a region that determines the solution in P (Fig. 4-B left). On the other hand, by drawing the characteristics that originate in P one obtains the region of influence of P (Fig. 4-B right).

Fig. 4-B: Zone of dependence (left) and zone of influence (right)

Multiplying Eq. (4-12) and (4-13) by dt and integrating them along the positive and negative char-acteristic, respectively, we write:

dv + gcW

P

∫W

P

∫ dh = g IS − IE( )dtW

P

∫ (4-14)

and analogously for the negative characteristic:

dv − gcE

P

∫E

P

∫ dh = g IS − IE( )dtE

P

∫ (4-15)

Starting from the points west (W) and east (E) we wish to integrate along the positive and negative characteristic. In a strict sense this is not possible due to the non-linearity involved; note that both wave velocity and friction loss are functions of h and v. These dependencies must first be linearized in some way and we can achieve this assuming that wave velocity c and friction loss SE keep their values at the points W and E along the characteristics. With these assumptions we obtain:

( ) ( ) ( )WPWESWPW

WP ttIIghhcgvv −−=−⎟⎠⎞⎜

⎝⎛+− (4-16)

( ) ( ) ( )EPEESEPE

EP ttIIghhcgvv −−=−⎟⎠⎞⎜

⎝⎛−− (4-17)

Page 4: 4 Numerical solution of the shallow water equations in 1D · Lecture Script Numerical Hydraulics 39 4 Numerical solution of the shallow water equations in 1D 4.1 Finite differences

Lecture Script Numerical Hydraulics

42

Sorting the equations into known and unknown quantities leads to:

PWpP hCCv −= (4-18)

PEnP hCCv −= (4-19)

with C = g/c, where all the known quantities are summarized by two constants Cp and Cn:

Cp = vW + gc

⎛⎝⎜

⎞⎠⎟W

hW + g IS − IE( )W tP − tW( ) (4-20)

Cn = vE −gc

⎛⎝⎜

⎞⎠⎟ EhE + g IS − IE( )E tP − tE( ) (4-21)

Besides the visual description, how information spreads in the computational domain, the principles of the method of characteristics can obviously also be used for the generation of a numerical meth-od. There are two computational methods based on characteristics. In the first method we start from the initial condition given on a grid and integrate along the charac-teristics. The intersection points of the positive and negative characteristic form the new grid points. This means that the intersection points of the characteristics, which depend on the initial conditions, will be located on different time levels and not on a previously defined position in space. In the second method the calculation is done on a fixed grid with constant space and time intervals between grid points. In this case it is however necessary to interpolate between the values at the ini-tial time. For the sake of simplicity we will use a linear interpolation. In the following the second method is shown in more detail, first, because it is quite easy to pro-gram and, second, because it uses a fixed space/time grid (see Fig. 4-C), similar to the finite volume method below.

Fig. 4-C: Computational grid and interpolation of characteristics

Page 5: 4 Numerical solution of the shallow water equations in 1D · Lecture Script Numerical Hydraulics 39 4 Numerical solution of the shallow water equations in 1D 4.1 Finite differences

Lecture Script Numerical Hydraulics

43

Through linear interpolation we obtain for point L (left):

vC − vLvC − vW

= xC − xLxC − xW

= xP − xLxC − xW

=vL + cL( )Δt

Δx (4-22)

analogously we can write:

cC − cLcC − cW

==vL + cL( )Δt

Δx (4-23)

Eliminating cL from the equations we obtain:

vL =vC −

ΔtΔx

cWvC − cCvW( )

1+ ΔtΔx

vC − vW + cC − cW( ) (4-24)

and from there cL and hL:

cL =cC − vL

ΔtΔx

cC − cW( )

1+ ΔtΔx

cC − cW( ) (4-25)

and:

hL = hC −ΔtΔx

vL + cL( ) hC − hW( ) (4-26)

For subcritical flow, point R (right), from which the negative characteristic originates, lies between grid points C and E. Using an analogous interpolation procedure for point L we get:

( )

( )WCWC

WCCWC

R

ccvvxt

vcvcxtv

v+−−

ΔΔ+

−ΔΔ+

=1

(4-27)

cR =cC − vL

ΔtΔx

cC − cW( )

1+ ΔtΔx

cC − cW( ) (4-28)

hR = hC +ΔtΔx

vR − cR( ) hC − hE( ) (4-29)

For supercritical flow the point from which the negative characteristic originates is located between points W and C, i.e. the interpolation is the same as for the positive characteristic. Note, that the negative characteristic has a velocity v-c, so that Eq (4-22) and Eq (4-23) have to be modified ac-cordingly. So we get:

Page 6: 4 Numerical solution of the shallow water equations in 1D · Lecture Script Numerical Hydraulics 39 4 Numerical solution of the shallow water equations in 1D 4.1 Finite differences

Lecture Script Numerical Hydraulics

44

vR =vC +

ΔtΔx

cWvC − cCvW( )

1+ ΔtΔx

vC − vW − cC + cW( ) (4-30)

cR =cC − vR

ΔtΔx

cC − cW( )

1+ ΔtΔx

cW − cC( ) (4-31)

hR = hC −ΔtΔx

vR − cR( ) hC − hW( ) (4-32)

By using these interpolated quantities and inserting them into Eq (4-18) and Eq (4-19), where

Cp = vL +gc

⎛⎝⎜

⎞⎠⎟ LhL + g IS − IE( )L Δt (4-33)

Cn = vR −gc

⎛⎝⎜

⎞⎠⎟ RhR + g IS − IE( )R Δt (4-34)

we obtain an explicit numerical scheme. When solving this scheme one has to set the boundary conditions properly, i.e. when the flow is subcritical one boundary condition has to be specified up-stream and the other one downstream, when the flow is supercritical both boundary conditions have to be specified at the inflow section. Using the two equations (4-18) and (4-19) and the two bounda-ry conditions, the two remaining unknowns at the boundary can be calculated by using the positive and negative characteristic (depending on the case), respectively. In Fig. 4-D below, a solution for a classical dam break problem obtained using the method of char-acteristics is shown. It is visible that the solution is qualitatively correct, however, the front propa-gation velocities are slightly too high. Hereby one has to consider that the accuracy of the scheme is only first order in space, both with respect to the interpolation procedure and to the linearization of the non-linear equations.

Fig. 4-D: Classical dam break problem solved using the method of characteristics

Page 7: 4 Numerical solution of the shallow water equations in 1D · Lecture Script Numerical Hydraulics 39 4 Numerical solution of the shallow water equations in 1D 4.1 Finite differences

Lecture Script Numerical Hydraulics

45

4.3 Finite Volume Method

4.3.1 Finite volume approaches

For the finite volume (FV) method we distinguish between two approaches: the cell-centered meth-od and the node-centered method. The two methods differ by the location, where the unknowns are formulated. In the cell-centered method the unknowns are placed at the centre of the cell, while in the node centered method they are located at the grid nodes. The difference is illustrated in Fig. 4-E.

Abb. 4-1: FV cell-centered method (left) and node centered method (right) and associated volume definitions

In the following only the cell-centered method will be discussed, since it was demonstrated that it is more stable compared to the node-centered method.

4.3.2 The 1D shallow water equation with conservative variables

One difficulty of the shallow water equations consists in the problem that it is very difficult to work with the right variables. For example, for the dam break problem we get different results depending on whether the velocity or the specific discharge is taken as an unknown. The reason is that, when there is a change of flow regime, e.g. a hydraulic jump from super- to subcritical flow, both water depth and flow velocity are not continuously differentiable, but show a jump. On the other hand, the specific discharge is continuously differentiable also across jumps in the flow regime and the solu-tion based on this variable is therefore closer to the physical reality in this case.

0=∂∂+

∂∂

xq

th

(4-35)

( )ES IIghghhq

xqt

−=⎟⎟⎠

⎞⎜⎜⎝

⎛+

∂∂+

∂∂

2

22

(4-36)

An alternative form of (4-35) and (4-36), which is suitable for generic cross sections, is represented by a system of equations with the unknowns free surface level hp and discharge Q. The respective system of equations reads:

0=∂∂+

∂∂

xQ

tA

(4-37)

02

=⎟⎟⎠

⎞⎜⎜⎝

⎛+

∂∂

+⎟⎟⎠

⎞⎜⎜⎝

⎛∂∂+

∂∂

Ep Ixh

gAAQ

xQt

(4-38)

Page 8: 4 Numerical solution of the shallow water equations in 1D · Lecture Script Numerical Hydraulics 39 4 Numerical solution of the shallow water equations in 1D 4.1 Finite differences

Lecture Script Numerical Hydraulics

46

The relationship A(hp) is calculated before solving the equations and saved in form of a lookup ta-ble. Considering for simplicity again Eq. (4-35) and (4-36), we can split these equations into parts and more specifically into time (storage), space (flux) and source terms, respectively. The vector con-taining the space derivatives is termed flux vector. The approximation in the FV method concerns the choice of an appropriate expression for the flux vector. Formulating Eq. (4-35) und (4-36) in matrix form yields:

ut + fx + b = 0 (4-39)

where

u = hq

⎣⎢⎢

⎦⎥⎥, f =

qq2

h+ gh

2

2

⎢⎢⎢

⎥⎥⎥, b =

0−gh IS − IE( )

⎣⎢⎢

⎦⎥⎥

(4-40)

The subscripts t and x indicate the partial derivatives with respect to time and space. Assuming for the moment that we use small time steps, we can linearize the non-linear terms assuming that their value does not change over the time interval Δt, but remains constant. Using an explicit time dis-cretization and, for the time being, a flux term written in the conventional form, we can write:

uit+1 − ui

t

Δt+ 1Δx

fi+12

t − fi−12

t( )+ bit = 0 (4-41)

and solve it for the unknown vector:

( ) ti

ti

ti

ti

ti x

t bffuu −−ΔΔ−= −+

+11

1

2 (4-42)

with the assumption that fluxes are calculated centrally (information from the two sides is weighted equally), i.e.:

( ) ( )ti

ti

ti

ti

ti

ti

and 1211

21 2

121

−−+++=+= ffffff (4-43)

Now, Eq. (4-41) has a shortcoming in that the difference of the flux vectors may change sign and schemes that are based on Eq. (4-41) to (4-43) are therefore not stable. Lax and Friedrichs proposed a small modification of Eq. (4-42), which leads to a simple, stable scheme. The stabilisation is not achieved by modifying the flux term, but via the temporal variation instead:

uit+1 = 0.5 ui+1

t + ui−1t( )− Δt

2Δxfi+1t − fi−1

t( )− bit (4-44)

The scheme proposed by Lax and Friedrichs is stable, but it leads to excessive numerical diffusion. A classical upwind discretization points towards a better direction. Taking the flow direction into account and using the operator A,B (selects the bigger value of A and B) one obtains an upwind-weighted formulation of the flux terms:

Page 9: 4 Numerical solution of the shallow water equations in 1D · Lecture Script Numerical Hydraulics 39 4 Numerical solution of the shallow water equations in 1D 4.1 Finite differences

Lecture Script Numerical Hydraulics

47

hit+1 = hi

t − ΔtΔx

KEit −KWi

t( ) (4-45)

qit+1 = qi

t − ΔtΔx

MEit −MWi

t( )− ghit (IS − IE ) (4-46)

with the definitions for KE, KW, ME and MW:

KE = qit, 0 + −qi+1

t , 0

KW = qi−1t , 0 + −qi

t, 0 (4-47)

ME =qit

qitqit2

hit +

ghit2

2⎛⎝⎜

⎞⎠⎟, 0 + −

qit

qit

qi+1t2

hi+1t + ghi+1

t2

2⎛⎝⎜

⎞⎠⎟, 0

MW =qit

qit

qi−1t2

hi−1t + ghi−1

t2

2⎛⎝⎜

⎞⎠⎟, 0 + −

qit

qitqit2

hit +

ghit2

2⎛⎝⎜

⎞⎠⎟, 0

(4-48)

If one takes a closer look at the upwind scheme, one discovers that it is always possible to decom-pose the discrete equations into a centrally weighted part and an additional term with second deriva-tives (diffusion term). This means that all Upwind schemes introduce numerical diffusion that is added to the centrally weighted part. One aspect that distinguishes the different upwind methods is the way how the fluxes across the cell sides are calculated and included into the discrete equations as diffusion terms. A good upwind scheme adds numerical diffusion only where necessary to main-tain stability, no numerical diffusion is introduced in the remaining computational domain. The simple upwind scheme presented here (first order upwind) takes the flow direction into ac-count. Since the method considers information only from one direction in the whole computational domain, it introduces by consequence numerical diffusion in the whole computational domain. An alternative method, the so-called “artificial viscosity” or “artificial dampening” adds to the central scheme a diffusion term (derivatives of second order) and in addition a derivative of fourth order as well. The term with the second derivative prevents the amplification of a solution in the proximity of surges (sharp gradients), whereas the term with the fourth derivative makes sure that the solution is smooth, i.e. it prevents the appearance of disturbances with small wavelength. A pressure sensor (free surface sensor) is used so that the additional terms are employed only at critical locations to stabilize the solution. “Artificial dampening” is hence a method, which stabilizes the solution where necessary, however, it lacks a physically based foundation. A step further, advancing beyond the simple upwind schemes, is the so-called “flux difference splitting”, as suggested by e.g. Roe, which nowadays is widely used in modern codes. Roe starts from Eq. (4-39) and (4-40). We denote f as “flux vector”, which has to be specified at the cell sides. When a convective term becomes more significant compared to the diffusive one, then the way in which this happens decides whether the solution will remain numerically stable and be physically meaningful. The method of Roe allows the appearance of discontinuities at the sides of a cell, which can be viewed as local dam break problem. The method of Roe determines tentative solutions at the cell sides, which approximate the nonlinear waves with linear ones and use these for the calculation of the fluxes across the sides of a cell. Roe requires that for the flux difference between the right and the left hand side the following relation holds:

Page 10: 4 Numerical solution of the shallow water equations in 1D · Lecture Script Numerical Hydraulics 39 4 Numerical solution of the shallow water equations in 1D 4.1 Finite differences

Lecture Script Numerical Hydraulics

48

f(ur )− f(ul ) = Ai+12(ur − ul ) (4-49)

where A must be consistent, i.e.

( ) uuuuAuuA →→→+ rllri

for),(21 (4-50)

The method is strongly related to the characteristic information: one can calculate the eigenvalues of the matrix A and it turns out that they depend on the characteristic wave velocities. Based on the signs of the eigenvalues the fluxes are subdivided into positive and negative parts – thus the name “flux difference splitting” – and contribute to the global flux by taking the direction of the charac-teristic information into account. At the eastern element side, i.e. at i+1/2 the flux can be calculated from:

fi+1/2 = fl +Ai+1/2− (ur − ul ) (4-51)

fi+1/2 = fr −Ai+1/2+ (ur − ul ) (4-52)

the arithmetic mean of the two fluxes is:

fi+1/2 =12fl + fr( )− 1

2Ai+1/2 (ur − ul ) (4-53)

with the Roe-matrix A defined as:

A = 12c

λ1 λ2 − λ1 λ2 λ1 − λ2λ1λ2 λ2 − λ1( ) λ1 λ1 − λ2 λ2

⎢⎢

⎥⎥

(4-54)

with the eigenvalues λ1 = u+c und λ2 = u-c. In order to guarantee conservatism and consistency, the means for h and u are used in A:

hi+1/2 =12hl + hr( ) und ui+1/2 =

hl ul + hrurhl + hr

(4-55)

For the variables vector at the new time it follows then that:

ui, jt+1 = ui, j

t − Δt2Δx

fi+1, jt − fi−1, j

t( )− bi, jt (4-56)

Page 11: 4 Numerical solution of the shallow water equations in 1D · Lecture Script Numerical Hydraulics 39 4 Numerical solution of the shallow water equations in 1D 4.1 Finite differences

Lecture Script Numerical Hydraulics

49

4.3.3 2D shallow water equation with conservative variables: We can extend the same formulation used for the 1D problem above to the 2D case and write:

ut + fx + gy + b = 0 (4-57)

where

u =hqr

⎢⎢⎢

⎥⎥⎥, f =

q

q2

h+ gh

2

2qrh

⎢⎢⎢⎢⎢⎢⎢

⎥⎥⎥⎥⎥⎥⎥

,g =

rqrh

r2

h+ gh

2

2

⎢⎢⎢⎢⎢⎢⎢

⎥⎥⎥⎥⎥⎥⎥

, b =

0−gh ISx − IEx( )−gh ISy − IEy( )

⎢⎢⎢⎢

⎥⎥⎥⎥

(4-58)

When solving the 2D shallow water equations on a regular grid parallel to the x- and y-axes, then no particular differences compared to the 1D case arise, because the fluxes across the sides of the elements are always parallel to the axes. Again it is possible to formulate a balance equation, which states that the flux differences of the fluxes in x- and y-direction plus the source term must be equal to the temporal variation of the variable. There a several differences: the additional terms contribute to the fluxes across the sides of an element, one has to account for the lengths of the element sides in the calculation of the fluxes and, finally, in the Roe method separate 3x3 matrices exist in x- and y-directions.

Fig. 4-F: Definition on the 2D grid

The simplest calculation suggested by Lax can be done using the following equations (see Fig. 4-F):

ui, jt+1 = 0.25 ui+1, j

t + ui−1, jt + ui1, j+1

t + ui, j−1t( )− Δt

2Δxfi+1, jt − fi−1, j

t( )−Δt2Δy

gi, j+1t − gi, j−1

t( )− bi, jt (4-59)

Following Roe, the fluxes across the eastern side of a cell can be expressed as:

fi+1/2, j =12fl + fr( )− 1

2Ai+1/2, j (ur − ul ) (4-60)

Page 12: 4 Numerical solution of the shallow water equations in 1D · Lecture Script Numerical Hydraulics 39 4 Numerical solution of the shallow water equations in 1D 4.1 Finite differences

Lecture Script Numerical Hydraulics

50

and for the northern boundary:

gi, j+1/2 =12gl + gr( )− 1

2Bi, j+1/2 (ur − ul ) (4-61)

with the Roe matrices:

A = 12c

λ2 λ3 − λ2 λ3 λ2 − λ3 0

λ2λ3 λ3 − λ2( ) λ2 λ2 − λ3 λ3 0

v λ2 λ3 − 2c λ1 − λ2 λ3( ) v λ2 − λ3( ) 2c λ1

⎢⎢⎢⎢⎢

⎥⎥⎥⎥⎥

(4-62)

with eigenvalues λ1,λ2,λ3( ) = u,u + c,u − c( ) and

B = 12c

λ2 λ3 − λ2 λ3 0 λ2 − λ3u λ2 λ3 − 2c λ1 − λ2 λ3( ) 2c λ1 u λ2 − λ3( )

λ2λ3 λ3 − λ2( ) 0 λ2 λ2 − λ3 λ3

⎢⎢⎢⎢⎢

⎥⎥⎥⎥⎥

(4-63)

with the eigenvalues λ1,λ2,λ3( ) = v,v + c,v − c( ) . The explicit scheme for the variables vector for the new time step is written as:

ui, jt+1 = ui, j

t − Δt2Δx

fi+1, jt − fi−1, j

t( )− Δt2Δy

gi, j+1t − gi, j−1

t( )− bi, jt (4-64)

Extending the method to general grids brings some difficulties, which has to be accounted for. Fluxes across the cell sides have then components in both directions in space. In addition, it be-comes more difficult to calculate the fluxes across the cell sides using the arithmetic mean of the values of the neighbouring cells. A relatively easy extension is the one from axi-parallel nets to curvilinear ones. The fluxes are then calculated as before. An individual element can be associated with a local coordinate system and the fluxes can be calculated in the conventional way. In a second step, the result is then converted to the global coordinate system. For generic nets it might be reasonable to take unit elements with side length one as a reference and calculate the fluxes for these unit elements. Using a transformation these fluxes must then be trans-formed to the effective situation. Such an approach is commonly used in the FE method.