AMRCART:
by
Doris Folini and
Rolf Walder


Page contentsAbstractIntegrators Adaptive Mesh Graphics and Visualization Implemented Problems History Access References and Links 

AbstractAMRCART is part of the AMAZE code package which provides codes for astrophysical simulations.AMRCART solves in 1D, 2D, or 3D the ideal, compressible, hydrodynamical or magnetohydrodynamical equations with arbitrary source terms. We use fractional step methods to solve the inhomogeneous equations. Different highresolution finite volume integrators are implemented to solve the MHD equations. Highorder ODEsolvers are used for the integration of the source terms. AMRCART uses Cartesian meshes (CART) and fully adaptive mesh refinement (AMR) for solving unsteady problems. More information on the codes you find in this brief documentation of AMRCART. AMRCART has been widely used by the Zürich group for different astrophysical flow problems, for example Symbiotic binaries, WR+O binaries, Shock bound slabs, and Molecular clouds. Several relevant astrophysical problems are implemented in the code. A new problem is easily implemented, as only three subroutines, describing the source terms, the initial, and the boundary conditions, have to be adapted. IntegratorsAMRCART uses high resolution finite volume methods to integrate the homogeneous HD and MHD equations. The user can choose between two truly multidimensional integrators, one by Colella (1990) the other by LeVeque (1997), and the modified LaxFriedrichs method proposed by Barmin et al. (1996).AMRCART provides several explicit or implicit ODEintegrators for integration of the source terms. It uses a fractional step method to solve the inhomogeneous flow equations. Adaptive Mesh RefinemenThe Adaptive Mesh Refinement algorithm of Marsha Berger is implemented in the code. In the simulation, this allows to resolve the many different spatial and temporal scales often appearing in astrophysical fluid flows.In AMRCART, the mesh on which the numerical solution is computed is organized in the form of hierarchically nested levels. Higher levels in the hierarchy have smaller mesh cells than levels lower in the hierarchy. Each level of refinement is composed of one or several regular quadrilateral blocks (see the examples below). Each individual block comprises a number of cells, each of which corresponds to one discretized data point. Within an individual block the size of the cells is fixed. The extention of a cell in each direction is constant, the cells are square shaped or cubic. A mesh remains fixed for a few time steps only before it is again adapted to the new, unsteady flow structure. Refinement on the basis of truncation errors In a first step, the local truncation error is estimated by comparing for each cell the solution on the actual mesh with the solution on a coarsened mesh. Cells having a larger local truncation error than a chosen threshold are flagged to be refined. In a subsequent step, quadrilateral blocks embedding all flagged cells are constructed. The mesh is then refined in these blocks. Example 1 and 2 illustrate this case. Refinement on the basis of geometry Alternatively, the blocks containing small mesh cells can be constructed on the basis of geometrical considerations or special flow features. Example 3 illustrates this case. Example 1: 2D timedependent meshstructure of a magnetic jet simulation We show the timedependent construction of a hierarchical mesh with a total of 5 levels at the example of a 2D simulation of the interaction of a molecular, magnetic jet from a protostar with the magnetic protostellar cloud. The computational box of the simulation is 5 x 10^(17) cm by 10^(18) cm. Fig. 1 shows density, logarithmically colored, as well as the hierarchical structure of the mesh. The coarsest cells measure 2.5 x 10^(16) cm squared. The mesh then carries 4 refined levels, each consisting of several quadrilateral blocks. Blocks of the first refinement level, cell size (6.25 x 10^(15) cm)^2, are colored in red, blocks of the second refinement level, cell size (1.56 x 10^(15) cm)^2, are colored in purple, blocks of the third refinement level, cell size (3.9 x 10^(14) cm)^2, are colored in white, blocks of the fourth refinement level, cell size (9.8 x 10^(13) cm)^2, are colored in black. The maximum number of blocks in this example is 648, the complete mesh consists of approximately 10 million cells. Approximately 10^(11) cells have been integrated during the entire simulation. At the beginning, levels with small mesh cells (high levels in the hierarchy) are constructed only in the neighborhood of the protostellar core (Fig. 1, left). In the final constellation (29378 y), the fine mesh is covering the turbulent zone of the unstable jet as well as the bow shock formed where the jet interacts with the protostellar cloud (Fig. 1, right).
This animation (mpeg, 1.1 MB) shows the timedependent adaptation of the mesh. Example 2: 3D mesh of a magnetic jet simulation As an example in 3D we again take the interaction of a molecular, magnetic jet from a protostar with the magnetic protostellar cloud. Below we show the computational box (in black) of this simulation together with the hierarchical mesh structure (left) and a zoom showing the interaction surface together with the blocks of the finest level of refinement. The size of the computational box is 2.5 x 10^(17) cm by 2.5 x 10^(17) cm by 5 x 10^(17) cm. The mesh is Cartesian with a cell size of 1.25 x 10^(16) cm cubed on the coarsest level. 4 levels of refinement exist, the cells being refined by a factor of 4 between successive levels. The finest blocks (blue in Fig.2) contain cells of 2 x 10^(14) cm cubed, which is more than 3 orders of magnitude smaller than the computational box. In this example, 63 hierarchically nested blocks are used and the total number of mesh cells is again about 10 million. Graphics and Visualization3D and 2DWe provide visualization tools on the basis of AVSExpress, NCARgraphics, and AVS 5. In close collaboration with our institute, Dr. J. Favre from CSCS has developed tools on top of AVSExpress for fast visualization of timedependent, hierarchical, multiblock data.To allow for a simple but less powerful visualization a fortran code can be supplied which interpolates a regular array of a flow variable from the full adaptive 3D data set dumped by AMRCART. This regular data array can then be visualized with any commercial visualization package, e. g. IDL. 1DMaster1D, a package of macros based on IDL, has been developed. The package allows to simultaneously visualize different flow variables of different data files in different windows.Implemented problemsAt present, the following astrophysical problems are implemented:
History
AccessAt the moment, the following versions are available:MHD 3D : betaversion of MHD 2D : betaversion of MHD 1D : betaversion of Hydro 3D : Version 1.0 Hydro 2D : Version 1.0 Hydro 1D : Version 1.0 See here how to access the codes. Links to further informations
ReferencesA. A. Barmin, A. G. Kulikovskij, and N. V. PogorelovShock capturing Approach and Nonevolutionary Solutions in Magntodydrodynamics, Journal of Computational Physics, 126, 77 (1996). Marsha J. Berger and Randall J. LeVeque, Adaptive Mesh Refinement using WavePropagation Algorithms for Hyperbolic Systems, SIAM J. Numer. Anal., 35, 22982316 (1998). Available as a 300KB gzipped postscript file. Marsha J. Berger and Randall J. LeVeque, Cartesian Meshes and Adaptive Mesh Refinement for Hyperbolic Partial Differential Equations, Proc. 3rd Int. Conf. Hyperbolic Problems, Uppsala, Sweden 1990. Marsha J. Berger, Adaptive mesh refinement for Hyperbolic Equations, Lectures in Applied Mathematics, 22, 3140 (1985). Marsha J. Berger and Phillip Colella, Local Adaptive Mesh refinement for Shock Hydrodynamics, Journal of Computational Physics, 82, pages 6484 (1989). Phillip Colella Multidimensional Upwind Methods for Hyperbolic Conservation Laws Journal of Computational Physics, 87, pages 171 (1990). Randall J. LeVeque, Wave propagation algorithms for multidimensional hyperbolic systems Journal of Computational Physics,131, 327353 (1997). K. G. Powell, P. L. Roe, and T. J. Linde A solution adaptive upwind scheme for ideal mhd Journal of Computational Physics, 154, 284309, (1999). S. A.E.G. Falle, S. S. Komissarov, and P. Joarder A multidimensional upwind scheme for MHD Monthly notices of the Royal Astronomical Society, 297,265277, (1998). 
Send comments to authors of AMAZE: folini@astro.phys.ethz.ch and walder@astro.phys.ethz.ch 
Last Update: October 14, 2002
