7/21/2019 Cfd Lecture
1/32
TheUNIVERSITY of NORTH CAROLINA at CHAPEL
Intro to
Computational FluidDynamic!randon Lloyd
CO"P #$%
April &'( #))*
Image courtesy of Prof. A. Davidhazy at RIT. Used without permission.
7/21/2019 Cfd Lecture
2/32
2 TheUNIVERSITY of NORTH CAROLINA at CHAPEL
O+,r+i,-
Und,rtandin. t/, Na+i,r0Sto1,,2uation- D,ri+ation 34ollo-in. 56ri,7,l &%%89:
- Intuition
Sol+in. t/, Na+i,r0Sto1, ,2uation- !aic approac/,
- !oundary condition
Trac1in. t/, 4r,, ur4ac,
7/21/2019 Cfd Lecture
3/32
3 TheUNIVERSITY of NORTH CAROLINA at CHAPEL
Op,rator
0 .radi,nt
di+ 0 di+,r.,nc,
#0 Laplacian
; 0 Hand -a+in. < L,n.t/ymat/ compr,ion
Foundation
yu
xuuu
+== div
2
2
2
22
yu
xuu
+
=
=
yu
xuu
,
7/21/2019 Cfd Lecture
4/32
4 TheUNIVERSITY of NORTH CAROLINA at CHAPEL
Tranport T/,or,m
xdtxufftxdtxfdt
d
t t
),()div(),(
+
=
),(),( tct
txu
=),( tcx =
c
0
),( tc
t
7/21/2019 Cfd Lecture
5/32
5 TheUNIVERSITY of NORTH CAROLINA at CHAPEL
Con,r+ation o4 "a
densityis;),()0,(mass0
== t xdtxxdx
0),()div(),( = += xdtxutxdtxdtd t t
0)div( =+
u
t
Transport theorem
0div =u
Integrand vanishes
is constantfor incompressible
fluids
Continuity equation
7/21/2019 Cfd Lecture
6/32
6 TheUNIVERSITY of NORTH CAROLINA at CHAPEL
Con,r+ation o4
"om,ntum= t xdtxutx ),(),(momentum
= forcesactingmomentuminchange t xdtxftx ),(),(:forcesbody
t dsntx ),(:forcessurface
+= ttt dsntxxdtxftxxdtxutxdtd
),(),(),(),(),(
norma:tensorstress: n
7/21/2019 Cfd Lecture
7/32
! TheUNIVERSITY of NORTH CAROLINA at CHAPEL
Con,r+ation o4
"om,ntum
0divdiv)())(()( =++ guuuuudt
d
Transport theorem Divergence
theorem
fupuudt
ud ++= 2")(
omentum equation
+= ttt dsntxxdtxftxxdtxutxdtd
),(),(),(),(),(
7/21/2019 Cfd Lecture
8/32
# TheUNIVERSITY of NORTH CAROLINA at CHAPEL
Na+i,r0Sto1, E2uation
fupuudtud
u
++=
=
2")(
0
convection viscositye!terna"
forcespressure
7/21/2019 Cfd Lecture
9/32
$ TheUNIVERSITY of NORTH CAROLINA at CHAPEL
Sol+in. t/, ,2uation
!aic Approac/
&= Cr,at, a t,ntati+, +,locity
>,ld=a= Finit, di?,r,nc,7= S,mi0La.ran.ian m,t/od 3Stable Fluids
5Stam &%%%9:
#= Enur, t/at t/, +,locity >,ldi di+,r.,nc, 4r,,@a= Adut pr,ur, and updat, +,lociti,
7= Pro,ction m,t/od
7/21/2019 Cfd Lecture
10/32
"0 TheUNIVERSITY of NORTH CAROLINA at CHAPEL
T,ntati+, V,locity Fi,ld
Finit, di?,r,nc, B m,c/anicaltranlation o4 ,2uation=
n
7/21/2019 Cfd Lecture
11/32
"" TheUNIVERSITY of NORTH CAROLINA at CHAPEL
T,ntati+, V,locity Fi,ld
Limit on tim, t,p
CFL conditionsB dont mo+,
mor, t/an a in.l, c,ll in on,tim, t,p
Di?uion t,rm
ytvxtu
7/21/2019 Cfd Lecture
12/32
"2 TheUNIVERSITY of NORTH CAROLINA at CHAPEL
T,ntati+, V,locity Fi,ld
Sta7l, Fluid ",t/od
&= Add 4orc,@
#= Ad+,ction*= Di?uion
)()()(& 0" xftxuxu +=
7/21/2019 Cfd Lecture
13/32
"3 TheUNIVERSITY of NORTH CAROLINA at CHAPEL
T,ntati+, V,locity Fi,ld
Ad+,ctionFinit, di?,r,nc, i unta7l, 4or lar., t=
Solution@ trac, +,lociti, 7ac1 in tim,=6uarant,, t/at t/, +,lociti, -ill n,+,r 7lo-up=
)),((&)(& "2 txpuxu =
7/21/2019 Cfd Lecture
14/32
"4 TheUNIVERSITY of NORTH CAROLINA at CHAPEL
T,ntati+, V,locity Fi,ld
Di?uionDicr,tiin. t/, +icoity t,rm pr,ad +,locity
amon. imm,diat, n,i./7or= Unta7l, -/,n
tim, t,p too mall( .rid pacin. too lar.,( or+icoity i /i./=
Solution@ Int,ad o4 uin. an ,plicit tim, t,pu, an implicit on,=
T/i l,ad to a lar., 7ut par, lin,ar yt,m=
)(&)(&)(23
2 xuxut
=I
7/21/2019 Cfd Lecture
15/32
7/21/2019 Cfd Lecture
16/32
"6 TheUNIVERSITY of NORTH CAROLINA at CHAPEL
Eplicitly En4orcin.
uG)Sinc, -, /a+, not y,t add,d t/, pr,ur, t,rm(
-, can u, pr,ur, to ,nur, t/at t/,+,lociti, ar, di+,r.,nc, 4r,,=
u) incr,a,d pr,ur, and u7,2u,nt outu uJ) d,cr,a,d pr,ur, and u7,2u,nt inu
R,laation al.orit/m
&= Corr,ct t/, pr,ur, in a c,ll
#= Updat, +,lociti,
*= R,p,at 4or all c,ll until ,ac/ /a uJK
7/21/2019 Cfd Lecture
17/32
"! TheUNIVERSITY of NORTH CAROLINA at CHAPEL
Sol+in. 4or pr,ur,
Anot/,r approac/ in+ol+, ol+in. 4or a pr,ur,corr,ction t,rm o+,r t/, -/ol, >,ld uc/ t/att/, +,lociti, -ill 7, di+,r.,nc, 4r,, and t/,nupdat, t/, +,lociti, at t/, ,nd=
)"()()"( "& +
+
=
= nnn
pt
uu
dt
ud
)"()()"(
& ++
= nnn
p
t
uu
0& )"(2)()"( =
= ++ nnn pt
uu
Discretize in time
Rearrange terms
#atisfy continuity eq.
7/21/2019 Cfd Lecture
18/32
"# TheUNIVERSITY of NORTH CAROLINA at CHAPEL
Sol+in. 4or pr,ur,
, ,nd up -it/ t/, Poion ,2uation 4orpr,ur,=
T/i i anot/,r par, lin,ar yt,m= T/,, typ,o4 ,2uation can 7, ol+,d uin. it,rati+,m,t/od=
U, pr,ur, to updat, >nal +,lociti,=
)()"(2 & nn ut
p
= +
)"()()"( & ++ = nnn ptuu
7/21/2019 Cfd Lecture
19/32
"$ TheUNIVERSITY of NORTH CAROLINA at CHAPEL
Pro,ction ",t/od
T/, H,lm/olt0Hod., D,compoition T/,or,mtat, t/at any +,ctor >,ld can 7, d,compo,da@
-/,r, u i di+,r.,nc, 4r,, and qi a calar>,ld d,>n,d implicitly a@
, can d,>n, an op,rator P t/at pro,ct a+,ctor >,ld onto it di+,r.,nc, 4r,, part@
quw +=
2qw =
qwwu ==
7/21/2019 Cfd Lecture
20/32
20 TheUNIVERSITY of NORTH CAROLINA at CHAPEL
Pro,ction ",t/od
Applyin. P to 7ot/ id, o4 t/, mom,ntum,2uation yi,ld a in.l, ,2uation only in t,rmo4 u@
T/u 4or t/, lat t,p @
Loo1 4amiliarM T/, calar >,ld qi actuallyr,lat,d to pr,ur,
quuqu == && 2
))('(
2
fuuudt
ud
++=
)"()()"( & ++
= nnn pt
uu
)()"(2 & nn ut
p
= +
7/21/2019 Cfd Lecture
21/32
2" TheUNIVERSITY of NORTH CAROLINA at CHAPEL
T/, !ottom Lin,
All t/r,, m,t/od ar, ,2ui+al,nt
7/21/2019 Cfd Lecture
22/32
22 TheUNIVERSITY of NORTH CAROLINA at CHAPEL
!oundary Condition
No lip@ S,t +,locity to ) on t/, 7oundary=6ood 4or o7tacl,=
Fr,, lip@ S,t only t/, +,locity in t/,
dir,ction normal to t/, 7oundary to ,ro=6ood 4or ,ttin. up a plan, o4 ymm,try=
Ino-@ Sp,ci>,d poiti+, normal +,locity=6ood 4or ourc,=
Outo-@ Sp,ci>,d n,.ati+, normal
+,locity= 6ood 4or in1= P,riodic@ Copy t/, lat ro- and column o4
c,ll to >rt ro- and column= 6ood 4orimulatin. an in>nit, domain=
7/21/2019 Cfd Lecture
23/32
23 TheUNIVERSITY of NORTH CAROLINA at CHAPEL
Sta..,r,d 6rid
T/, ta..,r,d .rid pro+id,+,lociti, imm,diat,ly at c,ll7oundari,( i con+,ni,nt 4or>nit, di?,r,nc,( and a+oidocillation=
Conid,r pro7l,m o4 a #D uid atr,t -it/ no ,t,rnal 4orc,=T/, continuou olution i@
On a dicr,ti,d non0ta..,r,d.rid you can /a+,@
jip , jip ,"+jip ,"
", +jip
", jip
2
", +jiv
2", jiv
jiu
,2" jiu ,
2"+
constant00 === pvu
oddforeven,for
00
2",
,,
jiPjiPp
vu
ji
jiji
++=
==
7/21/2019 Cfd Lecture
24/32
24 TheUNIVERSITY of NORTH CAROLINA at CHAPEL
Trac1in. t/, Fr,,
Sur4ac,T/, mo+,m,nt o4 t/, 4r,, ur4ac,
i not ,plicit in t/, Na+i,r0Sto1, ,2uation=
T/r,, m,t/od 4or trac1in. t/,4r,, ur4ac,@
&= "ar1,r and c,ll 3"AC: m,t/od#= Front trac1in.
*= Particl, l,+,l ,t m,t/od
7/21/2019 Cfd Lecture
25/32
25 TheUNIVERSITY of NORTH CAROLINA at CHAPEL
"AC
Du, to 5Harlo- and ,lc/ &%'$9=
Trac1 mal, mar1,r particl, tod,t,rmin, -/,r, t/, 4r,, ur4ac, i
locat,d="ar1,r ar, tranport,d accordin. to t/,
+,locity >,ld=
C,ll -it/ mar1,r ar, uid cells= Fluid c,ll7ord,rin. ,mpty c,ll ar, surface cells=
T/,r, ar, 7oundary condition t/at mut 7,ati>,d at t/, ur4ac,=
Et,nd,d 7y 5C/,n ,t al= &%%9 to trac1particl, only n,ar t/, ur4ac,=
7/21/2019 Cfd Lecture
26/32
7/21/2019 Cfd Lecture
27/32
2! TheUNIVERSITY of NORTH CAROLINA at CHAPEL
Front Trac1in.
Propo,d 7y 5Fot,r and F,d1i- #))&9
Front trac1in. u, a com7ination o4 a l,+,l ,t andparticl, to trac1 t/, ur4ac,=
T/, particl, ar, u,d to d,>n, an implicit 4unction=
An iocontour o4 t/i 4unction r,pr,,nt t/, li2uidur4ac,=
T/, iocontour yi,ld a moot/,r ur4ac, t/anparticl, alon,=
7/21/2019 Cfd Lecture
28/32
2# TheUNIVERSITY of NORTH CAROLINA at CHAPEL
Front Trac1in.
Uin. t/, l,+,l ,t m,t/od( t/,iocontour can 7, ,+ol+,d dir,ctly o+,rtim, 7y uin. t/, uid +,lociti,=
Particl, and l,+,l ,t ,+olution /a+,compl,m,ntary tr,n.t/ and-,a1n,,
-L,+,l ,t ,+olution u?,r +olum, lo
- Particl, can cau, +iual arti4act
- L,+,l ,t ar, al-ay moot/=
- Particl, r,tain d,tail=
7/21/2019 Cfd Lecture
29/32
2$ TheUNIVERSITY of NORTH CAROLINA at CHAPEL
Front Trac1in.
Com7in, t/, t-o t,c/ni2u, 7y .i+in. particl,mor, -,i./t in ar,a o4 /i./ cur+atur,=Particl, ,capin. t/, l,+,l ,t ar, r,nd,r,ddir,ctly a pla/in. dropl,t=
http://www.cs.unc.edu/~blloyd/comp259/project/foster_liquids1.avi7/21/2019 Cfd Lecture
30/32
30 TheUNIVERSITY of NORTH CAROLINA at CHAPEL
Particl, L,+,l S,t
",t/odPr,,nt,d 7y 5Enri./t ,t
al #))#9=
Implicit ur4ac, lo,d,tail on coar, .rid=
Particl, 1,,p t/, ur4ac,4rom croin. t/,m 7utcant 1,,p it 4romdri4tin. a-ay=
Add particl, to 7ot/ id,o4 t/, implicit ur4ac,=
Ecap,d particl, indicat,t/, location o4 ,rror int/, implicit ur4ac, oit can 7, r,7uilt=
7/21/2019 Cfd Lecture
31/32
3" TheUNIVERSITY of NORTH CAROLINA at CHAPEL
Particl, L,+,l S,t
",t/odEtrapolat,d +,lociti, at t/, ur4ac,
.i+, mor, r,alitic motion=
http://www.cs.unc.edu/~blloyd/comp259/project/splash-640.avihttp://www.cs.unc.edu/~blloyd/comp259/project/glass00.avi7/21/2019 Cfd Lecture
32/32
32
R,4,r,nc,
CHEN( =( AND LO!O( N= &%%Q=Toward interactive-rate simulation of uids withmoving obstacles using the navier-stokes equations. Computer Graphics andImage Processing, 10711!.
CHEN( S=( OHNSON( D=( RAAD( P= AND FADDA( D= &%%. The surface markerand micro cell method. "nternational #ournal of $umerical %ethods in &luids,
'(, 7)*-77+.
FOSTER( N=( AND "ETAAS( D= &%%'=ealistic animation of liquids. GraphicalModels and Image Processing, )71)+.
FOSTER( N=( AND FEDI( R= #))&=ractical animation of liquids. "nProceedings of SIGGRAPH 2001, '0.
6RIE!EL( "=( DORNSEIFER( T=( AND NEUNHOEFFER( T=&%%8. NumericalSimulation in luid !"namics# A Practical Introduction. /"% %onograhs on%athematical %odeling and 2omutation. /"%
ASS( "=( AND "ILLER( 6= &%%)=aid, stable uid d3namics for comutergrahics. "n Computer Graphics $Proceedings of SIGGRAPH %0&, vol. '), )*(7.
O!RIEN( =( AND HOD6INS( = &%%$. 43namic simulation of slashing uids. "nProceedings of Computer Animation %', 1*+'0(.
STA"( = &%%%=/table uids. "n roceedings of /"556 **, 1'1-1'+.
Top Related