Houdini 20.0 Nodes Dynamics nodes

Fluid Solver 2.0 dynamics node

A solver for Sign Distance Field (SDF) liquid simulations.

On this page
Since 12.0

Setting up

If you are setting up a fluid network from scratch, you can use the Fluid Object node to create a DOP object with the data required by the Fluid solver already attached. If you already have a DOP object, you can use the Fluid Configure Object node to add the necessary data to it.

This solver makes use of various field subdata on the object.

  • The object should have a scalar field “surface” to track the surface of the fluid in space.

  • The object should have a vector field called “vel” to track the velocity of each point in space.

Tips

  • If your fluid keeps disappearing, try turning off Build Outside Markers. You can also set Marker Escape Threshold to 0 to help keep fluid inside the box.

  • Liquid streams smaller than a few voxels may disappear.

  • If your source object deforms or collides with a deforming object (using a DOP relationship), by default the solver will use the per-point deformation. To make the solver use per-point deformation, on the Fields ▸ Sources subtab set Velocity Type to “Point Velocity”.

Parameters

Simulation

These parameters control how the simulation develops over time.

Time Scale

A scaling factor for time inside this solver. 1 is normal speed, greater than 1 makes the fluid sim appear speeded up, less than 1 makes the fluid sim appear to be in slow motion. You can use expression functions such as doptime, dopframe,dopsttot, and dopttost to convert between global times and simulation times.

Note

Changing the Time Scale only affects the timestep of the simulation. If adding velocities calculated in SOPs to the simulation for collisions or pumps with the Source Volume DOP, scale the incoming velocities by 1 / timescale to match the timestep of the simulation.

Confinement Strength

When the container has vorticles data attached, this is an overall scale adjustment for the vorticle forces. Vorticle forces are small pin-wheel like forces that add turbulence to fluids.

Speed Limit

If set, each axis of the velocity field will be clamped to this maximum speed. This is done after the force computation and before the divergence or advection, so it is possible for the speed to end up slightly larger than this value.

Note

As the clamping is done per-axis, the velocity along the diagonal can be up to sqrt(3) higher.

Viscosity

Low values give more “watery”, “thin”, flowing fluid, while higher values give more “thick”, resistant fluid.

Internally, viscosity is a force that tries to give neighboring voxels the same velocity.

Use Friction and Bounce

Use the fluid’s physical parameters for friction and bounce at collisions. Turn this off for a fluid with zero friction and zero bounce.

Relationships

Prior to Houdini 12, the Pyro solver used DOP relationships to associate sources, pumps, sinks, and collision geometry with a fluid container, using the Merge DOP and/or Apply relationship DOP to create the relationship. The preferred method in Houdini 12 and later is to use SOP networks to create sources, pumps, sinks, and collision geometry and import them using the Source volume DOP.

If you want to use the old relationship method to set up sources, sinks, etc., you can enable relationships using the parameters on this tab. By default, relationships are turned off, and the solver ignores relationship data.

You can use both methods (import SOP geometry and attach it to the solver’s “sourcing” input, as well as set up DOP object relationships). When relationships are enabled, the solver will combine the sources, sinks, etc. from both methods.

Enable Relationships

Use object relationship data to add sources, pumps, sinks, and collision geometry to the simulation (in addition to imported data connected to the sourcing input, if any).

Sources

Enable Source Relationship

Use DOP objects with a “source” relationship to the solver.

Velocity Merge

How the source object’s velocity will affect the container’s velocity field. Scale controls the amount to add.

None

The source’s velocity will be ignored.

Net New Source

Velocity will be set in those areas where fluid will be added this frame from the source.

New Source

Velocity will be set in those areas where the source is present.

Velocity Type

How to measure velocity on the source object. If the source geometry does not deform (change shape) over time, use Rigid Velocity. If the source deforms but does not change topology over time, use Point Velocity.

Rigid Velocity

Treat the source object as non-deforming.

Point Velocity

