48
Particle-Based Fluid Simulation for Interactive Applications Matthias Müller David Charypar Markus Gross

Particle-Based Fluid Simulation for Interactive Applications

Embed Size (px)

DESCRIPTION

Particle-Based Fluid Simulation for Interactive Applications. Matthias Müller David Charypar Markus Gross. Abstract. 이 논문에서는 SPH 를 기반으로 자유표면을 시뮬레이션 하는 상호작용하는 기법 제안 Navier -Stokes 방정식으로부터 힘의 density 을 계산하는 과정에 표면장력 효과를 더해주어 시뮬레이션 Eulerian 기반 방법보다 좋은 점 - PowerPoint PPT Presentation

Citation preview

Page 1: Particle-Based Fluid Simulation for Interactive Applications

Particle-Based Fluid Simulation for Interactive Applications

Matthias MüllerDavid Charypar

Markus Gross

Page 2: Particle-Based Fluid Simulation for Interactive Applications

Abstract

• 이 논문에서는 SPH 를 기반으로 자유표면을 시뮬레이션 하는 상호작용하는 기법 제안

• Navier-Stokes 방정식으로부터 힘의 density 을 계산하는 과정에 표면장력 효과를 더해주어 시뮬레이션

• Eulerian 기반 방법보다 좋은 점– 이 방법은 질량을 보존하고 , 이류텀에서

복잡성을 줄일 수 있음– 파티클로 유체의 표면을 직접 렌더링 할 수 있음

Page 3: Particle-Based Fluid Simulation for Interactive Applications

Abstract

• Marching cube 기법과 point splatting 기법을 사용하여 자유 표면을 추적하고 가시화 하는 기법 제안

• 이 논문에서의 animation 기법은 inter-active 한 시스템에서 사용하기에 충분히 빠름

• 5000 개 이상의 particle 을 사용하는 사용자 기반의 인터렉션 모델에서 사용가능

Page 4: Particle-Based Fluid Simulation for Interactive Applications

Motivation

• 유체는 모든 삶의 환경에서 중요함• 이러한 현상을 simulation 하기는 복잡함• 기존의 유체 simulation

– CFD(computational Fluid Dynamics) 분야에서 오랜 시간 동안 연구되어 왔음에도 불구하고 여전히 많은 문제가 논의되고 있음

– 이류 , 확산 , 난류 , 표면 장력과 같은 현상들이 복잡하게 상호작용하기 때문

– 유체 현상을 일반적으로 독립되어 simulation 한 후 , 나중에 가시화

– 가능한 정확한 결과를 얻어 항공 역학이나 터빈 또는 파이프의 최적화를 수행하기 위함

Page 5: Particle-Based Fluid Simulation for Interactive Applications

Motivation

• 실시간 유체 simulation–실시간으로 유체를 simulation 하는 덜 정확한

기법은 새로운 application 의 다양성을 이끌어냄

–우선 디자인 단계에서 수행되는 실시간 기법을 돕는 유용한 발상에 대해서 이야기함

–의학 simulation, computer game, 여러 가지 가상 환경에 사용될 수 있는 실시간 simu-lation 기술을 사용한 application 에 관해 다룸

Page 6: Particle-Based Fluid Simulation for Interactive Applications

Motivation

• Pouring water into a glass at 5 frames per second

Page 7: Particle-Based Fluid Simulation for Interactive Applications

Related Work

• Computational Fluid Dynamics 의 역사는깊음– Claude Navier(1822) 와 George

Stokes(1845) 는 유체의 운동에 관한 Navier-Stokes 방정식을 정립

– Navier-Stikes 방정식 외의 두 가지 보존식이 있음• 밀도 보존을 내포하는 continuity 방정식• 에너지를 보존하는 state 방정식

Page 8: Particle-Based Fluid Simulation for Interactive Applications

Related Work

• 이러한 수식들을 수치적으로 컴퓨터를 이용하여 풀이하는 많은 방법들이 CFD분야에서 제안됨

• 지난 20 년간 컴퓨터 그래픽스 분야에서 특별한 유체 시뮬레이션 기법이 제안됨– T.Reeves(1983) 흐트러진 object 들을 par-

