ddrous / visual-fluids

A collection of repos from TUM to run fluid simulations and ML experiments then visualise results in Blender.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Visual Fluids - VFX

A collection of repos from TUM to run fluid simulations and ML experiments in PhiFlow then visualise results in Blender.

Getting started

Our overall goal is to convert .NPZ files into volumetric .VDB now supported in Blender. The following steps are only valid for Linux, namely Ubuntu. It is recommended to use VSCode to build mantaflow binaries.

  1. Install PhiFlow and run experiments pip install phiflow dash. This experiment was tasted with Phiflow 2.2.5 (which is included in folder PhiFlow)

  2. Run a PhiFlow simulation. For example, run TUM.py using Python3. The results will be saved in .NPZ format.

  3. Install mantaflow dependencies:

    • CMake, etc.: sudo apt-get install cmake g++ git python3-dev
    • NumPy: sudo apt install python3-numpy
    • OpenVDB: sudo apt-get install libopenvdb-dev NB: On Windows, one should consider using the prebuilt libraries from here.
    • TBB: Download deb files for libtbb2 and libtbb-dev and install using sudo apt install ./<path_to_deb> NB: TBB went through a massive change to morph into oneTBB. Remark that TBB (version <2020) is required here, not OneTBB (version >2021).
  4. Build mantaflow from source with CMake options -DNUMPY, -DOPENVDB, and -DTBB enabled.

    NB: Remember to Delete Cache and Reconfigure if CMake options are not taken into account. Also, you might get warnings for some deprecated TBB headers. Ignore them !

  5. Now let's convert the .NPZ files from step 2 into .VDB. Simple, just locate the manta2vdb.py scene definition script and run the command ./path/to/manta path/to/manta2vdb.py -d path/to/scene/data -res 128 64 192 NB: It is advised to run the above command from the location of the manta2vdb.py script.

  6. Open Blender, press Shift + A, then Volumes, then import OpenVDB to load your volumetric scene files. To make awesome renderings, follow Nils Thuerey's video. That's all folks, ENJOY !

Dependencies

The files you will encouter in this repository have been updated to work on my WSL setup. Here are the links to the original repositories:

That's it. Thanks to the original creators :)

About

A collection of repos from TUM to run fluid simulations and ML experiments then visualise results in Blender.


Languages

Language:Jupyter Notebook 71.7%Language:Python 14.9%Language:C++ 9.3%Language:C 3.8%Language:CMake 0.3%Language:Shell 0.0%Language:Makefile 0.0%Language:GLSL 0.0%