5.2 Finite-Volume Method · HC Chen 2/19/2020 Chapter 5B: Finite-Volume Method 2 Green’s Theorem...

24
HC Chen 2/19/2020 Chapter 5B: Finite-Volume Method 1 5.2 Finite-Volume Method Closely related to Subdomain Method But without explicit introduction of trial or interpolation function Approximate the flux terms directly (rather than the function itself) Use the integral form of PDEs (instead of weighted residuals) “Numerical Heat Transfer and Fluid Flows,” S.V. Patankar, McGraw-Hill, 1980. Navier-Stokes Equations 2D Compressible N-S equations General Form i j j i ij y yy x xy t y xy x xx t y x t x u x u 2 1 0 p vv uv v 0 uv p uu u 0 v u ; ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( yy xy xy xx p vv G , uv F , v q : momentum y uv G , p uu F , u q : momentum x v G , u F , q : continuity 0 y G x F t q

Transcript of 5.2 Finite-Volume Method · HC Chen 2/19/2020 Chapter 5B: Finite-Volume Method 2 Green’s Theorem...

Page 1: 5.2 Finite-Volume Method · HC Chen 2/19/2020 Chapter 5B: Finite-Volume Method 2 Green’s Theorem 3D: Volume integral  Surface integral 2D: Surface integral

HC Chen 2/19/2020

Chapter 5B: Finite-Volume Method 1

5.2 Finite-Volume Method

Closely related to Subdomain MethodBut without explicit introduction of trial or

interpolation functionApproximate the flux terms directly (rather than

the function itself)Use the integral form of PDEs (instead of

weighted residuals)

“Numerical Heat Transfer and Fluid Flows,” S.V. Patankar, McGraw-Hill, 1980.

Navier-Stokes Equations 2D Compressible N-S equations

General Form

i

j

j

iij

yyyxxyt

yxyxxxt

yxt

x

u

x

u

2

1

0pvvuvv

0uvpuuu

0vu

;

)()()(

)()()(

)()(

yyxy

xyxx

pvvG ,uvF ,vq:momentumy

uvG ,puuF ,uq:momentumx

vG ,uF ,q :continuity

0y

G

x

F

t

q

Page 2: 5.2 Finite-Volume Method · HC Chen 2/19/2020 Chapter 5B: Finite-Volume Method 2 Green’s Theorem 3D: Volume integral  Surface integral 2D: Surface integral

HC Chen 2/19/2020

Chapter 5B: Finite-Volume Method 2

Green’s Theorem

3D: Volume integral <==> Surface integral

2D: Surface integral <==> Line integral

) ,( ,:

) ,( ,:

) ,( , :

)(et

yyxy

xyxx

pvvuvHvqmomentumy

uvpuuHuqmomentumx

vuHqcontinuity

y

G

x

FHF, GHl

CV CS

dSnHdH

Page 3: 5.2 Finite-Volume Method · HC Chen 2/19/2020 Chapter 5B: Finite-Volume Method 2 Green’s Theorem 3D: Volume integral  Surface integral 2D: Surface integral

HC Chen 2/19/2020

Chapter 5B: Finite-Volume Method 3

Triangular elements

5-sided or 6-sided control volumes

5.2.1 First Derivatives

vG ,uF ,cq:ibleincompress

vG ,uF ,q:lecompressib0

y

G

x

F

t

q

NW

W

SW

P

N

NE

E

SES

AB

C

D e

n

s

w

Page 4: 5.2 Finite-Volume Method · HC Chen 2/19/2020 Chapter 5B: Finite-Volume Method 2 Green’s Theorem 3D: Volume integral  Surface integral 2D: Surface integral

HC Chen 2/19/2020

Chapter 5B: Finite-Volume Method 4

First Derivatives

Evaluate surface integrals for arbitrary control surfaces

CS

CV

dSnH

dH

First Derivatives

AB

C

Dn

n

n

n

A

B

n

dxdy

n

dx

dy

dy

dx

n

n

dx

dy

Page 5: 5.2 Finite-Volume Method · HC Chen 2/19/2020 Chapter 5B: Finite-Volume Method 2 Green’s Theorem 3D: Volume integral  Surface integral 2D: Surface integral

HC Chen 2/19/2020

Chapter 5B: Finite-Volume Method 5

First Derivatives

dxdy

ds

dx

ds

dy

dS dx dy( , )

nds dy dx( , )

dS n n dS 0

H ndS F G dy dx Fdy Gdx( , ) ( , )

Finite-Volume Method

0xGyFxGyF

xGyFxGyFqAdt

d

0xGyFxGyF

xGyFxGyFqAdt

d

xGyFqAdt

d0dSnHqd

dt

d

DAwDAwCDnCDn

BCeBCeABsABsPP

DACD

BCABPP

DA

ABPP

CV CS

)()(

)()()(

)()(

)()()(

)()(

0yyyy

0xxxx

yyyxxx

yyyxxx

yyyxxx

yyyxxx

DACDBCAB

DACDBCAB

DADADADA

CDCDCDCD

BCBCBCBC

ABABABAB

;

;

;

;

Page 6: 5.2 Finite-Volume Method · HC Chen 2/19/2020 Chapter 5B: Finite-Volume Method 2 Green’s Theorem 3D: Volume integral  Surface integral 2D: Surface integral

HC Chen 2/19/2020

Chapter 5B: Finite-Volume Method 6

Linear Interpolation

)(

)(

)(

)(

)(

)(

)(

)(

PWwDA

PNnCD

PEeBC

PSsAB

PWwDA

PNnCD

PEeBC

PSsAB

GG2

1GG

GG2

1GG

GG2

1GG

GG2

1GG

FF2

1FF

FF2

1FF

FF2

1FF

FF2

1FF

0xGyF2

1xGyF

2

1

xGyF2

1xGyF

2

1

dt

dqA

DAWDAWCDNCDN

BCEBCEABSABSP

P

)()(

)()(

Uniform Cartesian Grids

0y2

GG

x2

FF

dt

dq

0GG2

xFF

2

yyx

dt

dq

SNWEP

SNWEP

)()()(

yy0x

0yxx

yy0x

0yxx

DADA

CDCD

BCBC

ABAB

;

;

;

;

ueuw

vn

vs

0y

GG

x

FF

dt

dq snweP

or

A B

CD

Page 7: 5.2 Finite-Volume Method · HC Chen 2/19/2020 Chapter 5B: Finite-Volume Method 2 Green’s Theorem 3D: Volume integral  Surface integral 2D: Surface integral

HC Chen 2/19/2020

Chapter 5B: Finite-Volume Method 7

General Curvilinear Coordinates

For curvilinear grids, FVM provides a discretization in Cartesian coordinates without explicit (boundary-fitted) coordinate transformation

Grid curvature terms are ignoredAlternatively, one may apply FVM in transformed plane

5.2.2. Second DerivativesConvective Transport Equations

x y x y xx yyu v u v S( ) ( ) ( )

: ; / Re,

: ; / Re,

: ; / Re,

: ; ,

: ;

u x t

v y t

t

x momentum u 1 S p u

y momentum v 1 S p v

vorticity 1 S

stream function u v 0 S

temperature T 1

/

: ; /

Pe

concentraction C 1 Pe

Page 8: 5.2 Finite-Volume Method · HC Chen 2/19/2020 Chapter 5B: Finite-Volume Method 2 Green’s Theorem 3D: Volume integral  Surface integral 2D: Surface integral

HC Chen 2/19/2020

Chapter 5B: Finite-Volume Method 8

Convective Transport Equations

x y x y xx yyu v u v S( ) ( ) ( )

x

y

F u F Glet S 0

G v x y

F GS dxdy 0

x y( )

P P s AB s AB e BC e BC

n CD n CD w DA w DA

A S F y G x F y G x

F y G x F y G x 0

( ) ( ) ( )

( ) ( )

Line integral for element centered at P: ABCDA

Second Derivativess x s x s s

s y s y s s

F u u

G v v

( ) ( ) ( )

( ) ( ) ( )

NW

W

SW

P

N

NE

E

SES

A

B

C

D e

n

s

w

AB

Line integral for element centered at s

AewBA

Page 9: 5.2 Finite-Volume Method · HC Chen 2/19/2020 Chapter 5B: Finite-Volume Method 2 Green’s Theorem 3D: Volume integral  Surface integral 2D: Surface integral

HC Chen 2/19/2020

Chapter 5B: Finite-Volume Method 9

Second Derivatives -- First derivatives centered at s -- came from second derivatives centered at PUse Green’s theorem again for elements centered

at s, e, n, and w (not centered at P )

x s y s( ) , ( )

x y x

CV CS

x y y

CV CS

H F G 0 H F G

Hd H ndS Fdy Gdx dy

H F G 0 H F G

Hd H ndS Fdy Gdx dx

( , ) ( , )

( )

( , ) ( , )

( )

x s x S A B B B e P ew A wAs s s

y s y S A B B B e P ew A wAs s s

1 1 1 dxdy dy y y y y

A A A

1 1 1 dxdy dx x x x x

A A A

( ) ( )

( ) ( )

NW

W

SW

P

N

NE

E

SES

A

B

C

D e

n

s

w

AB

Line integral for element centered at s

AewBA

Page 10: 5.2 Finite-Volume Method · HC Chen 2/19/2020 Chapter 5B: Finite-Volume Method 2 Green’s Theorem 3D: Volume integral  Surface integral 2D: Surface integral

HC Chen 2/19/2020

Chapter 5B: Finite-Volume Method 10

Bilinear InterpolationIgnore grid expansion or contraction

Bilinear interpolation

wASPeB

wASPeB

weABBA

weABBA

yyy

xxx

yyy

xxx

A S P W SW B S P E SE

1 1

4 4( ); ( )

2 2x s AB y s AB AB AB S P

s

AB SP AB SP E W SE SW

AB S P AB E W SE SW

1y x x y

A

1 y y x x

41

Q P4

( ) ( ) ( )( )

( )( )

( ) ( )

Flux Evaluation

s AB s AB AB S P AB E W SE SW

P S AB P S AB

AB S AB S AB S

F y G x Q P4

1 1 u u y v v x

2 21

Q u y v x 2

( ) ( )

( ) ( ) ( ) ( )

( )

AB P AB P AB P

AB E W SE SW

1 Q u y v x

2

P4

( )

( )

Diffusive and convective fluxes

Page 11: 5.2 Finite-Volume Method · HC Chen 2/19/2020 Chapter 5B: Finite-Volume Method 2 Green’s Theorem 3D: Volume integral  Surface integral 2D: Surface integral

HC Chen 2/19/2020

Chapter 5B: Finite-Volume Method 11

Convective Transport Equation

NW

W

SW

P

N

NE

E

SES

e

n

s

w

A’B’

Line integral for elements centered at s, e, n, wfour overlapped surface (line) integrals

Convective Transport Equations

P E E W W N N S S NE NE NW NW SE SE SW SW P P

S AB DA BC S AB S AB SE AB BC

E BC AB CD E BC E BC NE BC CD

N

C C C C C C C C C S

1 1C Q P P u y v x ; C P P

D 4 2 4 D

1 1C Q P P u y v x C P P

D 4 2 4D

1C

D

( )

( ) ( ) ( )

( ) ( ) ; ( )

CD BC DA N CD N CD NW CD DA

W DA CD AB W DA W DA SW DA AB

PP we sn sn we

1Q P P u y v x C P P

4 2 4D

1 1C Q P P u y v x C P P

D 4 2 4D

A 1C x y x y

D D

( ) ( ) ; ( )

( ) ( ) ; ( )

( )

Page 12: 5.2 Finite-Volume Method · HC Chen 2/19/2020 Chapter 5B: Finite-Volume Method 2 Green’s Theorem 3D: Volume integral  Surface integral 2D: Surface integral

HC Chen 2/19/2020

Chapter 5B: Finite-Volume Method 12

Convective Transport Equations

wWPDAWPDADAw2DA

2DADA

nNPCDNPCDCDn2CD

2CDCD

eEPBCEPBCBCe2BC

2BCBC

sSPABSPABABs2AB

2ABAB

AyyxxP AyxQ

AyyxxP AyxQ

AyyxxP AyxQ

AyyxxP AyxQ

/)(;/)(

/)(;/)(

/)(;/)(

/)(;/)(

)(

)

()(

DACDBCAB

DAPDAPCDPCDPBCPBCP

ABPABPDACDBCAB

QQQQ

xvyuxvyuxvyu

xvyu2

1QQQQD

Uniform Cartesian Grid

P E E w w N N S S NE NE NW NW SE SE SW SW P P

xE EE cell2 2 2

xW WW cell2 2 2

N

C C C C C C C C C S

1 x y u y 1 1 u 1C 1 0 5R

D x 2 D x 2 x D x

u y u1 x y 1 1 1C 1 0 5R

D x 2 D x 2 x D x

1 x yC

D

( )

.

.

yN Ncell2 2 2

yS SS cell2 2 2

NE NW SE SW P

2 2 2 2

v x 1 1 v 1 1 0 5R

y 2 D y 2 y D y

v x v1 x y 1 1 1C 1 0 5R

D y 2 D y 2 y D y

x y 1C C C C 0 C

D D

1 1 D 1 1D 2 x y D 2

x y x y x y

.

.

;

;

x ycell x cell y

u x v yR P R P,

Cell Reynolds (Peclet) number

Page 13: 5.2 Finite-Volume Method · HC Chen 2/19/2020 Chapter 5B: Finite-Volume Method 2 Green’s Theorem 3D: Volume integral  Surface integral 2D: Surface integral

HC Chen 2/19/2020

Chapter 5B: Finite-Volume Method 13

Central Difference

x y xx yy

E P W N P S E E W W N N S SP2 2

u v S

2 2 u u v vS 0

x y 2 x 2 y

( ) ( ) ( )

( )

Identical to the finite-volume method

WEP P E W2 2 2 2

SNN S P2 2

uu1 1 1 12 D

x y x 2 x x 2 x

vv1 1 1 S

y 2 y y 2 y( )

ycell

xcell R

2

1yv

2

1

2

yvR

2

1xu

2

1

2

xu

Re ;Re

Unphysical solutions may occur if cell Reynolds (Peclet) numbers > 2

Exponential Scheme Ref: “Numerical Heat Transfer and Fluid Flow,” by S.V. Patankar, 1980

cF 0x

F 0

y

G

x

F

t

q

Steady, 1-D

ux/αxF u c ae c/u

Fw Fe

Pee e ee P EPe

u u xF c e Pe

e 1;

PW E

ew x x

Page 14: 5.2 Finite-Volume Method · HC Chen 2/19/2020 Chapter 5B: Finite-Volume Method 2 Green’s Theorem 3D: Volume integral  Surface integral 2D: Surface integral

HC Chen 2/19/2020

Chapter 5B: Finite-Volume Method 14

Exponential SchemeCell Peclet number Pe

Pee e ee P EPe

u u xF c e Pe

e 1;

,

,

, . ( )

( )

)

e e P

e e E

Pe 2

e E Pe P E

e

e x x

Pe 1 F u

Pe 1 F u

Pe 1 e 1 Pe 0 5 Pe 1 Pe

u F 1 Pe

Pe x

(Note: F u

Gradual shift to upwind

1D Convective Transport Equation

Uniform Cartesian grid (and ue = uw = u)Pe = Pw = Px = uΔx/α

Exponential Scheme

Linear FVM (Central Difference)

x x

x x

x

x x

P Pe w P E W PP P

P

P W EP P

u uF F e e

e 1 e 1

e 1

e 1 e 1

( ) ( )

x xcell cell

e w P W E

1 0 5R 1 0 5RF F

2 2

. . x

cell xR P

Page 15: 5.2 Finite-Volume Method · HC Chen 2/19/2020 Chapter 5B: Finite-Volume Method 2 Green’s Theorem 3D: Volume integral  Surface integral 2D: Surface integral

HC Chen 2/19/2020

Chapter 5B: Finite-Volume Method 15

Exponential Scheme

FeFw

Gn

Gs

Cartesian grids only

x y xx yy

x

y

u v S 0

F u F Glet S 0

G v x y

( )

ew xx

s

n

y

y

0SAΔxGΔxGΔyFΔyFΔxx; ΔyΔy

PPssnnwwee

snew

Pe Pwe we P E w W PPe Pw

Pn Psn sn P N s S PPn Ps

e e w w n n s se w n s

u uF e F e

e 1 e 1 v v

G e G ee 1 e 1u x u x v y v y

P , P , P , P

;

;

yeyw

xn

xs

Exponential SchemeNonuniform Cartesian grids

Uniform Cartesian grid (and ue = uw = u, vn = vs = v)

P P E E W W N N S S P

Pw Pse e w w n n s s

E W N SPe Pw Pn Ps

Pe Pne e w w n n s s

P Pe Pw Pn Ps

C C C C C A S

u y e u y v x e v xC C C C

e 1 e 1 e 1 e 1

e u y u y e v x v xC

e 1 e 1 e 1 e 1

, , ,

; ( , )

, , ,

( ) ( ),

e w x n s y

Px PyE W E N S NPx Py

Px Py

P PPx Py

u x v y P P P P P P constant u v

u y v xC C e C C C e C

e 1 e 1

u y e 1 v x e 1C A x y

e 1 e 1

Page 16: 5.2 Finite-Volume Method · HC Chen 2/19/2020 Chapter 5B: Finite-Volume Method 2 Green’s Theorem 3D: Volume integral  Surface integral 2D: Surface integral

HC Chen 2/19/2020

Chapter 5B: Finite-Volume Method 16

FVM: Pure DiffusionUniform Cartesian Grid x y 0 1 S 0. ;

0.25

0.25

0.25 0.25 0.25

0.25

0.25

0.25

Linear Exponential

P E E W W N N S S x y

u x v yC C C C P P; ,

0P ;0P

0v ;0u

yx

FVM: Convection-DiffusionUniform Cartesian Grid x y 0 1 S 0. ;

0.25

0.25

0.2625 0.2375 0.262599

0.249896

0.237609

0.249896

Linear Exponential

1051709.1e ;0P ;1.0P

0v ;1u ;1 Px

yx

Page 17: 5.2 Finite-Volume Method · HC Chen 2/19/2020 Chapter 5B: Finite-Volume Method 2 Green’s Theorem 3D: Volume integral  Surface integral 2D: Surface integral

HC Chen 2/19/2020

Chapter 5B: Finite-Volume Method 17

FVM: Convection-DiffusionUniform Cartesian Grid x y 0 1 S 0. ;

0.25

0.25

0.375 0.125 0.379922

0.240156

0.139765

0.240156

Linear Exponential

718281828.2e ;0P ;1P

0v ;1u ;1.0 Px

yx

FVM: Convection-DominantUniform Cartesian Grid x y 0 1 S 0. ;

0.25

0.25

1.5 -1.0 0.833308

0.083327

0.000038

0.083327

Linear Exponential

466.22026e ;0P ;10P

0v ;1u ;01.0 Px

yx

Page 18: 5.2 Finite-Volume Method · HC Chen 2/19/2020 Chapter 5B: Finite-Volume Method 2 Green’s Theorem 3D: Volume integral  Surface integral 2D: Surface integral

HC Chen 2/19/2020

Chapter 5B: Finite-Volume Method 18

FVM: Convection-DominantUniform Cartesian Grid x y 0 1 S 0. ;

0.25

0.25

12.75 -12.25 1.000000

0.000000

0.000000

0.000000

Linear Exponential

10688.2e ;0P ;100P

0v ;1u ;001.0 43Px

yx

FVM: Skewed UpwindUniform Cartesian Grid x y 0 1 S 0. ;

0.2625

0.2375

0.2625 0.2375 0.262490

0.237510

0.237510

0.262490

Linear Exponential

1051709.1ee ;1.0P ;1.0P

1v ;1u ;1 PyPx

yx

Page 19: 5.2 Finite-Volume Method · HC Chen 2/19/2020 Chapter 5B: Finite-Volume Method 2 Green’s Theorem 3D: Volume integral  Surface integral 2D: Surface integral

HC Chen 2/19/2020

Chapter 5B: Finite-Volume Method 19

FVM: Skewed UpwindUniform Cartesian Grid x y 0 1 S 0. ;

0.375

0.125

0.375 0.125 0.365529

0.134471

0.134471

0.365529

Linear Exponential

718281828.2ee ;1P ;1P

1v ;1u ;1.0 PyPx

yx

Finite-Volume MethodUniform Cartesian Grid x y 0 1 S 0. ;

1.5

-1.0

1.5 -1.0 0.499977

0.000023

0.000023

0.499977

Linear Exponential

466.22026ee ;10P ;10P

1v ;1u ;01.0 PyPx

yx

Page 20: 5.2 Finite-Volume Method · HC Chen 2/19/2020 Chapter 5B: Finite-Volume Method 2 Green’s Theorem 3D: Volume integral  Surface integral 2D: Surface integral

HC Chen 2/19/2020

Chapter 5B: Finite-Volume Method 20

FVM: Convection-DominantUniform Cartesian Grid x y 0 1 S 0. ;

12.75

-12.25

12.75 -12.25 0.500000

0.000000

0.000000

0.500000

Linear Exponential

10688.2ee ;100P ;100P

1v ;1u ;001.0 43PyPx

yx

Page 21: 5.2 Finite-Volume Method · HC Chen 2/19/2020 Chapter 5B: Finite-Volume Method 2 Green’s Theorem 3D: Volume integral  Surface integral 2D: Surface integral

HC Chen 2/19/2020

Chapter 5B: Finite-Volume Method 21

Error in textbook

AJM

Page 22: 5.2 Finite-Volume Method · HC Chen 2/19/2020 Chapter 5B: Finite-Volume Method 2 Green’s Theorem 3D: Volume integral  Surface integral 2D: Surface integral

HC Chen 2/19/2020

Chapter 5B: Finite-Volume Method 22

Page 23: 5.2 Finite-Volume Method · HC Chen 2/19/2020 Chapter 5B: Finite-Volume Method 2 Green’s Theorem 3D: Volume integral  Surface integral 2D: Surface integral

HC Chen 2/19/2020

Chapter 5B: Finite-Volume Method 23

Successive Overrelaxation(SOR)

Page 24: 5.2 Finite-Volume Method · HC Chen 2/19/2020 Chapter 5B: Finite-Volume Method 2 Green’s Theorem 3D: Volume integral  Surface integral 2D: Surface integral

HC Chen 2/19/2020

Chapter 5B: Finite-Volume Method 24

Grid Refinement