FESTIM and HTM: leading open-source hydrogen transport modelling

Remi Delaporte-Mathurin, MIT, USA

James Dark, CEA, France

Thomas Fuerst, INL, USA

 

FESTIM & HTM contributors

AMPMI 2024, Helsinki, Finland

H transport in materials (oversimplified)

\frac{\partial c_\mathrm{m}}{\partial t} = \nabla \cdot (D \nabla c_\mathrm{m}) - \sum \frac{\partial c_{\mathrm{t}, i}}{\partial t}
\frac{\partial c_{\mathrm{t}, i}}{\partial t} = k \ c_\mathrm{m} \ (n - c_{\mathrm{t}, i}) - p \ c_{\mathrm{t}, i}

Example: McNabb & Foster model

H transport in materials (oversimplified)

\frac{\partial c_\mathrm{m}}{\partial t} = \nabla \cdot (\textcolor{f3d7ac}{D} \nabla c_\mathrm{m}) - \sum \frac{\partial c_{\mathrm{t}, i}}{\partial t}
\frac{\partial c_{\mathrm{t}, i}}{\partial t} = \textcolor{f3d7ac}{k} \ c_\mathrm{m} \ (n - c_{\mathrm{t}, i}) - \textcolor{f3d7ac}{p} \ c_{\mathrm{t}, i}
X = X_0 \ \exp{\left(\frac{-E_X}{k_B \ T}\right)}

We need to solve this

We need to know this

Arrhenius law

Survey time! 🙋

 

Do you use open-source software for your research?

Two examples: HTM and FESTIM

The issues of

closed-source software

Lack of transparency

Duplication of work

Slow development

Reproducibility

tick-checkbox

Solution: open-source

Difficult to share

Example 1

HTM: a database for hydrogen transport properties

Motivation: literature reviews of H transport properties are unreliable

From

2020

review

Original paper

Review #1

Review #2

