The cosmological growth of density fluctuations, which will end up forming galaxies, is a highly non-linear process which is impossible to treat analytically. Apart from the more empirical approach, called "halo-occupation-distribution", two main techniques have been developed in the past decades to solve this issue. On the one side, semi-analytical models (SAMs) try to address the non-linear growth of structures using approximate, analytic techniques. On the other side, hydrodynamical simulations directly address a wide range of dynamical scales and solve numerically the combined non-linear N-body and hydrodynamic equations describing the formation of a galaxy.
The main advantage of the semi-analytic approach is that it is computationally inexpensive compared to N-body simulations and it is therefore easy to address the relative importance of the different physical processes involved, simply by turning them off in the model and looking at the outcome: this allows a rapid exploration of parameter space with respect to N-body simulations . The weakness of SAMs is that the majority of the physics is controlled by hand, and that the codes are so complex to include a very high number of non-cosmological parameters, leading to a great degree of uncertainty.
With N-body and hydrodynamical simulations, instead, the basic equations of gravity and hydrodynamics are solved numerically in a much more consistent way. Pure N-body, dark matter only simulations have been found extremely effective at reproducing the large scale structure of the Universe, and powerful tools have been developed to deal with them, such has halo finders [82, 83] and dark matter halo merger-tree algorithms ; at small scales, however, baryonic physics must be taken into account. The main disadvantage of hydrodynamical simulations, apart from being computationally heavy, is that the vast range of dynamical scales between megaparsecs and astronomical units cannot yet be addressed numerically in a coherent fashion. The best scales achievable to date are at the level of parsecs. All the relevant physics happening at scales below the resolution of the simulation are put in by hand using a semi-analytic approach: this is the case of the complex processes of star formation and feedback from supernovae and AGN, whose treatment is at the "sub-grid" level.
Hydrodynamical simulations are essentially divided into two main branches, grid-based and particle-based. While grid-based codes cannot resolve at the same time large, cosmological and small, galactic scales, the particle-based methods, and in particular the smoothed particle hydrodynamics ones (SPH), do not suffer from such a problem (GADGET , GASOLINE ). SPH methods, however, fail to resolve shocks and Kelvin-Helmholtz instabilities. An improvement on grid-based codes is the Adaptive Mesh Refinement (AMR) scheme, in which cells can be adaptively refined according to a density criterion: schemes with deformable cells are becoming more widely used nowadays (RAMSES , AREPO ).
Highlighting the differences produced by the above mentioned techniques has been a topic of considerable interest, and simulators are still in the process of converging on such key questions as how much hot versus cold gas is accreted at differing scales and times. A summary of recent results on the accretion modes of gas in galaxies within hydrodynamical cosmological simulation of different types, specifically particle-based or grid-based codes, includes the following:
and with the smoothed particle hydrodynamics code GADGET-3 (an improved version of the publicly available GADGET-2 )
and found that the fraction of gas supplied to galaxies in massive halos through cold flows is less in the AREPO simulation than in the GADGET-3 simulations, because with traditional SPH, much of the cold gas reaches the central galaxies in purely numerical "blobs". Their results are shown in fig. 16. The authors explain the discrepancies as due to numerical inaccuracies in the standard formulation of SPH. Such inaccuracies, however, can be overwhelmed within more refined SPH schemes.
Figure 16. The mass-weighted histogram of past maximum temperature Tmax for gas accreted onto central galaxies (top) and halo atmospheres (bottom) by z = 2, as a function of the parent halo mass at z = 2. AREPO and GADGET-3 are shown separately in the left and right panels, respectively. It is clear how the two codes deviate strongly for galaxies in haloes with masses above 1010.5 M, where the strong contribution of hot gas in AREPO, which scales approximately with Tvir, is mostly absent in GADGET-3. The cold 105 K gas which dominates the accretion in GADGET-3 galaxies is largely absent in the AREPO simulation. Figure from .
Another indicator that all is not well in the galaxy formation simulation community is that there is still a serious overcooling problem. This has been with us for a very long time. Essentially, gas clouds collapse and star formation occurs too early. The prevalent solution is supernova feedback, but this fails unless unto ~ 300% of the supernova energy is tapped as kinetic energy to heat the gas. Alternatively, cooling is arbitrarily turned off within a few million years after the supernova explodes. New formulations of feedback are being explored that, for example, include cosmic-ray pressure in addition to thermal pressure in order to drive gas outflows [90, 91] or refine feedback on GMC scales by resolving the effects of grain photoheating and radiation pressure .  studied the impact of radiation pressure and photoionization feedback from young stars on surrounding gas and found that the latter is the dominant effect: in this sense the thermal pressure implementation of such "early stellar feedback" as in  seems promising.