Firefly 003

Build a Nuclear Reactor in 1 Hour

Series
Firefly Reading Circle
Workshop
Hands-on OpenMC session
Preparation
One-time install / 5–10 minutes
Platforms
Google Colab / macOS / Linux / Windows WSL
00

Introduction

You'll build a small reactor core out of fuel pins and control rods, run a real Monte Carlo neutron simulation in OpenMC, and see where the power is produced. Then you'll change the design and watch the results move.

Reactor model: red fuel pins, grey cladding, blue water, black control rods
Fig. 01 — Reactor geometry / fuel pins and control rods

Choose how you want to run the workshop: download all the local project files for your computer, or use Google Colab in your browser. Complete your chosen setup before the session.

01

Choose how to run

Option 1 — Run on your computer

Download the complete local workshop in one ZIP. No Google account or Colab is needed. Supported on macOS, Linux, and Windows through WSL (not directly on iPhone or iPad).

Includes the runnable notebook, Python script, setup script, software environment file, nuclear data, README, facilitator guide, and example images. Unzip the download, open the openmc-reactor-circle folder in Terminal, and run:

bash setup.sh

The first run needs internet to install OpenMC and Jupyter. The notebook then runs on your computer and opens in your browser; your project files and results stay on your machine. The separate Colab notebook below is only needed for Option 2.

Option 2 — Run in Google Colab

Download both files below. Open Google Colab, sign in, and choose File → Upload notebook to open Firefly_003_Colab.ipynb. Use a Python 3 CPU runtime; no GPU is needed.

Run cell A and wait for its automatic restart, then run B to install OpenMC and C to upload the workshop ZIP. Continue through the workshop cells in order. Initial setup takes several minutes. On a phone, use Safari or Chrome; desktop view may be easier. Colab files are temporary, so download your results before disconnecting.

For Colab, keep the ZIP compressed and upload it in cell C. It is the same ZIP as the local download above; you only need to download it once. The ZIP includes the nuclear data; Colab installs the software separately. Skip the local setup section below.

02

Local computer setup

For Option 1 only. Download and unzip all local workshop files above, then follow the instructions for your platform.

Both platforms are shown below. Select a platform heading to collapse or expand its instructions.

macOS / Linux

Open Terminal, then type cd (with a space), drag the unzipped folder into the window, and press Enter. Then run:

bash setup.sh

It installs everything into your home folder (no admin password) and opens the notebook in your browser. On Apple Silicon Macs, say yes if macOS asks to install Rosetta.

Windows / WSL

OpenMC runs on Windows through WSL (Windows' built-in Linux).

  1. Open PowerShell as Administrator, run wsl --install, and restart your PC.
  2. Open the Ubuntu app from the Start menu and run the commands below. Replace YOUR_NAME with your Windows username.
sudo apt update && sudo apt install -y unzip curl
cp /mnt/c/Users/YOUR_NAME/Downloads/openmc-reactor-circle.zip ~ && cd ~
unzip openmc-reactor-circle.zip && cd openmc-reactor-circle
bash setup.sh

Then copy the http://localhost:8888/... link it prints into your browser.

Check your install before doing experiments: run bash setup.sh --check. It runs the whole simulation without opening a browser and prints a success check mark when everything works. The check removes generated simulation outputs afterward; do not use it to preserve an existing run.

03

In the session

On your computer: run bash setup.sh from the project folder. In the notebook that opens, run the cells from top to bottom with Shift + Enter.

In Colab: complete cells A–C, then run the workshop cells in order using their play buttons. Use the final cell to download your results before the runtime ends.

04

What you'll see

Neutron flux and fission power heatmaps
Fig. 02 — Neutron flux / fission power

k-effective = 0.139 ± 0.002 means the core is strongly subcritical with every control rod in. In the experiments, you'll find out what pushes it toward 1.0.

05

Stuck?

  • permission denied: ./setup.sh Run bash setup.sh instead.
  • Browser didn't open Copy the http://localhost:8888/... link from the terminal.
  • "Nuclear data MISSING" in the notebook Open it from inside the unzipped folder.

Teaching model with realistic PWR-like dimensions. It is not a validated reactor design.