Quickstart Guide#

This guide walks you through the basic steps to install the package, load a benchmark, run a simulation, and view results — using the OpenMC Fusion Benchmarks framework.

⚠️ This guide assumes you have Python 3.9+ and a working OpenMC installation. For OpenMC setup, refer to the OpenMC documentation.


Install the Package#

Clone the repository and install dependencies in a clean Python environment:

git clone --recurse-submodules https://github.com/eepeterson/openmc_fusion_benchmarks.git
cd openmc_fusion_benchmarks
pip install .

You may wish to make use of a virtual environment using Conda, Mamba or Venv.

Run a Benchmark Simulation#

Minimal working example of instantiating and running a benchmark with the OpenMC transport code.

import openmc_fusion_benchmarks as ofb

benchmark = ofb.OpenmcBenchmark(name='oktavian_al')
benchmark.run()

Running in uncertainty quantification mode:

import openmc_fusion_benchmarks as ofb

benchmark = ofb.OpenmcBenchmark(name='oktavian_al')
benchmark.run(uq=True)

Read Results#

Results from an OFB benchmark simulation follow a standardized Xarray structure and are easily accessible as DataArray objects through the OFB Python API.

import openmc_fusion_benchmarkas as ofb

# Extract results
results = ofb.BenchmarkResults(filepath='benchmark_results.h5')

# Print tallies names available
print(results.tallies)
['neutron_leakage', 'photon_leakage']

And here it is how to extract a specific tally result as xarray.DataArray:

neutron_leakate = results.get_tally(name='neutron_leakage')

Extract Results From Database#

OFB features a standardized, continuously updated database that includes both experimental and computational benchmark results.

import openmc_fusion_benchmarkas as ofb

# Extract experiment from database
experiment = ofb.BenchmarkResults.from_database(benchmark='oktavian_al',filename='experiment.h5')

The rest works exatly like any other results generated by this code.