Dr. AQ Khan Institute of Computer Science and Information Technology
rhrtdf
RHRHG 6755

Fall 2016
The viscosity correction uses an intermediate value S which is
computed as
S=
1 6C2 r2+18C2q, !. (10.9) Now the modied relaxation
time is given by s =3(+C2S)+ 1 2 . (10.10) From Eq. (10.9) it can be
seen that S will always have a positive value thus the l
Dr. AQ Khan Institute of Computer Science and Information Technology
rhrtdf
RHRHG 6755

Fall 2016
hand is written as a partial differential equation (PDE) which only
admits continuous solutions because the derivation requires a
continuity assumption. Solutions of the differential form are known as
strong (also called pointwise) solutions. But note tha
Dr. AQ Khan Institute of Computer Science and Information Technology
rhrtdf
RHRHG 6755

Fall 2016
Once the Stream and Collide steps are completed, the f0 grid contains
the
updated
state
oftheuidforthenexttimestep.
Typically,thetwogridsarenowswapped,andsubsequent
time
steps
alternate in streaming and colliding the DFs from one grid array to
the other.
Dr. AQ Khan Institute of Computer Science and Information Technology
rhrtdf
RHRHG 6755

Fall 2016
y? What is the cross product of the two vectors ~r = rx x and ~ F =
Fy y (magnitude and direction)?
If all of these items are unfamiliar you dont remember the
quadratic formula (needed to solve the rst one), cant integrate xndx
(needed to solve the second
Dr. AQ Khan Institute of Computer Science and Information Technology
rhrtdf
RHRHG 6755

Fall 2016
where we introduce the momentum of a particle, p~ = m~v, in the last
way of writing it. c) Law of Reaction: If object A exerts a force ~ FAB
on object B along a line connecting the two objects, then object B
exerts an equal and opposite reaction force of
Dr. AQ Khan Institute of Computer Science and Information Technology
rhrtdf
RHRHG 6755

Fall 2016
: Total uid height, i.e. =H+h. To achieve a heighteld
representation of the uid we have to get rid of the vertical
dimensionintheseequationsbyaprojectionoftheintegralstothetwodimens
ionalhorizontal domain. Assume the equations are computed over a
uid colu
Dr. AQ Khan Institute of Computer Science and Information Technology
rhrtdf
RHRHG 6755

Fall 2016
FFF
FFF
FFF
FFF
.
Figure 10.2: This gure gives an overview of the stream and collide
steps for a uid cell.
Thestandardmodel,incontrasttotheoneusedhere,requiresanormalizatio
nofthevelocity
withtheuiddensity.
Forasingledirectioni,theequilibriumDF feq i canb
Dr. AQ Khan Institute of Computer Science and Information Technology
rhrtdf
RHRHG 6755

