Fluid Simulation


An experimental particle based fluid simulation plugin has been added to Gazebo, which can be tested in the tutorials. In order to run the simulation an Nvidia graphics card with cuda support is required and to have Fluidix library installed.

The fluids simulation is based on the Smoothed-particle Hydrodynamics method. All the particle interactions are computed on the GPU, thus allowing us to simulate thousands of fluid particles at interactive speeds.

The interaction between the physics engine running in Gazebo and the fluid engine is done using a world plugin loaded in the .world file. This interaction represents a two way communication between the engines: first Gazebo sends all its collisions (object shapes) to be loaded in the fluid engine and initialises them with their current position and orientation. Afterwards the fluid is loaded with the given particle numbers and its volume. During runtime the collisions (object shapes) poses from Gazebo are constantly updated in the fluid engine, and interaction with the fluid are computed. As a response the fluid engine sends the forces and torques that are needed to be applied on the objects from Gazebo.

In order to visualise the fluid, the plugin also sends the current poses of all the particles on a topic to which a visualisation plugin is subscribed, and renders them over the current scene.

There are still many parts to be added to the simulation, some of them are mentioned at the end of the tutorial.

This work has been contributed by Andrei Haidu.