You are on page 1of 57

COMPUTATIONAL FLUID DYNAMICS INTRODUCTION: Historical Background

Lecture 1
GENERAL INTRODUCTION: HISTORICAL
BACKGROUND AND SPECTRUM OF APPLICATIONS

1.1 INTRODUCTION
Analysis of physical problems in any area of engineering and science involves a multi-
pronged approach:
Idealized physical model: experiments on scale models of the problem
Mathematical model: Theoretical analysis (analytical solution) / approximate
numerical solution.

Physical
Problem

Experimental Mathematical
Analysis Modeling

Both physical experiments and analytical/numerical simulations complement each other.


Both the approaches have their own limitations, advantages and disadvantages:
Physical experiments
o These are usually very time consuming and expensive to set up
o There are limitations on extrapolation of the results obtained on scaled model
of a problem to the actual prototype.
o BUT the experimentally observed data provides the closest possible
approximation of the physical reality within the limits of experimental
errors.
Numerical Simulation
o Mathematical modelling is based on a set of assumptions with regard to the
variation of the problem variables, constitutive relations and material
properties.
o Numerical simulation process introduces additional approximation errors
in the solution. Hence, results of any analytical or numerical study must be

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L1.1


COMPUTATIONAL FLUID DYNAMICS INTRODUCTION: Historical Background

carefully validated against physical experiments to establish their practical


usefulness.
o However, once validated, a numerical simulation can be easily performed on
the full scale prototype, and thereby eliminate the need of extrapolation.

1.2 WHAT IS CFD?


Mathematical modelling of a continuum problem leads to a set of differential, integral or
integro-differential equations. Exact analytical solution of such equations is limited to
problems in simple geometries. Hence, for most of the problems of practical interest, an
approximate numerical solution is sought. In the context of mechanics, the science and
practice of obtaining approximate numerical solution using digital computers is termed
Computational Mechanics. For thermo-fluid problems, this approach is popularly known as
Computational Fluid Dynamics (CFD). Thus,

CFD is essentially a branch of continuum mechanics which deals with


numerical simulation of fluid flow and heat transfer problems.

Note that although word heat transfer is missing from CFD, it is an intrinsic part of this
discipline.

CFD deals with approximate numerical solution of governing equations based on the
fundamental conservation laws of physics, namely mass, momentum and energy
conservation. The CFD solution involves
Conversion of the governing equations for a continuum medium into a set of discrete
algebraic equations using a process called discretization.
Solution of the discrete equations can using a high speed digital computer to obtain
the numerical solution to desired level of accuracy.

1.3 HISTORICAL PERSPECTIVE


Although development of some of the techniques used in CFD dates back to pre-digital era,
history of CFD is intrinsically linked to the advent of the digital computers in late 1950s. It is
highly debatable as to who did the first CFD simulation of a flow problem. Hence, instead of
looking at chronology of the history of CFD, we focus on the evolution of CFD for
motivational and application perspective.
Early Applications
The early beginning of the CFD can be traced to numerical simulations for aerospace
applications at Douglas, Boeing, NASA, and Lockheed in 1960s based on panel methods.
o The codes based on panel methods still play an important role in the computer
aided design of modern day aircraft.
Meteorologists were the next early users of CFD for weather forecasting applications.
Large eddy simulation models for atmospheric turbulent flows appeared in early 1970s.

Algorithmic Front
1960s: Development of Particle-In-Cell (PIC), Marker-and-Cell (MAC) and Vorticity-
Stream function methods at NASA.

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L1.2


COMPUTATIONAL FLUID DYNAMICS INTRODUCTION: Historical Background

1970s: Development of parabolic flow codes (GENMIX), Vorticity-Stream function


based codes, and the SIMPLE algorithm by the research group of Professor D. Brian
Spalding, at Imperial College, London.
1980 onwards vigorous research activity in various parts of the globe addressing different
aspects of CFD: new discretization methods, turbulence modelling, numerical algorithms,
grid generation methods, post-processing and visualization, parallel implementation etc.

Impact of Developments in CAD on Industrial Applications of CFD


Industrial applications of CFD boosted by the availability of commercial CFD codes in
1980s.
Developments in CAD and FEA have inspired development of commercial CFD codes
with user-friendly graphical user interface, in-built geometry and solid modelling, and
visual post-processing capabilities.
Availability of commercial and open-source GUI based codes which offer CAD inter-
operability has led to the integration of CFD analysis in the design cycle.

1.4 APPLICATIONS OF CFD


CFD is being used for fundamental research as well as industrial R&D. CFD analysis forms
an integral part of design cycle in most of the industries: from aerospace, chemical and
transportation to bio-medical engineering. The length scales range from planetary boundary
layers to micro-channels in electronic equipments. Following is a short-list of some of more
prominent applications of CFD:
Meteorology: weather forecasting
Aerospace: design of wings to complete aircraft aerodynamic design
Turbomachines: design of hydraulic, steam, gas, and wind turbines; design of pumps,
compressors, blower, fans, diffusers, nozzles.
Engines: combustion modelling in internal combustion engines
Electronics: cooling of micro-circuits
Chemical process engineering
Energy systems: analysis of thermal and nuclear power plants, modelling of accident
situations for nuclear reactors.
Hydraulics and hydrology: flow in rivers, channels, ground aquifers, sediment
transport.
HVAC: Design of ducts, placement of heating/cooling ducts for optimum comfort in a
building
Surface transport: aerodynamic design of vehicles
Marine: hydrodynamic design of ships, loads on off-shore structures
Biomedical: simulation of blood flow through arteries and veins, fluid flow in renal
and ocular systems.
Fundamental flow physics: dynamics of laminar, transitional and turbulent flows.

The complete list of CFD applications is rather long, and continues to grow each day. Figures
on following pages provide graphical illustrations of some applications.

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L1.3


COMPUTATIONAL FLUID DYNAMICS INTRODUCTION: Historical Background

SUGGESTED TEXT-BOOKS / RESOURCES


Anderson, J. D., Jr. (1995). Computational Fluid Dynamics: The Basics with Applications.
McGraw Hill, New York.
Chung, T. J. (2010). Computational Fluid Dynamics. 2nd Ed., Cambridge University Press,
Cambridge, UK.
Date, A. W. (2005). Introduction to Computational Fluid Dynamics. Cambridge University
Press, Cambridge.
Ferziger, J. H. and Peric, M. (2003). Computational Methods for Fluid Dynamics. Springer-
Verlag, Berlin.
Fletcher, C. A. J. (1988). Computational Techniques for Fluid Dynamics. Vol. 1 and 2.
Springer-Verlag, Berlin.
Versteeg, H. K. and Malalasekera, W. M. G. (2007). Introduction to Computational Fluid
Dynamics: The Finite Volume Method. Second Edition (Indian Reprint) Pearson Education

WEB RESOURCES
http://www.cfd-online.com/

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L1.4


COMPUTATIONAL FLUID DYNAMICS INTRODUCTION: Historical Background

Figure 1.1 CFD Simulation of complete fighter aircraft

Figure 1.2 Direct numerical simulation of flow over a rough-bed channel

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L1.5


COMPUTA
ATIONAL FLUID
F DY
YNAMICS INTRODUCT
TION: Histtorical Bacckground

Figure 1.3 Pressuree distributioon around a high-speedd train obtainned from RANS
R simulation

(a) CAD
D model of geometry
g (b) Structurred Grid used in CFD analysis
a

(c) P
Pressure disstribution ovver runner blades
b (d) Pressure contours in
i stator andd runner
Figurre 1.4 RAN NS simulatioon of turbuleent flow in a Francis tuurbine

D K M Sin
Dr ngh, Indian
n Institute oof Technoloogy Roorkeee NPTE
EL L1.6
COMPUTATIONAL FLUID DYNAMICS INTRODUCTION: Numerical Simulation Process

Lecture 2
NUMERICAL SIMULATION PROCESS
2.1 NUMERICAL SIMULATION PROCESS
Numerical simulation of a physical problem involves approximation of the problem
geometry, choice of appropriate mathematical model and numerical solution techniques,
computer implementation of the numerical algorithm and analysis of the data generated by
the simulation. Thus, this process involves the following steps:
Model the geometry of the problem domain.
Choose appropriate mathematical model of the physical problem.
Choose a suitable discretization method.
Generate a grid based on the problem geometry and the discretization method.
Use a suitable solution technique to solve the system of discrete equations.
Set suitable convergence criteria for iterative solution methods.
Prepare the numerical solution for further analysis
Let us have a bit more detailed look at the preceding steps. Each of these steps clearly
reminds us of the approximations involved at each step of numerical simulation: from
approximations/idealizations used in geometry modelling to solution process and post-
processing.

2.2GEOMETRY MODELLING
The numerical simulation requires a computer representation of the problem domain. For
most of the engineering problems, it may not be possible or even desirable to include all the
geometric details of the system in its geometric model. The analyst has to make a careful
choice regarding the level of intricate details to be chosen. For example, in the numerical
simulation of flow field around an automobile, finer details of the front air-intake grills would
be avoided. Incorporation of these finer features would make the grid generation process very
difficult, but would hardly contribute to the accuracy of the velocity and pressure fields.

2.3 MATHEMATICAL MODELLING


An appropriate mathematical model for the problem has to be selected keeping in view the
objective of the simulation, and physics of the flow problem. For example, one can opt for
incompressible Navier-Stokes equations for low speed aerodynamics (Mach number < 0.3,
e.g. flow over a car or train). Similarly, for high speed compressible flow over a whole
aircraft, one may choose inviscid model (Eulers equation). The choice of the model also
depends on the available computing resources and level of accuracy desired.

2.4 DISCRETIZATION METHOD


For computer simulation, the continuum mathematical model must be converted into a
discrete system of algebraic equation using a suitable discretization procedure. There are
many discretization approaches. The most popular are the finite difference method (FDM),
the finite element method (FEM) and the finite volume method (FVM). Choice of the
discretization method depends on the problem geometry, preference of the analyst and pre-
dominant trend in a particular application area. For instance, FEM is very popular for stress
analysis applications, whereas FDM has traditionally been more popular for simulation of

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L2.1


COMPUTATIONAL FLUID DYNAMICS INTRODUCTION: Numerical Simulation Process

turbulent flows. Similarly, commercial CFD codes have shown a distinct preference for the
finite volume method.

2.5 GRID GENERATION


The problem domain is discretized into a mesh/grid appropriate to the chosen discretization
method. The type of the grid also depends on the geometry of the problem domain.
Structured grid is required for the finite difference method, whereas FEM and FVM can work
with either structured or unstructured grids. In case of unstructured grids, care must be taken
to ensure proper grading and quality of the mesh.

2.6 NUMERICAL SOLUTION


The discretization method applied to the mathematical model of the problem leads to a
system of discrete equations: (a) a system of ordinary differential equations in time for
unsteady problems, and (b) a system of algebraic equations for steady state model. For
unsteady problems, time integration methods for initial value problems are employed, some
of which transform the differential system to a system of algebraic equations at each time
step. Iterative methods are usually employed to solve the system of algebraic equations,
choice of methods being dependent on the type of the grid and size of the system.

The convergence criterion for the iterative solvers depends on the accuracy as well as
efficacy requirements. The tightness of the specified error tolerance would also depend on the
precision chosen for numerical computations.

2.7 POST-PROCESSING
Numerical simulation provides values of field variables at discrete set of computational
nodes. For analysis of the problem, the analyst would like to know the variation of different
variables in space-time. Further, for design analysis, secondary variables such a stresses and
fluxes must be computed. Most of the commercial CFD codes provide their own post-
processor which compute the secondary variables and provide variety of plots (contour as
well as line diagrams) based on the nodal data obtained from simulation. These computations
involve use of further approximations for interpolation of nodal data required in integration
and differentiation to obtain secondary variables or spatial distributions.

2.8 VALIDATION
Numerical solution of a physical problem must be validated with available experimental data
to ensure that it gives a reasonably accurate description of the physical reality. In general,
numerical solution is sought for a problem for which no experimental results are available.
For example, it is not feasible to perform experiments on a full scale prototype of an airplane
or high-speed train. In such situations, validation of the simulation process is carried out with
the scale model for which experimental data are available. Thereafter, the simulation process
can be extended for numerical solution of the full-scale problem.

REFERENCES/SUGGESTED READING
Ferziger, J. H. And Peri, M. (2003). Computational Methods for Fluid Dynamics. Springer.

Versteeg, H. K. and Malalasekera, W. M. G. (2007). Introduction to Computational Fluid


