Download Real-Time Simulation of Dust Behavior

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Monte Carlo methods for electron transport wikipedia , lookup

Relativistic quantum mechanics wikipedia , lookup

Electron scattering wikipedia , lookup

Standard Model wikipedia , lookup

ATLAS experiment wikipedia , lookup

Compact Muon Solenoid wikipedia , lookup

Identical particles wikipedia , lookup

Theoretical and experimental justification for the Schrödinger equation wikipedia , lookup

Elementary particle wikipedia , lookup

Transcript
Real-Time Simulation of Dust
Behavior
Paul J. McLaurin
UNC-CH, COMP 259
April 24, 2002
Motivation


Want to model dust clouds generated
by a fast-moving vehicle and simulate
their behavior using physically based
methods in real time
Presented by Chen et al. in a 1999
paper (see references slide)
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
2
Technique



Use particle systems to represent dust
particles
Use Computational Fluid Dynamics
(CFD) to compute the air flow around
and behind the vehicle
Render the particles using billboard
textures with alpha transparency
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
3
Process




Analyze forces and factors that affect dust
particle generation
Look at dust particle behavior after
generation
Construct physically based empirical models
for generating dust particles and for
controlling their behavior
Based on models and analysis of forces,
divide dust behavior into three stages, and
establish simplified particle systems for each
stage
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
4
Particle Properties









Position (3D orientation and center location)
Movement (velocity, acceleration, etc.)
Color (RGB)
Transparency (alpha)
Shape (point, rectangle, cube, etc.)
Density
Mass
Lifetime
Blur head and rear pointers (for motion blur)
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
5
Simulation Loop for Particles



Create particle systems
Initialize each particle’s parameters
Each simulation frame:





Create and remove particles
Calculate and update particle parameters
Adjust motion blur pointers
Render particles
Update particle systems’ range of activities
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
6
Dust Generation


Car presses down on tire, which crushes dirt and
ejects dust particles from the sides of the tire
Some particles stick to the tire and fly off after some
amount of time
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
7
Dust Generation (cont.)

Moving air underneath and behind the vehicle
creates a pressure gradient that will lift fine
dust particles off the ground
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
8
Parameters








vehicle velocity: Vcar
vehicle weight: WTcar
tire angular velocity: tire
tire radius: Rtire
particle size: p
particle density: p
particle stickiness: p
length, height, and width of vehicle: Lcar, Hcar,
Wcar
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
9
Parameters (cont.)




environmental wind: Vwd
density of dust on ground: gd
average size of particles on ground: gd
adhesion and wetness of ground: gd
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
10
Fluid Dynamics

Field of aerodynamics called “separated flow” helps
simulate air flow behind vehicle
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
11
Reynolds Number

A metric for fluid flow
VL
Re 
v
L and V are characteristic length and
velocity
 v is the kinematic energy
 For a pipe, L is the pipe diameter and V
is the velocity of the fluid flow

Paul J. McLaurin
Real-Time Simulation of Dust Behavior
12
Re for Vehicle

Consider the Re for a vehicle:




Vcar = 60 km/hr, L = 1m, v = 10-5
Re on the order of 106
With such a high Re, air flow around the
edges of vehicle is turbulent
However, turbulence is very hard to simulate,
so flow will be approximated as a steady, low
Re, laminar flow modified by random
velocities in the high-Re turbulent region
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
13
Air Flow Around Vehicle
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
14
Navier-Stokes Equations


We assume steady, low speed, and incompressible
flow in low Re region. Gravity force of air is ignored.
Incompressible Navier-Stokes equations:
ux  v y  w z  0
1
ut  uux  vuy  wuz    x 
uxx  uyy  uzz 

Re
1
v t  uv x  vvy  wv z    y 
v xx  v yy  v zz 

Re
1
w t  uw x  vwy  wwz    z 
w xx  w yy  w zz 

Re
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
15
Navier-Stokes (cont.)
dx
dy
dz
u  ,v  ,w 
dt
dt
dt
u
 2u
ux  ,uxx  2
x
x
p
x 
x
p is the pressure, Re is the Reynolds Number

Paul J. McLaurin
Real-Time Simulation of Dust Behavior
16
Poisson Equation
Separates pressure effects from the partial
derivatives to model elliptic nature of flow

 ux  v x  w z 
   Dp 
t
2

d 
1
Dp  uux  vuy  wuz 
uxx  uyy  uzz 


dx 
Re

d 
1
 uv x  vvy  wv z 
v xx  v yy  v zz 


dy 
Re

d 
1
 uw x  vwy  wwz 
w xx  w yy  w zz 


dz 
Re
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
17
Solving Equations

These equations are solved using Ghia’s
approach



Alternating-Direction Implicit (ADI) scheme is
applied to the momentum equations
Successive-Over-Relaxation (SOR) method is
used to solve the Poisson pressure equation
These methods will not be discussed in detail
here
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
18
Laminar Flow

Velocity calculation
V  ui  vj  wk
V  V  u2  v 2  w 2


To simulate the turbulence of separated flow, add
random velocities to the steady flow
 e is a random unit vector
dV
Vair  V  e L
dy
2
L  Lcar ,W car ,H car 
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
19
Pressure Gradient


The initial velocity of a particle is generated by the
pressure gradient.
Follows Bernoulli’s Theorem:
ph
1
p
 gh  Vh2  0
air
2
air

ph and Vh are pressure and the velocity at height h



known from CFD results and velocity of vehicle
p
0 is the pressure on the ground
Pressure gradient:
Paul J. McLaurin

1 2 
p0  ph  airgh  Vh 

2 
Real-Time Simulation of Dust Behavior
20
Lifting Process


