A simulator for the granular clock phenomenon [1]. When a mixture of two particle sizes is placed in a box with a low partition and subjected to vibration, the particle distribution on each side of the partition periodically reverses.
This program uses physics simulation to model the particle dynamics and visualizes the results with Bevy.
Live demo (runs in your browser): https://granular.necocen.info/
Supported browsers: Chrome and Firefox with WebGPU support (Safari is not currently supported)
Requires Rust (2024 edition or newer).
cargo run --releaseSimulation parameters can be configured in simulation.toml. Once the binary is built, you can also run it directly with a different config file:
/path/to/granular-clock --config ./simulation.tomlInstall Web support tooling:
rustup target add wasm32-unknown-unknown
cargo install trunkThen run:
trunk serveThis will open the simulation in your browser. Note that the build is quite slow due to WASM size optimization.
When running in the browser, custom simulation.toml files cannot be passed at runtime.
Left mouse button drag: orbitRight mouse button drag: panMouse wheel: zoom
- Switch physics backend:
GPU/CPU - Adjust
Substeps / Frame - Toggle oscillation and adjust amplitude/frequency
- Adjust divider height
- Adjust particle/wall contact parameters
Pause/Resume,Reset
- R. Lambiotte, J.M. Salazar, L. Brenig — From particle segregation to the granular clock, Physics Letters A, 343, 2005, 224
