Joint International Topical Meeting on Mathematics & Computation and Supercomputing in Nuclear Applications (M&C + SNA 2007) Monterey, California, April 15-19, 2007, on CD-ROM, American Nuclear Society, LaGrange Park, IL (2007)
HIGH RESOLUTION TIME INTEGRATION FOR THE SPHERICAL HARMONICS EQUATIONS Ryan G. McClarren Los Alamos National Laboratory∗ PO Box 1663, MS K784 Los Alamos, New Mexico 87545
[email protected] James Paul Holloway Department of Nuclear Engineering and Radiological Sciences College of Engineering University of Michigan 2355 Bonisteel Boulevard Ann Arbor, Michigan 48109 2104
[email protected]
ABSTRACT We present a high resolution time integration method for the spherical harmonics equations based on the L-Trap method of Duraisamy, et al. This method is equivalent to the Crank-Nicolson method in smooth regions of the solution and changes form in non-smooth regions of the solution to avoid artificial oscillations in the solution. The method is nonlinear in the sense that the time integration used in each cell depends on the solution there. We use a quasi-linear type approach to solve the nonlinear equations that arise. Results from test problems demonstrate the necessity of a non-oscillatory method and the effectiveness of this particular approach. Key Words: spherical harmonics equations, time integration, high resolution schemes
1. INTRODUCTION Order of accuracy is often considered to be an adequate metric by which to judge a numerical method’s efficacy. However, numerical methods for time-dependent, hyperbolic partial differential equations have the ignominious characteristic that any linear method that is higher than first order in space or time can introduce artificial oscillations. This is a result of Godunov’s theorem [1] and is responsible for the Gibbs type errors that linear second-order methods (e.g. Lax-Wendroff or Beam-Warming) introduce near extrema in the solution. There has been much work in developing high resolution spatial schemes that avoid these oscillations by the introduction of nonlinear slope reconstruction methods or adaptive stencil methods (the so-called essentially non-oscillatory (ENO) type schemes). The leitmotiv of these methods is nonlinearly adapting the scheme depending on properties of the solution. However, less investigation has been done on methods that treat the time variable to produce high resolution methods. The work of Duraisamy, et al. [2] showed how the ideas from high resolution spatial schemes could be applied to time integration to achieve high-order non-oscillatory methods. ∗
Los Alamos National Laboratory is operated by Los Alamos National Security, LLC, for the U.S. Department of Energy under contract DE-AC52-06NA25396.
Ryan G. McClarren and James Paul Holloway
Over the past few years much research has gone into high resolution methods for radiation transport based on the time-dependent spherical harmonics (Pn ) equations [3–6]. This work has mainly focused on high resolution spatial schemes using explicit and implicit time integration. In this paper we seek to investigate the use of high-order implicit time integration for radiation transport. Our ultimate goal is to solve problems of thermal radiation transport. In these types of problems the time scale at which radiation propagates is often orders of magnitude faster than the characteristic times on which the material temperature responds to the radiation field. Due to this fact it would be beneficial to have the ability to take time steps that are long on the radiation propagation time scale but short on the material energy time scale. McClarren, Holloway, and Brunner briefly mentioned that large time steps for Pn methods (using both first and second order time integration) can lead to undesirable solutions near extreme points [5] but did not proceed to explore further. In this paper we use a high resolution time integration scheme of Duraisamy, et. al to achieve better results. One drawback to high resolution schemes is their nonlinear character. For a high resolution spatial scheme to use an implicit time integration method, a (possibly large) nonlinear system of equations must be solved at each time step. McClarren, Holloway, and Brunner previously developed an approach to solve such systems robustly using just two linear solves. High resolution time integration methods also involve solving a nonlinear system at each time step, and the McClarren, Holloway, and Brunner (MHB) method can be adapted to this application. Below, we will present a high resolution time integration method for the Pn equations and summarize some results showing how such an approach is superior to first-order time integration and a standard second-order method.
2. INTEGRATING THE SEMI-DISCRETE Pn EQUATIONS In Cartesian coordinates, the two-dimensional Pn equations discretized by a Riemann solver [4] are given by ~i,j F~i+1/2,j − F~i−1/2,j F~i,j+1/2 − F~i,j−1/2 1 ∂ψ ~i,j = δl,0 δm,0 Σs ψ ~ + Si,j . + + + Σt ψ (1) v ∂t ∆x ∆z ~i,j is a vector of spherical harmonic moments, ψ m of the form The vector, ψ l
m = ψl,i,j
Z
2π
Z
1
dθ 0
−1
dµYlm (µ, θ)ψi,j (µ, θ)
0≤l≤n
0 ≤ m ≤ l,
(2)
where the Ylm are the spherical harmonics functions. The flux functions represent the flow of information across a cell boundary and are given by ~i+1,j ψ ~i,j ~i+1,j − ψ ~i,j ψ ψ F~i+1/2,j = Ax − |Ax | , 2 2 ~i,j+1 ψ ~i,j ~i,j+1 − ψ ~i,j ψ ψ F~i,j+1/2 = Az − |Az | . 2 2
(3) (4)
The A matrices are the x and z Jacobian’s of the Pn equations and the result of expanding the streaming term in spherical harmonics. These are of size 21 (N 2 + 3N ) + 1, where N is the order of the Pn expansion, and each has all real eigenvalues. We have also denoted the absolute value of the matrix as X |A| = ~rk |λk |~lk (5) k Joint International Topical Meeting on Mathematics & Computation and Supercomputing in Nuclear Applications (M&C + SNA 2007), Monterey, CA, 2007
2/9
High Resolution Time Integration for the Spherical Harmonics Equations
with ~rk and ~lk being the right and left eigenvectors of A with eigenvalue λk . Eqs. (3)-(4) represent a first-order spatial discretization. A high resolution method can be developed by reconstructing a slope in each cell to extrapolate the ψ values in Eqs. (3)-(4) to the cell boundaries [4, 6], however, simplicity of notation here we have not written these terms here. included these terms. 2.1. Time Integration Methods To discretize the time variable we introduce the well-known θ method which is written for each moment as m n m m n m m n+1 (ψlm )n+1 , (6) i,j = (ψl )i,j + v∆t (1 − θl )(Ll )i,j + θl (Ll )i,j with n (Lm l )i,j
=−
(Flm )ni+1/2,j − (Flm )ni−1/2,j
− Σt (ψlm )ni,j
(Flm )ni,j+1/2 − (Flm )ni,j−1/2
− ∆x ∆z + δl,0 δm,0 Σs (ψlm )ni,j + (Slm )ni,j
(7)
and the superscripts refering to the nth time step. Given specific values of θ, Eq. (6) yields common schemes. For θ = 1 no information at the previous time step is used in the update and this implicit method is called the backward Euler method. Setting θ = 0.5 we recover the Crank-Nicolson (or alternatively the trapezoidal) method [7]. Duraisamy, et al. [2] developed the time step limits for a θ method to be total variation diminishing (TVD). The total variation of a scalar grid function ψlm is TV((ψlm )n )
=
T /∆t I J X XX
∆t|(ψlm )i, j n+1 − (ψlm )ni,j | + ∆x|(ψlm )ni+1,j − (ψlm )ni,j | + ∆z|(ψlm )ni,j+1 − (ψlm )ni,j | .
n=0 i=0 j=0
(8) A TVD method has the property that TV((ψlm )n+1 ) ≤ TV((ψlm )n ). A method having this property is guaranteed to converged to the true solution as the grid and time step are refined. The definition of TVD also implies that a TVD method will not introduce artificial oscillations. The backward Euler method is TVD for any size time step. Crank-Nicolson is TVD when the time step satisfies v∆t ≤ 2.0. ∆x
(9)
We can use the backward Euler method with an arbitrarily large time step and not introduce artificial oscillations. However, the backward Euler method is only first-order accurate. The Crank-Nicolson method is second-order accurate, but has a time step limit to be TVD. Similarly, second-order accurate multistep methods have been shown to have a similar time step restriction to be TVD. To address this problem we will seek to define θ locally to make the scheme second-order accurate in areas where the solution is smooth while avoiding the introduction of artificial oscillations. This was the idea pursued by Duraisamy, et al. [2]. Joint International Topical Meeting on Mathematics & Computation and Supercomputing in Nuclear Applications (M&C + SNA 2007), Monterey, CA, 2007
3/9
Ryan G. McClarren and James Paul Holloway
2.2. Defining θlm Locally To locally define θ we invoke a modification of a lemma developed by Huynh [8] that states: Given ∂(ψlm )n+1 ∂(ψ m )n (ψlm )n+1 and U n and the derivative or ∂tl , the resulting quadratic interpolant is monotone ∂t ∂(ψ m )n+1 ∂(ψ m )n
l in [n∆t, (n + 1)∆t] if , ∂tl ∈ [0, 2s], where s = (v∆t)−1 (U n+1 − U n ). This lemma can be ∂t used for high-resolution time integration. We define
∂(ψlm )i,j n n = (Lm l )i,j , ∂t ∂(ψlm )i,j n+1 n+1 = (Lm l )i,j , ∂t m n (ψlm )n+1 i,j − (ψl )i,j . si,j = ∆t
(10) (11) (12)
We would like to adjust the value of θ locally to guarantee monotonicity as in the lemma. This will cause our method to smoothly transition between a Crank-Nicolson and backward Euler scheme at different points n+1 m n in the problem domain. To apply the lemma we first check to see if (Lm l )i,j and (Ll )i,j satisfy the lemma, i.e. we check if
n+1 (Lm l )i,j ∈ [0, 2si,j ]
and
n (Lm l )i,j ∈ [0, 2si,j ].
(13)
To perform this check using a finite precision arithmetic the test in Eq. (13) is modified [2] by making the lower limit in the test a small value instead of 0. This modified test is n+1 n m n m n+1 (14) ) − 2s ≤ and (Lm ) (L (Lm i,j l )i,j (Ll )i,j − 2si,j ≤ , l i,j l i,j for small and positive (we used 10−10 ). This is done to avoid spurious fluctuations due to roundoff error when ψlm is slowly changing. If Eq. (14) is true then the assumptions of the lemma are satisfied and θlm for n+1 m n the (i, j cell is set to 0.5. Otherwise we check to see if (Lm l )i,j or (Ll )i,j has a different sign as si,j , i.e. if n+1 (Lm l )i,j si,j < 0
or
n (Lm l )i,j si,j < 0.
(15)
In the case Eq. (15) is true, θlm for the (i, j cell is set to be 1 because the assumptions of the lemma are false; effectively the backward Euler method is used. If neither Eq. (14) nor Eq. (15) are satisfied then we are in a situation where at least one of the (Lm l )i,j ’s is too large. In this case we set " # s s i,j i,j (θlm )i,j = 1.0 − min , m n+1 , 0.5 . (16) n+1 (Lm ) + (L ) l i,j l i,j + The above process of deciding (θlm )i,j is equivalent to what is done in a high resolution spatial scheme [1]: the interpolation step was adjusted to make the solution monotone. 2.3. Implementation Due to the fact that θ depends on the solution, the method is nonlinear and would involve solving a nonlinear system at each time step. McClarren, Holloway, and Brunner introduced a quasi-linear method for solving Joint International Topical Meeting on Mathematics & Computation and Supercomputing in Nuclear Applications (M&C + SNA 2007), Monterey, CA, 2007
4/9
High Resolution Time Integration for the Spherical Harmonics Equations
Table I. MHB Quasi-Linear Algorithm for High Resolution Time Integration ~∗ = ψ ~ n + v∆t Ln+1 1. Solve ψ i,j i,j i,j 2. 3.
~∗ Determine the value of each (θlm )i,j to make a non-oscillatory solution using ψ ~ n + v∆t (1 − θ~i,j )Ln + θ~i,j Ln+1 using the values (θm )i,j ~ n+1 = ψ Solve ψ i,j
i,j
i,j
i,j
l
the nonlinear systems that arise out of high resolution spatial discretizations [6]. The method involves only two linear solves per time step rather than a full Newton solver. We adapt this approach to the time variable. In the MHB method a first-order solution is used to predict where oscillations would occur in the secondorder solution. Then, using this prediction, they were able to produce a high resolution, implicit solution without a nonlinear solver. We will modify their algorithm for use with high resolution time integration. To ~ n+1 we use the algorithm given in Table 1. The heart of this method is using a first-order time solve for ψ i,j integration step (the backward Euler solution in step one of the algorithm) to determine where second-order time integration can be used. This informations is utilized to perform a high resolution step. The third step in the algorithm is linear because the value of the θi,j was determined in the second step. The entire algorithm involves solving two linear systems. This type of approach has been shown to be superior to using a Newton based method to solve the nonlinear system [6].
3. RESULTS To demonstrate the effectiveness of the method we will look at some problems where Crank-Nicolson gives unsettling results. The first problem is a P1 one-dimensional problem in vacuum where initially the scalar flux and the current are a square pulse given by φ(x, 0) = J(x, 0) = 1
for x ∈ [0.25, 0.75].
(17)
√ The solution for the scalar flux in this problem is a traveling square pulse moving with velocity 1/ 3. In Fig. 1 we see some numerical results for this problem at time t = 1. In all the numerical results there are 200 cells in the z direction and the time step size is ∆t = 0.125. The Crank-Nicolson method has obvious issues with artificial oscillations around the sharp edges of the peak, whereas the backward Euler method markedly smooths out the numerical solution. The local θ method has θ defined by the procedure outlined above. The results from this method do a better job of capturing the exact solution without numerical oscillations.
This method was also explored using a two-dimensional square pulse in vacuum. The pulse was isotropic (i.e. Jz = Jx = 0) and of the form φ(x, z, 0) = 1
for z ∈ [−0.5, 0.5] and x ∈ [−0.5, 0.5].
(18)
To compare results with different time step sizes a reference solution using the Crank-Nicolson method and a fine time step (∆t = 0.01) was computed. Fig. 2 shows results from the different methods with a time step yielding CFL ≈ 7.5. The Crank-Nicolson method shows oscillations in the scalar flux and gives the solution the likeness of a Hopi woven cloth. The backward Euler method did the opposite and smeared out the effect Joint International Topical Meeting on Mathematics & Computation and Supercomputing in Nuclear Applications (M&C + SNA 2007), Monterey, CA, 2007
5/9
Ryan G. McClarren and James Paul Holloway
1.2 1
Exact Crank−Nicolson Local Theta Backward Euler
0.8
φ
0.6 0.4 0.2 0 −0.2 0
0.5
1 Z
1.5
2
Figure 1. Results from the 1D square pulse problem at t = 1 seconds and ∆t = 0.125 and for different methods compared with the exact solution.
v∆t ∆x
= 12.5
of the corners of the square. The high resolution method was much closer to the reference solution than the backward Euler method and avoided the oscillations of the Crank-Nicolson method. The next two figures, Figs. 3 and 4, show the solution along the line x = 0. The oscillations from the Crank-Nicolson method mar the solution with time step of ∆t = 0.5 and the solution in the middle of the problem goes far below the reference solution. These oscillations go away in the solution with the smaller time step in Fig. 4. This smaller time step has CFL = 3 which is beyond the TVD limit for the Crank-Nicolson method, although no oscillations appear. The backward Euler solution is too smooth with the larger time step and does not capture the peaks and valleys of the reference solution with a smaller time step. Finally, the high resolution method does better than the Crank-Nicolson method in the large time step case in terms of not having any oscillations. However, the wave front is further from the peak of the reference solution in the high resolution method. In the small time step solution, there is still a difference between the Crank-Nicolson method and the high resolution method. This is due to the fact that the Crank-Nicolson method is not guaranteed to be nonoscillatory with this time step and in some parts of the problem θ will not be exactly 0.5.
4. CONCLUSIONS Using the concepts of high resolution spatial scheme, Duraisamy, et al. were able to produce a high resolution time integration scheme. We have presented the first application of this method to time-dependent radiation transport. The heart of this time integration scheme is the locally determining the value of θ in such a manner that artificial oscillations are not introduced. We implemented this time integration scheme on a high resolution discretization of the Pn equations. We were able to adapt the MHB quasi-linear method to implement the high resolution time integration scheme with needing a Newton-based solver. Results from some test problems showed the problem of oscillations in a linear, second-order scheme (Crank-Nicolson) and why the high resolution approach is necessary. In these same problems the backJoint International Topical Meeting on Mathematics & Computation and Supercomputing in Nuclear Applications (M&C + SNA 2007), Monterey, CA, 2007
6/9
High Resolution Time Integration for the Spherical Harmonics Equations
(a) Reference solution: Crank-Nicolson Method ∆t = 0.01
(b) Crank-Nicolson Method
(c) High Resolution Method
(d) Backward Euler
Figure 2. The scalar flux for different methods with ∆t = 0.25 compared with the reference solution at t = 1.5 seconds. All solutions have ∆x = 0.033. ward Euler method demonstrated excessive error near sharp features in the solution. The high-resolution method demonstrated much less smoothing while avoiding the Gibbs-type errors of Crank-Nicolson. Now that efficient means of solving the nonlinear systems that arise from high resolution schemes (e.g. the MHB approach) are available, these methods are becoming viable for large-scale applications. On the whole, we believe that high resolution time integration schemes present a new way forward for applications where high-order time integration is necessary but oscillations are intolerable.
Joint International Topical Meeting on Mathematics & Computation and Supercomputing in Nuclear Applications (M&C + SNA 2007), Monterey, CA, 2007
7/9
Ryan G. McClarren and James Paul Holloway
Figure 3. P1 results from the 2D square pulse problem at t = 1.5 seconds and ∆t = 0.5 for different methods compared with the reference solution. All solutions have ∆x = 0.033.
Figure 4. P1 results from the 2D square pulse problem at t = 1.5 seconds and ∆t = 0.1 for different methods compared with the reference solution. All solutions have ∆x = 0.033.
Joint International Topical Meeting on Mathematics & Computation and Supercomputing in Nuclear Applications (M&C + SNA 2007), Monterey, CA, 2007
8/9
High Resolution Time Integration for the Spherical Harmonics Equations
REFERENCES [1] Randall J. Leveque. Numerical Methods for Conservation Laws. Birkh¨auser Verlag, Boston, USA, 1992. [2] Karthikeyan Duraisamy, James D. Baeder, and Jian Guo Liu. Concepts and application of time-limiters to high resolution schemes. Journal of Scientific Computing, 19(1-3), 2003. [3] Thomas A. Brunner and James Paul Holloway. One-dimensional Riemann solvers and the maximum entropy closure. J. Quantitative Spectroscopy and Radiative Transfer, 69:543–566, 2001. [4] Thomas A. Brunner and James Paul Holloway. Two dimensional time dependent Riemann solvers for neutron transport. J. Comput. Phys., 210(1):386–399, 2005. [5] Ryan McClarren, James Paul Holloway, Thomas A. Brunner, and Thomas Mehlhorn. Implicit Riemann solvers for the Pn equations. In Frank Graziani, editor, Computational Methods in Transport, Lake Tahoe, California, September 2005. Institute for Pure and Applied Mathematics, Springer-Verlag. [6] Ryan G. McClarren, James Paul Holloway, Thomas A. Brunner, and Thomas A. Mehlhorn. A quasilinear implicit Riemann solver for the time-dependent Pn equations. Nucl. Sci. and Eng., 155:290–299, 2007. [7] Erwin Kreysig. Advanced Engineering Mathematics. John Wiley and Sons, eigth edition, 1999. [8] H. Huynh. Accurate cubic interpolation. SIAM J. Numer. Anal., 30:57–100, 1993.
Joint International Topical Meeting on Mathematics & Computation and Supercomputing in Nuclear Applications (M&C + SNA 2007), Monterey, CA, 2007
9/9