CS 231. Fluid simulation

Similar documents
Water. Notes. Free surface. Boundary conditions. This week: extend our 3D flow solver to full 3D water We need to add two things:

CS-184: Computer Graphics Lecture #21: Fluid Simulation II

Navier-Stokes & Flow Simulation

Overview of Traditional Surface Tracking Methods

CGT 581 G Fluids. Overview. Some terms. Some terms

Realistic Animation of Fluids

Navier-Stokes & Flow Simulation

Fluid Simulation. [Thürey 10] [Pfaff 10] [Chentanez 11]

Navier-Stokes & Flow Simulation

FLUID SIMULATION. Kristofer Schlachter

Level set methods Formulation of Interface Propagation Boundary Value PDE Initial Value PDE Motion in an externally generated velocity field

Adarsh Krishnamurthy (cs184-bb) Bela Stepanova (cs184-bs)

Animation of Fluids. Animating Fluid is Hard

Computer animation for fluid simulation of a high viscous fluid melting

Particle-Based Fluid Simulation. CSE169: Computer Animation Steve Rotenberg UCSD, Spring 2016

Divergence-Free Smoothed Particle Hydrodynamics

CUDA. Fluid simulation Lattice Boltzmann Models Cellular Automata

Realistic Animation of Fluids

Realtime Water Simulation on GPU. Nuttapong Chentanez NVIDIA Research

Fluid Simulation. Dhruv Kore, Giancarlo Gonzalez, and Jenny Sum CS 488: Introduction to Computer Graphics Professor Angus Forbes

Fluids in Games. Jim Van Verth Insomniac Games

2.7 Cloth Animation. Jacobs University Visualization and Computer Graphics Lab : Advanced Graphics - Chapter 2 123

CS GPU and GPGPU Programming Lecture 2: Introduction; GPU Architecture 1. Markus Hadwiger, KAUST

AN ADAPTIVE SAMPLING APPROACH TO INCOMPRESSIBLE PARTICLE-BASED FLUID. A Dissertation WOO-SUCK HONG

Lagrangian methods and Smoothed Particle Hydrodynamics (SPH) Computation in Astrophysics Seminar (Spring 2006) L. J. Dursi

Comparison between incompressible SPH solvers

More Animation Techniques

Simulation of Swirling Bubbly Water using Bubble Particles

Simulating Bubbles Michael Running Wolf 4/1/05. Introduction

The 3D DSC in Fluid Simulation

Surface Tension Approximation in Semi-Lagrangian Level Set Based Fluid Simulations for Computer Graphics

PHYSICALLY BASED ANIMATION

A High Quality, Eulerian 3D Fluid Solver in C++ A Senior Project. presented to. the Faculty of the Computer Science Department of

Dynamical Simulation 1: Particle Systems and ODEs

Smoke Simulation using Smoothed Particle Hydrodynamics (SPH) Shruti Jain MSc Computer Animation and Visual Eects Bournemouth University

Constraint fluids in Sprinkle. Dennis Gustafsson Mediocre

Fluid Solver built in Houdini

Level Set Method in a Finite Element Setting

Mass-Spring Systems. Last Time?

Efficient Tridiagonal Solvers for ADI methods and Fluid Simulation

Investigating The Stability of The Balance-force Continuum Surface Force Model of Surface Tension In Interfacial Flow

Modelling of Levitation Melting using a Fixed Mesh Method

Physically-Based Modeling and Animation. University of Missouri at Columbia

SPC 307 Aerodynamics. Lecture 1. February 10, 2018

Computers & Graphics

Three Dimensional Numerical Simulation of Turbulent Flow Over Spillways

Fluid Simulation with Finite Element Method

Interaction of Fluid Simulation Based on PhysX Physics Engine. Huibai Wang, Jianfei Wan, Fengquan Zhang

NUMERICAL INVESTIGATION OF THE FLOW BEHAVIOR INTO THE INLET GUIDE VANE SYSTEM (IGV)

Chapter 3: Computer Animation Reminder: Descriptive animation. Procedural animation : Examples. Towards methods that generate motion?

The Immersed Interface Method

An Adaptive Sampling Approach to Incompressible Particle-Based Fluid

Rigid Body Dynamics, Collision Response, & Deformation

Shape of Things to Come: Next-Gen Physics Deep Dive

