particle-based fluid simulation for interactive...

44
Particle-Based Fluid Simulation for Interactive Applications Hyun-sang Lim 2018. 08. 09 Computer Graphics @ Korea University Matthias Muller et al. (ETHZ, Switzerland) SIGGRAPH 2003 Copyright of figures and other materials in the paper belongs to original authors.

Upload: others

Post on 18-Jul-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Particle-Based Fluid Simulation for Interactive Applications

Hyun-sang Lim

2018. 08. 09

Computer Graphics @ Korea University

Matthias Muller et al.(ETHZ, Switzerland)SIGGRAPH 2003

Copyright of figures and other materials in the paper belongs to original authors.

Page 2: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 2Computer Graphics @ Korea University

Index

1. Introduction– Motivation

– Related Work

– Contribution of this paper

2. Smoothed Particle Hydrodynamics.– Interpolation

– Strong point of the SPH

3. Modelling Fluids with Particles– Navier-Stokes equation

– Pressure

– Viscosity

– Surface tension

– External Forces

– Smoothing Kernels

– Leap-Frog algorithm

4. Surface Tracking and Visualization– Point Splatting

– Marching Cubes

5. Implementation

6. Result– Results

– Conclusion and Future work

Page 3: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 3Computer Graphics @ Korea University

1. Introduction

Motivation

• Fluids phenomena usually being simulated offline and visualized in a

second step in aerodynamics or optimization of turbines and pipes.

• Less accurate methods that allow the real-time simulation opening up a

variety applications like medical simulators and game engines.

<Fig.1-1 Aerodynamic simulation computed on Ansys fluent>

<Fig.1-3 Blood flow simulated on CBC Player><Fig. 1-2 Battle Front graphic mode>

Page 4: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 4Computer Graphics @ Korea University

1. Introduction

Related work (Type 1 Particle based simulation)

• [Particle Systems – A Technique for Modeling a Class of Fuzzy Objects]

▪ WILLIAM T. REEVES (TOG 1983)

• Topic

▪ First attempt to applying particle simulation in graphics.

▪ Radom properties controlling mean and variance.

▪ Applicable to fuzzy phenomena such as fire, smoke and clouds.

<Fig.1-4 Intial explosion>

<Fig.1-5 Expanding Wall of fire>

Page 5: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 5Computer Graphics @ Korea University

1. Introduction

Related work (Type 1 Particle based simulation)

• [Oriented Particles: A Tool for Shape Memory Objects Modeling]▪ Jean-Christophe Lombardo, Claude Puech

(Graphics Interface 1995)

• Topic

▪ Proposing a new kind of intermolecular force model for stability.

▪ Proposing a use of oriented particles to model shape memory skeletons

<Fig.1-7 3D simulation with implicit surfaces>

<Fig.1-6 Inter molecular force model>

Page 6: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 6Computer Graphics @ Korea University

1. Introduction

Related work (Type 1 Particle based simulation)

• [Using Particles to Sample and Control Implicit Surfaces]▪ Andrew P. Witkin, Paul S. Heckbert

(SIGGRPAH 1994)

• Topic

