Brought to you by:

THE ATHENA ASTROPHYSICAL MAGNETOHYDRODYNAMICS CODE IN CYLINDRICAL GEOMETRY

and

Published 2010 May 4 © 2010. The American Astronomical Society. All rights reserved.
, , Citation M. Aaron Skinner and Eve C. Ostriker 2010 ApJS 188 290 DOI 10.1088/0067-0049/188/1/290

0067-0049/188/1/290

ABSTRACT

A method for implementing cylindrical coordinates in the Athena magnetohydrodynamics (MHD) code is described. The extension follows the approach of Athena's original developers and has been designed to alter the existing Cartesian-coordinates code as minimally and transparently as possible. The numerical equations in cylindrical coordinates are formulated to maintain consistency with constrained transport (CT), a central feature of the Athena algorithm, while making use of previously implemented code modules such as the Riemann solvers. Angular momentum transport, which is critical in astrophysical disk systems dominated by rotation, is treated carefully. We describe modifications for cylindrical coordinates of the higher-order spatial reconstruction and characteristic evolution steps as well as the finite-volume and CT updates. Finally, we present a test suite of standard and novel problems in one, two, and three dimensions designed to validate our algorithms and implementation and to be of use to other code developers. The code is suitable for use in a wide variety of astrophysical applications and is freely available for download on the Web.

Export citation and abstract BibTeX RIS

1. INTRODUCTION

The Athena code (Gardiner & Stone 2005, hereafter GS05; Gardiner & Stone 2008, hereafter GS08; Stone et al. 2008) is a new, second-order Godunov code for solving the equations of ideal magnetohydrodynamics (MHD). Among its salient features are that it preserves the divergence-free constraint, ∇ · B = 0, to within machine round-off error via unsplit evolution of the magnetic field, and that it employs fully conservative updates of the MHD equations. This last feature distinguishes Athena from its predecessor, Zeus (Stone & Norman 1992a, 1992b), which also preserves the divergence-free constraint, but employs operator-split finite-difference methods. Athena has been extensively tested via both comparison to analytic solutions, and comparison to the results of other numerical MHD codes. The code package is freely available to the community, and is highly portable and easily configurable, as it is self-contained and does not rely on outside libraries other than MPI for computation on multi-processor distributed memory platforms.

The equations of ideal MHD consist of eight coupled partial differential equations, which are not analytically solvable in general, and fully three-dimensional numerical solutions can be quite costly. For many astrophysical systems of interest, however, the computational cost for certain problems can be reduced by exploiting geometric symmetry. For example, the high angular velocity of the plasma in accreting systems implies that most of the mass is confined within a disk. If the properties are statistically independent of azimuthal angle, ϕ, these disks can be studied using radial–vertical (Rz) models, and if vertical variations are of lesser importance, these disks can be studied using radial–azimuthal (R–ϕ) models. The dynamical properties of winds and jets from astrophysical systems can also be analyzed using axisymmetric models. Exploiting symmetry in this way to reduce the effective dimension of the problem can greatly simplify the calculations involved and allow finer resolution when and where needed. In addition, for either reduced-dimensional or fully three-dimensional problems, using a curvilinear coordinate system for rotating, grid-aligned flow is superior for preservation of total angular momentum, and renders imposition of boundary conditions much simpler compared to the Cartesian-grid case.

There are several other publicly available high-resolution shock-capturing codes for astrophysical MHD in wide use, including VAC (Tóth 1996), BATS-R-US (Powell et al. 1999), FLASH (Fryxell et al. 2000), RAMSES (Teyssier 2002), NIRVANA (Ziegler 2004), and PLUTO (Mignone et al. 2007), to name a few. Although these and other codes enjoy increasing popularity within the community, as of this writing only VAC and PLUTO have the capability for MHD in curvilinear coordinates.

In this paper, we describe our adaptation of Athena to support cylindrical geometry, and present a suite of tests designed to validate our algorithms and implementation. These tests include standard as well as novel problems, and may be of use to other code developers. A guiding principle of our approach is to alter the existing Athena code as minimally and as transparently as possible. This will involve a careful formulation of the MHD equations so that the finite-volume (FV) algorithm remains consistent with constrained transport (CT), and so that the built-in Riemann solvers (as well as computation of wavespeeds and eigenfunctions) need not be changed. Finally, we pay particular attention to angular momentum transport, which is critical in systems dominated by rotation.

The plan of this paper is as follows: In Section 2, we describe the conservative system of mathematical equations that we shall solve, and in Section 3, we briefly outline the main steps used in Athena to evolve the system numerically. In Section 4, we describe the projected primitive variable system used in the reconstruction step. In Sections 5 and 6, we describe the modifications needed for cylindrical coordinates in the higher-order spatial reconstruction and characteristic evolution steps, respectively. In Sections 7 and 8, we describe the implementation in cylindrical coordinates of the FV and CT updates, respectively, and then in Section 9, we summarize the steps of the whole algorithm in detail. In Section 10, we present code verification tests and results, and we conclude in Section 11.

Our version of the code, including the suite of test problems we have developed, is freely available for download on the Web.

2. THE EQUATIONS OF MHD

The coordinate-free conservative form of the equations of ideal MHD are

Equation (1a)

Equation (1b)

Equation (1c)

Equation (1d)

Here, ρ is the mass density, $\rho \boldsymbol{v}$ is the momentum density, $\boldsymbol{B}$ is the magnetic field vector, and I is the identity tensor. The total pressure is defined as $P^* \equiv P + (\boldsymbol{B} \cdot \boldsymbol{B})/2$, where P = nkT is the thermal pressure, and E is the total energy density defined as $E \equiv \epsilon + \rho (\boldsymbol{v} \cdot \boldsymbol{v})/2 + (\boldsymbol{B} \cdot \boldsymbol{B})/2$, where epsilon is the internal energy density. An ideal gas equation of state P = (γ − 1)epsilon is assumed, where γ is the ratio of specific heats. As written, the equations have been scaled in such a way that the magnetic permeability is μ = 1 (for cgs units, $\boldsymbol{B}$ is replaced by $\boldsymbol{B}/\sqrt{4\pi }$). Optionally, we can include a static gravitational potential $\Phi =\Phi (\boldsymbol{x})$ in Equations (1b) and (1c); the energy Equation (1c) can also be generalized by including radiative heating and cooling terms.

Ignoring terms on the right-hand sides, Equations (1) can be summarized by the single evolution equation in "conservative" form:

Equation (2)

where $\boldsymbol{Q} = \boldsymbol{Q}(\boldsymbol{x},t)$ is the set of conserved quantities

Equation (3)

and

Equation (4)

is a structure whose components represent the (nonlinear) fluxes associated with the various components of $\boldsymbol{Q}$. For added simplicity, we have defined the momentum and induction tensors:

Equation (5)

and

Equation (6)

Note that additional terms such as gravitational forces appearing on the right-hand sides of Equations (1) are treated separately as source terms, hence are not part of the conservative system in Equation (2).

In Cartesian coordinates, Equation (2) can be expanded in a straightforward manner:

Equation (7)

where $\boldsymbol{F}_x$, $\boldsymbol{F}_y$, and $\boldsymbol{F}_z$ are one-dimensional vectors representing the fluxes of various components of $\boldsymbol{Q}$ in each orthogonal coordinate direction.

In order to extend the existing algorithm in Athena to curvilinear coordinates, we introduce geometric scale factors and source terms arising from the covariant derivatives in the curved metric. Following this approach, the existing code can be made to support cylindrical geometry with only moderate adjustments, which is what we describe in this paper.

We expand Equation (2) according to the form of the divergence operator in cylindrical coordinates (see, e.g., Mihalas & Mihalas 1984) when acting on a vector,

Equation (8)

and when acting on a tensor,

Equation (9a)

Equation (9b)

Equation (9c)

The extra non-derivative terms in Equations (9a) and (9b) are the so-called geometric source terms, and represent "fictitious" forces, e.g., the centrifugal and Coriolis forces. Once source terms are introduced, the FV updates are no longer fully conservative. As we shall next show, however, all but one of the geometric source terms can be eliminated from the equations. This remaining geometric source term, appearing in the radial momentum equation, is often balanced by gravity in realistic astrophysical problems.

2.1. Continuity Equation

Expanding the derivative operators in cylindrical coordinates in Equation (1a), we have the continuity equation in conservative variable form:

Equation (10)

2.2. Momentum Equation

For the momentum Equation (1b), we have, in terms of the symmetric momentum tensor M (Equation (5)):

Equation (11a)

Equation (11b)

Equation (11c)

Mignone et al. (2007) note that the symmetric character of M allows further simplification of Equation (11b) in cylindrical coordinates, since

Equation (12)

This leads to the so-called angular momentum conserving form of the ϕ-momentum equation:

Equation (13)

Note that in this form, the conserved quantity is angular momentum and there is no source term. However, since the original Cartesian version of Athena makes use of linear momenta in the flux calculations and since we do not wish to alter those calculations, we rewrite this equation once more to obtain the ϕ-momentum equation that we shall use:

Equation (14)

This leaves the term Mϕϕ/R = (ρv2ϕB2ϕ + P*)/R appearing in the R-momentum Equation (11a) as the only geometric source term in the cylindrical coordinate expansion of Equation (1b). In practice, this source term is often (partially) balanced by the radial component of the gravitational source term

Equation (15)

for many astrophysical applications.

2.3. Energy Equation

For the total energy Equation (1c) in conservative form, we have

Equation (16)

The gravitational source term for the energy equation is

Equation (17)

2.4. Induction Equation

Finally, for the induction Equation (1d), we have in terms of the antisymmetric induction tensor, J (Equation (6)):

Equation (18a)

Equation (18b)

Equation (18c)

It is important for the preservation of the divergence constraint that we avoid source terms in the magnetic fluxes. Thus, we rewrite the ϕ-induction Equation (18b) as

Equation (19)

Note that in this form, the conserved quantity is Bϕ/R and there is no source term. Equation (19) has also modified the fluxes of Bϕ, but since Athena does not actually use flux differences to evolve the magnetic fields (see Section 8), this is not a serious problem. We will use a reduced form equivalent to Equation (19) for Bϕ in the reconstruction step (see Section 4):

Equation (20)

