HomeThermodynamicsFree (Joule) Expansion of a Gas — 2D

Free (Joule) Expansion of a Gas — 2D

Interactive 2D free-expansion box: an insulated gas confined to one side of a partition rushes into a vacuum when the wall is removed. A live density profile and a time-series graph track occupied length, pressure and entropy while mean molecular speed — proportional to temperature — stays exactly flat, the classic proof that ideal-gas internal energy depends only on temperature.

Thermodynamics2DEasy60 FPS📱 Mobile-adapted⇄ 3D version
2d-thermodynamics-physics ↗ Open standalone

An insulated box holds an ideal gas confined to one side of a removable partition, with vacuum on the other side. Because the surroundings do no work on the gas and no heat crosses the walls, the first law forces the internal energy — and therefore the temperature of an ideal gas — to stay exactly constant through the whole expansion, even though the process is thoroughly irreversible and generates real entropy. This 2D simulator renders the gas as bouncing molecules confined by a real partition line in a pannable, zoomable box view, alongside a live density-profile histogram and a time-series graph, while readouts track occupied length, relative pressure, mean molecular speed and the entropy generated, converging on the textbook result ΔS = N kB ln(L₂/L₁).

⚙ Under the hood

Interactive 2D free-expansion box: an insulated gas confined to one side of a partition rushes into a vacuum when the wall is removed. A live density profile and a time-series graph track occupied length, pressure and entropy while mean molecular speed — proportional to temperature — stays exactly flat, the classic proof that ideal-gas internal energy depends only on temperature.

thermodynamicsentropyideal gasfirst lawirreversibilitykinetic theory

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)