1 / 47

Efficient Simulation of Large Bodies of Water by Coupling Two and Three Dimensional Techniques

Efficient Simulation of Large Bodies of Water by Coupling Two and Three Dimensional Techniques. Frank Losasso Ron Fedkiw Stanford University Industrial Light + Magic. Geoffrey Irving Stanford University Pixar Animation Studios. Eran Guendelman Stanford University. Motivation.

marty
Download Presentation

Efficient Simulation of Large Bodies of Water by Coupling Two and Three Dimensional Techniques

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Efficient Simulation of Large Bodies of Water by Coupling Two and Three Dimensional Techniques Frank Losasso Ron Fedkiw Stanford University Industrial Light + Magic Geoffrey Irving Stanford University Pixar Animation Studios Eran Guendelman Stanford University

  2. 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(N4)

  3. Solution: use both • Uniform 3D Navier-Stokes near interface • Coarsen elsewhere using tall cells

  4. Solution: use both

  5. 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

  6. 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

  7. Outline • Grid structure • Uniform solver • Advection on tall cells • Pressure solver on tall cells • Parallel implementation • Discussion and Results

  8. Outline • Grid structure • Uniform solver • Advection on tall cells • Pressure solver on tall cells • Parallel implementation • Discussion and Results

  9. Why height fields work • Water likes to stay flat • Only water-air interface is visible • Vertical structure simpler than horizontal

  10. 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

  11. 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

  12. 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

  13. Grid structure: pressure • Two pressure samples per tall cell • Linear interpolation between • Allows

  14. Grid structure: velocity • Velocity corresponds to pressure gradients

  15. 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

  16. Transferring velocity Interpolate Least squares

  17. Transferring velocity (cont) • Interpolate: • Least squares:

  18. Outline • Grid structure • Uniform solver • Advection on tall cells • Pressure solver on tall cells • Parallel implementation • Discussion and Results

  19. Uniform solver • Navier-Stokes equations plus level set • Level set exists only in uniform cells • Velocity updated using projection method

  20. Uniform solver (cont) • Advect velocity and add gravity • use semi-Lagrangian for uniform cells • Solve Laplace equation for pressure • Apply pressure correction to velocity

  21. Outline • Grid structure • Uniform solver • Advection on tall cells • Pressure solver on tall cells • Parallel implementation • Discussion and Results

  22. Tall cell advection • Can’t use semi-Lagrangian for • Use conservative method for plausible motion • Simplest option: first order upwinding

  23. First order upwinding • Conservation form of advection equation • Compute flux on each control volume face • Add fluxes to current velocity

  24. 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

  25. First order upwinding (tall cells) u along u u along v v along u v along v

  26. 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

  27. Outline • Grid structure • Uniform solver • Advection on tall cells • Pressure solver on tall cells • Parallel implementation • Discussion and Results

  28. Pressure solve on tall cells • Pressure projection is • Need gradient and divergence operators

  29. Pressure solve: gradient • Gradient is easy

  30. Pressure solve: divergence • Two divergence samples per cell • Interpolate velocity to uniform face • Divide flux between samples with same weights used for interpolation

  31. 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

  32. Outline • Grid structure • Uniform solver • Advection on tall cells • Pressure solver on tall cells • Parallel implementation • Discussion and Results

  33. Parallel implementation • Parallelize only along horizontal dimensions • No harder than parallelizing a uniform code • Vertical dimension already cheap • Exchange data with neighbors every step

  34. Parallel implementation • Pressure solved globally on all processor together • Block diagonal preconditioner built out of incomplete Choleski on each processor A B C D

  35. Results: splash (300 x 200) Optical depth equal to water depth

  36. Results: splash (300 x 200) Optical depth 1/4th water depth

  37. Results: splash (300 x 200) Optical depth 1/16th water depth

  38. Results: deep splash Water depth doubled

  39. Results: boat (1500 x 300)

  40. Results: river (2000 x 200)

  41. Results: river (2000 x 200)

  42. Matching bottom topography • Tall cells match ground for free • Octrees would require extra refinement • Less important for deep problems

  43. 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.

  44. 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

  45. 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?

  46. The End Questions?

More Related