Particle-based Fluids

Similar documents
Smoothed Particle Hydrodynamics (SPH) Huamin Wang

CSCI1950V Project 4 : Smoothed Particle Hydrodynamics

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

Pressure corrected SPH for fluid animation

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

Simulation in Computer Graphics Elastic Solids. Matthias Teschner

Fluid Animation. Christopher Batty November 17, 2011

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

GAME PHYSICS SECOND EDITION. дяййтаййг 1 *

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

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

FVM for Fluid-Structure Interaction with Large Structural Displacements

Physically Based Simulations (on the GPU)

Continuum Mechanics and the Finite Element Method

PHYSICS. Course Structure. Unit Topics Marks. Physical World and Measurement. 1 Physical World. 2 Units and Measurements.

Inverse Design (and a lightweight introduction to the Finite Element Method) Stelian Coros

Physics-Based Animation

PDE Solvers for Fluid Flow

Flow and Transport. c(s, t)s ds,

Navier-Stokes Equation: Principle of Conservation of Momentum

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

6.2 Governing Equations for Natural Convection

Elements of Continuum Elasticity. David M. Parks Mechanics and Materials II February 25, 2004

Nonlinear Wave Theory for Transport Phenomena

Notes 4: Differential Form of the Conservation Equations

Structural Dynamics. Spring mass system. The spring force is given by and F(t) is the driving force. Start by applying Newton s second law (F=ma).

Scientific Computing II

7 The Navier-Stokes Equations

Computational Astrophysics

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

Applied Mathematics B Study Guide

Diffusion / Parabolic Equations. PHY 688: Numerical Methods for (Astro)Physics

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

Lecture V: The game-engine loop & Time Integration

Differential relations for fluid flow

Fluid Dynamics. Massimo Ricotti. University of Maryland. Fluid Dynamics p.1/14

Notes. Multi-Dimensional Plasticity. Yielding. Multi-Dimensional Yield criteria. (so rest state includes plastic strain): #=#(!

Introduction to Simulation - Lectures 17, 18. Molecular Dynamics. Nicolas Hadjiconstantinou

CS-184: Computer Graphics

CHAPTER 4. Basics of Fluid Dynamics

NORCO COLLEGE SLO to PLO MATRIX

EULERIAN DERIVATIONS OF NON-INERTIAL NAVIER-STOKES EQUATIONS

Fluid Mechanics Prof. T.I. Eldho Department of Civil Engineering Indian Institute of Technology, Bombay. Lecture - 17 Laminar and Turbulent flows

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

EXPERIENCE COLLEGE BEFORE COLLEGE

Contents. I Introduction 1. Preface. xiii

Fluid Mechanics Theory I

Lattice Boltzmann Method

MAE 3130: Fluid Mechanics Lecture 7: Differential Analysis/Part 1 Spring Dr. Jason Roney Mechanical and Aerospace Engineering

Lecture 8: Tissue Mechanics

NUMERICAL METHODS IN ASTROPHYSICS An Introduction

Module 6: Free Convections Lecture 25: Buoyancy Driven Flows. The Lecture Contains: Free Convection. Objectives_template

Chapter 1. Continuum mechanics review. 1.1 Definitions and nomenclature

Dynamics and Time Integration

OCR Physics Specification A - H156/H556

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

8. More about calculus in physics

ALGEBRAIC FLUX CORRECTION FOR FINITE ELEMENT DISCRETIZATIONS OF COUPLED SYSTEMS

Recap: Energy Accounting

Rational derivation of the Boussinesq approximation

Treecodes for Cosmology Thomas Quinn University of Washington N-Body Shop

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

Chapter 2: Fluid Dynamics Review

LOCAL NAVIGATION. Dynamic adaptation of global plan to local conditions A.K.A. local collision avoidance and pedestrian models

Chapter 9: Differential Analysis

AP PHYSICS 1 Learning Objectives Arranged Topically

Hamiltonian Dynamics In The Theory of Abstraction

Review: control, feedback, etc. Today s topic: state-space models of systems; linearization

the spring is compressed and x is the compression

Chapter 9: Differential Analysis of Fluid Flow

2 Equations of Motion

Introduction to Marine Hydrodynamics

SPH for simulating impacts and collisions

First Year Physics: Prelims CP1 Classical Mechanics: DR. Ghassan Yassin

AMME2261: Fluid Mechanics 1 Course Notes

Les Houches School of Foam: Rheology of Complex Fluids

2. FLUID-FLOW EQUATIONS SPRING 2019

