/deep-fluids

Deep Fluids: A Generative Network for Parameterized Fluid Simulations

Primary LanguagePython

Deep Fluids: A Generative Network for Parameterized Fluid Simulations

Tensorflow implementation of Deep Fluids: A Generative Network for Parameterized Fluid Simulations.

Byungsoo Kim¹, Vinicius C. Azevedo¹, Nils Thuerey², Theodore Kim³, Markus Gross¹, Barbara Solenthaler¹

¹ETH Zurich, ²Technical University of Munich, ³Pixar Animation Studios

Computer Graphics Forum (Proceedings of Eurographics 2019)

teaser

Requirements

This code is tested on Windows 10 and Ubuntu 16.04 with the following requirements:

Run the following line to install packages.

$ pip install --upgrade tensorflow-gpu tqdm matplotlib Pillow imageio

To install mantaflow, run:

$ git clone https://bitbucket.org/mantaflow/manta.git
$ git checkout 15eaf4

and follow the instruction. Note that numpy cmake option should be set to enable support for numpy arrays. (i.e., -DNUMPY='ON')

Usage

Run a script for the dataset generation using mantaflow. For instance,

$ ..\manta\build\Release\manta.exe .\scene\smoke_pos_size.py

To train:

$ python main.py

To test:

$ python main.py --is_train=False --load_path=MODEL_DIR

Please take a closer look at run.bat for each dataset and other architectures.

Result (2D)

Reconstruction from each parameter after 100 epochs (From top to bottom: position / width / time)

param

Reconstruction of random samples after 100 epochs (Top: reconstructed, bottom: ground truth)

In each image, the top row shows velocity profiles, and the bottom row shows vorticity profiles.

random

randomgt

Result (3D)

Reconstruction from each parameter after 100 epochs. (From top to bottom: in-flow velocity / buoyancy / time)

The left image shows the middle slice of xy domain, and the right image is the middle slice view of zy domain.

In each image, the top three rows are velocity profiles, and the rest rows are vorticity profiles.

param_xy param_zy

Reconstruction of random samples after 100 epochs (Top: reconstructed (xy-zy), bottom: ground truth (xy-zy))

random_xy random_zy

random_xy_gt random_zy_gt

Result (Autoencoder)

Reconstruction (2D) of random samples after 10 epochs (Top: reconstructed, bottom: ground truth)

random_ae

random_ae_gt

Reconstruction (3D) of random samples after 10 epochs (Top: reconstructed (xy-zy), bottom: ground truth (xy-zy))

random_ae_xy random_ae_zy

random_ae_xy_gt random_ae_zy_gt

Author

Byungsoo Kim / @byungsook