0% found this document useful (0 votes)
164 views

The Finite Volume Method

Uploaded by

Tuong Bui
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
164 views

The Finite Volume Method

Uploaded by

Tuong Bui
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

The Finite Volume

Method
CHEN 6355
Computational Fluid Dynamics
Spring 2019

Tony Saad

Department of Chemical Engineering


University of Utah

CHEN 6355 - Computational Fluid Dynamics © Prof. Tony Saad - www.tsaad.net


A Preliminary
Derivation

CHEN 6355 - Computational Fluid Dynamics © Prof. Tony Saad - www.tsaad.net


The starting point of the Finite Volume Method
(FVM) is the integral form of conservation laws

Let’s start with a 1D example

∂φ ∂φ ∂ ∂φ
∫ V ∂t
dV = −
∫c dV +
V ∂x ∫ V ∂x
k dV
∂x
Remember, the integral form is based on a control volume - so, let’s split up our
computational domain into discrete control volumes

CHEN 6355 - Computational Fluid Dynamics © Prof. Tony Saad - www.tsaad.net


w e

W P E

∂φ
e e ∂φ e ∂ ∂φ
∫w ∂t dx = − ∫w c ∂x dx + ∫w ∂x k ∂x dx

CHEN 6355 - Computational Fluid Dynamics © Prof. Tony Saad - www.tsaad.net


w e

W P E

Starting with the advective term

∂φ e e
A = − ∫ c dx = −cφ w = −c(φe − φ w )
w ∂x

φ P + φW φE + φP
φw ≈ φe ≈
2 2

φ E − φW
A=
2
CHEN 6355 - Computational Fluid Dynamics © Prof. Tony Saad - www.tsaad.net
w e

W P E

Next, the diffusion term

e
∂ ∂φ e ⎛ ∂φ ⎞ ∂φ ∂φ
D=∫ k dx = ⎜ k ⎟ = ke − kw
w ∂x ∂x ⎝ ∂x ⎠ w ∂x e ∂x w

∂φ φE − φP ∂φ φ P − φW
≈ ≈
∂x e Δx ∂x w Δx

φ E − 2φ P − φW
D=k
Δx
CHEN 6355 - Computational Fluid Dynamics © Prof. Tony Saad - www.tsaad.net
W P E

For the time derivative, we have to make an


assumption on how the value of Phi changes
within the control volume

We will assume that the average value of phi


lives at the center of the control volume

∂φ
e ∂φ P
∫w ∂t dx ≈ ∂t Δx
1
φP ≡
V ∫ φ dV
V

CHEN 6355 - Computational Fluid Dynamics © Prof. Tony Saad - www.tsaad.net


W P E

∂φ P
Δx = − A + D
∂t

∂φ P φ E − φW φ E − 2φ P + φW
=− +k
∂t 2Δx Δx 2

Use your favorite ODE time integration scheme!

CHEN 6355 - Computational Fluid Dynamics © Prof. Tony Saad - www.tsaad.net


Finite Volume Formalism
∂φ
∫V ∂t ∫V ∫V ∫V
φ
dV = − ∇ ⋅ uφ dV + ∇ ⋅ k∇φ dV + Q dV

N2
N1
f2 f1

N3 f3
f6
f4 C
f5 N6

N4
N5

CHEN 6355 - Computational Fluid Dynamics © Prof. Tony Saad - www.tsaad.net


∂φ
∫V ∂t ∫V ∫V ∫V dV
φ
dV = − ∇ ⋅ uφ dV + ∇ ⋅ k∇φ dV + Q
f2 f1 Convert all fluxes to
f3
surface integrals
C f6
f4

∫ ∇ ⋅ uφ dV = ∫ uφ ⋅ ndS
f5

V S

∫V
∇ ⋅ k∇φ dV = ∫ k∇φ ⋅ ndS
S

For simplicity, define total flux as: J ≡ A − D = uφ − k∇φ

total flux = ∫ J ⋅ ndS


S

So that the
∂φ
governing
equation is: ∫V ∂t dV = − ∫S J ⋅ ndS + ∫V Sφ dV
CHEN 6355 - Computational Fluid Dynamics © Prof. Tony Saad - www.tsaad.net
∂φ
∫V ∂t dV = − ∫S J ⋅ ndS + ∫V Sφ dV
f2 f1
f3
C f6 Next, split the flux integral
f4
f5

∫S
J ⋅ ndS = ∑∫ Si
J ⋅ ndSi
f1 , f 2 ,…

This is an exact procedure since


the volumes are defined as
polygons/polyhedra

CHEN 6355 - Computational Fluid Dynamics © Prof. Tony Saad - www.tsaad.net


Example
n n = (0,1)

∫ uφ ⋅ ndS = ∑ ∫
S
f1 , f 2 ,…
Si
uφ ⋅ ndSi

n w = (−1,0) n e = (1,0) u = (u,v)

n s = (0,−1)

= ∫ uφ ⋅ n e dSe + ∫ uφ ⋅ n w dS w + ∫ uφ ⋅ n n dS n + ∫ uφ ⋅ n s dSs
fe fw fn fs

= ∫ uφ dSe − ∫ uφ dS w + ∫ vφ dS n − ∫ vφ dSs
fe fw fn fs

CHEN 6355 - Computational Fluid Dynamics © Prof. Tony Saad - www.tsaad.net


Our conversation law now has
the following form

∂φ
∫V ∂t dV = − ∑ ∫Si
J ⋅ ndS i
+ ∫V
Q φ
dV
f1 , f 2 ,…

CHEN 6355 - Computational Fluid Dynamics © Prof. Tony Saad - www.tsaad.net


Approximations of Integrals
So far, our formulation is still exact -
we haven’t made any approximations
to the governing equation.

The next step is to approximate the integrals!


We will use numerical integration techniques

f (x)

f (x)dx = ∑ ω i f (xi )
b

a
i
x1 x2 … xi …
a b
CHEN 6355 - Computational Fluid Dynamics © Prof. Tony Saad - www.tsaad.net
f (x)

f (x)dx = ∑ ω i f (xi )
b

a
i

x1 x2 … xi …
a b
Examples
b ⎛ a + b⎞
∫ a
f (x)dx ≈ (b − a) f ⎜
⎝ 2 ⎟⎠
Midpoint rule

b f (a) + f (b) Trapezoidal rule


∫ a
f (x)dx ≈ (b − a)
2

⎛ a + b⎞
f (a) + 4 f ⎜ ⎟ + f (b)
b ⎝ 2 ⎠ Simpson’s rule

a
f (x)dx ≈ (b − a)
2

CHEN 6355 - Computational Fluid Dynamics © Prof. Tony Saad - www.tsaad.net


Approximation of volume integrals

∫ Q dV ≈ ΔV ∑ ω ipQip
V
ip

One integration point Four integration points

ΔVQC ΔV (ω 1QC1 + ω 2QC 2 + ω 3QC 3 + ω 4QC 4 )

C1

C2 C4
C C
C3

CHEN 6355 - Computational Fluid Dynamics © Prof. Tony Saad - www.tsaad.net


Approximation of Surface Integrals

At all faces
∫ J ⋅ ndS = ∑ ∫
S
f1 , f 2 ,…
Si
J i ⋅ n i dSi

At one of those faces ∫ J ⋅ ndSi = ∑ ω ip J ip ⋅ nS


Si
ip

One integration point Two integration points


J1 ⋅ n1S1

CHEN 6355 - Computational Fluid Dynamics © Prof. Tony Saad - www.tsaad.net


Single Integration Point
A vast majority of FV practitioners use a single integration
point - this gives us second order accuracy for the integral
evaluation and also simplifies things significantly!

Using the midpoint rule, we set

∫V
φ dV ≈ φC ΔV
C

1
φC =
ΔV ∫ φ dV
V

CHEN 6355 - Computational Fluid Dynamics © Prof. Tony Saad - www.tsaad.net


A vast majority of FV practitioners use a single integration
point - this gives us second order accuracy for the integral
evaluation and also simplifies things significantly!

Using the midpoint rule, we set

∫ φ dV ≈ φ
V C
ΔV
C
1
φC =
ΔV ∫ φ dV
V
J1

Similarly, for surface integrals,


we store the flux value at the n1
midpoint of the surface ΔS1

∫ S1
J ⋅ ndS1 ≈ J1 ⋅ n1ΔS1

CHEN 6355 - Computational Fluid Dynamics © Prof. Tony Saad - www.tsaad.net


Finally…
∂φ
∫V ∂t dV = − ∫S J ⋅ ndS + ∫V Q dV
φ

∂φ ∂φC
Time derivative
∫V ∂t dV ≈
∂t
ΔVC


φ φ
Source terms Q dV ≈ Q ΔVC C
V

Flux terms ∫ J ⋅ ndS = ∑ ∫


S
f1 , f 2 ,…
Si
J i ⋅ n i dSi ≈ ∑
f1 , f 2 ,…
J f ⋅ n f ΔS f

∂φC
ΔVC = − ∑ J f ⋅ n f ΔS f + QC ΔVC
φ

∂t f1 , f 2 ,…

CHEN 6355 - Computational Fluid Dynamics © Prof. Tony Saad - www.tsaad.net


Because we love examples
∂φ
= −∇ ⋅ uφ u = (u,v)
∂t

w e
W P E
s

CHEN 6355 - Computational Fluid Dynamics © Prof. Tony Saad - www.tsaad.net


∂φ
= −∇ ⋅ uφ u = (u,v)
∂t
∂φC
N
n n = (0,1)
∂t
ΔVC = ∑ (uφ ) f ⋅ n f ΔS f
f1 , f 2 ,…

n
n w = (−1,0) n e = (1,0)
w e
W P
s
E
∑ (uφ ) f ⋅ n f ΔS f
f1 , f 2 ,…
n s = (0,−1)

S = (uφ )e ⋅ n e ΔSe + (uφ ) w ⋅ n w ΔS w + (uφ ) n ⋅ n n ΔS n + (uφ )s ⋅ n s ΔSs

= (uφ )e Δy − (uφ ) w Δy + (vφ ) n Δx − (vφ )s Δx

∂φC
ΔxΔy = (uφ )e Δy − (uφ ) w Δy + (vφ ) n Δx − (vφ )s Δx
∂t
∂φC (uφ )e − (uφ ) w (vφ ) n − (vφ )s
= +
∂t Δx Δy

CHEN 6355 - Computational Fluid Dynamics © Prof. Tony Saad - www.tsaad.net


⎛ ∂φ ∂φ ⎞
∂φ ∇φ = ⎜ , ⎟
= k∇ ⋅∇φ ⎝ ∂x ∂ y ⎠
∂t
∂φC
ΔVC = k ∑ ∇φ f ⋅ n f ΔS f
n n = (0,1) ∂t f1 , f 2 ,…

n w = (−1,0) n e = (1,0)
k ∑ ∇φ f ⋅ n f ΔS f
f1 , f 2 ,…

= k ( ∇φe ⋅ n e ΔSe + ∇φ w ⋅ n w ΔS w + ∇φn ⋅ n n ΔS n + ∇φs ⋅ n s ΔSs )

∂φ ∂φ ∂φ ∂φ
n s = (0,−1) =k Δy − k Δy + k Δx − k Δx
∂x e ∂x w ∂y n ∂y s

∂φC ∂φ ∂φ ∂φ ∂φ
ΔxΔy = k Δy − k Δy + k Δx − k Δx
∂t ∂x e ∂x w ∂y n ∂y s

∂φ ∂φ ∂φ ∂φ
− −
∂φC ∂x e ∂x ∂y n ∂y s
=k w
+k
∂t Δx Δy
CHEN 6355 - Computational Fluid Dynamics © Prof. Tony Saad - www.tsaad.net
What about the Fluxes?
So far, we haven’t said anything about how to
evaluate the fluxes at the control volume faces

∂φ φ E − φW
Diffusive Flux: = Second order (equivalent to central differencing)
∂x e Δx

(uφ ) E + (uφ )W
Convective Flux: (uφ )e = Second order (equivalent to central differencing)
2

CHEN 6355 - Computational Fluid Dynamics © Prof. Tony Saad - www.tsaad.net

You might also like