No Arabic abstract
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 from an existing simulation snapshot, but can also be used to run full radiation hydrodynamical simulations. Both the radiation transfer and the hydrodynamics are implemented in a general way that is independent of the grid structure that is used to discretize the system, allowing it to be run both as a standard fixed grid code, but also as a moving-mesh code.
We present Arepo-MCRT, a novel Monte Carlo radiative transfer (MCRT) radiation-hydrodynamics (RHD) solver for the unstructured moving-mesh code Arepo. Our method is designed for general multiple scattering problems in both optically thin and thick conditions. We incorporate numerous efficiency improvements and noise reduction schemes to help overcome efficiency barriers that typically inhibit convergence. These include continuous absorption and energy deposition, photon weighting and luminosity boosting, local packet merging and splitting, path-based statistical estimators, conservative (face-centered) momentum coupling, adaptive convergence between time steps, implicit Monte Carlo algorithms for thermal emission, and discrete-diffusion Monte Carlo techniques for unresolved scattering, including a novel advection scheme. We primarily focus on the unique aspects of our implementation and discussions of the advantages and drawbacks of our methods in various astrophysical contexts. Finally, we consider several test applications including the levitation of an optically thick layer of gas by trapped infrared radiation. We find that the initial acceleration phase and revitalized second wind are connected via self-regulation of the RHD coupling, such that the RHD method accuracy and simulation resolution each leave important imprints on the long-term behavior of the gas.
(Context) Monte Carlo radiative transfer (MCRT) is a widely used technique to model the interaction between radiation and a medium, and plays an important role in astrophysical modelling and when comparing those models with observations. (Aims) In this work, we present a novel approach to MCRT that addresses the challenging memory access patterns of traditional MCRT algorithms, which hinder optimal performance of MCRT simulations on modern hardware with a complex memory architecture. (Methods) We reformulate the MCRT photon packet life cycle as a task-based algorithm, whereby the computation is broken down into small tasks that are executed concurrently. Photon packets are stored in intermediate buffers, and tasks propagate photon packets through small parts of the computational domain, moving them from one buffer to another in the process. (Results) Using the implementation of the new algorithm in the photoionization MCRT code CMacIonize 2.0, we show that the decomposition of the MCRT grid into small parts leads to a significant performance gain during the photon packet propagation phase, which constitutes the bulk of an MCRT algorithm, as a result of better usage of memory caches. Our new algorithm is a factor 2 to 4 faster than an equivalent traditional algorithm and shows good strong scaling up to 30 threads. We briefly discuss how our new algorithm could be adjusted or extended to other astrophysical MCRT applications. (Conclusions) We show that optimising the memory access patterns of a memory-bound algorithm such as MCRT can yield significant performance gains.
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 other publicly available codes using different hydrodynamical integration schemes, illustrating the advantages and disadvantages of the moving mesh technique.
We present a detailed comparison between the well-known SPH code GADGET and the new moving-mesh code AREPO on a number of hydrodynamical test problems. Through a variety of numerical experiments we establish a clear link between test problems and systematic numerical effects seen in cosmological simulations of galaxy formation. Our tests demonstrate deficiencies of the SPH method in several sectors. These accuracy problems not only manifest themselves in idealized hydrodynamical tests, but also propagate to more realistic simulation setups of galaxy formation, ultimately affecting gas properties in the full cosmological framework, as highlighted in papers by Vogelsberger et al. (2011) and Keres et al. (2011). We find that an inadequate treatment of fluid instabilities in GADGET suppresses entropy generation by mixing, underestimates vorticity generation in curved shocks and prevents efficient gas stripping from infalling substructures. In idealized tests of inside-out disk formation, the convergence rate of gas disk sizes is much slower in GADGET due to spurious angular momentum transport. In simulations where we follow the interaction between a forming central disk and orbiting substructures in a halo, the final disk morphology is strikingly different. In AREPO, gas from infalling substructures is readily depleted and incorporated into the host halo atmosphere, facilitating the formation of an extended central disk. Conversely, gaseous sub-clumps are more coherent in GADGET simulations, morphologically transforming the disk as they impact it. The numerical artefacts of the SPH solver are particularly severe for poorly resolved flows, and thus inevitably affect cosmological simulations due to their hierarchical nature. Our numerical experiments clearly demonstrate that AREPO delivers a physically more reliable solution.
Aims. The importance of radiation to the physical structure of protoplanetary disks cannot be understated. However, protoplanetary disks evolve with time, and so to understand disk evolution and by association, disk structure, one should solve the combined and time-dependent equations of radiation hydrodynamics. Methods. We implement a new implicit radiation solver in the AZEuS adaptive mesh refinement magnetohydrodynamics fluid code. Based on a hybrid approach that combines frequency-dependent ray-tracing for stellar irradiation with non-equilibrium flux limited diffusion, we solve the equations of radiation hydrodynamics while preserving the directionality of the stellar irradiation. The implementation permits simulations in Cartesian, cylindrical, and spherical coordinates, on both uniform and adaptive grids. Results. We present several hydrostatic and hydrodynamic radiation tests which validate our implementation on uniform and adaptive grids as appropriate, including benchmarks specifically designed for protoplanetary disks. Our results demonstrate that the combination of a hybrid radiation algorithm with AZEuS is an effective tool for radiation hydrodynamics studies, and produces results which are competitive with other astrophysical radiation hydrodynamics codes.