Fusion Neutronics Workshop

Half Day Conference Course

Neutron

Agenda

  • βš›οΈ Why OpenMC
  • βš™οΈ Installation options
  • 🧱 Making materials
  • πŸ“ˆ Plotting cross sections
  • 🧩 Constructive Solid Geometry (CSG)
  • ☒️ Neutron source terms
  • βš›οΈ Tritium Breeding Ratio simulation
  • πŸ“Š Neutron spectra simulation
  • 🩻 Dose simulations
  • 🎯 Variance reduction
  • πŸ—οΈ Converting CAD to DAGMC models
  • πŸ•ΈοΈ Unstructured mesh tally
  • πŸ”₯ Depletion / activation / transmutation
  • ⏱️ Shutdown dose rate simulation
  • πŸ§‘β€πŸ’» How to get support

Simulation needed

Simulations are necessary when wanting to predict the nuclear response.

  • TBR
  • DPA
  • Gas production
  • Heating (prompt and decay)
  • Dose (prompt and decay)
  • Transmutation
  • Neutron / Photon flux spectra
  • Diagnostic responses
  • Magnet + insulator lifetimes

Why OpenMC

Code Python interface High performance / scalable Physics Permissive license CAD support Validated
MCNP ❓ ❌ βœ… ❌ βœ… βœ…
Serpent βœ… βœ… βœ… ❌ βœ… βœ…
FLUKA ❌ ❓ βœ… ❌ ❓ ❓
Geant4 ❓ ❓ βœ… βœ… βœ… ❓
PHITS ❓ ❓ ❌ ❓ ❓ ❓
OpenMC βœ… βœ… βœ… βœ… βœ… βœ…

OpenMC community

The best way to predict the future is to create it

  • 179 contributors from across the globe have contributed to the source code.
  • Many others performing V&V, raising issues and providing feedback.

Why OpenMC

Code Python interface High performance / scalable Physics Permissive license CAD support Validated Ability to contribute
MCNP ❓ ❌ βœ… ❌ βœ… βœ… ❌
Serpent βœ… βœ… βœ… ❌ βœ… βœ… ❌
FLUKA ❌ ❓ βœ… ❌ ❓ ❓ ❌
Geant4 ❓ ❓ βœ… βœ… βœ… ❓ ❌
PHITS ❓ ❓ ❌ ❓ ❓ ❓ ❌
OpenMC βœ… βœ… βœ… βœ… βœ… βœ… βœ…

Growing adoption

The relative ease of install, permissive MIT licensing and Python API have contributed to the rising popularity of OpenMC.

Installation options

Conda

  • Stable releases only
  • Older version
  • No Embree acceleration
  • Relatively easy
  • Contains MPI

Clone, compile, pip

  • Most complex, needs many commands
  • Install takes longer
  • Latest version (develop)
  • Optimised for local hardware
  • Highly customisable

Pip pre-built wheel

  • Does not contain MPI
  • Relatively easy
  • Up to date version

Install OpenMC and workshop deps

The workshop documentation is the best source of installation instructions.

https://fusion-energy.github.io/neutronics-workshop/docs/install_pip.html

Using Git

Download the workshop.

git clone https://github.com/fusion-energy/neutronics-workshop.git
cd neutronics-workshop

Download nuclear data

bash postBuild

Downloads the nuclear data cross sections and the decay data chain file to ~/nuclear_data.

Jupyter Lab / Notebook usage

  • Run a cell with shift and enter
  • Run all cells, or run in order
  • Add code cells and text cells
  • Shift and tab to get docstrings
  • Buttons for reset

Making materials

Materials can be made from:

  • Nuclides
  • Elements
  • Chemical formulas
  • Components

Making materials

Materials can be made from:

  • Nuclides
  • Elements
  • Chemical formulas
  • Components

Making materials

Materials can be made from:

  • Nuclides
  • Elements
  • Chemical formulas
  • Components

Making materials

Materials can be made from:

  • Nuclides
  • Elements
  • Chemical formulas
  • Components

Task 1 - Making materials

In Jupyter Lab / Notebook try