Dynamics: The Finite Volume Method. Second Edition (Indian Reprint) Pearson Education

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L2.2


COMPUTATIONAL FLUID DYNAMICS INTRODUCTION: Approximation Techniques

Lecture 3
APPROXIMATE SOLUTION TECHNIQUES

3.1 INTRODUCTION
Numerous approximate solution techniques have been developed for different types of
problems in CFD. These methods can be classified into two categories:
Mesh-based methods which require discretization of the problem domain into a
mesh (or grid), e.g. finite difference, finite element, and finite volume methods.
Mesh-free methods which primarily use a collection of nodes with no apparent
connectivity, e.g. smooth particle hydrodynamics (SPH), mesh-less Petrov-
Galerkin (MLPG), lattice Boltzmann methods.
Of the preceding two types, mesh-based methods are more popular in CFD. Of these, finite
volume method has been the most popular due to its simplicity and ease of application for
problems in complex geometries. In fact, majority of commercial CFD packages (e.g. Fluent,
StarCD, etc.) are based on finite volume method. In this lecture, we will have a brief
overview of finite difference, finite element and finite volume methods.

3.2 FINITE DIFFERENCE METHOD (FDM)


The FDM is the oldest method for numerical solution of partial differential equations. This
method is also the easiest method to formulate and program for problems on simple
geometries. In FDM, the solution domain is discretized using a structured (usually Cartesian)
grid. The conservation equations in differential form are approximated at each grid point by
replacing the partial derivatives by finite difference approximations in terms of nodal values
of the unknown variables. This process results in an algebraic equation for each node. These
algebraic equations are collected for all the grid points and resulting system of discrete
equations are solved to yield the approximate solution of the problem at the grid nodes.

The main disadvantage of the finite difference method is its restriction to simple
geometries (although immersed boundary techniques do remove this restriction). We provide
a detailed description of this method in the following section.

3.3 FINITE ELEMENT METHOD (FEM)


The finite element method is based on the division of the problem domain into a set of finite
elements which are generally unstructured. The elements are usually triangles or
quadrilaterals in two dimensions, and tetrahedra or hexahedra in three dimensions. Starting
point of the method is conservation equation in differential form. The unknown variable is
approximated using an interpolation procedure in terms of nodal values and a set of known
functions (called shape functions). This approximation is substituted into the differential
equation. The resulting residual (error) is minimized in an average sense using a weighted
residual procedure. The weighted integral statement leads to a system of discrete equations in
terms of unknown nodal values, which is solved to obtain the solution of the problem.

FEM is ideally suited to problems on complex geometries, and hence, this method has
been very popular in computational solid mechanics. There is an extensive literature available

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L3.1


COMPUTATIONAL FLUID DYNAMICS INTRODUCTION: Approximation Techniques

on all aspects of this method: type of elements, shape functions, mesh generation,
applications to different type of problems, etc. For detailed study of FEM, interested reader
can refer to books by Zienkiewicz et al. (2005a, 2005b), Reddy (2005), Reddy and Gartling
(2010) amongst others.

3.4 FINITE VOLUME METHOD (FVM)


The finite volume method is based on the integral form of conservation equations. The
problem domain is divided into a set of non-overlapping control volumes (called finite
volumes). The conservation equations are applied to each finite volume. The integrals
occurring in the conservation equations are evaluated using function values at computational
nodes (which are usually taken as centroids of finite volumes). This process involves use of
approximate integral formulae and interpolation methods (to obtain the values of variables at
surfaces of the CVs).

The FVM can accommodate any type of grid, and hence, it is naturally suitable for
complex geometries. This explains its popularity for commercial CFD packages, which must
cater to problems in arbitrarily complex geometries. This method has immensely benefited
from the unstructured grid generation methods developed for the finite element method.

REFERENCES/SUGGESTED READING

Anderson, J. D., Jr. (1995). Computational Fluid Dynamics: The Basics with Applications.
McGraw Hill, New York.
Ferziger, J. H. And Peri, M. (2003). Computational Methods for Fluid Dynamics. Springer.

Reddy, J. N. (2005). An Introduction to the Finite Element Method. 3rd Ed., McGraw Hill,
New York.

Reddy, J. N. and Gartling, D. K. (2010). The Finite Element Method in Heat Transfer and
Fluid Dynamics, 3rd ed., CRC Press

Versteeg, H. K. and Malalasekera, W. M. G. (2007). Introduction to Computational Fluid


Dynamics: The Finite Volume Method. Second Edition (Indian Reprint) Pearson Education
Zienkiewicz, O. C., Taylor, R. L., Nithiarasu, P. (2005a). The Finite Element Method for
Fluid Dynamics, Butterworth-Heinemann (Elsevier).

Zienkiewicz, O. C., Taylor, R. L., Zhu, J. Z. (2005b). The Finite Element Method: Its Basis
and Fundamentals, 6th Ed., Butterworth-Heinemann (Elsevier).

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L3.2


COMPUTATIONAL FLUID DYNAMICS: Conservation Laws and Mathematical Preliminaries

Lecture 4
CONSERVATION LAWS AND MATHEMATICAL
PRELIMINARIES
4.1 CONSERVATION LAWS
CFD is based on fundamental governing equations of fluid dynamics which are essentially
mathematical models of conservation laws of physics. Assuming a fluid to be a continuum,
these conservation laws are
1. Conservation of mass
2. Conservation of momentum (Newtons second law)
3. Conservation of energy (first law of thermodynamics)
These conservation laws are supplemented with constitutive relations (e.g. stress-strain rate
relation, heat diffusion law, etc.) for a specific material.

In this lecture, we provide a brief overview mathematical notation and a few important
theorems which are used to obtain mathematical statements of the conservation laws, in
integral as well as differential forms. The integral forms provide the starting point for the
finite volume method whereas the differential form of conservation equations is used by the
finite difference and the finite element methods. This lecture closely follows the approach of
Kundu and Cohen (2008) and Panton (2005) which should be consulted for further details
and supplemental reading.

4.2 MATHEMATICAL NOTATIONS


Conservation laws of a continuum medium involve vector and tensor quantities. Following
three different types of notations are usually employed in continuum mechanics:

Dyadic or vector notation


Expanded or component form
Cartesian tensor notation

Dyadic or vector notation


Dyadic notation is usually preferred for clear enunciation of the underlying physical
principles in a compact form. In this notation, form of governing equations is independent of
the choice of coordinate axes. Hence, this is also known as coordinate-free form. We would
use bold face letters to denote vectors or tensor quantities (e.g. velocity v), whereas simple
italics symbols are used for scalars (e.g., temperature T, pressure p).

Expanded or component form


Component form of governing equations is dependent on the choice of coordinate axes.
Algebraic manipulations are a lot simpler with an expanded form of conservation equations
(say, in Cartesian coordinates).

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L4.1


COMPUTATIONAL FLUID DYNAMICS: Conservation Laws and Mathematical Preliminaries

Cartesian tensor notation


Cartesian tensor notation provides compactness of the dyadic notation and ease of algebraic
manipulation of Cartesian coordinate representation. In this notation, Ox1x2 x3 represents the
Cartesian reference frame Oxyz , and n subscripts are used for an nth order tensor. Thus,
one subscript is used to denote a vector (e.g., vi denotes the vector v);
two subscripts are used to denote a second order tensor (e.g. ij represents stress tensor
).
The summation convention given below is widely used in Cartesian tensor notation.

Summation convention
A repeated index in a term implies summation over the range of that index. For example
ai bi ai bi (Dot product of two vectors a and b) (4.1)
i

vi v v v v
i 1 2 3 (Divergence of vector v) (4.2)
xi xi x1 x2 x3

Kronecker delta
The Kronecker delta, ij , is a second order isotropic tensor defined as
1 if i j
ij (4.3)
0 if i j
Substitution property of Kronecker delta:

ij u j ui (4.4)

Alternating tensor (permutation symbol)


The alternating tensor, ijk is isotropic tensor of third order defined as
1 if ijk 123, 231 or 312 (cyclic order)

ijk 0 if any two indices are equal (4.5)
1 if ijk 321, 213 or 132 (anticyclic order)

Products of Two Vectors a and b


Scalar or dot product
a b b a a1b1 a2b2 a3b3 ai bi (4.6)
Vector or cross product
c a b ci ijk a j bk (4.7)
Tensor product
C ab Cij ai b j (4.8)

Products of Two Second Order Tensors A and B


Simple tensor product
C = AB Cijkl Aij Bkl (4.9)
Singly contracted product (dot product)
( A B )ij Aik Bkj (4.10)

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L4.2


COMPUTATIONAL FLUID DYNAMICS: Conservation Laws and Mathematical Preliminaries

Doubly contracted product (scalar product)


c A : B c Aij B ji (4.11)

Products of a Second Order Tensors A and vector u


Simple tensor product
C = Au Cijk Aij uk (4.12)
Singly contracted product (dot product)
( A u )i Aij u j (4.13)

Gradient operator ( )
The gradient operator, (del) is the vector operator defined as

i j k ii (4.14)
x y w xi
When operated on a scalar function , it generates a vector whose ith component is / xi .

Divergence operator ( . )
The divergence of a vector field is defined as the scalar quantity given by
v v v v
.v i 1 2 3 (4.15)
xi x1 x2 x3
Divergence of a second order tensor yields a vector whose ith component is given by

. i ij (4.16)
x j
Thus, divergence operator decreases the order of a tensor by 1, whereas gradient operator
increases the order of a tensor by 1.

4.3 GAUSS DIVERGENCE THEOREM


Let V be a volume bounded by a closed surface A. Let F x be any scalar, vector or tensor
field. Gauss theorem states that
F
V xi dV A FdAi (4.17)

If F is a vector, then Gauss theorem becomes


F
V xii dV A dAi Fi or FdV A F dA
V
(4.18)

which is popularly known as Gauss divergence theorem. Gauss divergence theorem is used to
convert a surface integral to a volume integral (or vice-versa).

4.4 REYNOLDS TRANSPORT THEOREM (RTT)


Conservation laws are defined for a control mass system whereas a control volume based
(Eulerian) description is usually preferred for a fluid medium. Reynolds transport theorem

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L4.3


COMPUTATIONAL FLUID DYNAMICS: Conservation Laws and Mathematical Preliminaries

provides a relation between the time rates of change in two descriptions, and is used to obtain
the integral form of the conservation laws for a fluid medium.

Let be an intensive property, then corresponding extensive property for a given


system (or control mass) can be expressed as
d (4.19)
CM

where CM represents the volume of the system which occupies the control volume at a
given instant of time and is mass density. Reynolds transport theorem states that the time
rate of change of for the system is equal to the rate of change of in control volume plus
net flux of through boundaries of the control volume, i.e.

d
d v v c dA (4.20)
dt CM t S

where v c is velocity of the control volume with respect to the fixed inertial reference frame
in which v is defined, and S denotes the boundary surface of the control volume. The second
term on RHS is usually called the convective (or advective) term.

We would employ the preceding notations and theorems to derive the integral as well as the
differential forms of the mass, momentum and energy equations in next few lectures.

REFERENCES

Kundu, P. K. and Cohen, I. M. (2008). Fluid Mechanics, 4th Ed., Academic Press.
Panton, R. L. (2005). Incompressible Flow, 3rd Ed., Wiley.

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L4.4


COMPUTATIONAL FLUID DYNAMICS: Continuity Equation

Lecture 5
CONTINUITY EQUATION

5.1 MASS CONSERVATION EQUATION: INTEGRAL FORM


For a system, its mass is conserved, i.e. dM / dt 0 . Since M .1 d , hence 1 , and

Reynolds transport theorem (L4.22) yields the following integral form for the mass
conservation (or continuity) equation for a stationary control volume:

t
d v dA 0 (5.1)
S

5.2 MASS CONSERVATION EQUATION: DIFFERENTIAL FORM


For a fixed control volume, order of temporal differentiation and integration in Eq. (5.1) can
be interchanged. Further, the convective term can be transformed into a volume integral by
applying Gauss divergence theorem, i.e.


t
d d and v dA ( v)d

t S
(5.2)

Substitution of Eq. (5.2) into Eq. (5.1) yields



t d ( v)d 0

( v ) d 0

t
(5.3)

The preceding equation holds for any control volume which is possible only if the integrand
vanishes everywhere, i.e.

. v 0 (5.4)
t

Equation (5.4) represents the differential form of continuity equation in vector notation. In
Cartesian coordinates with usual notation of velocity components (i.e. v ui vj wk vi i i ),
the continuity equation becomes

