15
•1 Computational Fluid Dynamics An Introduction Simulation in Computer Graphics University of Freiburg WS 04/05 University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory This slide set is based on: n John D. Anderson, Jr., “Computational Fluid Dynamics – The Basics with Applications,” McGraw-Hill, Inc., New York, ISBN 0-07-001685-2 Acknowledgement University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory Motivation D. Enright, S. Marschner, R. Fedkiw, “Animation and Rendering of Complex Water Surfaces,” Siggraph 2002, ACM TOG, vol. 21, pp. 736-744, 2002. University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory n introduction n pre-requisites n governing equations n continuity equation n momentum equation n summary n solution techniques n Lax-Wendroff n MacCormack n numerical aspects n recent research in graphics Outline

Acknowledgement Computational Fluid Dynamics An Introduction · PDF fileComputational Fluid Dynamics An Introduction ... in time and space, no closed-form analytical solution ... •5

Embed Size (px)

Citation preview

Page 1: Acknowledgement Computational Fluid Dynamics An Introduction · PDF fileComputational Fluid Dynamics An Introduction ... in time and space, no closed-form analytical solution ... •5

•1

Computational Fluid Dynamics An Introduction

Simulation in Computer GraphicsUniversity of Freiburg

WS 04/05

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

This slide set is based on:

n John D. Anderson, Jr., “Computational Fluid Dynamics –The Basics with Applications,” McGraw-Hill, Inc.,New York, ISBN 0-07-001685-2

Acknowledgement

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

Motivation

D. Enright, S. Marschner, R. Fedkiw,“Animation and Rendering of Complex Water Surfaces,”Siggraph 2002, ACM TOG, vol. 21, pp. 736-744, 2002.

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n introductionn pre-requisitesn governing equations

n continuity equationn momentum equationn summary

n solution techniquesn Lax-Wendroffn MacCormackn numerical aspects

n recent research in graphics

Outline

Page 2: Acknowledgement Computational Fluid Dynamics An Introduction · PDF fileComputational Fluid Dynamics An Introduction ... in time and space, no closed-form analytical solution ... •5

•2

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n physical aspects of fluid flow are governed bythree principlesn mass is conservedn force = mass × acceleration (Newton’s second law)n energy is conserved (not considered in this lecture)

n principles can be described with integral equations orpartial differential equations

n in CFD, these governing equations are replaced by discretized algebraic forms

n algebraic forms provide quantities at discrete pointsin time and space, no closed-form analytical solution

Introduction

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

Numerical Solution - Overview

GoverningEquations Discretization

System ofAlgebraicEquations

EquationSolver

Approx.Solution

Navier-StokesEuler

Finite Difference

DiscreteNodal Values

Lax-WendroffMacCormack

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n x, y, z – 3D coordinate systemn t – time

n ρ ( x,y,z,t ) – densityn 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

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

Problem

v (x,y,z,t )ρ (x,y,z,t )

v (x,y,z,t+∆t )ρ (x,y,z,t+∆t )

Page 3: Acknowledgement Computational Fluid Dynamics An Introduction · PDF fileComputational Fluid Dynamics An Introduction ... in time and space, no closed-form analytical solution ... •5

•3

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n introductionn pre-requisitesn governing equations

n continuity equationn momentum equationn summary

n solution techniquesn Lax-Wendroffn MacCormackn numerical aspects

n recent research in graphics

Outline

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n infinitesimally small fluid element moving with the flow

n ( x1,y1,z1 ) – position at time t1n ( x2,y2,z2 ) – position at time t2

n v1(x1,y1,z1,t1) = (u (x1,y1,z1,t1 ),v (x1,y1,z1,t1 ),w (x1,y1,z1,t1 ))T

n v2(x2,y2,z2,t2) = (u (x2,y2,z2,t2 ),v (x2,y2,z2,t2 ),w (x2,y2,z2,t2 ))T

n ρ1 ( x1,y1,z1,t1 )n ρ2 ( x2,y2,z2,t2 )

Substantial Derivative of ρ

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n Taylor series at point 1

t2 → t1

Substantial Derivative of ρ

( ) ( ) ( ) ( )121

121

121

121

12 ttt

zzz

yyy

xxx

∂∂+−

∂∂+−

∂∂+−

∂∂+= ρρρρρρ

112

12

112

12

112

12

112

12

∂∂+

−−

∂∂+

−−

∂∂+

−−

∂∂=

