Back
 ENG  Vol.13 No.6 , June 2021
Numerical Analysis of Upwind Difference Schemes for Two-Dimensional First-Order Hyperbolic Equations with Variable Coefficients
Abstract: In this paper, we consider the initial-boundary value problem of two-dimensional first-order linear hyperbolic equation with variable coefficients. By using the upwind difference method to discretize the spatial derivative term and the forward and backward Euler method to discretize the time derivative term, the explicit and implicit upwind difference schemes are obtained respectively. It is proved that the explicit upwind scheme is conditionally stable and the implicit upwind scheme is unconditionally stable. Then the convergence of the schemes is derived. Numerical examples verify the results of theoretical analysis.

1. Introduction

For the domain Ω = ( 0, L ) × ( 0, L ) , let Ω be the boundary of Ω and Ω ¯ = Ω Ω . For a given vector c = ( a ( x , y ) , b ( x , y ) ) , we divide Ω into the following two parts [1]:

{ ( Ω ) = { ( x , y ) Ω : c n 0 } ( flow in ) , ( Ω ) + = { ( x , y ) Ω : c n > 0 } ( flow out ) , (1)

where n is the unit outer normal vector of Ω . Considering the following two-dimensional first-order hyperbolic equation on Ω :

( a ) u t + a ( x , y ) u x + b ( x , y ) u y = f ( x , y , t ) , ( x , y ) Ω \ ( Ω ) , 0 < t T , ( b ) u ( x , y , 0 ) = u 0 ( x , y ) , ( x , y ) Ω ¯ , ( c ) u ( x , y , t ) = g ( x , y , t ) , ( x , y ) ( Ω ) , 0 t T , (2)

where c = ( a ( x , y ) , b ( x , y ) ) is the flow rate and a ( x , y ) , b ( x , y ) , f ( x , y , t ) , u 0 ( x , y ) , g ( x , y , t ) are known functions which are smooth enough.

Hyperbolic equations are widely used in natural sciences and engineering such as fluid mechanics, light propagation, gas dynamics, etc. This kind of equations admits solutions propagating along with the characteristics [2] and depending on the initial data locally. These properties must be taken into account in order to obtain a stable numerical solution. Many numerical methods have been applied to hyperbolic equations [3] - [10]. In [3] [4] upwind difference schemes were used to solve one-dimensional and two-dimensional hyperbolic equations with constant coefficient and stability analysis was conducted by Fourier method. Greg [5] studied the semi-discrete central upwind Rankine-Hugoniot schemes for hyperbolic systems of conservation laws. Zhao et al. [6] [7] proposed some hybrid WENO schemes for hyperbolic conservation laws. Kurganov et al. [8] [9] presented semi-discrete central upwind schemes for nonconvex hyperbolic conservation laws and shallow water equations, respectively. Discontinuous Galerkin schemes for hyperbolic laws were considered in [10]. Some high-order difference schemes were considered in [11] for first-order hyperbolic equations with variable coefficients, but the direction of flow rate was not taken into account. Chen et al. [12] proposed dissipative spectral element method for first-order linear hyperbolic equation with variable coefficients in two dimensions. Among the aforementioned methods, upwind difference methods are typical ones which depend on the direction of the flow rate to provide stable as well as easily implementable schemes. Especially in many practical applications, first-order hyperbolic equations with variable coefficients in two or three dimensions are needed to describe more complex problems. Upwind difference methods will be more efficient in such applications. However, there is little work about the detailed discussions of upwind difference schemes for two- or three-dimensional hyperbolic equations with variable coefficients. Therefore, in this paper, full-discrete explicit and implicit upwind difference schemes are formulated and analyzed for two-dimensional first-order hyperbolic equations with variable coefficients. The stability analysis of these schemes is conducted by using Fourier method and maximum technique, which shows that the explicit upwind difference scheme is conditionally stable and the implicit one is unconditionally stable. A convergence rate of O ( τ + h ) is proved for these schemes. Numerical examples are provided to verify the theoretical results.

The rest of the paper is arranged as follows. In Section 2 and Section 3 we formulate explicit and implicit upwind schemes for the two-dimensional first-order hyperbolic problem (2), and conduct the stability and convergence analysis. The implementation details of the method are given in Section 4 and numerical examples are given in Section 5. Conclusions and the future work plans are presented in Section 6.

2. Explicit Upwind Scheme

In this section, we will develop and analyze an explicit upwind difference scheme for problem (2).

2.1. Formulation of Difference Scheme

Noticing that the flow rate c = ( a ( x , y ) , b ( x , y ) ) in (2) is a vector function of ( x , y ) , we need to consider the direction of it node by node in the spatial mesh in order to discrete the spatial derivative upwind. This will lead to four cases according to the sign of a ( x , y ) and b ( x , y ) at every node.

Taking two positive integers M and N, let the time step and space step be h = L M , τ = T N , respectively. Denote x j = j h , y k = k h , 0 j , k M , t n = n τ , 0 < n N , and call ( x j , y k , t n ) a node.

Let Ω ¯ h = { ( x j , y k ) | 0 j M ,0 k M } , Ω ¯ τ = { t n | 0 n N } .

Considering Equation (2a) at ( x j , y k , t n ) , we have

u ( x j , y k , t n ) t + a ( x j , y k ) u ( x j , y k , t n ) x + b ( x j , y k ) u ( x j , y k , t n ) y = f ( x j , y k , t n ) . (3)

For the first term on the left hand side of Equation (3), applying the forward Euler method and Taylor’s formula, we have

u ( x j , y k , t n ) t = u ( x j , y k , t n + 1 ) u ( x j , y k , t n ) τ τ 2 2 u ( x j , y k , t n + 1 ) t 2 + O ( τ 2 ) . (4)

The second and third terms on the left hand side of Equation (3) will be discretized by upwind difference method according to the sign of a ( x j , y k ) and b ( x j , y k ) . Let a j , k = a ( x j , y k ) , b j , k = b ( x j , y k ) , f j , k n = f ( x j , y k , t n ) and consider the following four cases.

Case 1. a j , k 0, b j , k 0 .

When a j , k 0, b j , k 0 , it is obtained by Taylor’s formula

u ( x j , y k , t n ) x = u ( x j , y k , t n ) u ( x j 1 , y k , t n ) h + h 2 2 u ( x j , y k , t n ) x 2 + O ( h 2 ) (5)

and

u ( x j , y k , t n ) y = u ( x j , y k , t n ) u ( x j , y k 1 , t n ) h + h 2 2 u ( x j , y k , t n ) y 2 + O ( h 2 ) . (6)

Substituting (4)-(6) into (3), we have

u ( x j , y k , t n + 1 ) u ( x j , y k , t n ) τ + a j , k u ( x j , y k , t n ) u ( x j 1 , y k , t n ) h + b j , k u ( x j , y k , t n ) u ( x j , y k 1 , t n ) h = f ( x j , y k , t n ) + R j , k n ( u ) , (7)

where

R j , k n ( u ) = τ 2 2 u ( x j , y k , t n ) t 2 + h 2 2 u ( x j , y k , t n ) x 2 + h 2 2 u ( x j , y k , t n ) y 2 + O ( h 2 + τ 2 ) (8)

is the local truncation error.

Omitting the truncation error and replacing the exact solution u ( x j , y k , t n ) by the numerical solution U j , k n in (7), we obtain the upwind difference scheme of (3)

U j , k n + 1 U j , k n τ + a j , k U j , k n U j 1 , k n h + b j , k U j , k n U j , k 1 n h = f j , k n , 1 j , k M , 0 n N 1. (9)

Similar to Case 1, we can derive the upwind difference schemes for other cases.

Case 2. a j , k 0, b j , k 0 .

When a j , k 0, b j , k 0 , the difference scheme of (3) is

U j , k n + 1 U j , k n τ + a j , k U j + 1 , k n U j , k n h + b j , k U j , k + 1 n U j , k n h = f j , k n , 0 j , k M 1 , 0 n N 1. (10)

Case 3. a j , k 0, b j , k 0 .

When a j , k 0, b j , k 0 , the difference scheme of (3) is

U j , k n + 1 U j , k n τ + a j , k U j , k n U j 1 , k n h + b j , k U j , k + 1 n U j , k n h = f j , k n , 1 j M , 0 k M 1 , 0 n N 1. (11)

Case 4. a j , k 0 , b j , k 0 .

When a j , k 0, b j , k 0 , the difference scheme of (3) is

U j , k n + 1 U j , k n τ + a j , k U j + 1 , k n U j , k n h + b j , k U j , k n U j , k 1 n h = f j , k n , 0 j M 1 , 1 k M , 0 n N 1. (12)

The initial condition and boundary condition (2b)-(2c) are discretized as follows

U j , k 0 = u 0 ( x j , y k ) , 0 j , k M , U j , k n = g ( x j , y k , t n ) , ( x j , y k ) ( Ω ) , 0 n N . (13)

Combining (9)-(13), the explicit upwind difference scheme for problem (2) is formulated.

2.2. Stability and Convergence Analysis

Since the coefficients in problem (2) are variable, we need first to apply the local fixed coefficient method or the apparent variable coefficient method to derive a stability condition and then prove that it is sufficient for the scheme (9)-(13) to be stable. The methods we use mainly include Fourier analysis and maximum technique.

Let U n = { U j , k n , 0 j , k M } and U n = max 0 j , k M | U j , k n | .

Theorem 2.1. When τ h max 0 j h , k h L ( | a j , k | + | b j , k | ) 1 , the explicit upwind scheme (9)-(13) is stable with respect to the initial value U 0 and the source term f.

Proof. No loss of generality, we assume that a j , k 0 . Let r j , k = a j , k τ h , s j , k = b j , k τ h , c j , k = b j , k a j , k .

We first consider the Case 1, in which r j , k > 0 , s j , k 0 , c j , k 0 . Let f = 0 and rewrite (9) as

U j , k n + 1 = ( 1 r j , k s j , k ) U j , k n + r j , k U j 1 , k n + s j , k U j , k 1 n . (14)

Letting U j , k n = v n e i α j h e i β k h ( i = 1 , α = 2 p π L , β = 2 q π L , p and q are integers), and substituting it into (14), we have

v n + 1 = ( 1 r j , k s j , k + r j , k ( cos α h i sin α h ) + s j , k ( cos β h i sin β h ) ) v n .

Thus, the growth factor is

G ( α h , β h ) = 1 r j , k s j , k + r j , k ( cos α h i sin α h ) + s j , k ( cos β h i sin β h ) . (15)

Noticing that s j , k = c j , k r j , k , it can be obtained by calculation that

| G ( α h , β h ) | 2 = A r j , k 2 + B r j , k + 1 , (16)

where

A = 2 ( 1 + c j , k ) [ ( 1 cos α h ) + c j , k ( 1 cos β h ) ] + c j , k [ 1 + cos ( α h + β h ) ] ,

B = 2 [ ( 1 cos α h ) + c j , k ( 1 cos β h ) ] .

By Von Neumann condition, we let | G ( α h , β h ) | 2 1 , i.e.

A r j , k 2 + B r j , k 0. (17)

Obviously, B 0 holds for any α , β . So when A 0 , (17) holds for any r j , k > 0 . When A > 0 , (17) is equavalent to 0 < r j , k B A . Because

B A = ( 1 cos α h ) + c j , k ( 1 cos β h ) ( 1 + c j , k ) [ ( 1 cos α h ) + c j , k ( 1 cos β h ) ] + c j , k [ 1 + cos ( α h + β h ) ] ,

1 + cos ( α h + β h ) 0 ,

we know that B A 1 1 + c j , k > 0 . So when

0 < r j , k 1 1 + c j , k , (18)

(17) holds for any α , β .

Similarly, for Cases 2-4, the following conditions

1 1 + c j , k r j , k < 0 , a j , k < 0 , b j , k 0 , (19)

0 < r j , k 1 1 c j , k , a j , k > 0 , b j , k 0 , (20)

1 1 c j , k r j , k < 0 , a j , k < 0 , b j , k 0 (21)

are obtained respectively.

Summing up (18)-(21) gives that

| r j , k | 1 1 + | c j , k | . (22)

Condition (22) is obtained by taking the variable coefficients as constants. Considering that (2) admits variable coefficients and using the definition of r j , k and c j , k , we write (22) as

τ h max 0 j h , k h L ( | a j , k | + | b j , k | ) 1. (23)

Now we show that (23) is sufficient for the scheme (9)-(13) to be stable.

Using r i , k and s i , k , (9)-(12) can be rewritten as follows

U j , k n + 1 = ( 1 | r j , k | | s j , k | ) U j , k n + | r j , k | U j 1 , k n + | s j , k | U j , k 1 n + τ f j , k n , (24)

U j , k n + 1 = ( 1 | r j , k | | s j , k | ) U j , k n + | r j , k | U j + 1 , k n + | s j , k | U j , k + 1 n + τ f j , k n , (25)

U j , k n + 1 = ( 1 | r j , k | | s j , k | ) U j , k n + | r j , k | U j 1 , k n + | s j , k | U j , k + 1 n + τ f j , k n , (26)

U j , k n + 1 = ( 1 | r j , k | | s j , k | ) U j , k n + | r j , k | U j + 1 , k n + | s j , k | U j , k 1 n + τ f j , k n . (27)

From (23), we have | r j , k | + | s j , k | 1 . Therefore, we have

| U j , k n + 1 | ( 1 | r j , k | | s j , k | ) | U j , k n | + | r j , k | | U j 1 , k n | + | s j , k | | U j , k 1 n | + τ | f j , k n | ( 1 | r j , k | | s j , k | ) U n + | r j , k | U n + | s j , k | U n + τ | f j , k n | U n + τ f n (28)

for (24).

Similarly, we can obtain the following inequality

| U j , k n + 1 | U n + τ f n (29)

for (25)-(27). That is, we have the estimation

U n + 1 U n + τ f n (30)

for Case 1-Case 4. It can be derived from (30) immediately that

U n U 0 + n τ max 0 n N f n U 0 + T max 0 n N f n . (31)

So the scheme (9)-(13) is stable with respect to U 0 and f.

The proof is completed.

Remark 2.1. It can be seen that when a ( x , y ) a and b ( x , y ) b with constants a and b, the condition (23) reduces to

τ h ( | a | + | b | ) 1,

which is just the CFL condition of upwind difference scheme for two-dimensional hyperbolic equations with constant coefficients [3]. This indicates that the condition (23) is compatible with the constant coefficients case and is an appropriate one.

Now we derive the convergence rate of the scheme (9)-(13) based on the maximum technique and the condition (23).

Theorem 2.2. Suppose that u ( x , y , t ) C 2 ( Ω ¯ × [ 0, T ] ) is the solution of (2), and { U j , k n | 0 j , k M , 0 n N } is the solution of the upwind difference scheme (9)-(13). Then when the condition (23) is satisfied, there exists a constant C > 0 independent of h and τ such that

max 0 n τ N u n U n C ( τ + h ) .

Proof. Let E j , k n = u j , k n U j , k n , 0 j , k M , 0 n N . We can easily obtain the error equations

E j , k n + 1 = ( 1 | r j , k | | s j , k | ) E j , k n + | r j , k | E j 1 , k n + | s j , k | E j , k 1 n + τ R j , k 1 , n , E j , k n + 1 = ( 1 | r j , k | | s j , k | ) E j , k n + | r j , k | E j + 1 , k n + | s j , k | E j , k + 1 n + τ R j , k 2 , n , E j , k n + 1 = ( 1 | r j , k | | s j , k | ) E j , k n + | r j , k | E j 1 , k n + | s j , k | E j , k + 1 n + τ R j , k 3 , n , E j , k n + 1 = ( 1 | r j , k | | s j , k | ) E j , k n + | r j , k | E j + 1 , k n + | s j , k | E j , k 1 n + τ R j , k 4 , n , (32)

where E j , k 0 = 0 , R j , k 1 , n , R j , k 2 , n , R j , k 3 , n , R j , k 4 , n are the truncation errors for Case 1-Case 4, respectively, and | R j , k s , n | C ( τ + h ) , s = 1 , 2 , 3 , 4 .

Using the similar approach to get (31), we obtain

E n C ( τ + h ) , 0 n N .

The proof is completed.

3. Implicit Upwind Scheme

The explicit upwind difference scheme proposed in the previous section is easy to implement. But the conditional stability may limit the application of the scheme in practice. For example, when very small space step h is needed, the time step τ must be taken very small also in order to keep the stability condition. In this section we propose an implicit upwind difference scheme which is unconditionally stable for problem (2). Instead of the forward Euler method, the backward Euler method is used to the time derivative in (2a) and at the same time the upwind method is used to the space derivatives. The unconditional stability of the implicit scheme is obtained by using Fourier method and maximum technique. Since there is no restriction between the size of h and τ , large time step can be used when it is necessary. So the implicit upwind difference scheme is more universal.

3.1. Formulation of Difference Scheme

Now we consider Equation (2a) at the node ( x j , y k , t n + 1 )

u ( x j , y k , t n + 1 ) t + a ( x j , y k ) u ( x j , y k , t n + 1 ) x + b ( x j , y k ) u ( x j , y k , t n + 1 ) y = f ( x j , y k , t n + 1 ) . (33)

For the first term on the left hand side of Equation (3), applying the backward Euler method and Taylor’s formula, we have

u ( x j , y k , t n + 1 ) t = u ( x j , y k , t n + 1 ) u ( x j , y k , t n ) τ τ 2 2 u ( x j , y k , t n + 1 ) t 2 + O ( τ 2 ) . (34)

Then by using the upwind approach we have used to derive the scheme (9)-(12), we obtain the following implicit upwind difference scheme for (2)

( a ) U j , k n + 1 U j , k n τ + a j , k U j , k n + 1 U j 1 , k n + 1 h + b j , k U j , k n + 1 U j , k 1 n + 1 h = f j , k n + 1 , 1 j , k M , 0 n N 1 , a j , k 0 , b j , k 0 , ( b ) U j , k n + 1 U j , k n τ + a j , k U j + 1 , k n + 1 U j , k n + 1 h + b j , k U j , k + 1 n + 1 U j , k n + 1 h = f j , k n + 1 , 0 j , k M 1 , 0 n N 1 , a j , k 0 , b j , k 0 ,

( c ) U j , k n + 1 U j , k n τ + a j , k U j , k n + 1 U j 1 , k n + 1 h + b j , k U j , k + 1 n + 1 U j , k n + 1 h = f j , k n + 1 , 1 j M , 0 k M 1 , 0 n N 1 , a j , k 0 , b j , k 0 , ( d ) U j , k n + 1 U j , k n τ + a j , k U j + 1 , k n + 1 U j , k n + 1 h + b j , k U j , k n + 1 U j , k 1 n + 1 h = f j , k n + 1 , 0 j M 1 , 1 k M , 0 n N 1 , a j , k 0 , b j , k 0. (35)

The initial condition and boundary condition (2b)-(2c) are discretized as follows

U j , k 0 = u 0 ( x j , y k ) , 0 j , k M , U j , k n = g ( x j , y k , t n ) , ( x j , y k ) ( Ω ) , 0 n N . (36)

Remark 3.1. Note that at the time level t n + 1 , only two nodes in addition to ( x j , y k ) are used in x-direction and y-direction in each formula of (35). This makes it possible that the scheme (35)-(36) can be implemented explicitly from the flow-in boundary node by node. We will explain it in detail in Section 4.

3.2. Stability and Convergence Analysis

We present unconditional stability and convergence of the scheme (35)-(36) in Theorem 3.1 and Theorem 3.2, respectively.

Theorem 3.1. The implicit upwind scheme (35)-(36) is unconditionally stable with respect to the initial value U 0 and the source term f.

Proof. First consider the case in which a j , k 0, b j , k 0 . Let f = 0 and rewrite (35a) as

U j , k n + 1 + r j , k ( U j , k n + 1 U j 1, k n + 1 ) + s j , k ( U j , k n + 1 U j , k 1 n + 1 ) = U j , k n . (37)

Letting U j , k n = v n e i α j h e i β k h ( i = 1 , α = 2 p π L , β = 2 q π L , p and q are integers), and substituting it into (37), we have

v n + 1 + r j , k v n + 1 ( 1 ( cos α h i sin α h ) ) + s j , k v n + 1 ( 1 ( cos β h i sin β h ) ) = v n .

Thus, the growth factor is

G ( α h , β h ) = 1 1 + r j , k + s j , k r j , k cos α h s j , k cos β h + i ( r j , k sin α h + s j , k sin β h ) . (38)

Therefore

| G ( α h , β h ) | 2 = 1 ( 1 + r j , k + s j , k r j , k cos α h s j , k cos β h ) 2 + ( r j , k sin α h + s j , k sin β h ) 2 . (39)

Since r j , k 0, s j , k 0 , we easily know that

1 + r j , k + s j , k r j , k cos α h s j , k cos β h = 1 + r j , k ( 1 cos α h ) + s j , k ( 1 cos β h ) 1.

So for any r j , k 0, s j , k 0 , it holds that

| G ( α h , β h ) | 2 1. (40)

Similarly, we can obtain (40) for (35b)-(35d). Therefore, the growth factor satisfies the Von Neumann condition.

Now we prove the unconditional stability of the scheme (35)-(36) with respect to U 0 and f. We write (35a) as follow

( 1 + r j , k + s j , k ) U j , k n + 1 r j , k U j 1 , k n + 1 s j , k U j , k 1 n + 1 = U j , k n + τ f j , k n + 1 . (41)

Assuming that | U j 0 , k 0 n + 1 | = U n + 1 and noticing that r j , k 0 and s j , k 0 , we have

U n + 1 = ( 1 + r j 0 , k 0 + s j 0 , k 0 ) U n + 1 r j 0 , k 0 U n + 1 s j 0 , k 0 U n + 1 ( 1 + r j 0 , k 0 + s j 0 , k 0 ) | U j 0 , k 0 n + 1 | r j 0 , k 0 | U j 0 1 , k 0 n + 1 | s j 0 , k 0 | U j 0 , k 0 1 n + 1 | | ( 1 + r j 0 , k 0 + s j 0 , k 0 ) U j 0 , k 0 n + 1 r j 0 , k 0 U j 0 1 , k 0 n + 1 s j 0 , k 0 U j 0 , k 0 1 n + 1 | = | U j 0 , k 0 n + τ f j 0 , k 0 n + 1 | U n + τ f n + 1 . (42)

Thus, we obtain

U n + 1 U n + τ f n + 1 . (43)

Similarly, we can obtain (43) for (35b)-(35d).

Then, for any n, 1 n N , we get

U n U 0 + n τ max 0 n N f n U 0 + T max 0 n N f n . (44)

So the scheme (35)-(36) is unconditionally stable with respect to the initial value U 0 and the source term f.

The proof is completed.

Theorem 3.2. Suppose that u ( x , y , t ) C 2 ( Ω ¯ × [ 0, T ] ) is the solution of (2), and { U j , k n | 0 j , k M , 0 n N } is the solution of the upwind difference scheme (35)-(36). Then there exists a constant C > 0 independent of h and τ , such that

max 0 n τ N u n U n C ( τ + h ) .

Proof. Let E j , k n = u j , k n U j , k n , 0 j , k M , 0 n N . We can easily obtain the error equations

( 1 + | r j , k | + | s j , k | ) E j , k n + 1 | r j , k | E j 1 , k n + 1 | s j , k | E j , k 1 n + 1 = E j , k n + τ R j , k 1 , n + 1 , ( 1 + | r j , k | + | s j , k | ) E j , k n + 1 | r j , k | E j + 1 , k n + 1 | s j , k | E j , k + 1 n + 1 = E j , k n + τ R j , k 1 , n + 1 , ( 1 + | r j , k | + | s j , k | ) E j , k n + 1 | r j , k | E j 1 , k n + 1 | s j , k | E j , k + 1 n + 1 = E j , k n + τ R j , k 1 , n + 1 , ( 1 + | r j , k | + | s j , k | ) E j , k n + 1 | r j , k | E j + 1 , k n + 1 | s j , k | E j , k 1 n + 1 = E j , k n + τ R j , k 1 , n + 1 , (45)

where E j , k 0 = 0 , R j , k 1 , n , R j , k 2 , n , R j , k 3 , n , R j , k 4 , n are the truncation errors for (35), respectively, and | R j , k s , n | C ( τ + h ) , s = 1 , 2 , 3 , 4 .

Using the similar approach to get (43), we obtain

E n C ( τ + h ) , 0 n N .

The proof is completed.

4. Implementation Details of the Method

In this section, we give details about how to implement the method of this work. In order to describe the algorithm for the explicit scheme (9)-(13) and the implicit scheme (35)-(36) simply and clearly, we assume that the flow-in boundary is { ( x , y ) : x = 0 , 0 y L } and { ( x , y ) : y = 0 , 0 x L } with no loss of generality. Thus we have both a ( x , y ) 0 and b ( x , y ) 0 .

We provide the algorithms for the explicit scheme (9)-(13) and the explicit scheme (35)-(36) in the following Algorithm 4.1 and Algorithm 4.2, respectively.

Algorithm 4.1. Algorithm for the explicit scheme (9)-(13):

1) Choose space step h = L / M and time step τ = T / N which satisfy the stability condition (23) and partition the time interval [ 0, T ] and space domain Ω .

