P. 1
cfd

cfd

|Views: 2|Likes:
Published by Ronak Jain
Computataional fluid dynamics
Computataional fluid dynamics

More info:

Published by: Ronak Jain on Jun 11, 2013
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

06/11/2013

pdf

text

original

•1

Computational Fluid Dynamics
An Introduction
SimulationinComputerGraphics
UniversityofFreiburg
WS04/05
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
Thisslidesetisbasedon:
n JohnD.Anderson,Jr.,“ComputationalFluidDynamics–
TheBasicswithApplications,” McGraw-Hill,Inc.,
NewYork,ISBN0-07-001685-2
Acknowledgement
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
Motivation
D.Enright,S.Marschner,R.Fedkiw,
“AnimationandRenderingof
ComplexWaterSurfaces,”
Siggraph 2002,ACMTOG,
vol.21,pp.736-744,2002.
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n introduction
n pre-requisites
n governingequations
n continuityequation
n momentumequation
n summary
n solutiontechniques
n Lax-Wendroff
n MacCormack
n numericalaspects
n recentresearchingraphics
Outline
•2
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n physicalaspectsoffluidflowaregovernedby
threeprinciples
n massisconserved
n force=mass× acceleration(Newton’ssecondlaw)
n energyisconserved(notconsideredinthislecture)
n principlescanbedescribedwithintegralequationsor
partialdifferentialequations
n inCFD,thesegoverningequationsarereplacedby
discretized algebraicforms
n algebraicformsprovidequantitiesatdiscretepoints
intimeandspace,noclosed-formanalyticalsolution
Introduction
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
NumericalSolution- Overview
Governing
Equations
Discretization
System of
Algebraic
Equations
Equation
Solver
Approx.
Solution
Navier-Stokes
Euler
Finite
Difference
Discrete
Nodal
Values
Lax-Wendroff
MacCormack
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n x,y,z – 3Dcoordinatesystem
n t – time
n ρ ( x,y,z,t )– density
n v ( x,y,z,t )– velocity
n v ( x,y,z,t )=(u ( x,y,z,t ),v ( x,y,z,t ),w ( x,y,z,t ))
T
Continuous Quantities
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
Problem
v (x,y,z,t )
ρ (x,y,z,t )
v (x,y,z,t+∆t )
ρ (x,y,z,t+∆t )
•3
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n introduction
n pre-requisites
n governingequations
n continuityequation
n momentumequation
n summary
n solutiontechniques
n Lax-Wendroff
n MacCormack
n numericalaspects
n recentresearchingraphics
Outline
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n infinitesimallysmallfluidelementmovingwiththeflow
n ( x
1
,y
1
,z
1
)– positionattimet
1
n ( x
2
,y
2
,z
2
)– positionattimet
2
n v
1
(x
1
,y
1
,z
1
,t
1
)=(u (x
1
,y
1
,z
1
,t
1
),v (x
1
,y
1
,z
1
,t
1
),w (x
1
,y
1
,z
1
,t
1
))
T
n v
2
(x
2
,y
2
,z
2
,t
2
)=(u (x
2
,y
2
,z
2
,t
2
),v (x
2
,y
2
,z
2
,t
2
),w (x
2
,y
2
,z
2
,t
2
))
T
n ρ
1
( x
1
,y
1
,z
1
,t
1
)
n ρ
2
( x
2
,y
2
,z
2
,t
2
)
Substantial Derivative of ρ
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n Taylorseriesatpoint1

t
2
→t
1
Substantial Derivative of ρ
( ) ( ) ( ) ( )
1 2
1
1 2
1
1 2
1
1 2
1
1 2
t t
t
z z
z
y y
y
x x
x

,
_

¸
¸


+ −
,
_

¸
¸


+ −

,
_

¸
¸


+ −
,
_

¸
¸


+ ·
ρ ρ ρ ρ
ρ ρ
1 1 2
1 2
1 1 2
1 2
1 1 2
1 2
1 1 2
1 2

,
_

¸
¸


+

,
_

¸
¸


+

,
_

¸
¸


+

