Skip to content

InteractiveComputerGraphics/SPlisHSPlasH

Repository files navigation


      Documentation Status

SPlisHSPlasH is an open-source library for the physically-based simulation of fluids. The simulation in this library is based on the Smoothed Particle Hydrodynamics (SPH) method which is a popular meshless Lagrangian approach to simulate complex fluid effects. The SPH formalism allows an efficient computation of a certain quantity of a fluid particle by considering only a finite set of neighboring particles. One of the most important research topics in the field of SPH methods is the simulation of incompressible fluids. SPlisHSPlasH implements current state-of-the-art pressure solvers (WCSPH, PCISPH, PBF, IISPH, DFSPH, PF) to simulate incompressibility. Moreover, the library provides different methods to simulate viscosity, surface tension and vorticity.

The library uses the following external libraries: Eigen, json, partio, zlib, cxxopts, tinyexpr, toojpeg, pybind, glfw, hapPLY, nfd, and imgui. All external dependencies are included.

Furthermore we use our own libraries:

SPlisHSPlasH can export the particle data in the partio and vtk format. If you want to import partio files in Maya or Blender, try out our plugins:

Author: Jan Bender

License

The SPlisHSPlasH library code is licensed under the MIT license. See LICENSE for details.

External dependencies are covered by separate licensing terms. See the extern folder for the code and respective licensing terms of each dependency.

Documentation

Forum

On our GitHub discussions page you can ask questions, discuss about simulation topics, and share ideas.

Build Instructions

This project is based on CMake. Simply generate project, Makefiles, etc. using CMake and compile the project with a compiler of your choice that supports C++11. The code was tested with the following configurations:

  • Windows 10 64-bit, CMake 3.18.3, Visual Studio 2019
  • Debian 11.5 64-bit, CMake 3.18.4, GCC 10.2.1.

Note: Please use a 64-bit target on a 64-bit operating system. 32-bit builds on a 64-bit OS are not supported.

Python Installation Instruction

For Windows and Linux targets there exists prebuilt python wheel files which can be installed using

pip install pysplishsplash

These are available for Python versions 3.6-3.10. See also here: pySPlisHSPlasH. If you do not meet these conditions please refer to the build instructions and to the python binding Getting started guide.

The command line simulator is available by running one of the following

splash
splash --help

Features

SPlisHSPlasH implements:

  • an open-source SPH fluid simulation (2D & 3D)
  • neighborhood search on CPU or GPU
  • supports vectorization using AVX
  • Python binding (thanks to Stefan Jeske)
  • supports embedded Python scripts
  • several implicit pressure solvers (WCSPH, PCISPH, PBF, IISPH, DFSPH, PF)
  • explicit and implicit viscosity methods
  • current surface tension approaches
  • different vorticity methods
  • computation of drag forces
  • support for multi-phase simulations
  • simulation of deformable solids
  • rigid-fluid coupling with static and dynamic bodies
  • two-way coupling with deformable solids
  • XSPH velocity filter
  • fluid emitters
  • scripted animation fields
  • a json-based scene file importer
  • automatic surface sampling
  • a tool for volume sampling of closed geometries
  • a tool to generate spray, foam and bubble particles in a postprocessing step
  • a tool to skin a visual mesh to the moving particles of an elastic solid in a postprocessing step
  • partio file export of all particle data
  • VTK file export of all particle data (enables the data import in ParaView)
  • rigid body export
  • a Maya plugin to model and generate scene files
  • a ParaView plugin to import particle data

A list of all implemented simulation methods can be found here: https://splishsplash.physics-simulation.org/features

Screenshots & Videos

https://splishsplash.physics-simulation.org/gallery

Citation

To cite SPlisHSPlasH you can use this BibTeX entry:

@software{SPlisHSPlasH_Library,
  author = {Bender, Jan and others},
  license = {MIT},
  title = {{SPlisHSPlasH Library}},
  url = {https://github.com/InteractiveComputerGraphics/SPlisHSPlasH},
}