This model was developed as part of my Bachelor’s thesis in Mechanical Engineering to study neutron moderation in soil and its dependence on water content, with applications in water leak detection.
This project implements a history-based Monte Carlo neutron transport model to simulate how cosmic-ray neutrons interact with soil and progressively lose energy through scattering until thermalization, absorption, or escape.
Cosmic rays are extremely high-energy particles originating mainly from supernova explosions and other celestial bodies. During their journey through interstellar space, unstable particles decay; for this reason, protons are the particles that most frequently reach the Earth's atmosphere. When they enter the Earth's atmosphere with energies of the order of GeV, they interact with nitrogen and oxygen nuclei, generating cascades of particles, i.e. secondary cosmic rays consisting mainly of protons, muons and neutrons.
Secondary cosmic radiation formation scheme.
Neutrons undergo successive interactions with the atmosphere, which progressively reduces their energy, giving rise to different energy bands: high-energy, fast, epithermal and thermal neutrons.
Neutron energy spectra at the surface: exemplary measurement by Goldhagen et al. [2002] (grey) and simulated by Sato and Niita [2006].
The neutron population detected above the ground strongly depends on:
- soil moisture
- soil chemical composition
- density
- porosity
The purpose of this simulator is to model this moderation process using a particle-by-particle Monte Carlo approach.
The simulator tracks each neutron individually from its generation to its final state.
Each neutron is generated with:
- energy sampled from the PARMA spectrum stored in
SpectrumCurrent.csv - an isotropic direction in the upper hemisphere
- an initial position at the soil surface
Differential flux as a function of the neutron energy. The orange line denotes the input flux in the simulations, as obtained from the PARMA model, whereas the blue line indicates the flux measured at the detector position, which also includes the albedo component.
The neutron propagates through the soil medium where its motion is governed by stochastic interactions.
The soil can be characterized by parameters such as:
- density
- porosity
- water content
- elemental composition
The interactions considered are elastic scattering and absorption. Each process is associated with a probability that depends on the neutron energy and the cross section of the element involved. The cross section curves used and shown in the figure are based on experimental data available in the literature.
Each collision updates:- neutron energy
- neutron direction
- neutron position
- number of collisions
The neutron history stops when one of the following conditions occurs:
- thermalization
- absorption
- backscattering
Clone the repository:
git clone https://github.com/M4x000/Neutron-Thermalization-Simulator.git
cd Neutron-Thermalization-SimulatorInstall dependencies:
pip install -r requirements.txtRun the simulator with:
python neutron_simulator.pySimulation parameters such as:
- number of neutrons
- soil properties
- interaction parameters
can be modified directly in the script.
This simulator can be used for:
- studying neutron moderation in soil
- investigating the impact of soil moisture on neutron transport
- supporting research on cosmic-ray neutron sensing
Here are some example outputs generated by the model:







