Oliver Just, Zewei Xiong, Gabriel Martínez-Pinedo
Neutron-rich outflows in neutron-star mergers (NSMs) or other explosive events can be subject to substantial heating through the release of rest-mass energy in the course of the rapid neutron-capture ( r -) process. This r -process heating can potentially have a significant impact on the dynamics determining the velocity distribution of the ejecta, but due to the complexity of detailed nuclear networks required to describe the r -process self-consistently, hydrodynamic models of NSMs often neglect r -process heating or include it using crude parametrizations. In this work, we present a conceptually new method, RHINE, for emulating the r -process and concomitant energy release in hydrodynamic simulations via machine learning algorithms. The method requires the evolution of only a few additional quantities characterizing the composition, of which the nuclear rates of change are obtained at each location and time step from neural networks trained by a large set of trajectories from full nuclear network calculations. The scheme is tested by comparing spherically symmetric wind simulations and long-term simulations of NSMs using RHINE with postprocessing results from nucleosynthesis calculations, showing agreement in the released heating energy to within ≲ 10 % . In our NSM models on average about 2.3 MeV, 0.7 MeV, and 2.1 MeV are released per baryon in dynamical ejecta, NS-torus ejecta, and black hole (BH) torus ejecta, respectively. The strongest velocity boost is observed for BH-torus ejecta, which also become 40% more massive with r -process heating. The nucleosynthesis yields are only mildly affected by r -process heating, but the kilonova gets significantly brighter once the BH-torus ejecta become visible. RHINE can be readily implemented in existing hydrodynamics codes using pretrained machine learning data and routines for source-term prediction that we provide online.