PHYSICS - CLUTCH CH 01: UNITS & VECTORS.

Week 6 Notes, Math 865, Tanveer

NDT&E Methods: UT. VJ Technologies CAVITY INSPECTION. Nondestructive Testing & Evaluation TPU Lecture Course 2015/16.

Principles of Convection

Newtonian Gravitation of Matter and Antimatter

Course Name: AP Physics. Team Names: Jon Collins. Velocity Acceleration Displacement

Fluid Mechanics 3502 Day 1, Spring 2018

Motion Estimation (I) Ce Liu Microsoft Research New England

2 GOVERNING EQUATIONS

Simulation of Particulate Solids Processing Using Discrete Element Method Oleh Baran

Chapter 13. Simple Harmonic Motion

Boiling Heat Transfer and Two-Phase Flow Fall 2012 Rayleigh Bubble Dynamics. Derivation of Rayleigh and Rayleigh-Plesset Equations:

Introduction to molecular dynamics

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

WORK AND ENERGY PRINCIPLE

Compacton-like solutions in some nonlocal hydrodynamic-type models

Peristaltic Pump. Introduction. Model Definition

SAM Teachers Guide Atoms and Energy Overview Learning Objectives: Possible student pre/misconceptions

Multiscale modeling and simulation of shock wave propagation

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

Module 6 : Solving Ordinary Differential Equations - Initial Value Problems (ODE-IVPs) Section 1 : Introduction

The Johns Hopkins Turbulence Databases (JHTDB)

Lab 4: Gauss Gun Conservation of Energy

Transcription:

Particle-based Fluids

Particle Fluids

Spatial Discretization Fluid is discretized using particles 3

Particles = Molecules? Particle approaches: Molecular Dynamics: relates each particle to one molecule - Can model molecular forces, integrate - 1 liter of water contains about 10 25 molecules SPH: particle represents volume -> continuum assumptions apply - Properties such as density, pressure, etc are assumed to vary continuously in space - field quantities defined at discrete particle locations, use interpolation to evaluate anywhere 4

Smoothed Particle Hydrodynamics (SPH) Fluid volume is discretized by particles Each particles represents a certain amount of fluid volume: V i = m i ρ i Note: mass is constant, density is not 5

Smoothed Particle Hydrodynamics (SPH) Particles store attributes To evaluate an attribute, take weighted average of particle values within a neighborhood Smoothing kernel W prescribes interpolation weights 6

Kernel Properties Typically radially symmetric r: offset from kernel center Normalization condition: න W r dr = 1 If W is even (W(r,h)=W(-r,h)): second order accuracy Compact support W r, h = 0 when r > h 7

SPH Summation Equation Computing some quantity A at an arbitrary position in space Sum up contribution of neighboring particles j x A(x) = j m j ρ j A j W(x x j, h) Quantity A at arbitrary position x Particle volume Sum over all neighbor particles j within h Smoothing kernel Quantity A of particle j 8

SPH Summation Equation A quantity A of particle i can be computed by summing up the contributions from neighbors j: x i Note: Neighborhood j includes particle i 9

Differentiation Gradient and Laplacian can be easily calculated 10

Numerical Solution to NS Equations Neighbor Search Density, Pressure Body Force / V Diffusion / V Pressure Force / V 11

Estimating Density Attribute A is now density Larger density Smaller density 12

From Density to Pressure Pressure is computed through the ideal gas law: Modified version gives pressure of particle i: Stiffness parameter (~Specific Gas Constant) Rest density of fluid (water: 1000) Modified pressure is proportional to density deviation Gradient (forces) should not be affected by offset, but SPH approximation is numerically more stable Stiffness k defines speed of response (note: stiff system -> smaller time step) 13

Density and Pressure - Example Example: Larger density Smaller density Density below rest density Larger pressure Smaller pressure Negative pressure 14

Pressure Force Density Larger density Smaller density Density below rest density Larger pressure Smaller pressure Negative pressure Larger repulsion forces Smaller repulsion forces Attraction forces 15

Pressure Force Density Larger density Smaller density Density below rest density Larger pressure Smaller pressure Negative pressure Larger repulsion forces Smaller repulsion forces Attraction forces Pressure force aims to restore the rest state of the fluid (where ) 16

Attraction Forces Attraction forces can lead to numerical instability Typically, only repulsion forces are used: Density below rest density Negative pressure Attraction forces 17

