It is well known that cosmic rays contribute significantly to the pressure of the interstellar medium in our own Galaxy, suggesting that they may play an important role in regulating star formation during the formation and evolution of galaxies. We here discuss a novel numerical treatment of the physics of cosmic rays and its implementation in the parallel smoothed particle hydrodynamics code GADGET-2. In our methodology, the non-thermal cosmic ray population of each gaseous fluid element is approximated by a simple power law spectrum in particle momentum, characterized by an amplitude, a cut-off, and a fixed slope. Adiabatic compression and a number of physical source and sink terms are modelled which modify the cosmic ray pressure of each particle. The most important sources considered are injection by supernovae and diffusive shock acceleration, while the primary sinks are thermalization by Coulomb interactions, and catastrophic losses by hadronic interactions. We also include diffusion of cosmic rays. Using a number of test problems, we show that our scheme is numerically robust and efficient, allowing us to carry out the first cosmological structure formation simulations that account for cosmic ray physics, together with radiative cooling and star formation. In simulations of isolated galaxies, we find that cosmic rays can significantly reduce the star formation efficiencies of small galaxies, with virial velocities below ~, an effect that becomes progressively stronger towards low-mass scales. In cosmological simulations of the formation of dwarf galaxies at high redshift, we find that the total mass-to-light ratio of small halos and the faint end of the luminosity function are affected. The latter becomes slightly flatter. When cosmic ray acceleration in shock waves is followed as well, we find that up to of the energy dissipated at structure formation shocks can appear as cosmic ray pressure at redshifts around , but this fraction drops to ~ at low redshifts when the shock distribution becomes increasingly dominated by lower Mach numbers. Despite this large cosmic ray energy content in the high-redshift intergalactic medium, the flux power spectrum of the Lyman-α forest is only affected on very small scales of , and at a weak level of . Within virialized objects, we find lower contributions of CR-pressure, due to the increased efficiency of loss processes at higher densities, the lower Mach numbers of shocks inside halos, and the softer adiabatic index of CRs, which disadvantages them when a composite of thermal gas and cosmic rays is adiabatically compressed. The total energy in cosmic rays relative to the thermal energy within the virial radius drops from 20% for halos to 5% for rich galaxy clusters of mass in non-radiative simulations. Interestingly, the lower effective adiabatic index also increases the compressibility of the intrahalo medium, an effect that slightly increases the central concentration of the gas and the baryon fraction within the virial radius. We find that this can enhance the cooling rate onto central cluster galaxies, even though the galaxies in the cluster periphery become slightly less luminous as a result of cosmic ray feedback.
Read full abstract