Download presentation
Presentation is loading. Please wait.
Published byBethanie Nash 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
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
Outline Grid structure Uniform solver Advection on tall cells Pressure solver on tall cells Parallel implementation Discussion and Results
9
Outline Grid structure Uniform solver Advection on tall cells Pressure solver on tall cells Parallel implementation Discussion and Results
10
Why height fields work Water likes to stay flat Only water-air interface is visible Vertical structure simpler than horizontal
11
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
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
16
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
17
Transferring velocity InterpolateLeast squares
18
Transferring velocity (cont) Interpolate: Least squares:
19
Outline Grid structure Uniform solver Advection on tall cells Pressure solver on tall cells Parallel implementation Discussion and Results
20
Uniform solver Navier-Stokes equations plus level set Level set exists only in uniform cells Velocity updated using projection method
21
Uniform solver (cont) Advect velocity and add gravity – use semi-Lagrangian for uniform cells Solve Laplace equation for pressure Apply pressure correction to velocity
22
Outline Grid structure Uniform solver Advection on tall cells Pressure solver on tall cells Parallel implementation Discussion and Results
23
Tall cell advection Can’t use semi-Lagrangian for Use conservative method for plausible motion Simplest option: first order upwinding
24
First order upwinding Conservation form of advection equation Compute flux on each control volume face Add fluxes to current velocity
25
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
26
First order upwinding (tall cells) u along uu along vv along uv along v
27
Advection issues Occasional instabilities near steep terrain – fix by clamping to affine combination Lots of numerical dissipation – good enough for bulk motion Future work: generalize higher order schemes used in shallow water
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 gradient and divergence operators
30
Pressure solve: gradient Gradient is easy
31
Pressure solve: divergence Two divergence samples per cell Interpolate velocity to uniform face Divide flux between samples with same weights used for interpolation
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
Parallel implementation Parallelize only along horizontal dimensions – No harder than parallelizing a uniform code – Vertical dimension already cheap Exchange data with neighbors every step
35
Parallel implementation Pressure solved globally on all processor together Block diagonal preconditioner built out of incomplete Choleski on each processor AB CD
36
Results: splash (300 x 200) Optical depth equal to water depth
37
Results: splash (300 x 200) Optical depth 1/4 th water depth
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
Results: river (2000 x 200)
43
Matching bottom topography Tall cells match ground for free Octrees would require extra refinement Less important for deep problems
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 resolution at interface 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
The End Questions?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.