Skip to content

Rittik047/PM_PenetrationVisualization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Particle Deposition in the Human Respiratory Tract

GPU-Accelerated Simulation & Visualization

A physics-based simulation of aerosol particle penetration and deposition in human respiratory organs, implementing the ICRP 66 Human Respiratory Tract Model with Weibel Model A lung morphometry.


Quick Start (Google Colab — Recommended)

  1. Upload the notebook to Google Colab:

  2. Enable GPU runtime:

    • Runtime → Change runtime type → T4 GPU (or any available NVIDIA GPU)
    • Click Save
  3. Run all cells:

    • Runtime → Run all (Ctrl+F9)
    • The notebook is self-contained — all dependencies install automatically
  4. Interact:

    • Cell 11 provides an interactive widget with PM size bin toggle buttons
    • Select any PM bin from PM₀.₁ (ultrafine) to PM₁₀ (coarse)
    • Switch breathing scenarios (sleeping, sitting, light/heavy exercise)

Files

File Description
particle_deposition_simulation.ipynb Main notebook — complete simulation + visualization (run this in Colab)
simulation_engine.py Standalone Python module with the ICRP 66 deposition model
gpu_monte_carlo.py GPU-accelerated Monte Carlo particle tracker (PyTorch)
README.md This file

Physics Model

Lung Morphometry

Weibel Model A symmetric dichotomous branching tree with 24 generations:

  • Generation 0: Trachea (d = 18 mm, L = 120 mm)
  • Generations 1–7: Bronchi (BB region)
  • Generations 8–16: Bronchioles (bb region)
  • Generations 17–23: Respiratory bronchioles + alveolar ducts/sacs (AI region)

Deposition Mechanisms

1. Inertial Impaction (dominant for d > 2 μm):

Stk = ρ_p · d_p² · C_c · U / (18 · μ · D_aw)
η_imp = 1 - (2/π) · arccos(θ · Stk)    for θ·Stk < 1

2. Gravitational Sedimentation (dominant for 0.5 < d < 5 μm):

V_ts = ρ_p · d_p² · g · C_c / (18 · μ)
η_sed = 1 - exp(-4 · V_ts · t_res · cos(φ) / (π · D_aw))

3. Brownian Diffusion (dominant for d < 0.1 μm):

D = k_B · T · C_c / (3π · μ · d_p)
Δ = D · L / (U · R²)
η_diff = Ingham (1975) series solution

4. Combined deposition (independent mechanisms):

η_total = 1 - (1 - η_imp)(1 - η_sed)(1 - η_diff)

Cunningham Slip Correction

C_c = 1 + Kn · (1.142 + 0.558 · exp(-0.999/Kn))

where Kn = 2λ/d_p (Allen & Raabe 1985 coefficients).

Extrathoracic Deposition

ICRP 66 semi-empirical fits for inhalability, anterior nasal (ET1), and posterior nasal-to-larynx (ET2) regions.


PM Size Bins

Bin Aerodynamic Diameter Representative d_ae Dominant Mechanism
PM₀.₁ < 0.1 μm 0.05 μm Brownian diffusion
PM₀.₅ 0.1 – 0.5 μm 0.3 μm Diffusion + sedimentation
PM₁.₀ 0.5 – 1.0 μm 0.7 μm Minimum deposition zone
PM₂.₅ 1.0 – 2.5 μm 1.5 μm Sedimentation
PM₄.₀ 2.5 – 4.0 μm 3.0 μm Sedimentation + impaction
PM₁₀ 4.0 – 10 μm 7.0 μm Impaction

Computation

Analytical Model

  • Deterministic evaluation of ICRP 66 equations
  • ~300 μs per particle size on CPU
  • Full size sweep (200 points) in ~60 ms

Monte Carlo (GPU)

  • Stochastic Individual Path (SIP) model
  • Bernoulli sampling at each bifurcation
  • 15% coefficient of variation for inter-subject variability
  • 500,000 particles per bin on T4 GPU (~2s per bin)
  • Falls back to CPU with 100,000 particles if no GPU

Neural Network Surrogate

  • 5-layer feedforward network (SiLU + LayerNorm)
  • Input: [log₁₀(d_p), scenario one-hot encoding]
  • Output: [ET, BB, bb, AI, exhaled] fractions (softmax)
  • Trained on 20,000 physics evaluations
  • Real-time inference (<1 ms) for interactive exploration

