This repository contains Python scripts for the FESTIM v2.0 review paper.
-
Clone this repository to your local machine.
-
Create a Conda environment using the provided
environment.ymlfile:conda env create -f environment_festim_v2.yml
This will set up a Conda environment named
festim-v2-review-envwith all the required dependencies for running the FESTIM scripts and visualisation scripts. -
Activate the Conda environment:
conda activate festim-v2-review-env
-
Execute the Python scripts using the activated Conda environment and ensure compatibility with FESTIM requirements.
-
Navigate to the desired folder based on the simulation or comparison you are interested in.
The advection_demo folder contains scripts demonstrating FESTIM v2.0's new advection capabilities for modeling hydrogen transport in flowing media.
The demo showcases how to couple diffusion and advection processes, comparing results with pure diffusion cases to highlight the effects of velocity fields on hydrogen concentration distributions.
Running the test file:
python advection_demo.pyThe performance folder includes scripts testing the computational performance of FESTIM v1.4 and v2.0 on a 2D multi-material diffusion case adapted from the V&V book discontinuity verification case.
The test case runs a transient simulation on a 500×500 mesh to benchmark different numerical methods and compare runtimes between FESTIM versions.
Note
To run all the scripts in the Performance testing section, a conda environment for festim v1.4 is also required, which can be created by:
conda env create -f environment_festim_v1.ymlThen activate it the same way as done previously.
Running the performance tests for festim v1 int the conda environemnt (festim-v1-review-env):
python test_performance_v1.pyRunning the performance tests for festim v2 int the conda environemnt (festim-v2-review-env):
python test_performance_v2.pyBefore finally plotting the results:
python plot_runtimes.pyThe coupling folder includes scripts demonstrating how external solvers such as OpenFOAM and OpenMC can be coupled with FESTIM.
These examples showcase hydrogen transport in complex multiphysics scenarios including advection-diffusion with fluid flow (OpenFOAM) and neutron-induced tritium production and transport (OpenMC).
Scripts in the coupling_cfd subfolder demonstrate coupling FESTIM simulations with OpenFOAM for modeling hydrogen transport in flowing fluids.
The example simulates hydrogen diffusion in a lid-driven cavity flow, comparing standard diffusion with advection-enhanced transport.
Note
OpenFOAM results are pre-computed and stored in the repository as a zip file, so OpenFOAM installation is not required to run the FESTIM coupling scripts. However, if you wish to re-run the OpenFOAM case, refer to OpenFOAM's installation instructions.
Scripts in the coupling_neutronics subfolder demonstrate coupling FESTIM simulations with OpenMC for modeling neutron-induced tritium production and subsequent hydrogen isotope transport. The example simulates tritium breeding in lithium and its diffusion through structural materials in a fusion reactor environment.
For any questions or issues, please contact darkj385@mit.edu