u v w vi
0 (5.5)
t x y z t xi
The differential form (5.4) or (5.5) can be also derived by considering mass conservation for
an infinitesimal differential control volume (see Example 5.1 below). Expanded form of
continuity equation in cylindrical polar and spherical polar coordinates can be found in any
text on fluid mechanics, e.g. Kundu and Cohen (2008) and Panton (2005).

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L5.1


COMPUTATIONAL FLUID DYNAMICS: Continuity Equation

Example 5.1
Derive the differential form of continuity equation using an infinitesimal differential control
volume in Cartesian coordinates.

Solution
Let us consider flow of a fluid through an infinitesimal differential control volume of
dimensions dx, dy and dz. For the sake of clarity, Figure 5.1 depicts the flow through a two-
dimensional control volume. The mass flow rate of fluid entering from the left face (negative
x-face) of the CV is udydz and the mass flow rate leaving the positive x-face of the CV is
u
u dx dydz. Further, the mass flow rate entering from the bottom face (negative y-
x
face) of the CV is vdxdz and the mass flow rate leaving the top face (positive y-face) of the
v
CV is v dy dxdz. Therefore,
y
u
Net mass efflux rate through x-faces = u dx dydz udydz
x
u
= dxdydz
x
v
Net mass efflux rate through y-faces = v dy dxdz vdxdz
y
v
= d xd y d z
y

v
v dy
y y

u
u u dx
dy

x
dx

v
Figure 5.1 Mass fluxes through two-dimensional differential control volume

Similarly, for a three-dimensional control volume

w
Net mass efflux rate through z-faces = dxdydz
z
u v w
Hence, the net mass efflux rate = dxdydz
x y z

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L5.2


COMPUTATIONAL FLUID DYNAMICS: Continuity Equation


Rate of accumulation of mass inside the CV = dxdydz
t
For mass conservation, the rate of mass accumulation in the control volume must be negative
of the net mass efflux rate, i.e.
u v w
dxdydz dxdydz
t x y z
Dividing both sides by the differential volume dxdydz and transferring all the terms on one
side gives the following equation for mass conservation:
u v w
0
t x y z
which is same as the continuity equation (5.5) derived from the integral form of the continuity
equation.

Exercise 5.1: Derive the differential form of continuity equation in polar coordinates by take
an infinitesimal control volume in (a) cylindrical polar coordinates and (b) spherical polar
coordinates.

REFERENCES

Kundu, P. K. and Cohen, I. M. (2008). Fluid Mechanics, 4th Ed., Academic Press.
Panton, R. L. (2005). Incompressible Flow, 3rd Ed., Wiley.

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L5.3


COMPUTATIONAL FLUID DYNAMICS: Momentum Equation

Lecture 6
MOMENTUM EQUATION

6.1 MOMENTUM EQUATION: INTEGRAL FORM


Newtons second law of motion states that the rate of change of linear momentum for a
material region (system) is equal to the sum of external forces acting on the system. For a
particle of mass dm, this law can written as
d
dF vdm , dm = d (6.1)
dt
Hence, for a finite material region, this law takes the form
d dP

dt
v d F or
dt
F (6.2)

where P is the linear momentum of the system. The intensive property corresponding to P is
v . Hence, from Reynolds transport theorem for a fixed control volume
dP
t
vd vv dA (6.3)
dt

S
Rate of change of Rate of efflux of momentum
momentum in the CV across the control surface

Net force F on the control volume can be expressed as sum of the surface force, FS (pressure,
viscous stress), and body force, FB (gravity, electromagnetic, centrifugal, Coriolis etc.), i.e.
F FS FB (6.4)
The surface force FS essentially represents microscopic momentum flux across a surface and
can be expressed as
FS dA (6.5)
S

where is the stress tensor. Body force FB can be expressed as

FB b d (6.6)

where b is body force per unit mass. Combining (6.2)-(6.6), the integral form of momentum
equation can be written as

t
v d vv dA dA b d (6.7)

S S
Convective flux Diffusive flux

Note that since momentum is a vector quantity, its convective and diffusive fluxes are the
scalar products of second order tensors vv and with the surface vector dA.

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L6.1


COMPUTATIONAL FLUID DYNAMICS: Momentum Equation

6.2 MOMENTUM EQUATION: DIFFERENTIAL FORM


For a fixed control volume, order of temporal differentiation and integration in Eq. (6.7) can
be interchanged. Transform the convective and diffusive terms using Gauss divergence
theorem, i.e.
( v)

t
vd

t
d, vv dA ( vv)d and dA d (6.8)
S S

Substitution of Eq. (6.8) into Eq. (6.7) yields

( v)
. vv . b d 0 (6.9)

t
Equation (6.9) holds for any control volume which is possible only if the integrand vanishes
everywhere, i.e.
( v)
. vv . b (6.10)
t
Equation (6.10) is referred as the conservative or strong conservation form of momentum
equation. It is also known as Cauchy equation of motion.

The integral form of momentum equation (6.7) or its differential form represented by
Eq. (6.10) is applicable to an inertial control volume. Similar forms can be derived for
moving control volumes and non-inertial reference frames (Batchelor 1973, Panton 2005,
Kundu and Cohen 2008).

Further, using the identity


vv v v v v (6.11)

and chain rule of differentiation, we get

( v) v
. vv . v v v v
t t t
Using continuity equation (5.4), the first term on the RHS of the preceding equation vanishes.
Thus, Eq. (6.10) takes the following form:
v Dv
v v . b or . b (6.12)
t Dt

where the operator (D/Dt) denotes the material or particle derivative. Equation (6.12) is
referred to as the non-conservative form of the momentum equation.

Example 6.1
Derive the differential form of the momentum equation using an infinitesimal differential
control volume in Cartesian coordinates.

Solution
Let us consider flow of a fluid through an infinitesimal differential control volume of
dimensions dx, dy and dz. For the sake of clarity, Figure 6.2 depicts the flow through a three-

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L6.2


COMPUTATIONAL FLUID DYNAMICS: Momentum Equation

dimensional control volume, and the forces acting on the surfaces of the control volume in x-
direction only. The resultant force in x-direction is

Fx bx dxdydz xx xx dx xx dydz
x
yx
yx dy yx dxdz + zx zx dz yx dxdy
y z
yx zx
= bx xx dxdydz
x y z
Similarly, components of the resultant force in y- and z-directions are

xy yy zy
Fy by dxdydz
x y z
yz zz
Fz bz xz dxdydz
x y z

Figure 6.2 Forces acting on the faces of a differential control volume (only the x-components
are shown in the figure for clarity)

From Reynolds transport theorem,

dP Rate of change of Rate of efflux of momentum



dt momentum in the CV across the control surface
( dxdydzv ) ( v )
Rate of change of the momentum in CV = dxdydz
t t
Rate of efflux of momentum in x-direction is given by

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L6.3


COMPUTATIONAL FLUID DYNAMICS: Momentum Equation

Rate of momentum u u
u dx dydz u dx ( udydz )u
efflux in x-direction x x
v u dy u dy
+ v dy dxdz u -( vdxdz ) u
y y 2 y 2
w u dz u dz
+ w dz dxdy u -( wdxdy ) u
z z 2 z 2
u u v u w u
u u u v u w dxdydz
x x y y z z
uu uv uw
dxdydz
x y z
Similarly, rate of momentum efflux in y- and z-directions are

Rate of momentum uv vv vw
dxdydz
efflux in y -direction x y z
Rate of momentum uw vw ww
dxdydz
efflux in z -direction x y z

From Newtons second law, DP/Dt = F. The x-component of this equation is

DPx ( u ) uu uv uw
dxdydz dxdydz
Dt t x y z
yx zx
= Fx bx xx dxdydz
x y z
which can be simplified to obtain the x-component of momentum equation. We can similarly
obtain y- and z-components of the momentum equation, and these equations are given by

( u ) uu uv uw yx zx
bx xx
t x y z x y z
( v) uv vv vw xy yy zy
by
t x y z x y z
( w) uw vw ww yz zz
bz xz
t x y z x y z

The preceding equations represent the conservation form of the momentum equation. Non-
conservation form can be obtained using alternative form of the Newtons second law given
by
Dv
ma ( dxdydz ) F
Dt
Thus,
Du yx zx
max ( dxdydz ) Fx bx xx dxdydz
Dt x y z

Simplification of the preceding equation and similar equations for y and z-components leads
to the non-conservation form of momentum equation in Cartesian component form given by
the following set of scalar equations:

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L6.4


COMPUTATIONAL FLUID DYNAMICS: Momentum Equation

Du yx zx
bx xx
Dt x y z
Dv xy yy zy
by
Dt x y z
Dw yz zz
bz xz
Dt x y z

Exercise 6.1: Derive the differential form of momentum equation in polar coordinates by
take an infinitesimal control volume in (a) cylindrical polar coordinates and (b) spherical
polar coordinates.

REFERENCES
Batchelor, G. K. (1973). An Introduction to Fluid Dynamics. Cambridge University Press,
Cambridge.
Kundu, P. K. and Cohen, I. M. (2008). Fluid Mechanics, 4th Ed., Academic Press.
Panton, R. L. (2005). Incompressible Flow, 3rd Ed., Wiley.

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L6.5


COMPUTATIONAL FLUID DYNAMICS: Navier-Stokes Equations

Lecture 7
NAVIER-STOKES EQUATIONS

7.1 NAVIER-STOKES EQUATIONS


Momentum (Cauchy) equation
( v)
. vv . b (6.10)
t
contains nine additional unknowns (the elements of the stress tensor ). Hence, we need a
relation between stress tensor and velocity field v to reduce the momentum equation in
terms of primary unknowns of the flow field. For a fluid, this relationship (which is called
constitutive relation) relates the stress tensor to the rate of strain tensor S by the following
general functional form:
1
f (S, S , S
,....), v v
T
S (7.1)
2
For a general fluid, number of tensor parameters of the function f(..) would depend on the
memory of the fluid. For example, for a second order fluid with memory (a visco-elastic
fluid):
pI 1S 2S2 3S (7.2)
where p is thermodynamic pressure and s are material properties dependent on
thermodynamic state of the fluid.

Most of the common fluids (e.g. air, water, and gases) have little or no memory, and the
stress-strain rate relationship is linear. Such fluids are called Newtonian fluids for which
constitutive relationship becomes (Panton, 2005)
p I ( v ) I 2 S (7.3)

where and are fluid properties (called viscosities). For a wide class of Newtonian fluids,
the bulk viscosity, 3 2 , is quite small, i.e. 3 2 0. This is called the Stokes
hypothesis, and leads to the following constitutive relation for Newtonian fluids:
1
pI 2 S ( v)I (7.4)
3
where is the (dynamic) viscosity of the fluid. Substitution of relation (7.4) into momentum
equation (6.10) leads to the so-called Navier-Stokes equation in conservation form given by
( v) 1
. . vv b p 2. S ( v)I (7.5)
t 3
Non-conservation form of Navier-Stokes equation can be obtained by substituting Eq. (7.4)
into Eq. (6.12) and is given by
v 1
v v b p 2. S ( v)I (7.6)
t 3

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L7.1


COMPUTATIONAL FLUID DYNAMICS: Navier-Stokes Equations

Cartesian form of Navier-Stokes equations (7.5):


( vi ) ( v j vi ) 2 v j vi v j
bi p (7.7)
t x j xi 3 x j x j x j xi
For incompressible flow, v 0. Hence, Navier -Stokes equation reduces to
v 1 2
. vv b p . S (7.8)
t
In addition, if the temperature variations in an incompressible flow are small, the viscosity of
the fluid can be assumed constant, and Eq. (7.8) simplifies to
v 1
. vv b p 2 v (7.9)
t
where ( / ) is the kinematic viscosity. In Cartesian coordinates, Eq. (7.9) takes the
form
vi (v j vi ) 1 p 2 vi
bi (7.10)
t x j xi x j x j

7.2 EULER EQUATION


For high speed flows (e.g. flow over an aircraft), effects of viscosity are usually very small
away from solid boundaries. If effects of viscosity are neglected altogether, then pI and
momentum equation reduces to Euler equation
( v)
. vv b p (7.11)
t
Euler equation is often used to study compressible flow at high Mach numbers. Neglect of
viscosity permits use of coarser grids near the solid surfaces. Thus, use of Euler equation
allows the simulation of flow over the whole aircraft.

7.3 CREEPING FLOW: STOKES EQUATION