,
_

¸
¸


·


t t t
z z
z t t
y y
y t t
x x
x t t
ρ ρ ρ ρ ρ ρ
1 1 1 1 1 2
1 2

,
_

¸
¸


+
,
_

¸
¸


+

,
_

¸
¸


+
,
_

¸
¸


·


t
w
z
v
y
u
x t t
ρ ρ ρ ρ ρ ρ
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n substantialderivativeofρ
n substantialderivative=localderivative+convectivederivative
n localderivative– timerateofchangeatafixedlocation
n convectivederivative– timerateofchangeduetofluidflow
n subst.derivative=totalderivativewithrespecttotime
Substantial Derivative
t z
w
y
v
x
u
Dt
D


+


+


+



ρ ρ ρ ρ ρ
T
z y x t Dt
D

,
_

¸
¸






· ∇ ∇ ⋅ +


≡ , , ) ( v
•4
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n divergenceofvelocityv =timerateofchangeofthe
volumeδVofamovingfluidelementperunitvolume
Divergence of v
( )
Dt
V D
V z
w
y
v
x
u δ
δ
1
·


+


+


· ⋅ ∇ v
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n introduction
n pre-requisites
n governingequations
n continuityequation
n momentumequation
n summary
n solutiontechniques
n Lax-Wendroff
n MacCormack
n numericalaspects
n recentresearchingraphics
Outline
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n massisconserved
n infinitesimallysmallfluidelementmovingwiththeflow
n fixedmassδm,variablevolumeδV, variabledensityρ
n timerateofchangeofthemassofthemovingfluid
elementiszero

Continuity Equation
V m δ ρ δ ⋅ ·
( )
0 · + ·

·
Dt
V D
Dt
D
V
Dt
V D
Dt
m D δ
ρ
ρ
δ
δ ρ δ
0
1
· +
Dt
V D
V Dt
D δ
δ
ρ
ρ
0 · ⋅ ∇ + v ρ
ρ
Dt
D
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
Continuity Equation
0 · ⋅ ∇ + v ρ
ρ
Dt
D
divergenceofvelocity-
timerateofchangeofvolume
ofamovingfluidelementper
volume
substantialderivative–
timerateofchangeof
densityofamoving
fluidelement
•5
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n non-conservationform(considersmovingelement)
n manipulation
n conservationform(considerselementatfixedlocation)
Continuity Equation
0 · ⋅ ∇ + v ρ
ρ
Dt
D
( ) v v v v ρ
ρ
ρ ρ
ρ
ρ
ρ
⋅ ∇ +


· ⋅ ∇ + ∇ ⋅ +


· ⋅ ∇ +
t t Dt
D
( ) 0 · ⋅ ∇ +


v ρ
ρ
t
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n motivationforconservationform
n infinitesimallysmallelementatafixedlocation
n massfluxthroughelement
n differenceofmassinflowandoutflow=netmassflow
n netmassflow=timerateofmassincrease
Continuity Equation
( ) 0 · ⋅ ∇ +


v ρ
ρ
t
netmassflow
pervolume
timerateofmass
increasepervolume
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n introduction
n pre-requisites
n governingequations
n continuityequation
n momentumequation
n summary
n solutiontechniques
n Lax-Wendroff
n MacCormack
n numericalaspects
n recentresearchingraphics
Outline
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n consideramovingfluidelement
n physicalprinciple:F =m⋅a (Newton’ssecondlaw)
n twosourcesofforces
n bodyforces
n gravity
n surfaceforces
n basedonpressuredistributiononthesurface
n basedonshearandnormalstressdistributiononthesurface
duetodeformationofthefluidelement
normal
stress
Momentum Equation
pressure fluid
element
gravity
shear
stress
friction
velocity
velocity
•6
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n f =bodyforceperunitmass
n gravity:f=δm⋅g /δm=g
→ bodyforceonfluidelement
ρ f (dx dy dz )
Body Force
dx
dz
dy
fluid
element
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n considerthex component
n pressureforce
actsorthogonal
tosurfaceinto
thefluidelement
n netpressureforceinx direction
Pressure Force
dx
dy
dz
pdy dz (p+∂p/∂xdx ) dy dz
dz dy dx
x
p
dz dy dx
x
p
p p


− ·
1
]
1

