Houdini 20.5 Fluids

Filling a glass

On this page

Filling glasses, pools, and all kinds of containers and tanks is a common scenario in fluid simulations. With Houdini’s SOP FLIP fluids you can choose from three different modes to fill an object and each method gives you different results. To fill an object you have to create and emit particles from a source geometry or volume. For this purpose, Houdini provides the FLIP Boundary SOP node. If you want to save a few clicks, you can also use one of the macros: FLIP Source: Instant, FLIP Source: Pressure and FLIP Source: Velocity. The relevant parameter in all nodes is Boundary. More detailed explanations will be given later in the step-by-step guides.

  1. None behaves very similar to Houdini’s DOP FLIP fluid sources.

  2. Pressure emits particles based on pressure and an optional, additional velocity.

  3. Velocity emits particles based on velocity only.

If you just source new particles inside a FLIP Container SOP, for example, then you will hardly see any difference. The real difference becomes obvious when you fill an object.

FLIP Network

The network setup is exactly the same for all Boundary methods. Here, a glass will be filled with water, but you can use any other object.

  1. On obj level, press ⇥ Tab and enter geo to create a Geometry SOP node. Then, dive into the node by double-clicking it.

  2. Create a FLIP Container SOP. The container’s dimension can be defined through an upstream object, e.g. a box. Or you use the node’s Scale values. For now, keep the defaults.

  3. Set the FLIP Container’s Particle Separation to 0.015. This parameter defines the fluid’s and collision object’s resolution. Smaller settings create more particles and improve fluid-object collision, but take longer to simulate. Depending on the dimensions in your scene, you might have to adjust Particle Separation.

  4. Add a FLIP Collide SOP node and connect the first three inputs with the FLIP Container’s outputs. The fourth input is for the glass.

  5. Add a FLIP Boundary SOP. Again, connect all inputs with the upstream node’s outputs. Since we're going to change between the different Boundary types it’s more effective here to use the generic operator, rather than a macro. The default Boundary choice is None.

  6. Finally, add a FLIP Solver SOP node.

Glass geometry and collision

The glass in this scene is imported from an Alembic file, but that’s not mandatory. It’s important that the object is double-walled and not too small to avoid leaking. FLIP fluids were developed for large-scale simulations and with a glass, being almost 2 meters, scale is not realistic.

  1. To load an Alembic file, create an Alembic SOP node.

  2. Go to File Name, and click the Open floating file chooser icon. Choose the file with the glass.

  3. Lay down an Unpack SOP and connect its input with the Alembic’s output. This node will extract the model from the Alembic file.

  4. Connect the Unpack node with the FLIP Collide SOP’s fourth input.

  5. Turn on the Unpack’s Display/Render flag.

  6. Go to the viewport and look for the Shading Mode icon. Click it and choose Wireframe from the menu. The glass becomes transparent you can see its inner structure.

The glass’s dimensions also determine the size of the FLIP fluid container.

  1. Select the FLIP Container node.

  2. Go to the Domain section. To save resources, change Scale so that the container fits around the glass. Leave some space between domain boundaries and glass. In this scene, Scale is 3,3,3.

Source geometry

The source is represented through an object. The object’s position tells the solver where to emit particles. You can use almost any closed object or volume to define a source.

  1. Add a Sphere SOP and connect its output the FLIP Boundary node’s fourth input.

  2. The sphere’s Uniform Scale depends on the overall dimensions of the glass. This setup uses value of 0.3, but feel free to make the sphere smaller or bigger.

  3. Set the Center.Y position. For the FLIP Boundary’s Pressure method it’s mandatory that the source object is placed below the final water level. Change the sphere’s Y position to get a result, similar to the image below.

Collision refinements

The setup is ready to simulate, but it’s very likely that you have to adjust collision. Collision depends on several factors.

  • Scale and quality of the original collision geometry are the first factors. Very thin or very small objects are often problematic.

  • The FLIP Container’s Particle Separation and Grid Scale define the collision geometry’s quality. Smaller values create better results. In this scene, Grid Scale is 1.2.

  • By default, the FLIP Collide’s Volume Collide and Surface Collide options are turned on. This scene only uses Volume Collide.

  • In the Collision tab, the FLIP Solver’s provides additional settings. Under Collision Behavior you can see that the Particles Collision menu is set to Particles. If you only want to calculate collision from the volume, as in this case, set the dropdown to Move Outside Collision.

Note

The settings and values, given above, create the best results for this scene, but you might need different combinations.

Boundary: None

Note

Before you simulate, change Global Animation End Frame in the playbar to 125. We don’t need the full range of 240 frames here.

The default sourcing method is None. Click the icon in the playbar to start the simulation. After a few frames you can observe that the water level doesn’t rise anymore. This is the behavior you might already know from DOP FLIP fluids.

Boundary: Velocity

Go to the FLIP Boundary node and change Boundary to Velocity. This mode provides exactly the same parameters as None. Go back to frame 1 and start the simulation. In contrast to the previous run, the water level rises above the source object. If you let the simulation continue beyond frame 125, the water will run over the edge of glass.

Boundary: Pressure

With this mode it’s possible to determine the fill level of the glass. The solver reacts on the fluid’s hydrostatic pressure and uses it as a threshold to stop the sourcing of new particles.

Note

You can enter any value for Hydrostatic Pressure, but you should only use values in a range between 0.1 and 1 to get plausible results.

  1. Change Boundary to Pressure.

  2. Pressure-based sourcing can become very turbulent, so it’s better to animate Hydrostatic Pressure.

  3. Go to frame 1 and enter a Hydrostatic Pressure of 0.1. Alt + click the parameter name to create an animation key.

  4. Go to frame 24 and enter 1.0, then create another key.

  5. For Water Level enter 1. This parameter corresponds with the target fill level, indicated by a blue line. The line becomes visible

  6. Start the simulation.

You can see that sourcing stops when the water level has reached a height of 1, but this is not absolutely correct. The glass’s filling area doesn’t touch the ground and there is an offset of 0.15 units. Go to Water Origin and enter 0,0.15,0 to update the target level and simulate again. Now the effective fill height is 1 unit.

Fluids

For beginners

SOP WORKFLOW

Particle Fluids (SOP)

Viscous fluids (SOP)

Optimization (SOP)

FLIP Configure tools (SOP)

Particle Fluids (DOP)

Viscous Fluids (DOP)

Oceans (DOP)

Optimization