Plotting cross sections

  • nuclide β†’ microscopic cross section
  • element β†’ microscopic cross section
  • material β†’ macroscopic cross section

Scores such as heating, heating-local (eV-barn) and damage-energy (eV-barn) are also available.

Task 2 - Plotting cross sections

In Jupyter Lab / Notebook try

Bonus task - nuclear data

Try plotting the neutron energy distribution of an (n,2n) reaction.

github.com/fusion-energy/neutronics-workshop/issues/228

Making CSG geometry

The simplest region is a single surface and a cell defined as below (-) that surface.

import openmc

surface_sphere = openmc.Sphere(r=10.0)
inside_sphere = -surface_sphere
cell_sphere = openmc.Cell(region=inside_sphere)
cell_sphere.fill = steel

Making CSG geometry

Cells can also be constrained by multiple surfaces. This example is above (+) one surface and (&) below (-) another.

import openmc

surf_sphere1 = openmc.Sphere(r=10.0)
surf_sphere2 = openmc.Sphere(r=20.0)
between_spheres = +surf_sphere1 & -surf_sphere2
cell_sphere = openmc.Cell(region=between_spheres)
cell_sphere.fill = steel

Making CSG geometry

The outermost surface of the model should have a boundary_type set to "vacuum" to indicate that neutrons should not be tracked beyond this surface.

import openmc

surf_sphere = openmc.Sphere(r=10.0, boundary_type="vacuum")
region_inside_sphere = -surf_sphere
cell_inside_sphere = openmc.Cell(region=region_inside_sphere)
cell_inside_sphere.fill = steel

Visualizing CSG geometry

OpenMC supports classic CSG surface families, and there are many built in ways to view the geometry.

  • Slice plots: model.plot(), geometry.plot(), cell.plot(), region.plot()
  • Voxel plots: solid and ray traced (RayTracePlot)

There are also extra packages for viewing geometry:

Task 3 - making and visualizing CSG

In Jupyter Lab / Notebook try

Neutron birth energy

  • Deuterium (D) and Tritium (T) nuclides fuse, emitting an alpha particle and a neutron.
  • The neutron energy is dominated by the binding-energy release, with the spread due to the kinetic energy of the incident D and T nuclei.
  • Our neutron travels away from the fusion event with 14.1 MeV of energy (ignoring the magnetic field).

Plot created with fusion-neutron-utils

Particle source

  • Make a simple point neutron source
  • Make a ring neutron source
  • Visualize the source
  • Visualize particle tracks
  • Make a gamma source

Tasks 4 and 5 - Define a neutron source

In Jupyter Lab / Notebook try

Simulation settings

A minimal settings object for fusion simulations.

Settings objects also accept variance reduction configurations, weight windows and volume calculation settings.

Link to OpenMC docs

settings = openmc.Settings(
    batches=10,
    particles=10000,
    photon_transport=True,
    run_mode='fixed source',
    source=my_source,
)

Tally scores

A tally can record different scores. Many scores are available:

  • H3-production
  • MT 16 (n,2n)
  • (n,total)
  • heating / heating-local
  • damage-energy
  • flux

See the documentation for more information.

Cell filters

Tally filters are used to refine how and what a tally records.

The CellFilter tells the tally to record on a specific cell.

openmc.CellFilter([cell_1])

Task 6 - TBR tally

In Jupyter Lab / Notebook try

Post processing tricks

Modify task 6 so that you can access the tally.mean using apply_tally_results.

model.run(apply_tally_results=True)

openmc.model.Model documentation

Energy and particle filters

Tally filters refine how and what a tally records.

  • The EnergyFilter tells the tally to record the score on provided energy bins.
  • The ParticleFilter can be used to record photons or neutrons.
openmc.EnergyFilter(np.linspace(0, 15e6, 719))
openmc.ParticleFilter(['neutron'])

Task 7 - neutron spectra tally

In Jupyter Lab / Notebook try

Energy function filters

The EnergyFunctionFilter tells the tally to multiply by a factor when scoring the particle, for example to convert flux to dose.

energy_function_filter = openmc.EnergyFunctionFilter(
    energy=energy_bins,
    y=dose_coeffs,
    interpolation="cubic",
)