2) Get initial data { U j , k 0 , 0 j , k M } and flow-in boundary data { U 0 , k n , U j , 0 n , 0 j , k M , n = 0 , 1 , , N } by (13).

3) For n = 0 , 1 , , N 1 , suppose that { U j , k n , 0 j , k M } has been known or obtained beforehand. Then for 1 j , k M , get U j , k n + 1 explicitly by using the formula (9) according to the sign of a j , k 0 and b j , k 0 (or by other formula in (10)-(12) corresponding to other cases of the sign of a j , k and b j , k ).

Algorithm 4.2. Algorithm for the implicit scheme (35)-(36):

1) Choose space step h = L / M and time step τ = T / N and partition the time interval [ 0, T ] and space domain Ω .

2) Get initial data { U j , k 0 , 0 j , k M } and flow-in boundary data { U 0 , k n , U j , 0 n , 0 j , k M , n = 0 , 1 , , N } by (36).

3) For n = 0 , 1 , , N 1 , suppose that { U j , k n } has been known or obtained beforehand. For k = 1 , 2 , , M , obtain U j , k n + 1 explicitly from { U j 1, k n + 1 , U j , k 1 n + 1 , U j , k n } by using (35a) for j = 1 , , M . (Similarly, if the sign of a j , k and b j , k is one of other three cases, the corresponding formula in (35) is used.)

