54 views

Uploaded by neurolepsia3790

CFD advection diffusion equations

- A CFD Investigation Into the Transient Aerodynamic Forces on Overtaking Road Vehicle Models
- 267156
- 232
- FSI of WT Airfoils
- Engine Intake Port Optimization in Sculptor
- Five Key Questions to Answer Before Outsourcing CFD Services
- Numerical Method for Wave Equation
- Cfd Mod Eel Ling _smoke
- BCS-054-JUN 2015
- tmp9F52
- Flapping Wing Flight
- 08_PRM_C9_A1
- 1-s2.0-S0167610508001001-main
- Tutorial Shell and Tube Heat Exchanger CFD Simulation With ANSYS CFX
- FM_2e_SM__Chap15.pdf
- b801033751e98d8a84967b6b5d7d51d857d9.pdf
- CCS simulation
- CFD Simulation of Mono Disperse Droplet Generation by Means of Jet Break-up
- 4385477.pdf
- ecf workshop

You are on page 1of 8

http://www.nd.edu/~gtryggva/CFD-Course/!

Warm-up:!

One-Dimensional

Conservation

Equation!

Objectives:!

differential equation using finite difference methods. !

!

Discuss basic time integration methods, ordinary and

partial differential equations, finite difference

approximations, accuracy. !

!

Show the implementation of numerical algorithms into

actual computer codes.!

Grtar Tryggvason!

Spring 2013!

Outline!

! !Finite difference approximations!

! !The linear advection-diffusion equation!

! !Matlab code!

! !Accuracy and error quantification!

! !Stability!

! !Consistency!

! !Multidimensional problems!

! !Steady state!

Model Equations!

f

f

2 f

+U

=D 2

t

x

x

Model Equations!

For initial conditions of the form:!

f (x, t = 0) = Asin(2kx)

It can be verified by direct substitution that the solution

is given by:!

2

Although this equation is much simpler than the full

Navier Stokes equations, it has both an advection term

and a diffusion term. !

Before attempting to solve the equation, it is useful to

understand how the analytical solution behaves.!

which is a decaying

traveling wave!

Conservation equations!

Conservation equations!

principles: In the absence of explicit sources or sinks, f

is neither created nor destroyed.!

!

Consider a simple one dimensional pipe of uniform

diameter with a given velocity !

f (t)

we assume that f is conserved. Thus, for any section

of the pipe:!

Amount of f

in a control

volume

after a

given time

interval t!

U (x)

x

Given f at the inlet as a function of time (as well as

everywhere at time zero), how do we predict the f(t,x)? !

Amount of f in

the control

volume at the

beginning of

the time

interval t!

Amount of

f that

flows into

the control

volume

during t!

Amount of

f that flows

out of the

control

volume

during t!

U (x)

f (t)

Conservation equations!

How much does the total amount of f in

the Control Volume change during a short

time t? Restating the conservation law

from the last slide, we have!

Conservation equations!

We can also state the conservation principle

in differential form. From last slide!

Approximate:!

fTotal =

f dx f av x

()

f av t + t f av t x = t Fin Fout

Conservation equations!

()

f av t + t f av t x = t Fin Fout

Divide by tx!

!

()

f av t + t f av t

= Fout Fin

t

x

or:!

f av

F

=

t

x

Taking the

limit, we get:!

f F

+

=0

t x

F: Flux of f!

conservation equation is:!

f F

+

=0

t x

Taking the flux to be the sum of advective and

diffusive fluxes:!

F = Uf F

f

x

f

f

2 f

+U

=D 2

t

x

x

Finite Difference

Approximations of

the Derivatives!

Finite Difference Approximations!

Finite Difference Approximations!

equation, replacing a relation between the derivatives by

a relation between the discrete nodal values.

f (t + 2t)

t

t

The!

Time Derivative!

f (t + t)

f(t,x-h) f(t,x) f(t,x+h) !

h

f (t)