▪ Suggesting shape(implicit surface control Method by changing the position of the particle.

▪ Realizing real-time rendering and direct manipulation of the surface in particle systems.

<Fig.1-8 This sequence illustrates the construction of a shape composed o

f blobby cylinders. The shape was created by direct manipulation of contr

ol points using the mouse. In the topmost image, all three cylinder primiti

ves are superimposed. Each subsequent image represents the result of a si

ngle mouse motion. >

Page 7: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 7Computer Graphics @ Korea University

1. Introduction

Related work (Type 1 Particle based simulation)

• [Smoothed Particles: A new paradigm for animating highly deformable bodies]▪ Mathiew Desbrun, Marie-Paule Cani (EUROGRAPH 1996)

• Topic

▪ Applying SPH Method to the physical simulation.

▪ Improving stability relatively to the inter-molecule simulation.

<Fig.1-9 Snapshots from a sequence with a surface coating the particl

es: a quasi-liquid material (80 particles) falling under gravity.>

Page 8: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 8Computer Graphics @ Korea University

1. Introduction

Related work (Type 1 Particle based simulation)

• [Animating Lava Flows]▪ Dan Stora, et al(Graphics Interface 1999)

• Topic

▪ Applying SPH Method to the lava flow model

<Fig.1-10 Textured lava flow simulation>

Page 9: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 9Computer Graphics @ Korea University

1. Introduction

Related work (Type 2 Grid based simulation)

• [Animation and Rendering of Complex Water Surface]▪ Duglas Enright, et al(SIGGRAPH 2002)

• Topic

▪ Using semi-Lagrangian(Stable-fluid) Method for simulation

▪ Suggesting a novel computational method called ‘Level set Method’

<Fig.1-11 Water being poured into a clear, cylindrical glass (55x55x12

0 grid cells). Our method makes possible the fine detail seen in

the turbulent mixing of the water and air>

Page 10: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 10Computer Graphics @ Korea University

1. Introduction

Related work (Type 2 Grid based simulation)

• [Practical Animation of Liquids]▪ Nick Foster, Roland Fekiw (SIGGRAPH

2001)

• Topic

▪ Using semi-Lagrangian(Stable-fluid) Method for simulation

▪ Applying computational method called ‘Level set Method’

▪ Simulation for the interaction with rigid objects.

<Fig.1-12 A close up of the ellipsoid from figure 5 showing the impli

cit surface derived from combining the particle basis functions and l

evel set (top), and with the addition of the freely splashing particles

raytraced as small spheres (bottom). The environment for this exam

ple was 150x75x90 cells. Calculation times were approximately four

minutes per frame.>

Page 11: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 11Computer Graphics @ Korea University

1. Introduction

Related work (Type 2 Grid based simulation)

• [A Fluid-Based Soft Object Model]▪ Daniel Nixon, Richard Lobb (IEEE Computer

graphics and Applications 2002)

• Topic

▪ Using grid based approach for simulation of the soft objects.

▪ Suggesting new model for soft objects.

<Fig.1-13 Result of the simulation>

Page 12: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 12Computer Graphics @ Korea University

1. Introduction

Related work (Type 2 Grid based simulation)

• [Melting and Flowing]▪ Mark Carlson, et al(SIGRAPH 2002)

• Topic

▪ Unifying solid state and liquid state algorithm just applying different viscosity value.

▪ Simulation of heat diffusion that is coupled with viscosity.

<Fig.1-14 Melting wax>

Page 13: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 13Computer Graphics @ Korea University

1. Introduction

Related work (Type 3 Interactive simulation)

• [Stable fluids]▪ Jos Stam (SIGRAPH 1999)

• Topic

▪ Realizing interactive simulation of the fluids by simplifying governing equations.

▪ Enhancing stability w.r.t time integration.(semi-particle approach)

<Fig.1-15 Snapshots from our interactive fluid solver>

Page 14: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 14Computer Graphics @ Korea University

1. Introduction

Contribution of this paper

(1) Proposing Particle-Based method for interactive fluids simulation.

(2) Deriving SPH models for force fields terms from Navier-stokes equation.

(3) Proposing new special kernels for stability and interactivity in simulation.

Page 15: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 15Computer Graphics @ Korea University

2. Smoothed Particle Hydrodynamics

Interpolation

𝑓 𝑟 ≈𝑚2

𝜌2𝑓 𝑟2 𝑊 𝑟 − 𝑟2, ℎ +

𝑚4

𝜌4𝑓 𝑟4 𝑊 𝑟 − 𝑟2, ℎ +

𝑚5

𝜌5𝑓 𝑟5 𝑊 𝑟 − 𝑟2, ℎ

𝜌(𝑟𝑖) ≈

𝑗= 0

𝑁

𝑚𝑗𝑊 𝑟𝑖 − 𝑟𝑗, ℎ

- Definition of SPH

<Fig.2-1 Concept diagram for explaining SPH Method>

5

3

6

2

7

1

4 𝑟(𝑥, 𝑦)

<Fig.2-2 Concept diagram for explaining Kernel funcution>

- Kernel function

න𝑊 𝑟, ℎ 𝑑𝑟 = 1

𝑊 𝑟, ℎ = 𝑊 −𝑟, ℎ

If W satisfied two conditions, f is of second order

accuracy(Appendix A)𝑥

𝑊(𝑥 − 𝑥2, ℎ)

𝑥1 𝑥2 𝑥3

𝑊(𝑥 − 𝑥1, ℎ)

𝑊(𝑥 − 𝑥3, ℎ)

(Eq. 2.1)

(Eq. 2.2)

Ex)

(Eq. 2.3)

(Eq. 2.4)

Page 16: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 16Computer Graphics @ Korea University

2. Smoothed Particle Hydrodynamics

Strong point of SPH

- Obtaining Derivative values

Obtaining Derivative is very common in physical simulation!!

Ex) 𝝆𝑫𝒗

𝑫𝒕= −𝛁𝒑 + 𝝁 𝛁 ∙ 𝛁 𝒗 + 𝝆g

In general Derivative values are obtained by numerical method

like Euler Method

𝒅𝒇

𝒅𝒙≅𝒇 𝒙𝒊+𝟏 − 𝒇(𝒙𝒊−𝟏)

𝟐∆𝒙 <Fig.2-3 Centered difference approximation>

𝑥𝑖−1 𝑥𝑖+1𝑥𝑖

𝒅𝒇

𝒅𝒙

𝒇(𝒙)

<Fig.2-4 Obtaining derivative values in grid based method>

(𝑥𝑖 , 𝑦𝑖)

(𝑥𝑖−1 , 𝑦𝑖) (𝑥𝑖+1 , 𝑦𝑖)

7

2

4

< Fig.2-5 Obtaining derivative values in particle based method>

3

65

1

How the derivative value at point 4 can be

obtained?

(Eq. 2.5)

Page 17: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 17Computer Graphics @ Korea University

2. Smoothed Particle Hydrodynamics

Strong point of SPH

- Physical values are obtained Explicitly at every points

<Fig.2-6 Concept diagram for explaining SPH Method>

5

3

6

2

7

1

4

- Thus derivative values can be obtained at arbitrary points

Consequently, the Derivative values can be obtained easily in particles system, which means

Navier-Stokes equation can be applied to the system of particles

𝑓 𝑟4 ≈

𝐼=0

𝑁𝑚𝑖