¸

,
_

¸
¸


+ −
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n normalstress– relatedtothetimerateofchangeofvolume
n shearstress– relatedtothetimerateofchange
oftheshearingdeformation
n τ
jk
– stressink directionappliedtoasurfaceperpendicular
tothej axis
n τ
xx
– normalstressinx direction
n τ
zx

yx
– shearstressesinxdirections
Stress
τ
xx
x
y
τ
yx
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n normalstressisrelatedtopressureorthogonaltosurface
n shearstressisrelatedtofrictionparalleltosurface
n frictionandpressurearerelatedtothevelocitygradient
n friction(shearstress)modelsviscosity(viscousflow)
n incontrasttoinviscid flow,wherefrictionisnotconsidered
Stress
normal
stress
pressure shear
stress
friction
velocity
velocity
•7
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory

yx
+∂ τ
yx
/∂ydy) dx dz
Surface Forces in x
dx
dy
dz
pdy dz (p+∂p/∂xdx ) dy dz
τ
xx
dy dz (τ
xx
+∂ τ
xx
/∂xdx) dy dz
τ
yx
dx dz
τ
zx
notillustrated
dz dy dx
x
dz dy dx
x
p
p p F
xx
xx
xx x 1
]
1

¸


,
_

¸
¸


+ +
1
]
1

¸

,
_

¸
¸


+ − · τ
τ
τ
dz dy dz
z
dz dx dy
y
zx
zx
zx yx
yx
yx 1
]
1

¸


,
_

¸
¸


+ +
1
]
1

¸

,
_

¸
¸


+ + τ
τ
τ τ
τ
τ
dz dy dx
z y x x
p
F
zx yx xx
x

,
_

¸
¸


+


+


+


− ·
τ τ τ
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
Momentum Equation in x
dz dy dx f dz dy dx
z y x x
p
Dt
Du
dz dy dx
x
zx yx xx
ρ
τ
τ
τ
ρ +

,
_

¸
¸


+


+


+


− ·
x x
F a m ·
mass acceleration
timerateofchange
ofvelocityofa
movingfluidelement
surfaceforce
pressure
normalstress
shearstress
bodyforce
gravity
x
zx yx xx
f
z y x x
p
Dt
Du
ρ
τ
τ
τ
ρ +


+


+


+


− ·
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n viscousflow,non-conversationform
n Navier-Stokesequations
Momentum Equation
x
zx yx xx
f
z y x x
p
Dt
Du
ρ
τ τ τ
ρ +


+


+


+


− ·
y
zy yy xy
f
z y x y
p
Dt
Dv
ρ
τ τ τ
ρ +


+


+


+


− ·
z
zz yz xz
f
z y x z
p
Dt
Dw
ρ
τ τ τ
ρ +


+


+


+


− ·
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n obtainingtheconservationformofNavier-Stokes
Momentum Equation in x
u
t
u
Dt
Du
∇ ⋅ +


· v ρ ρ ρ
( )
t
u
t
u
t
u


+


·

∂ ρ
ρ
ρ ( )
t
u
t
u
t
u





·

∂ ρ ρ
ρ
( ) ( ) ( ) u u u ∇ + ⋅ ∇ · ⋅ ∇ v v v ρ ρ ρ ( ) ( ) ( ) v v v ρ ρ ρ ⋅ ∇ − ⋅ ∇ · ∇ u u u
( )
( ) ( ) v v u
t
u
t
u
Dt
Du
ρ ρ
ρ ρ
ρ ⋅ ∇ +
1
]
1

¸

⋅ ∇ +





·
continuityequation
( )
( ) v u
t
u
Dt
Du
ρ
ρ
ρ ⋅ ∇ +


·
•8
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n Navier-Stokesequationsinconservationform
Momentum Equation
( )
( )
x
zx yx xx
f
z y x x
p
u
t
u
ρ
τ τ τ
ρ
ρ
+


