• Aucun résultat trouvé

Example 1: Wave equation with a constant coefficient – a standing wave

5 Numerical experiments

5.1 Example 1: Wave equation with a constant coefficient – a standing wave

K

+ (aqnh,∇ψ)K −(a+(qn)+h ·ν, ψ)∂K = 0, (4.14) (qnh,φ)K+ (aunh,∇ ·φ)K −((unh), aφ·ν)∂K =−(unh∇a,φ)K, (4.15) and the corrector step

vh = uh −2unh +un−1h

∆t2 , (4.16)

(wh,φ)K + (avh,∇ ·φ)K−((vh), aφ·ν)∂K =−(vh∇a,φ)K, (4.17) (un+1h , ψ)K = (u, ψ)K +∆t4

12 (awh,∇ψ)K− ∆t4

12 (a+(w)+h ·ν, ψ)∂K = 0, (4.18) for all test functions ψ ∈Vhk and φ∈Σkh.

5 Numerical experiments

5.1 Example 1: Wave equation with a constant coefficient – a standing wave

5.1.1 Accuracy test in Qk space

We consider the 2D wave equation with a constant coefficient, which is taken to be 1, utt =∇2u, (x, y)∈[0,2]×[0,2], (5.1) with initial condition

u(x, y,0) = sin(πx) sin(πy), ut(x, y,0) = 0,

and periodic boundary conditions u(0, y, t) = u(2, y, t) and u(x,0, t) = u(x,2, t), for all 0≤x≤2,0≤y≤2 and t≥0.

This problem has the exact solution, which is a standing wave u(x, y, t) = cos(√

2πt) sin(πx) sin(πy).

Table 5.1: Example 1 with Q1 space: numerical errors and orders with uniform meshes.

N error of u error of ux error of uy

L2 error order L2 error order L2 error order

10 4.9405E-03 1.3059E-02 1.3059E-02

20 1.2323E-03 2.0033 6.7050E-03 0.9617 6.7050E-03 0.9617 40 3.1303E-04 1.9770 2.2976E-03 1.5451 2.2976E-03 1.5451 80 7.7676E-05 2.0108 3.7983E-04 2.5967 3.7983E-04 2.5967 160 1.9396E-05 2.0017 7.5453E-05 2.3317 7.5453E-05 2.3317

We implemented the LDG method with the alternating fluxes (2.17) and use the time inte-grator (4.11) with time step ∆t= 0.2/(∆x45 + ∆y45). Since the symplectic time integrator requires initial conditions for two time steps, we consider Taylor expansion ofu at t= 0:

u(x, y,∆t) =u(x, y,0) + ∆tut(x, y,0) +∆t2

2 utt(x, y,0) + ∆t3

6 uttt(x, y,0) +O(∆t4), and convert the higher derivatives of t to derivatives of x and y by repeatedly using the wave equation, while u and ut are given by the initial conditions. To obtain the desired order of convergence of u, following the initial conditions (3.10), we take the projection Ph+ of u(x, y,0), and L2 projection Ph of ut(x, y,0). In other words, with u(x, y,0) denoted by u0 and ut(x, y,0) by v0, we use the initial conditions:

u0h = Phu0, (5.2)

u1h = u0h+ ∆tPhv0+∆t2

2 Ph{(∂xx+∂yy)u0}+ ∆t3

6 Ph{(∂xx+∂yy)v0}. (5.3) Tables 5.1 – 5.3 list the numerical errors and the orders of convergence for Qk spaces, k = 1,2,3. In each table, the L2-norm of the errors eu, ep, and eq at the final time T = 1 are presented. The (k+ 1)th order for all the errors of u, p, q can be observed clearly.

5.1.2 Accuracy test in Qk space with standard L2 projections for initial condi-tions

To show that the special projections of the initial condition u0 in (5.2) is indeed critical for optimal rate of convergence, we test the problem with the same setting, but with standard L2 projections for both u0 and v0. Tables 5.4 – 5.5 list the numerical errors and the orders

Table 5.2: Example 1 with Q2 space: numerical errors and orders with uniform meshes.

N error of u error of ux error of uy

L2 error order L2 error order L2 error order

10 2.7279E-04 1.7387E-03 1.7387E-03

20 3.2450E-05 3.0715 1.7662E-04 3.2993 1.7662E-04 3.2993 40 4.1196E-06 2.9776 2.5073E-05 2.8164 2.5073E-05 2.8164 80 5.1406E-07 3.0025 2.5418E-06 3.3022 2.5418E-06 3.3022 160 6.4271E-08 2.9997 3.4971E-07 2.8616 3.4971E-07 2.8616

