CSCI1950V Project 4 : Smoothed Particle Hydrodynamics

Similar documents
Particle-based Fluids

Smoothed Particle Hydrodynamics (SPH) Huamin Wang

Pressure corrected SPH for fluid animation

Game Physics. Game and Media Technology Master Program - Utrecht University. Dr. Nicolas Pronost

Soft Bodies. Good approximation for hard ones. approximation breaks when objects break, or deform. Generalization: soft (deformable) bodies

Fluid Animation. Christopher Batty November 17, 2011

An Overview of Fluid Animation. Christopher Batty March 11, 2014

Fluid Dynamics. Part 2. Massimo Ricotti. University of Maryland. Fluid Dynamics p.1/17

Smoothed Particle Hydrodynamics (SPH) 4. May 2012

Computational Astrophysics

Computing a null divergence velocity field. using smoothed particle hydrodynamics

Smooth Particle Hydrodynamic (SPH) Presented by: Omid Ghasemi Fare Nina Zabihi XU Zhao Miao Zhang Sheng Zhi EGEE 520

Math background. Physics. Simulation. Related phenomena. Frontiers in graphics. Rigid fluids

2. FLUID-FLOW EQUATIONS SPRING 2019

PDE Solvers for Fluid Flow

Physics-Based Animation

Basic concepts in viscous flow

Dan s Morris s Notes on Stable Fluids (Jos Stam, SIGGRAPH 1999)

CHAPTER 4. Basics of Fluid Dynamics

An improved MPS method for numerical simulations of convective heat transfer problems

Chapter 9: Differential Analysis

P 1 P * 1 T P * 1 T 1 T * 1. s 1 P 1

Modeling, Simulating and Rendering Fluids. Thanks to Ron Fediw et al, Jos Stam, Henrik Jensen, Ryan

Computational Fluid Dynamics 2

Chapter 9: Differential Analysis of Fluid Flow

1 Exercise: Linear, incompressible Stokes flow with FE

V (r,t) = i ˆ u( x, y,z,t) + ˆ j v( x, y,z,t) + k ˆ w( x, y, z,t)

Lecture 2: Hydrodynamics at milli micrometer scale

REE Internal Fluid Flow Sheet 2 - Solution Fundamentals of Fluid Mechanics

Chapter 1: Basic Concepts

Chapter 5. Sound Waves and Vortices. 5.1 Sound waves

Differential relations for fluid flow

Shell Balances in Fluid Mechanics

Heat and Mass Transfer over Cooled Horizontal Tubes 333 x-component of the velocity: y2 u = g sin x y : (4) r 2 The y-component of the velocity eld is

Chapter 5. The Differential Forms of the Fundamental Laws

Fluid-soil multiphase flow simulation by an SPH-DEM coupled method

Exam in Fluid Mechanics 5C1214

Smoothed Particle Hydrodynamics

Fluid Dynamics Exercises and questions for the course

Navier-Stokes Equation: Principle of Conservation of Momentum

Experience with DNS of particulate flow using a variant of the immersed boundary method

Physically Based Simulations (on the GPU)

Chapter 2: Fluid Dynamics Review

Exercise: concepts from chapter 10

Improvement of Calculation Stability for Slow Fluid Flow Analysis Using Particle Method *

Simulating Interfacial Tension of a Falling. Drop in a Moving Mesh Framework

Getting started: CFD notation

CS 542G: The Poisson Problem, Finite Differences

ASTR 320: Solutions to Problem Set 2

Fluid Mechanics. Spring 2009

Of The Navier Stokes Equations Nar Associates

MITOCW MIT8_01F16_L12v01_360p

ME 309 Fluid Mechanics Fall 2010 Exam 2 1A. 1B.

Code Timings of a Bulk Liquid Simulation

Chapter 1. Governing Equations of GFD. 1.1 Mass continuity

EULERIAN DERIVATIONS OF NON-INERTIAL NAVIER-STOKES EQUATIONS

Conservation of Mass. Computational Fluid Dynamics. The Equations Governing Fluid Motion

Principles of Convection

Models of ocean circulation are all based on the equations of motion.

