A Dynamically-Moving Adaptive Grid Method Based on a Smoothed Equidistribution Principle along Coordinate Lines Paul A. Zegeling Computational Science Working Group Mathematical Institute, University of Utrecht P.O. Box 80.010, 3508 TA Utrecht The Netherlands e-mail:
[email protected] WWW: http://www.math.ruu.nl/people/zegeling/
Abstract In this paper a time-dependent moving-grid method is described to numerically solve timedependent partial differential equations (PDEs) in two space dimensions involving fine scale structures such as steep moving fronts, emerging steep layers, pulses and shocks. The method is based on an equidistribution principle along coordinate lines in the two spatial directions. Smoothing in the spatial direction is employed to control grid clustering and expansion. Additional smoothing in the temporal direction ensures a smooth progression of the grid points in time by preventing the points from responding too quickly to current values of the weightfunctions. Numerical results are given for a (parabolic) reactiondiffusion model and a (hyperbolic) rotating-pulse model.
Introduction During the last decade, dynamically-moving grid methods, also characterized by the term r-refinement, have shown to be very useful for solving parabolic and hyperbolic partial differential equations (PDEs) involving fine scale structures such as steep moving moving fronts, emerging steep layers, pulses and shocks. In one space dimension moving-grid methods have been applied successfully to a large class of PDE systems (see e.g. [1, 2, 3] and [4]). In two space dimensions, however, application of moving-grid methods is far less trivial than in 1D. For instances there are many possibilities to treat the one-dimensional boundary and to discretize the spatial domain, each having their own difficulties for specific PDEs. Furthermore, in 2D the chances for grid distortion to occur are much greater due to the extra degree of freedom (see [5]). In this paper a time-
dependent moving-grid method for 2D models is described that produces adaptive grids which move smoothly in time. Smoothing is also applied in the spatial direction to control grid clustering and expansion. The discretization of the PDE is carried out in two stages through the method-of-lines. First, the PDE is transformed to a PDE in a moving frame by a coordinate transformation. This transformed PDE is semi-discretized using central differences (on a non-uniform grid) for the spatial derivatives. Then, the moving-grid PDEs are defined that describe the dynamics of the grid. The moving-grid PDEs are based on an equidistribution principle along coordinate lines in the two spatial directions. Additional parameters are included to control the smoothness and adaptivity of the grid. Numerical experiments show the different effects of the method parameters. Results are given for two PDEs: a reaction-diffusion equation from chemistry, and a hyperbolic equation with a rotating pulse.
Semi-Discretization in Space Consider the scalar time-dependent PDE
@u = L(u); @t
(1 )
where L is a spatial PDE operator containing at most second order derivatives. It is assumed that appropriate initial- and boundary conditions are applied to complete the model. We seek for a solution u(x; y; t) with (x; y) 2 Ω := [0; 1]2 and t 2 [0; T ]. The following procedure for finding numerical solutions of (1) is based on the method-of-lines. This means that the discretization of the PDE is carried out in two stages. In the first stage the space variables are discretized in a moving frame, giving a large system of ordinary differential equations (ODEs). The second stage deals with the numerical integration in time of this stiff ODE system to generate the desired numerical solution. Before defining the moving-grid equations, the PDE model must first be prepared to allow for grid motion. This can be done by transforming the PDE (1) to a PDE in a moving frame. For this purpose, a coordinate transformation (x; y; t) ! (; ; ) of the form
x = x(; ; ); y = y(; ; ); t = is applied that yields the Lagrangian form of the PDE
u˙ ? ux x˙ ? uy y˙ = L(u); @ . After defining a time-dependent spatial grid (fX (t)g; fY (t)g) where the dot stands for @ i i 2 on the unit square [0; 1] , the Lagrangian form is semi-discretized in the spatial direction:
U˙ i ? Ux;i X˙ i ? Uy;i Y˙i = Li ;
for
i = 1; :::; N:
(2 )
For example, if we take the diffusion-convection-reaction operator
L(u) := ∆u ? ru + S (u);
(3)
then, using a central difference approximation on a non-uniform grid for the spatial derivatives in Li , we obtain Li = (∆U )i ? ( rU )i + S (Ui ); where
U )i = (1Xi ? Xi?N )Ui+2N ? (Xi+N ? Xi?N )Ui + (Xi2+N ? Xi )Ui?N 2 ((Xi+N ? Xi ) (Xi ? Xi?N ) + (Xi ? Xi?N ) (Xi+N ? Xi ))
(∆
+
Yi ? Yi?1)Ui+1 ? (Yi+1 ? Yi?1 )Ui + (Yi+1 ? Yi )Ui?1 ; Yi+1 ? Yi )2 (Yi ? Yi?1 ) + (Yi ? Yi?1)2 (Yi+1 ? Yi ))
(
1 2 ((
and
Ui?N
rU )i = 1;i XUi+N ? ?X
(
i?N
i+N
Ui?1 :
UYi+1 ? i+1 ? Yi?1
+ 2;i
The derivatives Ux;i and Uy;i in (2) are discretized similarly. Equation (2) defines N ODEs for the 3N unknowns Ui ; Xi ; Yi . The remaining 2N ODEs come from the semi-discretized moving-grid PDEs.
The Moving-Grid PDEs To complete the transformed model we define the moving-grid PDEs by
@ [ n˜ + n˙˜ ] = 0; @ V @ [ m˜ + m˙˜ ] = 0; @ W where the weight functions are
V
s :=
1+
s
u2x ; 1 + u2x
u2y ; 1 + u2y and the point concentrations (along coordinate lines) are n := 1=x and m := 1=y . W :=
1+
The boundary conditions for the grid PDEs (4) satisfy
@n j = @n j = @m j = @m j = 0: @ x=0 @ x=1 @ y=0 @ y=1 In (4) n˜ represents a smoothed point concentration, which is given by
@ 2 )n ; n˜ := (I ? (N+ 1) @ 2
(4 )
where is a spatial smoothing parameter. The smoothed point concentration m ˜ in the y-direction is defined in a similar way. Through we can control grid clustering and grid expansion. Loosely speaking, the weight functions V and W determine the shape of the grid distribution and the level of clustering. With = 2 rather modestly graded space grids are obtained. The parameter in (4) is connected with the temporal grid smoothing and serves to act as a delay factor for the grid movement. More precisely, the introduction of the temporal ˙˜ ) forces the grid to adjust over a time interval derivatives of the grid distribution (via n˙˜ and m of length from old to new values of V and W , which provides a tool for suppressing grid oscillations and hence to obtain a smoother progression of (fXi (t)g; fYi(t)g) in time. (for more details on , and equations (4) see [1, 6, 7]). For = = 0 the PDE system (4) reduces to
@ ( n ) = @ ( m ) = 0: (5) @ V @ W If additionally = 0, then V = 1 and W = 1 , and (5) yields a uniform grid distribution. The restriction of (5) to 1D is equivalent with x V = c, which describes an equidistribution principle written in continuous form. The constants and represent weight function parameters. The parameter is an adaptivity parameter, which controls the level of adaptivity. Increasing will yield more adaptivity, whereas low values for will yield almost non-adaptive meshes. The parameter in V and W is a parameter to prevent the grid from collapsing in 2D. In [8] a similar constant is called an ‘anti-overkill-parameter’. Too large values for will destroy the adaptivity induced by . Therefore, should not be taken too large w.r.t. , . e.g. 0 10 The PDEs (4) are semi-discretized as explained in the previous chapter and the resulting equations are coupled to system (2). This gives a system of 3N ODEs with 3N unknowns ˙ X; ˙ Y˙ )T = H (U; X; Y ); t > 0 ; M(U; X; Y )(U;
U (0); X (0); Y (0))T
(
(6 )
given:
Equation (6) defines a stiff ODE system with a banded matrix M that can be solved using the ODE solver DASSL [9].
Numerical Results In this section numerical experiments are described using the moving grids defined by (4). We have used a time-tolerance TOL = 10?3 for DASSL and a 21 21 uniform starting grid (fXi (0)g; fYi(0)g) for all testcases. A given function: For = S = 0 and = 0 in (3) an adaptive grid can be created at t = 0:005 for the function ujt=0 := u0(x; y) = 12 (1 + tanh(50( 161 ? (x ? 12 )2 ? (y ? 12 )2))). For this function the grid
must be adapted in all directions. In Figure (1) six different results are displayed in which the effects of changing the adaptivity and smoothness in the method can be observed. In this example two parameters are held fixed: = 10?3 and = 0. The case = 100 corresponds with an extra adaptivity requirement, i.e. the first-order spatial derivatives of u0 are emphasized. Smaller values for give less adapted grids. It can be seen that choosing = 0 (left figures) produces spatially very unsmooth grids, while = 2 (right figures) gives smoother grids. A reaction-diffusion model: = 1; = 0; S (u) = e420 (2 ? u)e?20=u in (3), u0(x; y) = 1 + sin30((x ? 1 1 30 2 )) sin ( (z ? 2 )), and uj@ Ω = 1, a reaction-diffusion equation is obtained which stems from combustion theory (cf. p.152 in [1]). The solution of this model is a temperature front starting in the middle of the domain that propagates towards the four boundaries of Ω. When the front reaches the boundary the problem runs into steady-state (at approx. t = 0:1), while forming steep boundary layers. Figure (2) shows numerical results at different points of time for the ‘standard’ parameter choice: = 1; = 10?3 ; = 2; = 0. Note the quick response of the grid points to the initial pulse in the middle of the domain and the grid positioning at the four boundary layers in steady-state. For
Rotating-pulse model: 2 2 For = 0; = (y ? 12 ; 12 ? x)T ; S = 0 in (3) and u0 (x; y) = e?100((x?:5) +(y?:65) ) , the so-called ‘Molenkamp-test’ problem is obtained ([1]). The exact solution describes a pulse that moves around in circles with a constant speed. During this movement the shape of the pulse does not change. For example, this means that the maximum and the minimum values of the solution must remain 1 and 0, respectively, throughout the evolution of the pulse. It is known that on a non-moving grid either the solution is being damped out rapidly due to numerical diffusion or unnatural oscillations may appear. Further, it has been observed that moving-grid methods may give severely distorted grids for this test problem ([1], [5]). In the table below and Figure (3) several test results are displayed using finite differences on a fixed grid (FFD), moving finite elements (MFE, see also [1]) and results using the moving-grid method defined by equations (4). Method parameters are again = 10?3 , = 1 and = 2. No grid distortion occurs in the present situation, while the solution remains almost undisturbed (maximum errors are less than 4 % ). However, using the = 0:1 instead of parameter can help to obtain less skewed grids. The use of = 10 = 0 has some effect on the grid positioning in the ‘corners’ of the solution. Method FFD ( = 0:0) MFE (see [1]) MFD ( = 0:0) MFD ( = 0:1)
Umax 0.8942 1.0020 0.9727 0.9600
Umin -0.0891 -0.0040 -0.0207 -0.0053
Max. over/undershoot 10:6% 0:4% 2:7% 4:0%
Grid uniform distorted not smooth smooth
Conclusions In this paper we have described a moving-grid method for two-dimensional time-dependent PDEs. Satisfactory numerical results are obtained for a given function with steep slopes in all directions, a scalar parabolic model describing a flame propagation front with a steep steady-state profile, and a scalar hyperbolic model representing a rotating pulse. The effects of the different method parameters are clear. Smoothing both in time and in space direction is necessary to prevent irregular adaptive grids. Standard choices for the smoothing parameters can be given. An additional, somewhat heuristic, term may sometimes be needed to handle ‘overkill’ at the ‘corners’ of the 2D solution. There are some possibilities to modify and improve the moving-grid PDEs that control the grid movement. Further, more attention should be paid to make the time integration process more efficient. Finally, it is planned to test the method on systems of nonlinear PDEs with more general boundary conditions.
References [1] P. A. Zegeling. Moving-gridmethods for time-dependent partial differential equations. CWI-tract No.94, Centre for Mathematics and Comp. Science, Amsterdam, 1993. [2] P. A. Zegeling, J. G. Verwer and J. C. H. v. Eijkeren. Application of a moving-grid method to a class of 1d brine transport problems in porous media. Int. J. for Numer. Meth. in Fluids, V15, N2, pp. 175–191, 1992. [3] A. Doelman, T. J. Kaper and P. A. Zegeling. Travelling waves in the 1-d self-replicating equations. To be published, 1996. [4] J. G. Blom and P. A. Zegeling. Algorithm 731: a moving-grid interface for systems of one-dimensional time-dependent partial differential equations. ACM Transactions in Mathematical Software, V20, N3, pp. 194–214, 1994. [5] P. A. Zegeling and J. G. Blom. A note on the grid movement induced by MFE. Int. J. for Numer. Meth. in Eng., V35, N3, pp. 623–636, 1992. [6] J. G. Verwer, J. G. Blom, R. M. Furzeland and P. A. Zegeling. A moving-grid method for one-dimensional PDEs based on the method of lines. In: J. E. Flaherty, P. J. Paslow, M. S. Shephard and J. D. Vasilakis, eds., Adaptive Methods for Partial Differential Equations, SIAM, Philadelphia, 1989. [7] W. Huang and R. D. Russell. Analysis of moving mesh partial differential equations with spatial smoothing. Research report No. 93-17, Simon Fraser University, Burbaby, B.C., 1993. [8] W. Huang and D. M. Sloan. A simple adaptive grid method in two dimensions. SIAM J. Sci. Comput., V15, N4, pp. 776–797, 1994. [9] L. R. Petzold. A description of DASSL: a differential/algebraic system solver. In: R. S. Stepleman, eds., IMACS Trans. on Scientific Computation, 1983.
1
1
0.9
0.9
0.8
0.8
0.7
0.7
0.6
0.6
0.5
0.5
0.4
0.4
0.3
0.3
0.2
0.2
0.1
0.1
0 0
0.2
0.4
0.6
0.8
1
0 0
1
1
0.9
0.9
0.8
0.8
0.7
0.7
0.6
0.6
0.5
0.5
0.4
0.4
0.3
0.3
0.2
0.2
0.1
0.1
0 0
0.2
0.4
0.6
0.8
1
0 0
1
1
0.9
0.9
0.8
0.8
0.7
0.7
0.6
0.6
0.5
0.5
0.4
0.4
0.3
0.3
0.2
0.2
0.1
0.1
0 0
0.2
0.4
0.6
0.8
1
0 0
0.2
0.4
0.6
0.8
1
0.2
0.4
0.6
0.8
1
0.2
0.4
0.6
0.8
1
Figure 1: Battle between adaptivity and smoothness. Grids for the initial tanh-function with different choices for the adaptivity- and smoothing parameters. (left: no smoothing i.e. = 0, and right: smoothing with = 2). Upper two figures with = 100, middle two with = 1, and lower two with = 0:1, respectively.
1
1
0.9
0.9
0.8
0.8
0.7
0.7
0.6
0.6
0.5
0.5
0.4
0.4
0.3
0.3
0.2
0.2
0.1
0.1
0 0
0.2
0.4
0.6
0.8
1
0 0
1
1
0.9
0.9
0.8
0.8
0.7
0.7
0.6
0.6
0.5
0.5
0.4
0.4
0.3
0.3
0.2
0.2
0.1
0.1
0 0
0.2
0.4
0.6
0.8
1
0 0
1
1
0.9
0.9
0.8
0.8
0.7
0.7
0.6
0.6
0.5
0.5
0.4
0.4
0.3
0.3
0.2
0.2
0.1
0.1
0 0
0.2
0.4
0.6
0.8
1
0 0
0.2
0.4
0.6
0.8
1
0.2
0.4
0.6
0.8
1
0.2
0.4
0.6
0.8
1
Figure 2: Grids for the propagating flame at t = 0; 0:01; 0:02; 0:03; 0:04; 0:1.
1
1
0.9
0.9
0.8
0.8
0.7
0.7
0.6
0.6
0.5
0.5
0.4
0.4
0.3
0.3
0.2
0.2
0.1
0.1
0 0
0.2
0.4
0.6
0.8
1
0 0
1
1
0.9
0.9
0.8
0.8
0.7
0.7
0.6
0.6
0.5
0.5
0.4
0.4
0.3
0.3
0.2
0.2
0.1
0.1
0 0
0.2
0.4
0.6
0.8
1
0 0
1
1
0.9
0.9
0.8
0.8
0.7
0.7
0.6
0.6
0.5
0.5
0.4
0.4
0.3
0.3
0.2
0.2
0.1
0.1
0 0
0.2
0.4
0.6
0.8
1
0 0
0.2
0.4
0.6
0.8
1
0.2
0.4
0.6
0.8
1
0.2
0.4
0.6
0.8
1
Figure 3: Grids for the rotating pulse at t = 0:1 (left) and 0:5 (right). Upper two figures were obtained using a moving-finite-element method (see [1]). The middle two figures show results using equations (4) with = 0 and the lower two figures with = 0:1.