Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Next Generation Fluid Simulations with Mantaflow

Next Generation Fluid Simulations with Mantaflow

It's about time that Blender gets an updated fluid simulator. Good that Mantaflow is around the corner!

Mantaflow is a fluid simulation framework from research. It's currently being developed at the Technical University of Munich under the supervision of Nils Thuerey - the creator of Blenders current fluid simulator. And although it's primarily used in research it turns out to be a great addition for Blender too!

In this talk you will first learn how a research-oriented framework like Mantaflow technically fits into Blender. The main part of this talk will then focus on the current state of Mantaflow in Blender: We will explore mesh- and particle-based liquid simulations, see examples of novel research finding practical application, take a look at results from Google Summer of Code fluid projects, and compare the new with the current fluid implementation. In a final outlook, you will find out what to expect for Blender 2.8.

================================================================================

The links to the papers (slides 4-6) are barely readable on the slides. Here they are again:

Narrow Band FLIP for Liquid Simulations:
https://wwwcg.in.tum.de/research/research/publications/2016/narrow-band-flip-for-liquid-simulations.html

Primal-Dual Optimization for Fluids:
https://ge.in.tum.de/publications/2017-cgf-eckert/

================================================================================

A video of this talk can be found here:
https://www.youtube.com/watch?v=h9TViIgm8Yc

Sebastián Barschkis

October 27, 2017
Tweet

Other Decks in Science