Convert the pressure gradient energy to the
dust initial disturbance kinetic energy
The pressure gradient will raise the dust
particles from the ground, imparting a
momentum energy that is proportional to the
pressure difference between the initial and
final level
1
m pV02  Ahp0  ph 
2
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
21
Lifting Process (cont.)



 is a chosen ratio of momentum energy
applied to the particle (between 0 and 1)
A is the cross-section area of the particle
We can now compute the initial speed of
particle:
Ahair 2gh  Vh2 
V0 
 p p
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
22
Newton


Once in the air, each particle obeys Newton’s
Law
Forces on each particle:
 Fdrag
turbulent air friction
 Fwd
wind
 Fgrv
gravity
 Fshape small, randomly generated force to
compensate for air drag due to particle
shape
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
23
Forces Acting on Particle
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
24
Friction Drag Force

Use Batchelor’s expression for a 3D body of
surface area A in a stream of speed U to get
the total friction drag:
Fdrag  k pU 2 ARe



1
2
k is a number depending on the shape of the
particle (k = 1 approximates a simple shape)
U is
 the relative speed between the air and
the particle:
U  Vair  Vcar  Vwd  Vp 
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
25
Friction Drag Force (cont.)
In vector form:
Fdrag 
Vair  Vcar  Vwd   Vp
U
Fdrag

Paul J. McLaurin
Real-Time Simulation of Dust Behavior
26
Total Force and Acceleration


Let Fp be the total force acting on a particle, P
the position, Vp the velocity, Ap the
acceleration, and mp=pp the mass
The dust particle’s behavior is described by
the following equations:
Fp  Fdrag  Fshape  Fgrv
Ap 
Paul J. McLaurin
Fp
mp
Real-Time Simulation of Dust Behavior
27
Motion Equations

The wind itself can be a velocity field and is
changeable every frame. Thus:
Vp  V0  Vwd 
t1
A
p
dt
t0
P  P0 
t1
 V dt
p
t0

Using Euler’s method:
Vi  Vi1  A p  t

Paul J. McLaurin
Pi  Pi1  Vi  t
Real-Time Simulation of Dust Behavior
28
Dust Behavior Algorithm


For the known current state of a particle
compute the next state:
Vi  Vi1  A p  t
Pi  Pi1  Vi  t
Initial velocity of particle is given by:


Ahair 2gh  Vh2 
V0 
 p p
Initial velocity is added to current wind
velocity

Paul J. McLaurin
Real-Time Simulation of Dust Behavior
29
Dust Behavior Algorithm(cont.)



Define a finite grid coordinate for a vehicle model in a
box volume (3D flow field for CFD computation)
Width of box is 3-5 times vehicle’s width
Length is 8-10 times vehicle’s length
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
30
Dust Behavior Algorithm(cont.)


Solve Navier-Stokes equations using ADI and
SOR methods
Number of particles is proportional to
predefined ground dust density, size, and
wetness
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
31
Results — Slow!


This method is very slow (not real time)
Solving the Navier-Stokes equations takes 7 minutes
on an SGI O2 workstation with a single MIPS R5000
and 64 MB of memory
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
32
Simplified Dust Particle Systems

To speed up the calculations, divide
dust particle’s behavior into three
stages:



Fluid Turbulence
Particle Momentum
Airborne Drift
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
33
Fluid Turbulence



Pre-compute the laminar flow at any point in
the flow volume off-line
This avoids having to compute the CFD
solution on the fly
Vair is computed using:
dV
Vair  V  e L
dy

2
Laminar portion of Vair is read directly from
memory

Paul J. McLaurin
Real-Time Simulation of Dust Behavior
34
Fluid Turbulence (cont.)


Vwd is provided, which can be a function of
time
Fdrag can then be calculated immediately
without CFD computation: 1
Fdrag  k pU ARe
2


2
Assume Reynolds number of the air, the
cross section, and the density of the particle
are constant:

Fdrag  cU 2
c  k p ARe
Paul J. McLaurin

1
2
Real-Time Simulation of Dust Behavior
35
Fluid Turbulence (cont.)



If velocity of car changes, fluid data is no
longer valid
Several key frames of the velocity field are
computed with different vehicle velocities and
the closest frames are interpolated between
Fire off another process to re-compute the
CFD solution (not implemented yet)
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
36
Particle Momentum



Turbulent air becomes insignificant after
some amount of time
At this point, Fgrv and Fdrag are the primary
forces governing particle behavior
This stage continues until the dust particle’s
velocity is very close to the wind velocity
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
37
Airborne Drift



At this point, the particle begins to move with
constant velocity towards the ground because
Fgrv and Fdrag are balanced
Small, low-density particles are suspended in
the air and drift
A particle drifts until it dies by either hitting the
ground or floating too far from the vehicle
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
38
Improved Performance

Use of the simplified particle system stages
allowed for 4 FPS with 3000 particles on an
SGI O2 with a single MIPS R5000 and 64 MB
of memory
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
39
Results

2000 particles at 4 FPS on an Onyx II
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
40
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
41
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
42
Video 1



20,000 particles
Not real-time
Around 2 minutes per frame
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
43
Video 2



20,000 particles
Not real-time
Around 2 minutes per frame
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
44
References

Chen, Jim X., Xiaodong Fu, and Edward J. Wegman.
“Real-Time Simulation of Dust Behavior Generated
by a Fast Traveling Vehicle.” ACM Transactions on
Modeling and Computer Simulation. Vol. 9, No. 2,
April 1999, p. 81–104.
Paul J. McLaurin
Real-Time Simulation of Dust Behavior
45