In this form, we use the fluxes JRϕ and Jzϕ originally appearing in Equation (18b), not the modified fluxes JRϕ/R and Jzϕ/R appearing in Equation (19).

3. OVERVIEW OF THE NUMERICAL ALGORITHM

The algorithm used in Athena to evolve the system in Equation (2) uses a Godunov-type FV scheme. A simplified version of the algorithm presented in Stone et al. (2008) is as follows.

  • 1.  
    Using cell-centered volume averages at time tn, compute left and right (L/R) interface states with the reconstruct-evolve-average (REA) method based on the linearized one-dimensional evolution equations.
  • 2.  
    Add the parallel components of source terms to the L/R states.
  • 3.  
    Compute the first-order interface fluxes from the L/R states using an exact or approximate Riemann solver.
  • 4.  
    Update the L/R states' magnetic fields using CT (Evans & Hawley 1988).
  • 5.  
    Correct the L/R states' remaining non-magnetic variables with transverse flux gradients and the transverse components of source terms.
  • 6.  
    Compute the second-order interface fluxes from the corrected L/R states using the Riemann solver.
  • 7.  
    Using the second-order fluxes, advance the interface magnetic fields to time tn+1 = t + Δt with CT.
  • 8.  
    Using the second-order fluxes, advance the remaining cell-centered quantities to time tn+1 with the FV method.
  • 9.  
    Add the time- and volume-averaged source terms to the cell-centered quantities.
  • 10.  
    Average the interface magnetic field components to obtain the cell-centered field components at time tn+1.
  • 11.  
    Compute a new timestep Δt based on the CFL condition and repeat steps (1)–(11) until tn+1tf.

Currently, Athena includes a wide variety of nonlinear Riemann solvers (see Stone et al. 2008, for a complete list). In our tests, we use the solvers based on the HLL flux (Harten et al. 1983) as well as Roe's linearized method (Roe 1981). Among the solvers based on the HLL flux are the HLLE solver (Einfeldt et al. 1991), which uses a single intermediate state, the HLLC solver (Toro 1999), which extends the original HLLE solver by including a contact wave, and the HLLD solver (Miyoshi & Kusano 2005), which extends the original HLLE solver by including both contact and Alfvén waves. The HLLE solver has the advantage that it is simple and therefore faster than more accurate solvers such as Roe's method, and like all solvers based on the HLL fluxes, it is positive-definite for one-dimensional problems. However, since it neglects the contact wave, and additionally the Alfvén waves for MHD, it is overly diffusive for these waves. On the other hand, for hydrodynamics, the HLLC solver produces fluxes that are as accurate, if not better, than those produced by Roe's method, but at a considerably lower computational cost. For MHD, it has been shown that the HLLD solver is of comparable accuracy to the MHD extension of Roe's method for several tests using Athena, although it is much faster (Stone et al. 2008). The advantage of Roe's linearized method is that it includes all waves in a given problem, yielding less diffusive and, hence, more accurate results for intermediate waves that are neglected by the methods based on HLL fluxes, although for some values of the left and right states, Roe's method will fail to return positive density and/or pressure in the intermediate state(s). Finally, we reiterate that with the approach we have adopted, it is not necessary to make any changes to the computation of wavespeeds, eigenfunctions, or fluxes in any of these methods.

Although no changes are required for the solution of the Riemann problem at interfaces, several changes are required in other parts of the Athena algorithm in order to accommodate non-Cartesian coordinates. In the next sections, we discuss the geometry-specific details of computing the L/R states (steps 1–2; see Sections 46), the FV method (steps 8–9; see Section 7), and the incorporation of CT into the corner transport upwind (CTU) method of Colella (1990; see Section 8). Finally, we will recapitulate the steps of the algorithm in greater detail and explain the computation of the new timestep (step 11; see Section 9).

4. THE LINEARIZED EVOLUTION EQUATIONS

In Athena, the left and right (L/R) interface states (the inputs to the Riemann solver) are computed using a modified form of the system in Equation (2). The equations, written in primitive variable form, are projected in a single coordinate direction, and the resulting system is linearized and then evolved. The projection in the ϕ-direction yields a system that can be obtained from the corresponding Cartesian projection (see GS05, Section 3.1) by making the substitution ∂yR−1ϕ. However, the projection in the R-direction differs more significantly as a result of geometric scale factors.

For the projection in the R-direction, we begin with the primitive variable form of Equation (2), take ∂ϕ ≡ 0 and ∂z ≡ 0, expand the remaining R-partials, and move the non-derivative terms to the right-hand side to obtain the system:

Equation (21)

where

Equation (22)

is the vector of primitive variables, omitting the parallel component of the magnetic field,

Equation (23)

is the wave matrix, and $\boldsymbol{s} = \boldsymbol{s}_{\rm MHD} + \boldsymbol{s}_{\rm grav} + \boldsymbol{s}_{\rm geom}$ is the source term vector, a combination of the MHD source terms arising from the $\nabla \cdot \boldsymbol{B}$ constraint, gravity source terms from a static potential, and the geometric source terms inherent in the cylindrical coordinate system. As in the Cartesian version of Athena, the form of the MHD source terms differs slightly in the two-dimensional and three-dimensional cases (see Section 4.4 below), but the forms of the gravity and geometric source terms are independent of dimension.

The hyperbolic wave matrix, A, given in Equation (23), is linearized by taking it to be a constant function of the primitive variable state $\boldsymbol{w}$ at time tn. However, it is only indirectly accessed through the system of eigenvectors and eigenvalues of A (see Section 6 below). We write the projected equations in cylindrical coordinates using this specific form in order to make use of the eigensystem solution previously implemented in Athena.

In the remainder of this section, we derive the cylindrical coordinate form of the primitive variable system given in Equation (21), and in the process obtain the geometric source terms.

4.1. Continuity Equation

Expanding the derivative operators in cylindrical coordinates in Equation (1a) and projecting in the R-direction, we have for the continuity equation in primitive variable form:

Equation (24)

The left-hand side of Equation (24) contains all the terms from Equation (21), and the term on the right-hand side is the first component of the geometric source term vector, $\boldsymbol{s}_{\rm geom}$. Furthermore, if we make the substitution Rx and ignore the source term, we recover the x-projection of the continuity equation in Cartesian coordinates.

4.2. Momentum Equation

For the momentum equation, we begin with the conservative form of Equation (1b) and use the continuity equation and divergence-free constraint to eliminate terms and obtain

Equation (25)

By explicitly enforcing $\nabla \cdot \boldsymbol{B}=0$ here, we ensure that any numerical error in the divergence of the magnetic field cannot influence the evolution of momentum during the reconstruction step.

Next, we divide through by ρ, substitute P* = P + B2/2, project in the R-direction, expand the partials, and move the source terms to the right-hand side to obtain

Equation (26a)

Equation (26b)

Equation (26c)

Recall that the ϕ-momentum Equation (13) can be expressed in angular momentum conserving form and thus avoid a geometric source term. However, we must include the source term on the right-hand side of Equation (26b) in primitive variable form in order to preserve the specific structure of the coefficient matrix, A, on the left-hand side of Equation (21). Finally, the gravity source terms in the momentum equation are given by the components of $-\boldsymbol{\nabla } \Phi$ in cylindrical coordinates.

4.3. Energy Equation

We begin with the internal energy equation in coordinate-free form:

Equation (27)

Then, projecting the equations in the R-direction, expanding the partials, and moving the source term to the right-hand side, we obtain

Equation (28)

In primitive form, there is no gravity source term in the energy equation.

4.4. Induction Equation

For the induction Equation (1d), also written as $\partial _t \boldsymbol{B} - \nabla \times (\boldsymbol{v} \times \boldsymbol{B}) = 0$, we begin with the components given in Equations (18a), (18c), and (20). Moving terms proportional to R−1R(RBR), R−1ϕBϕ, and ∂zBz to the right-hand side, we obtain

Equation (29a)

Equation (29b)

Equation (29c)

In two dimensions, the divergence-free constraint in cylindrical coordinates with ∂z ≡ 0 implies that the right-hand side of Equation (29c) is identically zero. Applying the divergence constraint in Equation (29c), projecting in the R-direction, and expanding the R-partials on the left-hand side, we obtain

Equation (30a)

Equation (30b)

Equation (30c)

Note that the left-hand sides of Equations (30b) and (30c) exactly match the Cartesian form (GS05, Equation (30)) if we make the substitution Rx. Also, the divergence term on the right-hand side of Equation (30b) matches the divergence term on the right-hand side of the Cartesian form, except that it appears in cylindrical coordinate form. However, the additional source terms −vϕBR/R in Equation (30b) and −vRBz/R in Equation (30c), which vanish as R, are curvature-related terms that are unique to the system in cylindrical coordinates.

In three dimensions, the cancellation of the $\nabla \cdot \boldsymbol{B}$ terms on the right-hand side of Equation (29c) is no longer possible. Instead, GS08 introduce an algorithm that adds a limited amount of the MHD source terms from the transverse directions to the source terms in each splitting direction. This is done in such a way that the overall induction equation is not altered and so that the sum of the MHD source terms is minimized. These constraints take the form of minmod limiter functions that reduce to the underlying two-dimensional algorithm in the limit of two-dimensional, grid-aligned problems (see GS08, Section 3). The three-dimensional algorithm in cylindrical coordinates yields the system

Equation (31a)

Equation (31b)

Equation (31c)

where

Equation (32a)

Equation (32b)

Equation (32c)

Note that the limiter Lij is only applied to the equation for Bi projected in the j-direction. We require that

Equation (33a)

Equation (33b)

Equation (33c)

so that the limiters cancel pairwise when summed over all projections. The limiters defined in Equations (32) and (33) are the same as in the three-dimensional Cartesian formulae (GS08, Equations (11) and (15)), with ∂xBxR−1R(RBR) and ∂yByR−1ϕBϕ.

Projecting Equations (31) in the R-direction, expanding the partials (except for those appearing in the limiter functions), moving all of the source terms to the right-hand side, and using the properties of the minmod function together with the $\nabla \cdot \boldsymbol{B}=0$ constraint, we obtain

Equation (34a)

Equation (34b)

Equation (34c)