It can be seen that the upwind difference schemes we have proposed in this work are easy to be implemented as well as are efficient. Especially, the implicit scheme (35)-(36) does not require any restriction between h and τ and can be implemented actually explicitly. So they are suited for the simulation of waves propagation in real-world application.

5. Numerical Experiment

In this section we give three numerical examples. In the first two examples, we consider two problems for which the exact solutions are given in order to verify the stability and convergence rate of the proposed schemes. In the third example, we consider a problem which is more realistic in sense that the initial data is nonsmooth and the exact solution is not given beforehand. The propagation performance of the wave is illustrated by using the proposed implicit upwind scheme.

Example 1. Consider the following initial-boundary value problem of two dimensional first-order hyperbolic problem:

( a ) u t + u x + u y = 0 , 0 < x , y 1 , 0 < t 1 , ( b ) u ( x , y , 0 ) = sin π x + sin π y , 0 x 1 , 0 y 1 , ( c ) u ( 0 , y , t ) = sin π ( t ) + sin π ( y t ) , 0 y 1 , 0 t 1 , ( d ) u ( x , 0 , t ) = sin π ( x t ) + sin π ( t ) , 0 x 1 , 0 t 1. (46)

The exact solution is u ( x , y , t ) = sin π ( x t ) + sin π ( y t ) .