𝜌𝑖𝑓 𝑟𝑖 𝑊 𝑟4 − 𝑟𝑖 , ℎ

Ex)

(Eq. 2.6)

Page 18: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 18Computer Graphics @ Korea University

3. Modeling Fluids with Particles

Navier-Stokes Equation

• Fundamental Physical principles

▪ Mass is conserved.

▪ Linear Momentum is conserved.

▪ Energy is conserved. (Isothermal case?)

• Equations

<Fig.3-1 Concept diagram for Eulerian> <Fig.3-2 Concept diagram for Lagrangian>

Density Velocity

Pressure Viscosity

Coefficient𝝆𝝏𝒗

𝝏𝒕+ 𝝆 𝒗 ∙ 𝛁 𝒗 = −𝛁𝑷 + 𝝆𝒈 + 𝝁 𝛁 ∙ 𝛁 𝒗

𝝆𝑫𝒗

𝑫𝒕= −𝛁𝑷+ 𝝆𝒈 + 𝝁 𝛁 ∙ 𝛁 𝒗⇒

Gravitational constant

(Eq. 3.1)

Page 19: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 19Computer Graphics @ Korea University

3. Modeling Fluids with Particles

Pressure (Derivation)

Pressure term approximated by the SPH Method ( Ref. Eq.1)

Using ideal gases state law to obtain the pressure value at some point.

(Eq. 3.3)

- Negative value of pressure is possible

- If p>p0 , Pressure force acting to make particles sparser and p<p0 Pressure force acting to make

particles dense. (I guess that it is alternative to the intermolecular forces)

- p0 is a sort of reference value.

(Eq. 3.2)⇒ (Calibrated for symmetry)

Navier-stokes is valid for incompressible fluids

Page 20: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 20Computer Graphics @ Korea University

3. Modeling Fluids with Particles

Viscosity

Viscosity term approximated by the SPH Method

(Eq. 3.4)

j

i

v21

F viscosit

y

<Fig.3-3 Concept diagram for SPH viscosity term>

Page 21: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 21Computer Graphics @ Korea University

3. Modeling Fluids with Particles

Surface Tension (Concept of color field)

𝛻𝑐𝑠 ≅ 0

𝛻𝑐𝑠 ≅ 0

Relatively large 𝛻𝑐𝑠

Concept of the Color field.

Surface can be detected by the value of the

gradient of color field.

l is the threshold value.

(I think that this assumption is lack of physical basis!)

𝑓𝑠𝑢𝑟𝑓𝑎𝑐𝑒 = 𝜎𝑘𝒏 = −𝛁𝟐𝒄𝒔𝒏

𝒏 (Eq. 3.5)

(Eq. 3.6)

(Eq. 3.7)

<Fig.3-4 Concept diagram for Surface tension>

<Fig.3-5 SPH Color field and gradient of the field>

Page 22: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 22Computer Graphics @ Korea University

3. Modeling Fluids with Particles

Surface Tension (Curvature)

(There is no inter molecule forces! But in negative pressure make it possible to assemble particles. Then why do we

need the surface tension term?)

- Definition of curvature.

𝑘 =1

𝑟=𝛿𝜃

𝛿𝑠

𝑟

𝛿𝑠

𝛿𝜃

𝑘 =𝑑𝜃

𝑑𝑠=−𝛻2𝑐𝑠𝑛

𝑐𝑜𝑠∅ ≅−𝛻2𝑐𝑠𝑛

(Eq. 3.8)

(Eq. 3.9)

−𝛻𝑐𝑠

𝑟

𝑟 + 𝑑𝑟

<Fig.3-6. SPH Color field having divergence value>

(∅ 𝑟𝑒𝑝𝑟𝑒𝑠𝑒𝑛𝑡𝑖𝑛𝑔 𝑎𝑛𝑔𝑙𝑒𝑠 𝑏𝑒𝑡𝑤𝑒𝑒𝑛 − 𝛻𝐶𝑆 𝑎𝑛𝑑 𝐷𝑖𝑟𝑒𝑐𝑡𝑖𝑜𝑛 Ref. Appendix C)

- Divergence of the gradient of the color field

Page 23: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 23Computer Graphics @ Korea University

3. Modeling Fluids with Particles

External Forces

External forces including two kinds of forces which are Body force and Surface force.

Body forces composed of Gravity and Electro-magnetic force. (Need not to use SPH Method for

modelling)

Surface forces including forces like a interacting force with a cup.

Implementing interacting forces just by mirroring the velocity

component.

<Fig.3-7 Concept of Interacting force between cup>

Page 24: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 24Computer Graphics @ Korea University

3. Modeling Fluids with Particles

Smoothing Kernels (Basic kernel and Problem)

Basic kernel satisfying Eq. 2

- Clustering problem

- Negative value of the Laplacian problem

Negative value of the laplacian meaning that viscosity force

acts on opposite to relative velocity. (Physically impossible.)

2

1

v21

F viscosity

Function valueGradient value

Laplacian value

<Fig.3-8 Function value, gradient and laplacian of the Wpoly6>

<Fig.3-9 Concept diagram of two particles for explaining the

problem caused by the negative value of laplacian>

As r goes to 0, The pressure force gets smaller.

