How pmocz/dsmc-python works
This is a compact, single-script DSMC simulation of dilute gas in the Rayleigh problem. Running dsmc.py configures the simulation, initializes sampling particles, advances them through drift, wall interactions and cell-based collisions, records velocity statistics, then compares the result with BGK theory and plots and saves the figures. These stages are implemented together in one file rather than separate modules; the graph preserves their runtime order and shows the external numerical and plotting libraries.
Main entry points: dsmc.py Simulation setup
Components 14
Simulation
- Run simulation
dsmc.py - Simulation setup
dsmc.py - Particle initialization
dsmc.py - Particle drift
dsmc.py - Wall interactions
dsmc.py - Cell collisions
dsmc.py
Analysis and plots
- Velocity statistics
dsmc.py - BGK comparison
dsmc.py - Plot results
dsmc.py
Other components
- User
- NumPy
- SciPy special
- Matplotlib
- Saved figure
Connections 15
- User → Run simulation: runs
README.md - Run simulation → Simulation setup: configures
dsmc.py - Simulation setup → Particle initialization: sets parameters
dsmc.py - Particle initialization → Particle drift: advances
dsmc.py - Particle drift → Wall interactions: handles boundaries
dsmc.py - Wall interactions → Cell collisions: updates particles
dsmc.py - Cell collisions → Velocity statistics: records velocities
dsmc.py - Velocity statistics → BGK comparison: compares with
dsmc.py - BGK comparison → Plot results: plots comparison
dsmc.py - Plot results → Saved figure: saves
dsmc.py - Simulation setup → NumPy: computes with
dsmc.py - Particle initialization → NumPy: samples with
dsmc.py - Cell collisions → NumPy: computes with
dsmc.py - BGK comparison → SciPy special: uses Bessel function
dsmc.py - Plot results → Matplotlib: plots and saves
dsmc.py