AN ADAPTIVE SAMPLING APPROACH TO INCOMPRESSIBLE PARTICLE-BASED FLUID. A Dissertation WOO-SUCK HONG

Size: px
Start display at page:

Download "AN ADAPTIVE SAMPLING APPROACH TO INCOMPRESSIBLE PARTICLE-BASED FLUID. A Dissertation WOO-SUCK HONG"

Transcription

1 AN ADAPTIVE SAMPLING APPROACH TO INCOMPRESSIBLE PARTICLE-BASED FLUID A Dissertation by WOO-SUCK HONG Submitted to the Office of Graduate Studies of Texas A&M University in partial fulfillment of the requirements for the degree of DOCTOR OF PHILOSOPHY May 2009 Major Subject: Computer Science

2 AN ADAPTIVE SAMPLING APPROACH TO INCOMPRESSIBLE PARTICLE-BASED FLUID A Dissertation by WOO-SUCK HONG Submitted to the Office of Graduate Studies of Texas A&M University in partial fulfillment of the requirements for the degree of DOCTOR OF PHILOSOPHY Approved by: Co-Chairs of Committee, Committee Members, Head of Department, Donald H House John Keyser Frederic I. Parke Ricardo Gutierrez-Osuna Valerie E. Taylor May 2009 Major Subject: Computer Science

3 iii ABSTRACT An Adaptive Sampling Approach to Incompressible Particle-Based Fluid. (May 2009) Woo-suck Hong, B.S., Pukyong National University; M.S.,Pukyong National University Co Chairs of Advisory Committee: Dr. Donald H. House Dr. John Keyser I propose a particle-based technique for simulating incompressible fluid that includes adaptive refinement of particle sampling. Each particle represents a mass of fluid in its local region. Particles are split into several particles for finer sampling in regions of complex flow. In regions of smooth flow, neghboring particles can be merged. Depth below the surface and Reynolds number are exploited as our criteria for determining whether splitting or merging should take place. For the fluid dynamics calculations, I use the hybrid FLIP method, which is computationally simple and efficient. Since the fluid is incompressible, each particle has a volume proportional to its mass. A kernel function, whose effective range is based on this volume, is used for transferring and updating the particle s physical properties such as mass and velocity. In addition, the particle sampling technique is extended to a fully adaptive approach, supporting adaptive splitting and merging of fluid particles and adaptive spatial sampling for the reconstruction of the velocity and pressure fields. Particle splitting allows a detailed sampling of fluid momentum in regions of complex flow. Particle merging, in regions of smooth flow, reduces memory and computational overhead. An octree structure is used to compute inter-particle interactions and to compute the pressure field. The octree supporting field-based calculations is adapted to provide

4 iv a fine spatial reconstruction where particles are small and a coarse reconstruction where particles are large. This scheme places computational resources where they are most needed, to handle both flow and surface complexity. Thus, incompressibility can be enforced even in very small, but highly turbulent areas. Simultaneously, the level of detail is very high in these areas, allowing the direct support of tiny splashes and small-scale surface tension effects. This produces a finely detailed and realistic representation of surface motion.

5 v ACKNOWLEDGMENTS First, I would like to thank my advisor, Prof. Donald H. House. I could not have asked for a better advisor. Thanks as well to my other advisor, Prof. John Keyser, and to my committee memebers, Prof. Frederic I. Parke and Prof. Ricardo Gutierrez-Osuna. Also, thanks to Prof. CheungHun Kim, Prof. Yoonsuck Choe and Prof. Jinxiang Chai for their encouragement. Finally I would like to thank my parents and sister. My study in the US would have not been possible without their love for me.

6 vi TABLE OF CONTENTS CHAPTER Page I INTRODUCTION II SIMULATION OF WATER A. Navier-Stokes equations B. Eulerian fluid Stam s stable fluid C. Lagrangian fluid Smoothed particle hydrodynamics a. Modeling fluid forces b. Pressure c. Viscosity d. Surface tension e. Smoothing kernels Moving Particle Semi-implicit Method a. Modeling of incompressibility D. Hybrid fluid simulation Particle-in-cell and fluid-implicit-particle method E. Fluid simulation coupled with octree based structure Combination of octree Previous work Introduction to octree Representation of quadtree and octree Finding a leaf node from an arbitrary location Finding the smallest common enclosing cells by region Finding neighbors Constructing the poisson equation a. The pressure gradient b. The divergence F. Surface reconstruction Particle level set a. Reinitialization Blobbies Bridson s method

7 vii CHAPTER Page III ADAPTIVE PARTICLES A. Introduction Our contribution B. Previous works C. The adaptive fluid simulation algorithm D. Computing deformability Distance from surface Reynolds number E. Determining when to merge and split F. Splitting and merging Merging Splitting Upper and lower bounds G. Kernels and the auxiliary grid H. Results and evaluation Experimental results Evaluation IV V FULLY ADAPTIVE FLUID SIMULATION FOR INCOM- PRESSIBLE FLOW A. Introduction B. Overview of our adaptive fluid simulation C. Octree generation Relating adaptive particles and octree cells Creating the octree grid D. Splitting and merging Splitting and merging process Layers for splitting and merging E. Kernel choice and transferring particle velocity to octree grid F. Constructing the poisson equation G. Divergence H. Results and discussion Results Contrast with previous methods SURFACE TENSION WITH FULLY ADAPTIVE FLUID SIMULATION

8 viii CHAPTER Page A. Introduction B. Modeling surface tension C. Adding surface tension to fully adaptive fluid simulation. 85 D. Fluid-object interaction E. Results and comparison VI CONCLUSION/FUTURE WORK A. Future work REFERENCES VITA

9 ix LIST OF TABLES TABLE Page I Parameters used in experiments II Simulation time table for a 2D simulation similar to Figure

10 x LIST OF FIGURES FIGURE Page 1 Staggered MAC grid Types of cells A result from Successive Over Relaxation scheme Eulerian fluid simulation Smooth Particle Hydrodynamics Moving Particle Semi-implicit Method Hybrid method Quadtree data structure and its representation Quad tree and locational codes The possible neighbors of a cell Computing the pressure on a quadtree Fluid simulation and particle level set Blobbiness Fluid simulation with adaptive particle sampling Layers for Splitting and Merging Mass and volume conservation when splitting and merging particles Gaussian and tent kernel functions D simulation using Gaussian and tent kernel functions

11 xi FIGURE Page 19 Sampling of particles with small radii Fluid simulation with adaptive particle sampling D simulation for splitting and merging D simulation using merging only D simulation with splitting and merging Surface without (left) and with (right) surface smoothing Surface without (left) and with (right) surface smoothing Animation result with surface-smoothing Quadtree hybrid simulation with uniform cells Overall simulation structure The size of particles determines the size of an octree cell Relation between adaptive particles and the octree cell Layers for splitting and merging Circular kernel functions Contrast with Previous Methods.(Comparison of Normal simulation, Adaptive Particle and Fully Adaptive Simulation) D Fully Adaptive Fluid simulation D fluid simulation using adaptive particles and an octree grid Non realistic splash effect without surface tension Curvature in concave region and convex region Surface tension in Fully Adaptive Fluid Simulation Interaction between fluid particles and an object

12 xii FIGURE Page 40 Comparison of different surface tension parameters D fluid simulation without (left) and with (right) surface tension Image sequence of 3D surface tension test

13 1 CHAPTER I INTRODUCTION In the simulation of incompressible fluid, one is faced with two phenomena that seem to demand quite different simulation methodologies. One dominant factor in fluid flow is that moving fluid is transporting real material, and thus the properties of the fluid are being transported (advected) with this material. This seems to call for a Lagrangian or particle-based simulation scheme, which naturally tracks the motion of discrete chunks of fluid mass, and thus provides a vehicle for handling advection in a straightforward way. The other dominant factor in fluid flow is that it is shaped largely by pressure gradients. Unlike advection, pressure is a massless field property that is poorly represented by moving particles, but quite naturally represented by an Eulerian or spatial-grid scheme. The usual way to handle advection within an Eulerian simulation is by backtracing, as in the semi-lagrangian method [34], but this approach is well known to lead to considerable dissipation of flow complexity. It is possible to approximate the pressure effects in compressible flow using the metaphor of interparticle spring forces. However, this method is poorly suited to handling water flow, which is essentially incompressible, yielding an unnatural looking bouncy water surface. Another important factor in fluid representation is that, within a flow, some regions will be highly complex while others are quite smooth. Similarly, for rendering purposes, having a detailed and convincing representation of the moving surface geometry may be considerably more important than having high detail below the surface. Thus, within a simulation, the ability to refine or coarsen the representation This dissertation follows the style of The Visual Computer.

14 2 can be quite useful, regardless of whether an Eulerian or a Lagrangian computational methodology is used. To capture the complex flow and fine geometric detail at the surface, finer grid spacing or particle sampling can be used, while regions of smooth flow permit coarsening of grid or particle representations without loss of detail, saving computation time and space. Finally, if the simulation level of detail is to be very fine, a representation of surface tension becomes important. This is especially true when it is desired to represent spray and splashes. A particle-based scheme naturally accounts for fine spray, but will not directly support the representation of surface tension, which is needed for the simulation of small water drops. Again, there is a need for both a particle-based representation of the material of the fluid, and a grid-based representation of the small-scale fluid surface. Our work attempts to find a suitable simulation framework that exploits the right methodologies for the various stages of the simulation, while maintaining a representation that is appropriately adapted to the required simulation granularity. For our approach, we have developed an adaptive version of the hybrid Flip method [37], which is essentially particle-based, but augmented by a computational grid for speeding the calculation of inter-particle interactions and for computing the pressure field. To make the approach adaptive, we have implemented a particle splitting and merging scheme using both depth from the surface and flow complexity to determine when particles should be split or merged. We use an octree spatial data structure to represent the computational grid, with octree cell size determined at each time step by the particle sampling in the neighborhood of the cell. Thus, the method is essentially particle based, with particle advection providing the transport mechanism in the fluid, and the pressure, inter-particle interaction and surface geometry being calculated on an octree whose resolution is locally determined by the particles. The main contribution of this work is to demonstrate how to support a fully

15 3 adaptive simulation of both particle and grid-based components for incompressible fluids. As part of this, we present a new method for determining spatial grid resolution based on adaptive particle sizes, and coupling this grid with the particles. We also present improvements to particle splitting and merging. Our approach allows us to have the resolution needed to incorporate surface tension effects into an adaptive particle-based simulation, and we present a new method for computing these forces.

16 4 CHAPTER II A. Navier-Stokes equations SIMULATION OF WATER We first brefly review vector calculus before describing the Navier-Stokes equations. The nabla operator is a vector differential operator. In a two-dimensional space it take the form: Its discrete form is: p = ( p x, p y ) (2.1) p i+1,j p i 1,j 2δx, p i,j+1 p i,j 1 2δy (2.2) The divergence, denoted by u is an operator that measures the magnitude of a vector field s source at a given point. It is defined as follows: u = u x + v y (2.3) Its discretization is : u i+1,j u i 1,j 2δx + v i,j+1 v i,j 1 2δy (2.4) The Laplace operator is a second order differential operator which is defined as the divergence of the gradient. In two dimensions it has the form: Its discretization is: 2 p = p = 2 p x p y 2 (2.5) p i+1,j 2p i,j + p i 1,j (δx) 2 + p i,j+1 2p i,j + p i,j 1 (δy) 2 (2.6)

17 5 Fluid simulations typically attempt to reproduce the effects of the Navier-Stokes equations that describe fluid flow. A typical representation of the incompressible form of these equations, after some simplification, is: u t = f (u )u 1 ρ p + ν 2 u (2.7) u = 0 (2.8) where u is the velocity field, p is the pressure field, f represents the sum of all external forces, ρ is a density measure, and ν is kinematic viscosity. The first equation is derived from Newton s Second Law, which states that momentum is always conserved and accounts for pressure gradients, diffusion, and external forces such as gravity. The (u )u term accounts for advection of the fluid, and the ν 2 u term accounts for velocity diffusion due to the fluid s viscosity. The second equation ensures that the fluid is divergence free, and thus incompressible. B. Eulerian fluid Eulerian fluid simulations generally solve the Navier-Stokes equations over a fixed spatial grid. Most Eulerian fluid simulations in Computer Graphics are based on Harlow and Welch s original marker and cell (MAC) method [17] which was originally developed for the computational fluid dynamics community. Later, Foster and Metaxas [13] were the first in the computer graphics community to achieve full 3D liquid simulation based on the Navier-Stokes equations for incompressible flow. Their method is based largely on the work of Harlow and Welch [17]. A staggered MAC grid is used in this method to compute the physical properties such as the pressure and velocity fields. As shown in Figure 1, the scalar quantities such as pressure are set to the cell center,

18 6 Fig. 1. Staggered MAC grid and vector quantities such as velocity are located at the face of each cell. We can obtain a more accurate approximation for the gradient of the velocity field using a staggered MAC grid rather than a cell-centered method in which all physical properties are positioned at the center of cell. Massless marker particles are generated to represent the fluid, but have no effect on its motion. Also, marker particles play an important role in determining which cells are on the surface of the fluid. If solid or barrier cells are marked, then fluid cell types, such as air (containing no particles), surface (containing particles, and adjacent to an air cell), and full (containing particles and not adjacent to air cells) cells can be recognized by marker particles at each step as shown in Figure 2. Cells with no particles are marked as an air cells. If a cell contains particles and the adjacent cell is an air cell with no particles, it is marked as a surface cell. Otherwise, all remaining cells containing particles are considered fluid cells. The Navier-Stokes equations are integrated explicitly by a forward finite difference approximation to obtain accurate fluid motion for advection and viscosity. We

19 7 Fig. 2. Types of cells need to consider the Courant-Friedrichs-Lewy condition (CFL condition) [7] for simulation stability, which is a condition for convergence while solving certain partial differential equations. Unfortunately, it strictly restricts the relationship between cell size and simulation time step to be 1 > max[u δt, v δt, w δt ] where u,v,w are velocities δx δy δz in the x,y,z directions; δt δx, δt δy, δt δz directions. Thus, u δt δt δt,v,w δx δy δz are ratios of the time step to the cell size in the x,y,z are dimensionless quantities which must be less than 1 to assure that fluid cannot cross more than one cell in one time step. This means that the performance of a simulation will be significantly slower (i.e. will require a smaller time step) at a high spatial resolution. In order to conserve mass, the new pressure field must be determined in each time step and the mass conservation equation u = 0 must be satisfied as well. Positive divergence represents an influx into a cell, meaning that the cell pressure is being increased, while negative divergence represents an outflow from the cell, meaning that the cell pressure is being decreased. Figure 3 shows a specific example of this. The cell marked in red has a fluid influx, and the figure shows that the pressure is

20 8 increased to and the pressure in the left cell is decreased to This is propagated throughout the overall grid. Fig. 3. A result from Successive Over Relaxation scheme In work by Foster and Metaxas [13], Successive Over Relaxation (SOR) was used to enforce incompressiblility, but this method usually has poor convergence and needs many iterations. Three cases of boundary conditions need to be set on the free surface so that the Navier-Stokes equations can be used to find the velocity for fluid cells. Thus, boundary conditions are needed for the velocity on the empty cells near the surface. First, if a cell is surrounded by three fluid cells, the velocity on the remaining face of the cell is set to v i,j+1 = v i,j ( δy δx )(u i+1,j u i,j ). Second, if the cell has two sides labeled as cells, the velocity of each side equals that of the opposite side. Third, if the cell has one side that is air, the velocity of the open side equals that of the opposite side while the remaining two sides do not change. In most cases, this

21 9 procedure seems to work well, however the solution is not unique when more than one face of a cell needs to be updated and the cell has two or three sides of air cells. Later, an extrapolation method [11] was proposed, allowing higher order accuracy and more visually pleasing results for the implicit surface. The boundary condition velocity can be computed similar to the reintialization step of the level set method [28]. Once the signed distance field is constructed away from the surface, the fluid velocity field can be extrapolated using φ u = 0, where u is the extrapolated velocity and φ is a field quantity representing signed distance from the level set. This can be created using the fast marching method [32]. 1. Stam s stable fluid The stable fluid method, introduced by Stam [34], uses a semi Lagrangian scheme for advection as well as a projection method to ensure unconditional stability and divergence-free flow. As mentioned in the previous section, Foster and Metaxas s simulation [13] has difficulties in producing a stable fluid using large timesteps due to the forward finite differencing approach. This method requires many iterations for the SOR method to converge to a solution that enforces incompressibility. The stable fluid method can be considered as an alternative which resolves the above difficulties. The method is outlined as follows, where the w s are the velocity field after successive refinement steps: w 0 (x) add force w 1 (x) advect w 2 (x) diffuse w 3 (x) project w 4 (x) (2.9) The solution is given by the last velocity field w 4. The step is iterated every time step for the duration of simulation. First, the external force f is added using Euler

22 10 integration in order to create a good approximation of the force effect: w 1 = w 0 + tf (2.10) In order to solve the advection step, Stam introduces a technique called the semi- Lagrangian scheme. This step satisfies the (u )u term in the momentum equation: w 2 = transport(w 1, t) (2.11) Euler integration is used to integrate backwards through the velocity field, determining where it would have been at t - t. The velocity at the original position is sampled at the backtraced position from the velocity field. The maximum value of the new field is never larger than the maximum value of the previous field, which result in an unconditionally stable solver. The third step accounts for the effect of viscosity forces: w 2 t = ν 2 w 2. (2.12) An implicit integration scheme is used to ensure stability rather than an explicit Euler method, because high stiffness and large time steps lead to an unstable simulation: (I ν t 2 )w 3 = w 2. (2.13) When the equation is discretized, it leads to a matrix form which can be inverted using a sparse linear system for the unknown field w 3. The fourth step is used to guarantee a divegence free-velocity field: w 4 = w 3 t ρ p = w 3 q (2.14) The main idea is to use Helmholtz-Hodge Decompostion, which states that the velocity field can be decomposed into a divergence-free field and the gradient of a scalar field

23 11 q: 2 q = w 3 (2.15) In this case, the scalar field q is proportional to the pressure. The equation produces a sparse diagonal matrix and is solved by a Poisson solver using a bi-conjugate gradient method, which is more accurate and faster that a solution via SOR. Once the pressure is determined, the divergence-free velocity field can be easily computed. Figure 4 is a frame from an animation of a fluid surface computed using the approach outlined above. The fluid surface is obtained using the particle level set approach [10]. Fig. 4. Eulerian fluid simulation

24 12 C. Lagrangian fluid Particles are the fundamental momentum-carrying simulation element in Lagrangian simulations. The most popular Lagrangian fluid simulation method is the Smooth Particle Hydrodynamics (SPH) Method [25]. In SPH, the fluid is composed of a set of particles, with inter-particle forces such as pressure and viscosity computed at the position of each particle. Desbrun and Cani-Gasculel [8] introduced SPH into computer graphics to simulate highly deformable substances such as lava flow. Müller et al. [27] extended the SPH approach for interactive fluid simulation, and introduced a new technique for complex behaviors, such as air-water interaction, boiling water, and trapped air. In a recent paper, Adams et al. [2] have proposed an improved adaptive method for SPH compressible fluid simulation. Though aspects of this paper are similar to ours, we emphasize that our approach handles incompressible fluid, and is in fact the first adaptive particle method to do so. Premoze [29] introduced Koshizuka s original work [22] on the Moving-Particle Semi-Implicit Method (MPS) to simulate incompressible liquid and multifluid flow. Unlike SPH, MPS handles incompressible fluid. However, the approach is slow, tends towards instability, and is not adaptive. Clavet [6] also extended the formulation of SPH by using a method called Double Density Relaxation for enforcing incompressibility and to oppose clustering. Several small-scale simulations of substances such as mud and paint were created realistically with surface tension using springs between particles. 1. Smoothed particle hydrodynamics In SPH, the fluid is sampled by a set of particles. A particle is a sample point where field quantities of the fluid are defined locally. A particle carries physical quantities

25 13 such as mass, density, velocity and pressure in its local area. Such field quantities and their derivatives can be interpolated at particle radius r by a weighted sum of contributions. f(r) = j m j f j ρ j W h (r r j ) (2.16) where f j denotes the field quantity at particle j, m j is the mass of particle, r j is its position, ρ j is the density and W j is a smoothing kernel determining the local support for f. In order to simulate a fluid, derivatives of field quantities such as pressure or velocity are needed. The following equation is used in order to evaluate the gradient of f: f(r) = j m j f j ρ j W h (r r j ) (2.17) The Laplacian of f is as follows: 2 f(r) = j m j f j ρ j 2 W h (r r j ) (2.18) Theses equations are the basis of the SPH simulation. Using the above equations, density in the location of a particle can be evaluated as: ρ(r) = j m j W h (r r j ) (2.19) a. Modeling fluid forces First, we consider the Navier-Stokes equations in terms of a Lagrangian fluid model: ρ( v t + v v) = p + ρg + µ 2 v (2.20) The term v v of the left side is not necessary in Lagrangian fluid simulation since the particle has its own physical properties, such as velocity, and it moves with fluid.

26 14 Thus, the rest of terms in right side of the equation, pressure p, external forces ρ, and viscosity µ 2 v are all the terms that we need to consider. b. Pressure We model the pressure force, a factor which causes a change in momentum as follows, p = j m j p j ρ j W h (r r j ) (2.21) Müller [27] pointed out that the equation leads to non-symmetric forces, since the gradient of the kernel is zero and the particle j is only used for particle i to compute its pressure force. He proposed that the symmetric pressure force can be computed using the arithmetic mean of the pressure among the interacting particles. p = j m j p i + p j 2ρ j W h (r r j ) (2.22) c. Viscosity Viscosity can be considered a force of friction resisting the relative motion between the surface of two objects. This force can be modeled using the average of the velocities at the particle positions as follows: µ 2 v = µ j m j v j ρ j 2 W h (r r j ) (2.23) This equation also produces an asymmetric viscosity force. The following equation was proposed by Müller [27] in order to compute the symmetric force. µ 2 v = µ j m j v j v ρ j 2 W h (r r j ) (2.24) In the equation, the particle i is accelerated by the average of the velocity differences. If the fluid in the position of a particle is flowing faster, and the fluid in a neighboring

27 15 position of the particle is flowing slower, the velocity in the particle position is adjusted in the direction of the relative speed. d. Surface tension Surface tension is a phenomenon caused by cohesive forces between liquid molecules. The force acting on the surface of a liquid tends to minimize the area of the surface. Its strength depends on the forces of attraction among the particles. For example, surface tension results in spherical drops of liquid, as the liquid tends to minimize its surface area. In order to compute surface tension, we need an additional distance field as follows: C s = j m j 1 ρ j W h (r r j ) (2.25) The gradient of the color field n = c S and the normalized scalar field δ s = n are used to compute the surface normal field. The Laplacian of the color field represents the curvature of the surface κ = 2 c s. The surface tension force is evaluated using: n σκn = σ 2 c s n n (2.26) e. Smoothing kernels Each particle has its own area of influence that is weighted by a kernel. The choice of kernel is very important in particle based simulation since the performance of the simulation, as well as its accuracy and stability depend on it. The kernel function is used to determine the contribution that the particle has on other nearby particles. Müller [27] used the following three smoothing kernels: w h poly6 = πh 9 (h2 r 2 ) (2.27)

28 16 w h spiky = 15 πh 6 (h r)3 (2.28) w viscosity h = 15 r3 ( 2πh3 2h + r2 3 h + h 1) (2.29) 2 2r The kernels are mainly used to compute the density, pressure force, and viscosity force for the duration of the simulation. The kernel poly6 is used for sampling the density at each particle location, but if it is used for the computation of pressure force, particles tend to cluster, or overlap, since the repulsive force vanishes when two particles are very close to each other, producing a high pressure region. Desbrun [8] used a spiky function to resolve the problem, since its gradient vanishes around the center of a particle. The viscosity kernel is used for computing the viscosity force, whose Laplacian is positive and produces the correct effect for smoothing the velocity field. Figure 5 shows two images from a sequence of images from an SPH simulation of pouring water into a cup. The particles are colored blue before colliding with the wall and are colored green afterward. 2. Moving Particle Semi-implicit Method Premoze [29] introduced Koshizuka s original work [22] on the Moving-Particle Semi- Implicit Method (MPS) to simulate incompressible liquid and multifluid flow. Unlike SPH, MPS handles incompressible fluid. However, the approach is slow and tends towards instability. For an incompressible fluid, the fluid density must be constant and the number of particles in a unit volume is approximated by the particle number density as follows: < ρ n > i = < n > i w(r)dv (2.30)

29 17 Fig. 5. Smooth Particle Hydrodynamics where w(r) is re r within the effective range of particle radius, and the particle number density is computed as < n > i = j i w( r j r i ). Later, the particle density is fixed to enforce the incompressibility. A gradient vector is defined by (φ j φ i )(r j r i )/ r j r i 2 and is evaluated using the weighted kernel between particle i and its neighbor j. The gradient of field quantities is computed as follows: < φ > i = d n 0 j i φ j φ i r j r i r w( r j r i ) (2.31)

30 18 where d represents the space dimensions. The equation is used to compute the pressure gradient in MPS. When a particle get close to its neighbor, it provides a large force, which helps to avoid clustering throughout the duration of simulation. As presented in the previous section, Desbrun [8] used a spiky function to resolve the problem, since its gradient vanished around the center of the particle in the use of poly6. However, a big pressure difference between a particle and its neighbor can lead to instability. The Laplacian of field quantities is computed as follows, < 2 φ > i = 2d (φ λn 0 j φ i )w( r j r i ) (2.32) This model of the Laplacian is used for computing the viscosity force. j i a. Modeling of incompressibility Unlike SPH, MPS handles incompressible fluid, which means that the particle number density n 0 should be a constant throughout the simulation. After computing the pressure and viscosity forces, the incompressibility of the fluid is violated. When the particle number density n is not n 0, it should be corrected to n 0 as follows: n + n = n 0 (2.33) The divergence of velocity in the particle location can be computed by the correction value n as follows: n 1 t n = 0 u (2.34) The modification velocity u is derived from the implicit pressure term: u = t ρ P n+1 (2.35)

31 19 With the above three equations, a Poisson equation for pressure is obtained: < 2 P n+1 > i = ρ t 2 < n > i n 0 n 0 (2.36) The right side of the equation is similar to the divergence of the velocity since it is represented by the deviation of the particle number density from a constant value. A linear symmetric matrix is constructed in the equation, which is sparse and symmetric and it can be solved using the conjugate gradient method. The overall steps of MPS algorithm are as follows: Apply forces to particles and find temporary particle positions and velocities u, r using Euler forward integration r i = r n i + u i Solve pressure Poisson equation using Conjugate Gradient method. 2 P n+1 = ρ <n > i n 0 t 2 n 0 Calculate the modification of velocity u and find new particle position(u i n+1, r i n+1, P i n+1 ) The above steps are iterated throughout the duration of the simulation. When a symmetric matrix is constructed for solving the pressure Poisson equation, the surface particles can be considered with n i < βn 0, where β is a parameter below 1.0. Figure 6 shows a single frame from an animation that we obtained using the Moving Particle Semi-implicit Method. The surface particles are represented in blue and the remaining particles are shown in green. The figure shows an example of a splashing effect. D. Hybrid fluid simulation First, we need to go over the strengths and weaknesses of the grid-based and particlebased methods before describing the Hybrid method. In the grid-based method, each cell size is much larger than the size of a particle in the particle-based simulation.

32 20 Fig. 6. Moving Particle Semi-implicit Method The discretization and solution of the incompressibility condition is resolved in a unit cell and very simply compared to the corresponding step of a particle-based simulation such as MPS [29]. In MPS, the size of the linear symmetric matrix for solving the Poisson equation for pressure is n 2, where n is the number of particles in the simulation. Even if only eight particles are used in a tentative unit cell for a 3D simulation, the size of the matrix will be significantly increased, causing the simulation to be very slow. This is because the projection step dominates the overall computation time. The grid-based method has difficulties in fluid advection, which is conducted using the Semi-Lagrangian method. The Semi-Lagrangian method allows us to take large time steps, but suffers from excessive numerical dissipation due to the accumulated interpolation error. Mass dissipation in a liquid simulation can cause critical problems in terms of the visual effect, since it dampens out interesting flow

33 21 features. Thus, the time step still needs to be limited by a CFL condition [7] for the liquid simulation. On the other hand, in particle-based simulations, particles are the fundamental representation of fluid in the simulation and have their own physical properties such as mass, velocity, and density. Therefore, they let particles flow for themselves through the velocity field using forward Euler integration with excellent accuracy. The accuracy in the advection step allows the simulation to capture interesting flow features, but it has difficulty solving the incompressibility condition as presented above. 1. Particle-in-cell and fluid-implicit-particle method Zhu and Bridson [37] introduced the hybrid fluid simulation approaches called Particlein-Cell (PIC) [17], and Fluid-Implicit-Particle (FLIP) [5] to computer graphics in a paper simulating sand flow. Both approaches are fundamentally particle-based, as particles carry the momentum of the fluid, but a MAC grid is used for efficient computation of the spatial interactions required to compute diffusion and guarantee incompressibility. Using this auxiliary grid, incompressibility and boundary conditions can be enforced much more efficiently than in a pure Lagrangian scheme like MPS. In both PIC and FLIP, mass particles have their own velocity and position, which are integrated numerically using velocity updates obtained from the grid. Since the methods are Lagrangian, the velocity backtracing step of the semi-lagrangian method can be avoided, greatly reducing numerical dissipation and loss of flow detail. Kim and Ihm [21] adapted these approaches to water animation, demonstrating realistic turbulent splashing without volume loss. The overall steps of the hybrid simulation are as follows, Construct an auxiliary MAC grid around the particles.

34 22 Use the particle velocities to reconstruct a velocity field on the MAC grid. Integrate accelerations due to body forces such as gravity and other external forces. Integrate accelerations due to diffusion. Calculate the pressure field, and project the flow field onto the nearest divergence free field. Transfer velocity changes in the flow field back onto the particles. Advect each particle with its velocity through the flow field. Figure 7 shows an example obtained using the standard hybrid simulation approach. The particles are drawn as black dots, and the grid cells are drawn in red. E. Fluid simulation coupled with octree based structure 1. Combination of octree Losasso and Fedkiw [24] proposed a technique which simulates water and smoke on an octree-based data structure using refinement and coarsening. The proposed technique shows how the poisson equation can be discretized on the Octree grid and allows us to use fast solution methods such as the conjugate gradient method with preconditioning. A cell is subdivided into more grid cells in regions of complex flow, such as at a nearby surface. This subdivision is performed from the larger cells to smaller cells. In regions of smooth flow, coarsening is performed from smaller cells to larger cells, which means that neighboring leaves are merged into a larger node and the resulting node values are deleted or unchanged in the octree structure. The authors were able to reduce the total simulation time to approximately 25 percent of

35 23 Fig. 7. Hybrid method the original, and the finer sampling enabled them to capture fine detail of the flow in smoke and water. However, octree method [24] suffers from numerical dissipation due to repeated averaging and interpolation. The dissipation can be reduced in [16] using FLIP [37]. Inspired by their approach, I propose a fully adaptive technique which couples our adaptive particle approach with the Octree structure. It will be described in the next chapter. In this chapter, the detail algorithms are presented in order to apply an octree for fluid simulation.

36 24 2. Previous work A number of authors have looked at adaptive methods for simulating fluid. Within the Eulerian simulation community, Losasso et al. [24] promoted the use of an adaptive octree data structure, instead of a fixed grid, to achieve high surface resolution in complex flows. More recently, Irving et al. [20] used a simpler idea, simply to coarsen cells with distance from the surface. In Lagrangian methods, early work by Desbrun and Cani-Gasculel [9] looked at splitting and merging particles in an SPH simulation to sample the fluid adaptively. Most recently, Adams et al. [2] have proposed an improved adaptive method for SPH compressible fluid simulation, and Hong et al. [19] demonstrated adaptive particle sampling within an incompressible framework. 3. Introduction to octree Quadtrees and Octrees are tree data structures which are often used in computer graphics. They can be used to partition a region of space into 4 or 8 quadrants or octants. When a cell (i.e., a leaf node) contains an object boundary, the cell is subdivided into smaller cells, which enables us to save more of memory compared to methods that partition space uniformly when an object is represented in a region of space. The hierarchical tree structure is composed of a root node, intermediate nodes, and leaf nodes. Each node has a pointer to its own parent and children. There are three important traversal operations such as point location, region location and neighbor searches for querying and managing information. Each node s pointers are used for traversing the tree when these operations are performed. In this section, I will focus on efficient methods for performing these operations through a survey of the previous octree papers [31], [26] and [3].

37 25 4. Representation of quadtree and octree Quadtrees and octrees are a hierarchical tree data structures which branch from a root node to a leaf cell when traversing the tree. Each node has a pointer to its parent node and four child nodes, for a quadtree, or eight child nodes for an octree. A quadtree representation is assumed in this section. Figures 8 and 9 illustrate a quadtree data structure, where each node is labeled by its location code. Figure 8 shows the tree structure, and Figure 9 shows the corresponding spatial breakdown. The depth of the quadtree is set to n levels before generating. The level of the root node is set to: ROOT LEV EL = n 1, which is one less than the maximum depth of the tree. The level of the smallest size node is set to 0. As shown in Figure 9, the quadtree is defined over [0, 1] [0, 1] (an arbitrarily sized space can be represented by simply prescaling). Each node has a location code, which is used as a search key to locate a cell. The location code is represented in a binary encoding form in which each bit corresponds to the branching pattern of the corresponding level in a tree. Figure 9 assumes that the quadtree has 6 levels and the level of the root is 5 (i.e., ROOT LEV EL = 6 1). In order to determine the location code for each cell, the location of the cell s left is multiplied by 2 ROOT LEV EL. For example, the cell [0.375, 0.5] has a location code ( = 12 = ). In the case of a quadtree or an octree, the location code should be computed for each dimension. 5. Finding a leaf node from an arbitrary location It is important to find the corresponding node in the octree from any arbitrary location. First, the coordinate values in a location are converted into locational codes by multiplying each coordinate value by 2 ROOT LEV EL. The resulting products are truncated to integers. Finally, the integers are represented in binary form. For

38 26 Fig. 8. Quadtree data structure and its representation the example in Figures 8 and 9, the root level is 5, we multiply all values by 2 5 = 32, or 6 binary digits. An arbitrary location at (0.44,0.32) is converted into binary (trunc( ))= for x, binary (trunc( ))= for y. This branching pattern of the locational code is used to traverse the tree from the root node to a leaf node, which is the desired cell that we are looking for. 6. Finding the smallest common enclosing cells by region [26] and [3] present a method for finding the smallest possible enclosing cells. We use a method similar to [26], which determines the size of the smallest possible enclosing cells using an XOR operation, with left and right locational codes and top and bottom locational codes in a quadtree. For example, the region [0.38,0.45] for the x direction has left and right locational codes of and An XOR operation with the two locational codes yields and the smallest enclosing cell is found at level 2 because the first 1 bit is encountered at the 5th possible bit from the left. As a special case, let us see the following example in which the region [0.31,0.65] for the x direction has left and right locational codes as and The XOR

39 27 Fig. 9. Quad tree and locational codes operation with the two locational codes yields The smallest possible enclosing cell is located at level 5 but the enclosing cell for the region is the root cell because the first 1 bit is the second bit from the left, meaning that the smallest common cell enclosing the location is not exactly matched with the cell. 7. Finding neighbors Neighbor information is important when discretizing the Poisson equation when using an octree grid. This discritization requires exact information from the right, left, top, bottom, up and down neighbors in order to accurately compute pressure. As shown in Figure 10, the number of neighbors in each direction can be more than a single cell since the octree includes different sized cells as leaf nodes. In order to determine the neighbors of a given cell, we note that the bit patterns of the locational codes of two neighboring cells differ by the binary distance between the two cells. The left boundary of every right neighbor of a cell is offset from

40 28 Fig. 10. The possible neighbors of a cell the cell s left boundary. Thus, the x location code of every right neighbor can be determined by adding the binary form of the cell s size to the cell s x location code. For left neighbors, it can be found by locating the smallest possible left neighbor by subtracting the current cell s x location code from binary 1 and then traversing downwards from the smallest possible ancestor until the leaf node is reached. Using the bit pattern, all leaf nodes should be reached to obtain information about neighbors in each direction in order to discretize the Poisson equation. 8. Constructing the poisson equation a. The pressure gradient First, we derive the generalized form for discretizing the Poisson equation in terms of a two dimensional quad tree. The Laplacian of the pressure is defined at cell ij as 2 p ij = p i+1,j p i,j x 0 p i,j p i 1,j x 1 x 2 + p i,j+1 p i,j y 0 p i,j p i,j 1 y 1 y 2, (2.37)

41 29 where x 0 is the distance between p i+1,j and p i,j in the x direction, x 1 is the distance between p i,j and p i 1,j in the x direction, y 0 is the distance between p i,j+1 and p i,j in the y direction and y 1 is the distance between p i,j and p i,j 1 in the y direction. This can be rewritten as, ( x 2 y 2 ) 2 p = (p i+1,j p i,j ) y 2 x 0 (p i,j p i 1,j ) y 2 x 1 + (p i,j+1 p i,j ) x 2 y 0 (p i,j p i,j 1 ) y 2 y 1. (2.38) As equation 2.38 shows, we need the pressure of the neighbor cells in order to construct the Laplacian used in the Poisson equation. Only four neighbors are considered on a MAC grid which is composed of uniform size cells but more than four neighbors may be needed on a quadtree based structure. For Figure 11, the cell enclosing p 4 is connected to five cells. We must consider three cases for discretizing the Poisson equation on this quadtree grid. In the first case, the size of the current cell is the same as the size of the neighbor. In the second case, the size of the current cell is bigger than the size of the neighbors, meaning that the current cell has several neighbors. In the third case, the size of the current cell is smaller than the size of the neighbors meaning that there is only one neighbor. The standard pressure gradient formulation is used when the cells are the same size. We have to concern ourselves with the gradient of pressure between smaller neighbors and the current cell and the gradient of pressure between a bigger neighbor and the current cell. We first consider the gradient of pressure p 4 with its smaller neighbors. According to [24], p x is approximated as (p 52 p a )/(.75 x) since the distance between p 4 and p 52 is perturbed by a small amount proportional to the size of a cell, making p a = p 4 to avoid the dependency of p a yielding a convergent approximation. The denominator (.75 x) is

42 30 also approximated to the size of a large cell. Fig. 11. Computing the pressure on a quadtree In Figure 11, the equation of the pressure gradient for p 4 with its neighbor s pressure using this approximation is: ( x y) 2 p 4 = x (p 2 50 p 4 ) + x x (p 2 52 p 4 ) x x(p 7 p 4 ) y + x(p 3 p 4 ) + x + x(p 1 p 4 ) y. (2.39) The denominators are set to the size of the larger cell between the current cell and its neighbors. The numerators are set to the size of the smaller cells. When the current cell is larger than its neighbors, we can use the same method to approximate the pressure gradient, yielding ( x/2)( y/2) 2 p 50 = ( y/2)(p 51 p 50 ) x/2 ( y/2)(p 4 p 50 ) x +

43 31 ( x/2)(p 52 p 50 ) y/2 + ( x/2)(p 2 p 50 ) y. (2.40) The denominators are set to the size of the larger cell between the current cell and its neighbor and the numerators are set to the size of the smaller cell in equation The generalized form for all three cases is A area 2 p = j ( p j p i n)l size, (2.41) where A area is the area of the current cell which is x y, j, the index of neighbors, n is the outward unit normal for the current cell, is the size of the large cell, and L size is the size of the current cell. The generalized form for a 3-dimensional octree is V cell 2 p = j ( p j p i n)a area, (2.42) where V cell is the volume of the current cell, j the index of neighbors, n is the outward unit normal of the current cell, is the size of the large cell and A size is the face area of the current cell. b. The divergence The divergence of velocity in 2-dimensional uniform sized cells is ( x y)( u) ij = y(u i+1,j u i,j ) + x(v i+1,j v i,j ). (2.43) Following the same logic that was used for the pressure gradient in octree cells, the generalized form for the divergence term is

44 32 V cell u = j (u j u i ) na area (2.44) where A area is the area of a cell face, n is the outward unit normal of the current cell and V cell is the volume of the cell in the fluid simulation based on the octree. Once the equation for divergence and pressure gradient are computed in all fluid cells, the linear system representing the finite difference approximation to the Poission equation 2 p = u can be constructed. An efficient iterative method such as preconditioned conjugate gradients can be applied to solve the system. F. Surface reconstruction In this section, we review several methods for surface reconstruction, which are used for Eulerian and Lagrangian fluid model. 1. Particle level set The level set method is a tool for representing an evolving fluid surface. The zero level set of a signed distance field φ represents the fluid surface. Negative values of φ are considered fluid and positive values considered air: where φ t φ t + u φ = 0, (2.45) is a temporal partial derivative in the time variable t, u is the given fluid velocity at time t and φ denotes the vector of spatial derivatives of φ. Once fluid velocity is updated at each time step by a solver, this equation is integrated by using the updated velocity. The first order Eulerian advection method, e.g. Upwind scheme can be applied in order to discretize the spatial terms u φ in the equation,

45 33 which is extended for high-order spatial accuracy by using Hamilton-Jacobi (W)ENO method(a high order accurate Eulerian advection method) [28]. Also, the forward Euler method can be extended to a higher-order temporal discretization such as TVD Runge-Kutta method [28] in time, which is a high order time-integration method. The standard Eulerian advection algorithm provides enough accuracy for tracking the interface, but it is strictly restricted by a stability-based CFL criterion [7], which causes the simulation to be significantly slowed. Enright et al. [10] proposed a particle level set method which exploits the combination of a Grid based semi-lagrangian advection method and a characteristic-based particle method. A semi-lagrangian method is not limited by a stability-based CFL condition but it suffers from a large amount of numerical dissipation. Massless marker particles near the interface are used to correct errors caused by back-tracing φ values for the duration of the simulation. Massless marker particles are placed in a thin layer inside and outside of the zero level set. Particles placed below the surface (φ < 0) carry a negative sign and particles outside of the surface (φ > 0) carry a positive sign. A band of thickness ±6 max( x, y) is fine on each side of the interface. The particles are integrated forward in time using the fluid velocity with a second order accurate midpoint rule. The level set function is then advected with a semi-lagrangian method. Finally the particles are used to correct any errors in the function. When particles appear on the wrong side of the interface (a negative particle in the φ > 0 or a positive particle in the φ < 0) by a distance more than its radius, it is said to be have escaped. In this case, the level set function is corrected as follows, φ p (x) = s p (r p x x p ), (2.46) where x is a sampling point on the computational grid, x p is the Particle position and s p is the sign of the particle. For error correction, the minimum magnitude for the

46 34 grid sample is used to replace the existing level set value. Overall steps for using the particle level methods are as follows: Evolve the marker particles and level set function in time. Correct errors in the level set function using particles. Reinitialize φ using the fast marching method. Correct errors in the level set function using particles. Adjust the particle radii using the following rule: r p = r max s p if s p φ(x p ) > r max if r min s p φ(x p ) r max r min if s p φ(x p ) r min (2.47) a. Reinitialization Once the level set function is updated, the signed distance field may no longer be accurate. Reinitialization of the level set function is necessary to recover the signed distance field, which is important for visualizing fluid and extending the velocity field outward from the interface. There are two approaches for solving the Eikonal equation [36] for reinitialization. One approach is to move the zero isocontour in the normal direction at times equal to the distance from the interface. In this approach, many iterations are necessary until a steady state is reached. The other approach is a discrete algorithm that mimics the crossing-time approach to update the signed distance field one grid point at a time. This is known as the Fast Marching Method [32]

47 35 which needs to solve the Eikonal equation [36] to construct a signed distance field. When marching out, each grid point is updated with the appropriate value of signed distance. The final minimization is computed over all quadrants. Three conditions are considered to solve the quadratic equation. First, there is one neighboring point which is not equal to in the spatial dimension. In this case, two of the three terms can vanish since the current grid point is chosen as the minimum as follows: ( φ i,j,k φ 1 ) 2 = 1 (2.48) x The larger term φ s + x s is chosen when marching out in the normal direction to construct the positive distance function. When there are two nonzero terms, the equation is: ( φ i,j,k φ 1 x i ) 2 + ( φ i,j,k φ 2 x j ) 2 = 1 (2.49) If P (max{φ 1, φ 2 }) > 1, then the larger φ is ignored and we proceed with ( φ i,j,k φ s ) 2 = 1. Otherwise, the above quadratic equation is solved and the larger x one is used as the solution. When there are three nonzero terms, it follows the same way, after checking if P (max{φ s }) is greater than 1 or not. The equation in this case is: ( φ i,j,k φ 1 x i ) 2 + ( φ i,j,k φ 2 x j ) 2 + ( φ i,j,k φ 3 x k ) 2 = 1 (2.50) The time complexity of the FMM is of order O(N log N), where N is the number of grid points and log N is the height of the tree for the heapsort algorithm. The method was originally proposed by Tsitsiklis. FMM is generally considered a fast method but the extra memory assignment is necessary for heapsorting and it is not simple to implement. There is one more iterative algorithm for solving the Eikonal equation [36], called

48 36 Fig. 12. Fluid simulation and particle level set the fast sweeping method [36]. The main idea of the fast sweeping method is to use the Godunov upwind differencing scheme [28], as we did in FMM, and Gauss-Seidel iteration with alternating sweeping. First, check the neighbors in the current grid point that have the closest distance from the surface. If the closest distance is smaller than the distance of the current grid point, update the distance. We sweep the whole domain with four alternating orderings(in two dimensions)as follows, (1)i = 1 : I, j = 1 : J, (2)i = I : 1, j = 1 : J, (3)i = I : 1, j = J : 1, (4)i = 1 : I, j = J : 1. (2.51) A finite number of iterations is needed to reach a steady state and the complexity of the algorithm is O(N), where N is the number of grid points. It is extremely simple to implement and fast compared to the Fast Marching method. Figure 12 shows a 2D example of surface extraction using a particle level set, for a fluid simulation. The

49 37 top row shows the extracted surface. The bottom row shows the particles inside the surface in blue, and outside the surface in red. 2. Blobbies The basic concept of blobbies is introduced in this section. Blinn proposed the idea of blobbies in his early work [4]. Blobbies model electron density maps of molecular structures, and thus are well suited to surface reconstruction from particles. For these reasons, it is used as a basic mathematical model for constructing surfaces in Lagrangian fluid simulations. The electron in an atom can be represented as a density function in Quantum mechanics as D(x, y, z) = exp( ar) (2.52) where r is a distance between the spatial location and a hydrogen atom, and a is the standard deviation. Polynomial density functions can be used as an alternate definition of density functions, even though Blinn used a Gaussian distribution. When it is applied to a large number of atoms, the density function can be represented by summing the contribution from each atom as follows: D(x, y, z) = i D i (x, y, z) (2.53) A surface can be chosen by a threshold T as follows, S = {(x, y, z) D(x, y, z) = T } (2.54) The electron densities are greater than T inside the surface and less than T outside the surface. The resulting surface of this model is naturally blobby. Figure 13 shows our result for blobbies.

50 38 Fig. 13. Blobbiness 3. Bridson s method More recently, Bridson et al [37] proposed a smoothing technique which uses a moving average. In order to construct a signed distance field from particles, he used the following equations: φ(x) = x x r (2.55) x = i w i x i (2.56) r = i w i r i (2.57)

51 39 w i = k( x x i /R) j k( x x j /R) (2.58) where k(s) = max(0, (1 s 2 ) 3 ), x i and r i are the position and radius of particle i, and R is the radius of the neighborhood. Unfortunately, his model produces spurious blobs due to the moving average in concave areas and can remove small detailed features near the surface. Another method similar to this is found in [Adams07].

52 40 CHAPTER III ADAPTIVE PARTICLES 1 A. Introduction It is well known that the complexity of the flow of fluids, especially water, differs depending upon the region of the flow. For example, in large bodies of water, surface flow is generally much more complex than the flow deep below the surface. This concept has been used in Eulerian fluid simulation when developing schemes for grid refinement for detailed behavior and coarsening for efficiency, as in [20]. In a Lagrangian fluid simulation, refinement and coarsening can be done by merging and splitting the particles representing the mass of the fluid. For example, within a Smoothed Particle Hydrodynamics (SPH) simulation, Desbrun and Cani [9] used simplification and refinement of particles to animate soft bodies such as lava. Particle size adaptation is attractive as a simulation mechanism, since particles provide an efficient means for capturing the small-scale detailed behavior near the surface of a fluid. Even simulations based on an Eulerian grid typically use particles to restore surface detail lost due to smoothing [11]. In Figure 14, we show examples from an adaptive particle-based fluid simulation, where very fine details of the surface are visible, while in the deep areas, particle merging has been used to avoid oversampling and lend efficiency to the simulation. Although the idea is attractive, it has, to date, only been reported for compressible fluid simulation. 1 Reprinted with permission from Adaptive particles for incompressible fluid simulation by Woosuck Hong. Donald H. House and John Keyser, The Visual Computer, Volume 24, ,Copyright[2008] by Springer Berlin / Heidelberg

53 41 Fig. 14. Fluid simulation with adaptive particle sampling 1. Our contribution We propose an efficient incompressible Lagrangian fluid simulation method utilizing splitting and merging of particles to adaptively sample the evolving fluid motion. The approach uses the hybrid FLIP method [37]. This is an extension to the original work of Desbrun [9], and more recently Adams et al. [2], in which refinement and simplification were performed for compressible flows based on the SPH approach. The fact that we model incompressible flow makes our method much more suitable than SPH for simulating water. Water is well known to be nearly incompressible, and this fact contributes greatly to its visible behavior. For example, water being poured into a cylindrical glass would maintain an average height proportional to the volume of fluid in the glass. On the other hand, the height of the surface of a compressible fluid would exhibit damped periodic oscillations, giving it an unnatural springy look. To confirm this, one can compare animations in support of the incompressible Particle Level Set Method [11], and those in support of the compressible SPH method [27].

54 42 In order to determine the level of particle sampling needed in a region of fluid, we quantify what we call the deformability [9] of each region of the fluid and then base particle splitting and merging on this measure. Our method for finding the deformability of a fluid region considers both depth or distance from the surface, and the local Reynolds number [30]. Depth is determined by constructing a signed distance field from the fluid interface as determined by particle positions. The local Reynolds number is estimated on the computational grid, using a ratio of terms from the Navier Stokes equations. The use of both depth and Reynolds number to obtain a deformability measure allows us to provide the necessary detail to represent both surface shape and complex turbulent flow below the surface, while avoiding over computation in areas where the flow is smooth. Splitting is done in highly deformable areas, and merging in areas of low deformation. With merging, we do not need to assign particles to every grid cell, since the effective radius of a particle can be bigger than the cell width, thus we do not need to worry about occasional gaps in the flow of fluid. Significant memory and computing time savings come from reducing the number of particles in the simulation. We have been able to reduce the number of particles by more than 80% of the number that would have to be used without merging, while producing results that are visually indistinguishable. Likewise, the speed of the simulation is improved significantly. By using multiple particle sizes, we can also better decouple the size of the auxiliary grid from the size of the particles themselves. The auxiliary grid can be used in the computation of external forces (such as finding curvature and normal vectors when computing surface tension). By supporting multiple particle sizes, we can allow for better computation of these external forces without extra computational cost.

55 43 B. Previous works Eulerian fluid simulations generally solve the Navier-Stokes equation over a grid. Foster and Metaxas [14] were the first in the computer graphics community to achieve full 3D liquid simulation based on the Navier-Stokes equations for incompressible flow. Their simulation method was based on Harlow and Welch s original Marker and Cell (MAC) method [17]. They used a fixed finite-difference grid for computing partial spatial derivatives, an explicit integration scheme for advection and diffusion, a relaxation method for incompressibility, and massless marker particles for surface representation. Stam[34] made significant improvements on the stability of this approach using a semi-lagrangian scheme to handle velocity advection, implicit integration to handle diffusion, and a Poisson solver for computation of pressure to achieve divergence free flow. Foster and Fedkiw [12] and Enright et al. [11][10] extended Stam s method to handle the fluid-air interface using level set methods augmented by marker particles. In addition to the above work, several extensions have been attempted to the basic Eulerian method. Greenwood and House [15] simulated fluid with the visual effect of bubbles, Song [33] attempted to reduce the numerical diffusion and dissipation caused by the semi-lagrangian method by adopting a constrained interpolation profile-based advection scheme. Hong and Kim [18] developed a numerical method to resolve the discontinuities of the interface between two fluids by using the interpolated pressure field and velocity gradient. Particles are the fundamental momentum-carrying simulation element in Lagrangian simulations. In SPH [25], the fluid is composed of a set of particles, with inter-particle forces such as pressure and viscosity computed at the position of a particle by a smoothing kernel. Desbrun and Cani-Gasculel [8] introduced SPH to

56 44 computer graphics to simulate highly deformable substances such as lava flow. In [9] refinement of particles by splitting and merging allowed sampling the fluid adaptively. The basic concept of the adaptive sampling scheme for Lagrangian fluid corresponds to Geoffrey s idea [20] who used refinement near the interface for detailed representation and coarsening of fluid cells away from the interface for efficiency in Eulerian fluid. Müller et al. [27] extended the SPH approach for interactive fluid simulation, and introduced a new technique for complex behaviors, such as air-water interaction, boiling water, and trapped air. In a recent paper, Adams et al. [2] have proposed an improved adaptive method for SPH compressible fluid simulation. Though aspects of this paper are similar to ours, we emphasize that our approach handles incompressible fluid, and is in fact the first adaptive particle method to do so. Premoze [29] introduced Koshizuka s original work [22] on the Moving-Particle Semi-Implicit Method (MPS) to simulate incompressible liquid and multifluid flow. Unlike SPH, MPS handles incompressible fluid. However, the approach is slow, tends towards instability, and is not adaptive. Clavet [6] also extended the formulation of SPH by using a method called double Density Relaxation for enforcing incompressibility and to oppose clustering. Several small-scale simulations of substances such as mud and paint were created realistically with surface tension using springs between particles. Zhu and Bridson [37] introduced the hybrid fluid simulation approaches called Particle-in-cell (PIC) [17], and Fluid-Implicit-Particle (FLIP) [5] to computer graphics, in a paper simulating sand flow. Both approaches are fundamentally particlebased, as particles carry the momentum of the fluid, but a MAC grid is used for the efficient computation of the spatial interactions required to compute diffusion and to guarantee incompressibility. Using this auxiliary grid, incompressibility and boundary conditions can be enforced much more efficiently than in a pure Lagrangian

57 45 scheme like MPS. In both PIC and FLIP, mass particles have their own velocity and position, which are integrated numerically using velocity updates obtained from the grid. Since the methods are Lagrangian, the velocity backtracing step of the semi- Lagrangian method can be avoided, greatly reducing numerical dissipation and loss of flow detail. Kim and Ihm [21] adapted these approaches to water animation, demonstrating realistic turbulent splashing without volume loss. C. The adaptive fluid simulation algorithm Our fluid simulation is based on the FLIP method, where particle velocities are transferred to a staggered Marker-and-Cell (MAC) grid, body and diffusion forces are applied, the divergence free property of incompressible fluid is enforced by solving a Poisson equation to obtain a pressure field, and velocities are corrected based on the gradient of the pressure field. The resulting velocity changes are transferred to the fluid mass particles and their positions are integrated through the velocity field. An auxiliary grid is recreated at each time step, serving a computational role only in reconstructing the flow field from the particles. This allows us to avoid costly interparticle interaction calculations, and provides a more natural field representation for computing pressure. We have augmented this approach to support merging and splitting of particles. Our overall scheme thus becomes: Construct an auxiliary MAC grid around the particles. Use the particle velocities to reconstruct a velocity field on the MAC grid. Integrate accelerations due to body forces such as gravity and other external forces.

58 46 Integrate accelerations due to diffusion. Calculate the pressure field, and project the flow field onto the nearest divergence free field. Transfer velocity changes in the flow field back onto the particles. Compute a fluid deformability measure based on depth and Reynolds number. Split or merge the particles based on the local deformability measure. Convect each particle with its velocity through the flow field. When particle velocity is transferred to the auxiliary grid, the weight of a particle s effect is determined by using a spherical kernel function whose volume is proportional to the mass of fluid represented by the particle. D. Computing deformability Splitting and merging are adaptively performed based on what we call the fluid s local deformability. In a local region, our deformability measure is based both on depth from the surface, and on the Reynolds number. Since the Reynolds number is the ratio of convection to diffusion, our method requires the fluid to have non-zero viscosity. 1. Distance from surface Intuitively speaking, the highly deformable area in a fluid is mainly near the surface, i.e. the interface with another fluid. Areas away from this interface tend to have smoother flow and are thus less deformable. Further, we wish to be able to reconstruct a smooth surface for rendering, and so we want to be sure to sample finely near

59 47 the surface. Therefore, we use distance from the surface as our basic criterion for deformability. We compute an implicit representation of the fluid surface directly from the particles, and then use the Fast Sweeping Method [36], which is O(n) in time to construct a signed distance field. This is more easily implemented and faster than the Fast Marching Method [1], which is O(n log n). Then, the distance from the surface can be computed anywhere inside the fluid using trilinear interpolation. 2. Reynolds number In 1883, Osborne Reynolds defined the terms laminar and turbulent flow to describe his experimental results with fluid motion [30]. He proposed the use of a number Re, which is the ratio of inertial forces to viscous forces. This number has come to be known as the Reynolds Number. In fluid mechanics, the Reynolds number can be used to identify highly deformable areas of fluid. It is given by Re = υ sl ν = Inertialforces V icousf orces (3.1) where υ s is the mean fluid velocity, L is the characteristic length, and υ is the kinematic fluid viscosity. It is known that the flow rate of turbulence is proportional to the square root of the pressure gradient. That is, high deformation occurs when a high pressure gradient is present, since this will cause high accelerations. We can estimate the square root of the pressure gradient by computing a gradient from the convection term of the Navier-Stokes equation via differencing on the associated grid. We estimate a deformability factor roughly proportional to Re, Df = (u )u ν 2 u (3.2) by taking a ratio of the convection term and the diffusion term of the Navier Stokes equation 2.7.

60 48 E. Determining when to merge and split To determine where it is appropriate to merge and split particles, we divide our simulation domain into a set of layers, based on the distance to the surface. The basic process is illustrated in Figure 15. The number and placement of these layers is somewhat arbitrary; we want to choose layers that allow detailed simulation (small particles) where needed, and less detail (large particles) where acceptable. Numerous possible schemes could be developed relying on the distance from surface and deformability factor. We describe here a four-layer approach that has proven effective in practice. Note that in all cases, we must set some minimum and maximum bounds to limit the amount of splitting or merging allowed. Splitting must be limited in order to avoid excessive memory space and noise. Merging must be limited in order to avoid excessive smoothing of particle motion. Fig. 15. Layers for Splitting and Merging Figure 15 shows the four layers into which we divide the fluid. These layers represent distance from the fluid surface, which is not necessarily the same as depth.

61 49 Layer A represents the region closest to the fluid/air interface. We desire the highest resolution in this region, and as a result, we want to use particles of the minimum volume possible. Any particles that enter this region are immediately split to the minimum allowable particle size. This ensures that there is always a highly detailed representation of the surface. In Layer B, all particles are of a nominal, or standard size, which is larger than that in layer A. When smaller particles move into layer B, merging will be performed, and when larger particles move into this area, splitting will be performed. Layer C and Layer D allow both splitting and merging, based on the deformability measure. The choice of whether to split or merge in these regions is based solely on the deformability factor. Particles are split in higher deformability factor regions and are merged in lower deformability factor regions. Note that instead of layers, one could also easily define an approach where the deformability factor thresholds for merging and splitting are a continuous function of distance from the surface. F. Splitting and merging Figure 16 shows particle splitting on the left, and particle merging on the right. This process must preserve mass, which, for a constant density incompressible fluid, is equivalent to conserving volume, as indicated by the V labels on the figure. One stage of particle splitting splits a single particle into two particles, each of half the volume of the original particle. Particles within some sphere of radius r are merged into a single particle whose volume is the sum of the original particles. Momentum is conserved using different approaches for merging and splitting.

62 50 Fig. 16. Mass and volume conservation when splitting and merging particles 1. Merging When merging a group of particles, the new particle is placed at the center of gravity of the original particles. The mass, radius, position and velocity of a newly created particle i from neighbor particles are given by m i = j m j, r i = 3 rj 3, x i = j j V j x j j V j, u i = j V j u j j V j. (3.3) 2. Splitting Contrary to merging, splitting of a particle is performed by generating a new set of n particles within the radius of the parent particle. We currently use n = 2 but this is arbitrary. Particle mass is distributed evenly among the child particles, and the velocities are simply copied from the original particle, thus conserving momentum. The mass, radius, and velocity of each new particle j, generated by splitting particle i, are given by m j = m i n, r j = 3 r 3 i n, u j = u i (3.4) There are multiple reasonable ways to determine position x j of the new particles. We choose to place it randomly at a position within the radius of the original particle, using spherical coordinates.

63 51 3. Upper and lower bounds Note that bounds on minimum and maximum size can be set per particle. These maximum and minimum bounds can be set layer by layer (or change continuously) if desired. In practice, we adjust these by layer. We limit the maximum size of a merged particle so that its radius should not extend beyond the fluid/air interface. A smaller maximum volume is set near the surface, and a larger maximum volume is used in the deep areas of the fluid. The maximum volume is interpreted as an upper limit, beyond which no more merging will occur. We also limit the minimum size of the particles, so that there is not excessive splitting. This minimum volume limit is interpreted as a bound for which no particles will ever be split if it would result in a particle lower than that bound. Note that these limits restrict the splitting and merging process, rather than the sizes of the particles themselves directly. For example, a small particle (below the minimum radius) might enter a region, and be unable to merge with any other particle without exceeding the maximum value. In this case, the smaller particle would remain. Likewise, a particle that exceeds the maximum might enter a region and be unable to split, since splitting might reduce it below the minimum bound. In our implementation, for example, both of these can occur in layer B. G. Kernels and the auxiliary grid When the particle velocities must be reconstructed in the auxiliary grid, a kernel function is used around each particle to determine its contribution to a grid point. Each particle is given a radius that determines the volume of fluid it represents. Each cell point that is within a particle s radius is affected by that particle by an amount determined by distance and the kernel function shape. We have tested two kernel

64 52 Fig. 17. Gaussian and tent kernel functions Fig D simulation using Gaussian and tent kernel functions functions, Gaussian and tent. Illustrations of these two kernel functions are given in Figure 18. We tested the Gaussian kernel over a circular region, and the tent kernel over a square region, as indicated as shown in Figure 17. For computational efficiency, we prefer the tent kernel function, which is implemented by trilinear interpolation. This simplification does not produce a noticeable effect on the simulation accuracy. Our 2D simulations for Gaussian and tent kernels are shown in Figure 18 The size of the auxiliary grid can be set independently of the size of the particles themselves. In practice, we usually use a grid cell spacing equal to the nominal particle radius of layer B. We will call the grid cell width d g.

65 53 To determine velocity values on the grid, we use different schemes depending on the radii of the nearby particles. If the particle radii are generally greater than or equal to d g (as is generally the case in layers B through D in our implementation), each sample point on the grid will potentially be affected by multiple particles. In this case, we simply weight the contribution of each particle at the sample point by the value of the kernel function: u cell = i W i (x cell ; r i )u i i W i (x cell ; r i ), (3.5) where the W j for particle i is defined either radially: W i (x; r) = K( x x i ; r), (3.6) or trilinearly: W i (x; r) = K((x x i ) x; r)k((x x i ) y; r)k((x x i ) z; r). (3.7) Note that K(d; r) is the value of the kernel function of radius r at distance d. As shown in Figure 19, when particle radii are near to or smaller than d g, the sample point(red dot) might not lie within the volume of any particle(pink dots), and thus the weighted average described above is not applicable. To avoid such cases, for each sample point we check whether there is a particle with radius less than d g, within a distance of d g (in each dimension). If there are such particles, we determine the velocity by taking a volume-weighted average of all such cells, using a d g radius kernel function for each: u cell = i V i W i (x cell ; d g )u i i V i W i (x cell ; d g ), (3.8)

66 54 Fig. 19. Sampling of particles with small radii where V i is the volume of particle i. H. Results and evaluation 1. Experimental results We have implemented the above process to simulate in both 2 and 3 dimensions. Note that the 2D simulation requires slightly different but straightforward reformulation of some of the listed equations. Examples from some 2D simulations are shown in Figure 20. Table I lists the parameters used in our experiments, including the distance of each layer from the surface, relative to the radius of the standard particles in layer B, the deformability factor values used to determine when splitting and/or merging occur, and the minimum and maximum bounds to use when splitting and merging. For each layer, columns give the distance from surface range (upper and lower bound), the deformability factors above which splitting occurs and below which merging occurs, and the minimum and maximum particle radii (relative to the nom-

67 55 Fig. 20. Fluid simulation with adaptive particle sampling inal size) for splitting and merging. The auxiliary grid was set with grid cell size d g equal to the nominal radius of particles in layer B. For all calculations, constants typical of water were used. These are are kinematic viscosity ν = m 2 /s, with density ρ = 1000 kg/m 3. The 2 dimensional water simulation shown in Figure Table I. Parameters used in experiments Layer Lower Upper Df Df Split Merge Bound Bound Split Merge Min Max A B C D was sampled with 3,545 particles on an auxiliary grid. Green, blue and red particles are used for split, standard (radius 1) and merged particles. Splitting and merging were performed based on our algorithm for finding the deformable area.

68 56 Fig D simulation for splitting and merging The total number of particles was reduced by as much as 61% (to 1,372 particles) by merging during the simulation. The split particles near the interface still support a highly detailed surface representation as shown in the figure. The image sequence shown in Figure 22 demonstrates a three-dimensional water simulation that uses only merging, originally sampled with 87,965 particles and an auxiliary grid. For the animation shown in Figure 23, we used 113,958 particles in the initial step. Splitting was performed near the surface before the simulation began, in which each particle s volume was split to the minimum size of 0.25 standard particle sizes. Splitting and merging were performed during the simulation. The number of particles was reduced to about 60 percent (69,438 particles) due to merging. Green particles are standard particles which are radius 1. Red particles are the merged particles and blue particles are the split particles with radius less than 1. The grid resolution was Table II presents running times for a sample 2D simulation as in Figure 21. Timings were the average seconds per frame over a 200

69 57 Fig D simulation using merging only frame sequence, on a Pentium GHz CPU. NA is the timing for a non-adaptive method with no merging or splitting. All particles were of the nominal size, and 1,326 particles were used. M1 presents timing when the particles were merged (but not split) as a preprocess, and no further merging (or splitting) occurred during the simulation. Only 972 particles were used. The M2 simulation starts from the same point as M1, but allows particles to merge (but not split) during the simulation, and the number of particles was eventually reduced to 776. Note that this demonstrates that our particle merging causes noticeable improvements in running time. The AS simulation presents our adaptive sampling approach, including particle splitting. With this approach, we achieve a much finer scale representation of the fluid surface, at a cost of only about 10% more than the original running time with no splitting or merging. In order to

70 58 Fig D simulation with splitting and merging produce a visually plausible fluid surface, surface reconstruction process is required. In our approach, particles are the fundamental representation in our hybrid method, and must be used to determine the location of the fluid surface. This guarantees that the fluid surface interface will be maintained at the full available level of detail, and then there will be no loss in the volume of the fluid. Also, the adaptive approach allows us to capture the small detail features through split particles. Thus, the following Table II. Simulation time table for a 2D simulation similar to Figure 21 NA M1 M2 AS Simulation time(sec.)

71 59 equation is proposed: i V i W i (x; r i )(1 x x i φ(x) = r i ) 2 i V i W i (x; r i ) 1 2, (3.9) where V and W are the particle volume and kernel function, and x,x i and r i are the sampling point, neighboring particle location and its radius. φ(x) is computed from the particles on an auxiliary grid of the desired surface resolution and then the final value is normalized by the summation of density. We use the combination of a root and square in order to produce a particle-defined surface that gives more contribution to particles closer to the surface, while reducing bumpy artifacts. The surface interface is simply the zero level set of this function. Once the surface cell is detected, a signed distance field is easily constructed by fast sweeping, which is exploited for detecting the deformable area in the next step of simulation. The Marching Cubes Method [23] is exploited to extract a polygonal isosurface for high quality rendering. Once the signed distance field is constructed, bump artifacts are reduced by averaging the neighboring vertices and the normal vector of their vertices of the resulting mesh. In order to accelerate the smoothing operation, k-d tree algorithm is used for searching the neighbors. we found that three or four iterations are sufficient for smoothing. Excessive iterations of smoothing lead to elimination of important small detailed features but eliminating the smoothing operation leads to a poor fluid surface with lots of bump artifacts near the surface. Figures 24 and 25 show the effect of surface smoothing in both 2D and 3D. In the 3D simulation shown in Figure 26, we rendered the surface using the marching cubes technique through our surface reconstruction method. This simulation was also performed with splitting and merging. The grid resolution for surface generation was and 623,575 particles were generated in the initial

72 60 Fig. 24. Surface without (left) and with (right) surface smoothing Fig. 25. Surface without (left) and with (right) surface smoothing step. More than 40 percent of the initial particles were eliminated due to merging. 2. Evaluation Mass particle refinement and simplification based on depth and Reynolds number give several advantages in terms of the performance of the simulation and a detailed representation of the fluid surface. In order to obtain interesting flow motion, splitting is performed near the fluid surface. Merging away from the surface reduces the

73 61 number of particles. This enables us to save considerable memory space in large scale simulations and improves the speed of the simulation significantly, while maintaining detail where it is needed. Distance from the surface is used as our basic criterion for determining whether to split or merge particles, and we use a signed distance field for computing this distance. As a complementary criterion, we have proposed a calculation based on the Reynolds number to determine deformability of areas below the surface. Particle splitting and merging are performed adaptively using these criteria. Next, we will investigate more faithful capture of the character of the smallscale detail of turbulent water, including splashes and bubbles. To do this, I will implement surface tension, using techniques similar to those of Hong [18] and Kim [21]. In addition, I will couple an octree based MAC grid approach as in Losasso et al. [24] with our adaptive particle approach, so that appropriate spatial resolution is maintained in all phases of our calculations, further improving the performance of our simulation. Our fully adaptive particle approach will be presented in the next chapter.

74 Fig. 26. Animation result with surface-smoothing 62

75 63 CHAPTER IV FULLY ADAPTIVE FLUID SIMULATION FOR INCOMPRESSIBLE FLOW A. Introduction Thus, my work in this chapter, I describe an adaptive particle-based technique for simulating incompressible fluid that uses an octree structure to compute inter-particle interactions and to compute the pressure field. As presented in the previous chapter, an efficient incompressible Lagrangian fluid simulation was proposed to utilize splitting and merging of particles to adaptively sample the evolving fluid motion. Significant memory and computing time savings came from reducing the number of particles through the merging scheme. The adaptive sampling scheme was performed only on particles using splitting and merging to capture the complex flow. It was not performed on the computational grid. The uniform-size grid was still used as an auxiliary grid in the method to enforce incompressibility and boundary conditions, which can lead to waste of memory, low performance of simulation and numerical dissipation. For an example, when particle size is near to or smaller than the size of a cell in the uniform grid, the sample point might not lie within the volume of any particle, and thus the weighted average is not applicable. If there are such particles, the fluid velocity is determined by taking a volume-weighted average with the uniform size radii in the previous method. This method may cause a serious numerical dissipation when splitting is performed several times within a cell. Also, numerical dissipation may occur when a large particle is generated through merging and occupies several uniform-size cells on the auxiliary grid. Thus, my work in this chapter attempts to find a suitable simulation framework that exploits the right methodologies for the various stages of the simulation, while

76 64 maintaining a representation that is appropriately adapted to the required simulation granularity. To make our approach fully adaptive, a particle splitting and merging scheme is exploited using both depth from the surface and flow complexity to determine when particles should be split or merged and an octree spatial data structure is used to represent the computational grid, with octree cell size determined at each time step by the particle sampling in the neighborhood of the cell. Eventually, the octree supporting field-based calculations provides a fine spatial reconstruction where particles are small and a coarse reconstruction where particles are large. This scheme places computational resources where they are most needed, to handle both flow and surface complexity. Thus, incompressibility can be enforced even in very small, but highly turbulent areas. Simultaneously, the level of detail is very high in these areas, allowing the direct support of tiny splashes and small-scale surface tension effects. If the simulation level of detail is to be very fine, a representation of surface tension becomes important. This is especially true when it is desired to represent spray and splashes. A particle-based scheme naturally accounts for fine spray, but will not directly support the representation of surface tension, which is needed for the simulation of small water drops. Again, there is a need for both a particle-based representation of the material of the fluid, and a grid-based representation of the small-scale fluid surface. Thus, the method is essentially particle based, with particle advection providing the transport mechanism in the fluid, and the pressure, inter-particle interaction and surface geometry being calculated on an octree whose resolution is locally determined by the particles. The main contribution of this work is to demonstrate how to support a fully adaptive simulation of both particle and grid-based components for incompressible fluids. As part of this, we present a new method for determining spatial grid resolution

77 65 Fig. 27. Quadtree hybrid simulation with uniform cells based on adaptive particle sizes, and coupling this grid with the particles. We also present improvements to particle splitting and merging. Our approach allows us to have the resolution needed to incorporate surface tension effects into an adaptive particle-based simulation, and we present a new method for computing these forces. Figure 27 shows an example of our result when using the hybrid method, coupled with an octree data structure but using uniform size particles.

78 66 B. Overview of our adaptive fluid simulation Our overall method is an extension to the hybrid FLIP method [37]. We maintain the general FLIP approach of using particles to capture fluid advection and a grid to perform pressure calculations. In order to make the simulation more adaptive, we incorporate adaptive techniques in both key aspects: namely particle splitting and merging for Lagrangian calculation, and octree grids for Eulerian calculation. A surface tension force is added as an external force to more accurately capture smallscale fluid motions (the detailed description of the surface tension force will be given in Chapter V). More detail explanation will be given in the next chapter. While each of these ideas has been applied individually in prior work, we show that these techniques can be applied collectively in a unified manner. Specifically, we show how the adaptive particles can be used to drive the formation of the octree grid. Figure 28 presents a diagram illustrating our overall process. The following steps are iterated during the simulation. Update particle positions based on velocity. Generate an octree grid with resolution based on local particle radii. Identify surface cells from among the current fluid cells. Subdivide cells in the air based on the distance to the fluid surface. Construct a signed distance field from the particles using fast sweeping on the octree grid, allowing identification of particles near the surface. Local surface curvature is computed for these particles to provide a surface tension force. Use the particle velocities to reconstruct a set of fields on the octree. Fields are maintained, at the center of each octree cell, for velocity, pressure, distance

79 67 Fig. 28. Overall simulation structure from the surface, and applied forces. Forces include gravity, surface tension, and any externally applied forces. A circular kernel is used for the reconstruction. Create a copy of the octree. Using two octrees avoids the additional steps and computation that would be needed to update the field in place. Calculate the pressure field, and project the flow field onto the nearest divergence free field [24]. Transfer velocity changes in the flow field back onto the particles velocities. Compute a fluid deformability measure based on depth and local motion.

80 68 Split or merge the particles based on the local deformability measure. Several of these steps are common to the hybrid FLIP method, or are explained in detail in the previous chapter, and we will not discuss them further here. We will focus our discussion in the following sections on the key areas where we present new ideas or improvements on prior approaches. Specifically, we will describe the creation of octree cells based on particles (Section C), splitting and merging particles (Section D), communicating velocity information between the particles and the grid (Section E), and computing surface tension (Chapter V). For illustrative purposes, most of our figures and examples will be presented in 2D, while the descriptions and formulae will be in 3D (e.g. octrees instead of quadtrees). However, all the methods discussed have been implemented and work equally well in both two and three dimensions. C. Octree generation Key to our method is the generation of an octree data structure at each iteration. During simulation, both particle volume and octree cell size can be changed adaptively, conserving mass for a constant density incompressible fluid. We choose to have the octree structure adapt to both the positions and the sizes of the particles. Thus (as described in Section D), we adapt the particle size/distribution to the needs of the simulation, and then the octree to the particles. 1. Relating adaptive particles and octree cells First, we need to discuss the relation between adaptive particles and octree cells. In a sense, these values can be considered independently the grid size and particle size/distribution do not necessarily have to be related. This is illustrated in prior

81 69 Fig. 29. The size of particles determines the size of an octree cell adaptive particle methods that use fixed grids [19]. However, in general the areas where we want additional (or less) detail in the pressure calculation are the same as those where we want more (less) detail in the mass advection, therefore it makes sense for the grid size to be related to the particle size. In order to communicate information between the grid and the particles, we need to be able to map velocity information from the particles to the grid and vice-versa (see Section E). When a size h cell is matched with a radius r particle, where r = 3h (or r = 2h in 2D), each particle can be expected to cover at least eight (four) nodal points on the octree (quadtree) grid. This coverage guarantees that (if all adjacent cells are the same size), a particle will affect all nodes of the grid within the cell in which it lies. This is illustrated in Figure 29. We note that although this is a heuristic, it works very well in practice, and better than other values we tested. We discuss next how this heuristic is used to determine the actual octree subdivision.

82 70 2. Creating the octree grid It is straightforward to create an octree grid according to the target particle radius. All particles are placed into a single octree node for the simulation, and this node is recursively subdivided to form the octree. In the recursion, each node is examined to determine whether it contains a particle with radius less than the target value (i.e. in our implementation, with r < h/ 3). If two particles in the same cell have different sizes, the cell will be subdivided based on the smaller particle radius. When a cell of the octree is of sufficiently small size, the cell is identified as a leaf node. Typically, there will be only a single particle per leaf node, though it is possible to have more. Leaf nodes containing particles are identified as fluid cells and the physical values for the cell (velocity and pressure) are initialized from the particles (Section E). As the octree is created, the areas near the surface will thus be described by a fine grid (assuming the particles were of small radius). However, for the velocity field to be extrapolated accurately, we must also ensure a fine sampling of the velocity grid on the air side of the fluid-air interface. Essentially, we want neighboring air cells to be no larger than the fluid cells. So, we will further process the octree data to add detail in the air near the fluid. Figure 30 demonstrates the relationship between the particles and the octree cells created. All fluid cells are stored into a list and used to construct this extra detail. For each fluid cell, we determine any neighboring air cells, and repeatedly apply octree subdivision to those cells, until the neighboring cells are as small as the fluid cell. Within this process, we also identify which fluid and air cells form the fluid/air boundary, and store these in a list for subsequent computation.

83 Fig. 30. Relation between adaptive particles and the octree cell 71

84 72 D. Splitting and merging In order to adapt our simulation to the areas of most interest, we implement a particle splitting and merging approach. As presented in chapter III, we base our splitting and merging on both distance to the surface and on local fluid deformation similar to the Reynolds number. We summarize our approach here, which offers an improvement over prior adaptive particle methods, and focus on the unique characteristics. 1. Splitting and merging process The process of splitting and merging particles must preserve mass and momentum. For a constant density incompressible fluid, mass and volume conservation are equivalent. Merging particles is straightforward; the merged particle s mass and volume are the sum of the smaller particles mass and volume, while position and velocity are chosen to conserve momentum and center of mass. When we decide to merge particles (Section 2), we use a greedy approach. We choose one particle arbitrarily, and merge it with the nearest particle within the particle s radius r. The process is continued with this particle, which will now have a larger radius, until its volume reaches the maximum volume allowed in the region of the particle, or no further particles are within its radius. Splitting is somewhat more complicated. When splitting, a single particle is divided into two or more particles, each of equal volume/mass, and with velocity equal to that of the parent particle. Given the original particle position, we form a box around the particle position, of size equal to the size of a grid cell, h. The new subparticles are generated within this box. In practice, to ensure good distribution of child particles, we subdivide the box into a 2 by 2 by 2 grid of subboxes, and ensure

85 73 that no particles are placed into the same subbox (we never subdivide into more than 8 particles). When a particle is split near the surface, we modify the positions of the subparticles to ensure a good sampling remains near the surface. If the parent particle is located within a threshold of the surface, then the new subparticles are projected to the surface using the gradient of the distance field (already computed): N = φ φ. (4.1) 2. Layers for splitting and merging With the splitting and merging process available, we must determine exactly when to split and merge particles. We divide the fluid into a number of layers, in each of which we determine whether to merge or split particles. Layers are determined by distance from the surface. Within each layer, we determine whether to split/merge based in part on a local measure of fluid deformation based on the Reynolds number; this determination is similar to the approach which presented in previous chapter, so we will not discuss it further. Generally, each layer has a nominal target particle size, with radius twice that of the layer nearer the surface. Local motion of the fluid within the layer can cause smaller particles to occur in those areas. We create hysteresis around the layer transition boundary by defining a small range, ɛ, in which merging (in the smaller layer ) or splitting (in the larger layer) are not allowed. This is illustrated in Figure 31. The range of ɛ is determined by the nominal radius of particles in the farther layer. Specifically, we set ɛ = h for the grid cell size, h of the layer with larger particles. This hysteresis is used to prevent particles newly split/merged from immediately being merged/split. For example,

86 74 splitting a particle could cause some subparticles to be placed in the larger layer, and thus immediately merged. Likewise, a merged particle could be positioned within the smaller layer and immediately split. Fig. 31. Layers for splitting and merging E. Kernel choice and transferring particle velocity to octree grid Once the octree grid is formed, the velocities of particles must be transferred to the grid. To do this, a kernel function is associated with each particle, and the velocity value at each node point is determined by the weighted average of the kernels that overlap it. Likewise, this kernel is used to transfer velocities from the grid to the particle (velocities of the nodes are weighted by the kernel value). We use a circular kernel function, w: w(r) = (1 r r e ) 3 (0 r < r e ) (4.2)

87 75 w(r) = 0 (r e r) (4.3) where r is the distance from the current particle, and r e is the current particle radius. The power of 3 in the kernel function was experimentally determined to give somewhat better results than a linear tent kernel or a quadratic kernel in producing detailed splashing effects. Using a circular kernel, rather than a rectangular kernel makes finding which cell centers are within the particle s radius simpler. Figure 32 shows circular kernels on an octree grid. Fig. 32. Circular kernel functions F. Constructing the poisson equation To construct and solve the Poisson equation, we simply use Lossaso s octree based approach [24]. The only difference is that we minimize octree neighbor cell queries by storing all field quantities in the center of each grid cell, speeding some of the

88 76 computations. In a fixed grid system this could lead to unwanted smoothing of spatial derivatives of the velocity field, since interpolation is required to compute derivatives where they are needed. However, in the spatially adaptive octree formulation, this effect is negligible. Pressure is computed as follows: V cell 2 p = j ( p j p i n)a area, (4.4) where V cell is the volume of the current cell, j is the index of neighbors, n is the outward unit normal of the current cell, is the size of the large cell and A size is the face area of the neighbor cell. G. Divergence Following the same logic that was used for the pressure gradient, in octree cells the generalized form for the divergence term is V cell u = j (u j u i ) na area (4.5) where A area is the area of a cell face, n is the outward unit normal of the current cell and V cell is the volume of the cell in the fluid simulation based on the octree. H. Results and discussion 1. Results We have implemented the algorithm as described, in both two and three dimensions. Figure 33 shows a comparison of a standard method, a method with adaptive particles only, and our fully adaptive method. Results of our implementation can be seen in

89 77 Figures 34 and 35. In Figure 34, the maximum grid resolution is particles were used in the starting configuration. The average number of octree cells was In Figure 35, the maximum grid resolution is , 261 particles were used in the starting configuration. The average number of octree cells was 88, 033. These two figures show sequences from a 2D and a 3D simulation conducted using our approach, illustrating both the particle sampling and the octree structure. The detail at the surface and the coarsening of the representation below the surface can be clearly seen. Since the simulation is grounded in a particle representation, splashes and spray are handled directly, and actually account for true fluid mass. At the same time, the octree representation provides the fine detail needed around spray particles so that nearby particles continue to form a surface over which surface tension forces can be computed. 2. Contrast with previous methods Note that our approach for merging and splitting is in contrast to that of Adams et al. [2], which can allow some particles of larger size to end up near the surface. While the larger kernel they then use for surface smoothing allows the method to produce smooth results, it also eliminates the small scale surface features that can be vital for producing splashing and similar effects. Since a major goal of our method is to capture fine surface detail (such as from surface tension), we do not adopt their splitting and merging criterion. More fundamentally, that approach is based on SPH, and does not support incompressibility, which is a key feature for realistic water behavior.

90 78 Fig. 33. Contrast with Previous Methods.(Comparison of Normal simulation, Adaptive Particle and Fully Adaptive Simulation)

91 Fig D Fully Adaptive Fluid simulation 79

92 Fig D fluid simulation using adaptive particles and an octree grid 80

93 81 CHAPTER V SURFACE TENSION WITH FULLY ADAPTIVE FLUID SIMULATION A. Introduction In our adaptive simulation, particle splitting is performed near the surface of the fluid in order to capture the characteristic small-scale details of the water. This results in the generation of many particles near the surface of the fluid, leading to non-realistic small scale effects as shown in Figure 36. We believe that by introducing a surface tension representation, these small scale effects can be minimized. In order to provide a more faithful representation of the small-scale details of turbulent water, including splashes and bubbles, we propose implementing surface tension, using techniques similar to those of [18, 35]. Hong and Kim[18] describe a technique for animating fluids that extends previous techniques to handle multi-phase fluids with surface tension effects and viscosity changes at their interfaces. Wang[35] presents an algorithm to solve the capillary solid coupling problem by modeling surface tension between the liquid and a solid object. The method replaces the liquid-solid interface with a virtual surface beneath the solid surface so that the estimated boundary pressure can represent all surface tension on the contact front. For our fluid simulation, we expect that the octree based structure will be very useful for representing surface cells including surface tension. Even though the techniques of Hong and Wang[18, 35] show new aspects of small-scale fluid motion and Wang tried the Sparse Grid Representation technique which activates or deactivates regions based on particle presence, their fluid simulations must be performed in a high resolution MAC grid to capture the small details. This is excessively complex

94 82 in both memory and time. We propose a more efficient technique in which surface tension is applied directly to the boundary of each cell which corresponds to each leaf node of an octree and the grid size is changed adaptively during the simulation based on the radius of particles. We review how to model the surface tension on a MAC grid, then we observe some shortcomings of our technique and now they are resolved in the following section. Fig. 36. Non realistic splash effect without surface tension B. Modeling surface tension Surface tension is physically caused by attraction between molecules. Within a fluid, these attractive forces are canceled out, but near the surface they are unopposed in the direction of the surface. In physics, surface tension is usually considered to be an external force oriented towards the negative surface normal with magnitude proportional to the surface curvature. To compute surface tension, we will need to know surface curvature. Let the

95 83 function φ(x, y, z) be a scalar field defined implicitly as a signed distance field around a level set φ = 0. The gradient of the implicit function is φ = ( φ x, φ y, φ z ). (5.1) φ is perpendicular to the interface (i.e. the surface determined by the level set) and points in the direction of increasing φ. Thus, the outward unit normal for an arbitrary point on the interface is N = φ φ. (5.2) The derivatives in equation 5.1 can be approximated using a first-order accurate forward difference such as ( φ x ) i φ i+1 φ i x. (5.3) This equation is abbreviated D + φ, and the first-order backward difference is ( φ x ) i φ i φ i 1 x, (5.4) which is abbreviated D φ. The second-order central difference is defined as ( φ x ) i φ i+1 φ i 1 2 x, (5.5) which is abbreviated D 0 φ. The formulas for the derivatives in the y and z directions can be obtained in the same manner. The mean curvature κ of the interface is defined as the divergence from the normal, κ = N = n 1 x + n 2 y + n 3 z, (5.6)

96 84 where N = (n 1, n 2, n 3 ). Equation 5.2 and 5.6 yield Thus, we can write the curvature as κ = ( φ φ ). (5.7) κ = (φ 2 xφ y y 2φ x φ y φ xy + φ 2 yφ xx + φ 2 xφ zz 2φ x φ z φ zz + φ 2 zφ xx + φ 2 yφ zz 2φ y φ z φ yz + φ 2 zφ yy )/ φ 3, (5.8) where φ xy is defined as D 0 xd 0 yφ. By equation 5.3 φ xy = (φ i+1,j+1 φ i 1,j+1 ) (φ i+1,j 1 φ i 1,j 1 ) 4 x 2. (5.9) The forces arising from surface tension are based on the above equation. As illustrated in Figure 37, κ > 0 indicates a convex region, κ < 0 indicates a concave region, and κ = 0 indicates a planer region. Fig. 37. Curvature in concave region and convex region

97 85 C. Adding surface tension to fully adaptive fluid simulation Surface tension J can be described as a force in the negative surface normal direction, with magnitude proportional to the surface curvature, κ Γ : J = σκ Γ N (5.10) Fig. 38. Surface tension in Fully Adaptive Fluid Simulation In the hybrid FLIP method, we have two ways to apply surface tension. The prior work for incorporating surface tension, presented by Hong and Kim [18], is based on computing these external forces on an Eulerian grid. Likewise, we could compute the tension force by generating an additional MAC grid in the FLIP method and using this grid to compute the surface tension forces. However, doing so would require a very high resolution grid and significant additional computational time in order to capture the small detailed features that are the whole point of incorporating surface tension in the first place.

98 86 We prefer to instead apply the surface tension force directly within the FLIP method, as we present here. First, surface particles are identified as those within a small depth ɛ from the surface in the signed distance field. Figure 38 illustrates the region in which we calculate surface tension. The normal N = φ φ and curvature κ Γ = N are computed at each of these points, based on the distance function. This force is then transferred to the Octree grid along with particle velocities, and is then used along with other external forces (such as gravity and viscosity) when performing the Eulerian force computations. Because this alternative has significantly lower computational cost and makes use of the Lagrangian nature of the approach, we believe it provides a better alternative for surface tension calculation within a hybrid FLIP implementation. D. Fluid-object interaction First, the computation of the normal vector for an object is important. In order to compute it, a signed distance field should be computed for the object and then the normal vector can be computed at any position. We need to consider one problem: that many particles could collide in the fluid. If a response to a collision is computed whenever a particle collides, it would be very costly. In order to prevent this problem, we consider a common technique by Muller, Keiser and Simon, who worked on Lagrangian fluid. The collision between many particles in a fluid can be detected at the same time. First, an object is evolved in time in terms of linear velocity and angular velocity without collision detection with particles. Then, all particles located in the object can be detected as shown in Figure 39. The relative velocity is important to accumulate particle impulses on the body. Assume that there are two objects A and B, and the relative velocity A to B is

99 87 Fig. 39. Interaction between fluid particles and an object (velocity of A - velocity of B). Using the relative velocity, we consider both object-tofluid and fluid-to-object interaction. The velocity can then be separated into normal and tangential components. v normal = (v r n)n (5.11) v tangent = (v v normal ) (5.12) I = v normal µv tangent (5.13) The impulse, including friction, is computed as in the above equations and then the impulse is accumulated to determine the force and torque for the object. In terms of particles, the relative velocity of the particle to the object is computed and used to apply the impulse to the particle. Particles are moved to the surface of the object before applying the impulse.

100 88 E. Results and comparison In this section, we demonstrate the effect that surface tension has within the simulation. For all calculations, constants typical of water were used. As physical properties, kinematic viscosity ν = m 2 /s with density ρ = 1000 kg/m 3 and surface tension between the liquid-air interface, σ = 73 g/s 2 (a room temperature) are assumed in our tests. Figure 40 shows the results using 2 different surface tension parameters. The first image shows no surface tension, the second image σ and the third image 2σ as the surface tension coefficient. Notice that the water particles cluster more when surface tension is included. In Figure 41, a water ball drop was performed onto an object(green circle). The fluid-object interaction algorithm was already presented in the previous section. The simulation shows two results without surface tension(left) and with surface tension(right). The Marching Square Algorithm [23] is used to extract a polygonal isosurface. Note that the clustering of the particles is shown in the right picture. Figure 42 demonstrates the surface tension effect in our 3D fluid simulation.

101 Fig. 40. Comparison of different surface tension parameters 89

102 Fig D fluid simulation without (left) and with (right) surface tension 90

An Adaptive Sampling Approach to Incompressible Particle-Based Fluid

An Adaptive Sampling Approach to Incompressible Particle-Based Fluid EG UK Theory and Practice of Computer Graphics (2009) Ik Soo Lim, Wen Tang (Editors) An Adaptive Sampling Approach to Incompressible Particle-Based Fluid Woosuck Hong 1, Donald H. House 2 and John Keyser

More information

Adaptive Particles for Incompressible Fluid Simulation (Technical Report tamu-cs-tr )

Adaptive Particles for Incompressible Fluid Simulation (Technical Report tamu-cs-tr ) Adaptive Particles for Incompressible Fluid Simulation (Technical Report tamu-cs-tr 2007-7-2) Woosuck Hong Dept. of Computer Science Texas A&M University wshong@cs.tamu.edu Donald H. House Visualization

More information

Overview of Traditional Surface Tracking Methods

Overview of Traditional Surface Tracking Methods Liquid Simulation With Mesh-Based Surface Tracking Overview of Traditional Surface Tracking Methods Matthias Müller Introduction Research lead of NVIDIA PhysX team PhysX GPU acc. Game physics engine www.nvidia.com\physx

More information

Navier-Stokes & Flow Simulation

Navier-Stokes & Flow Simulation Last Time? Navier-Stokes & Flow Simulation Implicit Surfaces Marching Cubes/Tetras Collision Detection & Response Conservative Bounding Regions backtracking fixing Today Flow Simulations in Graphics Flow

More information

CS-184: Computer Graphics Lecture #21: Fluid Simulation II

CS-184: Computer Graphics Lecture #21: Fluid Simulation II CS-184: Computer Graphics Lecture #21: Fluid Simulation II Rahul Narain University of California, Berkeley Nov. 18 19, 2013 Grid-based fluid simulation Recap: Eulerian viewpoint Grid is fixed, fluid moves

More information

Realistic Animation of Fluids

Realistic Animation of Fluids 1 Realistic Animation of Fluids Nick Foster and Dimitris Metaxas Presented by Alex Liberman April 19, 2005 2 Previous Work Used non physics-based methods (mostly in 2D) Hard to simulate effects that rely

More information

Navier-Stokes & Flow Simulation

Navier-Stokes & Flow Simulation Last Time? Navier-Stokes & Flow Simulation Pop Worksheet! Teams of 2. Hand in to Jeramey after we discuss. Sketch the first few frames of a 2D explicit Euler mass-spring simulation for a 2x3 cloth network

More information

CGT 581 G Fluids. Overview. Some terms. Some terms

CGT 581 G Fluids. Overview. Some terms. Some terms CGT 581 G Fluids Bedřich Beneš, Ph.D. Purdue University Department of Computer Graphics Technology Overview Some terms Incompressible Navier-Stokes Boundary conditions Lagrange vs. Euler Eulerian approaches

More information

Navier-Stokes & Flow Simulation

Navier-Stokes & Flow Simulation Last Time? Navier-Stokes & Flow Simulation Optional Reading for Last Time: Spring-Mass Systems Numerical Integration (Euler, Midpoint, Runge-Kutta) Modeling string, hair, & cloth HW2: Cloth & Fluid Simulation

More information

Fluid Simulation. [Thürey 10] [Pfaff 10] [Chentanez 11]

Fluid Simulation. [Thürey 10] [Pfaff 10] [Chentanez 11] Fluid Simulation [Thürey 10] [Pfaff 10] [Chentanez 11] 1 Computational Fluid Dynamics 3 Graphics Why don t we just take existing models from CFD for Computer Graphics applications? 4 Graphics Why don t

More information

Smoke Simulation using Smoothed Particle Hydrodynamics (SPH) Shruti Jain MSc Computer Animation and Visual Eects Bournemouth University

Smoke Simulation using Smoothed Particle Hydrodynamics (SPH) Shruti Jain MSc Computer Animation and Visual Eects Bournemouth University Smoke Simulation using Smoothed Particle Hydrodynamics (SPH) Shruti Jain MSc Computer Animation and Visual Eects Bournemouth University 21st November 2014 1 Abstract This report is based on the implementation

More information

Water. Notes. Free surface. Boundary conditions. This week: extend our 3D flow solver to full 3D water We need to add two things:

Water. Notes. Free surface. Boundary conditions. This week: extend our 3D flow solver to full 3D water We need to add two things: Notes Added a 2D cross-section viewer for assignment 6 Not great, but an alternative if the full 3d viewer isn t working for you Warning about the formulas in Fedkiw, Stam, and Jensen - maybe not right

More information

2.7 Cloth Animation. Jacobs University Visualization and Computer Graphics Lab : Advanced Graphics - Chapter 2 123

2.7 Cloth Animation. Jacobs University Visualization and Computer Graphics Lab : Advanced Graphics - Chapter 2 123 2.7 Cloth Animation 320491: Advanced Graphics - Chapter 2 123 Example: Cloth draping Image Michael Kass 320491: Advanced Graphics - Chapter 2 124 Cloth using mass-spring model Network of masses and springs

More information

Realistic Animation of Fluids

Realistic Animation of Fluids Realistic Animation of Fluids p. 1/2 Realistic Animation of Fluids Nick Foster and Dimitri Metaxas Realistic Animation of Fluids p. 2/2 Overview Problem Statement Previous Work Navier-Stokes Equations

More information

Particle-based Fluid Simulation

Particle-based Fluid Simulation Simulation in Computer Graphics Particle-based Fluid Simulation Matthias Teschner Computer Science Department University of Freiburg Application (with Pixar) 10 million fluid + 4 million rigid particles,

More information

PHYSICALLY BASED ANIMATION

PHYSICALLY BASED ANIMATION PHYSICALLY BASED ANIMATION CS148 Introduction to Computer Graphics and Imaging David Hyde August 2 nd, 2016 WHAT IS PHYSICS? the study of everything? WHAT IS COMPUTATION? the study of everything? OUTLINE

More information

Realtime Water Simulation on GPU. Nuttapong Chentanez NVIDIA Research

Realtime Water Simulation on GPU. Nuttapong Chentanez NVIDIA Research 1 Realtime Water Simulation on GPU Nuttapong Chentanez NVIDIA Research 2 3 Overview Approaches to realtime water simulation Hybrid shallow water solver + particles Hybrid 3D tall cell water solver + particles

More information

Adarsh Krishnamurthy (cs184-bb) Bela Stepanova (cs184-bs)

Adarsh Krishnamurthy (cs184-bb) Bela Stepanova (cs184-bs) OBJECTIVE FLUID SIMULATIONS Adarsh Krishnamurthy (cs184-bb) Bela Stepanova (cs184-bs) The basic objective of the project is the implementation of the paper Stable Fluids (Jos Stam, SIGGRAPH 99). The final

More information

CS 231. Fluid simulation

CS 231. Fluid simulation CS 231 Fluid simulation Why Simulate Fluids? Feature film special effects Computer games Medicine (e.g. blood flow in heart) Because it s fun Fluid Simulation Called Computational Fluid Dynamics (CFD)

More information

Particle-Based Fluid Simulation. CSE169: Computer Animation Steve Rotenberg UCSD, Spring 2016

Particle-Based Fluid Simulation. CSE169: Computer Animation Steve Rotenberg UCSD, Spring 2016 Particle-Based Fluid Simulation CSE169: Computer Animation Steve Rotenberg UCSD, Spring 2016 Del Operations Del: = x Gradient: s = s x y s y z s z Divergence: v = v x + v y + v z x y z Curl: v = v z v

More information

Interactive Fluid Simulation using Augmented Reality Interface

Interactive Fluid Simulation using Augmented Reality Interface Interactive Fluid Simulation using Augmented Reality Interface Makoto Fuisawa 1, Hirokazu Kato 1 1 Graduate School of Information Science, Nara Institute of Science and Technology, 8916-5 Takayama, Ikoma,

More information

IMPROVED WALL BOUNDARY CONDITIONS WITH IMPLICITLY DEFINED WALLS FOR PARTICLE BASED FLUID SIMULATION

IMPROVED WALL BOUNDARY CONDITIONS WITH IMPLICITLY DEFINED WALLS FOR PARTICLE BASED FLUID SIMULATION 6th European Conference on Computational Mechanics (ECCM 6) 7th European Conference on Computational Fluid Dynamics (ECFD 7) 1115 June 2018, Glasgow, UK IMPROVED WALL BOUNDARY CONDITIONS WITH IMPLICITLY

More information

Mass-Spring Systems. Last Time?

Mass-Spring Systems. Last Time? Mass-Spring Systems Last Time? Implicit Surfaces & Marching Cubes/Tetras Collision Detection & Conservative Bounding Regions Spatial Acceleration Data Structures Octree, k-d tree, BSF tree 1 Today Particle

More information

Investigating The Stability of The Balance-force Continuum Surface Force Model of Surface Tension In Interfacial Flow

Investigating The Stability of The Balance-force Continuum Surface Force Model of Surface Tension In Interfacial Flow Investigating The Stability of The Balance-force Continuum Surface Force Model of Surface Tension In Interfacial Flow Vinh The Nguyen University of Massachusetts Dartmouth Computational Science Training

More information

Lagrangian methods and Smoothed Particle Hydrodynamics (SPH) Computation in Astrophysics Seminar (Spring 2006) L. J. Dursi

Lagrangian methods and Smoothed Particle Hydrodynamics (SPH) Computation in Astrophysics Seminar (Spring 2006) L. J. Dursi Lagrangian methods and Smoothed Particle Hydrodynamics (SPH) Eulerian Grid Methods The methods covered so far in this course use an Eulerian grid: Prescribed coordinates In `lab frame' Fluid elements flow

More information

Divergence-Free Smoothed Particle Hydrodynamics

Divergence-Free Smoothed Particle Hydrodynamics Copyright of figures and other materials in the paper belongs to original authors. Divergence-Free Smoothed Particle Hydrodynamics Bender et al. SCA 2015 Presented by MyungJin Choi 2016-11-26 1. Introduction

More information

CS205b/CME306. Lecture 9

CS205b/CME306. Lecture 9 CS205b/CME306 Lecture 9 1 Convection Supplementary Reading: Osher and Fedkiw, Sections 3.3 and 3.5; Leveque, Sections 6.7, 8.3, 10.2, 10.4. For a reference on Newton polynomial interpolation via divided

More information

Interactive Fluid Simulation Using Augmented Reality Interface

Interactive Fluid Simulation Using Augmented Reality Interface Interactive Fluid Simulation Using Augmented Reality Interface Makoto Fuisawa and Hirokazu Kato Graduate School of Information Science, Nara Institute of Science and Technology, 8916-5 Takayama, Ikoma,

More information

Adaptive-Mesh-Refinement Pattern

Adaptive-Mesh-Refinement Pattern Adaptive-Mesh-Refinement Pattern I. Problem Data-parallelism is exposed on a geometric mesh structure (either irregular or regular), where each point iteratively communicates with nearby neighboring points

More information

Interaction of Fluid Simulation Based on PhysX Physics Engine. Huibai Wang, Jianfei Wan, Fengquan Zhang

Interaction of Fluid Simulation Based on PhysX Physics Engine. Huibai Wang, Jianfei Wan, Fengquan Zhang 4th International Conference on Sensors, Measurement and Intelligent Materials (ICSMIM 2015) Interaction of Fluid Simulation Based on PhysX Physics Engine Huibai Wang, Jianfei Wan, Fengquan Zhang College

More information

The Immersed Interface Method

The Immersed Interface Method The Immersed Interface Method Numerical Solutions of PDEs Involving Interfaces and Irregular Domains Zhiiin Li Kazufumi Ito North Carolina State University Raleigh, North Carolina Society for Industrial

More information

Simulation in Computer Graphics. Particles. Matthias Teschner. Computer Science Department University of Freiburg

Simulation in Computer Graphics. Particles. Matthias Teschner. Computer Science Department University of Freiburg Simulation in Computer Graphics Particles Matthias Teschner Computer Science Department University of Freiburg Outline introduction particle motion finite differences system of first order ODEs second

More information

Technical Report TR

Technical Report TR Technical Report TR-2015-09 Boundary condition enforcing methods for smoothed particle hydrodynamics Arman Pazouki 1, Baofang Song 2, Dan Negrut 1 1 University of Wisconsin-Madison, Madison, WI, 53706-1572,

More information

A High Quality, Eulerian 3D Fluid Solver in C++ A Senior Project. presented to. the Faculty of the Computer Science Department of

A High Quality, Eulerian 3D Fluid Solver in C++ A Senior Project. presented to. the Faculty of the Computer Science Department of A High Quality, Eulerian 3D Fluid Solver in C++ A Senior Project presented to the Faculty of the Computer Science Department of California Polytechnic State University, San Luis Obispo In Partial Fulfillment

More information

Level set methods Formulation of Interface Propagation Boundary Value PDE Initial Value PDE Motion in an externally generated velocity field

Level set methods Formulation of Interface Propagation Boundary Value PDE Initial Value PDE Motion in an externally generated velocity field Level Set Methods Overview Level set methods Formulation of Interface Propagation Boundary Value PDE Initial Value PDE Motion in an externally generated velocity field Convection Upwind ddifferencingi

More information

Computer animation for fluid simulation of a high viscous fluid melting

Computer animation for fluid simulation of a high viscous fluid melting 2 nd WIETE Annual Conference on Engineering and Technology Education 2011 WIETE Pattaya, Thailand, 25-28 January 2011 Computer animation for fluid simulation of a high viscous fluid melting S. Lertkulvanich

More information

Support for Multi physics in Chrono

Support for Multi physics in Chrono Support for Multi physics in Chrono The Story Ahead Overview of multi physics strategy in Chrono Summary of handling rigid/flexible body dynamics using Lagrangian approach Summary of handling fluid, and

More information

A Geometric Approach to Animating Thin Surface Features in SPH Water

A Geometric Approach to Animating Thin Surface Features in SPH Water A Geometric Approach to Animating Thin Surface Features in SPH Water Taekwon Jang et al. Computer Animation and Social Agents 2013 (CASA) Jong-Hyun Kim 2013. 11.08 Abstract We propose a geometric approach

More information

The 3D DSC in Fluid Simulation

The 3D DSC in Fluid Simulation The 3D DSC in Fluid Simulation Marek K. Misztal Informatics and Mathematical Modelling, Technical University of Denmark mkm@imm.dtu.dk DSC 2011 Workshop Kgs. Lyngby, 26th August 2011 Governing Equations

More information

Numerical Methods for (Time-Dependent) HJ PDEs

Numerical Methods for (Time-Dependent) HJ PDEs Numerical Methods for (Time-Dependent) HJ PDEs Ian Mitchell Department of Computer Science The University of British Columbia research supported by National Science and Engineering Research Council of

More information

Robust Simulation of Sparsely Sampled Thin Features in SPH-Based Free Surface Flows

Robust Simulation of Sparsely Sampled Thin Features in SPH-Based Free Surface Flows Copyright of figures and other materials in the paper belong to original authors. Robust Simulation of Sparsely Sampled Thin Features in SPH-Based Free Surface Flows Xiaowei He et al. ACM SIGGRAPH 2015

More information

Comparison between incompressible SPH solvers

Comparison between incompressible SPH solvers 2017 21st International Conference on Control Systems and Computer Science Comparison between incompressible SPH solvers Claudiu Baronea, Adrian Cojocaru, Mihai Francu, Anca Morar, Victor Asavei Computer

More information

Animation of Fluids. Animating Fluid is Hard

Animation of Fluids. Animating Fluid is Hard Animation of Fluids Animating Fluid is Hard Too complex to animate by hand Surface is changing very quickly Lots of small details In short, a nightmare! Need automatic simulations AdHoc Methods Some simple

More information

T6: Position-Based Simulation Methods in Computer Graphics. Jan Bender Miles Macklin Matthias Müller

T6: Position-Based Simulation Methods in Computer Graphics. Jan Bender Miles Macklin Matthias Müller T6: Position-Based Simulation Methods in Computer Graphics Jan Bender Miles Macklin Matthias Müller Jan Bender Organizer Professor at the Visual Computing Institute at Aachen University Research topics

More information

Hardware Accelerated Real-Time Fluid Surface Simulation

Hardware Accelerated Real-Time Fluid Surface Simulation Hardware Accelerated Real-Time Fluid Surface Simulation Björn Hellstrandh bjornh@cs.umu.se Jesper Byström c99jbm@cs.umu.se July 1, 2008 Master s Thesis in Computing Science, 2*30 ECTS credits Supervisor

More information

Simulation of Swirling Bubbly Water using Bubble Particles

Simulation of Swirling Bubbly Water using Bubble Particles Noname manuscript No. (will be inserted by the editor) Simulation of Swirling Bubbly Water using Bubble Particles Ho-Young Lee Jeong-Mo Hong Chang-Hun Kim Received: date / Accepted: date Abstract The effect

More information

Multigrid Pattern. I. Problem. II. Driving Forces. III. Solution

Multigrid Pattern. I. Problem. II. Driving Forces. III. Solution Multigrid Pattern I. Problem Problem domain is decomposed into a set of geometric grids, where each element participates in a local computation followed by data exchanges with adjacent neighbors. The grids

More information

CUDA. Fluid simulation Lattice Boltzmann Models Cellular Automata

CUDA. Fluid simulation Lattice Boltzmann Models Cellular Automata CUDA Fluid simulation Lattice Boltzmann Models Cellular Automata Please excuse my layout of slides for the remaining part of the talk! Fluid Simulation Navier Stokes equations for incompressible fluids

More information

Simulation in Computer Graphics. Deformable Objects. Matthias Teschner. Computer Science Department University of Freiburg

Simulation in Computer Graphics. Deformable Objects. Matthias Teschner. Computer Science Department University of Freiburg Simulation in Computer Graphics Deformable Objects Matthias Teschner Computer Science Department University of Freiburg Outline introduction forces performance collision handling visualization University

More information

SPH: Why and what for?

SPH: Why and what for? SPH: Why and what for? 4 th SPHERIC training day David Le Touzé, Fluid Mechanics Laboratory, Ecole Centrale de Nantes / CNRS SPH What for and why? How it works? Why not for everything? Duality of SPH SPH

More information

The Simulation of Liquids

The Simulation of Liquids The Simulation of Liquids Mario Ausseloos mario.ausseloos@hotmail.com In partial fulfillment of the requirements for the degree MSc Computer Animation National Centre for Computer Animation Bournemouth

More information

Solidification using Smoothed Particle Hydrodynamics

Solidification using Smoothed Particle Hydrodynamics Solidification using Smoothed Particle Hydrodynamics Master Thesis CA-3817512 Game and Media Technology Utrecht University, The Netherlands Supervisors: dr. ir. J.Egges dr. N.G. Pronost July, 2014 - 2

More information

Isogeometric Analysis of Fluid-Structure Interaction

Isogeometric Analysis of Fluid-Structure Interaction Isogeometric Analysis of Fluid-Structure Interaction Y. Bazilevs, V.M. Calo, T.J.R. Hughes Institute for Computational Engineering and Sciences, The University of Texas at Austin, USA e-mail: {bazily,victor,hughes}@ices.utexas.edu

More information

Fluids in Games. Jim Van Verth Insomniac Games

Fluids in Games. Jim Van Verth Insomniac Games Fluids in Games Jim Van Verth Insomniac Games www.insomniacgames.com jim@essentialmath.com Introductory Bits General summary with some details Not a fluids expert Theory and examples What is a Fluid? Deformable

More information

Simulating Smoke with an Octree Data Structure and Ray Marching

Simulating Smoke with an Octree Data Structure and Ray Marching Simulating Smoke with an Octree Data Structure and Ray Marching Edward Eisenberger Maria Montenegro Abstract We present a method for simulating and rendering smoke using an Octree data structure and Monte

More information

Driven Cavity Example

Driven Cavity Example BMAppendixI.qxd 11/14/12 6:55 PM Page I-1 I CFD Driven Cavity Example I.1 Problem One of the classic benchmarks in CFD is the driven cavity problem. Consider steady, incompressible, viscous flow in a square

More information

Acknowledgements. Prof. Dan Negrut Prof. Darryl Thelen Prof. Michael Zinn. SBEL Colleagues: Hammad Mazar, Toby Heyn, Manoj Kumar

Acknowledgements. Prof. Dan Negrut Prof. Darryl Thelen Prof. Michael Zinn. SBEL Colleagues: Hammad Mazar, Toby Heyn, Manoj Kumar Philipp Hahn Acknowledgements Prof. Dan Negrut Prof. Darryl Thelen Prof. Michael Zinn SBEL Colleagues: Hammad Mazar, Toby Heyn, Manoj Kumar 2 Outline Motivation Lumped Mass Model Model properties Simulation

More information

Revision of the SolidWorks Variable Pressure Simulation Tutorial J.E. Akin, Rice University, Mechanical Engineering. Introduction

Revision of the SolidWorks Variable Pressure Simulation Tutorial J.E. Akin, Rice University, Mechanical Engineering. Introduction Revision of the SolidWorks Variable Pressure Simulation Tutorial J.E. Akin, Rice University, Mechanical Engineering Introduction A SolidWorks simulation tutorial is just intended to illustrate where to

More information

An adaptive discretization of incompressible flow using a multitude of moving Cartesian grids

An adaptive discretization of incompressible flow using a multitude of moving Cartesian grids An adaptive discretization of incompressible flow using a multitude of moving Cartesian grids R. Elliot English, Linhai Qiu, Yue Yu, Ronald Fedkiw Stanford University, 353 Serra Mall Room 27, Stanford,

More information

Shape of Things to Come: Next-Gen Physics Deep Dive

Shape of Things to Come: Next-Gen Physics Deep Dive Shape of Things to Come: Next-Gen Physics Deep Dive Jean Pierre Bordes NVIDIA Corporation Free PhysX on CUDA PhysX by NVIDIA since March 2008 PhysX on CUDA available: August 2008 GPU PhysX in Games Physical

More information

Cloth Simulation. Tanja Munz. Master of Science Computer Animation and Visual Effects. CGI Techniques Report

Cloth Simulation. Tanja Munz. Master of Science Computer Animation and Visual Effects. CGI Techniques Report Cloth Simulation CGI Techniques Report Tanja Munz Master of Science Computer Animation and Visual Effects 21st November, 2014 Abstract Cloth simulation is a wide and popular area of research. First papers

More information

Rigid Body Dynamics, Collision Response, & Deformation

Rigid Body Dynamics, Collision Response, & Deformation Rigid Body Dynamics, Collision Response, & Deformation Pop Worksheet! Teams of 2. SOMEONE YOU HAVEN T ALREADY WORKED WITH What are the horizontal and face velocities after 1, 2, and many iterations of

More information

1.2 Numerical Solutions of Flow Problems

1.2 Numerical Solutions of Flow Problems 1.2 Numerical Solutions of Flow Problems DIFFERENTIAL EQUATIONS OF MOTION FOR A SIMPLIFIED FLOW PROBLEM Continuity equation for incompressible flow: 0 Momentum (Navier-Stokes) equations for a Newtonian

More information

Physically Based Simulation and Animation of Gaseous Phenomena in a Periodic Domain

Physically Based Simulation and Animation of Gaseous Phenomena in a Periodic Domain Physically Based Simulation and Animation of Gaseous Phenomena in a Periodic Domain Andrew Nealen Department of Computer Science, University of British Columbia CPSC 533b: Algorithmic Animation, Project

More information

Fluid Simulation Quality with Violated CFL Condition

Fluid Simulation Quality with Violated CFL Condition Fluid Simulation Quality with Violated CFL Condition Philipp Erler Supervised by: Christian Hafner, Michael Wimmer Institute of Computer Graphics and Algorithms TU Wien Vienna / Austria Abstract Fluid

More information

Solving Partial Differential Equations on Overlapping Grids

Solving Partial Differential Equations on Overlapping Grids **FULL TITLE** ASP Conference Series, Vol. **VOLUME**, **YEAR OF PUBLICATION** **NAMES OF EDITORS** Solving Partial Differential Equations on Overlapping Grids William D. Henshaw Centre for Applied Scientific

More information

Computational Fluid Dynamics - Incompressible Flows

Computational Fluid Dynamics - Incompressible Flows Computational Fluid Dynamics - Incompressible Flows March 25, 2008 Incompressible Flows Basis Functions Discrete Equations CFD - Incompressible Flows CFD is a Huge field Numerical Techniques for solving

More information

Two-Phase flows on massively parallel multi-gpu clusters

Two-Phase flows on massively parallel multi-gpu clusters Two-Phase flows on massively parallel multi-gpu clusters Peter Zaspel Michael Griebel Institute for Numerical Simulation Rheinische Friedrich-Wilhelms-Universität Bonn Workshop Programming of Heterogeneous

More information

Chapter 6. Semi-Lagrangian Methods

Chapter 6. Semi-Lagrangian Methods Chapter 6. Semi-Lagrangian Methods References: Durran Chapter 6. Review article by Staniford and Cote (1991) MWR, 119, 2206-2223. 6.1. Introduction Semi-Lagrangian (S-L for short) methods, also called

More information

CFD MODELING FOR PNEUMATIC CONVEYING

CFD MODELING FOR PNEUMATIC CONVEYING CFD MODELING FOR PNEUMATIC CONVEYING Arvind Kumar 1, D.R. Kaushal 2, Navneet Kumar 3 1 Associate Professor YMCAUST, Faridabad 2 Associate Professor, IIT, Delhi 3 Research Scholar IIT, Delhi e-mail: arvindeem@yahoo.co.in

More information

Chapter 2 Water and Bubbles

Chapter 2 Water and Bubbles Chapter 2 Water and Bubbles 2.1 Animation of Bubbles in Liquid Abstract This section introduces a new fluid animation technique in which liquid and gas interact with each other, using the example of bubbles

More information

Fluent User Services Center

Fluent User Services Center Solver Settings 5-1 Using the Solver Setting Solver Parameters Convergence Definition Monitoring Stability Accelerating Convergence Accuracy Grid Independence Adaption Appendix: Background Finite Volume

More information

Parallel GPU-Based Fluid Animation. Master s thesis in Interaction Design and Technologies JAKOB SVENSSON

Parallel GPU-Based Fluid Animation. Master s thesis in Interaction Design and Technologies JAKOB SVENSSON Parallel GPU-Based Fluid Animation Master s thesis in Interaction Design and Technologies JAKOB SVENSSON Department of Applied Information Technology CHALMERS UNIVERSITY OF TECHNOLOGY Gothenburg, Sweden

More information

Fluid Simulation. Dhruv Kore, Giancarlo Gonzalez, and Jenny Sum CS 488: Introduction to Computer Graphics Professor Angus Forbes

Fluid Simulation. Dhruv Kore, Giancarlo Gonzalez, and Jenny Sum CS 488: Introduction to Computer Graphics Professor Angus Forbes Fluid Simulation Dhruv Kore, Giancarlo Gonzalez, and Jenny Sum CS 488: Introduction to Computer Graphics Professor Angus Forbes 1) Introduction Figure 1.1: Realistic water and ice simulation using Blender,

More information

Modeling Surface Tension in SPH by Interface Reconstruction using Radial Basis Functions

Modeling Surface Tension in SPH by Interface Reconstruction using Radial Basis Functions Modeling Surface Tension in SPH by Interface Reconstruction using Radial Basis Functions Björn Andersson, Stefan Jakobsson, Andreas Mark, Fredrik Edelvik Fraunhofer-Chalmers Centre Chalmers Science Park

More information

Phase-field simulation of two-phase micro-flows in a Hele-Shaw cell

Phase-field simulation of two-phase micro-flows in a Hele-Shaw cell Computational Methods in Multiphase Flow III 7 Phase-field simulation of two-phase micro-flows in a Hele-Shaw cell Y. Sun & C. Beckermann Department of Mechanical and Industrial Engineering, University

More information

CMPT 898 Final Report. Adam L. Preuss. Numerical Simulation Laboratory. Department of Computer Science. University of Saskatchewan

CMPT 898 Final Report. Adam L. Preuss. Numerical Simulation Laboratory. Department of Computer Science. University of Saskatchewan A GPU implementation of massively parallel direction splitting for the incompressible Navier Stokes equations CMPT 898 Final Report Adam L. Preuss Numerical Simulation Laboratory Department of Computer

More information

Example 24 Spring-back

Example 24 Spring-back Example 24 Spring-back Summary The spring-back simulation of sheet metal bent into a hat-shape is studied. The problem is one of the famous tests from the Numisheet 93. As spring-back is generally a quasi-static

More information

Fluid Simulation using Smoothed Particle Hydrodynamics

Fluid Simulation using Smoothed Particle Hydrodynamics Fluid Simulation using Smoothed Particle Hydrodynamics Burak Ertekin i7637445 MSc Computer Animation and Visual Effects August, 2015 Contents Table of contents......................... List of figures...........................

More information

ALE Seamless Immersed Boundary Method with Overset Grid System for Multiple Moving Objects

ALE Seamless Immersed Boundary Method with Overset Grid System for Multiple Moving Objects Tenth International Conference on Computational Fluid Dynamics (ICCFD10), Barcelona,Spain, July 9-13, 2018 ICCFD10-047 ALE Seamless Immersed Boundary Method with Overset Grid System for Multiple Moving

More information

Mid-Year Report. Discontinuous Galerkin Euler Equation Solver. Friday, December 14, Andrey Andreyev. Advisor: Dr.

Mid-Year Report. Discontinuous Galerkin Euler Equation Solver. Friday, December 14, Andrey Andreyev. Advisor: Dr. Mid-Year Report Discontinuous Galerkin Euler Equation Solver Friday, December 14, 2012 Andrey Andreyev Advisor: Dr. James Baeder Abstract: The focus of this effort is to produce a two dimensional inviscid,

More information

A 3D VOF model in cylindrical coordinates

A 3D VOF model in cylindrical coordinates A 3D VOF model in cylindrical coordinates Marmar Mehrabadi and Markus Bussmann Department of Mechanical and Industrial Engineering, University of Toronto Recently, volume of fluid (VOF) methods have improved

More information

Partial Differential Equations

Partial Differential Equations Simulation in Computer Graphics Partial Differential Equations Matthias Teschner Computer Science Department University of Freiburg Motivation various dynamic effects and physical processes are described

More information

Moving Interface Problems: Methods & Applications Tutorial Lecture II

Moving Interface Problems: Methods & Applications Tutorial Lecture II Moving Interface Problems: Methods & Applications Tutorial Lecture II Grétar Tryggvason Worcester Polytechnic Institute Moving Interface Problems and Applications in Fluid Dynamics Singapore National University,

More information

FLUID SIMULATION. Kristofer Schlachter

FLUID SIMULATION. Kristofer Schlachter FLUID SIMULATION Kristofer Schlachter The Equations Incompressible Navier-Stokes: @u @t = (r u)u 1 rp + vr2 u + F Incompressibility condition r u =0 Breakdown @u @t The derivative of velocity with respect

More information

Chapter 6. Petrov-Galerkin Formulations for Advection Diffusion Equation

Chapter 6. Petrov-Galerkin Formulations for Advection Diffusion Equation Chapter 6 Petrov-Galerkin Formulations for Advection Diffusion Equation In this chapter we ll demonstrate the difficulties that arise when GFEM is used for advection (convection) dominated problems. Several

More information

Realistic and Controllable Fire Simulation

Realistic and Controllable Fire Simulation Realistic and Controllable Fire Simulation Philippe Beaudoin Sebastien Paquet Pierre Poulin Target: Use a set of techniques together to produce realistic-looking animations of burning objects. Techniques:

More information

Cloth Simulation. COMP 768 Presentation Zhen Wei

Cloth Simulation. COMP 768 Presentation Zhen Wei Cloth Simulation COMP 768 Presentation Zhen Wei Outline Motivation and Application Cloth Simulation Methods Physically-based Cloth Simulation Overview Development References 2 Motivation Movies Games VR

More information

Engineering Effects of Boundary Conditions (Fixtures and Temperatures) J.E. Akin, Rice University, Mechanical Engineering

Engineering Effects of Boundary Conditions (Fixtures and Temperatures) J.E. Akin, Rice University, Mechanical Engineering Engineering Effects of Boundary Conditions (Fixtures and Temperatures) J.E. Akin, Rice University, Mechanical Engineering Here SolidWorks stress simulation tutorials will be re-visited to show how they

More information

An adaptive discretization of incompressible flow using a multitude of moving Cartesian grids

An adaptive discretization of incompressible flow using a multitude of moving Cartesian grids An adaptive discretization of incompressible flow using a multitude of moving Cartesian grids R. Elliot English, Linhai Qiu,YueYu, Ronald Fedkiw Stanford University, 353 Serra Mall Room 27, Stanford, CA

More information

The Level Set Method. Lecture Notes, MIT J / 2.097J / 6.339J Numerical Methods for Partial Differential Equations

The Level Set Method. Lecture Notes, MIT J / 2.097J / 6.339J Numerical Methods for Partial Differential Equations The Level Set Method Lecture Notes, MIT 16.920J / 2.097J / 6.339J Numerical Methods for Partial Differential Equations Per-Olof Persson persson@mit.edu March 7, 2005 1 Evolving Curves and Surfaces Evolving

More information

Abstract. Introduction. Kevin Todisco

Abstract. Introduction. Kevin Todisco - Kevin Todisco Figure 1: A large scale example of the simulation. The leftmost image shows the beginning of the test case, and shows how the fluid refracts the environment around it. The middle image

More information

FLUENT Secondary flow in a teacup Author: John M. Cimbala, Penn State University Latest revision: 26 January 2016

FLUENT Secondary flow in a teacup Author: John M. Cimbala, Penn State University Latest revision: 26 January 2016 FLUENT Secondary flow in a teacup Author: John M. Cimbala, Penn State University Latest revision: 26 January 2016 Note: These instructions are based on an older version of FLUENT, and some of the instructions

More information

Chapter 3: Computer Animation Reminder: Descriptive animation. Procedural animation : Examples. Towards methods that generate motion?

Chapter 3: Computer Animation Reminder: Descriptive animation. Procedural animation : Examples. Towards methods that generate motion? Chapter 3 : Computer Animation (continued) Chapter 3: Computer Animation Reminder: Descriptive animation Describes a single motion, with manual control Ex: direct kinematics with key-frames, inverse kinematics

More information

Efficient Tridiagonal Solvers for ADI methods and Fluid Simulation

Efficient Tridiagonal Solvers for ADI methods and Fluid Simulation Efficient Tridiagonal Solvers for ADI methods and Fluid Simulation Nikolai Sakharnykh - NVIDIA San Jose Convention Center, San Jose, CA September 21, 2010 Introduction Tridiagonal solvers very popular

More information

cuibm A GPU Accelerated Immersed Boundary Method

cuibm A GPU Accelerated Immersed Boundary Method cuibm A GPU Accelerated Immersed Boundary Method S. K. Layton, A. Krishnan and L. A. Barba Corresponding author: labarba@bu.edu Department of Mechanical Engineering, Boston University, Boston, MA, 225,

More information

FEMLAB Exercise 1 for ChE366

FEMLAB Exercise 1 for ChE366 FEMLAB Exercise 1 for ChE366 Problem statement Consider a spherical particle of radius r s moving with constant velocity U in an infinitely long cylinder of radius R that contains a Newtonian fluid. Let

More information

PARALLEL SIMULATION OF A FLUID FLOW BY MEANS OF THE SPH METHOD: OPENMP VS. MPI COMPARISON. Pawe l Wróblewski, Krzysztof Boryczko

PARALLEL SIMULATION OF A FLUID FLOW BY MEANS OF THE SPH METHOD: OPENMP VS. MPI COMPARISON. Pawe l Wróblewski, Krzysztof Boryczko Computing and Informatics, Vol. 28, 2009, 139 150 PARALLEL SIMULATION OF A FLUID FLOW BY MEANS OF THE SPH METHOD: OPENMP VS. MPI COMPARISON Pawe l Wróblewski, Krzysztof Boryczko Department of Computer

More information

Unstructured Mesh Generation for Implicit Moving Geometries and Level Set Applications

Unstructured Mesh Generation for Implicit Moving Geometries and Level Set Applications Unstructured Mesh Generation for Implicit Moving Geometries and Level Set Applications Per-Olof Persson (persson@mit.edu) Department of Mathematics Massachusetts Institute of Technology http://www.mit.edu/

More information

Simple and Fast Fluids

Simple and Fast Fluids Simple and Fast Fluids Martin Guay, Fabrice Colin, Richard Egli To cite this version: Martin Guay, Fabrice Colin, Richard Egli. Simple and Fast Fluids. GPU Pro, A.K. Peters, Ltd., 2011, GPU Pro, pp.433-444.

More information