+


+


+


− · ⋅ ∇ +


v
( )
( )
y
zy yy xy
f
z y x y
p
v
t
v
ρ
τ τ τ
ρ
ρ
+


+


+


+


− · ⋅ ∇ +


v
( )
( )
z
zz yz xz
f
z y x z
p
w
t
w
ρ
τ τ τ
ρ
ρ
+


+


+


+


− · ⋅ ∇ +


v
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n Newton:shearstressinafluidisproportional
tovelocitygradients
n mostfluidscanbeassumedtobenewtonian,
butbloodisapopularnon-newtonian fluid
n Stokes:
n µ isthemolecularviscositycoefficient
n λ isthesecondviscositycoefficientwithλ =-2/3⋅ µ
Newtonian Fluids
( )
x
u
xx


+ ⋅ ∇ · µ λ τ 2 v ( )
y
v
yy


+ ⋅ ∇ · µ λ τ 2 v ( )
z
w
zz


+ ⋅ ∇ · µ λ τ 2 v
1
]
1

¸



+


· ·
y
u
x
v
yx xy
µ τ τ
1
]
1

¸



+


· ·
x
w
z
u
zx xz
µ τ τ
1
]
1

¸



+


· ·
z
v
y
w
zy yz
µ τ τ
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n intermolecularforcesarenegligible
n R – specificgasconstant
n T – temperature
n termal equationofstate
Perfect Gas
T R p ρ ·
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n now,
p canbeexpressedusingdensityand
τ canbeexpressedusingvelocitygradients,
f
x
isuser-defined(e.g.gravity)
Momentum Equation in x
( )
( )
x
zx yx xx
f
z y x x
p
u
t
u
ρ
τ τ τ
ρ
ρ
+


+


+


+


− · ⋅ ∇ +


v
•9
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n introduction
n pre-requisites
n governingequations
n continuityequation
n momentumequation
n summary
n solutiontechniques
n Lax-Wendroff
n MacCormack
n numericalaspects
n recentresearchingraphics
Outline
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n thus,fourequationsandfourunknownsρ,u,v,w
Governing Equations –
Viscous Compressible Flow
( )
( )
x
zx yx xx
f
z y x x
p
u
t
u
ρ
τ τ τ
ρ
ρ
+


+


+


+


− · ⋅ ∇ +


v
( )
( )
y
zy yy xy
f
z y x y
p
v
t
v
ρ
τ τ τ
ρ
ρ
+


+


+


+


− · ⋅ ∇ +


v
( )
( )
z
zz yz xz
f
z y x z
p
w
t
w
ρ
τ τ τ
ρ
ρ
+


+


+


+


− · ⋅ ∇ +


v
( ) 0 · ⋅ ∇ +


v ρ
ρ
t
continuityequation
m
o
m
e
n
t
u
m

e
q
u
a
t
i
o
n
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n Eulerequations
Governing Equations –
Inviscid Compressible Flow
( )
( )
x
f
x
p
u
t
u
ρ ρ
ρ
+


− · ⋅ ∇ +


v
( )
( )
y
f
y
p
v
t
v
ρ ρ
ρ
+


− · ⋅ ∇ +


v
( )
( )
z
f
z
p
w
t
w
ρ ρ
ρ
+


− · ⋅ ∇ +


v
( ) 0 · ⋅ ∇ +


v ρ
ρ
t
continuityequation
m
o
m
e
n
t
u
m

e
q
u
a
t
i
o
n
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n coupledsystemofnonlinearpartialdifferentialequations
n normalandshearstresstermsarefunctionsofthe
velocitygradients
n pressureisafunctionofthedensity
n onlymomentumequationsareNavier-Stokesequations,
howeverthenameiscommonlyusedforthefullset
ofgoverningequations(plusenergyequation)
Comments
on the Governing Equations
•10
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n canbeobtaineddirectly fromacontrolvolumefixedin
space
n considerflux ofmass,momentum(andenergy)intoand
outofthevolume
n haveadivergencetermwhichinvolvestheflux of
mass(ρv),momentuminx,y,z(ρuv,ρvv,ρwv)
n canbeexpressedinagenericform
Governing Equations in
Conservation Form
J
H G F U
·