Note that for the two-dimensional case with ∂z ≡ 0, the $\nabla \cdot \boldsymbol{B}$ constraint implies that the arguments of the minmod function in Equation (34b) are equal and that the minmod function in Equation (34c) evaluates to zero, so that we recover the two-dimensional system in Equations (30). The minmod terms on the right-hand side of Equations (34b) and (34c) are analogous to the corresponding terms in Cartesian coordinates derived in GS08, and the remaining terms are geometric.

4.5. Source Terms

In summary, for the primitive variable equations in cylindrical coordinates, the MHD source term vectors are given by Equations (18) and (19) of GS08 via the substitutions ∂xBxR−1R(RBR) and ∂yByR−1ϕBϕ, and the geometric source term vector is given by

Equation (35)

Since the geometric source terms arise directly from the scale factors in the R-partials, we associate the geometric source term $\boldsymbol{s}_{\rm geom}$ exclusively with the R-direction. Note that $\Vert \boldsymbol{s}_{\rm geom} \Vert \rightarrow 0$ in the limit of vanishing curvature, i.e., as R.

We emphasize that the geometric source terms in Equation (35) are used only in obtaining the L/R states, not for the final FV update. Finally, the gravity source terms for the L/R states are given by the cylindrical coordinate components of $-\boldsymbol{\nabla } \Phi$ in the momentum equation, and there is no gravity source term in the energy equation.

5. SPATIAL RECONSTRUCTION

In Athena, spatial reconstruction is performed in a directionally split fashion using piecewise polynomial approximations as outlined in Colella & Woodward (1984, hereafter CW), and Colella (1990, hereafter Colella). Here, we focus on piecewise linear and quadratic reconstructions, which yield second- and third-order approximations to smooth profiles, respectively. For a given coordinate direction, ξ, we form the piecewise linear or quadratic reconstruction of each primitive variable, a(ξ), from the set {ai} of cell-centered volume averages (including ghost-zones) at time tn, holding indices j and k fixed. In each case, we require for consistency that the volume average of the reconstruction equal the volume-averaged data in the ith cell, i.e.,

Equation (36)

Instead of defining a(ξ) in the ith zone explicitly, i.e., for ξ ∈ [ξi−1/2, ξi+1/2], we find it more convenient to define the auxiliary parameter s ∈ [0, 1] by

Equation (37)

where Δξ ≡ ξi+1/2 − ξi−1/2 is the width of the interval, so that ξ = ξi−1/2 + s Δξ.

We also employ slope-limiting and monotonization procedures to ensure that the resulting reconstructions are total-variation-diminishing (TVD) while providing somewhat steeper slopes at discontinuities. Of course, this can destroy the local formal order of the reconstruction, especially at extrema, but we pay this price for stability. Note, however, that while monotonicity is a sufficient condition for a reconstruction to be TVD, it is not always necessary (Leveque 2002). Recently, Colella & Sekora (2008) have described a slope-limiting method that, when combined with piecewise quadratic reconstruction, preserves the local order of convergence of the reconstruction at extrema. This has been implemented for Cartesian coordinates in the latest versions of Athena, but not for cylindrical coordinates, hence will not be described further here.

For reconstructions in Cartesian coordinates, the procedures for the y- and z-directions are identical to the procedure for the x-direction. For the reconstructions in cylindrical coordinates, the only non-trivial difference from the Cartesian procedure occurs in the R-direction since the discrete cell-volumes change with R, but not with ϕ or z. Thus, we take ξ = x for the Cartesian cases and ξ = R for the cylindrical cases. The Cartesian formulae apply, with suitable relabeling of coordinates, for ϕ- and z-reconstructions.

5.1. Piecewise Linear (Second-order) Reconstruction

The piecewise linear method (PLM) of reconstruction approximates each primitive variable by defining in the ith zone,

Equation (38)

where ΔaiaR,iaL,i represents the difference of some quantity a over the zone, and aL,i and aR,i are the values of a at the left and right interfaces of the zone, respectively. Thus, to specify a(s) completely, we need only to define Δai and aL,i for each zone as functions of the volume averages, ai.

5.1.1. PLM in Cartesian Coordinates

From the consistency requirement in Equation (36) with Cartesian coordinates,

Equation (39)

Substituting Equation (38) into Equation (39) and integrating, we obtain

Equation (40)

from which

Equation (41a)

Equation (41b)

The usual Cartesian formulae for the differences over the zone are

Equation (42)

It is clear from Equation (42) that constant and linear profiles are reconstructed exactly. In order to make the reconstruction TVD, these differences (or "slopes," as they are commonly called) are limited using a slight variant of the monotonized central-difference (MC) limiter as described by Leveque (2002), and flattened to avoid the introduction of new extrema. Leveque argues that limiting should be performed in characteristic variables so that the accuracy of the reconstruction for smooth wave families is not adversely affected by limiting in other non-smooth wave families. This requires a special description for systems of conservation laws including a bounded linear transformation from primitive to characteristic variables, with inverse transformation from characteristic variables back to primitive. We do not go into detail here, but note that the inverse transformation is not guaranteed to be monotonicity-preserving, hence an additional monotonization is performed on the resulting primitive variable differences. In the previous implementation, this was done in a non-conservative manner, and we have since implemented a related scheme which preserves the consistency requirement of Equation (36).

Finally, by applying the monotonized, limited differences Δai in Equations (40) and (41), for smooth profiles we obtain second-order accurate approximations to the values of a across each zone at time tn, except possibly at local extrema.

5.1.2. PLM in Cylindrical Coordinates

From the consistency requirement of Equation (36) with cylindrical coordinates,

Equation (43)

Substituting Equation (38) into Equation (43) and integrating, we obtain

Equation (44)

where

Equation (45)

is a correction factor for curvature. Note that γi → 0 for fixed ΔR as R, or for fixed R as ΔR → 0, and from the formulae in Equation (44), we recover the Cartesian formulae in Equation (40). Solving for aL,i and aR,i, we obtain

Equation (46a)

Equation (46b)

Next, we wish to define the differences Δai such that constant and linear profiles are reconstructed exactly. Assuming a linear profile, say a(R) = CR with some constant slope C, we enforce the consistency relation of Equation (43) to obtain

Equation (47)

where

Equation (48)

is the R-coordinate of the volume centroid of the ith zone. To obtain an exact reconstruction for a linear profile, we require that Δai = C ΔR. First, we consider the Cartesian formula for a centered difference to obtain

Equation (49)

If we divide the Cartesian centered-difference formula in Equation (42) by the term in parentheses from Equation (49), we obtain the desired difference, C ΔR, exactly. This—along with similar calculations for the forward- and backward-difference slopes—suggests the following definitions:

Equation (50)

It is clear from Equation (50) that constant profiles yield Δai = 0, hence these are also reconstructed exactly. In order to make the reconstruction TVD, these differences are limited and monotonized as in the Cartesian case. Finally, by applying the resulting differences to Equations (38) and (46), for smooth profiles we obtain second-order accurate approximations to the values of a across each zone at time tn, except possibly at local extrema.

5.2. Piecewise Parabolic (Third-order) Reconstruction

The piecewise parabolic method (PPM) of reconstruction approximates the profile of each primitive variable in the ith zone as

Equation (51)

where, as for linear reconstruction, ΔaiaR,iaL,i represents the average difference of some quantity a over the zone, and aL,i and aR,i are the values of a at the left and right interfaces of the zone, respectively. The term a6,i is the so-called parabolic coefficient (see CW, Equation (1.5)). To specify a(s) completely, we need only to define Δai, aL,i, and a6,i for each zone as functions of the set of volume averages, {ai}.

5.2.1. PPM Reconstruction in Cylindrical Geometry

To satisfy the consistency requirement of Equation (36) in cylindrical coordinates, we substitute Equation (51) into Equation (43) and integrate, then solve for a6,i in terms of the quantities ai and Δai:

Equation (52)

Equation (52) is equivalent to the definition of the parabolic coefficient appearing in Equation (18) of Blondin & Lufkin (1993, hereafter BL). Recall that γi → 0 for fixed ΔR as R or for fixed R as ΔR → 0 (see Equation (45)), and in these limits we recover the Cartesian version of the parabolic coefficient, which is the same as Equation (52) except with γi = 0 (see CW, Equation (1.5)).

We wish to define the values of aL,i, aR,i, and ΔaiaR,iaL,i such that constant, linear, and parabolic profiles are reconstructed exactly, or at least to second order. By constructing a quartic polynomial from the {ai}, one can show (see BL, Section 3) that the cylindrical formulae can be obtained from the corresponding Cartesian formulae (see CW, Equation (1.6)) by making the canonical substitution alalRl. This yields

Equation (53a)

Equation (53b)

Here, the centered, forward, and backward differences in zone i are

Equation (54a)

and similarly for the i + 1 and i − 1 zones. Note that the corresponding Cartesian formulae are given by taking Ri → 1 in Equations (53) and (54).

First, assuming a constant profile, a(R) = C, and taking the volume average across the ith zone, we have that ai = C. Using centered differences, it follows that δai = C ΔR/Ri, hence from Equations (53), we see that aL,i = C as desired. For forward- and backward differences, a constant profile yields aL,i = C[1 + O((ΔR)3)].

Next, assuming a linear profile, a(R) = CR, and volume averaging, we have ai given using Equations (47) and (48) above. Using either centered, forward, or backward differences, it follows that δai = 2C ΔR, hence from Equations (53), we see that aL,i = CRi−1/2 and aR,i = CRi+1/2, as desired.

Finally, assuming a parabolic profile, a(R) = CR2, it is straightforward to show that the volume average of R across the ith zone is

Equation (55)

Using centered differences, it follows that δai = C ΔR[3Ri +5(ΔR)2/(4Ri)], hence from Equations (53), we see that aL,i = CR2i−1/2, as desired. For forward- or backward differences, it can be shown that aL,i = CR2i−1/2[1 + OR/Ri−1/2)3]. Thus, we conclude that parabolic profiles can be recovered up to the required order.

