Saturday, December 12, 2015

Three-State Granular Solver Research

Description of Problem:

In cooperation with Seth Holladay, an animation professor at BYU, I helped him implement a new simulation method for granular materials described in his dissertation: "Optimized Simulation of Granular Materials"

As explained in his dissertation, simulating granular materials, even at a uniform room temperature, can behave as a solid, liquid, or a gas as shown in the figure below.

This cross-section of ball bearings falling over each other show that granular materials exhibit different behaviours at the same temperature
Knowing this, our goal was to use this to our advantage to allow the simulation to compute physically accurate surface detail while allowing the material under the surface to be simulated at a much lower detail level, still maintaining the behaviour of the mass as a whole.

Implementation and Contribution:

When I started helping Professor Holladay, he had implemented his solution in Houdini using three separate simulation methods to simulate each of these observed behaviours and the states transitioned between each other using and algorithm based on the velocity, density, and external forces acting on a particular section of the simulation.

This cross-section shows the same behaviour observed above implemented in Houdini

The Solid State was simulated by a Rigid Body Object solved with a Bullet Engine.

Solid State Network

The Liquid State was simulated with a solver implemented from the 2010 paper "Free-Flowing Granular Materials with Two-Way Solid Coupling" (Rahul Narain, Abhinav Golas, and Ming C. Lin, 2010.)

Liquid State Network

The Gas State was simulated using Houdini's Particle Solver.

Gas State Network

While in most cases this implementation worked out well, there were several cases in which the Liquid State would not produce physically accurate results because the internal stresses were not being simulated properly in the implementation. So, in order to complete the implementation of this solver for presentation, the Liquid State needed to be stabilized.

In discussing the problem, we came up with the conclusion that we could either attempt to iron out the bugs in the current implementation or use a more stable method already available in Houdini. Using a stable method from Houdini became a more reasonable option when a Position Based Dynamics (PBD) solution for solving granular materials was introduced in Houdini 14.

So, I created a PBD network with grains simulated at a lower resolution than the actual surface detail required that would accept data from the Solid State and Gas State simulations and create new PBD particles off of that as well as sending partcles that needed to be transitioned to either the Solid State or the Gas State to their respective simulations and culling them from the Liquid State.


New Liquid State with H14 PBD Solver

In addition, there were a handful of Houdini Development Kit (HDK) based methods that needed to be updated or replaced because the initial implementation was created before Houdini 14's release and functions that had been used in the original implementation has since been deprecated.

For example, a section of the simulation required that Geometry data from two solvers (Gas State and Liquid State) be evaluated over one node to determine the boundary between the states for the simulation frame. In the initial implementation we looped over each point from each Geometry data set using the GA_FOR_ALL_GPOINTS macro and copied all the attributes from each point into a third set of geometry data, which we then evaluated. However, this macro was deprecated by Houdini 14, so we ended up changing this implementation to use the GEO_Detail::mergePoints() method.