Use point history to allow deforming geometry. This only works if the topology of the source geometry doesn’t change.

Volume Velocity

Uses the SDF representation of the object to detect deformation. Does not require a fixed topology over time, but cannot detect tangential velocities.

Pumps

Enable Pump Relationship

Use DOP objects with a “pump” relationship to the solver.

Velocity Merge

How the source object’s velocity will affect the container’s velocity field. Scale controls the amount of velocity to add.

Velocity Type

Controls how the pump object’s per point velocity is computed.

Rigid Velocity

The velocity of the object treating it as a rigid body. Only the angular velocity and linear velocity will be used, no local deformation will be taken into account.

Point Velocity

The velocity of the object attempting to take into account deformation by using point history. This only works if the topology doesn’t change.

Volume Velocity

Uses the SDF representation of the object to detect deformation. Does not require a fixed topology over time, but cannot detect tangential velocities.

Collisions

Enable Collide Relationship

Use DOP objects with a “collision” relationship to the solver.

Restrict Mask to Bandwidth

Normally the collision mask SDF is only calculated up to a certain distance from the original collision geometry. Turn this off to compute the full range of the mask if you need it for some special effect, such as having things react before they reach the object.

Sticky Fluid

Determine if collision objects should prevent fluid from leaving their surface instead of just preventing the fluid from entering their surface. This should be left on.

Collide with Non-SDF

Allows the fluid to collide with objects that don’t have Geometry/SDF, such as other fluids.

Velocity Type

Controls how the collision object’s per point velocity is computed.

Rigid Velocity

The collision velocity of the object is calculated by treating it as a rigid body. Only the angular velocity and linear velocity will be used, no local deformation will be taken into account.

Point Velocity

The collision velocity of the object tries to take into account deformation by using point history. This only works if the topology doesn’t change.

Volume Velocity

Uses the SDF representation of the object to detect deformation. Does not require a fixed topology over time, but cannot detect tangential velocities.

Sink

Enable Sink Relationship

Use DOP objects with a “sink” relationship to the solver.

Advanced

You should generally not need to change these parameters.

Min Substeps

Forces the solver to run a minimum number of substeps. Normally the pyro solver works best with no substeps. If you have smoke and unusual forces, you may want to increase this parameter for better stability. Increasing this parameter will usually make the simulation much slower.

Max Substeps

Forces the solver to not run more substeps than this maximum. Normally the pyro solver works best with no substeps. If you have smoke and unusual forces, you may want to increase this parameter for better stability. Increasing this parameter will usually make the simulation much slower.

CFL Condition

When Max Substeps is greater than 1, the solver uses this parameter to decide the number of substeps. The “condition” is that no substep can allow objects to interpenetrate by more than this many voxels. Higher values allow a substep to move smoke by more voxels, possibly letting it pass through collision objects.

Quantize to Max Substeps

When turned on, use substeps that divide up the frame by Max Substeps so that the time always lands on a multiple of 1/Max Substeps.

For example, if Max Substeps is set to 4, but the CFL Condition only requires 3 substeps, the solver will divide up the frame into 3 substeps, with the substeps located at multiples of 1/Max Substeps. One combination of the substep lengths could be 0.25, 0.5, and 0.25, with the frame divided up from 0-0.25, 0.25-0.75, and 0.75-1. The solver also takes into account the current state of the particles (particle size and velocity) when dividing the frame into substeps.

This option can be useful for re-using input geometry that has been cached to file at increments of 1/Max Substeps. For example, if your geometry is cached on disk at 4 substeps per frame, then you may want your simulation’s substeps to always land on a multiple of 0.25 so that you don’t have to interpolate the geometry.

Frames Before Solve

Specifies the number of frames to wait before a full solve cycle is computed. On those frames only operations applied to the last solver input (sources) are computed. This enables the sourcing and resizing of data without actually computing a full solve on the maximum grid.

Surface

Correct Surface

The motion of the collision objects may cause the fluid to interpenetrate the fluid objects. The Correct Surface step will remove any fluid that is penetrating a collision object.

