Author: Alex Panera Alvarez
HPI2-NN is a machine learning surrogate model of the HPI2 pellet ablation and deposition code (https://gitlab.com/hpi2_group/HPI2_code), developed to accelerate integrated modeling of pellet-fuelled tokamak discharges.
The model learns from around 10000 HPI2 simulations on WEST experimental data and ITER simulation data, and predicts pellet deposition profiles based on plasma parameters and pellet injection conditions.
It is designed for stand-alone and coupling into integrated modeling frameworks, enabling fast inference within integrated plasma scenario modeling.
- Neural network surrogate trained on HPI2 synthetic data
- PCA compression of temperature and density profiles
- Supports ONNX inference for fast runtime execution
- Modular code for evaluation
Clone the repository:
git clone https://github.com/DIFFER-NL/hpi2nn.git
cd hpi2nn(Optional) Create a virtual environment and install dependencies.
python3 -m venv venv
source venv/bin/activate
pip install onnxruntimeThe onnxruntime version used for this project is 1.22.0
Shown on inference/simple_inference.py Advised to be run from hpi2nn/ folder
python inference_hpi2nn/simple_inference.pyInputs: Pellet radius in m, velocity in m/s, Te and Ti profiles in eV, ne profile in m-3, B0 in T, first point (R1,Z1) and second point (R2,Z2) in m x coord preferred in rho_tor_norm, but using a_norm will not impact too much the result B0 is suppose to be negative always (inforced anyway in inference)
Outputs: deposition profile dne (m-3) and temperature change profile dTe (eV) same x coord as given in input
For JETTO implementation--> inference_hpi2nn/HPI2-NN_JETTO.py FOR JETTO multiply ne by 1e6
HPI2-NN was trained using synthetic data from HPI2 simulations under various plasma conditions representative of WEST and ITER configurations. A different NN has been trained for every injection line and tokamak.
A manuscript explaining and using this model is under preparation. So this repository is for the moment the only citable source.
Alex Panera Alvarez PhD Candidate, Integrated Modelling Group — DIFFER Email: a.paneraalvarez@differ.nl
GitHub: @alexpanera
This project is licensed under the MIT License
. © 2025 DIFFER — Dutch Institute for Fundamental Energy Research.
This work was supported by EUROfusion under the Theory, Simulation, Verification and Validation (TSVV) tasks, and carried out in collaboration with WEST and ITER Organization.
Special thanks to Florian Köchl, Eleonore Geulin for their contribution and the integrated modeling community for valuable discussions.