Taking the space step h = 1 M and the time step τ = 1 N , the explicit and implicit upwind schemes proposed in this paper are respectively used to solve problem (46). The discrete l 2 norm is defined as U n = { j , k = 0 M h 2 ( U j , k n ) 2 } 1 2 .

Firstly, we consider the explicit upwind scheme. According to the Theorem 2.1, the stability condition of the explicit upwind scheme for (46) is r = s = τ h 1 2 . The l -error and l 2 -error and the convergence order of the explicit upwind scheme when r = s = 1 3 and r = s = 1 2 are presented in Table 1 and Table 2, respectively. It can be seen from the results that the scheme is stable when r = s 1 2 and the convergence rate of the scheme is first order.

Table 1. Errors and convergence order of explicit upwind scheme with r = s = 1 3 .

Table 2. Errors and convergence order of explicit upwind scheme with r = s = 1 2 .

The l -error and l 2 -error of the explicit upwind scheme when r = s = 1 are presented in Table 3. It can be seen from the results that the scheme is unstable for r = s = 1 > 1 2 , which verifies that the explicit upwind scheme is conditionally stable. The plots of convergence order for the explicit upwind scheme with r = s = 1 3 and r = s = 1 2 are presented in Figure 1. Surface plots of the exact solution and the numerical solution with r = s = 1 3 are presented in Figure 2 and Figure 3.

