Free Surface Fluid Simulations

As one of the Google summer of code projects, Nils Thuerey added his fluid simulator, named El'Beem, to Blender.

 

It allows the realistic simulation of fluids as they interact with stationary objects. Be aware that this kind of simulation is very CPU and memory intensive. Before locking your computer for severals hours, it is recommended that you do some tests at low resolution.

 

The implementation uses the Lattice-Boltzmann Method, which is a kind of cellular automaton to simulate the macroscopic behavior of fluids. The method is attractive due to it's simplicity, flexibility and efficiency.

 

The fluid simulator uses various extensions of the basic algorithm to perform optimized simulations of free surface flows. For details, please see Nils home site or the wiki for technical details.

 

Workflow

Image by Mike "MPAN3" Pan
  • While modeling a scene with blender certain objects can be marked to participate in the fluid simulation, e.g. as fluid or as an obstacle. The bounding box of another object will be used to define a box-shaped region within which to simulate the fluid.
  • Global simulation parameters such as viscosity and gravity can be set for this domain object.
  • Using the "bake" button, geometry and settings are exported to the simulator and the fluid simulation is performed, generating a surface mesh together with a preview for each animation frame, and saving them to hard disk.
  • The appropriate fluid surface for the current frame is then loaded from disk and displayed or rendered in Blender.

Making a Simulation

You will need at least one fluid or inflow object, as well as a domain object which will be the containing space of the simulation. You can also have several obstacles and more than one fluid object. Only one domain is supported at a time. Please note that the domain should be a mesh and that only its bounding box is used. It will be replaced by the fluid simulation result at each frame. Obstacles should not move during the simulation.

 

Mark each object as appropriate in the fluid panel of the object context, enter your settings, select the domain object again and push the "Bake" button to perform the actual fluid simulation.

 

The blender GUI will freeze for a while, displaying the progress of the simulation in a bar in the upper right corner. The simulator uses the animation settings in the Render buttons to choose the range of frames to calculate. Pressing ESCAPE aborts the simulation.

 

Afterwards, you will notice two .bobj.gz files in the selected output directory for each frame. As there are usually many of these files, it is a good idea to put them in a separate directory.

 

Further information

- Demo movies in the elysiun.com forums

- Fluid Simulation chapter int the Blender mediawiki manual

- Tutorial 1

- Tutorial 2