33
Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

Embed Size (px)

Citation preview

Page 1: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

Mode-Splitting for Highly Detail, Interactive Liquid

Simulation

H. Cords University of Rostock

Presenter: Truong Xuan Quang

Page 2: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

Content

0. Abstract

1. Introduction

2. Related work

3. Our Approach

4. Implement and Result

Page 3: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

Abstract

A new technique for highly detailed interactive liquid simulation

Separated low-frequency (LF) and high-frequency (HF)

LF: free surface wave, 2D wave equation

HF: liquid follow, 3D Navier-Stock equation

Rendering in 2.5 D

Simulation liquid follow according to gravity, ground, obstacles and interaction with impacts, moving impact, etc

Page 4: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

IntroductionReal-time liquid simulation can be classified as follows:

Empirical (expert) surface simulation

Physically-based surface simulation (wave equation)

Physically-based volume simulation(Navier-Stokes equations )

Page 5: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

Introduction

The Goal : mode-splitting to increase quality of the simulate liquid. Moving obstacles, rain, surface wave generation, etc……

Splitting based:

Navier-Stockes based method: Fluid flow, movement of free surface

2D wave equation: fast solve wave equation

Finally combines the advantages of both physically-based approaches

Limitation: not valid in splashing or breaking wave

Page 6: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

Related work Simulation and rendering liquids and effected (e.g. [Carlson

et al. 2004] [Hong and Kim 2005] [Guendelman et al. 2005] [Muller et al. 2005]).

The Navier-Stokes equations are usually solved with particle-based systems (e.g Smoothed Particle Hydrodynamics - SPH), [Adabala and Manohar 2002].

In [Stam and Fiume 1995] the first real-time approach using SPH is presented.

Interactive simulation of fluids was introduced in [Stam 1999]

Execution on the GPU with reasonable frame rates [Harris-2005]

Solving the wave equation was presented [Yuksel et al. 2007]

And etc..

Page 7: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

Our Approach Goal for simulation: real-time and large scale Lagrangian methods few particlesLiquid volume Small grid size (Eulerain)

Propose model-slitting method to simulate highly detailed surface: described by 2D wave equation is solve by FDM and liquid flow by Navier-Stockes equations there is solve with the (SPH)

Page 8: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

Our Approach

Page 9: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

Our Approach

For visualization we use a height field-based rendering approach most liquid surface can be rendered appropriately as height fields.

However, complex liquid phenomena, such as breaking waves or splashes, cannot be visualized as height fields.

Page 10: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

Mode Splitting

Using oceanography the method is used to simulated high frequency waves is external gravity waves-included by tide and atmospheric pressure, water waves, free surface water.

And low frequency waves Internal gravity wave included by wind and density gradients, vertical turbulences.

Different algorithms are used, external and internal algorithms are solved separately with different time steps

c : speed of lightl :amplify frequencyNth mode

Page 11: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

Mode Splitting Moving external waves need to be solved at small

time steps

The slow moving internal waves are more expensive to solve (due to complex turbulences), large time step can be used

We used the 2D equation for surface simulation and a 3D SPH-based Navier-Stokes equations solver for volume flow simulation

Page 12: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

Surface simulation

The general wave equation describes the propagationsof wave in time t and space x, liquid surface wave the 2DWave equation can be used, describing the circular wavePropagation

Laplace operator in 2D and c is the velocity at the which wave propagate acrossThe wave equation can be solved with Eulerian finite difference approach

Page 13: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

Implicit different method