ticle system 으로 모델링하는 기술을 소개– Particle 기반의 Lagrangian 기법과

격자기반의 Eulerian 기법이 둘 다 그래픽스 분야에서 사용

Page 9: Particle-Based Fluid Simulation for Interactive Applications

RelatedWork

– Desburn 과 Cani 와 Tonnesen 은 부드러운 객체이 애니메이션을 위해 particle 사용

– Particle 은 표면을 애니메이션 하는데 사용 되고 implicit 표면을 제어하고 , 용암을 애니메이트하는데 사용

–최근 Eulerian 기반의 유체 시뮬레이션은 물과 부드러운 객체와 녹는 효과 등에서 대중적으로 사용

Page 10: Particle-Based Fluid Simulation for Interactive Applications

RelatedWork

• Interactive 한 시스템에서 사용 가능할 만한 매우 적은 수의 기술이 있음–격자 기반의 Stam 의 방법은 실시간 유체

시뮬레이션에서 중요함– Height field 를 사용하는 특수한 경우의

인터렉티브한 애니메이션 기술• 우리는 임의의 유체 움직임을 애니메이션 하시

위해 SPH 를 사용하는 particle 기반의 방법을 제안

Page 11: Particle-Based Fluid Simulation for Interactive Applications

Our Contribution

• 자유표면의 유체를 시뮬레이션 하기 위해 SPH기반의 기법을 사용

• 표면장력을 모델링하는 방법을 제안하고 Navier-Stokes 방정식으로부터 점성과 pressure field을 이끌어낼 것임

• 실시간 환경을 제안하기 위해 새로운 Smoothing Kernel 을 디자인 함

• 표면 탐색과 표면의 렌더링은 인터렉티브한 속도를 내기 어려운 문제이며 , 이를 해결하는 가능한 해법을 설명할 것임

Page 12: Particle-Based Fluid Simulation for Interactive Applications

Smoothed Particle Hydrodynamics

• SPH 는 particle system 을 위한 보간방법• SPH 를 사용하면 각각의 필드값은 particle 의 위치에 따라 결정• 방사형으로 대칭인 (radial symmetrical) smoothing ker-

nel 을 이용하여 , r 위치에서 스칼라 필드 값 A 는 모든 파티클의 공헌하는 양 (contribution) 의 weighted sum 에 의해 보간해서 구해짐

Page 13: Particle-Based Fluid Simulation for Interactive Applications

Smoothed Particle Hydrodynamics

• 반지름 h 를 주어 제한된 영역에서 사용• W(r , h) = W(-r , h) 이며 normalize 된 함수• 부피 (vi) = mi/ρi 질량은 constant,밀도는 변함

Page 14: Particle-Based Fluid Simulation for Interactive Applications

Smoothed Particle Hydrodynamics

• SPH 의 gradient 와 Laplacian 는 오직 SPH kernel 에만 영향을 줌

• SPH 의 문제점– SPH 를 이 용 하 는 유 체 방 정 식 은 힘 의 균 형 과

운동량의 보존과 같은 물리적 특성을 보장하지 못함

Page 15: Particle-Based Fluid Simulation for Interactive Applications

Modeling Fluids with Parti-cles

• Eulerian 의 방법에서 유체는 velocity field, density field, pressure field 으로 묘사됨

• 질량보존의 법칙과 Navier-Stokes 방정식을 보장함

• 질량 보존의 법칙

Page 16: Particle-Based Fluid Simulation for Interactive Applications

Modeling Fluids with Parti-cles

• Navier – Stokes 방정식

• grid 기반의 방법을 이용할 때 보다 particle기반을 이용하면 위의 두 방정식이 간단해짐– 질량 보존의 법칙을 고려하지 않아도 됨– convective term 을 필요로 하지 않음

• substantial derivative of the velocity field

t

vvv

t

v

Dt

Dv

Page 17: Particle-Based Fluid Simulation for Interactive Applications

Modeling Fluids with Parti-cles

• Particle 이 받는 힘은 N-S 방정식의 오른쪽 항들의 합