Rebuild SDF

The voxels that border the zero isocontour are used to determine the initial zero isocontour. The rest of the field is then rebuilt from these values directly.

Reinitialize SDF

If the field is already almost a signed distance field, a less drastic error correction can be performed. The reinitialization equation is applied which will converge on a signed distance field without affecting the boundary.

Reinitialize Rate

The rebuilding and reinitialization of the SDF will only be performed every every N frames where N is the reinitialization rate.

Reinitialize Iterations

The number of times to apply the reinitialization equation.

Marker Escape Threshold

The distance the marker must be on the wrong side of the surface, as measured in terms of the marker’s radius, to qualify as escaped. Only escaped markers will update the surface value.

Markers

Build Inside Markers

Construct marker surfels on the inside of the surface. Inside surfels increase volume as they correct the surface by pushing out the boundary.

Build Outside Markers

Construct marker surfels on the outside of the surface. Outside surfels decrease volume as they correct the surface by pushing in the boundary.

Markers Per Voxel

The desired number of markers to maintain inside each voxel. More markers allows for a better capturing of the surface behaviour, but can require a lot of memory and processing time for large complicated sims.

Minimum Marker Radius

The minimum radius of marker surfels, measured in terms of voxel size.

Maximum Marker Radius

The maximum radius of marker surfels, measured in terms of voxel size.

Projection

Variational

Contribution to the pressure equation is proportional to the amount of the cell in the liquid. This attempts to avoid stairstep boundaries on solid boundaries.

Note: Uses the Gas Project Non Divergent Variational when this is set, so the ghost fluid and preserve bubble options are no longer available.

Scale by Surface

Scales external forces by an estimate of how much fluid is in each voxel. This allows sub-voxel waves to be evened out under gravity.

Preserve Bubbles

Trapped air will be given a pressure value independent of the boundary pressure conditions. This prevents the bubbles from collapsing in on themselves. If not set, fluid will be free to flow into bubbles from all sides ensuring their swift dissipation.

Ghost Fluid

Pressures are extrapolated into air cells rather than just set to zero. This causes sub-voxel ripples in the air side to be suppressed.

Limit Velocity Extrapolation

When extrapolating the velocity field into non-fluid cells, the extrapolation is stopped when a certain number of cells has been filled along the border.

Max Cells to Extrapolate

The number of non-fluid cells that should be filled with velocity values on the non-fluid side of the velocity field.

Strain

Use Strain

Adds a “strain” field to the object to track the amount of deformation the fluid has undergone at each voxel.

Plastic Flow Rate

This is the rate of plastic flow. The current strain is dissipated at this rate per second. A value greater than the timestep per second can lead to overshoot.

Plastic Flow Threshold

This is the threshold for plastic flow. When the norm of the strain exceeds this threshold, the strain is dissipated according to the plastic flow term.

Strain Elastic Modulus

Similar to a drag coefficient, the elastic modulus provides the scale factor for how to translate a certain amount of distortion into a restorative force.

Advection

Advection Type

The algorithm to use for advecting the fields.

Single stage

Equivalent to the Gas Advect DOP, where each point is back traced through the velocity field once to find the new voxel value.

BFECC and Modified MacCormack

Run a second basic advection stage, resulting in a sharper fluid that doesn’t disperse as much.

Clamp Values

The error correction of the BFECC and Modified MacCormack advection types can move voxel values outside the container, leading to strange effects such as negative density values. This parameter lets you choose a method to avoid this problem. The default is “Revert”.

None

Do not attempt to prevent error correction from moving values outside the container.

Clamp

Restrict each voxel to the range of values possible given its eight original values.

Revert

If the error-corrected voxel is out of range, return it to the single-stage value.

Reverting can avoid checker artifacts where the error correction breaks down.

Vel Advection Type

The algorithm to use for advecting the velocity field. Higher types in the list will reduce the apparent viscosity of the field, but may add energy or cause chatter.

Advection CFL