Introduction to Turbulence AEEM Why study turbulent flows?

Relativistic Hydrodynamics L3&4/SS14/ZAH

6.1 Steady, One-Dimensional Rectilinear Flows Steady, Spherically Symmetric Radial Flows 42

Lectures 15: Parallel Transport. Table of contents

Ensemble averaged dynamic modeling. By D. Carati 1,A.Wray 2 AND W. Cabot 3

CENG 501 Examination Problem: Estimation of Viscosity with a Falling - Cylinder Viscometer

Mass Transfer in a Stirred Batch Reactor

Schwarzschild s Metrical Model of a Liquid Sphere

Christel Hohenegger A simple model for ketchup-like liquid, its numerical challenges and limitations April 7, 2011

A general theory of discrete ltering. for LES in complex geometry. By Oleg V. Vasilyev AND Thomas S. Lund

UNIT II CONVECTION HEAT TRANSFER

SPH for the Modeling of non-newtonian Fluids with Thermal-Dependent Rheology

(Jim You have a note for yourself here that reads Fill in full derivation, this is a sloppy treatment ).

fluid mechanics as a prominent discipline of application for numerical

- Marine Hydrodynamics. Lecture 4. Knowns Equations # Unknowns # (conservation of mass) (conservation of momentum)

Computational Simulation of Marangoni Convection Under Microgravity Condition

REE 307 Fluid Mechanics II. Lecture 1. Sep 27, Dr./ Ahmed Mohamed Nagib Elmekawy. Zewail City for Science and Technology

MOMENTUM PRINCIPLE. Review: Last time, we derived the Reynolds Transport Theorem: Chapter 6. where B is any extensive property (proportional to mass),

Modeling of dispersed phase by Lagrangian approach in Fluent

1. Introduction As is well known, the bosonic string can be described by the two-dimensional quantum gravity coupled with D scalar elds, where D denot

Basic Fluid Mechanics

A Continuous Counterpart to Schwarzschild s Liquid Sphere Model

Quasi-geostrophic ocean models

6. Basic basic equations I ( )

2 GOVERNING EQUATIONS

2 Equations of Motion

(Refer Slide Time: 2:14)

Interpreting Differential Equations of Transport Phenomena

To study the motion of a perfect gas, the conservation equations of continuity

Microscopic Momentum Balance Equation (Navier-Stokes)

On Mean Curvature Diusion in Nonlinear Image Filtering. Adel I. El-Fallah and Gary E. Ford. University of California, Davis. Davis, CA

The Rocket Equation. Lukas Lundin. 26th January 2016

Introduction to Heat and Mass Transfer. Week 9

( ) Notes. Fluid mechanics. Inviscid Euler model. Lagrangian viewpoint. " = " x,t,#, #

Fluid Mechanics Qualifying Examination Sample Exam 2

Prancing Through Quantum Fields

Viscous Fluids. Amanda Meier. December 14th, 2011

3. What type of force is the woman applying to cart in the illustration below?

The Divergence Theorem Stokes Theorem Applications of Vector Calculus. Calculus. Vector Calculus (III)

Application of Chimera Grids in Rotational Flow

Fluid Mechanics II Viscosity and shear stresses

Transcription:

CSCI1950V Project 4 : Smoothed Particle Hydrodynamics Due Date : Midnight, Friday March 23 1 Background For this project you will implement a uid simulation using Smoothed Particle Hydrodynamics (SPH). The main reference we will use is Lagrangian Fluid Dynamics Using Smoothed Particle Hydrodynamics by Kellager et al [3]. In particular, most of the equations below can be found in section four of the paper. If you implemented the NBody project before this correctly, this project should not be too dicult to write. Essentially the gravitational forces you computed for the previous project will be replaced by the forces of uid dynamics. The hardest part will probably adding in all the extra forces and tracking down any bugs. 2 Requirements Your SPH simulation can either be 2D or 3D. As with all other projects, computation should be done in GLSL, however for the 3D visualization we only require point sprites (for 2D) or spheres (for 3D). You do not need to compute an explicit uid surface for this project - a particle visualization is sucient. However, we encourage you to color the particles or spheres according to some metric (ie. pressure). While doing this in 3D means you have to change less code from your previous project (and things in 3D are of course cool), with a 2D simulation you will be able to add more particles per screen space, making the simulation look more interesting - it's up to you. You are required to implement all the internal and external forces covered in the Kelager 2006 paper and presented below, for one type (either liquid or gas). 1