As in Section 5.1, the slopes (meaning the centered, forward, and backward difference δai's) are monotonized in characteristic form using a slight variant of the MC limiter, as in Leveque (2002). Then, after computing the parabolic interpolant, the slopes are re-monotonized to ensure that the interpolation introduces no new extrema. Following BL, the values of aL,i and aR,i are reset to

Equation (56)

whenever ai is a local extremum with respect to aL,i and aR,i, or to

Equation (57a)

Equation (57b)

whenever they are close enough to ai so that the parabolic interpolation function introduces new extrema. The test for this case,

Equation (58)

is geometry independent. As a result, for smooth profiles we obtain second-order accurate approximations to the values of a across each zone at time tn, except possibly at local extrema. By taking γi = 0, we recover the Cartesian versions of Equations (57) (see CW, Equation (1.10)).

6. CHARACTERISTIC EVOLUTION AND AVERAGING

The final step in the calculation of the one-dimensional L/R states is a characteristic time evolution from tn to tn+1/2 following the methods of CW and Colella. This is accomplished by computing the time-averages of the solutions to the linearized primitive variable systems described in Section 4 at zone interfaces over this half-timestep. The particular form of the averages depends on the direction, the order of the reconstruction, the coordinate system, etc.

First, recall the modified primitive variable system described in Section 4 by Equation (21), where A is the linearized hyperbolic wave matrix for the one-dimensional equations projected in the R-direction, which is given by Equation (23). Recall further that (weakly) hyperbolic systems of conservation laws have square wave matrices with real eigenvalues. Thus, let λ1 ⩽ ⋅ ⋅ ⋅ ⩽ λM represent the M real (but not necessarily distinct) eigenvalues of A corresponding to the M linearly independent left- and right-eigenvectors, $\lbrace \boldsymbol{l}^\nu,\boldsymbol{r}^\nu \rbrace$, where ν = 1, ..., M. These eigenvectors are orthonormalized so that $\boldsymbol{l}^\mu \cdot \boldsymbol{r}^\nu = \delta _{\mu \nu }$. Thus, any vector $\boldsymbol{w} \in \mathbb {R}^M$ (in particular the centered, forward, or backward differences across the ith zone, $\boldsymbol{\Delta w}_i$) has the right-eigenvector expansion

Equation (59)

with the coefficients $a^\nu = \boldsymbol{l}^\nu \cdot \boldsymbol{w}$ representing the components of the projection of $\boldsymbol{w}$ onto the left eigenspace of A.

Next, we note that the characteristic form of the primitive variable system is obtained by multiplication of Equation (21) on the left by L, the matrix whose rows are the left-eigenvectors of A, i.e. $\mathbf {L} = \lbrace \boldsymbol{l}^1,\ldots,\boldsymbol{l}^M\rbrace ^T$, hence $\mathbf {L} \mathbf {A} = {\bLambda } \mathbf {L}$ where ${\bLambda }$ is the diagonal matrix consisting of the eigenvalues of A. Neglecting source terms for the moment, we obtain the homogeneous linear system

Equation (60)

where $\boldsymbol{a} \equiv \mathbf {L} \boldsymbol{w}$ is the vector of characteristic variables. From the form of Equation (60), these eigenvalues {λν} evidently represent the signal speeds of wave families along characteristics. Furthermore, the system in Equation (60) decouples into M constant-coefficient linear advection equations of the form

Equation (61)

which have the solution

Equation (62)

where an(ξ) is the reconstructed solution at time tn. Since the solution in Equation (62) depends only on a(ξ), for each characteristic wave impinging on the interface, the contribution to the time-averaged interface state is given by the volume average of this reconstruction over the domain of dependence defined by the wave's characteristic speed, λ, and the time interval (tn, tn + Δt).

In a time Δt, a right-moving wave travels a distance λ Δt in the R-direction. The volume in cylindrical coordinates of the domain of dependence of the left interface state at Ri+1/2 upon this wave is given by VDOD = (Ri+1/2 − λ Δt/2) λ Δt Δϕ Δz. Thus, with χR ≡ λ ΔtR and χL ≡ −λ ΔtR, we have the average of a over VDOD equal to

Equation (63a)

Similarly, over the domain of dependence of the right interface state at Ri−1/2 upon a left-moving wave, we have

Equation (63b)

6.1. PLM Evolution in Cylindrical Geometry

Here, we describe the evaluation of the L/R states at time tn+1/2 based on a piecewise linear reconstruction of the underlying profile at time tn, defined by Equations (38), (46), and (50) of Section 5.1. Substituting a(s) into Equations (63) and integrating, we obtain

Equation (64a)

on the right side of the zone (left of the interface) and

Equation (64b)

at the left of the zone (right of the interface). Here, aL,i and aR,i are the values of a at the left and right interfaces of the ith zone, respectively, Δai is the monotonized difference of a across the zone from Equation (50), and we have defined the functions

Equation (65a)

Equation (65b)

as additional correction factors due to the curvature of the zone. Note that βR,iR), βL,iL) → 0 as R, i.e., in the limit of vanishing curvature, in which case Equations (64) reduce to the Cartesian formulae. Note further that in averaging a(s) over the whole zone, i.e., taking χL/R = 1, we have βR,i(1) = βL,i(1) = γi (see Equation (45)), and from Equations (64), we recover the averages of Equation (44).

6.2. PPM Evolution in Cylindrical Geometry

Here, we describe the evaluation of the L/R states at time tn+1/2 based on a piecewise parabolic reconstruction of the underlying profile at time tn, defined by Equations (51), (52), (53), and (54) of Section 5.2. Substituting a(s) into Equations (63) and integrating, we obtain expressions analogous to Equations (64) for the time average of the right(left)-moving waves over the domain of dependence of the left(right) interface state at Ri+1/2(Ri−1/2) upon these waves:

Equation (66a)

Equation (66b)

The functions βR,iR) and βL,iL) defined in Equations (65) are the correction factors due to the curvature of the zone. The PLM result in Equations (64) corresponds to setting a6,i = 0. Note that Equations (66) also reduce to the Cartesian formulae (see CW, Equation (1.12)) when β → 0 as R. Note further that in averaging a(s) over the whole zone, i.e. taking χL/R = 1, we have βR,i(1) = βL,i(1) = γi, and the results in Equations (66) are consistent with Equation (52).

6.3. Sum Over Characteristics

Once time-averaged L/R states have been obtained in the characteristic variables (as in Equations (64) or (66)), we convert back to the primitive variables using R, the matrix consisting of the right-eigenvectors of A. Since L transforms from primitive to characteristic variables via $\boldsymbol{a} = \mathbf {L}\boldsymbol{w}$, and since RL = I, where I is the standard identity matrix, $\mathbf {R}\boldsymbol{a}=\boldsymbol{w}$ accomplishes the inverse transformation.

Defining aν,n+1/2L,i+1/2faL,i+1/2νR) and aν,n+1/2R,i−1/2faR,i−1/2νL) for each characteristic variable, we obtain the total time-averaged L/R states in primitive variable form by summing the projections of these contributions onto the right eigenspace:

Equation (67)

For example, in the Cartesian case (Stone et al. 2008, Equation (42)), using Equation (64a) or (66a) with β = 0, we have

Equation (68)

As written in Equation (67), the inverse transformation includes a sum over all waves. However, following CW and Colella, contributions to $\boldsymbol{w}$ on a given interface from waves that propagate in the opposite direction may be discarded to yield a more robust solution for strongly nonlinear problems, i.e., the waves are upwinded in the appropriate direction. Thus, for left-moving waves with λ < 0, we may set χL/R = 0 in Equation (64a) to obtain faL,i+1/2(0) = aR,i. Similarly for right-moving waves with λ>0, we may set χL/R = 0 in Equation (64b) to obtain faR,i−1/2(0) = aL,i.

Stone et al. (2008) have noted that this upwinding destroys the formal second-order convergence for smooth flows. In this case, the one-dimensional L/R states are accurate to the desired order if and only if we account for all waves, including those propagating toward the interfaces from outside of the zone. With this approach, the sum in Equation (68) includes all λν. This means that for a given zone we integrate an extrapolation of the local reconstruction profile over a domain of dependence that lies outside the zone. However, for non-smooth flows, we have found that this can lead to significant errors near discontinuities, since we may end up extrapolating the local reconstruction beyond a point of discontinuity into a region where it is no longer a good approximation of the profile. Thus, for flows that may contain discontinuities, we follow CW and restrict to integration only over characteristics that propagate toward the interfaces from the interior of the zone, as previously described. However, we do not use the reference states for waves propagating away from the interface. Thus, we compute the states using

Equation (69a)

Equation (69b)

for Cartesian PLM, which we refer to as "upwind-only" integration. For PLM in cylindrical coordinates, factors (1 − βR,iνR)) and (1 + βL,iνL)) are included in the sums in Equations (69a) and (69b), respectively, using Equations (64a) and (64b). Equations (66a) and (66b) are used to obtain analogous expressions for PPM in cylindrical coordinates.

7. FINITE VOLUME METHOD

The FV method uses approximate time- and area-averaged interface fluxes to update volume-averaged quantities. In cylindrical coordinates (R, ϕ, z), the differential volume element is

Equation (70)

and the finite grid cell volume and interface area are

Equation (71a)

Equation (71b)

Equation (71c)

Equation (71d)

To derive the FV method, we integrate the system in Equations (2) over the volume of a given grid cell, apply Gauss's divergence theorem, and integrate in time from tn to tn+1 to obtain

Equation (72)

where $\boldsymbol{Q}$ represents the volume-averaged conserved quantities, $\boldsymbol{F}$ represents the time- and area-averaged fluxes, and $\boldsymbol{S}$ represents the time- and volume-averaged source terms.

For cylindrical coordinates, in Section 2 we rewrote the ϕ-momentum equation in a modified angular momentum preserving form in order to reduce the number of source terms on the right-hand side of the system. Therefore, when we apply the procedure in Equation (72) to Equation (13), it yields the FV update for the angular momentum, Rρvϕ, not the linear momentum, ρvϕ. However, it can be shown that the radial contribution from a quasi-FV update of the ρvϕ Equation (14),

Equation (73)

is equivalent to the corresponding terms in the true FV update of Equation (11b),

Equation (74)

to second order away from the origin for smooth flows. Note that Equation (74) contains the volume- and time-averaged geometric source term, −MRϕ/R = −(ρvRvϕBRBϕ)/R, whereas Equation (73) has no source term.

The only nonzero component of the geometric source term, $\boldsymbol{S}^{n+1/2}_{{\rm geom},ijk}$, required for the FV update is in the radial momentum Equation (11a). For this term, we must compute

Equation (75)