When tracing the particles, this controls how many voxels the particles can move in a single iterations. Higher values give faster tracing and faster advection, but more errors.

Collisions

Feedback Scale

A scale factor for applying feedback forces to other objects. Setting this to 0 will prevent any feedback.

Clear Fields

Fields to Clear

Zeros out the specified types of fields after the solve

step. This ensures the .sim files, which store the complete state of the simulation, do not have any information not needed, reducing their size and save time.

None

No special clearing of fields is done.

Hidden

Fields not needed for the next time step that do not have guide parameters are cleared.

Static

Fields not needed for next time step are cleared. Note that some guides will thus start showing up as zero as the underlying field got cleared.

Additional

A space separated list of extra fields that should be cleared post-solve.

Distribution

Tracker Address

What machine will run the simtracker.py process for synchronization. If this is blank, there will be no attempt at synchronization or data transfer.

Tracker Port

The port specified when starting the simtracker.py process for communication.

Job Name

The job name to describe this synchronization or data exchange event. By using different job names one can have machines part of separate data-exchange and synchronization events.

Slice/Peer

The slice number that this machine should report itself as. Each machine connecting under the job name should have its own unique slice number. Sometimes this can be inferred from the operation so this parameter will be absent.

Number of Slice/Number of Peers

Total number of machines that have to synchronize. Sometimes this can be determined from the operation, so this parameter will be absent.

Distributed Pressure Solve

The pressure projection may be distributed across machines. This avoids any loss of fluid and is required for tank-style simulations, but not needed for flowing rivers. It requires considerably more network bandwidth, so becomes advantageous only with very large simulations.

Inputs

First Input

This optional input can be used to control which simulation objects are modified by this node. Any objects connected through this input and which match the Group parameter field will be modified.

If this input is not connected, this node can be used in conjunction with an Apply Data node, or can be used as an input to another data node.

All Other Inputs

If this node has more input connectors, other data nodes can be attached to act as modifiers for the data created by this node.

The specific types of subdata that are meaningful vary from node to node. Click MMB an input connector to see a list of available data nodes that can be meaningfully attached.

Outputs

First Output

The operation of this output depends on what inputs are connected to this node. If an object stream is input to this node, the output is also an object stream containing the same objects as the input (but with the data from this node attached).

If no object stream is connected to this node, the output is a data output. This data output can be connected to an Apply Data DOP, or connected directly to a data input of another data node, to attach the data from this node to an object or another piece of data.

Locals

channelname

This DOP node defines a local variable for each channel and parameter on the Data Options page, with the same name as the channel. So for example, the node may have channels for Position (positionx, positiony, positionz) and a parameter for an object name (objectname).

Then there will also be local variables with the names positionx, positiony, positionz, and objectname. These variables will evaluate to the previous value for that parameter.

This previous value is always stored as part of the data attached to the object being processed. This is essentially a shortcut for a dopfield expression like:

dopfield($DOPNET, $OBJID, dataName, "Options", 0, channelname)

If the data does not already exist, then a value of zero or an empty string will be returned.

DATACT

This value is the simulation time (see variable ST) at which the current data was created. This value may not be the same as the current simulation time if this node is modifying existing data, rather than creating new data.

DATACF

This value is the simulation frame (see variable SF) at which the current data was created. This value may not be the same as the current simulation frame if this node is modifying existing data, rather than creating new data.

RELNAME

This value will be set only when data is being attached to a relationship (such as when Constraint Anchor DOP is connected to the second, third, of fourth inputs of a Constraint DOP).

In this case, this value is set to the name of the relationship to which the data is being attached.

RELOBJIDS

This value will be set only when data is being attached to a relationship (such as when Constraint Anchor DOP is connected to the second, third, of fourth inputs of a Constraint DOP).

In this case, this value is set to a string that is a space separated list of the object identifiers for all the Affected Objects of the relationship to which the data is being attached.

RELOBJNAMES

