py4radiation: a framework for generating heating/cooling functions and ion fractions from custom radiation fields for astrophysical simulations
py4radiation: a framework for generating heating/cooling functions and ion fractions from custom radiation fields for astrophysical simulations
Daniel Villarruel-Yánez, Wladimir E. Banda-Barragán, Benedetta Casavecchia
AbstractModelling multiphase gas in and around galaxies is key to understanding the baryon cycle in galaxy evolution. Modern simulation codes rely on heating/cooling functions and ion fractions to capture the thermodynamics and chemistry of such gases, but coupling all physical factors remains challenging. We present a new Python-based, parallelised package that acts as an integration framework, connecting well-established astrophysical codes and models to produce self-consistent heating/cooling functions and ion fractions from custom ionising UV/X-ray backgrounds. The package returns multi-dimensional tables that can be readily coupled to hydrodynamic and post-processing codes to study radiative processes and extract observables, as we demonstrate with static cloud simulations. Our simulation suite studies the thermodynamic history of a static circumgalactic cloud with smoothed edges subjected to meta-galactic and starburst heating. We find that the clouds experience damped pulsations regulated by strong cooling-driven inflows and heating-driven outflows that constantly overshoot pressure equilibrium. Meta-galactic heating is weak and produces a confined and dense cloud, while starburst heating is strong and sustains large clouds only a little smaller than those obtained with the standard $10^4\,\rm K$ cooling floor. Starburst radiative heating acts as a damping agent, thereby reducing mixing. py4radiation comes with extensive documentation and a sample catalogue of heating/cooling functions and ion tables for a selected set of input meta-galactic and starburst spectral energy distributions. The code is publicly available and can be easily expanded.