Realistic and Controllable Fire Simulation

CNM 190, pt 2 Advanced Digital Animation Lec 03 : Art Direction on Madagascar / Effects 1

A Toolbox of Level Set Methods

Interactive Fluid Simulation using Augmented Reality Interface

Solving Partial Differential Equations on Overlapping Grids

Recent applications of overset mesh technology in SC/Tetra

The Simulation of Liquids

CUDA/OpenGL Fluid Simulation. Nolan Goodnight

Ian Mitchell. Department of Computer Science The University of British Columbia

IMPROVED WALL BOUNDARY CONDITIONS WITH IMPLICITLY DEFINED WALLS FOR PARTICLE BASED FLUID SIMULATION

Solidification using Smoothed Particle Hydrodynamics


Flows on Surfaces of Arbitrary Topology

FLUID SIMULATION BY PARTICLE LEVEL SET METHOD WITH AN EFFICIENT DYNAMIC ARRAY IMPLEMENTATION ON GPU

Vector Field Visualisation

A Novel Approach to High Speed Collision

Adaptive Particles for Incompressible Fluid Simulation (Technical Report tamu-cs-tr )

Finite Volume Discretization on Irregular Voronoi Grids

Introduction to the immersed boundary method

Texture Advection Based Simulation of Dynamic Cloud Scene

Physically Based Simulation and Animation of Gaseous Phenomena in a Periodic Domain

SIMULATION OF THE MIXING OF INK AND WATER IN HOUDINI

LATTICE-BOLTZMANN METHOD FOR THE SIMULATION OF LAMINAR MIXERS

DLA Simulations. Jasraj Singh Kohli Gregory Raustad Peter Del Rosso

Support for Multi physics in Chrono

Chapter 2 Water and Bubbles

Particle-based Fluid Simulation

(LSS Erlangen, Simon Bogner, Ulrich Rüde, Thomas Pohl, Nils Thürey in collaboration with many more

9. Three Dimensional Object Representations

Partial Differential Equations

Interactive Fluid Simulation Using Augmented Reality Interface

Cloth Simulation. COMP 768 Presentation Zhen Wei

Permeable and Absorbent Materials in Fluid Simulations

Deforming meshes that split and merge

A Fluid Implicit Particle Approach to a Pyro Solver in Houdini

The Mimetic Approach to Incompressible Surface Tension Flows

Abstract. Introduction. Kevin Todisco

Fluid Mechanics Simulation Essentials R2014X

FEM techniques for interfacial flows

Animating smoke with dynamic balance

A Geometric Approach to Animating Thin Surface Features in SPH Water

Fluid Simulation Quality with Violated CFL Condition

ENERGY-224 Reservoir Simulation Project Report. Ala Alzayer

Real-Time Volumetric Smoke using D3D10. Sarah Tariq and Ignacio Llamas NVIDIA Developer Technology

Rendering Smoke & Clouds

An Introduction to Flow Visualization (1) Christoph Garth

Transcription:

CS 231 Fluid simulation

Why Simulate Fluids? Feature film special effects Computer games Medicine (e.g. blood flow in heart) Because it s fun

Fluid Simulation Called Computational Fluid Dynamics (CFD) Many approaches from math and engineering Graphics favors finite difference Introduced fast and stable methods to graphics [Stam 1999]

Vector Fields (Fluid Velocity) u ij = (u x,u y )

Navier-Stokes Equations u=0 Incompressibility u t = k 2 u (u )u p + f Diffusion Change in Velocity Advection Pressure Body Forces

Navier-Stokes Equations u=0 Incompressibility u t = k 2 u (u )u p + f Diffusion Change in Velocity Advection Pressure Body Forces

Fluid Grids All values live on regular grids Need scalar and vector fields Scalar fields: amount of smoke or dye Vector fields: fluid velocity Subtract adjacent quantities to approximate derivatives

Scalar Field (Smoke, Dye) 1.2 3.7 5.1 c ij

Diffusion c ij

Diffusion c t = k 2 c 1 value relative to neighbors 1-4 1 1 c ij new = c ij + k Dt (c i-1j + c i+1j + c ij-1 + c ij+1-4c ij )

Diffusion = Blurring Original Some Diffusion More Diffusion

Vector Field Diffusion u t = k 2 u Two separate diffusions: viscosity u x t = k 2 u x u y t = k 2 u y blur the x-velocity and the y-velocity

Effect of Viscosity Low Medium High Very High Each one is ten times higher viscosity than the last

Variable Viscosity Viscosity can vary based on position Viscosity field k can change with temperature

Navier-Stokes Equations u=0 Incompressibility u t = k 2 u (u )u p + f Diffusion Change in Velocity Advection Pressure Body Forces

Advection = Pushing Stuff

Scalar Field Advection c t = (u )c change in value advection current values

Vector Field Advection u t = (u )u Two separate advections: u x t = (u )u x u y t = (u )u y push around x-velocity and y-velocity

Advection Easy to code Method stable even at large time steps Problem: numerical inaccuracy diffuses flow

Diffusion/dissipation in first order advection Original Image After 360 degree rotation using first order advection

Solution: Error Correction 1) Perform forward advection 2) Do backward advection from new position 3) Compute error and take correction step 4) Do forward advection from corrected position