If the Reynolds number is very small (i.e. flow velocity is very small, the fluid is very
viscous, or the geometric dimensions are very small), the nonlinear convective terms in the
Navier-Stokes equation can be neglected. Such flows, which are dominated by pressure, body
force and viscous forces, are called creeping flow. Because of low velocity, unsteady terms
can also be neglected and the momentum equation takes the following form:

2 v b p 0 (7.12)

REFERENCES
Batchelor, G. K. (1973). An Introduction to Fluid Dynamics. Cambridge University Press,
Cambridge.
Kundu, P. K. and Cohen, I. M. (2008). Fluid Mechanics, 4th Ed., Academic Press.
Panton, R. L. (2005). Incompressible Flow, 3rd Ed., Wiley.

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L7.2


COMPUTATIONAL FLUID DYNAMICS: Energy and Scalar Transport Equations

Lecture 8
ENERGY AND SCALAR TRASPORT EQUATIONS

8.1 ENERGY EQUATION


Conservation of energy principle states that energy of a system is always conserved. The
corresponding physical law is the first law of thermodynamics which states that
Time rate of increase Net rate of Net rate of energy
of the total stored energy addition addition by work ,
energy in the system by heat transfer done on the system

i.e.

DE Q W
(8.1)
Dt t t

where E denotes the total stored energy which consists of kinetic energy, potential energy and
internal energy. The potential energy usually represents the work done by the external force
field (i.e. body forces), and hence, this part can be accounted for by the second term on RHS
of Eq. (8.1). Hence, we take the stored energy E as the sum of the internal energy and kinetic
energy, and its specific measure (i.e. stored energy per unit mass) is given by
1 2
e v (8.2)
2
where e represents internal energy per unit mass. From Reynolds transport theorem, the rate
of increase of the stored energy is given by

DE
Dt t
d v dA (8.3)
S

Energy addition by heat transfer can be due to volumetric heat generation and heat transfer
across the surface of the control volume. Thus,
Q
t g
q d q dA (8.4)
S

where q g is the rate of volumetric heat generation and q is the surface heat flux.

Rate of work done is obtained by taking dot product of force with velocity vector. Note that
surface force is given by dot product of stress tensor by area vector. Thus, rate of energy
addition due to the work done on the system by body as well as surface forces is given by
W
t S
v ( dA) v ( b) d (8.5)

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L8.1


COMPUTATIONAL FLUID DYNAMICS: Energy and Scalar Transport Equations

Substitution of Eqs. (8.3)-(8.5) into Eq. (8.1) yields the integral form of the total energy
equation:

t
d v dA q g d q dA v ( dA) v ( b) d (8.6)
S S S

Using Gauss divergence theorem, the preceding equation leads to the following differential
equation for the total energy:
v dA ( v)d, q dA q d and v ( dA) ( v ) d (8.7)
S S S

Substitution of Eq. (8.7) into Eq. (8.6) yields


( )
t . v qg .q .( v ) v ( b) d 0 (8.8)

Equation (8.8) holds for any control volume which is possible only if the integrand vanishes
everywhere leading to the following differential equation for the total energy:

( )
. v q g .q .( v ) v ( b) (8.9)
t

To obtain the equation of thermal energy, we subtract the equation for mechanical energy
(which can be obtained by taking the dot product of velocity v with momentum equation
(6.10)) from the preceding equation. After some algebraic manipulation, we obtain the
equation for thermal energy given by
( e)
. ev q g .q v : (8.10)
t
where the double dot product is defined as
u j
v : ij (8.11)
xi
The last term in the thermal energy equation consists of the work done by pressure and
viscous dissipation. For the low speed flows (i.e. flow speeds are small as compared to the
speed of sound), viscous dissipation part is negligible. Pressure related term has the form
p.v and can be combined with the left hand side of Eq. (8.10) to give the following
equation:
DT
C p q g .q (8.12)
Dt
If the heat flux obeys the Fouriers law q k T , and thermal conductivity k is assumed
constant, Eq. (8.12) simplifies to
DT 1
q g 2T (8.13)
Dt C p

where k / Cp is the thermal diffusivity. Equation (8.13) is commonly referred as the


advection-diffusion equation for thermal energy.

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L8.2


COMPUTATIONAL FLUID DYNAMICS: Energy and Scalar Transport Equations

8.2 GENERALIZED SCALAR TRANSPORT EQUATION


In analogy with the conservation laws for mass, momentum and energy, conservation
principle for a generic scalar can be expressed as
Time rate of increase Net rate of Net rate of energy
of the scalar energy addition addition by work (8.14)
in the system by heat transfer done on the system

From Reynolds transport theorem,
Net rate of
Time rate of increase Rate of increase decrease due
of the scalar of inside the to convection (8.15)
in the system control volume across CV

boundary
Combination of Eq. (8.14) and (8.15) yields the following conservation law for a control
volume:

Net rate of Net rate of Net rate of


Rate of increase decrease due increase of creation of
of inside the to convection due to diffusion inside the (8.16)
control volume across CV across the CV control
boundary
boundary volume

The preceding statement can be represented by the integral equation



t
d v dA q dA q d (8.17)
S S

where q represents the volumetric generation (or source) term and q denotes the surface
flux associated with . Usually, the surface flux is related to by a gradient law (such as
Fouriers law for heat conduction, Ficks law for mass diffusion) which can be expressed as
q . Substituting this expression in Eq. (8.17) and use of Gauss divergence theorem
leads to the following differential equation for transport of :
( )
. v q ( ) (8.18)
t
In Cartesian coordinates, Eq. (8.18) takes the form


t

x j
v j
x j x j
q (8.19)

Preceding equation represents the conservation form of the transport equation. Expanding
terms on the left had side, and using the continuity equation, one can obtain the non-
conservation form of the transport equation given by

D
( v.) q ( ) (8.20)
Dt t

It can be easily observed that Eq. (8.19) [or Eq. (8.20)] can be made to represent the mass,
momentum or energy equation by proper choice of the flux and source terms. Thus, in this
course on CFD, we will first focus our discussion on the approximation techniques for the

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L8.3


COMPUTATIONAL FLUID DYNAMICS: Energy and Scalar Transport Equations

generic transport equation (8.19), and then discuss their application and extension to the
solution of Navier-Stokes equations.

Let us note that general form of all the conservation equations is similar: each equation
contains a temporal derivative, a convective term, a diffusive term and a source term. This
commonality is exploited in CFD while developing algorithms and computer programs to
solve the fluid flow and scalar transport problems. Further, all of these equations are coupled
nonlinear partial differential equations. Thus, analytical solution is very difficult (if not
impossible), and approximate numerical solution using techniques of CFD is required for
practical problems.

REFERENCES
Ferziger, J. H. And Peri, M. (2003). Computational Methods for Fluid Dynamics. Springer.
Kundu, P. K. and Cohen, I. M. (2008). Fluid Mechanics, 4th Ed., Academic Press.
Panton, R. L. (2005). Incompressible Flow, 3rd Ed., Wiley.

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L8.4


COMPUTATIONAL FLUID DYNAMICS: Classification of Governing Equations

Lecture 9
CLASSIFICATION OF GOVERNING EQUATIONS

9.1 INTRODUCTION
The governing equations of fluid flow (momentum, energy or scalar transport) are second
order partial differential equations (PDEs). Choice of the numerical solution technique and
number of initial/boundary conditions required for their solution depends on their
mathematical character. However, since these equations are system of coupled nonlinear
equations in four independent variables (time + three space coordinates), their mathematical
classification is rather difficult. Nevertheless, a classification of these equations is usually
applied to the linearized form of Navier-Stokes equations.

9.2 CLASSIFICATION OF QUASI-LINEAR PDES


Mathematical classification of quasi-linear PDEs is usually based on the classification
procedure evolved for a general second order PDE in two independent variables (say, x and y)
given by

2u 2u 2u u u
A B C D E Fu G 0 (9.1)
x 2
xy y 2
x y
where A, B, C, D, E, F and G are functions of x and y. Let us assume that A 0 and
B 2 4 AC is of uniform sign for the range of values of x and y of interest. Classification of
PDE (9.1) is based on the type of roots of the associated characteristic equation

2
dy dy
A B C 0 (9.2)

d x dx

Let r ( x, y ) and s ( x, y ) be the solutions of the preceding equation. Each of these is called a
characteristic. Existence of these roots depends on the value of the discriminant B 2 4 AC.
We list in Table 9.1 the type of the PDE for each of the three possible cases.

Table 9.1: Classification of quasi-linear second order PDEs


Discriminant Nature of characteristics Type of PDE
B 4 AC 0
2
Two real characteristics Hyperbolic
B 2 4 AC 0 One real characteristic Parabolic
B 2 4 AC 0 No real characteristics Elliptic

The type name for the PDE has been assigned in analogy with conic sections from analytical
geometry wherein the quadratic equation

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L9.1


COMPUTATIONAL FLUID DYNAMICS: Classification of Governing Equations

Ax 2 Bxy Cy 2 Dx Ey F 0
represents a hyperbola if B 2 4 AC 0 , a parabola if B 2 4 AC 0 and an ellipse if
B 2 4 AC 0 .
The classification of PDE tells us about physical behaviour of the problem. The
propagation of information (e.g. effect of disturbance introduced in a flow field) takes place
along the characteristics. It also sets the required number of initial/boundary conditions for
the given problem.

9.2.1 Hyperbolic Equations


In this case, information propagates at a finite speed along the characteristics. Further, any
disturbance introduced in the problem domain at a specific point affects the solution in a
limited region enclosed within the characteristics through that point. Equations of this type
usually appear in time-dependent processes with negligible energy dissipation and lead to
wave-type solutions. A typical hyperbolic equation is the wave equation given by
2u 2 u
2
c (9.3)
t 2 x 2
where c denotes the finite speed of wave propagation. The preceding equation requires
specification of two sets of initial conditions.

9.2.2 Parabolic Equations


Parabolic equations have only one real characteristic. Hence, these require only one set of
initial conditions. Further, information travels in only one direction along the characteristic.
Thus, these equations lend themselves to marching type solution schemes starting with the
given initial data. Parabolic equations usually describe time dependent problems which
involve significant amount of diffusion. The typical example is transient heat conduction in a
plane wall governed by
T 2T
2 (9.4)
t x
For the heat diffusion problem (9.4), initial conditions are required at time t = 0. In addition,
boundary conditions must be specified at both ends of the wall for all time t 0. Hence, this
problem is also called an initial-boundary value problem. To emphasize the requirement of
the boundary conditions, some prefer to classify the transient heat conduction equation (9.4)
as parabolic-in-time and elliptic in space.

9.2.3 Elliptic Equations


Elliptic equations have no real characteristics. Thus, there is no preferred direction for
information propagation, and information travels equally well in all the directions. As a
consequence, effect of a disturbance introduced anywhere in the problem domain will be felt
everywhere. Thus, one boundary condition is required at all the points on the boundary of the
problem domain. Hence, these equations are called boundary-value problems.

Elliptic equations usually represent steady state or equilibrium problems (unsteady


problems are never elliptic). The representative of the elliptic equation is the Laplace
equation given

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L9.2


COMPUTATIONAL FLUID DYNAMICS: Classification of Governing Equations

2 2
0 (9.5)
x 2 y 2
which may describe steady state heat conduction or potential flow problem.

9.3 CLASSIFICATION OF NAVIER-STOKES EQUATIONS


Navier-Stokes equations are coupled nonlinear partial differential equations in four variables.
For mathematical classification, we can look at their linearized form. The formal
classification for incompressible flows is as follows:
Steady viscous flows: elliptic.
Unsteady viscous flows: parabolic.

Energy equation has the same behaviour, i.e. it is elliptic for steady flows, and parabolic, for
time dependent problems. Unsteady Navier-Stokes and energy equations are in fact parabolic
in time and elliptic in space. Hence, solution of these equations requires (a) one set of initial
conditions, and (b) boundary conditions at all the boundary points for all values to time t > 0.
Compressible Navier-Stokes equations may be considered as mixed hyperbolic, parabolic and
elliptic (or incompletely parabolic) equations.

Note that elliptic equations are more difficult to solve than parabolic equations, which
lend themselves to marching type solution procedure. Thus, in practice, steady viscous flows
are usually converted to unsteady problems, and solved using a time marching scheme. The
solution obtained for large values of time t provides the desired solution of the steady viscous
flow problem.

9.3 CLASSIFICATION OF EULER EQUATION


