You are on page 1of 19

Finite volume method

The finite volume method is based on (I)


rather than (D). The integral conservation
law is enforced for small control volumes
defined by the computational mesh:

Integral conservation law (I)


Z
Z
Z

f n dS =
q dV
u dV +
t V
S
V
S

V =

N
[

Vi ,

Vi Vj = ,

1
|Vi |

u dV

dS

i 6= j

i=1

ui =

f = vu du

mean value

u
dV +
t

flux function

f dV =

q dV
V

Vi

Partial differential equation (D)

To be specified
concrete choice of control volumes
type of approximation inside them
numerical methods for evaluation
of integrals and fluxes

u
+ f = q
t
In steady state

u
t

in V

= 0 so that

(uv) = (du) + q

Definition of control volumes


Vertex-centered FVM
ui

1D

ui+1

ui 1

Cell-centered FVM
ui

1D

ui+1

ui 1

Vi
xi 1

xi
x i 1=2

2D

Vi
xi 1

xi+1
xi+1=2

x i 1=2

xi

2D

Vi
Vi

Vi

Vi

Different grids / control volumes can be used for different variables (v, p, . . .)

Discretization of local subproblems


Integral equation for a single finite volume
Z
Z
ui
1 X
1
u dV,
+
f nk dS = qi ,
ui =
t
|Vi |
|V
|
i
Sk
Vi
k

1
qi =
|Vi |

q dV
Vi

the integral conservation law is satisfied for each CV and for the entire domain
to obtain a linear system, integrals must be expressed in terms of mean values
pn (x)

Numerical integration
Z
n
X
wi f (xi )
f (x) dV
V

i=0

where wi 0 are the weights and xi are


the nodes of the quadrature rule

x0

xi

xn

Such formulae can be derived by exact integration of an interpolation polynomial

Newton-Cotes quadrature rules for intervals


1D

x1

x12

Midpoint rule
Trapezoidal rule
Simpsons rule

x12 =

x2
Z

x1 +x2
,
2

V = (x1 , x2 ),

|V | = x2 x1

exact for f P1 (V )

f (x) dV |V |f12
V

f (x) dV |V |

f1 + f2
2

exact for f P1 (V )

f (x) dV |V |

f1 + 4f12 + f2
6

exact for f P3 (V )

Numerical integration for quadrilaterals/hexahedra


y

use a mapping onto a unit square


and apply 1D quadrature rules in
each coordinate direction

V^
x

Newton-Cotes quadrature rules for triangles


x3

2D

x13

x123

Midpoints
x1 + x2
x12 =
,
2

x23

Center of gravity

x1

x12
Z

x2

f (x) dV |V |f123

x1 + x3
x2 + x3
, x23 =
2
2
x1 + x2 + x3
=
3

x13 =
x123

exact for f P1 (V )

f (x) dV |V |

f1 + f2 + f3
3

exact for f P1 (V )

f (x) dV |V |

f12 + f23 + f13


3

exact for f P2 (V )

f (x) dV |V |

3(f1 + f2 + f3 ) + 8(f12 + f23 + f13 ) + 27f123


60
exact for f P3 (V )

Newton-Cotes quadrature rules for tetrahedra


3D

x4
Center of gravity

x1234

x3

x1234 =

x1

x1 + x2 + x3 + x4
4

x2
Z
Z

f (x) dV |V |f1234
V

f (x) dV |V |

f1 + f2 + f3 + f4
4

exact for f P1 (V )

f (x) dV |V |

f1 + f2 + f3 + f4 + 16f1234
20

exact for f P2 (V )

exact for f P1 (V )

Interpolation techniques
Problem: the solution is available only at computational nodes (CV centers)
Interpolation is needed to obtain the function values at quadrature points
Volume integrals

ui =

1
|Vi |

Vi

u dV u(
xi ) midpoint rule

f = vu du
Z
1 X
(v nk )u dS,
Ic =
|Vi |
Sk

Surface integrals

1D:

|Vi | x =

P R

f nk dS = Ic + Id
Z
1 X
d(nk u) dS
Id =
|Vi |
Sk

Approximation of convective fluxes


1
N,

1
|Vi |

Sk

vertex-centered FVM
ui

xi = ix

ui+1/2 ui1/2
,
Ic = v
x

ui+1

ui 1
Vi

v = const

How to define the interface values ui1/2 ?

xi 1

xi
x i 1=2

xi+1
xi+1=2

Upwind difference approximation (UDS)


Piecewise-constant solution
ui 1=2

Upwind-biased interface values

ui+1=2
ui+1

ui

Ic v

ui 1

x
xi 1

ui ui1
x

v<0

xi
xi 1=2

ui1/2 ui1 ,

v>0

xi+1

Ic v

xi+1=2

ui+1/2 ui

backward difference

ui1/2 ui ,
ui+1 ui
x

ui+1/2 ui+1

forward difference

Taylor series expansion


vui+1/2

vx
= vui
2

u
x

i+1/2

(x)2
v
8

2u
x2

+ ...

i+1/2

a first-order accurate flux approximation, the leading truncation error resembles


vx
a diffusive flux d u
x with d = 2 being the numerical diffusion coefficient

Central difference approximation (CDS)


Piecewise-linear solution
ui 1=2

ui+1=2
ui+1

ui

Interpolation polynomial
x xL
xR x
+ uR
p1 (x) = uL
xR xL
xR xL
Averaged interface values

ui 1

ui1/2

x
xi 1

xi
xi 1=2

xi+1

Ic v

xi+1=2

ui1 + ui
,
2

ui+1 ui1
2x

ui+1/2

ui + ui+1
2

central difference

Taylor series expansions


ui+1 = ui+1/2 +

x
2

u
x i+1/2

ui = ui+1/2

x
2

u
x i+1/2

Hence, ui+1/2




ui + ui+1 (x)2

=
2
8

(x)2
8

(x)2
8

2u
x2




2 u
x2
2 u
x2

i+1/2

i+1/2

i+1/2

+ ...

+ ...
...
(second-order accuracy)

Linear upwind difference scheme (LUDS)


Piecewise-linear solution

Upwind-biased extrapolation
ui+1=2

ui 1=2
v
ui 2

xi 2

v>0

ui+1

ui
ui 1

Ic v

x
xi 1

xi
xi 1=2

ui1/2

xi+1

ui+1/2

3ui 4ui1 + ui2


2x

v<0

xi+1=2

LUDS is second-order accurate, equivalent


to the one-sided 3-point finite difference

3ui1 ui2
2
3ui ui1
2

Ic v

ui1/2
ui+1/2

3ui ui+1
2
3ui+1 ui+2
2

3ui 4ui+1 + ui+2


2x

The matrix is no longer tridiagonal (shifted, upper/lower triangular if Id = 0)


Defect correction:

(m+1)

(m+1)

(m)

(m)

ILU DS = IU DS + [ILU DS IU DS ],

m = 0, 1, 2, . . .

Quadratic upwind difference scheme (QUICK)


Quadratic Upwind Interpolation for Convective Kinematics
M
p2 (x) = uL xxx
L xM

ui 1=2
v
ui 2

xi 2

xR x
xR xL

ui+1=2
ui+1

ui

xxL xxM
xR x
L
+ uM xxx
+
u
R
x
x
x
x
M
L R
M
R xL xR xM

Upwind-biased interface values


ui1/2

v>0

ui 1

x
xi 1

xi
xi 1=2

xi+1

Ic v

ui+1/2

3ui+1 + 3ui 7ui1 + ui2


8x

xi+1=2

third-order flux approximation

v<0

second-order overall accuracy


(because of the midpoint rule)

Ic v

marginally better than LUDS

3ui +6ui1 ui2


8
3ui+1 +6ui ui1
8

ui1/2
ui+1/2

3ui1 +6ui ui+1


8
3ui +6ui+1 ui+2
8

3ui1 + 3ui 7ui+1 + ui+2


8x

Evaluation of surface integrals


Approximation of convective fluxes
any second-order finite volume scheme is a linear combination of CDS and
LU DS approximations (e.g. IQU ICK = 43 ICDS + 41 ILU DS )
high-order schemes can be readily derived by polynomial fitting based on
pm (x), m > 2 but pay off only if the quadrature rule matches their accuracy
a high-order scheme is guaranteed to produce better results than a low-order
one only asymptotically i.e. for sufficiently fine meshes
Approximation of diffusive fluxes
 
ui ui1
u

,
x i1/2
x

u
x

i+1/2

Second-order accurate central difference




u
u
d x i+1/2 d x i1/2
Id =
x

ui+1 ui
x

slopes of the
straight lines

ui+1 2ui + ui1


(x)2

Discretization of transport problems

Convective transport

+ (v) = 0
t
Diffusive transport

T
(T ) = 0
t
Dimensionless numbers:
Pe =

v0 L0
d

first derivatives

x , y , z

continuity equation (hyperbolic)


second derivatives

2
2
2
,
,
2
2
x
y
z 2 , . . .

heat conduction (parabolic/elliptic)


ratio of convection and diffusion

Peclet number

Re =

v0 L0

Reynolds number

Convection-dominated transport equations (such that P e 1 or Re 1)


are essentially hyperbolic, which may give rise to numerical difficulties.

Example: 1D convection-diffusion equation


Exact solution

Boundary value problem

2 u
v u

d
x
x2 = 0 in (0, 1)

u(0) = 0,

ePe x 1
u = Pe
,
e 1

u(1) = 1

Pe =

v
d

where Pe is the Peclet number

Vertex-centered finite volume method


u
x i+1/2

ui+1/2 ui1/2

Pe
x
Solution behavior for v > 0
u
1

u
1

P e = 40

u
x i1/2

xi = ix,

x =

1
N,

i = 0, 1, . . . N
u

=0

smearing

v
wiggles

x = 0.1
0

exact solution

upwind difference

central difference

Discretized convection-diffusion equation


Upwind difference scheme
Pe

ui ui1
ui1 2ui + ui+1

= 0,
x
(x)2

i = 1, . . . , N 1

Central difference scheme


ui1 2ui + ui+1
ui+1 ui1

= 0,
Pe
2x
(x)2
Boundary conditions
Linear system

u0 = 0,

Au = F

uN = 1
A RN 1N 1

b c
a b c

a
b
c
A=
,

(x)2
...
a b

i = 1, . . . , N 1

u=

u1
u2
u3

uN 1

u, F RN 1

F =

0
0
0

c
(x)
2

where A is a tridiagonal, nonsymmetric matrix with constant coefficients

Exact solution of the difference scheme


Linear equation for an interior node
aui1 + bui + cui+1 = 0

a < 0,

b > 0,

a+b+c=0

upwind difference

1 Pe x

2 + Pe x

central difference

1 0.5 Pe x

1 + 0.5 Pe x

Trial solution

ui = + ri ,

u0 = 0,

uN = 1

(boundary conditions)

ari1 + br i + cri+1 = 0, b = (a + c)

cr2 (a + c)r + a = 0
p
(a + c) (a + c)2 4ac
(a + c) (a c)
a
r1,2 =
=
,
r1 = , r2 = 1
2c
2c
c
A constant solution does not satisfy the BC

r=

a
c

is the root we need.

Numerical behavior of the difference scheme


Trial solution

u0 = + = 0,
Hence,

c<0

ui =

1( a
c)
1(

a < 0,

a
c

a
c

a < 0,

a
c

 a N
c

=1

P
Q

1
1

>0

< 0;

a + c = b < 0

a
c

0<

ui = ab ui1 = 0,


a N
c

is the exact solution of the difference scheme.

P < 0,

Q<0

ui > 0

<1

P > 0,

Q>0

ui > 0

>1
a
c

P changes its sign so that sign(ui ) = sign(ui1 )


c=0

= =

subject to the boundary conditions

uN = +

positivity-preserving
c>0


a i
c

ui = +

i = 1, . . . , N 1

c < a

a
c

< 1

nonphysical oscillations

u0 = 0,

uN = 1

no spurious oscillations but the accuracy leaves a lot to be desired

Evaluation of the central difference scheme


Criterion: the difference scheme produces no oscillations if c 0
Under this condition the matrix A is diagonally dominant
a < 0,

b = (a + c)

|b| = |a| + |c| for c 0


|b| < |a| + |c| for c > 0

Moreover, A is an M-matrix so that all the entries of its inverse are nonnegative
u

Central difference scheme


c = 1 +

Pe x
0
2

Pe x 2

v
wiggles

this condition is very restrictive for large Pe


wiggles occur just in the vicinity of steep gradients
local mesh refinement is useful for moderate Pe

Evaluation of the upwind difference scheme


c = 1 is negative unconditionally


 


(x)3 3 u
u
(x)2 2 u

+...
Taylor series
ui1 = ui x
+
x i
2
x2 i
6
x3 i


   2 
ui ui1 ui1 2ui + ui+1
u
u
Pe x 2 u
Pe
+ O(x)2

= Pe

2
2
2
x
(x)
x i
x i
2
x i

Upwind difference scheme

The truncation error is O(x) for the original equation


but O(x)2 for the so-called modified equation


vx 2 u
u
d+
=0
v
x
2
x2
where

vx
2

is the numerical (artificial) diffusion coefficient

v
smearing

UDS is nonoscillatory but not to be recommended because of its low accuracy.

You might also like