Introduction to OpenMC

What Makes OpenMC Different

OpenMC represents a modern approach to Monte Carlo neutron transport. Unlike traditional codes that rely on text input files, OpenMC uses Python as its primary interface. This means you can build models programmatically, automate parameter studies, and integrate seamlessly with data analysis tools.

Developed at MIT and now maintained by an active open-source community, OpenMC focuses on neutron criticality calculations for reactor physics. The code is completely free to use, modify, and distribute under the MIT license - no export controls or licensing headaches.

Because the interface is Python, complex tasks like parametric studies, optimization, and data processing are much simpler than with traditional codes.

Repositories and scripts for these tutorials

Two repositories matter: the OpenMC application (Python API + transport engine) and the example scripts we mirror for two flagship walkthroughs.

  • OpenMC source and docs — github.com/openmc-dev/openmc (install via conda/pip or from source). Reference material: docs.openmc.org. This is where you get openmc, nuclear-data helpers, and issue tracking—not the ReactorMC tutorial text.
  • Public examples mirror — github.com/caalh/ReactorMC. Holds the same openmc-examples/ tree as the ReactorMC website repo: runnable build_model.py scripts you can run locally once OpenMC and HDF5 cross sections are installed (OPENMC_CROSS_SECTIONS). SCONE tutorial decks live next to it under scone-examples/.

Layout under caalh/ReactorMC (OpenMC parts)

ReactorMC/
└── openmc-examples/
    ├── README.md                 ← prerequisites, OPENMC_CROSS_SECTIONS
    ├── VERIFICATION_SUMMARY.md
    ├── run_all.ps1 / run_all.sh  ← run both examples from repo root
    ├── example_pin/
    │   └── build_model.py        ← aligns with /openmc/example-pin
    └── example_assembly/
        └── build_model.py        ← aligns with /openmc/example-assembly

Every other page in this OpenMC section (geometry, materials, tallies, depletion, …) teaches with inline Python snippets on the site. Those listings are not necessarily copied 1:1 into openmc-examples/; each code block still shows a footer linking to caalh/ReactorMC and labels whether it is a mirrored script, a section of one, or a tutorial-only snippet.

Start from Example: Pin Cell and Example: Assembly when you want a file-oriented path that matches the repo layout above.

Why Choose OpenMC?

If you're comfortable with Python or want to learn modern computational physics, OpenMC offers significant advantages. The code excels at continuous-energy calculations, handles complex 3D geometries naturally, and includes built-in visualization tools.

OpenMC is particularly strong for research applications. The native Python interface makes it easy to integrate with machine learning workflows, optimization algorithms, and uncertainty quantification tools. You can also take advantage of the entire scientific Python ecosystem.

FeatureOpenMCMCNPSerpent
LicenseOpen source (MIT)Export-controlledAcademic license
InterfacePython APIText inputText input
AutomationNative PythonExternal scriptsLimited
VisualizationInteractive plotsBasic plots2D plots

Real Applications

OpenMC is used extensively in nuclear engineering research and industry. Reactor designers use it to model advanced concepts like small modular reactors and Generation IV systems. The code's flexibility makes it ideal for studying complex geometries and novel fuel designs.

Research institutions rely on OpenMC for fuel cycle studies, nuclear data validation, and multi-physics simulations. The Python interface makes it particularly valuable for machine learning applications and automated design optimization.

Learning Path

This guide assumes basic Python knowledge but no prior Monte Carlo experience.

Essential Learning Path

Foundation: Master the Python API, understand geometry creation, and learn material definitions. You'll start with simple pin cells and work up to fuel assemblies.

Core Skills: Learn about tallies, cross sections, and simulation settings. You'll be able to analyze realistic reactor configurations and understand the physics.

Advanced Topics: Explore depletion calculations, parallel computing, and multi-physics coupling. You'll be equipped to handle complex research problems and optimize reactor designs.

Each section includes working code examples. The guide is sequential — later sections build on earlier foundations.

Only the pin and assembly examples have standalone build_model.py twins on GitHub; see Repositories and scripts for these tutorials above.

Related