Finite Difference Approximations!

Finite Difference Approximations!

Time derivative!

The Time Derivative is found using a FORWARD

EULER method. The approximation can be found by

using a Taylor series

f(t+t,x)

t

f(t,x)!

h

Finite Difference Approximations!

The Spatial!

First Derivative!

f (t + t) = f (t) +

f (t)

2 f (t) t 2

t +

+

t

t 2 2

=

+

t

t

t 2 2

Finite Difference Approximations!

the values of f are stored at discrete points.!

f(x-h) f(x) f(x+h) !

h

using a Taylor series!

Finite Difference Approximations!

Start by expressing the value of f(x+h) and f(x-h) in terms of f(x)

f (x)

2 f (x) h 2 3 f (x) h 3 4 f (x) h 4

f (x + h) = f (x) +

h+

+

+

+

x

x 2 2

x 3 6

x 4 24

f (x h) = f (x)

f (x)

2 f (x) h 2 3 f (x) h 3 4 f (x) h 4

h+

x

x 2 2

x 3 6

x 4 24

f (x + h) f (x h) = 2

f (x)

3 f (x) h 3

h+2

+

x

x 3 6

Finite Difference Approximations!

The result is:!

f (x + h) f (x h) = 2

f (x)

3 f (x) h 3

h+2

+

x

x 3 6

f (x) f (x + h) f (x h) 3 f (x) h 2

=

+

x

2h

x 3 6

Finite Difference Approximations!

Finite Difference Approximations!

Start by expressing the value of f(x+h) and f(x-h) in terms of f(x)

The Spatial!

Second Derivative!

f (x + h) = f (x) +

f (x)

2 f (x) h 2 3 f (x) h 3 4 f (x) h 4

h+

+

+

+

x

x 2 2

x 3 6

x 4 24

f (x h) = f (x)

f (x)

2 f (x) h 2 3 f (x) h 3 4 f (x) h 4

h+

x

x 2 2

x 3 6

x 4 24

f (x + h) + f (x h) = 2 f (x) + 2

Finite Difference Approximations!

f 2 (x) h 2

4 f (x) h 4

+2

+

2

x

2

x 4 24

Finite Difference Approximations!

f (x + h) + f (x h) = 2 f (x) + 2

f 2 (x) h 2

4 f (x) h 4

+2

+

2

x

2

x 4 24

=

+

x 2

h2

x 4 12

differential equation!

Finite Difference Approximations!

Finite Difference Approximations!

A numerical approximation to!

For space and time we will use:!

f

f

2 f

+U

=D 2

t

x

x

f j = f (t, x j )

f jn+1

f jn+1

approximations!

f jn+1

= f (t + t, x j )

f jn1

= f (t, x j + h)

f jn f jn+1

h

f jn1 = f (t, x j h)

n

n

2 f

f

f

+U

= D 2

t j

x j

x j

f jn+1

f jn1

f jn f jn+1

h

Finite Difference Approximations!

Finite Difference Approximations!

Substituting these approximations into:!

notation!

gives!

f fj

f

= j

+ O(t)

t j

t

n

f jn = f (t, x j )

f jn+1 = f (t + t, x j )

n+1

f

f

2 f

+U

=D 2

t

x

x

gives!

f f j 1

f

= j +1

+ O(h2 )

x j

2h

n

f jn+1 = f (t, x j + h)

f jn1 = f (t, x j h)

f jn+1 fjn

f jn+1 fjn1

fjn+1 2 f jn + f jn1

+U

=D

+ O(t, h 2 )

t

2h

h2

2 f

f jn+1 2 f jn + f jn1

2

=

+ O(h )

2

x j

h2

Solving for the new value and dropping the error terms yields!

fj

Finite Difference Approximations!

n+1

= fj

n

Ut n

Dt n

n

n

n

( f f j 1) + 2 ( f j +1 2 f j + f j 1)

2h j +1

h

next time level is given by:!

