Download presentation
Presentation is loading. Please wait.
Published byBennett Hood Modified over 8 years ago
2
Efficient Simulation of Large Bodies of Water by Coupling Two and Three Dimensional Techniques Geoffrey Irving Stanford University Pixar Animation Studios Eran Guendelman Stanford University Frank Losasso Ron Fedkiw Stanford University Industrial Light + Magic
3
Motivation Large scale water phenomena important – Rivers, lakes, oceans, floods Fast option: height field methods – Nice wave propagation – Can’t handle overturning Accurate option: 3D Navier Stokes – Captures three dimensional behavior – Slow at high resolutions: O(N 4 )
4
Solution: use both Uniform 3D Navier-Stokes near interface Coarsen elsewhere using tall cells uniform tall cells
5
Solution: use both
6
Related work: 2D Deep water – Fournier and Reeves 1986, Peachy 1986 – Recent: Thon et al. 2000, Hinsinger 2002 Shallow Water – Kass and Miller 1990, O’Brien and Hodgins 1995 Rivers and streams – Chen and Lobo 1994, Thon and Ghazanfarpour 2001
7
Related work: 3D Uniform Navier-Stokes water – Foster and Metaxas 1997, Foster and Fedkiw 2001 – Enright et. al 2002: Particle level set method Large bodies of water – Takahashi et al. 2003: spray and foam – Mihalef et al. 2004: breaking waves Adaptive simulation – Losasso et al. 2004: Octree grids – Houston et al. 2006: Run-Length Encoded (RLE) grids
8
Why height fields work Water likes to stay flat Only water-air interface is visible Vertical structure simpler than horizontal
9
Mixing height fields and 3D Specify “optical depth” where we expect turbulent motion Use uniform 3D cells within optical depth Use height field model elsewhere optical depth
10
Outline Grid structure Uniform solver Advection on tall cells Pressure solver on tall cells Parallel implementation Discussion and Results
11
Outline Grid structure Uniform solver Advection on tall cells Pressure solver on tall cells Parallel implementation Discussion and Results
12
Grid structure Start with uniform MAC grid Keep cells within optical depth of the interface Outside optical depth, merge vertical sequences of cells into single tall cells
13
Grid structure: storing values Start with MAC grid storage – Level set values in cell centers near interface – Pressure values in cell centers – Velocity components on corresponding faces
14
Grid structure: pressure Two pressure samples per tall cell Linear interpolation between Allows
15
Grid structure: velocity Velocity corresponds to pressure gradients Horizontal velocity (u and w)Vertical velocity (v)
16
Grid structure: velocity Velocity corresponds to pressure gradients Horizontal velocity (u and w)Vertical velocity (v)
17
Refinement and coarsening Grid is rebuilt whenever fluid moves based on current level set Linear time (Houston et al. 2006) Velocity must be transferred to new grid – optionally transfer pressure as initial guess
18
Transferring velocity InterpolateLeast squares Main criterion: conserve momentum
19
Transferring velocity (cont) Interpolate: Least squares:
20
Outline Grid structure Uniform solver Advection on tall cells Pressure solver on tall cells Parallel implementation Discussion and Results
21
Uniform solver Navier-Stokes equations for velocity: Level set equation: Standard uniform MAC grid within uniform band Level set exists only in uniform cells
22
Uniform solver (cont) Advect velocity and add gravity – use semi-Lagrangian for uniform cells (Stam 1999) Solve Laplace equation for pressure Apply pressure correction to velocity
23
Outline Grid structure Uniform solver Advection on tall cells Pressure solver on tall cells Parallel implementation Discussion and Results
24
Tall cell advection Can’t use semi-Lagrangian for tall cells Use conservative method for plausible motion Simplest option: first order upwinding Ignored by semi-Lagrangian
25
First order upwinding (uniform) Average to control volume face Compute flux based on upwind velocity Adjust velocities based on flux
26
First order upwinding (tall cells) Pretend to do the following – Refine to uniform grid – Advect – Coarsen back to original grid Simulate this by applying least squares directly to uniform discretization Same answer but faster
27
Advection issues Occasional instabilities near steep terrain Fix by clamping to affine combination
28
Outline Grid structure Uniform solver Advection on tall cells Pressure solver on tall cells Parallel implementation Discussion and Results
29
Pressure solve on tall cells Pressure projection is Need to define two operations: – Gradient (pressure to velocity) – Divergence (velocity to pressure)
30
Pressure solve: gradient Gradient is easy:
31
Pressure solve: divergence
32
Pressure solve: Laplacian Compose divergence and gradient to get linear system Symmetric and positive definite since we used the same weights in both Solve using preconditioned conjugate gradients
33
Outline Grid structure Uniform solver Advection on tall cells Pressure solver on tall cells Parallel implementation Discussion and Results
34
Parallelize only along horizontal dimensions – No harder than parallelizing a uniform code – Vertical dimension already cheap Exchange data with neighbors every step Solve for pressure on all processors globally Parallel implementation
35
Results: splash (300 x 200) Optical depth equal to water depth
36
Results: splash (300 x 200) Optical depth 1/4 th water depth
37
Results: splash (300 x 200) fully refined 1/4 th refined
38
Results: splash (300 x 200) Optical depth 1/16 th water depth
39
Results: deep splash Water depth doubled
40
Results: boat (1500 x 300)
41
Matching bottom topography Tall cells match ground for free Octrees would require extra refinement Less important in very deep water
42
Results: river (2000 x 200)
44
Comparison with octrees Advantages over octrees: – Easy to parallelize – Reduces to MAC discretization with refinement – Matches bottom topography for free Main disadvantage: relies on vertical simplicity for efficiency Not applicable for all flows – rising bubbles, colliding droplets, etc.
45
Conclusion Want high resolution near interface – Uniform interface resolution sufficient Plausible bulk motion enough elsewhere Many flows have simple vertical structure Use this to create hybrid 2D/3D method
46
Future work Improved advection scheme – Match ENO/WENO schemes for shallow water Better parallelism – Remove global linear system solve Find optimal adaptive structure – Hybrid RLE / octree grid?
47
Acknowledgements My co-authors: Eran, Frank, and Ron Stanford Physically-Based Modeling group Funding agencies – NSF, ONR, Packard Foundation, and Sloan
48
The End Questions?
50
First order upwinding (uniform) Conservation form of advection equation Compute flux on each control volume face Add fluxes to current velocity
51
First order upwinding (tall cells) u along uu along vv along uv along v
52
Pressure solve: divergence Two divergence samples per cell Interpolate velocity to uniform face Divide flux between samples with same weights used for interpolation
53
Parallel implementation Pressure solved globally on all processors together Block diagonal preconditioner built out of incomplete Choleski on each processor AB CD
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.