2),(2

),(2

t

txutxuc

,0)()0,(

0,0),(),0(

0,0

lxxfxu

ttlutu

tlxi

α is constant, m>0 is integer and time step size k>0, with h=l/m

ihxi for each i=0, 1…, m

jkt j for each i=0, 1…, m

Page 14: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

Implicit different method

02)(

)1t,i(x)t,iu(x2)1t,iu(x2)2(

)it,12(x)t,u(x2)t,12u(x2α2)1(

)it,11(x)t,u(x2)t,11u(x2α

22

)t,1(x)t,iu(x2)t,1iu(x)it,i(x2

2x

u2

21

)it,11(x)t,u(x2)t,11u(x)it,(x

21x

u2

2)1it,(x)t,u(x2)1t,u(x

)it,1(x2t

u2

t

iuii

x

uiii

x

iii

x

iiii

x

iiii

it

iiiii

i

Page 15: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

Implicit different method

2/1/

xtry

xtrx

)1,()),12(),12((2

)),11(),11((2),()]22(22[)1,(

itxiuitxuitxury

itxuitxurxitixuryrxitixu

1 2 3

1. Several radius wave propagations2. Rain-Drop 3. A swimming object is moving

Page 16: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

Liquid simulation

)0( t

p

Navier-Stokes equations

Conservation of mass (continuity equation ) in rest position

V is velocity filed Ρ the pressure field μ: viscosity f: external force

Incompressible liquids, density is constant

Resulting in the mass conservation

0v

Page 17: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

Simple and fast handling of boundary conditions as collisions

Mass conservation is guaranteed (number of particles = const; mass of each particle = const)

Nonlinear convective acceleration can be neglected

SPH for real-time simulation

vv ).(

Page 18: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

SPHSPH (Smooth Particle Hydro-dynamics) is an simulation method for particle systems defined at discrete particle locations can be evaluated everywhere in the space.

Continuous field quantities distributed in the localneighborhood according to the discrete particle positions andthe smoothing kernels Wh(x).

Scalar quantities A(x) can be estimated for n particles as :

Page 19: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

SPHPressure force

External force

Viscosity forceneglected

Smoothing kernel for pressure and viscosity

Page 20: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

SPH

a(t0)v(t0)xi(t0)

tiv a(t0+Δt)v(t0+ Δt)xi(t0+ Δt)

The liquid volume is discredited by particles

z

preshW

yi

xi

zi

x

preshW

y

preshW

Page 21: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

SPH

Page 22: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

CollisionsCollisions of liquids particles with objects are using a force vector field surrounding collision objects

Where d is the closet distance between object and particle nObject is normal vector of the object at the points closet objectFcol: is acting on each particle being close to collision objects

V: reflect velocity, friction coefficient

Page 23: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

Free surface Extraction Generated height surface: number of neighbors potential Φ

for n particles with position xi (i=1..n) is determined by the following spherical potential

These particles can be detected according to their actual number of neighbors

Threshold (condition of the smoothness), to reduce unwanted surface ripples cause by the discrete sampling of the liquids

Page 24: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

Free surface Extraction (2/2)

Depending kinetic energy

n particlesvi velocitiesmi mass (i=1..m)

If Ekin exceeds a defined of threshold, no smoothing occurs

Else bellow threshold, the number of smoothing steps is increased, until the Maximum number of smoothing step is reach

Page 25: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

Simulation time-steps

Surface simulation (wave equation) and volume simulation (SPH) should be synchronized

be integer fraction Ntime of

WE-TS

N-S TS

Example of time step (TS)Synchronization, Ntime=3WE is solved 3 times, whileNavier-Stockes is solve once

Page 26: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

Combine surface and volume simulation Final surface just depends on the different field

resolution

SPH generated surface Xsph x Ysph

Wave equation surface size XWE x YWE

Page 27: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

Rendering (1/2)

Using cube map contain the environment for approximating the effects.

Surface variation (position and normal) calculating reflection and refraction vectors.

Reflection and refraction is described by Fresnel equation.

Page 28: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

Rendering (2/2)

•Planar light map is generated via light ray tracing using Snell’s law

•Other liquid can be also applied, simple liquid like:

milk, cola, oil.

SPH WE

Page 29: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

4.1 Implementation and Results

Using OpenGL 2.0 and shading language GLSL in C++, dual core PC 2.6 GHz AMD Athlon 64 CPU.

2 GBs of RAM and graphics card ATIRadeon x 1900 GPU.

Using Parallel implementation with one core simulation SPH and one core solving wave equation

Page 30: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

4.1 Implementation and Results

Performance of the technique mainly depend on the following parameter:

Number of SPH particles

XSPH . YSPH

XWE . YWE

Results of experiments show that SPH simulation account for 40-70% of the run time-less than 4000 particles.

Disadvantage is impossible to visualize 3D liquid effects like: splashes, breaking waves, cause by 2.5D rendering approach

(2D WE + 3D SPH+ rendering)=2.5D

Page 31: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

4.1 Implementation and Results

Advantaged: Volume interaction (moving glass of water, obstacles) Surface interaction (rain, moving objects) Automatic, natural and global flow Object moving with the follow Simulation pool or sea

Page 32: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang

4.2 Conclusion and future work Simulation of the low frequency liquid flow and the high

frequency free surface waves are separated

2D WE and 3D fluid (SPH-method) presented realistic and highly detailed results

Future works: Simulation in real-time environments at high frame rates,

better rendering approach.

GPU or PPU (Physic Processing Unit) for physical calculations.

Applied for larger liquid volume

Page 33: Mode-Splitting for Highly Detail, Interactive Liquid Simulation H. Cords University of Rostock Presenter: Truong Xuan Quang