⚛️ Rarefied Gas — DSMC Collisions

Direct Simulation Monte Carlo (DSMC) for a rarefied gas. Particles stream and collide probabilistically. See the transition from free molecular to continuum flow as Knudsen number changes.

PhysicsInteractive
Colour = particle speed (blue=slow, red=fast) · P pause · R reset

How it Works

The simulation implements a simplified 2D DSMC algorithm. Particles are initialised with velocities drawn from a Maxwell-Boltzmann distribution at temperature T. Each timestep consists of two phases: (1) free streaming — particles move ballistically and reflect off walls with diffuse or specular reflection; (2) collisions — the domain is divided into cells and pairs of particles within each cell undergo probabilistic elastic binary collisions at a rate proportional to their relative speed and the collision cross-section.

The Knudsen number slider changes the collision probability per cell per timestep. High Kn (rarefied) means few collisions and free-molecular behaviour. Low Kn (continuum limit) means many collisions per mean free path and local thermodynamic equilibrium is approached. Particle colours encode speed: blue is thermal (~sqrt(2kT/m)), red is fast.

Kn = λ / L = 1 / (√2 · n · π · d² · L)
f(v) ∝ v² exp(−mv²/2kT) [Maxwell-Boltzmann]
P_coll = n · σ · v_rel · Δt / V_cell

Frequently Asked Questions

What is a rarefied gas?

A rarefied gas is one where the mean free path of molecules is comparable to or larger than the characteristic length scale of the flow. Standard continuum fluid equations break down and kinetic theory must be used.

What is the Knudsen number?

The Knudsen number Kn = λ/L is the ratio of mean free path λ to the characteristic length L. Kn < 0.01 is continuum flow; Kn > 10 is free molecular flow; intermediate values are the transition regime.

What is DSMC (Direct Simulation Monte Carlo)?

DSMC is a particle-based statistical method for rarefied gas flows. Particles stream freely and then undergo probabilistic binary collisions sampled from the Boltzmann collision integral. It was developed by Graeme Bird in the 1960s.

What is the Boltzmann equation?

The Boltzmann equation governs the evolution of the one-particle distribution function f(x,v,t): df/dt + v·df/dx = Q(f,f), where Q is the collision operator encoding binary molecular interactions.

What is mean free path?

The mean free path λ = 1/(√2·n·π·d²) is the average distance a molecule travels between successive collisions, where n is number density and d is molecular diameter.

Where is rarefied gas flow important?

Rarefied gas dynamics is critical in re-entry vehicle aerodynamics, satellite drag, vacuum system design, microelectromechanical systems (MEMS), and shale gas extraction in nano-porous rock.

How does temperature distribution differ in rarefied vs continuum flow?

In rarefied flow, temperature jumps appear at walls (Smoluchowski jump) because incomplete thermal accommodation occurs. In continuum flow the fluid temperature equals the wall temperature at the boundary.

What is the Maxwell-Boltzmann distribution?

The Maxwell-Boltzmann distribution describes the equilibrium speed distribution: f(v) ∝ v² exp(−mv²/2kT). DSMC samples initial velocities from this distribution.

What is the difference between free molecular and continuum flow?

In free molecular flow (Kn >> 1) molecules travel without collisions and interact only with surfaces. In continuum flow (Kn << 0.01) the fluid behaves as a continuous medium described by Navier-Stokes equations.

What collision model does DSMC use?

DSMC typically uses the Variable Hard Sphere (VHS) or Variable Soft Sphere (VSS) model. Pairs of particles within a cell are selected probabilistically based on their relative speed, and elastic collisions conserve momentum and energy.

About this simulation

Every particle here streams ballistically each timestep, then gets sorted into one of 16×8 spatial cells where it may undergo a probabilistic elastic collision with a neighbour — the core two-phase loop of Direct Simulation Monte Carlo (DSMC). The Knudsen slider directly scales the per-cell collision probability, so dragging it toward free-molecular values thins out collisions until particles simply bounce off walls like a rarefied gas in orbit or deep vacuum.

🔬 What it shows

Hundreds of particles coloured by speed (blue slow, red fast) streaming and colliding in a bounded box, revealing how collision frequency governs the transition between free-molecular flow and near-continuum gas behaviour.

🎮 How to use

Set Particle Count N, Temperature T, Knudsen Kn and Mean Flow Ux with the sliders, then read live collision rate and mean free path in the stats panel, or press P/R to pause/reset.

💡 Did you know?

Real DSMC, invented by Graeme Bird in the 1960s, is still the standard tool for modelling spacecraft re-entry and satellite drag, where the surrounding air is too thin for ordinary Navier-Stokes equations to apply.

Frequently asked questions

How does the Knudsen slider change the collision behaviour?

The code sets collProbScale = 1/Kn, so a higher Kn value directly lowers the number of attempted pairwise collisions per cell each step, thinning collisions toward free-molecular flow.

Why do particles brighten to red when moving fast?

Particle colour is mapped from speed relative to a thermal velocity scale derived from temperature T, blending blue (slow) through white to red (fast) so you can see the Maxwell-Boltzmann spread visually.

What do the faint grid lines on the canvas represent?

They mark the 16x8 DSMC collision cells. Only particles sharing the same cell are eligible to collide in that timestep, which is how DSMC avoids expensive all-pairs collision checks.

Why does raising Temperature T change particle speed?

Initial velocities are sampled via a Box-Muller Maxwell-Boltzmann generator scaled by sqrt(kB*T/m), so a hotter gas directly widens the spread and average magnitude of particle velocities.

What does Mean Free Path in the stats panel mean?

It is an estimate of the average distance a particle travels between collisions, computed from particle count and box width — a smaller value indicates a denser, more collisional gas closer to the continuum regime.