Pressure Force Density For particle i evaluates to: Note: Kernel is multiplied by distance vector x_ij Pressure force acts along vector between particles! p1 p2 if p1!= p2: forces not symmetric! 18

Pressure Force Density Non-symmetric forces violate Newton s 3rd law action = reaction Use arithmetic mean of pressure values p1 p2 19

Incompressibility The stiffer the fluid (the larger k), the less compression Incompressibility by using very (!) large k (density variation < 1%) 20

Viscosity Force Density For particle i, evaluates to : Once again need to make forces symmetric. Insight: viscosity forces are only dependent on velocity differences, not on absolute velocities Note: Viscosity is always needed to stabilize the particle system 21

Zero Viscosity vs Normal Viscosity vs High Viscosity

Gravitational Force Density For particle i we get: Other forces can easily be included (collision forces, boundary forces, user interaction, etc.) 23

Kernel Function Different kernels can be used, see for example [Müller03] Choice of kernel affects stability, accuracy and speed of SPH methods Poly6 kernel: use for everything but pressure forces & viscosity 24

Kernel Function Different kernels can be used, see for example [Müller03] Choice of kernel affects stability, accuracy and speed of SPH methods Spiky kernel: use for pressure forces 25

Kernel Function Different kernels can be used, see for example [Müller03] Choice of kernel affects stability, accuracy and speed of SPH methods Viscosity kernel: Laplacian is always positive! 26

Time Integration Total force density: Acceleration: Symplectic Euler scheme: - New velocity: - New position: 27

Neighbor Search 3D: 30-40 neighbors per particle Neighbor computation is most expensive part we need fast data structures Domain partitioning into cells of size h Potential neighbors in 27 cells Create grid, insert particles, compute neighbors 28

How to get started with SPH... Start with simple implementation, worry about performance/optimizations once it works Define walls/boundary conditions geometrically simple collision tests (if x[y] < 0 then x[y] = 0) Debugging 1: Visualize particles / quantities (densities, velocities) Debugging 2: Viscosity const large enough? Time step small enough? 29

Algorithm 30

Multiple Fluids Particles carry different attributes - Mass - Rest density - Viscosity coefficient - Gas constant (stiffness) - Color attributes - Temperature Buoyancy emerges from individual rest densities (note:v1=v2) 31

Fun with SPH 32

Solids with SPH Unified model for fluids, solids, elastic objects -> phase changes Displacement from undeformed shape -> strain, stress, elastic forces 33

Position-Based Dynamics 34

Position-Based Dynamics Physics-inspired*: everything is a set of particles connected by constraints Replace forces & numerical integration by constraint projection Very fast, very stable, simple, plausible results used in video games Nvidia PhysX T. Jakobsen, Advanced Character Physics, Game Developer Conference, 2001. used in Autodesk s Maya: https://autodeskresearch.com/publications/nucleus

Position-Based Dynamics 36

Position-Based Dynamics Many references, but start here: Position-Based Simulation Methods in Computer Graphics, Bender, Muller and Macklin, Eurographics 2015 37

Position-Based Dynamics Setup similar to mass-spring systems Discretize using mass points: mass m i, position x i, velocity v i Rather than forces, use constraints: distance constraint, area preservation, etc 38

PBD: constraints 39

PBD: main loop 40

PBD: constraint projection C p i, p j = p i p j d 41

PBD: constraint projection 42

PBD: constraint projection Taylor expansion (per constraint): Step must be in direction of constraint Jacobian: Putting it all together: 43

PBD: constraint projection Is momentum conserved? 44

PBD: constraint projection Conservation of linear momentum: Scale updates by inverse mass w i = 1/mi 45

PBD: constraint projection 46

PBD: constraint projection 47

PBD: main loop 48

Collision constraints Assume: collisions already detected Simple objects/particles: easy Collision response: Unilateral constraints (inequality) Potentially changing at every time-step

Collision constraints x q c p

Collision constraints x n c q c p

Collision constraints x n c q c p

Collision constraint Unilateral: C p 0 Project only if violated

PBD: main loop 54

PBD: main loop Not a traditional time-stepping scheme Predictor-Corrector approach Stability due to constraint projection which acts directly on positions note: no internal forces! 55

PBD: can you see any downsides to this approach? 56

Other types of constraints? Position-based Fluids Position Based Fluids, Macklin & Muller, 2014 57

Assignment 2 Out today Due on March 2 nd @ midnight 58

Reminder Project Ideas Brief descriptions due today (or plan to talk to us this week) Team info, topic, etc. 59