Code comparison in galaxy and cluster simulations
The Eulerian and Lagrangian approaches described in the previous sections are theoretically supposed to provide the same results when applied to the same problem. To verify that codes succeed at correctly integrating the set of hydrodynamical equations, they are usually tested against problems whose solution is known analytically. In practice, these test problems are shock tubes or spherical collapse problems.
However, idealized hydrodynamical tests like the interaction of multi-phase fluids [109] often reveal fundamental differences among results obtained with different methods. Such differences can be driven by the formulation of the underlying fundamental equations (like no mixing in classical SPH), by the discretization (like the volume bias in SPH formulations) or they can be due to the influence of numerical errors (like the departure of translation invariance in grid codes due to errors in the reconstruction).
In cosmology, problems with known analytical solutions are impractical: as a consequence, a meaningful test is represented by comparing the results provided by different codes when they simulate the formation of cosmic structures in a standard set-up. As an example, [110] compares the thermodynamical properties of the IGM predicted by the GADGET (SPH-based) and ENZO (grid-based) codes. Another example of a comparison between grid-based and SPH-based codes can be found in [111] .
A detailed comparison of hydrodynamical codes which simulate the formation and evolution of a galaxy or of a galaxy cluster is therefore an extremely important test. A pioneering comparison was performed within the so-called Santa Barbara Cluster Comparison Project [112] . Here, 12 different groups, each using a code either based on the SPH technique (seven groups) or on the grid technique (five groups), performed a non-radiative simulation of a galaxy cluster from the same initial conditions.
A more recent comparison project, the so-called nIFTy galaxy cluster simulations [113] , also involved modern SPH implementations as well as the moving mesh code AREPO. A similar agreement over large ranges was obtained for many of the gas properties in both studies, like the density, temperature and entropy profiles, as shown in Fig. 8. Both studies found significantly larger differences between mesh-based codes and classical particle-based codes to be present for the inner part of the profiles. However, as shown in [113] , particle-based codes which include an explicit treatment of mixing produce results very similar to grid-based codes.
A few code comparison campaigns have targeted galaxies as well (see e.g., [114] ,[115] , Fig. 8, and §3.14).
It is worth mentioning that as soon as additional physics like star formation and AGN feedback is included, the discrepancies in the results obtained by the various numerical methods are no longer driven by differences which can be ascribed to the hydrodynamical solvers: they are rather due to the details of the numerical prescriptions adopted to model these additional processes [116] .

评论