Boldface is used to represent vector quantities, such as velocity, u. In equations, italics are used for variables that represent scalar quantities, such as pressure, p. We use consistent mathematical notation throughout the chapter. We mention a few of these at the end of the chapter, and we provide pointers to further reading about them. There are many extensions to these basic techniques. Also, we do not simulate free surface boundaries between fluids, such as the interface between sloshing water and air. We restrict ourselves to simulation of a continuous volume of fluid on a two-dimensional rectangular domain. The scope of the simulation concepts that we can cover here is necessarily limited. This chapter cannot teach you everything about fluid dynamics. Because our simulation grids are stored in textures, this speed and parallelism is just what we need. They are also optimized to perform multiple texture lookups per cycle. GPUs achieve high performance through parallelism: they are capable of processing multiple vertices and pixels simultaneously. Programmable GPUs are optimized for performing computations on pixels, which we can consider to be a grid of cells. The simulation we describe is performed on a grid of cells. However, while Stam's simulations used a CPU implementation, we choose to implement ours on graphics hardware because GPUs are well suited to the type of computations required by fluid simulation. The techniques we describe are based on the "stable fluids" method of Stam 1999. If you have ever implemented any sort of physical simulation, such as projectile motion or rigid body dynamics, many of the concepts we use will be familiar. Also, experience with finite difference approximations of derivatives is useful. An understanding of vector calculus principles is helpful, but not required (we will review what we need). The reader is expected to have at least a college-level calculus background, including a basic grasp of differential equations. Wherever possible, we provide clear explanations and draw connections between the math and its implementation. As a result, this chapter contains many potentially daunting equations. For this reason, we did not skimp on the mathematics here. Without understanding the basic physics and mathematics of fluids, using and extending the algorithms we present would be very difficult. Fluid dynamics is such a useful component of more complex simulations that treating it as a black box would be a mistake. Our goal is to assist you in learning a powerful tool, not just to teach you a new trick. Using an NVIDIA GeForce FX, we have achieved a speedup of up to six times over an equivalent CPU simulation. Because of the large amount of parallelism in graphics hardware, the simulation we describe runs significantly faster on the GPU than on the CPU. Figure 38-1 shows examples of fluids simulated using the source code provided with this book.įigure 38-1 Colored "Dye" Carried by a Swirling Fluidįluid simulation is a useful building block that is the basis for simulating a variety of natural phenomena. All are phenomena that we would like to portray realistically in interactive graphics applications. Underlying all of them is the flow of fluids. 38.1 Introductionįluids are everywhere: water passing between riverbanks, smoke curling from a glowing cigarette, steam rushing from a teapot, water vapor forming into clouds, and paint being mixed in a can. The source code accompanying this book demonstrates the techniques described in this chapter. After reading this chapter, you should have a basic understanding of fluid dynamics and know how to simulate fluids using the GPU. It introduces fluid dynamics and the associated mathematics, and it describes in detail the techniques to perform the simulation on the GPU. This chapter describes a method for fast, stable fluid simulation that runs entirely on the GPU. University of North Carolina at Chapel Hill Fast Fluid Dynamics Simulation on the GPU The CD content, including demos and content, is available on the web and for download.Ĭhapter 38. You can purchase a beautifully printed version of this book, and others in the series, at a 30% discount courtesy of InformIT and Addison-Wesley. This release includes significant GPU technology advancements, accurate hydrogen modeling from production to consumption, workflow, and automation improvements across the entire product line.GPU Gems GPU Gems is now available, right here, online. Pushing the envelope of performance, sustainability, and productivity for CFD simulations
0 Comments
Leave a Reply. |