Table 5.3: Example 1 with Q3 space: numerical errors and orders with uniform meshes.

N error of u error of ux error of uy

L2 error order L2 error order L2 error order

10 1.2053E-05 5.3347E-05 5.3347E-05

20 7.8368E-07 3.9430 4.0172E-06 3.7311 4.0172E-06 3.7311 40 5.0864E-08 3.9455 2.2137E-07 4.1817 2.2137E-07 4.1817 80 3.3455E-09 3.9264 1.2105E-08 4.1928 1.2105E-08 4.1928

of convergence for Q1 and Q2 spaces. We can observe that the order of accuracy for u, ux

and uy is oscillating. When Q2 space is used, the accuracy of ux and uy is close to 2, which means only suboptimal convergence rate is obtained. This oscillating behavior of numerical accuracy is commonly observed for energy conserving methods, and a least square fitting of the order [44] may give the optimal convergence rate of u. We notice that in Subsection 5.1.1, different initial conditions are employed and optimal convergence rates are clearly observed there. Previous studies on LDG methods showed that different choices of initial conditions have little impact on the convergence/superconvergence results [11, 37, 32]. This test demonstrates that our energy conserving method is more sensitive to the error in the initial conditions, probably due to the fact that no numerical dissipation is included in these methods to dissipate the initial error.

5.1.3 Accuracy test in Pk space

We consider the same problem and setup, but replace the DG spaces by Pk, which is the polynomial space that has degree at most k, namely, {P

i,jxiyj : i, j ∈ N, i +j ≤ k}. According to extensive numerical experiments in previous works, (k+ 1)-th order accuracy

Table 5.4: Example 1 with Q1 space and L2 projections of the initial conditions: numerical errors and orders with uniform meshes.

N error of u error of ux error ofuy

L2 error order L2 error order L2 error order

10 2.8467e-03 1.0048e-01 1.0048e-01

20 2.4944e-03 0.1906 1.4448e-01 -0.5240 1.4448e-01 -0.5240 40 1.0608e-03 1.2335 6.6667e-02 1.1158 6.6667e-02 1.1158 80 1.7083e-04 2.6345 1.7039e-02 1.9681 1.7039e-02 1.9681 160 2.3920e-05 2.8363 1.2683e-02 0.4259 1.2683e-02 0.4259 160 6.5615e-06 1.8661 1.3186e-03 3.2658 1.3186e-03 3.2658

Table 5.5: Example 1 with Q2 space and L2 projections of the initial conditions: numerical errors and orders with uniform meshes.

N error of u error of ux error of uy

L2 error order L2 error order L2 error order

10 7.7825e-04 1.7934e-02 1.7934e-02

20 7.0800e-05 3.4584 4.7146e-03 1.9275 4.7146e-03 1.9275 40 1.1093e-05 2.6741 1.0602e-03 2.1528 1.0602e-03 2.1528 80 9.9096e-07 3.4847 2.4853e-04 2.0928 2.4853e-04 2.0928 160 1.4768e-07 2.7464 7.0811e-05 1.8114 7.0811e-05 1.8114

can usually be observed for the Pk space. Since the space Pk is smaller than Qk, using Pk will be more efficient in order to obtain (k+ 1)-th order accuracy. However, theoretically it is very difficult to prove the optimal order of accuracy forPkspace, and therefore in this paper, we only perform numerical experiments. As for the initial conditions, we simply project the initial conditions (5.2)-(5.3), which is defined inQk, to space Pk.

The orders of accuracy with spacesP1, P2 and P3 are shown in Tables 5.6 – 5.8. ForP1, second order accuracy can be observed in all the variables u, pand q. However, for P2 and P3, (k+ 1)-th order can be achieved in u, but onlyk-th order of accuracy is seen in pand q.

This loss of accuracy inpand qmay be resulted from the initial projection (5.2)-(5.3), which has been shown essential for the Qk space, but appears not to produce the same optimal order of accuracy for the Pk space.

Table 5.6: Example 1 with P1 space: numerical errors and orders with uniform meshes.

N error of u error of ux error of uy

L2 error order L2 error order L2 error order

10 1.2736e-02 6.3328e-02 6.3328e-02

20 3.1285e-03 2.0254 1.8352e-02 1.7869 1.8352e-02 1.7869 40 7.8996e-04 1.9856 5.6663e-03 1.6955 5.6663e-03 1.6955 80 1.9682e-04 2.0049 1.1306e-03 2.3253 1.1306e-03 2.3253 160 4.9184e-05 2.0006 2.5818e-04 2.1306 2.5818e-04 2.1306

Table 5.7: Example 1 with P2 space: numerical errors and orders with uniform meshes.

N error of u error of ux error of uy

L2 error order L2 error order L2 error order

10 2.6763e-03 7.6128e-02 7.6128e-02

20 2.0342e-04 3.7177 1.2275e-02 2.6327 1.2275e-02 2.6327 40 4.7780e-05 2.0900 4.2500e-03 1.5302 4.2500e-03 1.5302 80 6.3518e-06 2.9112 1.1668e-03 1.8649 1.1668e-03 1.8649 160 8.0589e-07 2.9785 2.9819e-04 1.9683 2.9819e-04 1.9683

Table 5.8: Example 1 with P3 space: numerical errors and orders with uniform meshes.

N error of u error of ux error of uy

L2 error order L2 error order L2 error order

10 1.5827e-04 3.9745e-03 3.9745e-03

20 1.2081e-05 3.7116 8.3389e-04 2.2528 8.3389e-04 2.2528 40 8.6623e-07 3.8018 7.7308e-05 3.4312 7.7308e-05 3.4312 80 3.0307e-08 4.8370 1.2469e-05 2.6323 1.2469e-05 2.6323 160 2.0657e-09 3.8749 1.1613e-06 3.4245 1.1613e-06 3.4245

Table 5.9: Example 1 with Qk and central flux: numerical errors and orders for u with uniform meshes, forQ1, Q2 and Q3.

N Q1 Q2 Q3

L2 error order L2 error order L2 error order

10 2.8446e-02 1.9582e-04 7.5838e-05

20 1.1325e-02 1.3287 1.8994e-05 3.3659 6.0140e-06 3.6565 40 5.1048e-03 1.1496 2.5060e-06 2.9221 8.1456e-07 2.8842 80 2.4699e-03 1.0474 2.9755e-07 3.0742 1.0012e-07 3.0243 160 1.2234e-03 1.0136 3.7259e-08 2.9975 1.2413e-08 3.0118 5.1.4 Accuracy test with central flux in the Qk space

While claiming that the advantage of using alternating flux as proposed in this paper is to conserve energy, it is arguable that in (2.6), (2.15) and (2.16) using the central flux

aqch1 ={{aqh}}, cuh ={{uh}}, and

aqfh2 ={{aqh}}, fuh ={{uh}},

where {{u}} = u+u2 +, may also conserve energy, as is known when applied for first order hyperbolic equations. However, a well-known disadvantage of central flux is its order of accuracy oscillates, depending on if k is even or odd. Here we implement the LDG scheme, with central flux and show that the order of accuracy indeed oscillates (Table 5.9): the order for even k is k + 1 and the order for odd k is k. Therefore it is not an optimal energy preserving method to use for any desired order of accuracy.

5.1.5 Time history of the L2 error

To demonstrate that the growth of the L2 error of our proposed method is at most linear, as proved in Section 3, we simulate the problem in Example 1 until T = 100 and monitor the L2 error. When a 40×40 uniform mesh is used, it can be seen in Fig. 5.1 (upper panel) that the L2 error stays at the level of 10−5 for Q2 and 10−7 for Q3, and the average values do not grow noticeably in time. As we reduce the resolution by using a 5×5 uniform mesh, the growth of errors can be seen to be bounded linearly. We also simulated with the central

0 20 40 60 80 100

Alternating Flux, Q2, N=5

0 200 400 600 800 1000

Figure 5.1: Example 1 with Qk space. Upper panel: time history until T = 100 of the L2 error of the numerical approximations obtained from using the alternating flux (red) and central flux (blue), withk = 2,3. A uniform 40×40 grid is used. TheL2 error ofu ony-axis are presented in log scale. Lower panel: A uniform 5×5 grid is used to observe the growth of errors until T = 1000. History of L2 errors for central flux and alternating flux with Q2 space are shown at left and right in linear scale, respectively.

flux for Q2 and Q3. Since the central flux also preserves energy, the L2 error also remains roughly constant in average if a 40×40 uniform mesh is used. However, due to the nature of the oscillating order of accuracy, the L2 error for Q2 is comparable to that of alternating flux, but the error for Q3 is much higher than using alternating flux. Moreover, if Q2 space and a coarse 5×5 mesh are used, the growth of the errors for central flux is much faster than that for alternating flux (lower panel of Fig. 5.1).

5.2 Example 2: Wave equation with a constant coefficient – a

Documents relatifs