Validation/Molecular dynamics
A box of argon
Statistical mechanics gives the answer exactly, but only on average — so the scatter has to be predicted as well as the mean, and this page states both.
Why this case
Molecular dynamics is the one solver family in the product with nothing in it to compare against an experiment. There is no wall, no body, no inlet and no force — the ideal model for the family is a cube of fluid at a stated density and temperature, wrapped onto itself in all three directions.
That is not a weakness. A box like that obeys four statements that are exact rather than measured, and none of them has a fitted constant in it.
- Equipartition. At equilibrium the mean kinetic energy of a monatomic molecule is (3/2) kBT in three dimensions, so the temperature computed from the velocities the solver carries must be the temperature the case was set to.
- Maxwell–Boltzmann. The equilibrium speed distribution is known in closed form, and one ratio of its moments is dimensionless — no temperature and no mass in it at all.
- Momentum. Gravity is zero and every one of the six patches is cyclic. Nothing outside the box pushes on it, so the total momentum cannot change — not approximately: it is a sum the integrator adds and subtracts the same numbers from.
- Energy. The solver integrates Newton’s equations with no thermostat, which is an NVE ensemble. Kinetic plus potential energy is a constant of the motion, and how nearly a leapfrog run keeps it is the whole quality of the time step.
The dimensionless moment ratio
<v> / sqrt(<v^2>) = sqrt(8 / (3 pi)) = 0.9213177
A box whose velocities are not Maxwellian misses that ratio whatever its temperature is, and a box at the wrong temperature still hits it — so the two checks are independent.
| Physics | Molecular dynamics, periodic in all three directions, no external force |
|---|---|
| Box | 4.924983316 nm on a side — a volume of 1.1945774 × 10⁻²⁵ m³ |
| Fluid | Argon at 1220 kg/m³; molecule mass 6.63352033 × 10⁻²⁶ kg |
| Molecules | 2197, checked against ρV/m rather than trusted — expected 2197.0000005 |
| Time step | 10⁻¹⁴ s |
| Run | Equilibrated for 5000 steps to 5 × 10⁻¹¹ s, then 2000 NVE steps over 1.999 × 10⁻¹¹ s |
| Reference | Equipartition and the Maxwell–Boltzmann distribution |
| Agreement | Temperature 300.279 K against a requested 300, which is 0.05 of one standard deviation |
A statistical result needs its scatter
Every number below is one sample of 2197 molecules, and 2197 is not a large number. An agreement quoted without its scatter would mean nothing: 306 K against a requested 300 is not a 2 % error, it is 1.2 standard deviations, which is what a correct sample of that size looks like.
| Quantity | Exact value | Predicted standard deviation | As a fraction |
|---|---|---|---|
| Temperature | 300 K | 5.225894 K | 1.74 % |
| ⟨v⟩ / √⟨v²⟩ | 0.9213177 | 0.00210150 | 0.23 % |
Both scatters were then confirmed against the product rather than only against the algebra. The initialiser was run 30 times on the staged box, a second apart because it seeds itself from a clock with one-second resolution and back-to-back calls otherwise repeat the same draw.
| Quantity | Mean of 30 samples | Standard deviation of 30 samples | Exact value | Predicted standard deviation |
|---|---|---|---|---|
| Temperature | 300.410 K | 5.309 K | 300 K | 5.226 K |
| ⟨v⟩ / √⟨v²⟩ | 0.921334 | 0.001937 | 0.9213177 | 0.002102 |
Result
| Quantity | Measured | Exact | Difference in standard deviations |
|---|---|---|---|
| Temperature, mean over the NVE run | 300.279355 K | 300 K | +0.05σ |
| Temperature, first half of the run | 300.167322 K | 300 K | +0.03σ |
| Temperature, second half of the run | 300.391387 K | 300 K | +0.08σ |
| Temperature, at the last step | 298.011416 K | 300 K | −0.38σ |
| ⟨v⟩ / √⟨v²⟩ after the run | 0.92267067 | 0.9213177 | +0.64σ |
The two conservation laws are checked separately, because they are exact rather than statistical and there is no scatter to allow for.
| Quantity | Value | What it should be |
|---|---|---|
| Total momentum at the start | 7.7489180 × 10⁻²⁵ | Whatever the draw gave |
| Drift in total momentum | 0.0 | Exactly zero |
| Drift in total energy | 7.788279 × 10⁻⁶ | Zero, in an NVE ensemble |
| End-to-end change in total energy | 2.600263 × 10⁻⁵ | Zero |
| RMS fluctuation in total energy | 5.377835 × 10⁻⁵ | Zero |
| Full spread in total energy | 3.2000483 × 10⁻⁴ | Zero |
Why the run is in two halves
The initialiser lays the molecules on a lattice at the spacing the density asks for, which for this case puts every molecule within a hair of the bottom of its potential well. That is not an equilibrium configuration, and the solver reference says so in as many words: the stored potential energy comes out over the first few picoseconds and the temperature goes with it.
So the healthy run equilibrates first — with the solver that rescales velocities towards the target temperature at each write — and only then runs the plain NVE solver, whose momentum and energy are the ones worth checking, because a thermostat conserves neither.
| Stage | Temperature (K) | From 300 K |
|---|---|---|
| On the lattice, as initialised | 308.663947 | +1.66σ |
| Start of equilibration | 307.859215 | +1.50σ |
| End of equilibration, 5000 steps | 305.945835 | +1.14σ |
| Mean over the NVE run | 300.279355 | +0.05σ |
The failing fixture is the product's own default
Choosing this solver in the product runs the initialiser and then the solver. That is the whole pipeline; there is no equilibration in it. Run that way, the box settles at 229.3 K when the case asked for 300 — the lattice is laid down at 300 K, the kinetic temperature is through 250 K within fifty steps, and it settles over the next two thousand at a value 13.5 standard deviations from where the case was set.
And it reports that without complaint. Every step succeeds, the momentum is conserved to every figure printed and the energy to 2.5 × 10⁻⁵ of the kinetic energy. Only the temperature says anything is wrong. That is documented rather than broken — the solver reference already tells the reader to equilibrate first — and it makes a good failing fixture precisely because it is real, reachable and quiet.
What this page does not establish
- The speed distribution is compared through one moment ratio, not point by point. ⟨v⟩/√⟨v²⟩ is dimensionless and independent of the temperature check, which is what makes it worth reporting — but a distribution can in principle miss its shape while hitting that ratio. No histogram comparison is recorded here.
- Everything is at one time step and one box. There is no time-step refinement study on this page. A separate fixture raises the step threefold, and it is not reported here.
- There is no body in the domain. The molecular methods in the product run in a box and only in a box; a wall built of tethered molecules is not something this build does. Nothing on this page says anything about molecular flow past a surface.
- Nothing here is a validation against a measurement. Statistical mechanics gives these answers exactly, which is the whole reason this case exists; it is not a comparison against an experiment on argon.
Repeat this yourself
Every case here is set up from the worked examples in the product, with no hand-editing of solver files — so you can run it, and get the same numbers. The free tier runs real cases up to 250,000 cells of fluids, or 100,000 nodes of solid, with no account needed to download and no time limit.
Other cases
- A manufactured solutionThe only case here that checks the arithmetic rather than the answer. Pick the solution first, work out what source term it needs, and the error is then known exactly on every mesh.
- A pressure wave crossing a tubeA wave that stays smooth, so the answer is exact for as long as it does. It is also the case that showed refining the mesh alone can hide a first-order time scheme completely.
All validation cases · Written by the team building SHD Sim.