Naïvely, one might compute this source term from volume-averaged quantities at time tn. However, to achieve second-order accuracy, it is necessary to use time-centered estimates of these quantities, i.e., advanced to the half-timestep tn+1/2. One can think of this as a sort of trapezoid rule applied to the time domain. This half-timestep advance is performed using a combination of FV updates on the volume-centered variables ρ and ρvϕ and CT updates on the interface-centered Bϕ. For the P* contribution, the FV and CT updates to tn+1/2 are too costly, since they would be required for every variable and they, in turn, would require source term calculations. Instead, we compute the total pressure contribution directly from the fluxes at R-interfaces. The appropriate second-order average is

Equation (76)

where P*i±1/2 are the time-averaged pressure fluxes returned directly from the Riemann solver.

Our application of the geometric source term is similar to what is done for the gravity source terms in the existing Athena code. However, we have found it easier to maintain centrifugal balance numerically by using the analytic gravitational acceleration function $\boldsymbol{g}(\boldsymbol{x}) \equiv -\boldsymbol{\nabla } \Phi (\boldsymbol{x})$ in the momentum equation, rather than approximations of the gradient using finite-differences of the static potential, Φ. We approximate the gravitational source term for the momentum equation by

Equation (77)

where $\langle \boldsymbol{x} \rangle _{ijk}$ is the volume centroid of cell (i, j, k), the radial component of which is given by Equation (48). Note that for the case of solid-body rotation with uniform density, $\boldsymbol{g} \propto R$, so that the gravitational source term given by Equation (77) is exact. For the energy equation, we rely on the previously implemented FV update based on the potential function $\Phi (\boldsymbol{x})$, which allows the energy equation to be written conservatively.

To compute the gravitational source terms appearing in the calculation of the L/R states, which only appear in the momentum equation in primitive variable form, we evaluate $\boldsymbol{g}(\boldsymbol{x})$ at the area centroid of each interface. Note that the R-coordinate of the area centroid of ϕ- and z-interfaces coincides with the R-coordinate of the volume centroid of each adjacent grid cell.

8. CONSTRAINED TRANSPORT

In this section, we discuss modifications in cylindrical coordinates to the CT algorithm described in GS05 and Evans & Hawley (1988). As argued in those papers, the integral form of the induction Equation (1d) is most naturally expressed in terms of finite area averages rather than volume averages. In this way, the equation becomes a statement of the conservation of total magnetic flux through a given grid cell and as such automatically preserves the $\nabla \cdot \boldsymbol{B}$ constraint.

8.1. Integral Form and Consistency Relations

To see this, we rewrite the induction equation as

Equation (78)

where ${\mathbf {\mathcal {E}}}= -\boldsymbol{v} \times \boldsymbol{B}$ is the electric field in ideal MHD (the electromotive force (EMF)). Then, integrating over the oriented bounding surface of grid cell (i, j, k) and applying Stokes' theorem, we find that

Equation (79a)

Equation (79b)

Equation (79c)

where

Equation (80a)

Equation (80b)

Equation (80c)

are the interface area-averaged components of the magnetic field normal to each surface (i.e., the magnetic flux per unit area) and

Equation (81a)

Equation (81b)

Equation (81c)

are the corner-centered EMFs averaged over the edges bounding each surface. The EMFs in Equations (81) are approximated to some desired order of accuracy and the surface-averaged field components are evolved using Equations (79).

The interface-centered, area-averaged magnetic field components in Equations (80) comprise the fundamental representation of the magnetic field in Athena. However, one often needs to refer to the cell-centered, volume-averaged magnetic field components as well. Therefore, we adopt the averages

Equation (82a)

Equation (82b)

Equation (82c)

Note the use of an R-weighted average of the BR interface values in Equation (82a); it is straightforward to show that this is the appropriate second-order accurate average in cylindrical coordinates. Equations (82) imply consistency relations between the Godunov fluxes computed by the Riemann solver (the fluxes of the volume-averaged magnetic field components) and the corner-centered EMFs (the fluxes of the area-averaged magnetic field components). These relations define how they are computed from each other (see GS05, for details).

8.2. Calculating the EMFs

The primary modification to the CTU+CT algorithm described in GS05 for cylindrical coordinates concerns the calculation of the upwinded, corner-centered EMF component ${\mathcal {E}}_z$. As we shall demonstrate, we must combine spatial gradients of different curvature to form ${\mathcal {E}}_z$. However, to form ${\mathcal {E}}_R$ or ${\mathcal {E}}_\phi$, we combine spatial gradients of the same curvature, hence the effect of that curvature is canceled out and no subsequent modification is necessary.

For example, to compute ${\mathcal {E}}_{z; \;i-1/2,j-1/2}$, we estimate $(\partial _\phi {\mathcal {E}}_z)_{i-1/2,j-3/4}$ and use a centered-difference scheme to calculate one estimate

Equation (83)

In the same manner, we integrate ${\mathcal {E}}_z$ to the corner from each of the remaining adjacent interface centers and take the arithmetic average:

Equation (84)

To ensure stability, for $(\partial _\phi {\mathcal {E}}_z)_{i-1/2,j-3/4}$, we use the upwinding scheme (GS05, Equation (50)) based on the sign of the mass flux at the center of each interface:

Equation (85)

The formulae for the remaining gradients are analogous.

To obtain the estimates of $\partial _\phi {\mathcal {E}}_z$ needed in Equation (85), we use a centered-difference scheme based on the cell-centered EMFs, computed using volume averages of ρ, $\rho \boldsymbol{v}$, and $\boldsymbol{B}$, and on the interface-centered EMFs, which come directly from the fluxes:

Equation (86a)

Equation (86b)

Note that this scheme has no dependence on the particular type of Riemann solver used to calculate the fluxes. Furthermore, note the different radial scale factors appearing in Equations (86) resulting from the combination of ϕ-gradients at different radii; the factors of Δϕ cancel the factor of Δϕ from Equation (84), but the radial scale factors themselves do not cancel and must be inserted into the algorithm. On the other hand, when ϕ-gradients are combined at the same radius, as is the case for the corner integration of ${\mathcal {E}}_{R}$, both the Δϕ and the corresponding radial scale factors cancel, hence no modification is required.

9. THE ATHENA ALGORITHM

In this section, we summarize in somewhat greater detail the main steps of the six-solve version of the CTU+CT algorithm adapted from Stone et al. (2008) for cylindrical coordinates (see also GS05 and GS08, for details).

  • 1.  
    Compute the first-order source terms, $\boldsymbol{S}^{*}_{i,j,k}$, in both conservative and primitive variable forms using the initial volume-averaged data at time tn. These include the geometric source terms, $\boldsymbol{S}_{\rm geom}$ (Equation (35) for primitive variables, and Equation (75) for conserved variables), the gravitational source terms, $\boldsymbol{S}_{\rm grav}$, computed from static accelerations and potentials (Equation (77) for conserved variables), and the MHD source terms arising from the $\nabla \cdot \boldsymbol{B}$ constraint (e.g., Equations (32) and (33) for three dimensions).
  • 2.  
    Compute the L/R interface states, $\boldsymbol{Q}^{L/R,*}_{i-1/2,j,k}$, $\boldsymbol{Q}^{L/R,*}_{i,j-1/2,k}$, and $\boldsymbol{Q}^{L/R,*}_{i,j,k-1/2}$, by using the desired reconstruction scheme on the initial data in primitive variable form. This requires reconstruction with characteristic evolution as described in Sections 5 and 6, followed by application of the parallel components of the (primitive variable) source terms from step (1).
  • 3.  
    Compute the first-order interface fluxes, $\boldsymbol{F}^*_{R; \;i-1/2,j,k}$, $\boldsymbol{F}^*_{\phi ; \;i,j-1/2,k}$, and $\boldsymbol{F}^*_{z; \;i,j,k-1/2}$, from the interface states via an exact or approximate Riemann solver.
  • 4.  
    Compute the corner-centered electric field components, ${\mathcal {E}}^*_{R; \;i,j-1/2,k-1/2}$, ${\mathcal {E}}^*_{\phi ; \;i-1/2,j,k-1/2}$, and ${\mathcal {E}}^*_{z; \;i-1/2,j-1/2,k}$, from components of the interface-centered fluxes from step (3) and the cell-centered electric field computed using the initial data at time tn, via Equations (84) and (85) for the z-components.
  • 5.  
    Update the interface magnetic field components for a half-timestep using the CT difference Equations (79) and the EMFs from step (4).
  • 6.  
    Compute the updated L/R interface states, $\boldsymbol{Q}^{L/R,n+1/2}_{i-1/2,j,k}$, $\boldsymbol{Q}^{L/R,n+1/2}_{i,j-1/2,k}$, and $\boldsymbol{Q}^{L/R,n+1/2}_{i,j,k-1/2}$, by applying transverse flux gradients to the non-magnetic variables of the interface states and then adding the transverse components of the source terms from step (1).
  • 7.  
    Use the fluxes from step (3) and the source terms from step (1) to compute the velocities at the half-timestep using conservative FV updates of the cell-centered density and momentum at time tn. Average the half-timestep interface magnetic field components from step (5) to obtain the cell-centered magnetic field components at time tn+1/2 using Equations (82). Then, calculate the cell-centered electric field components, ${\mathcal {E}}^{n+1/2}_{R; \;i,j,k}$, ${\mathcal {E}}^{n+1/2}_{\phi ; \;i,j,k}$, and ${\mathcal {E}}^{n+1/2}_{z; \;i,j,k}$, using the cell-centered velocities and magnetic fields at time tn+1/2.
  • 8.  
    Compute the second-order interface fluxes, $\boldsymbol{F}^{n+1/2}_{R; \;i-1/2,j,k}$, $\boldsymbol{F}^{n+1/2}_{\phi ; \;i,j-1/2,k}$, and $\boldsymbol{F}^{n+1/2}_{z; \;i,j,k-1/2}$, using the updated interface states from steps (5) and (6) via the Riemann solver.
  • 9.  
    Compute the corner-centered electric field components, ${\mathcal {E}}^{n+1/2}_{R; \;i,j-1/2,k-1/2}$, ${\mathcal {E}}^{n+1/2}_{\phi ; \;i-1/2,j,k-1/2}$, and ${\mathcal {E}}^{n+1/2}_{z; \;i-1/2,j-1/2,k}$, from components of the updated fluxes from step (8) and the cell-centered electric field components computed in step (7), as in step (4).
  • 10.  
    Use the fluxes from step (8) to obtain half-timestep conservative FV updates of the cell-centered density and ϕ-momentum at time tn, similar to step (7). Compute the cell-centered total pressure, P*, from the interface-centered quantities returned by the Riemann solver in step (8) using Equation (76). Combine the cell-centered Bϕ from step (7) with ρ, ρvϕ, and P* to construct the second-order geometric source term (Equation (75)) at time tn+1/2. Combine ρ and the static gravitational acceleration, $\boldsymbol{g}$, to construct the components of the gravity source term for the momentum equation at time tn+1/2. Combine the interface-centered $\rho \boldsymbol{v}$, obtained directly from the fluxes in step (8), to construct the gravity source term for the energy equation at time tn+1/2.
  • 11.  
    Using the fluxes from step (8) and source terms from step (10), advance the cell-centered quantities from time tn to tn+1 using conservative FV updates on the hydrodynamic variables (mass, momentum, and energy) and using the CT difference Equations (78) with the EMFs from step (9) to update the interface magnetic field components.
  • 12.  
    Average the updated interface magnetic field components from step (11) to compute the updated cell-centered values using Equations (82).
  • 13.  
    Increment the time to tn+1 = tn + Δt and then compute a new timestep using the standard CFL condition based on the maximum signal speed at cell centers and on the size of the grid cells. Here, we must use Ri Δϕ to estimate the CFL stability criterion, since the Riemann solvers compute linear wavespeeds.