Page 25: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 25Computer Graphics @ Korea University

3. Modeling Fluids with Particles

Smoothing Kernels (Other kernels for treatment)

Spike kernel used for Pressure force term

- Absolute value of the gradient near r = 0 not close to zero

Basic kernel satisfying Eq. 2

- Laplacian of velocity always having a positive value.

<Fig.3-10 Function value, gradient and laplacian of the Wspiky >

<Fig.3-11 Function value, gradient and laplacian of the Wviscosity >

Page 26: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 26Computer Graphics @ Korea University

3. Modeling Fluids with Particles

Leap-Frog Algorithm(Concept)

-Spatial derivative is obtained by SPH, However time can not be interpolated by SPH

⇒𝑑𝑥

𝑑𝑡= 𝑣,

𝑑𝑣

𝑑𝑡= 𝐹(𝑥),

𝑥𝑛+1 = 𝑥𝑛 + 𝑣𝑛𝑑𝑡,

-Euler forward method

𝑣𝑛+1 = 𝑣𝑛 + 𝐹(𝑥𝑛)𝑑𝑡

𝑥0 𝑎𝑛𝑑 𝑣0 𝑖𝑠 𝑔𝑖𝑣𝑒𝑛

𝑣1/2 = 𝑣0 + 𝐹(𝑥0)𝑑𝑡

2

-Leap frog Method

𝑥0 𝑎𝑛𝑑 𝑣0 𝑖𝑠 𝑔𝑖𝑣𝑒𝑛,

𝑥𝑛+1 = 𝑥𝑛 + 𝑣𝑛+1/2𝑑𝑡,

𝑣𝑛+1/2 = 𝑣𝑛−1/2 + 𝐹(𝑥𝑛)𝑑𝑡

𝑥

𝑥(𝑡)

𝑡𝑛 𝑡𝑛+1

𝑥(𝑡𝑛)𝑥(𝑡𝑛+1)

𝑥𝑛+1Tangent

Approximated solution

Exact solution

Error

𝑡<Fig.3-12 Concept of the Euler forward method>

t / h

x

v<Fig. 3-13 Concept of the Leap-Frog method>

𝝆𝑫𝒗

𝑫𝒕= −𝛁𝒑 + 𝝁 𝛁 ∙ 𝛁 𝒗 + 𝝆g

(Eq. 3.10)

Page 27: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 27Computer Graphics @ Korea University

4. Surface Tracking and Visualization

Point Splatting

- Concept of Point splatting

Simple forward projection

of point samplesSplatting footprints

<Fig.4-1 Concept diagram of Point splatting >

Point

Cloud

Forward

Warping

Filtering

and

Shading

Visibility

Image

Reconstru

ction

Point

Cloud

- Procedure of Point splatting

<Fig.4-2 Procedure of the Point splatting >

Each particle stores essential information for rendering

Page 28: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 28Computer Graphics @ Korea University

4. Surface Tracking and Visualization

Marching Cube Algorithm(Concept)

Given set of points, Marching cube Algorithm helping to construct the surfaces of target object composed

of triangle elements.

In this paper, the surface of water rendered through marching cube algorithm.

<Fig.4-3 Concept diagram of Marching cube method in 2D>

Page 29: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 29Computer Graphics @ Korea University

4. Surface Tracking and Visualization

Marching Cube Algorithm (Procedure)

(1) Selecting grid size and making grids in physical space.

(2) Calculating the density values at each node by using

SPH Method.

(3) Checking Each cube to see if the density value of each node

exceeds the threshold value.

(4) Finding the model that matches the configuration of the

nodes in the table.

(5) Drawing the triangles(or triangle) in the cube like the one

found in the table

(6) The position of the nodes of the triangle can be interpolated

by the density value of the nodes of the cube.<Fig.4-4 Tables for fourteen possible node configuration>

Page 30: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 30Computer Graphics @ Korea University

• Concept of Hash table

• Computation complexity drops

5. Implementation

Hash table

𝑂 𝑛2 ⇒ 𝑂 𝑛𝑚

I only care about my family and

neighborhoods!!

h

<Fig.5-1 Concept diagram for explaining Hash table acceleration>

Page 31: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 31Computer Graphics @ Korea University

6. Result

Results

Result 1.- Simulation of the water in a rotating cup using 2200 particles.

- Left Figure showing particles (5 frame per second).

- Centre figure showing surface using point splatting method.

(20 frame per second)

- Right figure showing surface using marching cube method.

(5 frame per second)

Result 2.- Demonstrating the user interacting with fluids

- User generating a external force through mouse motion.

- Using 1300 particles and 25frames per second.

- Implementing point splatting method to render the surface.

Result 3.- Simulation of the pouring water into a glass

- Using 3000 particles and 5frames per second.

- Implementing marching cube technique to render the surface.

<Fig. 6-1 Result 1>

<Fig. 6-2 Result 2>

<Fig. 6-3 Result 3>

Page 32: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 32Computer Graphics @ Korea University

6. Result

Conclusion and Future work

(1) This study proposes an interactive fluid simulation method, contrast to the offline

simulation.

(2) This paper proposes to use various special kernel to improve stability and speed.

(3) There are still many research themes on technology to track and render fluid free surfa

ces in real time.