This value will be set only when data is being attached to a relationship (such as when Constraint Anchor DOP is connected to the second, third, of fourth inputs of a Constraint DOP).

In this case, this value is set to a string that is a space separated list of the names of all the Affected Objects of the relationship to which the data is being attached.

RELAFFOBJIDS

This value will be set only when data is being attached to a relationship (such as when Constraint Anchor DOP is connected to the second, third, of fourth inputs of a Constraint DOP).

In this case, this value is set to a string that is a space separated list of the object identifiers for all the Affector Objects of the relationship to which the data is being attached.

RELAFFOBJNAMES

This value will be set only when data is being attached to a relationship (such as when Constraint Anchor DOP is connected to the second, third, of fourth inputs of a Constraint DOP).

In this case, this value is set to a string that is a space separated list of the names of all the Affector Objects of the relationship to which the data is being attached.

ST

The simulation time for which the node is being evaluated.

Depending on the settings of the DOP Network Offset Time and Scale Time parameters, this value may not be equal to the current Houdini time represented by the variable T.

ST is guaranteed to have a value of zero at the start of a simulation, so when testing for the first timestep of a simulation, it is best to use a test like $ST == 0, rather than $T == 0 or $FF == 1.

SF

The simulation frame (or more accurately, the simulation time step number) for which the node is being evaluated.

Depending on the settings of the DOP Network parameters, this value may not be equal to the current Houdini frame number represented by the variable F. Instead, it is equal to the simulation time (ST) divided by the simulation timestep size (TIMESTEP).

TIMESTEP

The size of a simulation timestep. This value is useful for scaling values that are expressed in units per second, but are applied on each timestep.

SFPS

The inverse of the TIMESTEP value. It is the number of timesteps per second of simulation time.

SNOBJ

The number of objects in the simulation. For nodes that create objects such as the Empty Object DOP, SNOBJ increases for each object that is evaluated.

A good way to guarantee unique object names is to use an expression like object_$SNOBJ.

NOBJ

The number of objects that are evaluated by the current node during this timestep. This value is often different from SNOBJ, as many nodes do not process all the objects in a simulation.

NOBJ may return 0 if the node does not process each object sequentially (such as the Group DOP).

OBJ

The index of the specific object being processed by the node. This value always runs from zero to NOBJ-1 in a given timestep. It does not identify the current object within the simulation like OBJID or OBJNAME; it only identifies the object’s position in the current order of processing.

This value is useful for generating a random number for each object, or simply splitting the objects into two or more groups to be processed in different ways. This value is -1 if the node does not process objects sequentially (such as the Group DOP).

OBJID

The unique identifier for the object being processed. Every object is assigned an integer value that is unique among all objects in the simulation for all time. Even if an object is deleted, its identifier is never reused. This is very useful in situations where each object needs to be treated differently, for example, to produce a unique random number for each object.

This value is also the best way to look up information on an object using the dopfield expression function.

OBJID is -1 if the node does not process objects sequentially (such as the Group DOP).

ALLOBJIDS

This string contains a space-separated list of the unique object identifiers for every object being processed by the current node.

ALLOBJNAMES

This string contains a space-separated list of the names of every object being processed by the current node.

OBJCT

The simulation time (see variable ST) at which the current object was created.

To check if an object was created on the current timestep, the expression $ST == $OBJCT should always be used.

This value is zero if the node does not process objects sequentially (such as the Group DOP).

OBJCF

The simulation frame (see variable SF) at which the current object was created. It is equivalent to using the dopsttoframe expression on the OBJCT variable.

This value is zero if the node does not process objects sequentially (such as the Group DOP).

OBJNAME

A string value containing the name of the object being processed.

Object names are not guaranteed to be unique within a simulation. However, if you name your objects carefully so that they are unique, the object name can be a much easier way to identify an object than the unique object identifier, OBJID.

The object name can also be used to treat a number of similar objects (with the same name) as a virtual group. If there are 20 objects named “myobject”, specifying strcmp($OBJNAME, "myobject") == 0 in the activation field of a DOP will cause that DOP to operate on only those 20 objects.