Force Expression Liquid / Gas Mass Density 3.2.1 mj W default (r r j, h) L+G Surface normal 3.2.2 mj W default (r r j, h) L Pressure 3.2.1 p i+p j j i 2 W pressure (r i r j, h) L+G µ Viscosity 3.2.1 ρ i j (u j u i ) 2 W viscosity (r r j, h) L+G Gravity 3.2.2 ρ i g L Buoyancy 3.2.2 b(ρ i ρ 0 )g G Surface tension 3.2.2 σ ni mj n i 2 W default (r r j, h) L For example, if you choose to do liquid, you must implement mass, surface normal, pressure, viscosity, gravity, and surface tension. Since each kernel W is zero outside of the core radius h, you should use the spatial hashing from the last project to quickly nd all the nearest neighbors within about distance h so that you dont have to loop through every particle. Your particles should be contained within a box and should properly interact with the walls and oor. A ceiling is optional. You must implement rudimentary collision handling against walls - this can be as simple as checking if the location of a particle is outside the bounds of a box and if so reecting its velocity across the normal. For the visualization you should use spheres or point sprites (or other similar particle-like objects). You should also draw the boundaries of your system (ie. the walls) - you probably want to make these a wireframe so that the particles are visible through the walls. We are not requiring any complex graphical shaders for this project. You may keep the same integration scheme as the last project (Verlet), but feel free to experiment with other integration schemes as well. Finally you should experiment with dierent uid types (ie. change the mass and viscosity), as well as interactions between two or more dierent types of uids. Your writeup should be contained within a seperate html directory in your project. 3 Governing Equations This section simply summarizes the derivation and governing of equations of your simulation. You can nd all of these in. 3.1 Smoothed Particle Hydrodynamics (SPH) SPH is essentially an interpolation method and is based o of integral interpolants which use kernels to approximate the response of a delta function. By 2

denition, the integral interpolant, A I of a function A(r) over some space Ω is given by ˆ A I (r) = A(r )W (r r, h)dr Ω where r Ω, and W is a smoothing kernel with a width, or core radius of h. The choice of smoothing kernel W is important and careful selection can aect the accuracy of the interpolant. The kernel W satises the following four properties ˆ W (r, h)dr = 1 Ω lim h 0 W (r, h) = δ(r) W (r, h) 0 W (r, h) = W ( r, h) In practice, most kernels are Gaussian like, but the exact choice of kernel largely depends on what you are trying to interpolate. The discretized version of the SPH interpolant can be expressed as a summation A S (r) = j V j W (r r j, h) where the summation is over all particles j, and V j is the volume or area (in 2D) taken by particle j. Note that this holds only when is close to constant on V j (and is the integral as the volume of each particle goes to zero). Now recall that Substituting this into gives us V = m ρ A S (r) = j W (r r j, h) Now suppose we take the partial derivative between two particles, i and j in some direction, (in this case, the x direction), x A S(r i ) = ( ) W (r i r j, h) x Note that the quantity is constant relative to the x direction (or any other direction for that matter), which means we can treat it as a constant under dierentiation. Then ( ) x A S(r i ) = x W (r i r j, h) 3