Next, we consider the implicit upwind scheme. The l -error and l 2 -error and the convergence order of the implicit scheme when r = s = 1 are shown in Table 4. The results show that the implicit upwind scheme is unconditional stable and converges at a rate of first order. The plots of convergence order of the implicit scheme are given in Figure 4. Surface plots of the exact solution and the numerical solution with r = s = 1 are presented in Figure 5 and Figure 6.

Example 2. In this example, we consider the following initial-boundary value problem of two-dimensional first-order hyperbolic equation with variable coefficients:

(a)(b)

Figure 1. Convergence order of explicit scheme for Example 1. (a) r = s = 1 3 ; (b) r = s = 1 2 .

Figure 2. Exact solution with h = 1 2 5 .

Figure 3. Solution of explicit upwind scheme with h = 1 2 5 .

Figure 4. Convergence order of implicit scheme for Example 1.

Figure 5. Exact solution with h = 1 2 5 .

Figure 6. Solution of implicit upwind scheme with h = 1 2 5 .

Table 3. Errors of explicit upwind scheme with r = s = 1 .

Table 4. Errors and convergence order of implicit upwind scheme with r = s = 1 .

( a ) u t + sin ( x ) u x + sin ( y ) u y = sin ( x ) sin ( y ) [ cos ( t ) + sin ( t ) cos ( x ) + sin ( t ) cos ( y ) ] , 0 < x , y π , 0 < t 1 , ( b ) u ( x , y , 0 ) = 0 , 0 x π , 0 y π , ( c ) u ( 0 , y , t ) = 0 , 0 y π , 0 t 1 , ( d ) u ( x , 0 , t ) = 0 , 0 x π , 0 t 1 , (47)