This algorithm is simplified for the purely hydrodynamic case. Besides having fewer variables to store, reconstruct, and evolve, there is no need to compute MHD source terms, magnetic components of geometric source terms, or corner- or cell-centered EMFs, or to apply FV or CT updates to magnetic field components.

In adapting the code for cylindrical coordinates, we have altered several steps of the original Cartesian algorithm to varying degrees. First, we significantly change the computation of the L/R states for the R-direction in step (2); only a minor change is needed for the ϕ-direction and no change is needed for the z-direction. Second, we add geometric scale factors to the flux differences in the conservative FV updates performed in steps (7), (10), and (11), and we include the geometric source terms computed in steps (1) and (10). As detailed in Sections 2 and 4, the geometric source terms applied in steps (2) and (6) differ from those applied in steps (7), (10), and (11) because of the differences in the primitive and conservative forms of the evolution equations, and furthermore, the source term contribution from the total pressure, P*, is computed differently in steps (1) and (10), as discussed in Section 7. Finally, we change the CT calculation in steps (4) and (10) to reflect the additional geometric scale factors appearing in the cylindrical coordinate version of the induction Equation (78) and to enforce modified consistency relations, as described in Section 8.1.

10. CODE VERIFICATION TESTS

In this section, we present a suite of tests of our cylindrical coordinate adaptation of the Athena code. Some are drawn from tests published by other authors (GS05; GS08; Londrillo & Del Zanna 2000; Sakurai 1985), which were originally written to test Cartesian codes, including Athena itself, while others are new. Where possible, we have tried to make comparisons with the existing Cartesian tests in order to demonstrate our code's ability to recover their results both qualitatively and quantitatively. We include tests in one, two, and three spatial dimensions, in both hydrodynamics and MHD, with solutions that are both smooth and non-smooth, and having varying levels of symmetry.

10.1. Force Balance

In this problem, we investigate various steady equilibria in order to evaluate the code's ability to balance forces. While there are many possible tests to choose from, we give here two representative examples demonstrating simple magnetohydrostatic equilibria.

First, we consider the axisymmetric magnetic field

Equation (87)

for which the outward magnetic pressure and inward tension forces sum to zero. Note that the magnetic field given by Equation (87) satisfies the $\nabla \cdot \boldsymbol{B} = 0$ constraint. We use B0 = 1 and set the velocity $\boldsymbol{v}=0$, mass density ρ = 1, and gas pressure P = 1. Figure 1 shows the convergence of the L2 norm of the L1 error vector (rms error) for the solution at time t = 10, defined as

Equation (88)

where $\boldsymbol{q}_i^0$ is the initial solution. For reference, we plot a line of slope −2 (dashed) alongside the error to demonstrate that the convergence is second order in 1/N. These data were computed using the HLLD fluxes and third-order reconstruction; the results were similar for all combinations of Roe or HLLD fluxes, second- or third-order reconstruction, and one-dimensional, two-dimensional, or three-dimensional integrators. However, because the two-dimensional and three-dimensional algorithms differ significantly from the one-dimensional version, especially in their inclusion of transverse flux gradients and CT updates, we also present the results of the same test using these integrators on grids which are essentially one dimensional, but contain a few grid cells in each transverse direction considered. By symmetry, it is clear that any number of cells may be used in the transverse directions, but since the grid cell volumes change with R in multidimensions, the CFL condition will determine the timestep based on grid cell volume as well as the maximum signal speed, so the absolute errors should not be compared between, say, the one-dimensional and two-dimensional algorithms. Only the order of convergence of each individual algorithm is meaningful. Additionally, we have performed tests with the outward acceleration v2ϕ/R from a solid-body rotation profile vϕ = Ω0R balanced by the gradient of the static gravitational potential Φ = (Ω0R)2/2, as well as with constant vz ≠ 0, and find similar results in all cases.

Figure 1.

Figure 1. Convergence of the rms error in the L1-norm for the Bϕ force-balance problem in one, two, and three dimensions. For reference, we have plotted a line of slope −2 (dashed) to show that the convergence is second order in 1/N.

Standard image High-resolution image

Second, we consider the non-axisymmetric magnetic field

Equation (89)

which when combined with the gas pressure

Equation (90)

yields zero net force in the ϕ-direction. The combination of static gravitational potential

Equation (91)

and mass density

Equation (92)

together balance the gradient of the gas pressure in the R-direction. Here, we use the angular coordinate ψ = 2π(ϕ − ϕmin)/(ϕmax − ϕmin) so that BR, P, and ρ are all periodic in the ϕ-domain. Note that the magnetic field given by Equation (89) satisfies the $\nabla \cdot \boldsymbol{B}=0$ constraint. We use B0 = 1, P0 = 1, ρ0 = 1, and once again use the solid-body rotation profile vϕ = Ω0R balanced by the gradient of the static gravitational potential Φ2 = (Ω0R)2/2, where Ω0 = π/4. Note that the total potential is given by Φ = Φ1 + Φ2.

Figure 2 shows the convergence of the rms error for the solution at time t = 10. For reference, we once again plot a line of slope −2 (dashed) alongside the error to demonstrate that the convergence is second order. These data were computed using the HLLD fluxes, third-order reconstruction, and the two-dimensional integrator; the results were similar for all combinations of the Roe or HLLD fluxes, second- or third-order reconstruction, and two-dimensional or three-dimensional integrators. We use a computational domain of size N-by-N with R ∈ [1, 2], ϕ ∈ [0, π/4], and z = 0. We use periodic boundary conditions in the ϕ- and z-directions, and Dirichlet boundary conditions in the R-direction. Similar results were obtained using a Neumann boundary condition in the R-direction.

Figure 2.

Figure 2. Convergence of the L1-error for the two-dimensional BR force-balance problem in two dimensions. For reference, we have plotted a line of slope −2 (dashed) to show that the convergence is second order in 1/N.

Standard image High-resolution image

10.2. Rotational Stability

In this problem, we investigate the stability of rotating disks evolved with our code, using the two-dimensional integrator. Given a differential rotation profile, Ω(R), Rayleigh's criterion for stability to axisymmetric, infinitesimal disturbances is that specific angular momentum increase outward:

Equation (93)

While it is possible that systems satisfying Rayleigh's criterion are still subject to growth of finite-amplitude non-axisymmetric disturbances, laboratory measurements at Reynolds number up to 2 × 106 have found that Couette flows violating Rayleigh's criterion show large angular momentum transport associated with turbulence, while those satisfying Rayleigh's criterion do not (Ji et al. 2006).

For our test, we consider power-law rotational profiles of the form Ω(R) ∝ Rq, where q is a constant, the so-called "shear parameter." Rayleigh's criterion in a differentially rotating system of this form predicts stability when q < 2, and instability for q>2. For example, Keplerian rotation with q = 1.5 is predicted to be stable (for unmagnetized flows).

Using a constant background density and pressure, we set

Equation (94)

and set the gravitational potential so that rotational equilibrium is achieved. Next, we perturb vϕ to

Equation (95)

where δvϕ is a random variable uniformly distributed in [ − epsilon, epsilon], and epsilon is small, typically on the order of 10−4. The same initial perturbation is used for each value of q considered. We use a grid of 200 × 400 cells over the domain [3, 7] × [0, π/2], which is chosen so that $R_{\rm{avg}} \,\Delta \phi \sim 2 \Delta R$. We set ρ0 = 200, P0 = 1, and use an adiabatic index of γ = 5/3 which gives cs ≈ 0.09. With Ω0 = 2π, $v_{\phi,\rm{min}} \approx 0.9$, which puts the Mach numbers in a range of approximately 10–20 over the domain. Thus, the flow is rotationally dominated.

As a diagnostic of instability, we compute a scaled mean perturbed angular momentum flux,

Equation (96)

For stable flows, this will remain on the order of the initial perturbation, but for unstable flows, it will diverge exponentially. Figure 3 shows the values of the dimensionless angular momentum flux as a function of time for t ∈ [0, 300] for various values of the shear parameter near the marginal stability limit of q = 2. Consistent with Rayleigh's criterion, the flows with q < 2 remain stable, and those with q>2 go unstable. For the q = 2.05 case, the instability reaches saturation more quickly (around t = 90) and the mass flies off the grid, but the characteristic exponential growth is observed before this point. This test demonstrates the code's accurate conservation of angular momentum near the boundary of rotational stability.

Figure 3.

Figure 3. Mean dimensionless angular momentum transport as a function of time in the Rayleigh rotational stability test for various values of q.

Standard image High-resolution image

Additionally, we investigate the long-term stability of the rotation profiles given by the shear parameters q = 1, typical of galactic disk systems, and q = 1.5, typical of Keplerian systems. For this test we use the unperturbed equilibrium solutions as initial data. As a diagnostic of the error, we compute the cumulative mean of the dimensionless background angular momentum flux (proportional to the radial accretion rate):