Fall 2016
Thecodeaboveandbelowrequiressomeglobalsarrays:
theweightsoftheequilibrium DFs w, and the lattice vectors. For the
D2Q9 model, these are
Lbm
D2Q9
Globals
(1)
wl[9]=cfw_1/3,
1/18,1/18,1/18,1/18,
1/18,1/18,1/18,1/18 (2) ex[9]=cfw_0, 1,1,0,0, 1,1,1,1 (3) ey[9
Dr. AQ Khan Institute of Computer Science and Information Technology
rhrtdf
RHRHG 6755

Fall 2016
can be used to achieve a variety of effects. These will be the topic of
the next section.
11.3 Boundary Conditions
In the following, we will describe different types of boundary
conditions:
reecting
and
absorsorbingboundaries,aswellasaformoffreesurfacebou
Dr. AQ Khan Institute of Computer Science and Information Technology
rhrtdf
RHRHG 6755

Fall 2016
Real Time Physics Class Notes
Absorbing Boundaries Surprisingly, it is more difcult to achieve
absorbing boundaries than reecting ones. The problem of boundaries
simulating an innite domain is already known for a long time (see,
e.g.,[Dur01]fordetails).
A
Dr. AQ Khan Institute of Computer Science and Information Technology
rhrtdf
RHRHG 6755

Fall 2016
terrainareneeded,thisisnotsufcientanymore.
Suchapplicationsrequireadistinctionbetween areas lled with uid,
and empty or dry areas. An example can be seen in Fig. 11.4. In the
following we will consider this as a problem similar to free surface
handling fo
Dr. AQ Khan Institute of Computer Science and Information Technology
rhrtdf
RHRHG 6755

Fall 2016
Advect(s,v) (1) for j =1to n21 (2) for i=1to n11 (3) x=(ix, jx) (4)
x0 =xtv(x) (5) s0(i, j)=interpolate(s,x0) (6) endfor (7) endfor (8)
return(s0)
Note that, due to the staggered grid, the lookup of v(x) above already
might require an averaging of two nei
Dr. AQ Khan Institute of Computer Science and Information Technology
rhrtdf
RHRHG 6755

Fall 2016
+H pN (i, j) (11.9)
max(i, j)=
(i, j)+max (p) 2
pN (i, j) (11.10) where N (i, j) is the set of the four direct neighbors
of cell (i, j). Note that we add a small value h to hmax to prevent
hmin to be equal to hmax in at areas. With these three
valueswecan
Dr. AQ Khan Institute of Computer Science and Information Technology
rhrtdf
RHRHG 6755

Fall 2016
[TR04] Nils Thurey and Ulrich Rude. Free Surface LatticeBoltzmann uid simulations with and without level sets. Proc. of
Vision, Modelling, and Visualization VMV, pages 199208, 2004.
88
Real Time Physics Class Notes
[TRS06] Nils Thurey, Ulrich Rude, and Ma
Dr. AQ Khan Institute of Computer Science and Information Technology
rhrtdf
RHRHG 6755

Fall 2016
Torepresentthethreeunknownswiththisgridweuseastaggered grid. This
means that the pressure is located in the center of a cell, while the
velocity components are located at the center of each edge, as shown
in Fig. 11.1. The staggered grid is commonly used
Dr. AQ Khan Institute of Computer Science and Information Technology
rhrtdf
RHRHG 6755

Fall 2016
FFF
FFF
OOO
FFF
FFF
Figure 10.3: This gure gives an overview of the stream and collide
steps for a uid cell next to an obstacle.
become instable. In Section 10.5, a method to stabilize the
computations with a turbulence model will be explained. This
allev
Dr. AQ Khan Institute of Computer Science and Information Technology
rhrtdf
RHRHG 6755

Fall 2016
Real Time Physics Class Notes
v1
v2
h
0
g
h
h
g
h
Figure 11.1: A uid volume is represented as a heighteld elevation in
normal direction n. The uid velocityvhas two components in
horizontal directions.
11.2 A basic Solver
A basic solver of the SWE has to c
Dr. AQ Khan Institute of Computer Science and Information Technology
rhrtdf
RHRHG 6755

Fall 2016
[Mon92] J.Monaghan. Smoothedparticle hydrodynamics. Annu. Rev.
Astron. Phys., 30:543574, 1992.
[MSKG05] Matthias Muller, Barbara Solenthaler, Richard Keiser,
and Markus Gross. Particlebased uiduid interaction. Proc. of the
2005
ACM
Siggraph/Eurographics
Dr. AQ Khan Institute of Computer Science and Information Technology
rhrtdf
RHRHG 6755

Fall 2016
Laws of Nature are essentially mathematical postulates that permit
us to understand natural phenomena and make predictions
concerning the time evolution or static relations between the
coordinates associated with objects in nature that are consistent
mat
Dr. AQ Khan Institute of Computer Science and Information Technology
rhrtdf
RHRHG 6755

Fall 2016
Graph. Appl., 1997. [CFL+07] Nuttapong Chentanez, Bryan E.
Feldman, Francois Labelle, James F. OBrien, and Jonathan R.
Shewchuk. Liquid simulation on latticebased tetrahedral meshes. In
SCA
07:
Proceedings
of
the
2007
ACM
SIGGRAPH/Eurographicssymposiumon
Dr. AQ Khan Institute of Computer Science and Information Technology
rhrtdf
RHRHG 6755

Fall 2016
[YUM86] Larry Yaeger, Craig Upson, and Robert Myers. Combining
physical and visual simulation and creation of the planet jupiter for
the lm 2010. In SIGGRAPH 86: Proceedings of the 13th annual
conference on Computer graphics and interactive techniques, pa
Dr. AQ Khan Institute of Computer Science and Information Technology
rhrtdf
RHRHG 6755

Fall 2016
Inthiscasehoweverthellratio is the ratio between minimal ground
level, uid surface height and maximal ground level. Note, that with
this denition cells may have negative depth values even if they are
marked as uid. There are cases were the cell center its
Dr. AQ Khan Institute of Computer Science and Information Technology
rhrtdf
RHRHG 6755

Fall 2016
Projection
ThederivationoftheSWEnowproceedsbymakinganimportantassumptio
n: thepressure is assumed to be hydrostatic, i.e.,
p=an (A.3) wherean istheaccelerationinverticaldirectionand
correspondstotheverticaldistance from the bottom of the uid to its
surfac
Dr. AQ Khan Institute of Computer Science and Information Technology
rhrtdf
RHRHG 6755

Fall 2016
because you had such a hard time with precalc or because you failed
straight up calculus when you took it.
They lied.
Sorry to be blunt, but thats the simple truth. Heres a list of a few of
the kinds of things youll have to be able to do during the next t
Dr. AQ Khan Institute of Computer Science and Information Technology
rhrtdf
RHRHG 6755

Fall 2016
negative gradient of the bottom heighteldH rather than the
normal of the horizontal projection plane. Furthermore, the
normalization of the gradient and the cosine for the area
foreshortening cancel each other out. The projection of the pressure
force due
Dr. AQ Khan Institute of Computer Science and Information Technology
rhrtdf
RHRHG 6755

Fall 2016
Here, the Smagorinsky subgrid model, as used in, e.g., [WZF+03,
LWK03], will be applied. Its primary use is to stabilize the simulation,
instead of relying on its ability to accurately model subgrid scale
vortices
in
the
simulation.
The
modelrequiresslig
Dr. AQ Khan Institute of Computer Science and Information Technology
rhrtdf
RHRHG 6755

Fall 2016
[Sma63] J. Smagorinsky. General circulation experiments with the
primitive equations. Mon. Wea. Rev., 91:99164, 1963.
[Sta99] Jos Stam. Stable Fluids. Proc. of ACM SIGGRAPH, pages
121128, 1999.
[Suc01] S. Succi. The Lattice Boltzmann Equation for Fluid
Dy
Dr. AQ Khan Institute of Computer Science and Information Technology
rhrtdf
RHRHG 6755

Fall 2016
TheSWEthentake the following form D Dt =v (A.15) Dv Dt
=anh+ 1 2 an+ 1 f. (A.16) Note that when the balance
equations were projected from three dimension to two dimensions, the
vertical force component has been dropped. This term can now be
reinserted as
Dr. AQ Khan Institute of Computer Science and Information Technology
rhrtdf
RHRHG 6755

Fall 2016
These rst assumptions reduce the NavierStokes equations to four
equations in four unknowns: three velocity components and the
pressure.
77
78
Real Time Physics Class Notes
Balance Equations The balance equations describe fundamental
physical
laws
and
are