where the exact solution is u ( x , y , t ) = sin ( t ) sin ( x ) sin ( y ) .

Taking the space step h = π M and the time step τ = 1 N , the explicit and implicit upwind schemes proposed in this paper are respectively used to solve problem (47).

Firstly, we consider the explicit upwind scheme. According to Theorem 2.1, the condition under which the explicit upwind scheme of (47) is stable is τ h 1 2 . The l -error and l 2 -error and the convergence order of the explicit upwind scheme when τ h = 1 2 π and τ h = 1 π are presented in Table 5 and Table 6, respectively. It can be seen from the results that the scheme is stable when τ h 1 2 and the convergence rate of the scheme is first order. The l -error and l 2 -error of the explicit upwind scheme when τ h = 2 π are presented in Table 7. It can be seen from the results that the scheme is unstable for τ h = 2 π > 1 2 , which verifies that the explicit

upwind scheme is conditionally stable. The plots of convergence order of the explicit scheme with τ h = 1 2 π and τ h = 1 π are displayed in Figure 7. Surface plots of the exact solution and the numerical solution with τ h = 1 2 π are presented in Figure 8 and Figure 9.

Table 5. Errors and convergence order of explicit upwind scheme with τ h = 1 2 π .

(a)(b)

Figure 7. Convergence order of explicit scheme for Example 2. (a) τ h = 1 2 π ; (b) τ h = 1 π .

