Unit 2 With QP
Unit 2 With QP
Derivation of finite difference equations – Simple Methods – General Methods for first and second order accuracy
– Finite volume formulation for steady state One, Two and Three –dimensional diffusion problems –Parabolic
equations – Explicit and Implicit schemes – Example problems on elliptic and parabolic equations – Use of Finite
Difference and Finite Volume methods.
DISCRETIZATION
Analytical solutions of partial differential equations involve closed-form expressions which give the variation of
the dependent variables continuously throughout the domain. In contrast, numerical solutions can give answers
at only discrete points in the domain, called grid points.
o Consider Fig. 4.1, which shows a section of a discrete grid in the xy plane. For convenience, let us assume that
the spacing of the grid points in the x direction is uniform and given by Δx and that the spacing of the points in
the direction is also uniform and given by Δy, as shown in Fig. 4.1. In general, Δx and Δy are different.
o Fig. 4.1, the grid points are identified by an index i which runs in the x direction and an index j which runs in the
y direction. Hence, if (i, j) is the index for point P in Fig. 4 .1, then the point immediately to the right of P is
labeled as (i + 1, j), the point immediately to the left is (i - 1, j), the point directly above is (i, j + 1) , and the point
directly below is (i, j - 1)
o Indeed, it is not absolutely necessary that Δx or Δy be uniform; we could deal with totally unequal spacing in both
directions, where Δx is a different value between each successive pairs of grid points, and similarly for Δy.
o However, the majority of CFD applications involve numerical solutions on a grid which contains uniform
spacing in each direction, because this greatly simplifies the programming of the solution, saves storage space,
and usually results in greater accuracy. This uniform spacing does not have to occur in the physical xy space; as
is frequently done in CFD,
o The numerical calculations are carried out in a transformed computational space which has uniform spacing in
the transformed independent variables but which corresponds to non-uniform spacing in the physical plane.
o In any event, in this chapter we will assume uniform spacing in each coordinate direction but not necessarily
equal spacing for both directions; i.e., we will assume Δx and Δy to be constants, but Δx does not have to equal
Δy .
o Figure 4.1 is an example of a structured grid
Equation ( 4 . 1) is mathematically an exact expression for ui+1,j if (1 ) the number of terms is infinite and the
series converges and/or (2) Δx -+ 0.
FINITE VOLUME FORMULATION
INTRODUCTION
o Here we develop the numerical method based on this integration, the finite volume (or control volume) method,
by considering the simplest transport process of all: pure diffusion in the steady state.
o The governing equation of steady diffusion can easily be derived from the general transport equation (2.39) for
property φ by deleting the transient and convective terms.
This gives
o By working with the one-dimensional steady state diffusion equation, the approximation techniques that are
needed to obtain the so-called discretized equations are introduced.
Step 2: Discretisation
The key step of the finite volume method is the integration of the governing equation (or equations) over
a control volume to yield a discretised equation at its nodal point P. For the control volume defined above this
gives
Here
A -is the cross-sectional area of the control volume face,
ΔV-is the volume and
D -is the average value of source
S -Source over the control volume
Step 3: Solution of equations
Discretised equations of the form (4.11) must be set up at each of the nodal points in order to solve a
problem. For control volumes that are adjacent to the domain boundaries the general discretised equation (4.11)
is modified to incorporate boundary conditions. The resulting system of linear algebraic equations is then solved
to obtain the distribution of the property φ at nodal points.
ANIN_C04.qxd 29/12/2006 09:57 AM Page 129
In addition to the east (E) and west (W) neighbours a general grid node
P now also has north (N) and south (S) neighbours. The same notation as in
the one-dimensional analysis is used for faces and cell dimensions. When the
above equation is formally integrated over the control volume we obtain
A D A D
∂∂x BC Γ ∂φ∂x EF dx . dy + ∂∂y BC Γ ∂∂φy EF dx . dy + S dV = 0 (4.52)
φ
∆V ∆V ∆V
So, noting that Ae = Aw = ∆y and An = As = ∆x, we obtain
G A ∂φ D A ∂φ D J
H Γe Ae B E − Γw Aw B E K
I C ∂x F e C ∂x F wL
G A ∂φ D A ∂φ D J
+ H Γn An B E − Γs As B E K + D∆V = 0 (4.53)
I C ∂y F n C ∂ y F sL
∂φ (φ − φP)
Flux across the east face = Γe Ae = Γe Ae E (4.54b)
∂x δxPE
e
∂φ (φ − φS)
Flux across the south face = Γs As = Γs As P (4.54c)
∂y δ ySP
s
∂φ (φ − φP)
Flux across the north face = Γn An = Γn An N (4.54d)
∂y δ yPN
n
ANIN_C04.qxd 29/12/2006 09:57 AM Page 130
− Γs As (φP − φS)
+ D∆V = 0 (4.55)
δ ySP
When the source term is represented in the linearised form D∆V = Su + SpφP, this
equation can be rearranged as
A Γw Aw Γe Ae Γs − Γn ASn p φP D
B + +
A + E
C δxWP δxPE s δ ySP δ yPN F
A Γw Aw D A Γe Ae D A Γs As D A Γn An D
= B E φW + B E φE + B E φS + B E φN + Su
C δxWP F C δxPE F C δ ySP F C δ yPN F
(4.56)
Equation (4.56) is now cast in the general discretised equation form for
interior nodes:
where
aW aE aS aN aP
Γw Aw Γe Ae Γs As Γn An
aW + aE + aS + aN − Sp
δxWP δxPE δySP δyPN
A ∂φ D J G A ∂φ D A ∂φ D J
− Γs As B E K + H Γt At B E − Γb Ab B E K + D∆V = 0
C ∂ y F sL I C ∂z F t C ∂z F bL
(4.59)
Following the procedure developed for one- and two-dimensional cases the
discretised form of equation (4.59) is obtained:
G (φ − φP) (φ − φW) J G (φ − φP)
H Γe Ae E − Γw Aw P K + H Γn An N
I δxPE δxWP L I δyPN
As before, this can be rearranged to give the discretised equation for interior
nodes:
where
aW aE aS aN aB aT aP
Γw Aw Γe Ae Γs As Γn An Γb Ab Γt At aW + aE + aS + aN
δxWP δxPE δ ySP δ yPN δzBP δzPT + aB + aT − SP
Parabolic equations
describe time-dependent problems, which involve significant amounts of diffusion. Examples are
unsteady viscous flows and unsteady heat conduction. The prototype parabolic equation is the diffusion equation
∂φ ∂ 2φ
=α (2.46)
∂t ∂x2
The transient distribution of temperature (again φ = T) in an insulated rod of metal whose ends at x = 0 and x =
L are kept at constant and equal tem-perature T0 is governed by the diffusion equation. This problem arises
when the rod cools down after an initially uniform source is switched off at time t = 0. The temperature
distribution at the start is a parabola with a maximum at x = L/2 (Figure 2.7).
The steady state consists of a uniform distribution of temperature T = T0 throughout the rod. The
solution of the diffusion equation (2.46) yields the exponential decay of the initial quadratic temperature
distribution. Initial conditions are needed in the entire rod and conditions on all its boundaries are
required for all times t > 0. This type of problem is termed an initial–boundary-value problem.
A disturbance at a point in the interior of the solution region (i.e. 0 < x < L and time t1 > 0) can only
influence events at later times t > t1 (unless we allow time travel!). The solutions move forward in time and
diffuse in space. The occurrence of diffusive effects ensures that the solutions are always smooth in the
interior at times t > 0 even if the initial conditions contain discontinuities. The steady state is reached as
time t → ∞ and is elliptic. This change of character can be easily seen by setting ∂φ/∂t = 0 in equation
(2.46). The governing equation is now equal to the one governing the steady tem-perature distribution in
the rod.
Equilibrium problems
The problems in the first category are steady state situations, e.g. the steady
state distribution of temperature in a rod of solid material or the equilibrium
stress distribution of a solid object under a given applied load, as well as many
steady fluid flows. These and many other steady state problems are governed
by elliptic equations. The prototype elliptic equation is Laplace’s equa-
tion, which describes irrotational flow of an incompressible fluid and steady
state conductive heat transfer. In two dimensions we have
∂ 2φ ∂ 2φ
+ =0 (2.45)
∂x2 ∂ y2
In addition to the usual variables we have c, the specific heat of the material
(J/kg.K).
Consider the one-dimensional control volume in Figure 8.1. Integration
of equation (8.3) over the control volume and over a time interval from t to
t + ∆t gives
t +∆t t +∆t t +∆t
∂ A ∂T D
∂T
ρc dV dt =
∂t B k E dV dt +
∂x C ∂x F S dV dt (8.4)
t CV t CV t CV
H kA ∂T D − A ∂T D K
H
H
I t
ρc
∂T K
dt
∂t KL
dV = H B ∂x E
IC Fe
B kA E K dt
C ∂x F wL
w t
t +∆t
+ D∆V dt (8.5)
t
In equation (8.5), A is the face area of the control volume, ∆V is its volume,
which is equal to A∆x, where ∆x = δxwe is the width of the control volume,
and D is the average source strength. If the temperature at a node is assumed
to prevail over the whole control volume, the left hand side can be written as
G t +∆t J
H
H ρc
∂T K
∂t
dt K dV = ρc(TP − T P )∆V
o
(8.6)
CV I t L
In equation (8.6) superscript ‘o’ to refers to temperatures at time t; tempera-
tures at time level t + ∆t are not superscripted. The same result as (8.6)
would be obtained by substituting (TP − T Po )/∆t for ∂T/∂t, so this term has
been discretised using a first-order (backward) differencing scheme. Higher-
order schemes, which may be used to discretise this term, will be discussed
briefly later in this chapter. If we apply central differencing to the diffusion
terms on the right hand side equation (8.5) may be written as
t +∆t
GA J
H k A TE − TP D − A k A TP − TW D K dt
ρc(TP − T Po )∆V = H
IC
B e E
δxPE F C
B w E
δxWP F KL
t
t +∆t
+ D∆V dt (8.7)
t
To evaluate the right hand side of this equation we need to make an assump-
tion about the variation of TP, TE and TW with time. We could use tempera-
tures at time t or at time t + ∆t to calculate the time integral or, alternatively,
a combination of temperatures at time t and t + ∆t. We may generalise the
approach by means of a weighting parameter θ between 0 and 1 and write
the integral IT of temperature TP with respect to time as
t +∆t
Hence
θ 0 1/2 1
IT T Po ∆t –12 (TP + T Po )∆t TP ∆t
G k (T o − T Po ) kw(T Po − T Wo )J
+ (1 − θ) H e E − K + D∆x (8.9)
I δxPE δxWP L
which may be rearranged to give
G ∆x A k k DJ
H ρc + θ B e + w E K TP
I ∆t C δxPE δxWP F L
ke k
= [θTE + (1 − θ)T Eo] + w [θTW + (1 − θ)T Wo ]
δxPE δxWP
G ∆x k k J
+ H ρc − (1 − θ) e − (1 − θ) w K T Po + D∆x (8.10)
I ∆t δxPE δxWP L
Now we identify the coefficients of TW and TE as aW and aE and write
equation (8.10) in the familiar standard form:
where
and
∆x
aPo = ρc
∆t
with
aW aE b
kw ke
D∆x
δxWP δxPE
The exact form of the final discretised equation depends on the value of θ.
When θ is zero, we only use temperatures T Po , T Wo and T Eo at the old time
level t on the right hand side of equation (8.11) to evaluate TP at the new time
and the resulting scheme is called explicit. When 0 < θ ≤ 1 temperatures at
the new time level are used on both sides of the equation and the resulting
schemes are called implicit. The extreme case of θ = 1 is termed fully
implicit and the case corresponding to θ = 1/2 is called the Crank–
Nicolson scheme (Crank and Nicolson, 1947).
Explicit scheme
where
aP = aPo
and
aW aE
∆x
aPo = ρc kw ke
∆t
δxWP δxPE
The right hand side of equation (8.12) only contains values at the old time step so the left hand
side can be calculated by forward marching in time. The scheme is based on backward
differencing and its Taylor series truncation error accuracy is first-order with respect to time. A
Advantages
FDM
1. Easy to formulate.
2. For multidimensional prob lems, meshes must b e structured in either two or three
dimensions. Curved meshes must be transformed into orthogonal cartesian coordinates
so that finite difference equations can b e written on structured cartesian meshes.
3. Neumann boundary conditions can only be approximated, not exactly enforced.
FVM
2 Marks