How vihanga-senarath/monte-carlo-neutron-slab-transport-energy-deposition works
This is a C++ Monte Carlo prototype for 1D neutron transport through a slab. The workflow initializes histories, repeatedly samples free paths and resolves collisions until each neutron is absorbed, transmitted, or reflected, then tallies outcomes and absorbed energy by depth bin. It writes the deposition profile to CSV, which a Python script reads to plot. The transport routines are implemented in main.cpp; transport.hpp declares their types and interfaces. Empty I/O and physics files are omitted. The available excerpts do not show additional runtime subsystems.
Main entry points: main.cpp History Loop · transport.hpp Transport Types · plot_deposit.py Profile Plotter
Components 9
Simulation
- History Loop
main.cpp - Outcome Tallies
main.cpp
Neutron Transport
- Free-Path Sampling
main.cpp - Collision Branching
main.cpp - Transport Step
main.cpp - Transport Types
transport.hpp
Deposition Analysis
- Deposit CSV
main.cpp - Profile Plotter
plot_deposit.py
Other components
- User
Connections 8
- User → History Loop: runs
README.md - History Loop → Transport Step: advances histories
main.cpp - Transport Step → Free-Path Sampling: samples path
main.cpp - Transport Step → Collision Branching: resolves collision
main.cpp - Transport Types → History Loop: declares interface
main.cpp - History Loop → Outcome Tallies: counts outcomes
main.cpp - History Loop → Deposit CSV: writes bins
main.cpp - Deposit CSV → Profile Plotter: provides profile
plot_deposit.py