2.3 Simulations
2.3.2 Force computation: hydrodynamics
The cosmological evolution of dark matter is rather well understood; the use of a specific gravity-solver or the other does not alter an overall consistent picture. The same is not true when it comes to modelling the baryonic component of the cosmic fluid. The advantages and disadvantages of the specific method adopted will have an impact on the final results. The situation becomes even worse when considering that a number of astrophysical processes (e.g. gas cooling, star formation and related feedback) need to be accounted for by means of “sub-grid” prescriptions, as this physics occurs on scales too small to be followed by the simulation and has to be introduced “by hand” with ad-hoc recipes. As most of the time the astrophysical process itself is poorly understood, there exist several competing approaches to its modelling, each leading to different results. In the following, we will first discuss the two most important philosophies at the basis of the hydrodynamic modelling of baryonic matter in cosmological simulations and then briefly outline the treatment of the additional astrophysical processes.
The equations ruling the behaviour of a baryonic, perfect fluid are:
• Continuity equation dρ dt +ρ∇ ·v= ∂ρ ∂t +∇ ·(ρv) = 0; (2.10) • Euler equation dv dt = ∂v ∂t + (v· ∇)v=− 1 ρ∇P − ∇Φ; (2.11)
• Energy equation du dt = ∂u ∂t +v· ∇u=− P ρ∇ ·v. (2.12)
This last equation is just an expression for the first law of thermodynamics in the adiabatic limit. The system is closed by the field equation forΦ, accounting for the gravitational term in the equation of motion 2.11, and by the equation of state
P =Aργ, (2.13)
whereA is a constant related to the specific entropy of gas and γ is the polytropic index.
These equations can be solved either at the position of the sampling particles or on the nodes of a grid. In the first case we speak of Lagrangian codes and in the second of Eulerian codes.
Smoothed Particle Hydrodynamics (SPH)
The scene of Lagrangian codes is dominated by the use of SPH algorithms (Lucy 1977; Gingold and Monaghan 1977; Monaghan and Lattanzio 1985. For a review see Monaghan 1992; Rosswog 2009). At the heart of this method is an interpola- tion technique which allows the density ρ to be defined for each of the sampling particles.
The integral interpolant of any function A(r) is defined by
AII(r) =
Z
A(r0)W(|r−r0|, h)dr03, (2.14) where the integral is performed over the entire space and the contribution at each pointr0 is calibrated by the value of the interpolating kernel at r=|r−r0|. Although its form can vary, the main properties of the kernel W are set by:
Z W(|r−r0|, h)dr3 = 1 (2.15) and W(|r−r0|, h)−→ h→0δ(r−r 0), (2.16) where hregulates the spatial extent of the function.
More interesting, from a numerical point of view, is the discretised version of Eq. 2.14. Once the integral interpolant is expressed as
AII(r) =
Z
A(r0)
ρ(r0) W(|r−r
0|, h)ρ(r0)dr03, (2.17)
it is easy to replace the integral by a sum over a set of interpolation points (the particles), whose masses originate from the ρ(r0)dr03 term. The result is:
ASI(r) = X b mb Ab ρb W(|r−rb|, h), (2.18)
where SI stands for summation interpolant, the subscript b denotes the value of any quantity associated to particle b and the summation is performed over all the particles. The density ρa associated to particle ais therefore given by 4:
ρa=
X
b
mbW(|ra−rb|, h). (2.19)
The key point is that, once the kernelW is chosen to be differentiable, it is possible to construct a differentiable interpolant of a function from its values at a set of points. For example, the expression for ∇ASI would simply reduce to:
∇ASI(r) = X b mb Ab ρb ∇W(|r−rb|, h), (2.20)
where ∇W is known analytically. The discretised version of the hydrodynamic equations can be differentiated easily without the need of a grid; the only deriva- tives present, once the quantities are expressed in terms of kernel interpolation, will involve W. As an example, here is the typical discretised form of the Euler equation, as used in SPH: dva dt =− X b mb Pa ρ2 a +Pb ρ2b ∇W(|ra−rb|, h), (2.21)
where the gravitational part has been omitted5.
The main advantages of SPH are its conservation properties and spatial adaptiv- ity. Physical quantities like mass, energy and momentum are conserved, by con- struction, along the flow. The resolution naturally increases in overdense regions, something that makes the method particularly targeted for modelling the highly inhomogeneous matter fields in cosmological simulations. The weaknesses of SPH lie in the inaccurate treatment of shocks and in the suppression of fluid instabil- ities at contact discontinuities.
Eulerian methods
Instead of defining the gas properties at the location of the sampling particles, Eulerian codes use the vertices of a grid. The evolution of the system is obtained by solving theRiemann problem at the boundaries between each grid cell, by means of schemes such as the one proposed by Godunov (1959).
In order to overcome the problem of limited spatial resolution, state-of-the-art Eu- lerian codes make use of Adaptive Mesh Refinement algorithms (AMR; Berger and Colella 1989); the grid is recursively refined in regions where higher resolution is needed and left coarser in the rest of the domain. This allows grid codes to compete
4In principle, the density can also be calculated via integration of a discretised version of Eq. 2.10. However, the summation form given by Eq. 2.19 is numerically more robust. If particle masses are kept fixed, mass conservation is guaranteed and there is no need to solve the continuity equation.
5The expression in Eq. 2.21 is a symmetrised version of the discretised Euler equation. A straight- forward discretisation of Eq. 2.11 does not conserve linear and angular momentum.
in resolution with Lagrangian codes, but results in poor conservation of funda- mental physical quantities. In general, the Eulerian approach to hydrodynamics results in an accurate treatment of shocks and discontinuities. Its application to the cosmological problem is hampered by the lack of Galilean invariance (making the results sensitive to the presence of bulk motions) and by the difficulties in the treatment of gravitational instabilities.
In order to combine the advantages of the Eulerian and Lagrangian methods, a hybrid approach has been recently proposed. We will briefly discuss this in Sec. 2.3.4.
Sub-resolution processes
An accurate description of all the astrophysical processes shaping the observ- able properties of the Universe is impossible to obtain at once; it would mean a simultaneous modelling of scales ranging from the interior of a star to the largest cosmic structures - differing by tens of orders of magnitudes. Yet, neglecting pro- cesses like gas cooling, star formation and supernova feedback (among others) would mean a rather inadequate modelling of the baryonic component. The so- lution so far has been to provide the codes with specific modules accounting for additional physics by means of pre-defined recipes; this obviously constitutes a deviation from the otherwise self-consistent treatment of the evolution of the fluid. Modelled astrophysical processes generally include:
• Radiative cooling - assuming a specific composition for the baryonic matter and a range of possible reactions (collisional excitation and ionisation, re- combination, bremmstrahlung, etc.; see, e.g., Katz et al. 1996) cooling rates are computed that bring the gas temperature to a low enough level for it to condense at the centre of dark matter halos, where it will eventually become Jeans-unstable and form stars;
• Star formation - rapidly cooling, Jeans-unstable gas is progressively con- verted into star particles (one star particle containing, in fact, a large ensemble of stars), which are then evolved under the effect of gravity as an additional collisionless component (see, e.g., Cen and Ostriker 1992);
• Stellar feedback- the impact that the formation and evolution of stars has on the environment is modelled via prescriptions for galactic winds, metal enrich- ment and supernova explosions and its main effects are to heat and change the compositions of the surrounding gas (see, e.g., Springel and Hernquist 2003);
• SMBH feedback - the presence of super massive black holes (SMBHs) at the centre of galaxies is modelled via prescription for their growth and the feed- back associated with their accretion of gas (see, e.g., Di Matteo et al. 2005).
Figure 2.5: Schematic representation of the leapfrog-integration method. Figure taken from the web (http://www.drexel.edu/physics/)
Comparison projects aimed at comparing the performances of different codes have been carried out. When concentrating on purely hydrodynamical simulations (i.e. no sub-grid physics; Frenk et al. 1999), these confirmed a very good agreement on the predictions for the dark matter component in collapsed objects, while point- ing out some disagreement in properties like gas temperature, gas mass fraction (within about 10%) and X-ray luminosity (within a factor of 2); also, even when a good match was obtained in overdense regions, results for the temperature, pres- sure and entropy of the gas were found to significantly differ in underdense envi- ronments (O’Shea et al., 2005). More recently, Scannapieco et al. (2011) undertook a comparison project aimed at testing the performance of nine different codes on a simulation of galaxy formation; besides varying in the philosophy adopted to tackle hydrodynamics, the codes also differed in the implemented sub-grid physics. Major differences were found in the results; the authors concluded that although the Eu- lerian or Lagrangian nature of each code did contribute the final discrepancies, the fluctuations introduced by different formulations of the star-formation and feed- back schemes are likely to be the fundamental source of the differences seen.