Classification of inviscid flow equations governed by Euler equation is different from that of
Navier-Stokes or energy equations due to complete absence of the second order terms. The
classification of these equations depends on the extent of compressibility. Further, for
compressible flows, flow speed (Mach number, Ma) has a significant role in determining the
behaviour of the problem. The formal classification of the inviscid flows is as follows
(Anderson, 1995, Versteeg and Malalasekera, 2007):
Inviscid incompressible flows
o Steady flows: elliptic.
o Unsteady flows: parabolic.
Inviscid compressible flows
o Steady subsonic flows (Ma < 1): elliptic.
o Steady supersonic flows (Ma > 1): hyperbolic.
o Unsteady flows: hyperbolic.
Dependence of the flow behaviour on local Mach number makes the solution of
steady inviscid compressible flows pretty complicated. For example, let us consider high
speed flow around a bluff body. Even if the upstream Mach number Ma > 1, in the vicinity of
the solid surface, there exists a subsonic zone as the flow velocity goes to zero at the
stagnation point. Therefore, separate algorithms would be required for numerical simulation
of the problem in subsonic and supersonic zones (whose extent and boundaries are
themselves unknown). This situation has baffled aerodynamicist for a while in early 1960s. A
way out was provided by the time dependent approach to solve a steady problem (Moretti and

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L9.3


COMPUTATIONAL FLUID DYNAMICS: Classification of Governing Equations

Abbett, 1966), since the unsteady Euler equation for compressible flows is hyperbolic
everywhere (irrespective of the local Mach number). In fact this time dependent approach to
steady state is also widely used now for solution of steady state viscous flows.

REFERENCES
Anderson, J. D., Jr. (1995). Computational Fluid Dynamics: The Basics with Applications.
McGraw Hill, New York.
Ferziger, J. H. And Peri, M. (2003). Computational Methods for Fluid Dynamics. Springer.

Moretti, G. and Abbett, M. (1966). A time-dependent computational method for blunt body
flow. AIAA Journal, 4, 2136-2141.
Versteeg, H. K. and Malalasekera, W. M. G. (2007). Introduction to Computational Fluid
Dynamics: The Finite Volume Method. Second Edition (Indian Reprint) Pearson Education

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL L9.4


COMPUTATIONAL FLUID DYNAMICS: Classification of Governing Equations

Lecture 10
BOUNDARY CONDITIONS

10.1 BOUNDARY CONDITIONS FOR FLOW PROBLEMS


Partial differential equations obtained from conservation laws are the same for a particular
type of flow (compressible or incompressible) irrespective of the flow domain. The boundary
conditions act as the constraints, and establish the uniqueness of the flow field for a specified
problem. In numerical simulation, we come across two types of boundary conditions:

1. Physical boundary conditions which are imposed by the physical processes at the
bounding surfaces of the flow domain, and
2. Artificial boundary conditions which are specified at the boundaries of computational
domain which are not natural boundaries (sometimes referred to as the fluid
boundaries).

The artificial boundaries arise from the approximation of physical problem domain for
numerical simulation in both internal and external flows. For example, in simulation of flow
over an aircraft, its solid surface represents the natural physical boundary. Flow is otherwise
unbounded, i.e. flow domain is infinite. However, numerical simulation requires a finite
computational domain. Thus, artificial external boundaries must be chosen, and appropriate
values of flow parameters must be specified based on physical reasoning.

10.2 BOUNDARY CONDITIONS ON PHYSICAL BOUNDARIES


Boundary conditions on physical boundaries are straight forward. For viscous flows, relative
velocity at the solid surface is zero: this is called no-slip boundary condition. For energy
equation, a similar condition holds for the temperature (i.e. temperature of the fluid at the
wall is same as that of the solid wall). However, the wall temperature may not be known, and
instead heat flux may be specified. Thus, boundary conditions for viscous flow at solid wall
are:
v v w where v w is velocity of the solid surface (no-slip condition)
T Tw (specified wall temperature Tw ) or q qw (specified heat flux qw at the
wall).

For inviscid flows, the fluid can freely slip over the surface. However, there can be no
velocity component normal to the surface. This velocity boundary condition is called free slip
condition, and is given by
v n 0 where v n is velocity component normal to the solid surface.

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL 10.1


COMPUTATIONAL FLUID DYNAMICS: Classification of Governing Equations

10.3 BOUNDARY CONDITIONS ON ARTIFICIAL BOUNDARIES

Conditions on artificial or fluid boundaries can take variety of form: inlet, outflow,
symmetry, cyclic or periodic are few of the popular types of boundary conditions specified on
fluid boundaries. Details of these boundary conditions are:
Inlet: specified pressure, velocity, temperature and density as a function of
position.
Outflow boundary condition: specified pressure, v n / n 0, T / n 0.
Symmetry boundary condition: / n 0 for all flow variables .
Periodic boundary condition: 1 2 for all flow variables where subscripts 1
and 2 denote the periodic boundaries.

REFERENCES
Anderson, J. D., Jr. (1995). Computational Fluid Dynamics: The Basics with Applications.
McGraw Hill, New York.
Ferziger, J. H. And Peri, M. (2003). Computational Methods for Fluid Dynamics. Springer.

Versteeg, H. K. and Malalasekera, W. M. G. (2007). Introduction to Computational Fluid


Dynamics: The Finite Volume Method. Second Edition (Indian Reprint) Pearson Education

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL 10.2


COMPUTATIONAL FLUID DYNAMICS: FDM: METHODOLOGY & NOTATION

Lecture 11
FINITE DIFFERENCE METHOD: METHODOLOGY AND
GRID NOTATION

11.1 FINITE DIFFERENCE METHOD


The finite difference method (FDM) is the oldest method for numerical solution of partial
differential equations. Its first suggested application dates back to 18th century by Leonhard
Euler for solution of initial value problems (two suggested methods are popularly known as
forward Euler and backward Euler method). FDM has been very popular in CFD and its
development, analysis and applications are well documented in many text books such as
Anderson (1995), Ferziger and Peric (2003), Chung (2010).

Attractive features of FDM are:


It is the easiest method to use for simple geometries, both in terms of formulation and
programming.
It can also be adapted for problems in complex geometries using boundary fitted grids
or the concept of immersed boundaries.
Domain decomposition based solvers can be easily adapted for solution of algebraic
systems obtained from FDM, and thus, this method is uniquely suited for massively
parallel architectures.
These features have made FDM very popular in CFD. In this and next few lectures, we will
have a brief overview of the method and its applications to the generic transport problem,
which will enable the reader to understand the method, and apply it for solution of heat
transfer and fluid flow problems.

11.2 FDM: BASIC METHODOLOGY


Starting point for the finite difference method is the differential form of a conservation
equation of a continuum problem. The continuum problem is discretized by using finite
difference approximation of the derivatives in the governing differential equation(s) at a set
of finite discrete points (which are called nodes or grid points). The simulation procedure
based on finite difference method consists of the following steps:
Discretize the solution domain by a grid (i.e. a set of discrete points)
At each grid point, approximate the differential equation using finite difference
approximation of derivatives, and thus convert it into an algebraic equation.
At the boundary grid points, apply the boundary conditions. Any derivatives in
boundary conditions are replaced by one sided finite difference approximation
involving values at boundary and interior nodes.
Collect the algebraic equations at all the grid points --- interior as well as boundary ---
to obtain a system of algebraic equations in terms of unknown values of the variable
at these nodes.
Solve the resulting system of algebraic equation to obtain values of the variable at
each grid point.
The solution obtained at the grid points can be interpolated and processed to obtain the
desired physical quantities in the so-called post-processing step of the simulation.

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL 11.1


COMPUTATIONAL FLUID DYNAMICS: FDM: METHODOLOGY & NOTATION

11.3 FINITE DIFFERENCE GRID, NOTATION AND TERMINOLOGY


Finite difference formulation employs a structured grid in which each grid point (node) may
be considered as the origin of a local coordinate system whose axes coincide with grid lines.
Thus,
Two grid lines of the same family (say, xi ) do not intersect ,
Any pair of grid lines of two different families (say, x = constant, y = constant)
intersect only once.
Figures 11.1 and 11.2 depict typical finite difference grids for one and two-dimensional
problems respectively. Each grid line is identified by an integer index. The most commonly
used indices are i, j and k for grid lines x = xi, y = yj and z = zk respectively.

Each node is identified by a set of indices which are the indices of the grid lines that intersect
at it. Thus,
Node i represents the grid point x = xi in one dimension.
Node (i,j) represents the intersection point of grid lines x = xi and y = yj in 2-D.
Node (i,j,k) represents the intersection point of grid lines x = xi, y = yj and z = zk in
3D.

1 i-1 i i+1 M

Figure 11.1 One dimensional finite difference grid

j+1
(i,j)
j

j-1

1
1 i-1 i i+1 M
Figure 11.2 Two dimensional finite difference grid

A finite difference grid is called a uniform grid if the spacing between the grid lines of the
same family is constant, i.e. xi 1 xi xi xi 1 x, for all i. Similarly, for multi-dimensional

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL 11.2


COMPUTATIONAL FLUID DYNAMICS: FDM: METHODOLOGY & NOTATION

problems, y j 1 y j y j y j 1 y , j; zk 1 zk zk zk 1 z, k . The grid is otherwise


called non-uniform. In the latter case, the following notation is used to denote the grid
spacing in respective directions:
xi xi 1 xi , y j y j 1 y j , zk zk 1 zk . (11.1)

In view of the index notation for the grid points, the following short notations are commonly
used in finite difference equations for the function values at grid points:
For one dimensional problems, fi f xi .
For two-dimensional problems, f i , j f ij f xi , y j .
For three-dimensional problems, f i , j , k f ijk f xi , y j , zk .

Definition (Order of Magnitude)


A quantity g(x) is said to be of order hm ( m 0 ) denoted by g x ~ O h m if
f x
lim L where L is a finite quantity (Niyogi et al., 2005).
h 0 hm

11.4 FINITE DIFFERENCE APPROXIMATION


Basic idea of finite difference approximation comes from the definition of the derivative
f f xi x f xi
lim (11.2)
x xi x 0 x

which clearly indicates that an approximate value of the derivative can be obtained from the
finite difference expression given by
f f xi x f xi fi 1 fi
(11.3)
x xi x x
The preceding equation is commonly referred to as the forward difference approximation.
More refined finite difference approximations for the derivatives can be obtained using a
number of formal approaches. The two most popular approaches are:

1. Taylor series expansion


2. Polynomial fitting

Pade approximants offer another method, and are used to obtain higher order finite difference
approximations (Chung, 2010).

The finite difference approximation of a derivative at point is expressed in terms of function


values at the neighbouring points and spacing between these points (i.e. the grid spacing).
The error involved in the approximation is usually referred to as the truncation error.

Definition (Truncation Error)


Truncation error (TE) represents the sum of the terms in a Taylor series expansion which
were deleted in obtaining the approximation of the derivative.

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL 11.3


COMPUTATIONAL FLUID DYNAMICS: FDM: METHODOLOGY & NOTATION

Thus, the truncation error represents a correction term which if added to the finite difference
approximation can yield an exact value of the derivative at the point. On a uniform grid with
spacing x, the truncation error can be expressed as (Ferziger and Peric, 2003):

(x) m m 1 ( x) m 1 m 2 (x) m 2 m 3 ..... (11.4)

where s are higher order derivatives multiplied by constant factors. The leading power m of
x determines the order of accuracy of a finite difference approximation.

Definition (Order of Accuracy)


If the truncation error of a finite difference approximation is O x m , then it is said to
have the accuracy of order m (or be mth order accurate).

Conservation equations in fluid dynamics and heat transfer involve first and second order
derivatives. We, therefore, focus on the finite difference approximation of these derivatives in
the next two lectures.

REFERENCES
Anderson, J. D., Jr. (1995). Computational Fluid Dynamics: The Basics with Applications.
McGraw Hill, New York.
Chung, T. J. (2010). Computational Fluid Dynamics. 2nd Ed., Cambridge University Press,
Cambridge, UK.
Ferziger, J. H. And Peri, M. (2003). Computational Methods for Fluid Dynamics. Springer.

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL 11.4


COMPUTATIONAL FLUID DYNAMICS: FDM: Approximation of First Order Derivatives

Lecture 12
APPROXIMATION OF FIRST ORDER DERIVATIVES