Solution: Error Correction Forward Compensate Forward Backward error

Navier-Stokes Equations u=0 Incompressibility u t = k 2 u (u )u p + f Diffusion Change in Velocity Advection Pressure Body Forces

Divergence High divergence Low divergence Zero divergence

Enforcing Incompressibility First do velocity diffusion and advection Find closest vector field that is divergencefree Need to calculate divergence Need to find and use pressure

Measuring Divergence u=? u y ij+1 -u x? i-1j u x i+1j -u y ij-1 u ij =(u x i+1j - u x i-1j) + (u y ij+1-u y ij-1)

Pressure Term u new = u p Take divergence of both sides u new = u p zero u = 2 p

Pressure Term u = 2 p known unknown p ij+1 p i-1j? p i+1j p ij-1 p new ij = p ij + ( u ij - (p i-1j + p i+1j + p ij-1 + p ij+1-4p ij ))

Pressure Term u new = u p and velocity is now divergence-free

Fluid Simulator 1) Diffuse velocity 2) Advect velocity 3) Add body forces (e.g. gravity) 4) Pressure projection 5) Diffuse dye/smoke 6) Advect dye/smoke

Where is the Water? Water is often modeled as a fluid with a free surface The only thing we re missing so far is how to track where the water is: Voxelized: which cells are fluid vs. empty? Better: where does air/water interface cut through grid lines?

Marker Particles Simplest approach is to use marker particles Sample fluid volume with particles At each time step, mark grid cells containing any marker particles as Fluid, rest as Empty or Solid Move particles in incompressible grid velocity field (interpolating as needed)

Rendering Marker Particles Need to wrap a surface around the particles E.g. blobbies, or Zhu & Bridson 05 Problem: rendered surface has bumpy detail that the fluid solver doesn t have access to The simulation can t animate that detail properly if it can t see it. Result: looks fine for splashy, noisy surfaces, but fails on smooth, glassy surfaces.

Improvement Sample (implicit) surface function on simulation grid Even just union of spheres is reasonable if we smooth and render from the grid Issues, must make sure that each particle always shows up on grid or droplets can flicker in and out of existence Or: you must delete stray particles But still not perfect for flat fluid surfaces.

Level Sets Idea: drop the particles all together, and just sample the implicit surface function on the grid In particular, best behaved type of implicit surface function is signed distance

Computing Signed Distance Many algorithms exist Simplest and most robust (and accurate enough for animation) are geometric in nature Our example algorithm is based on a Fast Sweeping method [Tsai 02]

Level Sets Surface is exactly where =0 We need to evolve on the grid The surface ( =0) moves at the velocity of the fluid (any fluid particle with =0 should continue with =0) See e.g. the book [Osher&Fedkiw 02]

Reinitializing One problem is that advecting this way doesn t preserve signed distance property Eventually gets badly distorted Causes problems particularly for extrapolation, also for accuracy in general Reinitialize: recompute distance to surface Ideally shouldn t change surface at all, just values in the volume

Small-scale liquid-solid Interactions What makes large water and small water behave differently? Surface Tension Viscosity Lake ( >1 meter) Water drops (millimeters)

Surface Tension Fsurf N Normal (always pointing outward) Surface Tension Force 0 0

Virtual Surface Method Air Liquid Virtual Liquid Virtual Surface Solid

Virtual Surface Method 60 90 120 s s hydrophillic hydrophobic s