0709.1234/ct.tex
1: %\documentclass[preprint]{aastex}
2: \documentclass[12pt,preprint]{aastex}
3: %\documentstyle{article}
4: \input epsf
5: 
6: \newcommand\bs{\hspace{-0.25cm}}
7: \newcommand\bss{\hspace{-0.07cm}}
8: 
9: \newcommand\tablevar       {1}
10: \newcommand\tablek         {2}
11: \newcommand\tableop        {3}
12: \newcommand\tablesim       {4}
13: 
14: 
15: 
16: \newcommand\figstencil     {1}
17: \newcommand\figct          {2}
18: \newcommand\figalfven      {3}
19: \newcommand\figdynamo      {4}
20: \newcommand\figalfvenb     {5}
21: \newcommand\figstagger     {6}
22: 
23: 
24: \newcommand\aaa{{\bf a}}
25: \newcommand\B{{\bf B}}
26: %\newcommand\k{{\bf k}}
27: \newcommand\E{{\bf E}}
28: \newcommand\J{{\bf J}}
29: \newcommand\bb{{\bf B}}
30: \newcommand\f{{\bf f}}
31: \newcommand\kk{{\bf k}}
32: \newcommand\s{{\bf s}}
33: \newcommand\U{{\bf U}}
34: \newcommand\V{{\bf V}}
35: \newcommand\A{{\bf A}}
36: \newcommand\vv{{\bf V}}
37: \newcommand\x{{\bf x}}
38: \newcommand\zze{{\bf \zeta}}
39: \newcommand\bnabla{\mbox{\boldmath $\nabla$}}
40: \newcommand\hh{\hspace{1mm}}
41: \newcommand\h{\hspace{-2mm}}
42: 
43: %\newcommand\bxi{\mbox{\boldmath $\xi$}}
44: %\newcommand\bomega{\mbox{\boldmath $\omega$}}
45: \newcommand\smf{\scriptscriptstyle\mathsf}
46: \newcommand\spa{\scriptscriptstyle\mathsf{Pade}}
47: \newcommand\spf{\scriptscriptstyle\mathsf{FD}}
48: %\newcommand\refnew#1{(\ref{#1})}
49: %\newcommand\lesssim
50: %{\mathrel{\hbox{\rlap{\hbox{\lower4pt\hbox{$\sim$}}}\hbox{$<$}}}}
51: %\newcommand\gtrsim
52: %{\mathrel{\hbox{\rlap{\hbox{\lower4pt\hbox{$\sim$}}}\hbox{$>$}}}}
53: %\\smf{\scriptscriptstyle\mathsf}
54: 
55: %\documentstyle{article}
56: %\documentstyle[psfig,../aasms4]{article}
57: %\documentclass[12pt]{cit_thesis}
58: %\usepackage{epsf,times,latexsym}
59: 
60: %\pagestyle{empty}
61: %\setlength{\topmargin}{-0.0in}
62: %\setlength{\headheight}{0in}
63: %\setlength{\headsep}{0in}
64: %\setlength{\voffset}{0in}
65: %\setlength{\textwidth}{7.25in}
66: %\setlength{\textheight}{10.5in}
67: %\setlength{\oddsidemargin}{.5in}
68: %\setlength{\evensidemargin}{.5in}
69: 
70: %\addtolength{\oddsidemargin}{-0.6in}
71: %\addtolength{\evensidemargin}{-0.6in}
72: %\addtolength{\topmargin}{-1.0in}
73: %\addtolength{\textwidth}{1.2in}
74: %\addtolength{\textheight}{1.5in}
75: %\setlength{\parskip}{0.15in}
76: 
77: 
78: \begin{document}
79: 
80: \nonumber
81: \setcounter{equation}{0}
82: 
83: \title{A constrained-transport magnetohydrodynamics algorithm with
84: near-spectral resolution.}
85: 
86: %\title{A finite difference magnetohydrodynamics algorithm with near
87: %ideal wavenumber resolution using high-order volume-centered constrained
88: %transport and tuned gradients.}
89: 
90: \author{Jason L. Maron\altaffilmark{1}}
91: \author{Mordecai-Mark Mac Low\altaffilmark{2}}
92: \author{Jeffrey S. Oishi\altaffilmark{3}}
93: \affil{Department of Astrophysics, American Museum of Natural History,
94: 79th Street at Central Park West, New York, NY 10024-5192}
95: \altaffiltext{1}{badger@amnh.org}
96: \altaffiltext{2}{mordecai@amnh.org}
97: \altaffiltext{3}{Also Department of Astronomy, University of Virginia,
98:   Charlottesville, VA; joishi@amnh.org}
99: 
100: 
101: \begin{abstract}
102: 
103: Numerical simulations including magnetic fields have become important
104: in many fields of astrophysics.  Evolution of magnetic fields by the
105: constrained transport algorithm preserves magnetic divergence to
106: machine precision, and thus represents one preferred method for the
107: inclusion of magnetic fields in simulations.  We show that constrained
108: transport can be implemented with volume-centered fields and
109: hyperresistivity on a high-order finite difference
110: stencil. Additionally, the finite-difference coefficients can be tuned
111: to enhance high-wavenumber resolution. Similar techniques can be used
112: for the interpolations required for dealiasing corrections at high
113: wavenumber.  Together, these measures yield an algorithm with a
114: wavenumber resolution that approaches the theoretical maximum achieved
115: by spectral algorithms.  Because this algorithm uses finite
116: differences instead of fast Fourier transforms, it runs faster and
117: isn't restricted to periodic boundary conditions.  Also, since the
118: finite differences are spatially local, this algorithm is easily
119: scalable to thousands of processors.  We demonstrate that, for
120: low-Mach-number turbulence, the results agree well with a high-order,
121: non-constrained-transport scheme with Poisson divergence cleaning.
122: 
123: \end{abstract}
124: 
125: 
126: \section{Introduction} \label{ct}
127: 
128: 
129: Many astrophysical flows involve dynamically significant magnetic fields, such
130: as molecular clouds, accretion disks, the galactic dynamo, jets, galaxy
131: clusters, stellar dynamos and coronae, the solar wind and the interstellar
132: medium. These problems tend to be three-dimensional, multiscale and turbulent,
133: so there is an ongoing interest in developing high-resolution and efficient
134: magnetohydrodynamics (MHD) algorithms for them. In this paper, we
135: outline an extension of the constrained transport algorithm (Evans \& Hawley
136: 1988) to the combination of higher spatial order and zone-centered grids, and
137: with resolution-enhanced tuned derivatives.  We then describe how these
138: measures fit together to yield an algorithm that closely approaches the
139: theoretical maximum wavenumber resolution of spectral algorithms.
140: 
141: \subsection{Constrained transport}
142: 
143: The induction equation for a magnetic field $\B$ and a velocity field $\V$
144: in ideal MHD is
145: \begin{equation}
146: \partial_t \B = \bnabla \times (\V \times \B). \label{eqct}
147: \end{equation}
148: Analytically, this equation conserves magnetic divergence: $\partial_t
149: (\bnabla \cdot \B) = 0$.  However, this may or may not be the case for
150: a finite-difference treatment of this equation.  T\'{o}th (2000)
151: reviews the methods taken by various algorithms to treat the
152: divergence in MHD simulations.  A spectral code explicitly projects
153: the Fourier components so that $\hat{\B}(\kk) \cdot \kk = 0$. For a
154: finite difference code, the magnetic field can be evolved by a
155: constrained transport scheme that preserves the magnetic divergence to
156: machine precision (Evans \& Hawley 1988).  Alternatively, if the
157: discretization doesn't conserve magnetic divergence, the divergence
158: can be removed with measures such as periodic use of a Poisson solver
159: (Brackbill \& Barnes 1980), adding a divergence diffusion term
160: $\partial_t \B = \bnabla \bnabla \cdot \B$ to the magnetic evolution,
161: or following an artificial and independently evolving divergence field
162: (Dedner et al.\ 2002) to propagate divergence away from where it is
163: produced and then dissipate it. The Powell scheme (Powell et al.\
164: 1999) adds a source term to advect divergence rather than let it grow
165: in place.  A finite difference code can also employ a vector potential
166: ${\bf A}$ such that $\B = \bnabla \times {\bf A}$, in which case the
167: magnetic divergence is automatically zero.  This requires the use of a
168: higher-order advection algorithm to ensure accurate
169: second-derivatives, as is done in the Pencil code (Brandenburg \&
170: Dobler 2002).
171: 
172: We denote any finite difference scheme for MHD that explicitly conserves the
173: magnetic divergence to machine precision
174: as constrained transport (CT), and any scheme that does not as
175: unconstrained transport (UT). Several variations of CT
176: are possible.  If the electric field is differenced as a curl: $\partial_t \B =
177: - \bnabla \times \E,$ 
178: then the magnetic divergence is preserved to machine
179: precision for most grid types (see Appendix).  Evans \& Hawley (1988)
180: introduced CT for staggered grids and T\'{o}th (2000)
181: showed that it works for centered grids as well (see the Appendix
182: for explanation of centered and staggered grids).  Londrillo \& Del Zanna
183: (2000) further showed that high-order CT is possible on
184: staggered grids with a radius-two stencil. In this paper, we show that
185: volume-centered CT is possible on arbitrarily large stencil
186: sizes, with hyperresistivity, and that the resolution of this algorithm
187: at moderately high order approaches the theoretical maximum exhibited by a
188: spectral code.
189: 
190: 
191: In \S~\ref{algorithms}, we discuss the specifics of the algorithm, and
192: in \S~\ref{simulations}, we describe test simulations that demonstrate
193: the capabilities of 
194: CT with high-order spatial derivatives.
195: 
196: \section{Algorithms} \label{algorithms}
197: 
198: Our algorithm is based on a constrained transport scheme, plus
199: measures to enhance the resolution and maintain stability.  High
200: wavenumber resolution is achieved by a combination of high-order and
201: tuned finite differences plus hyperdiffusivity, and stability is
202: achieved by Runge-Kutta timestepping and hyperdiffusivity.
203: 
204: \subsection{Timestepping}
205: 
206: A high-order timestepping scheme for the
207: evolution equations is essential for the
208: stability of most algorithms. The time update for a variable $Q(t)$ is
209: $Q(\Delta t) = Q(0) + \Delta t Q^*$, where $Q^*$ represents some
210: estimate of $\int_0^{\Delta t} \partial_t Q(t) dt$. One example is the
211: second-order Runge-Kutta scheme, which estimates $Q(\Delta t/2)
212: \approx Q(0) + (\Delta t / 2) Q^\prime(0),$ and then identifies $Q^* =
213: Q^\prime(\Delta t/2)$. Another class of algorithms maintains the
214: conservation of mass and momentum by computing fluxes through zone
215: boundaries. A variety of techniques exist for time-extrapolating the
216: fluxes at $t=\Delta t/2$, such as piecewise parabolic advection
217: (Colella and Woodward 1984), Total Variation Diminishing (Harten
218: 1983), Riemann solvers (Toro 1999), the method of characteristics
219: (Stone \& Norman 1992a, Hawley \& Stone 1995), and many more. MHD
220: poses a challenge to time extrapolation because there are seven or
221: eight wavemode characteristics, depending on the technique used for
222: treating magnetic divergence.  In particular, the well-known
223: method-of-characteristics algorithm interpolates along the Alfv\'en
224: characteristic while neglecting the fast and slow mode
225: characteristics.  For our simulations, we use Runge-Kutta for
226: time-extrapolation because it doesn't invoke any diffusive spatial
227: interpolations (\S~\ref{diffusivity}), and because it automatically
228: captures all three MHD wavemode types.  In our demonstration
229: implementation, we use second-order Runge-Kutta while the Pencil code
230: (Brandenburg \& Dobler 2002) uses third-order, although either order has
231: proven successful.
232: 
233: \subsection{Diffusivity} \label{diffusivity}
234: 
235: 
236: A common class of algorithms is based on momentum fluxes that are
237: time-extrapolated with upwind spatial interpolations.  The errors from
238: the interpolations required for these flux transport algorithms
239: produce an intrinsic diffusivity that can stabilize the evolution,
240: even in the absence of any explicit diffusive terms.
241: The nature and magnitude of the diffusivity has been characterized in
242: Zhong (1998) and Dobler et al (2006).
243: 
244: Runge-Kutta timestepping, on the other hand, has no spatial
245: interpolations, and thus no intrinsic diffusivity.
246: One then generally needs an explicit stabilizing diffusivity.
247: One has various options for the form of this diffusivity, with
248: Laplacian or hyper-Laplacian typically chosen.
249: These diffusivities have the benefit that their magnitude is easily
250: characterized, and the diffusive coefficient can be tuned to have the
251: minimum value necessary to preserve stability. Consider:
252: \begin{equation}
253: \partial_t \V =
254:   \nu_{\smf 2} \bnabla^2 \V
255: - \nu_{\smf 4} \bnabla^4 \V
256: + \nu_{\smf 6} \bnabla^6 \V
257: - \nu_{\smf [4]} \bnabla^{[4]} \V.
258: \end{equation}
259: Let the Fourier components be
260: $\hat{\V}(\kk),$ where $\kk = \{k_x, k_y, k_z\}$ is
261: the wavenumber.
262: They evolve according to
263: \begin{equation}
264: \partial_t \hat{\V}(\kk) =
265: - \nu_{\smf 2} \kk^2 \hat{\V}(\kk)
266: - \nu_{\smf 4} \kk^4 \hat{\V}(\kk)
267: - \nu_{\smf 6} \kk^6 \hat{\V}(\kk).
268: - \nu_{\smf [4]} (k_x^4 + k_y^4 + k_z^4) \hat{\V}(\kk).
269: \end{equation}
270: The $\nu_{\smf 2}$ term is the Laplacian viscosity and the others are
271: higher-order hyperdiffusivities. Specifically, $\bnabla^4 = \bnabla^2
272: \bnabla^2,$ $\bnabla^6 = \bnabla^2 \bnabla^2 \bnabla^2,$ and
273: $\bnabla^{[4]} = \partial_x^4 + \partial_y^4 + \partial_z^4.$
274: They differ in that
275: the higher the order, the more selective they are in diffusing high-k
276: structure while preserving low-k structure. Equivalently stated, high-order
277: hyperdiffusivities erase small-scale structure without affecting the larger
278: scales. For many physical applications, such as the
279: turbulent magnetic dynamo, the large scale structure is
280: unaffected by the nature of the small-scale diffusivity
281: (Haugen \& Brandenburg 2004), and so
282: in these instances, the use of hyperdiffusivity instead of Laplacian
283: diffusivity enhances the wavenumber resolution.
284: 
285: The $\bnabla^4$ operator is spherically symmetric in Fourier space
286: while the $\bnabla^{[4]}$ operator is not.  This affects the maximum-possible
287: timestep because in order to
288: be advectively stable, the Courant condition implies that the product $|k|
289: \Delta t$ must be less than a given value, and so the high-k corners of the 3D
290: Fourier cube are the most vulnerable to advective instability.
291: In these corners, the $\bnabla^4$ term delivers more diffusion
292: than the $\bnabla^{[4]}$ term, but with a
293: cost of twice as many finite difference operations.
294: 
295: Hyperdiffusivity acts together with high-order finite differences to
296: enhance the resolution of a simulation. High-order finite differences
297: allows structure to be finite differenced with less error,
298: and hyperdiffusivity allows this structure to evolve with less dissipation
299: than it would with Laplacian diffusivity.
300: 
301: 
302: Hyperdiffusivity can benefit the timestep as well as the resolution.  Suppose
303: one chooses the Laplacian term to provide the dominant fraction of the
304: diffusivity.  One typically then evaluates by trial and error the minimum value
305: of $\nu_{\smf 2}$ and the maximum timestep $\Delta t$ that one can get away
306: with to maintain stability. Once these values are chosen, the addition of a
307: small measure of hyperdiffusivity, small enough so as not to contribute
308: significantly to the total diffusivity, but large enough to affect the
309: highest-k structure, increases the maximum stable timestep by about 50\%.  This
310: technique works because the highest-wavenumber structure is the most vulnerable
311: to instability, and so the timestep depends most critically on the value of the
312: diffusivity for these wavenumbers.
313: 
314: One could additionally note that ``maximum stable timestep" is not sharply
315: defined. For instance, a timestep at the cusp of stability might be
316: unstable, but only after perhaps more than 10 timesteps. Also, the maximum
317: stable timestep depends on the maximum value of the velocity in the simulation,
318: which is changing in time.
319: 
320: \subsection{Magnetohydrodynamic equations}
321: 
322: The equations of incompressible MHD with diffusivity and hyperdiffusivity are
323: \begin{equation}
324: \partial_t \V = - \V \cdot \bnabla \V + \B \cdot \bnabla \B
325: + \nu_{\smf 2} \bnabla^2 \V
326: - \nu_{\smf 4} \bnabla^4 \V \label{equtv}
327: - \nu_{\smf [4]} \bnabla^{[4]} \V \label{equtv}
328: + \nu_{\smf 6} \bnabla^6 \V \label{equtv}
329: + \nu_{\smf [6]} \bnabla^{[6]} \V \label{equtv}
330: + \nu_{\smf D} \bnabla \bnabla \cdot  \V
331: \label{eqctv}
332: \end{equation}
333: \begin{equation}
334: \partial_t \B
335: =
336: \bnabla \times \left[
337: {\bf V} \times {\bf B}
338: - \eta_{\smf 2}     {\bf J}
339: + \eta_{\smf 4}     \bnabla^2 {\bf J}
340: - \eta_{\smf 6}     \bnabla^4 {\bf J}
341: - \eta_{\smf 2,[4]} \bnabla^[4] {\bf J}
342: \bf \right]
343: + \eta_{\smf D} \bnabla \bnabla \cdot \B
344: \label{eqctb}
345: \end{equation}
346: \begin{equation}
347: \J = \bnabla \times \B
348: \end{equation}
349: 
350: \begin{table}
351: \begin{center}
352: \begin{tabular}{
353: ll @{\hspace{25mm}}
354: ll}
355: \hline
356: \V         & Velocity   &  \B       & Magnetic field\\
357: 
358: %{\bf E}    & Electric field &
359:               & &
360: \J & Current ($\bnabla \times \B$) \\
361: 
362: $\nu_{\smf 2}$    & Laplacian Viscosity   &
363: $\eta_{\smf 2}$ & Laplacian resistivity\\
364: 
365: $\nu_{\smf 4}$    & Hyperviscosity for $\bnabla^4$ &
366: $\eta_{\smf 4}$   & Hyperresistivity for $\bnabla^4$ \\
367: 
368: $\nu_{\smf [4]}$  & Hyperviscosity for $\bnabla^{[4]}$ &
369: $\eta_{\smf [4]}$ & Hyperresistivity for $\bnabla^{[4]}$ \\
370: 
371: $\nu_{\smf 6}$    & Hyperviscosity for $\bnabla^6$ &
372: $\eta_{\smf 6}$   & Hyperresistivity for $\bnabla^6 $ \\
373: 
374: $\nu_{\smf 2,[4]}$ & Hyperviscosity for $\bnabla^2 \bnabla^{[4]}$ &
375: $\eta_{\smf 2,[4]}$& Hyperresistivity for $\bnabla^2 \bnabla^{[4]}$ \\
376: 
377: $\nu_{\smf [6]}$  & Hyperviscosity for $\bnabla^{[6]}$ &
378: $\eta_{\smf [6]}$ & Hyperresistivity for $\bnabla^{[6]}$ \\
379: 
380: $\nu_{\smf D}$    & Divergence viscosity &
381: $\eta_{\smf D}$   & Divergence resistivity\\
382: \hline
383: \end{tabular}
384: \end{center}
385: \caption{ \label{tablevar}
386: Variables in the equations of MHD}.
387: \end{table}
388: 
389: 
390: The variables are defined in Table (\ref{tablevar}).  The magnetic
391: equation~(\ref{eqctb}) is written as a curl so that the contrained
392: transport scheme can preserve the magnetic divergence (Appendix).  The
393: remaining term proportional to $\eta_{\smf D}$ outside of the curl has
394: the effect of diffusing away any magnetic divergence present, and does
395: nothing otherwise (\S~\ref{divergence}).  Similarly, the term
396: proportional to $\nu_{\smf D}$ term can be used to help quell kinetic
397: divergence in incompressible simulations, although for the simulations
398: in this paper we use a spectral projection to accomplish this.
399: 
400: We clarify the meaning of equation~(\ref{eqctb}),
401: by assuming that $\bnabla \cdot \B = 0:$
402: \begin{displaymath}
403: \partial_t \B
404: = \B \cdot \bnabla \V - \V \cdot \bnabla \B - \B \, \bnabla \cdot \V
405: \end{displaymath}
406: \begin{equation}
407: \label{laplaceb}
408: + \eta_{\smf 2}     \bnabla^2 \B
409: - \eta_{\smf 4}     \bnabla^4 \B
410: + \eta_{\smf 6}     \bnabla^6 \B
411: + \eta_{\smf 2,[4]} \bnabla^2 \bnabla^{[4]} \B
412: + \eta_{\smf D}     \bnabla \bnabla \cdot \B
413: \end{equation}
414: The $\J$ terms in equation~(\ref{eqctb}) are seen to have the role of
415: diffusivities in equation~(\ref{laplaceb}). In the simulations in
416: \S~\ref{simulations}, we use equation~(\ref{eqctb}) for
417: constrained transport and equation~(\ref{laplaceb})
418: for unconstrained transport.
419: 
420: Time centering of the staggered-grid and centered-grid constrained
421: transport equations encounter a similar circumstance as with the
422: kinetic equation.  In the staggered-grid constrained transport
423: configuration employed by Hawley and Stone (1995), the electric fields
424: are spatially interpolated from the nearest 8 velocity and magnetic
425: field vectors, and they are also time-interpolated to the next half
426: step with an Alfv\'en wave Method of Characteristics scheme (Hawley
427: and Stone 1995).  The implicit diffusivity inherent in these
428: interpolations stabilizes the magnetic field evolution, even in the
429: absence of explicit diffusivity.  For Runge-Kutta timestepping
430: on a centered grid, there are no spatial interpolations in
431: constructing the electric field, and no accompanying intrinsic
432: diffusivity. Some form of diffusivity is then generally required to maintain
433: stability.
434: 
435: 
436: 
437: \subsection{Divergence} \label{divergence}
438: 
439: 
440: In a constrained transport simulation, the magnetic divergence remains
441: zero to machine precision. For unconstrained transport, we set the
442: magnetic divergence to zero with a Poisson projection in Fourier space
443: once every four timesteps. In tests, we found that the evolution is
444: virtually identical whether the divergence is removed once every
445: timestep or once every four timesteps (Maron 2004), and in both cases
446: the fractional magnetic divergence remains below one percent.  For
447: both constrained and unconstrained transport simulations of
448: incompressible flow that we describe below, the kinetic divergence is
449: removed once every timestep in Fourier space, although for
450: quasi-incompressible flow, it suffices to do this only once every few
451: timesteps (Maron 2004).
452: 
453: The divergence diffusivity term $\partial_t \B = \eta_{\smf D} \bnabla
454: \bnabla \cdot \B$ is helpful for reducing the effect of magnetic
455: divergence in the timesteps between Poisson projections.  It diffuses
456: any magnetic divergence present, but otherwise does nothing. If
457: each Fourier component has the form $\hat{\B}({\bf k}) =
458: \hat{\B}_\parallel {\bf k} / |{\bf k}| + \hat{\B}_\perp$, then the
459: $\bnabla \bnabla \cdot \B$ term evolves $\hat{\B}$ as $\partial_t
460: \hat{\B}_\parallel = - k^2 \hat{\B}_\parallel$ and $\partial_t
461: \hat{\B}_{\perp} = 0$.  The divergence diffusivity is also helpful for
462: a constrained transport simulation. Without it, CT preserves the
463: magnetic divergence but does nothing to remove it. With the divergence
464: diffusivity, any divergence present is diffused away.
465: 
466: 
467: \subsection{Initialization} \label{initial}
468: 
469: The constrained transport algorithm evolves the magnetic field in such
470: a way as to conserve magnetic divergence. If the initial conditions
471: have zero divergence, the divergence remains zero indefinitely.
472: Even if any monopoles do grow slowly, they can be removed at negligible
473: computational expense with a Fourier projection, say, once every thousand
474: timesteps.Care
475: must be taken with the initial conditions, however, because the
476: divergence depends on the method for approximately evaluating
477: derivatives. One may use, for example, a spectral or a finite
478: difference divergence operator. For constrained transport to work, the
479: derivatives used for making the initial conditions divergenceless must
480: be the same as those used in the simulation.  Even an analytic
481: function with vanishing divergence may not have vanishing numerical
482: divergence.
483: 
484: 
485: To initialize the magnetic field, we apply the following procedure.
486: In three dimensions, let the wavenumbers for the
487: magnetic field Fourier components $\hat{\B}$
488: be ${\bf k}$, the length of each side of the simulation volume be
489: ${\bf L}$, and the number of grid zones on each side be ${\bf N}$. If
490: the magnetic divergence is defined spectrally, then the constraint on
491: the magnetic field is $\hat{\B}({\bf k}) \cdot {\bf k} = 0$.
492: For a finite difference derivative the constraint is slightly different.
493: If we use the high-order finite difference from \S~\ref{rez}
494: (eq.~\ref{stencil}), we can define an adjusted dimensionless wavenumber
495: by
496: \begin{equation}
497: k^*_i = \sum_{j=-S}^{S} m_j \sin(k_i L_i j / N_i),\end{equation} 
498: and then the finite difference condition for zero divergence
499: is
500: \begin{equation}\hat{\B}(\kk) \cdot \kk^* = 0
501: \label{divformula}.\end{equation} 
502: The initial conditions for a constrained
503: transport simulation should satisfy this condition, which is easily
504: implemented in Fourier space.  
505: 
506: 
507: \subsection{High-wavenumber finite differences} \label{rez}
508: 
509: High-order spatial derivatives can enhance the wavenumber resolution of a
510: simulation. To quantify this, define a function $f_j(x_j)$ on a periodic grid
511: $x_j = j$, with $j$ an integer. Then construct a finite difference derivative
512: $f^\prime(0)$ at $x=0$ using a
513: radius-$S$ stencil. The familiar result for the gradient on
514: a radius-one stencil
515: is $f^\prime(0) \sim (f_{1} - f_{-1})/2$, which is obtained from fitting a
516: polynomial of order $2$ to $f_j$ at $j=0$. For an order 4 polynomial on a
517: radius-two stencil, \begin{equation}f^\prime(0) \sim \frac{1}{12} f_{-2}
518:   - \frac{2}{3} f_{-1} + \frac{2}{3} f_1 - \frac{1}{12} f_2.
519: \end{equation} 
520: For a stencil of order $S$,
521: \begin{equation} f^\prime(0) \sim \sum_{j=-S}^{S} m_j f_j \label{stencil}
522: \end{equation} where $m_{-j} = -m_j$. The coefficients for a radius-three stencil
523: are $\{m_1,m_2,m_3\}=\{3/4,3/20,1/60\}$.
524: 
525: Consider the finite-difference error at $x=0$
526: for a Fourier mode $\sin(\pi k x)$.
527: (Cosine modes can be ignored because they don't contribute to the derivative at
528: $x=0$.)  We scale the wavenumber $k$ to grid units so that $k=1$
529: corresponds to the maximum (Nyquist) wavenumber expressible on the grid. The
530: finite difference formula (eq.~\ref{stencil}) gives
531: \begin{equation}
532: f_k^\prime(0) \sim 2
533: \sum_{j=1}^S m_j \sin(\pi j k) \label{eqderiv}
534: \end{equation}
535: whereas the correct value is $k \pi$. The spectral procedure of taking
536: the derivative by transforming to Fourier space and back gives the
537: correct value up to $k=1$, but at a cost of $5 \log_2N$ floating point
538: operations per grid point per transform, where $N$ is the number of
539: grid points, whereas the finite difference derivative (equation
540: \ref{stencil}) on a radius $S$ stencil costs $3S-1$ floating point
541: operations.  Figure~(\ref{figstencil}) exhibits the accuracy of finite
542: difference derivatives of different orders as a function of
543: wavenumber.  The wavenumber resolution increases with polynomial order.
544: 
545: The polynomial fit can be tuned by adjusting the coefficients to
546: enhance high-wavenumber accuracy substantially at the expense of a
547: negligible loss of accuracy at low wavenumbers (Maron
548: 2004). Table~\ref{tablek} gives the coefficients for finite difference
549: operators at various orders, along with the maximum wavenumber for
550: which they are 0.5\% accurate.  In Figure~\ref{figstencil} we also
551: show the wavenumber accuracy for a
552: radius-three stencil using tuned coefficients,
553: designed to have a relative precision of $< 0.5$\% for $k=0$ to $0.50$. We
554: will see in \S~\ref{overlap} that a simulation based on this tuned radius-three
555: scheme performs better than a radius-four simulation with conventional
556: coefficients.
557: We note that power spectra do not reveal a difference
558: between turbulence simulations with tuned and untuned coefficients,
559: because errors in the derivative manifest as an advective dispersion
560: rather than as a diffusivity.  One has instead to examine the fields
561: in real space rather than in Fourier space.
562: 
563: \begin{figure}
564: \plotone{f1.eps}
565: \caption{ \label{figstencil}
566: The accuracy of finite-difference derivatives as a function of
567: the Nyquist-scaled wavenumber $k.$ ``Polynomial-N" denotes a
568: radius-N stencil with polynomial-based coefficients, and ``Tuned-N"
569: denotes a radius-N stencil with tuned coefficients (\S~\ref{rez} and
570: Table~\ref{tablek}). The ``Exact" curve is the derivative as
571: evaluated by a Fourier transform. A radius-N stencil with
572: polynomial-based coefficients is accurate to order $2N.$}
573: \end{figure}
574: 
575: \begin{table}
576: \begin{center}
577: \begin{tabular}{lrrrrrrrrrl}
578: \hline
579: Operation &\bs $m_0$&\bs $m_1$&\bs $m_2$&\bs $m_3$&\bs $m_4$&\bs $m_5$&
580: \bs $m_6$&$m_7$&$m_8$ & $k_{max}$\\
581: \hline
582: 
583: $\partial/\partial x$\,(P1)&\bs 0&\bs 0.50000&\bs &\bs &
584: \bs &\bs &\bs &\bs &\bs & 0.12\\
585: 
586: $\partial/\partial x$\,(P2)&\bs 0&\bs 0.66667&\bs -0.08333 & \bs &
587: \bs &\bs &\bs &\bs &\bs & 0.24\\
588: 
589: $\partial/\partial x$\,(P3)&\bs 0&\bs 0.75000&\bs -0.15000 &\bs 0.01667&
590: \bs &\bs &\bs &\bs &\bs & 0.34\\
591: 
592: $\partial/\partial x$\,(P4)&\bs 0&\bs 0.80000&\bs -0.20000 &\bs 0.03810&
593: \bs-0.00357 &\bs &\bs &\bs &\bs & 0.40\\
594: 
595: $\partial/\partial x$\,(P5)&\bs 0&\bs 0.83333&\bs -0.23810 &\bs 0.05952&
596: \bs-0.00992 &\bs 0.00079&\bs &\bs &\bs & 0.44 \\
597: 
598: $\partial/\partial x$\,(P8)&\bs 0&\bs 0.88889&\bs -0.31111&\bs 0.11313&
599: \bs -0.03535&\bs 0.00870&\bs -0.00155&\bs 0.00018&\bs -0.00001 & 0.56 \\
600: 
601: $\partial/\partial x$ (T3)& \bs 0 &\bs 0.81796&\bs -0.21324&\bs 0.03683&
602: \bs        &\bs &\bs &\bs &\bs & 0.50 \\
603: 
604: $\partial/\partial x$ (T8)& \bs 0 &\bs  0.95951 &\bs -0.42312 &\bs 0.22746 &
605: \bs -0.12450 &\bs 0.06461 &\bs -0.03004 &\bs 0.01156 &\bs -0.00273 & 0.76\\
606: 
607: %Tune-8 k=.76 w=.00092039 0.9595116 -0.4231150 0.2274565 -0.1244969 0.6460959E-01
608: %                -0.3004304E-01  0.1155808E-01 -0.2727237E-02 m=16/20
609: 
610: $\partial/\partial x$ (T8)& \bs 0 &\bs  0.96685    &\bs -0.43635  &\bs  0.24410  &
611: \bs -0.14168       &\bs  0.07976 &\bs -0.04148 &\bs  0.01884 &\bs -0.00536 & 0.80 \\
612: 
613: %Tune-8, k=.80, w=.00266301
614: %.9668453 -0.4363475 0.2441007 -0.1416759E+00
615: %                0.7975759E-01 -0.4148324E-01  0.1883914E-01 -0.5359367E-02
616: 
617: 
618: $\partial^2/\partial x^2$ \bss (P3)&\bs -2.72222&\bs 1.5&\bs -0.15&
619: \bs 0.01111&\bs &\bs &\bs &\bs &\bs & \\
620: 
621: $\partial^4/\partial x^4$ \bss (P3)&\bs 9.33333 &\bs -6.5 &\bs 2.&
622: \bs -0.16667&\bs &\bs &\bs &\bs &\bs & \\
623: 
624: $\partial^6/\partial x^6$ \bss (P3)&\bs -20.&\bs 15. &\bs -6. &
625: \bs 1. &\bs &\bs &\bs &\bs &\bs & \\
626: 
627: Interpolation \bss (P3) & \bs 0 &\bs  0.58594 &\bs -0.09766 &\bs  0.01172 &
628: \bs        &\bs &\bs &\bs &\bs & 0.35 \\
629: 
630: Interpolation \bss (T3) & \bs 0 &\bs  0.60103 &\bs -0.12312 &\bs  0.02214 &
631: \bs        &\bs &\bs &\bs &\bs & 0.50 \\
632: 
633: Interpolation \bss (T8) & \bs 0 &\bs   0.63099 &\bs -0.19580 &\bs  0.10149&
634: \bs  -0.05770 &\bs  0.03248&\bs -0.01709&\bs  0.00793&\bs -0.00233& 0.80  \\
635: 
636: %tune-8 k=.80 w=.00119544
637: %     0.6309936E+00 -0.1958019E+00  0.1014883E+00 -0.5769893E-01  0.3247978E-01
638: %    -0.1708539E-01  0.7929849E-02 -0.2326164E-02
639: 
640: 
641: \hline
642: \end{tabular}
643: \end{center}
644: \caption{ \label{tablek}
645: Coefficients for finite difference
646: operations. The column $``k_{max}"$ indicates the maximum wavenumber
647: for which the operator is no worse than $0.5 \%$ accurate.  For the odd-order
648: derivatives, $m_{-j} = -m_j$, and for the even-order derivatives as
649: well as the interpolations, $m_{-j} = m_j$. The interpolation
650: coefficients are for interpolation to a point halfway between two grid
651: zones using the nearest $S$ grid points on each side (\S~\ref{interpolate})
652: }.  
653: \end{table}
654: 
655: \subsection{Dealiasing} \label{dealiasing}
656: 
657: Nonlinear terms in the MHD equations such as $\V \cdot \bnabla \V$
658: suffer an aliasing error for high-wavenumber structure.  We first
659: illustrate this with a 1D example before treating the 3D case (Canuto
660: et al.\ 1987).  Let $A_j$ and $B_j$ be discrete functions on a
661: one-dimensional grid with $N=16$ grid points: $1 \leq j \leq N$, and
662: with accompanying Fourier modes ranging from $-N/2 \leq s \leq
663: (N/2)-1.$ The Fourier expansion of $A$ is \begin{equation} A_j =
664: \sum_{s=-N/2}^{N/2-1} \hat{A}_s \, \exp(2 \pi i j s / N)
665: \end{equation} and similarly for $B_j$. Let $A$ and $B$ each be
666: composed of a single Fourier mode with $s=6$. The product $C = A B$ is
667: then composed of a single Fourier mode with $s=12$, but in this
668: discrete representation, this is equivalent to $s=-4$. This remapping
669: of high wavenumber modes to low wavenumber modes is known as aliasing
670: error.  Note that $s=6$ is within the Nyquist limit of $|s| \leq N/2$
671: while the product mode $s=12$ is not. While $A_j$ and $B_j$ might be
672: resolvable on the grid, their product need not be.  This can be fixed
673: by truncating before and after the product all modes outside $|s| \leq
674: N/3$ to ensure that no modes in the product will exceed the Nyquist
675: limit.  A spectral code can make this truncation because the fields
676: are in Fourier space, while a finite difference code cannot. As a
677: practical matter it suffices to set the diffusivities high enough so
678: that negligible structure exists outside the $N/3$ aliasing limit.
679: 
680: Alternatively, 
681: the aliasing problem can be remedied with a
682: staggered-grid correction (Canuto et al.\ 1987), and then
683: the truncation isn't necessary.  Additionally, this allows
684: us to simulate structure beyond $k=2/3.$ We first exhibit this
685: procedure in 1D and then extend it to 3D below. To implement
686: the staggered-grid correction, first construct the
687: usual product $C_j = A_j B_j$. Then interpolate the centered grids
688: $A_j$ and $B_j$ to the staggered grids $A_{j+1/2}$ and $B_{j+1/2}$,
689: multiply to produce $C_{j+1/2}$ and transform back to the centered
690: grid $C_j^\prime$. Finally, combine the centered and staggered results
691: as $C_j \leftarrow (C_j + C_j^\prime) / 2$. This result is free from
692: aliasing error for all Fourier modes, and so no Fourier-space
693: truncation is necessary.  In Fourier space, the fields on the
694: staggered grid can be computed exactly by applying a phase shift to
695: each Fourier mode. A finite difference scheme can accomplish this with
696: the high-order interpolation discussed in \S~\ref{stagger}.
697: 
698: In three dimensions the aliasing error can be eliminated by truncating
699: the Fourier modes outside $|{\bf \vec{s}}| < {\bf \vec{N}}/3$, where
700: ${\bf \vec{s}} = \{s_x,s_y,s_z\}$ and ${\bf \vec{N}} = \{N_x, N_y,
701: N_z\}$. The grid-shift correction is more complicated. Seven grid
702: shifts are needed to completely correct the error, but it is more
703: efficient to settle for a more limited correction involving just one
704: shift (Canuto et al.\ 1987).  Interpolate $A$ and $B$ to the staggered
705: grid $\{j_x+1/2,j_y+1/2,j_z+1/2\}$, multiply, return to the centered
706: grid $\{j_x,j_y,j_z\}$, and as in the one-dimensional case, average
707: the result with the product carried out on the original centered grid.
708: This yields an alias-free result if accompanied by a Fourier
709: truncation of all modes outside $|{\bf \vec{s}}| < \sqrt{3} {\bf
710: \vec{N}}/2$, which is 94 \% of the Nyquist limit. For a finite
711: difference code, the diffusivity can be set to minimize the energy
712: outside the truncation zone.
713: When the three-dimensional, staggered-grid, aliasing correction is
714: combined with high-order, volume-centered, constrained transport,
715: magnetic divergence is still preserved to machine precision. This
716: scheme uses the high-order finite differences and interpolations
717: discussed in \S~\ref{rez} and \S~\ref{interpolate}.
718: 
719: 
720: \subsection{Interpolation} \label{interpolate} \label{stagger}
721: 
722: High-order interpolation allows implementation of the staggered
723: aliasing correction discussed in \S~\ref{dealiasing}.  It can also be
724: used for doubling the grid size. In this case, the new points in the
725: doubled three-dimensional grid can be generated with a set of
726: interpolations along and diagonal to the three grid axes. Doubling the
727: grid is also useful for interpolating to points that are not exactly
728: halfway between grid points. For example, the grid can be doubled with
729: the high-order interpolation discussed above, and then a simpler
730: algorithm can be used to further interpolate to a point anywhere
731: within the refined grid.  We used this technique to trace the path of
732: magnetic fieldlines in our studies of cosmic ray diffusion (Maron
733: 2003), and also for doubling the resolution of turbulent dynamo
734: simulations in Maron et al.\ (2004).  Lastly, we have found that
735: high-order tuned derivatives and interpolations are useful for
736: post-simulation analysis of timeslice data without the need for
737: computationally expensive fast Fourier transforms.
738: 
739: A high-order interpolation to a point halfway between two grid points
740: can be accomplished with
741: \begin{equation}
742: f_{j+1/2} = \sum_{i=1}^S m_i (f_{j+i} + f_{j+1-i}).
743: \label{eqinterp}
744: \end{equation}
745: The error in the interpolation as a function of wavenumber can be calculated by
746: applying
747: equation~(\ref{eqinterp}) to a cosine mode centered on $f_{j+1/2}$:
748: $f_i = \cos(\pi k (i - (j + 1/2)))$.
749: The interpolated value is
750: \begin{equation}
751: f_{j+1/2}^* = \sum_{i=1}^S m_j \cos(\pi i k)
752: \end{equation}
753: whereas the correct value is $f_{j+1/2} = 1$.
754: Table~\ref{tablek} gives coefficients for
755: an interpolation based on a radius-three
756: stencil from a polynomial fit to $f_j$, in the row labeled
757: ``Interpolation (P3)." Tuning the coefficients can improve the
758: wavenumber resolution of the interpolation in a similar manner as was done
759: for the derivative.
760: Tuned
761: coefficients for radius 3 and 8 stencils are given in Table~(\ref{tablek})\,
762: in the rows labeled T3 and T8, with the column labeled $k_{max}$
763: giving the maximum wavenumber for which the interpolation is $0.5 \%$ accurate.
764: 
765: 
766: \subsection{Operation count} \label{sectionop}
767: 
768: A finite difference derivative on a radius $S$ stencil costs $S$ multiplies and
769: $2S - 1$ adds. Since add and multiply units tend to come in pairs on most
770: modern machines, this is effectively $4S - 2$ floating point operations per
771: grid cell. A code with $F$ finite difference convolutions per timestep involves
772: $F(4S-2)$ floating point operations.
773: 
774: 
775: The computation cost per timestep scales as the number of derivatives
776: computed per grid element per time update. For constrained transport,
777: one needs to calculate three derivatives for $\partial_i \rho$, three
778: for $\partial_i e$, nine for $\partial_i \V_j$, six for $\bnabla
779: \times \B$ and six for $\bnabla \times \E$. Diffusion terms such as
780: $\bnabla^2 \V$ and $\bnabla^2 \J$ aren't included in the tally because
781: they need only be applied every few timesteps (Maron 2004). The same
782: is true for the Fourier-space Poisson projection to make the fields
783: divergenceless. Maron (2004) found that the results were
784: effectively identical whether these terms were applied once every
785: timestep or once every four timesteps.
786: 
787: In Table~\ref{tableop} we list the number of derivatives computed per timestep
788: for various classes of algorithms.  Pencil is a vector potential code
789: (Brandenburg \& Dobler 2002) that calculates $\J$ directly from $\A$ to take
790: advantage of the cache memory.  This involves 15 distinct 2-level derivatives
791: computed from a 2D stencil.
792: For a radius-S finite difference, a 2D derivative
793: involves $4S^2 - 1$ adds,
794: compared to $2S - 1$ adds for a conventional 1D derivative.
795: We don't consider multiples because they are always less numerous than
796: adds, and because CPUs tend to feature
797: add and multiply units in pairs.
798: As a result, a 2D derivative corresponds to $2S+1$ times the computational
799: effort of a conventional 1D derivative.
800: Thus, the calculation of $\J$ with $S=3$ corresponds effectively to about $105$
801: conventional derivatives.
802: Alternatively, a vector potential algorithm can instead calculates
803: $\B$ from $\A$ and then $\J$ from $\B$ in separate stages, at a possible
804: cost of extra memory latency. In table~\ref{tableop}, we denote a vector
805: potential algorithm that calculates $\J$ directly from $\A$ as ``1-stage,"
806: and a vector potential algorithm that calculates $\B$ from $\A$ and then
807: $\J$ from $\B$ as ``2-stage."
808: The constrained transport
809: algorithm evolves $\V$ and $\B$ according to equations~(\ref{eqctv})
810: and~(\ref{eqctb}), and the unconstrained transport algorithm evolves $\V$ and
811: $\B$ according to equations~(\ref{eqctv}) and~(\ref{laplaceb}). The spectral
812: algorithm computes 15 Fourier transforms instead of derivatives and thus
813: doesn't directly compare with the finite difference codes.
814: 
815: A vector potential code such as Pencil can be adapted to the algorithm
816: described here by substituting equation~(\ref{eqctb}) for the vector
817: potential equation, and by changing the finite difference coefficients
818: from the polynomial-based values to the tuned values. This allows one to
819: compute boundary conditions using the magnetic field instead of the
820: vector potential.  However, there is an extra round of inter-processor
821: communication associated with calculating ${\bf J}$ from $\B$ and then
822: applying the curl.
823: 
824: \begin{table}
825: \begin{center}
826: \begin{tabular}{lll}
827: \hline
828: Algorithm & Terms & Derivatives \\
829: \hline
830: 
831: Constrained transport &
832: $\partial_i \rho$, $\partial_i e$, $\partial_i \V_j$,
833: $\bnabla \times \B$, $\bnabla \times \E$&
834: 27\\
835: 
836: Unconstrained transport &
837: $\partial_i \rho$, $\partial_i e$, $\partial_i \V_j$, $\partial_i \B_j$,
838: $\partial_i (\bnabla \cdot \B)$ &
839: 30 \\
840: 
841: 2-stage vector potential &
842: $\partial_i \rho$, $\partial_i e$, $\partial_i \V_j$,
843: $\bnabla \times \A$, $\bnabla \times \B$ &
844: 27 \\
845: 
846: 1-stage vector potential (Pencil) &
847: $\partial_i \rho$, $\partial_i e$, $\partial_i \V_j$,
848: $\bnabla \times \A$, $\bnabla \times \bnabla \times \A$ &
849: 120 \\
850: 
851: %Pencil &
852: %$\partial_i \rho$, $\partial_i e$, $\partial_i \V_j$,
853: %$\partial_{ii} \A_j$, $\partial_{ij} \A_k$ &
854: %42 \\
855: 
856: Spectral &
857: 15 Fourier transforms &
858: N/A \\
859: 
860: %$\sim$ 100 \\
861: 
862: \hline
863: \end{tabular}
864: \end{center}
865: \caption{
866: \label{tableop} The number of derivatives computed per time update
867: (see \S~\ref{sectionop}).}
868: \end{table}
869: 
870: A convenient unit for execution speed is
871: Kilo-grid Elements per CPU GigaFLOPS per Second (KEGS).  A constrained
872: transport code with a radius-three stencil and two Runge-Kutta steps per
873: timestep
874: would run ideally at a speed of 1850 KEGS. The actual speed is slower of course
875: because of overhead and because the finite difference convolutions don't run at
876: the peak floating point speed.  In benchmarks, we have observed that
877: the Pencil code, which has 3 Runge-Kutta
878: stages, runs at a speed of around 100 KEGS for serial operation and
879: 
880: 50 KEGS for massively parallel operation.  For comparison, the highly-optimized
881: spectral-MHD code Tulku (Maron \& Goldreich 2001), has a speed of around
882: 80 KEGS in serial and 40 KEGS in parallel (Maron 2004).
883: 
884: 
885: \section{Simulations} \label{simulations}
886: 
887: \subsection{The turbulent nonhelical dynamo} \label{dynamo}
888: 
889: Our first test model is the turbulent, nonhelical, MHD dynamo
890: (Batchelor 1950), which is the magnetic analogue of the Kolmogorov
891: cascade for hydrodynamic turbulence.  The Kolmogorov cascade is the
892: long-term, steady state of hydrodynamic turbulence that is forced at
893: the large scale and dissipated by viscosity at the small scale, and it
894: has an energy spectrum of $E(k) \sim k^{-5/3}$. The nonhelical MHD
895: dynamo has the same setup but includes a spatially homogeneous
896: magnetic field with unit magnitude and zero mean. Maron et al.\ (2004)
897: found that the steady state of this system has a kinetic
898: energy spectrum of $E(k) \propto k^{-2}$, where the energy is
899: dominantly in large-scale eddys, and a magnetic spectrum with the
900: energy predominantly in the smallest-scale (resistive-scale) magnetic
901: structures. The kinetic and magnetic spectra are shown in figure
902: \ref{figct}.
903: \begin{figure}
904: {\plottwo{f2a.eps}{f2b.eps}}
905: \caption
906: { \label{figct} {\em (a)} The kinetic ($\V$) and magnetic ($\B$)
907: spectra for a set of simulations with identical initial conditions,
908: after two crossing times.  {\em (b)} The value of $B_y$ along a grid
909: line parallel to the $x$-axis after 0.4 crossing times, for the same
910: set of simulations.  The high-order constrained and unconstrained
911: transport simulations (CT3, CT8 \& UT8) more closely resemble each
912: other than they do the low-order constrained transport simulations
913: (CT1 \& CT2).}
914: \end{figure}
915: 
916: 
917: \subsubsection{Models}
918: 
919: We ran a set of simulations of forced homogeneous MHD turbulence (Table
920: \ref{tablesim}) with and without constrained transport and at various spatial
921: orders to test the effectiveness of high-order constrained
922: transport. Each simulation has the same timestep,
923: viscosity and resistivity. The grid used in all cases
924: has $64^3$ zones covering a periodic unit cube.  The forcing power, density,
925: initial RMS velocity and magnetic field are all unity, and they remain so in
926: the long-term steady state.  
927: 
928: The initial state is the same for all
929: simulations. It was taken from a simulation of forced magnetized turbulence
930: (\S~\ref{dynamo}) in the long-term steady state. The magnetic divergence is
931: zero in Fourier space: $\hat{\B}(\kk) \cdot \kk = 0$. The initial state was
932: modified slightly for the constrained transport simulations to make it
933: magnetically divergenceless according to the finite-difference derivative
934: (\S~\ref{initial}).  This amounts to a very small adjustment in the fields,
935: much less than the difference between the fields after a crossing time of
936: evolution.
937: 
938: Constrained transport needs some form of diffusivity, either Laplacian
939: or hyperdiffusivity, to maintain stability. With diffusivity, it is
940: stable indefinitely, whereas it is unstable without it. To establish
941: this, we evolved the MHD equations with constrained transport for ten
942: crossing times stably.  The diffusivities used in these models are
943: Laplacian viscosity $\nu_2 = 10^{-3}$, hyperviscosity $\nu_{\smf [4]} = 2.5
944: \times 10^{-8}$ and hyperresistivity $\eta_{\smf 2,[4]} = 7 \times 10^{-12}$,
945: which we empirically find are the minimum values that maintain
946: stability for $V_{\smf RMS} = B_{\smf RMS} = 1$ on a $64^3$ grid.
947: Expressed in dimensionless form:
948: $\overline{\nu}_n = \nu_n / (V_{\smf RMS} dx^{n-1})$
949: and $\overline{\eta}_n = \eta_n / (V_{\smf RMS} dx^{n-1}),$ these are
950: $\overline{\nu}_2 = .064,$ $\overline{\eta}_{\smf [4]} = 6.6 \cdot 10^{-3}$
951: and $\overline{\eta}_{\smf 2,[4]} = 7.5 \cdot 10^{-3}.$
952: 
953: 
954: 
955: \begin{table}
956: \begin{center}
957: \begin{tabular}{|llrlll|}
958: \hline
959: Tag   & Method  & Stencil & Finite difference & $k_{max}$ & $L_2$ norm\\
960:       &         & radius  & technique         &           & \\
961: \hline
962: CT1   & Constrained transport   & 1 & Polynomial           & 0.12 & 0.561 \\
963: CT2   & Constrained transport   & 2 & Polynomial           & 0.24 & 0.193 \\
964: CT3   & Constrained transport   & 3 & Polynomial           & 0.34 & 0.083 \\
965: CT4   & Constrained transport   & 4 & Polynomial           & 0.40 & 0.042 \\
966: CT5   & Constrained transport   & 5 & Polynomial           & 0.44 & 0.023 \\
967: CT8   & Constrained transport   & 8 & Polynomial           & 0.56 &  0   \\
968: CT3t1 & Constrained transport   & 3 & Tuned                & 0.50 & 0.034 \\
969: CT3t2 & Constrained transport   & 3 & Tuned                & 0.52 & 0.037 \\
970: UT8   & Unconstrained transport & 8 & Polynomial           & 0.56 & 0.267 \\
971: \hline
972: 
973: \end{tabular}
974: \end{center}
975: \caption{
976: \label{tablesim}
977: Index of simulations. CT and UT denote constrained
978: and unconstrained transport. The column labeled ``finite difference technique"
979: specifies whether
980: the finite difference coefficients are from a polynomial fit or if they
981: have been tuned to enhance high-wavenumber accuracy
982: (\S~\ref{rez}).
983: $k_{max}$ denotes the largest wavenumber for which derivatives are $0.5 \%$
984: accurate.
985: The $L_2$ norms are taken with respect to UT8, as discussed in \S~\ref{overlap}
986: The simulations with tuned coefficients are
987: CT3t1, which has $k_{max}$
988: set to $0.50$, and CT3t2, which has $k_{max}$ set
989: to $0.52$.
990: }
991: \end{table}
992: 
993: 
994: 
995: The forcing is the same as used by Maron et al.\ (2004).  A random forcing
996: field is added to the velocity every timestep.  The spectrum of the forcing
997: field is $k^{-5/3}$, truncated 2.5 lattice units from the origin in Fourier
998: space, and the Fourier components have random phases. The forcing power,
999: simulation volume and density are unity, which yields RMS velocity and
1000: magnetic fields of order unity (Maron 2004).
1001: 
1002: 
1003: \subsubsection{Results} \label{overlap}
1004: 
1005: The diffusivities are
1006: given in \S~\ref{simulations}.
1007: We plot the kinetic and magnetic spectra in figure \ref{figct}{\em (a)}.  The
1008: spectra are very similar for constrained and unconstrained transport
1009: simulations, and also for different orders.  However the spectra alone
1010: do not distinguish between simulations of different orders because an
1011: error in the derivative manifests itself as an advective dispersion
1012: rather than as a diffusivity (\S~\ref{rez}). One instead has to
1013: examine the fields in real space.
1014: 
1015: In Figure~\ref{figct}{\em (b)}, we compare the magnetic fields at
1016: t=0.4 crossing times. For the comparison, we examine the difference
1017: between the fields integrated over space by computing the $L_2$ norm
1018: between simulations $i$ and $j:$ \begin{equation} A_{ij}^2 = \frac{
1019: \int [B_y(i) - B_y(j)]^2 d(\mbox{Vol})} {\int B_y(i)^2 d\mbox{Vol} +
1020: \int B_y(j)^2 d(\mbox{Vol})}.
1021: \end{equation} 
1022: Stone et. al. (1992b) argue that this kind of comparison is more
1023: meaningful than merely plotting the overlay of both fields.  The
1024: constrained transport simulation with polynomial-based finite
1025: differences on a radius-eight stencil (CT8 in Table \ref{tablesim}) serves
1026: as the basis of comparison.
1027: We compare the constrained transport simulations to an unconstrained
1028: transport simulation on a radius-eight tuned finite-difference stencil (UT8).
1029: We use UT8 as a stand-in for the spectral algorithm because of its high
1030: wavenumber resolution.
1031: 
1032: The spectral algorithm delivers the highest-attainable resolution because
1033: spectral derivatives are exact for all wavenumbers.  With this, a 3D
1034: spectral simulation without an aliasing grid-shift correction can resolve
1035: structure up to k=2/3, and with a grid-shift correction it can resolve up to
1036: k=.94 (Canuto 1987).  The spectral algorithm can also set the magnetic
1037: divergence to zero in Fourier space at negligible cost.
1038: Unconstrained transport does not explicitly conserve
1039: magnetic divergence and so in model UT8 the divergence is cleaned with a
1040: Fourier projection every timestep. We also tried applying the correction
1041: every fourth timestep and with virtually identical results.
1042: The radius-eight stencil of UT8 yields derivatives that are accurate up to
1043: k=.56.
1044: 
1045: The $L_2$ norms given in
1046: Table~(\ref{tablek}) show how the simulations progressively approach
1047: the CT8 result as the stencil size increases.  
1048: The match is poor for CT1 and better for CT3. 
1049: We also note that the radius-three simulation with
1050: tuned derivatives (CT3t) performs better than the radius-four simulation
1051: with polynomial-based derivatives, establishing the effectiveness of
1052: tuned derivatives.
1053: This can also be qualitatively seen in Figure (\ref{figct}), where
1054: we see that the fields for CT8 and UT8 are closely aligned
1055: (Fig.~\ref{figct}), and that they also
1056: closely resemble those for CT3.
1057: 
1058: We attribute the remaining differences between CT8 and UT8 to the fact that
1059: the magnetic divergence is removed spectrally in UT8, while it is handled
1060: by constrained transport in CT8.
1061: Collectively, the high-order constrained and unconstrained transport
1062: simulations (CT3, CT8 \& UT8) more closely resemble each other than they do the
1063: low-order constrained transport simulations (CT1 \& CT2).  We conclude that CT3
1064: is already a good approximation to the spectral algorithm.
1065: 
1066: 
1067: \subsection{Comparison of the constrained transport and vector potential
1068: techniques} \label{pencil}
1069: 
1070: 
1071: We adapted the vector potential code Pencil to run in
1072: CT mode and used it to compare the vector potential and CT techniques.
1073: We ran an Alfv\'en wave
1074: on a $32^3$ grid with zero viscosity and resistivity.
1075: (Figure~\ref{figalfven}).
1076: After ten crossing times, both the vector potential and CT techniques yield
1077: wave profiles that agree with each other to within 1 percent.
1078: The shape of the profiles are also well-matched with the initial conditions,
1079: with a phase error of 10 percent.
1080: 
1081: 
1082: We also used both techniques to run a turbulent dynamo simulation 
1083: We started with an initially
1084: weak magnetic field in the form of a Beltrami wave and applied helical forcing
1085: until it grew to a steady state. The box size is $(2\pi)^3$, the density
1086: is unity, the forcing power is equal to $0.07,$
1087: the viscosity is equal to $5 \cdot 10^{-3},$ and the resistivity is equal
1088: to $5 \cdot 10^{-3}.$
1089: The RMS magnetic field
1090: strength is plotted in Figure~(\ref{figdynamo}). 
1091: After 30 crossing times, the values for $B_{RMS}$ for the CT and vector
1092: potential techniques agree to 1 percent (Figure~\ref{figdynamo}).
1093: 
1094: \begin{figure}
1095: \plottwo{f3a.eps}{f3b.eps}
1096: \caption{
1097: \label{figalfven} The Alfv\'en wave profile after ten crossing
1098: times, with {\em (a)} the Pencil code using the vector potential form
1099: of the induction equation and {\em (b)} using CT (\S~\ref{pencil}).
1100: Alfven units denote the fluctuating field strengths compared to the
1101: uniform component of the magnetic field.
1102: } \end{figure}
1103: 
1104: \begin{figure}
1105: \plotone{f4.eps}
1106: \caption{
1107: \label{figdynamo} We plot the RMS magnetic field strength for a
1108: turbulent dynamo simulation using the Pencil code
1109: in vector potential and CT mode (\S~\ref{pencil}).
1110: Both techniques agree to 1 percent after 30 crossing times.
1111: }
1112: \end{figure}
1113: 
1114: \subsection{Oblique Alfv\'en wave test} \label{sectionalfven}
1115: 
1116: We ran an Alfv\'en wave test where the propagation axis is oblique
1117: to the grid axes, with the initial conditions in
1118: Gardiner \& Stone (2005):
1119: \begin{equation}
1120: \V = \{ 0, \,\,\, 0.1 \sin(2 \pi x + 4 \pi y), \,\,\,
1121: 0.1 \cos(2 \pi x + 4 \pi y)\}
1122: \end{equation}
1123: \begin{equation}
1124: \B = \{ 1, \,\,\, 0.1 \sin(2 \pi x + 4 \pi y), \,\,\,
1125: 0.1 \cos(2 \pi x + 4 \pi y)\}
1126: \end{equation}
1127: The simulation volume is a unit cube, modeled on a grid of
1128: size $16^3$. 
1129: The velocity field is quasi-incompressible, with the divergence removed
1130: spectrally every 4 timesteps.
1131: The kinetic and magnetic diffusivities
1132: are all set to zero for this linear problem.
1133: We ran two simulations: one with third-order polynomial finite differences
1134: and another with third-order tuned finite differences from
1135: Table~(\ref{tablek}).
1136: After the wave has traveled 16 times around the periodic box, the waveform
1137: remains almost indistinguishable from the initial conditions, with the tuned
1138: finite differences yielding a more precise result than the polynomial
1139: finite differences (figure~\ref{figalfvenb}).  
1140: 
1141: \begin{figure}
1142: \plotone{f5.eps} 
1143: \caption{ \label{figalfvenb} The oblique Alfv\'en wave test from
1144: \S~\ref{sectionalfven}.
1145: We plot the $B_z$ field as a function of $y,$
1146: with $x$ and $z$ equal to zero.  We show initial conditions {\em
1147: (solid points)}, and results from simulations with polynomial finite
1148: differences {\em (open circles)} and tuned finite differences {\em
1149: (crosses)}.  In each simulation, the grid size is $16^3$ and the
1150: wave has traveled 16 times around
1151: the periodic box. The tuned finite differences yield a more precise
1152: result.}
1153: \end{figure}
1154: %program helicalwave.f90
1155: 
1156: \section{Summary}
1157: 
1158: We have developed a new version of the constrained transport algorithm that
1159: uses
1160: volume-centered fields and hyperresistivity on a high-order finite difference
1161: stencil, with tuned finite difference coefficients to enhance high-wavenumber
1162: resolution. High-order interpolation allows implementation of staggered
1163: dealiasing. 
1164: Together, these measures yield a wavenumber resolution that
1165: approaches the ideal value achieved by the spectral algorithm.
1166: 
1167: 
1168: Volume centered fields are desirable because then $\V$, $\B$ and $\E$
1169: all reside at the same grid location, allowing $\E$ to be constructed
1170: directly from the cross product of $\V$ and $\B$ without
1171: interpolation. For staggered fields, $\V$ and $\B$ reside at the zone
1172: faces and $\E$ on the edges, and so constructing $\E$ involves
1173: spatial interpolation, which reduces wavenumber resolution.
1174: 
1175: High-order stencils and tuned finite difference coefficients both enhance the
1176: wavenumber resolution of finite differences. For a radius-three stencil with
1177: tuned coefficients, derivatives can be computed to a relative precision of $0.5
1178: \%$ up to a Nyquist-scaled wavenumber of $k=0.5$. Without tuning, this would be
1179: $k= 0.34$ for a radius-three stencil. A radius-one stencil derivative such
1180: as is used in Zeus (Stone \& Norman 1992a)
1181: is only accurate up to $k=0.12$. The spectral derivative
1182: is precise up to $k=1.00$, although in practice it is limited to $k=0.94$
1183: because
1184: of aliasing. Aliasing limits a finite-difference code to
1185: $k=0.66$ unless the finite-difference grid shift aliasing correction is used
1186: (\S~\ref{dealiasing}).
1187: 
1188: Hyperresistivity is desirable because it is more effective than Laplacian
1189: resistivity in diffusing high-wavenumber modes while at the same time
1190: preserving low-wavenumber modes. The fact that hyperresistivity can be written
1191: as a curl allows its inclusion into CT. If Laplacian diffusivity were used
1192: instead, too much high-wavenumber structure would be diffused for the
1193: high-order or tuned derivatives to matter.
1194: 
1195: The resolution of the algorithm described here approaches that of a
1196: spectral code, but because it uses finite differences, it runs faster
1197: than a spectral code and isn't restricted to periodic boundary
1198: conditions.  Also, since the finite differences are local, it is
1199: easily scalable to thousands of processors. The spectral algorithm is
1200: more difficult to scale to large numbers of processors because it involves
1201: all-to-all communications between processors. A finite difference code
1202: only passes information between processors whose subgrids are adjacent in
1203: physical space. Lastly, because the code works with the magnetic field
1204: rather than the vector potential, boundary conditions are often easier
1205: to implement.
1206: 
1207: \begin{acknowledgements}
1208: We received support for this work from NSF Career grant
1209: AST99-85392, NSF grants AST03-07854 and AST06-12724, and NASA grant
1210: NAG5-10103.  We acknowledge stimulating discussions with E. Blackman,
1211: A. Brandenburg, B. Chandran, and J. Stone, and we also acknowledge the
1212: referee, Wolfgang Dobler, for thorough comments that improved the paper."
1213: \end{acknowledgements}
1214: 
1215: 
1216: 
1217: \appendix
1218: 
1219: \section{Appendix} \label{ctapp}
1220: 
1221: Constrained transport expresses the magnetic induction equation as a pure curl
1222: plus a divergence diffusivity: $\partial_t \B = \bnabla \times {\bf F} +
1223: \eta_{\smf D} \bnabla \bnabla \cdot \B,$ where ${\bf F}$ is defined in
1224: equation~(\ref{eqctb}).  The $\eta_{\smf D}$ term serves to diffuse away
1225: magnetic divergence, and the finite differences are arranged so that $\bnabla
1226: \cdot \bnabla \times {\bf F} = 0.$ Thus, the curl term does not contribute to
1227: the evolution of the magnetic divergence, and if the initial conditions are
1228: divergence-free, the magnetic divergence remains zero throughout the evolution.
1229: 
1230: To see how constrained transport works,
1231: denote the vector field by
1232: ${\bf F_{\smf i,j,k}}$ = $\{F^x_{\smf i,j,k}, F^y_{\smf i,j,k},
1233: F^z_{i,j,k}\},$ where $\{i,j,k\}$ are integers specifying the locations of
1234: grid cell centers. There are two basic grid types: ``centered" and
1235: ``staggered" (figure~\ref{figstagger}).
1236: For a centered grid, scalar and vector quantities are
1237: located at cell centers. For a staggered grid,
1238: scalar quantities are located at
1239: cell centers and vector quantities at cell faces.
1240: For instance, we would index the components of ${\bf F}$ as
1241: $\{F^x_{\smf i+1/2,j,k}, F^y_{\smf i,j+1/2,k}, F^z_{\smf i,j,k+1/2}\}.$
1242: 
1243: The finite divergence divergence of the curl of ${\bf F}$ is $\bnabla \cdot
1244: \bnabla \times {\bf F} = \epsilon_{ijk} \partial_i \partial_j {\bf F}_k,$ which
1245: consists of terms such as $(\partial_1 \partial_2 - \partial_2 \partial_1)
1246: {\bf F}_k.$ One can straightforwardly see that this is zero for finite
1247: differences of the form eq.~\ref{stencil} for both
1248: centered and staggered grids. Thus, constrained
1249: transport can be coordinated with high-order and tuned finite differences,
1250: as well as with hyperresistivity.
1251: 
1252: 
1253: For a staggered grid, the ``${\bf F}$" vectors are located at cell
1254: edges, whereas the $\V$ and $\B$ vectors from which they are constructed
1255: are found at cell faces. A staggered grid CT scheme therefore involves
1256: spatial interpolation, one example
1257: being the method of characteristics scheme for
1258: time-interpolating Alfv\'en waves. We use volume-centered fields and
1259: Runge-Kutta timestepping because,
1260: among other reasons, no interpolation is required.
1261: 
1262: \begin{figure}[!] \plotone{f6.eps}
1263: \caption{
1264: \label{figstagger}
1265: We show the configuration for zone-centered and zone-staggered fields
1266: in two dimensions, where the generalization to three dimensions is
1267: straightforward. {\em (Left)} A zone-centered vector field, where both the
1268: $\hat{X}$ and $\hat{Y}$ vectors reside at zone centers. {\em (Right)} A
1269: zone-staggered vector field, where $\hat{X}$ vectors reside on
1270: $\hat{X}$ faces and $\hat{Y}$ vectors reside on $\hat{Y}$ faces.}
1271: \end{figure}
1272: 
1273: 
1274: \begin{thebibliography}{}
1275: 
1276: 
1277: \bibitem[]{} Batchelor, G. K. 1950, Proc. Roy. Soc. Lon., A201, 405
1278: 
1279: %\bibitem[]{} Batchelor, G. K.,
1280: %``On the spontaneous magnetic field in a conducting liquid in
1281: %turbulent motion,"  Proc. Roy. Soc. Lon., A201, 405, 1950.
1282: 
1283: \bibitem[]{}Brackbill, J. \& Barnes, D. 1980, J. Comput.\ Phys., 35, 426
1284: %\bibitem[]{}Brackbill, J. \& Barnes, D. 1980, JCP 35, 426-430
1285: 
1286: %\bibitem[]{}Brackbill \& Barnes, ``The effect of nonzero $\bnabla \cdot \B$ on
1287: %the numerical solution of the magnetohydrodynamic equations," JCP 35, 426-430,
1288: %1980
1289: 
1290: \bibitem[Brandenburg(2002)]{bra02} Brandenburg, A., \& Dobler,
1291:   W. 2002, Comput.\ Phys.\ Comm., 147, 471
1292: 
1293: \bibitem[Canuto(1987)]{can87} Canuto, C., Hussaini, M. Y., Quarteroni, A.,
1294: Zang, T. A., Jr. 1987, Spectral Methods in Fluid Dynamics
1295: (Heidelberg: Springer-Verlag)
1296: 
1297: %\bibitem[Canuto(1987)]{can87} Canuto, C., Hussaini, M. Y., Quarteroni, A.,
1298: %Zhang, t. A., ``Spectral Methods in Fluid Dynamics". Springer-Verlag 1987.
1299: 
1300: \bibitem[]{}
1301: Colella, P., \& Woodward, P. R. 1984, J. Comput. Phys., 54, 174
1302: %Colella and Woodward 1984, Woodward 1986
1303: %"The piecewise parabolic method (PPM) for gas-dynamical simulations"
1304: 
1305: \bibitem[]{} Dedner, A., Kemm, F., Kroner, D., Munz, C.-D., Schnitzer, T.
1306: \& Wesenberg, M. 2002, J. Comput.\ Phys., 175, 645
1307: %\bibitem[]{} Dedner, A., Kemm, F., Kroner, D., Munz, C.-D., Schnitzer, T.
1308: %\& Wesenberg, M. 2002, JCP 175, 645-673
1309: 
1310: %\bibitem[]{} Dedner, A., Kemm, F., Kroner, D., Munz, C.-D., Schnitzer, T.
1311: %\& Wesenberg, M., ``Hyperbolic divergence cleaning for the MHD equations,"
1312: %JCP 175, 645-673, 2002
1313: 
1314: \bibitem[]{} Dobler, W., Stix, M. \& Brandenburg, A. 2006, ApJ 638, 336
1315: 
1316: \bibitem[]{} Evans, C.R. \& Hawley, J.F. 1988, ApJ, 332, 659
1317: 
1318: %\bibitem[]{} Evans, C.R. \& Hawley, J.F., ``Simulation of magnetohydrodynamic
1319: %flows: A constrained transport method," ApJ 332, 659, 1988
1320: 
1321: \bibitem[]{} Gardiner, T. \& Stone, J., J. Comput.\ Phys., 205, 509
1322: 
1323: \bibitem[]{} Harten, A. 1983, J. Comput.\ Phys., 49, 357
1324: %"High Resolution Schemes for Hyperbolic Conservative Laws"
1325: 
1326: \bibitem[]{} Haugen N. E. L., \& Brandenburg, A. 2004, PRE 70, 026405
1327: 
1328: \bibitem[]{} Hawley, J. F., \& Stone, J. M. 1995, Comp.\ Phys.\ Comm., 89, 127
1329: 
1330: \bibitem[]{} Londrillo, P. \& Del Zanna, L. 2000, ApJ, 530, 508
1331: %\bibitem[]{} Londrillo, P. \& Del Zanna, L. 2000, ApJ 530, 508-524
1332: 
1333: %\bibitem[]{} Londrillo, P. \& Del Zanna, L., ``High-order upwind schemes
1334: %for multidimensional magnetohydrodynamics," ApJ 530, 508-524, 2000
1335: 
1336: \bibitem[]{} Maron, J., 2004, J. Comput.\ Phys., submitted  (astro-ph/0402606)
1337: 
1338: %\bibitem[]{} Maron, J., "High-Wavenumber Finite Differences and Turbulence
1339: %Simulations," xxx.lanl.gov/abs/astro-ph/0402606
1340: 
1341: \bibitem[]{} Maron, J., Chandran, B. \& Blackman, E. 2004, PRL, 92, 045001
1342: 
1343: %\bibitem[]{} Maron, J., Chandran, B. \& Blackman, E., ``Divergence of
1344: %Neighboring Magnetic-Field Lines and Fast-Particle Diffusion in Strong
1345: %Magnetohydrodynamic Turbulence, with Application to Thermal Conductionin
1346: %Galaxy Clusters," PRL, 92, 045001, 2004.
1347: 
1348: \bibitem[Maron \& Goldreich(2001)]{mar01} Maron, J. \& Goldreich, P.
1349: 2001, ApJ, 554, 1175
1350: 
1351: \bibitem[]{} Powell, K.G., Roe, P.L., Linde, T.J., Gombosi, T.J. \&
1352: De Zeeuw, D.L. 1999, J. Comput.\ Phys., 154, 284
1353: 
1354: %\bibitem[Stone and Norman(1992a)]{sto92a}
1355: %Stone, J. M. \& Norman, M. L. 1992a, ApJS, 80, 753
1356: 
1357: \bibitem[Stone and Norman(1992b)]{sto92b}
1358: Stone, J. M. \& Norman, M. L. 1992a, ApJS, 80, 791
1359: 
1360: %\bibitem[Stone and Norman(1992a)]{sto92a}
1361: %Stone, J. \& Norman, M., ``Zeus-2D, A Radiation Magnetohydrodynamics Code
1362: %for Astrophysical Flows in Two Space Dimensions: I. The Hydrodynamic
1363: %Algorithms and Tests", 1992a, ApJS, 80, 753.
1364: 
1365: \bibitem[]{}Stone, J., Hawley, J.F., Evans, C.R. \& Norman, M. 1992b,
1366: ApJ, 388, 415
1367: 
1368: %\bibitem[Stone and Norman(1992b)]{sto92b}
1369: %Stone, J. \& Norman, M., ``Zeus-2D, A Radiation Magnetohydrodynamics Code
1370: %for Astrophysical Flows in Two Space Dimensions: II. The Magnetohydrodynamic
1371: %Algorithms and Tests", 1992b, ApJS, 80, 791.
1372: 
1373: \bibitem[]{} T\'{o}th, G. 2000, J. Comput.\ Phys., 161, 605
1374: %\bibitem[]{} T\'{o}th, G. 2000, JCP 161, 605-652
1375: 
1376: %\bibitem[]{} T\'{o}th, G., ``The ${\bf \nabla \cdot B} = 0$ constraint in
1377: %shock-capturing magnetohydrodynamics codes," JCP 161, 605-652, 2000
1378: 
1379: \bibitem[]{} Toro, E. F. 1999, Riemann Solvers and Numerical Methods for Fluid
1380: Dynamics (Heidelberg: Springer-Verlag)
1381: 
1382: \bibitem[]{} Zhong, X. 1998, J. Comp. Phys. 144, 662
1383: %"High-order nite-dierence schemes for numerical simulation
1384: %of hypersonic boundary-layer transition"
1385: 
1386: 
1387: \end{thebibliography}
1388: 
1389: 
1390: 
1391: \end{document}
1392: 
1393: stencil4.eps      f1.eps
1394: ctspectrum.eps    f2a.eps
1395: ct.ray.eps        f2b.eps
1396: A_alfven_test.ps  f3a.eps
1397: CT_alfven_test.ps f3b.eps
1398: brms_vs_t_CT_A.ps f4.eps
1399: ct.alfven.eps     f5.eps
1400: ctfig.ps          f6.eps
1401: 
1402: 
1403: