PH5023 Monte Carlo Radiation Transport Techniques

PH5023 Monte Carlo Radiation Transport Techniques

Kenny Wood (kw25)

Overview

This module introduces the theory and practice behind Monte Carlo radiation transport codes for use in physics, astrophysics, atmospheric physics, neutron transport for criticality calculations, and medical physics. Core topics that will be covered include: recap of basic radiation transfer; techniques for sampling from probability distribution functions; an isotropic scattering code; computing the radiation field, pressure, temperature, and ionisation structure; programming skills required to write Monte Carlo codes; code speed-up techniques and parallel computing; three-dimensional codes.

The module will comprise lectures and at least two taught lab sessions. The lecture notes will be provided on-line below both in PDF format and read-only pptx files with audio. The lab sessions will introduce the basic Fortran programming skills required for the module. By the end of the lab sessions each student will have written their own Monte Carlo codes to sample from probability distribution functions and also a code that simulates isotropic scattering of radiation from a point source at the centre of a unifom density sphere. Another lab session will follow on from lectures that describe a publicly available three dimensional scattering code. During this lab session, students will be led through the 3D code's subroutines and how to adapt them for their own three dimensional radiation transport simulations.

Prerequsites: PH2012: Physics 2B, plus at least 1 of the following: AS3013: Computational Astrophysics, PH3080: Computational Physics, PH3081: Mathematics for Physicists, PH3082: Mathematics for Chemistry/Physics

Texbooks

A Monte Carlo Primer by Dupree & Fraley. This book focuses on neutron transport but the techniques are the same for photon transport and it has lots of programming examples. Several copies of this have been bought for the Physics & Astronomy library.

Steve Jacques (who gave three guest lectures in 2014) has supplied this review chapter on Monte Carlo simulations of photon transport in biological tissue: PDF

Lectures

PDFs of the lecture slides are available with two slides per page. The Power Point files containing audio on each slide are available as read-only pptx files.

Lecture 1: Overview and background requirements PDF

Lecture 2: Introduction and history PDF

Lecture 3: A Monte Carlo Scattering Code: Part 1 PDF

Lecture 4: A Monte Carlo Scattering Code: Part 2 PDF

Lecture 5: Intensity moments, Monte Carlo estimators, random numbers PDF

Lecture 6: Monte Carlo sampling techniques PDF

Lecture 7: Variance reduction techniques PDF

Lecture 8: Neutron transport: revision & outline of MCRT ideas PDF

Lecture 9: Monte Carlo neutron transport & criticality calculations PDF

Lecture 10: Scattering and refractive index changes PDF

Lecture 11: MCRT on a 3D Cartesin Grid PDF

Lecture 12: Monte Carlo photoionization PDF

Lecture 13: Time dependent MCRT and radiation magneto hydrodynamics PDF

Guest lectures will not be given in 2021, but PDFs available here:

Louise Campbell (2016): Monte Carlo simulations of photodynamic therapy PDF

Prof Jerry DeGroot from St Andrews School of History has kindly provided these two articles that you may be interested in reading before the history lectures and morality discussion session.

Jerry's lecture to the Royal United Service Institute

Temptation of terror

Jerry DeGroot: Physics and morals I PDF

Jerry DeGroot: Physics and morals II PDF

Homework Sheets

The module assessment will be 100% continuous assessment comprising two homework sheets (50%), a 50 minute written class test (25%), and a three hour computing test (25%).

Homework 1

Homework 2

Tutorial Sheet

This tutorial sheet contains questions of a similar style and level to the class test.

Lab Sessions

In weeks two and three there will be some taught lab sessions where students will be walked through the steps to write, compile, and execute their own Monte Carlo codes for the problems described in this example sheet.

In around week 7, there will be a lab session on using my 3D grid code. The Lab script for the 3D grid code is here: PDF

Fortran programming resources

For those students with little or no fortran programming experience, the links below provide very clear (and short) introductions to the structure of fortran codes and all that you will require to tackle the homework sheets. I have also prepared a very short intro lecture on basic fortran programming available as PDF and also read-only pptx with audio:

FORTRAN_INTRO.pdf

FORTRAN_INTRO.pptx

This lecture closely follows the Stanford tutorial linked below.

You may wish to use the random number generator ran2.f from Numerical Recipes for the exmple sheet problems. For the example in my fortran notes to numerically integrate the solar spectrum, read in the fluxes and wavelengths from this file: solarspectrum.dat.

Fortran 90 Computational Astrophysics taught by Peter Woitke at St Andrews

Fortran 77 tutorial from Stanford University

Fortran notes from the University of Hawaii

Monte Carlo Radiation Transport on a 3D Cartesian Grid

I have set up a 3D grid code to compute the average number of scatterings of photons emitted from the centre of a uniform density sphere. The emission and scattering are both assumed to be isotropic. The code algorithms and subroutines are described in the lecture "MCRT on a 3D Cartesian Grid." You can download a tar file of the code here. To unpack the tarball, type "tar - xvf grid.tar" and this will give you eight fortran files, two txt files, an input.params file, a README, and a Makefile. To get started type "make" and this will produce an executable file called "mcgrid." When you run this the code will generate some output to the screen. The code is set up for a simulation where the optical depth across the sphere's diameter is 20 (radial optical depth of 10). The average number of scatterings for this optical depth and input parameters given is 57.35.

The code writes out a file "density.dat" which is an unformatted fortran file comprising the 3D density grid. You may use this short fortran code, read_write.f to read in the density grid and write out a 2D slice through the grid. You can then import the output 2D slice into a plotting program (gnuplot, IDL, Mathematica, etc) to display the slice as a 2D image.

Resources

Here are some links to texts and other Monte Carlo lectures and courses that I've found on random walks around the internet...

Texts, Notes, and Review Chapters:
The classic text by Cashwell and Everett (1957): A Practical Manual on the Monte Carlo Method for Random Walk Problems PDF
Monte Carlo Techniques of Electron and Photon Transport for Radiation Dosimetry by Rogers and Bielajew PDF

Historical development of Monte Carlo Radiation Transfer
The following files are from the Los Alamos archive and give a very enjoyable overview of the development of MCRT.
Letter from John von Neumann to Bob Richtmyer, 1947
The Beginning of the Monte Carlo Method by Nick Metropolis
Stan Ulam, John von Neumann, and the Monte Carlo Method, by Roger Eckhardt
Metroplois, Monte Carlo, and the MANIAC, by H.L. Anderson

Lecture Courses and Summer Schools
St Andrews Monte Carlo Summer School