It follows that the gradient of the integral interpolant for is simply Similarly, A S (r) = j 2 A S (r) = j W (r r j, h) 2 W (r r j, h) 3.2 Navier Stokes Equations The classical formulation of an incompressible Newtonian uid over time is given by the Navier Stokes (NS) equations. Inertia (per volume) { }} { ρ Mass density u t Unsteady acceleration + u u Convective acceleration = Divergence of stress { }} { p Pressure gradient + µ 2 u Viscosity Because we assume that density is constant (since the uid is incompressible), and the formula simplies to We can rewrite this to become u = 0 ρ u t = p + µ 2 u + f external ρ u = f internal + f external t u = ( f internal + f external) /ρ t a i = ( fi internal + fi external ) /ρi (1) Where the interal forces are the pressure and viscosity, while the external forces are things such as gravity. Thus, the acceleration of a particle i is given by the sum of its forces divided by ρ, the mass-density. + f Other body forces 3.2.1 Internal Forces Mass Density Using the SPH formulation to approximate mass density is fairly straightforward. The quantity we would like to interpolate, A(r) is simply the mass density, ρ. Thus, A S (r) = j W (r r j, h) 4

becomes ρ S (r) = j = j W (r r j, h) W (r r j, h) Since we are evaluting ρ S (r) only at particle locations, for each particle i, this becomes ρ i = W default (r r j, h) (2) j For the kernel, W, [4] suggests W default (r, h) = 315 64πh 9 { (h 2 r 2 ) 3 0 r h 0 r > h (3) Pressure Gradient Recall that the pressure gradient is given by p. Thus the SPH formulation is simply p i = j p j W pressure (r r j, h) Unfortunately, this formulation is not symmetric (consider the case of two particles where particle 1 is dependent on particle 2 and vice versa - which is clearly not symmetrical), violating the action-reaction law. SPH has various symmetrical formulations, one of which is p i = j i p i + p j 2 W pressure (r i r j, h) (4) Where p can be calculated using a modied ideal gas state equation (with an added rest pressure) such that (p + p 0 )V = k p + kρ 0 = kρ p = k(ρ ρ 0 ) (5) Here, ρ 0 corresponds to the rest density. The kernel recommended by [1] and used in [4] is { W pressure (r, h) = 15 (h r ) 3 0 r h πh 6 0 r > h Which has a gradient of W pressure (r, h) = 45 πh 6 r r (h r )2 (6) 5

Viscosity From the NS equations, viscosity is given by µ 2 u, where µ is the viscosity coecient (and controls how viscous the uid is). Therefore, the straightforward SPH formulation is µ 2 u i = µ j i u j 2 W (r r j, h) However, like the pressure gradient, we require that viscosity be symmetric, which the above formulation is not. In this case we can symmetrize the SPH approximation as µ 2 u i = µ (u j u i ) 2 W viscosity (r r j, h) (7) ρ i [23] suggests a kernel of W viscosity (r, h) = 15 2πh 3 which has a Laplacian of 3.2.2 External Forces j { r 3 2h 3 + r 2 h + h 2 2 r 1 0 r > h 0 r h 2 W viscosity (r, h) = 45 (h r ) (8) πh6 Gravity The force of gravity on particle i can be computed simply as f i = ρ i g (9) Buoyancy The force of buoyancy on particle i is where b > 0 is the buoyancy diusion coecient. f i = b(ρ i ρ 0 )g (10) Surface Tension The surface tension of a liquid is given by [4] n i f i = σ 2 c i n i (11) Where σ is the surface tension coecient and depends on the the uids that form the surface, c i is the coloreld of particle i, (which has a value of one at the particle's location and zero elsewhere) whose smoothed SPH formulation is c i = j W default (r i r j, h) (12) 6

The normal n can be computed as the gradient of the color eld, c. n i = c(r i ) = W default (r i r j, h) ρ j j Keep in mind that n i may go to zero, and division by zero is bad. Note that 4 Notes W default (r, h) = 945 32πh 9 r(h2 r 2 ) 2 2 W default (r, h) = 945 32πh 9 (h2 r 2 )(3h 2 7 r 2 ) Note that most of the force calculations depend on mass density (ρ). You probably need to have at least two stages, the rst calculating mass density and storing in a texture. The second stage calculating the rest of the forces. Good luck. References [1] M. Desbrun and M.-P. Cani. Smoothed Particles: A new paradigm for animating highly deformable bodies. 1996. [2] T. Harada, S. Koshizuka, and Y. Kawaguchi. Smoothed Particle Hydrodynamics on GPUs. 2007. [3] M. Kelager. Lagrangian Fluid Dynamics Using Smoothed Particle Hydrodynamics. 2006. [4] M. Muller, D. Charypar, and M.Gross. Particle-Based Fluid Simulation for Interactive Applications. 2003. 7