+


+


+


z y x t
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n viscousflow
n inviscid flow
Generic Form

,
_

¸
¸
·
w
v
u
ρ
ρ
ρ
ρ
U

,
_

¸
¸


− +
·
xz
xy
xx
u w
u v
p u u
u
τ ρ
τ ρ
τ ρ
ρ
F

,
_

¸
¸

− +

·
yz
yy
yx
t v w ?
t p v v ?
t v u ?
v ?
G

,
_

¸
¸
·
z
y
x
f ?
f ?
f ?
0
J

,
_

¸
¸
− +
− +

·
zz
zy
zx
t p w w ?
t p w v ?
t w u ?
w ?
H

,
_

¸
¸
·
w
v
u
ρ
ρ
ρ
ρ
U

,
_

¸
¸
+
·
u w
u v
p u u
u
ρ
ρ
ρ
ρ
F

,
_

¸
¸
+
·
v w ?
p v v ?
v u ?
v ?
G

,
_

¸
¸
·
z
y
x
f ?
f ?
f ?
0
J

,
_

¸
¸
+
+
·
p w w ?
p w v ?
w u ?
w ?
H
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n U – solutionvector(tobesolvedfor)
n F,G,H – fluxvectors
n J – sourcevector(externalforces,energychanges)
n dependentflowfieldvariablescanbesolvedprogressively
instepsoftime(time-marching )
n spatialderivativesareknowfromprevioustimesteps
n numberscanbeobtainedfordensityρ andfluxvariables
ρu,ρv,ρw
Generic Form
z y x t ∂

+


+


− ·

∂ H G F
J
U
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n inmanyreal-worldproblems,discontinuouschangesin
theflow-fieldvariablesρ,v occur(shocks,shockwaves)
n problem:differentialformofthegoverningequations
assumesdifferentiable(continuous)flowproperties
n simple1-Dshockwave:ρ
1
u
1

2
u
2
n conservationformsolvesforρu,seesnodiscontinuity
n positiveeffectonnumericalaccuracyandstability
Motivation for Different Forms
of the Governing Equations
x
ρ
x
u
x
ρu
•11
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n introduction
n pre-requisites
n governingequations
n continuityequation
n momentumequation
n summary
n solutiontechniques
n Lax-Wendroff
n MacCormack
n numericalaspects
n recentresearchingraphics
Outline
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n flow-fieldvariablesρ,u,v,w areknownateachdiscrete
spatialposition(x,y,z )attimet
n Lax-Wendroff computesallinformationattimet+∆t
n second-orderaccuracyinspaceandtime
n explicit,finite-differencemethod
n particularlysuitedtomarchingsolutions
n marchingsuitedtohyperbolic,parabolicPDEs
n unsteady(time-dependent),compressibleflow
isgovernedbyhyperbolicPDEs
Lax-Wendroff Technique
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n 2D,inviscid flow,nobodyforce,innon-conservationform
Lax-Wendroff
Example

,
_

¸
¸


+


+


+


− ·


y
v
y
v
x
u
x
u
t
ρ
ρ
ρ
ρ
ρ

,
_

¸
¸


+


+


− ·


x
T R
y
u
v
x
u
u
t
u ρ
ρ

,
_

¸
¸


+


+


− ·


y
T R
y
v
v
x
v
u
t
v ρ
ρ
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n ρ
t
i,j
– densityatposition(i, j )andtimet
n ρ
t
i,j
,u
t
i,j
,v
t
i,j
areknown
Taylor Series Expansions
( )
...
2
2
,
2
2
,
, ,
+

,
_

¸
¸


+ ∆
,
_

¸
¸


+ ·
∆ +
t
t
t
t
t
j i
t
j i
t
j i
t t
j i
ρ ρ
ρ ρ
( )
...
2
2
,
2
2
,
, ,
+

,
_

¸
¸


+ ∆
,
_

¸
¸


