Published July 11, 2025 | Version 1.0

RHINE: R-process Heating Implementation in hydrodynamic simulations with NEural networks

  • 1. ROR icon GSI Helmholtz Centre for Heavy Ion Research

Description

# Overview

RHINE (R-process Heating Implementation in hydrodynamic simulations with NEural networks) is a machine-learning based Fortran code for modeling r-process heating in astrophysical hydrodynamic simulations. The code uses trained neural networks to provide fast and accurate estimates of r-process related rates of change for a set of characteristic quantities. RHINE is designed for integration into hydrodynamic simulations of astrophysical environments with r-process viable conditions such as neutron-star mergers. While maintaining a high accuracy comparable to detailed nuclear reaction networks, it avoids their large computational demands.

For more details see:

Phys. Rev. D 113, 083022

# Features

- Provides nuclear rates of change for the electron fraction, mass fractions of neutrons, protons, alphas, and remaining ("heavy") nuclei, average mass number of heavy nuclei, average mass excess per baryon, and energy-loss rates due to neutrino emission from beta-decays.
- Trained on large datasets from full nuclear network calculations.
- Lightweight and fast: neural network inference is orders of magnitude faster than full nuclear reaction networks.

# Modules

RHINE contains two modules `RHINE_neural()` and `RHINE_model()`.

1. Module `RHINE_neural()` provides

  - subroutine `load_model()` to load specific neural network,

  - function `forward()` to evaluate a neural network, i.e. obtain the output for given input quantities,

  - functions `scale_data()` and `rescale_data()` for scaling and rescaling functions for data standardization,

  - functions `expo()`, `sigmoid()`, and `elu()` for the activation functions.

2. Module `RHINE_model()` provides

  - subroutine `load_model_RHINE()` to load all neural networks,

  - subroutine `run_RHINE()` to provide all source terms used to update the hydro quantities within a time step dt,

  - subroutine `get_derivative()` to predict all variables and time derivatives given all input quantities,

  - subroutine `get_QSE()` to predict the abundances in QSE regime given the density, temperature, and electron fraction,

  - subroutine `get_ma()` to predict the mass excess and fraction of neutrino losses,

  - subroutine `normalization()` to ensure physical consistency of the source terms such as mass and charge conservation.


# Usage

1. Load the model

```fortran
use RHINE_model

call load_model_RHINE(<model_path>)
```

2. Predict the source terms

```fortran
call run_RHINE(<arguments>)
```

3. See also more detailed demonstration in `demo.f90`.

 

# Citation

If you use RHINE in your research, please include the following two references:

```
@misc{RHINE2025,
  author = {{Just}, Oliver and {Xiong}, Zewei and {Martı́nez-Pinedo}, Gabriel},
  title  = {RHINE: R-process Heating Implementation in Hydrodynamic Simulations with Neural Networks},
  year   = {2025},
  url    = {https://git.gsi.de/nucastro_public/rhine}
}

 
@article{Just2026a,
author = {Just, Oliver and Xiong, Zewei and Mart\'{\i}nez-Pinedo, Gabriel},
journal = {Phys. Rev. D},
month = {Apr},
pages = {083022},
title = {$r$-process heating implementation in hydrodynamic simulations with neural networks},
volume = {113},
year = {2026}}

```

# License

RHINE is released under the BSD 3-Clause License. See LICENSE file for details.

# Contact

For questions or requests please contact:

o.just@gsi.de
z.xiong@gsi.de
g.martinez@gsi.de

Files

README.md

Files (851.5 kB)

Name Size Download all
md5:23707b100be417f1d53920d3c3789534
103 Bytes Download
md5:92664c7aa26bf26a877e26f1b75688ba
2.0 kB Download
md5:20b61fe07e7f44294b82e127a7755250
1.5 kB Download
md5:ca41102e87186156ced5a77103de2fbb
54.7 kB Preview Download
md5:4ec1e61056f849fbf4b40d0f82236267
59.0 kB Preview Download
md5:85e3f4dcf6d53439e82add455716706a
24.1 kB Preview Download
md5:8b97f46afe2d368c0d0c32674e616331
60.0 kB Preview Download
md5:108ef675232c9eda2b8779110a8b1834
23.4 kB Preview Download
md5:d62a42f018685594b38cb97586791a2f
23.5 kB Preview Download
md5:fd70198d5ad643b9ef9fc2e67945cab2
60.3 kB Preview Download
md5:4cbd9310835f78531de191261c2e6c87
60.7 kB Preview Download
md5:6d8ab36ea70576a0ee26c23009f0558b
57.5 kB Preview Download
md5:6023a39b7610b1b105b672917c795d2d
57.4 kB Preview Download
md5:5dd8459e9c762dd1531ebc0cf772faa9
57.1 kB Preview Download
md5:4c14dd2c49f33fe16b4e9f41c79da4ff
57.1 kB Preview Download
md5:58a5da9966b399b41be776549988148b
57.1 kB Preview Download
md5:f6c0682e3318665beaed7eff28b492a0
57.2 kB Preview Download
md5:c4d95ab318102d68da13dec534ffca35
57.3 kB Preview Download
md5:3526ab051340ca14467f05cc38b7ad60
58.2 kB Preview Download
md5:f1f88c89cb6495c4baf41e797cfa2db8
3.1 kB Preview Download
md5:0fc84531944cbd6475cc489701dc1f42
20.0 kB Download

Additional details

Funding

European Commission
KILONOVA - Probing r-process nucleosynthesis through its electromagnetic signatures 885281
Deutsche Forschungsgemeinschaft
SFB 1245 279384907
Deutsche Forschungsgemeinschaft
Gottfried Wilhelm Leibniz-Preis MA 4248/3-1

Dates

Accepted
2025-07-11

Software

Repository URL
https://git.gsi.de/nucastro_public/rhine
Programming language
Fortran
Development Status
Active