HyFLIP - Fluid-Object Interaction

In RealFlow 2015, the interaction between HyFLIP fluids and objects has been vastly improved. We do not go into technical details here, because we want to keep everything as simple as possible:

 

When you think about fluid-object interaction you should think about meshing.

 

Meshing? Yes, this is the key, because it is exactly what you are doing when you are adjusting an object in order to make it watertight.

A Typical Scene Setup

Let's take a look at the following scene, where we have a subway tunnel. The tunnel's inside has ribs and there are also structures for the rails.

 

 

Now proceed as follows – here only the ribs are adjusted, but the workflow is the same for other elements:

 

 

  • HY_Domain node > Node Params > Grid > Cell size
  • Start with the domain's cell size, because this is the reference value, e.g. 0.1.
  • Object node > Node Params > Volume > Cell size
  • Use the domain's “Cell size” value for the objects' own “Cell size” parameters.
  • Go to the object's Node Params > Display Volume section and enable the object's “Isosurface” option.



 

What you get with "Isosurface" is nothing else than a mesh. And this mesh is very coarse and consists of just a few polygons (the purple spots in the image above). The reason for this look is that “Isosurface” shows you the voxelized representation of an object. With a “Cell size” of 0.1 or greater, the object's finer structures are often not considered. Please also bear in mind that structures which are smaller than the adjusted “Cell size” cannot be “seen” by Hybrido.

Refining the Interaction

The solution is to work with an object's “Surface offset” parameter. The effect of this parameter is comparable to a mesh's “Radius” value: a greater radius creates a thicker mesh. When you increase “Surface offset” you literally inflate the object and you get a better representation of its surface. If the iso-surface is too thick already then it is also possible to use negative values and shrink it.

 

 

Of course, “Surface offset” does have its limits as well, because its impact strongly depends on the quality of the voxelized object. But, if you slightly lower the objects' and domain's “Cell size” settings (e.g. 0.075 instead of 0.1), and refine the mesh with “Surface offset” you will get a very good balance between quality and simulation speed.

 

Volume modes

Volume modes define how an object is "seen" by the HyFLIP fluid. These modes are located under

Selected object > Node Params > Volume > Volume mode

Here are the three possible modes:

  • "Solid inside" makes the fluid collide with object's outer surface. 
  • "Solid outside" creates a hollow object and fluid collides with the inner surface.
  • "Shell" is often used with open objects like glasses, vases, or RealFlow's "Cube top open" node. When active, RealFlow adds an invisible layer around the object's surface. The thickness of this layer is Cell size * 3. As a consequence, there will always be a gap between the fluid and the object, but it is watertight.



Conclusion

As you can see, all you have to do is to perform a meshing process with two parameters:

  • Cell size. Please make sure that both the Hybrido domain and the objects share the same values! It does not help at all to decrease an object's “Cell size” only.
  • Surface offset. This parameter is used to refine the surface reconstruction, accepts positive and negative values, and can be adjusted freely.