
Lagrangian Fluid Dynamics Using Smoothed Particle Hydrodynamics Micky Kelager [email protected] January 9, 2006 DIKU Department of Computer Science • University of Copenhagen Universitetsparken 1 • DK-2100 Copenhagen • Denmark Abstract Computational fluid dynamics is a hot topic in Computer Graphics. The capability to reproduce realistic fluids numerically has gained an increased interest the last decade. Grid-based methods have been favored the most to solve the mathematical equations for fluid flow, but often they lack the ability to create interactive fluid simulations together with detailed fluid surfaces. Interactive fluid dynamics is of essential interest in real-time applications, such as computer games or virtual surgery simulators. Using the smoothed particle hydrodynamics (SPH) method, we have implemented a stable particle-based approach to solve the motion of interactive fluids. With focus on the simulation part we provide a thorough insight of the mathematical theory of particle-based fluids. Detailed real-time results are obtained for small-scale fluid simulations of water and viscous mucus, but the interactivity is sacrificed when near-incompressibility is enforced. ii Contents 1 Introduction.......................................................................................1 1.1 Software Solutions .....................................................................1 1.2 Goals............................................................................................3 1.3 Overview......................................................................................3 2 Classical Fluid Dynamics..................................................................4 2.1 The Navier-Stokes Equations.....................................................4 2.2 Eulerian Fluids ............................................................................6 2.3 Summery .....................................................................................7 3 Smoothed Particle Hydrodynamics .................................................8 3.1 Definitions ...................................................................................8 3.2 Smoothing Kernels .................................................................. 11 3.3 Summery .................................................................................. 13 4 Lagrangian Fluid Dynamics........................................................... 14 4.1 Mass-Density............................................................................ 16 4.2 Internal Forces......................................................................... 17 4.2.1 Pressure ........................................................................... 17 4.2.2 Viscosity............................................................................ 20 4.3 External Forces ........................................................................ 23 4.3.1 Gravity............................................................................... 23 4.3.2 Buoyancy .......................................................................... 23 4.3.3 Surface Tension............................................................... 24 4.3.4 User Interaction ............................................................... 26 4.4 Collision Handling.................................................................... 26 4.4.1 Collision Detection........................................................... 27 4.4.2 Implicit Primitives ............................................................ 28 4.4.3 Collision Response .......................................................... 32 4.4.4 Discussion........................................................................ 34 4.5 Numerical Time Integration .................................................... 36 4.5.1 The Implicit Euler Scheme .............................................. 36 4.5.2 The Verlet Scheme .......................................................... 36 4.5.3 The Leap-Frog Scheme.................................................... 37 4.5.4 Discussion........................................................................ 38 4.6 Summery .................................................................................. 38 5 Implementation.............................................................................. 40 5.1 Fast Nearest Neighbor Search ............................................... 41 5.1.1 Spatial Hashing................................................................ 41 iii 5.1.2 Spatial Particle Queries................................................... 42 5.2 Incompressibility...................................................................... 43 5.2.1 Discussion........................................................................ 44 5.3 Physical Parameters................................................................ 45 5.3.1 Fluid Volume and Particle Mass ..................................... 45 5.3.2 Smoothing Kernel Support Radius................................. 45 5.3.3 Time Integrator and Time Step ....................................... 47 5.3.4 Gas Stiffness and Rest Density ...................................... 47 5.3.5 Viscosity Coefficient......................................................... 48 5.3.6 Surface Tension and Threshold...................................... 49 5.4 Fluid Materials ......................................................................... 50 5.4.1 Water ................................................................................ 50 5.4.2 Mucus............................................................................... 51 5.4.3 Steam ............................................................................... 51 5.5 Rendering................................................................................. 52 5.6 The Lagrangian Fluid Method................................................. 53 5.6.1 Initialize SPH System....................................................... 53 5.6.2 Compute Density and Pressure...................................... 54 5.6.3 Compute Internal Forces................................................. 54 5.6.4 Compute External Forces................................................ 54 5.6.5 Time Integration and Collision Handling ........................ 55 5.6.6 Render Particles .............................................................. 55 5.7 Discussion................................................................................ 55 5.8 Summery .................................................................................. 57 6 Results............................................................................................ 59 6.1 Fluid Properties........................................................................ 59 6.2 Fluid Flows ............................................................................... 63 6.3 Sanity and Stability.................................................................. 68 6.4 Performance Tests .................................................................. 71 6.5 Issues and Challenges ............................................................ 73 7 Future Work ................................................................................... 77 7.1 GPU Utilization ......................................................................... 77 7.2 Fluid Visualization.................................................................... 77 7.3 Incompressible Lagrangian Fluids.......................................... 78 7.4 Advanced Fluid Interactions ................................................... 78 8 Conclusion...................................................................................... 79 8.1 Contributions............................................................................ 80 References............................................................................................. 81 iv Preface This is a graduate project in computer science at DIKU, the Department of Computer Science, University of Copenhagen. The project caters for people interested in a detailed particle-based description of a numerical solution to interactive fluid simulations. This report is written by Micky Kelager, DIKU. Supervisor is assistant professor Kenny Erleben, DIKU. Contributions Based on the previous work done in the field of particle-based fluid simulations, this project contributes a thorough insight of the mathematical theory of particle-based fluid motion, physically correct fluid parameters, stable collision handling between fluid particles and implicit primitives, visual analysis of fluid flows using SPH in Computer Graphics, and a complete open-source implementation of particle-based fluids. Prerequisites The reader is assumed to have passed the undergraduate studies in computer science or equivalent, and to possess knowledge in linear algebra and calculus corresponding to the undergraduate courses in mathematics. A basic knowledge in classical mechanics is also assumed, i.e. the physical laws of motion, and an interest in physics-based animation will do no harm. Acknowledgements Personally, I wish to thank my girlfriend for accepting and supporting the endless hours I have spent in front of my computer completing this project. Thanks to Theo Engell-Nielsen for reviewing this work and for providing useful comments and suggestions. Also thanks to Henrik Dohlmann for following up on the standard appliances of the implementation in OpenTissue. Finally, huge thanks to my supervisor, Kenny
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages88 Page
-
File Size-