Visualizations

The notebook produces 6 main visualization types:

  1. Regional deposition curves — Stacked area plot of ET/BB/bb/AI vs particle diameter
  2. Anatomical lung map — Schematic with deposition heatmap + generation-resolved bars
  3. Mechanism decomposition — Impaction/sedimentation/diffusion per generation
  4. Interactive Plotly dashboard — 4-panel with PM bin toggles
  5. Breathing scenario comparison — Side-by-side sleeping/sitting/light/heavy exercise
  6. Physics parameter space — C_c, D, V_ts, τ, Kn across particle sizes

Running Standalone (Local)

# Install dependencies
pip install torch numpy matplotlib plotly scipy ipywidgets scikit-learn

# Run simulation engine
python simulation_engine.py

# Run Monte Carlo (GPU recommended)
python gpu_monte_carlo.py

References

  1. ICRP Publication 66 (1994). Human Respiratory Tract Model for Radiological Protection. Ann. ICRP 24(1-3).
  2. Weibel, E.R. (1963). Morphometry of the Human Lung. Academic Press.
  3. Hinds, W.C. (1999). Aerosol Technology, 2nd Ed. Wiley.
  4. Hofmann, W. (2011). Modelling inhaled particle deposition in the human lung — A review. J. Aerosol Sci. 42, 693-724.
  5. Longest, P.W. & Holbrook, L.T. (2012). In silico models of aerosol delivery to the respiratory tract. J. Aerosol Sci. 45, 1-17.
  6. Ingham, D.B. (1975). Diffusion of aerosols from a stream flowing through a cylindrical tube. J. Aerosol Sci. 6, 125-132.
  7. Allen, M.D. & Raabe, O.G. (1985). Slip correction measurements of spherical solid aerosol particles. Aerosol Sci. Technol. 4, 269-286.
  8. Tian, G. et al. (2015). Stochastic individual path model for aerosol deposition. Aerosol Sci. Technol. 49, 875-890.

Animated Particle Penetration Simulation

2D & 3D Real-Time Visualization

Live animated simulation of particulate matter (PM) inhalation and deposition in human organs, with physics-based particle trajectories computed from the ICRP 66 Human Respiratory Tract Model.


Files

File Type Description
particle_sim_2d.jsx React Component 2D animated canvas simulation with anatomical body cross-section
particle_sim_3d.html Standalone HTML 3D WebGL simulation with CAD-style navigation (Three.js r128)
particle_deposition_simulation.ipynb Jupyter Notebook Full GPU-accelerated physics model (from previous delivery)
simulation_engine.py Python Module ICRP 66 computation engine
gpu_monte_carlo.py Python Module GPU Monte Carlo tracker

Running the 3D Simulation

Option A: Direct file open (simplest)

Open particle_sim_3d.html in any modern browser (Chrome, Firefox, Edge, Safari)

That's it — the file is completely self-contained. No server needed. Three.js loads from CDN.

Option B: Local HTTP server (if CDN blocked)

# Python 3
python -m http.server 8000

# Then open: http://localhost:8000/particle_sim_3d.html

3D Controls (CAD-style navigation)

  • Left-drag: Orbit around the body
  • Right-drag: Pan
  • Scroll wheel: Zoom in/out
  • Touch: Single-finger orbit (mobile)
  • Wireframe button: Toggle body wireframe view
  • X-Ray button: Increase organ visibility, decrease body opacity

Running the 2D Simulation

The 2D simulation is a React component (.jsx). It renders in Claude.ai's artifact viewer directly.

To run standalone:

# Create a new React project
npx create-react-app particle-sim
cd particle-sim

# Copy particle_sim_2d.jsx to src/App.jsx (rename the default export)
cp particle_sim_2d.jsx src/App.jsx

# Install dependencies (none beyond React)
npm start

Or paste the code into any React playground (CodeSandbox, StackBlitz, etc.).


Physics Model

Both simulations implement identical physics from the ICRP 66 HRTM:

Particle Fate Determination

Each particle's deposition region is sampled from the ICRP 66 probability distribution:

  1. Compute regional deposition fractions (ET, BB, bb, AI) for the given diameter
  2. Sample a uniform random number r ∈ [0, 1]
  3. Map r to a region via cumulative distribution
  4. Particle follows the anatomical path to that region