f jn+1 = f jn

Ut n

Dt

( f j +1 f jn1) + 2 ( f jn+1 2 f jn + f jn1)

2h

h

explicitly in terms of the values at the level n!

f jn+1

f jn1

f jn f jn+1

h

Example!

The evolution of a sine wave is followed as it

is advected and diffused. Two waves of the

infinite wave train are simulated in a domain of

length 2. To model the infinite train, periodic

boundary conditions are used. Compare the

numerical results with the exact solution.!

EX2!

% one-dimensional advection-diffusion by the FTCS scheme!

n=21; nstep=100; length=2.0; h=length/(n-1); dt=0.05; D=0.05;!

f=zeros(n,1); y=zeros(n,1); ex=zeros(n,1); time=0.0;!

for i=1:n, f(i)=0.5*sin(2*pi*h*(i-1)); end;

% initial conditions!

for m=1:nstep, m, time!

for i=1:n, ex(i)=exp(-4*pi*pi*D*time)*...!

0.5*sin(2*pi*(h*(i-1)-time)); end;

% exact solution !

hold off; plot(f,'linewidt',2); axis([1 n -2.0, 2.0]); % plot solution!

hold on; plot(ex,'r','linewidt',2);pause;

% plot exact solution!

y=f;

% store the solution!

for i=2:n-1,!

f(i)=y(i)-0.5*(dt/h)*(y(i+1)-y(i-1))+...!

! D*(dt/h^2)*(y(i+1)-2*y(i)+y(i-1)); % advect by centered differences!

end;!

f(n)=y(n)-0.5*(dt/h)*(y(2)-y(n-1))+...!

! D*(dt/h^2)*(y(2)-2*y(n)+y(n-1));

% do endpoints for!

f(1)=f(n);

% periodic boundaries!

time=time+dt;!

end;!

Evolution

for!

U=1;

D=0.05;

k=1

N=21

t=0.05

Accuracy!

Movie: adv1!

Exact!

Numerical!

qualitatively similar to the analytical solution, there

are significant quantitative differences.!

!

The derivation of the numerical approximations for

the derivatives showed that the error depends on

the size of h and t. !

!

First we test for different t. !

!

Number of time steps= T/t

Accuracy!

Evolution

for!

U=1;

D=0.05;

k=1

N=21

t=0.05

m=11; time=0.50!

2

1.5

1

0.5

0

-0.5

Exact!

-1

-1.5

Numerical!

-2

10

12

14

16

18

20

Accuracy!

Accuracy!

m=21; time=0.50!

Repeat with

a smaller

time-step!

t=0.025

N=21

m=41; time=0.50!

Repeat with

a smaller

time-step!

t=0.0125

N=21

1.5

1.5

0.5

0.5

-0.5

-0.5

-1

Exact!

-1

Exact!

-1.5

Numerical!

-2

-1.5

Numerical!

2

10

12

14

16

18

20

we obtain?!

!

Take !

t = 0.0005 !

and !

N=200!

-2

10

12

14

16

18

20

Accuracy!

Very fine spatial

resolution and a

small time step!

m=1001; time=0.50!

2

U=1;

D=0.05;

k=1

N=200

t=0.0005

1.5

1

0.5

0

-0.5

-1

Exact!

-1.5

Numerical!

Order of Accuracy!

-2

20

40

60

80

100

120

140

Accuracy!

very small time step, t = 0.0005 and vary

the number of grid points, N, used to

resolve the spatial direction. !

!

The grid size is h = L/N where L = 1 for our

case!

160

180

200

Accuracy!

Exact!

time=0.50!

Numerical!

E=h

( f

j =1

N=11; E = 0.1633!

N =21; E = 0.0403!

N =41; E = 0.0096!

N =61; E = 0.0041!

N =81; E = 0.0022!

N =101; E = 0.0015!

N =121; E = 0.0011!

N =161; E = 9.2600e-04!

fexact )2