Equation (97)

Figure 4 shows the dimensionless cumulative mean as a function of time for t ∈ [0, 300]. We use the same computational domain and background state as above. Since vϕ = ΩRR1−q is constant for q = 1, and constant profiles are reconstructed exactly in our code, we observe relatively small errors for this level of discretization, indicating that angular momentum is conserved very well for systems of astrophysical interest.

Figure 4.

Figure 4. Cumulative mean (time and space average) of the dimensionless background radial angular momentum flux as a function of time for shear parameters q = 1 and q = 1.5 with unperturbed initial data.

Standard image High-resolution image

10.3. Adiabatic Blast Wave

In this problem, we investigate a strong two-dimensional shock using the HLLC solver. We use the parameter set of GS08 and compare the outputs of our cylindrical code with those from the Cartesian version of Athena. For the Cartesian version we use the domain (x, y) ∈ [ − 0.5, 0.5] × [ − 0.75, 0.75], and for the cylindrical version we use the domain (R, ϕ) ∈ [1, 2] × [ − 0.5, 0.5] so that the physical domain spans an arc length of $R_{\rm{mid}}(\phi _{\rm{max}}-\phi _{\rm{min}})=1.5$ at $R_{\rm{mid}}=1.5$, giving a roughly similar domain sizes. The initial conditions consist of a circular region of hot gas with radius R = 0.1 and pressure P = 10 in an ambient medium of uniform pressure P0 = 0.1 and density ρ0 = 1. We use a computational grid of 200 × 300 cells, third-order reconstruction, and the HLLC fluxes with upwind-only integration for the L/R states in each version of the test. Contour plots of the density, pressure and specific kinetic energy densities of the evolved state at time t = 0.2 are shown in Figure 5 using the cylindrical (left column) or Cartesian (right column) version of Athena. For additional comparison, one-dimensional plots of these variables along a horizontal line through the center of the blast are shown in Figure 6, demonstrating excellent agreement between the Cartesian and cylindrical versions of Athena. Note in the Cartesian version that symmetry is perfectly preserved by the integrator, which is most easily seen in the grid noise in the interior of the shell in Figure 5. Symmetry is also preserved rather well in the cylindrical version although in this case the grid is non-uniform.

Figure 5.

Figure 5. Contours of selected variables of the evolved state (at time t = 0.2) for the two-dimensional hydrodynamic blast wave test using 200 × 300 grid cells, third-order reconstruction, HLLC fluxes, and the cylindrical (left column) or Cartesian (right column) versions of Athena. Thirty equally spaced contours between the minimum and maximum are drawn in each plot.

Standard image High-resolution image
Figure 6.

Figure 6. Plots of selected variables along a horizontal line through the center of the blast at time t = 0.2 for the two-dimensional hydrodynamic blast wave test (see Figure 5 legend), using the cylindrical (circles) or Cartesian (solid line) versions of Athena.

Standard image High-resolution image

10.4. Rotating Wind

In this problem, we investigate a steady, axisymmetric, rotating hydrodynamic wind as a test of angular momentum transport across a sonic transition. We adopt a Newtonian gravitational potential of the form Φg = −GM/R. The constants of motion are given by

Equation (98)

Equation (99)

Equation (100)

This flow must satisfy the Bernoulli equation, $\mathcal {B} = {\rm constant}$, along streamlines for

Equation (101)

where

Equation (102)

is the specific enthalpy of the gas.

We scale density and pressure to their values at infinity, ρ ≡ ρ() and PP(), and the radial coordinate to some finite fiducial value, RB. In terms of α ≡ ρ/ρ and χ ≡ R/RB, the constant entropy parameter is K = c2/(γ ργ−1), where c2 ≡ γP is the square of the sound speed at infinity. At any radius, the local sound speed, radial velocity, and specific enthalpy satisfy

Equation (103)

Equation (104)

Equation (105)

where $\mathcal {M}_R \equiv v_R / c_s$ is the radial Mach number.

We define the dimensionless radial mass flux by

Equation (106)

and the dimensionless angular momentum by

Equation (107)

Solving Equation (106) for α and introducing β ≡ 2(γ − 1)/(γ + 1), we find that $\alpha ^{\gamma -1} = [\lambda /(\chi \mathcal {M}_R)]^\beta$. Finally, taking RB to be the Bondi radius, RBGM/c2, we obtain the dimensionless Bernoulli equation

Equation (108)

where $\tilde{\mathcal {B}} \equiv \mathcal {B}/h_\infty$ is the dimensionless Bernoulli constant, and hc2/(γ − 1) is the specific enthalpy at infinity.

Figure 7 shows the contours of λ for various values of ω, using an adiabatic index of γ = 5/3. For the ω = 0 case, we recover a cylindrical version of Parker's spherically symmetric wind (see, e.g., Spitzer 1978). The bold lines represent the transonic solutions (wind and accretion) passing through the X-type saddle points. These solutions can be found by first writing Equation (108) as $\mathcal {F}(\mathcal {M}_R) f(\lambda) = \mathcal {G}(\chi)$ and requiring that $\mathcal {F}^{\prime }=\mathcal {G}^{\prime }=0$. The first constraint implies that $\mathcal {M}_R = 1$, i.e., the saddle point is the sonic point. The second constraint yields a quadratic in χ, and for ω ∈ (0, ωmax), there are two distinct, positive solutions,

Equation (109)

where $\omega _{\rm max} \equiv (3-\gamma)/(4\tilde{\mathcal {B}}^{1/2})$. It can be shown that χ gives an O-type critical point and χ+ gives the desired transonic critical point. For ω>ωmax, no transonic solutions exist. Note further that no transonic solutions exist for χ < χmin, where χmin represents the point at which the transonic wind solution for which $\mathcal {M}_R \rightarrow \infty$ as χ → joins the transonic accretion solution for which $\mathcal {M}_R \rightarrow 0$ as χ → (see, e.g., the lower-left panel of Figure 7). We define χmin to be the smallest value of χ ⩾ 0 for which $\mathcal {G}(\chi) \ge 0$, which is given by

Equation (110)

Finally, the critical value of the radial mass flux, λc, is defined by Equation (108) with χ = χ+ and $\mathcal {M}_R = 1$, which is given by

Equation (111)
Figure 7.

Figure 7. Contours of the dimensionless mass flux, λ, for a rotating hydrodynamic steady flow with γ = 5/3 and dimensionless Bernoulli constant $\tilde{\mathcal {B}}=1$. The scaled angular momentum in each panel is (a) ω = 0, (b) ω = 0.2, (c) ω = 0.3, and (d) ω = 1/3. The critical transonic contours are shown in bold.

Standard image High-resolution image

For our code test, we use γ = 5/3 (i.e. β = 1/2), ω = 0.3, and $\tilde{\mathcal {B}}=1$, which give the transonic solution shown in Figure 7(c). The critical point occurs at χ+ ≈ 0.479, with λc ≈ 1.377. We solve the problem on the domain χ ∈ [χ, 2], where χ ≈ 0.188, using bisection with a tolerance of epsilon = 10−10 to evaluate $\mathcal {M}_R$ at each χ from Equation (108). Once $\mathcal {M}_R$ is known, vR, ρ, and P follow algebraically. We choose units such that GM = c = 1, which yields RB = 1. We fix the solution at the inner and outer boundaries and evolve the initial solution long enough for it to settle into equilibrium.

Figure 8 shows the convergence of the L2 norm of the L1 error vector for the solution at time t = 5.0. These data were computed using the Roe fluxes, second-order reconstruction, and the one dimension; the results were similar for all combinations of Roe or HLLC fluxes and second- or third-order reconstruction. The test was also performed using the two-dimensional and three-dimensional integrator with a few grid cells in the transverse directions.

Figure 8.

Figure 8. Convergence of the rms error in the L1-norm for various levels of discretization of the rotating hydrodynamic wind test in one, two, and three dimensions. For reference, we have plotted a line of slope −2 (dashed) to show that the convergence is second order in 1/N.

Standard image High-resolution image

This test clearly demonstrates the code's ability to maintain smooth, steady hydrodynamic flows in both subsonic and supersonic regimes, as well as its ability to conserve angular momentum to second order in cylindrical geometry.

10.5. Field Loop Advection

In this problem, we investigate the advection of a weak field loop in two-dimensional and three-dimensional cylindrical coordinates, analogous to the Cartesian test appearing in GS05 and GS08. The main difference with our test is that we advect the field loop in the ϕ-direction only as opposed to a more general advection oblique to the grid. We use the computational domain (R, ϕ) ∈ [1, 2] × [ − 2/3, 2/3], which has the same total area as the Cartesian version of the test. We use periodic boundary conditions in ϕ and fixed boundary conditions in R. We use uniform initial density ρ0 = 1 and pressure P0 = 1 with a solid-body rotation profile of vϕ = Ω0R, where we set Ω0 = 4/3 so that the field loop is advected once across the grid by t = 1. The initial z-component of the magnetic field is 0, and the R- and ϕ-components are set using the z-component of the magnetic vector potential

Equation (112)

where a0 is the radius of the field loop and $r \equiv \sqrt{R^2 + R_0^2 - 2 R R_0 \cos (\phi -\phi _0)}$ is the distance from the center of the loop (R0, ϕ0). We use A0 = 10−3 and a0 = 0.3 so that inside the field loop P/B = 106 and the field loop should be advected passively.

Figure 9 shows the magnetic energy density B2/2 and magnetic field lines at times t = 0 and t = 2 for the two-dimensional problem. The field lines are the contours of Az which can be readily computed since the field is planar and the CTU+CT algorithm preserves the $\nabla \cdot \boldsymbol{B} = 0$ condition. Note that the circular shape of the field lines is nicely preserved.

Figure 9.

Figure 9. For the two-dimensional field loop advection test, we show the magnetic energy density B2/2 at times t = 0 and t = 2 in panels (a) and (b), respectively. Panels (c) and (d) contain magnetic field lines at t = 0 and t = 2, respectively.

Standard image High-resolution image