+ ·
∆ +
t
t
u
t
t
u
u u
t
j i
t
j i
t
j i
t t
j i
( )
...
2
2
,
2
2
,
, ,
+

,
_

¸
¸


+ ∆
,
_

¸
¸


+ ·
∆ +
t
t
v
t
t
v
v v
t
j i
t
j i
t
j i
t t
j i
•12
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n ∂ρ/∂t canbereplacedbyspatialderivatives
giveninthegoverningequations
n usingsecond-ordercentraldifferences
Taylor Expansion - Density
( )
...
2
2
,
2
2
,
, ,
+

,
_

¸
¸


+ ∆
,
_

¸
¸


+ ·
∆ +
t
t
t
t
t
j i
t
j i
t
j i
t t
j i
ρ ρ
ρ ρ

,
_

¸
¸


+


+


+


− ·


y
v
y
v
x
u
x
u
t
ρ
ρ
ρ
ρ
ρ

,
_

¸
¸


+


+


+


− ·
,
_

¸
¸

∂ − + − + − + − +
y
v
y
v v
x
u
x
u u
t
t
j i
t
j i t
j i
t
j i
t
j i t
j i
t
j i
t
j i t
j i
t
j i
t
j i t
j i
t
j i
2 2 2 2
, 1 , 1
,
, 1 , 1
,
, 1 , 1
,
, 1 , 1
,
,
ρ ρ
ρ
ρ ρ
ρ
ρ
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n ∂
2
ρ/∂t
2
canbeobtainedbydifferentiatingthegoverning
equationwithrespecttotime
n mixedsecondderivativescanbeobtainedbydifferentiating
thegoverningequationswithrespecttoaspatialvariable,
e.g.
n bracketsmissingonpp.219,220inAnderson’sbook!
Taylor Expansion - Density

,
_

¸
¸




+
∂ ∂

+




+
∂ ∂

+




+
∂ ∂

+




+
∂ ∂

− ·


t
v
y t y
v
t y
v
t y
v
t
u
x t x
u
t x
u
t x
u
t
ρ ρ ρ
ρ
ρ ρ ρ
ρ
ρ
2 2 2 2
2
2

,
_

¸
¸


+
,
_

¸
¸







+
∂ ∂

+
,
_

¸
¸


+


− ·
∂ ∂

2
2 2
2
2 2
2
2 2
x
T R
x
T R
x
v
y
u
y x
u
v
x
u
x
u
u
t x
u ρ
ρ
ρ
ρ
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n → ∂
2
ρ/∂t
2
canbecomputedusingcentraldifferencesfor
spatialderivatives
n higher-ordertermsarerequired,e.g.
n ... u,v arecomputedinthesameway
Taylor Expansion - Density
( )
2
, 1 , , 1
,
2
2
2
x
u u u
x
u
t
j i
t
j i
t
j i
t
j i

+ −
·

,
_

¸
¸


− +
y x
u u u u
y x
u
t
j i
t
j i
t
j i
t
j i
t
j i
∆ ∆
− − +
·

,
_

¸
¸
∂ ∂
∂ − + + − − − + +
4
1 , 1 1 , 1 1 , 1 1 , 1
,
2
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n introduction
n pre-requisites
n governingequations
n continuityequation
n momentumequation
n summary
n solutiontechniques
n Lax-Wendroff
n MacCormack
n numericalaspects
n recentresearchingraphics
Outline
•13
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n samecharacteristicslikeLax-Wendroff
n second-orderaccuracyinspaceandtime
n requiresonlyfirsttimederivative
n predictor– corrector
n illustratedfordensity
MacCormack Technique
t
t
av
j i
t
j i
t t
j i

,
_

¸
¸


+ ·
∆ +
,
, ,
ρ
ρ ρ
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n predictorstepfordensity
n u,v arepredictedthesameway
MacCormack Technique

,
_

¸
¸


+


+


+


− ·
,
_

¸
¸