12.1 INTRODUCTION
Convective term in conservation equations involve first order derivatives. The simplest
possible approach for discretization of these terms would be to use the approximation based
on the basic definition of the derivative. In this lecture, we learn systematic procedures to
obtain FD approximations based on Taylor series expansion and polynomial fitting for a
generic function f(x) of a generic variable x.

12.2 TAYLOR SERIES EXPANSION


A continuously differentiable function f(x) can be expanded in Taylor series about x xi as

f x xi f x xi n f H (12.1)
2 2 n

f x f xi x xi .....
x i 2! x 2 i n ! x n i
In series expansion, symbol H has been used to denote the higher order terms which have not
been indicated explicitly. Thus, function values at grid points xi 1 and xi 1 can be expressed as
f x x f
2 2
f i 1 f xi 1 f xi xi 1 xi i 1 i 2 H (12.2)
x i 2! x i
f x x f
2 2
fi 1 f xi 1 f xi xi 1 xi i 1 i 2 H (12.3)
x i 2! x i

Rearrangement of Eq. (12.2) yields

f fi 1 fi xi 1 xi 2 f
2 H (12.4)
x i xi 1 xi 2 x i

which gives us forward difference scheme (FDS) formally expressed as

f f i 1 f i
O xi (12.5)
x i xi
where xi xi 1 xi . Similarly, Eq. (12.3) yields the backward difference scheme (BDS)
given by
f f i fi 1
O xi 1 (12.6)
x i xi 1

where xi 1 xi xi 1. Subtracting Eq. (12.3) from Eq.(12.2), we obtain the central difference
scheme (CDS) given by the formula

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL 12.1


COMPUTATIONAL FLUID DYNAMICS: FDM: Approximation of First Order Derivatives

f i 1 fi 1 xi xi 1 xi 1 xi 2 f
2 2
f
2 H (12.7)
x i xi 1 xi 1 2 xi 1 xi 1 x i

Thus, finite difference approximations based on Taylor series expansion are:

f f f
FDS: i 1 i , Truncation Error ~ O x
x i xi 1 xi
f f f
BDS: i i 1 , Truncation Error ~ O x
x i xi xi 1
f f f
CDS: i 1 i 1 , Truncation Error ~ O x on non-uniform mesh
x i xi 1 xi 1

f fi 1 fi 1
, Truncation Error ~ O x 2 on uniform grid
x i 2x

Note that the truncation error of the first order FDS or BDS is given by
x 2 f
(12.8)
2 x2 i
The truncation error of the CDS is given by
x xi 1 2 f xi xi 1 3 f
2 2 3 3

CDS i 2 H (12.9)
2 xi xi 1 x i 6 xi xi 1 x3 i
Thus, although the truncation error for CDS is formally of the same order as FDS or BDS, the
magnitude of the truncation error for CDS is much smaller than FDS/BDS. In fact, on grid refinement,
the convergence of CDS becomes second order asymptotically (Ferziger and Peric, 2003).

Further, let us substitute the value of second order derivative from Eq. (12.2) into Eq.
(12.4). On rearrangement, we get

f f i 1 (xi ) 2 f i 1 (xi 1 ) 2 f i (xi 1 ) 2 (xi ) 2 xi xi 1 3 f


3 H (12.10)
x i xi xi 1 xi xi 1 6 x i

which has second order accuracy on any grid (uniform or non-uniform). It reduces to the
simpler form of CDS on uniform grids.

A general procedure on uniform grids

Let us define the difference approximation as (Chung, 2010)


f af i bf i 1 cfi 1 dfi 2 efi 2 ...
(12.11)
x i x
Coefficients a, b, c, d, e, . can be determined from Taylor series expansion for the function
values involved at the RHS around point xi. We illustrate its use in the following example.

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL 12.2


COMPUTATIONAL FLUID DYNAMICS: FDM: Approximation of First Order Derivatives

Example 12.1
Derive a three point backward difference formula on uniform grid using general procedure
given by equation (12.11).

Solution
For three point backward difference formula, Eq. (12.11) takes the following form:

f afi bf i 1 cfi 2
(i)
x i x

Taylor series expansions for fi 1 and f i 2 are


f x f x f
2 2 3 3
fi 1 fi x 2 3 .... (ii)
x i 2 x i 6 x i

f 2x f (2x) f
22 3 3
fi 2 f i 2x 2 3 .... (iii)
x i 2 x i 6 x i
Hence,
af i bfi 1 cfi 2 a b c f x 2 f
f i b 2c b 4c 2
x x x i 2 x i
(iv)
x 2 3 f
b 8c 3 ...
6 x i
Equations (i) and (iv) indicate that the following three conditions must be satisfied:
abc 0 (v)
b 2 c 1 (vi)
b 4c 0 (vii)
Solving Eqs. (v)-(vii), we get
a 3 / 2, b 2, c 1/ 2 (viii)

The truncation error (TE) is given by


x2 3 f x2 3 f
b 8c 3 3 (ix)
6 x i 3 x i

Therefore, the desired three-point backward difference formula is

f 3 f i 4 fi 1 f i 2
, TE ~ O x 2 (x)
x i 2x

Similarly, we can derive a three-point forward difference formula which is given by

f 3 f i 4 fi 1 f i 2
, TE ~ O x 2 (x)
x i 2x

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL 12.3


COMPUTATIONAL FLUID DYNAMICS: FDM: Approximation of First Order Derivatives

12.3 POLYNOMIAL FITTING


A generic function f(x) can be approximated by a polynomial as

f x a0 a1 x a2 x2 .... an xn (12.12)
or
f x a0 a1 x xi x a2 x xi ... an x xi
2 n
(12.13)
Coefficients a0, a1, a2,.., an are determined by fitting the interpolation curve to function values
at appropriate number of points. The second form given by Eq. (12.13) is usually preferred as
it directly provides the expression for derivatives at point xi, i.e.
f 2 f 3 f
a ,
1 2
2 a 2 , 3 6a3 , .... (12.14)
x i x i x i

The order of approximation of the resulting finite difference approximation can obtained
using Taylor series expansion. The following example illustrates the use of polynomial fitting
for derivation of finite difference approximation for the first order derivative.

Example 12.2
Derive a three point central difference formula on non-uniform grid using polynomial fitting
at points xi 1 , xi and xi 1 .

Solution
We can fit the following quadratic curve through three points xi 1 , xi and xi 1 :
f x a0 a1 x xi x a2 x xi2 (i)

The first order derivative at point xi is a1 . To obtain the value of a1 , we fit the interpolation
curve (i) to the function values at points xi 1 , xi and xi 1 , which results in the following set
of linear equations:

f i a0 (ii)
fi 1 fi a1 xi a2 xi
2
(iii)
f i 1 fi a1 xi 1 a2 xi 1
2
(iv)

Multiply Eq. (iv) by xi and subtract it from xi 1 Eq. (iii) to obtain


2 2

a1xi 1xi xi xi 1 xi2 f i 1 xi21 f i 1 f i xi21 xi (v)

Rearrangement of the preceding equation gives value of coefficient a1 , and thereby an


approximation for the first order derivative given by

f xi2 fi 1 xi21 fi 1 fi xi21 xi2


a (vi)
xi 1xi xi xi 1
1
x i

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL 12.4


COMPUTATIONAL FLUID DYNAMICS: FDM: Approximation of First Order Derivatives

The preceding formula is identical to that given by Eq. (12.10) derived earlier using Taylor
series expansion. Further, on a uniform grid, xi xi 1 x , Eq. (vi) (or Eq. (12.10))
reduces to the standard CDS formula
f f i 1 fi 1
(vii)
x i 2x
as expected.

Let us note that other polynomials, splines or shape functions can be used to
approximate the function, and thereby obtain an approximate formula for the derivative.
Using the procedure outlined above, we can obtain higher order approximations. For
example, by fitting a cubic polynomial to four points, the following third order
approximations can be obtained on a uniform grid (Ferziger and Peric, 2003):

f 2 fi 1 3 fi 6 fi 1 fi 2
O((x)3 ) (12.15)
x i 6x

f fi 2 6 fi 1 3 fi 2 fi 1
O((x)3 ) (12.16)

i
x 6 x
The preceding approximations are third order BDS and third order FDS respectively. These
schemes are very useful in convective transport problem where these are referred as upwind
difference schemes (UDS).

In general, approximation of the first derivative obtained using polynomial fitting has the
truncation error of the same order as the degree of polynomial (Ferziger and Peric, 2003).

REFERENCES
Chung, T. J. (2010). Computational Fluid Dynamics. 2nd Ed., Cambridge University Press,
Cambridge, UK.
Ferziger, J. H. And Peri, M. (2003). Computational Methods for Fluid Dynamics. Springer.

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL 12.5


COMPUTATIONAL FLUID DYNAMICS: FDM: Approximation of Second Order Derivatives

Lecture 13
APPROXIMATION OF SECOMD ORDER
DERIVATIVES

13.1 APPROXIMATION OF SECOND ORDER DERIVATIVES


Second order derivatives appear in diffusive terms of transport/conservation equations. To
obtain a finite difference approximation of the second derivative at a point, we can either use
the approximation of the first derivatives or extend any of the techniques described in the
previous lecture for the first order derivatives. We discuss application of each of these
approaches in the sequel.

13.2 USE OF APPROXIMATIONS OF FIRST ORDER DERIVATIVE


To obtain the second order derivative at a point, one may use approximation of first order
derivatives. For example, an approximation of the second order derivative can be obtained
using the forward difference formula
f f

f x i 1 x i
2

2 (13.1)
x i xi 1 xi
We can use a different formula (say, BDS) for the approximation of the first order derivatives
in the preceding equation which results in
fi 1 fi fi fi 1

f
2
xi 1 xi xi xi 1 fi 1 xi xi 1 fi 1 xi 1 xi fi xi 1 xi
2 (13.2)
x i xi 1 xi xi 1 xi xi xi 1
2

On a uniform grid, Eq. (13.2) reduces to

2 f f i 1 fi 1 2 fi
2 (13.3)
x i x
2

Approximation (13.1) is first order accurate. A better approximation for the second order
derivative can be obtained using CDS at points halfway between nodes, i.e.

f f
1 1
2 f x i 2 x i 2
2 (13.4)
x i xi 1 xi 1
2 2

CDS is also used for approximation of the first order derivatives in Eq. (13.4), i.e.

f f i 1 f i f f i f i 1
1 and 1 (13.5)
x i 2 xi 1 xi x i 2 xi xi 1

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL 13.1


COMPUTATIONAL FLUID DYNAMICS: FDM: Approximation of Second Order Derivatives

Substitution of Eq. (13.5) into Eq. (13.4) yields the following formula for the second order
derivative

2 f fi 1 xi xi 1 fi 1 xi 1 xi fi xi 1 xi 1
2 1
(13.6)
x i xi 1 xi 1 xi 1 xi xi xi 1
2

On a uniform grid, Eq. (13.6) reduces to Eq. (13.3).

13.3 TAYLOR SERIES EXPANSION


Using Taylor series expansion about x xi , function values at grid points xi 1 and xi 1 can be
expressed as
f x x f x x f
2 2 3 3

fi 1 fi xi 1 xi i 1 i 2 i 1 i 3 H (13.7)
x i 2! x i 3! x i
f x x f x x f
2 2 3 3

fi 1 fi xi xi 1 i i 1 2 i i 1 3 H (13.8)
x i 2! x i 3! x i

Multiply Eq. (13.8) by xi 1 xi and add it to xi xi 1 Eq. (13.7) to eliminate the first
order derivative. Rearrangement of the resulting equation leads to the following relation for
the second order derivative:

2 f fi 1 xi xi 1 fi 1 xi 1 xi f i xi 1 xi 1
2 1
x i xi 1 xi 1 xi 1 xi xi xi 1
2 (13.9)
1 3 f
xi 1 xi xi xi 1 3 H
3 x i
which is identical to Eq. (13.6) obtained using CDS. The leading term in the truncation error
of preceding approximation is formally of first order on a non-uniform grid, and of second
order on uniform grids. However, even for a non-uniform grid, the truncation error is reduced
as in a second order scheme with the grid refinement (Ferziger and Peric, 2003).

A general procedure on uniform grids

On uniform grids, we can define the difference approximation for the second order derivative
as (Chung, 2010)

2 f af i bf i 1 cf i 1 dfi 2 ef i 2 ...
2 (13.10)
x i x 2

Coefficients a, b, c, d, e, . can be determined from Taylor series expansion for the function
values involved at the RHS around point xi. Using this approach, the three point central
difference formula (13.3) can be derived starting with the relation

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL 13.2


