Académique Documents
Professionnel Documents
Culture Documents
Abstract In the context of systems of nonlinear conservation laws it can be crucial to use adaptive grids in order to correctly simulate the singularities of the solution over long time ranges while keeping the computing time within acceptable bounds. The adaptive space grid must vary in time according to the local smoothness of the solution. More sophisticated and recent methods also adapt the time step locally to the space discretization according to the stability condition. We present here such a method designed for an explicit-implicit Lagrange projection scheme, addressing physical problems where slow kinematic waves coexists with fast acoustic ones. Numerical simulations are presented to validate the algorithms in terms of robustness and eciency.
keywords: Hyperbolic PDE, Time varying adaptive grid, Local Time Stepping, implicitexplicit
1 Introduction
Our scope of interest is the accurate numerical simulation of highly nonlinear conservative laws. The solutions of such systems of PDEs exhibit localized and moving singularities which require costly numerical schemes. At the same time realistic applications often require simulation of the phenomenon on very long time range. As developed in [1], we are interested in multiphase ows applications presenting the particularity of two scale wavelengths: a slow kinematic one which is the phenomenon of interest for the engineers, and fast acoustic waves arising from the highly nonlinear physics. This will induce very small time steps when treated explicitly. This discrepancy between kinematic and acoustic speeds can be advantageously dealt with in a Lagrangian projection formulation, as detailed in [10, 9]. This allows to resolve the acoustic part of the solution with an implicit scheme, therefore relaxing the time step bound. The kinematic components are solved explicitly, ensuring in turn the required precision.
Laboratoire Jacques-Louis Lions, CNRS et Universit Pierre et Marie Curie, B.C. 187, 75252 Paris e Cedex 05, France D partement Math matiques Appliqu es, Institut Francais du P trole, 1 et 4 avenue de Bois-Pr au, e e e e e 92852 Rueil-Malmaison Cedex, France
This setup is a very good candidate for adaptive methods, such as the one introduced by Harten in the 1990s [14], which was specially designed for the speed-up of nite volume schemes. The gist of the method consists in analyzing the smoothness of the solution by performing a wavelet-like transformation. In the context of nite volume schemes this relies on a dyadic hierarchy of discretizations. The size of the coecients in the multiscale basis is tested against a threshold parameter. This information on the local smoothness of the solution can be used in several manners. It can trigger dierent numerical schemes, like limited non linear and costly uxes in the vicinity of singularities and linear high order cheaper uxes in smooth areas. It can also be used to design an adaptive grid by locally selecting the coarsest level of discretization beyond which the coecients are negligible. The adaptive grid must evolve at each time step in order to follow the displacement of the singularities of the solution. This evolution strongly relies on the hyperbolic nature of the equations that ensures a nite speed of propagation. The time step is monitored by the smallest space grid step and the CFL-like stability condition. Design and study of fully adaptive scheme can be found in [7, 16]. Use of the multiresolution technique is described at length in [12] and [1] and is also implemented in the Lagrangian case in [10, 11]. Simulations exhibits that it can signicantly speed-up the computation. The goal of the present paper is to describe a further enhancement to the multiresolution technique: the local time stepping. Numerical schemes designed on non uniform moving or xed grids can be sped up by using dierent time steps in dierent areas of the grid, according to the local mesh size. First developments in this direction can be found in [19] for xed non-uniform grid just before the development of Adaptive Mesh Renement technique in [5, 4]. In the context of the multiresolution technique previously described, it has been developed and implemented for one-dimensional scalar conservation laws in [17] and extended to the two-dimensional shallow water equations in [15], with promising CPU time gains. A macro time step, t for the coarsest level of discretization, is subdivided into intermediate time steps. At a given intermediate time step, the solution is updated only on cells belonging to the current synchronization level or ner. Transition zones are dened in order to deal with the synchronization of the solution at the border between consecutive levels of discretization. Straightforward application of this method to our system of PDEs in the explicit scheme case, was rst presented in [11]. It is now extensively tested for robustness and performances in this paper. We also endeavor here to adapt the local time stepping idea to our semi-implicit scheme, where two wave speeds interplay in the sense that fast acoustic waves are treated implicitly with a CFL condition number much larger than one, and kinematic waves are treated explicitly, with a time step verifying a standard CFL condition with a CFL number less than one. The resulting scheme departs from the original one in [17] and will be described in details. The implicit version of the local time stepping algorithm presented in [17], or an alternative to it described by the same authors in [18] cannot be readily applied to our problem where we have to deal with transient fast acoustic waves. In particular, the prediction of the adaptive grid from one time step to the next needs to take into account the fast wave speed. Another originality of our setup is the splitting of our operator into a Lagrangian step and an Euler projection step which requires some extra synchronization during the time integration. We rst present the model equations and the numerical algorithms on a xed non 2
uniform grid. The next section summarizes the multiresolution setup and its application to a nite volume scheme, as described at length in [12, 1]. The section 4 is devoted to the local time stepping enhancement in the case of the explicit scheme. This part makes full use of the notations established in [17]. The semi-implicit scheme, which requires a new approach, is treated at last in section 5. Numerical simulations are described in sections 4.3 and 5.2. They allow to compare the eciency of the dierent schemes with and without local time stepping, in term of accuracy and computing time.
(2.1)
The thermodynamical closure law P(, Y) appearing in (2.1) can be in real applications very costly to evaluate, and should satisfy c2 (V) = P(, Y)|Y > 0. Under this assumption, the system (2.1) is hyperbolic with three distinct eigenvalues u c < u < u + c. The intermediate eigenvalue corresponds to the slow transport wave and is linearly degenerated, the remaining ones are much bigger and correspond to genuinely nonlinear acoustic waves. Improving the previous numerical treatments of the system (2.1), the scheme we use here ensures the positivity of the density and physical bounds on the gas mass fraction. It can be expressed as a ux scheme, which makes local time stepping techniques applicable. The main idea consists in decomposing the ux in an acoustic part, associated with the genuinely nonlinear waves, and a transport part, associated to the linearly degenerated waves. This is introduced for instance in [13] using Lagrangian coordinates for gas dynamics and detailed in [10, 9] in the case of our more involved 3
relaxed system of equations. Eventually the Lagrange step where we deal with the acoustic part of the ux will be treated implicitly, which will enable us to use a larger time step, basically driven by the transport phenomenon, which will still be treated explicitly for better accuracy. We will rst present the explicit version of the scheme, for which we adapt the local time stepping enhancement proposed by M ller et al [17]. u
2.1 Discretization
The Lagrange-Projection splitting is performed at the numerical level in a two-step scheme which we present in this section without the intermediate details for which we refer to [10, 9]. We discretize the domain in J cells j = [x j1/2 , x j+1/2 ] of size x j , such that L = J1 x j and of center x j = (x j1/2 + x j+1/2 )/2 for j = 0, . . . , J 1. j=0 We denote by Vn = n (1, Y n , un ) the numerical solution on cell j at time n and by j j j j Vn = n (1, Y n , un ) the numerical solution at the end of the Lagrange step. j j j j 2.1.1 Explicit scheme
n where denotes the co volume 1/ and un j+1/2 and P j+1/2 are the solution of the Rien and Vn mann problem between states V j j+1
Explicit Euler scheme for the Lagrange step gives n n n un n j j+1/2 u j1/2 j j t x j Y n Y n j n j j t un un Pn n n j j j+1/2 P j1/2 + j t x
j
= 0, = 0 = 0, (2.2)
In (2.3), an is a stabilizing coecient coming from the relaxation formulation of problem (2.1) as described in [2, 9]. It is set globally for all cells at each time step by the Whitham condition a2 > n
j=0,...,J1
n P j+1/2 = n u j+1/2 =
Pn + Pn j j+1 2 un + un j j+1 2
an
un un j j+1
2 Pn Pn j j+1 2an
, (2.3)
max P(n , Y n ). j j
(2.4)
The Euler projection step advects the conservative state Vn with the edge velocities un 1 . Combining the two steps together provides the locally conservative ux formulation Vn+1 = Vn j j t Fn Fn 1 , j 2 x j j+ 1 2 4 (2.5)
j 2
(2.6)
In the above denition of the uxes, the superscript (.)+ (respectively (.) ) denotes the positive (respectively negative) part. We will admit here the following theorem (see [13] and [8]) Theorem 2.1. Suppose that condition (2.4) is satised and that t min
j
(2.7)
Then, if n > 0 and 0 Y n 1 for all j = 0, . . . , J 1, the solution of (2.5) satises j j n+1 > 0 and 0 Y n+1 1 for all j = 0, . . . , J 1. j j 2.1.2 Implicit scheme
The semi-implicit version of the Lagrange-Projection scheme has been derived in [10, 9] and we merely recall the important steps here. Implicitation of the Lagrange step leads to n n un un n j j+1/2 j1/2 j j = 0, t x j Y n Y n j (2.8) n j j = 0, t un un Pn Pn n j j j+1/2 j1/2 j + = 0, t x
j
We replace P j+1/2 and u j+1/2 in (2.8) by their expressions (2.9) and obtain a system for n , un and Pn . We then eliminate this last unknown, by implicitating the equilibrium j j j at the end of the Lagrange state Pn = P(n , Y n ) and by replacing all (P ) j by a global j j j lower bound an 2 dened by (2.4), so that Pn = Pn an 2 (n n ). j j j j Introducing auxiliary unknowns dened by ,n 1 C j = 2 un an n , j j +,n n n C 1 = 2 u j + an j , j 5 (2.10)
an
un un j j+1 2 2an .
, (2.9)
Pn Pn j j+1
(2.11)
where
some straightforward algebra leads eventually to the following system +,n C j1 0 1 + a n a n +,n = S +,n C j n j n j j +,n C j+1 ,n C j1 an n 1 + an n 0 C ,n = S ,n j j j j ,n C j+1 n = j t x j n j
(2.12)
(2.13)
Pn + an 2 n Pn an 2 n . (2.14) j j j1 j1 2 We impose here non reective boundary conditions, adequate to treat initial value ,n ,n problems. We will set C1 = C0 in the rst equation for the lower bidiagonal system, and C J = C J1 in the upper bidiagonal system. The Euler projection step computes the conservative state at time n + 1: Vn+1 = Vn j j where F j1/2 = 0, 0, P j1/2 Introducing the coecients
n m
j n, n T +,n +,n
S ,n = C n j j
(2.15)
(2.16)
= min n , wk
= min wn , k
k= j k=0 J1
n m
j
where
wn = Pn + an un , j j j wn = Pn an un j j j
(2.17)
we have the following theorem (see [9]) Theorem 2.2. If n > 0 and 0 Y n 1 for all j = 0, . . . , J 1 and if we impose j j condition (2.4), and the following CFL condition on the time step t = maxJ1 max j=0 2an x
n 0, M j
(2.18)
then the scheme (2.15) has a unique solution which satises n+1 > 0 and 0 Y n+1 1 j j for all j = 0, . . . , J 1. 6
Additionally to (2.18), we impose to the time step another bound depending solely on the fast acoustic wave speed, but with a CFL number CFLimp = 10 or even larger, in order to control the distortion of the acoustic waves. t CFLimp min
j
min(x j1 , x j ) . max(u j1 a j1 , u j + a j )
(2.19)
3 Adaptive multiresolution
It is well known that since the fast acoustic waves are treated implicitly, they are smoothed out very early in the computation (see [12]). The wave of interest which moves with the slow speed and is computed explicitly, may present on the other hand singularities that we want to compute as precisely as possible. It is of course natural to discretize the solution nely in the vicinity of these singularities and more coarsely elsewhere where it is smooth. In answer to this observation, we have adapted the multiresolution techniques devised for explicit schemes in [7] and based on ideas introduced in the context of systems of conservation laws by Harten [14] at the beginning of the nineties. The multiscale analysis of the solution is used to design an adaptive grid by selecting the correct level out of a hierarchy of nested grids according to the local smoothness of the solution. This non-uniform grid evolves with time, with a strategy based on the prediction of the displacement and formation of the singularities in the solution. The wavelet basis used to perform the multiscale analysis enables to reconstruct the solution at any time back to the nest level of discretization, within an error tolerance controlled by a threshold parameter. The coupling of multiresolution with the semi-implicit Euler relaxation scheme is detailed in [12] for the non-drift model and in [1] for the complete model with drift and friction. The adaptation of the method to the Lagrange projection scheme is straightforward. The important point for our present work is the enhancement to local time stepping. In the previous works [7, 12, 1] the time step is dictated by the size of the smallest cell in the adaptive grid which enters into a CFL stability condition. We rst describe how to adapt the local time stepping approach developed by M ller and Stiriba in [17] in the framework of u the explicit Lagrange projection scheme. The design of the local time stepping algorithm for the implicit version of the Lagrange projection method is the original part of this work and is described in details. First we briey recall in section 3.1 the basics of the multiresolution analysis. It is then used, in section 3.2, to monitor a time varying adaptive grid for a conservative nite volume scheme. Technical details and examples can be found in [16].
cell averaging from one grid to the coarser one, i.e., Vk1 = Pk1 Vk k with Vk1, j = 1 (Vk,2 j + Vk,2 j+1 ). 2 (3.1)
The inverse operator consists in recovering the mean values on grid level k, given the mean values on the coarser level k 1. This involves an approximation or prediction operator Pk which we dene here as k1 Vk = Pk Vk1 with k1
1 Vk,2 j = Vk1, j 8 (Vk1, j+1 Vk1, j1 ), Vk,2 j+1 = Vk1, j + 1 (Vk1, j+1 Vk1, j1 ). 8
(3.2)
The two vectors Vk and (Vk1 , Dk ) are of same length and we can use Dk along with Vk1 to recover Vk entirely. Iterating this encoding operation from the nest level down to the coarsest provides the multiscale representation MK = (V0 , D1 , . . . , DK ) = MVK . The indices of the multiscale representation MK vary in K = {[0, . . . , N0 ], [0, . . . , N0 ], . . . , [0, . . . , 2K1 N0 ]} The interest of the multiscale representation lies in the fact that the local regularity of the function is reected by the size of its details. We can use this property to compress the function in the multiscale domain by dropping all details smaller than a given threshold. To clarify this idea, we rst dene a threshold operator T acting on the multiscale representation M K , depending on a subset K of indices = (k, j), by T (D ) = 0 if , D otherwise. (3.4)
Given level-dependent threshold values = (k )k=0,...,K , and extending the notation D0 = V0 , we introduce the subset = (1 , , K ) := { s.t. |D | || }, where || = |(k, j)| = k. This completes the denition of the threshold operator T := T , and gives rise to an approximating operator A := M1 T M acting on the physical domain representation. In practice, we take advantage of the fact that the remaining ne-scale details will be concentrated near singularities. This is not such a trivial result because the operator A is nonlinear since depends on VK through the threshold scheme. We refer to [6] for a thorough investigation of nonlinear approximation and the proof of the main result
K | VK V | L1 < C, K with V = A VK ,
(3.5)
valid when k = 2kK . This allows us to dene an adaptive grid S where the local size of the cell will be the grid step corresponding to the nest non negligible detail. S = (k, j), k {0, . . . , K}, j {0, . . . , 2k N0 }, s.t. (k, j/2) and (k + 1, j) where j denotes the integer part of j. 8 } , (3.6)
The representation V of the solution on this adaptive grid is obtained from the K encoded multiscale representation M = T MVK by the following Algorithm 3.1 Partial decoding Starting from T MV on for level k = 1 K do if (k, j) then Vk,2 j using (3.2), compute Vk,2 j = Vk,2 j + Dk, j , Vk,2 j+1 = 2Vk1, j Vk,2 j . end if end for Note, in particular, that the representation by its mean value Vk, j on an intermediate level k does not mean that the function is locally constant on this cell of width 2k x, but simply that its mean values on the nest grid in this area can be recovered within the accuracy using the mean values on this intermediate level and the reconstruction operators Pl for l = k + 1, . . . , K. l1 The reverse transformation is performed as follow Algorithm 3.2 Partial encoding Starting from V on S for level k = K 1 0 do if (k + 1, 2 j) then Vk, j using (3.1), compute Dk+1, j = Vk+1,2 j Vk+1,2 j using (3.2). end if end for
The numerical ux Fn j+1/2 between cells K and K is computed using r values of j j+1 K, the solution on each side of the interface xK j+1/2 Fn j+1/2 = F Vn j+1r , . . . , Vn j, Vn j+1 , . . . , Vn j+r . K, K, K, K, K, (3.9)
In our case it will be dened by (2.6) or (2.16). Due to the nestedness of the dyadic grids, we can dene the numerical uxes on coarser levels k from the uxes dened at 9
the same location on ner scales Fn j1/2 = Fn j1/2 = . . . = Fn Kk j1/2 . k, k+1,2 K,2 Bn j = k, =
=2Kk j 2Kk ( j+1)1 2Kk 1
(3.10)
This allows us to dene the ux balances by induction for all levels k = 0, . . . , K by Fn j+1/2 Fn j1/2 = Fn Kk ( j+1)1/2 Fn Kk j1/2 k, k, K,2 K,2
2Kk ( j+1)1 n Fn K,+1/2 F K,1/2
=
=2Kk j
Bn K,
=
=0
Bn Kk j+ . K,2
(3.11)
After normalization by the step size 2 Kk x at level k, we can apply the same projection (3.1) and prediction (3.2) schemes on the ux balances as on the solution itself and we obtain the fully adaptive scheme in 1D as
n+1 V k, j = V n j k B n j , k, k,
(k, j) S
(3.12)
where k = 2kK K . The important point here is that the adaptive grid S must be adequate to represent the solution at both times n and n + 1. More specically, if we denote by n the graded tree obtained by applying A to Vn , then n can be inated K n+1 n+1 into containing as well as n , ensuring that estimation (3.5) is valid at both n+1 times n and n + 1 when using A = M1 Tn+1 M. Setting to K does the trick
n+1 but it is not very interesting in practice. The inated tree should be as small as n and Vn+1 was heuristically possible. An economical way to ensure (3.5) both for V described by Harten in [14]. In [7], we added some gradualness property, necessary to ensure computational eciency. n+1 Algorithm 3.3 Prediction of the adaptive grid Prediction: for level k = K 1 do if (k, j) n and Dk k then j n+1 (k, j + l) for l = s, . . . , s if Dk 2k then j n+1 (k + 1, 2 j) and (k + 1, 2 j + 1) end if end if end for Gradualness: for level k = K 1 do n+1 if (k, j) then for || g do n+1 (k 1, j/2 + ) end for end if end for
10
Let us comment on the choice of s and g: in Hartens strategy the number of cells added on each side of important details to account for displacement of the solution during one time step is s = 1, thanks to the CFL < 1 for explicit schemes. This is an important point of discussion in the extension of the adaptive algorithm to implicit schemes with CFL larger than one and the value of the parameter s has been discussed in [12]. It turns out that s = 1 remains valid in the semi-implicit case becasue the fast waves are severely damped out by the implicit scheme and can therefore be well represented at the coarser levels of discretization. Concerning the gradualness accounted for by the second step of algorithm 3.3, the multiresolution stencil should always be readily available in order to apply the reconstruction formula (3.2) so in our case g = 1. Below is the actual adaptive algorithm we implement Algorithm 3.4 Adaptive algorithm Initialization: encoding of the initial solution and denition of 0 for time step n = 0, . . . , N 1 do n+1 Prediction of using Algorithm 3.3. n+1 n+1 Partial decoding of Vn on S (derived from using (3.6)). n+1 Evolution of Vn to V on the adaptive grid S n+1 using (3.12). n+1 by partial encoding of Vn+1 . Denition of end for N Decoding of V on the nest grid S K . The evolution step of this algorithm can be implemented in several ways which have now been extensively studied and compared (see for instance [7] and [1]). We can now address the purpose of the present paper which is to couple the multiresolution algorithm with local time stepping.
11
2 t t 2x x
With these denitions, illustrated in gure 2,the evolution of the solution during a macro time step is performed in a loop on intermediate time steps (see Figure 3). At each intermediate time step i the solution is updated on all active cells belonging to levels k ki , using time step tk = t2Kk , except for the cells in the transition regions where a half time step is used. It is also updated on cells in the transition region of the immediately coarser level ki 1, using a half time step. (here 2Kki t). Thanks to the explicit nature of the scheme, and of the ux computation (2.6), we can use the conservation property depicted in Figure 4 to synchronize the solution in the manner detailed in the following algorithm
12
K1
C K1
CK l
Fig. 2. Denition of index set C K1 and C K , transition zone C K1 and ranges of dependence and m for the cells (K, ) and (K, m).
Algorithm 4.1 Synchronized time evolution for time step tn+i2L for each intermediate time step i = 1, . . . , 2K do Initialization for k = K ki do Update indices sets Ck , Ck end for Update uxes on cells that have been modied at previous time step: for levels k = K ki1 do n+1 for j s.t. (k, j) S do n+(i1)2K Compute Fk, j1/2 using (2.3-2.6) end for end for n+1 for (ki1 1, j) Cki1 1 s.t. (ki1 , 2 j 1) S do K n+(i1)2 Compute Fki1 1, j1/2 using (2.3-2.6) end for Time evolution for levels k = L ki do use full time step t k for (k, j) Ck do Vn+i2 k, j
K
n+(i1)2 = Vk, j
end for end for for levels k = L ki 1 do use half time step for (k, j) Ck do Vn+i2 k, j
K
n+(i1)2 = Vk, j
end for end for Elsewhere the solution remains unchanged end for
13
for || s
K
n+(i+1)2 (k + 1, 2 j) and (k + 1, 2 j + 1) end if end if end for 2. Gradualness: for levels k = K ki do n+(i+1)2K if (k, j) then
K
if (k 1, j/2 + ) n+i2 then n+(i+1)2K (k 1, j + ) for || g end if end if end for 3. for levels k = ki + 1 K do Check that we always have g cells at level k 1 between two sets of cells at level k. Otherwise rene to level k. end for end for for intermediate step i = 2K do Perform algorithm 3.3 with gradualness g. Perform step 3. end for The prediction s should be equal to the maximum displacement of a singularity in one time step. In the explicit case, it is therefore equal to 1 as in the standard multiresolution algorithm 3.3. We will see that for the semi implicit case, it is necessary to take into account the fast wave and assume a speed larger than 1. The gradualness parameter g must ensure the possibility of regriding and still preserve the transition 14
/2 t /2
/2 /2 /2 /2
Fig. 3. A three level adaptive grid with transition zones of width 1 represented with dotted lines. The intermediate step number is denoted by i = 1, . . . , 4, ki denotes the synchronization level. The red and green arrows indicate the uxes that are computed at the corresponding time step
n+1 V k,j2
n F k,j3/2
n V k,j2
n V k,j1
Fig. 4. Flux conservation at interface between level k and k + 1 implies 2Fn j1/2 = Fn j1/2 + Fn+1/2j1/2 . The solution Vn+1/2 is used to compute k, k+1,2 k+1,2 k, j1 Fn+1/2j1/2 k+1,2
This rule is illustrated in Figure 5 for speeds 1, 2 and 3. For each example, the predicted tree is represented at the beginning of the macro time step, with the single non negligible detail symbolized with a . Then the resulting adaptive grid S is represented at the dierent intermediate time steps, along with the progression of the singularity, marked with a . The dotted lines indicate the transitions zones.
t S x
a)
~
t S ~ x
b)
t S x
c)
~
Fig. 5. Grid prediction at intermediate time steps. indicates the tree at the beginning of the macro time step, with a single non negligible detail . The evolution of the adaptive grid S includes intermediate regriding every two intermediate time steps. The singularity is marked with a . The grid propagation speed is (a) s = 1, (b) s = 2, (c) s = 3.
respectively 0.2 and 0.4 and the speed is uniform and equal to 10m/s. The transport wave moves slowly toward the left at a speed 29m/s while two acoustic waves are visible on the density and speed components moving in opposite directions at roughly 263m/s and +238m/s. The pressure the law corresponds to a perfect gas and incompressible liquid P(, Y) = a2 g l Y . l (1 Y) (4.2)
Figure 6 displays the density eld obtained after 42s of propagation with the uniform, the multiresolution, and the local time stepping schemes. The grid has 5 levels of renement, which amounts to J = 4096 grid points on the smallest level of renement. We use a constant elementary time step on the nest level throughout the simulation, determined by taking the minimum time step during a previous uniform simulation. For the 4096 points simulations we use t = 0.0096s. The MR and LTS results are obtained with a threshold parameter = 0.005. The crosses for the multiresolution and circles for the local time stepping denote the level of renement used locally to discretize the solution. It is read on the right hand side vertical axis. In Figure 7 the range of abscissa is zoomed in in the three regions of interest. The quality of approximation of the transport wave is the same for the two algorithms. The local time stepping does a slightly better job than the standard multiresolution as far as the acoustic waves are concerned. This is because there are less projection steps performed and therefore less diusion. 16
560 540 520 500 480 460 440 420 400 380 360 0 10000 20000 x
Ini U MR tree
6 5 4 3 2 1 0 40000
560 540 520 500 480 460 440 420 400 380 360 0 10000 20000 x
6 5 4 3 2 1 0 40000
30000
30000
(a)
(b) Fig. 6. Density eld and grid renement at t = 42s, for = 0.005. (a) Explicit multiresolution scheme (MR) against uniform solution (U) on nest (5th ) level and initial solution (Ini) (b) Local time stepping (LTS) scheme. The symbols + and indicate the level of renement used locally, to be read on the right hand side vertical axis
To study the performance and the robustness of the algorithm we perform a parameter study. We test two discretizations: J = 4096 points on a hierarchy of 5 levels and J = 8192 with 6 levels. The range of the threshold goes from 0 to 102 . For each set of parameters we compute the solution at t = 42s with the three algorithms and calculate the relative error between the adaptive solution reconstructed on the nest level at the nal time and the solution computed on the uniform nest grid. The error is computed for the component which is sensitive to both transport and acoustic phenomena and for the gas mass fraction which sees only the transport eect.
J J
| j | j E1 ( ) =
j=0 J
|Y Y j | j , E1 (Y ) =
j=0 J
. |Y j |
(4.3)
| j |
j=0 j=0
We also compute the error with respect to a reference solution computed on a uniform mesh at the 9th level of discretization (on 65536 points), that is 8 times ner than the simulation on 8192 points. It will be considered as the exact solution.
J J
| j | j E1 ( ) =
re f j=0 J
|Y Y j | j , E1 (Y ) =
re f j=0 J
. |Y j |
(4.4)
| j |
j=0 j=0
In (4.4), j and Y j denote the average of the reference solution on the 8 or 16 cells covering cell j. In Figure 8 we display the graph of the error (4.3) with respect to the uniform solution on the nest level versus the threshold parameter. Both schemes (MR) and (LTS) converge with respect to the threshold parameter which corroborates the theoretical estimate (3.5). 17
560 540 520 500 480 460 440 420 400 380 360 14500 14700 x
6 5
4 3 2 1
530 525
6 5 4 3
520 515 510 1 505 14900 15100 0 15300 500 3000 4000 5000 x 6000 0 7000 2
(a)
400 395 390 385 380 375 370 22000
(b)
Ini U LTS MR tree LTS tree MR 6 5 4 3 2 1 0 30000
24000
26000 x
28000
(c) Fig. 7. Density eld and grid renement at t = 42s. Zoom on (a) transport wave, (b) left going acoustic wave (c) right going acoustic wave .
0.01
0.01
1e-06
1e-10
MR LTS 0.01
MR LTS 0.01
(a)
(b) Fig. 8. Convergence versus for 6 levels. Relative error with respect to the uniform solution on the 6th level(4.3) on (a) (b) Y, with the standard multiresolution (MR) and the local time stepping strategy (LTS)
In Figure 9 we notice that as expected, the error with respect to the reference solution (4.4) is bounded below by the error between the uniform solution on the 6th level and the reference solution. In Figure 10 we study the dependence between the precision and the speed of the algorithm, by displaying the relative errors between the adaptive and uniform grid 18
0.1
0.1
0.01
0.001
MR LTS 0.01
MR LTS 0.01
(a)
(b) Fig. 9. Convergence versus for 5 levels. Relative error with respect to the reference solution (4.4) on (a) (b) Y, with the standard multiresolution (MR) and the local time stepping strategy (LTS)
solutions as a function of the gain in computing time. The gain is the ratio between the computing time required for the uniform scheme on the nest level of discretization and the computing time required by the multiresolution (MR) or the local time stepping (LTS) scheme for a given threshold ratio. Each point on these curves corresponds to a dierent value of the threshold parameter . The best CPU gain are achieved for the highest value of , but also correspond to the highest error The CPU gain can be as high as 10 for a relative error of one per cent for the standard multiresolution and the local time stepping goes yet more than twice as fast for a given error level.
0.01
0.01
1e-06
1e-14
1e-14
(a)
(b) Fig. 10. Convergence versus CPU gain for 6 levels. Relative error with respect to uniform solution on (a) (b) Y.
In Figure 11 we display the error with respect to the reference solution, as a function of the CPU gain, for both the 4096 and 8192 points simulations. Here again, each point corresponds to a dierent value of . The CPU gain is computed with respect to the CPU for the uniform simulation on the 5th (respectively 6th ) level for the multiresolution (MR) and local time stepping (LTS) simulations on the 5 level-hierarchy (resp. 19
6 level-hierarchy). Both (MR) and (LTS) simulations converge to the error level of the uniform grid simulation when goes to 0 which is roughly 103 for 4096 points and 5.104 for 8192 points. Since the uniform simulation on 8192 points costs roughly 4 times as much as the one on 4096 points, all multiresolution simulations on the 6 level hierarchy which exhibit a CPU gain superior to 4 and an error below 103 are doing a better and faster job than the uniform simulation on the 5th level.
0.008 MR LTS MR LTS 5 5 6 6 Eref(Y) 0.008 MR LTS MR LTS 5 5 6 6
0.006 Eref()
0.006
0.004
0.004
0.002
0.002
0 0 10 20 30 CPU(unif)/CPU(adapt) 40
0 0 10 20 30 CPU(unif)/CPU(adapt) 40
(a)
(b) Fig. 11. Convergence versus CPU gain for 5 and 6 levels. Relative error with respect to reference solution on (a) (b) Y.
the level immediately coarser, forming the transition zone Cki 1 (of length r + 1 in number of cells at level ki 1 in Figure 12). We will see later that cells at the boundaries of the transition zone require a special treatment at the Euler projection step. To locate them more easily, we introduce the distances between a given cell (k, j) and a ner level k on its right and on its left dl (k, j, k ) = dr (k, j, k ) =
,(k , )Ck ,(k , )Ck
min
j2k k 1
,
+
(5.1) . (5.2)
min
( j + 1)2k k
The overall algorithm equivalent of algorithm 4.1 in the semi implicit case is the following
S.I.
i=1, k1=2
C1
x
S.I.
i=2, k 2=1
C0
S.I C1
i=3, k =2 3 x
i=4, k 4 =0 x
Fig. 12. Transition zones (C k ) and implicit stencil S.I.. The intermediate step number is denoted by i = 1, . . . , 4, the corresponding synchronization level by ki .
Algorithm 5.1 Synchronized time evolution for intermediate time step i = 1, . . . , 2K do Lagrange step. Compute right hand side (2.14) for (2.12) (see Algorithm 5.2). Compute linear system coecients for (2.12) and solve linear systems (see Algorithm 5.3). Compute Euler projection uxes (see Algorithm 5.4) Time evolution and synchronization (see Algorithm 5.5) end for 21
The interface quantities are computed at the beginning of each macro time step on the synchronized solution. The right hand side of (2.12) should be computed according to the following algorithm Algorithm 5.2 Right hand side for the linear systems for levels k = K ki do for (k, j) Ck do compute right hand side using (2.14), for a full time step advance tk . end for for k < K and (k, j) Ck do compute right hand side for a half time step advance t k /2. end for end for for levels k = ki 1 0 do for cells (k, j) s.t. dl (k, j, ki ) z or dr (k, j, ki ) z do compute right hand side for a reduced time step advance tki = tk 2kki end for end for We denote by S i the stencil of the implicit systems. It can be a union of disconnected chunks. The upper and lower bidiagonal matrices M + and M of the linear systems are formed as follows Algorithm 5.3 Linear systems for levels k = K ki do K compute n+i2 using t k if (k, j) Ck else using t k /2. k, j end for for level k = ki 1 0 do K compute n+i2 using t ki . k, j end for Impose non reective boundary condition at end of blocks : if (k, j + 1) S i then K K + + Mk; j, j = (1 + n+i2 ) and Mk; j, j+1 = n+i2 k,i k, j else + + Mk; j, j = 1 and Mk; j, j+1 = 0 end if if (k, j 1) S i then K K Mk; j, j = (1 + n+i2 ) and Mk; j, j1 = n+i2 k, j k, j else Mk; j, j = 1 and Mk; j, j1 = 0 end if In order to compute the Euler projection uxes (2.16), the interface quantities Pk, j+1/2 and uk, j+1/2 are computed directly from the Lagrangian phase solution (with the pressure updated using (2.10), with (2.9).
22
Algorithm 5.4 Euler projection uxes (2.16) for levels k = K ki do for (k, j) Ck do K K Compute Pn+(i1)2 , and un+(i1)2 , using (2.9). j1/2 j1/2 Save uxes at the previous intermediate time step for transition zone end points Compute uxes using (2.16) end for end for for level k = ki 1 do for (k, j) Ik and dl (k, j, ki ) r + 1 or dr (k, j, ki ) r + 1 do n+i2K , n+i2K , Compute P j1/2 and u j1/2 using (2.9). Compute uxes using (2.16) end for end for In the case of the explicit scheme the uxes at the end of the transition zone Ck are not modied and the conservation property depicted in Figure 4 can be used in a very simple manner. In case of the semi-implicit scheme, it is not the case anymore, since the solution has been modied during the Lagrangian step, therefore a special synchronization must be done on levels k, for ki k < K, at the interface between cells (k, j) and (k, j + 1) if dl (k, j, k + 1) = r + 1 or at the interface between cells (k, j 1) and (k, j) if dr (k, j, k + 1) = r + 1. If dl (k, j, k + 1) = r + 1, the solution on cell (k, j) is updated over tk /2 while n+(i1)2K , the solution on cell (k, j + 1) is updated over tk . The ux Fk, j+1/2 has been computed using the synchronized Lagrange step solution and can be used straightforwardly in (2.15) for cell (k, j + 1). However, solution on cell (k, j) has already been advanced with a half time step at a previous intermediate time step K i = i 2Kk , using ux Fn+(i 1)2 , . This quantity has not been tampered with k, j+1/2 since then. Therefore, on (k, j) the update formula (2.15) should be replaced by Vn+i2 k, j
K
n+(i1)2 = Vk,i
(5.3)
Similarly if dr (k, j, k+1) = r+1, the solution on cell (k, j1) is updated over tk n+(i1)2K while the solution on cell (k, j) is updated over tk /2. The ux Fk, j1/2 , has been computed using the synchronized Lagrange step solution and can be used straightforwardly in (2.15) for cell (k, j 1). However, solution on cell (k, j) has already been advanced with a half time step at a previous intermediate time K step i = i 2Kk , using ux Fn+(i 1)2 , . Therefore, on (k, j) (2.15) should be k, j1/2 replaced by Vn+i2 k, j
K
n+(i1)2 = Vk, j
t n+(i1)2K , n+(i 1)2K , n+(i1)2K , . Fk, j+1/2 2Fk, j1/2 + Fk, j1/2 2x 23
(5.4)
The time evolution algorithm takes into account this special synchronization and also prepares right hand side corrections for the linear systems at the next intermediate time step. Algorithm 5.5 Time evolution and synchronization for levels k = L ki do full time step t k for (k, j) Ck
n+(i1)2 t x Fk, j+1/2 Vn+i2 = Vk, j k, j end for for levels k = L ki 1 do half time step for (k, j) Ck
K K K K
n+(i1)2K ,
Fk, j1/2
n+(i1)2K ,
n+(i1)2 n+(i1)2 n+(i1)2 t 2x Fk, j+1/2 , Fk, j1/2 , . Vn+i2 = Vk, j k, j if k >= ki then special evolution equations should be used at the end of transition zone, (5.4) if dr (k, j, k + 1) = r + 1 and (5.3) if dl (k, j, k + 1) = r + 1. end if Elsewhere the solution remains unchanged end for
We consider a solution at time tn built from a single detail at position J on level K 1 in the multiresolution domain: V0 = 0, D1 = . . . = DK2 = 0, DK1 = J , j j DK = 0.
After transformation into the physical space using the decoding operator M1 , the solution is advanced in time using the implicit scheme (5.5) and then transformed back in the multiscale representation using the encoding operator M. We display in Figure 13 (a) dierent details of this solution on level K 1, as a function of the coecient = t/x. The strength of the initial detail DK1 decreases rapidly and is below 10% J of its initial value for > 10. The next detail in the direction of the propagation DK1 J+1 has a signicant amplitude for [0, 5]. We then represent the two following details DK1 and DK1 . They are already very small, and all others are negligible. The curve J1 J+2 corresponding to DK1 indicates that detail DK1 has propagated at a speed higher J J+1 24
than 1 in a manner that cannot be completely neglected at level K 1. In Figure 13 (b), the details at the coarser level K 2 are displayed. The strength of the detail on cell J/2 + 1 is comparable to that on the cell J/2, which also means that some of the solution has actually moved with speed 2. This elementary example illustrates that the details are damped by the implicit scheme, which is good because it means that they will be captured by coarser levels in the multiresolution hierarchy. Nevertheless, to ensure that the regriding at intermediate time step does not deteriorate in the manner described in Figure 5 (b), we modify the prediction of the grid and assume that the speed s in the prediction step of Algorithm 4.2 is in fact 3 instead of 1, which will have the eect of broadening the tree thanks to the gradualness rule (4.1).
J1 J J+1 J+2
(a)
10 12 14 16 18 20
0.10 0
(b)
10 12 14 16 18 20
K1 K2 Fig. 13. Details at time t as a function of (a) d J+m and (b) d J/2+m for m = 1, . . . , 2
(a)
(b)
Fig. 14. Density eld and grid renement computed with the semi-implicit schemes at time t = 41.6s, for = 0.005. (a) multiresolution scheme (b) Local time stepping scheme.
To illustrate the algorithm presented above we use the same test case as in subsection 4.3 for the explicit scheme. In the case of the semi-implicit scheme the coecient 25
560 540 520 500 480 460 440 420 400 380 360 14500 14700 x
7 6 5 4
7 6 5 4 3
2 1 0 30000
14900
15100
24000
26000 x
28000
(a)
545 540 535 530 525 520 515 510 505 500 4000
(b)
Ini U LTS MR tree LTS tree MR 7 6 5 4 3 2 1 0 5000 x 6000
(c) Fig. 15. Density eld computed with the semi-implicit schemes at time t = 41.6s, for = 0.01. Zoom on (a) kinematic wave (b) right going acoustic wave (c) left going acoustic wave.
0.01
0.01
1e-04 E(Y)
1e-04
E()
1e-06
1e-06
(a)
(b) Fig. 16. Error on (a) density, (b) gas mass fraction with respect to uniform solution versus threshold parameter for 6 levels grid hierarchy.
an must be set globally on the all x range at each time step. The uniform scheme provides us with a time step ensuring stability throughout the simulation t = 0.065s hence roughly seven times larger than the one used for the explicit schemes simulations. Figure 14 displays the density eld computed with the uniform scheme and the 26
0.01
0.01
1e-04 E(Y)
1e-04
E()
1e-06
1e-06
(a)
(b) Fig. 17. Error on (a) density, (b) gas mass fraction with respect to uniform solution versus CPU gain for 6 levels grid hierarchy.
MR LTS MR LTS
5 5 6 6 Eref(Y)
0.01 0.009 0.008 0.007 0.006 0.005 0.004 0.003 0.002 0.001
MR LTS MR LTS
5 5 6 6
Eref()
CPU(unif)/CPU(adapt)
8 12 16 CPU(unif)/CPU(adapt)
20
(a)
(b) Fig. 18. Error on (a) density, (b) gas mass fraction with respect to uniform reference solution versus CPU gain for 5 and 6 levels grid hierarchy.
adaptive schemes (MR) and (LTS) The zoom on the three dierent waves displayed in Figure 15 show the robustness of the new algorithm. The kinematic wave is reproduced as well, if not better as with the standard (MR) scheme. The acoustic waves are also well handled even though they are more smoothed out with the local time stepping algorithm than with the standard multiresolution. A parameter study for varying values of the threshold is presented in Figures 16 to 18. In Figure 16 we display the relative error (4.3) between the density or the gas mass fraction obtained using the uniform scheme or the dierent adaptive schemes. As in the explicit case, the MR and LTS schemes both exhibit a monotonous convergence in O(). We also observe that the relative error on the gas mass fraction is two orders of magnitude smaller than the error on the density. This is quite normal since the gas mass fraction is driven by the slow kinetic wave and actually explicitly computed in the semi-implicit scheme. The adaptive grid is retains almost all details in the vicinity of the discontinuity in the gas mass fraction, which accounts for a much smaller error. On the other hand the density sees acoustic waves which are more sensitive to the
27
adaptivity of the grid because they are computed with the implicit scheme. Figure 17 displays the same relative errors versus the gain in CPU time. For the best error level that can be achieved with the local time stepping algorithms we have a CPU gain of more than 17, while the gain using the standard multiresolution is around 11. Eventually we display, in Figure 18, the error between the adaptive solution and a reference solution obtained using the uniform scheme on a grid corresponding to the 9th level. The abscissa is the gain in CPU with respect to the uniform solution on the nest level. As expected, both schemes MR and LTS converge to the error level corresponding to the error Eu between the uniform solution on the nest level, the 5th or the 6th , and the reference solution on the 9th level. Compared to the similar curves with the explicit scheme in Figure 11, the local time stepping enhancement seems to be more advantageous, knowing that the gas mass fraction is the only component where precision really matters: all values of threshold tried on the six level hierarchy lead to a relative error below that obtained with the uniform scheme on the 5th level. In order to compare all the schemes tested in this study we collect in the following table the performances of the six level simulations, in term of computing times, for both the explicit and implicit schemes. The number in parenthesis are the ratio between the uniform and the adaptive performances. The gain is signicant between the uniform and adaptive scheme: 9 in the explicit case and 6 in the implicit one. With the global time stepping enhancement it becomes spectacular: 15 in both case. The number of calls to the equilibrium state laws is also reported in the table, along with the computing times. These gures indicate the potential performances of the algorithms when realistic thermodynamical closure laws will be used instead of the model one (4.2). One should also note that for the test case presented in this table, we have used for the explicit scheme a constant time step t = 0.0048 and for the implicit one t = 0.0325 that is roughly 7 times larger. These values are the minimum values provided by the stability conditions (2.7) and (2.18) throughout a uniform computation. The larger time step in the implicit case is counterbalanced by the cost of solving the linear systems (2.12) and both schemes end up costing roughly the same in terms of computing times in the uniform case. Explicit CPU(s) State law Semi-implicit CPU(s) State law Uniform 31.55 10493 Uniform 33.5 17698 Multiresolution 3.54 (8.9) 1105 (9.5) Multiresolution 5.8 (5.8) 2411 (7.3) Local time stepping 2.14 (14.7) 237 (44.3) Local time stepping 2.11 (15.9) 345 (51.3)
Table 1 Computing times and number of calls to state laws comparison for the dierent algorithms. Threshold parameter = 0.005 and a 6-levels hierarchy.
28
6 Conclusion
We have described in details several algorithms to compute the solution of the one dimensional multiphase ow, in the framework of a LagrangeEuler projection formulation of the equations. Both explicit and semi-implicit schemes are presented, and for each one, two adaptive enhancement methods are described. The rst one is the standard multiresolution method already implemented in more complicated cases. It is tested here versus the local time stepping algorithm. The robustness of the two algorithms has been checked by doing a parameter study. Several values have been tried of the threshold parameter and for the number of levels. The relative errors between the dierent adaptive solutions and the uniform one present the expected behaviors. The benets of the local time stepping enhancement in terms of computing time are encouraging.
Acknowledgments: this work was supported by the Minist` re de la Recherche under e grant ERT-20052274: Simulation avanc e du transport des hydrocarbures and by the e Institut Francais du P trole. The authors also wish to thank S. M ller and S.-M. Kaber e u for fruitful discussions on the redaction of this paper.
References
[1] Nikolay Andrianov, Fr d ric Coquel, Marie Postel, and Quang Huy Tran. A e e relaxation multiresolution scheme for accelerating realistic two-phase ows calculations in pipelines. Internat. J. Numer. Methods Fluids, 54(2):207236, 2007. [2] Micha l Baudin, Christophe Berthon, Fr d ric Coquel, Roland Masson, and e e e Quang-Huy Tran. A relaxation method for two-phase ow models with hydrodynamic closure law. Numer. Math., 99:411440, 2005. [3] Micha l Baudin, Fr d ric Coquel, and Quang-Huy Tran. A semi-implicit relaxe e e ation scheme for modeling two-phase ow in a pipeline. SIAM J. Sci. Comput., 27(3):914936, 2005. [4] Marsha J. Berger and Phillip Collela. Local adaptive mesh renement for shock hydrodynamics. Journal of Computational Physics, 82:6484, 1989. [5] Marsha J. Berger and Joseph Oliger. Adaptive mesh renement for hyperbolic partial dierential equations. Journal of Computational Physics, 53:484512, 1984. [6] Albert Cohen. Numerical analysis of wavelet methods, volume 32 of Studies in Mathematics and its Applications. North-Holland Publishing Co., Amsterdam, 2003. [7] Albert Cohen, Mahmoud S. Kaber, Siegfried M ller, and Marie Postel. Fully u adaptive multiresolution nite volume schemes for conservation laws. Math. Comp., 72(241):183225 (electronic), 2003.
29
[8] Fr d ric Coquel, Edwige Godlewski, Benot Perthame, Arun In, and Paul Rascle. e e Some new Godunov and relaxation methods for two-phase ow problems. In Godunov methods (Oxford, 1999), pages 179188. Kluwer/Plenum, New York, 2001. [9] Fr d ric Coquel, Quang-Long Nguyen, Marie Postel, and Quang-Huy Tran. e e Positivity-preserving Lagrange-projection method with large time-steps for multiphase ows and Euler IBVPs. submitted. [10] Fr d ric Coquel, Quang-Long Nguyen, Marie Postel, and Quang-Huy Tran. e e Large time-step positivity-preserving method for multiphase ows. To appear in proceedings of HYP2006, 2006. [11] Fr d ric Coquel, Quang-Long Nguyen, Marie Postel, and Quang-Huy Tran. e e Time varying grids for gas dynamics. To appear in proceedings of ECMI2006, 2006. [12] Fr d ric Coquel, Marie Postel, Nicole Poussineau, and Quang Huy Tran. Mule e tiresolution technique and explicit-implicit scheme for multicomponent ows. J. Numer. Math, 14(3):187216, sep 2006. [13] Edwige Godlewski and Pierre-Arnaud Raviart. Numerical approximation of hyperbolic systems of conservation laws, volume 118 of Applied Mathematical Sciences. Springer Verlag, New-York, USA, 1996. [14] Ami Harten. Multiresolution algorithms for the numerical solutions of hyperbolic conservation laws. Comm. Pure Appl. Math., 48:13051342, 1995. [15] Philipp Lamby, Siegried M ller, and Youssef Stiriba. Solution of shallow water u equations using fully adaptive multiscale schemes. Int. Journal for Numerical Methods in Fluids, 49, No.4:417437, 2005. [16] Siegfried M ller. Adaptive Multiscale Schemes for Conservation Laws, volu ume 27 of Lecture Notes on Computational Science and Engineering. Springer, 2002. [17] Siegried M ller and Youssef Stiriba. Fully adaptive multiscale schemes for conu servation laws employing locally varying time stepping. Journal for Scientic Computing, pages 493531, 2007. Report No. 238, IGPM, RWTH Aachen. [18] Siegried M ller and Youssef Stiriba. A multilevel nite volume method with u multiscale-based grid adaptation for steady compressible ows. Journal of Computational and Applied Mathematics, 2007. to appear in the special issue Emergent wavelet-based algorithms in science and engineering ECCOMAS 2006. [19] Stanley Osher and Richard Sanders. Numerical approximations to nonlinear conservation laws with locally varying time and space grids. Math. Comp., 41(164):321336, 1983.
30