Transcript

  1. N E X T G E N E R AT

    I O N F L U I D S I M U L AT I O N S W I T H M A N TA F L O W B L E N D E R C O N F E R E N C E 2 0 1 7 - S E B A S T I Á N B A R S C H K I S
  2. T E S T S C E N E N

    O . 1 ( 2 0 1 5 ) H O W I T A L L S TA R T E D …
  3. B L E N D E R M A N

    TA F L O W I N T E G R AT I O N T H E S T O RY S O FA R … • 2014: Kickoff, Smoke, Python API • 2015: Fire, High-res smoke (Wavelets) • 2016: Liquids (NB-FLIP), Unified cache & solver • 2017: Particles (FLIP + secondary), Fluid guiding Google Summer of Code Blender 2.8 / 40 3 https://summerofcode.withgoogle.com/ http://mantaflow.com/ https://www.tum.de/
  4. R E S E A R C H AT T

    U M - T H U E R E Y G R O U P T H E S T O RY S O FA R … Narrow Band FLIP for Liquid Simulations F. Ferstl, R. Ando, C. Wojtan, R. Westermann, N.Thuerey Primal-Dual Optimization for Fluids T. Inglis, M.-L. Eckert, J. Gregson, N. Thuerey / 40 4 https://wwwcg.in.tum.de/research/research/publications/2016/narrow-band-flip-for-liquid-simulations.html https://ge.in.tum.de/publications/2017-cgf-eckert/
  5. R E S E A R C H AT T

    U M - T H U E R E Y G R O U P T H E S T O RY S O FA R … Narrow Band FLIP for Liquid Simulations F. Ferstl, R. Ando, C. Wojtan, R. Westermann, N.Thuerey NB-FLIP ON 64x64x64 grid 104.604 particles NB-FLIP OFF 64x64x64 grid 682.822 particles Particles (FLIP) only at surface! + Save memory + Save computation time / 40 5 https://wwwcg.in.tum.de/research/research/publications/2016/narrow-band-flip-for-liquid-simulations.html
  6. R E S E A R C H AT T

    U M - T H U E R E Y G R O U P T H E S T O RY S O FA R … Primal-Dual Optimization for Fluids T. Inglis, M.-L. Eckert, J. Gregson, N. Thuerey 64x64 grid, blur radius = 2 Target velocity field constrains flow velocity! + Avoids artificial viscosity (force-based methods) + Fictitious but plausible motion / 40 6 https://ge.in.tum.de/publications/2017-cgf-eckert/
  7. D E V E L O P E R S

    P E R S P E C T I V E M A N TA F L O W ( S TA N D A L O N E ) Mantaflow C++ solver core C++ Plugins (e.g. Guiding, Wavelets, Fire) Python scene definition 2D slice view in Mantaflow GUI / 40 7
  8. D E V E L O P E R S

    P E R S P E C T I V E A N AT O M Y O F M A N TA S C R I P T Basic Mantaflow Python Script Solver object setup • Domain size • Timestep • 2D / 3D? Grid / Particle System Init • Density, velocity, pressure, (…) grids • FLIP, Secondary particle systems Main loop (frame step) • Advection • External forces • Pressure solve Scene setup • Domain boundaries • Inflow & obstacle objects / 40 8
  9. Python snippets Callable from bpy Export scene as Mantascript Better

    debugging Future: Node editor D E V E L O P E R S P E R S P E C T I V E B L E N D E R M A N TA F L O W A P I Basic Mantaflow Python Script / 40 9
  10. W H AT C H A N G E S

    ? S E T T I N G S O V E R V I E W W I T H M A N TA F L O W “ S a m e ” S m o k e & F i re H i g h - re s o p t i o n s Wa v e l e t n o i s e N o t p o s s i b l e A d a p t i v e D o m a i n N e w / 40 10
  11. W H AT C H A N G E S

    ? S E T T I N G S O V E R V I E W And: Fluid = Smoke or Liquid! W I T H M A N TA F L O W “ S a m e ” S m o k e & F i re H i g h - re s o p t i o n s Wa v e l e t n o i s e N o t p o s s i b l e A d a p t i v e D o m a i n N e w F L I P L i q u i d s A d a p t i v e t i m e - s t e p p i n g F l u i d p a r t i c l e s F l u i d g u i d i n g
  12. ( F L I P ) L I Q U

    I D S G O O G L E S U M M E R O F C O D E 2 0 1 6 FLIP = Fluid Implicit Particle Particles track surface Generate mesh from particles Cache: Mesh and/or particles High resolution (FLIP) liquid splash (512 divisions) / 40 12
  13. ( F L I P ) L I Q U

    I D S C O M PA R I S O N E L B E E M V S . M A N TA F L O W With Mantaflow Blender 2.79
  14. F L U I D PA R T I C

    L E S G O O G L E S U M M E R O F C O D E 2 0 1 7 Types: • FLIP (Fluid Implicit Particle) / 40 15 Just (FLIP) particles (FLIP) particles + mesh
  15. Types: • FLIP (Fluid Implicit Particle) • Drop • Bubble

    • Float • Tracer F L U I D PA R T I C L E S G O O G L E S U M M E R O F C O D E 2 0 1 7 Secondary Particles “Recycled” / 40 16 Just (FLIP) particles (FLIP) particles + mesh
  16. Types: • FLIP (Fluid Implicit Particle) • Drop • Bubble

    • Float • Tracer F L U I D PA R T I C L E S G O O G L E S U M M E R O F C O D E 2 0 1 7 Secondary Particles “Recycled” FLIP Drop Bubble Float Tracer Mesh / 40 17
  17. F L U I D PA R T I C

    L E S F L I P & S E C O N D A RY PA R T I C L E S & L I F E C Y C L E FLIP Drop Bubble Float Tracer [Thresh] [Factor] [Sample %] [Sample %] / 40 18
  18. F L U I D PA R T I C

    L E S F L I P PA R T I C L E S FLIP Drop Bubble Float Tracer [Thresh] [Factor] [Sample %] [Sample %] Is in narrow band? / 40 19
  19. F L U I D PA R T I C

    L E S S E C O N D A RY PA R T I C L E S & L I F E C Y C L E Next position with Euler’s method: x i+1 =x i +v i ·∆t Is convex? Is fast enough? FLIP Drop Bubble Float Tracer [Thresh] [Factor] [Sample %] [Sample %] Generate Gravity / 40 20
  20. F L U I D PA R T I C

    L E S S E C O N D A RY PA R T I C L E S & L I F E C Y C L E Is inside fluid? FLIP Drop Bubble Float Tracer [Thresh] [Factor] [Sample %] [Sample %] Generate Gravity Buoyancy Convert Buoyancy = Inverse Gravity · “Rise Up” Factor / 40 21
  21. F L U I D PA R T I C

    L E S S E C O N D A RY PA R T I C L E S & L I F E C Y C L E Is on surface? FLIP Drop Bubble Float Tracer [Thresh] [Factor] [Sample %] [Sample %] Generate Gravity Buoyancy Convert Convert Float / 40 22
  22. F L U I D PA R T I C

    L E S S E C O N D A RY PA R T I C L E S & L I F E C Y C L E Is on surface? FLIP Drop Bubble Float Tracer [Thresh] [Factor] [Sample %] [Sample %] “Drop, bubble & float particles recycled (Lifecycle)” Generate Gravity Buoyancy Convert Convert Float / 40 23
  23. F L U I D PA R T I C

    L E S S E C O N D A RY PA R T I C L E S & L I F E C Y C L E Is inside fluid? FLIP Drop Bubble Float Tracer [Thresh] [Factor] [Sample %] [Sample %] Generate with x% / 40 24
  24. F L U I D PA R T I C

    L E S S E C O N D A RY PA R T I C L E S & L I F E C Y C L E Additional floats! FLIP Drop Bubble Float Tracer [Thresh] [Factor] [Sample %] [Sample %] Generate with x% Generate with x% / 40 25
  25. F L U I D G U I D I

    N G G O O G L E S U M M E R O F C O D E 2 0 1 7 Blur radius = 1 Blur radius = 5 Blur radius = 9 for each step: 1. Guide vel constrains main vel 2. Ensure divergence-free motion / 40 27
  26. F L U I D G U I D I

    N G G O O G L E S U M M E R O F C O D E 2 0 1 7 Blur radius = 1 Blur radius = 5 Blur radius = 9 for each step: 1. Guide vel constrains main vel 2. Ensure divergence-free motion Guiding object / 40 28
  27. F L U I D G U I D I

    N G G O O G L E S U M M E R O F C O D E 2 0 1 7 Blur radius = 1 Blur radius = 5 Blur radius = 9 for each step: 1. Guide vel constrains main vel 2. Ensure divergence-free motion Guiding object Animation Guiding velocity grid / 40 29
  28. F L U I D G U I D I

    N G G O O G L E S U M M E R O F C O D E 2 0 1 7 Blur radius = 1 Blur radius = 5 Blur radius = 9 for each step: 1. Guide vel constrains main vel 2. Ensure divergence-free motion Guiding object Animation Guiding velocity grid Blur, weight Manta pressure solve / 40 30
  29. F L U I D G U I D I

    N G G O O G L E S U M M E R O F C O D E 2 0 1 7 Blur radius = 1 Blur radius = 5 Blur radius = 9 for each step: 1. Guide vel constrains main vel 2. Ensure divergence-free motion Guiding object Animation Guiding velocity grid Blur, weight Manta pressure solve / 40 31
  30. F L U I D G U I D I

    N G G O O G L E S U M M E R O F C O D E 2 0 1 7 Guided Smoke Tornado Weight = 2 (Lag) Blur radius = 5 (Size vortices) Frame 10 Frame 20 Frame 30 Frame 40 Frame 50 Frame 60 Frame 70 Frame 80 Frame 90 / 40 32
  31. O B S TA C L E S F L

    U I D I N T E R A C T I O N P R O B L E M R E A S O N S O L U T I O N O b s t a c l e n o t h i t Reality Expectation / 40 34
  32. O B S TA C L E S F L

    U I D I N T E R A C T I O N P R O B L E M R E A S O N S O L U T I O N O b s t a c l e n o t h i t O b s t a c l e t o o t h i n Obstacle Levelset in Mantaflow GUI (2D view from above) Thickening “0.0” Thickening “0.5” / 40 35
  33. O B S TA C L E S F L

    U I D I N T E R A C T I O N P R O B L E M R E A S O N S O L U T I O N O b s t a c l e n o t h i t O b s t a c l e t o o t h i n O b s t a c l e “ t h i c k e n i n g ” Obstacle Levelset in Mantaflow GUI (2D view from above) Thickening “0.0” Thickening “0.5” Thickening “1.5” Thickening “2.5” / 40 36
  34. O B S TA C L E S F L

    U I D I N T E R A C T I O N P R O B L E M R E A S O N S O L U T I O N O b s t a c l e n o t h i t O b s t a c l e t o o t h i n O b s t a c l e “ t h i c k e n i n g ” T i m e - s t e p t o o b i g Some (FLIP) particles “slip” through obstacle wall Frame i Frame i+1 / 40 37
  35. O B S TA C L E S F L

    U I D I N T E R A C T I O N P R O B L E M R E A S O N S O L U T I O N O b s t a c l e n o t h i t O b s t a c l e t o o t h i n O b s t a c l e “ t h i c k e n i n g ” T i m e - s t e p t o o b i g A d a p t i v e t i m e - s t e p p i n g Some (FLIP) particles “slip” through obstacle wall Frame i Frame i+1 / 40 38
  36. N E X T S T E P S R

    O A D T O B L E N D E R 2 . 8 • ToDo’s for 2.8: • Bug fixes — Blenderartists! • Remove (Elbeem) Fluid modifier • Merge in 2.8 branch • After 2.8 merge (Ideas): • Node editor • Fluid particles: Smoke & Fire / 40 39
  37. R E S O U R C E S •

    Blender-Wiki: • https://wiki.blender.org/index.php/User:Sebbas • Research: • https://ge.in.tum.de/ • Code: • Branch “fluid-mantaflow” • Me: • Twitter @sebbas WA N T M O R E ? Thanks! / 40 40