In order to capture the unique behaviors that such materials exhibit,
we depart significantly from traditional fluid simulation techniques.
Firstly, to allow the material to disperse freely when agitated
but maintain its volume when at rest, we replace the existing
fluid-based model’s assumption of incompressibility with a unilateral
variational constraint. Secondly, unlike fluid viscosity, friction
in granular materials can counteract gravity to maintain stable piles
in equilibrium. This requires solving for the internal stresses in a
global fashion. We present an efficient method for this numerical
problem, permitting appropriate frictional behavior and solid body
interaction.