modeling fluid phenomena
DESCRIPTION
Modeling Fluid Phenomena. Vinay Bondhugula (25 th & 27 th April 2006). Two major techniques. Solve the PDE describing fluid dynamics. Simulate the fluid as a collection of particles. Rapid Stable Fluid Dynamics for Computer Graphics – Kass and Miller SIGGRAPH 1990. Previous Work. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/1.jpg)
Modeling Fluid Phenomena
-Vinay Bondhugula
(25th & 27th April 2006)
![Page 2: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/2.jpg)
Two major techniques
• Solve the PDE describing fluid dynamics.
• Simulate the fluid as a collection of particles.
![Page 3: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/3.jpg)
Rapid Stable Fluid Dynamics for Computer Graphics – Kass and Miller
SIGGRAPH 1990
![Page 4: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/4.jpg)
Previous Work
• Older techniques were not realistic enough:– Tracking of individual waves– No net transport of water– Can’t handle changes in boundary conditions
![Page 5: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/5.jpg)
Introduction
• Approximates wave equation for shallow water.
• Solves the wave equation using implicit integration.
• The result is good enough for animation purposes.
![Page 6: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/6.jpg)
Shallow Water Equations: Assumptions
1) Represent water by a height field.
Motivation:• In an accurate simulation, computational
cost grows as the cube of resolution.Limitation:• No splashing of water.• Waves cannot break.
![Page 7: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/7.jpg)
Contd…
2) Ignore the vertical component of the velocity of water.
Limitation:
Inaccurate simulation for steep waves.
![Page 8: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/8.jpg)
Contd…
3) Horizontal component of the velocity in a column is constant.
Assumption fails in some cases:
• Undercurrent
• Greater friction at the bottom.
![Page 9: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/9.jpg)
Notation
• h(x) is the height of the water surface
• b(x) is the height of the ground surface
• d(x) = h(x) – b(x) is the depth of the water
• u(x) is the horizontal velocity of a vertical water column.
• di(n) is the depth at the ith point after the nth iteration.
![Page 10: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/10.jpg)
The Equations
• F = ma, gives the following:
The second term is the horizontal force acting on a water column.
• Volume conservation gives:
![Page 11: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/11.jpg)
Contd…
• Differentiating equation 1 w.r.t x and equation 2 w.r.t t we get:
• From the simplified wave equation, the wave velocity is sqrt(gd).
• Explains why tsunami waves are high– The wave slows down as it approaches the
coast, which causes water to pile up.
![Page 12: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/12.jpg)
Discretization
• Finite-difference technique is applied:
![Page 13: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/13.jpg)
Integration
• Implicit techniques are used:
![Page 14: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/14.jpg)
Another approximation
• Still a non-linear equation!– ‘d’ is dependent on ‘h’
• Assume ‘d’ to be constant during integration– Wave velocities only change between
iterations.
![Page 15: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/15.jpg)
The linear equation:
• Symmetric tridiagonal matrices can be solved very efficiently.
![Page 16: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/16.jpg)
The linear equation
• The linear equation can be considered an extrapolation of the previous motion of the fluid.
• Damping can be introduced if the equation is written as:
![Page 17: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/17.jpg)
A Subtle Issue
• In an iteration, nothing prevents h from becoming less than b at a particular point, leading to negative volume at that point.
• To compensate for this the iteration creates volume elsewhere (note that our equations conserve volume).
• Solution: After each iteration, compute the new volume and compare it with the old volume.
![Page 18: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/18.jpg)
The Equation in 3D
• Split the equation into two terms - one independent of x and the other independent of y - and solve it in two sub-iterations.
• We still obtain a linear system!
![Page 19: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/19.jpg)
Rendering
• Rendered with caustics – the terrain was assumed to be flat.
• Real-time simulation!!– 30 fps on a 32x32 grid
![Page 20: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/20.jpg)
Miscellaneous
• Walls are simulated by having a steep incline.
![Page 21: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/21.jpg)
ResultsWater flowing down a hill…
![Page 22: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/22.jpg)
More Images
Wave speed depends on the depth of the water…
![Page 23: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/23.jpg)
Particle-Based Fluid Simulation for Interactive Applications
- Matthias Muller et. al.
SCA 2003
![Page 24: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/24.jpg)
Motivation
Limitations of grid based simulation:
• No splashing or breaking of waves
• Cannot handle multiple fluids
• Cannot handle multiple phases
![Page 25: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/25.jpg)
Introduction
• Use Smoothed Particle Hydrodynamics (SPH) to simulate fluids with free surfaces.
• Pressure and viscosity are derived from the Navier-Stokes equation.
• Interactive simulation (about 5 fps).
![Page 26: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/26.jpg)
SPH
• Originally developed for astrophysical problems (1977).
• Interpolation method for particles.
• Properties that are defined at discrete particles can be evaluated anywhere in space.
• Uses smoothing kernels to distribute quantities.
![Page 27: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/27.jpg)
Contd…
• mj is the mass, j is the density, Aj is the quantity to be interpolated and W is the smoothing kernel
![Page 28: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/28.jpg)
Modeling Fluids with Particles
• Given a control volume, no mass is created in it. Hence, all mass that comes out has to be accounted by change in density.
But, mass conservation is anyway guaranteed in a particle system.
![Page 29: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/29.jpg)
Contd…
• Momentum equation:
Three components:– Pressure term– Force due to gravity– Viscosity term (is the viscosity of the liquid)
![Page 30: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/30.jpg)
Pressure Term
• It’s not symmetric! Can easily be observed when only two particles interact.
• Instead use this:
• Note that the pressure at each particle is computed first. Use the ideal gas state equation:p = k*where k is a constant which depends on the temperature.
![Page 31: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/31.jpg)
Viscosity Term
• Method used is similar to the one used for the pressure term.
![Page 32: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/32.jpg)
Miscellaneous
• Other external forces are directly applied to the particles.
• Collisions: In case of collision the normal component of the velocity is flipped.
![Page 33: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/33.jpg)
Smoothing Kernel
• Has an impact on the stability and speed of the simulation.– eg. Avoid square-roots for distance computation.
• Sample smoothing kernel:
all points inside a radius of ‘h’ are considered for “smoothing”.
![Page 34: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/34.jpg)
Surface Tracking and Visualization
• Define a quantity that is 1 at particle locations and 0 elsewhere (it’s called the color field).
• Smooth it out:
• Compute the gradient of this field:
![Page 35: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/35.jpg)
Contd…
• If |n(ri)| > l, then the point is a surface point.
• l is a threshold parameter.
![Page 36: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/36.jpg)
Results
• Interactive Simulation (5fps)
• Videos from Muller’s site:
http://graphics.ethz.ch/~mattmuel/
![Page 37: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/37.jpg)
Fluid-Fluid Interaction Results
![Page 38: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/38.jpg)
![Page 39: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/39.jpg)
![Page 40: Modeling Fluid Phenomena](https://reader035.vdocuments.mx/reader035/viewer/2022062408/56813689550346895d9e126d/html5/thumbnails/40.jpg)
References
• Rapid, Stable Fluid Dynamics for Computer Graphics – Michael Kass and David Miller – SIGGRAPH 1990
• Particle-Based Fluid Simulation for Interactive Applications – Muller et. al., SCA 2003
• Particle-Based Fluid-Fluid Interaction - M. Muller, B. Solenthaler, R. Keiser, M. Gross – SCA 2005