This program is a basic free-surface liquid FLIP fluid simulator with viscosity. The fluid simulation program exports the simulation particle positions as a sequence of .OBJ or .PLY meshes containing only vertices. The particles can then be meshed and rendered in a separate program.
This program implements the following methods for the variational pressure solver and the variational viscosity solver:
- Fast Variational Framework for Accurate Solid-Fluid Coupling by Batty, Bertails, and Bridson
- Accurate Viscous Free Surfaces for Buckling, Coiling, and Rotating Liquids by Batty and Bridson
Much of the simulation method was adapted from code available from Christopher Batty's GitHub page and also code available from my GridFluidSim3D project.
The following images were generated from particle data output by the program and rendered using Blender.
An animation of a buckling honey simulation can be viewed here.
Below is a list of features implemented in the simulator.
- FLIP (Fluid-Implicit-Particle) simulation method
- Accurate variational pressure solve for free-surfaces and curved boundaries
- Accurate viscosity for buckling, coiling, and rotating liquids
- Initialize fluids and solid boundaries from triangle meshes
Everything required to run this program is included in the repository. A compiler that supports C++11 is required to build the program.
This program uses the CMake utility to generate the appropriate solution, project, or Makefiles for your system. A Makefile is also provided.
Sample triangle meshes are located in the sample_meshes
directory.
The default simulation will drop a mass of fluid in the shape of the Stanford Bunny inside of a spherical container.
An example script for how to import the particle meshes into Blender for rendering is located here. This script will import a .obj mesh sequence into Blender and update the mesh data on a frame change. The sequence can be rendered in Blender 3.1 or later by converting the object to a Point Cloud using the Geometry Nodes Mesh to Points Node.
Usage: load the script into the Blender text editor, edit the MESH_CACHE_PATH
variable to point to the directory containing the simulation meshes, and press the 'Run Script' button.