COMPUTATIONAL FLUID DYNAMICS: FDM: Approximation of Second Order Derivatives

2 f af i bf i 1 cf i 1
2 (13.11)
x i x 2
Taylor series expansion for f i 1 and f i 1 lead to the following relation:
afi bfi 1 cfi 1 (a b c) (c b) f (b c) 2 f
fi
x 2 x 2 x x i 2 x 2 i
(13.12)
x 3 f x 2 4 f
(c b) 3 (b c) ....
6 x i 24 x 4 i
From the preceding equation, it is clear that Eq. (13.11) will represent an approximation for
the second order derivative if and only if a b c 0, b c 0 and b c 2. Clearly,
b c 1 and a 2. Thus, we obtain the following central difference approximation

2 f f i 1 f i 1 2 f i x 2 4 f
2 (13.13)
x i x 12 x 4 i
2

which is second order accurate. Similarly, we can derive the following one-sided formula

2 f fi 2 fi 1 fi 2 3 f
2 x 3 (13.14)
x i x x i
2

which is only first order accurate (Chung, 2010). Further, using this approach, we can easily
derive a higher order central difference approximation using function values at five points
(for details, see Example 13.1 below) given by

f 30 f i 16( f i 1 f i 1 ) ( f i 2 f i 2 )
O x 4 (13.15)
x i 12x 2

Example 13.1
Derive a five point central difference formula for the second order derivative on uniform grid
using Taylor series expansion and Eq. (13.10).
Solution
Five point central difference formula for the second order derivative can expressed as

2 f afi bf i 1 cf i 1 dfi 2 ef i 2
2 (i)
x i x 2
Taylor series expansions for f i 2 , f i 1 , f i 1 and fi 2 , we get

af i bf i 1 cfi 1 df i 2 ef i 2 a b c d e b c 2d 2e f
fi
x 2
x 2
x x i
1 2 f x 3 f
b c 4d 4e 2 b c 8d 8e 3
2 x i 6 x i
(ii)
x 2 4 f x 3 5 f
b c 16d 16e 4 b c 32d 32e 5
24 x i 120 x i
x 4 6 f
b c 64d 64e 6 H
720 x i

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL 13.3


COMPUTATIONAL FLUID DYNAMICS: FDM: Approximation of Second Order Derivatives

Equations (i) and (iv) indicate that the coefficients in Eq. (i) must satisfy the following
conditions:
a bcd e 0 (iii)
b c 2 d 2e 0 (iv)
b c 4 d 4e 2 (v)
b c 8 d 8e 0 (vi)
b c 16 d 16e (vii)
Solving Eqs. (v)-(vii), we get
a 5 / 2, b c 4 / 3, d e 1/ 12 (viii)

The truncation error (TE) is given by


x4 6 f x4 6 f
b c 64d 64e 6 6 (ix)
720 x i 90 x i
Therefore, the desired five-point central difference formula is

f 30 fi 16( fi 1 fi 1 ) ( fi 2 f i 2 )
, TE~O x 4 (x)
x i 12x 2

13.4 POLYNOMIAL FITTING


For any function, an interpolating polynomial of degree n can be fit using function values at
(n 1) data points and approximation to all derivatives up to order n can be obtained by
differentiation.
Use of quadratic interpolation loads to three point CDS formula (13.3) or (13.13) for
the second order derivative.
In general, truncation error of the approximation to second order derivative obtained
by fitting a polynomial of degree n is of order ( n 1 ).
One order is gained (i.e., truncation error is of order n) if grid spacing is uniform and
an even-order polynomials is used. For example, polynomial of degree 4 on uniform
grid leads to the fourth order accurate formula given by Eq. (13.15).

Example 13.2
Derive Eq. (13.15) by fitting a polynomial of degree 4 on uniform grid. Also obtain the
corresponding approximations for the first, third and fourth order derivatives.
Solution
To obtain a central difference approximation, we can fit the following 4th degree polynomial
through five points xi 2 , xi 1 , xi , xi 1 and xi 2 :

f x a0 a1 x xi x a2 x xi a3 x xi a4 x xi
2 3 4
(i)
Formal differentiation of the preceding equation leads to the following relations:

f 2 f 3 f 4 f
a1 , 2 2a2 , 3 6a3 , 4 24a4 (ii)
x i x i x i x i

To obtain the values of coefficients ai , we fit the interpolation curve (i) to the function values
at points xi 2 , xi 1 , xi , xi 1 and xi 2 , which results in the following set of linear equations:

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL 13.4


COMPUTATIONAL FLUID DYNAMICS: FDM: Approximation of Second Order Derivatives

f i a0 (iii)
fi 2 fi a1 2x a2 2x a3 2x a2 2x
2 3 4
(iv)
fi 1 fi a1 x a2 x a3 x a2 x
2 3 4
(v)
fi 1 fi a1 x a2 x a3 x a2 x
2 3 4
(vi)
fi 2 fi a1 2x a2 2x a3 2x a2 2x
2 3 4
(vii)

Solution of simultaneous Eqs. (iv)-(vii) yields the following values for coefficients ai:

fi 2 8 fi 1 8 fi 1 fi 2 fi 2 16 fi 1 30 fi 16 fi 1 fi 2
a1 , a2
12x 24x 2
(viii)
f 2 fi 1 2 fi 1 fi 2 f 4 fi 1 6 fi 4 fi 1 fi 2
a3 i 2 , a4 i 2
12x3 24x 4

Thus, approximations for the derivatives obtained from two-sided 4th degree polynomial
fitting on a uniform grid are

f f i 2 8 f i 1 8 f i 1 f i 2
a1 (ix)
x i 12x
2 f f i 2 16 f i 1 30 fi 16 f i 1 f i 2
2 2 a2 (x)
x i 12x 2
3 f f i 2 2 f i 1 2 f i 1 f i 2
3 6a3 (xi)
x i 2 x 3
4 f f i 2 4 f i 1 6 f i 4 f i 1 f i 2
4 24a4 (xii)
x i x 4

Equation (x) is the same as Eq. (13.15) derived earlier using Taylor series expansion.

13.5 APPROXIMATION OF SECOND ORDER DERIVATIVE IN


GENERIC TRANSPORT EQUATION
The diffusion term in the generic conservation equation involves a second order derivative of
the form ( / x ) / x. If is constant, this term becomes ( 2 / x 2 ) and finite
difference approximations in the preceding section can be used. Otherwise, we have to
employ suitable finite difference approximations for the first order derivatives for inner and
outer derivatives. The most popular approach is to employ the central difference
approximation for both the inner and outer derivatives. Let us use the values of the inner first
order derivative at points mid-way between the nodes and central difference formula to
obtain the approximation for the outer derivative given by

1 1
x i 2 x i 2
x x
(13.16)
i
xi 1 xi 1
2 2

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL 13.5


COMPUTATIONAL FLUID DYNAMICS: FDM: Approximation of Second Order Derivatives

Central difference approximation of the first order derivatives on RHS of the preceding
equation are

i 1 i i i 1
1 and 1 (13.17)
x i xi 1 xi x i xi xi 1
2 2
Combining Eq. (13.16) and Eq. (13.17), we get

i 1 i 1 i i 1 i i 1

2
xi 1 xi 2
xi xi 1
x x 1
(13.18)
i xi 1 xi 1
2

On a uniform grid, the preceding equation simplifies to


i 12 i 1 i i 12 i i 1
x x (x) 2
(13.19)
i

Note that if is a function of , values at a point midway between the nodes can be evaluated
using simple average of function values at the neighbouring nodes, i.e.

1 1
1 i 1 i , ( xi 1 xi ) (13.20)
i
2 2 2

Other approximations can be easily obtained using different finite difference approximations
for the inner and outer derivatives.

REFERENCES
Chung, T. J. (2010). Computational Fluid Dynamics. 2nd Ed., Cambridge University Press,
Cambridge, UK.
Ferziger, J. H. and Peri, M. (2003). Computational Methods for Fluid Dynamics. Springer.

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL 13.6


COMPUTATIONAL FLUID DYNAMICS: FDM: Multi-dimensional Derivatives

Lecture 14
MULTIDIMENSIONAL DERIVATIVES

14.1 MULTIDIMENSIONAL FINITE DIFFERENCE FORMULAE


Multidimensional finite difference formulae can be easily written using one dimensional
formulae. For example, the formulae for first order derivative using forward difference
scheme (FDS) are

f fi 1, jk f ijk
O x (14.1)
x i , j , k x
f f fijk
i , j 1, k O y (14.2)
y i , j ,k y
f f f
i , j ,k 1 ijk O z (14.3)
z i , j ,k z
Similarly, second order central difference formulae for the second order derivatives are:

2 f f i 1, jk fi 1, jk 2 f ijk
2 O x 2 (14.4)
x ijk x
2

2 f fi , j 1,k f i , j 1,k 2 f ijk


2 O y 2 (14.5)
y
2
y ijk
2 f fi , j ,k 1 fi , j , k 1 2 f ijk
2 O z 2 (14.6)
z ijk z
2

14.2 APPROXIMATION OF MIXED DERIVATIVES


In thermo-fluid problems, mixed derivatives are encountered in two situations: (a) heat
conduction in anisotropic medium, and (b) the transport equations expressed in non-
orthogonal coordinate systems. Mixed derivatives can be treated by combining one
dimensional approximation in the same way as described earlier for second order derivative.
For example, the mixed derivative 2 f / xy can be re-written as

2 f f
(14.7)
xy x y

Using CDS for approximation of the outer derivative, we obtain

f f
y
2 f i 1, j y i 1, j
O x 2 (14.8)
xy i , j 2x

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL 14.1


COMPUTATIONAL FLUID DYNAMICS: FDM: Multi-dimensional Derivatives

We can also use CDS for approximation of f / y , i.e.

f fi 1, j 1 f i 1, j 1 f fi 1, j 1 f i 1, j 1
O y 2 , O y 2 (14.9)
y i 1, j 2 y y i 1, j 2 y

Combining Eq. (14.8) and Eq. (14.9), we get

2 f fi 1, j 1 fi 1, j 1 fi 1, j 1 fi 1, j 1
O x 2 , y 2 (14.10)
xy i , j 4xy

14.3 IMPLEMENTATION OF BOUNDARY CONDITIONS


Numerical solution of a partial differential equation (PDE) using FDM requires finite
difference approximation of the PDE at every interior grid point. Further, boundary
conditions specified on the domain boundaries must be imposed to obtain a unique solution
of the continuum problem. The boundary conditions of the Dirichlet-type (i.e. specified value
of the variable) can be incorporated directly. However, the boundary conditions which
involve the gradient of a variable would require the use of one sided difference formulae
(forward or backward, depending on the location of the boundary node) for approximation of
derivatives at the boundary. For example, at the boundary node x1 the simplest approximation
of the derivative is given by the forward difference scheme

f f 2 f1
(14.11)
x 1 x2 x1

which is first order accurate. For more accurate approximation, we can use higher order one-
sided difference formulae involving function values at the boundary node and interior grid
points. For instance, use of quadratic polynomial fit involving function values at boundary
point x1 and interior nodes x2 and x3 leads to the following second order approximation
(Ferziger and Peric, 2003):

f ( x2 x1 ) f 3 ( x3 x1 ) f 2 ( x3 x1 ) ( x2 x1 ) f1
2 2 2 2

(14.12)
x 1 ( x2 x1 )( x3 x1 )( x3 x2 )

On a uniform grid, the preceding approximation reduces to

f 3 42 31
(14.13)
x i 2x

One-sided difference formulae (14.11)-(14.13) would also be useful in post processing, e.g.
in evaluation of heat flux from computed temperature field.

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL 14.2


COMPUTATIONAL FLUID DYNAMICS: FDM: Multi-dimensional Derivatives

14.4 FINITE DIFFERENCE DISCRETE ALGEBRAIC SYSTEM


Finite difference approximation of derivatives in a partial differential equation (PDE) leads to
an algebraic equation at each node in terms of the variable values at the node and its
neighbouring nodes. This equation is linear for a linear PDE, and non-linear for non-linear
PDEs. In the latter case, the non-linear equation would require linearization in the process of
its numerical solution. This quasi-linear equation obtained from the finite difference
discretization of a PDE of a generic scalar at a grid point can be represented as (Ferziger
and Peric, 2003)
APP All QP (14.14)
l
where index P represents the node at which the PDE is approximated and l denotes the
neighbouring node involved in finite difference approximation. Coefficients Al and AP are
functions of grid size and material properties. The node P and its neighbours form the so-
called computational molecule (or stencil). In the finite difference and the finite volume
methods, compass notation is usually employed, i.e. for a node i, j , node i 1, j is
denoted by E (eastern neighbour), node i, j 1 is denoted by S (southern neighbour), and so
on. Figure 9.5 depicts the computational molecules in 1D and 2D.

W P E
Figure 9.5 Central difference computational molecules (1D and 2D)

Collection of algebraic equation (14.14) at all the computational nodes leads to a system of
algebraic equations given by
A Q (14.15)
where A is the coefficient matrix, is the vector of unknown nodal values of and Q is the
vector containing terms on RHS of Eq. (14.14). Matrix A is sparse. However, its structure
depends on ordering of variables in vector .

For structured grids, variables are usually ordered starting from a corner and
traversing line after-line in a regular manner. This ordering scheme is called lexicographic
ordering and results in a poly-diagonal structure for matrix A. Note that this ordering is not
unique as it depends on the order of line traversal in different directions. For example, if we
start ordering the entries in vector starting from southwest corner of the domain, proceed
eastward along each grid line, and then northward across the domain, we get the ordering of
indices as given in Table 14.1.

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL 14.3


COMPUTATIONAL FLUID DYNAMICS: FDM: Multi-dimensional Derivatives

Table 14.1 Conversion of i, j, k grid indices to one dimensional storage locations in vector
.

Grid location Compass notation Storage location


i, j , k P l k 1 Ni N j j 1 Ni 1
i 1, j , k W l 1
i 1, j , k E l 1
i, j 1, k S l Ni
i, j 1, k N l Ni
i, j , k 1 B l Ni N j
i, j , k 1 T l Ni N j

Because matrix A is sparse and has a poly-diagonal structure for structured grids, it is
preferable to store it as a set of one dimensional arrays instead of a full two-dimensional
array. We can use the directional connection in naming these 1D arrays (calling them as
AP , AW etc.), and thus write the algebraic equation (14.14) for a two dimensional problem as
AWW ASS APP ANN QP (14.16)

At present, most of the programming languages (including Fortran 90) support user-
defined data types. An alternative storage scheme for matrix A can be adopted using records
or structure data types wherein the matrix A is stored as an array of records (or struct). Each
element of this record contains the number of modes connected to a given node, nodal
connectivity (i.e. indices of neighbouring nodes) and corresponding matrix entries. This
scheme can be used not only for the system matrix arising from finite difference
discretization on structured grids, but also for the matrix resulting from finite volume/finite
element method on structured as well as unstructured grids. A sample implementation of
such a record in C is as follows:

struct Matrix
{
int nn; // number of neighbours of the node
double AP; // matrix entry AP
double *AL; // array to hold coefficients Al
int *nc; // array to hold connectivity information
}

On structured grids, we can omit storage of connectivity information by adopting an implicit


indexing for neighbouring nodes.

Note that the indexing scheme described above is primarily required if one plans to
use a direct solver which require specification of an algebraic system in the standard form Ax
= b. In practical CFD applications, large size of the system matrix normally dictates use of
iterative solvers (even for linear systems).

REFERENCE
Ferziger, J. H. And Peri, M. (2003). Computational Methods for Fluid Dynamics. Springer.

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL 14.4


COMPUTATIONAL FLUID DYNAMICS: FDM: Applications to Scalar Transport Problems

Lecture 15
APPLICATIONS OF FDM TO SCALAR TRANSPORT
PROBLEMS

15.1 ONE DIMENSIONAL HEAT CONDUCTION


Let us consider steady state heat conduction in a slab of width L with thermal conductivity k
and heat generation qg . The governing equation for this problem is
2T
k qg 0 (15.1)
x 2
Suppose that the left end of the slab is maintained at constant temperature and the right end of
the slab is losing heat by convection to surroundings. Thus, boundary conditions are

T 0 T (15.2)
dT
k h T Ta (15.3)
dx x L

where T is specified temperature, h is convection heat transfer coefficient and Ta is ambient


temperature.

For finite difference formulation, let us use a uniform grid of size x L / N where N
denotes the number of divisions in the grid. Thus, there are (N+1) grid points. Using CDS for
approximation of the second order derivative, discretized form of Eq. (15.1) at an internal
node x xi becomes
Ti 1 Ti 1 2Ti qg ,i q g , i x 2
0 or Ti 1 2Ti Ti 1 (15. 4)
x 2 k k

Using the matrix notation introduced in the previous section, the preceding equation can be
written as

APi TP AWi Ti 1 AEi Ti 1 Qi (i 2,3,.., N ) (15.5)

where AP 2, AW AE 1, and Qi qgi x / k.


i i i 2

At the left boundary node (i 1), T1 T 0 T . Hence, AP1 1, AW


1
AE1 0, and
Q1 Ta . At the right boundary node (i N 1) , use of a backward difference approximation
(say, first order BDS) yields

TN 1 TN k k
k h TN 1 Ta i.e. TN 1 TN 1 Ta (15.6)
x hx hx

Thus, APN 1 1 k / ( hx), AEN 1 0, AWN 1 k / ( hx) and QN Ta . The linear algebraic
system obtained for this problem is tri-diagonal and can be easily solved using TDMA (tri-
diagonal matrix algorithm) discussed in a later section.

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL 15.1


COMPUTATIONAL FLUID DYNAMICS: FDM: Applications to Scalar Transport Problems

15.2 TWO DIMENSIONAL HEAT CONDUCTION


Steady state heat conduction in a two dimensional domain without heat source or sink is
governed by Laplace equation

2T 2T
0 (15.7)
x 2 y 2

Governing equation (15.7) involves second order derivatives which can be approximated
using central difference scheme. Associated boundary conditions may involve first order
derivatives (in case Neumann or convective boundary conditions), which would require the
use of one-sided difference formula.

Using of central difference scheme based on a five point computational molecule


yields the following discretized form of Eq. (15.7):

Ti 1, j Ti 1, j 2Tij Ti , j 1 Ti , j 1 2Tij
0 (15.8)
x 2
y 2

which can be rewritten as

APTP AETE AWTW ANTN ASTS QP (15.9)

where AP 2 / x 2 2 / y 2 , AE AW 1/ x 2 , AN AS 1 / y 2 and QP 0. Discretized


equations for boundary nodes can be written using the approach used in 1-D heat conduction
problem discussed earlier. The resulting linear algebraic system is penta-diagonal, and can be
solved using a suitable direct solver (e.g. Gaussian elimination) or an iterative solver (SOR,
conjugate gradient etc.).

15.3 ONE DIMENSIONAL ADVECTION-DIFFUSION


One dimensional advection-diffusion problem for a scalar variable is governed by
d
u
d d
(15.10)
dx dx dx

where u is specified velocity, is density, and is diffusivity. Suppose values of are


specified at both ends of the domain of length L, i.e. the boundary conditions are
0 0 and L L (15.11)

Let us employ a non-uniform grid with a total of N+1 grid points (nodes 1 and N+1
represent the boundary nodes x 0 and x L respectively) for finite difference solution of
this problem. We can discretize Eq. (15.10) using finite difference scheme based on a there
point computational molecule. The resulting discretized equation for an interior node i can be
represented as

APi P AWi i 1 Ei Ti 1 Qi (i 2,3,.., N ) (15.12)

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL 15.2


COMPUTATIONAL FLUID DYNAMICS: FDM: Applications to Scalar Transport Problems

where coefficients A contain contributions from both the convective and diffusive terms, i.e.
A Ad Ac (in which superscripts d and c indicate contribution from diffusive and
convective terms respectively).

Central difference scheme (CDS) is commonly used for approximation of the diffusive term
(for inner as well as the outer derivative). Thus,

d d i 1 i i i 1
i 1 i 1
d d dx i 1 dx i 1 2 xi 1 xi 2 x x
2 2
i i 1
(15.13)
dx dx i 1
( xi 1 xi 1 )
1
( xi 1 xi 1 )
2 2

Therefore, contributions of the diffusive term to the coefficients of algebraic equation (15.12)
are
2 i 1 2 i 1
AEd 2
, AWd 2
, APd AEd AWd (15.14)
xi 1 xi 1 xi 1 xi xi 1 xi 1 xi xi 1
If the convection term is also discretized using CDS, then
d ( u )i 1 ( u )i 1
dx u xi 1 xi 1
(15.15)
i
and its contributions to the coefficients of Eq. (15.12) are
( u )i 1 ( u )i 1
AEc , AWc , APc 0 (15.26)
xi 1 xi 1 xi 1 xi 1
Use of CDS for convective term can result in spurious wiggles or oscillations in numerical
solution if the local Peclet number, Pe ( u x / ) 2. To reduce/eliminate these
oscillations, upwind difference is usually employed for convective term. However, first order
upwind scheme (based on FDS/BDS) is highly diffusive. Hence, higher order TVD (total
variation diminishing schemes) should be preferred for discretization of the convective terms
(Versteeg and Malalasekera, 2007; Chung, 2010).

Example 15.1
Consider the steady state heat conduction in a slab of width l = 0.5 m with heat generation.
The left end of the slab (x = 0) is maintained at T = 373 K. The right end of the slab (x = 0.5
m) is being heated by a heater for which the heat flux is 1 kW/m2. The heat generation in the
slab is temperature dependent and is given by Q = (1273 T) W/m3. Thermal conductivity is
constant at k = 1 W/(m-K).Write down the governing equation and boundary conditions for
the problem. Use the finite difference method (central difference scheme) to obtain an
approximate numerical solution of the problem. For the first order derivative, use forward or
backward difference approximation of first order. Choose x = 0.1, and use the TDMA.
Solution
Governing equation for the steady state heat conduction with constant heat generation:
d 2T
k 2 Q 0 (i)
dx
Given: Q = 1273 T. Thus, Eq. (i) becomes
d 2T
k 2 T 1273 (ii)
dx

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL 15.3


COMPUTATIONAL FLUID DYNAMICS: FDM: Applications to Scalar Transport Problems

Left end of the slab is maintained at constant temperature; hence


T (0) 373 (iii)
At the right end, heat influx is specified. Thus, boundary condition at this end is
dT
k 1000 (iv)
dx
Using central difference scheme, the discretized form of (ii) at an internal node x = xi can be
expressed as
Ti 1 Ti 1 2Ti
Ti 1273 (v)
x 2
Using given values of k = 1 and x = 0.1, the preceding equation simplifies to

Ti 1 2.01Ti Ti 1 12.73, i 2,3,4,5 (vi)


Hence, the coefficients in the standard equation AWi Ti 1 APi Ti AEi Ti 1 bi are:
AWi
1, APi
2.01, AEi
1, bi 12.73, i 2,3, 4,5 (vii)
Temperature boundary condition (iii) at the first node implies
T1 373, i.e. AW1 0, AP1 1, AE1 0, b1 373 (viii)
Discretization of the flux boundary (iv) requires use of backward difference, which yields
T6 T5 100, i.e. AW6 1, AP6 1, AE6 0, b6 100 (ix)
Therefore, the discrete system obtained from finite difference discretization is

1 0 0 0 0 0 T1 373
1 2.01 1
0 0 0 T2 12.73
0 1 2.01 1 0 0 T3 12.73

0 0 0 2.01 1 0 T4 12.73 (x)
0 0 0 1 2.01 1 T5 12.73

0 0 0 0 1 1 T6 100

Numerical calculations using TDMA are given in the following table:

AWi AEi 1 * AWi bi*1 bi* AEi Ti 1 Tex


AWi AEi APi APi b b Ti
i APi bi APi 1
i i
APi 1 APi

1 0 1.00 0 373 1 373 373.0000 373.00


2 -1 2.01 -1 12.73 2.01 385.73 497.2893 498.95
3 -1 2.01 -1 12.73 1.512487 204.6355 613.8216 617.18
4 -1 2.01 -1 12.73 1.34883754 148.02734 723.7617 728.85
5 -1 2.01 -1 12.73 1.26862087 122.47438 828.2096 835.08
6 -1 1.00 0 100 0.21174243 196.54136 928.2096 936.92

REFERENCES
Chung, T. J. (2010). Computational Fluid Dynamics. 2nd Ed., Cambridge University Press,
Cambridge, UK.

Versteeg, H. K. and Malalasekera, W. M. G. (2007). Introduction to Computational Fluid


Dynamics: The Finite Volume Method. Second Edition (Indian Reprint) Pearson Education.

Dr K M Singh, Indian Institute of Technology Roorkee NPTEL 15.4

You might also like