Motivated by the observed connection between molecular hydrogen (H2) and star formation, we present a method for tracking the non-equilibrium abundance and cooling processes of H2 and H2-based star formation in smoothed particle hydrodynamic simulations. The local abundances of H2 are calculated by integrating over the hydrogen chemical network. This calculation includes the gas phase and dust grain formation of H2, shielding of H2 and photodissociation of H2 by Lyman–Werner radiation from nearby stellar populations. Because this model does not assume equilibrium abundances, it is particularly well suited for simulations that model low-metallicity environments, such as dwarf galaxies and the early Universe. We further introduce an explicit link between star formation and local H2 abundance. This link limits star formation to ‘star-forming regions’, represented by areas with abundant H2. We use simulations of isolated disc galaxies to verify that the transition from atomic to molecular hydrogen occurs at realistic densities and surface densities. Using these same isolated galaxies, we establish that gas particles of 104 M⊙ or less are necessary to follow the molecular gas in this implementation.
With this implementation, we determine the effect of H2 on star formation in a cosmological simulation of a dwarf galaxy. This simulation is the first cosmological simulation with non-equilibrium H2 abundances to be integrated to a redshift of zero or to include efficient supernova feedback. We analyse the amount and distribution of star formation in the galaxy using simulated observations of the H i gas and in various optical bands. From these simulated observations, we find that our simulations are consistent with the observed Tully–Fisher, global Kennicutt–Schmidt and resolved Kennicutt–Schmidt relations. We find that the inclusion of shielding of both the atomic and molecular hydrogen and, to a lesser extent, the additional cooling from H2 at temperatures between 200 and 5000 K increases the amount of cold gas in the galaxies. The changes to the interstellar medium (ISM) result in an increased amount of cold, dense gas in the disc of the galaxy and the formation of a clumpier ISM. The explicit link between star formation and H2 and the clumpier ISM results in a bluer galaxy with a greater spatial distribution of star formation at a redshift of zero.