We describe the structure and implementation of a radiation hydrodynamic solver for MANGA, the moving-mesh hydrodynamics module of the large-scale parallel code, Charm N-body GrAvity solver (ChaNGa). We solve the equations of time dependent radiative transfer using a reduced speed of light approximation following the algorithm of Jiang et al (2014). By writing the radiative transfer equations as a generalized conservation equation, we solve the transport part of these equations on an unstructured Voronoi mesh. We then solve the source part of the radiative transfer equations following Jiang et al (2014) using an implicit solver, and couple this to the hydrodynamic equations. The use of an implicit solver ensure reliable convergence and preserves the conservation properties of these equations even in situations where the source terms are stiff due to the small coupling timescales between radiation and matter. We present the results of a limited number of test cases (energy conservation, momentum conservation, dynamic diffusion, linear waves, crossing beams, and multiple shadows) to show convergence with analytic results and numerical stability. We also show that it produces qualitatively the correct results in the presence of multiple sources in the optically thin case.
We present the public Monte Carlo photoionization and moving-mesh radiation hydrodynamics code CMacIonize, which can be used to simulate the self-consistent evolution of HII regions surrounding young O and B stars, or other sources of ionizing radiation. The code combines a Monte Carlo photoionization algorithm that uses a complex mix of hydrogen, helium and several coolants in order to self-consistently solve for the ionization and temperature balance at any given type, with a standard first order hydrodynamics scheme. The code can be run as a post-processing tool to get the line emission fro…
We introduce the moving mesh code Shadowfax, which can be used to evolve a mixture of gas, subject to the laws of hydrodynamics and gravity, and any collisionless fluid only subject to gravity, such as cold dark matter or stars. The code is written in C++ and its source code is made available to the scientific community under the GNU Affero General Public License. We outline the algorithm and the design of our implementation, and demonstrate its validity through the results of a set of basic test problems, which are also part of the public version. We also compare Shadowfax with a number of ot…
We describe the structure and implementation of a moving-mesh hydrodynamics solver in the large-scale parallel code, Charm N-body GrAvity solver (ChaNGa). While largely based on the algorithm described by Springel (2010) that is implemented in AREPO, our algorithm differs a few aspects. We describe our use of the Voronoi tessellation library, VORO++, to compute the Voronoi tessellation directly. We also incorporate some recent advances in gradient estimation and reconstruction that gives better accuracy in hydrodynamic solutions at minimal computational cost. We validate this module with a sma…
Current Voronoi based moving mesh hydro codes suffer from "grid noise". We identify the cause of this noise as the volume inconsistency error, where the volume that is transferred between cells is inconsistent with the hydrodynamical calculations. As a result, the codes do not achieve second order convergence. In this paper we describe how a simple fix allows Voronoi based moving mesh codes to attain second order convergence. The fix is based on the understanding that the volume exchanged between cells should be consistent with the hydrodynamical calculations. We benchmark our fix with three t…
We extend the state-of-the-art N-body code PKDGRAV3 with the inclusion of mesh-free gas hydrodynamics for cosmological simulations. Two new hydrodynamic solvers have been implemented, the mesh-less finite volume and mesh-less finite mass methods. The solvers manifestly conserve mass, momentum and energy, and have been validated with a wide range of standard test simulations, including cosmological simulations. We also describe improvements to PKDGRAV3 that have been implemented for performing hydrodynamic simulations. These changes have been made with efficiency and modularity in mind, and pro…
We present a new method for numerical hydrodynamics which uses a multidimensional generalisation of the Roe solver and operates on an unstructured triangular mesh. The main advantage over traditional methods based on Riemann solvers, which commonly use one-dimensional flux estimates as building blocks for a multidimensional integration, is its inherently multidimensional nature, and as a consequence its ability to recognise multidimensional stationary states that are not hydrostatic. A second novelty is the focus on Graphics Processing Units (GPUs). By tailoring the algorithms specifically to …
The detection of gravitational waves has opened a new era for astronomy, allowing for the combined use of gravitational wave and electromagnetic emissions to directly probe the physics of compact objects, still poorly understood. So far, the theoretical modelling of these sources has mainly relied on standard numerical techniques as grid-based methods or smoothed particle hydrodynamics, with only a few recent attempts at using new techniques as moving-mesh schemes. Here, we introduce a general relativistic extension to the mesh-less hydrodynamic schemes in the code GIZMO, which benefits from t…
In the interstellar medium of galaxies and the intracluster gas of galaxy clusters, the charged particles making up cosmic rays are moving almost exclusively along (but not across) magnetic field lines. The resulting anisotropic transport of cosmic rays in the form of diffusion or streaming not only affects the gas dynamics but also rearranges the magnetic fields themselves. The coupled dynamics of magnetic fields and cosmic rays can thus impact the formation and evolution of galaxies and the thermal evolution of galaxy clusters in critical ways. Numerically studying these effects requires sol…
We present the first-ever moving-mesh general relativistic hydrodynamics solver for static spacetimes as implemented in the code, MANGA. Our implementation builds on the architectures of MANGA and the numerical relativity Python package NRPy+. We review the general algorithm to solve these equations and, in particular, detail the time stepping; Riemann solution across moving faces; conversion between primitive and conservative variables; validation and correction of hydrodynamic variables; and mapping of the metric to a Voronoi moving-mesh grid. We present test results for the numerical integr…
Fast(er)PM and Moving Mesh: JAX-native Geometric Multigrid Methods
Kavli IPMU (WPI)(卡弗里宇宙学前沿研究所);UTIAS(多伦多大学应用科学与工程研究所);The University of Tokyo(东京大学);Center for Data-Driven Discovery, Kavli IPMU (WPI)(卡弗里宇宙学前沿研究所数据驱动发现中心);Lawrence Berkeley National Lab(劳伦斯伯克利国家实验室)
In certain astrophysical systems the commonly employed ideal magnetohydrodynamics (MHD) approximation breaks down. Here, we introduce novel explicit and implicit numerical schemes of ohmic resistivity terms in the moving-mesh code AREPO. We include these non-ideal terms for two MHD techniques: the Powell 8-wave formalism and a constrained transport scheme, which evolves the cell-centred magnetic vector potential. We test our implementation against problems of increasing complexity, such as one- and two-dimensional diffusion problems, and the evolution of progressive and stationary Alfvén waves…
We present a constrained transport (CT) algorithm for solving the 3D ideal magnetohydrodynamic (MHD) equations on a moving mesh, which maintains the divergence-free condition on the magnetic field to machine-precision. Our CT scheme uses an unstructured representation of the magnetic vector potential, making the numerical method simple and computationally efficient. The scheme is implemented in the moving mesh code Arepo. We demonstrate the performance of the approach with simulations of driven MHD turbulence, a magnetized disc galaxy, and a cosmological volume with primordial magnetic field. …
In this paper we introduce a new radiative transfer code SPRAI (Simplex Photon Radiation in the Arepo Implementation) based on the SimpleX radiation transfer method. This method, originally used only for post-processing, is now directly integrated into the Arepo code and takes advantage of its adaptive unstructured mesh. Radiated photons are transferred from the sources through the series of Voronoi gas cells within a specific solid angle. From the photon attenuation we derive corresponding photon fluxes and ionization rates and feed them to a primordial chemistry module. This gives us a self-…
We present two new Lagrangian methods for hydrodynamics, in a systematic comparison with moving-mesh, SPH, and stationary (non-moving) grid methods. The new methods are designed to simultaneously capture advantages of both smoothed-particle hydrodynamics (SPH) and grid-based/adaptive mesh refinement (AMR) schemes. They are based on a kernel discretization of the volume coupled to a high-order matrix gradient estimator and a Riemann solver acting over the volume 'overlap.' We implement and test a parallel, second-order version of the method with self-gravity & cosmological integration, in the c…
We introduce AREPO-RT, a novel radiation hydrodynamic (RHD) solver for the unstructured moving-mesh code AREPO. Our method solves the moment-based radiative transfer equations using the M1 closure relation. We achieve second order convergence by using a slope limited linear spatial extrapolation and a first order time prediction step to obtain the values of the primitive variables on both sides of the cell interface. A Harten-Lax-Van Leer flux function, suitably modified for moving meshes, is then used to solve the Riemann problem at the interface. The implementation is fully conservative and …
We present a new algorithm to solve the equations of radiation hydrodynamics (RHD) in a frequency-integrated, two-moment formulation. Novel features of the algorithm include i) the adoption of a non-local Variable Eddington Tensor (VET) closure for the radiation moment equations, computed with a ray-tracing method, ii) support for adaptive mesh refinement (AMR), iii) use of a time-implicit Godunov method for the hyperbolic transport of radiation, and iv) a fixed-point Picard iteration scheme to accurately handle the stiff nonlinear gas-radiation energy exchange. Tests demonstrate that our sche…
Accurate numerical solutions of the equations of hydrodynamics play an ever more important role in many fields of astrophysics. In this work, we reinvestigate the accuracy of the moving-mesh code \textsc{Arepo} and show how its convergence order can be improved for general problems. In particular, we clarify that for certain problems \textsc{Arepo} only reaches first-order convergence for its original formulation. This can be rectified by simple modifications we propose to the time integration scheme and the spatial gradient estimates of the code, both improving the accuracy of the code. We de…
We present Variable Eddington Tensor-closed Transport on Adaptive Meshes (\texttt{VETTAM}), a new algorithm to solve the equations of radiation hydrodynamics (RHD) with support for adaptive mesh refinement (AMR) in a frequency-integrated, two-moment formulation. The method is based on a non-local Variable Eddington Tensor (VET) closure computed with a hybrid characteristics scheme for ray tracing. We use a Godunov method for the hyperbolic transport of radiation with an implicit backwards-Euler temporal update to avoid the explicit timestep constraint imposed by the light-crossing time, and a …