• particle 의 가속도를 구할 수 있음

)(1

)(

2

2

vgpf

t

va

t

vaf

vgpt

vvv

t

vf

i

ii

i

Page 18: Particle-Based Fluid Simulation for Interactive Applications

Pressure

• SPH 에 의해 압력 을 계산할 수 있음

• 하지만 위의 식은 symmetric 하지 않음• 중앙에서 kernel 의 gradient 값은 0 이기

때문에 파티클 i 의 압력은 j 의 압력만 가지고 계산

• 일반적으로 두 particle 의 압력은 같지 않으므로 symmetric 하지 않음

p

Page 19: Particle-Based Fluid Simulation for Interactive Applications

Pressure

• 이 논문에서 제안하는 빠르고 안정적인 압력을 구하는 방정식 (symmetric 함 )

• P 는 아래의 식을 이용하여 구함

– k 는 기체상수 , 는 기준 밀도 (rest density)0

Page 20: Particle-Based Fluid Simulation for Interactive Applications

Pressure

• 위의 방정식에서 ρ 는 아래의 방정식으로 구할 수 있음

• Pressure force(fpressure) 는 압력의 미분에 의존하기 때문에 와 k 같은 offset 은 수치적으로 압력힘에 영향을 미치지 않음

• 그러나 offset 은 SPH 에 의해 부드럽게된 field의 gradient 값에 영향을 줌

• 또한 simulation 이 수치적으로 더욱 안정됨

0

Page 21: Particle-Based Fluid Simulation for Interactive Applications

Viscosity

• SPH 의 기법에 의해 점성은 다음과 같은 비대칭 힘으로 계산할 수 있음

• Velocity 는 particle 과 particle 사이에서 다른 값을 가지므로 viscosity force 은 속도의 차이 값에 의존

Page 22: Particle-Based Fluid Simulation for Interactive Applications

Viscosity

• 본 논문에서 제공하는 자연스럽고 대칭적인 , 속도의 차이 값을 이용하여 viscosity force를 구하는 방정식이 있음

• 위의 식은 얼마나 끈적한가를 알 수 있음• 두 입자의 속도의 차이가 많이 나면 서로

잡아당기는 힘이 강함 • 크기는 같고 방향은 반대인 힘이 상호 작용

Page 23: Particle-Based Fluid Simulation for Interactive Applications

Surface Tension

• particle(molecules) 은 주변에 있는 particle끼리 서로 끌어 당기는 경향이 있음

• fluid 안에서는 당기는 힘이 모든 방향에서 같고 평형상태를 이루었음

• 하지만 표면에서는 평형상태를 이루지 않음• 표면 장력은 표면의 normal 방향으로 작용• 표면장력은 curvature 를 최소화 시키려는 경향이

있음• curvature 가 크면 클수록 힘의 세기도 큼– 표면장력은 curvature 에 비례

Page 24: Particle-Based Fluid Simulation for Interactive Applications

Surface Tension

• 표면 장력은 장력계수 σ 에 의존적임• 유체의 표면은 추가적인 필드를 사용함으로 규명할

수 있음• color field 라고 불리는 이 필드는 particle 이

있는 곳은 1, 다른 곳에서는 0 을 가짐• 본 논문에서는 smoothed color field 사용

Page 25: Particle-Based Fluid Simulation for Interactive Applications

Surface Tension

• color field 의 gradient 로 normal field 를 구함 (pointing into the fluid)

• normal field 의 divergence 값은 표면의 곡률– divergence 는 내적되어지는 vector 의

방향으로의 변화량 ( 유체의 안쪽방향으로 들어오는 vector 양이 plus 값 )

– curvature 는 plus 값을 가져야 하므로 다음과 같은 식을 얻을 수 있음

Page 26: Particle-Based Fluid Simulation for Interactive Applications

Surface Tension

• curvature of the surface

• 표면장력 (surface traction 끄는 힘 ) 은 장력계수와 curvature 에 비례 방향은 normal field 방향

Page 27: Particle-Based Fluid Simulation for Interactive Applications

Surface Tension

• 표면주위에 있는 particle 에 의한 표면장력을 분배시키고 힘의 밀집장 (force density field) 을 구하기 원함

• 그래서 ‘ 0’ 이 아닌 normalize 된 스칼라 field |n| 을 곱해주어 다음과 같은 식을 얻음

Page 28: Particle-Based Fluid Simulation for Interactive Applications

External Forces

• 본 논문에서는 외력을 제공함–중력 , 유저의 상호작용으로 인한 particle

사이의 충돌–이러한 힘들은 SPH 를 사용하지 않고 입자에

적용–본 논문에서 입자가 물체와 충돌이 일어났을 경우

반대방향 속도를 주고 , 물체 반대방향으로 밀어냄

Page 29: Particle-Based Fluid Simulation for Interactive Applications

Smoothing Kernels

• SPH 의 안전성 , 정확성 , 속도는 smoothing ker-nel 에 의존

• kernel 은 모두 우함수

- 두꺼운 선은 kernel, 얇은 선은 kernel 의 gradient, 점선은 kernel 의 laplacian

wpoly6 wspiky wviscosity

Page 30: Particle-Based Fluid Simulation for Interactive Applications

Smoothing Kernels

• Kernel 은 바운더리에서 미분 값이 ‘ 0’ 이어서 안전성에 도움이 됨

• 본 논문에서 두 경우를 지닌 kernel 사용

• 거리계산에서 제곱근 연산 없이 결정• 압력이 높은 압력으로 뭉치는 경향이 있음• particle 들이 가까이 있으면 kernel 중앙의

gradient 값이 ‘ 0’ 이므로 척력이 사라짐

Page 31: Particle-Based Fluid Simulation for Interactive Applications

Smoothing Kernels

• Desburn 은 중앙 주위에서 gradient 값의 사라짐이 없는 spiky kernel 을 사용

• 척력보장 , 바운더리에서 1 차 ,2 차 미분이 ‘ 0’

Page 32: Particle-Based Fluid Simulation for Interactive Applications

Smoothing Kernels

• 점성은 마찰력에 의한 현상이므로 온도에 따른 유체의 운동 에너지의 변화에 따라 감소

• 그러므로 점성은 속도 장에 따라 smoothing됨

• Standard kernel 을 사용 할 경우 이러한 성질을 반영하지 못함

• 두 개의 particle 이 가까워 지면 두 parti-cle 의 상대 속도가 증가되는 음의 값을 가짐

Page 33: Particle-Based Fluid Simulation for Interactive Applications

Smoothing Kernels

• Particle 수에 기반하는 실시간 어플리케이션에서는 이러한 효과는 안정성의 문제를 가져옴

• Viscosity force 을 구할 때 아래와 같은 kernel 사용

Page 34: Particle-Based Fluid Simulation for Interactive Applications

Smoothing Kernels

• 아래의 추가적인 특성에 따라 Laplacian 은 어디서나 양의 값을 가짐

• 이 kernel 의 사용은 어떠한 damping force ( 감쇠력 ) 에 대해서 안전성을 높여줌

Page 35: Particle-Based Fluid Simulation for Interactive Applications

Simulation

• Leap frog scheme 사용 식 (8) 의 적분을 위해

• 힘을 한 번에 계산 할 수 있는 second order scheme 은 우리의 제안 방법에 어울림

• 더 나은 결과를 위하여 adaptive time step 인 Courant-Friedrichs-Lewy con-dition 을 사용

Page 36: Particle-Based Fluid Simulation for Interactive Applications

Surface Tracking and Visualiza-tion

• Color-field 와 color-field 의 gradient field 인 n = 는 표면을 이루는 particle과 표면의 normal 값

• particle i 가 이면 표면 particle 로 정의함 ( 은 threshold 값 )

• particle i 위치에서의 표면 particle 의 normal 값은 임

cs

l

Page 37: Particle-Based Fluid Simulation for Interactive Applications

Point Splatting

• Particle 의 normal 값에 대한 정보는 있지만 particle 의 연결정보는 가지고 있지 않음

• Point splatting 에서는 이러한 타입의 정보를 다룸

• 그러나 이러한 방법들은 10,000 개나 100,000 개의 point 로 이루어진 스캔 데이터를 이용함

• 우리는 오직 표면에 있는 작은 천 단위의 parti-cle 을 사용

Page 38: Particle-Based Fluid Simulation for Interactive Applications

Point Splatting

• 그럼에도 나타난 결과를 보면 그럴듯한 결과가 나타남

• 우리는 최근 유체의 표면을 upsample 하는 방법을 사용함

• 표면 particle 의 color field 정보를 보간 하여 렌더링에 사용되는 추가적인 particle의 위치를 구함

Page 39: Particle-Based Fluid Simulation for Interactive Applications

Marching Cubes

• free surface 를 가시화 시키는 또 다른 방법은 cs의 iso surface 를 렌더링 하는 것임

• iso surface 를 triangulate 하기 위해 march-ing cube algorithm 을 사용

• 공간에 고정된 격자에서 표면이 포함된 cell 을 찾아서 구별함

• 표면을 따라 격자를 탐색하여 표면 particle 이 내재된 모든 cell 을 찾음

• 표면이 내재된 각각의 cell 에서 빠르게 table 을 살펴서 삼각형이 생성됨

Page 40: Particle-Based Fluid Simulation for Interactive Applications

Implementation

• SPH 에서 사용하는 smoothing kernel 은 제한하는 값 h 를 사용

• Cell 격자의 크기 h 를 사용하는 것은 계산의 복잡성을 감소시킴

• Particle i 가 존재하는 cell 또는 그 이웃 cell 만을 탐색하여 서로 상호작용하는 잠재적인 particle 을 찾음

Page 41: Particle-Based Fluid Simulation for Interactive Applications

Implementation

• Particle 격자에 연관하여 저장하는 대신에 각 격자 cell 에 particle 객체의 값을 저장

• 보간 연산을 할 때 필요한 메모리 접근 시 캐쉬 히트 비율을 극적으로 증가 시켜서 속도를 빠르게 함

Page 42: Particle-Based Fluid Simulation for Interactive Applications

Results

• 그림 (3) 은 2200 개의 particle 을 사용하여 컵 안의 물을 보여줌

Page 43: Particle-Based Fluid Simulation for Interactive Applications

Results

• Figure 4 : The user interacts with fluid causing it to splash

Page 44: Particle-Based Fluid Simulation for Interactive Applications

Results

• Figure 5 : Pouring water into a glass at 5 frames per second

Page 45: Particle-Based Fluid Simulation for Interactive Applications

Results

• Rotational 한 외력을 주어 유체가 소용돌이 침• 그림 (a) 는 각각의 particle 을 보여줌• 그림 (b) 는 자유 표면을 렌더링 하기 위해 point

splatting 을 사용• 그림 (c) 은 marching cubes algorithm 을

사용하여 color field 의 iso-surface 를 가시화

• 그림 (a),(b) 는 초당 20 frame , 그림 (c) 는 초당 5 frame

Page 46: Particle-Based Fluid Simulation for Interactive Applications

Results

• 그러나 여전히 대부분의 off-line 유체 simulation 기술 보다 frame rate 가 높음

• 다음 세대의 그래픽 카드를 사용하면 실시간 기술이 더욱 가능해 질 것임

Page 47: Particle-Based Fluid Simulation for Interactive Applications

Conclusions and Future Work

• 우리는 particle 기반의 interactive 한 유체 simulation 을 보여줌

• SPH 기반의 물리 모델을 사용• 안정성과 속도 향상을 위한 특별한 kernel

사용• Free surface 을 추적하고 렌더링 하는 기술을

설명• Off-line 계산한 애니메이션과 같이 실사와

같은 결과는 아님

Page 48: Particle-Based Fluid Simulation for Interactive Applications

Conclusions and Future Work

• 그러나 많은 시간이 소요되는 최근의 off-line방법과는 달리 interactive 함

• 물리 기반 모델의 사용은 사실상 불변하지만 실시간으로 유체 free surface 을 추적하고 렌더링 하는 기술은 아직 많은 연구주제가 남아 있음

• 미래에 marching cube-based algo-rithm 의 성능을 높일 수 있는 upsampling기술을 개발할 것임