Abstract
Purpose:
PENELOPE provides a means of simulating the transport of charged particles in the presence of external electromagnetic fields. The user must hard-code the magnetic field and recompile the source code. In this work, we develop the means of introducing non-uniform magnetic fields without recompilation and validate this implementation.
Materials and Methods:
We edited the underlying FORTRAN subroutines in the Monte Carlo code to handle non-uniform magnetic fields. A text file defines an arbitrary magnetic field volume into a 3D grid. A trilinear interpolation scheme enables the code to obtain the precise magnetic field vector at any arbitrary point within the grid, corresponding to the particle location at each step in the Monte Carlo simulation.
For validation, test electrons with energies of 6, 12, and 18 MeV were transported through a heterogeneous magnetic field gradient directed at a 45o angle to the incident velocity vector that varied in magnitude from 0 T to 10 T over 50 cm. Simulation results for 25 histories were compared to a numerical solution using 4th-order Runge-Kutta (RK4) methods applied to electrons transported through the same magnetic field.
Results:
In general, the methods produced qualitatively similar tracks. Over the entire trajectory, through a downstream distance of 50 cm, track lengths from RK4 techniques and PENELOPE differed by at most 0.2 mm on average for the magnetic field test configuration.
Conclusions:
PENELOPE simulations using non-uniform magnetic fields were consistent with the trajectories of electrons simulated with RK4 techniques. We can now introduce a non-uniform magnetic field into further studies involving PENELOPE.