Figure 10 shows the time evolution of the volume-averaged magnetic energy density. The dissipation is well-described by a power law of the form 〈B2/2〉 = A(1 − (t/τ)α) (for t ≪ τ), with A = 7.02 × 10−8, τ = 1.46 × 104, and α = 0.342, and with a residual error of 0.0580. Note that the overall dissipation in this problem is less than that of the Cartesian version since the advection is only in one direction; GS05 found τ = 1.06 × 104 and α = 0.291 for a similar fit.

Figure 10.

Figure 10. Time evolution showing dissipation of the volume-averaged magnetic energy density B2/2 for the two-dimensional field loop advection test. The solid line represents a power-law fit (for t ≪ τ) to the data points with residual 0.0580.

Standard image High-resolution image

10.6. Blast Wave in a Strong Magnetic Field

In this problem, we investigate two-dimensional and three-dimensional MHD shocks in a strongly magnetized medium with low plasma-β, denoted βp ≡ 2P/B. We run two problems, one with B0 = 1 and βp = 0.2 using the parameter set of GS08, and another with B0 = 10 and βp = 0.02 using the parameter set of Londrillo & Del Zanna (2000). In each case, we compare the outputs of the cylindrical and Cartesian versions of Athena.

The moderate B-field, βp = 0.2 case uses HLLD fluxes and the same setup as the hydrodynamic blast described in Section 10.3, but with a uniform background magnetic field of strength B0 = 1 oriented at a 45° angle to the positive $\hat{x}$- or $\hat{R}$-axis. For the two-dimensional case, contour plots of the density, pressure, specific kinetic energy, and magnetic energy are shown in Figure 11 based on the cylindrical (left column) or Cartesian (right column) versions of Athena. Figure 12 shows a plot of these variables along a horizontal line through the center of the blast. Note that in the Cartesian version, the background field is uniformly inclined to the grid, but in the cylindrical version, the angle the background field makes with the grid changes as a function of ϕ; nonetheless, a high degree of symmetry is observed in the solution. We have also tested a three-dimensional analog of this problem on a 2003 grid with z ∈ [ − 0.5, 0.5]. Again, plots of selected variables along a horizontal line through the center of the blast (in the z = 0 plane) in Figure 13 show agreement between the Cartesian and cylindrical versions of Athena.

Figure 11.

Figure 11. Contours of selected variables of the evolved state (at time t = 0.2) for the two-dimensional MHD blast wave test with B0 = 1 and βp = 0.2 using 200 × 300 grid cells, third-order reconstruction, HLLD fluxes, and using the cylindrical (left column) or Cartesian (right column) versions of Athena. Thirty equally spaced contours between the minimum and maximum are drawn in each plot.

Standard image High-resolution image
Figure 12.

Figure 12. Plots of selected variables along a horizontal line through the center of the blast at time t = 0.2 for the two-dimensional MHD blast wave test with B0 = 1 and βp = 0.2 using the cylindrical (circles) or Cartesian (solid line) versions of Athena.

Standard image High-resolution image
Figure 13.

Figure 13. Plots of selected variables along a horizontal line through the center of the blast at time t = 0.2 for the three-dimensional MHD blast wave test with B0 = 1 and βp = 0.2 using the cylindrical (circles) or Cartesian (solid line) versions of Athena.

Standard image High-resolution image

The strong B-field, βp = 0.02 case uses the domain (x, y) ∈ [ − 0.5, 0.5] × [ − 0.5, 0.5] for the Cartesian version, and for the cylindrical version, uses the domain (R, ϕ) ∈ [1, 2] × [2/3, 2/3], giving a roughly similar domain size in each case. The initial conditions consist of a circular region of hot gas with radius R0 = 0.125 and pressure P = 100 in an ambient medium of uniform pressure P0 = 1 and density ρ0 = 1. There is uniform background magnetic field of strength B0 = 10 oriented parallel to the x-axis. We use a computational grid of 2002 cells, third-order reconstruction and the HLLD fluxes with upwind-only integration for the L/R states. The density, pressure, specific kinetic energy, and magnetic energy along a horizontal line through the center of the blast at time t = 0.02 are shown in Figure 14, with comparison to the Cartesian version of Athena. We have also conducted a three-dimensional analog of this test on a 2003 grid with z ∈ [ − 0.5, 0.5]. Figure 15 shows a comparison of contour plots with the Cartesian version of Athena, and Figure 16 shows a comparison along a horizontal line through the center of the blast (in the z = 0 plane).

Figure 14.

Figure 14. Plots of selected variables along a horizontal line through the center of the blast at time t = 0.02 for the two-dimensional MHD blast wave test with B0 = 10 and βp = 0.02 using the cylindrical (circles) or Cartesian (solid line) versions of Athena.

Standard image High-resolution image
Figure 15.

Figure 15. Contours of selected variables at time t = 0.02 for the three-dimensional MHD blast wave test with B0 = 10 and βp = 0.02 using 2003 grid cells and the cylindrical (left column) or Cartesian (right column) versions of Athena. Thirty equally spaced contours between the minimum and maximum are drawn in each plot.

Standard image High-resolution image
Figure 16.

Figure 16. Plots of selected variables along a horizontal line through the center of the blast at time t = 0.02 for the three-dimensional MHD blast wave test with B0 = 10 and βp = 0.02 using the cylindrical (circles) or Cartesian (solid line) versions of Athena.

Standard image High-resolution image

10.7. Weber–Davis Wind

In this problem, we investigate a cylindrical version of the Weber–Davis wind solution as described in Sakurai (1985). We assume a steady, axisymmetric, two-dimensional MHD flow with planar magnetic field, and a gravitational potential Φg = −GM/R. The constants of motion are K = Pρ−γ, $\dot{M} = R\rho v_R$, f = RBR, β = BR/(ρvR), as well as

Equation (113a)

Equation (113b)

Equation (113c)

Here, $\boldsymbol{u} \equiv (v_R, \,v_\phi -R\Omega,\,0)$ is the velocity in a frame rotating at angular velocity Ω, and in this frame $\boldsymbol{B} = \beta \rho \boldsymbol{u}$, so that the fluid feels no force from the magnetic field. Note that the Bernoulli parameter in the rotating frame includes a centrifugal potential contribution. The Alfvén Mach number in the rotating frame is given by $\mathcal {M}_A \equiv u/c_A = 1/\sqrt{\beta ^2 \rho }$. Let RA and ρA denote the radius and density, respectively, at the Alfvén Mach point, i.e., where $\mathcal {M}_A = 1$. Then $\beta = 1/\sqrt{\rho _A}$ and J = R2AΩ.

Letting xR/RA and $y \equiv \rho /\rho _A = \rho \beta ^2 = \mathcal {M}_A^{-2}$ denote the scaled radius and density, respectively, the Bernoulli parameter is

Equation (114)

where we have defined the scaled parameters

Equation (115a)

Equation (115b)

Equation (115c)

Letting $\tilde{\mathcal {B}} \equiv \mathcal {B}/(GM/R_A)$, we have

Equation (116a)

Equation (116b)

To find wind solutions, we solve the Bernoulli Equation (114) under the constraint that the solution be locally flat at the slow- and fast-magnetosonic points, i.e., $\partial \tilde{\mathcal {B}}/\partial x = \partial \tilde{\mathcal {B}}/\partial y = 0$ at (xs,  ys) and (xf,  yf). We will specify θ and ω, and let η, $\tilde{\mathcal {B}}$, xs, ys, xf, and yf vary. Note that this becomes a system of six equations in six unknowns, so if a solution exists, it must be unique. Following Sakurai (1985), we use the parameters γ = 1.2, θ = 1.5 and ω = 0.3 as for the spherically symmetric solar wind model of Weber and Davis. The numerical solution is given in Table 1.

Table 1. Weber–Davis Wind Parameters

Parameter Value
γ 1.2
θ 1.5
ω 0.3
η 2.3609
$\tilde{\mathcal {B}}$ 7.8745
xs 0.5243
ys 2.4986
xf 1.6383
yf 0.5374

Download table as:  ASCIITypeset image

We solve the problem on the domain x ∈ [0.4, 1.8], so that the wind solution passes through all three critical points. We choose units such that GM = 1 and fix the initial solution at the inner and outer boundaries, evolving it long enough for equilibrium to develop. Figure 17 shows the convergence of the rms error in the L1-norm of the solution at t = 5.0 compared to the initial solution. These data were computed using the Roe fluxes, second-order reconstruction, and the one-dimensional integrator; the results were similar for all combinations of Roe/HLLD fluxes and second-/third-order reconstruction. Because the two-dimensional and three-dimensional algorithms differ significantly from the one-dimensional version, especially in their treatment of magnetic fields, we present the results of the same test using these integrators on grids which are essentially one-dimensional, but contain a few grid cells in each transverse direction considered.

Figure 17.

Figure 17. Convergence of the rms error in the L1-norm for various levels of discretization of the Weber–Davis MHD wind test in one, two, and three dimensions. For reference, we have plotted a line of slope −2 (dashed) to show that the convergence is second order in 1/N.

Standard image High-resolution image

Evidently, the algorithm yields second-order convergence for smooth MHD flows, and is able to maintain a steady magnetized solution, also conserving angular momentum as it is exchanged between the fluid and magnetic field.

11. CONCLUSION

We have described an adaptation of the Athena astrophysical MHD code for cylindrical coordinates. The original Cartesian code uses a combination of higher-order Godunov methods (based on the CTU algorithm of Colella) to evolve the mass-density, momenta, and total energy, and CT (Evans & Hawley 1988) to evolve the magnetic fields. We have described modifications to the second- and third-order reconstruction schemes, the finite-volume and finite-area formulations of the MHD equations, and the inclusion of geometric source terms.

Our approach is advantageous in that it does not require modification to the majority of the existing code, in particular to the Riemann solvers and eigensystems. Furthermore, our approach to implementing cylindrical coordinates could be applied in a straightforward manner to enable other curvilinear coordinate systems, such as spherical coordinates, in the Athena code as well as other higher-order Godunov codes.

Finally, our code and test suite are publicly available for download on the Web. The code is currently being used for a variety of applications, including studies of global accretion disks, and we hope it will be of use to many others studying problems in astrophysical fluid dynamics.

The authors thank Jim Stone for helpful discussions about the Athena algorithms, and Peter Teuben for his assistance with the code package. This work was supported by grant AST 0507315 from the National Science Foundation.

Please wait… references are loading.
10.1088/0067-0049/188/1/290