0% found this document useful (0 votes)
9 views

07 Fluid Simulation

Uploaded by

ari990
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

07 Fluid Simulation

Uploaded by

ari990
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Last Time?

• Spring-Mass Systems
• Numerical Integration
Navier-Stokes (Euler, Midpoint, Runge-Kutta)
& • Modeling string, hair, & cloth
Flow Simulation

Pop Worksheet! Teams of 2. Hand in to


Jeramey after we discuss.
“Predicting the Drape of Woven
Sketch the first few frames of a 2D explicit Euler mass-spring simulation for a 2x3 cloth
Cloth Using Interacting Particles”
network of uniform masses using only structural springs with uniform stiffness. READING FOR TODAY

• Breen, House,
and Wozny
• SIGGRAPH
1994
READING FOR TODAY
Cloth Collision Robert Bridson, Ronald Fedkiw & John Anderson
Cloth in Practice (w/ Animation)
Robust Treatment of Collisions, Contact
and Friction for Cloth Animation
• A cloth has many SIGGRAPH 2002 READING FOR TODAY
points of contact
• Often stays in contact • Baraff, Witkin & Kass
• Requires Untangling Cloth
– Efficient collision detection SIGGRAPH 2003
– Efficient numerical treatment (stability)

How to read a research paper? Components of a well-written research paper?


(especially an advanced paper in a new area) • Motivation/context/related work
• Multiple readings are often necessary • Contributions of this work
• Don't necessarily read from front to back • Clear description of algorithm
• Lookup important terms – Sufficiently-detailed to allow work to be reproduced
• Target application & claimed contributions – Work is theoretically sound
(hacks/arbitrary constants discouraged)
• Experimental procedure
• Results
• How well results & examples support the claims – well chosen examples
• Scalability of the technique (order notation) – clear tables/illustrations/visualizations
• Limitations of technique, places for future research • Conclusions
• Possibilities for hybrid systems with other work – limitations of the method are clearly stated
HW2: Cloth & Fluid Simulation Today
• Flow Simulations in Computer Graphics
– water, smoke, viscous fluids
• Navier-Stokes Equations
– incompressibility, conservation of mass
– conservation of momentum & energy
• Fluid Representations
• Basic Algorithm
• Data Representation
• Papers for Next Time...

Flow Simulations in Graphics Heightfield Wave Simulation


• Random velocity fields • Cem Yuksel, Donald H. House, and John Keyser,
– with averaging to get simple background motion “Wave Particles”, SIGGRAPH 2007
• Shallow water equations
– height field only, can’t
represent crashing waves, etc.
• Full Navier-Stokes

• note: typically we ignore


surface tension and focus
on macroscopic behavior
Flow in a Volume (continuous or voxel grid) Navier-Stokes Equations
• conservation of mass: • conservation of momentum:
gravity (& other external forces)
pressure viscosity

For a single
phase simulation
(e.g., water only,
air only)

Image from acceleration Convection: internal movement drag


Foster & Metaxas, 1996 in a fluid (e.g., caused by variation
in density due to a transfer of heat)

Today Modeling the Air/Water Surface


• Flow Simulations in Computer Graphics
• Navier-Stokes Equations • Volume-of-fluid tracking
• Fluid Representations
• Basic Algorithm
• Data Representation • Marker and Cell (MAC)
• Papers for Next Time...

• Smoothed Particle
Hydrodynamics (SPH)
Comparing Representations Volume-of-fluid-tracking
• How do we render the resulting surface? • Each cell stores a scalar floating point value indicating
that cell’s “full”-ness
• Are we guaranteed not to lose mass/volume?
(is the simulation incompressible?)
• How is each affected by the grid resolution
and timestep?
• Can we guarantee stability?

+ preserves volume
– difficult to render
– very dependent on grid resolution

Marker and Cell (MAC) Smoothed Particle Hydrodynamics (SPH)


• Harlow & Welch, "Numerical calculation of • Each particle represents a specific mass of fluid
time-dependent viscous incompressible flow
of fluid with free surface”, The Physics of • “Meshless” (no voxel grid)
Fluids, 1965. • Repulsive forces between
• Volume marker particles identify location of neighboring particles
fluid within the volume
maintain constant volume
• (Optional) surface marker particles track the
detailed shape of the fluid/air boundary
• But… marker particles don’t have or + no grid resolution concerns
represent a mass/volume of fluid (now accuracy depends on number/size of particles)
+ volume is preserved*
+ rendering + render similar to Marker and Cell (MAC)
– does not preserve volume – much more expensive (particle-particle interactions)
– dependent on grid resolution Note: Usually a grid is added to reduce the number of particle-particle comparisons!
Demos Today
• Nice Marker • Flow Simulations in Computer Graphics
and Cell (MAC) • Navier-Stokes Equations
videos at: • Fluid Representations
http://panoramix.ift.uni.wroc.pl/~maq/eng/cfdthesis.php • Basic Algorithm
• Data Representation
• Papers for Next Time...

