Skip to content

fusion-energy/magnetic_fusion_openmc_dagmc_paramak_example

Repository files navigation

This example simulates a simplified model of an inertial confinement fusion reactor.

This example simulates a 90 degree sector model of a fusion reactor with reflecting surfaces.

  • A CAD model is made and automatically converted to a DAGMC geometry that is then used in OpenMC for a neutronics simulation.
  • The neutronics simulation obtains the tritium breeding ratio and a 3D map of tritium production.
  • The simulation outputs are post processed to display the results and produce a VTK file for visualization.

👉 📹 Link to video tutorial for this repository 📹

Prerequisites

This minimal example makes use of Conda to manage and install the packages.

You will need one of these conda distributions to be installed or work within a Docker image

First clone the repository

git clone https://github.com/shimwell/magnetic_fusion_openmc_dagmc_paramak_example.git
cd magnetic_fusion_openmc_dagmc_paramak_example

Making the DAGMC model

Make an environment for the model preparation from your base environment

conda activate base
conda env create -f environment_cad.yml
conda activate env_cad

Then run the script for making the DAGMC model.

python 1_creation_of_dagmc_geometry.py

Then open the dagmc.html file in an internet browser to view the CAD created

CAD geometry image

Optionally you can inspect the DAGMC file at this stage by converting the h5m file to a vtk file and opening this with Paraview

mbconvert dagmc.h5m dagmc.vtk
paraview dagmc.vtk

DAGMC model image

Simulating the model in OpenMC

First make an environment for simulation from your base environment.

conda activate base
conda env create -f environment_neutronics.yml
conda activate env_neutronics

Then run the simulation which will produce a statepoint.10.h5 file that contains the simulation outputs

python 2_run_openmc_dagmc_simulation.py

Then run the post processing script that should output the heating and Tritium Breeding Ratio to the terminal and make a VTK showing the heating and the neutron interactions resulting in tritium production

python 3_extract_results.py

Open up the VTK file with Paraview and slice the data to see the heating

paraview tritium_production_map.vtk

Mesh Tally result

The VTK file showing the Tritium Breeding Ratio is similarly opened:

paraview heating_map.vtk