This value is the empty string if the node does not process objects sequentially (such as the Group DOP).

DOPNET

A string value containing the full path of the current DOP network. This value is most useful in DOP subnet digital assets where you want to know the path to the DOP network that contains the node.

ST

The simulation time for which the node is being evaluated.

Depending on the settings of the DOP Network Offset Time and Scale Time parameters, this value may not be equal to the current Houdini time represented by the variable T.

ST is guaranteed to have a value of zero at the start of a simulation, so when testing for the first timestep of a simulation, it is best to use a test like $ST == 0, rather than $T == 0 or $FF == 1.

SF

The simulation frame (or more accurately, the simulation time step number) for which the node is being evaluated.

Depending on the settings of the DOP Network parameters, this value may not be equal to the current Houdini frame number represented by the variable F. Instead, it is equal to the simulation time (ST) divided by the simulation timestep size (TIMESTEP).

TIMESTEP

The size of a simulation timestep. This value is useful for scaling values that are expressed in units per second, but are applied on each timestep.

SFPS

The inverse of the TIMESTEP value. It is the number of timesteps per second of simulation time.

SNOBJ

The number of objects in the simulation. For nodes that create objects such as the Empty Object DOP, SNOBJ increases for each object that is evaluated.

A good way to guarantee unique object names is to use an expression like object_$SNOBJ.

NOBJ

The number of objects that are evaluated by the current node during this timestep. This value is often different from SNOBJ, as many nodes do not process all the objects in a simulation.

NOBJ may return 0 if the node does not process each object sequentially (such as the Group DOP).

OBJ

The index of the specific object being processed by the node. This value always runs from zero to NOBJ-1 in a given timestep. It does not identify the current object within the simulation like OBJID or OBJNAME; it only identifies the object’s position in the current order of processing.

This value is useful for generating a random number for each object, or simply splitting the objects into two or more groups to be processed in different ways. This value is -1 if the node does not process objects sequentially (such as the Group DOP).

OBJID

The unique identifier for the object being processed. Every object is assigned an integer value that is unique among all objects in the simulation for all time. Even if an object is deleted, its identifier is never reused. This is very useful in situations where each object needs to be treated differently, for example, to produce a unique random number for each object.

This value is also the best way to look up information on an object using the dopfield expression function.

OBJID is -1 if the node does not process objects sequentially (such as the Group DOP).

ALLOBJIDS

This string contains a space-separated list of the unique object identifiers for every object being processed by the current node.

ALLOBJNAMES

This string contains a space-separated list of the names of every object being processed by the current node.

OBJCT

The simulation time (see variable ST) at which the current object was created.

To check if an object was created on the current timestep, the expression $ST == $OBJCT should always be used.

This value is zero if the node does not process objects sequentially (such as the Group DOP).

OBJCF

The simulation frame (see variable SF) at which the current object was created. It is equivalent to using the dopsttoframe expression on the OBJCT variable.

This value is zero if the node does not process objects sequentially (such as the Group DOP).

OBJNAME

A string value containing the name of the object being processed.

Object names are not guaranteed to be unique within a simulation. However, if you name your objects carefully so that they are unique, the object name can be a much easier way to identify an object than the unique object identifier, OBJID.

The object name can also be used to treat a number of similar objects (with the same name) as a virtual group. If there are 20 objects named “myobject”, specifying strcmp($OBJNAME, "myobject") == 0 in the activation field of a DOP will cause that DOP to operate on only those 20 objects.

This value is the empty string if the node does not process objects sequentially (such as the Group DOP).

DOPNET

A string value containing the full path of the current DOP network. This value is most useful in DOP subnet digital assets where you want to know the path to the DOP network that contains the node.

Note

Most dynamics nodes have local variables with the same names as the node’s parameters. For example, in a Position DOP, you could write the expression:

$tx + 0.1

…to make the object move 0.1 units along the X axis at each timestep.

Dynamics nodes