SimuVeda

Chemistry · Simulator 024

Molecular Diffusion

Two kinds of particles start on opposite sides of a box. Lift the barrier and watch them mix through random collisions. Change the temperature, particle count and mass, and track how far particles wander: the mean squared displacement grows in proportion to time.

How the model works

No particle is “trying” to mix. Each one moves in a straight line until it collides, then heads off in a new direction. The resulting random walk spreads particles out because there are vastly more mixed arrangements than separated ones.

For a random walk in two dimensions, the mean squared displacement grows linearly with time:

⟨r²⟩ = 4 D t

where D is the diffusion coefficient. Faster particles diffuse quicker: in this model the typical speed is v ∝ √(T/m), so heavier or colder particles spread more slowly (Graham's law).

The simulator moves particles with hard-disc collisions between them and elastic wall bounces. It measures ⟨r²⟩ directly from the particles' unwrapped displacements and fits D from the slope. A fixed seed makes each run reproducible.

2-D hard-disc model in arbitrary units; speeds are scaled for viewing. Real gas diffusion coefficients depend on pressure and molecular size as well.

Guided experiments

  1. Lift the barrier. Equal masses at room temperature. Prediction: the mixing fraction rises quickly and then levels off near 50/50. Particles keep moving, but the overall mix stops changing.
  2. Heat it. Quadruple the temperature. Prediction: speeds double, so the fitted D roughly doubles and mixing is faster.
  3. Heavy vs light. Make one species 4× heavier. Prediction: the light particles spread about twice as fast (√4 = 2), and their ⟨r²⟩ line is steeper.

Challenge

If a particle's mean squared displacement is 1 cm² after 10 s, how long until it reaches 2 cm² and 10 cm²? Why does diffusion feel slow over long distances?

Reveal the explanation

⟨r²⟩ ∝ t, so 2 cm² takes 20 s and 10 cm² takes 100 s. Typical distance grows only as √t: to go 10 times as far takes 100 times as long. That is why perfume spreads across a room mainly by air currents, while diffusion handles the last millimetres.

References

  • OpenStax, Chemistry 2e, §9.4 “Effusion and Diffusion of Gases”.
  • Berg, Random Walks in Biology, ch. 1.