The source_mpm_gel
node is useful for simulating many materials such as icing, toothpaste, ketchup, melted chocolate, and foam, just to name a few possibilities.
Check out the sample gel simulations available in the Bifrost Browser. See Get Started with sample graphs.
Get the meshes to use as emitters for the gel, as well as containers and other colliders. These meshes can be input from the scene or created in the graph. For best results:
Connect each emitter mesh into the geometry
input of a source_mpm_gel
node, and set its properties.
source_mpm_gel
nodes if you want different meshes to emit with different properties.Connect the outputs from the source_mpm_gel
nodes into the sources
port of a simulate_mpm
node.
Connect the ouput of an mpm_solver_settings
node into the settings
port of the simulate_mpm
node, and set its properties.
Connect the meshes that you want to use as obstacles (such as containers for the gel) into collider
nodes. You can connect all the collider meshes into a single node if you want them to have the same properties, or into different nodes if you want different colliders to have different properties.
Connect the outputs of the collider
nodes into the colliders
input of the simulate_mpm
node.
Optionally, connect influence nodes such as wind_influence
or turbulence_influence
into the influences
input of the simulate_mpm
node.
To visualize the flow of the gel particles, connect the granular_points
output of the simulate_mpm
node to a graph output or terminal
node. Play through the simulation and adjust settings as desired.
yield_stress
property on the source_mpm_gel
node controls the overall behavior — the larger the value, the more the gel will clump together and resist yielding under shear force.To generate a mesh for rendering, it's best to cache the particles because rendering typically takes longer than the simulation and can be easily resumed (unlike the simulation).
erase_component_properties
to remove point properties that are no longer needed and reduce the size of the cache files. You can use a watchpoint to list the properties of the gel points, but note that the granular_points
output is an array so you need to get the gel points object from the array first.file_cache
node, and connect its output to a graph output or terminal
node. points_to_volume
followed by volume_to_mesh
. To tweak the mesh output, you can use set_geo_property
to adjust point_size
before points_to_volume
, as well as use smooth_voxel_property
to adjust volume properties afterwards — the details depend on what you are trying to simulate and how you want it to look.