This is a real diffusion-limited aggregation (DLA) model — the same mechanism believed to underlie dendritic crystals, snowflakes and electrodeposits. Monomer "walkers" perform a discrete random walk (Brownian motion) through the solution; when a walker drifts within bonding range of an existing particle it sticks with the sticking probability you set, freezing in place and becoming part of that crystal:
x(t+dt) = x(t) + η·√(2D·dt) (isotropic random walk)
stick if |x_walker − x_neighbor| < r_bond AND rand() < p_stick
Independently, brand-new crystal nuclei appear at random empty sites as a Poisson process at the rate you set — genuine homogeneous nucleation, seeding separate grains that grow and can merge with neighbors through accretion as their dendrites touch.
- Sticking probability controls morphology: near 1.0 the walk barely matters before capture, producing open, wispy dendrites (the classic low-density DLA fractal); lower values let walkers explore more before sticking, densifying the arms.
- Fractal dimension D is estimated live from mass–radius scaling, D ≈ ln(N)/ln(Rg/r₀). Canonical 2D DLA converges to D ≈ 1.71 — watch the readout drift toward it as the cluster grows.
- Crystal grains is the live count of distinct connected clusters (tracked with a union–find over every bond), decreasing whenever two growing grains touch and accrete into one.