Hybrido and Rigid Bodies

One of the strongest features of RealFlow is the ability to couple different solvers, for example fluids and body dynamics. In order to enable this connection, you only have to activate an object's rigid or soft body features. In this scene, some old tyres and oil barrels will be washed away by a stream of water made with RealFlow's Hybrido. In the first pass, the interaction between the Hybrido fluid and the objects is simulated. Then we will add some nice splashes.

 

A quick preview made with RealFlow's implementation of Maxwell Render.


Here is the nodes list:

  • 2 “Cube” objects (fluid container and emitter object)
  • 7 “Tyre” objects
  • 3 “Oil Barrel” onjects
  • 1 “Open Domain” node
  • 1 “Hybrido Emitter” node
  • 1 “Splash” node
  • 1 “Gravity” daemon
  • 1 “k Volume” daemon


All scene elements can be added from RealFlow's “Edit” menu:

  • Add > Objects | Hybrido | Daemon
  • RealFlow nodes can be moved, scaled, and rotated with the W, R, and E keys.
  • Imported objects from SD files have to be unlocked before they can be transformed with Selected object > Node Params > Node > SD ↔ Curve
  • Viewport perspective is changed with the 1, 2, 3, and 4 keys.
  • Shading modes are toggled with the 7, 8, 9, and 0 keys.

The Setup - Hybrido

This scene is split into two parts: in the first part, the Hybrido simulation is performed – the splash simulation will follow later.

  • Add the first “Cube” node, scale it to 20 x 8 x 7.5 metres. “Cube01” acts as a container to include the fluid. If your axis setup is not YXZ (see "Preferences - General") then the scale is 20 x 7.5 x 8 metres.

  • Add the second “Cube” node, scale it to 2.5 x 6.0 x 6.5 (2.5 x 6.5 x 6.0) metres. This object will serve as the Hybrido fluid emitter. Place it somewhere inside “Cube01”.

  • The tyres and oil barrels can either be created inside your 3D program or downloaded from a 3D model resource site. The best workflow is to save the tyres with the platform-independent Alembic format. Alternatively, the nodes can be exported in SD format using the connectivity plugins. Export these models to the RealFlow project's “objects” folder.

  • Import the tyres and oil barrels with Ctrl/Cmd + I. If necessary, reposition these models. Please note that you have to unlock them first with the objects' “SD ↔ Curve” button.

  • Reposition “Cube02” if necessary.

  • Add the “Gravity” daemon.

 

 

Now, the domain will be created. For this step you always need two nodes:

  • Add a Hybrido “Domain”; leave the default settings.

  • Create a Hybrido “Emitter” node, and choose “Cube02” from the nodes list. The fluid will be created inside this volume.

Adjusting the Scene's Environment

This step includes various settings to make everything work correctly. The first actions affect the “Cube01” node:

  • Node Params > Volume > Mode > Solid inside creates a hollow cube to enclose the fluid

  • Node Params > Dynamics > Passive rigid body

  • Node Params > Rigid body > Collision side > Inside

 

Now, the imported nodes (tyres and oil barrels) are adjusted:

  • Node Params > Node > Dynamics > Active rigid body

  • Node Params > Rigid body > @ mass > enter different values for each node

  • Don't make the objects too heavy. Values around 100 for the barrels, and 15 for the tyres should work.

 


Hybrido works with cells, and every cell has a certain size which determines the simulation's level of detail (LOD). All scene elements are rasterized in RealFlow internally – including the objects. This means that the objects provide a “Cell size” value as well. By default, this value is 0.3.To change it for the entire scene, go to the “Scale options” button:

  • Cell size scale > 0.3334
  • All “Cell size” values in the scene are multiplied with this factor: 0.3 * 0.3334 = 0.1

 

Export Resources

A very important part is to adjust the imported objects' export resources. Open “Export Central” with F12. There you will see a branch, called “OBJECTS”. Spot the imported nodes and check the following resources for imported nodes:

 

 

This action is important, because it will help us to reload the motion data in the splash simulation. “ANIMATION (.sd)” and “CACHE (.bdc)” can be disabled.

The Hybrido Fluid Simulation

In order to save time, the simulation will be performed using RealFlow's Command Line version. This is a matter of a few clicks:

  • Click on the small triangle next to the “Simulate” button.

  • Enable the “Command line” entry.

  • Hit “Reset”, then “Simulate”.

  • A terminal window appears showing the simulation's progress.

 



During the simulation leave the RealFlow GUI open, because there you can monitor the simulation's progress by pressing Alt + U. This shortcut will load the already simulated files, and you can scrub the timeline to see the result.

The Setup – Splash

When the Hybrido simulation is finished the splash elements will be added:

  • Add a “Splash” node.
  • Scale and reposition the "Hy_Splash01" domain (green box, see image below). It should not cover the right part where the Hybrido fluid is released from the emitter. 
  • In the viewport a green box appears indicating the splash domain's dimensions. You can change its size with the parameters under Node Params > Node > Scale.
  • Create a “k Volume” daemon.
  • Click on k_Volume01 > Node Params > k Volume > Fit to object
  • Select “Cube01” from the nodes list to adapt the daemon to the fluid container.

 

 

In the next step, select the “HyDomain01” node:

  • Node Params > Node > Simulation > Cache

  • With this option, the already simulated Hybrido fluid is loaded to the scene, but not re-simulated. This helps to save lots of time.

 

 

The imported tyres and barrels have to be set to “Cache” as well. Please do not forget this!

Adjusting the Splash Emitter

The number of splash particles depends on various parameters. They are located in the “Splash Creation” panel under “Node Params”. You have to play with these settings to get a satisfying amount of particles and the desired behaviour. For more information about their meaning, please take a look at the “HySPH - Splash” chapter. Here are the settings used for the image above:

 

 

Another, very important, decision is the choice of particle type. “Dumb” particles are simulated very fast, but may lack realism. “Liquid - Particles” creates realistic results, but takes its time. A good alternative is “Liquid – Hybrido”:

  • HySplash01 > Node Params > Particles > Type > Liquid – Hybrido

The Splash Simulation

Now, that all nodes and elements are adjusted, the scene can be simulated again. The Hybrido fluid is simply loaded (it is set to “Cache”), and only the splash particles will be created:

  • Reset

  • Simulate