−−

tttzz

zttyy

yttxx

xttρρρρρρ

111112

12

∂∂+

∂∂+

∂∂+

∂∂=

−−

tw

zv

yu

xttρρρρρρ

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n substantial derivative of ρ

n substantial derivative = local derivative + convective derivative

n local derivative – time rate of change at a fixed locationn convective derivative – time rate of change due to fluid flown subst. derivative = total derivative with respect to time

Substantial Derivative

tzw

yv

xu

DtD

∂∂

+∂∂

+∂∂

+∂∂

≡ρρρρρ

T

zyxtDtD

∂∂

∂∂

∂∂

=∇∇⋅+∂∂

≡ ,,)(v

Page 4: Acknowledgement Computational Fluid Dynamics An Introduction · PDF fileComputational Fluid Dynamics An Introduction ... in time and space, no closed-form analytical solution ... •5

•4

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n divergence of velocity v = time rate of change of the volume δV of a moving fluid element per unit volume

Divergence of v

( )Dt

VDVz

wyv

xu δ

δ1

=∂∂

+∂∂

+∂∂

=⋅∇ v

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n introductionn pre-requisitesn governing equations

n continuity equationn momentum equationn summary

n solution techniquesn Lax-Wendroffn MacCormackn numerical aspects

n recent research in graphics

Outline

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n mass is conservedn infinitesimally small fluid element moving with the flown fixed mass δm, variable volume δV, variable density ρ

n time rate of change of the mass of the moving fluidelement is zero

Continuity Equation

Vm δρδ ⋅=

( )0=+=

⋅=

DtVD

DtD

VDt

VDDt

mD δρ

ρδ

δρδ

01

=+Dt

VDVDt

D δδ

ρρ

0=⋅∇+ vρρ

DtD

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

Continuity Equation

0=⋅∇+ vρρ

DtD

divergence of velocity -time rate of change of volumeof a moving fluid element pervolume

substantial derivative –time rate of change ofdensity of a moving fluid element

Page 5: Acknowledgement Computational Fluid Dynamics An Introduction · PDF fileComputational Fluid Dynamics An Introduction ... in time and space, no closed-form analytical solution ... •5

•5

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n non-conservation form (considers moving element)

n manipulation

n conservation form (considers element at fixed location)

Continuity Equation

0=⋅∇+ vρρ

DtD

( )vvvv ρρ

ρρρ

ρρ

⋅∇+∂∂

=⋅∇+∇⋅+∂∂

=⋅∇+ttDt

D

( ) 0=⋅∇+∂∂

vρρt

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n motivation for conservation formn infinitesimally small element at a fixed locationn mass flux through elementn difference of mass inflow and outflow = net mass flown net mass flow = time rate of mass increase

Continuity Equation

( ) 0=⋅∇+∂∂

vρρt

net mass flowper volume

time rate of massincrease per volume

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n introductionn pre-requisitesn governing equations

n continuity equationn momentum equationn summary

n solution techniquesn Lax-Wendroffn MacCormackn numerical aspects

n recent research in graphics

Outline

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n consider a moving fluid elementn physical principle: F = m⋅a (Newton’s second law)n two sources of forces

n body forcesn gravity

n surface forcesn based on pressure distribution on the surfacen based on shear and normal stress distribution on the surface

due to deformation of the fluid element

normalstress

Momentum Equation

pressurefluidelement

gravity

shearstress

friction

velocity

velocity

Page 6: Acknowledgement Computational Fluid Dynamics An Introduction · PDF fileComputational Fluid Dynamics An Introduction ... in time and space, no closed-form analytical solution ... •5

•6

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n f = body force per unit massn gravity: f = δm⋅g / δm = g

→ body force on fluid elementρ f (dx dy dz )

Body Force

dx

dz

dyfluid element

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n consider the x componentn pressure force

acts orthogonalto surface intothe fluid element

n net pressure force in x direction

Pressure Force

dxdy

dz

p dy dz ( p + ∂p/ ∂x dx ) dy dz

dzdydxxp

dzdydxxp

pp∂∂

−=

∂∂

+−

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n normal stress – related to the time rate of change of volumen shear stress – related to the time rate of change

of the shearing deformationn τjk – stress in k direction applied to a surface perpendicular

to the j axisn τxx – normal stress in x directionn τzx , τyx – shear stresses in x directions

Stress

τxx

x

y

τyx

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n normal stress is related to pressure orthogonal to surfacen shear stress is related to friction parallel to surfacen friction and pressure are related to the velocity gradient

n friction (shear stress) models viscosity (viscous flow)n in contrast to inviscid flow, where friction is not considered

Stress

normalstress

pressure shearstress

friction

velocity

velocity

Page 7: Acknowledgement Computational Fluid Dynamics An Introduction · PDF fileComputational Fluid Dynamics An Introduction ... in time and space, no closed-form analytical solution ... •5

•7

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

(τyx + ∂ τyx / ∂y dy) dx dz

Surface Forces in x

dxdy

dzp dy dz ( p + ∂p/ ∂x dx ) dy dz

τxx dy dz (τxx + ∂ τxx / ∂x dx) dy dz

τyx dx dz τzx not illustrated

dzdydxx

dzdydxxpppF xx

xxxxx

∂∂++

∂∂+−= τττ

dzdydzz

dzdxdyy zx

zxzxyx

yxyx

∂∂++

∂++ ττττ

ττ

dzdydxzyxx

pF zxyxxx

x

∂+

∂∂

+∂

∂+

∂∂

−=τττ

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

Momentum Equation in x

dzdydxfdzdydxzyxx

pDtDu

dzdydx xzxyxxx ρτττρ +

∂+∂

∂+

∂∂+

∂∂−=

xx Fam =

mass accelerationtime rate of changeof velocity of a moving fluid element

surface forcepressurenormal stressshear stress

body forcegravity

xzxyxxx fzyxx

pDtDu

ρτττ

ρ +∂

∂+

∂+

∂∂

+∂∂

−=

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n viscous flow, non-conversation formn Navier-Stokes equations

Momentum Equation

xzxyxxx fzyxx

pDtDu

ρτττ

ρ +∂

∂+

∂∂

+∂

∂+

∂∂

−=

yzyyyxy fzyxy

pDtDv

ρτττ

ρ +∂

∂+

∂∂

+∂

∂+

∂∂

−=

zzzyzxz fzyxz

pDtDw

ρτττ

ρ +∂

∂+

∂∂

+∂

∂+

∂∂

−=

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n obtaining the conservation form of Navier-Stokes

Momentum Equation in x

utu

DtDu ∇⋅+

∂∂= vρρρ

( )t

utu

tu

∂∂+

∂∂=

∂∂ ρρρ ( )

tu

tu

tu

∂∂−

∂∂=

∂∂ ρρρ

( ) ( ) ( ) uuu ∇+⋅∇=⋅∇ vvv ρρρ ( ) ( ) ( )vvv ρρρ ⋅∇−⋅∇=∇ uuu

( ) ( ) ( )vv ut

utu

DtDu ρρρρρ ⋅∇+

⋅∇+

∂∂−

∂∂=

continuity equation

( ) ( )vutu

DtDu ρρρ ⋅∇+

∂∂=

Page 8: Acknowledgement Computational Fluid Dynamics An Introduction · PDF fileComputational Fluid Dynamics An Introduction ... in time and space, no closed-form analytical solution ... •5

•8

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n Navier-Stokes equations in conservation form

Momentum Equation

( ) ( ) xzxyxxx fzyxx

pu

tu

ρτττ

ρρ

+∂

∂+

∂∂

+∂

∂+

∂∂

−=⋅∇+∂

∂v

( ) ( ) yzyyyxy fzyxy

pv

tv

ρτττ

ρρ

+∂

∂+

∂∂

+∂

∂+

∂∂

−=⋅∇+∂

∂v

( ) ( ) zzzyzxz fzyxz

pw

tw

ρτττ

ρρ

+∂

∂+

∂∂

+∂

∂+

∂∂

−=⋅∇+∂

∂v

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n Newton: shear stress in a fluid is proportional to velocity gradients

n most fluids can be assumed to be newtonian, but blood is a popular non-newtonian fluid

n Stokes:

n µ is the molecular viscosity coefficientn λ is the second viscosity coefficient with λ = -2/3 ⋅ µ

Newtonian Fluids

( )xu

xx ∂∂

+⋅∇= µλτ 2v ( )yv

yy ∂∂

+⋅∇= µλτ 2v ( )zw

zz ∂∂

+⋅∇= µλτ 2v

∂∂

+∂∂

==yu

xv

yxxy µττ

∂∂

+∂∂

==xw

zu

zxxz µττ

∂∂

+∂∂

==zv

yw

zyyz µττ

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n intermolecular forces are negligiblen R – specific gas constantn T – temperaturen termal equation of state

Perfect Gas

TRp ρ=

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n now, p can be expressed using density andτ can be expressed using velocity gradients,fx is user-defined (e. g. gravity)

Momentum Equation in x

( ) ( ) xzxyxxx fzyxx

pu

tu

ρτττ

ρρ

+∂

∂+

∂∂

+∂

∂+

∂∂

−=⋅∇+∂

∂v

Page 9: Acknowledgement Computational Fluid Dynamics An Introduction · PDF fileComputational Fluid Dynamics An Introduction ... in time and space, no closed-form analytical solution ... •5

•9

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n introductionn pre-requisitesn governing equations

n continuity equationn momentum equationn summary

n solution techniquesn Lax-Wendroffn MacCormackn numerical aspects

n recent research in graphics

Outline

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n thus, four equations and four unknowns ρ, u, v, w

Governing Equations –Viscous Compressible Flow

( ) ( ) xzxyxxx fzyxx

pu

tu

ρτττ

ρρ

+∂

∂+

∂∂

+∂

∂+

∂∂

−=⋅∇+∂

∂v

( ) ( ) yzyyyxy fzyxy

pv

tv

ρτττ

ρρ

+∂

∂+

∂+

∂+

∂∂

−=⋅∇+∂

∂v

( ) ( ) zzzyzxz fzyxz

pw

tw

ρτττ

ρρ

+∂

∂+

∂∂

+∂

∂+

∂∂

−=⋅∇+∂

∂v

( ) 0=⋅∇+∂∂

vρρt

continuity equation

mom

entu

m e

quat

ion

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n Euler equations

Governing Equations –Inviscid Compressible Flow

( ) ( ) xfxp

utu

ρρρ

+∂∂

−=⋅∇+∂

∂v

( ) ( ) yfyp

vtv

ρρρ

+∂∂

−=⋅∇+∂

∂v

( ) ( ) zfzp

wtw

ρρρ

+∂∂

−=⋅∇+∂

∂v

( ) 0=⋅∇+∂∂

vρρt

continuity equation

mom

entu

m e

quat

ion

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n coupled system of nonlinear partial differential equationsn normal and shear stress terms are functions of the

velocity gradientsn pressure is a function of the densityn only momentum equations are Navier-Stokes equations,

however the name is commonly used for the full setof governing equations (plus energy equation)

Comments on the Governing Equations

Page 10: Acknowledgement Computational Fluid Dynamics An Introduction · PDF fileComputational Fluid Dynamics An Introduction ... in time and space, no closed-form analytical solution ... •5

•10

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n can be obtained directly from a control volume fixed in space

n consider flux of mass, momentum (and energy) into andout of the volume

n have a divergence term which involves the flux of mass (ρv), momentum in x, y, z (ρu v, ρv v, ρw v)

n can be expressed in a generic form

Governing Equations inConservation Form

JHGFU

=∂∂

+∂∂

+∂∂

+∂∂

zyxt

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n viscous flow

n inviscid flow

Generic Form

=

wvu

ρρρρ

U

−−

−+=

xz

xy

xx

uwuv

puuu

τρτρ

τρρ

F

−−+

−=

yz

yy

yx

tvw?tpvv?

tvu?v?

G

=

z

y

x

f?f?f?

0

J

−+−+

−=

zz

zy

zx

tpww?tpwv?

twu?w?

H

=

wvu

ρρρρ

U

+

=

uwuv

puuu

ρρ

ρρ

F

+=

vw?pvv?

vu?v?

G

=

z

y

x

f?f?f?

0

J

++

=

pww?pwv?

wu?w?

H

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n U – solution vector (to be solved for)n F, G, H – flux vectorsn J – source vector (external forces, energy changes)

n dependent flow field variables can be solved progressively in steps of time (time-marching )

n spatial derivatives are know from previous time stepsn numbers can be obtained for density ρ and flux variables

ρu, ρv, ρw

Generic Form

zyxt ∂∂

+∂∂

+∂∂

−=∂∂ HGF

JU

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n in many real-world problems, discontinuous changes inthe flow-field variables ρ, v occur (shocks, shock waves)

n problem: differential form of the governing equations assumes differentiable (continuous) flow properties

n simple 1-D shock wave: ρ1 u1 = ρ2 u2

n conservation form solves for ρu, sees no discontinuityn positive effect on numerical accuracy and stability

Motivation for Different Formsof the Governing Equations

x

ρ

x

u

x

ρu

Page 11: Acknowledgement Computational Fluid Dynamics An Introduction · PDF fileComputational Fluid Dynamics An Introduction ... in time and space, no closed-form analytical solution ... •5

•11

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n introductionn pre-requisitesn governing equations

n continuity equationn momentum equationn summary

n solution techniquesn Lax-Wendroffn MacCormackn numerical aspects

n recent research in graphics

Outline

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n flow-field variables ρ, u, v, w are known at each discrete spatial position ( x, y, z ) at time t

n Lax-Wendroff computes all information at time t +∆tn second-order accuracy in space and time

n explicit, finite-difference methodn particularly suited to marching solutionsn marching suited to hyperbolic, parabolic PDEsn unsteady (time-dependent), compressible flow

is governed by hyperbolic PDEs

Lax-Wendroff Technique

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n 2D, inviscid flow, no body force, in non-conservation form

Lax-WendroffExample

∂∂

+∂∂

+∂∂

+∂∂

−=∂∂

yv

yv

xu

xu

ρρ

ρρ

∂∂

+∂∂

+∂∂

−=∂∂

xTR

yu

vxu

utu ρ

ρ

∂∂

+∂∂

+∂∂

−=∂∂

yTR

yv

vxv

utv ρ

ρ

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n ρti,j – density at position (i, j ) and time t

n ρti,j , u ti,j , v ti,j are known

Taylor Series Expansions

( )...

2

2

,2

2

,,, +∆

∂∂+∆

∂∂+=∆+ t

tt

t

t

ji

t

ji

tji

ttji

ρρρρ

( )...

2

2

,2

2

,,, +∆

∂∂+∆

∂∂+=∆+ t

tu

ttu

uut

ji

t

ji

tji

ttji

( )...

2

2

,2

2

,,, +∆

∂∂+∆

∂∂+=∆+ t

tv

ttv

vvt

ji

t

ji

tji

ttji

Page 12: Acknowledgement Computational Fluid Dynamics An Introduction · PDF fileComputational Fluid Dynamics An Introduction ... in time and space, no closed-form analytical solution ... •5

•12

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n ∂ρ/∂t can be replaced by spatial derivativesgiven in the governing equations

n using second-order central differences

Taylor Expansion - Density

( )...

2

2

,2

2

,,, +∆

∂∂+∆

∂∂+=∆+ t

tt

t

t

ji

t

ji

tji

ttji

ρρρρ

∂∂

+∂∂

+∂∂

+∂∂

−=∂∂

yv

yv

xu

xu

ρρ

ρρ

−+

−+

−+

−−=

∂∂ −+−+−+−+

yv

y

vv

xu

x

uu

t

tji

tjit

ji

tji

tjit

ji

tji

tjit

ji

tji

tjit

ji

t

ji 2222,1,1

,,1,1

,,1,1

,,1,1

,,

ρρρ

ρρρρ

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n ∂2ρ/∂t 2 can be obtained by differentiating the governingequation with respect to time

n mixed second derivatives can be obtained by differentiating the governing equations with respect to a spatial variable, e. g.

n brackets missing on pp. 219, 220 in Anderson’s book!

Taylor Expansion - Density

∂∂

∂∂+

∂∂∂+

∂∂

∂∂+

∂∂∂+

∂∂

∂∂+

∂∂∂+

∂∂

∂∂+

∂∂∂−=

∂∂

tv

ytyv

tyv

tyv

tu

xtxu

txu

txu

tρρρρρρρρρ 2222

2

2

∂∂

+

∂∂

−∂∂

∂∂

+∂∂

∂+

∂∂

+∂∂

−=∂∂

∂2

22

2

22

2

22

xTR

xTR

xv

yu

yxu

vxu

xu

utx

u ρρ

ρρ

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n → ∂2ρ/∂t 2 can be computed using central differences for spatial derivatives

n higher-order terms are required, e. g.

n ... u, v are computed in the same way

Taylor Expansion - Density

( )2,1,,1

,2

2 2

x

uuu

xu t

jit

jit

ji

t

ji ∆

+−=

∂∂ −+

yx

uuuu

yxu t

jit

jit

jit

jit

ji ∆∆

−−+=

∂∂

∂ −++−−−++

41,11,11,11,1

,

2

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n introductionn pre-requisitesn governing equations

n continuity equationn momentum equationn summary

n solution techniquesn Lax-Wendroffn MacCormackn numerical aspects

n recent research in graphics

Outline

Page 13: Acknowledgement Computational Fluid Dynamics An Introduction · PDF fileComputational Fluid Dynamics An Introduction ... in time and space, no closed-form analytical solution ... •5

•13

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n same characteristics like Lax-Wendroffn second-order accuracy in space and timen requires only first time derivativen predictor – correctorn illustrated for density

MacCormack Technique

tt

av

ji

tji

ttji ∆

∂∂

+=∆+

,,,

ρρρ

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n predictor step for density

n u, v are predicted the same way

MacCormack Technique

−+

−+

−+

−−=

∂∂ −+−+−+−+

yv

y

vv

xu

x

uu

t

tji

tjit

ji

tji

tjit

ji

tji

tjit

ji

tji

tjit

ji

t

ji 2222,1,1

,,1,1

,,1,1

,,1,1

,,

ρρρ

ρρρρ

tt

t

ji

tji

ttji ∆

∂∂+=∆+

,,,

ρρρ

ttuuu

t

ji

tji

ttji ∆

∂∂+=∆+

,,, t

tvvv

t

ji

tji

ttji ∆

∂∂+=∆+

,,,

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n corrector step for density

n corresponds to Heun scheme for ODEsn other higher-order schemes, e. g. Runge-Kutta 2 or 4,

could be used as well

MacCormack Technique

−+

−+

−+

−−=

∂∂ ∆+

−∆+

+∆+∆+

−∆+

+∆+∆+

−∆+

+∆+∆+

−∆+

+∆+

∆+

yv

y

vv

xu

x

uu

t

ttji

ttjitt

ji

ttji

ttjitt

ji

ttji

ttjitt

ji

ttji

ttjitt

ji

tt

ji2222

,1,1,

,1,1,

,1,1,

,1,1,

,

ρρρ

ρρρ

ρ

ttt

tt

tt

ji

t

ji

tji

av

ji

tji

ttji ∆

∂∂

+

∂∂

+=∆

∂∂

+=∆+

∆+

,,,

,,, 2

1 ρρρ

ρρρ

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n Lax-Wendroff and MacCormack can be used forunsteady flow n non-conservation formn conservation formn viscous flown inviscid flow

n higher-order accuracy required to avoid numerical dissipation, artificial viscosity, numerical dispersion

n note, that viscosity is represented by second partialderivatives in the governing equations

Comments

Page 14: Acknowledgement Computational Fluid Dynamics An Introduction · PDF fileComputational Fluid Dynamics An Introduction ... in time and space, no closed-form analytical solution ... •5

•14

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n introductionn pre-requisitesn governing equations

n continuity equationn momentum equationn summary

n solution techniquesn Lax-Wendroffn MacCormackn numerical aspects

n recent research in graphics

Outline

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n truncation error causes dissipation and dispersionn numerical dissipation is caused by even-order terms

of the truncation errorn numerical dispersion is caused by odd-order termsn leading term in the truncation error dominates the

behavior

Numerical Effects

x

u

x

u

x

u

original function dissipation dispersion

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n artificial viscosity compromises the accuracy, butimproves the stability of the solution

n adding artificial viscosity increases the probability ofmaking the solution less accurate, but improvesthe stability

n similar to iterative solution schemes for implicit integration schemes, where a smaller number of iterations introduces “artificial viscosity”, but improves the stability

Numerical Effects

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

n governing equations for compressible flown continuity equation, momentum equationn Navier-Stokes (viscous flow) and Euler (inviscid flow)n discussion of conservation and non-conservation form

n explicit time-marching techniquesn Lax-Wendroffn MacCormackn numerical aspects

n recent research in graphics

Summary

Page 15: Acknowledgement Computational Fluid Dynamics An Introduction · PDF fileComputational Fluid Dynamics An Introduction ... in time and space, no closed-form analytical solution ... •5

•15

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

Recent Research

M. Carlson, P. J. Mucha, G. Turk, “Rigid Fluid: Animating the Interplay Between Rigid Bodies and Fluid,” Siggraph 2004.

University of Freiburg - Institute of Computer Science - Computer Graphics Laboratory

Recent Research

T. G. Goktekin, A. W. Bargteil, J. F. O’Brien, “A Method for Animating Viscoelastic Fluids,” Siggraph 2004.