ebook img

Fluid Simulation for Computer Graphics, Second Edition PDF

269 Pages·2015·9.099 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Fluid Simulation for Computer Graphics, Second Edition

S E C O N D E D I T I O N Fluid Simulation f o r Computer Graphics SECOND EDITION Fluid Simulation f o r Computer Graphics Robert Bridson Boca Raton London New York CRC Press is an imprint of the Taylor & Francis Group, an informa business AN A K PETERS BOOK CRC Press Taylor & Francis Group 6000 Broken Sound Parkway NW, Suite 300 Boca Raton, FL 33487-2742 © 2016 by Taylor & Francis Group, LLC CRC Press is an imprint of Taylor & Francis Group, an Informa business No claim to original U.S. Government works Version Date: 20150810 International Standard Book Number-13: 978-1-4822-3284-4 (eBook - PDF) This book contains information obtained from authentic and highly regarded sources. Reason- able efforts have been made to publish reliable data and information, but the author and publisher cannot assume responsibility for the validity of all materials or the consequences of their use. The authors and publishers have attempted to trace the copyright holders of all material reproduced in this publication and apologize to copyright holders if permission to publish in this form has not been obtained. If any copyright material has not been acknowledged please write and let us know so we may rectify in any future reprint. Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying, microfilming, and recording, or in any information storage or retrieval system, without written permission from the publishers. For permission to photocopy or use material electronically from this work, please access www. copyright.com (http://www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400. CCC is a not-for-profit organiza- tion that provides licenses and registration for a variety of users. For organizations that have been granted a photocopy license by the CCC, a separate system of payment has been arranged. Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for identification and explanation without intent to infringe. Visit the Taylor & Francis Web site at http://www.taylorandfrancis.com and the CRC Press Web site at http://www.crcpress.com [For my wife, Rowena.] Contents I The Basics 1 1 The Equations of Fluids 3 1.1 Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2 The Momentum Equation . . . . . . . . . . . . . . . . . . 4 1.3 Lagrangianand Eulerian Viewpoints . . . . . . . . . . . . 7 1.4 Incompressibility . . . . . . . . . . . . . . . . . . . . . . . 11 1.5 Dropping Viscosity . . . . . . . . . . . . . . . . . . . . . . 13 1.6 Boundary Conditions . . . . . . . . . . . . . . . . . . . . . 13 2 Overview of Numerical Simulation 17 2.1 Splitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 2.2 Splitting the Fluid Equations . . . . . . . . . . . . . . . . 19 2.3 Time Steps . . . . . . . . . . . . . . . . . . . . . . . . . . 20 2.4 Grids. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2.5 Dynamic Sparse Grids . . . . . . . . . . . . . . . . . . . . 25 2.6 Two Dimensional Simulations . . . . . . . . . . . . . . . . 27 3 Advection Algorithms 29 3.1 Semi-LagrangianAdvection . . . . . . . . . . . . . . . . . 29 3.2 Boundary Conditions . . . . . . . . . . . . . . . . . . . . . 33 3.3 Time Step Size . . . . . . . . . . . . . . . . . . . . . . . . 34 3.4 Diffusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 3.5 Reducing Numerical Diffusion . . . . . . . . . . . . . . . . 39 4 Level Set Geometry 43 4.1 Signed Distance . . . . . . . . . . . . . . . . . . . . . . . . 44 4.2 Discretizing Signed Distance Functions . . . . . . . . . . . 47 4.3 Computing Signed Distance . . . . . . . . . . . . . . . . . 49 4.4 Recomputing Signed Distance . . . . . . . . . . . . . . . . 54 4.5 Operations on Level Sets. . . . . . . . . . . . . . . . . . . 55 4.6 Contouring . . . . . . . . . . . . . . . . . . . . . . . . . . 59 4.7 Limitations of Level Sets . . . . . . . . . . . . . . . . . . . 64 4.8 Extrapolating Data . . . . . . . . . . . . . . . . . . . . . . 64 vii viii CONTENTS 5 Making Fluids Incompressible 67 5.1 The Discrete Pressure Gradient . . . . . . . . . . . . . . . 68 5.2 The Discrete Divergence . . . . . . . . . . . . . . . . . . . 72 5.3 The Pressure Equations . . . . . . . . . . . . . . . . . . . 74 5.4 Projection . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 5.5 More Accurate Curved Boundaries . . . . . . . . . . . . . 91 5.6 The Compatibility Condition . . . . . . . . . . . . . . . . 96 6 Smoke 99 6.1 Temperature and Smoke Concentration . . . . . . . . . . 99 6.2 Buoyancy . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 6.3 Variable Density Solves . . . . . . . . . . . . . . . . . . . 103 6.4 Divergence Control . . . . . . . . . . . . . . . . . . . . . . 105 7 Particle Methods 107 7.1 Advection Troubles on Grids . . . . . . . . . . . . . . . . 107 7.2 Particle Advection . . . . . . . . . . . . . . . . . . . . . . 109 7.3 Transferring Particles to the Grid . . . . . . . . . . . . . . 111 7.4 Particle Seeding. . . . . . . . . . . . . . . . . . . . . . . . 114 7.5 Diffusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 7.6 Particle-in-CellMethods . . . . . . . . . . . . . . . . . . . 116 II More Types of Fluids 121 8 Water 123 8.1 Marker Particles and Voxels . . . . . . . . . . . . . . . . . 123 8.2 More Accurate Pressure Solves . . . . . . . . . . . . . . . 127 8.3 Topology Change and Wall Separation . . . . . . . . . . . 129 8.4 Volume Control . . . . . . . . . . . . . . . . . . . . . . . . 130 8.5 Surface Tension . . . . . . . . . . . . . . . . . . . . . . . . 131 9 Fire 133 9.1 Thin Flames . . . . . . . . . . . . . . . . . . . . . . . . . 134 9.2 Volumetric Combustion . . . . . . . . . . . . . . . . . . . 137 10 Viscous Fluids 139 10.1 Stress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 10.2 Applying Stress . . . . . . . . . . . . . . . . . . . . . . . . 141 10.3 Strain Rate and Newtonian Fluids . . . . . . . . . . . . . 142 10.4 Boundary Conditions . . . . . . . . . . . . . . . . . . . . . 147 10.5 Implementation . . . . . . . . . . . . . . . . . . . . . . . . 148 CONTENTS ix III More Algorithms 161 11 Turbulence 163 11.1 Vorticity . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 11.2 Vorticity Confinement . . . . . . . . . . . . . . . . . . . . 167 11.3 Procedural Turbulence . . . . . . . . . . . . . . . . . . . . 168 11.4 Simulating Sub-Grid Turbulence . . . . . . . . . . . . . . 172 12 Shallow Water 175 12.1 Deriving the Shallow Water Equations . . . . . . . . . . . 176 12.2 The Wave Equation . . . . . . . . . . . . . . . . . . . . . 180 12.3 Discretization . . . . . . . . . . . . . . . . . . . . . . . . . 182 13 Ocean Modeling 185 13.1 Potential Flow . . . . . . . . . . . . . . . . . . . . . . . . 185 13.2 Simplifying Potential Flow for the Ocean . . . . . . . . . 188 13.3 Evaluating the Height Field Solution . . . . . . . . . . . . 193 13.4 Unsimplifying the Model . . . . . . . . . . . . . . . . . . . 195 13.5 Wave Parameters . . . . . . . . . . . . . . . . . . . . . . . 198 13.6 Eliminating Periodicity. . . . . . . . . . . . . . . . . . . . 199 14 Vortex Methods 201 14.1 Velocity from Vorticity . . . . . . . . . . . . . . . . . . . . 202 14.2 Biot-Savart and Streamfunctions . . . . . . . . . . . . . . 206 14.3 Vortex Particles. . . . . . . . . . . . . . . . . . . . . . . . 207 15 Coupling Fluids and Solids 217 15.1 One-Way Coupling . . . . . . . . . . . . . . . . . . . . . . 217 15.2 Weak Coupling . . . . . . . . . . . . . . . . . . . . . . . . 219 15.3 The Immersed Boundary Method . . . . . . . . . . . . . . 222 15.4 General Sparse Matrices . . . . . . . . . . . . . . . . . . . 223 15.5 Strong Coupling . . . . . . . . . . . . . . . . . . . . . . . 225 A Background 231 A.1 Vector Calculus . . . . . . . . . . . . . . . . . . . . . . . . 231 A.2 Numerical Methods . . . . . . . . . . . . . . . . . . . . . . 239 B Derivations 243 B.1 The Incompressible Euler Equations . . . . . . . . . . . . 243 Bibliography 247 Index 257

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.