Accuracy!

Accuracy. Effect of!

spatial resolution!

dt=0.0005!

N=11 to N=161!

time=0.50!

100

10-1

-2

E

10

10-3

10-4 0

10

10

10

10

1/ h

Accuracy!

Accuracy!

time=0.50!

2

1

E = Ch 2 = C

h

spatial resolution!

10-1

-2

E

10

1 2

1

ln E = ln C = lnC 2ln

h

h

should therefore have a slope -2!

Accuracy!

Why is does the error deviate from the line for the

highest values of N?!

Error!

Truncation!

Total!

Roundoff!

Number of Steps, N = 1/h!

100

2!

1!

10-3

dt=0.0005!

!

N=11 to N=161!

10-4 0

10

10

1/ h

Summary!

expansion!

!

Approximating a partial differential

equation!

!

Showed, by numerical experiments, that

accuracy increases as the resolution is

increased!

!

Showed that the error behaves in a way

that should be predictable!

- A CFD Investigation Into the Transient Aerodynamic Forces on Overtaking Road Vehicle ModelsUploaded byMuhayyuddin Rajpoot
- 267156Uploaded byhenreng
- 232Uploaded byalexmechdesigner
- FSI of WT AirfoilsUploaded byIva Hrgovan
- Engine Intake Port Optimization in SculptorUploaded bygosculptor
- Five Key Questions to Answer Before Outsourcing CFD ServicesUploaded bySunny Marks
- Numerical Method for Wave EquationUploaded byRAJA
- Cfd Mod Eel Ling _smokeUploaded byadrian3452
- BCS-054-JUN 2015Uploaded bySebastian
- tmp9F52Uploaded byFrontiers
- Flapping Wing FlightUploaded byqyilmazoglu
- 08_PRM_C9_A1Uploaded byAngel Canales Alvarez
- 1-s2.0-S0167610508001001-mainUploaded byGaurav Goel
- Tutorial Shell and Tube Heat Exchanger CFD Simulation With ANSYS CFXUploaded byJesús Ramirez
- FM_2e_SM__Chap15.pdfUploaded byMariCarmen
- b801033751e98d8a84967b6b5d7d51d857d9.pdfUploaded byStajic Milan
- CCS simulationUploaded byDela Quarme
- CFD Simulation of Mono Disperse Droplet Generation by Means of Jet Break-upUploaded byZeSnex
- 4385477.pdfUploaded byWilly Vieira
- ecf workshopUploaded byapi-457792987
- Inverse SimulationUploaded byRaghavendra Prasad
- 124376_FULLTEXT01.pdfUploaded byAbderraouf
- 1-s2.0-S0307904X05001198-mainUploaded byprashanthreddy26
- 1-s2.0-S0360544218321881-mainUploaded byAbdul Ahad
- CAE ReportUploaded byHaziq Mansor
- Lecture 1Uploaded bySolutions132
- Akin Cfd 2014Uploaded bysousou
- 11.Inverse.fulllUploaded byTJPRC Publications
- Math ProblemsUploaded byAnonymous AooYJE
- COMPIT 14 ProceedingsUploaded byMaciej Reichel