(4) The author planed to develop an up-sampling technique to improve the performance o

f marching cube algorithm in the future.

Page 33: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 33Computer Graphics @ Korea University

Starting from the trivial identity

Letting W be equations below

Letting W be an even function w.r.t r

Estimating f(r) using W instead of using Dirac delta function.

Then, the remainder is the second order of h<Fig.A1 Substitutions for the W( r`-r , h) in 1-Dimsional space>

h

r

Dirac delta function

SPH Kernel function

Error term

Appendix A. SPH Validation

Page 34: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 34Computer Graphics @ Korea University

- Dirac delta function usually being used for modeling impulse forces or signals.

- Definition

Proof)

𝛿𝜀 =𝑎𝑟𝑏𝑖𝑡𝑟𝑎𝑟𝑦 𝑣𝑎𝑙𝑢𝑒, 𝑓𝑜𝑟 𝑥 <

2

0 , 𝑓𝑜𝑟 𝑥 ≥휀

2

න−∞

𝛿𝜀(𝑥) 𝑑𝑥 = 1Let 𝛿𝜀 be

and

න−∞

𝑓 𝑥 𝛿𝜀(𝑥 − 𝑎)𝑑𝑥 = න𝑎−

𝜀2

𝑎+𝜀2𝑓 𝑥 𝛿𝜀(𝑥 − 𝑎) 𝑑𝑥 Let us assume that 𝑑𝑥 = 휀

≈ 𝑓 𝑎 ∙ 𝛿𝜀 0 ∙ 𝑑𝑥 = 𝑓 𝑎 ∙1

휀2 − −

휀2

∙ 휀 = 𝑓(𝑎)

As 휀 goes to infinity, න−∞

𝑓 𝑥 𝛿𝜀(𝑥 − 𝑎) 𝑑𝑥 = න−∞

𝑓(𝑥)𝛿(𝑥 − 𝑎) 𝑑𝑥 = 𝑓(𝑎)

Appendix A. SPH Validation

Page 35: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 35Computer Graphics @ Korea University

Q1) Then how much is it close to real f(r)? , or how small is the error?

Q2) Is the amount of error related to the value of h?

⇒ 𝑓 𝑟 ≈ න−∞

𝑓(𝑟′) 𝑊(𝑟 − 𝑟′, ℎ) 𝑑𝑟

⇒ 𝑓 𝑟 = න−∞

𝑓(𝑟′) 𝑊(𝑟 − 𝑟′, ℎ) 𝑑𝑟 + 𝑒𝑟𝑟𝑜𝑟

Using 𝑊(𝑟 − 𝑟′) instead of 𝛿(𝑟 − 𝑟′) satisfying below equation.

𝑊(𝑟, ℎ) = ቊ𝑎𝑟𝑏𝑖𝑡𝑟𝑎𝑟𝑦 𝑣𝑎𝑙𝑢𝑒, 𝑓𝑜𝑟 𝑟 < ℎ

0 , 𝑓𝑜𝑟 𝑟 ≥ ℎර𝑊 𝑟, ℎ 𝑑𝑟 = 1 𝑊 𝑟, ℎ = 𝑊 −𝑟, ℎ

Appendix A. SPH Validation

Page 36: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 36Computer Graphics @ Korea University

Using Taylor expansion around 𝑟′ = 𝑟 to evaluate the amount of error.

𝑓 𝑟′ = 𝑓 𝑟 +1

1!

𝑑𝑓

𝑑𝑟′𝑟′=𝑟𝑟′ − 𝑟 +

1

2!

𝑑2𝑓

𝑑𝑟′2𝑟′=𝑟𝑟′ − 𝑟 2 +

1

3!

𝑑3𝑓

𝑑𝑟′3𝑟′=𝑟𝑟′ − 𝑟 3 + ⋯⋯

න−∞

𝑓(𝑟′) 𝑊(𝑟 − 𝑟′, ℎ) 𝑑𝑟 = න−∞

𝑓 𝑟 𝑊 𝑟 − 𝑟′, ℎ 𝑑𝑟′ + න−∞

∞ 1

1!

𝑑𝑓

𝑑𝑟′𝑟′=𝑟𝑟′ − 𝑟 ∗𝑊 𝑟 − 𝑟′, ℎ 𝑑𝑟′

+න−∞

∞ 1

2!

𝑑2𝑓

𝑑𝑟′2𝑟′=𝑟𝑟′ − 𝑟 2 ∗ 𝑊 𝑟 − 𝑟′, ℎ 𝑑𝑟′ + න

−∞

∞ 1

3!

𝑑3𝑓

𝑑𝑟′3𝑟′=𝑟𝑟′ − 𝑟 3 ∗ 𝑊 𝑟 − 𝑟′, ℎ 𝑑𝑟′

- First term

න−∞

𝑓 𝑟 𝑊 𝑟 − 𝑟′, ℎ 𝑑𝑟′ = 𝑓 𝑟 න−∞

𝑊 𝑟 − 𝑟′, ℎ 𝑑𝑟′ = 𝑓(𝑟)

- Second term

න−∞

∞ 1

1!

𝑑𝑓

𝑑𝑟′𝑟′=𝑟𝑟′ − 𝑟 ∗𝑊 𝑟 − 𝑟′, ℎ 𝑑𝑟′ =

𝑑𝑓

𝑑𝑟′𝑟′=𝑟න𝑟−

ℎ2

𝑟+ℎ2𝑟′ − 𝑟 ∗𝑊 𝑟 − 𝑟′, ℎ 𝑑𝑟′

=𝑑𝑓

𝑑𝑟′𝑟′=𝑟න−ℎ2

ℎ2𝑟′ ∗ 𝑊 𝑟′, ℎ 𝑑𝑟′ = 0 𝑊 𝑟′, ℎ is a even function w.r.t 𝑟′, thus 𝑟′𝑊 𝑟′, ℎ is the

odd function

-𝑆𝑖𝑚𝑚𝑖𝑙𝑎𝑟𝑙𝑦, 𝐹𝑜𝑢𝑟𝑡ℎ 𝑎𝑛𝑑 𝑠𝑖𝑥𝑡ℎ 𝑡𝑒𝑟𝑚 𝑎𝑟𝑒 𝟎

Taylor series

Appendix A. SPH Validation

Page 37: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 37Computer Graphics @ Korea University

- Third term

න−∞

∞ 1

2!

𝑑2𝑓

𝑑𝑟′2𝑟′=𝑟𝑟′ − 𝑟 2 ∗ 𝑊 𝑟 − 𝑟′, ℎ 𝑑𝑟′ =

1

2!

𝑑2𝑓

𝑑𝑟′2𝑟′=𝑟න𝑟−

ℎ2

𝑟+ℎ2𝑟′ − 𝑟 2 ∗ 𝑊 𝑟 − 𝑟′, ℎ 𝑑𝑟′

=1

2!

𝑑2𝑓

𝑑𝑟′2𝑟′=𝑟න−ℎ2

ℎ2𝑟′2∗ 𝑊 𝑟′, ℎ 𝑑𝑟′ =

1

2!

𝑑2𝑓

𝑑𝑟′2𝑟′=𝑟𝑟′2∗ න𝑊 𝑟′, ℎ 𝑑𝑟′

−ℎ2

+ℎ2

−න−ℎ2

ℎ22𝑟′ ∗ 𝑊 𝑟′, ℎ 𝑑𝑟′

0

=1

2!

𝑑2𝑓

𝑑𝑟′2𝑟′=𝑟

ℎ2

4න−ℎ2

ℎ2𝑊 𝑟′, ℎ 𝑑𝑟′ =

1

8

𝑑2𝑓

𝑑𝑟′2𝑟′=𝑟ℎ2

- Total equation

න−∞

𝑓(𝑟′) 𝑊(𝑟 − 𝑟′, ℎ) 𝑑𝑟 = 𝑓 𝑟 +1

8

𝑑2𝑓

𝑑𝑟′2𝑟′=𝑟ℎ2 +⋯⋯(ℎ𝑖𝑔ℎ𝑒𝑟 𝑡𝑒𝑟𝑚𝑠)

𝑓 𝑟 − න−∞

𝑓 𝑟′ 𝑊 𝑟 − 𝑟′, ℎ 𝑑𝑟 = −1

8

𝑑2𝑓

𝑑𝑟′2𝑟′=𝑟ℎ2 −⋯⋯ ℎ𝑖𝑔ℎ𝑒𝑟 𝑡𝑒𝑟𝑚𝑠 = 𝑒𝑟𝑟𝑜𝑟

Therefore as h gets decreased, error gets also decreased in second order of h

(Eq. 2.3)

Appendix A. SPH Validation

Page 38: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 38Computer Graphics @ Korea University

• Deriving from lagrangian fluid model

𝒎 = 𝝆𝛅𝐕 ,𝒅𝒎

𝒅𝒕= 𝟎 (Mass is conserved)

𝑫𝝆𝛅𝐕

𝑫𝒕=𝑫𝝆

𝑫𝒕𝛅𝐕 + 𝝆

𝐃𝛅𝐕

𝑫𝒕= 𝟎,

𝒅𝝆

𝒅𝒕+ 𝝆

𝟏

𝛅𝐕

𝐃𝛅𝐕

𝑫𝒕= 𝟎

• Meaning of divergence of velocity field

∆𝐕 = 𝒗∆𝐭 ∙ 𝒏 𝒅𝐒 = 𝒗∆𝐭 ∙ 𝒅𝐒,∆𝐕

∆𝒕= 𝒗 ∙ 𝒅𝐒,

𝑫𝐕

𝑫𝒕= 𝒗 ∙ 𝒅𝐒 = ශ𝛁 ∙ 𝒗 𝒅𝑽

For small volume 𝛅𝐕

𝑫(𝛅𝐕)

𝑫𝒕= 𝛁 ∙ 𝒗 𝛅𝐕,

(Gauss’s divergence theorem)

𝛁 ∙ 𝒗 =𝟏

𝛅𝐕

𝒅𝛅𝐕

𝒅𝒕(Divergence of velocity meaning the change rate of unit local volume )

⇒𝑫𝝆

𝑫𝒕+ 𝝆𝛁 ∙ 𝒗 = 𝟎

𝒗

𝒗∆𝒕

<Fig.B2 Differential element moving with flow:

Describing the change in shape of element>

<Fig.B1 Differential element moving with flow>

𝛅𝐕

Appendix B. Navier – Stokes Equation

Page 39: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 39Computer Graphics @ Korea University

• Transforming lagrangian continuity equation to Eulerian

𝑫𝝆

𝑫𝒕+ 𝝆𝛁 ∙ 𝒗 = 𝟎 ⇒

𝝏𝝆

𝝏𝒕+𝝏𝝆

𝝏𝒙𝒗𝒙 +

𝝏𝝆

𝝏𝒚𝒗𝒚 +

𝝏𝝆

𝝏𝒛𝒗𝒛 + 𝝆𝛁 ∙ 𝒗 = 𝟎

𝑫𝑨

𝑫𝒕=𝝏𝑨

𝝏𝒕+𝝏𝑨

𝝏𝒙

𝝏𝒙

𝝏𝒕+𝝏𝑨

𝝏𝒚

𝝏𝒚

𝝏𝒕+𝝏𝑨

𝝏𝒛

𝝏𝒛

𝝏𝒕

If A is any scalar function of x, y, z, t (Eulerian concept)

𝝏𝝆

𝝏𝒕+ 𝛁𝝆 ∙ 𝒗 + 𝝆𝛁 ∙ 𝒗 = 𝟎

𝝏𝝆

𝝏𝒕+ 𝛁(𝝆 ∙ 𝒗) = 𝟎

( 𝛁(𝑨 ∙ 𝑩) = 𝛁𝑨 ∙ 𝑩 +𝑨 ∙ 𝛁𝑩 )

<Fig. B3 Transforming from Lagrangian coordinate to Eulerian coordinate>

Appendix B. Navier – Stokes Equation

Page 40: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 40Computer Graphics @ Korea University

• Deriving from lagrangian fluid model

𝒎𝒂 = 𝑭 (Newton’s 2nd Law)

𝒎 = 𝝆𝛅𝐕 , 𝐚 =𝑫𝒗

𝑫𝒕⇒ 𝝆𝛅𝐕

𝑫𝒗

𝑫𝒕= 𝐅

𝝆𝑫𝒗

𝑫𝒕=

𝑭

𝛅𝐕= 𝒇 (f is the external force per unit volume)

𝝆𝑫𝒗

𝑫𝒕= 𝒇𝒃𝒐𝒅𝒚 + 𝒇𝒔𝒖𝒓𝒇𝒂𝒄𝒆

f is usually divided in two classes which are body force and surface force.

Hence, surface force is represented by two terms which are pressure term and viscosity term and body force

is compose of other two terms, which are gravity terms and electromagnetic term.

Electromagnetic term is usually not considered.

𝝆𝑫𝒗

𝑫𝒕= 𝒇𝒑𝒓𝒆𝒔𝒔𝒖𝒓𝒆 + 𝒇𝒔𝒖𝒓𝒇𝒂𝒄𝒆 + 𝒇𝒈𝒓𝒂𝒗𝒊𝒕𝒚

Appendix B. Navier – Stokes Equation

Page 41: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 41Computer Graphics @ Korea University

𝝆𝑫𝒗

𝑫𝒕= 𝒇𝒑𝒓𝒆𝒔𝒔𝒖𝒓𝒆 + 𝒇𝒔𝒖𝒓𝒇𝒂𝒄𝒆 + 𝒇𝒈𝒓𝒂𝒗𝒊𝒕𝒚

𝝆𝑫𝒗

𝑫𝒕= 𝝆

𝝏𝒗

𝝏𝒕+ 𝝆

𝝏𝒗

𝝏𝒙𝒗𝒙 +

𝝏𝒗

𝝏𝒚𝒗𝒚 +

𝝏𝒗

𝝏𝒛𝒗𝒛

𝝆𝑫𝒗

𝑫𝒕= 𝝆

𝝏𝒗

𝝏𝒕+ 𝝆 𝒗 ∙ 𝛁 𝒗

𝝆𝑫𝒗

𝑫𝒕= 𝝆

𝝏𝒗

𝝏𝒕+ 𝝆 𝒗 ∙ 𝛁 𝒗

𝝆𝝏𝒗

𝝏𝒕+ 𝝆 𝒗 ∙ 𝛁 𝒗 = 𝒇𝒑𝒓𝒆𝒔𝒔𝒖𝒓𝒆 + 𝒇𝒔𝒖𝒓𝒇𝒂𝒄𝒆 + 𝒇𝒈𝒓𝒂𝒗𝒊𝒕𝒚

• Transforming lagrangian continuity equation to Eulerian

Appendix B. Navier – Stokes Equation

Page 42: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 42Computer Graphics @ Korea University

𝒇𝒈𝒓𝒂𝒗𝒊𝒕𝒚 = 𝝆g

• Body force

(g is the gravitational acceleration constant ≈ 9.81m/s2)

• Surface force

- Stress Tensor

+

+

+

+

=

zzzyzx

yzyyyx

xzxyxx

zzzyzx

yzyyyx

xzxyxx

p

p

p

p

p

p

00

00

00

-𝒑 =𝟏

𝟑(𝝈𝒙𝒙 + 𝝈𝒚𝒚 + 𝝈𝒛𝒛)Let p satisfy Then,

Pressure term Friction term

=

+

+

+

zzzyzx

yzyyyx

xzxyxx

zzzyzx

yzyyyx

xzxyxx

p

p

p

<Fig.B4 Differential element in Cartesian coordinate>

Shear stress term

Appendix B. Navier – Stokes Equation

Page 43: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 43Computer Graphics @ Korea University

• Surface force(x-component)

𝒇𝒔𝒖𝒓𝒇,𝒙 = −𝝏𝒑𝒙𝝏𝒙

+𝝏𝝉𝒙𝒙𝝏𝒙

+𝝏𝝉𝒚𝒙

𝝏𝒚+𝝏𝝉𝒛𝒙𝝏𝒛

𝒇𝒔𝒖𝒓𝒇,𝒙 = −𝝏𝒑𝒙𝝏𝒙

+ 𝝁𝝏𝟐𝒗𝒙𝝏𝒙𝟐

+ 𝝁𝝏𝟐𝒗𝒚

𝝏𝒚+ 𝝁

𝝏𝟐𝒗𝒛𝝏𝒛𝟐

= −𝝏𝒑𝒙𝝏𝒙

+ 𝝁𝛁𝟐𝒗𝒙

𝒇𝒔𝒖𝒓𝒇 = −𝛁𝒑 + 𝝁 𝛁 ∙ 𝛁 𝒗

𝒑𝒙 𝒑𝒙 +𝝏𝒑𝒙𝝏𝒙

𝒅𝒙

𝝉𝒙𝒙𝝉𝒙𝒙 +

𝝏𝝉𝒙𝒙𝝏𝒙

𝒅𝒙

𝝉𝒚𝒙 +𝝏𝝉𝒚𝒙

𝝏𝒚𝒅𝒚

𝝉𝒚𝒙

𝝉𝒛𝒙 +𝝏𝝉𝒛𝒙𝝏𝒛

𝒅𝒛

<Fig.B5 Free body diagram for the differential element>

𝒑𝒙𝒅𝒚𝒅𝒛 − 𝒑𝒙 +𝝏𝒑𝒙𝝏𝒙

𝒅𝒙 𝒅𝒚𝒅𝒛 = −𝝏𝒑𝒙𝝏𝒙

𝒅𝒙𝒅𝒚𝒅𝒛

−𝝉𝒙𝒙𝒅𝒚𝒅𝒛 + 𝝉𝒙𝒙 +𝝏𝝉𝒙𝒙𝝏𝒙

𝒅𝒙 𝒅𝒚𝒅𝒛 − 𝝉𝒚𝒙𝒅𝒛𝒅𝒙

=𝝏𝝉𝒙𝒙𝝏𝒙

𝒅𝒙𝒅𝒚𝒅𝒛 +𝝏𝝉𝒚𝒙

𝝏𝒚𝒅𝒙𝒅𝒚𝒅𝒛 +

𝝏𝝉𝒛𝒙𝝏𝒛

𝒅𝒙𝒅𝒚𝒅𝒛

+ 𝝉𝒚𝒙 +𝝏𝝉𝒚𝒙

𝝏𝒚𝒅𝒚 𝒅𝒛𝒅𝒙 − 𝝉𝒛𝒙𝒅𝒙𝒅𝒚 + 𝝉𝒛𝒙 +

𝝏𝝉𝒛𝒙𝝏𝒛

𝒅𝒛 𝒅𝒙𝒅𝒚

Appendix B. Navier – Stokes Equation

Page 44: Particle-Based Fluid Simulation for Interactive Applicationskucg.korea.ac.kr/new/seminar/2018/ppt/ppt-2018-08-09.pdf · (1) Proposing Particle-Based method for interactive fluids

Hyun-sang Lim | 2018. 08. 09 | # 44Computer Graphics @ Korea University

Appendix C. Curvature

- Definition of curvature.

𝑘 =1

𝑟=𝛿𝜃

𝛿𝑠

𝑟

𝛿𝑠

𝛿𝜃

−𝑛(𝑟 + 𝑑𝑟)𝑑𝑠

−𝑛(𝑟)

𝑑𝜃𝑘 =

𝑑𝜃

𝑑𝑠, 𝑛 = 𝛻𝑐𝑠

- Finding curvature.

−𝑛 𝑟 + 𝑑𝑟 / 𝑛−𝑑𝑛/ 𝑛

𝑑𝜃−𝑛 𝑟 / 𝑛

- Normalizing -n.

𝑑𝜃 =−𝑑𝑛/ 𝑛

1

=−𝑑𝑛

𝑛≈

1

𝑛

𝜕(−𝑛𝑥)

𝜕𝑥d𝑥 +

𝜕(−𝑛𝑦)

𝜕𝑦d𝑦 +

𝜕(−𝑛𝑧)

𝜕𝑧d𝑧 =

1

𝑛𝛻 −𝑛 ∙ 𝑑𝑠 =

−𝛻2𝑐𝑠𝑛

𝑑𝑠 𝑐𝑜𝑠∅

𝑘 =𝑑𝜃

𝑑𝑠=−𝛻2𝑐𝑠𝑛

𝑐𝑜𝑠∅

−𝛻𝑐𝑠

𝑟

𝑟 + 𝑑𝑟

<Fig.C1 SPH Color field having divergence value>