• Stars
    star
    128
  • Rank 281,044 (Top 6 %)
  • Language
    C++
  • License
    MIT License
  • Created almost 8 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A basic free-surface liquid FLIP fluid simulator with viscosity

FLIPViscosity3D

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:

Much of the simulation method was adapted from code available from Christopher Batty's GitHub page and also code available from my GridFluidSim3D project.

Gallery

The following images were generated from particle data output by the program and rendered using Blender.

alt tag alt tag

alt tag alt tag

An animation of a buckling honey simulation can be viewed here.

Features

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

Dependencies

Everything required to run this program is included in the repository. A compiler that supports C++11 is required to build the program.

Installation

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.

alt tag

Rendering in Blender

An example script for how to import the particle meshes into Blender for rendering is located here. This script will import a .ply or .obj mesh into Blender and duplicate a sphere over the particles.

Usage: load the script into the Blender text editor, edit the MESH_DIRECTORY variable to point to the directory containing the simulation meshes, and press the 'Run Script' button.