∂ − + − + − + − +
y
v
y
v v
x
u
x
u u
t
t
j i
t
j i t
j i
t
j i
t
j i t
j i
t
j i
t
j i t
j i
t
j i
t
j i t
j i
t
j i
2 2 2 2
, 1 , 1
,
, 1 , 1
,
, 1 , 1
,
, 1 , 1
,
,
ρ ρ
ρ
ρ ρ
ρ
ρ
t
t
t
j i
t
j i
t t
j i

,
_

¸
¸


+ ·
∆ +
,
, ,
ρ
ρ ρ
t
t
u
u u
t
j i
t
j i
t t
j i

,
_

¸
¸


+ ·
∆ +
,
, ,
t
t
v
v v
t
j i
t
j i
t t
j i

,
_

¸
¸


+ ·
∆ +
,
, ,
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n correctorstepfordensity
n correspondstoHeun schemeforODEs
n otherhigher-orderschemes,e.g.Runge-Kutta 2or4,
couldbeusedaswell
MacCormack Technique

,
_

¸
¸


+


+


+


− ·

,
_

¸
¸


∆ +

∆ +
+ ∆ +
∆ +

∆ +
+ ∆ +
∆ +

∆ +
+ ∆ +
∆ +

∆ +
+ ∆ +
∆ +
y
v
y
v v
x
u
x
u u
t
t t
j i
t t
j i t t
j i
t t
j i
t t
j i t t
j i
t t
j i
t t
j i t t
j i
t t
j i
t t
j i t t
j i
t t
j i
2 2 2 2
, 1 , 1
,
, 1 , 1
,
, 1 , 1
,
, 1 , 1
,
,
ρ ρ
ρ
ρ ρ
ρ
ρ
t
t t
t
t
t t
j i
t
j i
t
j i
av
j i
t
j i
t t
j i

1
1
]
1

¸

,
_

¸
¸


+
,
_

¸
¸


+ · ∆
,
_

¸
¸


+ ·
∆ +
∆ +
, ,
,
,
, ,
2
1 ρ ρ
ρ
ρ
ρ ρ
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n Lax-Wendroff andMacCormack canbeusedfor
unsteadyflow
n non-conservationform
n conservationform
n viscousflow
n inviscid flow
n higher-orderaccuracyrequiredtoavoidnumerical
dissipation,artificialviscosity,numericaldispersion
n note,thatviscosityisrepresentedbysecondpartial
derivativesinthegoverningequations
Comments
•14
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n introduction
n pre-requisites
n governingequations
n continuityequation
n momentumequation
n summary
n solutiontechniques
n Lax-Wendroff
n MacCormack
n numericalaspects
n recentresearchingraphics
Outline
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n truncationerrorcausesdissipationanddispersion
n numericaldissipationiscausedbyeven-orderterms
ofthetruncationerror
n numericaldispersioniscausedbyodd-orderterms
n leadingterminthetruncationerrordominatesthe
behavior
Numerical Effects
x
u
x
u
x
u
originalfunction dissipation dispersion
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n artificialviscositycompromisestheaccuracy,but
improvesthestabilityofthesolution
n addingartificialviscosityincreasestheprobabilityof
makingthesolutionlessaccurate,butimproves
thestability
n similartoiterativesolutionschemesforimplicitintegration
schemes,whereasmallernumberofiterationsintroduces
“artificialviscosity”,butimprovesthestability
Numerical Effects
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
n governingequationsforcompressibleflow
n continuityequation,momentumequation
n Navier-Stokes(viscousflow)andEuler(inviscid flow)
n discussionofconservationandnon-conservationform
n explicittime-marchingtechniques
n Lax-Wendroff
n MacCormack
n numericalaspects
n recentresearchingraphics
Summary
•15
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
Recent Research
M.Carlson,P.J.Mucha,G.Turk,“RigidFluid:Animatingthe
InterplayBetweenRigidBodiesandFluid,” Siggraph 2004.
UniversityofFreiburg- InstituteofComputerScience- ComputerGraphicsLaboratory
Recent Research
T.G.Goktekin,A.W.Bargteil,J.F.O’Brien,
“AMethodforAnimatingViscoelastic Fluids,” Siggraph 2004.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->