Home▸Physics & Mechanics▸Cell-List Molecular Dynamics: Slice Through a Lennard-Jones Box

⚛️ Cell-List Molecular Dynamics: Slice Through a Lennard-Jones Box

A slice through a periodic Lennard-Jones box: speed-coloured atoms, the cell grid and neighbour cells of one atom, energy per atom and the Maxwell-Boltzmann speed distribution.

Physics & Mechanics2DEasy60 FPS📱 Mobile-adapted🟠 Blender⇄ 3D version
Cell-List Molecular Dynamics: Slice Through a Lennard-Jones Box ↗ Open standalone

This is a real 3D molecular dynamics engine, not a reskin of the 2D version: particles live in a cubic box and interact through the same Lennard-Jones potential V(r)=4ε[(σ/r)^12-(σ/r)^6], but neighbor forces are found with a spatial cell-linked list rather than an all-pairs scan, and every particle is one instance of a single InstancedMesh so the whole cloud renders in one draw call while you orbit and zoom the camera freely. Velocity Verlet integration advances positions and velocities each substep with a clamped timestep, so the simulation stays stable even if a frame stalls. Watch clusters of particles pull into loosely bound groups at medium range, then flash apart the instant two get pushed inside the steep repulsive core — the same balance of attraction and repulsion that governs real van der Waals gases and liquids.

⚙ Under the hood

A slice through a periodic Lennard-Jones box: speed-coloured atoms, the cell grid and neighbour cells of one atom, energy per atom and the Maxwell-Boltzmann speed distribution.

molecular dynamicsLennard-Jonesvelocity Verletcell liststatistical mechanicsequipartitionvirial pressureThree.js

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

What did you find?

Add reproduction steps (optional)