(citing #1)

13.1

11.7

Motivation

Even trusted organisations like ITER can make mistakes

Motivation

Making mistakes in review:

very easy

 

Catching them during peer-review: almost impossible

HTM is the solution to these pitfalls

Conversion errors

Automated unit conversion

Wrong references

Bibtex integration

Error propagation from other reviews

Only data from original papers

Fitting errors

Automated fitting

Open-source

Permanent errors in paper

Obsolete reviews

Lack of transparency

Easy access to 400+ properties

import h_transport_materials as htm

# filter only tungsten and H
diffusivities = htm.diffusivities.filter(
  material="tungsten", isotope="h")

htm.plotting.plot(diffusivities)

import matplotlib.pyplot as plt

plt.yscale("log")
plt.title("Tungsten diffusivity")

Filter by:

  • author
  • year
  • material
  • isotope
  • temp. range
  • ...

Properties

  • diffusivity
  • solubility
  • permeability
  • recombination coeff.
  • dissociation coeff.

HTM is growing

45+ materials

160 references

438 properties

Current version v0.16

HTM is transparent

import h_transport_materials as htm
from h_transport_materials import Diffusivity, Solubility

u = htm.ureg

causey_diffusivity = Diffusivity(
    D_0=0.93e-4 * u.m**2 * u.s**-1,
    E_D=2.8 * u.eV * u.particle**-1,
    range=(900 * u.K, 1473 * u.K),
    source="causey_interaction_1989",
    isotope="H",
)

atsumi_diffusivity = Diffusivity(
    D_0=1.69 * u.cm**2 * u.s**-1,
    E_D=251 * u.kJ * u.mol**-1,
    range=(500 * u.degC, 900 * u.degC),
    isotope="D",
    source="atsumi_absorption_1988",
    note="Equation 5 of Atsumi's paper",
)

atsumi_solubility = Solubility(
    S_0=1.9e-1 * u.mol * u.m**-3 * u.Pa**-0.5,
    E_S=-19.2 * u.kJ * u.mol**-1,
  	range=(850 * u.degC, 1050 * u.degC),
    source="atsumi_absorption_1988",
    isotope="H",
)

properties = [causey_diffusivity, atsumi_diffusivity, atsumi_solubility]

for prop in properties:
    prop.material = htm.CARBON

htm.database += properties
  • Integration with BibTex for easy reference
  • Automatic unit conversion with Pint under the hood
  • Additional notes

Example HTM source file

HTM simplifies writing papers

import h_transport_materials as htm

htm.diffusivities
	.filter(material="tungsten")
  	.to_latex_table()

Use HTM to generate LaTeX tables

Allergic to code?    We have a Web app

Don't want to/can't use python?

 

The database is compiled to JSON at each release

HTM

MOOSE

COMSOL

Experimental analysis

FESTIM

HTM can be easily integrated

Material properties

Example 2

FESTIM: a powerful and accessible H transport code

User inputs

  • Material properties
  • Trap properties
  • Geometry
  • Boundary conditions
  • Initial conditions
  • ...

Heat transfer model

T

Hydrogen transport model

  • McNabb & Foster
  • Multi-level trapping
  • Multi-isotopes
  • ...

FESTIM

Outputs

  • H concentration fields \(c(x,t)\)
  • Temperature field \(T(x,t)\)
  • surface fluxes
  • inventories
  • average concentration
  • ...

User inputs

  • Material properties
  • Trap properties
  • Geometry
  • Boundary conditions
  • Initial conditions
  • ...

Heat transfer model

T

Hydrogen transport model

  • McNabb & Foster
  • Multi-level trapping
  • Multi-isotopes
  • ...

FESTIM

Outputs

  • H concentration fields \(c(x,t)\)
  • Temperature field \(T(x,t)\)
  • surface fluxes
  • inventories
  • average concentration
  • ...

FEniCS

Available H transport models in FESTIM

\frac{\partial c_\mathrm{m}}{\partial t} = \nabla \cdot (D \nabla c_\mathrm{m}) - \frac{\partial c_{\mathrm{t}, i}}{\partial t}
\frac{\partial c_{\mathrm{t}, i}}{\partial t} = k \ c_\mathrm{m} \ (n - c_{\mathrm{t}, i}) - p \ c_{\mathrm{t}, i}

McNabb & Foster

Multi-occupancy trapping

Multi-isotope transport

Pick & Sonnenberg

\dfrac{d c_{\mathrm{s}}}{dt} = J_{\mathrm{bs}} - J_{\mathrm{sb}} + J_{\mathrm{vs}}
-D \nabla c_\mathrm{m} \cdot \mathbf{n} = -\lambda_{\mathrm{IS}} \dfrac{\partial c_{\mathrm{m}}}{\partial t} - J_{\mathrm{bs}} + J_{\mathrm{sb}}
\frac{\partial c_\mathrm{H}}{\partial t} = \nabla \cdot (D_\mathrm{H} \nabla c_\mathrm{H}) + ...
\frac{\partial c_\mathrm{D}}{\partial t} = \nabla \cdot (D_\mathrm{D} \nabla c_\mathrm{D}) + ...
\mathrm{H} + [\ \ \ \ ]_\mathrm{trap} \ \substack{p_1 \\[-1em] \longleftarrow\\[-1em] \longrightarrow \\[-1em] k_1} \ [\mathrm{H}_1]_\mathrm{trap}
\mathrm{H} + [\mathrm{H}_1]_\mathrm{trap} \ \substack{p_2 \\[-1em] \longleftarrow\\[-1em] \longrightarrow \\[-1em] k_2} \ [\mathrm{H}_2]_\mathrm{trap}
\mathrm{H} + [\mathrm{H}_2]_\mathrm{trap} \ \substack{p_3 \\[-1em] \longleftarrow\\[-1em] \longrightarrow \\[-1em] k_3} \ [\mathrm{H}_3]_\mathrm{trap}

History of FESTIM

2022

2019

Start of development

Open-source

Oct 2023

v1.0 release

2024

FESTIM is user-friendly

  • python-based
  • very easy to learn
  • plenty of libraries: numpy, scipy, matplotlib, HTM...
  • intuitive interface
conda install -c conda-forge fenics
pip install festim

Easy install

import festim as F
import numpy as np

my_model = F.Simulation()

my_model.mesh = F.MeshFromVertices(
    vertices=np.linspace(0, 1e-6, num=1001)
)

my_model.materials = F.Material(id=1, D_0=1.9e-7, E_D=0.2)

my_model.T = 500  # K

my_model.boundary_conditions = [
    F.DirichletBC(
        surfaces=[1, 2],
        value=1e15,  # H/m3/s
        field=0
        )
]

my_model.settings = F.Settings(
    absolute_tolerance=1e10,
    relative_tolerance=1e-10,
    final_time=100  # s
    )


my_model.dt = F.Stepsize(0.1)  # s

my_model.initialise()

my_model.run()

FESTIM is verified & validated

  • Validated against TDS, permeation experiments...
     
  • Verified against analytical solutions in many different problems
     
  • New V&V online book
       festim-vv-report.readthedocs.io

 

📈5 years of development

📑13+ publications

🗣️110+ citations

🧑‍💻16+ contributors

🏛️25+ institutions using the code

🧑‍💻30+ Slack members

⭐80+ stars on GitHub

      3 workshops

FESTIM in numbers

Evolution of GitHub stars

Open source

SOFE workshop

New reference paper

FESTIM is used worldwide

8 private companies

10 universities

16 research organisations

Neutron-induced damage and tritium trapping

  • Dynamic evolution of trap densities including annealing
    \(\dot{n} = \Phi \ K (1-\frac{n}{n_\mathrm{max}}) - A \ n \)
     
  • Parametrised on TDS data from IPP Garching

Influence of ELMs on retention

  • 1D ITER monoblock model 
  • Coupled transient heat transfer
  • Varying surface heat flux

Retention studies

  • Delaporte-Mathurin et al 2024 International Journal of Hydrogen Energy 63 786–802
  • Delaporte-Mathurin et al 2024 Nucl. Fusion 64 026003
  • ITER plasma facing components
  • Transient estimation of tritium retention

Detritiation studies

Breeding Blanket modelling

  • DEMO WCLL
  • Complex 3D geometry
  • Coupled to fluid dynamics
  • Tritium generation in the LiPb volume (computed from OpenMC)

James Dark et al 2021 Nucl. Fusion 61 116076

Tritium extraction system

courtesy of K. Dunnell (MIT)

  • Permeation Against Vacuum
  • Complex 3D geometry
  • Coupled with fluid dynamics
  • Tritium extraction from permeable membranes

Tritium extraction system

courtesy of K. Dunnell (MIT)

BABY breeding experiment

Velocity

Temperature

Tritium concentration

Metal Foil Pumps for DIR

  • H is implanted in the first \( 10 \ \mathrm{nm} \)
  • Super-permeation regime is attained at high recombination energy (upstream surface)
  • Source code

Benedikt & Day, (2017) Fusion Engineering and Design

Isotope swapping

Multi-isotope, multi-level trapping

  • 7 different species
  • 6 reactions
  • \( c_H = 10^{20} \ \mathrm{m^{-3}} \) on the left
  • \( c_D = 10^{19} \ \mathrm{m^{-3}} \) on the right
  • Source code available here

Spherical cavity trapping

see Zibrov and Schmid, NME, 2024

for complete description

  • Implementation in FESTIM of the spherical cavity trapping model developed by Zibrov and Schmid
  • Custom trapping equations
  • Smooth implementation in FESTIM

Anisotropy

  • Anisotropic materials can be simulated with very few modifications
D = \begin{bmatrix} D_{xx} & 0\\ 0 & D_{yy} \end{bmatrix}

Other applications

PAV Tritium Extraction System

TDS

PFC

Breeding blankets

No barrier

Barrier

Permeation barriers

Surface kinetics analysis

Community & Collaboration

Why we should all go open-source

AMPMI website: "The meeting fosters global collaboration for fusion R&D in the public and private sectors"

Collaborative environment

  • External contributions:
    • FESTIM: boundary conditions (PoliTo), post-processing (CEA), chemical reactions (Digilab), kinetic surface model (MEPhI), documentation and bug fixes...
    • HTM: database contributions (INL), fixes (IAEA)...
  • Transparency
  • User support & community: Discourse forum, Slack workspace

Open-source improves collaboration

Open-source improves collaboration

Cross-institution work

  • Removes barrier to access to software
  • Avoid work duplication

Accelerates Development and Innovation

  • Continuous distribution
  • Rapid growth
  • Reduced loss of technical knowledge

FESTIM community

Evolution of HTM properties

  • Anyone can make a copy of the repository and make changes there
     
  • Changes are reviewed by official maintainers via pull-requests
     
  • ~500 tests are run automatically
     
  • Changes are only merged when all the tests pass ✅

fork

fork

pull request

FESTIM

Jane

FESTIM

John

FESTIM

festim-dev

pull request

Open-source improves software quality

Open-source improves documentation

FESTIM (available at festim.readthedocs.io)

  • Installation instructions
  • User guide
  • Contribution guide
  • Tutorials
  • Theory background
  • API reference

✅Open-source is:

  • a successful model for hydrogen transport modelling benefiting the whole community
  • Other relevant projects: OpenMC, TMAP8, Xolotl, Paramak, LAMMPS, QE...​​

Take-aways

❌Open-source is not:

  • ​only code: documentation, community, testing
  • a silver bullet: releasing the code isn't enough
  • unidirectional: needs to be a win-win

⭐What open-source needs for fusion:

  • Sustained support from institutions
  • Appropriate training and awareness
  • Recognition for contributors