0805.3356/ms.tex
1: %\documentclass[12pt,preprint]{aastex}
2: \documentclass{emulateapj}
3: 
4: %Used for picture environment.
5: %\usepackage{color}
6: \usepackage{amsmath}
7: 
8: \shorttitle{}
9: \shortauthors{}
10: 
11: \begin{document}
12: 
13: \title{BETHE-Hydro: An Arbitrary Lagrangian-Eulerian
14:   Multi-dimensional Hydrodynamics Code for Astrophysical Simulations}
15: 
16: \author{Jeremiah W. Murphy\altaffilmark{1,2}}
17: \author{Adam Burrows\altaffilmark{1}}
18: 
19: \altaffiltext{1}{Steward Observatory, The University of Arizona,
20:   Tucson, AZ 85721; jmurphy@as.arizona.edu, burrows@as.arizona.edu}
21: \altaffiltext{2}{JINA Fellow.}
22: 
23: \begin{abstract}
24: In this paper, we describe a new hydrodynamics code for 1D and 2D
25: astrophysical simulations, BETHE-hydro, that uses time-dependent,
26: arbitrary, unstructured grids. The core of the hydrodynamics algorithm
27: is an arbitrary Lagrangian-Eulerian (ALE) approach, in which the
28: gradient and divergence operators are made compatible using the
29: support-operator method.  We present 1D and 2D gravity solvers that
30: are finite differenced using the support-operator technique, and the
31: resulting system of linear equations are solved using the tridiagonal
32: method for 1D simulations and an iterative multigrid-preconditioned
33: conjugate-gradient method for 2D simulations. Rotational terms are
34: included for 2D calculations using cylindrical coordinates.  We
35: document an incompatibility between a subcell pressure algorithm to
36: suppress hourglass motions and the subcell remapping algorithm and
37: present a modified subcell pressure scheme that avoids this
38: problem. Strengths of this code include a straightforward structure,
39: enabling simple inclusion of additional physics packages, the ability
40: to use a general equation of state, and most importantly, the ability
41: to solve self-gravitating hydrodynamic flows on time-dependent,
42: arbitrary grids.  In what follows, we describe in detail the numerical
43: techniques employed and, with a large suite of tests, demonstrate that
44: BETHE-hydro finds accurate solutions with 2$^{nd}$-order convergence.
45: \end{abstract}
46: 
47: \keywords{hydrodynamics --- instabilities --- methods: numerical ---
48:   shock waves --- supernovae: general }
49: 
50: \section{Introduction}
51: 
52: The ability to simulate hydrodynamic flow is key to studying most astrophysical objects.
53: Supernova explosions, gamma-ray bursts, X-ray bursts, classical novae,
54: the outbursts of luminous blue variables (LBVs), and stellar winds are just a few
55: phenomena for which understanding and numerical tools evolve in tandem.  This is due
56: in part to the physical complexity, multi-dimensional character, and instabilities
57: of such dynamical fluids. Moreover, rotation is frequently a factor in the 
58: dynamical development of astrophysical transients.  One-dimensional hydrodynamics
59: is by and large a solved problem, but multi-dimensional hydrodynamics is still a challenge.
60: In the context of astrophysical theory, this is due primarily to the need to address 
61: time-dependent gravitational potentials, complicated equations of state (EOSs),
62: flexible grids, multi-D shock structures, and chaotic and turbulent flows.
63: As a result, theorists who aim to understand the Universe devote much of their 
64: time to code development and testing.  
65: 
66: One of the outstanding and complex problems in theoretical astrophysics is the 
67: mechanism for core-collapse supernovae. For more than two decades, 
68: the preferred mechanism of explosion has been the delayed neutrino mechanism \citep{bethe85}.
69: One-dimensional (1D) simulations generally fail to produce explosions
70: \citep{liebendorfer01a,liebendorfer01b,rampp02,buras03,thompson03,liebendorfer05}.
71: However, 2-dimensional (2D) simulations, and the accompanying
72: aspherical instabilities, suggest that the neutrino-mechanism may indeed be viable
73: \citep{herant94,janka95,burrows95,burrows07a,buras06,kitaura06}, though this
74: has yet to be proven.  In fact, \citet{burrows06} have recently reported an 
75: acoustic mechanism, which seems to succeed on long timescales when and if
76: other mechanisms fail.  These authors identified two primary
77: reasons why this mechanism might have been missed before:  1) 2D
78: radiation-hydrodynamic simulations with reasonable approximations are
79: still expensive to run, and with limited resources simulations are
80: rarely carried to late enough times; and 2), a noteworthy feature of the code
81: they used, VULCAN/2D, is its Arbitrary Lagrangian-Eulerian (ALE) structure.
82: VULCAN/2D incorporates non-standard grids that liberate the inner core from the Courant 
83: and resolution limitations of standard spherical grids. In this context, 
84: \citet{burrows06} claim that simulating all degrees of freedom
85: leads to a new mechanism in which the gravitational energy in aspherical
86: accretion is converted to explosion energy by first exciting
87: protoneutron star core g-modes. These modes then radiate acoustic power
88: and revive the stalled shock into explosion.  Remarkably, the acoustic
89: mechanism, given enough time, leads to successful
90: core-collapse supernovae in all progenitors more massive than $\sim$9
91: M$_{\odot}$ simulated to date \citep{burrows06,burrows07a}.  However, this is a
92: remarkable claim, and given the implications, must be thoroughly investigated.
93: For instance, one question to ask is: could the results seen by \citet{burrows06} 
94: be numerical artifacts of VULCAN?
95: 
96: Therefore, to address this and other issues that surround the acoustic 
97: supernova mechanism, as well as a host of other outstanding astrophysical puzzles, 
98: we have designed the new hydrodynamic code,
99: BETHE-hydro\footnote{Hydrodynamic core of BETHE ({\bf B}asic {\bf E}xplicit/Implicit {\bf
100:     T}ransport and {\bf H}ydrodynamics {\bf E}xplosion Code)}, from the bottom up.
101: BETHE-hydro will be coupled with the 2D mixed-frame radiation transport scheme of
102: \citet{hubeny07} to create the 2D radiation/hydrodynamics code BETHE, and the merger
103: of these two codes will be the subject of a future paper.  In
104: this paper, we present and test the hydrodynamic and gravity 
105: algorithms of BETHE-hydro. Since BETHE-hydro uses arbitrary grids and a general 
106: gravity solver, we expect it to be a powerful and flexible numerical tool, 
107: able to configure the grid to suit the computational challenge.
108: 
109: The core of BETHE-hydro is a 1D and 2D ALE
110: hydrodynamics solver.  First, solutions to the Lagrangian hydrodynamic
111: equations are obtained on an arbitrary polygonal grid.  Then, to avoid
112: tangled grids, the hydrodynamic variables can be remapped to another grid.
113: A unique and powerful feature of ALE schemes is their
114: flexibility to tailor an arbitrary grid to the computational challenge
115: and to alter the grid dynamically during runtime.  Hence, purely Lagrangian,
116: purely Eulerian, or arbitrarily moving grids (chosen to optimize
117: numerical performance and resolution) are possible.  These grids
118: can be non-orthogonal, non-spherical, and non-Cartesian.
119: 
120: Some of the earliest 2D hydrodynamic simulations in astrophysics were,
121: in fact, performed to address the core-collapse problem.  While some
122: employed standard fixed-grid schemes \citep{smarr81}, other 2D
123: simulations were calculated with adaptive grids.  Although many
124: utilized moving grids, for the most part, the differencing
125: formulations were Eulerian \citep{leblanc70,symbalisty84,miller93}.
126: On the other hand, \citet{livio80} did employ an ``Euler-Lagrange''
127: method involving a Lagrangian hydrodynamic solve, followed by a
128: remapping stage.  Even though these simulations did exploit radially
129: dynamical grids, they were restricted to be orthogonal and spherical.
130: 
131: Many of the current hydrodynamic algorithms used in
132: astrophysics are based upon either ZEUS \citep{stone92a} or
133: higher-order Godunov methods, in particular the Piecewise-Parabolic Method (PPM)
134: \citep{colella84,woodward84}.  Both approaches have been limited to
135: orthogonal grids.  One concern with PPM-based codes is that they
136: solve the hydrodynamic equations in dimensionally-split
137: fashion.  As a result, there have been concerns that these algorithms
138: do not adequately resolve flows that are oblique to the grid
139: orientation.  Rectifying this concern, recent unsplit higher-order
140: Godunov schemes, or approximations thereof, have been developed
141: \citep{truelove98,klein99,gardiner05,miniati07}.  Despite this
142: and the employment of adaptive mesh refinement (AMR), these codes must use
143: orthogonal grids that are often strictly Cartesian.
144: 
145: In BETHE-hydro, we use 
146: finite-difference schemes based upon the support-operator method \citep{shashkov95} of
147: \citet{caramana98c} and \citet{caramana98a}.  Differencing
148: by this technique enables conservation of energy to roundoff error in the absence of rotation and time-varying
149: gravitational potentials.  Similarly, momentum is conserved
150: accurately, but due to the artificial viscosity scheme that we employ,
151: it is conserved to roundoff error for hydrodynamic simulations
152: using Cartesian coordinates only.  Moreover, using the support-operator method and borrowing from an
153: adaptation of the support-operator technique for elliptic equations \citep{morel98},
154: we have developed a gravity solver for arbitrary grids. Unfortunately, by 
155: including a general gravity capability, we sacrifice strict energy and momentum conservation.
156: However, we have performed tests and for most cases the results are
157: reasonably accurate.  Furthermore, we have included rotational terms and we use a
158: modified version of the subcell pressure scheme to mitigate hourglass instabilities 
159: \citep{caramana98a}. 
160: 
161: To resolve shocks, we employ an artificial viscosity method, 
162: which is designed to maintain grid stability as well \citep{campbell01}, and there are 
163: no restrictive assumptions made about the equation of state.  
164: Higher-order Godunov techniques employ Riemann solvers to 
165: resolve shocks, but frequently need an artificial viscosity scheme 
166: to eliminate unwanted post-shock ringing.
167: Moreover, the inner workings of Riemann
168: solvers often make local approximations that the EOS has a gamma-law
169: form, which stipulates that as the internal energy goes to zero so
170: does the pressure. For equations of state appropriate for core-collapse supernovae, this
171: artificially imposed zero-point energy can pose problems for the
172: simulations \citep{buras06}.  
173: 
174: Two codes in astrophysics which have already capitalized on the
175: arbitrary grid formulations of ALE are Djehuty
176: \citep{bazan03,dearborn05} and VULCAN/2D \citep{livne93,livne04}.  In both
177: cases, the grids employed were designed to be spherical in
178: the outer regions, but to transition smoothly to a cylindrical grid near the
179: center.  These grid geometries reflected the basic structure of stars, while
180: avoiding the cumbersome singularity of a spherical
181: grid.  With this philosophy, \citet{dearborn06}, using Djehuty, have
182: studied the helium core flash phase of
183: stellar evolution in 3D.  In the core-collapse context,
184: \citet{burrows06,burrows07c,burrows07a}, using VULCAN/2D, performed 2D
185: radiation/hydrodynamic and radiation/MHD simulations with rotation.
186: 
187: Several gravity solvers have been employed in
188: astrophysics.  The most trivial are static or monopole approaches.
189: For arbitrary potentials, the most extensively used are N-body
190: schemes, which fit most naturally in Smooth Particle
191: Hydrodynamics (SPH) codes \citep{monaghan92}.  As a virtue, SPH solves
192: the equations in a grid-free context, and while SPH
193: has opened the way to three-dimensional (3D) hydrodynamic simulations
194: in astrophysics, including core-collapse simulations \citep{fryer02},
195: the smoothing kernels currently employed pose serious problems for
196: simulating fundamental hydrodynamic instabilities such as the
197: Kelvin-Helmholtz instability \citep{agertz07}.  Another approach
198: to the solution of Poisson's equation for gravity is the use of
199: multipole expansions of the potential \citep{muller95}.  This
200: technique achieves its relative speed by calculating simple
201: integrals on a spherical grid once. Then, the stored integrals are 
202: used in subsequent timesteps.  In BETHE-hydro, we
203: construct finite-difference equations for Poisson's equation using the
204: support-operator method and find solutions to the resulting linear
205: system of equations for the potentials via an iterative
206: multigrid-preconditioned conjugate-gradient method \citep{ruge87}.
207: 
208: In \S \ref{section:bethe_hydro}, we give a summary of BETHE-hydro and sketch the flowchart of the
209: algorithm.  The coordinates and mesh details are discussed in \S \ref{section:coords_mesh}. We then 
210: describe in \S\ref{section:lag_hydro} the discrete Lagrangian equations, including 
211: specifics of the 2$^{nd}$-order time-integration and rotational terms.  Section \ref{section:gravity} gives a
212: complete description of the 1D and 2D gravity solvers.  Hydrodynamic
213: boundary conditions are discussed in \S \ref{section:hydro_boundary}.
214: The artificial viscosity algorithm that provides shock resolution and grid stability
215: is described in \S \ref{section:artificial_viscosity}. In \S \ref{section:hourglass}, we present the
216: subcell pressure scheme that suppresses hourglass modes. Remapping is described
217: in depth in \S \ref{section:remap}.  In \S \ref{section:tests}, we
218: demonstrate the code's strengths and limitations with some test
219: problems. Finally,  in \S \ref{section:discussion} we summarize 
220: the central characteristics and advantages of BETHE-hydro.
221: 
222: \section{BETHE-Hydro:  An Arbitrary Lagrangian-Eulerian Code}
223: \label{section:bethe_hydro}
224: In ALE algorithms, the equations of hydrodynamics are solved in
225: Lagrangian form.
226: Within this framework, equations for the conservation of mass,
227: momentum, and energy are: 
228: \begin{equation}
229: \label{eq:mass_lag}
230: \frac{d \rho}{d t} = - \rho \vec{\nabla} \cdot \vec{v} \, ,
231: \end{equation}
232: \begin{equation}
233: \label{eq:mom_lag}
234: \rho \frac{d \vec{v}}{d t} = - \rho \vec{\nabla} \Phi - \vec{\nabla} P
235: \, ,
236: \end{equation}
237: and
238: \begin{equation}
239: \label{eq:ene_lag}
240: \rho \frac{d \varepsilon}{d t} = - P \vec{\nabla} \cdot \vec{v} \, .
241: \end{equation}
242: $\rho$ is the mass density (which we refer to simply as
243: ``density'' and is distinct from the energy or
244: momentum densities), $\vec{v}$ is the fluid velocity, $\Phi$ is the gravitational
245: potential, $P$ is the isotropic pressure, $\varepsilon$ is the specific
246: internal energy, and $d/dt = \partial / \partial t + \vec{v} \cdot
247: \vec{\nabla}$ is the Lagrangian time derivative.  The equation of
248: state may have the following general form:
249: \begin{equation}
250: \label{eq:eos}
251: P = P(\rho,\varepsilon,X_i) \, ,
252: \end{equation}
253: where $X_i$ denotes the mass fraction of species $i$.
254: Therefore, we also solve the conservation equations:
255: \begin{equation}
256: \label{eq:advec}
257: \frac{d X_i}{dt} = 0 \, .
258: \end{equation}
259: Completing the set of equations for self-gravitating astrophysical flows 
260: is Poisson's equation for gravity:
261: \begin{equation}
262: \label{eq:poisson}
263: \nabla^2 \Phi = 4 \pi G \rho \, ,
264: \end{equation}
265: where $G$ is Newton's gravitational constant.
266: 
267: All ALE methods have the potential to solve eqs. (\ref{eq:mass_lag}-\ref{eq:ene_lag})
268: using arbitrary, unstructured grids.  In this lies the power and functionality of ALE methods.
269: The solutions involve two steps and are conceptually quite simple: 1) a Lagrangian solver moves the nodes of the mesh in
270: response to the hydrodynamic forces; and 2) to avoid grid tangling,
271: the nodes are repositioned, and a remapping algorithm interpolates hydrodynamic quantities from the old grid to this new grid.
272: Of course, the challenge is to find accurate solutions, while conserving
273: energy and momentum.  In constructing BETHE-hydro to satisfy these
274: requirements, we use the ALE hydrodynamic
275: techniques of \citet{caramana98c}, \citet{caramana98a},
276: \citet{campbell01}, and \citet{loubere05}.
277: 
278: To summarize the overall structure of BETHE-hydro, we present a
279: schematic flowchart, Fig. \ref{flowchart}, and briefly describe the
280: key steps.
281: Establishing the structure for
282: all subsequent routines, the first step is to construct
283: the arbitrary, unstructured grid.  This leads to the next step, problem
284: initialization.  Then, the main loop for timestep integration is
285: entered.  After a call to the EOS to obtain the pressure, solutions to Poisson's
286: equation for gravity are calculated using either the 2D or 1D
287: algorithms in \S \ref{section:gravity}.  Both use the
288: support-operator method to discretize eq. (\ref{eq:poisson}), and the
289: resulting system of linear equations is solved by a tridiagonal
290: solver in 1D and a multigrid pre-conditioned conjugate-gradient
291: iterative method in 2D (\S \ref{section:gravity}).
292: 
293: After the timestep is calculated (\S
294:   \ref{section:predictor_corrector}),
295: the Lagrangian equations of hydrodynamics are solved on
296: an arbitrary grid using the compatible hydrodynamics algorithm of
297: \citet{caramana98c} (see \S \ref{section:lag_hydro} for further discussion).  To ensure 2nd-order accuracy in both space and time, we employ a
298: predictor-corrector iteration (\S \ref{section:predictor_corrector}), in which a second call to the EOS and
299: the gravity solver are required.
300: Other than the gravity solver block, the
301: Lagrangian hydrodynamics solver (\S
302: \ref{section:lag_hydro}) is represented by the set of steps
303: beginning with Predictor and ending with Corrector
304: (Fig. \ref{flowchart}).
305: 
306: After finding Lagrangian hydrodynamic solutions at each timestep, one
307: could proceed directly to the next timestep, maintaining the
308: Lagrangian character throughout the simulation.  However, in multiple spatial dimensions,
309: grid tangling will corrupt flows with significant
310: vorticity. In these circumstances, we conservatively remap the Lagrangian
311: solution to a new arbitrary grid that mitigates tangled grids.  The
312: new grid may be the original grid, in which case we are solving the
313: hydrodynamic equations in the Eulerian frame, or it may be a new,
314: arbitrarily-defined, grid.
315: 
316: 
317: \section{Coordinate Systems and Mesh}
318: \label{section:coords_mesh}
319: 
320: In BETHE-hydro, eqs. (\ref{eq:mass_lag}-\ref{eq:poisson}) may be
321: solved with any of several
322: coordinate systems and assumed symmetries.  Included are the standard
323: 1D \& 2D Cartesian coordinate systems.  For astrophysical applications, we use 1D
324: spherical and 2D cylindrical coordinate systems.  Irrespective of the
325: coordinate system, we indicate a position by $\vec{x}$.  The components
326: of the Cartesian coordinate system are $x$ and $y$; the spherical
327: components are $r$, $\theta$, and $\phi$; and the cylindrical
328: coordinates are $r$, $z$, and $\phi$.
329: 
330: Distinct from the coordinate system is the grid, or mesh, which
331: defines an arbitrary discretization of space.  It is this unique
332: feature and foundation of ALE techniques that provides their flexibility.
333: Figure \ref{grid_ex} shows two example grids: the butterfly mesh on the
334: left and a spiderweb mesh on the right.  Either may be used in a 2D
335: Cartesian or 2D cylindrical simulations, although the placement of the
336: nodes is neither Cartesian nor cylindrical.  Instead, these meshes have
337: been designed to simulate spherically or cylindrically convergent
338: phenomena without the limitation of small zones near the center.
339: 
340: When using cylindrical coordinates in ALE algorithms, one may use control-volume
341: differencing (CVD) or area-weighted differencing (AWD); we use CVD.
342: Thorough comparisons of these two differencing schemes may be found in
343: \citet{caramana98c}.  Here, we give a basic justification for
344: choosing CVD.  For CVD, the volumes of the subcell, cell, and
345: node are calculated by straightforward partitioning of these regions by
346: edges.  Hence, volumes and masses are exact representations of their
347: respective regions.  While this discretization is natural and easy to
348: comprehend, it does not preserve strict spherical symmetry when using
349: a spherical grid and cylindrical coordinates.  On the other hand, AWD is designed
350: to preserve spherically symmetric flows, but only with the use of
351: spherical grids that have equal spacing in angle.  Since this
352: prevents the use of arbitrary grids, and the asymmetries of CVD are
353: small, we use CVD for discretization.
354:  
355: Construction of the grid begins with the arbitrary placement of nodes.  At
356: these nodes, coordinate positions, velocities, and accelerations are defined.
357: Simply specifying node locations does not completely define a mesh,
358: since there is not a unique way to assign cells and masses to these
359: nodes.  Therefore, the
360: user must specify the connectivity among nodes, which define the arbitrarily-shaped polygonal cells.  It is within these cells that
361: cell-centered averages of $\rho$,
362: $\varepsilon$, $P$, $X_i$, and $\Phi$ are defined.
363: 
364: With the node
365: positions, their connectivity, and the cells defined, a mesh is completely specified and all other useful
366: descriptions follow.  Cells are denoted by $z$, and nodes are indexed
367: by $p$.  The
368: set of nodes that defines cell $z$ are $p \in S(z)$, where
369: the nodes are ordered counterclockwise.
370: Conversely, the set of cells that shares node $p$ is denoted by $z \in S(p)$.
371: Each cell has $N_p(z)$ nodes that define it, and each node has
372: $N_z(p)$ cells that share it.  The sample sub-grid depicted in
373: Fig. \ref{fig:grid} helps to illustrate the nodal and cell structure. The filled circles
374: indicate node positions, $\vec{x}_p$, and the crosses indicate the
375: cell-center positions,
376: $\vec{x}_z = (1/N_p(z))\sum_{p \in S(z)} \vec{x}_p$.  The solid lines
377: are direction-oriented edges that separate cells from one
378: another, and the open circles indicate their mid-edge locations.
379: Partitioning the cell into subcells, the
380: dashed lines connect the mid-edges with the cell centers.  No matter how many sides a cell
381: has, with this particular division the subcells are always
382: quadrilaterals.  Naturally, the cell volumes (see appendix
383: \ref{section:integrals} for formulae calculating discrete volumes), $V_z$, are related to the
384: subcell volumes, $V^z_p$, by
385: \begin{equation}
386: \label{eq:volume_cell}
387: V_z = \sum_{p \in S(z)} V^z_p \, .
388: \end{equation}
389: Furthermore, each node has a volume, $V_p$, defined by the adjoining subcells
390: that share the node $p$:
391: \begin{equation}
392: \label{eq:volume_node}
393: V_p = \sum_{z \in S(p)} V^p_z \, .
394: \end{equation}
395: For calculating pressure forces and fluxes, 
396: vectors are assigned to each
397: half edge on either side of node $p$: $\vec{C}^z_{p+}$ and
398: $\vec{C}^z_{p-}$, where $+$ indicates the half edge in the
399: counterclockwise direction around the cell and $-$ indicates its opposite
400: counterpart.  Their magnitudes are the areas represented by the half edges, and their directions point
401: outward and normal to the surface of cell $z$.  From these half-edge
402: area vectors, an area vector, $\vec{S}^z_p$, that is
403: associated with zone $z$ and node $p$ is then defined:
404: \begin{equation}
405: \vec{S}^z_p = \vec{C}^z_{p+} + \vec{C}^z_{p-} \, .
406: \end{equation}
407: Similarly, vectors are associated with the lines connecting the
408: mid-edges and the cell centers: $\vec{a}^z_p$.  Again, their
409: magnitudes are the corresponding area, but while the vector is
410: normal to this line, the direction is oriented
411: counterclockwise around the cell.
412: 
413: \section{Discrete Lagrangian Hydrodynamics}
414: \label{section:lag_hydro}
415: The fundamental assumption of Lagrangian algorithms is that the mass,
416: $m_z$, of a discrete volume $V_z$ is constant
417: with time.  For staggered-grid methods, in which scalars are defined
418: as cell-centered averages and vectors are defined at the nodes, it is
419: necessary to define a
420: Lagrangian mass, $m_p$, for the nodes as well.  This nodal
421: mass is associated with the node's volume $V_p$ 
422: (eq. \ref{eq:volume_node}).  Conservation of mass (eq. \ref{eq:mass_lag}) implies zero mass flux across the boundaries,
423: $\partial V$, of either the cell volume or nodal volume.  Therefore, the region of overlap for
424: $V_z$ and $V_p$, which is the subcell volume $V^z_p$, is bounded by
425: surfaces with zero mass flux.  Consequently, the most elemental
426: Lagrangian mass is the subcell mass, $m^z_p$, and the cell mass ($m_z$) and node mass ($m_p$) are constructed as appropriate sums
427: of subcell masses:
428: \begin{equation}
429: \label{eq:mass_cell}
430: m_z = \sum_{p \in S(z)} m^z_p \, ,
431: \end{equation}
432: and
433: \begin{equation}
434: \label{eq:mass_node}
435: m_p = \sum_{z \in S(p)} m^p_z \, .
436: \end{equation}
437: Hence, we arrive at three discrete forms of mass conservation (eq. \ref{eq:mass_lag}):
438: \begin{equation}
439: \label{eq:mass_discrete}
440: \begin{array}{cccc}
441: \rho^z_p = \frac{m^z_p} {V^z_p} \, , &
442: \rho_p = \frac{m_p} {V_p} \, ,&
443: \mbox{and} &
444: \rho_z = \frac{m_z} {V_z} \, .
445: \end{array}
446: \end{equation}
447: 
448: In defining the discrete momentum and energy equations, we use the
449: compatible hydrodynamics algorithms developed by
450: \citet{caramana98c}. Specifically, the discrete divergence and
451: gradient operators are {\it compatible} in that
452: they faithfully represent their analog in continuous space
453: {\it and} their definitions are expressly related to one another using
454: the hydrodynamic expressions for conservation of momentum and
455: energy.  As a result, this approach leads to discretizations that satisfy momentum and energy conservation to machine
456: accuracy.  This is accomplished with the support-operator method
457: \citep{shashkov95}.  Given
458: the integral identity,
459: \begin{equation}
460: \label{eq:intidentity}
461: \int_V \Phi (\vec{\nabla} \cdot \vec{H}) dV 
462: + \int_V \vec{H} \cdot \vec{\nabla} \Phi dV 
463: = \oint_{\partial V} \Phi \vec{H} \cdot d\vec{S} \, ,
464: \end{equation}
465: where $\Phi$ is any scalar and $\vec{H}$ is some vector,
466: there is an incontrovertible connection between the divergence and
467: gradient operators.  For many choices of discretization, the discrete
468: counterparts of these operators could violate this integral identity.
469: Simply put, the goal of the support-operator method is to define the discrete operators so
470: that they satisfy eq. (\ref{eq:intidentity}).  The first step is to
471: define one of the discrete operators.  It is often, but
472: not necessary, that the discrete
473: divergence operator is defined via Gauss's Law:
474: \begin{equation}
475: \label{eq:gausslaw}
476: \int_V \vec{\nabla} \cdot \vec{v} dV = \oint_{\partial V} \vec{v}
477: \cdot d\vec{S} \, ,
478: \end{equation}
479: and then eq. (\ref{eq:intidentity}) is used to compatibly define the other
480: discrete operator.  Discretizing the hydrodynamic
481: equations, 
482: \citet{caramana98c} begin by defining
483: $(\vec{\nabla}P)_p$ at the nodes and use the integral form of energy
484: conservation and an equation equivalent to eq. (\ref{eq:intidentity})
485: to define for each cell the discrete divergence of the velocity, $(\vec{\nabla} \cdot \vec{v})_z$.
486: 
487: To begin, \citet{caramana98c} integrate eq. (\ref{eq:mom_lag}) (excluding gravity and rotational
488: terms) over the volume of node $p$, producing the discrete form for
489: $(\vec{\nabla P})_p$ and the momentum equation:
490: \begin{eqnarray}
491: \label{eq:mom_discrete1}
492: m_p \frac{\Delta \vec{v}_p}{\Delta t} & = & - \int_{V_p}\vec{\nabla} P \,
493: dV \nonumber \\
494: & = & - \oint_{\partial V_p} P \, d\vec{S} \nonumber \\ 
495: & = & - \sum_{z \in S(p)} P_z \vec{S^p_z} \, ,
496: \end{eqnarray}
497: %\begin{equation}
498: %\label{eq:mom_discrete1}
499: %m_p \frac{\Delta \vec{v}_p}{\Delta t} = - \int_{V_p}\vec{\nabla} P \,
500: %dV = - \oint_{\partial V_p} P \, d\vec{S} = - \sum_{z \in S(p)} P_z
501: %\vec{S^p_z} \, ,
502: %\end{equation}
503: where $\Delta \vec{v}_p = \vec{v}_p^{n+1} - \vec{v}^n_p$ is the change
504: in velocity from timestep $n$ to the next timestep $n+1$, the
505: timestep is $\Delta t$, and $P_z$ is the pressure in cell $z$.  In other words, the net force
506: on node $p$ is a sum of the pressure times the
507: directed zone areas that share node $p$.  Hence, the subcell force
508: exerted by zone $z$ on point $p$ is $\vec{f}^p_z = P_z \vec{S}^p_z$.  A more complete description of the
509: subcell force, however, must account for artificial
510: viscosity (\S \ref{section:artificial_viscosity}):
511: \begin{equation}
512: \vec{f}^p_z = P_z \vec{S}^p_z + \vec{f}^p_{z,\rm{visc}} \, ,
513: \end{equation}
514: where $\vec{f}^p_{z,\rm{visc}},$ is the subcell force due to
515: artificial viscosity.  Furthermore, in this work, we include gravity
516: and rotation for 2D axisymmetric simulations, and the full discrete
517: momentum equation becomes
518: \begin{equation}
519: \label{eq:mom_discrete2}
520: m_p \frac{\Delta \vec{v}_p}{\Delta t} =
521: \sum_{z \in S(p)} \vec{f}^p_z + m_p \vec{g}_p + m_p\vec{A}_p \, ,
522: \end{equation}
523: where $\vec{g}_p$ and $\vec{A}_p$ are the gravitational and rotational
524: accelerations, respectively.  For simplicity, and to parallel the discussion in
525: \citet{caramana98c}, we ignore these terms in the momentum equation
526: and proceed with the compatible construction of the energy equation
527: (see \S \ref{section:consenerot} and \S \ref{section:consenegravity}
528: for discussions of total energy conservation including rotation and
529: gravity, respectively).
530: 
531: To construct the discrete energy equation, \citet{caramana98c} integrate
532: eq. (\ref{eq:ene_lag}) over the discrete volume of cell $z$:
533: \begin{equation}
534: m_z \frac{\Delta \varepsilon_z}{\Delta t} = - \int_{V_z} P \vec{\nabla} \cdot
535: \vec{v} \, dV = - P_z ( \vec{\nabla} \cdot
536: \vec{v} )_z V_z \, ,
537: \end{equation}
538: where $\Delta \varepsilon_z = \varepsilon_z^{n+1} - \varepsilon_z^n$.
539: Then, the objective is to determine a discrete form for the right hand
540: side of this equation that conserves energy and makes the discrete
541: gradient and divergence operators compatible.
542: \citet{caramana98c} accomplish this with the integral for conservation
543: of energy (neglecting gravity):
544: \begin{eqnarray}
545: \int \left ( \rho \frac{d \varepsilon}{dt} + \frac{1}{2} \rho \frac{d
546:     v^2}{dt}\right ) dV 
547: & = & -\int_V (P \vec{\nabla} \cdot \vec{v} + \vec{v} \cdot \vec{\nabla} P
548: ) dV \nonumber \\
549: & = & -\oint_{\partial V} P\vec{v} \cdot d\vec{S}
550: \, ,
551: \end{eqnarray}
552: %\begin{equation}
553: %\int \left ( \rho \frac{d \varepsilon}{dt} + \frac{1}{2} \rho \frac{d
554: %    v^2}{dt}\right ) dV 
555: %= -\int_V (P \vec{\nabla} \cdot \vec{v} + \vec{v} \cdot \vec{\nabla} P
556: %) dV
557: %= -\oint_{\partial V} P\vec{v} \cdot d\vec{S}
558: %\, ,
559: %\end{equation}
560: where the second expression is the integral identity,
561: eq. (\ref{eq:intidentity}), that defines the physical relationship
562: between the gradient and divergence operators.
563: Neglecting boundary terms, the discrete form of this integral is
564: \begin{equation}
565: \label{eq:enecons_discrete}
566: \sum_z \left ( m_z \frac{\Delta \varepsilon_z}{\Delta t} + \sum_{p \in S(z)}
567: \vec{v}^{n+1/2}_p \cdot \vec{f}^p_z \right ) =
568: 0 \, ,
569: \end{equation}
570: where we used $\Delta \vec{v}^2_p = (\vec{v}^{n+1}_p)^2 -
571: (\vec{v}^n_p)^2 = 2 \vec{v}^{n+1/2}_p \cdot \Delta \vec{v}_p$, $\vec{v}^{n+1/2}_p = 1/2 ( \vec{v}^{n+1}_p + \vec{v}^n_p)$,
572:  and
573: substituted in eq. (\ref{eq:mom_discrete1}).  If we set the expression
574: for each zone in eq. (\ref{eq:enecons_discrete}) to zero, we
575: arrive at the compatible energy equation:
576: \begin{equation}
577: \label{eq:ene_discrete}
578: m_z \frac{\Delta \varepsilon_z}{\Delta t} = - \sum_{p \in S(z)}
579: \vec{v}^{n+1/2}_p \cdot \vec{f}^z_p \, .
580: \end{equation}
581: The RHS of
582: eq. (\ref{eq:ene_discrete}) is merely the $PdV$ work term of the first
583: law of thermodynamics.  Its unconventional form is a consequence of
584: the support-operator method.
585: 
586: Thus, we derive two significant results.  First, 
587: inspection of eqs. (\ref{eq:ene_discrete}) and
588: (\ref{eq:mom_discrete1}) leads to compatible definitions for the
589: discrete gradient and divergence operators. Specifically, the discrete
590: analogs of the gradient and divergence operators are
591: \begin{equation}
592: (\vec{\nabla} P)_p = \frac{1}{V_p} \sum_{z \in S(p)} P_z \vec{S}^p_z
593: \end{equation}
594: and 
595: \begin{equation}
596: (\vec{\nabla} \cdot \vec{v})_z = \frac{1}{V_z} \sum_{p \in S(z)}
597: \vec{v}_p \cdot \vec{S}^p_z \, .
598: \end{equation}
599: Second, eqs. (\ref{eq:mass_discrete}), (\ref{eq:mom_discrete1}), and
600: (\ref{eq:ene_discrete}) form the compatible discrete equations of
601: Lagrangian hydrodynamics.
602: 
603: \subsection{Momentum Conservation}
604: \label{section:momcons}
605: 
606: In its current form, BETHE-hydro strictly conserves momentum for
607: simulations that use Cartesian coordinates and not cylindrical
608: coordinates.  \citet{caramana98c} show that the requirement for strict
609: conservation is the use of control-volume differencing, or that exact
610: representations of cell surfaces are employed.  As a simple example,
611: consider momentum conservation with pressure forces only:
612: \begin{equation}
613: \sum_p \vec{F}_p = \sum_p \sum_{z \in S(p)} \vec{f}^p_z = \sum_z
614: P_z \sum_{p \in S(z)} \vec{S}^z_p \, .
615: \end{equation}
616: For Cartesian coordinates, the sum $\sum_{p \in S(z)} \vec{S}^z_p$ is exactly
617: zero for each cell as long as the surface-area vectors are exact
618: representations of the cell's surface.  This is not the case for
619: area-weighted differencing, and hence momentum is not conserved in
620: that case.  For cylindrical coordinates, the sum of surface-area
621: vectors gives zero only for the $z$-component.  However, the assumption
622: of symmetry about the cylindrical axis ensures momentum conservation
623: for the $r$-component.  Therefore, control-volume differencing ensures
624: momentum conservation, even with the use of cylindrical coordinates.
625: 
626: Based upon similar arguments, the subcell-pressure forces that
627: eliminate hourglass motions (\S \ref{section:hourglass}) are formulated to conserve momentum for
628: both Cartesian and cylindrical coordinates.  On the other hand, because
629: we multiply the Cartesian artificial viscosity force by $2 \pi r_p$ to
630: obtain the force appropriate for cylindrical coordinates, the
631: artificial viscosity scheme (\S \ref{section:artificial_viscosity})
632: that we employ is conservative for Cartesian coordinates only.
633: 
634: We test momentum conservation with the Sedov blast wave problem (\S
635: \ref{section:sedov}) using Cartesian and cylindrical coordinates.
636: Symmetry dictates conservation in the $r$-component of the momentum.
637: Consequently, we compare the $z$-component of the total momentum at
638: $t=0$ s with subsequent times.  Since the initial momentum of this
639: test is zero, we obtain a relative error in momentum by $P_z(t)/P_{z,z >
640: 0}(t)$, where $P_z(t)$ is the $z$-component of the total momentum at
641: time $t$ and $P_{z,z > 0}(t)$ is a similar quantity for $z > 0$.  As
642: expected, the relative error using Cartesian coordinates reflects
643: roundoff error.  For cylindrical coordinates and 35,000 cells, the
644: relative error in momentum is $\sim 3 \times 10^{-7}$ after 0.8 s and
645: 71,631 timesteps.  Although momentum is strictly conserved for
646: simulations using Cartesian coordinates only, the Sedov blast wave
647: problem demonstrates that momentum is conserved very accurately, even
648: when cylindrical coordinates are used.
649: 
650: \subsection{Second-Order Time Integration: Predictor-Corrector}
651: \label{section:predictor_corrector}
652: 
653: Our method is explicit in time.  Therefore, for numerical convergence, we limit the timestep, $\Delta t$, to be smaller than
654: three timescales.  By the Courant-Friedrichs-Levy (CFL) condition we
655: limit $\Delta t$ to be smaller than the shortest sound-crossing time
656: and the time it takes flow to traverse a cell.  The latter condition
657: is useful to avoid tangled meshes and is necessary when remapping is
658: used.  In addition, it is
659: limited to be smaller than the fractional change in the volume
660: represented by $(\vec{\nabla} \cdot \vec{v})_z$.  In calculating
661: these timescales a characteristic length for each cell is needed.
662: Given arbitrary polygonal grids, we simply use the shortest edge for
663: each cell.  In practice, the timestep is the shortest of these
664: timescales multiplied by a scaling factor, CFL.  In our
665: calculations, we set ${\rm CFL}= 0.25$.
666: 
667: To ensure second-order accuracy and consistency with the time
668: levels specified in eqs. (\ref{eq:mom_discrete2}) and
669: (\ref{eq:ene_discrete}), we employ predictor-corrector
670: time integration using the finite difference stencil from \citet{caramana98c}.
671: For each timestep, the
672: current time level of each quantity is identified with $n$ in
673: superscript.  The time-centered quantities are indicated with a
674: $n+1/2$ superscript, while the predicted values are labeled
675: $n+1,pr$, and the fully updated values for the next timestep are
676: labeled with a $n+1$ superscript.
677: 
678: Table \ref{table:predictor-corrector} lists the steps for the
679: predictor-corrector integration. 
680: The predictor step begins by defining the forces on nodes, $\vec{f}^n$,
681: using current pressures $P^n$, areas $\vec{S}^n$, and artificial
682: viscosity forces $\vec{f}^n_{\rm{visc}}$.
683: Eq. (\ref{eq:mom_discrete2}) is then used to calculate the predicted
684: velocity, $\vec{v}^{n+1,pr}$.  The predicted node coordinate is then
685: calculated by $\vec{x}^{n+1,pr} = \vec{x}^n + \Delta t
686: \vec{v}^{n+1/2}$, where $\vec{v}^{n+1/2}$ is the time-centered
687: velocity computed as $\vec{v}^{n+1/2} = \frac{1}{2}(\vec{v}^{n+1,pr} +
688: \vec{v}^n)$. Then, using $\vec{f}^n$ and $\vec{v}^{n+1/2}$ in
689: eq. (\ref{eq:ene_discrete}), the predicted specific internal energy,
690: $\varepsilon^{n+1,pr}$, is obtained.  Using the predicted node positions,
691: the predicted rotational acceleration ($\vec{A}^{n+1,pr}_p$), volume ($V^{n+1,pr}$), and density ($\rho^{n+1,pr}$), are
692: computed, which in turn are used to calculate the predicted gravitational
693: acceleration, $\vec{g}^{n+1,pr}$.  Calling the EOS with $\varepsilon^{n+1,pr}$ and
694: $\rho^{n+1,pr}$ gives the predicted pressure $P^{n+1,pr}$.  We finish
695: the predictor step and prepare for the corrector step by calculating the time-centered positions
696: $\vec{x}^{n+1/2}$, pressures $P^{n+1/2}$, rotational accelerations $\vec{A}^{n+1/2}_p$, and gravitational
697: accelerations $\vec{g}^{n+1/2}$ as simple
698: averages of their values at the $(n+1,pr)$ and $n$ time levels.  
699: 
700: The corrector step then proceeds similarly to the predictor step.  $P^{n+1/2}$ and
701: $\vec{S}^{n+1/2}$ are used to compute $\vec{f}^{n+1/2}$, which in
702: turn is used to compute the updated velocity, $\vec{v}^{n+1}$.  After
703: computing the new time-centered velocity, the node coordinates are
704: finally updated using the time-centered velocity.  Then, the specific internal energy, $\varepsilon^{n+1/2}$, is updated using
705: $\vec{f}^{n+1/2}$ and $\vec{v}^{n+1/2}$.  Finally, the volume,
706: $V^{n+1}$, and
707: density $\rho^{n+1}$ are computed for the next timestep. 
708: 
709: 
710: \subsection{Rotation in 2D cylindrical coordinates}
711: \label{section:rotation}
712: 
713: In 2D simulations using cylindrical coordinates, we have extended
714: BETHE-hydro to include rotation about the axis of symmetry.
715: For azimuthally symmetric configurations, all partial derivatives
716: involving $\phi$ are zero.  Consequently, the conservation of mass and
717: energy equations are
718: \begin{equation}
719: \label{eq:mass_lag_rot}
720: \frac{D \rho}{Dt} = - \rho \vec{\nabla}_{rz} \cdot \vec{v}
721: \end{equation}
722: and
723: \begin{equation}
724: \label{eq:ene_lag_rot}
725: \rho \frac{D \varepsilon}{Dt} = -P \vec{\nabla}_{rz} \cdot \vec{v} \, ,
726: \end{equation}
727: where the $rz$ subscript on the del operator reminds us that the
728: derivatives with respect to $\phi$ vanish.  For
729: concise notation, we define a pseudo Lagrangian derivative:
730: \begin{equation}
731: \frac{D}{Dt} = \frac{\partial}{\partial t} + v_z
732: \frac{\partial}{\partial z} + v_r\frac{\partial}{\partial r} \, .
733: \end{equation}
734: While eqs. (\ref{eq:mass_lag_rot}) and (\ref{eq:ene_lag_rot}) are
735: simple extensions of the true mass (eq. \ref{eq:mass_lag}) and
736: energy (eq. \ref{eq:ene_lag}) equations, the presence of ``Christoffel''
737: terms in the momentum equation give it extra terms:
738: \begin{equation}
739: \label{eq:mom_lag_rot}
740: \rho \frac{D \vec{v}}{Dt} = - \vec{\nabla}_{rz} P + \rho \vec{A} \, .
741: \end{equation}
742: where the extra rotational terms are represented by $\vec{A}$:
743: \begin{equation}
744: \vec{A} = 
745: \left\{
746: \begin{array}{l}
747: 0 \, \hat{e}_z\\
748: \frac{v^2_{\phi}}{r} \, \hat{e}_r\\
749: - \frac{v_{\phi}v_r}{r} \, \hat{e}_{\phi}\\
750: \end{array}
751: \right.
752: \end{equation}
753: 
754: To see the origin of these extra terms, one must begin with the
755: momentum equation in cylindrical coordinates and Eulerian form:
756: \begin{equation}
757: \label{eq:mom_cyl}
758: \begin{array}{rcl}
759: \rho \left (
760: \frac{\partial v_z}{\partial t} + v_z \frac{\partial v_z}{\partial z}
761: +  v_r \frac{\partial v_z}{\partial r} + v_{\phi}\frac{1}{r}
762: \frac{\partial v_z}{\partial \phi}
763: \right) &
764: = &
765: - \frac{\partial P}{\partial z} \\
766: 
767: \rho \left (
768: \frac{\partial v_r}{\partial t} + v_z \frac{\partial v_r}{\partial z}
769: +  v_r \frac{\partial v_r}{\partial r} + v_{\phi}\frac{1}{r}
770: \frac{\partial v_r}{\partial \phi} - \frac{v^2_{\phi}}{r}
771: \right) &
772: = &
773: - \frac{\partial P}{\partial r} \\
774: 
775: \rho \left (
776: \frac{\partial v_{\phi}}{\partial t} + v_z \frac{\partial v_{\phi}}{\partial z}
777: +  v_r \frac{\partial v_{\phi}}{\partial r} + v_{\phi}\frac{1}{r}
778: \frac{\partial v_{\phi}}{\partial \phi} + \frac{v_{\phi}v_r}{r}
779: \right) &
780: = &
781: - \frac{1}{r}\frac{\partial P}{\partial \phi} \, . \\
782: \end{array}
783: \end{equation}
784: Again, dropping terms involving partial derivatives of $\phi$, and
785: moving all terms not involving partial derivatives to the right-hand
786: side (RHS), eq. (\ref{eq:mom_cyl}) reduces to 
787: \begin{equation}
788: \label{eq:mom_azsymmetric}
789: \begin{array}{rcl}
790: \rho \left (
791: \frac{\partial v_z}{\partial t} + v_z \frac{\partial v_z}{\partial z}
792: +  v_r \frac{\partial v_z}{\partial r}
793: \right) &
794: = &
795: - \frac{\partial P}{\partial z} \\
796: 
797: \rho \left (
798: \frac{\partial v_r}{\partial t} + v_z \frac{\partial v_r}{\partial z}
799: +  v_r \frac{\partial v_r}{\partial r}
800: \right) &
801: = &
802: - \frac{\partial P}{\partial r}  + \rho \frac{v^2_{\phi}}{r}\\
803: 
804: \rho \left (
805: \frac{\partial v_{\phi}}{\partial t} + v_z \frac{\partial v_{\phi}}{\partial z}
806: +  v_r \frac{\partial v_{\phi}}{\partial r}
807: \right) &
808: = &
809: - \rho \frac{v_{\phi}v_r}{r} \, .\\
810: \end{array}
811: \end{equation}
812: Hence, using our definition for the pseudo Lagrangian derivative,
813: $D/Dt$, and $\vec{\nabla}_{rz}$ in eq. (\ref{eq:mom_azsymmetric}) we
814: obtain eq. (\ref{eq:mom_lag_rot}).  It is now apparent why $D/Dt$ is a
815: pseudo Lagrangian derivative.  Strictly, the ``extra'' rotational
816: terms are a result of ``Christoffel'' terms in the true Lagrangian
817: derivative.  Therefore, in defining $D/Dt$ without them, we've defined
818: a pseudo Lagrangian derivative.
819: 
820: Conveniently, the $\phi$ component of eq. (\ref{eq:mom_lag_rot}),
821: \begin{equation}
822: \rho \frac{D v_{\phi}}{D t}= 
823: - \rho \frac{v_{\phi}v_r}{r} \, ,
824: \end{equation}
825: is simply a statement of the conservation of angular momentum about the
826: axis of symmetry:
827: \begin{equation}
828: \label{eq:cons_ang}
829: \frac{D J}{D t} = 0 \, ,
830: \end{equation}
831: where $J$ is the angular momentum about the $z$-axis of a Lagrangian
832: mass.
833: 
834: Other than the appearance of an extra term on the RHS of the $r$-component
835: and of an equation for the $\phi$ component in
836: eq. (\ref{eq:mom_lag_rot}), the 2D hydrodynamic equations including
837: rotation about the $z$-axis are similar to the equations without
838: rotation.  Therefore, the algorithms for dynamics in the 2D plane
839: remain the same, except for the inclusion of the conservation of angular
840: momentum equation and the fictitious force term.
841: 
842: It seems natural to define $J = m_p v_{\phi,p} r_p$ and $v_{\phi,p} =
843: \omega_p r_p$, where $\omega_p$ is the angular velocity of node $p$.
844: In fact, our first implementation of rotation did just this.  However,
845: results indicated that this definition presents problems near the axis of rotation.  Whether
846: $v_{\phi,p}$ or $\omega_p$ is defined, the angular momentum at node
847: $p$ is associated with the region of subcells that comprise the node's
848: volume.
849: For the nodes on the axis, this definition states that $J = 0$
850: since $r_p =
851: 0$, which implies that the angular momentum for the region of subcells
852: near the axis is zero.  This awkward feature
853: causes no problems
854: for Lagrangian calculations with no remapping.  However, during the subcell remapping step, the
855: subcells near the axis contain no angular momentum, yet physically
856: there should be some angular momentum to be remapped. 
857: 
858: Therefore, we have devised an alternative method for including rotational terms in 2D
859: simulations.
860: Just as for mass, the angular momentum of a subcell, $J^z_p$, is a primary
861: indivisible unit, which by eq. (\ref{eq:cons_ang}) is constant during
862: a Lagrangian hydrodynamic timestep.  The angular momentum for a cell is
863: \begin{equation}
864: J_z = \sum_{p \in S(z)} J^z_p \, ,
865: \end{equation}
866: and for each node is
867: \begin{equation}
868: \label{eq:define_jp}
869: J_p = \sum_{z \in S(p)} J^z_p \, .
870: \end{equation}
871: To relate angular velocity and $v_{\phi}$ to the angular momentum, we
872: treat each subcell as a unit with constant angular velocity.
873: For such regions of space the angular momentum is related to the
874: angular velocity by
875: \begin{equation}
876: J^z_p = \omega^z_p \int_{V^z_p} \rho^z_p r^2 dV = \omega^z_p I^z_p \, ,
877: \end{equation}
878: where $I^z_p = \int_{V^z_p} \rho^z_p r^2 dV$ is the moment of inertia
879: for subcell $\{z,p\}$.  
880: Since we are interested in accelerations and velocities at the nodes,
881: we choose that $\omega^z_p = \omega_p$, which naturally leads to
882: \begin{equation}
883: \label{eq:define_jzp}
884: J^z_p = \omega_p I^z_p \, .
885: \end{equation}
886: Substituting eq. (\ref{eq:define_jzp}) into eq. (\ref{eq:define_jp}),
887: we define a relationship between the angular momentum at the nodes and
888: the angular velocity at the nodes:
889: \begin{equation}
890: J_p = \omega_p \mathcal{I}_p \, ,
891: \end{equation}
892: where
893: \begin{equation}
894: \mathcal{I}_p = \sum_{z \in S(p)} I^z_p \, .
895: \end{equation}
896: By conservation of angular momentum, $J^{n+1}_p = J^n_p = J_p =
897: \omega^{n+1}\mathcal{I}^{n+1}_p$, the angular velocity at the $n+1$
898: timestep , $\omega^{n+1}$, is
899: \begin{equation}
900: \omega^{n+1} = \frac{J_p}{\mathcal{I}^{n+1}_p} \, .
901: \end{equation}
902: 
903: Finally, a new form for the $r$-component of $\vec{A}_p$ is
904: constructed.  The previously defined form is $v_{\phi}^2/r$, and
905: having $r$ in the denominator poses numerical problems near and at
906: $r=0$.  Since $v_{\phi}^2/r = \omega^2r$, the new half timestep
907: acceleration is
908: \begin{equation}
909: \label{eq:arot}
910: \vec{A}_{r,p} = \left ( \omega^2_p r_p \right )^{n+1/2} \, .
911: \end{equation}
912: 
913: 
914: \subsubsection{Conservation of Energy with Rotation}
915: \label{section:consenerot}
916: 
917: Without rotation and time-varying gravity, the equations for 2D
918: simulations using cylindrical coordinates conserve energy to machine
919: precision.  However, with rotation, strict energy
920: conservation is lost.  Using the equations for energy and momentum
921: including rotation, eqs. (\ref{eq:ene_lag_rot}) and
922: (\ref{eq:mom_lag_rot}) the energy integral becomes
923: \begin{multline}
924: \int_v \left ( \rho \frac{D \varepsilon}{Dt} + \frac{1}{2} \rho
925:   \frac{D v^2}{Dt}\right ) dV
926: = \int_v \left ( - P \vec{\nabla}_{rz} \cdot \vec{v} \right . \\
927: \left . - \vec{v} \cdot
928:   \vec{\nabla}_{rz} P  
929: + \rho (v_{r}A_r + v_{\phi}A_{\phi}) \right ) dV \, .
930: \end{multline}
931: %\begin{equation}
932: %\int_v \left ( \rho \frac{D \varepsilon}{Dt} + \frac{1}{2} \rho
933: %  \frac{D v^2}{Dt}\right ) dV
934: %= \int_v \left (  -P \vec{\nabla}_{rz} \cdot \vec{v} - \vec{v} \cdot
935: %  \vec{\nabla}_{rz} P  
936: %+ \rho (v_{r}A_r + v_{\phi}A_{\phi}) \right ) dV \, .
937: %\end{equation}
938: Since the terms $v_rA_r$ and $v_{\phi}A_{\phi}$ are equal in magnitude
939: and opposite in sign, the rate of change for the total energy reduces
940: to the usual surface integral:
941: \begin{equation}
942: \frac{\partial E}{\partial t}= \oint P\vec{v} \cdot d \vec{S} \, .
943: \end{equation}
944: If the form of the energy equation is to remain the same, discrete
945: versions of $v_rA_r$ and $v_{\phi}A_{\phi}$ must be derived that
946: cancel one another.
947: 
948: In the previous section, we made
949: arguments not to use $J = m_p v_{\phi} r$.  However, it
950: is simpler and more intuitive to illustrate why the 2D equations, including rotation, can
951: not satisfy strict energy conservation, while satisfying angular
952: momentum conservation.  With conservation of angular
953: momentum we have $v^{n+1}_{\phi}r^{n+1} = v^n_{\phi}r^n$ or
954: \begin{equation}
955: v^{n+1}_{\phi} = v^n_{\phi} \left ( \frac{r^{n}}{r^{n+1}} \right ) \, .
956: \end{equation}
957: The discrete time derivative of $v_{\phi}$ is then
958: \begin{equation}
959: \label{eq:aphi_timelevels}
960: \frac{\Delta v_{\phi}}{\Delta t} = - \frac{v^n_{\phi}
961:   v^{n+1/2}_r}{r^{n+1}} \, ,
962: \end{equation}
963: where we have used $\Delta r = v^{n+1/2}_r \Delta t$.  This specifics
964: the required time levels for the components of $A_{\phi}$ to conserve
965: angular momentum.  Considering time integration, the discrete
966: analog of $v_rA_r + v_{\phi}A_{\phi}$ is $v^{n+1/2}_rA_r +
967: v^{n+1/2}_{\phi}A_{\phi}$.  To ensure that this sums to zero, the discrete analog of $A_r$ is
968: \begin{equation}
969: A_{r} = \frac{v^{n+1/2}_{\phi} v^n_{\phi}}{r^{n+1}} \, .
970: \end{equation}
971: With these time levels, the 2D equations, which include rotation,
972: would satisfy energy and angular momentum conservation to round-off error.  However,
973: $r^{n+1}$ and $v^{n+1/2}_{\phi}$ are not known at the beginning of the
974: timestep.  It is only
975: after the predictor step of the predictor-corrector method that
976: $v^{n+1/2}_{\phi}$ and $r^{n+1,pr}$ are obtained. As a result, $A_r$,
977: including the correct time levels and predictor values, is
978: \begin{equation}
979: A_{r} = \frac{v^{n+1/2}_{\phi} v^n_{\phi}}{r^{n+1,pr}} \, ,
980: \end{equation}
981: but to conserve angular momentum and energy, $r^{n+1}$ appears in the denominator.
982: Therefore, the terms $v^{n+1/2}_{\phi}A_{\phi}$ and $v^{n+1/2}_rA_{r}$
983: will not be exactly opposite and equal in magnitude, and angular
984: momentum and energy conservation can not be enforced to machine
985: precision at the same time.  
986: 
987: In the previous section, we motivated a different discretization of
988: angular momentum, angular velocity, and $v_{\phi}$.  However, the
989: basic results of this section do not change.  There is still the fundamental
990: problem that to strictly conserve angular momentum, positions at the
991: $n+1$ time level are required, while one must use the
992: predicted, $n+1,pr$, values in updating the radial velocity.
993: Sacrificing strict energy conservation, we have chosen to strictly
994: conserve angular momentum for simulations including rotation.
995: 
996: 
997: \subsubsection{Simple Rotational Test}
998: \label{section:rot_test}
999: 
1000: We have designed a test that isolates and tests rotation.
1001: Using cylindrical coordinates, the calculational domain lies in the
1002: $r-z$ plane and extends
1003: from the symmetry axis, $r = 0$, to $r = 1.0$ cm and from $z=-0.1$ cm to
1004: $z=0.1$ cm .  The initial density is homogeneous with $\rho = 1.0$ g cm$^{-3}$.
1005: Isolating the rotational forces, we eliminate pressure gradients by setting the
1006: internal energy everywhere to zero.  Consequently,
1007: the trajectory of a Lagrangian mass is a straight line in 3D and has a
1008: very simple analytic evolution for $r(t)$, determined only by its initial
1009: position and velocity.  We set $v_z = 0$ and give $v_{\phi}$ and $v_r$
1010: homologous profiles: $v_r = -3 r / r_0$ cm s$^{-1}$ and $v_{\phi} = r
1011: /r_0$ cm s$^{-1}$.  
1012: This produces a homologous self-similar solution for $v_r$ and
1013: $v_{\phi}$ that our algorithm for rotation should reproduce.
1014: 
1015: In Figure \ref{rottestplot}, plots of $v_{\phi}$ vs. $r$ (top
1016: panel) and $\Omega$ vs. $r$ panel (bottom) show that BETHE-hydro
1017: performs well with this test.  Simultaneously testing the rotational remapping (\S
1018: \ref{section:ang_vel_remap}) and hydrodynamic algorithms, we employ three remapping regions.  The inner 0.1 cm is
1019: Eulerian, zones exterior to 0.2 cm follow Lagrangian dynamics, and the
1020: region in between provides a smooth transition between the two domains.
1021: Both $v_{\phi}$ and  $\Omega$ profiles are presented at $t =
1022:   0.0, 0.1, 0.2, 0.35, 0.45, 0.55, 0.65, 0.75, 0.85$, and $1.0$ s.
1023: As designed the angular momentum is conserved to machine accuracy.
1024: In the top panel ($v_{\phi}$ vs. $r$), it is hard to discern any
1025: deviation of the simulation (crosses) from the analytic
1026: solution (solid line).  In fact, the maximum error as measured by
1027: $(v_{\phi,{\rm ana}} - v_{\phi})/ {\rm max}(v_{\phi,{\rm ana}})$
1028: ranges from
1029: $\sim 4 \times 10^{-5}$ near the beginning of the simulation to
1030: $\sim 8 \times 10^{-4}$ at the end.  $\Omega$ vs. $r$ (bottom panel) shows similar
1031: accuracy, except for the region near the axis.  At the center $(\Omega_{\rm ana} -\Omega)$
1032: reaches a maximum value of 0.2 rads s$^{-1}$ at $t = 0.55$ s.  On the
1033: whole, Fig. \ref{rottestplot} demonstrates that this code reproduces the analytic result with and without remapping.
1034: 
1035: \section{Gravity}
1036: \label{section:gravity}
1037: 
1038: There are two general strategies for solving Poisson's equation for
1039: gravity on
1040: arbitrary grids.  The first is to define another regular grid,
1041: interpolate the density from the hydro grid to this new gravity grid, and
1042: use many of the standard Poisson solvers for regular grids.  However,
1043: in our experience this approach can lead to numerical errors, which
1044: may lead to unsatisfactory results.  The second
1045: approach is to solve eq. (\ref{eq:poisson}) explicitly on the
1046: arbitrary hydro grid, eliminating an interpolation step.  We prefer the
1047: latter approach, giving potentials and accelerations that are more
1048: consistent with the hydrodynamics on an unstructured mesh. 
1049: 
1050: In determining the discrete analogs of eq. (\ref{eq:poisson}), we use the support-operator method.  After a bit of algebra these discrete equations
1051: may be expressed as a set of linear equations whose unknowns are the
1052: discretized gravitational potentials.  Solving for these potentials is
1053: akin to solving
1054: a matrix equation of the form, ${\bf A}\vec{x} = \vec{b}$, and since the solutions change little from
1055: timestep to timestep, we use an iterative matrix inversion approach
1056: in which the initial guess is the solution from the previous timestep. 
1057: 
1058: In solving Poisson's equation for gravity, we seek an algorithm
1059: satisfying the following conditions:  1) the potential should be defined at zone
1060: centers and the gravitational acceleration should be defined at the
1061: nodes;  2) we should conserve momentum and energy as accurately
1062: as possible;  and 3) the solver must be fast.  To this end, we employ
1063: the method described in \citet{shashkov95},
1064: \citet{shashkov96}, and \citet{morel98} for elliptic solvers.
1065: Specifically, we follow the particular implementation of
1066: \citet{morel98}.
1067: 
1068: Applying the support-operator method, we first define the divergence operator and, in
1069: particular, define $(\vec{\nabla} \cdot \vec{g})_z$.
1070: Poisson's equation for gravity may
1071: be written as an equation for the divergence of the acceleration,
1072: \begin{equation}
1073: \label{eq:poisson_div}
1074: - \vec{\nabla} \cdot \vec{g} = 4 \pi G \rho \, ,
1075: \end{equation}
1076:  where $\vec{g}$, the gravitational acceleration, is the negative of the
1077:  gradient of the potential.
1078: \begin{equation}
1079: \label{eq:gacc}
1080: \vec{g} = - \vec{\nabla} \Phi \, .
1081: \end{equation}
1082: Integrating eq. (\ref{eq:poisson_div}) over a finite volume gives
1083: \begin{equation}
1084: \label{eq:divtheorem}
1085: \int_V \vec{\nabla} \cdot \vec{g} dV = \oint_{\partial V} \vec{g}
1086: \cdot d\vec{S} = - \int_V 4 \pi G \rho dV \, ,
1087: \end{equation}
1088: and if the volume of integration, $V$, is chosen to be that of a cell, the RHS
1089: of eq. (\ref{eq:divtheorem}) becomes $- 4 \pi G m_z$.
1090: In discretizing the middle term in eq. (\ref{eq:divtheorem}),
1091: \begin{equation}
1092: \label{eq:discretegauss}
1093: \oint_{\partial V_z} \vec{g} \cdot d\vec{S} \longrightarrow
1094: \sum_e g_e A_e \, ,
1095: \end{equation}
1096: an expression for the divergence of $\vec{g}$ follows naturally:
1097: \begin{equation}
1098: \label{eq:discretediv}
1099: ( \vec{\nabla} \cdot \vec{g})_z =
1100: \frac{1}{V_z} \sum_{e \in S(z)} g_e A_e \, ,
1101: \end{equation}
1102: where 
1103: $A_e$ is the area of edge $e$, and $g_e$ is the component of the
1104: acceleration parallel to the direction of the edge's area vector.
1105: Therefore, substituting eq. (\ref{eq:discretediv}) into
1106: eq. (\ref{eq:divtheorem}) suggests a discrete expression for eq. (\ref{eq:poisson_div}):
1107: \begin{equation}
1108: \label{eq:discretepoisson_div}
1109: - \sum_e g_e A_e = 4 \pi G m_z \, .
1110: \end{equation}
1111: 
1112: 
1113: Having defined
1114: the discrete divergence of a vector, we then use the support-operator method to write the
1115: discrete equivalent of the gradient.  Once again, the integral identity relating
1116: the divergence and gradient operators is given by eq. (\ref{eq:intidentity}).
1117: Applying the definition for
1118: the discrete divergence, the first term on the LHS of
1119: eq. (\ref{eq:intidentity}) is approximated by
1120: \begin{equation}
1121: \label{eq:intidentity_lhs1}
1122: \int_V \Phi (\vec{\nabla} \cdot \vec{H}) dV
1123: \sim \Phi_z \sum_e h_e A_e \, ,
1124: \end{equation}
1125: where $h_e$ is the component of $\vec{H}$ perpendicular to edge $e$,
1126: and the RHS of eq. (\ref{eq:intidentity}) is approximated by
1127: \begin{equation}
1128: \label{eq:intidentity_rhs}
1129: \oint_{\partial V} \Phi \vec{H} \cdot d\vec{S}
1130: \sim \sum_e \Phi_e h_e A_e \, .
1131: \end{equation}
1132: It is already apparent that the discrete potential is
1133: defined for both cell centers ($\Phi_z$) and edges ($\Phi_e$).  This
1134: fact seems cumbersome.  However, we will demonstrate below that in the
1135: final equations the number of unknowns may be reduced by eliminating
1136: the cell-centered potentials, $\Phi_z$, in favor of the edge-centered
1137: potentials, $\Phi_e$.
1138: Completing the discretization of eq. (\ref{eq:intidentity}), the second
1139: term on the LHS is
1140: \begin{equation}
1141: \label{eq:intidentity_lhs2}
1142: \int_V \vec{H} \cdot \vec{\nabla} \Phi dV
1143: \sim - \sum_p \vec{H}_p \cdot \vec{g}_p W^z_p V_z \, ,
1144: \end{equation}
1145: where $W^z_p$ is a volumetric weight and $\vec{H}_p$ and $\vec{g}_p$
1146: are defined at the nodes.  The volumetric weight associated with each
1147: corner is defined as one quarter of the area of the parallelogram
1148: created by the sides that define the corner.  Additionally, the
1149: weights are normalized so that $\sum_{p \in N(z)} W^z_p = 1$.  The
1150: remaining task is to define the dot product $\vec{H}_p \cdot
1151: \vec{g}_p$ at each corner when the vector is expressed in components
1152: of a nonorthogonal basis set:
1153: \begin{equation}
1154: \label{eq:h_basis}
1155: \vec{H}_p = h_e \hat{e}_e+ h_{e-1} \hat{e}_{e-1} \, ,
1156: \end{equation}
1157: where $\hat{e}_{e-1}$ and $\hat{e}_e$ are basis vectors located at the
1158: center of the edges on either side of the corner associated with node
1159: $p$ with orientations perpendicular to the edges, and $h_{e-1}$ and
1160: $h_e$ are the corresponding magnitudes in this basis set.  With this
1161: basis set, the inner product is
1162: \begin{equation}
1163: \vec{H}_p \cdot \vec{g}_p = \langle S^p_{e,e-1}\vec{H}_p,\vec{g}_p \rangle \, ,
1164: \end{equation}
1165: where
1166: \begin{equation}
1167: \label{eq:smatrix}
1168: S^p_{e,e-1} = 
1169: \frac{1}{\sin^2 \theta^p_{e,e-1}}
1170: \left [
1171: \begin{array}{cc}
1172: 1 & \cos \theta^p_{e,e-1} \\
1173: \cos \theta^p_{e,e-1} & 1 \\
1174: \end{array}
1175: \right ] \, ,
1176: \end{equation}
1177: and $\theta^p_{e,e-1}$ is the angle formed by edges $e$ and $e-1$.
1178: Using eqs. (\ref{eq:h_basis})-(\ref{eq:smatrix}) in
1179: eq. (\ref{eq:intidentity_lhs2}), the second term on the LHS
1180: of eq. (\ref{eq:intidentity}) is
1181: \begin{multline}
1182: - \sum_p \vec{H}_p \cdot \vec{g}_p W^z_p V_z 
1183: = - \sum_e h_e \left ( (\alpha_p +\alpha_{p+1})g_e \right . \\
1184: \left . + \beta_p g_{e-1} + \beta_p g_{e+1} \right )
1185: \end{multline}
1186: %\begin{equation}
1187: %- \sum_p \vec{H}_p \cdot \vec{g}_p W^z_p V_z 
1188: %= - \sum_e h_e \left ( (\alpha_p +\alpha_{p+1})g_e 
1189: %+ \beta_p g_{e-1} + \beta_p g_{e+1} \right )
1190: %\end{equation}
1191: where $\alpha_p = W^z_p V_z / \sin^2 \theta_p$ and $\beta_p = W^z_p
1192: V_z \cos \theta_p / \sin^2 \theta_p$.
1193: Combining eqs. (\ref{eq:intidentity_lhs1}), (\ref{eq:intidentity_rhs}), and (\ref{eq:intidentity_lhs2}), we have the discrete form of the
1194: identity eq. (\ref{eq:intidentity}):
1195: \begin{multline}
1196: \label{eq:intidentity_discrete}
1197: \sum_e \left [
1198: (\Phi_e - \Phi_z)h_eA_e - h_e \left ( (\alpha_p +\alpha_{p+1})g_e \right . \right . \\
1199: \left . \left . + \beta_p g_{e-1} + \beta_p g_{e+1} \right )
1200: \right] = 0 \, .
1201: \end{multline}
1202: %\begin{eqnarray}
1203: %\label{eq:intidentity_discrete}
1204: %\sum_e \left [
1205: %(\Phi_e - \Phi_z)h_eA_e - h_e \left ( (\alpha_p +\alpha_{p+1})g_e \right . \rig%ht . \nonumber \\
1206: %\left . \left . + \beta_p g_{e-1} + \beta_p g_{e+1} \right )
1207: %\right] = 0 \, .
1208: %\end{eqnarray}
1209: %\begin{equation}
1210: %\label{eq:intidentity_discrete}
1211: %\sum_e \left [
1212: %(\Phi_e - \Phi_z)h_eA_e - h_e \left ( (\alpha_p +\alpha_{p+1})g_e 
1213: %+ \beta_p g_{e-1} + \beta_p g_{e+1} \right )
1214: %\right] = 0 \, .
1215: %\end{equation}
1216: 
1217: To find the equation for $g_e$ on each edge we set the
1218: corresponding $h_e = 1$ and set all others to zero.  This gives an
1219: expression for $g_e$ in terms of $\Phi_e$, $\Phi_z$, and the other
1220: edge-centered accelerations of cell $z$: 
1221: \begin{multline}
1222: \label{eq:ge_equation}
1223: (\Phi_e - \Phi_z)A_e - \left [ (\alpha_p +\alpha_{p+1})g_e \right . \\
1224: \left . + \beta_p g_{e-1} + \beta_p g_{e+1} \right ] = 0
1225: \end{multline}
1226: %\begin{equation}
1227: %\label{eq:ge_equation}
1228: %(\Phi_e - \Phi_z)A_e - \left [ (\alpha_p +\alpha_{p+1})g_e 
1229: %+ \beta_p g_{e-1} + \beta_p g_{e+1} \right ] = 0
1230: %\end{equation}
1231: or
1232: \begin{multline}
1233: \left [ (\alpha_p +\alpha_{p+1})g_e 
1234: + \beta_p g_{e-1} + \beta_p g_{e+1} \right ] \\
1235: = (\Phi_e - \Phi_z)A_e \, .
1236: \end{multline}
1237: %\begin{equation}
1238: %\left [ (\alpha_p +\alpha_{p+1})g_e 
1239: %+ \beta_p g_{e-1} + \beta_p g_{e+1} \right ] = (\Phi_e - \Phi_z)A_e \, .
1240: %\end{equation}
1241: Together, the set of equations for the edges of cell $z$ forms a
1242: matrix equation of the form\footnote{
1243: On a practical note, all terms involving $g_e$ on the $z$-axis are
1244: zero because the areas on the axis of symmetry are zero.
1245: Therefore, for the zones along the axis, one less equation and variable appear in the set of equations
1246: for $g_e$.}
1247: \begin{equation}
1248: {\bf Q} \vec{g} = \vec{b} \, ,
1249: \end{equation}
1250: where $\vec{b}$ is a vector based upon the edge values, $b_e =
1251: A_e(\Phi_z - \Phi_e)$.  Inverting this equation gives an expression
1252: for the edge accelerations as a function of the cell- and
1253: edge-centered potentials:
1254: \begin{equation}
1255: \label{eq:gacc_phiz_phie}
1256: g_e = \sum_{e'} a_{ee'} A_{e'}(\Phi_z - \Phi_{e'}) \, .
1257: \end{equation}
1258: After finding the edge acceleration for each zone,
1259: these values are inserted into eq. (\ref{eq:discretepoisson_div}).
1260: The stencil of potentials for this equation for each cell includes the
1261: cell center and all edges.  While eq. (\ref{eq:gacc_phiz_phie}) gives
1262: the edge accelerations associated with cell $z$, there is no
1263: guarantee that the equivalent equation for a neighboring cell will
1264: give the same acceleration for the same edge.
1265: To ensure continuity, we must include an equation which equates
1266: an edge's acceleration vectors from the neighboring cells:
1267: \begin{equation}
1268: \label{eq:gacc_continuity}
1269: -A_e g_{e,L} - A_e g_{e,R} = 0 \, ,
1270: \end{equation}
1271: where $g_{e,L}$ and $g_{e,R}$ are the edge accelerations as determined
1272: by eq. (\ref{eq:gacc_phiz_phie}) for the left ($L$) and right ($R$)
1273: cells.  While we could have chosen a simpler expression for
1274: eq. (\ref{eq:gacc_continuity}), the choice of sign and coefficients
1275: ensures that the eventual system of linear equations involves a
1276: symmetric positive-definite matrix.  This enables the use of fast and
1277: standard iterative matrix inversion methods such as the
1278: conjugate-gradient method. The stencil for this equation involves the
1279: edge in question, the 
1280: cell centers on either side, and the rest of the edges associated with
1281: these cells.  At first glance, it seems that we need to invert the
1282: system of equations that includes the cell-centered equations,
1283: eq. (\ref{eq:gacc_phiz_phie}), and the edge-centered equations, eq. (\ref{eq:gacc_continuity}).  Instead, we use
1284: eq. (\ref{eq:discretepoisson_div}) to express the cell-centered
1285: potentials in terms
1286: of edge-centered potentials and the RHS of the equation:
1287: \begin{equation}
1288: \label{eq:phizeq}
1289: \Phi_z = \frac{1}{\zeta_z}
1290: \left (
1291: \sum_{e'} A_{e'} \Phi_{e'} \psi_{e'} - 4 \pi G m_z
1292: \right ) \, ,
1293: \end{equation}
1294: where $\psi_e = \sum_{e'} A_e'a_{e'e}$, and $\zeta_z = \sum_e
1295: \sum_{e'} A_e a_{ee'}A_{e'} = \sum_{e'}A_{e'}\psi_{e'}.$  Substituting
1296: eq. (\ref{eq:phizeq}) into the expression for the edge acceleration,
1297: eq. (\ref{eq:gacc_phiz_phie}),
1298: \begin{equation}
1299: \label{eq:gacc_phie}
1300: g_k = - \frac{\eta_k}{\zeta_z} 4 \pi G m_z + \sum_e \Phi_e A_e 
1301: \left (
1302: \frac{\eta_k}{\zeta_z} \psi_e - a_{ke}
1303: \right ) \, ,
1304: \end{equation}
1305: where $\eta_k = \sum_e a_{ke} A_e$.  Finally, substituting
1306: eq. (\ref{eq:gacc_phie}) into eq. (\ref{eq:gacc_continuity}) gives the matrix equation for gravity with
1307: only edge-centered potential unknowns:
1308: \begin{multline}
1309: A_*\sum_{e^R} \Phi_e A_e(a_{*e}^R - \frac{\eta^R_* \psi^R_e}{\zeta_R})
1310: + A_*\sum_{e^L} \Phi_e A_e(a_{*e}^L - \frac{\eta^L_*
1311:   \psi^L_e}{\zeta_L}) \\
1312: = -4 \pi G A_* (\frac{\eta^R_*}{\zeta_R} m_R + \frac{\eta^L_*}{\zeta_L} m_L) \, .
1313: \end{multline}
1314: %\begin{eqnarray}
1315: %A_*\sum_{e^R} \Phi_e A_e(a_{*e}^R - \frac{\eta^R_* \psi^R_e}{\zeta_R})
1316: %+ A_*\sum_{e^L} \Phi_e A_e(a_{*e}^L - \frac{\eta^L_*
1317: %  \psi^L_e}{\zeta_L}) \nonumber \\
1318: %= -4 \pi G A_* (\frac{\eta^R_*}{\zeta_R} m_R + \frac{\eta^L_*}{\zeta_L} m_L) \, .
1319: %\end{eqnarray}
1320: %\begin{equation}
1321: %A_*\sum_{e^R} \Phi_e A_e(a_{*e}^R - \frac{\eta^R_* \psi^R_e}{\zeta_R})
1322: %+ A_*\sum_{e^L} \Phi_e A_e(a_{*e}^L - \frac{\eta^L_*
1323: %  \psi^L_e}{\zeta_L})
1324: %= -4 \pi G A_* (\frac{\eta^R_*}{\zeta_R} m_R + \frac{\eta^L_*}{\zeta_L} m_L) \, .
1325: %\end{equation}
1326: The stencil for this equation involves the edge and all other edges
1327: associated with the zones on either side of
1328: the edge in question.  Taken together, the equations result in a set of linear equations for the edge-centered
1329: potentials, $\Phi_e$.  
1330: 
1331: Since this class of matrix equations is ubiquitous,
1332: there exists many accurate and fast linear system
1333: solvers we can exploit.  To do so, we recast our discrete
1334: form of Poisson's equation as
1335: \begin{equation}
1336: \label{eq:linear}
1337: \mathbf{A} \vec{\Phi} = \vec{s} \, ,
1338: \end{equation}
1339: where $\vec{\Phi}$ is a vector of the edge-centered potentials,
1340:  and $\vec{s}$
1341: is the corresponding vector of source terms.
1342: We solve the matrix equation using the conjugate-gradient method with
1343: a multigrid preconditioner.  In particular, we use the algebraic
1344: multigrid package, AMG1R6\footnote{See \S \ref{section:corecollapse}
1345:   for details on performance.} \citep{ruge87}.
1346: 
1347: 
1348: \subsection{Gravitational Acceleration}
1349: \label{section:gravity_acceleration}
1350: 
1351: Unfortunately, this discretization scheme does not adequately define
1352: the accelerations at the nodes where they are needed in eq. (\ref{eq:mom_discrete2}).  Therefore, we use the least-squares
1353: minimization method to determine the gradient on the unstructured
1354: mesh.
1355: Assuming a linear
1356: function for the potential in the neighborhood of node $i$, $\hat{\Phi}_i(x,y)$, we seek to minimize the difference between
1357: $\Phi_k$ and $\hat{\Phi}_i(x_k,y_k)$, where $\Phi_k$ is the neighbor's
1358: value and $\hat{\Phi}_i(x_k,y_k)$ is the evaluation of
1359: $\hat{\Phi}_i(x,y)$ at
1360: the position of the neighbor, $(x_k,y_k)$.
1361: More explicitly, we minimize the following equation:
1362: \begin{equation}
1363: \label{eq:least_gacc_eq1}
1364: \sum_{k \in \mathcal{N}(i)} \omega^2_{ki} E^2_{ik} \, ,
1365: \end{equation}
1366: where the ``neighbors'' are the nearest cell-centers and
1367: edges to node $i$ and are denoted by $k \in \mathcal{N}(i)$,
1368: \begin{equation}
1369: E^2_{ik} = \left (
1370: \Phi_i - \Phi_k + \Phi_{x,i} \Delta x_{ik} + \Phi_{y,i} \Delta y_{ik}
1371: \right )^2 \, ,
1372: \end{equation}
1373: $\Delta x_{ik} = x_k - x_i$, $\Delta y_{ik} = y_k - y_i$, and $\omega^2_{ik} = 1/(\Delta x_{ik}^2 + \Delta y_{ik}^2)$.
1374: 
1375: Usually, minimization of
1376: eq. (\ref{eq:least_gacc_eq1}) leads to a matrix equation for two
1377: unknowns: $\Phi_{x,i}$ and $\Phi_{y,i}$, the gradients for $\Phi$ in
1378: the $x$ and $y$ directions, respectively (\S \ref{section:swept}).  However, $\Phi_i$, the potential at the node
1379: is not defined and is a third unknown with which
1380: eq. (\ref{eq:least_gacc_eq1}) must be minimized.
1381: Performing the least-squares minimization process with respect to the
1382: three unknowns, $\Phi_i$, $\Phi_{x,i}$, and $\Phi_{y,i}$, leads to the
1383: following set of linear equations for each node:
1384: \begin{equation}
1385: \begin{array}{rcl}
1386: a \Phi_i + b \Phi_{x,i} + c \Phi_{y,i} & = & k\\
1387: d \Phi_i + e \Phi_{x,i} + g \Phi_{y,i} & = & l\\
1388: h \Phi_i + i \Phi_{x,i} + j \Phi_{y,i} & = & m\\
1389: \end{array}
1390:  \, ,
1391: \end{equation}
1392: where 
1393: \begin{equation}
1394: \begin{array}{rcl}
1395: a & = & \sum_{k} \omega^2_{ik}\\
1396: b & = & \sum_{k} \omega^2_{ik} \Delta x_{ik}\\
1397: c & = & \sum_{k} \omega^2_{ik} \Delta y_{ik}\\
1398: d & = & \sum_{k} \omega^2_{ik} \Delta x_{ik}\\
1399: e & = & \sum_{k} \omega^2_{ik} \Delta x^2_{ik}\\
1400: g & = & \sum_{k} \omega^2_{ik} \Delta x_{ik} \Delta y_{ik}\\
1401: h & = & \sum_{k} \omega^2_{ik} \Delta y_{ik}\\
1402: i & = & \sum_{k} \omega^2_{ik} \Delta x_{ik} \Delta y_{ik}\\
1403: j & = & \sum_{k} \omega^2_{ik} \Delta y^2_{ik}\\
1404: k & = & \sum_{k} \omega^2_{ik} \Phi_k\\
1405: l & = & \sum_{k} \omega^2_{ik} \Phi_k \Delta x_{ik}\\
1406: m & = & \sum_{k} \omega^2_{ik} \Phi_k \Delta y_{ik}\\
1407: \end{array}
1408: \end{equation}
1409: Inversion of this linear system gives the potential and the gradient
1410: at the node.  Specifically, we use the adjoint matrix inversion method
1411: to find the inverse matrix and the three unknowns, including $\Phi_{x,i}$ and $\Phi_{y,i}$.
1412: 
1413: \subsection{Gravitational Boundary Conditions}
1414: \label{section:gravity_boundary}
1415: 
1416: The outer boundary condition we employ for the Poisson solver is a
1417:  multipole expansion for the gravitational potential at a spherical
1418:  outer boundary.  Assuming no material exists outside the calculational
1419:  domain and that the potential asymptotes to zero, the potential at the
1420:  outer boundary, ${\bf r}$, is given by
1421: \begin{equation}
1422: \label{eq:boundary_eq1}
1423: \phi({\bf r}) = - G \sum_{n=0}^{\infty} \frac{1}{r^{n+1}} \int
1424: (r')^nP_n(\cos \theta') \rho({\bf r}')dV' \, ,
1425: \end{equation}
1426: where $P_n(\cos \theta')$ is the usual Legendre polynomial.  In
1427: discretized form, eq. (\ref{eq:boundary_eq1}) becomes
1428: \begin{equation}
1429: \phi({\bf r}) = - G \sum_{n=0}^{N_n} \frac{1}{r^{n+1}} \sum_z
1430: (r_z)^nP_n(\cos \theta_z) m_z \, ,
1431: \end{equation}
1432: where $N_n$ is the order at which the multipole expansion is truncated.
1433: 
1434: \subsection{Gravity: 1D Spherical Symmetry}
1435: \label{section:gravity_1d}
1436: 
1437: For 1D spherically symmetric simulations, calculation of gravity can
1438: be straightforward using
1439: \begin{equation}
1440: \label{eq:gacc_enclosed}
1441: g_p = - \frac{G m_{p,{\rm enclosed}}}{r_p^2} \, ,
1442: \end{equation}
1443: where $m_{p,{\rm enclosed}}$ is all of the mass enclosed by point
1444: $p$.  Instead, we solve Poisson's equation for
1445: gravity using similar methods to those employed for the 2D gravity.  By doing
1446: this, we remain consistent when comparing our 1D and 2D results.
1447: Furthermore, we show that deriving a Poisson solver based upon
1448: the support-operator method is equivalent to the more traditional form, eq. (\ref{eq:gacc_enclosed}).
1449: 
1450: The inherent symmetries of 1D spherical simulations reduce
1451: eq. (\ref{eq:ge_equation}) to the following form:
1452: \begin{equation}
1453: (\Phi_e - \Phi_z)A_e - V^z_p g_{e,z} = 0 \, .
1454: \end{equation}
1455: Unlike the full 2D version, one may eliminate the edge potentials in favor
1456: for the cell-centered potentials and the accelerations at the edges.
1457: Since each edge $e$ will have an equation for its value associated with
1458: cells $z$ and $z+1$, this leads to
1459: \begin{equation}
1460: \Phi_z A_e + V^z_p g_{e,z} = \Phi_{z+1} A_e + V^{z+1}_p g_{e,z+1} \, .
1461: \end{equation}
1462: Using the continuity of accelerations at the edges,
1463: \begin{equation}
1464: g_{e,z} = - g_{e,z+1} \, ,
1465: \end{equation}
1466: the expression for gravitational acceleration at edge $e$ in terms of
1467: the cell-centered potentials is
1468: \begin{equation}
1469: \label{eq:gacc_1dsph}
1470: g_{e,z} = \frac{1}{V_p}(\Phi_{z+1} - \Phi_z) A_e \, .
1471: \end{equation}
1472: Substituting this expression into
1473: \begin{equation}
1474: \label{eq:1dgaussgravity}
1475: \sum_e A_e g_{e,z} = - 4 \pi G m_z \, ,
1476: \end{equation}
1477: leads to a tridiagonal matrix equation for the cell-centered
1478: potential, which can be inverted in O(N) operations to give the cell-centered potentials.  Substituting these cell-centered potentials back into
1479: eq. (\ref{eq:gacc_1dsph}) gives the gravitational acceleration needed
1480: for the momentum equation (eqs. \ref{eq:mom_lag} and \ref{eq:mom_discrete2}).
1481: 
1482: It should be noted that eq. (\ref{eq:1dgaussgravity}) can be rewritten
1483: as a recursion relation for the gravitational acceleration, $g_p$, at node
1484: $p$:
1485: \begin{equation}
1486: \label{eq:recursive}
1487: A_p g_p = A_{p-1} g_{p-1} - 4 \pi G m_{z,{\rm interior}} \, ,
1488: \end{equation}
1489: where $m_{z,{\rm interior}}$ is the mass of the cell
1490: interior to point $p$.  With the boundary condition $g_1 = 0$ and
1491: then recursively solving eq. (\ref{eq:recursive}) for $g_p$ from the
1492: center outward, the expression for the
1493: gravitational acceleration simplifies to eq. (\ref{eq:gacc_enclosed}).
1494: This is the traditional form by which the gravitational acceleration
1495: is calculated for 1D spherically symmetric simulations and for which
1496: the potential is usually not referenced.  The beauty of our approach
1497: is that 1D and 2D simulations are consistent, and that it
1498: self-consistently gives the gravitational potential.  
1499: 
1500: \subsection{Conservation of Energy with Gravity}
1501: \label{section:consenegravity}
1502: 
1503: For self-gravitating hydrodynamic systems, the total energy is
1504: \begin{equation}
1505: \label{eq:totalenergy}
1506: E = \mathcal{E} + K + U \, ,
1507: \end{equation}
1508: where $\mathcal{E}$ is the total internal energy, $K$ is the total
1509: kinetic energy, and $U$ is the total potential energy:
1510: \begin{equation}
1511: \label{eq:totpot1}
1512: U = \frac{1}{2}\int_V \rho \Phi dV \, ,
1513: \end{equation}
1514: An alternative form is possible with the substitution of
1515: eq. (\ref{eq:poisson_div}) into eq. (\ref{eq:totpot1}) and integration
1516: by parts:
1517: \begin{equation}
1518: \label{eq:totpot2}
1519: U = -\frac{1}{8 \pi G} \left [ \oint_S \vec{g}\Phi \cdot d\vec{S}
1520:  + \int_V |\vec{g}|^2 dV
1521: \right ] \, .
1522: \end{equation}
1523: The integral form of eq. (\ref{eq:totalenergy}) is
1524: \begin{equation}
1525: E = \int_V (\rho e + \frac{1}{2}\rho v^2 + \frac{1}{2}\rho \Phi) dV \, ,
1526: \end{equation}
1527: and total energy conservation is given by
1528: \begin{equation}
1529: \label{eq:dedt}
1530: \frac{\partial E}{\partial t} = \frac{\partial}{\partial t}\int_V
1531: (\rho e + \frac{1}{2}\rho v^2 + \frac{1}{2}\rho \Phi) dV = 0\, .
1532: \end{equation}
1533: Since the solution to Poisson's equation for
1534: gravity, using Green's function, is
1535: \begin{equation}
1536: \Phi(\vec{x}) = -G \int{\frac{\rho(\vec{x}') dV'}{|\vec{x} - \vec{x}'|}} \, ,
1537: \end{equation}
1538: the time derivative of the total potential energy may take three forms:
1539: \begin{equation}
1540: \label{eq:dudt}
1541: \int_V \rho \frac{\partial \Phi}{\partial t}dV = \int_V \Phi
1542: \frac{\partial \rho}{\partial t}dV = \frac{1}{2} \int_V \frac{\partial (\rho
1543:   \Phi)}{\partial t}dV \, .
1544: \end{equation}
1545: Note that this is true only for the total potential energy and does
1546: not imply $\rho \frac{\partial \Phi}{\partial t} = \Phi \frac{\partial \rho}{\partial t} = \frac{1}{2} \frac{\partial (\rho
1547:   \Phi)}{\partial t}$.
1548: Using eq. (\ref{eq:dudt}) and the Eulerian form of the hydrodynamics equations  (see appendix \ref{section:eulerian_hydro}),
1549: eq. (\ref{eq:dedt}) becomes a surface integral:
1550: \begin{equation}
1551: \frac{\partial E}{\partial t} = 
1552: - \oint_S (\rho e + P + \frac{1}{2}\rho v^2
1553:   + \rho \Phi) \vec{v}
1554: \cdot d \vec{S} \, ,
1555: \end{equation}
1556: which simply states that energy is conserved in the absence of a flux
1557: of energy through the bounding surface.
1558: 
1559: 
1560: The discrete analogs of $\mathcal{E}$ and
1561: $K$ are trivially obtained using $\mathcal{E} = \sum_z m_z \varepsilon_z$
1562: and $K = \frac{1}{2}\sum_p m_p v^2_p$, respectively.
1563: The discrete total potential energy may take two forms, the analogs of
1564: eqs. (\ref{eq:totpot1}) and (\ref{eq:totpot2}):
1565: \begin{equation}
1566: U = 
1567: \left \{
1568: \begin{array}{l}
1569: \frac{1}{2}\sum_z m_z \Phi_z \\
1570: -\frac{1}{8 \pi G} \left [
1571: \sum_{pb} \Phi_{pb} \vec{g}_{pb} \cdot \vec{S}_{pb}
1572: + \sum_p \vec{g}_p \cdot \vec{g}_p V_p
1573: \right ] \, ,\\
1574: \end{array}
1575: \right . 
1576: \end{equation}
1577: where $pb$ indicates outer-boundary values.
1578: Upon trying both forms, we get similar results.  Therefore, we use the
1579: simpler form involving the cell-center potential: $U = \frac{1}{2}\sum_z m_z \Phi_z$.
1580: 
1581: Because our discrete hydrodynamics equations including gravity do not give strict
1582: energy conservation, we use the
1583: core-collapse simulation (\S \ref{section:corecollapse}) to gauge how
1584: well energy is conserved.  
1585: Rather than measuring the relative error in total energy by $\Delta E /
1586: E_{\rm ref}$, where $\Delta E = E_n - E_{\rm ref}$, $E_{\rm ref}$ is
1587: the initial total energy, and $E_n$ is the
1588: total energy at timestep $n$, we use $\Delta E / |U_n|$.  For stellar
1589: profiles, the kinetic energy is small and the internal and gravitational
1590: energies are nearly equal in magnitude, but opposite in sign.
1591: Since the total energy is roughly zero
1592: in comparison to the primary constituents, $\mathcal{E}$ and $U$, of the total energy, we use the
1593: gravitational potential energy as a reference.  For example, the internal
1594: and gravitational energies start at $\sim 4 \times
1595: 10^{51}$ erg and reach $\sim 1 \times 10^{53}$ ergs at the end of the
1596: run.  However, the total energy is a small fraction of these energies
1597: initially, $\sim 5\times 10^{50}$,
1598: and after core bounce, $\sim 1.5 \times 10^{51}$.  Hence, we measure
1599: the relative error in total energy as $\Delta E / |U_n|$.
1600: 
1601: The total energy for the 1D and 2D core-collapse simulations evolve similarly and is
1602: conserved quite well.  For all times except a few milliseconds around
1603: bounce, total energy is conserved better than $\sim$1 $\times
1604: 10^{-3}$.  During collapse, from 0 to 147 ms, the total energy deviates by only $\sim$3
1605: $\times 10^{-4}$.  Over a span of 5 ms around bounce, $t = 148$ ms, the total energy changes by
1606: $\sim$2.2 $\times 10^{-2}$.  For 100s of milliseconds afterward, the
1607: relative error in the total energy reduces to $\sim$7 $\times 10^{-4}$.
1608: Hence, for all but about 5 ms of a simulation that lasts many hundreds
1609: of milliseconds the relative error in total energy is better than $\sim$1 $\times 10^{-3}$.
1610: 
1611: \subsection{Tests of Gravity}
1612: \label{section:gravity_tests}
1613: 
1614: We include here several assessments of the 1D and 2D Poisson solvers.  First, we calculate, using the
1615: butterfly mesh, the potential
1616: for a homogeneous sphere and compare to the
1617: analytic solution.  This tests overall accuracy and
1618: the ability of our solver to give spherically symmetric potentials
1619: when a non-spherical mesh is employed.  Similarly, we substantiate the
1620: algorithm's ability to produce aspherical potentials of homogeneous oblate spheroids.  Then, we verify that the
1621: hydrodynamics and gravity solvers give accurate results for stars in
1622: hydrostatic equilibrium, and for a dynamical problem, the Goldreich-Weber
1623: self-similar collapse \citep{goldreich80}.
1624: 
1625: Figure \ref{maclaurin_sphere} compares the simulated and analytic
1626: solutions for a homogeneous
1627: sphere, having density $\rho_0 =
1628: 1$ g cm$^{-3}$, and maximum radius $r_a = 1$ cm.  The analytic
1629: potential inside the sphere is $\Phi_{\rm{ana}} = G \rho_0 \frac{2}{3}
1630: \pi (r^2 + z^2 - 3 r_a^2)$, and the top panel of Fig. \ref{maclaurin_sphere}
1631:   shows the relative difference of the analytic potential and the
1632:   numerical solution, $\Phi_z$, as a function of radius.  Results for four
1633:   resolutions of the butterfly mesh are shown:
1634:   2550 cells with an effective radial resolution $\Delta r \sim$ 0.02
1635:   cm (blue); 8750 cells with $\Delta r \sim$ 0.01 cm (green); 15,200 cells with
1636:   $\Delta r \sim$ 0.006 cm (yellow); and 35,000 cells with $\Delta r
1637:   \sim$ 0.005 cm (red).  
1638:   Two facts are obvious:  1) the solutions are accurate at a level of
1639:   $\sim 3 \times 10^{-5}$ for $\Delta r/r_a \sim 0.005$ and $\sim 3
1640:   \times 10^{-4}$ for $\Delta r/r_a \sim 0.02$; and 2) the degree to
1641:   which the solution is spherically symmetric is similarly a few times
1642:   $10^{-5}$ for $\Delta r/r_a \sim 0.005$ and a few times $10^{-4}$
1643:   for $\Delta r/r_a \sim 0.02$.  Plotting the minimum error as a function of the effective
1644:   radial resolution, the bottom panel of
1645:   Fig. \ref{maclaurin_sphere}  verifies that the 2D Poisson
1646:   solver convergences with 2$^{\rm{nd}}$-order accuracy (solid line).
1647: 
1648: Next, we calculate the aspherical potential for an oblate spheroid .
1649: The homogeneous oblate spheroid has an elliptic meridional cross section, and the minor-
1650: and major-axes of the ellipse are $r_b$ and $r_a$,
1651: where $r_a$ is the equatorial radius.  Thus, the
1652: eccentricity of the spheroid is $e = \sqrt{1 -
1653:   (r_b/r_a)^2}$.  Given a uniform density, $\rho_0$, the potential for
1654: a spheroid is
1655: \begin{equation}
1656: \Phi_{\rm{ana}}(r,z) = - \pi G \rho_0 \left ( 
1657: I_{BT} r_a^2 - [ a_1 r^2 + a_3 z^2]
1658: \right ) \, ,
1659: \end{equation}
1660: where, for oblate spheroids,
1661: \begin{equation}
1662: a_1 = \left [
1663: \frac{\sin^{-1} e}{e} - (1 - e^2)^{1/2}
1664: \right ] \frac{(1 - e^2)^{1/2}}{e^2} \, ,
1665: \end{equation}
1666: \begin{equation}
1667: a_3 = 2 \left [
1668: (1 - e^2)^{-1/2} -  \frac{\sin^{-1} e}{e}
1669: \right ] \frac{(1 - e^2)^{1/2}}{e^2} \, ,
1670: \end{equation}
1671: and $I_{BT} = 2a_1 + a_3 (1 - e^2)$ \citep{chandrasekhar69}.
1672: 
1673: Numerical results with $e = 0.8$ are shown in Fig. \ref{maclaurin_spheroid}.
1674: As with the sphere, $\rho_0 = 1$ g cm$^{-3}$
1675: and $r_a = 1$ cm.  However, for the given eccentricity, the polar-axis
1676: radius, $r_b$, is 0.6 cm.  Once again, the grid is a butterfly mesh, but
1677: this time the outer boundary follows the ellipse defining the
1678: surface of the spheroid.  The top panel of
1679: Fig. \ref{maclaurin_spheroid} presents the spheroid's potential, and the degree of
1680: accuracy is presented in the bottom plot.  With $N_{\rm{cell}} =
1681: 35,000$ and $\Delta r/r_a \sim 0.005$, the relative error in the
1682: potential ranges from $\sim 2 \times 10^{-6}$ near the outer boundary
1683: to $\sim 3 \times 10^{-5}$ in interior regions.
1684: Conspicuous are
1685: features in the relative error that track abrupt grid orientation changes in
1686: the mesh.  Fortunately, these features have
1687: magnitudes smaller than or similar to the relative error in the local
1688: region.
1689: The relative error in the gravitational acceleration magnitude, $(|\vec{g}_p| -
1690: |\vec{g}_{\rm ana}| / {\rm max}(|\vec{g}_{\rm ana}|)$ ranges from
1691: $\sim$$-10^{-4}$ to $\sim$$10^{-4}$, where $\vec{g}_{\rm ana}$
1692: is the analytic acceleration and ${\rm max}(|\vec{g}_{\rm ana}|)$ is
1693: the maximum magnitude on the grid.  Typical errors in the acceleration
1694: direction range from $\sim$$-10^{-4}$ to
1695: $\sim$$10^{-4}$ radians with rare deviations as large as
1696: $\sim$$10^{-3}$ radians near the axis and abrupt grid orientation changes.
1697: 
1698: In Fig. \ref{laneemden_plot}, we demonstrate that the ALE
1699: algorithm in combination with our
1700: gravity solver produces reasonably accurate hydrostatic equilibria.
1701: The grid is the butterfly mesh with 8750 zones, and the initial model is a Lane-Emden polytrope with
1702:   $\gamma = 5/3$, $M = 1$ M$_{\sun}$, and $R = 2.9 \times 10^{10}$
1703:   cm.  Crosses show the density profile at $t = 1 \times 10^{4}$
1704:   s, while the solid line shows the maximum density
1705:   as a function of time and that the star pulsates.  These oscillations result from the slight difference between an analytic
1706:   hydrostatic equilibrium structure and a discretized hydrostatic
1707:   equilibrium structure, and with increasing resolution, they decrease in
1708:   magnitude.  Interestingly, the oscillations continue for many cycles with very little attenuation.
1709: 
1710: Simulating the
1711: Goldreich-Weber self-similar collapse \citep{goldreich80} in 1D and
1712: 2D is a good test of dynamic simulations including gravity. The analytic profile is similar to a Lane-Emden polytrope with $\gamma =
1713: 4/3$, and in fact, we use the gamma-law EOS with $\gamma = 4/3$.
1714: While the Lane-Emden
1715: polytropes are assumed to be in hydrostatic equilibrium, the
1716: Goldreich-Weber self-similar collapse has a homologous velocity
1717: profile and a self-similar density profile.
1718: The physical dimensions have been scaled so that $M = 1.3$ M$_{\sun}$,
1719: the initial central density is $10^{10}$ g cm$^{-3}$, and the maximum
1720: radius of the profile is $1.66 \times 10^8$ cm.  For the 1D
1721: simulation, we initiate the grid with 200 evenly-spaced zones, and for
1722: 2D, a butterfly mesh with
1723: 35,000 zones (effectively with 200 radial zones) is used to initiate the
1724: grid.  Subsequent evolution for both simulations uses the Lagrangian
1725: configuration.
1726: 
1727: Figure \ref{gwplot} shows snapshots of density vs. radius
1728: for 1D (top
1729: panel) and 2D (bottom panel) simulations at $t = $0, 20, 40, 60, 80,
1730: 100, 120, and 130 ms.  Both plots indicate that the simulations
1731: (crosses) track the analytic solution (solid lines).  Quantitatively,
1732: we measure a relative difference, $(\rho_z - \rho_{\rm ana})/(\max
1733: (\rho_{\rm ana} ) )$, for the reported times, where $\rho_z$ are the simulated
1734: cell-center densities and $\rho_{\rm ana}$ are the analytic values.
1735: Consistently, the largest deviations are at the center and Table
1736: \ref{table:gw} gives these values for the 1D simulation (2$^{nd}$
1737: column) and the 2D simulation (3$^{rd}$ column).  The relative
1738: differences range from $-9.2 \times 10^{-8}$ at 0 ms to $-3.6 \times
1739: 10^{-2}$ at 130 ms for the 1D simulation and $-1.2 \times 10^{-7}$ at
1740: 0 ms to $-6.3 \times 10^{-2}$ at 130 ms for the 2D simulation.  At all times, the departure from spherical
1741: symmetry is no more than $\sim 1 \times 10^{-4}$.
1742: 
1743: \section{Hydrodynamic Boundary Conditions}
1744: \label{section:hydro_boundary}
1745: 
1746: Boundary conditions are implemented in one of two ways.  Either an
1747: external pressure is specified or the velocities at the nodes are
1748: fixed.  For external pressures, ghost cells are
1749: defined that have no true volume or mass associated with them.
1750: Their only function is to apply an external force to the boundary
1751: cells equal to an external pressure times the boundary surface area.
1752: Specifying nodal velocities on the boundary
1753: accomplishes the same task.  In this case, there is an implied
1754: external force and pressure.  In practice, generic dynamical
1755: boundaries use the external pressure boundary condition.  On the other
1756: hand, pistons, reflecting walls, and the azimuthal axis have
1757: the velocity perpendicular to the boundary specified, while the
1758: parallel component executes unhindered hydrodynamic motions.
1759: 
1760: \section{Artificial Viscosity}
1761: \label{section:artificial_viscosity}
1762: 
1763: To resolve shocks over just a few zones, we include artificial
1764: viscosity in the equations of hydrodynamics.  For 1D simulations, we
1765: add a viscous-like term to the pressure \citep{vonneumann50}.  We denote this viscous
1766: pressure by $q$.  The original realization of $q$ employed one term proportional to
1767: $(\Delta v)^2$, where $\Delta v$ is the difference in velocity from one
1768: zone to the next.  While this form adequately
1769: resolved shocks, unphysical oscillations were observed in the
1770: post-shock flow.  A second term, linear in $\Delta v$, was then added that
1771: effectively damped these oscillations \citep{landshoff55}.  Another form which we employ
1772: for our 1D simulations is
1773: \begin{multline}
1774: \label{eq:viscosity}
1775: q = \rho \left (
1776: c_2 \frac{\gamma + 1}{4} |\Delta v| \right. \\
1777: \left. +
1778: \sqrt{c^2_2 \left ( \frac{\gamma + 1}{4}\right )^2 (\Delta v)^2 +
1779:   c^2_1 c^2_s
1780: }
1781: \right ) |\Delta v| \, ,
1782: \end{multline}
1783: %\begin{equation}
1784: %\label{eq:viscosity}
1785: %q = \rho \left (
1786: %c_2 \frac{\gamma + 1}{4} |\Delta v| +
1787: %\sqrt{c^2_2 \left ( \frac{\gamma + 1}{4}\right )^2 (\Delta v)^2 +
1788: %  c^2_1 c^2_s
1789: %}
1790: %\right ) |\Delta v| \, ,
1791: %\end{equation}
1792: where $c_s$ is the sound speed, $c_1$ is the parameter associated with the
1793: linear term, and $c_2$ is the parameter associated with the quadratic term.
1794: This form has the appealing attribute that it is motivated by the
1795: expression for the shock-jump condition for pressure in an ideal gas \citep{wilkins80}.
1796: 
1797: For 2D simulations, the artificial viscosity scheme we have settled upon
1798: is the tensor artificial viscosity algorithm of \citet{campbell01}.
1799: Here, we do not re-derive the artificial viscosity scheme, but highlight
1800: some of its salient features and practical implementations.  The useful feature of the tensor algorithm is its ability to calculate artificial viscosity on an
1801: arbitrary grid, while suppressing artificial grid buckling when the
1802: flow is not aligned with the grid.  In the strictest sense, the tensor
1803: artificial viscosity does not employ the simple viscous pressure
1804: described above.  Instead, \citet{campbell01} assume that the
1805: artificial viscosity tensor is a combination of a scalar coefficient,
1806: \begin{equation}
1807: \label{eq:mu_av}
1808: \mu \propto \rho \left (
1809: c_2 \frac{\gamma + 1}{4} |\Delta v| +
1810: \sqrt{c^2_2 \left ( \frac{\gamma + 1}{4}\right )^2 (\Delta v)^2 +
1811:   c^2_1 c^2_s
1812: }
1813: \right ) \, ,
1814: \end{equation}
1815: and the gradient of the velocity tensor, $\vec{\nabla} \vec{v}$.
1816: Therefore, references to the parameters $c_1$ and $c_2$ in 1D and 2D
1817: refer to the same linear or quadratic dependence on $|\Delta \vec{v}|$.  With this assumption, the
1818: momentum equation, eq. (\ref{eq:mom_lag}), becomes
1819: \begin{equation}
1820: \label{eq:mom_lag_av}
1821: \rho \frac{d \vec{v}}{d t} = - \rho \vec{\nabla} \Phi - \vec{\nabla} P
1822: + \vec{\nabla} \cdot ( \mu \vec{\nabla} \vec{v} ) \, ,
1823: \end{equation}
1824: and the energy equation, eq. (\ref{eq:ene_lag}), is
1825: \begin{equation}
1826: \label{eq:ene_lag_av}
1827: \rho \frac{d \varepsilon}{d t} = - P \vec{\nabla} \cdot \vec{v} 
1828: + \mu (\vec{\nabla} \vec{v}) : (\vec{\nabla} \vec{v})\, ,
1829: \end{equation}
1830: where $(\vec{\nabla} \vec{v}) : (\vec{\nabla} \vec{v}) = (\vec{\nabla}
1831: \vec{v})_{ij} (\vec{\nabla} \vec{v})_{ij}$, using the normal Einstein
1832: summation convention.  With the method of support operators,
1833: \citet{campbell01} derive discrete forms of these equations.
1834: Analogous to the gradient of the pressure term, the discrete artificial
1835: viscosity term in the momentum equation becomes a summation of corner
1836: forces, 
1837: \begin{equation}
1838: \vec{\nabla} \cdot ( \mu \vec{\nabla} \vec{v} ) \longrightarrow \sum_{z \in S(p)}\vec{f}^p_{z,\rm{visc}} \, ,
1839: \end{equation}
1840: and the
1841: corresponding term in the energy equation is the usual
1842: force-dot-velocity summation: 
1843: \begin{equation}
1844: \mu (\vec{\nabla} \vec{v}) : (\vec{\nabla} \vec{v}) \longrightarrow
1845: -\sum_{p \in S(z)} \vec{f}^z_{p,\rm{visc}} \cdot \vec{v}_p.
1846: \end{equation}
1847: Therefore, implementation of the artificial viscosity scheme is
1848: straightforward and similar to that for the pressure forces.
1849: 
1850: In practice, this artificial viscosity scheme is
1851: formulated for Cartesian coordinates, and to obtain the equivalent
1852: force for cylindrical coordinates, we multiply the Cartesian subcell
1853: force by $2 \pi r_p$.  In general, this works quite well,
1854: but sacrifices strict momentum conservation (See \S
1855: \ref{section:momcons}).
1856: 
1857: \section{Subcell Pressures: Eliminating Hourglass Grid
1858:   Distortion}
1859: \label{section:hourglass}
1860: A problem that can plague Lagrangian codes using cells with 4 or more sides is the
1861: unphysical hourglass mode \citep{caramana98a}.  To suppress this problem, we employ a modified version of the
1862: subcell pressure algorithm
1863: of \citet{caramana98a}.  For all
1864: physical modes (translation, shear, and extension/contraction) the
1865: divergences of the velocity on the subcell and cell levels are equal,
1866: \begin{equation}
1867: (\nabla \cdot {\bf v})^z_p = (\nabla \cdot {\bf v})_z \, .
1868: \end{equation}
1869: Hence, as long as the calculation is initiated such that the subcell
1870: densities of a cell are equal to the cell-averaged density, then they
1871: should remain equal at all subsequent times.  Any deviation of the
1872: subcell density from the cell density, $\delta \rho^z_p = \rho^z_p -
1873: \rho_z$, is a direct result of the hourglass mode.  The scheme of
1874: \citet{caramana98a} uses this deviation in subcell density to define a
1875: subcell pressure that is related to the deviation in subcell and cell
1876: density, $\delta \rho^z_p$, by
1877: \begin{equation}
1878: P^z_p = P_z + c^2_s \delta \rho^z_p
1879: \end{equation}
1880: with the corresponding deviation in pressure: $\delta P^z_p = c^2_s
1881: \delta \rho^z_p$.
1882: 
1883: Application of these pressures as subcell forces counteracts the hourglass distortion.
1884: However, the pressure throughout the cell is no longer uniform.  As
1885: a result, the subcell pressures exert forces on the cell centers
1886: and mid-edge points.  These locations in the grid are not subject to physical
1887: forces as are the nodes.  Instead, their movement is tied to the
1888: motions of the nodes.  To conserve momentum, the forces
1889: acting on these enslaved points must be redistributed to the dynamical
1890: nodes.  Though the choice of redistribution is not unique, we follow
1891: the  procedure established by \citet{caramana98a} for the form of the
1892: subcell force (for the definitions of $\vec{S}^z_p$ and
1893:   $\vec{a}^z_p$, see \S \ref{section:coords_mesh} and Fig. \ref{fig:grid}.):
1894: \begin{equation}
1895: \vec{f}^z_p = \delta P^z_p \vec{S}^z_p + \frac{1}{2}[
1896: (\delta P^z_p-\delta P^z_{p+1}) \vec{a}^z_p
1897: +(\delta P^z_{p-1}-\delta P^z_p) \vec{a}^z_{p-1}] \, .
1898: \end{equation}
1899: 
1900: 
1901: This particular scheme works quite well for Lagrangian
1902: calculations.  However, it can be incompatible with
1903: subcell remapping algorithms.  The hourglass suppression scheme
1904: described above assumes that only hourglass motions result in nonzero
1905: values for $\delta \rho^z_p$.  Even in calculations that are
1906: completely free of hourglass motions, the subcell remapping scheme can
1907: and will produce subcell densities within a cell that are different
1908: from the cell density.  Since this difference of subcell and cell densities
1909: has nothing to do with hourglass motions, any subcell forces that
1910: arise introduce spurious motions that don't correct the
1911: hourglass motions.
1912: 
1913: Investigating several alternative schemes, we settled on a
1914: modification of the \citet{caramana98a} approach.  After each remap, 
1915: we define a tracer density whose only purpose is to
1916: track the relative changes in the subcell and cell volumes during the
1917: subsequent hydrodynamic solve.  For
1918: convenience, and to keep the magnitude of the subcell pressures about
1919: right, we set the subcell tracer density equal to the cell density.  After
1920: replacing $\delta \rho^z_p$ with the difference between the subcell tracer
1921: density and the cell density, $\delta \rho^z_{p,tr}$, we proceed with
1922: the scheme prescribed by \citet{caramana98a}.  We have found that
1923: the subcell forces of \citet{caramana98a} significantly
1924: resist hourglass motions only after $\delta \rho^z_p$ achieves
1925: significant magnitude.  For our new hourglass scheme, if a remap is implemented
1926: after each hydrodynamic solve, $\delta \rho^z_{p,tr}$ does not
1927: have a chance to achieve large values, and hence, the
1928: subsequent subcell forces are not very resistant to hourglass
1929: distortions.  However, for many
1930: simulations, we have found that it is not necessary to remap after
1931: every Lagrangian hydrodynamic solve.  Rather, the remap may be performed after $N$
1932: timesteps.  In these circumstances, the subcell tracer density is
1933: allowed to evolve continuously as determined by the hydrodynamic
1934: equations.  With large $N$, $\delta \rho^z_{p,tr}$ does develop
1935: significant amplitude and the subcell forces become effective in
1936: suppressing the hourglass modes.  In fact, in the limit that $N \gg 1$,
1937: this scheme becomes the hourglass suppression scheme of \citet{caramana98a}.
1938: 
1939: In practice, we multiply this subcell force by a scaling factor.  To
1940: determine the appropriate magnitude of this scaling factor, we
1941: executed many test problems and found that problems that
1942: involved the perturbation of hydrostatic equilibrium provide a good
1943: test of the
1944: robustness of the hourglass fix.  During the testing protocol, we ran a simulation for at least 200,000 timesteps, ensuring that
1945: the hourglass fix remains robust for long calculations.  For
1946: Lagrangian calculations, a scaling factor $\sim 1$ produced
1947: reasonable results.  For runs in which remapping
1948: occurred after $N$ timesteps, we found that larger values of the
1949: scaling factor were required.  However, for very large values of $N$, such as 64 or
1950: greater, such large values compromised
1951: small structures in the flow.  Hence, we settled on scaling factors
1952: near 1 for large $N$.  For small $N$, we found that the difference in
1953: tracer density and the cell-centered density had little time to build
1954: to significant amplitudes, so larger values of the scaling factor are
1955: required, but anything above 4 produced noticeable problems in
1956: flows with many timesteps.  In summary, the scaling factor should be
1957: adjusted to be $\sim 1$ for large $N$ and $\sim 4$ for small $N$.
1958: 
1959: \subsection{Tests of the Hourglass Elimination Algorithm}
1960: 
1961: To demonstrate the need for an hourglass suppression scheme, and that
1962: our algorithm to address the hourglass distortions works, we show in
1963: Fig. \ref{gw_fmerit_comp} results for the Goldreich-Weber self-similar
1964: collapse in 2D (\S \ref{section:gravity_tests}), with and without the hourglass
1965: suppression (\S \ref{section:hourglass}).  These results
1966: represent a Lagrangian simulation of the self-similar collapse at $t =
1967: 118$ ms.  On the left (``$r < 0$'') the grid clearly shows problematic
1968: grid buckling when the hourglass suppression is turned off.  The grid
1969: on the right (``$r > 0$'') shows the elimination of grid buckling with
1970: the use of the hourglass suppression scheme and a scaling factor of 2.0. 
1971: 
1972: Figure \ref{rt_stills_fmerit} illustrates the problem of using the
1973: hourglass suppression scheme of \citet{caramana98a} in combination
1974: with the subcell remapping algorithm (\S \ref{section:remap}).  All
1975: three panels show the results of the single-mode Rayleigh-Taylor
1976: instability at $t = 12.75$ s.  For the left
1977: panel, no hourglass suppression is employed.  This panel
1978: represents our control.  While the hourglass instability does not cause serious
1979: problems for the calculation, one can see evidence of slight hourglass
1980: patterns at the scale of the grid resolution.  In particular, two
1981: blobs near the top and on the edges form distinct patterns.  The
1982: central panel demonstrates the problem of using the subcell remapping scheme and the
1983:   subcell pressure method of \citet{caramana98a}.  On the other hand,
1984:   the right panel demonstrates that the modified subpressure scheme we have developed
1985:   suppresses the hourglass distortions, while preserving the expected flow.
1986: 
1987: \section{Remapping}
1988: \label{section:remap}
1989: Fluid flows with large vorticity quickly tangle a Lagrangian
1990: mesh, presenting severe problems for Lagrangian
1991: hydrodynamic codes.  To avoid entangled grids, it is common to remap the state
1992: variables after each Lagrangian hydrodynamic advance to another less
1993: tangled mesh.  Even flows that exhibit very
1994: little vorticity, but extreme compression or expansion along a
1995: particular direction, leading to very skewed cells, can
1996: limit the accuracy of Lagrangian calculations.  In this case as well, one can
1997: employ a remapping scheme which is designed to minimize the
1998: calculational error.
1999: 
2000: To remap, a new grid must be established.
2001: One choice is to remap to the original
2002: grid, thereby effectively solving the hydrodynamics equations on an
2003: Eulerian mesh.  Another is to use a reference Jacobian matrix
2004: rezone strategy, which establishes a new mesh close to the
2005: Lagrangian mesh, while reducing numerical error by reducing unnecessarily
2006: skewed zones.  The arbitrary nature of the
2007: remapping algorithm even allows the freedom of choosing one
2008: rezoning scheme in one sector of the grid and another
2009: rezoning scheme in other sectors.  For example, one could remap in an
2010: Eulerian fashion in one sector, let the grid move in a
2011: Lagrangian manner in another, and in the intervening region smoothly
2012: match these two regions.
2013: 
2014: Generally, there are two options for remapping
2015: schemes.  One can remap from one arbitrary grid to another
2016: completely unrelated arbitrary grid.  For these unrelated grids, one needs to
2017: determine the overlap of the zones of the first grid with the zones
2018: of the second.  In general, this can be a very cumbersome and
2019: expensive process.  As a result most ALE codes, remap to an arbitrary grid
2020: that is not too different from the first.  Specifically, the usual
2021: stipulation employed is that the face of each cell does not traverse
2022: more than one cell during a timestep, and that the connectivity among nodes,
2023: faces, edges, and cells remains the same from the first grid to the
2024: remapped grid.  The regions swept by the faces then contain the mass,
2025: momentum, or energy which is added to the cell on one side of the face
2026: and subtracted from the cell on the other side.
2027: 
2028: It is in this context that we use the swept-region remapping
2029: algorithms of \citet{loubere05}, \citet{margolin03,margolin04}, \citet{kucharik03}, and \citet{loubere06}.  This
2030: remapping scheme may be described by four
2031: stages:
2032: \begin{enumerate}
2033: \item The first is the gathering stage.  This is a
2034:   stage in which subcell quantities of the mass, momenta, and
2035:   energies are defined in preparation for the bulk of the remapping
2036:   process.
2037: \item The second is to remap the subcell quantities from the
2038:   Lagrangian grid to the new rezoned grid using the swept-region
2039:   approximation.  In doing so, the remapping algorithm remains 2nd-order
2040:   accurate, but avoids time intensive routines to calculate the overlap
2041:   regions of the old and new grids.
2042: \item The third is to repair the subcell densities.  Because exact
2043:   spatial integration is avoided with the swept-region
2044:   approximation, local bounds of subcell densities may be violated.
2045:   Therefore, a
2046:   repair algorithm which redistributes mass, momentum, and energies to
2047:   preserve the local bounds is implemented.
2048: \item Finally, there is the
2049:   scattering stage, in which the primary variables of the hydrodynamics
2050:   algorithm are recovered for the new rezoned grid.
2051: \end{enumerate}
2052: 
2053: 
2054: \subsection{Gathering Stage}
2055: \label{section:gather}
2056: 
2057: In order to remap the primary quantities using the subcell remapping
2058: algorithm, mass, momenta, internal energy, and kinetic energy must be
2059: defined at the subcell level.  In the Lagrangian stage, the subcell mass, $m^z_p$, is already
2060: defined.  The subcell density which is a consequence of
2061: the change in the subcell volume ($V^z_p$) during the Lagrangian hydro step is
2062: \begin{equation}
2063: \rho^z_p = \frac{m^z_p}{V^z_p} \, .
2064: \end{equation}
2065: Unfortunately, there is no equivalent quantity for the subcell
2066: internal energy.  Instead, we define the internal energy density for
2067: each zone, $e_z = \varepsilon_z \rho_z$, fit a linear function for the
2068: internal energy density, $\hat{e}_z = e_z + (\vec{\nabla}e)_z \cdot
2069: (\vec{x} - \vec{x}_c)$, and integrate this function over the volume of
2070: each subcell to determine the total subcell internal energy and,
2071: consequently, the average subcell internal energy density:
2072: \begin{equation}
2073: \label{eq:gather_energy}
2074: \begin{array}{ccc}
2075: E^z_p = \int_{v^z_p} \hat{e} dV  &
2076: \mbox{and}&
2077:  e^z_p = \frac{E^z_p}{V^z_p} \, .
2078: \end{array}
2079: \end{equation}
2080: Performing the integration of eq. (\ref{eq:gather_energy}) involves a
2081: volume integral and volume integrals weighted by $x$ and $y$ in
2082: Cartesian coordinates or $r$ and $z$ in cylindrical coordinates (see appendix
2083: \ref{section:integrals} for formulae calculating these discrete integrals).
2084: Note, that, by construction, these newly defined internal energies
2085: satisfy conservation of internal energy for each zone, $m_z
2086: \varepsilon_z = \sum_{p \in S(z)} E^z_p$.
2087: 
2088: Similarly, there are no readily defined subcell-centered averages for the
2089: momenta, $\vec{\mu}^z_p$, or velocities, $\vec{u}^z_p$.  However, they
2090: should be related to one another by
2091: \begin{equation}
2092: \vec{\mu}^z_p = m^z_p \vec{u}^z_p \, .
2093: \end{equation}
2094: If the gathering stage is to preserve momentum conservation, then the
2095: following equality must hold:
2096: \begin{equation}
2097: \label{eq:momconssubcell}
2098: \sum_{p \in S(z)} m^z_p \vec{u}^z_p = \sum_{p \in S(z)} m^z_p
2099: \vec{v}_p \, .
2100: \end{equation}
2101: By inspection, it might seem natural to set $\vec{u}^z_p =
2102: \vec{v}_p$.  However, we follow the more accurate suggestion made by
2103: \citet{loubere05} to define the subcell-averaged velocity as follows:
2104: \begin{equation}
2105: \label{eq:subcellvel}
2106: \vec{u}^p_z = \frac{ 
2107: \vec{u}_z + \vec{v}_p + \vec{v}_{p+1/2} + \vec{v}_{p-1/2}}{4} \, ,
2108: \end{equation}
2109: where $\vec{u}_z$ is obtained by averaging over all nodal velocities associated
2110: with zone $z$, and $\vec{v}_{p+1/2}$ and $\vec{v}_{p-1/2}$ are edge-averaged velocities given by $\vec{v}_{p+1/2} = 1/2 \left (
2111:   \vec{v}_p + \vec{v}_{p+1} \right )$ and $\vec{v}_{p-1/2} = 1/2 \left
2112:   ( \vec{v}_p + \vec{v}_{p-1} \right )$.
2113: %\begin{equation}
2114: %\sum_{p \in S(z)} m^z_p \left (\frac{ 
2115: %\vec{u}_z + \vec{v}_p + \vec{v}_{p+1/2} + \vec{v}_{p-1/2}}{4}
2116: %\right )
2117: %= \sum_{p \in S(z)} m^z_p \vec{v}_p
2118: %\end{equation}
2119: Substituting eq. (\ref{eq:subcellvel}) into
2120: eq. (\ref{eq:momconssubcell}) and rearranging terms, we get an
2121: expression for the subcell velocity that depends on known subcell masses
2122: and nodal velocities:
2123: \begin{multline}
2124: \label{eq:vsubcellexplicit1}
2125: \vec{u}^p_z = \frac{1}{4} \left (
2126: 2\vec{v}_p + \frac{\vec{v}_{p+1}}{2} + \frac{\vec{v}_{p-1}}{2}
2127: \right ) \\
2128: + \sum_{p' \in S(z)} \frac{m^z_{p'}}{8 m_z} (4\vec{v}_{p'} -
2129: \vec{v}_{p'+1} - \vec{v}_{p'-1}) \, .
2130: \end{multline}
2131: %\begin{equation}
2132: %\label{eq:vsubcellexplicit1}
2133: %\vec{u}^p_z = \frac{1}{4} \left (
2134: %2\vec{v}_p + \frac{\vec{v}_{p+1}}{2} + \frac{\vec{v}_{p-1}}{2}
2135: %\right ) +
2136: %\sum_{p' \in S(z)} \frac{m^z_{p'}}{8 m_z} (4\vec{v}_{p'} -
2137: %\vec{v}_{p'+1} - \vec{v}_{p'-1}) \, .
2138: %\end{equation}
2139: We now rewrite
2140: eq. (\ref{eq:vsubcellexplicit1}) in a form that obviously makes it
2141: easy to write the
2142: gathering operation in matrix form:
2143: \begin{multline}
2144: \label{eq:vsubcellexplicit}
2145: \vec{u}^p_z = \frac{1}{4} \left (
2146: 2\vec{v}_p + \frac{\vec{v}_{p+1}}{2} + \frac{\vec{v}_{p-1}}{2}
2147: \right ) \\
2148: + \sum_{p' \in S(z)} \vec{v}_{p'} \left (
2149: \frac{-m^z_{p'-1} + 4 m^z_{p'} - m^z_{p'+1}}{8 m_z}
2150: \right ) \, .
2151: \end{multline}
2152: %\begin{equation}
2153: %\label{eq:vsubcellexplicit}
2154: %\vec{u}^p_z = \frac{1}{4} \left (
2155: %2\vec{v}_p + \frac{\vec{v}_{p+1}}{2} + \frac{\vec{v}_{p-1}}{2}
2156: %\right ) +
2157: %\sum_{p' \in S(z)} \vec{v}_{p'} \left (
2158: %\frac{-m^z_{p'-1} + 4 m^z_{p'} - m^z_{p'+1}}{8 m_z}
2159: %\right ) \, .
2160: %\end{equation}
2161: If ${\bf U}_z$ is a vector of one component of all
2162: velocities associated with cell $z$, and ${\bf U}^{SC}_z$ is the
2163: equivalent for subcell velocities, then
2164: \begin{equation}
2165: {\bf U}^{SC}_z = {\bf M}_z {\bf U}_z \, ,
2166: \end{equation}
2167: where the matrix, ${\bf M}_z$, for each zone is given by the
2168: coefficients in eq. (\ref{eq:vsubcellexplicit}).
2169: 
2170: To conserve total energy in the remap stage, we define the subcell
2171: kinetic energy and follow the same gather procedure
2172: as for the velocity by simply replacing
2173: velocity with the specific kinetic energy:
2174: \begin{equation}
2175: k_p = \frac{|\vec{v}|^2}{2} \, .
2176: \end{equation}
2177: We
2178: ensure conservation of total kinetic energy for a cell:
2179: \begin{equation}
2180: \sum_{p \in S(z)} m^z_p k^z_p = \sum_{p \in S(z)} m^z_p k_p = K_z \, ,
2181: \end{equation}
2182: where $k^z_p$ is the subcell-averaged specific kinetic energy.
2183: Then, the transformation from nodal specific
2184: kinetic energies to subcell-averaged specific kinetic energies is
2185: given by
2186: \begin{equation}
2187: {\bf k}^{SC}_z = {\bf M}_z {\bf k}_z \, ,
2188: \end{equation}
2189: where ${\bf k}^{SC}_z$ is a vector of the subcell-averaged specific
2190: kinetic energies, ${\bf k}_z$ is a vector of the nodal specific
2191: kinetic energies, and ${\bf M}_z$ is the same transformation matrix
2192: used for the velocity transformations.  Having found the specific
2193: kinetic energies, the calculation of the kinetic
2194: energy for each subcell is then straightforward: $K^z_p =
2195: m^z_p k^z_p$.
2196: 
2197: Upon completion of the gathering stage, each relevant quantity, $m^z_p$, $\vec{\mu}^z_p$, $E^z_p$, and $K^z_p$, is
2198: expressed as a fundamentally conserved quantity for each subcell.  From these conserved
2199: quantities and the subcell volumes, we have the corresponding
2200: densities, which, as is explained in \S \ref{section:swept}, are
2201: important components of the remapping process.
2202: 
2203: \subsection{Swept-edge Remap}
2204: \label{section:swept}
2205: 
2206: Having gathered all relevant subcell quantities, we begin
2207: the bulk of the remapping process.  Since all variables are now expressed in terms of
2208: a conserved quantity (subcell mass, energy, and momentum) and
2209: a density (mass density, energy density, and momentum density), for clarity of exposition, we focus on representative variables, subcell mass and density, to explain
2210: the generic remapping algorithm.  When there are differences in the algorithm for the other
2211: variables, we note them.
2212: 
2213: We have instituted the remapping algorithm of \citet{kucharik03}.  To avoid the
2214: expensive process of finding the overlap of the Lagrangian grid with
2215: the rezoned grid, this algorithm modifies the mass of each subcell
2216: with a swept-edge approximation for the rezoning process.  As
2217: long as the connectivity and neighborhood for each cell remain the
2218: same throughout the calculation, time spent in connectivity overhead
2219: is greatly reduced.  The objective of the remapping algorithm is then to
2220: find the amount of mass, $\delta m_e$, that each edge effectively sweeps up due to the rezoning
2221: process and to add or subtract this change
2222: in mass to the old subcell mass to obtain the new subcell mass, $\tilde{m}^z_p$:
2223: \begin{equation}
2224: \label{eq:swept_eq1}
2225: \tilde{m}^z_p = m^z_p + \sum_{e \in S(z)} \delta m_e \, .
2226: \end{equation}
2227: Of course, the change in mass is obtained by integration of a density
2228: function over the volume of the swept region:
2229: \begin{equation}
2230: \label{eq:swept_eq2}
2231: \delta m_e = \int_{\delta e} \hat{\rho} dV \, .
2232: \end{equation}
2233: The density function, $\hat{\rho}(x,y)$, may take on any functional
2234: form.  To maintain second-order accuracy of the algorithm we use a linear density function;
2235: \begin{equation}
2236: \hat{\rho} = \rho^p_z + (\vec{\nabla}\rho)^p_z \cdot (\vec{x} - \vec{x}^p_z) \, ,
2237: \end{equation}
2238: where $\vec{x}^p_z$ is the average of the nodal positions defining the subcell.
2239: 
2240: In determining the gradient, $(\vec{\nabla}\rho)^p_z$, we employ one of
2241: two standard methods for calculating the gradient using the densities
2242: from subcell $\{z,p\}$ and its neighbors.
2243: The first method uses Green's theorem to rewrite a bounded volume integral as a
2244: boundary integral around the same volume.  We begin
2245: with a definition of the average gradient of $\rho$ for a given
2246: region.  For each component, the
2247: average gradient is
2248: \begin{equation}
2249: \begin{array}{ccccc}
2250: \left < \frac{\partial \rho}{\partial x} \right > &
2251: = &
2252: \frac{1}{V}\int_{V} \rho_x dV &
2253: = &
2254: \frac{1}{V}\oint_{\partial V} \rho dy\\
2255: \left < \frac{\partial \rho}{\partial y} \right >&
2256: = &
2257: \frac{1}{V}\int_{V} \rho_y dV &
2258: = &
2259: -\frac{1}{V}\oint_{\partial V} \rho dx \, , \\
2260: \end{array}
2261: \end{equation}
2262: where $\rho_x$ and $\rho_y$ are the gradients in the x- and y-directions, respectively.
2263: The region over which the integrals are evaluated is defined by
2264: segments connecting the centers of the neighboring subcells.  Hence, 
2265: the discrete form of the average gradient is
2266: \begin{equation}
2267: \begin{array}{rcl}
2268: \left < \frac{\partial \rho}{\partial x} \right >^p_z&
2269:  = &
2270: \frac{1}{V}\sum_e \frac{\rho_1 + \rho_2}{2} \Delta y_{12}\\
2271: \left < \frac{\partial \rho}{\partial y} \right >^p_z&
2272:  = &
2273: -\frac{1}{V}\sum_e \frac{\rho_1 + \rho_2}{2} \Delta x_{12} \, .\\
2274: \end{array}
2275: \end{equation}
2276: While this method works reasonably well, an unfortunate consequence
2277: of the integration and division by volume is that the value of the gradient is
2278: directly influenced by the shape and size of the cell.
2279: 
2280: An alternative method for determining gradients, which is not as easily influenced by the shape
2281: of the mesh, is a least-squares procedure.  For simplicity of notation,
2282: we describe this method in the context of cells
2283: rather than subcells.  Again, assuming a linear
2284: form for $\hat{\rho}_z(x,y)$, we seek to minimize the difference between
2285: $\rho_c$ and $\hat{\rho}_z(x_c,y_c)$, where $\rho_c$ is the neighbor's
2286: value and $\hat{\rho}_z(x_c,y_c)$ is the extrapolation of cell $z$'s
2287: linear function to the position of the neighbor, $(x_c,y_c)$.
2288: More explicitly, we wish to minimize the following equation:
2289: \begin{equation}
2290: \label{eq:least_eq1}
2291: \sum_{c \in \mathcal{N}(z)} \omega^2_{cz} E^2_{zc} \, ,
2292: \end{equation}
2293: where the set of neighbors for cell $z$ is denoted by $c \in \mathcal{N}(z)$,
2294: \begin{equation}
2295: \label{eq:least_eq2}
2296: E^2_{zc} = \left (
2297: -\Delta \rho_{cz} + \rho_{x,z} \Delta x_{cz} + \rho_{y,z} \Delta y_{cz}
2298: \right )^2 \, ,
2299: \end{equation}
2300: $\rho_{x,z}$ and $\rho_{y,z}$ are the $x$ and $y$ components of the
2301: gradient, $\Delta \rho_{cz} = \rho_c - \rho_z$, $\Delta x_{cz} = x_c - x_z$, $\Delta
2302: y_{cz} = y_c - y_z$, and $\omega_{cz}^2 = 1/(\Delta x_{cz}^2 + \Delta y_{cz}^2)$.
2303: Minimizing eq. (\ref{eq:least_eq1}) with respect to the two unknowns, leads to the
2304: following set of linear equations:
2305: \begin{equation}
2306: \begin{array}{rcl}
2307: a \rho_x + b \rho_y & = & d\\
2308: b \rho_x + c \rho_y & = & e \, ,\\
2309: \end{array}
2310: \end{equation}
2311: for each subcell, where
2312: \begin{equation}
2313: \begin{array}{rcl}
2314: a & = & \sum_{c \in \mathcal{N}(z)} \omega^2_{cz} \Delta x^2_{cz}\\
2315: b & = & \sum_{c \in \mathcal{N}(z)} \omega^2_{cz} \Delta x_{cz} \Delta y_{cz}\\
2316: c & = & \sum_{c \in \mathcal{N}(z)} \omega^2_{cz} \Delta y^2_{cz}\\
2317: d & = & \sum_{c \in \mathcal{N}(z)} \omega^2_{cz} \Delta \rho_{cz} \Delta x_{cz}\\
2318: e & = & \sum_{c \in \mathcal{N}(z)} \omega^2_{cz} \Delta \rho_{cz} \Delta
2319: y_{cz} \, .\\
2320: \end{array}
2321: \end{equation}
2322: Solving this linear system with Cramer's rule then gives the least-squares gradients.
2323: 
2324: After calculating the gradient
2325: we ensure monotonicity using the Barth-Jespersen limiter
2326: \citep{barth97}.  The gradient is limited by a scalar, $\Phi_z$, that
2327: has a range between 0 and 1:
2328: \begin{equation}
2329: \hat{\rho}_z(x,y) = \rho_z + \Phi_z (\vec{\nabla}\rho)_z \cdot (\vec{x} - \vec{x}_z) \, .
2330: \end{equation}
2331: First, we determine the minimum and maximum value of $\rho$ among $\rho_z$ and
2332: its neighbors $\rho_c$:
2333: \begin{equation}
2334: \rho^{\rm min}_z = \min (\rho_z,\rho_c)
2335: \end{equation}
2336: \begin{equation}
2337: \rho^{\rm max}_z = \max (\rho_z,\rho_c) \, .
2338: \end{equation}
2339: We satisfy the requirement that
2340: \begin{equation}
2341: \rho^{\rm min}_z \leq \hat{\rho}(x,y) \leq \rho^{\rm max}_z \, .
2342: \end{equation}
2343: This is accomplished in the following way.
2344: \begin{equation}
2345: \Phi_z = \min ( \Phi^n_z) \, ,
2346: \end{equation}
2347: where $\Phi^n_z$ is a limiter associated with each node of the cell
2348: and is given by
2349: \begin{equation}
2350: \Phi^n_z =
2351: \left \{
2352: \begin{array}{lcr}
2353: \min \left ( 1,\frac{\rho^{\rm max}_z - \rho_z}{ \hat{\rho}(x_n,y_n) - \rho_z} \right ) & \mbox{for} &
2354: \hat{\rho}(x_n,y_n) - \rho_z > 0 \\
2355: \min \left ( 1,\frac{\rho^{\rm min}_z - \rho_z}{ \hat{\rho}(x_n,y_n) - \rho_z} \right ) & \mbox{for} &
2356: \hat{\rho}(x_n,y_n) - \rho_z < 0 \\
2357: 1 & \mbox{for} & \hat{\rho}(x_n,y_n) - \rho_z = 0 \, , \\
2358: \end{array}
2359: \right .
2360: \end{equation}
2361: where $\hat{\rho}(x_n,y_n)$ is the unlimited linear function evaluated at the nodes.
2362: 
2363: 
2364: With the linear function $\hat{\rho}$ defined for each subcell, we
2365: return to the task of determining the swept mass, $\delta m_e$.  The specific linear function $\hat{\rho}$ for density
2366: used in eq. (\ref{eq:swept_eq2}) depends upon which subcell the edge encroaches upon.  In fact,
2367: it is quite possible that the volume swept by the edge intersects more
2368: than one immediate neighbor of the subcell in question.  Of course, an
2369: accurate swept-edge integration scheme would take into account all
2370: spatial functions in the relevant subcells.  \citet{kucharik03}, and
2371: references therein, have noted that such an accurate scheme may be
2372: cumbersome and computational expensive.  Instead, they suggest an
2373: approximate swept region integration in which only the subcells to the
2374: left and right of the oriented edge need matter in determining the
2375: spatial function of density used for integration.  To this
2376: end, an oriented volume integral is defined:
2377: \begin{equation}
2378: \delta V_e = \oint xdy \, .
2379: \end{equation}
2380: Whether this volume integral is negative or positive, the density
2381: function is taken from either the left or right subcell:
2382: \begin{equation}
2383: \hat{\rho} = \left \{
2384: \begin{array}{lr}
2385: \hat{\rho}_r, & \delta V_e \geq 0 \, ,\\
2386: \hat{\rho}_l, & \delta V_e < 0
2387: \end{array}
2388: \right .
2389: \end{equation}
2390: 
2391: \subsection{Repair}
2392: 
2393: While the above scheme is second-order accurate and mass conserving, the
2394: approximations made in the swept-edge algorithm can violate local
2395: bounds.  In practice, the values of the remapped densities should be
2396: bounded by the neighborhood values of the original grid.
2397: Computationally expensive schemes that
2398: find the overlap regions among the old and new grid can be made to preserve the
2399: bounds.  However,
2400: the local bounds can be violated in swept-edge remapping.  Using the
2401: linearity-and-bound-preserving method of \citet{kucharik03}, we conservatively repair quantities by redistributing mass,
2402: energy, momenta, and number to neighbors satisfying the local bounds
2403: of the quantities on the previous Lagrangian grid.  However, the order
2404: in which one processes the cells and subcells influences the specific
2405: values that emerge from the repair process.  Therefore, we employ the order
2406: independent scheme of \citet{loubere06}.  These repair
2407: schemes are designed to repair subcell densities.  For velocities and
2408: composition we wish to preserve the bounds of $\vec{v}$ and $X_i$.
2409: Therefore, we have appropriately adjusted the scheme to conservatively
2410: repair momenta and particle number by preserving the local
2411: bounds of $\vec{v}$ and $X_i$, respectively.
2412: 
2413: \subsection{Scattering}
2414: \label{section:scatter}
2415: The final remap step is to recover the primary variables for the
2416: next hydrodynamic step.
2417: The new cell-centered and node-centered masses are
2418: \begin{equation}
2419: \tilde{m}_z = \sum_{p \in S(z)} \tilde{m}^z_p
2420: \end{equation}
2421: and
2422: \begin{equation}
2423: \tilde{m}_p = \sum_{z \in S(p)} \tilde{m}^p_z \, ,
2424: \end{equation}
2425: respectively. Consequently, the subcell and cell-averaged densities are
2426: \begin{equation}
2427: \tilde{\rho}^z_p = \frac{\tilde{m}^z_p}{\tilde{V}^z_p}
2428: \end{equation}
2429: and
2430: \begin{equation}
2431: \tilde{\rho}_z = \frac{\tilde{m}_z}{\tilde{V}_z} \, ,
2432: \end{equation}
2433: respectively.
2434: 
2435: Recovering the velocities at the nodes is slightly more involved.
2436: First, the new subcell-averaged velocity is defined using the remapped
2437: momenta and masses:
2438: \begin{equation}
2439: \tilde{v}^z_p = \frac{\tilde{\mu}^z_p}{\tilde{m}^z_p}
2440: \end{equation}
2441: Then, for each cell we invert the matrix equation that transforms node
2442: velocities into subcell velocities:
2443: \begin{equation}
2444: \label{eq:vmatrix}
2445: \tilde{\bf U}_z = \tilde{\bf M}^{-1}_z \tilde{\bf U}^{SC}_z \, .
2446: \end{equation}
2447: In this scheme, each cell provides its own velocity for a node, which may
2448: be different from another cell's value for the same node.  Therefore, for
2449: each node velocity, we average node velocities resulting from the
2450: inversion of eq. (\ref{eq:vmatrix}):
2451: \begin{equation}
2452: \tilde{v}_p = \frac{1}{\tilde{m}_p} \sum_{z \in S(p)} \tilde{m}^z_p 
2453: \tilde{v}_p(z) \, .
2454: \end{equation}
2455: 
2456: Finally, we recover the specific internal energy.  Comparing the sum of the old internal energy and
2457: kinetic energy with the sum of remapped internal energy and a kinetic
2458: energy defined by the remapped node velocities will not necessarily
2459: ensure conservation of total energy.  Therefore, the old
2460: kinetic energy is remapped along with the node velocities.  The
2461: discrepancy between these two kinetic energy representations is then
2462: added to the internal energy, ensuring conservation of total energy
2463: during the remap stage:
2464: \begin{equation}
2465: \label{eq:remap_conserve_ene}
2466: \tilde{\mathcal{E}}_z = \sum_{p \in S(z)} \tilde{\mathcal{E}}^z_p
2467: + \left [
2468: \left ( \sum_{p \in S(z)} \tilde{K}^z_p \right )
2469: - \left ( \sum_{p \in S(z)} \tilde{m}^z_p \frac{|\tilde{v}_p|^2}{2} \right )
2470: \right ] \, .
2471: \end{equation}
2472: The new cell-centered specific internal energy is then obtained using
2473: the modified internal energy, $\tilde{\mathcal{E}}_z$, and the
2474: remapped mass, $\tilde{m}_z$: 
2475: \begin{equation}
2476: \tilde{\varepsilon}_z = \frac{\tilde{\mathcal{E}}_z}{\tilde{m}_z} \, .
2477: \end{equation}
2478: 
2479: This ensures conservation of total energy at the expense of consistent
2480: remapping of internal energy.  Whichever is desirable depends upon the
2481: problem.  For example, in flows with large kinetic energies and small
2482: internal energies, the discrepancy in kinetic energy remapping could
2483: substantially alter or even dominate the internal energy.
2484: Consequently, we include a flag in BETHE-hydro that determines whether
2485: the remapped kinetic energy differences are added to the internal energy.
2486: 
2487: \subsection{Remapping Tests}
2488: \label{section:remap_test}
2489: 
2490: Figure \ref{rhoremap_step} demonstrates the basic effectiveness of the remapping
2491: algorithm.  We remap a 1D step function in density many times.  From
2492: $x=0$ to $x=1/2$ cm, the density is $\rho = 2.5$ g cm$^{-3}$, and from $x =
2493: 1/2$ to $x = 1$ cm, the density is $\rho = 1.5$ g cm$^{-3}$.  This test has 50 cells
2494: and $N_{nodes} = 51$ nodes.  Indexing each node by $i$, the positions of
2495: the nodes are
2496: \begin{equation}
2497: x_i = (1 - \alpha)  \left ( \frac{i-1}{N_{nodes}-1} \right ) + \alpha \left ( \frac{i-1}{N_{nodes}-1} \right )^2 \, ,
2498: \end{equation}
2499: where
2500: \begin{equation}
2501: \alpha = \frac{1}{4}\sin \left (4 \pi \frac{n}{n_{max}} \right ) 
2502: \end{equation}
2503: and the remapping
2504: step is $n$.  As a result, the grid completes two full cycles in this
2505: remapping test.  Figure \ref{rhoremap_step} shows the result of this
2506: remapping test where $n_{max} = 800$.  The top panel displays the density profile for remapping
2507: steps 0 to $n_{max}/2$, while the bottom panel shows the profile for
2508: steps $n_{max}/2$ to $n_{max}$.  Comparison of the first half (top
2509: panel) with the
2510: second half (bottom panel) indicates that the remapping process diffuses the
2511: discontinuity over a small number ($\sim$4) of zones initially, and
2512: ``diffusion'' slows substantially after the initial phase, maintaining
2513: a somewhat consistent width in the discontinuity.
2514: 
2515: \subsection{Composition Remap}
2516: \label{section:composition_remap}
2517: Barring any nuclear or chemical transformations, the composition
2518: equation, eq. (\ref{eq:advec}), states that $X_i$ is conserved.
2519: The Lagrangian hydro portion of our
2520: algorithm will not change a cell's composition.  All alterations in
2521: composition are, therefore, a result of advection, and in an ALE code
2522: advection is handled by the remapping algorithm.
2523: 
2524: Equation (\ref{eq:advec}) may be written in Eulerian form:
2525: \begin{equation}
2526: \label{eq:advec_eulerian}
2527: \frac{\partial (\rho X_i)}{\partial t} + \vec{\nabla} \cdot (\rho X_i
2528: \vec{v}) = 0 \, ,
2529: \end{equation}
2530: which implies a close dependence of the
2531: advection of $X_i$ on $\rho$ and $\vec{v}$.  In practice, if the
2532: composition is not advected in a manner entirely consistent with the
2533: advection of mass, then the advection of composition will develop
2534:  peculiarities.  Since the remapping of density is truly a
2535: remapping of the subcell masses, we have designed a scheme for the
2536: remapping of composition which operates on an equivalent subcell quantity.
2537: 
2538: Specifically, we define new Lagrangian quantities for
2539: composition.   They are the number of species $i$ in the cell,
2540: $N_{i,z}$, and the number of species $i$ in the subcell, $N^z_{i,p}$.
2541: Analogous to the mass density is the number density, $n_{i,z}$ and
2542: $n^z_{i,p}$.  These new quantities are related to the previously defined
2543: quantities by: $n_i = \rho X_i$ and $N_i = n_i V$ or $N_i = m X_i$.
2544: 
2545: The remap (or advection) of composition follows the scheme
2546: outlined for the advection of mass on the subcell level, with $n_i$
2547: replacing $\rho$ and $N_i$ replacing mass.  The new compositions are
2548: then determined by $\tilde{X}_{i,z} = \tilde{N}_{i,z}/\tilde{m_z}$.
2549: The final minor, but crucial, difference between mass and composition
2550: remapping occurs during the repair process.  While the repair process
2551: maintains the bounds on the number density, we also enforce bound
2552: preservation of the compositions.
2553: 
2554: While we do not address specific rate equations in this work,
2555: transport and nuclear processes will require consideration of nonzero
2556: terms on the RHS of eqs. (\ref{eq:advec}) and
2557: (\ref{eq:advec_eulerian}).  Since our division of composition into
2558: subcell compositions has consequences for discrete implementations with
2559: rates, we include here some discussion.
2560: 
2561: Normally, the discrete form of eq. (\ref{eq:advec}) with a nonzero
2562: RHS would be designed to operate at the cell
2563: level.  In other words, it would involve $N_{z,i}$ and $n_{z,i}$.
2564: However, the fundamental Lagrangian subunit is the subcell.
2565: Therefore, we have developed an algorithm to handle the composition
2566: changes, $\Delta X_i$, at the subcell level due to changes at the cell level.
2567: 
2568: Irrespective of the scheme employed, a condition which must be
2569: satisfied is that
2570: \begin{equation}
2571: \sum_z \Delta N_{z,i} = \sum_z \sum_{p \in S(z)} \Delta N^z_{p,i} \, .
2572: \end{equation}
2573: We'd like to convert the statement of number conservation into the more useful relationship:
2574: \begin{equation}
2575: \label{eq:deltancell}
2576: \Delta N_{z,i} = \sum_{p \in S(z)} \Delta N^z_{p,i} \, .
2577: \end{equation}
2578: When the change in composition due to the rates
2579: is applied in operator-split form to the discrete hydro
2580: equations, we have the following relations:
2581: \begin{equation}
2582: \label{eq:deltaxcriterion1}
2583: \Delta N_{i,z} = \Delta X_{i,z} m_z \, ,
2584: \end{equation}
2585: and
2586: \begin{equation}
2587: \Delta N^z_{i,p} = \Delta X^z_{i,p} m^z_p \, .
2588: \end{equation}
2589: Our dilemma is that the rate equations will determine $\Delta X_{z,i}$,
2590: but they put no constraint on $\Delta X^z_{p,i}$.  A fairly natural and
2591: simple choice is $\Delta X^z_{p,i} = \Delta X_{z,i}$, giving 
2592: \begin{equation}
2593: \label{eq:deltansubcell}
2594: \Delta N^z_{p,i} = \Delta X_{z,i} m^z_p \, .
2595: \end{equation}
2596: Substituting eq. (\ref{eq:deltansubcell}) into
2597: eq. (\ref{eq:deltancell}) we have
2598: \begin{equation}
2599: \Delta N_{z,i} = \sum_{p \in S(z)} \Delta X_{z,i} m^z_p = \Delta
2600: X_{z,i} \sum_{p \in S(z)}
2601: m^z_p = \Delta X_{z,i} m_z \, .
2602: \end{equation}
2603: Hence, by simply stating that $\Delta X^z_{p,i} = \Delta X_{z,i}$, we
2604: have developed discrete rate equations that satisfy conservation of
2605: species number and operates at the subcell level.
2606: 
2607: \subsection{Angular Velocity Remap}
2608: \label{section:ang_vel_remap}
2609: 
2610: The remap of the angular momentum deserves special mention.  As in mass remapping, we try
2611: to find 
2612: new subcell
2613: angular momenta, $\tilde{J^z_p}$, based upon an approximate swept-region
2614: approach.  In other words,
2615: \begin{equation}
2616: \tilde{J^z_p} = J^z_p + \sum_{e \in S(z)} \delta J_e \, ,
2617: \end{equation}
2618: which parallels eq. (\ref{eq:swept_eq1}) in form.  A notable
2619: difference, however, is the expression for the swept angular momentum.
2620: It no longer involves a simple volume integral, but an integral
2621: weighted by $r^2$ (see appendix
2622: \ref{section:integrals} for calculating the discrete analog of this integral):
2623: \begin{equation}
2624: \delta J_e = \omega \rho \int r^2 dV \, .
2625: \end{equation}
2626: After finding the new subcell angular
2627: momentum we determine the new cell angular momentum,
2628: \begin{equation}
2629: \tilde{J_z} = \sum_{p \in S(z)} \tilde{J^p_z} \, ,
2630: \end{equation}
2631: and node angular momentum,
2632: \begin{equation}
2633: \tilde{J_p} = \sum_{z \in S(p)} \tilde{J^p_z} \, ,
2634: \end{equation}
2635: and in turn determine the new angular velocity;
2636: \begin{equation}
2637: \tilde{\omega}_p = \frac{\tilde{J_p}}{\tilde{\mathcal{I}_p}} \, .
2638: \end{equation}
2639: 
2640: 
2641: 
2642: \section{Code Tests}
2643: \label{section:tests}
2644: 
2645: In this section, we characterize BETHE-hydro's 
2646: performance using several test problems.  First, we demonstrate that
2647: this code produces 2$^{nd}$-order accurate solutions for
2648: self-gravitating flows. To assess the accuracy of high Mach-number simulations, we use the Sod shock tube problem, Sedov blast
2649: wave, and Noh implosion problem, which all have analytic solutions.
2650: Furthermore, we simulate the Saltzman and
2651: Dukowicz piston problems to test the code's ability to simulate piston-driven shocks using oblique meshes.  In simulating two important
2652: hydrodynamic instabilities, the Rayleigh-Taylor and Kelvin-Helmholtz
2653: instabilities, we further demonstrate this
2654: code's strengths and limitations.  Demonstrating BETHE-hydro's ability to simulate
2655: astrophysical phenomena, we conclude with a core-collapse supernova simulation.
2656: 
2657: \subsection{2$^{\rm nd}$-Order Accuracy}
2658: \label{section:2ndorder}
2659: 
2660: To verify the 2$^{\rm nd}$-order character of BETHE-hydro, a smooth
2661: hydrodynamics flow is required.  The
2662: Goldreich-Weber self-similar collapse
2663: (see \S \ref{section:gravity_tests} and Fig. \ref{gwplot}) satisfies this requirement and is
2664: ideal to check convergence of the hydrodynamic and gravity solvers and
2665: their coupling.  We use $L^1$-norms of the error:
2666: \begin{equation}
2667: \label{eq:l1norm}
2668: L^1 = \sum |e_z \Delta r^d| \, ,
2669: \end{equation}
2670: where the error is $e_z = \rho_{\rm ana}(\vec{x_z}) -\rho_z$,
2671: $\rho_{\rm ana}$ is the analytic density at $t=130$ ms, $\Delta
2672: r$ is the zone size, and $d$ is 1 for 1D and 2 for 2D.  Strictly
2673: speaking, the simulations are Lagrangian and have time-varying zone sizes.
2674: Fortunately, this collapse problem is self-similar, implying a direct
2675: correlation between the starting resolution and the resolution at a
2676: later time.  Therefore, we use the initial zone size in eq. (\ref{eq:l1norm})
2677: and in Fig. \ref{gw_resstudy}.  The $L^1$-norm as a function of
2678: $\Delta r$ (crosses) is plotted in Fig. \ref{gw_resstudy}.  As the
2679: figure demonstrates, both 1D simulations (top panel) and 2D simulations (bottom panel)
2680: converge with roughly 2$^{\rm nd}$-order accuracy.
2681: 
2682: \subsection{Sod Shock Tube Problem}
2683: \label{section:sod}
2684: 
2685: The Sod shock tube problem is a standard analytic test that assesses the code's
2686: ability to simulate three characteristic waves:  a shock, a
2687: rarefaction wave, and a contact discontinuity.
2688: A simple gamma-law EOS is employed with $\gamma =
2689: 1.4$.  Initially, the computational domain is divided into left and
2690: right static
2691: regions with different densities and pressures.
2692: Specifically, the left and right regions have densities of 1.0 g
2693: cm$^{-3}$ and $0.125$ g cm$^{-3}$ and pressures of 1.0 erg cm$^{-3}$ and
2694: 0.1 erg cm$^{-3}$, respectively.  This gives rise to a self-similar
2695: solution involving a shock propagating to the right, a rarefaction
2696: wave propagating to the left, and a contact discontinuity in between.
2697: 
2698: 
2699: In Fig. \ref{sodplot}, we display the Sod shock tube test results for 1D Lagrangian, 1D
2700: Eulerian, 2D Lagrangian, and 2D Eulerian configurations.
2701: Cell-centered densities and locations are marked with plus signs, while
2702: the analytic results are denoted by solid dark lines.  The 1D Lagrangian
2703: result shows the appropriate density profile, while the other profiles
2704: have been shifted vertically so that distinguishing features are more
2705: easily compared.  In addition, the profiles are
2706: further distinguished by displaying them at different times: 1D Lagrangian
2707: ($t = 0.2$ s), 1D Eulerian ($t = 0.225$ s), 2D Lagrangian ($t = 0.25$
2708: s), and 2D Eulerian ($t = 0.275$ s).  The 1D calculations are resolved
2709: with 400 zones. Similarly, the 2D tests are resolved along the
2710: direction of shock propagation with 400 zones, and they are resolved
2711: in the perpendicular direction by 10 zones.
2712: 
2713: The overall features of the shock, post-shock material, contact
2714: discontinuity, and rarefaction wave are reproduced. For all scenarios,
2715: the shock is resolved within a few zones.  For the 1D Eulerian and Lagrangian
2716: calculations the post-shock density is good to $\sim 0.05$\% and $\sim
2717: 0.01$\%, respectively.  Upon viewing the
2718: profiles in greater detail, there is a
2719: noticeable departure from the analytic solution at the tail of the
2720: rarefaction wave where the density dips below the expected value.
2721: This error in density at the tail of the rarefaction wave is $\sim 2.5$\% for the
2722: Lagrangian simulation and $\sim 1$\% for the Eulerian simulation.  Since the
2723: contact discontinuity moves with the flow speed, both Lagrangian
2724: calculations resolve the contact discontinuity exactly from one zone to the next and
2725: maintain this resolution throughout the simulation.  The Eulerian
2726: calculations, not surprisingly, distribute the contact discontinuity
2727: over several ($\sim$4) zones.
2728: 
2729: \subsection{Sedov Blast Wave}
2730: \label{section:sedov}
2731: 
2732: A classic test, the Sedov blast wave problem provides a quantitative
2733: measure of a code's ability to simulate spherical explosions.
2734: Initial conditions are 
2735: set so that the total energy of the Sedov blast is 0.244816 ergs,
2736: $\rho_0 = 1.0$ g cm$^{-3}$, $\varepsilon_0 = 1 \times 10^{-20}$ ergs
2737: g$^{-1}$, and the gamma-law EOS has $\gamma = 5/3$.  
2738: We compare the simulations with the analytic result (solid lines) for the following
2739: scenarios: 1D Lagrangian, 1D Eulerian, 2D Lagrangian using the butterfly
2740: mesh, and 2D Lagrangian using the spiderweb mesh.
2741: 
2742: Results of the Sedov explosion are plotted in Fig. \ref{sedovplot}.
2743: The top panel compares the analytic and numerical density profiles, while
2744: the bottom panel shows the relative differences between the numerical
2745: solutions and the analytic profile.
2746: To easily
2747: distinguish different runs and details, we plot the 1D Lagrangian calculation
2748: at $t = 0.4$ s, the 1D Eulerian at $t = 0.53$ s, the 2D Lagrangian using the
2749: butterfly mesh at $t = 0.66$ s, and the 2D Lagrangian using the spiderweb
2750: mesh at $t = 0.80$ s.  The 1D calculations are resolved with 400
2751: zones. The spiderweb test has a total of 12,381 zones with 200 radial
2752: zones and a maximum of 64 angular zones, while the butterfly mesh has a
2753: total of 35,000 zones with effectively 200 radial
2754: and 200 angular zones.
2755: Qualitatively, all simulations reproduce the overall structure and
2756: position of the shock and post-shock flows.
2757: 
2758: There are some practical issues about formulating the Sedov runs that are worth
2759: mentioning.  For the 1D simulations, we found that simply placing the
2760: initial explosion energy in a small number of inner zones was
2761: adequate.  On the other hand, the 2D simulations using
2762: non-spherical grids required more care.  Simply depositing all the
2763: energy within a small number of zones near the center led to severe
2764: grid tangling and distortions.  We
2765: remedied this by initiating all profiles with the analytic solution at
2766: $t = 0.001$ s.
2767: 
2768: The bottom panel of Fig. \ref{sedovplot} emphasizes the quantitative accuracy of the
2769: post-shock solutions.  Plotted are the relative errors of the density,
2770: $(\rho - \rho_{\rm ana})/\rho_{\rm max}$, versus radius, where $\rho$
2771: is the simulated density profile, $\rho_{\rm ana}$ is the analytic
2772: profile, and $\rho_{\rm max}$ is the maximum density of the analytic profile.  The 1D Lagrangian simulation gives the best
2773: results with a maximum relative error near the shock of $\sim 2$\%.  In
2774: comparison, the 1D Eulerian test gives $\sim 4$\% deviation near the
2775: shock.  The 2D Lagrangian simulation using the spiderweb mesh has a
2776: maximum deviation similar to the 1D Lagrangian simulation, even though
2777: the 1D simulation has radial zones with half the zone size.  The simulation using
2778: the spiderweb mesh shows some slight departure from spherical
2779: symmetry.  Specifically, for
2780: most of the post-shock region, the peak-to-peak variation of density is less than
2781: $\sim 1$\%, and near the shock the peak-to-peak variation of density reaches
2782: $\sim 3$\%.  The 2D Lagrangian simulation using the butterfly mesh has
2783: a maximum density deviation of
2784: $\sim 4$\% near the shock and a deviation from
2785: spherical symmetry of similar magnitude.
2786: 
2787: \subsection{Noh Implosion Problem}
2788: 
2789: 
2790: Initial conditions for the Noh Problem are uniform density $\rho_0 =
2791: 1$ g cm$^{-3}$, zero (or
2792: very small) internal energy $\varepsilon_0 = 0$ ergs, a convergent velocity
2793: field with magnitude $v_0 = 1$ cm s$^{-1}$, and a gamma-law EOS with
2794: $\gamma = 5/3$.  Subsequent evolution produces a symmetric
2795: self-similar flow including supersonic accretion, an accretion shock, and
2796: stationary post-shock matter in which kinetic energy has been
2797: converted into internal energy.  The analytic solution for this problem
2798: is
2799: \begin{equation}
2800: \{ \rho, \varepsilon, v\} =
2801: \left \{
2802: \begin{array}{ll}
2803: \left \{ \rho_0 \left ( \frac{\gamma + 1}{\gamma - 1} \right )^d
2804: ,\frac{1}{2}v^2_0,0  \right \} &
2805: {\rm if} \, r < r_s \\
2806: \left \{ \rho_0 \left ( 1 - \frac{v_0 t}{r} \right )^{d-1}
2807: ,0,v_0  \right \} &
2808: {\rm if} \, r > r_s \\
2809: \end{array}
2810: \right .
2811: \end{equation}
2812: where $v$ is the velocity magnitude, the shock position is $r_s = u_s
2813: t$, the shock velocity is $u_s =
2814: \frac{1}{2}(\gamma-1) v_0$, and $d$ is 2 for 2D Cartesian, 3 for 2D
2815: simulations using
2816: cylindrical coordinates, and 3 for 1D spherically symmetric simulations.
2817: 
2818: In Fig. \ref{noh1dres}, we present the density profiles at $t = 0.2$ s
2819: for 1D, spherically
2820: symmetric simulations of the Noh problem using four
2821: resolutions.  The initial grid spans the range $x \in \{ 0: 1\}$ cm
2822: and is evenly divided into 200, 400, 800, and 1600 zones.
2823: The solid line is the analytic solution for $\gamma
2824:   = 5/3$.  Higher resolution simulations more accurately capture the shock
2825:   position and the post-shock density profile.  However, all resolutions depart significantly from the analytic
2826:   solution near the center.  This is ``wall heating'' and is a common problem for Lagrangian
2827:   schemes \citep{rider00}.
2828: 
2829: The four panels of Fig. \ref{nohplot_2d} present the density profiles
2830: for 2D simulations.  Three of the four panels show the results using Cartesian
2831: coordinates.  The top-left panel shows the results using a Cartesian
2832: grid with 100$\times$200 zones, the top-right panel shows the results
2833: using the butterfly mesh with 22,400 zones, and the lower-left panel shows the results
2834: using the spiderweb mesh.  The fourth panel, lower-right, shows the
2835: results using 2D cylindrical coordinates and a Cartesian mesh with
2836: 100$\times$200 zones.  Obvious is the fact that the mesh
2837: employed has consequences for the solution.  Both the top-left and
2838: bottom-right panels indicate that using the Cartesian mesh for this
2839: problem produces fairly smooth results, with some
2840: asymmetry ($\sim$7\%) in the post-shock region.  The lower-left panel
2841: shows that using the spiderweb mesh produces perfectly symmetric
2842: solutions except near the center where the deviation from symmetry is
2843: as large as $\sim$25\%.  Finally, simulations using the butterfly
2844: mesh, top-right panel, shows a similarly mixed capacity to preserve
2845: symmetry.  In this light, it is important to choose a grid that
2846: minimizes numerical artifacts for the problem at hand.  A task easily
2847: accomplished with the use of ALE methods.
2848: 
2849: \subsection{Saltzman Piston Problem}
2850: \label{section:saltzman}
2851: 
2852: A standard test for arbitrary grid codes, the Saltzman piston problem
2853: \citep{margolin88} addresses the ability of a code to simulate a simple
2854: piston-driven shock using a grid with mesh lines oblique to the shock normal.  The top panel of Fig. \ref{saltzman} shows the
2855: grid with $100 \times 10$ zones.  For a grid with $N_x \times N_y$ nodes within a domain defined
2856: by $x \in \{ 0 : x_{\rm max} \}$ and $y \in \{ 0 : y_{\rm max} \}$,
2857: where $x_{\rm max} = 1.0$ and $x_{\rm max} = 0.1$, the $x$ positions of the
2858: nodes are given by
2859: \begin{equation}
2860:   x = (i-1) \frac{x_{\rm max}}{N_x - 1}
2861:       + (N_y-j) \sin \left ( \pi \frac{(i-1)}{(N_x-1)} \right)
2862:      \frac{y_{\rm max}}{N_y - 1} \, ,
2863: \end{equation}
2864: where $i \in \{ 1 : N_x \}$ and $j \in \{ 1 : N_y \}$.
2865: At the piston, the left wall is
2866:   moving at a constant velocity, 1.0 cm s$^{-1}$, to the right.
2867:   Initially, the density and internal energy are set equal to 1.0 g
2868:   cm$^{-3}$ and 0.0 ergs, respectively, and we use a gamma-law EOS with $\gamma = 5/3$.
2869: 
2870: In the bottom panel of Fig. \ref{saltzman}, we show the grid and the
2871: density colormap at $t = 0.925$ s after the shock has traversed
2872: the domain twice, reflecting off the right and left walls once.
2873: In this snapshot, the shock is traveling to the right.  Our results are
2874: to be compared with Figs. 15 and 16 of \citet{campbell01}.  Figure 15 of
2875: \citet{campbell01} depicts a simulation with severe grid buckling, which we
2876: do not observe in our simulations.  Instead, our
2877: Fig. \ref{saltzman} shows reduced grid buckling and appropriate
2878: densities in accordance with the results of Fig. 16 of \citet{campbell01}.
2879: 
2880: \subsection{Dukowicz Piston Problem}
2881: \label{section:dukowicz}
2882: 
2883: The Dukowicz piston problem \citep{dukowicz92} is another test using an oblique mesh.  The initial setup involves two
2884: regions.  Region 1 has a density of 1 g cm$^{-3}$ and is resolved with
2885: $144 \times 120$ zones.  In the vertical domain, $y \in \{ 0 : 1.5 \}$ cm,
2886: and the mesh lines evenly partition the space into 120 sections.  Dividing
2887: region 1 horizontally involves mesh lines with changing orientation.
2888: The leftmost mesh line is parallel to the vertical, while the rightmost mesh line is
2889: oriented 60$^{\circ}$ relative to the vertical.  The mesh lines in
2890: between smoothly transition from 0$^{\circ}$ to 60$^{\circ}$.  Region 2 has a
2891: density of 1.5 g cm$^{-3}$ and is gridded with a $160 \times 120$ mesh,
2892: with the vertical mesh lines uniformly slanted at 60$^{\circ}$.
2893: Including region 1 and region 2, the bottom boundary spans the range
2894: $x \in \{ 0: 3 \}$ cm and is evenly divided into 304 segments.
2895: Initially, both regions are in equilibrium with $P = 1.0$ erg
2896: cm$^{-3}$.  The top, bottom, and right boundaries are reflecting, and
2897: the left boundary is a piston with a velocity in the positive $x$
2898: direction and a magnitude of 1.48 cm s$^{-1}$ (see the top panel of Fig. \ref{dukowicz} for a low
2899: resolution example of this grid).
2900: 
2901: A piston-driven shock
2902:   travels from left to right, and encounters the density jump at an
2903:   angle of 60$^{\circ}$, producing a rich set of phenomena.
2904:   The incident shock continues into the lower density region, a
2905:   transmitted/refracted shock propagates into the higher density
2906:   region, a vortex sheet develops behind the transmitted shock, and a
2907:   reflected shock propagates into the incident shock's post-shock flow
2908:   (see the labels in the bottom plot of Fig. \ref{dukowicz} for visual
2909:   reference).  The results are to be compared with the semi-analytic
2910:   shock-polar analysis presented by \citet{dukowicz92} (see Figure 13
2911:   and Table I of \citet{dukowicz92}).  In their paper, angles subtended by the five regions
2912:   are presented.  In Table \ref{table:dukowicz}, we recast this information as
2913:   the angles that the transmitted shock, vortex sheet, reflected
2914:   shock, and incident shock have with $x$-axis.  The first row gives
2915:   the analytic values, which should be compared with the simulated orientations in
2916:   the second row.  Strikingly, despite the fact that the incident
2917:   shock has traversed a grid with an oblique mesh, the simulated and
2918:   analytic orientations differ very little.  The simulated and
2919:   analytic reflected-shock orientations agree to within $\sim 0.5$\%,
2920:   and the orientations of the transmitted shock and vortex sheet agree
2921:   to within 2\%.
2922: 
2923: \subsection{Rayleigh-Taylor Instability}
2924: \label{section:rt}
2925: 
2926: Here, we simulate the growth of a single mode of the Rayleigh-Taylor Instability.
2927: A heavy fluid is placed on top
2928: of a lighter fluid in the presence of a constant gravitational
2929: acceleration.  The top and bottom densities are
2930: $\rho_1 = 2.0$ g cm$^{-3}$ and $\rho_2 = 1.0$ g cm$^{-3}$, respectively, and the gravitational
2931: acceleration points downward with magnitude $g = 0.1$ cm s$^{-2}$.
2932: The domain is a rectangle with $x \in \{ -0.25 : 0.24 \}$ cm and $y \in \{ -0.75
2933: : 0.75 \}$ cm and $100 \times 300$ grid zones.
2934: The top and bottom boundaries are reflecting while the left and right
2935: boundaries are periodic.  For such configurations, small perturbations
2936: of the interface between the heavy and light fluids are unstable to exponential
2937: growth.  Assuming that the boundaries are far from the
2938: interface, the exponential growth rate of a perturbation with
2939: wavenumber $k$ is
2940: \begin{equation}
2941: \omega = \sqrt{\frac{k g (\rho_1 - \rho_2)}{\rho_1 + \rho_2}} \, .
2942: \end{equation}
2943: For all single-mode Rayleigh-Taylor simulations we initiate the
2944: perturbation by setting the vertical component of the velocity equal to $v_y
2945: = 2.5 \times 10^{-3} (1 + \cos(2 \pi x / \lambda)) (1 + \cos(3 \pi
2946: y))$, where the wavelength, $\lambda$, is $0.5$ cm.
2947: Therefore, we simulate one wavelength of the mode, and the exponential
2948: growth rate ($\omega$) should be  0.65 s$^{-1}$. 
2949: 
2950: Figure \ref{rt_stills_res} shows the evolution of a single-mode
2951: Rayleigh-Taylor instability  at $t = 12.75$ s for four resolutions.
2952: From left to right, the grid sizes are $50 \times 150$, $74 \times
2953: 222$, $100 \times 300$, and $150 \times 450$.  Gross features
2954: compare well, with all the resolutions differing by only a few
2955: percent in the maximum and minimum position of the interface.
2956: However, higher resolution simulations manifest greater complexity for the Kelvin-Helmholtz rolls.
2957: One can compare the third panel to the results of Fig. 4.5 of
2958:   \citet{liska03}.  In a general sense, these authors conclude that
2959:   fewer features imply more dissipation.  However, it could be that
2960:   some of the Kelvin-Helmholtz rolls are seeded by grid noise in some schemes\footnote{See results from Jim Stone's Athena for a more
2961:   favorable comparison and a discussion of the grid noise issue
2962:   (http://www.astro.princeton.edu/~jstone/tests/rt/rt.html).}.
2963: 
2964: Next, we discuss the effects of artificial viscosity on the
2965: single-mode Rayleigh-Taylor flow.  As stated in \S
2966: \ref{section:artificial_viscosity}, artificial viscosity is a
2967: requirement for ALE algorithms in order to simulate shocks.  In
2968: the current formulation, there are two parameters of the artificial
2969: viscosity scheme.  One parameter, $c2$, is the coefficient for
2970: $(\vec{\nabla} \cdot \vec{v})^2$, which is largest in
2971: shocks.  Effectively, this term provides shock resolution.  The second
2972: parameter, $c_1$, is the coefficient of the term that
2973: is proportional to $c_s (\vec{\nabla} \cdot \vec{v})$ and is designed
2974: to reduce the amount of post-shock ringing in the solution.  Typical
2975: values suggested for both are 1.0 \citep{campbell01}.  For the
2976: single-mode Rayleigh-Taylor test, the
2977: flows are subsonic, so the term multiplied by $c_1$ has the
2978: greatest impact on the magnitude of the artificial viscosity forces.
2979: Each panel of Fig. \ref{rt_stills_visc} presents the nonlinear
2980: Rayleigh-Taylor flow after 12.75 s for different values of the
2981: artificial viscosity parameter, $c_1$.  Clearly, $c_1 = 0.01$ (left
2982: panel) reproduces the expected results for this low-Mach-number flow.  On the
2983: other hand, the $c_1 = 0.1$ run (center panel) displays significant departures for
2984: the Kelvin-Helmholtz rolls, while the overall progression of the
2985: plumes remains similar.  Unfortunately, the model with $c_1 = 1.0$ (right panel)
2986: completely suppresses the Kelvin-Helmholtz rolls on these scales and
2987: plume progression is severely retarded.  
2988: 
2989: In Fig. \ref{rt_linear}, the interface perturbation
2990: amplitude is plotted as a function of time (dashed lines).
2991: The
2992:   solid line is the analytic exponential growth rate scaled to the simulation
2993:   results.  The dashed lines show the simulation results for viscosity
2994:   parameters, $c_1$, of 0.01, 0.1, and 1.0.  Three distinct phases are apparent: an early transient phase, a phase in which
2995: the slope most closely matches the exponential growth rate, and the
2996: subsequent nonlinear phase.  The
2997:   simulations with $c_1 = 0.01$ and 0.1 manifest exponential growth for several
2998:   e-folding times.  The run with $c_1 = 1.0$, on the other hand, seems
2999:   to follow the linear phase for  only 1 s ($\sim$ 1/2 e-folding), if at
3000:   all.  Around 5 s, the evolution of the interface amplitude enters the
3001:   nonlinear phase.
3002: 
3003: For the artificial viscosity scheme that we employ, the Rayleigh-Taylor
3004: instability test indicates that lower values of $c_1$ are preferred.
3005: However, tests of the Sod shock-tube problem including a parameter
3006: study of $c_1$ indicate that unwanted post-shock ringing is diminished only for
3007: values above $\sim0.5$.  This represents the primary weakness of
3008: BETHE-hydro to simulate flows with both shocks and Rayleigh-Taylor
3009: instabilities.  To be clear, this does not represent a weakness of ALE
3010: methods in general, but of the tensor artificial viscosity
3011: algorithm designed to mitigate the hourglass instability that we
3012: employ.  Other artificial viscosity schemes such as edge viscosity
3013: (see \citet{campbell01} for references) allow for proper development
3014: of hydrodynamic instabilities, but do little to suppress the hourglass
3015: instability (Milan Kucharik, private communication).
3016: Of great interest to users of ALE is a methodology that suppresses the
3017: hourglass instability and post-shock ringing while enabling proper
3018: evolution of hydrodynamic instabilities.
3019: 
3020: \subsection{Kelvin-Helmholtz Instability}
3021: 
3022: Another important phenomenon we explore is the Kelvin-Helmholtz shear
3023: instability.  \citet{agertz07} have shown that SPH has trouble
3024: simulating the Kelvin-Helmholtz instability when extreme density
3025: contrasts are involved.  We find that this instability is reasonably
3026: well handled in BETHE-hydro, and that the evolution during the small amplitude regime
3027: is accurately characterized by analytic linear analysis.  The
3028: calculational domain covers the square region bounded by
3029: $x \in \{ 0 : 1 \}$ cm and $y \in \{ 0 : 1 \}$ cm and has $256 \times 256$ zones.
3030: The top and bottom boundaries are reflecting, while the left and right
3031: boundaries are periodic.
3032: For $y<0.5$ cm, $\rho_{\rm b} = 1.0$ g cm$^{-3}$, and for $y>0.5$ cm, $\rho_{\rm t}
3033: = \rho_{\rm b}/\chi$, where 
3034: $\chi = 8$.  These regions are in pressure equilibrium with $P =
3035: 1.0$ erg cm$^{-3}$.  The shearing velocity, $v_{\rm shear}$ is scaled with respect
3036: to the slowest sound speed (sound speed in the bottom region, $c_b$).
3037: This relative shearing velocity is split between the top region,
3038: which flows to the left with speed $\frac{1}{2} v_{\rm shear}$, and the
3039: bottom region, which flows to the right with the same speed.  For this
3040: test, the linear coefficient in the viscosity, $c_1$, is set to 0.01.  A gamma-law
3041: EOS is used with $\gamma = 5/3$.
3042: The initial
3043: perturbation (see Agertz et al. 2007 \nocite{agertz07}) is placed in a small band
3044: centered on the interface and is a perturbation in velocity given by 
3045: \begin{equation}
3046: \label{eq:kh_pert}
3047: v_y = \delta v_y v_{\rm shear}  \sin \left ( \frac{2 \pi x}{\lambda} \right ) \, {\rm for}
3048: \, \left | y - 0.5 \right | \le 0.025 \, ,
3049: \end{equation}
3050: where $\lambda = 1/3$ cm.  It should be noted that this perturbation
3051: is not an eigenmode of the instability.  Therefore, simulations have a transient phase at the
3052: beginning in which this perturbation settles into one or more modes of the
3053: instability.  We have found that using amplitudes suggested by
3054: \citet{agertz07}, $\delta v_y = 1/80$ and 1/40, produces strong transients that complicate the
3055: interpretation of the linear regime.  To avoid strong long-lasting
3056: transients, we set $\delta v_y = 1/160$.
3057: These initial conditions should produce a perturbation of the interface that
3058: grows exponentially in magnitude with an e-folding time given by
3059: \begin{equation}
3060: \tau_{\rm KH} = \frac{\lambda (\rho_{\rm top} + \rho_{\rm bot})}
3061: {2 \pi v_{\rm shear} \sqrt{\rho_{\rm top} \rho_{\rm bot}}  } \, .
3062: \end{equation}
3063: For the simulations presented here, we consider two shearing
3064: velocities: $v_{\rm shear} = \frac{1}{2} c_b = 0.6455$ cm s$^{-1}$ and $v_{\rm shear} =
3065: \frac{1}{4} c_b = 0.32275$ cm s$^{-1}$.  Hence, $\tau_{\rm KH}$ is
3066: 0.262 s and 0.523 s, respectively.
3067: 
3068: The top panel of Fig. \ref{kh_still} shows the evolution at
3069: $t= 5.5$ s for $v_{\rm shear} = \frac{1}{4} c_b$.  The first set of
3070: nonlinear Kelvin-Helmholtz rolls have appeared.  Qualitatively, the
3071: morphology of the rolls is
3072: similar to the results presented in Figure 13. of
3073: \citet{agertz07} labeled by ``grid 1'' at $t = 2 \pi \tau_{\rm KH}$ (there is a factor of $2 \pi$ difference in the definition of
3074: $\tau_{\rm KH}$ between our work and theirs).  There are two main
3075: differences.  For one, we simulate with a factor two larger wavelength
3076: to adequately resolve
3077: the wavelength for linear analysis.  Secondly, the time at which we
3078: present the results in the top panel of Fig. \ref{kh_still}
3079: corresponds to  $t = 1.67 \times (2 \pi \tau_{\rm KH})$, not $t = 2
3080: \pi \tau_{\rm KH}$.  We have noticed similar discrepancies in the time
3081: required to achieve similar evolution using $\lambda = 1/6$ and $v_{\rm shear} = \frac{1}{2}c_b$.  Additionally, we analyze the
3082: growth rate of the interface during the linear regime.  We determine the
3083: interface amplitude by generating a
3084: contour for $\rho = 0.5 (\rho_{\rm t} + \rho_{\rm b})$, measuring the
3085: peak to peak amplitude, and dividing by two.  The bottom
3086: plot of Fig.
3087: \ref{kh_still} shows this amplitude (solid line) versus time and
3088: compares to the expected exponential growth (dashed line) for
3089: a simulation with $v_{\rm shear} = \frac{1}{4}c_b$ (green) and $v_{\rm
3090: shear} = \frac{1}{2}c_b$ (blue).  There are three distinct phases
3091: in the log-linear plot: an early transient phase, a phase in which
3092: the slope most closely matches the exponential growth rate, and the
3093: subsequent nonlinear phase.  While the growth rate during the linear
3094: regime differs slightly ($\sim$10\%) from theory, the bottom panel of
3095: Fig. \ref{kh_still} demonstrates that the correct
3096: dependence of the growth rate on $v_{\rm shear}$ is obtained.
3097: 
3098: \subsection{Core-Collapse Test}
3099: \label{section:corecollapse}
3100: Incorporating all aspects of BETHE-hydro, we simulate 1D
3101: and 2D hydrodynamic core-collapse of a 15
3102: M$_{\sun}$ star.  We use the s15s7b2 model (S15) of \citet{woosley95} and the Shen EOS \citep{shen98} and initiate
3103: collapse using a $Y_e$-$\rho$ parameterization \citep{liebendorfer06}.  While there are no analytic solutions for such a
3104: test, we test to see whether the density profiles, timescales, and shock
3105: radii, etc. all match experience with other codes and results
3106: published \citep{liebendorfer01a,liebendorfer01b,rampp02,buras03,thompson03,liebendorfer05}.  For 2D simulations,
3107:   the grid is composed of a butterfly mesh in the interior with a minimum
3108:   cell size of $\sim$0.5 km and extends to 50 km where a spherical grid
3109:   carries the domain out to 4000 km.  In total, there are 23,750 cells,
3110:   with an effective resolution of $\sim$250 radial and $\sim$100 angular
3111:   zones.  For the best comparison, the 1D grid has
3112:   250 zones, mimicking the effective radial resolution of the 2D simulation.  Figure \ref{cc_rhoplot} depicts the density
3113: vs. radius for 1D (lines) and
3114:   2D (crosses) at times 0, 70, 110, 130, 140, and 150 ms after the
3115:   start of the calculation.  Core bounce occurs at 148 ms.    Other
3116:   than a $\sim$10\% difference in the shock radii at 150 ms, 1D and 2D
3117:   calculations track one another quite well.  Furthermore,
3118:   Fig. \ref{cc_gaccplot} shows an exceptional correspondence between the
3119:   1D and 2D gravitational accelerations.
3120: 
3121: Using this core-collapse test to best represent the conditions during
3122: astrophysical
3123: simulations, we describe some timing results of this problem.  A standard measure is the average CPU time spent per cell per
3124: cycle.  Using one core of a Dual-Core AMD Opteron\texttrademark 2.8 GHz
3125: processor for this test, the average time spent is $8.125 \times
3126: 10^{-5}$ CPU seconds/cycle/cell.  80\% of which is spent in AMG1R6,
3127: the multigrid solver.  For this problem, the iterative multigrid
3128: solver usually takes $\sim$5 to $\sim$10 cycles to achieve a
3129: fractional residual of $\sim$$10^{-7}$ to $\sim$$10^{-9}$, where the
3130: fractional residual of the linear system $A\vec{x} = \vec{b}$ is $(A\vec{x}-\vec{b})/\vec{b}$.
3131: 
3132: We re-simulate the
3133: collapse of the S15 model, but with an angular velocity profile of the form
3134:   $\Omega(r) = 1/(1 + (r/A)^2)$, where $A = 1000$ km and $\Omega_0 =
3135:   2$ radians s$^{-1}$.  The $\Omega$ vs. $r$ plot is shown in Fig. \ref{cc_angvelplot}.  
3136: Core
3137:   bounce occurs at 151 ms.  First of all, total
3138:   angular momentum is conserved to machine accuracy.  Since there are no analytic descriptions for
3139:   the evolution of angular velocity in core collapse scenarios, we
3140:   cannot validate the numerical results via analytic theory.  However, the central
3141:   angular velocity, $\Omega_c$ is proportional to $\rho_c^{2/3}$, where $\rho_c$ is
3142:   the central density.  Since the central density compresses from
3143:   $\sim$10$^{10}$ g cm$^{-3}$ at $t = 0$ ms to $\sim$2.2 $\times 10^{14}$ g
3144:   cm$^{-3}$ at $t = 160$ ms, $\Omega_c$ should be
3145:   $\sim$1600 radians s$^{-1}$ at $t = 160$ ms.  This is consistent with results shown
3146:   in Fig. \ref{cc_angvelplot}.  Furthermore, the angular velocity
3147:   evolves smoothly with no evidence of axis effects.  On the other hand, there is a slight,
3148:   but noticeable, glitch at the location of the shock.
3149: 
3150: \section{Discussion and Conclusions}
3151: \label{section:discussion}
3152: 
3153: In this paper, we have presented the algorithms employed in BETHE-hydro, a new code
3154: for 1D and 2D astrophysical hydrodynamic simulations.  The
3155: hydrodynamic core is an ALE algorithm, and its most
3156: striking feature is the ability to use
3157: arbitrary, unstructured grids.
3158: With finite-differencing based upon the support-operator method
3159: \citep{shashkov95} of \citet{caramana98c} and \citet{caramana98a},
3160: energy is conserved to roundoff error in the absence of rotation and
3161: gravity, and momentum is strictly conserved using Cartesian
3162: coordinates.  For all other circumstances, energy and momentum are
3163: conserved accurately, if not precisely.  We use a subcell remapping scheme that
3164: conservatively remaps mass, momentum, energy, and number density.  For
3165: 2D calculations using cylindrical
3166: coordinates, we include rotational terms in the Lagrangian solver, and
3167: develop a remapping algorithm that conservatively remaps angular
3168: momentum while minimizing unwanted features in the angular velocity near
3169: the axis.  To provide shock resolution and grid stability, we use the
3170: tensor artificial viscosity of \citet{campbell01}, and to minimize
3171: hourglass instabilities, we have developed a subcell pressure method
3172: that is a close derivative of the scheme developed by
3173: \citet{caramana98a}, but avoids pathological problems when used
3174: in conjunction with the subcell remapping algorithm.  Finally, we
3175: have developed a gravity solver for arbitrary grids that uses a
3176: support-operator technique for elliptic equations \citep{morel98} and
3177: an iterative multigrid-preconditioned
3178: conjugate-gradient method \citep{ruge87} to solve the system of linear
3179: equations.
3180: 
3181: Overall, BETHE-hydro offers many unique and useful features for
3182: astrophysical simulations.  For one, by using ALE techniques, the
3183: structure of BETHE-hydro is straightforward, enabling
3184: simple inclusion of a variety of additional physics packages.
3185: Examples, which will be discussed in future papers, are nuclear
3186: networks and time-dependent radiation transport.  In contrast with
3187: other techniques, such as higher-order Godunov
3188: methods, no assumptions are made in ALE techniques about characteristic
3189: waves nor the relationships among important thermodynamic variables.  Hence, one of its useful features is an ability to use a general EOS.
3190: 
3191: Most important among BETHE-hydro's strengths is the ability to
3192: solve self-gravitating hydrodynamic flows on arbitrary
3193: grids.  This is achieved primarily because the foundation of the Lagrangian
3194: hydrodynamics solver is an arbitrary, unstructured polygonal
3195: grid. Furthermore, grids may be time-dependent since the hydrodynamic
3196: flow from one timestep is remapped to another arbitrary grid for subsequent
3197: evolution.  Consequently, simulations may be executed using a purely
3198: Lagrangian, purely Eulerian, or an arbitrarily defined time-dependent
3199: grid.  With BETHE-hydro, simulations have great flexibility, tailoring
3200: the grid to minimize numerical error and suiting the grid to the
3201: computational challenge.
3202: 
3203: Ironically, this flexibility leads to BETHE-hydro's most prominent
3204: weakness, which is shared among all ALE codes, the hourglass
3205: instability and grid buckling.  We use subcell pressure and tensor artificial viscosity algorithms to mitigate these
3206: numerical artifacts, but the resolution is imperfect.  In \S
3207: \ref{section:hourglass}, we present a subcell pressure algorithm that
3208: is compatible with the subcell remapping algorithm, but the efficacy
3209: of hourglass elimination is slightly compromised.  Although the tensor
3210: artificial viscosity does well to mitigate grid buckling, it can be
3211: more resistive to the proper development of hydrodynamic instabilities
3212: compared to other artificial viscosity schemes used in
3213: ALE (Milan Kucharik, private communication).  Hence, we
3214: diminish the effects of the hourglass instability, but with some unwanted
3215: side effects.  While mitigation in 2D is tractable, the
3216: instability in 3D has many more modes and is not as easily eliminated
3217: (Guglielmo Scovazzi, private communication ),
3218: making long 3D ALE simulations a challenge.
3219: 
3220: Throughout this paper, we have not only demonstrated BETHE-hydro's
3221: flexibility, but have shown that it produces accurate and 2$^{nd}$-order
3222: convergent solutions.  With density distributions having analytic
3223: potentials, we have shown that the 2D gravity solver gives accurate
3224: spherically symmetric potentials when a non-spherical grid is used, it
3225: produces accurate non-spherical potentials, and solutions
3226: converge with 2$^{nd}$-order accuracy.  Further tests demonstrated
3227: accurate solutions for self-gravitating hydrostatic and dynamic
3228: problems.  We have shown that our hourglass elimination algorithm
3229: minimizes the hourglass instability and does not present problems when
3230: used in conjunction with subcell remapping.  In addition, we have
3231: quantified the accuracy of hydrodynamic simulations by simulating
3232: problems with analytic solutions.  Simulating piston-driven shocks
3233: using oblique meshes, we confirmed we can obtain accurate solutions in the context
3234: of arbitrary grids.  Verifying the code's ability to capture basic hydrodynamic
3235: instabilities, we simulate the Rayleigh-Taylor and Kelvin-Helmholtz
3236: instabilities.  Concluding the tests, we simulated a supernova core collapse, which demonstrates the ability to simulate complex
3237: astrophysical phenomena.
3238: 
3239: Simulating hydrodynamic flow is fundamental to understanding most
3240: astrophysical objects, and despite the long tradition of
3241: hydrodynamic simulations many puzzles remain.  This is due primarily to the need
3242: to address time-dependent gravitational potentials, complicated
3243: equations of state (EOSs), flexible grids, multi-D shock structures,
3244: and chaotic and turbulent flows.  Therefore, with BETHE-hydro, we introduce
3245: a uniquely flexible and functional tool for advancing the theory of complex
3246: astrophysical phenomena.
3247: 
3248: \acknowledgments
3249: We would like to thank Mikhail Shashkov, Raphael Loub{\`e}re, Milan
3250: Kucharik, and Burton Wendroff for valuable conversations about ALE
3251: techniques.  Discussions concerning the 2D gravity solver with Ivan Hubeny, Jim
3252: Morel, David Moulton, and David Keyes of TOPS were very 
3253: fruitful.
3254:  We acknowledge support for this work                                           
3255: from the Scientific Discovery through Advanced Computing                        
3256: (SciDAC) program of the DOE, under grant numbers DE-FC02-01ER41184              
3257: and DE-FC02-06ER41452, and from the NSF under grant number AST-0504947.         
3258: J.W.M. thanks the Joint Institute for Nuclear Astrophysics (JINA) for           
3259: support under NSF grant PHY0216783.
3260: We thank Jeff Fookson and Neal Lauber of the Steward Computer Support
3261: Group for their invaluable help with the local Beowulf cluster, Grendel.
3262: 
3263: \appendix
3264: 
3265: \section{Hydrodynamic equations:  Eulerian form}
3266: \label{section:eulerian_hydro}
3267: In Eulerian form, the equations for conservation of mass, momentum,
3268: and energy are
3269: \begin{equation}
3270: \label{eq:mass_eul}
3271: \frac{\partial \rho}{\partial t} + \vec{\nabla} \cdot ( \rho \vec{v})
3272: = 0 \, ,
3273: \end{equation}
3274: \begin{equation}
3275: \label{eq:mom_eul}
3276: \frac{\partial (\rho \vec{v})}{\partial t} 
3277: + \vec{\nabla} \cdot ( \rho \vec{v} \vec{v}) + \vec{\nabla} P = -\rho
3278: \vec{\nabla} \Phi \, ,
3279: \end{equation}
3280: and
3281: \begin{equation}
3282: \label{eq:ene_eul}
3283: \frac{\partial (\rho \varepsilon + 1/2 \rho v^2) }{\partial t}
3284: + \vec{\nabla} \cdot [ (\rho \varepsilon + P + 1/2 \rho v^2) \vec{v}]
3285: = - \rho \vec{\nabla} \Phi \cdot \vec{v} \, .
3286: \end{equation}
3287: 
3288: 
3289: \section{Volume and Weighted-Volume Integrals in 2D}
3290: \label{section:integrals}
3291: 
3292: In this appendix, we give the exact analytic volumes and
3293: weighted-volume integrals in discrete form.  Since we are dealing with
3294: 2D simulations all integrals are 2D integrals, and can be further
3295: reduced using Green's formula to 1D boundary integrals.  For example,
3296: the volume of zone $z$ in Cartesian coordinates is
3297: \begin{equation}
3298: \int_{V_z}dV = \oint_{\partial V_z} x dy
3299: = \sum_e \frac{1}{2}(x_1 + x_2)(y_2-y_1)
3300: \end{equation}
3301: or alternatively,
3302: \begin{equation}
3303: \int_{V_z}dV = - \oint_{\partial V_z} y dx
3304: = - \sum_e \frac{1}{2}(y_1 + y_2)(x_2-x_1) \, ,
3305: \end{equation}
3306: where the direction of the boundary integral is clockwise, $e$ indicates an edge of the cell, and subscripts 1 and 2
3307: represent the endpoints of edge $e$.  In cylindrical coordinates, the
3308: volume integral is
3309: \begin{equation}
3310: \int_{V_z}dV = 2\pi \frac{1}{2}\oint_{\partial V_z} r^2 dz
3311: = 2\pi \sum_e \frac{1}{6}(r^2_1 + r_1r_2 + r^2_2)(z_2-z_1) \, .
3312: \end{equation}
3313: 
3314: Throughout BETHE-hydro, integrals of linear functions produce volume integrals
3315: weighted by $x$ or $y$.  The discrete form of these integrals are
3316: \begin{equation}
3317: \int_{V_z}x dV = \frac{1}{2}\oint_{\partial V_z} x^2 dy
3318: = \sum_e \frac{1}{6}(x^2_1 + x_1x_2 + x^2_2)(y_2-y_1)
3319: \end{equation}
3320: and
3321: \begin{equation}
3322: \int_{V_z}y dV = - \frac{1}{2}\oint_{\partial V_z} y^2 dx
3323: = - \sum_e \frac{1}{6}(y^2_1 + y_1y_2 + y^2_2)(x_2-x_1) \, .
3324: \end{equation}
3325: Using cylindrical coordinates these are
3326: \begin{equation}
3327: \int_{V_z}rdV = 2\pi \frac{1}{3}\oint_{\partial V_z} r^3 dz
3328: = 2\pi \sum_e \frac{1}{12}(r^3_1 + r^2_1r_2 + r_1r^2_2 + r^3_2)(z_2-z_1)
3329: \end{equation}
3330: and
3331: \begin{equation}
3332: \begin{array}{lcl}
3333: \int_{V_z}z dV & = & 2\pi \frac{1}{2}\oint_{\partial V_z} r^2 z dz \\
3334: & = & 2 \pi \sum_e \frac{1}{6}\left [
3335: (\frac{3}{4}r^2_2 + \frac{1}{2}r_2r_1 + \frac{1}{4}r^2_1)(z_2 - z_1)
3336: +
3337: (r^2_2 + r_2r_1 + r^2_1)z_1
3338: \right ] (z_2 - z_1) \,.
3339: \end{array}
3340: \end{equation}
3341: 
3342: Finally, for angular momentum remapping, we require
3343: integrals in cylindrical coordinates weighted by $r^2$:
3344: \begin{equation}
3345: \int_{V_z}r^2dV = 2\pi \frac{1}{4}\oint_{\partial V_z} r^4 dz
3346: = 2\pi \sum_e \frac{1}{20}(r^4_1 + r^3_1r_2 + r^2_1r^2_2 + r_1r^3_2 + r^4_2)
3347: (z_2-z_1) \, .
3348: \end{equation}
3349: 
3350: 
3351: 
3352: %\bibliographystyle{apj}
3353: %\bibliography{jeremiah}
3354: \begin{thebibliography}{62}
3355: \expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab#1{#1}\fi
3356: 
3357: \bibitem[{{Agertz} {et~al.}(2007){Agertz}, {Moore}, {Stadel}, {Potter},
3358:   {Miniati}, {Read}, {Mayer}, {Gawryszczak}, {Kravtsov}, {Nordlund}, {Pearce},
3359:   {Quilis}, {Rudd}, {Springel}, {Stone}, {Tasker}, {Teyssier}, {Wadsley}, \&
3360:   {Walder}}]{agertz07}
3361: {Agertz}, O., {Moore}, B., {Stadel}, J., {Potter}, D., {Miniati}, F., {Read},
3362:   J., {Mayer}, L., {Gawryszczak}, A., {Kravtsov}, A., {Nordlund}, {\AA}.,
3363:   {Pearce}, F., {Quilis}, V., {Rudd}, D., {Springel}, V., {Stone}, J.,
3364:   {Tasker}, E., {Teyssier}, R., {Wadsley}, J., \& {Walder}, R. 2007, \mnras,
3365:   380, 963
3366: 
3367: \bibitem[{{Barth}(1997)}]{barth97}
3368: {Barth}, T.~J. 1997, {Numerical Methods for Gasdynamic Systems on Unstructured
3369:   Meshes}, ed. T.~{Kroner}, M.~{Ohlberger}, \& C.~{Rohde} (Springer, Berlin),
3370:   195--285
3371: 
3372: \bibitem[{{Baz{\'a}n} {et~al.}(2003){Baz{\'a}n}, {Dearborn}, {Dossa},
3373:   {Eggleton}, {Taylor}, {Castor}, {Murray}, {Cook}, {Eltgroth}, {Cavallo},
3374:   {Turcotte}, {Keller}, \& {Pudliner}}]{bazan03}
3375: {Baz{\'a}n}, G., {Dearborn}, D.~S.~P., {Dossa}, D.~D., {Eggleton}, P.~P.,
3376:   {Taylor}, A., {Castor}, J.~I., {Murray}, S., {Cook}, K.~H., {Eltgroth},
3377:   P.~G., {Cavallo}, R.~M., {Turcotte}, S., {Keller}, S.~C., \& {Pudliner},
3378:   B.~S. 2003, in Astronomical Society of the Pacific Conference Series, Vol.
3379:   293, 3D Stellar Evolution, ed. S.~{Turcotte}, S.~C. {Keller}, \& R.~M.
3380:   {Cavallo}, 1--58381
3381: 
3382: \bibitem[{{Bethe} \& {Wilson}(1985)}]{bethe85}
3383: {Bethe}, H.~A., \& {Wilson}, J.~R. 1985, \apj, 295, 14
3384: 
3385: \bibitem[{{Buras} {et~al.}(2003){Buras}, {Rampp}, {Janka}, \&
3386:   {Kifonidis}}]{buras03}
3387: {Buras}, R., {Rampp}, M., {Janka}, H.-T., \& {Kifonidis}, K. 2003, Physical
3388:   Review Letters, 90, 241101
3389: 
3390: \bibitem[{{Buras} {et~al.}(2006){Buras}, {Rampp}, {Janka}, \&
3391:   {Kifonidis}}]{buras06}
3392: ---. 2006, \aap, 447, 1049
3393: 
3394: \bibitem[{{Burrows} {et~al.}(2007{\natexlab{a}}){Burrows}, {Dessart}, {Livne},
3395:   {Ott}, \& {Murphy}}]{burrows07c}
3396: {Burrows}, A., {Dessart}, L., {Livne}, E., {Ott}, C.~D., \& {Murphy}, J.
3397:   2007{\natexlab{a}}, \apj, 664, 416
3398: 
3399: \bibitem[{{Burrows} {et~al.}(1995){Burrows}, {Hayes}, \& {Fryxell}}]{burrows95}
3400: {Burrows}, A., {Hayes}, J., \& {Fryxell}, B.~A. 1995, \apj, 450, 830
3401: 
3402: \bibitem[{{Burrows} {et~al.}(2006){Burrows}, {Livne}, {Dessart}, {Ott}, \&
3403:   {Murphy}}]{burrows06}
3404: {Burrows}, A., {Livne}, E., {Dessart}, L., {Ott}, C.~D., \& {Murphy}, J. 2006,
3405:   \apj, 640, 878
3406: 
3407: \bibitem[{{Burrows} {et~al.}(2007{\natexlab{b}}){Burrows}, {Livne}, {Dessart},
3408:   {Ott}, \& {Murphy}}]{burrows07a}
3409: ---. 2007{\natexlab{b}}, \apj, 655, 416
3410: 
3411: \bibitem[{{Campbell} \& {Shashkov}(2001)}]{campbell01}
3412: {Campbell}, J.~C., \& {Shashkov}, M.~J. 2001, Journal of Computational Physics,
3413:   172, 739
3414: 
3415: \bibitem[{{Caramana} {et~al.}(1998){Caramana}, {Burton}, {Shashkov}, \&
3416:   {Whalen}}]{caramana98c}
3417: {Caramana}, E.~J., {Burton}, D.~E., {Shashkov}, M.~J., \& {Whalen}, P.~P. 1998,
3418:   Journal of Computational Physics, 146, 227
3419: 
3420: \bibitem[{{Caramana} \& {Shashkov}(1998)}]{caramana98a}
3421: {Caramana}, E.~J., \& {Shashkov}, M.~J. 1998, Journal of Computational Physics,
3422:   142, 521
3423: 
3424: \bibitem[{{Chandrasekhar}(1969)}]{chandrasekhar69}
3425: {Chandrasekhar}, S. 1969, {Ellipsoidal Figures of Equilibrium} (New Haven: Yale
3426:   University Press)
3427: 
3428: \bibitem[{{Colella} \& {Woodward}(1984)}]{colella84}
3429: {Colella}, P., \& {Woodward}, P.~R. 1984, Journal of Computational Physics, 54,
3430:   174
3431: 
3432: \bibitem[{{Dearborn} {et~al.}(2006){Dearborn}, {Lattanzio}, \&
3433:   {Eggleton}}]{dearborn06}
3434: {Dearborn}, D.~S.~P., {Lattanzio}, J.~C., \& {Eggleton}, P.~P. 2006, \apj, 639,
3435:   405
3436: 
3437: \bibitem[{{Dearborn} {et~al.}(2005){Dearborn}, {Wilson}, \&
3438:   {Mathews}}]{dearborn05}
3439: {Dearborn}, D.~S.~P., {Wilson}, J.~R., \& {Mathews}, G.~J. 2005, \apj, 630, 309
3440: 
3441: \bibitem[{{Dukowicz} \& {Meltz}(1992)}]{dukowicz92}
3442: {Dukowicz}, J.~K., \& {Meltz}, B. 1992, Journal of Computational Physics, 99,
3443:   115
3444: 
3445: \bibitem[{{Fryer} \& {Warren}(2002)}]{fryer02}
3446: {Fryer}, C.~L., \& {Warren}, M.~S. 2002, \apjl, 574, L65
3447: 
3448: \bibitem[{{Gardiner} \& {Stone}(2005)}]{gardiner05}
3449: {Gardiner}, T.~A., \& {Stone}, J.~M. 2005, Journal of Computational Physics,
3450:   205, 509
3451: 
3452: \bibitem[{{Goldreich} \& {Weber}(1980)}]{goldreich80}
3453: {Goldreich}, P., \& {Weber}, S.~V. 1980, \apj, 238, 991
3454: 
3455: \bibitem[{{Herant} {et~al.}(1994){Herant}, {Benz}, {Hix}, {Fryer}, \&
3456:   {Colgate}}]{herant94}
3457: {Herant}, M., {Benz}, W., {Hix}, W.~R., {Fryer}, C.~L., \& {Colgate}, S.~A.
3458:   1994, \apj, 435, 339
3459: 
3460: \bibitem[{{Hubeny} \& {Burrows}(2007)}]{hubeny07}
3461: {Hubeny}, I., \& {Burrows}, A. 2007, \apj, 659, 1458
3462: 
3463: \bibitem[{{Janka} \& {Mueller}(1995)}]{janka95}
3464: {Janka}, H.-T., \& {Mueller}, E. 1995, \apjl, 448, L109
3465: 
3466: \bibitem[{{Kitaura} {et~al.}(2006){Kitaura}, {Janka}, \&
3467:   {Hillebrandt}}]{kitaura06}
3468: {Kitaura}, F.~S., {Janka}, H.-T., \& {Hillebrandt}, W. 2006, \aap, 450, 345
3469: 
3470: \bibitem[{{Klein}(1999)}]{klein99}
3471: {Klein}, R.~I. 1999, J. Comp. App. Math, 109, 123
3472: 
3473: \bibitem[{{Kucharik} {et~al.}(2003){Kucharik}, {Shaskov}, \&
3474:   {Wendroff}}]{kucharik03}
3475: {Kucharik}, M., {Shaskov}, M.~J., \& {Wendroff}, B. 2003, Journal of
3476:   Computational Physics, 188, 462
3477: 
3478: \bibitem[{{Landshoff}(1955)}]{landshoff55}
3479: {Landshoff}, R. 1955, {A Numerical Method for Treating Fluid Flow in the
3480:   Presence of Shocks}, Tech. rep., Los Alamos National Laboratory
3481: 
3482: \bibitem[{{LeBlanc} \& {Wilson}(1970)}]{leblanc70}
3483: {LeBlanc}, J.~M., \& {Wilson}, J.~R. 1970, \apj, 161, 541
3484: 
3485: \bibitem[{{Liebend{\"o}rfer} {et~al.}(2001{\natexlab{a}}){Liebend{\"o}rfer},
3486:   {Mezzacappa}, \& {Thielemann}}]{liebendorfer01b}
3487: {Liebend{\"o}rfer}, M., {Mezzacappa}, A., \& {Thielemann}, F.-K.
3488:   2001{\natexlab{a}}, \prd, 63, 104003
3489: 
3490: \bibitem[{{Liebend{\"o}rfer} {et~al.}(2001{\natexlab{b}}){Liebend{\"o}rfer},
3491:   {Mezzacappa}, {Thielemann}, {Messer}, {Hix}, \& {Bruenn}}]{liebendorfer01a}
3492: {Liebend{\"o}rfer}, M., {Mezzacappa}, A., {Thielemann}, F.-K., {Messer}, O.~E.,
3493:   {Hix}, W.~R., \& {Bruenn}, S.~W. 2001{\natexlab{b}}, \prd, 63, 103004
3494: 
3495: \bibitem[{{Liebend{\"o}rfer} {et~al.}(2006){Liebend{\"o}rfer}, {Pen}, \&
3496:   {Thompson}}]{liebendorfer06}
3497: {Liebend{\"o}rfer}, M., {Pen}, U.-L., \& {Thompson}, C. 2006, in International
3498:   Symposium on Nuclear Astrophysics - Nuclei in the Cosmos
3499: 
3500: \bibitem[{{Liebend{\"o}rfer} {et~al.}(2005){Liebend{\"o}rfer}, {Rampp},
3501:   {Janka}, \& {Mezzacappa}}]{liebendorfer05}
3502: {Liebend{\"o}rfer}, M., {Rampp}, M., {Janka}, H.-T., \& {Mezzacappa}, A. 2005,
3503:   \apj, 620, 840
3504: 
3505: \bibitem[{{Liska} \& {Wendroff}(2003)}]{liska03}
3506: {Liska}, R., \& {Wendroff}, B. 2003, SIAM J. Sci. Comput., 25, 995
3507: 
3508: \bibitem[{{Livio} {et~al.}(1980){Livio}, {Buchler}, \& {Colgate}}]{livio80}
3509: {Livio}, M., {Buchler}, J.~R., \& {Colgate}, S.~A. 1980, \apjl, 238, L139
3510: 
3511: \bibitem[{{Livne}(1993)}]{livne93}
3512: {Livne}, E. 1993, \apj, 412, 634
3513: 
3514: \bibitem[{{Livne} {et~al.}(2004){Livne}, {Burrows}, {Walder}, {Lichtenstadt},
3515:   \& {Thompson}}]{livne04}
3516: {Livne}, E., {Burrows}, A., {Walder}, R., {Lichtenstadt}, I., \& {Thompson},
3517:   T.~A. 2004, \apj, 609, 277
3518: 
3519: \bibitem[{{Loub{\`e}re} \& {Shashkov}(2005)}]{loubere05}
3520: {Loub{\`e}re}, R., \& {Shashkov}, M.~J. 2005, Journal of Computational Physics,
3521:   209, 105
3522: 
3523: \bibitem[{{Loub{\`e}re} {et~al.}(2006){Loub{\`e}re}, {Staley}, \&
3524:   {Wendroff}}]{loubere06}
3525: {Loub{\`e}re}, R., {Staley}, M., \& {Wendroff}, B. 2006, Journal of
3526:   Computational Physics, 211, 385
3527: 
3528: \bibitem[{{Margolin}(1988)}]{margolin88}
3529: {Margolin}, L.~G. 1988, {A centered artificial viscosity for cells with large
3530:   aspect ratio}, Tech. rep., Lawrence Livermore National Laboratory
3531: 
3532: \bibitem[{{Margolin} \& {Shaskov}(2003)}]{margolin03}
3533: {Margolin}, L.~G., \& {Shaskov}, M.~J. 2003, Journal of Computational Physics,
3534:   184, 266
3535: 
3536: \bibitem[{{Margolin} \& {Shaskov}(2004)}]{margolin04}
3537: ---. 2004, Computer Methods in Applied Mechanics and Engineering, 193, 4139
3538: 
3539: \bibitem[{{Miller} {et~al.}(1993){Miller}, {Wilson}, \& {Mayle}}]{miller93}
3540: {Miller}, D.~S., {Wilson}, J.~R., \& {Mayle}, R.~W. 1993, \apj, 415, 278
3541: 
3542: \bibitem[{{Miniati} \& {Colella}(2007)}]{miniati07}
3543: {Miniati}, F., \& {Colella}, P. 2007, Journal of Computational Physics,
3544:   227, 400
3545: 
3546: \bibitem[{{Monaghan}(1992)}]{monaghan92}
3547: {Monaghan}, J.~J. 1992, Annu. Rev. Astron. Astrophys., 30, 543
3548: 
3549: \bibitem[{{Morel} {et~al.}(1998){Morel}, {Roberts}, \& J.}]{morel98}
3550: {Morel}, J.~E., {Roberts}, R.~M., \& J., S.~M. 1998, Journal of Computational
3551:   Physics, 144, 17
3552: 
3553: \bibitem[{{M{\"u}ller} \& {Steinmetz}(1995)}]{muller95}
3554: {M{\"u}ller}, E., \& {Steinmetz}, M. 1995, Computer Physics Communications, 89,
3555:   45
3556: 
3557: \bibitem[{{Rampp} \& {Janka}(2002)}]{rampp02}
3558: {Rampp}, M., \& {Janka}, H.-T. 2002, \aap, 396, 361
3559: 
3560: \bibitem[{{Rider}(2000)}]{rider00}
3561: {Rider}, W.~J. 2000, Journal of Computational Physics, 162, 395
3562: 
3563: \bibitem[{{Ruge} \& {Stuben}(1987)}]{ruge87}
3564: {Ruge}, J.~W., \& {Stuben}, K. 1987, {Algebraic multigrid (AMG)}, ed. S.~F.
3565:   S.~F.~{McCormick} (Philadelphia, PA: SIAM), 73–130
3566: 
3567: \bibitem[{{Shashkov} \& {Steinberg}(1995)}]{shashkov95}
3568: {Shashkov}, M.~J., \& {Steinberg}, S. 1995, Journal of Computational Physics,
3569:   118, 131
3570: 
3571: \bibitem[{{Shashkov} \& {Steinberg}(1996)}]{shashkov96}
3572: ---. 1996, Journal of Computational Physics, 129, 393
3573: 
3574: \bibitem[{{Shen} {et~al.}(1998){Shen}, {Toki}, {Oyamatsu}, \&
3575:   {Sumiyoshi}}]{shen98}
3576: {Shen}, H., {Toki}, H., {Oyamatsu}, K., \& {Sumiyoshi}, K. 1998, Nuclear
3577:   Physics A, 637, 435
3578: 
3579: \bibitem[{{Smarr} {et~al.}(1981){Smarr}, {Wilson}, {Barton}, \&
3580:   {Bowers}}]{smarr81}
3581: {Smarr}, L., {Wilson}, J.~R., {Barton}, R.~T., \& {Bowers}, R.~L. 1981, \apj,
3582:   246, 515
3583: 
3584: \bibitem[{{Stone} \& {Norman}(1992)}]{stone92a}
3585: {Stone}, J.~M., \& {Norman}, M.~L. 1992, \apjs, 80, 753
3586: 
3587: \bibitem[{{Symbalisty}(1984)}]{symbalisty84}
3588: {Symbalisty}, E.~M.~D. 1984, \apj, 285, 729
3589: 
3590: \bibitem[{{Thompson} {et~al.}(2003){Thompson}, {Burrows}, \&
3591:   {Pinto}}]{thompson03}
3592: {Thompson}, T.~A., {Burrows}, A., \& {Pinto}, P.~A. 2003, \apj, 592, 434
3593: 
3594: \bibitem[{{Truelove} {et~al.}(1998){Truelove}, {Klein}, {McKee}, {Holliman},
3595:   {Howell}, {Greenough}, \& {Woods}}]{truelove98}
3596: {Truelove}, J.~K., {Klein}, R.~I., {McKee}, C.~F., {Holliman}, II, J.~H.,
3597:   {Howell}, L.~H., {Greenough}, J.~A., \& {Woods}, D.~T. 1998, \apj, 495, 821
3598: 
3599: \bibitem[{{Von Neumann} \& {Richtmyer}(1950)}]{vonneumann50}
3600: {Von Neumann}, J., \& {Richtmyer}, R.~D. 1950, J. Appl. Phys., 21, 232
3601: 
3602: \bibitem[{{Wilkins}(1980)}]{wilkins80}
3603: {Wilkins}, M.~L. 1980, J. Comput. Phys., 36, 281
3604: 
3605: \bibitem[{{Woodward} \& {Colella}(1984)}]{woodward84}
3606: {Woodward}, P., \& {Colella}, P. 1984, Journal of Computational Physics, 54,
3607:   115
3608: 
3609: \bibitem[{{Woosley} \& {Weaver}(1995)}]{woosley95}
3610: {Woosley}, S.~E., \& {Weaver}, T.~A. 1995, \apjs, 101, 181
3611: 
3612: \end{thebibliography}
3613: 
3614: 
3615: \clearpage
3616: 
3617: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3618: %%%%  Tables   %%%%%%%%%%%%%%%%%%%%%%%%%%%
3619: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3620: 
3621: \begin{deluxetable}{ll}
3622: \tabletypesize{\scriptsize}
3623: \tablecaption{The predictor-corrector procedure.  The operations to
3624:   determine predicted and corrected values are listed in the left and
3625:   right columns, respectively.  See \S
3626:   \ref{section:predictor_corrector} for a detailed
3627:   discussion. \label{table:predictor-corrector}}
3628: \tablewidth{0pt}
3629: \tablehead{ \colhead{Predictor} & \colhead{Corrector}}
3630: \startdata
3631: $P^n \, \& \, \vec{S}^n \longrightarrow \vec{f}^{n}$ &
3632: $P^{n+1/2} \, \& \, \vec{S}^{n+1/2} \longrightarrow \vec{f}^{n+1/2}$
3633: \\
3634: $\vec{f}^n, \, \vec{f}^n_{\rm{visc}}, \, \vec{A}^n_p,
3635:   \, \& \, \vec{g}^n \longrightarrow
3636:   \vec{v}^{n+1,pr}$ &
3637: $\vec{f}^{n+1/2}, \, \vec{f}^n_{\rm{visc}}, \, \vec{A}^{n+1/2}_p,
3638:   \, \& \, \vec{g}^{n+1/2} \longrightarrow
3639:   \vec{v}^{n+1}$
3640: \\
3641: $\vec{v}^{n+1/2} = \frac{1}{2}(\vec{v}^{n+1,pr} + \vec{v}^n)$ &
3642: $\vec{v}^{n+1/2} = \frac{1}{2}(\vec{v}^{n+1} + \vec{v}^n)$
3643: \\
3644: $\vec{x}^{n+1,pr} = \vec{x}^n + \Delta t \vec{v}^{n+1/2}$ &
3645: $\vec{x}^{n+1} = \vec{x}^n + \Delta t \vec{v}^{n+1/2}$
3646: \\
3647: $\vec{f}^n \, \& \, \vec{v}^{n+1/2} \longrightarrow
3648: \varepsilon^{n+1,pr}$ &
3649: $\vec{f}^{n+1/2} \, \& \, \vec{v}^{n+1/2} \longrightarrow
3650: \varepsilon^{n+1}$
3651: \\
3652: $\vec{x}^{n+1,pr} \longrightarrow V^{n+1,pr} \longrightarrow
3653:   \rho^{n+1,pr}$ &
3654: $x^{n+1} \longrightarrow V^{n+1} \longrightarrow
3655:   \rho^{n+1}$
3656: \\
3657: calculate $\vec{g}^{n+1,pr} \, \& \, \vec{A}^{n+1,pr}_p$ &
3658: %calculate $\vec{g}^{n+1} \, \& \, \vec{A}^{n+1,pr}_p$
3659: \\
3660: $e^{n+1,pr} \& \rho^{n+1,pr} \longrightarrow P^{n+1,pr}$ &
3661: %$e^{n+1} \, \& \, \rho^{n+1} \longrightarrow P^{n+1}$
3662: \\
3663: $\vec{x}^{n+1/2} = \frac{1}{2}(\vec{x}^{n+1,pr} + \vec{x}^n)$ &
3664: 
3665: \\
3666: $P^{n+1/2} = \frac{1}{2}(P^{n+1,pr} + P^n)$ &
3667: 
3668: \\
3669: $\vec{g}^{n+1/2} = \frac{1}{2}(\vec{g}^{n+1,pr} + \vec{g}^n)$ &
3670: 
3671: \\
3672: $\vec{A}^{n+1/2}_p = \frac{1}{2}(\vec{A}^{n+1,pr}_p
3673: + \vec{A}^n_p)$ &
3674: 
3675: \\
3676: \enddata
3677: \end{deluxetable}
3678: 
3679: 
3680: \begin{deluxetable}{lll}
3681: \tabletypesize{\scriptsize}
3682: \tablecaption{
3683: Relative error in density, $(\rho_z - \rho_{\rm ana})/(\max(\rho_{\rm ana} ) )$,
3684: at the center for the Goldreich-Weber self-similar collapse test.  The
3685: first column is the time in milliseconds, and the second and third
3686: columns are the error between the simulation, $\rho_z$, and the analytic solution,
3687: $\rho_{\rm ana}$, scaled by the maximum density of the analytic
3688: solution $\max(\rho_{\rm ana})$ for 1D simulation and 2D simulations,
3689: respectively.  See \S \ref{section:gravity_tests} for a discussion.
3690: \label{table:gw}
3691: }
3692: \tablewidth{0pt}
3693: \tablehead{ \colhead{Time (ms)} & \colhead{1D} & \colhead{2D}}
3694: \startdata
3695: 0   & $-9.2 \times 10^{-8}$ & $-1.2 \times 10^{-7}$ \\
3696: 20  & $-7.2 \times 10^{-4}$ & $-1.4 \times 10^{-3}$ \\
3697: 40  & $-1.2 \times 10^{-3}$ & $-2.2 \times 10^{-3}$ \\
3698: 60  & $-1.9 \times 10^{-3}$ & $-3.6 \times 10^{-3}$ \\
3699: 80  & $-3.2 \times 10^{-3}$ & $-6.0 \times 10^{-3}$ \\
3700: 100 & $-6.2 \times 10^{-3}$ & $-1.1 \times 10^{-2}$ \\
3701: 120 & $-1.6 \times 10^{-2}$ & $-2.8 \times 10^{-2}$ \\
3702: 130 & $-3.6 \times 10^{-2}$ & $-6.3 \times 10^{-2}$ \\
3703: \enddata
3704: \end{deluxetable}
3705: 
3706: 
3707: \begin{deluxetable}{lllll}
3708: \tabletypesize{\scriptsize}
3709: \tablecaption{The analytic and simulated orientations of features for the Dukowicz
3710:   problem.  While \citet{dukowicz92} published the angles subtended by
3711:   various regions, we list the angles of each feature
3712:   with respect to the $x$-axis.\label{table:dukowicz}}
3713: \tablewidth{0pt}
3714: \tablehead{\colhead{} & \colhead{Transmitted Shock} & \colhead{Vortex Sheet} & \colhead{Reflected Shock} & \colhead{Incident shock}}
3715: \startdata
3716: Analytic (deg.) &-101.02 & -122.92 & 146.12 & 90 \\
3717: Simulation & -103.21 & -124.42 & 146.92 & 90.32 \\
3718: \enddata
3719: \end{deluxetable}
3720: 
3721: 
3722: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3723: %%%%  Figures  %%%%%%%%%%%%%%%%%%%%%%%%%%%
3724: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3725: 
3726: \clearpage
3727: 
3728: \begin{figure}
3729: \epsscale{0.8}
3730: \plotone{f1.ps}
3731: \caption{The flowchart for BETHE-hydro. See \S \ref{section:bethe_hydro} for a discussion.\label{flowchart}}
3732: \end{figure}
3733: 
3734: 
3735: \clearpage
3736: 
3737: \begin{figure}
3738: \epsscale{1.0}
3739: \plottwo{f2a.ps}{f2b.ps}
3740: \caption{On the left, a representative butterfly mesh and on the
3741:   right, a representative spiderweb mesh.  In general, we construct
3742:   meshes with much higher resolution.  However, to easily see the
3743:   features of the mesh we reproduce low resolution versions here.
3744:   The butterfly mesh is a standard grid that captures the benefits of
3745:   a spherical grid near the outer boundary and avoids the singularity
3746:   at the center. 
3747:   The spiderweb mesh captures the benefits of
3748:   a spherical grid throughout, but near the center, the
3749:   angular resolution is modified to avoid extreme Courant-condition limits and the
3750:   singularity.  Construction begins with half of an octagon at the
3751:   center.  Subsequent tiers of nodes are placed $\Delta r$ farther in
3752:   radius from the interior set.  When $r\Delta \theta$ exceeds $\Delta
3753:   r$ the angular size is halved.  For these transition nodes, $\Delta r$
3754:   is alternately multiplied by $1 + \epsilon$ and $1-\epsilon$ to
3755:   exaggerate the concavity of the cells.\label{grid_ex}}
3756: \end{figure}
3757: 
3758: \clearpage
3759: 
3760: \begin{figure}
3761: \epsscale{0.9}
3762: \plotone{f3.ps}
3763: \caption{A portion of an unstructured, polygonal mesh.  Filled
3764:   circles indicate node positions, $p$.  Crosses mark cell
3765:   centers, $z$.  Open circles show the mid-edge
3766:   locations.  Cells are bounded by the edges (solid lines), and the
3767:   cell is further divided into subcells via dashed
3768:   lines. $\vec{C}^z_{p+}$ and $\vec{C}^z_{p-}$ are the half-edge
3769: area vectors.  $\vec{a}^z_p$ and $\vec{a}^z_{p-1}$ are the area
3770: vectors for the lines connecting the cell centers and mid-edges (see
3771: \S \ref{section:coords_mesh} for a discussion).\label{fig:grid}}
3772: \end{figure}
3773: 
3774: \clearpage
3775: 
3776: \begin{figure}
3777: \epsscale{0.6}
3778: \plotone{f4a.ps} \\
3779: \plotone{f4b.ps}
3780: \caption{Plots of $v_{\phi}$ vs. $r$ (top
3781: panel) and $\Omega$ vs. $r$ (bottom panel) for the simple rotational
3782: test discussed in \S \ref{section:rot_test}.  We employ three remapping regions.  The inner 0.1 cm is
3783: Eulerian, zones exterior to 0.2 cm follow Lagrangian dynamics, and the
3784: region in between provides a smooth transition between the two domains.
3785: $v_{\phi}$ and  $\Omega$ profiles are presented at $t =
3786:   0.0, 0.1, 0.2, 0.35, 0.45, 0.55, 0.65, 0.75, 0.85$, and $1.0$ s.
3787: In the top panel, the deviation of the simulation (crosses) from the analytic solution (solid lines) is not
3788: discernible.  The maximum error as measured by
3789: $(v_{\phi,{\rm ana}} - v_{\phi})/ {\rm max}(v_{\phi,{\rm ana}})$ is
3790: $\sim 4 \times 10^{-5}$ near the beginning of the simulation and
3791: $\sim 8 \times 10^{-4}$ at the end.  The $\Omega$ vs. $r$ panel (bottom) shows similar accuracy, except at the center, where
3792: $(\Omega_{\rm ana} -\Omega)$ reaches a maximum value of 0.2 rads
3793: s$^{-1}$ at $t = 0.55$ s.
3794: \label{rottestplot}}
3795: \end{figure}
3796: 
3797: \clearpage
3798: 
3799: \begin{figure}
3800: \epsscale{0.6}
3801: \plotone{f5a.ps}\\
3802: \plotone{f5b.ps}
3803: \caption{Potential of a uniform density sphere.  The density of the
3804:   sphere is 1 g cm$^{-3}$ and the radius is 1 cm.  Presented are
3805:   results for four
3806:   resolutions of the butterfly mesh (see left panel of Fig. \ref{grid_ex}):
3807:   2550 cells with an effective radial resolution $\Delta r \sim$ 0.02
3808:   cm (blue); 8750 cells with $\Delta r \sim$ 0.01 cm (green); 15,200 cells with
3809:   $\Delta r \sim$ 0.006 cm (yellow); and 35,000 cells with $\Delta r
3810:   \sim$ 0.005 cm (red).  
3811:   The top panel
3812:   shows $(\Phi - \Phi_{\rm{ana}})/|\Phi_{\rm{ana}}|$, where $\Phi$ are
3813:   the cell-center potentials as determined by the Poisson solver, and
3814:   $\Phi_{\rm{ana}}$ is the analytic potential.  The bottom panel shows the
3815:   minimum error for each resolution as a function of the effective
3816:   radial resolution.  The solid line illustrates the fact that the 2D Poisson
3817:   solver converges with 2$^{\rm{nd}}$-order accuracy.
3818: \label{maclaurin_sphere}}
3819: \end{figure}
3820: 
3821: \clearpage
3822: 
3823: \begin{figure}
3824: \epsscale{0.5}
3825: \plotone{f6a.ps}\\
3826: \plotone{f6b.ps}
3827: \caption{The potential of a homogeneous
3828: spheroid with $e = 0.8$ (top panel) and the relative accuracy of the
3829: potential, $(\Phi - \Phi_{\rm ana})/|\Phi_{\rm ana}|$ (bottom panel).
3830: $\rho_0 = 1$ g cm$^{-3}$ and the equatorial radius is $r_a = 1$ cm.  For the given eccentricity, the polar-axis
3831: radius, $r_b$, is 0.6 cm.  The grid is a butterfly mesh, but
3832: the outer boundary follows the ellipse defining the
3833: surface of the spheroid.  With $N_{\rm{cell}} =
3834: 35,000$ and $\Delta r/r_a \sim 0.005$, the relative error in the
3835: potential ranges from $\sim$2 $\times 10^{-6}$ near the outer boundary
3836: to $\sim$3 $\times 10^{-5}$ in interior regions.  
3837: Features in the relative error that track abrupt grid orientation changes in
3838: the mesh are apparent, but the magnitude of these features does not
3839: dominate the errors.
3840: \label{maclaurin_spheroid}}
3841: \end{figure}
3842: 
3843: \clearpage
3844: \begin{figure}
3845: \epsscale{.80}
3846: \plotone{f7.ps}
3847: \caption{Hydrostatic Equilibrium.  The grid is the butterfly mesh
3848:   with 8750 zones.  The initial model is a Lane-Emden polytrope with
3849:   $\gamma = 5/3$, $M = 1$ M$_{\sun}$, and $R = 2.9 \times 10^{10}$
3850:   cm.  The green crosses show the density profile at $t = 1 \times 10^{4}$
3851:   s.  The solid line shows the maximum density as a function of time.
3852:   The oscillations are due to the slight difference between an analytic
3853:   hydrostatic equilibrium structure and a discretized hydrostatic
3854:   equilibrium structure.  This figure shows the code's ability to follow
3855:   oscillations for many periods with very little or no attenuation. 
3856: \label{laneemden_plot}}
3857: \end{figure}
3858: 
3859: \clearpage
3860: 
3861: \begin{figure}
3862: \epsscale{.60}
3863: \plotone{f8a.ps} \\
3864: \plotone{f8b.ps}
3865: \caption{Density profiles
3866: for Goldreich-Weber self-similar collapse in 1D (top
3867: panel) and 2D (bottom panel) and at $t = $0, 20, 40, 60, 80,
3868: 100, 120, and 130 ms.  Simulation results (crosses) are compared with
3869: analytic solutions (solid lines).  
3870: A gamma-law EOS is used with $\gamma = 4/3$.
3871: The physical
3872:   dimensions have been scaled so that $M = 1.3$ M$_{\sun}$, the
3873:   initial central density is $10^{10}$ g cm$^{-3}$, and the maximum
3874:   radius of the profile is $1.66 \times 10^8$ cm.  The initial grid
3875:   for the 1D simulation
3876:   uses 200 evenly-spaced zones. For the 2D simulation, a butterfly mesh with 35,000 zones with
3877:   effectively 200 radial zones is used.  These tests are calculated
3878:   using the Lagrangian configuration.
3879: See \S \ref{section:gravity_tests}
3880: and Table \ref{table:gw} for quantitative discussion of the accuracy.
3881: \label{gwplot}}
3882: \end{figure}
3883: 
3884: \clearpage
3885: 
3886: \begin{figure}
3887: \epsscale{.90}
3888: \plotone{f9.ps}
3889: \caption{Comparison when hourglass suppression is turned off (left)
3890:   and on (right) for the Goldreich-Weber self-similar collapse.  The
3891:   simulations in this figure were run in the Lagrangian configuration
3892:   with the butterfly mesh.  Displayed in the
3893:   region ``$r > 0$'' are results at $t = 0.118$ s when the hourglass suppression scheme of
3894:   \S \ref{section:hourglass} is used and the scale factor has been
3895:   set to 2.0.  The results shown in the region ``$r < 0$'' represent what
3896:   happens when the hourglass suppression scheme is turned off. \label{gw_fmerit_comp}}
3897: \end{figure}
3898: 
3899: \clearpage
3900: 
3901: \begin{figure}
3902: \epsscale{.80}
3903: \plotone{f10.ps}
3904: \caption{Single-mode Rayleigh-Taylor instability: investigating
3905:   hourglass suppression schemes (see \S \ref{section:rt} for a
3906:   description of the setup).  We present the
3907:   results of the single-mode Rayleigh-Taylor instability with no
3908:   hourglass fix (left panel), the hourglass subcell pressure scheme of
3909:   \citet{caramana98a} (center panel), and the modified subpressure
3910:   scheme described in this paper (right panel).  While the results of
3911:   the left panel are acceptable, there are hints of hourglass patterns
3912:   in the contours.  The central panel is a consequence of
3913:   the incompatible nature of the subcell remapping scheme and the
3914:   subcell pressure scheme of \citet{caramana98a}, and our modified
3915:   subpressure scheme (right panel) suppresses the hourglass
3916:   distortions, while preserving the expected flow.
3917: \label{rt_stills_fmerit}}
3918: \end{figure}
3919: 
3920: \clearpage
3921: 
3922: \begin{figure}
3923: \epsscale{.90}
3924: \plotone{f11.ps}
3925: \caption{Remapping a 1D step function. A step function in density is
3926:   remapped many times with a grid that oscillates for two full cycles.
3927:   There are 51 nodes (50 cells) and $n_{\rm max} = 800$ remapping
3928:   steps.  The top panel displays the density profile for remapping
3929:   steps 0 to $1/2 n_{rm max}$, and the bottom panel shows the profile for
3930:   steps $1/2 n_{\rm max}$ to $n_{\rm max}$.  Initially, the
3931:   discontinuity spreads over a small number of zones ($\sim$4), and in
3932:   later steps (bottom panel) the discontinuity spreads very slowly.  \label{rhoremap_step}}
3933: \end{figure}
3934: 
3935: \clearpage
3936: 
3937: \begin{figure}
3938: \epsscale{0.7}
3939: \plotone{f12a.ps}\\
3940: \plotone{f12b.ps}
3941: \caption{
3942: The $L^1$-norm as a function of
3943: $\Delta r$ (crosses), the initial zone size, is plotted for Goldreich-Weber simulations in 1D
3944: (top panel) and 2D (bottom panel).  The $L^1$-norm is calculated at t
3945: = 130 ms for both simulations.  Both 1D and 2D simulations (crosses)
3946: converge with roughly 2$^{\rm nd}$-order accuracy (solid line).  See
3947: \S \ref{section:2ndorder}.
3948: \label{gw_resstudy}}
3949: \end{figure}
3950: 
3951: \clearpage
3952: 
3953: \begin{figure}
3954: \epsscale{.80}
3955: \plotone{f13.ps}
3956: \caption{Sod shock tube test.  For a gamma-law EOS and $\gamma = 1.4$,
3957:   we compare the results of the 1D Lagrangian (bottom), 1D Eulerian
3958:   (2nd from the bottom), 2D Lagrangian (3rd), and 2D Eulerian (top) Sod
3959:   shock tube tests with the analytic result (solid lines).  Other than
3960:   the 1D Lagrangian results, the density profiles have
3961:   been shifted vertically to distinguish features.  The profiles
3962:   are further separated by displaying them at different times: 1D
3963:   Lagrangian ($t = 0.2$ s), 1D Eulerian
3964:   ($t = 0.225$ s), 2D Lagrangian ($t = 0.25$ s), and 2D Eulerian ($t =
3965:   0.275$ s).  The 1D calculations are
3966:   resolved with 400 zones, and the 2D tests are resolved with 400x10
3967:   zones.  See \S \ref{section:sod} for a discussion.\label{sodplot}}
3968: \end{figure}
3969: 
3970: \clearpage
3971: \begin{figure}
3972: \epsscale{.60}
3973: \plotone{f14a.ps}\\
3974: \plotone{f14b.ps}
3975: \caption{
3976: Density profiles of the Sedov blast wave test.  The Sedov blast energy
3977: is 0.244816 ergs.  Initial conditions are 
3978: $\rho_0 = 1.0$ g cm$^{-3}$, $\varepsilon_0 = 1 \times 10^{-20}$ ergs
3979: g$^{-1}$, and the gamma-law EOS has $\gamma = 5/3$.  
3980: Top panel compares the simulations (crosses) with the analytic result
3981: (solid lines) for 1D Lagrangian ($t = 0.4$ s), 1D Eulerian ($t = 0.53$ s), 2D Lagrangian using the butterfly
3982: mesh ($t = 0.66$ s), and 2D Lagrangian using the spiderweb mesh ($t =
3983: 0.80$ s).
3984: 1D calculations are resolved with 400
3985: zones. The spiderweb test has a total of 12,381 zones with 200 radial
3986: zones and a maximum of 64 angular zones.  The butterfly mesh has a
3987: total of 35,000 zones with effectively 200 radial
3988: and 200 angular zones.
3989: Plotted in the bottom panel are the relative errors of the density,
3990: $(\rho - \rho_{\rm ana})/\rho_{\rm max}$, vs. radius, where $\rho$
3991: is the simulated density profile, $\rho_{\rm ana}$ is the analytic
3992: profile, and $\rho_{\rm max}$ is the maximum density of the analytic profile.
3993: \label{sedovplot}}
3994: \end{figure}
3995: 
3996: \clearpage
3997: 
3998: \begin{figure}
3999: \epsscale{.80}
4000: \plotone{f15.ps}
4001: \caption{Density profile for the Noh Problem at $t = 0.2$ s.  The solid line is the analytic solution for $\gamma
4002:   = 5/3$, and the crosses show the numerical results for resolutions of
4003:   200, 400, 800, and 1600 zones.  The downturn of the density profile near
4004:   the center is ``wall heating,'' a common problem for Lagrangian
4005:   schemes \citep{rider00}.  For the post shock material, the higher
4006:   resolution runs capture the analytic solution.  The upstream
4007:   flow matches the analytic solution for all resolutions.
4008: \label{noh1dres}}
4009: \end{figure}
4010: 
4011: \clearpage
4012: 
4013: \begin{figure}
4014: \epsscale{1.1}
4015: \plottwo{f16a.ps}{f16b.ps}\\
4016: \plottwo{f16c.ps}{f16d.ps}
4017: \caption{Similar to Fig. \ref{noh1dres}, except here we present the
4018:   results of 2D tests.  All but the lower-right show results using 2D
4019:   Cartesian coordinates.  The lower-right shows results using 2D cylindrical
4020:   coordinates.  The grids used are: a Cartesian
4021: grid with 100$\times$200 zones (top-left and lower-right), a butterfly
4022: mesh with 22,400 zones (top-right), and a spiderweb mesh with 8550
4023: zones (lower-left).  Both the top-left and
4024: bottom-right panels indicate that using the Cartesian mesh produces fairly smooth results, with some ($\sim$7\%)
4025: asymmetry in the post-shock region.  Using the spiderweb mesh produces
4026: perfectly symmetric solutions except near the center where the
4027: deviation from symmetry is as large as $\sim$25\%.  Using the butterfly
4028: mesh produces similar mixed accuracy in symmetry.
4029: \label{nohplot_2d}}
4030: \end{figure}
4031: 
4032: \clearpage
4033: \begin{figure}
4034: \epsscale{0.8}
4035: \plotone{f17a.ps} \\
4036: \plotone{f17b.ps}
4037: \caption{
4038: Saltzman piston problem. This problem tests the code's ability to
4039: resolve shocks that are oblique to the orientation of the grid. The
4040: top panel shows the initial  grid with $100 \times 10$ zones. The left
4041: wall is a piston moving at a constant velocity, 1.0 cm s$^{-1}$, to
4042: the right.  Initially, the density and internal energy are set equal
4043: to 1.0 g cm$^{-3}$ and 0.0 ergs, respectively, and we use a gamma-law
4044: EOS with $\gamma = 5/3$.  The grid and
4045: the density colormap are shown in the bottom panel at $t = 0.925$
4046: s. See \S \ref{section:saltzman} for a discussion of the results.
4047: \label{saltzman}}
4048: \end{figure}
4049: 
4050: \clearpage
4051: \begin{figure}
4052: \epsscale{0.8}
4053: \plotone{f18a.ps}\\
4054: \plotone{f18b.ps}
4055: \caption{
4056: The Dukowicz piston problem, another test
4057: using an oblique mesh.  The initial setup involves two
4058: regions having an interface with a 60$^{\circ}$ orientation with the
4059: vertical.  The top panel shows a low-resolution example of the grid used.  Region 1 has a density of 1 g cm$^{-3}$ and is resolved with
4060: $144 \times 120$ zones, and region 2 has a
4061: density of 1.5 g cm$^{-3}$ and is gridded with a $160 \times 120$ mesh,
4062: with the vertical mesh lines uniformly slanted at 60$^{\circ}$.
4063: Initially both regions are in equilibrium with $P = 1.0$ erg
4064: cm$^{-3}$.  The left boundary is a piston with a velocity in the positive $x$
4065: direction and a magnitude of 1.48 cm s$^{-1}$.
4066: The piston-driven shock
4067:   travels from left to right, and encounters the interface.
4068:   The incident shock continues to the lower density region, a
4069:   transmitted/refracted shock propagates into the higher density
4070:   region, a vortex sheet develops behind the transmitted shock, and a
4071:   reflected shock propagates into the incident shock's post-shock
4072:   flow.   The orientations of the flow are reproduced accurately (see
4073:   \S \ref{section:dukowicz} and Table \ref{table:dukowicz}).
4074: \label{dukowicz}}
4075: \end{figure}
4076: 
4077: \clearpage
4078: 
4079: \begin{figure}
4080: \epsscale{1.0}
4081: \plotone{f19.ps}
4082: \caption{
4083: Nonlinear phase of a single mode of the Rayleigh-Taylor instability at
4084: $t = 12.75$ s.
4085: The top and bottom densities are
4086: $\rho_1 = 2.0$ g cm$^{-3}$ and $\rho_2 = 1.0$ g cm$^{-3}$, respectively, and the gravitational
4087: acceleration points downward with magnitude $g = 0.1$ cm s$^{-2}$.
4088: The top and bottom boundaries are reflecting while the left and right
4089: boundaries are periodic.  From left to right, grid sizes are $50 \times 150$, $74 \times
4090: 222$, $100 \times 300$ (this is the resolution used in Fig. \ref{rt_stills_fmerit}), and $150 \times 450$.  See \S \ref{section:rt} for discussions
4091: comparing these results with those in other works.
4092: \label{rt_stills_res}}
4093: \end{figure}
4094: 
4095: \clearpage
4096: 
4097: \begin{figure}
4098: \epsscale{.80}
4099: \plotone{f20.ps}
4100: \caption{Single-mode Rayleigh-Taylor instability: investigating the
4101:   artificial viscosity parameter.  The same resolution, setup, and
4102:   time are shown as presented in Fig. \ref{rt_stills_fmerit} and the third panel
4103:   of Fig. \ref{rt_stills_res}.  Each panel shows results for
4104:   different values of the
4105:   artificial viscosity parameter, $c_1$, that is the coefficient of $c_s (\vec{\nabla}
4106:   \cdot \vec{v})$ (see \S \ref{section:artificial_viscosity}).
4107:   The artificial viscosity parameters are $c_1 = 0.01$ (left panel), $c_1 =
4108:   0.1$ (center panel) and, $c_1 = 1.0$ (right panel).  From this analysis, it would seem
4109:   that one should choose the lower values of $c_1$ to accurately
4110:   represent low Mach number Rayleigh-Taylor flows.  However,
4111:   higher values help to eliminate unwanted ringing in post
4112:   shock flows.
4113: \label{rt_stills_visc}}
4114: \end{figure}
4115: 
4116: \clearpage
4117: 
4118: \begin{figure}
4119: \epsscale{.80}
4120: \plotone{f21.ps}
4121: \caption{
4122: The interface
4123: amplitude vs. time for the single-mode Rayleigh-Taylor instability
4124: test.  Resolutions and setup are similar to those presented in Fig. \ref{rt_stills_visc}.
4125: We compare the analytic exponential growth rate (solid line) with
4126: simulation results (dashed lines) for viscosity
4127:   parameters, $c_1$, of 0.01, 0.1, and 1.0.  Simulations with $c_1 = 0.01$ and 0.1 manifest exponential growth for several
4128:   e-folding times, while the run with $c_1 = 1.0$ seems
4129:   to follow the linear phase for  only 1 s ($\sim$ 1/2 e-folding).
4130: \label{rt_linear}}
4131: \end{figure}
4132: 
4133: \clearpage
4134: \begin{figure}
4135: \epsscale{.70}
4136: \plotone{f22a.ps}\\
4137: \plotone{f22b.ps}
4138: \caption{
4139: Kelvin-Helmholtz shear instability.  The domain is resolved with $256
4140: \times 256$ zones.  The bottom region has $\rho_{\rm b} = 1.0$, and
4141: the top region has $\rho_{\rm t} = \rho_{\rm b}/\chi$, where $\chi =
4142: 8$, and both regions have $P = 1.0$ erg cm$^{-3}$.  A gamma-law EOS is
4143: used with $\gamma = 5/3$.  The top panel shows the development of Kelvin-Helmholtz rolls at
4144: $t= 5.5$ s for $v_{\rm shear} = \frac{1}{4} c_b$ and $\tau_{\rm KH} $
4145: 0.523 s.
4146: The bottom plot of Fig. \ref{kh_still} shows the interface amplitude
4147: (solid line) vs. time and compares to the expected exponential growth
4148: (dashed line) for a simulation with $v_{\rm shear} = \frac{1}{4}c_b$
4149: (green) and $v_{\rm shear} = \frac{1}{2}c_b$ (blue).  There are three
4150: distinct phases in the log-linear plot: an early transient phase, a
4151: phase in which the slope most closely matches the exponential growth
4152: rate, and the subsequent nonlinear phase.
4153: \label{kh_still}}
4154: \end{figure}
4155: 
4156: \clearpage
4157: 
4158: \begin{figure}
4159: \plotone{f23.ps}
4160: \caption{Density vs. radius for the core collapse of a 15-M$_{\sun}$ star.  The model is the s15
4161:   model of Weaver \& Woosley.  Density vs. radius for 1D (lines) and
4162:   2D (crosses) at times 0, 70, 110, 130, 140, and 150 ms after the
4163:   start of the calculation.  Core bounce occurs at 148 ms.  The 2D
4164:   grid is composed of a butterfly mesh in the interior with a minimum
4165:   cell size of $\sim$0.5 km and extends to 50 km.  A spherical grid
4166:   extends the domain out to 4000 km.  There are 23,750 cells in total,
4167:   with an effective resolution of $\sim$250 radial and $\sim$100 angular
4168:   zones.  The 1D grid has
4169:   250 zones, with similar resolution to the 2D run at all radii.  For the
4170:   most part, the 1D and 2D calculations track one another quite well.
4171:   There is roughly a $\sim$10\% difference in the shock radii at 150 ms.
4172: \label{cc_rhoplot}}
4173: \end{figure}
4174: 
4175: \clearpage
4176: 
4177: \begin{figure}
4178: \plotone{f24.ps}
4179: \caption{Radial component of the gravitational acceleration during the
4180:   core collapse of a 15-M$_{\sun}$ star.  Similar to
4181:   Fig. \ref{cc_rhoplot}.  Note the good match between the
4182:   1D and 2D results.
4183: \label{cc_gaccplot}}
4184: \end{figure}
4185: 
4186: \clearpage
4187: 
4188: \begin{figure}
4189: \plotone{f25.ps}
4190: \caption{
4191: Angular velocity evolution during the core collapse of a rotating 15-M$_{\sun}$ star.  This test problem was calculated on the same grid
4192:   as in Fig. \ref{cc_rhoplot}. The initial angular velocity profile is
4193:   constant on cylinders and is given by
4194:   $\Omega(r) = 1/(1 + (r/A)^2)$, where $A = 1000$ km and $\Omega_0 =
4195:   2$ radians s$^{-1}$.  As expected, the central
4196:   angular velocity, $\Omega_c$ is proportional to $\rho_c^{2/3}$, where $\rho_c$ is
4197:   the central density.  The central density compresses from
4198:   $\sim$10$^{10}$ g cm$^{-3}$ at $t = 0$ ms to $\sim$2.2 $\times 10^{14}$ g
4199:   cm$^{-3}$ at $t = 160$ ms.  Therefore, at $t = 160$ ms, $\Omega_c$ should be
4200:   $\sim$1600 radians s$^{-1}$, consistent with results shown
4201:   in this figure.  Other than a slight,
4202:   but noticeable, glitch at the location of the shock ($\sim$180 km), the angular velocity
4203:   evolves smoothly with no evidence of axis effects.
4204: \label{cc_angvelplot}}
4205: \end{figure}
4206: 
4207: \end{document}