Figure 8. Exact solution with h = 1 2 5 .

Figure 9. Solution of explicit upwind scheme with h = 1 2 5 .

Table 6. Errors and convergence order of explicit upwind scheme with τ h = 1 π .

Table 7. Errors of explicit upwind scheme with τ h = 2 π .

Next, we consider the implicit upwind scheme. The l -error and l 2 -error and the convergence order of the implicit upwind scheme when τ h = 1 π are shown in Table 8. The results show that the implicit upwind scheme is unconditional stable and converges at a rate of first order. The plots of convergence order of the implicit scheme are displayed in Figure 10. Surface plots of the exact solution and the numerical solution with τ h = 1 π are presented in Figure 11 and Figure 12.

Example 3. We consider the following initial-boundary value problem of two-dimensional first-order hyperbolic equation with variable coefficients:

Figure 10. Convergence order at net ratios τ h = 1 π .

Figure 11. Exact solution with h = 1 2 5 .

Figure 12. Solution of implicit upwind scheme with h = 1 2 5 .

( a ) u t + sin ( π x ) u x + sin ( π y ) u y = 0 , 0 < x , y 1 , 0 < t 1 , ( b ) u ( x , y , 0 ) = { 2 π , x 2 + y 2 1 , 0 x , y 1 , π , otherwise , ( c ) u ( 0 , y , t ) = 2 π , 0 y 1 , 0 t 1 , ( d ) u ( x , 0 , t ) = 2 π , 0 x 1 , 0 t 1. (48)

Table 8. Errors and convergence order of implicit upwind scheme with τ h = 1 π .

Notice that in (48) the initial function is nonsmooth and the exact solution is not given beforehand. So it is more realistic. We study the wave propagation by using the implicit upwind scheme proposed in this paper.

Taking space step h = 1 M and time step τ = 1 N with M = 2 5 and N = M , we present the numerical solution at different times in Figure 13. We can see from Figure 13 that the wave propagates to left stably.

(a)(b)(c)(d)(e)(f)

Figure 13. The numerical solution at different time t. (a) t = 0.000; (b) t = 0.2188; (c) t = 0.4063; (d) t = 0.5938; (e) t = 0.7813; (f) t = 1.0000.

6. Conclusions

The upwind difference method is based on the direction of the flow and so can provide efficient simulation of wave propagation in real world. In this paper, we applied this method to solve the two-dimensional first-order hyperbolic equation with variable coefficients, constructing full-discrete explicit and implicit upwind difference schemes, respectively. We illustrated that both schemes are easy to be implemented in practice. By using the local fixed coefficient method and maximum technique, we proved the conditional stability of the explicit scheme and the unconditional stability of the implicit scheme, respectively. In addition, we derived the optimal first-order convergence of these schemes both in space and time. The efficiency of our schemes is presented theoretically as well as numerically through a few examples.

Since the method of this work is of first order both in space and time, we can consider the high-order upwind difference method for two-dimensional first-order hyperbolic equations with variable coefficients in the future, such as the compact difference method. Also, the extension of the method of this work to three-dimensional problems is also under consideration.

Acknowledgements

The authors would like to thank editors and referees for their valuable advice for the improvement of this article.

Funding

The work is supported by Shandong Provincial Natural Science Foundation, China (ZR2017MA020).

Cite this paper: Sun, Y. and Yang, Q. (2021) Numerical Analysis of Upwind Difference Schemes for Two-Dimensional First-Order Hyperbolic Equations with Variable Coefficients. Engineering, 13, 306-329. doi: 10.4236/eng.2021.136023.
References

[1]   Li, R.H., Chen, Z.Y., Wu, W., et al. (2000) Generalized Difference Methods for Differential Equations. Marcel Dekker Inc., New York.
https://doi.org/10.1201/9781482270211

[2]   Evans, L.C. (2010) Partial Differential Equations. American Mathematical Society, Providence, Rhode Island.
https://doi.org/10.1090/gsm/019

[3]   Thomas, J.W. (1997) Numerical Partial Differential Equations: Finite Difference Methods. Springer-Verlag, Berlin.

[4]   Li, R.H. and Liu, B. (2009) Numerical Solution of Differential Equation. Higher Education Press, Beijing.

[5]   Garg, N.K., Kurganov, A., Liu, Y., et al. (2021) Semi-Discrete Central-Upwind Rankine-Hugoniot Schemes for Hyperbolic Systems of Conservation Laws. Journal of Computational Physics, 428, 110078.
https://doi.org/10.1016/j.jcp.2020.110078

[6]   Zhao, Z., Zhu, J., Chen, Y.B., Qiu, J.X., et al. (2019) A New Hybrid WENO Scheme for Hyperbolic Conservation Laws. Computers and Fluids, 179, 422-436.
https://doi.org/10.1016/j.compfluid.2018.10.024

[7]   Zhao, Z., Chen, Y.B., Qiu, J.X., et al. (2020) A Hybrid Hermite WENO Scheme for Hyperbolic Conservation Laws. Journal of Computational Physics, 405, 109175.
https://doi.org/10.1016/j.jcp.2019.109175

[8]   Kurganov, A., Petrova, G., Popov, B., et al. (2007) Adaptive Semidiscrete Central-Upwind Schemes for Nonconvex Hyperbolic Conservation Laws. Siam Journal on Scientific Computing, 29, 2381-2401.
https://doi.org/10.1137/040614189

[9]   Kurganov, A. and Petrova, G. (2009) Central-Upwind Schemes for Two-Layer Shallow Water Equations. Siam Journal on Scientific Computing, 31, 1742-1773.
https://doi.org/10.1137/080719091

[10]   Schncke, G., Krais, N., Bolemann, T., Gassner, G.J., et al. (2020) Entropy Stable Discontinuous Galerkin Schemes on Moving Meshes for Hyperbolic Conservation Laws. Journal of Scientific Computing, 82, 69.
https://doi.org/10.1007/s10915-020-01171-7

[11]   Fan, X.F. (2015) High-Order Difference Schemes for the First-Order Hyperbolic Equations with Variable Coefficients. Master’s Dissertation, Southeast University, Nanjing.

[12]   Chen, L. and Ma, H.P. (2013) Dissipative Spectral Element Method for First-Order Linear Hybperbolic Equation. Communication on Applied Mathematics and Computation, 27, 491-500.

 
 
Top