The Marbles code is a computer program designed to simulation the motion, packing and vibration of spheres that undergo various mechanical forces including gravitation, Hooke's law force and various friction forces. The frictional forces include true static friction that allows non-zero angles of repose. Each sphere is individually simulated using the distinct element method. Marbles uses the soft sphere method, so it is better at simulating a jar of marbles than a game of marbles. Marbles is freely available under the GPL 2 license.
It is based off of the PEBBLES code that I used for my disseration (arxiv 1103.6082). Information about the PEBBLES code is available from the Energy Science and Technology Software Center (ESTSC) at www.osti.gov/estsc, or by phone at (865) 576-2606.