Solvers do the work of calculating how simulated objects (RBD objects, wires, cloth surfaces, fluids, etc.) behave. They look at the data attached to objects (and may attach some of their own) and use it to run the simulation. For example, the RBD solver will look at the physical data, such as density, and forces, such as gravity, attached to an object to determine where to move it (updating its position data). If an object doesn’t have a solver attached to it, it won’t do anything when the simulation runs.
(OK, that’s not exactly true... if really wanted to you could use expressions in the data fields that are meaningful to the viewer, such as
Position, to make simulated objects move without a solver. But it wouldn’t be nearly as much fun!)
The solver that should control an object is attached as another piece of data on the object. Different types of simulated objects can affect each other (for example, RBD objects displacing smoke). Objects cannot be controlled by multiple solvers, but you can attach a solver that itself uses multiple solvers, such as a Blend solver. See below for more information on combining solvers.
When you use the shelf tools to create simulation objects, they will attach solvers for you. If you're working in the network, you will need to create your own solver nodes and attach them to your objects.
Houdini cooks dynamics simulations in a two step process:
Process the network to establish objects and data attachments.
Run solvers on the processed data tree.
Solve order and simultaneous solving
Houdini sorts out the objects in the scene based on relationships to determine the order in which to solve them. For one-way relationships, affectors are solved before the affected objects. Wherever a mutual relationship exists, or wherever a hierarchical group of relationships creates a loop, all relationships in that group must be solved simultaneously.
Simultaneous solving is really pseudo-simultaneous... because computers are sequential they can’t work with truly simultaneous events, so Houdini tries to work out a close approximation through an iterative process:
Apply forces to objects in the order — left to right, top to bottom (in the network).
Look for collisions.
If anything collided, feed the collision forces back into the objects. For static objects this feedback step is optimized out.
Repeat until no collisions or Max feedback loops is reached.
The Max feedback loops parameter on the DOP Network containing the simulation limits the number of collision feedback loops Houdini will run, to speed up the simulation and prevent infinite loops.
The best order for solving RBD simulations is to evaluate the heavy objects first, before the light objects. When wiring nodes manually, you can try to wire heavy objects to the left of light objects in Merge nodes. When creating networks automatically, Houdini will assume that particles (solved by the particle solver) are light, and try to wire them to the right of other objects. If you're simulating heavy particles, you may want to change the wiring order.
You can create groups of objects in the simulation using the Group node, just like you can create groups of particles in a particle network and groups of faces in a geometry network.
You can include objects in a group by their object ID or object name. You can also include other groups by their group name.
Groups have three uses/effects in a dynamics simulation:
You can set up groups so you can refer to a set of objects by their group name, instead of using complicated masks.
Technically, affector relationships exist between groups, not individual objects.
Because objects in a group affect each other, everything inside a group must always be solved simultaneously.
To make a solver’s collision detection more accurate, increase the solver’s Maximum substeps parameter. This will usually make the simulation take longer to calculate.
You can also increase the resolution of the simulation globally with the Timestep parameter on the DOP Network node containing the simulation.
The time step
The dynamics engine calculates the simulation in time steps: the amount of time between the points where Houdini stops and re-calculates the state of the simulation. Normally this is some multiple of the frame time (the length of time Houdini displays each frame, e.g. 1/24th of a second at 24 FPS), but that’s not necessary. Long time steps makes it easier for Houdini to run the simulation, but give less accurate results. Smaller time steps take longer to calculate, but give more accurate results.
To set the time step for a dynamics network, open the parameters for the DOP Network object, click the Simulation tab, and set the Time step parameter.
In individual solver nodes in a dynamics network, you can control the number of sub-steps the solver breaks the default time step into. This lets you increase the granularity of simulation for just one solver, without increasing it for every calculation in the entire simulation by changing the time step.
To control sub-steps in a solver, open the parameters for the solver node and set the Minimum substeps and Maximum substeps parameters.
Increase the Minimum substeps value to have the solver break each time step into more solving steps. Make sure to limit the Maximum substeps to make sure the simulation eventually finishes in a reasonable amount of time.
These solvers do the main work of simulating physical phenomena.
RBD (rigid body dynamics) simulates solid objects.
Wire simulates wires, strings, ropes, trees, spiderwebs, and other linear, possibly branching objects.
Cloth simulates cloth and flexible surfaces.
Particle brings particles from a particle network into a dynamics simulation.
Level-set fluid simulates fluid using a sign distance field (SDF). This type of fluid simulation is useful for extracting a continuous surface.
Making different object types interact
To make differently solved objects interact (for example, make particles bounce off an RBD object, or have an RBD object displace smoke as it moves), connect the different types of objects, plus their constraints and solvers, in separate chains and combine them with a Merge node.
Add any data you want to share between the different types of dynamics (for example, a gravity node that should affect both RBDs and fluids) after the merge.
These solvers perform technical functions, such as combining the effects of the main solvers.
Multiple solver runs multiple solvers in order on the same objects.
Blend solver runs multiple solvers and blends between their effects, based on blend factor data on each object. Use the Blend Factor node to attach blend factor data to each object. See how to use the blend solver for more information.
Switch solver routes objects to different solvers based on a piece of switch data on each object. Use the Switch Value node to attach switch data to each object. See how to use the switch solver for more information.
The switch solver is similar to the Switch node, but where the Switch node operates during the data attachment step (and so can affect which data gets attached to which objects), the Switch Solver runs in the solve step (and so can see all data attached to all objects).
Script solver runs a script that can potentially change data, update positions, etc. Several HScript commands, expression functions, and HOM classes exist to enable writing scripts to modify dynamics simulations. See scripting simulations.