http://mme.uwaterloo.ca/~fslien/free_surface/free_surface.htm

Each Grid Cell Stores: Initialization


• Velocity at the cell faces (offset grid) • Choose a voxel resolution
• Pressure • Choose a particle density
This is a critically
• List of particles important detail! (and • Create grid & place the particles
makes correct • Initialize pressure & velocity of each cell
implementation
rather annoying) • Set the viscosity & gravity
• Choose a timestep & go!

This piece needs


Image from explanation!
Foster & Metaxas, 1996
At each Timestep: Empty, Surface & Full Cells
• Identify which cells are Empty, • Empty: no marker particles
Full, or on the Surface • Surface: has an neighbor that is “Empty”
• Compute new velocities • Full: not “Empty” or “Surface”
• Adjust the velocities to maintain
an incompressible flow
• Move the particles
– Interpolate the velocities at the faces
• Render the geometry and repeat!

Images from Foster & Metaxas, 1996

At each Timestep: Compute New Velocities


• Identify which cells are Empty,
Full, or on the Surface
• Compute new velocities
• Adjust the velocities to maintain
an incompressible flow
• Move the particles
– Interpolate the velocities at the faces
• Render the geometry and repeat!
Note: some of these values are the average velocity
within the cell rather than the velocity at a cell face
At each Timestep: Adjusting the Velocities
• Identify which cells are Empty, • Calculate the divergence of the cell
Full, or on the Surface (the extra in/out flow)
• Compute new velocities • The divergence is used
• Adjust the velocities to maintain to update the pressure
an incompressible flow within the cell
• Move the particles • Adjust each face velocity
– Interpolate the velocities at the faces uniformly to bring the
divergence to zero
• Render the geometry and repeat!
• Iterate across the entire Image from
Foster & Metaxas, 1996
grid until divergence is < ε

Calculating/Eliminating Divergence Handing Free Surface with MAC


• Divergence in
surface cells:
… – Is divided
equally
amongst
neighboring
initial flow field after 1 iteration after many iterations empty cells
(results will vary with different calculation order) – Or other
similar
strategies?
• Zero out the
divergence &
pressure in
empty cells
corresponding corresponding corresponding
divergence divergence divergence
Original image from
At each Timestep: Velocity Interpolation Foster & Metaxas, 1996

• Identify which cells are Empty, • In 2D: For each axis, find the 4 closest face velocity samples:
Full, or on the Surface
• Compute new velocities
• Adjust the velocities to maintain
an incompressible flow
• Move the particles
– Interpolate the velocities at the faces
• Render the geometry and repeat!

• (In 3D… Find 8 closest face velocities in each dimension)

Correct Velocity Interpolation Today


• NOTE: The complete implementation isn’t particularly • Flow Simulations in Computer Graphics
elegant… Storing velocities at face midpoints (req’d for
• Navier-Stokes Equations
conservation of mass) makes the index math messy!
• Fluid Representations
• Basic Algorithm
• Data Representation
• Papers for Next Time...

No interpolation (just use the Correct Interpolation Buggy Interpolation


left/bottom face velocity) Note that the velocity Note the clumping particles,
Note the discontinuities in perpendicular to the and the discontinuities at some
velocity at cell boundaries outer box is zero of the cell borders (& particles
might escape the box!)
Everyone should read this
Reading for Tuesday (simple fluid model used in HW2) Stable Fluids
• “Realistic Animation of Liquids”, • “Stable Fluids”,
Foster & Metaxas, 1996 Jos Stam,
SIGGRAPH 1999.

Smoke Simulation & Rendering Optional Reading for Friday

“Visual Simulation of Smoke” “Coupling Water and Smoke to Thin Deformable


Fedkiw, Stam & Jensen
SIGGRAPH 2001
and Rigid Shells”, Guendelman, Selle, Losasso, &
Fedkiw, SIGGRAPH 2005.
Optional Reading for Friday Optional Reading for Friday
• Cem Yuksel, Donald H. House, and John Keyser,
“Wave Particles”, SIGGRAPH 2007

“Preserving Geometry and Topology for Fluid Flows


with Thin Obstacles and Narrow Gaps”
Azevedo, Batty, & Oliveira, SIGGRAPH 2016

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy