Sei sulla pagina 1di 20

1

Queensland University of Technology


CRICOS No. 00213J
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
Introduction to the Introduction to the
Finite Volume Method Finite Volume Method
A/Professor Ian Turner
School of Mathematical Sciences
Queensland University of Technology
Invited Lecture Series presented at the APAC / ICE-EM / AMSI Summer School held
at the Australian National University, Canberra, January 2004.
Copyright 2004 by Ian Turner
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
Associate Professor (Computational Mathematics)
School of Mathematical Sciences
Bachelor of Mathematics Course Coordinator
Co-director, Applied Mathematics
and Advanced Computing (AMAC)
Research Program
Room: L805 (QUT)
E-mail: i.turner@qut.edu.au
Phone: +61 7 3864 2259
Fax: +61 7 3864 2310
Main Research Interests:
Finite Volume Methods
Applied Numerical Linear Algebra
Computational Methods for PDEs
Heat and Mass Transfer - Porous Media
Computational Electromagnetics (CEM)
Welcome to my Lectures
2
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
Assumed Knowledge
Linear Algebra
Introduction to Differential/Partial Differential
Equations
Introduction to Scientific Computation and Matlab
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
COURSE CONTENT
Introduction to conservation equations
Analytical solutions for the benchmark problems
Introduction to the Finite Volume method
Implementing boundary condition information into the
model
The treatment of advection within the framework of the
FVM
Specialised Topics FVM in higher dimensions,
Treatment of Nonlinearity
3
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
OVERVIEW OF LECTURES OVERVIEW OF LECTURES
Module 1 - Introduction and the Generalised
Transport Equation
Module 2 - Introduction to Finite Volume
Methods (FVM)
Module 3 - FVM for Advection-Diffusion
Equations
Module 4 - Specialised Topics
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
4
Queensland University of Technology
CRICOS No. 00213J
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
MODULE 1 - Introduction and the
Generalised Transport Equation
A brief discussion of the conservation equations
that describe fluid motion
The notion of a generalised transport equation
Discussion of boundary and initial conditions
Derivation of analytical solutions for the
benchmark problems
Invited Lecture Series presented at the APAC / ICE-EM / AMSI Summer School held at the
Australian National University, Canberra, January 2004. Copyright 2004 by Ian Turner
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
Overview of Module
Conservation Equations
Conservation of Mass
Conservation of Momentum
Conservation of Energy
Navier-Stokes Equation
Summary of Conservation Equations
Generalised Form
Boundary Conditions
Summary
Benchmark Problems
5
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
1.1 Conservation Equations
In order to model mathematically the motion of a fluid
using the continuum approach, we analyse the physics
associated with a small averaging volume of the fluid.
This averaging volume, denoted by V, will be assumed
to be associated with every point in space. Furthermore,
any arbitrary shape may be chosen to represent V.
In general, the size of the representative elementary
volume (REV) is selected so that it is small on the
macroscopic scale, but large on the microscopic scale,
ensuring that the fluid properties (for example the
density) can be measured experimentally.
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
Representative Elementary Volume
V
= F v
d
n
Flux Function
A
Force acting on surface element
d (which has unit normal n)
6
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
1.2 Conservation of Mass
In an averaging volume element dV the Total Mass of
the fluid is given by:
(density volume) (1a)
The Mass flow rate of fluid through an averaging surface
element is given by:
(1b)
For a fixed volume V enclosed by a surface A, the
conservation of mass can be written as follows
dM dV =
( ) . d v n
{ } { }
{ }
/
Rate of Change of Mass in V Mass Flow rate of fluid out through surface A
Source Sink of Mass
=
+
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
Interpreting this statement in mathematical terminology,
we arrive at the following equation:
(1c)
By applying the Divergence Theorem and noting that V
is arbitrary, the Conservation of Mass can be written in
differential form as follows:
(2a)
.
u
V A V
d
dV d S dV
dt
= +

v n
( )
u
S
t

+ =

. v
7
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
Enter the Material Derivative
The Partial Derivative
Total time derivative
Material Derivative
t

, , ,
d dx dy dz dz dy dz
dt t x dt y dt z dt dt dt dt

= + + + =



v
( ) , , ,
D
u v w u v w
Dt t x y z

= + + + =

v
Rate of change in density at a fixed position in space
Rate of change in density at a position in space dependent
on stream (fluid) velocity, i.e., derivative following motion
Rate of change in density at a position in space dependent on
the observer velocity
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
Equation (2a) can be expressed in terms of the material
derivative:
(2b)
where it has been assumed that there are no
sources/sinks of mass generated in V.
An important special form of the equation of continuity (2b)
occurs when the fluid is assumed to have constant
density, (i.e., incompressible fluid). In this case, (2b)
reduces to the simplified form
(2c)
( ) 0
D
Dt

+ = .v
0 = v
8
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
1.3 Conservation of Momentum
In an averaging volume element dV, the Total Momentum
is given by:
(mass velocity) (3a)
Through an averaging surface element there are fluxes of
momentum given by:
(3b)
The stress forces acting on the surface element are given
by:
(3c)
where the i
th
component of is given in tensorial form
as
( ) d v.n v
( ) n
d F
( ) n
F
, 1, 2, 3
i ij j
F n i = =
d dV = U v
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
For a fixed volume V enclosed by a surface A, the
Conservation of Momentum is stated as:
This is a statement of Newtons second law,
In equivalent mathematical terminology we write:
(3d)
{ } { }
{ }
{ }
Rate of change of momentum Momentum flux of fluid out through surface
Stress forces acting on the element
Body forces acting on the element
A = +
+
. ., i e mass acceleration forces =

( )

n
V A A V
d
dV d d dV
dt
= + +

v v.n v F g
9
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
Note that equation (3d) is a vector equation with
components in each of the three coordinate directions.
Applying the Divergence Theorem in tensorial form (i.e.,
for a fixed i,
ij
are three components of a vector) and
noting that V is arbitrary, the Conservation of Momentum
can be written in differential form as follows:
(4)
The definition of the stress tensor is given by:
(5)
where the viscous component must be defined.
, 1, 2, 3
ij
i j i i
j j
v v v g i
t x x


+ = + =

ij ij ij
p = +
ij

CRICOS No. 00213J


a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
Substituting (5) into (4) gives the usual form of the
conservation of momentum as:
(6)
The terms on the RHS of equation (6) represent
respectively, the pressure forces acting on the element
of fluid per unit volume, the rate of momentum gained by
viscous transfer and the gravitational force per unit
volume.
( ) ( )
, 1, 2, 3
ij
i j i i
j i j
p
v v v g i
t x x x


+ = + + =

10
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
1.4 Conservation of Energy
In an averaging volume dV the Total Energy is given by:
(7a)
where e represents internal (stored) energy and
is the kinetic energy generated by the fluid motion.
The energy fluxes through an averaging surface element
are given by:
(7b)
where the first expression represents a convective flux
and the second expression represents a conductive flux.
1
2
dE e
1

= +


( )
v v
1
and
2
e d k Td
1


( )
v.n v.v n.
1
2
v v
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
The Conservation of Energy in integral form is written as
follows:
(7c)
( )
( )
1 1

2 2

V A
n
A A
V
d
e dV e d
dt
k T d d
dV

1 1
+ = +


( ) ( )
+ +
+ +

v.v v.n v.v


.n v.F
v.g
where: Term (1) Rate of change of energy in V;
Terms (2) + (3) Flux of energy and heat through the surface of element;
Term (4) The mechanical contribution of heat arising from compression
and visc

ous dissipation;
Term (5a) ( part of integral) Internal heat generation volumetric source;
Term (5b) (other part of integral) Body forces acting on the element per unit volume.

11
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
By using the Divergence Theorem and noting that V is
arbitrary, the Conservation of Energy is given as:
(8)
In order to simplify (8), it is assumed that the kinetic
energy, fluid viscous dissipation and work done by body
forces are negligible:
Thus, the conservation law becomes:
(9a)
( )
( )
1 1
2 2
e e k T
t

' ' 1 1
1 1
1 1
+ + + = + + +
! !

( ) ( ) 1 1

1 1 + +
v.v . v.v v . . v v.g
( )
1
0 ; ; 0
2
ij ij
p = = = v.v v g
( ) ( ) ( ) ( ) e e k T p
t

+ = +

. v . . v
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
Defining the bulk enthalpy as h = e + pv, where v is the
specific volume and h takes into account both internal
energy and compressive heating, (9a) becomes:
(9b)
Note that equation (9b) contains a number of variables:
T temperature, e internal energy, and h enthalpy.
Given that , (9b) can be recast into the
following form involving temperature and enthalpy:
(9c)
( ) ( ) ( ) e h k T
t

+ = +

. v .
( ) ( ) ( ) h p h k T
t

+ = +

. v .
/ e h p =
12
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
1.5 Navier-Stokes Equation
The viscous component of the stress tensor can be
written for Newtonian fluids as follows:
(10a)
where is the viscosity, e
ij
is the rate of strain tensor and
denotes the rate of expansion:
(10b)
In this case the total stress tensor becomes:
(10c)
1
2
3
ij ij ij
e
1
=


( )
1
and
2
j
i
ij ii
j i
v
v
e e
x x
1



= + =



( )
.v
1
2
3
ij ij ij ij
p e
1

= +


( )
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
Substituting (10c) into equation (4) gives:
Under the assumption of constant density and viscosity
, . We obtain the Navier-Stokes equation (1822):
(11)
If viscous effects are assumed negligible, , we
arrive at Eulers equation (1755):
(12)
( ) ( )
1
2 , 1, 2, 3
3
i j i ij ij i
j i j
p
v v v e g i
t x x x

l 1
+ = + l + =


( ) l
l
2
D
p
Dt
= + +
v
v g
0 = .v
D
p
Dt
= +
v
g
. ., 0
ij
j
i e
x

=

13
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
1.6 Summary of Conservation Equations
The above system of transport equations represents five
equations for seven unknowns - r, u, v, w, p, T, h. In
order to close the system, these equations must be
augmented with constitutive laws obtained from
thermodynamics.
These equations are knows as Equations of State:
(13)
( ) , T p =
( ) , h h T p =
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
1.7 Generalised Form
Note that all of the Conservation Laws summarised
above can be cast into a generalised scalar advection-
diffusion equation of the following form:
(14)
In order to have a well posed mathematical problem it is
necessary to specify boundary and initial conditions.
( ) ( ) .
u
v D S
t

+ =

Accumulation term + Advection Term - Diffusion Term = Source or Sink Term


Flux term

14
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
In many cases, due to the complexity introduced via the
nonlinearity in both the advection and diffusion terms, a
classical analytic solution becomes near impossible and
often a numerical solution technique must be employed.
This course will focus on numerical methods for solution
of these generalised conservation laws (primarily in one-
dimension with some discussion in two-dimensions) via
the Finite Volume Method (FVM).
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
1.8 Boundary Conditions
Note that the following generalised boundary condition
form can capture most of the types of boundary conditions
encountered for the conservation laws listed above:
(15)
where A,B,C are problem specific scalars, or scalar
valued functions; n denotes the outward normal to the
boundary and
A B C
n


+ =

n
15
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
1.8 Boundary Conditions
In equation (15):
A = 0; B 0 gives rise to boundary conditions of the
Dirichlet type,
A 0; B = 0 gives rise to boundary conditions of the
Neumann type,
A 0; B 0 gives rise to boundary conditions of the
Mixed or Robin type.
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
1.9 Summary
Throughout this course we will deal with the numerical
solution of the following one-dimensional generalised
conservation equation, together with the appropriate
boundary and initial conditions:
The way in which the advective and diffusive flux components
in the above equation are approximated will be of utmost
importance to the accuracy of the FVM.
( )
( ) ( )
0
( 0 )
, 0
x xx u
v D S
t x x
subject to
A B C at x and x L
n
and initially
x x


1

+ =


( )

+ = = =

=
16
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
1.10 Benchmark Problems
Problem 1: Generalised Diffusion Problem in a slab
Exercise 1.1 :
1. Non-dimensionalise this system.
2. Find the analytical solution to the problem using the separation of
variables method.
3. Tabulate the temperature variation for various times for the
following system parameters:
( ) ( )
2
2
0
, 0 , 0
0: 0 , 0
: 0, 0
, 0 , 0
D x L t
t x
at x t
at x L t
Initially x x x L



= < < >

= = >
= = >
= < <
( )
( )
2 1
0
1
2 0
2
1 , 1 ,
1
2 1 1
2
x x
L m D m s x
x x

'1
1
1
1
1
1
1
1
1
!
1
1
1
1
1
1
1
1
1+

= = =

CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
Analytical Solution
( )
( )
( )
( )
( )

+
=
=


2 2
(2 1)
1
2
2
1
8
, 1 sin 2 1
2 1
m t
m
m
e
x t m x
m
17
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
Problem 2 : Heat Conduction in a slab
Exercise 1.2:
1. Non-dimensionalise this system.
2. Find the analytical solution to the problem using the separation of
variables method.
3. Tabulate the temperature variation for various times for the given
system parameters.
2
2
0
0 ; 0
subject to
0 :
:
and initially ( , 0)
p
T T
C k g x L t
t x
T
x k hT hT
x
T
x L k hT hT
x
T x T


= + < < >

= + =

= + =

=
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
Analytical Solution


= +
0
( , ) ( ) ( , ) T x t T T T

= +
= + + +
+
2 2
2 2
and ( , ) cos( ) sin( )
1
( ) [( )(1 ) ]
2
n n n i n
i
n n i i
n i
B
B
N B B
B


= +

2
1
where,
( , )
( , ) (sin cos )exp( )
( )
n i i
n n n
n
n n n
B B
N
To obtain the Analytical Solution (g = 0):
(1) Transform the model into non-dimensional form
(2) Use separation of variables

= =
=
2
,

i
p
x hL
B
L k
k
t
C L
18
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005

2 2
2
tan
i n
n n
n i
B
where are the roots of
B
Parameters used for simulations:
k=0.159 W m
-1
C
-1
; r=595 kg m
-3
; C
p
=1758 J kg
-1
C
-1
;
L=0.05 m; h=25 W m
-2
; =140 C; =30 C;

T
0
T
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05
0
50
100
150
distance (m)
T
e
m
p
e
r
a
t
u
r
e

(
C
)
Bechmark Problem 1 - Heat Conduction in wood
t
1
t
2
t
3
t
4
t
5
t
6
t
7
19
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
Problem 3 : Contaminant Transport
Exercise 1.3:
1. Find the analytical solution to the problem using Laplace Transforms.
2. Tabulate the solution for various times for the given system parameters.
( )
( )
2
2
0
0 0 ; 0
su b j ect to
0, , 0
li m , 0,
an d i n itiall y ( , 0) 0
x x x
x
V D x t
t x x
t t
x t
x



+ + = > >

= >
=
=
Parameters used for the tests: L = 1, V
x
= 0.5, D
xx
= 0.0025,
0
=1, = 0.05
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
( )
( ) ( )

+ +
= +




= +
0
2
1 1
, exp exp
2 2 2 2 2
1 4 /
x x x x
xx xx xx xx
xx x
V x V x x V t x V t
x t erfc erfc
D D t D D t
with D V
Analytical Solution
20
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
Problem 4 : Advection-Diffusion
Exercise 1.4:
1. Verify that the exact solution to this problem is given by
2. Tabulate the solution for various times for the given system parameters:
V
x
= 0.6, D
xx
= 0.006, x
0
=0.2
( )
( )
( )
( )
( )
( )
( )
2
2
2
0
2
0
2
0
0 1 ; 0
s u b j e c t t o
1
0, e x p , 0
1 4 1 4
1 1
1, e x p , 0
1 4 1 4
e x p
, 0 1
a n d i n i t i a l l y ( , 0)
x x x
x
x x
x
x x
x x
V D x t
t x x
x V t
t t
t D t
x V t
t t
t D t
x x
x
x D


+ = < < >

1
+


= >


+ +
( )
1



= >


+ +
( )
1




=
( )
( )
( )
( )








=

>
+
+
0
,
2
1
e x p , 0 1 , 0
1 4
1 4
x
x x
x t
x x V t
x t
D t
t
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005

Potrebbero piacerti anche