Transcript Document
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
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
Introduction
Real-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 )
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
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 [Harris2005]
Solving the wave equation was presented [Yuksel et al.
2007]
And etc..
Our Approach
Goal for simulation: real-time and large scale
Lagrangian methods few particles
Liquid 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 NavierStockes equations there is solve with the (SPH)
Our Approach
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.
Mode Splitting
c : speed of light
l :amplify frequency
Nth mode
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
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
Surface simulation
The general wave equation describes the propagations
of wave in time t and space x, liquid surface wave the 2D
Wave equation can be used, describing the circular wave
Propagation
Laplace operator in 2D and c is the velocity at the which
wave propagate across
The wave equation can be solved with Eulerian finite
difference approach
Implicit different method
2u ( x, t )
c 2u ( x, t )
t 2
0 xi l ,
t 0
u (0, t ) u (l , t ) 0,
u ( x,0) f ( x)
t 0
0 x l,
α is constant, m>0 is integer and time step size k>0, with h=l/m
xi ih
t j jk
for each i=0, 1…, m
for each i=0, 1…, m
Implicit different method
2 u
u(xi , t i 1) 2 u(xi , t i ) (xi , t i 1)
(x1, t i )
ti 2
ti 2
2 u
u(x1 1, t i ) 2 u(xi , t i ) (x11, t i )
(x i, t i )
x12
x12
2 u
u(xi 1, t i ) 2 u(xi , t i ) (xi 1, t i )
(xi , t i )
x 22
x22
u(x1 1, t i ) 2 u(xi , t i ) (x11, t i )
u(x2 1, t i ) 2 u(xi , t i ) u (x2 1, t i ) u(xi , t i 1) 2 u(xi , t i ) u (xi , t i 1)
α2
α2
0
2
2
2
(x1)
(x2 )
(t )
Implicit different method
rx t / x1
ry t / x2
u( xi , ti 1) [2 2(rx 2 ry 2 )]u( xi , ti ) rx 2 (u( x1 1, ti ) u( x1 1, ti ))
ry 2 (u( x2 1, ti ) u( x2 1, ti )) u( xi, ti 1)
1
2
3
1. Several radius wave propagations
2. Rain-Drop
3. A swimming object is moving
Liquid simulation
Navier-Stokes equations
V is velocity filed
Ρ the pressure field
μ: viscosity
f: external force
Conservation of mass (continuity equation ) in rest position
Incompressible liquids, density is constant
Resulting in the mass conservation
v 0
p
( 0)
t
SPH for real-time simulation
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 (v.)v can be
neglected
SPH
SPH (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 local
neighborhood according to the discrete particle positions and
the smoothing kernels Wh(x).
Scalar quantities A(x) can be estimated for n particles as :
SPH
Pressure force
External force
Viscosity force
neglected
Smoothing kernel for pressure and viscosity
SPH
The liquid volume is discredited by particles
Wh pres
z
vi t
a(t0)
v(t0)
xi(t0)
a(t0+Δt)
v(t0+ Δt)
xi(t0+ Δt)
zi
xi
yi
Wh pres
y
Wh pres
x
SPH
Collisions
Collisions 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 object
Fcol: is acting on each particle being close to collision objects
V: reflect velocity, friction coefficient
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
Free surface Extraction (2/2)
Depending kinetic energy
n particles
vi velocities
mi 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
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=3
WE is solved 3 times, while
Navier-Stockes is solve once
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
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.
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
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
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
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
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