- Spt Natco Shv Combustor BrochureUploaded byneurolepsia3790
- NKN_WhitepaperUploaded byneurolepsia3790
- Lecture 12Uploaded byArpit Dodia
- ADVISE_Deliverable_D4.7 Validation Guide Without AppendicesUploaded byneurolepsia3790
- INDUSTRIAL MICRODIFFUSION DUAL-FUEL BURNERSUploaded byneurolepsia3790
- Sample Colle Tion-cow DungUploaded byTeeOne92
- Finite Element Analysis of Shell StructuresUploaded bySuryaKaundinyaOruganti
- ASME Guide for Verification and Validation of Mechnics SOftwareUploaded byGifford Machon
- m5l34 Calculation of Calorific Value of Fuels (1)Uploaded byN.s. Suresh
- Hickory Ridge Landfill Biogas FlareUploaded byneurolepsia3790
- ~ accepted ~ fe ~ practices ~ nafems ~ india ~Uploaded bytt3340
- Tkt Glossary DocumentUploaded byLamaC
- CFX Combust Radiation 16.0 L01 IntroUploaded byneurolepsia3790
- Pompa Subm, FLYGTPompa Subm, FLYGT- Menajera- MenajeraUploaded byRoby Sz
- Jens Thesis Biogas EconomicsUploaded byneurolepsia3790
- Fmea to Wwt PlantUploaded byneurolepsia3790
- EagleBurgmann_H75VN_EN.pdfUploaded byneurolepsia3790
- Lec. 06 Fuel-Air Cycle ResultsUploaded byneurolepsia3790
- Ch6_ Flare Gas Control_1992Uploaded byneurolepsia3790
- VIS10 Vibration Sensor Flygt Pumps W85Uploaded byneurolepsia3790
- Bombas hidráulicasUploaded byArnaldo Benitez
- Split Case Pumps Technical Brochure - XylemUploaded byneurolepsia3790
- Federal Bylaw 12 Air Pollution 2006 English TranslationUploaded byneurolepsia3790
- Thermodynamics of CombustionUploaded byjMora89
- Burner HandbookUploaded byDk Damo
- Flare Hydro Proc May 2004Uploaded byRob Gillespie
- Condensed Flare DatasheetUploaded byAditya Nur
- Qip Ice 08 Fuel Air CyclesUploaded byGaurav Dahiya

- Kenwood Kdc-mp5029, w5031, w5031y, w531yUploaded bypolydeukes
- ReportUploaded byapi-3825452
- Mikroc Pic Pro Manual v100 2Uploaded byanhossain
- SHARPLES Nozlejector Type Centrifuges - General BrochureUploaded byOscar Alvitez Dominguez
- e10945Uploaded bythana_silks
- 45083455 PHY1Projectile MotionUploaded byArian Afrasiabi
- Adobe DreamAdobe Dreamweaver & Dreamweaver Developer Toolbox Tutorialweaver & Dreamweaver Developer Toolbox TutorialUploaded byHilman Abdu Idris
- INF3705 Assignment 2Uploaded bytmogamisi
- Manual for Ministries _Finance Managers.pdfUploaded byMuhammad Atif Qaisrani
- Screw Jack 3Uploaded byAsad Hafudh
- R-REC-M.1036-5-201510-I!!PDF-EUploaded bySeung Joon Lee
- 7000_brochure_paste slaker.pdfUploaded byalexituu
- Lecture Guide Chp 3Uploaded byCesar Montenegro
- Seiwa Explorer3 User Manual englishUploaded byNomofnamor
- 6421A_11: Configuring and Managing Distributed File SystemUploaded by健康生活園Healthy Life Garden
- Introduction to Computers (Question Bank)Uploaded bySumitembhare
- Node Manager Set Up in WeblogicUploaded byrosewin_johnrose
- GFMUploaded byAndy Mezeta
- health and safety management systemUploaded byKien Trung Nguyen
- Radiant Energy Aerial Capture (REAC)Uploaded byAnonymous Kti5jq5EJI
- BellareRivest-translucentUploaded byΟλυμπίδης Ιωάννης
- 13 Transit Pedestrians-1Uploaded byNorman Oder
- SEP 11 Best PracticesUploaded byreanve
- DiSi Flash memoryUploaded byFERNS
- CCST9016_Uploaded byulrich788
- Phy 1 (8)Uploaded byGarlapati Srinivasa Rao
- Man Strong Srt5302Uploaded bybejan
- FEM.pdfUploaded byJaved
- Open Fires Chimneys and FluesUploaded bystan80
- Lean Manufacturing in Process Industries Are WIP Inventories NecessaryUploaded byMark Jimenez Cervantes