Task 8 - cell dose tally

In Jupyter Lab / Notebook try

Meshes and mesh filters

Two options for making the mesh, then use it in the tally as another filter type.

mesh = openmc.RegularMesh().from_domain(
    domain=geometry,
    dimension=[100, 100, 100],
)
mesh_filter = openmc.MeshFilter(mesh)
flux_tally.filters = [mesh_filter]

Task 9 - mesh dose tally

In Jupyter Lab / Notebook try

Variance reduction

OpenMC supports:

  • Implicit capture
  • Weight windows
  • Importance values

OpenMC can generate weight windows using:

  • the MAGIC method
  • Random Ray + FW-CADIS

Task 10 - weight windows

In Jupyter Lab / Notebook try

DAGMC

DAGMC lets OpenMC transport particles through CAD geometry converted to a surface mesh.

CAD overview

Today simulation on CAD in OpenMC uses:

  • DAGMC for surface mesh geometry
  • DAGMC for volume mesh (unstructured mesh)
  • LibMesh for surface mesh
  • LibMesh for volume mesh (unstructured mesh)

In the future, XDG will offer another option.

Task 11 - convert CAD to DAGMC

In Jupyter Lab / Notebook try

Visualizing CAD to DAGMC

In addition to slice plots, the OpenMC plotter and the OpenMC geometry plot, there are two options specifically for DAGMC geometry viewing:

Task 12 - Simulating with DAGMC

In Jupyter Lab / Notebook try

Unstructured meshes

Unstructured meshes are currently available via two libraries.

  • MOAB: tet mesh only, file is h5 or vtk format
  • LibMesh: tet, hex and mixed meshes, file is exodus format

In the future XDG will offer another option.

Task 13 - Simulating with unstructured mesh

In Jupyter Lab / Notebook try

Activation pathways

  • Activation reactions can result in stable and unstable isotopes.
  • Neutron induced reactions tend to not increase the proton number.
  • Irradiation of 5 stable Zr isotopes produces 20 unstable isotopes via direct reactions.

Decay pathways

  • Unstable isotopes decay.
  • Beta- decay transmutates the nuclide +1 proton, -1 neutron, and gammas are also emitted.
  • Unstable isotopes can have multiple decay routes, each with a different probability (branching ratio).
  • Each has a characteristic half life.
  • Stable and natural abundances are not the same thing.

Task 14 - transport free transmutation

In Jupyter Lab / Notebook try

Task 15 - transmutation with transport

In Jupyter Lab / Notebook try

Radioactive decay

  • Decay can produce different particles: Beta+, Beta-, alpha, neutron, gamma.
  • We are unlikely to see neutron decay products in fusion (with the exception of Be).
  • The range of alpha and beta is typically short and often blocked within the material itself.
  • The primary interest is the gamma.

Task 16 - transport with decay gammas

In Jupyter Lab / Notebook try

Getting support with OpenMC

Perhaps the best part of OpenMC is the community.

Other features we have not covered

  • R2S shutdown / residual dose simulations
  • Tally triggers
  • OpenMC lib C++ interface
  • Volume calculations
  • Track simulations
  • Coupled depletion

Many more topics are covered in the neutronics workshop.

Other OpenMC courses

  • NEA databank
  • Conferences
  • OSSFE

We are also considering making a 2 day fusion neutronics analysis workshop depending on demand and availability.

How did we do

  • βš›οΈ Why OpenMC
  • βš™οΈ Installation options
  • 🧱 Making materials
  • πŸ“ˆ Plotting cross sections
  • 🧩 Constructive Solid Geometry (CSG)
  • ☒️ Neutron source terms
  • βš›οΈ Tritium Breeding Ratio simulation
  • πŸ“Š Neutron spectra simulation
  • 🩻 Dose simulations
  • 🎯 Variance reduction
  • πŸ—οΈ Converting CAD to DAGMC models
  • πŸ•ΈοΈ Unstructured mesh tally
  • πŸ”₯ Depletion / activation / transmutation
  • ⏱️ Shutdown dose rate simulation
  • πŸ§‘β€πŸ’» How to get support

![bottom-right](logo)