Particle Dynamics During Transit

  • Trajectory: Interpolation along Weibel airway centerlines
  • Brownian motion: Random displacement ∝ √D perpendicular to flow (Wiener process)
  • Gravitational settling: Downward drift ∝ V_ts (Stokes settling velocity with Cunningham correction)
  • Impaction at bifurcations: Encoded in the ICRP 66 deposition probability (Stokes number dependent)

Ultrafine Particle Translocation (PM₀.₁)

Particles < 100 nm can translocate through the alveolar epithelium into systemic circulation:

  • ~25-30% of alveolar-deposited UFPs enter bloodstream (Oberdörster 2004, Kreyling 2017)
  • Distributed to liver, kidneys, brain, spleen via blood flow
  • Visualized as red particles following blood vessel paths

Deposition Mechanisms by Size

Diameter Dominant Mechanism Physics
< 0.1 μm Brownian diffusion D = kT·Cc/(3πμdp), Δ = DL/UR²
0.1–0.5 μm Deposition minimum Low Stk, low Vts, moderate D
0.5–2.5 μm Sedimentation Vts = ρp·dp²·g·Cc/(18μ)
2.5–10 μm Inertial impaction Stk = τ·U/D_aw at bifurcations

Key Equations Implemented

Cunningham slip correction (Allen & Raabe 1985):

Cc = 1 + Kn·(1.142 + 0.558·exp(-0.999/Kn))
where Kn = 2λ/dp (Knudsen number)

Impaction efficiency (Yeh & Schum 1980):

η_imp = 1 - (2/π)·arccos(θ·Stk)  for θ·Stk < 1

Sedimentation efficiency:

η_sed = 1 - exp(-4·Vts·tres·cos(φ) / (π·D_aw))

Diffusion efficiency (Ingham 1975):

η_diff = f(Δ), where Δ = D·L/(U·R²)
Ingham series: η = 1 - 0.819·exp(-14.63Δ) - 0.0976·exp(-89.22Δ) - ...

Combined (independent mechanisms):

η_total = 1 - (1 - η_imp)(1 - η_sed)(1 - η_diff)

PM Size Bins

Toggle between these in both simulations:

Bin Representative d_ae Visual Size Color
PM₀.₁ 0.05 μm Smallest Pink
PM₀.₅ 0.3 μm Small Orange
PM₁.₀ 0.7 μm Medium-small Yellow
PM₂.₅ 1.5 μm Medium Green
PM₄.₀ 3.0 μm Medium-large Blue
PM₁₀ 7.0 μm Largest Purple

Visual Features

2D Simulation

  • Anatomical body outline with positioned organs
  • Real-time particle trails with Brownian jitter
  • Particle glow effects proportional to size
  • Deposited particles pulse at deposition site
  • UFP translocation shown as color change (→ red) following blood vessels
  • Live deposition statistics with ICRP 66 predicted values
  • Physics readout (Cc, D, Vts, τ)

3D Simulation

  • Full procedural 3D human body with transparent skin
  • Semi-transparent organs (lungs, heart, liver, kidneys, brain, stomach)
  • Visible airway tree (trachea → bronchi → bronchioles → alveoli)
  • Blood vessel paths for translocation
  • Organ emission/glow proportional to local deposition
  • CAD-style orbit/pan/zoom navigation
  • Wireframe and X-Ray viewing modes
  • Additive-blend particle rendering for depth perception

References

  1. ICRP Publication 66 (1994). Human Respiratory Tract Model for Radiological Protection.
  2. Weibel, E.R. (1963). Morphometry of the Human Lung.
  3. Oberdörster, G. et al. (2004). Translocation of inhaled ultrafine particles to the brain. Inhal. Toxicol. 16, 437-445.
  4. Kreyling, W.G. et al. (2017). Air–blood barrier translocation of tracheally instilled gold nanoparticles inversely depends on particle size. ACS Nano 8, 222-233.
  5. Hofmann, W. (2011). Modelling inhaled particle deposition in the human lung. J. Aerosol Sci. 42, 693-724.
  6. Ingham, D.B. (1975). Diffusion of aerosols from a stream flowing through a cylindrical tube. J. Aerosol Sci. 6, 125-132.

About

Python Model and Notebook for PM Penetration in Human Body by their Size

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors