Hardware Accelerated Real-Time Fluid Surface Simulation

Size: px
Start display at page:

Download "Hardware Accelerated Real-Time Fluid Surface Simulation"

Transcription

1 Hardware Accelerated Real-Time Fluid Surface Simulation Björn Hellstrandh Jesper Byström July 1, 2008 Master s Thesis in Computing Science, 2*30 ECTS credits Supervisor at CS-UmU: Kenneth Bodin Examiner: Per Lindström Umeå University Department of Computing Science SE UMEÅ SWEDEN

2

3 Abstract In today s fast moving gaming industry realism and physical correctness becomes more and more important every day. As fluids are a common element in our world, simulating them has always been of great interest. The approach taken in this thesis is based on the Wave Particle algorithm, which is a method for simulating wide open water areas in realtime. This method can only handle flowless fluids. An attempt is made to incorporate flow into the simulated fluid, by combining the Wave Particle algorithm with a Stable Fluid implementation. The Wave Particle approach is found to be a viable method of simulating fluids in real-time. The flow simulation, as implemented, is a purely visual improvement, since it is difficult to properly combine the methods because of their fundamentally different requirements on the fluid.

4 ii

5 Contents 1 Introduction 1 2 The Physics of Fluids Viscosity Force Pressure Force Navier-Stokes Equation Continuity Drag and Lift Buoyancy Eulerian and Lagrangian Viewpoints The Lagrangian View The Eulerian View The Semi-Lagrangian View Boundary Conditions An Overview of Different Simulation Methods Procedural Fluids Stable Fluids Advection External Forces Diffusion Projection Smoothed Particle Hydrodynamics Kernel Functions Solving the Navier-Stokes Equation Density Pressure Viscosity External Forces Incompressibility Boundary Conditions iii

6 iv CONTENTS Comments Wave Particles Wave Simulation Wave Fronts Updating the Simulation Fluid Object Interaction Comments Implementation Implementation of Wave Particles Algorithm Implementation of Stable Fluids Limitations Real-Time Visualization Techniques Extended Height Map Projected Grid Reflection & Refraction Approximations Water Depth Caustics Conclusions Possible Improvements Acknowledgements 37 References 39

7 Chapter 1 Introduction Realistic visualization and simulation of 3D scenes is a much explored topic, ever since computers became capable of producing them. The goal is often to be able to simulate and render a scene as realistically as possible, and to do it in real-time. Fluids have long been of interest in such applications, and many methods for simulating realistic fluids have been developed. However, it is only in recent years that the performance of computer hardware has reached a level which makes it feasible to perform this type of simulation and rendering in real-time. Today s users place higher and higher demands on both the visual appearance, and the physical behavior of fluids in real-time applications such as games. A physically based fluid simulation can improve the visual aspect of a fluid by making it behave and interact with other objects in the way a user would expect. Additionally realistic physical behavior can open up new possibilities for game-play in a game. Resolution Interactive is a game development company based in Umeå, Sweden. They had an idea for a game centered around driving and racing watercraft, primarily Seadoos. In a game such as this, the interaction between the watercrafts and the water becomes very important. For this reason they needed an interactive and stable water model. The objective of this thesis is to examine current techniques for simulating fluids, and to implement a prototype of a solution which could be used in such a game. Figure 1.1: Seadoo game prototype 1

8 2 Chapter 1. Introduction This thesis is divided into several parts. It starts by explaining the physics of fluid simulations in Chapter 2 The Physics of Fluids, and continues by describing some current computer-based simulation techniques in Chapter 3 An Overview of Different Simulation Methods. After that, the implementations chosen for the prototype of the Seadoo game are described in detail in Chapter 4 Implementation, and a few methods for visualizing the fluid are described in Chapter 5 Real-Time Visualization Techniques. Finally, Chapter 6 Conclusions contains a few conclusions about the fluid simulation methods described in previous chapters. The reader is assumed to have a basic understanding of calculus, but a quick overview of some of the mathematics used can be found in Appendix????, if the reader needs to brush up. This appendix also contains an overview of the mathematical notation used in this thesis.

9 Chapter 2 The Physics of Fluids Most physical fluid simulations are based on Newton s Second Law, which states that: The rate of change of the momentum of a body is proportional to the resultant force acting on the body and is in the same direction as that force. In other words, the force is equal to the time-derivative of the momentum. Expressed algebraically in vector form, with u denoting velocity, m mass and t time 1 : F = d m u (2.1) dt If the mass m is constant, then the only quantity dependent on time is the velocity u, so d d u dtm u = m dt = m a, which reduces the equation to its more well known form: F = m a (2.2) In reality, the properties of a fluid vary continuously within the body of the fluid. To capture this continuous variation, and at the same time obviate the need to operate at the molecular level, the continuum hypothesis is introduced. Basically this hypothesis states that a fluid can be modeled as particles, where each particle represents a blob of fluid. The fluid as a whole is made up of a multitude of such fluid particles, each one reflecting the macroscopic properties of the fluid while at the same time representing the smooth variations across the fluid 2. The continuum hypothesis means that very small volumes of fluid (consisting of only a few molecules) can not be accurately simulated. The reason for this is that the properties of a fluid is a result of the interactions between the molecules constituting the fluid in question. With a significant number of molecules within a particular volume, the individual molecular behaviors average out. For example, a piece of fluid has a certain temperature, as a result of the average of the individual particle s Brownian motion. As the number of molecules in a piece of fluid goes toward zero, the properties resulting from these average motions become less and less representable of the fluid as a whole. From the above assumptions, an equation governing the motion of a fluid can be derived. This equation is called the Navier-Stokes equation: 1 Throughout the rest of the text u will be used instead of the more usual v to denote the velocity vector, for historical reasons. 2 For a more thorough explanation, see pp 48 in [16] 3

10 4 Chapter 2. The Physics of Fluids u t + u u = 1 ρ p + ν 2 u + 1 ρ F (2.3) While this looks rather complicated at first glance, we will show how to derive this equation based on Newton s Second Law. We will also point out some simplifications that can be introduced when simulating fluids. Since we are interested in the rate of change of the momentum of a particle we need to understand what this means. We should also realize that the concept of rate of change is not an exclusive problem regarding the momentum. One might for instance be interested in the rate of change of temperature for a position in a fluid. Because of this, we need a general way of calculating the rate of change of both scalar quantities (such as temperature) and vector quantities (such as momentum). To most people reading this thesis, it will be obvious that the rate of change of a quantity carried by the fluid, will involve taking the time-derivative of that quantity. However, since the application of the Navier-Stokes equation to different simulation models will be simplified if we have a general way of expressing the rate of change of a quantity, which works in both an Eulerian and a Lagrangian view, the concept of the material derivative 3 is introduced here. The material derivative is defined as: D Dt = t + u t + v t + w (2.4) t Here the velocity is u = (u, v, w). This derivative operator consists of two parts: the first, T, represents the rate-of-change of the variable itself, at the point in question; and the second, u t + v t + w t, represents the rate-of-change of the variable s value, which occurs as a result of particles moving through the fluid. Using gradient notation, the above can be expressed as: Applying D Dt D Dt = + u (2.5) t to an arbitrary quantity T carried by a fluid, gives DT Dt = T + u T (2.6) t It should be noted here that this expression is valid regardless of whether T is a scalar or a vector. Since we now have an appropriate operator for expressing the rate of change, we can return to Newton s Second Law. To be able to express the rate of change of the momentum, we need to know what the momentum of a piece of fluid is. In general the momentum of a body is defined as m u, and since we are interested in the momentum of a fluid particle, this becomes m V u, where m is the mass of the fluid particle, and V is the volume it represents. Since m V is simply the density ρ of the fluid, the momentum can be written as ρ u. Thus the rate of change of the momentum of a piece of fluid becomes: D(ρ u) = (ρ u) + u (ρ u) (2.7) Dt t If the fluid is incompressible, meaning that the density of the fluid can be regarded as constant, this further simplifies to: 3 Also called the substantive derivative

11 2.1. Viscosity Force 5 ρ D u Dt = ρ u + ρ u u (2.8) t We now have an expression for the rate of change of the momentum of a piece of fluid, and Newton s Second Law states that this is equal to the sum of all forces acting upon the piece of fluid. All that remains is determining what those forces are. Forces may be external (such as gravity), or may be the result of interactions between fluid particles. There are two kinds of forces resulting from activity internal to the fluid: viscosity forces and pressure forces. 2.1 Viscosity Force To successfully model fluids one has to consider the viscosity of the fluid. The viscosity represents the forces that neighboring particles exert on each other. These forces oppose the relative momenta between neighboring particles. In other words, a high viscosity makes a fluid thick and hard to stir. The derivation of the viscosity term of the Navier- Stokes equation is beyond the scope of this thesis. Interested readers are referred to [16] for a thorough discussion of the viscous term. All fluids which will be dealt with in this paper are incompressible and of Newtonian character, which means that the viscosity term in the equation can be approximated by µ 2 u. 2.2 Pressure Force Pressure is defined as force applied to a surface, divided by the area of the surface region, where the considered force is parallel to the surface s normal. The forces, in the case of a fluid, are caused by fluid particles moving, and pushing on each other. The surfaces on which these forces act are the bounds of the small blobs of fluid represented by each particle. In other words, there exists a pressure potential between each pair of fluid particles. All these interactions give rise to a pressure field throughout the fluid. Since each fluid particle is only affected by other fluid particles in its immediate vicinity, only the relative differences in pressure are of interest. Since a higher pressure will exert a larger force, and since the gradient of a scalar field points in the direction where the scalar field increases the most, we see that the direction of the pressure force will be in the opposite direction of the gradient vector of the pressure field. In other words: 2.3 Navier-Stokes Equation F pressure = p (2.9) From the sections above, we have an expression for the rate of change of the momentum of a fluid particle: ρ D u Dt = ρ u + ρ u u (2.10) t

12 6 Chapter 2. The Physics of Fluids An expression for the pressure force: And an expression for the viscosity force: F pressure = p (2.11) F viscosity = µ 2 u (2.12) In addition we can have an external force F external acting on a piece of fluid. According to Newton s Second Law, these result in the following equation: ρ D u Dt = F pressure + F viscosity + F external (2.13) Expanding each side, gives ρ u t + ρ u u = p + µ 2 u + F external (2.14) Division by the density ρ, yields: u t + u u = 1 ρ p + µ ρ 2 u + 1 ρ F external (2.15) µ The viscosity divided by the density, ρ, is called the kinematic viscosity, and is denoted ν. Using the kinematic viscosity results in the Navier-Stokes equation, as given at the beginning of this chapter: 2.4 Continuity u t + u u = 1 ρ p + ν 2 u + 1 ρ F external (2.16) Another thing that has to be considered when modeling a fluid is the property of mass conservation, often called the continuity. Continuity is a consequence of incompressibility. To keep a constant density throughout the fluid, no part of the fluid can be allowed to gain or lose mass. We start by considering an arbitrary volume V fixed in space and completely inside the fluid. If there is a flow present, then fluid will move into or out of the volume passing through points of the surface bounding it. Consider an element of the surface, ds, with magnitude equal to the area of the element and direction such that it is pointing out of the volume. Let the velocity of the fluid at the position of the element be u. The velocity u can be regarded as the sum of two vectors, one of which is parallel to the normal of the surface element. The part of the velocity that is parallel to the normal of the surface element must be the velocity which transfers fluid into or out of the fluid. Since the magnitude of ds is the area of the surface element, the outward mass flux 4 through the element must be ρ u ds 5. This states that the rate of loss of mass from the volume V equals ρ u ds. Since the total mass in the volume is the density times the S volume we can express this as V ρdv. Taking the time derivative of the total mass of the fluid within the volume and combining the above equations, results in the expression: 4 Mass flow per unit time. 5 Where ρ denotes the density of the fluid.

13 2.5. Drag and Lift 7 d ρdv = dt V V ρ t dv = ρ u ds (2.17) S Since we are interested in the mass balance at a point rather than over an arbitrary volume we look at the limit as V approaches 0, thus making the integration in dv redundant so we end up with: [ ρ ρ u d t = lim ] S V 0 V Which equals, by the definition of the divergence operator ( ): ρ t (2.18) ρ = (ρ u) + (ρ u) = 0 (2.19) t Since we will only be interested in fluids with constant density throughout the rest of this thesis, the above expression simplifies to: u = 0 (2.20) 2.5 Drag and Lift When modeling interactions between objects and a fluid, one has to consider the different kinds of forces they exert on each other. The forces acting on an object can be divided into two parts: The part of the total force which is parallel to the relative velocity and the part which is perpendicular to the relative velocity. These forces are called Drag and Lift respectively. It has been shown that for a wide range of Reynolds numbers, these forces are proportional to the relative velocity. They are also dependent on the active surface area perpendicular to the relative velocity. For relatively large velocities the Drag Equation, formulated by Lord Rayleigh, states that: Where u is the relative velocity of the object and the fluid. û is the unit vector in the direction of u. ρ is the density of the fluid. A is the reference area of the object. C D is the drag coefficient. F drag = 1 2 ρ u 2 AC D û (2.21) The reference area is related to the area of the object projected onto a plane with normal in the direction of the relative velocity. The drag coefficient, C D, is a dimensionless constant, often determined experimentally for complex objects. The Lift is calculated analogously replacing the drag coefficient by an appropriate lift coefficient C L and directed along the part of the relative velocity vector that is perpendicular to the normal at any given point at the surface of the object. F lift = 1 2 ρ u 2 AC L (û (ˆn û)) (2.22)

14 8 Chapter 2. The Physics of Fluids 2.6 Buoyancy In physics, buoyancy is the force which is exerted on a object due to pressure differences above and below the object. The force acts in opposite direction of the gravitational field in which the object resides and is of a net magnitude equal to the weight of the displaced fluid. If g is used to denote the gravitational field: F bouyancy = gρv displaced 2.7 Eulerian and Lagrangian Viewpoints When simulating fluids, it is necessary to define the frame of reference in which the calculations are to be performed. Conceptually this can be viewed as the relation between the fluid being simulated, and the observer. There are two general views when looking at this: The Eulerian, and the Lagrangian. Aspects from both of these views can be combined, and this is usually called the Semi- Lagrangian view The Lagrangian View In the Lagrangian view, a system is observed from points that are moving with the system. If we, for example, are interested in measuring the temperature of the water in a river, the Lagrangian View would place the observer in a boat. The boat follows the flow of the river, and the observer in it measures the temperature of the water immediately surrounding the boat The Eulerian View In the Eulerian view, the system is observed from a point, fixed in space. Continuing with the river analogy from the previous section, this is akin to the observer standing on the shore of the river, measuring the temperature of the water flowing past the point where the observer is standing The Semi-Lagrangian View The Semi-Lagrangian view is less interesting from a theoretical standpoint, but in practice it is often used instead of a pure Eulerian method. The reason for this is that the Semi-Lagrangian view uses a fixed observer as in the Eulerian view, but when fluid properties are evaluated at a certain point, the point is viewed as an arrival point for Lagrangian particles. The fluid velocity at the observation point is used to find the trajectories of arriving particles. These trajectories are traced backwards in time, giving an estimation of the particles start position. These backtracked positions are used as the basis for numerical integration. Using this method, stability of the numerical algorithms can be guaranteed, regardless of the length of the time-step.

15 2.8. Boundary Conditions Boundary Conditions When modelling a contained fluid, there is an obvious need to consider the fluid s boundaries and what conditions apply there. This should be evident by the fact that the Navier-Stokes equation is a differential equation and thus needs well defined boundary conditions in order to be solvable. There are many types of boundaries, giving rise to a various number of boundary conditions, but since the only types of boundaries that will be of interest is that between a fluids and a rigid body and the boundary conditions which apply when two different fluids interact. First an explanation for the rigid body - fluid scenario will be described and following that a description of which conditions must hold when simulating two separate fluids which interacts. First of all the fact that no fluid should pass through the walls of a rigid body must guarantee that the velocities of the walls of the rigid body and the particles closest to it matches up. The part of the velocity in the normal direction of the wall must thus be equal. The second condition which will be required is the so called no-slip condition, which states that the relative tangential velocity between the fluid and the object must be zero. Thus, the boundary conditions between a rigid body and a fluid must ensure that the relative velocity is equal to the zero vector at all points along the boundary. For the second type of boundary, often referred to as free surface boundary, one needs to consider the pressure difference between the two fluids. Its important to note that its only the relative difference that is of interest. This of course means that the implementor is free to chose an arbitrary zero-level, say atmospheric pressure for a water - air simulation. Of special interest will be the situation where a partition of the fluid is simulated. In this case the pressure difference at the boundaries should be non existing.

16 10 Chapter 2. The Physics of Fluids

17 Chapter 3 An Overview of Different Simulation Methods Since water, and fluids in general, are a very popular topic in computer graphics, many different approaches to simulating and rendering realistic fluids have been devised. The implementations range from simple visual techniques, utilizing sine-waves (or other wave functions) to simulate waves travelling through a fluid, to complex physically based simulations attempting to solve the Navier-Stokes equation accurately. The following is an overview of a few such techniques. 3.1 Procedural Fluids The goal of a procedural fluid is to achieve visually pleasing results, using a minimum of computational resources. Because of this, the simulated fluid is usually represented as a height map (of course other topologies are possible, but are likely to incur higher computational costs). To give this height map a fluid-like appearance, wave-form functions (such as sinewaves) dependent on time are applied to it. The interaction between multiple such wave-forms moving across the height map can give results that look quite good. As a simulation method this model is however limited, since it can be quite difficult to implement mutual interaction between the fluid and other bodies in the simulation. Especially when it comes to the effect other bodies have on the fluid. A procedural water implementation can work well as a complement to another, more physically grounded, simulation model. This is especially true in the context of realtime simulations, since a more complex model may be significantly more expensive to compute. Using a simple procedural model for unimportant areas of the fluid (e.g. areas far from the viewer), can free some computational resources for other use. For an example of a procedural water implementation, see [4]. 3.2 Stable Fluids The Stable Fluids algorithm, presented by Jos Stam [15] in 1999, is an algorithm which uses a semi-lagrangian approach to solving the Navier-Stokes equation. Over the years, the algorithm has become one of the most widespread methods for simulating different 11

18 12 Chapter 3. An Overview of Different Simulation Methods kinds of fluid in the field of computer graphics. Since it uses a semi-lagrangian integration scheme it is guaranteed to be stable for arbitrarily large time-steps, a feature which is very appreciated in the computer graphics field, especially when the simulation needs to run in real-time. The algorithm is also well suited for parallel implementation, for example on a GPU. Another fact that has contributed to the popularity of the algorithm is that it is suitable for both two- and three-dimensional implementations. The algorithm solves the different parts of the Navier-Stokes equation sequentially and guarantees conservation of volume as long as the steps of the equation are performed in the correct sequence. At a high level the algorithm can be described as: For each time-step n: Advect the velocity field. ( u A = advect( u, t, u)) Add external forces ( u B = u A + tf external ) Diffuse the velocity field. ( u C = diffuse( u)) Project the velocity field to the divergence free surface. ( u n+1 = project( u C )) Each part of the above algorithm will be explained in the sections below. For a thorough explanation of stable fluids, including implementation details, see for example [1] Advection Advection is the process by which a quantity is transported within the fluid. This process can be used for any quantity, including self transportation of the fluid itself (advecting the velocity field of the fluid). Q = advect( u, t, Q) (3.1) As described in Section The Semi-Lagrangian View, the positions in the grid are considered to be arrival points for fluid particles. This means that the value of a quantity Q at a certain point is conceptually caused by particles carrying the quantity arriving at the point in the current time-step. In practice, this means that to advect quantity Q, the velocity field is sampled at each grid point p, yielding a velocity u p. Since the particles arrived at p, moving with velocity u p in this time-step, the position at which they started is p 0 = p tv p. The value Q p0 of quantity Q at the start position p 0 is then added to Q at position p External Forces Adding external forces to the velocity field is the easiest part of the simulation. Simply multiply the external forces by the time step and add this to the velocity field. Assuming that the forces do not change significantly during a time step, this is an adequate approximation.

19 3.3. Smoothed Particle Hydrodynamics Diffusion u = diffuse( u) (3.2) The process of diffusing the velocity field is done to simulate the viscosity of the fluid. For inviscid fluids this step can be skipped. The equation that needs to be solved is: u t = ν 2 u (3.3) However, solving this equation explicitly might lead to instabilities when the viscosity (ν) is large. Therefore, an implicit formulation of the above equation is often used: (I ν t 2 ) u = u (3.4) This implicit formulation can be solved numerically in a stable way Projection An explanation to why this step is called projection might be a good place to start. As the purpose of the step is to make the velocity field divergence free, repeated applications of this operator on an already divergence free field would produce the same field. This is, by definition, a projection in mathematical terms. u = project( u) (3.5) As stated by the mathematical theorem called Helmholtz-Hodge Decomposition, any vector field w can be expressed as the sum of a divergence free vector field u and the gradient of a scalar field q: Multiplying both sides of this equation yields w = u + q (3.6) w = u + q = 2 q (3.7) Which is a Poisson equation. This equation is solved iteratively for q. The result is then used to compute the divergence free velocity field u: u = w q (3.8) 3.3 Smoothed Particle Hydrodynamics When the Navier-Stokes equation was presented in Section 2 The Physics of Fluids, fluid particles were used to describe the behavior and properties of the fluid. An intuitive way of simulating a fluid would thus be to represent it using a particle system. As the name suggests, this is exactly what the Smoothed Particle Hydrodynamics (SPH) method does [11]. Each particle in an SPH simulation carries with it attributes about the part of the fluid it represent. To be able to solve the Navier-Stokes equation the values of these attributes need to be continuously defined at all points inside the fluid, but the attributes are only defined at individual particles. To achieve continuity SPH uses distance based

20 14 Chapter 3. An Overview of Different Simulation Methods averages of the particle attributes. These averages are smoothed by applying a kernel function. To decrease the computational expense of performing these sums, SPH uses a cut-off radius to decide which particles are of interest when evaluating an attribute value at a specific point. Figure 3.1: Cut-off radius for an SPH-particle The kernel function should be symmetric around the evaluation point, in order to uphold Newton s Third Law ( For every action, there is an equal and opposite reaction ). Otherwise conservation of momentum can not be guaranteed. The kernel function should also be normalized, meaning that its integral over the fluid volume should equal one. W( x x i )d r i = 1 (3.9) First, a smoothed density is computed. Using that, an arbitrary attribute A can be calculated using the following formula: A smoothed = j m j A j ρ j W( x x i ) (3.10) This formulation has the nice property that the gradient of the field can be computed simply by replacing the kernel by the gradient of the kernel. A smoothed = j m j A j ρ j W( x x i ) (3.11) The same principle holds for the Laplacian, giving rise to the formulation: 2 A smoothed = j m j A j ρ j 2 W( x x i ) (3.12) Kernel Functions A popular kernel function is the poly6 function, because it is simple to evaluate and works well in many situations. There are many other types of kernels that one can use. W poly6 (r) = πd 9 { (d 2 r 2 ) 3 0 r d 0 otherwise (3.13)

21 3.3. Smoothed Particle Hydrodynamics Solving the Navier-Stokes Equation With the basic properties of SPH established, it is time to look at how the different terms of the Navier-Stokes equation are evaluated. As described in Section 2 The Physics of Fluids, the Navier-Stokes equation is: u t + u u = 1 ρ p + ν 2 u + 1 ρ F external (3.14) According to the definition of the material derivative (see Equation (2.4)) the term u u represents the rate of change of a quantity caused by the movement of particles into or out of the point where it is evaluated. Because SPH is a particle based method, a fully Lagrangian view is used. Hence, evaluation points used when solving the Navier- Stokes equation are always at the position of a particle. Because of this, there is no question of particles entering or exiting an evaluation point, and the u u term of the material derivative is always zero. Thus, the Navier-Stokes equation used in SPH is: u t = 1 ρ p + ν 2 u + 1 ρ F external (3.15) Rewriting this leaves three forces on the right hand side, which should sum up to the change of momentum on the left hand side: ρ u t = p + µ 2 u + F external = F pressure + F viscosity + F external (3.16) Density The density needs to be known at each particle in order to calculate the smoothed averages of the force terms, as described in Section 3.3 Smoothed Particle Hydrodynamics. Expressing the density as a smoothed average, causes the density term to cancel out, giving a simple method for calculating the local density at each particle: ρ i = j m j W( x x i ) (3.17) Pressure Expressing the pressure force using a smoothed average, gives the expression: F pressure ( x i ) = p( x i ) j m j p j ρ j W( x i x j ) (3.18) Unfortunately the above formulation of the pressure force is not symmetric. To see this, consider two particles P and Q with different local pressures. In this case, the pressure force for P is only dependent on the pressure at Q, and vice versa. Because of this the pressure forces arising from the interaction of P and Q have different magnitudes. This violates Newton s Third Law, and momentum is therefore not conserved. In fact what is really of interest when calculating the pressure force is the difference in local pressure between the two particles. There are several methods of making the pressure term symmetric. One solution that is simple to implement and yields stable results is:

22 16 Chapter 3. An Overview of Different Simulation Methods F pressure ( x i ) = p( x i ) j m j p i + p j 2ρ i ρ j W( x i x j ) (3.19) Using this (or a similar symmetric formulation), conservation of momentum can be guaranteed. In order to calculate the force as described above, the local pressure at each particle position needs to be known. This pressure can be determined using the ideal gas equation: p = c 2 s(ρ ρ 0 ) (3.20) This equation provides a relation between the local density ρ, and the local pressure p at a particle. The constant ρ 0 is the fluid reference density, and c s is the speed of sound in the fluid medium. In practice, the speed of sound constant c s must be set to a value significantly lower than the actual speed of sound, because the higher c s is, the shorter the time-step needs to be to avoid inordinately large pressure forces for small density differences Viscosity The viscosity term suffers from the same problems regarding symmetry as the pressure term. However, since the viscosity only depends on velocity, a natural solution to this problem is to use the relative velocity between two particles when evaluating. The formulation for the viscosity term is then: F viscosity ( x i ) = µ 2 u i µ j m j u j u i ρ j 2 W( x i x j ) (3.21) External Forces Adding external forces to an SPH simulation can be done in several ways. One way is to apply forces to individual particles. Alternatively a smoothed average approach, analogous to the one used for the pressure and viscosity forces, can be used Incompressibility As a method, SPH was originally devised to simulate compressible fluids [11]. The application to incompressible fluids is thus something that the model was not originally intended for. Using the formulation of the pressure force described in Section Pressure, incompressibility can only be achieved with an extremely small time-step, and a realistic value for the speed of sound. This is impractical for simulations performed on current hardware. However, a method similar to that used in Stable Fluids can be used, wherein a Helmholtz-Hodge decomposition and projection is used to project the compressible velocity field to a divergence free incompressible field. This requires that a system of equations be solved, using for example, Conjugated Gradient, or Gauss-Seidel. This part of the simulation often becomes the most time consuming, and is currently not suitable for real-time simulations. A parameter of interest here is the Mach number, which is defined as M = c c s, where c is the speed of the flow and c s is the speed of sound in the fluid. Compressibility

23 3.4. Wave Particles 17 effects are O(M 2 ) so keeping the Mach number small will lessen the compressibility of the fluid. Unfortunately the solution is not that simple. If the time step is to large, increasing the speed of sound will increase local pressure deviations which may lead to the simulation exploding. Considering these factors, the constant c s should be set to a suitable value for the simulation Boundary Conditions As is the case for any method that tries to solve the Navier-Stokes equation, what happens at the boundaries of the simulation needs to be taken into account. In SPH, enforcing the correct boundary conditions is difficult. Several suggestions on how to approach the problem have been proposed. Most of them are based on the idea of placing imaginary particles with slightly different properties at the boundaries. Many types of such boundary particles have been proposed, both implicitly defined boundary particles and explicit particles incorporated into the simulation. These particles are often referred to as Ghost Particles. Implementing good boundary conditions is difficult and many papers have been written on the subject. A good place to start might be [10] or [9] Comments 3.4 Wave Particles The Wave Particle algorithm was presented at SIGGRAPH 2007 (see [20] and [19]). The method is not directly based on solving the Navier-Stokes equations, but instead it is founded on the physical principles of conservation of momentum and conservation of volume (which is applicable when the fluid being simulated is incompressible). The method is designed to work in real-time and produce visually plausible results rather than as a method for highly realistic simulations of physical behavior. The method works fairly well in a macroscopic sense, i.e. it gives a rough approximation of wave propagation in a flow-less fluid. Since the model does not consider the water depth in any way, it is only suitable for simulations where the fluid has uniform depth. The method relies on a large number of parameters that must be configured, such as wave lengths and propagation speed (in relation to the overall scale of the scene); the resolutions of the grids used to compute submerged volume; the resolution of the collision meshes for objects in the fluid; etc. The method should be able to produce realistic results if proper values are used for the wave parameters, if the resolutions mentioned above are very high, and the integration time step is very low. It would still not consider water depth and thus not be in any way suitable for shoreline simulations. The model must also be extended to support individual wavelengths for different waves. By doing this many of the properties which permit real-time implementation are lost. If one wishes to produce high precision simulations of fluids and have the time and computational facilities to do so, other methods 1, which consider a larger number of fluid properties, would provide a far more correct simulation. Since water movement is a three dimensional problem and this method reduces the problem space to two dimensions. Corners will be cut with respect to true physical 1 eg. smoothed particle hydrodynamics, the shallow water equation

24 18 Chapter 3. An Overview of Different Simulation Methods behaviour. A pre-condition of the method is that the fluid is flow-less, meaning that no movement inside the fluid will be respected. Neither will any consideration be given to the water depth, a factor that has a great impact when it comes to waves. The main physical properties that the method respects are mass- and energy conservation. The model implicitly accounts for energy lost due to the viscosity of the fluid, by killing off wave particles when they become too small. Ideally the amplitude at which a particle is removed from the simulation should be sufficiently low such that the energy loss is continuous, however setting this value too low results in a significant performance drop, making this an important trade-off. The algorithm is, as the name suggests, a particle based method of simulating waves on the surface of a body of incompressible and globally flow-less fluid. At the heart of the method lies the so called wave particle, which represents a wave. Each wave carries with it information about volume, speed and propagation direction. Since the method aims to simulate surface waves, the particles are propagated in a plane and smoothed together to produce wavefronts. The algorithm uses a combination of sine waves to generate wavefronts based on the particles. The real-time aspects enter through the possibility to schedule particle events such as interaction with boundaries. This is made possible by the assumption of a flow-less fluid, and because of it the position updates of particles can be made implicit, thus saving valuable computational time. The method suggests ways to handle two way object-water coupling. Wave particles are generated at the boundaries of solids, the particles volume, speed and propagation direction based on the volume displaced by the object, the interaction from object to water in solved. The interaction from water to object is done by generating a velocity field based on the waves throughout the simulation Wave Simulation As stated earlier, the method simulates waves propagating on the surface of a fluid. The simulation method views the fluid as a planar height field z = ν z ( x, t), which gives the height offset z above the fluid s reference plane, given a point x at the time t. Since the method is supposed to simulate waves, this height map function must satisfy the second-order wave equation: 2 z = 1 c 2 2 z t 2 As two waves meet they do not collide. They pass through each other, keeping their shape and direction, but interacting in such a way that the waves become superimposed, i.e. the two waveforms add to form another more complex waveform. This is called interference. Because of this phenomenon, the total deviation function ν( x, t) can be formulated as the sum of a set of individual local deviation functions D i, each representing a wave. ν( x, t) = i D i ( x, t) To find a suitable D i function, a wave front could be divided into infinitesimally thin slices, thus reducing the problem to finding a proper wave function for the case of the two dimensional cross-section. In two dimensions a sinusoidal function can be defined that has the needed properties. So, the individual local deviation D i ( x, t) functions could be defined as:

25 3.4. Wave Particles 19 D i ( x, t) = a i W i ( x x i ), where x represents the center of the particle and x i the local offset. Furthermore, the wave function W could be defined as W i (u) = 1 ( ( )) ( ) 2πu u cos + 1 Π, 2 l i where Π is a rectangle function which bounds the function. According to [20], this is a good wave function since it is non-zero over a finite range and has a zero derivate at the endpoints. This choice of function also makes it easy to create continuous waves by alternating the sign of the amplitude and creating particles at a fixed spacing. If this wave function is extended to three dimensions, each particle could be thought of as a blob where the amplitude in the direction perpendicular to the propagation direction is calculated according to a blending function. This gives us this individual deviation function, for the three dimensional case: D i ( x, t) = a i W i (u)b(v) In the above equation u = û ( x x i ) and v = û ( x x i ), with û being the propagation direction of the particle. The blending function being somewhat arbitrary. Any function that has finite support and whose translates sum to one is acceptable. So far only the transversal waves have been accounted for. In reality, there are two kinds of waves that can propagate through a fluid: transversal and longitudinal waves. l i (a) Longitudinal Waves (b) Transverse Waves (c) Combined Waves Figure 3.2: Transverse and longitudinal waves These longitudinal waves play an important role in the interaction with objects and when creating a visually realistic simulation. They are the cause of the circular motion patterns exhibited by an object floating in a fluid. In order to incorporate longitudinal waves, the height field is extended to include a tangential deviation at each point. The definition of this extended height field then becomes: x ( x, t) = x + ν z ( x, t) + ν xy ( x, t), where ν xy ( x, t) is the horizontal component. This function can be defined as: ν xy ( x, t) = i D L i ( x, t), with the longitudinal local deviation function defined as:

26 20 Chapter 3. An Overview of Different Simulation Methods D L i ( x, t) = L i (û ( x x i ))D i ( x, t). The vector function L describes the longitudinal waveform. A waveform function which corresponds to the transversal waveform function is: ( ) 2πu L i (u) = sin Π l i ( u l i ) û. Figure 3.3: Waveform function We have now defined a method for representing the shape of the fluid surface using a number of local deviation functions. All that remains is making waves propagate, and we will have a representation of a fluid surface. Here each local deviation function described above can be viewed as attached to a particle. Wherever the particle moves, that is where the local deviation function will be applied to the height field. Here the fact the waves move in straight lines can also be exploited, meaning that once a particle is created with a certain direction, it will always move in that direction, unless it hits an object (and is reflected). Since the speed of the wave is constant, and is known when the particle is created, the time at which such reflections occur can be determined at creation time, and an event can be scheduled to take care of it. In other words, there is no need to continuously detect collisions against the static environment Wave Fronts The discussion above only considered individual fluid parcels, or individual wave bumps travelling over the surface of the fluid. In reality, most waves are part of a wave front. To simulate wave fronts, all particles are created with a dispersion angle. Using this, it is possible to determine when the distance between two particles that are part of the same wave front becomes so large that the gap between them becomes visible. When this happens, the particle is split into three new particles, each having a third of the amplitude, and a third of the propagation direction of the original particle. One of them is placed at the original particle s position, while the other two are placed at either side of the original particle, in such a way as to make it appear as if they have always existed. This process conserves the volume of the fluid, since the total volume of the three new particles equal the volume of the original particle. Because the fluid is assumed to have constant density, this also leads to conservation of mass, and since the velocity of the particles is not changed, momentum is also conserved.

27 3.4. Wave Particles 21 (a) Individual wave particles (b) Wave particles smoothed into a wave front Figure 3.4: Construction of wave fronts from individual wave particles (a) Initial particle at start position (b) Particle has reached distance for subdivision (c) Subdivided particles with new dispersion angles Figure 3.5: Particle subdivision It should be noted that the time at which a particle needs to be subdivided can be determined at the time the particle is created Updating the Simulation Because of the ability to determine the time at which reflection- and subdivision events occur, the simulation of the wave particles can be made completely event-based. This means that we do not need to update every particle at each simulation frame, but only need to consider the events which have been scheduled for a particular frame. The positions of the particles are easily calculated when needed, as long as the speed, propagation direction, start position, and creation time are known. This makes the simulation suitable for execution on a GPU (with the event handling running on the CPU) Fluid Object Interaction The interaction between the fluid and solid objects is split up into two one-way couplings. Object to Fluid Coupling An object, fully or partially submerged, affects the surface by interacting with existing waves and generating new waves. Due to the additive property of waves two waves with identical amplitude, but different signs, will effectively cancel each other out. Using this

28 22 Chapter 3. An Overview of Different Simulation Methods fact, no modification of existing particles needs to take place, instead new particles are created. The amplitude 2 of each new particle is based on the volume displaced at the point where it is created. No collision detection is carried out with the particles, instead the extended height map described in Section Wave Simulation is used to calculate the submerged part of the object. This approach is based on volume conservation rather than being energy conserving. This energy dissipation is in general not a problem, because in reality a portion of energy is lost due to heat and turbulence and viscosity effects. For the wave generation each entry in the height map is considered to represent a vertical cell containing the fluid. This way an amplitude change in the cell corresponds to a change in volume. The wave direction is based on the pressure differences at the point where the wave is created. In effect, a particle with positive amplitude is generated where the object is pushing the fluid, and a particle with negative amplitude is generated where the object is pulling the fluid. If the object is not fully submerged, the waves move away from the object, otherwise they move towards the object. (a) (b) (c) (d) Fluid to Object Coupling There are three forces acting on an object which are simulated by this method: buoyancy, drag and lift. The buoyancy force applied to the object is equal to the submerge volume times the density of the fluid, taken in the negative direction of the gravity field. F bouyancy = gρv displaced Where the g in the above equation represents the gravity field. The drag and lift forces, as described in Section 2.5 Drag and Lift, are computed per object surface and are based on the relative movement of the surface compared to the fluid. The total dynamic force acting on the object is the sum of all drag and lift forces acting on the object. 2 implicitly their volume

29 3.5. Comments 23 Figure 3.6: Buoyancy force for an object Figure 3.7: The directions of drag and lift forces for a triangle 3.5 Comments As one can see, the methods described above differ very much in their approach to simulating water. The SPH and Stable Fluids algorithms both aim to solve the Navier-Stokes equation. They are thus suitable for high precision simulations of water movement. The wave particle method is devised for generating visually plausible results, rather than very realistic, high precision simulations. It implements the physical properties of volume conservation and incompressibility. Both the stable fluid and the SPH approach can be run as both two dimensional and three dimensional simulations, thus giving the user a wide range of applicable areas for the techniques. The wave particle approach simulates surface movement, thereby reducing the problem dimension from three to two dimensions. By doing this and using the additive property of waves, large scale real time simulations can be simulated. The stable fluids algorithm is grid based and infinitely stable, thus a good choice if a spatially bound fluid volume is to be simulated. SPH is particle based and intuitively a good choice if there are no well defined bounds for the fluid. SPH further suffers from the fact that the method is originally designed for simulation compressible fluids, forcing the implementor to take certain aspects into consideration to assure that the simulation will not blow up when the time step increases.

30 24 Chapter 3. An Overview of Different Simulation Methods

31 Chapter 4 Implementation Since the thesis work has been done for a company, certain restrictions for the project had to be enforced. These include the choice of graphics engine, platform and physics engine. Resolution Interactive, the company in question, develop for the Microsoft Windows platform and are currently working with Emergent s Gamebryo 1 as their graphic engine and Ageia PhysX 2 as their physics engine. Since Gamebryo uses Microsoft s DirectX on the Windows platform, all shader code have been implemented using HLSL. 4.1 Implementation of Wave Particles The method is (as stated in Section 3.4 Wave Particles) particle based, hence functionality to dynamically handle particles needs to be implemented. In our solution a batch method has been used. Particle batches are created as needed and existing batches are kept as full as possible without reducing the overall performance by moving data around. When a new wave-particle is created it is placed in the first batch which is not full. As particles are removed from the simulation, the batches containing them mark their slot as unused, thereby allowing new particles to be created in their place. Empty batches are pruned from the simulation in an early stage of the pipeline. The model considers each particle to be an individual entity without any dependencies on neighboring particles. This property makes the model suitable for a parallel implementation, for example on a GPU. The model further supports implicit position updating, which means that there is no need to modify a particle on the CPU, once it has been created. A particle s current position is calculated using the current time in combination with the velocity and start position of the particle. There are certain things that need to be handled on the CPU: subdivision of particles and reflection of particles against static objects. Subdivision of a particle occurs when the particle no longer covers the arc represented by its dispersion angle, see Figure Reflections occur when a particle collides with a static object. Both of these events can be scheduled since the time at which they will occur can be calculated at the creation time of the particle. As a subdivision event occurs, the current particle is removed and three new particles are created. Each with a third of the original particle s dispersion angle and amplitude. The new particles directions are assigned in such a way that they together cover the same arc as their parent. Upon a reflection event, the particles

32 26 Chapter 4. Implementation direction is mirrored around the incident normal of the static object with which it is colliding, and its start position is mirrored in the collision plane. To avoid the need to calculate collisions between dynamic objects and wave-particles, particles are rendered to an extended height map, see Section 5.1 Extended Height Map. It is at this stage that the implicit position update is performed. Each particle is rendered as a point sprite using a pre-calculated blob -texture representing the local deviation caused by the particle. All particles are rendered with additive blending to a texture. This texture is then used as the representation of the fluid surface when rendering the water. In addition the extended height map is rendered to a regular height map which is used for intersection tests with dynamic objects. Collision volumes for dynamic objects are arbitrary, closed triangle-meshes. These collision meshes are used to calculate the buoyancy force for the object. Each object is rendered using an orthographic top view. The drag and lift forces are calculated per triangle. A special mesh consisting of a pre-projected list of points, one for each face in the collision mesh, containing information about each triangle s normal and area. The acting forces are calculated on the GPU and read back to the CPU where the forces are applied to the bodies. In the same pass, wave generation data is calculated. This data consists of a displaced volume for each triangle and is used on the CPU to generate wave particles. Figure 4.1: A water surface rendering, showing the calculated height map texture. As the final height map is rendered, horizontal displacements are clamped to remove artifacts caused by the limitations inherent in an extended height map. Most notably to prevent the geometry from turning inside out when waves should break. The implementation supports visualization of the water by using a static grid or a projected grid, see Section 5.2 Projected Grid. Reflection and refraction is implemented using render to texture as described in Section 5.3 Reflection & Refraction Approximations. For unbounded waters, no reflection events are created. Particles are removed early

33 4.2. Implementation of Stable Fluids 27 if they are detected as being outside the simulation without the possibility to enter again. The simulation area is always limited, but in the case of an unbounded water it is moved along with the player object. For static grids, the simulation is set to cover the full area of the water. Using this method it is actually computationally cheaper to simulate unbounded water than bounded Algorithm 1. For each event in the queue: (a) Reflection Event: Reflect the particle against a static object. (b) Subdivision Event: If the particle s amplitude is below a certain threshold, it is removed from the simulation. Otherwise the particle is subdivided by replacing it with three smaller particles. 2. Render the particles to the extended heightmap as well as to the velocity map (using the precalculated particle textures). 3. For each dynamic item: (a) Render the immediately surrounding part of the extended heightmap to a regular heightmap. (b) Collide the object with the regular heightmap, and generate interaction forces (applied to the object), and new wave particles. 4. Apply external forces (such as gravity and engine forces) on the dynamic objects. 5. Perform a physics step. 4.2 Implementation of Stable Fluids Since the wave model does not support flow inside the fluid in any way, a Stable Fluid implementation has been implemented as a complement to improve the visual aspect of the water. The implementation calculates local flow around dynamic bodies inside the simulation area, but it could also be extended to determining global flows, such as those occurring in a river. The Stable Fluid solver has been implemented on the GPU by using render to texture. Each part of the Navier-Stokes equation is calculated in a separate render pass. Jacobiiteration is used to solve the partial differential equations. The visualization of the flow is done by transporting particles near the surface of the water. This is also done on the GPU which means that there is no need to read anything back to the CPU. For a good reference on how to implement Stable Fluids on the GPU, see [6]. 4.3 Limitations As this implementation has been developed as part of a thesis project it should be seen more as a proof of concept for the purpose of evaluation of the technique, than as a production ready implementation. The major limitations and areas which could be improved will be presented in this section.

34 28 Chapter 4. Implementation As stated before the wave model does not support simulation of fluids with flow in any way. This might or might not be a limitation, depending on the type of application in which it would be used. A partial solution is to simulate flow using stable fluids or SPH for example, but the coupling between the models is non-trivial. The basic premise for wave particles is the assumption that it resides in a fluid without any global flow. Otherwise the implicit position update would be impossible and the real time aspect of the model would be lost (on todays hardware at least). The flow simulated in our solution is a purely visual effect. Even though it is based on physical phenomena no forces from the flow vector field are applied on the dynamic bodies and the flow velocity field does not affect the wave particles. Applying forces to dynamic bodies does not present any real problem. The problem is the connection between flow velocities and wave particle propagation. Another problem is that using a height map means that the geometry can not be used to visualize breaking (rolling) waves. To achieve this effect, another geometrical representation must be used. Further more, the implementation does not in any way represent splashes or foam. These types of effects can be implemented as particle effects or something similar. The wave particle model contains enough information to determine when a wave should break. This information can be used to determine when foam should be generated. There are a few limits on the implementation that could quite easily be removed, but they are present because of time constraints. The meshes used to calculate forces caused by interaction with the water must be closed and must not contain self-intersecting parts. In addition, many calculations are performed using vertex texture fetch, which is not generally available. Implementing an alternative using, for example, render to vertex buffer should be quite simple. The implementation has only been tested on nvidia cards of series 6000, 7000 and If this water implementation is to be used in a real application, there are a few things that should be optimized. Most notably, the wave particle generation could be made more efficient, by merging particles created sufficiently close to each other in the interaction with dynamic objects. Additionally, the buoyancy, drag and lift forces calculated for dynamic objects could be summed on the GPU reducing the amount of data that needs to be read back to the CPU. The current approach was chosen for simplicity of implementation and debugging and was not improved because of time constraints.

35 Chapter 5 Real-Time Visualization Techniques Since the goal of a fluid simulation in a game environment is to create a plausible image of reality, the visualization of the simulated results will have a large impact on the perceived results. Apart from the physics simulation eating away a large portion of the CPU/GPU, one has to consider networking and game-play to be likely to hog their share of the resources as well. The perfectly rendered, infinitely ray-traced image should also be finished when it s time to switch from the back-buffer every 1 60th or so of a second. Since this isn t reality today one has to resort to tricks and approximations when rendering the simulation. In this section a couple of common techniques used in fluid visualization will be described. 5.1 Extended Height Map While a fixed grid might be very convenient when performing the simulation, it might not be optimal for visualizing waves since they have local deviations, not only in height, but in steepness as well. To be able to create a more plausible simulation one can resort to the usage of an extended height map, where each grid position not only contains an offset in the normal direction, but deviations in the tangential plane as well. 5.2 Projected Grid A significant problem with using a regular grid for visualizing large surfaces, such as an open ocean, is that the level of detail needed up close requires a highly tessellated mesh, while such tessellation is unnecessary (and unnecessarily computationally expensive) for the parts of the surface far away from the viewer. To remedy this problem, a number of different level of detail (LOD) schemes can be applied, such as dividing the surface into patches, and dynamically choosing a tessellation level for each patch based on its distance to the viewer (similar to geo-mipmapping). Another simpler solution is to use a so called projected grid. The idea is to use a fixed size grid and divide this uniformly over the visual area. The difference to the regular grid approach, being that the division is done in projection space thereby effectively implementing an adaptive LOD while at the same time utilizing 29

36 30 Chapter 5. Real-Time Visualization Techniques Figure 5.1: Extended height map the triangle count to the fullest. With state of the art graphics cards this can be done directly on the GPU. An approach taken by the authors while implementing this thesis consists of finding a slightly larger frustum containing the actual view frustum. Calculating the intersection points with the fluid surface and interpolating the vertex positions linearly in projection space using the vertex shader. For a more thorough explanation of this technique see, for example, [7]. 5.3 Reflection & Refraction Approximations As mentioned before, current hardware is, at the time of writing, not yet capable of raytracing large scenes consisting of arbitrary objects in real-time. Therefore, an efficient method for approximating surface reflections and refraction must be found, whose results are still perceived as correct by a viewer. Refraction is especially difficult to implement correctly when objects are allowed to intersect the surface of the fluid. For this reason refraction is often ignored. The usual way of implementing reflections is to render the geometry surrounding the fluid, reflected around a plane which approximates the fluid surface, to a texture. The surrounding geometry is then rendered normally (to provide the refraction part), and then the fluid is rendered, using the Fresnel equations (or more commonly an approximation if it) to determine how much of the reflection texture to blend over the refraction part of the scene. Refraction can be handled similar to the reflection, by rendering a refraction map, but as mentioned above, artifacts should be expected for objects just below or intersecting the surface.

37 5.4. Water Depth 31 Figure 5.2: Low resolution projected grid Figure 5.3: High resolution projected grid 5.4 Water Depth Coloring the rendered fluid according to its depth is an important effect in giving the fluid a sense of volume, and can improve the visual appearance of the rendered scene significantly. The simplest way of achieving depth based coloring is to render the geometry below

38 32 Chapter 5. Real-Time Visualization Techniques (a) Refraction (b) Reflection (c) The result of combining the refraction and reflection textures, and applying specular lighting Figure 5.4: Refraction and reflection rendering the fluid surface into a depth map. When the fluid is later rendered, the values of the depth map are used to select how much of the fluid color to blend in. 5.5 Caustics Caustics is a phenomenon caused by the refraction of light-rays at different angles as they hit the surface of a fluid, thus producing patterns of light and dark areas on the bottom and on objects inside the fluid. Caustics can increase the visual appeal of a computer generated fluid dramatically. Since physically correct caustics effects involve lots and lots of ray-tracing, they are extremely expensive to calculate. For real-time application an alternative to ray-tracing is to use a procedural method to approximate the effect. Very plausible results can be achieved this way, at extremely low computational cost. To create a caustic effects a dynamically generated caustic map can be used, in effect

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

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

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

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

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

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

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

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

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

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

Example 13 - Shock Tube

Example 13 - Shock Tube Example 13 - Shock Tube Summary This famous experiment is interesting for observing the shock-wave propagation. Moreover, this case uses the representation of perfect gas and compares the different formulations:

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

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

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

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

Lecture 1.1 Introduction to Fluid Dynamics

Lecture 1.1 Introduction to Fluid Dynamics Lecture 1.1 Introduction to Fluid Dynamics 1 Introduction A thorough study of the laws of fluid mechanics is necessary to understand the fluid motion within the turbomachinery components. In this introductory

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

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

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

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

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

ENERGY-224 Reservoir Simulation Project Report. Ala Alzayer

ENERGY-224 Reservoir Simulation Project Report. Ala Alzayer ENERGY-224 Reservoir Simulation Project Report Ala Alzayer Autumn Quarter December 3, 2014 Contents 1 Objective 2 2 Governing Equations 2 3 Methodolgy 3 3.1 BlockMesh.........................................

More information

Introduction to C omputational F luid Dynamics. D. Murrin

Introduction to C omputational F luid Dynamics. D. Murrin Introduction to C omputational F luid Dynamics D. Murrin Computational fluid dynamics (CFD) is the science of predicting fluid flow, heat transfer, mass transfer, chemical reactions, and related phenomena

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

Development of the Compliant Mooring Line Model for FLOW-3D

Development of the Compliant Mooring Line Model for FLOW-3D Flow Science Report 08-15 Development of the Compliant Mooring Line Model for FLOW-3D Gengsheng Wei Flow Science, Inc. October 2015 1. Introduction Mooring systems are common in offshore structures, ship

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

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

3D Simulation of Dam-break effect on a Solid Wall using Smoothed Particle Hydrodynamic

3D Simulation of Dam-break effect on a Solid Wall using Smoothed Particle Hydrodynamic ISCS 2013 Selected Papers Dam-break effect on a Solid Wall 1 3D Simulation of Dam-break effect on a Solid Wall using Smoothed Particle Hydrodynamic Suprijadi a,b, F. Faizal b, C.F. Naa a and A.Trisnawan

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

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

Introduction to Computational Fluid Dynamics Mech 122 D. Fabris, K. Lynch, D. Rich

Introduction to Computational Fluid Dynamics Mech 122 D. Fabris, K. Lynch, D. Rich Introduction to Computational Fluid Dynamics Mech 122 D. Fabris, K. Lynch, D. Rich 1 Computational Fluid dynamics Computational fluid dynamics (CFD) is the analysis of systems involving fluid flow, heat

More information

Lagrangian and Eulerian Representations of Fluid Flow: Kinematics and the Equations of Motion

Lagrangian and Eulerian Representations of Fluid Flow: Kinematics and the Equations of Motion Lagrangian and Eulerian Representations of Fluid Flow: Kinematics and the Equations of Motion James F. Price Woods Hole Oceanographic Institution Woods Hole, MA, 02543 July 31, 2006 Summary: This essay

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

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

Chapter 1 - Basic Equations

Chapter 1 - Basic Equations 2.20 Marine Hydrodynamics, Fall 2017 Lecture 2 Copyright c 2017 MIT - Department of Mechanical Engineering, All rights reserved. 2.20 Marine Hydrodynamics Lecture 2 Chapter 1 - Basic Equations 1.1 Description

More information

Lecture 7 Notes: 07 / 11. Reflection and refraction

Lecture 7 Notes: 07 / 11. Reflection and refraction Lecture 7 Notes: 07 / 11 Reflection and refraction When an electromagnetic wave, such as light, encounters the surface of a medium, some of it is reflected off the surface, while some crosses the boundary

More information

Coupling of STAR-CCM+ to Other Theoretical or Numerical Solutions. Milovan Perić

Coupling of STAR-CCM+ to Other Theoretical or Numerical Solutions. Milovan Perić Coupling of STAR-CCM+ to Other Theoretical or Numerical Solutions Milovan Perić Contents The need to couple STAR-CCM+ with other theoretical or numerical solutions Coupling approaches: surface and volume

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

Continued Investigation of Small-Scale Air-Sea Coupled Dynamics Using CBLAST Data

Continued Investigation of Small-Scale Air-Sea Coupled Dynamics Using CBLAST Data Continued Investigation of Small-Scale Air-Sea Coupled Dynamics Using CBLAST Data Dick K.P. Yue Center for Ocean Engineering Department of Mechanical Engineering Massachusetts Institute of Technology Cambridge,

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

ANSYS AIM Tutorial Turbulent Flow Over a Backward Facing Step

ANSYS AIM Tutorial Turbulent Flow Over a Backward Facing Step ANSYS AIM Tutorial Turbulent Flow Over a Backward Facing Step Author(s): Sebastian Vecchi, ANSYS Created using ANSYS AIM 18.1 Problem Specification Pre-Analysis & Start Up Governing Equation Start-Up Geometry

More information

Thompson/Ocean 420/Winter 2005 Internal Gravity Waves 1

Thompson/Ocean 420/Winter 2005 Internal Gravity Waves 1 Thompson/Ocean 420/Winter 2005 Internal Gravity Waves 1 II. Internal waves in continuous stratification The real ocean, of course, is continuously stratified. For continuous stratification, = (z), internal

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

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

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

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

The viscous forces on the cylinder are proportional to the gradient of the velocity field at the

The viscous forces on the cylinder are proportional to the gradient of the velocity field at the Fluid Dynamics Models : Flow Past a Cylinder Flow Past a Cylinder Introduction The flow of fluid behind a blunt body such as an automobile is difficult to compute due to the unsteady flows. The wake behind

More information

INTRODUCTION REFLECTION AND REFRACTION AT BOUNDARIES. Introduction. Reflection and refraction at boundaries. Reflection at a single surface

INTRODUCTION REFLECTION AND REFRACTION AT BOUNDARIES. Introduction. Reflection and refraction at boundaries. Reflection at a single surface Chapter 8 GEOMETRICAL OPTICS Introduction Reflection and refraction at boundaries. Reflection at a single surface Refraction at a single boundary Dispersion Summary INTRODUCTION It has been shown that

More information

Coastal impact of a tsunami Review of numerical models

Coastal impact of a tsunami Review of numerical models Coastal impact of a tsunami Review of numerical models Richard Marcer 2 Content Physics to simulate Different approaches of modelling 2D depth average Full 3D Navier-Stokes 3D model Key point : free surface

More information

More Animation Techniques

More Animation Techniques CS 231 More Animation Techniques So much more Animation Procedural animation Particle systems Free-form deformation Natural Phenomena 1 Procedural Animation Rule based animation that changes/evolves over

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

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

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

Strömningslära Fluid Dynamics. Computer laboratories using COMSOL v4.4

Strömningslära Fluid Dynamics. Computer laboratories using COMSOL v4.4 UMEÅ UNIVERSITY Department of Physics Claude Dion Olexii Iukhymenko May 15, 2015 Strömningslära Fluid Dynamics (5FY144) Computer laboratories using COMSOL v4.4!! Report requirements Computer labs must

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

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

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

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

Table of contents for: Waves and Mean Flows by Oliver Bühler Cambridge University Press 2009 Monographs on Mechanics. Contents.

Table of contents for: Waves and Mean Flows by Oliver Bühler Cambridge University Press 2009 Monographs on Mechanics. Contents. Table of contents for: Waves and Mean Flows by Oliver Bühler Cambridge University Press 2009 Monographs on Mechanics. Preface page 2 Part I Fluid Dynamics and Waves 7 1 Elements of fluid dynamics 9 1.1

More information

Introduction to CFX. Workshop 2. Transonic Flow Over a NACA 0012 Airfoil. WS2-1. ANSYS, Inc. Proprietary 2009 ANSYS, Inc. All rights reserved.

Introduction to CFX. Workshop 2. Transonic Flow Over a NACA 0012 Airfoil. WS2-1. ANSYS, Inc. Proprietary 2009 ANSYS, Inc. All rights reserved. Workshop 2 Transonic Flow Over a NACA 0012 Airfoil. Introduction to CFX WS2-1 Goals The purpose of this tutorial is to introduce the user to modelling flow in high speed external aerodynamic applications.

More information

Physics Tutorial 2: Numerical Integration Methods

Physics Tutorial 2: Numerical Integration Methods Physics Tutorial 2: Numerical Integration Methods Summary The concept of numerically solving differential equations is explained, and applied to real time gaming simulation. Some objects are moved in a

More information

LATTICE-BOLTZMANN METHOD FOR THE SIMULATION OF LAMINAR MIXERS

LATTICE-BOLTZMANN METHOD FOR THE SIMULATION OF LAMINAR MIXERS 14 th European Conference on Mixing Warszawa, 10-13 September 2012 LATTICE-BOLTZMANN METHOD FOR THE SIMULATION OF LAMINAR MIXERS Felix Muggli a, Laurent Chatagny a, Jonas Lätt b a Sulzer Markets & Technology

More information

MAE 3130: Fluid Mechanics Lecture 5: Fluid Kinematics Spring Dr. Jason Roney Mechanical and Aerospace Engineering

MAE 3130: Fluid Mechanics Lecture 5: Fluid Kinematics Spring Dr. Jason Roney Mechanical and Aerospace Engineering MAE 3130: Fluid Mechanics Lecture 5: Fluid Kinematics Spring 2003 Dr. Jason Roney Mechanical and Aerospace Engineering Outline Introduction Velocity Field Acceleration Field Control Volume and System Representation

More information

CHAPTER 1. Introduction

CHAPTER 1. Introduction ME 475: Computer-Aided Design of Structures 1-1 CHAPTER 1 Introduction 1.1 Analysis versus Design 1.2 Basic Steps in Analysis 1.3 What is the Finite Element Method? 1.4 Geometrical Representation, Discretization

More information

A Particle Cellular Automata Model for Fluid Simulations

A Particle Cellular Automata Model for Fluid Simulations Annals of University of Craiova, Math. Comp. Sci. Ser. Volume 36(2), 2009, Pages 35 41 ISSN: 1223-6934 A Particle Cellular Automata Model for Fluid Simulations Costin-Radu Boldea Abstract. A new cellular-automaton

More information

Essay 1: Dimensional Analysis of Models and Data Sets: Similarity Solutions

Essay 1: Dimensional Analysis of Models and Data Sets: Similarity Solutions Table of Contents Essay 1: Dimensional Analysis of Models and Data Sets: Similarity Solutions and Scaling Analysis 1 About dimensional analysis 4 1.1 Thegoalandtheplan... 4 1.2 Aboutthisessay... 5 2 Models

More information

Continuum-Microscopic Models

Continuum-Microscopic Models Scientific Computing and Numerical Analysis Seminar October 1, 2010 Outline Heterogeneous Multiscale Method Adaptive Mesh ad Algorithm Refinement Equation-Free Method Incorporates two scales (length, time

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

Light. Form of Electromagnetic Energy Only part of Electromagnetic Spectrum that we can really see

Light. Form of Electromagnetic Energy Only part of Electromagnetic Spectrum that we can really see Light Form of Electromagnetic Energy Only part of Electromagnetic Spectrum that we can really see Facts About Light The speed of light, c, is constant in a vacuum. Light can be: REFLECTED ABSORBED REFRACTED

More information

18.02 Final Exam. y = 0

18.02 Final Exam. y = 0 No books, notes or calculators. 5 problems, 50 points. 8.0 Final Exam Useful formula: cos (θ) = ( + cos(θ)) Problem. (0 points) a) (5 pts.) Find the equation in the form Ax + By + z = D of the plane P

More information

Three Dimensional Numerical Simulation of Turbulent Flow Over Spillways

Three Dimensional Numerical Simulation of Turbulent Flow Over Spillways Three Dimensional Numerical Simulation of Turbulent Flow Over Spillways Latif Bouhadji ASL-AQFlow Inc., Sidney, British Columbia, Canada Email: lbouhadji@aslenv.com ABSTRACT Turbulent flows over a spillway

More information

Modeling icing using cartesian grids, penalization & level sets

Modeling icing using cartesian grids, penalization & level sets Introduction State of the art The proposed approach Proof of concept Modeling icing using cartesian grids, penalization & level sets Héloïse Beaugendre IMB Institut de Mathématiques de Bordeaux - INRIA

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

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

Simulation of Fuel Sloshing Comparative Study

Simulation of Fuel Sloshing Comparative Study 3. LS-DYNA Anwenderforum, Bamberg 2004 Netfreie Verfahren Simulation of Fuel Sloshing Comparative Study Matej Vesenjak 1, Heiner Müllerschön 2, Alexander Hummel 3, Zoran Ren 1 1 University of Maribor,

More information

Tutorial 1. Introduction to Using FLUENT: Fluid Flow and Heat Transfer in a Mixing Elbow

Tutorial 1. Introduction to Using FLUENT: Fluid Flow and Heat Transfer in a Mixing Elbow Tutorial 1. Introduction to Using FLUENT: Fluid Flow and Heat Transfer in a Mixing Elbow Introduction This tutorial illustrates the setup and solution of the two-dimensional turbulent fluid flow and heat

More information

C. A. D. Fraga Filho 1,2, D. F. Pezzin 1 & J. T. A. Chacaltana 1. Abstract

C. A. D. Fraga Filho 1,2, D. F. Pezzin 1 & J. T. A. Chacaltana 1. Abstract Advanced Computational Methods and Experiments in Heat Transfer XIII 15 A numerical study of heat diffusion using the Lagrangian particle SPH method and the Eulerian Finite-Volume method: analysis of convergence,

More information

Modeling External Compressible Flow

Modeling External Compressible Flow Tutorial 3. Modeling External Compressible Flow Introduction The purpose of this tutorial is to compute the turbulent flow past a transonic airfoil at a nonzero angle of attack. You will use the Spalart-Allmaras

More information

Preliminary Spray Cooling Simulations Using a Full-Cone Water Spray

Preliminary Spray Cooling Simulations Using a Full-Cone Water Spray 39th Dayton-Cincinnati Aerospace Sciences Symposium Preliminary Spray Cooling Simulations Using a Full-Cone Water Spray Murat Dinc Prof. Donald D. Gray (advisor), Prof. John M. Kuhlman, Nicholas L. Hillen,

More information

Homework 4A Due November 7th IN CLASS

Homework 4A Due November 7th IN CLASS CS207, Fall 2014 Systems Development for Computational Science Cris Cecka, Ray Jones Homework 4A Due November 7th IN CLASS Previously, we ve developed a quite robust Graph class to let us use Node and

More information

A mass-conservative version of the semi- Lagrangian semi-implicit HIRLAM using Lagrangian vertical coordinates

A mass-conservative version of the semi- Lagrangian semi-implicit HIRLAM using Lagrangian vertical coordinates A mass-conservative version of the semi- Lagrangian semi-implicit HIRLAM using Lagrangian vertical coordinates Peter Hjort Lauritzen Atmospheric Modeling & Predictability Section National Center for Atmospheric

More information

1 Mathematical Concepts

1 Mathematical Concepts 1 Mathematical Concepts Mathematics is the language of geophysical fluid dynamics. Thus, in order to interpret and communicate the motions of the atmosphere and oceans. While a thorough discussion of the

More information

THE preceding chapters were all devoted to the analysis of images and signals which

THE preceding chapters were all devoted to the analysis of images and signals which Chapter 5 Segmentation of Color, Texture, and Orientation Images THE preceding chapters were all devoted to the analysis of images and signals which take values in IR. It is often necessary, however, to

More information

CHAPTER 3. Elementary Fluid Dynamics

CHAPTER 3. Elementary Fluid Dynamics CHAPTER 3. Elementary Fluid Dynamics - Understanding the physics of fluid in motion - Derivation of the Bernoulli equation from Newton s second law Basic Assumptions of fluid stream, unless a specific

More information

Introduction to ANSYS CFX

Introduction to ANSYS CFX Workshop 03 Fluid flow around the NACA0012 Airfoil 16.0 Release Introduction to ANSYS CFX 2015 ANSYS, Inc. March 13, 2015 1 Release 16.0 Workshop Description: The flow simulated is an external aerodynamics

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

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

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

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

Computational Simulation of the Wind-force on Metal Meshes

Computational Simulation of the Wind-force on Metal Meshes 16 th Australasian Fluid Mechanics Conference Crown Plaza, Gold Coast, Australia 2-7 December 2007 Computational Simulation of the Wind-force on Metal Meshes Ahmad Sharifian & David R. Buttsworth Faculty

More information

Microwell Mixing with Surface Tension

Microwell Mixing with Surface Tension Microwell Mixing with Surface Tension Nick Cox Supervised by Professor Bruce Finlayson University of Washington Department of Chemical Engineering June 6, 2007 Abstract For many applications in the pharmaceutical

More information

Ch. 22 Properties of Light HW# 1, 5, 7, 9, 11, 15, 19, 22, 29, 37, 38

Ch. 22 Properties of Light HW# 1, 5, 7, 9, 11, 15, 19, 22, 29, 37, 38 Ch. 22 Properties of Light HW# 1, 5, 7, 9, 11, 15, 19, 22, 29, 37, 38 Brief History of the Nature of Light Up until 19 th century, light was modeled as a stream of particles. Newton was a proponent of

More information

Flow Structures Extracted from Visualization Images: Vector Fields and Topology

Flow Structures Extracted from Visualization Images: Vector Fields and Topology Flow Structures Extracted from Visualization Images: Vector Fields and Topology Tianshu Liu Department of Mechanical & Aerospace Engineering Western Michigan University, Kalamazoo, MI 49008, USA We live

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

Convection Cooling of Circuit Boards 3D Natural Convection

Convection Cooling of Circuit Boards 3D Natural Convection Convection Cooling of Circuit Boards 3D Natural Convection Introduction This example models the air cooling of circuit boards populated with multiple integrated circuits (ICs), which act as heat sources.

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

The goal is the definition of points with numbers and primitives with equations or functions. The definition of points with numbers requires a

The goal is the definition of points with numbers and primitives with equations or functions. The definition of points with numbers requires a The goal is the definition of points with numbers and primitives with equations or functions. The definition of points with numbers requires a coordinate system and then the measuring of the point with

More information

Non-Newtonian Transitional Flow in an Eccentric Annulus

Non-Newtonian Transitional Flow in an Eccentric Annulus Tutorial 8. Non-Newtonian Transitional Flow in an Eccentric Annulus Introduction The purpose of this tutorial is to illustrate the setup and solution of a 3D, turbulent flow of a non-newtonian fluid. Turbulent

More information