Uploaded by adhithya prem

112106186.pdf

advertisement
INDEX
Topic
Week 1
S. No
Page No.
1
Module 1
1
2
Module 2
16
3
Module 3
35
4
Module 4
53
5
Module 5
69
Week 2
6
Module1
84
7
Module2
96
8
Module3
106
9
Module4
120
10
Module5
129
Week 3
11
Module-1
140
12
Module-2
153
13
Module-3
167
14
Module-4
182
15
Module-5
195
Week 4
16
Module-01
209
17
Module-02
223
18
Module-03
239
19
Module-04
252
20
Module-05
263
Week 5
21
Module- 1
276
22
Module- 2
291
23
Module- 3
306
24
Module- 4
319
25
Module- 5
330
26
Module- 6
343
Week 6
27
Module- 01
354
28
Module 2 - Part 1
369
29
Module 2 - Part 2
379
30
Module- 03
385
31
Module- 04
398
32
Module- 05
412
Week 7
33
Module - 01
424
34
Module - 02
436
35
Module - 03
449
36
Module - 04
461
37
Module - 05
474
Week 8
38
Module - 1
487
39
Module - 2
500
40
Module - 3
514
41
Module - 4
526
42
Module - 5
538
Week 9
43
Conclusion
566
44
Module 6
569
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture – 01
(Refer Slide Time: 00:23)
Welcome to this MOOC course on Foundation of Computational Fluid Dynamics. I’ll
just do now course outline for this course. We start off with basic review on fluid
mechanics which includes some important properties and governing equations. Then,
important topic on Taylor’s series expansion procedure to obtain different finite
difference formula, numerical errors and stability criteria, finite difference formulation
for different model equations... Then we go on to finite volume formulation in detail for
solving full governing equations.
How to do unsteady equations? Which means time advancement methods for unsteady
flows; then another important procedure what is known as a pressure velocity coupling,
which is linking momentum equations and continuity equations. All these equations
when discretized will result in what is known as lin ear algebraic equations. Then to
solve we have to know different matrix inversion procedures. We will go over there
procedures also. Then at the end, we will also see, a complete demo for two or three
example problem discretization procedure, how a code is written, how a mesh is setup
and what are the results and how to go about writing code etcetera.
1
(Refer Slide Time: 02:22)
So, after going through this course, a student is expected to understand discretization
strategies, and appreciate different numerical strategies like computational domain,
boundary condition, what inversion procedure one has to follow and how to obtain
results and interpretations. One also will get confidence on writing a code because we
are going to see at the end, a complete working code, details of the code etcetera. And
that will give you confidence to write own code or if a code is inherited from some other
a person or source, then it also requires equivalent skills to understand that code.
There are many commercial CFD software and open source available, to use them one
has to know details; otherwise, it will be a wrong selection of choices. So, one can
understand at the end of this course, all the theoretical background based on which the
commercial CFD software are built. You will also get confidence to apply any CFD code
or own, commercial software or own code to any engineering applications problem.
After this, this is a foundation course, so each of the sub topic is also available in the
form of advanced course. For example, grid generation, finite volume method in detail
etcetera. So, one can pursue those higher course, after this course.
2
(Refer Slide Time: 04:52)
There are many text books available, and many online reference material available. So, I
am listing here, particularly three or four text books, a student is expected to go through
various other materials also. First book on Computational Fluid Mechanics written by
Anderson, Tannehil and Fletcher; second book, Ferziger and Peric, book title –
Computational Methods for Fluid Dynamics. Then there is a book exclusively on Finite
Volume Method written by Versteeg and Malalasekera. There is a comprehensive text
book on Computational Fluid Dynamics authored by T. J. Chung. As I mentioned before,
there are many materials available, so please do not restrict yourself, only these four text
books, you are also encouraged to ready many other online material available to gain
confidence on this topic.
3
(Refer Slide Time: 06:06)
Now, having described course content, expected outcome and reference text book. We
now move on to actual course. So, in week one, I planned to do some important review
on basic fluid mechanics, governing equations. We will do a detail derivation on one or
some important terms of the derivation not in detail, they are expected in standard text
book and some importance certain terms. There is some procedure called nondimensionalization. So, we will go through that and find out why one has to do. There is
a specific governing equation, what is known as a vorticity-stream function relation. We
will do the derivation of the vorticity-stream function derivation. Then all these
governing equations in fluid mechanics or heat transfer are mostly partial differential
equations can classify them, and we will find out how to classify them based on the
solution nature. And what is the procedure, how a procedure is different for different
types of equation.
Then there are different types of boundary conditions available, so we will go through
them also. Then there are different types of problem, we will see those types of problem
with example. Then whenever somebody writes a code or setup a numerical strategy to
solve any particular problem, there is a procedure called taking a standard test case and
proving that code or proving your numerical strategy for the standard test case. So, we
will go through few standard test case problems, explained the features in them; what
kind of boundary conditions are imposed. And whenever you have to do a code
4
development or using a commercial software, you need to do this first step of proving
your code for these test cases. So, this will be the course content for week one.
(Refer Slide Time: 08:37)
We now go on to review of basic fluid mechanics. We know we deal with lot of
equations or mathematical terms, so we just do what is known as a different co-ordinate
systems. So, we know there are basically three co-ordinate system, one is a Cartesian coordinate system – x y. Second one is the polar co-ordinate system – r
spherical co-ordinate system, which is r
, third one is a
z. You can convert from any one co-ordinate
system to any other co-ordinate system, there is a relationship. Now, why do you want to
do this, because all the governing equations need not be only in one co-ordinate system,
we should be able to convert from one co-ordinate system to other co-ordinate system
and solve problem according to the co-ordinate system that you can described for the
problem.
So, basic quantity for example, in two-dimensional co-ordinate, Cartesian co-ordinate
system x and y is related to r theta co-ordinate system as x is equal to
equal
. So, in cylindrical co-ordinate system, then we have
for
, and
for
and y is
, and
. Similarly, spherical co-ordinate
system to Cartesian co-ordinate system, in spherical co-ordinate system, you have three
parameters to define. One is the
, which is the radius; and
5
is angle between two
sets of co-ordinate, and
is angle between another two sets of co-ordinate. And they
are related to Cartesian co-ordinate system x, y, z. In this formula, that is given here;
. So, this is available in any standard text book or anywhere else. So, we
need to know how to convert from one co-ordinate system to another co-ordinate system.
(Refer Slide Time: 11:16)
There are different standard vector operations available. So, we just see what is known
as a gradient. If there is a scalar function
get
system
, and if you do gradient of f (
) then you
. You can also get a gradient expression in other co-ordinate
and
, which is defined as here,
. The same way
you can also define gradient operator in spherical co-ordinate system, which is given the
last expression. Then another important operation is divergences. So, if you define
velocity
vector
with
the
component
and
corresponding
unit
vector
, then divergence is defined as
as
del dot v
equal to dou V x by dou x plus dou V y by dou y plus dou V z by dou z.
Just like we did for gradient, we can also define divergence in other two co-ordinate
system,
operator
co-ordinate system and spherical co-ordinate system. Third important
is
a
curl,
which
6
is
defined
as
. So, you can extend this
procedure for other two co-ordinate system, and we just defined here for
co-ordinate
system as you can see here, the first component and second component and third
component. Now, these are important, because it is easy or for any quantity later, you
find them it is extremely useful.
(Refer Slide Time: 14:27)
Then another important mathematical related quantity for fluid mechanics is what is
known as total derivative. So, for a function,
; then one can define the total
derivative of the function at a point
, and this is defined as
. Now, you can also recognize
is time rate of change of spatial co-ordinate, which is actually the velocity in x direction.
Similarly,
is a velocity component in y direction, so all so for velocity component
in z direction, because function f is dependent on three co-ordinate x, y, z and t, we have
partial derivative define for that function in time as well as in other three spatial coordinate system.
7
Now, such as derivative is defined here as
, which is known as material derivative or
substantial derivative or total derivative. The first term on the right hand side, which is
is called temporal derivative, because it is derivative taken
8
with respect to time. The other three terms are called spatial derivative or convective
derivative. So, this gives local acceleration and this give convective acceleration.
(Refer Slide Time: 16:36)
Now, we restrict ourselves to fluid as a continuum, which mean properties are considered
to be continuous functions of space as well as time. We have just seen a function of f,
and that is considered to be continuous, there is no gap in between. So,
modeling a fluid as a continuum assumes that properties are continuously distributed and
fills the entire region of space it occupies. Now, this assumption does not allow
properties to become infinite or to be undefined at a single isolated point, but there are
some branches what is known as molecular dynamics where there is a question whether
this continuum assumption is valid. But in this course, we are going to restrict ourselves
only to situation where fluid is treated as continuum. Hence all the governing equation
and whatever procedure we are going to do to deal with those governing equations are
restricted only for fluid as continuum and it has been tested by several people and
different situation and this assumption holds good. So, we are restricting ourselves only
to situation where fluid is treated as a continuum mechanism. There is another subject
called rarified gas dynamics where it is treated not as continuum.
9
(Refer Slide Time: 18:34)
There are many properties, firs is the viscosity. So, it is the property by which internal
resistance to a fluid flow is defined and it is just a measure of fluid friction. So, all fluids
supposed to have some resistance to the flow and because of the resistance it develops
some stress. Fluid where resistance is assumed to be zero or no effect is there, such a
fluid is called ideal fluid or inviscid fluid. So, in some situation, you can assume ideal
fluid situation or inviscid calculations can be done to obtain first level of results or
approximation then that inviscid solution can be taken as a initial condition for
subsequent viscous calculation. So, this stage-by-stage, numerical simulation is helpful
to overcome any numerical difficulties. There are two definitions available; one is
absolute or dynamic viscosity, second one – kinematic viscosity, it is also called
momentum diffusivity. And these two are interrelated.
10
(Refer Slide Time: 20:07)
So, having defined viscosity, stress and strain one can classify fluid based on how they
behave. So, major classification Newtonian fluid or non-Newtonian fluid. In Newtonian
fluid, there is a linear relationship between applied stress and resulting rate of
deformation. In non-Newtonian fluid, there is a non-linear relationship between the value
of the applied stress and the rate of deformation. So, there is a graph available; so on y-
axis, we have the stress –
; on x-axis, we have the rate of strain –
, which is strain.
So, a is a linear straight line, so linear relationship between applied stress and the
resultant strain that behavior, which is marked here as a is known as Newtonian fluid.
Any other behavior, which is marked in this figure either b, situation d or situation c,
where the linear relationship is not followed, we are called non-Newtonian fluid. So, we
have example tooth-paste is the example for non-Newtonian fluid; blood is example for
non-Newtonian fluid, grease is example for non-Newtonian fluid.
So, whenever we have a non-Newtonian fluid, there are different models available to
describe them. A popularly used a power law model, where the stress is related to rate of
deformation by power law, so it is
separate as
, n is the index of the power. And you can
and the remaining one part is written separately. This product
11
, this term alone is referred as apparent viscosity which is written by the
symbol
, so
of remaining term
and which is related to strain
velocity strain. So, this is because in general in for Newtonian fluid, we write
12
, this is
or
; so for non-Newtonian fluid also we would like to have a similar
expression and that is written here as eta into du by dy. The difference here is eta is
apparent viscosity, mu is another viscosity.
So, we can go one more small sub classification; fluids where apparent viscosity which
is eta decreases with increasing deformation rate which means n is less than one is called
pseudo plastic which is marked here as c in this curve. So, the relationship between
stress and rate of strain is decreasing with a increasing, so on x-axis as you go, it
increases; whereas, the rate here is smaller in the other axis. The second situation, if the
apparent viscosity increases with increasing deformation rate, which happens for
situation marked as d here and that is what is known as a shear thickening fluid or
dilatant fluid which is marked here as d. So, there are situation where there is a stress
required then the fluid will start moving so that is the meaning of situation where b. So,
they will not start flowing up to some definite pressure is set form plastic.
(Refer Slide Time: 25:00)
We also now go to the next topic what is known as scalar or vector fields, because in
fluid mechanics we talk about velocity, temperature or concentration, so we should know
what is the scalar field and what is the vector field. A field is a quantity which can be
defined as a function of position at every point in space. This may be a scalar, which has
only the magnitude or vector which has both magnitude as well as direction. When a
scalar quantity is defined as a function of position then it is said to be a scalar field.
13
Similarly, when a vector quantity is specified at every point as a function of position
then it is said to be vector field. So, for example, temperature is a function of x, y, z
and if you prescribed temperature then it becomes scalar field. Similarly, vector
velocity is defined then it becomes velocity field, because it is direction dependent.
You can also take a component, so component of vector field or called a scalar field
function, so just like velocity vector V, if we take a component in x, y, z then we get
corresponding component of velocity in that direction. Though it is defined as a scalar
field, it keeps on changing, so even if you take only the velocity component as it keeps
on changing in x direction. For example, then the direction along which the change
happens results a vector. So, for a flow field, velocity vector v, which is a function of
spatial co-ordinate x, y, z also as a function of time; w e have a three component u, v, w
and all three also varies as a function of x, y, z as well as time. And to get to get back
velocity field – vector field, you multiply magnitude with a corresponding unit vector i,
j, k. So, one can obtain from the scalar field, vector field this way.
(Refer Slide Time: 27:57)
Next quantity of interest is vorticity vector, and
vorticity; expression for
is the symbol used to define this
is shown here with its component. So,
and that is also equal to half times
, where
is equal to half rotation vector which is capital omega ,
Cartesian component, rotation is given here as
14
is the velocity vector and that
. And in terms of detail
. Expression for cylindrical co-ordinate
system is also given here.
Now, we know in a fluid, a fluid particle is subjected to body force or normal force as
well as shear force. A fluid particle moving without rotation in a flow field cannot
develop rotation under the action of body force or normal force. Development of rotation
in a fluid particle, initially without rotation, requires action of a shear stress on the
surface of the particle. If the rotation or vorticity is zero, that is
, such a flow
is called irrotational flow. Since the shear stress is proportional to the rate of angular
deformation, then a particle without initial rotation will not develop rotation without any
simultaneous angular deformation. So, for a fluid to have rotational viscous force, which
actually results in the form of shear stress is responsible for rotation.
In this first module, I outline syllabus for the entire course, outcome of this course, what
is expected from this course, reference text book, important fluid properties, basic review
on mathematical operations, viscosity, and something about rotation. So, next class, we
are going to continue this and slowly move onto governing equations.
Thank you.
15
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture – 02
(Refer Slide Time: 00:56)
Welcome you all again to this course on Foundation of Computational Fluid Dynamics.
We are on to module two of the first week. Last class, we basically did we put out the
syllabus for the course, and then outcome - what you obtain from this course, some of
the mathematical operations, then definition of velocity field, vorticity, viscosity,
definition of fluid based on viscosity. And we still have to do review of equations, and
there are other topics like non-dimensionalization, vorticity-streamfunction and so on.
16
(Refer Slide Time: 01:15)
Whenever a fluid is moving, we have to characterize them, visualize them, so this is given
by flow visualization and there are four such characteristic lines defined for flow description.
They are time line, path line, streak line and stream line. So, we will see the definition of
them and later when we take an example, we will see that how these are used to define a
flow. So, timeline are the lines or curves formed by a number of fluid particles marked at
particular instant of time, this is very important, so it is unsteady flow it changes with time
and you are looking at one particular instant how different fluid particle at that instant
behave and if you are able to connect all the particles at that instant then similarly you
proceed with the time, you are able to get timeline for that flow.
So, they get displaced as a particles proceed further in the flow. Pathline is another
definition this is a contour or path followed by fluid –moving fluid particles. They are
traced by individual fluid particles and in experiment also in CFD, we can inject a dye
then it traverses when if you connect all the contour then you get pathline. So, pathline
are characteristic Lagrangian descriptions of the fluid motion such that the coordinates of
the fluid particles can be expressed in terms of time as well as initial coordinates.
17
(Refer Slide Time: 03:42)
There are other two definitions streakline and streamline. So, streakline are the locus of
all fluid particles which passes a particular point and after some instant whatever
particles that is crossed at that particular point and you connect all of them, then you get
a streakline. So, in experiment, if dye is injected and it would continuously move only
along the streakline. Streamlines, this is the standard definition which all of you know, a
family of curves which are tangent to the direction of the flow at every point at a given
instant. So, if you draw a tangent to streamline, then you get velocity component,
velocity vector at that particular instant. The streamlines show the direction in which a
fluid element would tend to move at any point of the flow field. We know flow can be
steady or unsteady. So, in steady problem, all these four descriptions pathline, timeline,
streamline and streakline they all will be same. They will be different for unsteady flow,
and this is to be noted very carefully.
18
(Refer Slide Time: 05:46)
Now, next important topic, reviewing of basic equation; we will not do detail derivation,
we will only touch few steps and explain importance of terms; detailed derivation is
available in any standard under graduate fluid mechanic text books. In general, there are
three basic equations, one is conservation of mass, which is also known as continuity
equation; conservation of momentum and then conservation of energy.
Primarily conservation of mass and conservation of momentum are necessary for any
fluid mechanics problems and conservation of energy is used whenever you are
interested in compressible flow or to do with heat transfer problems. These are only
primary equations. You also need to have additional equations depending on problem.
For example, ideal gas equation is used in compressible flow; and if you are interested to
find out concentration distribution for example, pollutant disperse a problem, then you
interested to find out particular concentration then you solve additional species transport
equation.
Governing equation can be expressed in two different forms; one is the differential form
and integral form. Similarly, we already seen last class, different coordinate systems,
Cartesian coordinate system, cylindrical coordinate system and spherical coordinate
system, so one can able to convert or derive governing equation in any coordinate system
and convert from one coordinate system to other coordinate system.
19
(Refer Slide Time: 07:34)
So, we before going to the derivation, one important concept that we have to learn in
fluid mechanics what is known as system and control volume. System is basically related
a fixed identifiable mass. So, with the time, the boundary may change, but the mass
remains; the boundary which contains that mass may change, but the quantity of mass
that remains same. So, across the boundary, we can have a work or energy transfer. The
usual example given is piston and cylinder assembly. Certain quantity of gas is inside the
cylinder and piston moves front and back, the mass that is remains the same. And you
have an energy transfer happening across the boundary and piston moves back and fro.
Now, though it looks simple for a problem where there is continuous change of the
boundary, it is difficult to apply idea of system or concept system and get a solution.
So, there is alternate what is known as control volume, where we do not really focus on a
fixed quantity of mass, only the boundary focused on fixed window and then observe
what is happening to that window. So, we can have a mass transfer also, in addition to
momentum as well as energy transfer crossing the boundary. Control volume can change
shape or move, it need not be fixed in a flow, it can also move. For example, you want to
find out flow pass in aircraft or flow moving over a four-wheeler and you define control
volume around the aircraft or four-wheeler as aircraft moves or as the four-wheeler
moves, the control volume also moves. Similarly, if you take a balloon then the balloon
has deflating, it changes its shape. So, the boundary which is defined here as a controlled
volume, it can change shape. This is helpful for example, we have a elastic material and
20
you want to find out flute structure interaction problem later then there is a boundary it is
not fixed it undergoes changes as a function of time; control volume study is very
helpful.
The boundary which is enclosing the control volume is called control surface, so there is
a schematic available. So, here this red boundary is the control surface and fluid crosses
through the control volume, and you find out what is happening to the control volume,
because of the flow that is happening through this control volume. So, for example, you
want to find out in the case of aircraft, what will the lift generator, what is the drag force
exerted on the aircraft then you find out a net get a drag estimate.
(Refer Slide Time: 11:22)
So, as I mentioned before one can get all the governing equation either in integral form
or in differential form. We will see sum up them in integral form then later we will move
to differential form. So, to take an integral form, we can relate the system and control
volume derivatives for any general extensive property N, then one can get all basic laws
by instantaneously by identifying the system at that coincides with the control volume.
This is theory what is known as a Reynolds transport theorem; right now, we are not
going to details of that derivation. In mathematical form, it is expressed and given here;
the extensive property N is related to intensive property
21
η
and it is related here as
N=
∫
η dm equal to integral over mass, which is for actually system
M(system)
related to volume, which is
N=
∫
ηρ dv .
V (system)
22
η dm
is
Now, you can see by substituting different values for
equations. For example, if you say
η , you get different governing
η=1 , so if you substitute
η=1 here, and then
the resulting quantity corresponding extensive property is actually the mass. So, if you
put one η=1 , it is
m
3
∫ ρ dV
; you know
ρ
is the density
3
kg / m
and dV is
, product of them will give you mass, so that N is actually mass and that will give
you conservation of mass equation in integral form.
Similarly, if you define
η - as intensive property as V, then if you substitute here V, so
V ρ dV , you know mass into velocity will give you the linear momentum, and
similarly on the left hand side extensive property N will give you the linear momentum.
So, we can substitute different value for
η
and they are given here. Next one is for
angular momentum, then total energy and total entropy. So, one can obtain from this
general relationship, it means extensive property and intensive property to this integral
relationship, one can obtain basic laws in integral form. As I mentioned before, this is
what is known as Reynolds transport theorem.
(Refer Slide Time: 14:43)
Now, we will see how to get expression in detail for conservation of mass. We know this
equation stated as rate of increase of mass within the fixed volume must be equal to net flux
crossing the boundary. So, if you consider a control volume, the mass that is insider the
control volume is
ρ dV , V is the volume that is given here, and then if you define
23
at any point
dA
is the normal vector, and
⃗
V
is the velocity vector, A is the area of
the boundary volume. So, if you express conservation of mass in integral form, so
∂ρ
∫ ∂ t dV =−A ∫ ρ V⃗ .dA
, because area is also vector, velocity is also vector, you do
V
the dot product, you get a flux crossing and here it is
dA
is continuously changing for
this illustration figure that is given so you find out net flux crossing the boundary.
It may be coming in some place, it may be entering the volume, in some place it may be
going outside the volume and sum them up you get net that why we do the integral. The
integral is correspond to summing and you get that sum and that is related to rate of
increase of mass within that control volume. Now, the differential form of the equation is
∂ρ
⃗ )=0 . We have already seen this
+ ∇ .(ρ V
∂t
∇ operator. So,
⃗
V
is the velocity
vector and in Cartesian coordinate system, you have u, v, w as a component to define of
the velocity.
(Refer Slide Time: 17:00)
So, we already seen, we will now see in detail. So, let us take a volume threedimensional representation here, fluid element; and with the elemental length define in
each direction, for example, dx is the length of that element in x-direction, dy is the
length of the element in y-direction, similarly dz is the length of the element in zdirection. So, Reynolds transport theorem, we already seen; so if you substitute eta equal
to one, then you get N on the left hand side to be mass, so that equation is put here again.
24
And volume is taken inside, so dou by dou t of control volume rho into dV will give the
mass and this will give you the flux crossing the control surface. And you find out flux
crossing at each control surface and then you sum them up. So, in this case, if you
consider this is the rectangular volume element, and you define for example, this is one
face, and this is another face, front face, back face and so on, so there are six faces here,
top and bottom. So, one has to get explanation of this term on although control surface.
So, the first term is
∂ρ
dx dy dz
∂t
∂ρ
dx dy dz ;
∂t
dxdydz
corresponds to volume and
will give you the rate of change of mass. Now, if you consider the next
term, second term in this equation, so as I mentioned, if you consider
ρ , if you
consider center of this volume x, y, z then from the center, if you go to the left in xdirection, it becomes
dx
; similarly, form the center, in the x-direction if you go to the
2
right, that elemental length is
dx
2
positive. Similarly, you can go from the center
come front and go to the back, there will be
dz
; similarly, top and bottom that will be
2
dy
, half in either direction. So, this term, which is accounting mass flux through
2
control surface, and you will find out the term for each of this face, so
x−
y−
dy
2
dx
2
will be the left face;
will be the bottom face, and
y+
x+
dy
2
dx
2
will be the right face. Similarly,
will be the top face; similarly, from the
front and back. So, there are six terms for this cube bar element that you have consider.
And if you write for example, only for the left face, mass flux to the left face
ρ ( x , y , z , t)
that is defined here. Assume that is a density available at center of the
element and you go left hand side, and this will give you the flux that is crossing and this
is flux that is leaving. So, we can say mass flux through the left face of CV, and mass
flux through the right face of CV. So, you get term define like this for each face and put
them in this equation. And finally, in all, you have dy, dz and dx term, which is actually
the volume.
25
(Refer Slide Time: 21:20)
So, if you do that arithmetic substitute for all faces and sum them up; if you do that
arithmetic and divide by volume
dxdydz
that terms appearing in all the three terms of
the spatial as well as on temporal. If you divide by the volume, then you get
∂ρ ∂
+ ( ρ u)+ ∂ ( ρ v)+ ∂ ( ρ w) , and you also know how to convert or write in
∂t ∂ x
∂y
∂z
other form, this
∂ρ ⃗ ⃗
+ ∇ . ρ V =0 .
∂t
(Refer Slide Time: 22:05)
26
Now, what we have done is a generic, not particular to any situation; generic equation
gets reduced or simplified for different situation. For example, in steady flow, we know
the properties do not change with the time, so any term with the time derivative is there
equal to zero. In this case, it is
∂ρ
∂t
that first term
∂ρ
∂t
goes to zero, and mass
conservation equation gets reduced with only a spatial derivative term that is given here,
and in terms of vector,
⃗ .( ρ V⃗ )=0 . Another simplification, if it is incompressible
∇
flow, we know density is the constant, so any derivative, any spatial derivative of density
will not be there and that term is also removed and we get only the velocity component,
so
∂u ∂ v ∂ w
+
+
=0 ; and in terms of vector, it is
∂x ∂ y ∂z
⃗ . V⃗ =0 .
∇
(Refer Slide Time: 23:29)
So, the next equation we said we will do three equations – conservation of mass,
conservation of momentum and conservation of energy. The second important equation
is conservation of momentum, which is based on Newton second law of motion
F=ma . Like we did for conservation of mass, here also we need to consider
elemental volume, find out net force acting on the control volume and then net
momentum flux crossing the control volume. You account for both of them then you get
finally, conservation of momentum equation. So, it is stated as net force on the control
volume equals rate of change of momentum within the control volume and net flux
crossing the control volume.
27
So, in vector form, here again we are not doing the detailed derivation that is there in any
standard fluid mechanics text books or any other open source materials or other NPTEL
course.
ρ
(
So,
in
⃗
∂V
⃗ )V
⃗
+( V⃗ . ∇
∂t
vector
)
form,
conservation
of
momentum
is
given
here,
, which is on the left hand side equals pressure gradient, viscous
force and any other force. Now,
⃗
V
is the velocity field; and this
2
∇ V⃗ , which
accounts for shear force, it is the Laplacian operator and given here as
∂2 + ∂2 + ∂2 . And
2
2
2
∂x ∂ y ∂ z
μ , we know it is the dynamic viscosity of the fluid. So, if
you divide equation by ρ , then you get
μ
μ ⃗
ρ , ρ ∇ P and only the external force.
So, if a problem, you are applying the problem on say involving the magnetic field then
this external force -
f⃗e
represent additional magnetic force. Similarly, a problem
involving gravity then you have gravity force appearing on additional source term. So,
this is given as a source term, and for different problem, you will have a different
definition of the source term or external force. So, if you look at this equation, on the left
hand side, you have one component for time derivative, and this
∇
three components
as a spatial derivative and this derivative of time, you know that gives acceleration,
similarly this term also supposed to be acceleration, we will get the definition clarity in
next slide. So, the left hand side is acceleration; and right hand side, pressure is the force,
viscosity of the shear force or any other force so that is why I said Newton second law
F=ma
is actually the first principle based on which conservation of momentum is
derived. And you are able to see here the same acceleration term and force term on other
side.
28
(Refer Slide Time: 27:34)
We have already seen in the first class, different review, we have seen total derivative
D ∂ ⃗ ⃗
= +V . ∇
Dt ∂ t
which is
. So, if you substitute the definition of material derivative or
substantial derivative in the momentum equation then it is rewritten as given here. So,
D V⃗
Dt
on left hand side; the right hand side is the same pressure force, viscous force
and any other force. It is convenient to write in vector form, sometime it is easy to write
equation in scalar form, so we will also get to see how to write momentum equation in
scalar form. So, for example, we know three-dimensional representation, x- momentum
equation; the detailed expression of the same momentum equation for x- momentum
equation.
We
know
the
velocity
component
along
the
x
is
u,
so
∂u ∂ u
∂u
∂u
+u
+v
+w
, and this corresponds to expansion of this material derivative
∂t
∂x
∂y
∂z
D V⃗
Dt
on the left hand side; and pressure term
∂p
∂x
is appearing here for pressure,
viscous force is appearing here and then external force is consider as gravity force. And
we take a component, you get ρ g x .
So, where
gx
is acceleration due to gravity, which is consider here as an external
force. One can also obtain similarly by substituting for V vector, in terms of velocity
29
component for y as v, and w for z, we get momentum equation the corresponding
direction, y- momentum equation and z- momentum equation.
30
(Refer Slide Time: 30:04)
So, if you do that, you are able to write a complete momentum equation, and you are able
to see here corresponding v- momentum equation or y- momentum equation and third
direction w- momentum equation or z- momentum equation. Now, you see advantage of
writing in vector form, writing in Taylor form; and in vector form, these three equations
with so many terms or written in elegantly in simple one equation with only two terms.
Whereas in scalar form, you are able to write in detail and one can actually locate what
component responsible of what. So, while writing a code also you write in detail form
then write a code, it is easier to decode later. And this set of equation that is all the three
momentum equations with full components written, all the terms written, we generally
called Navier-Stokes equations. Navier and Stokes are two scientist, who independently
developed these equations and as a credit to them, these equations are named as NavierStokes equations.
And you can again understand in this equation, if you take left hand side, all the time
derivatives, which is given as
And
u
∂u ∂ v ∂ w
,
,
, they are all called local acceleration.
∂t ∂ t ∂ t
∂u
∂u
∂u
+v
+w
, those three terms in x- momentum equation; similarly three
∂x
∂y
∂z
terms in y- momentum equation, three terms in w- momentum equation, they are
convective acceleration. And you put them together all the four terms will give you total
acceleration.
31
(Refer Slide Time: 32:19)
So, that what is explained, left hand side, first term is local acceleration that is this term
and remaining three terms are called convective acceleration. Put together, it is called
total acceleration. Now, if you look this particularly convective acceleration in closely,
we see here u is a velocity field, which is the function main quantity in the x- momentum
equation, and
∂u
∂x
is the derivative of the same velocity. In other words also
v
∂u
,
∂y
v is the velocity field in y component, and there is velocity derivative. So, function
multiplying the derivative of the same function is result in what is known as a non-linear
in nature. So, such non-linear nature of this convective acceleration actually attracts a
special attention, because the behavior of how to solve or how to represent u, multiplying
∂u
∂x
in discretization is important and we are going to focus a special attention on this
convective term, because of its non-linearity. The behavior and the treatment of this
convective term can change the solution results in some in stable also accuracy to some
extent.
So, we are going to see in detail treatment of this non-linear convection term later. So, in
this class, we did important topic flow description, conservation of mass equation,
conservation of momentum equation detailed in differential form and writing the
momentum equation in vector form and scalar form. And important of non-linear
32
convection term and why one should focus on convection term discretization, and how to
represent different external force for different problem. So, next class, we are going to
33
see little more detail on this momentum equation, and go onto the next equation,
conservation of energy equation.
Thank you.
34
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture – 03
(Refer Slide Time: 00:26)
Welcome you all, we are now on to module three of this MOOC course. Last two classes,
we have done some review on mathematical formulation, operators, important properties,
description of the flow, and then we started doing equations. So, we first did
conservation of mass or continuity equation then we went on to momentum equation,
which is called conservation of momentum and we have written a momentum equation in
both vector form and as well as scalar form, and that is repeated here. All the three
components of a momentum equation and we know this also called Navier-Stokes
equations. We recognize here again, first term is unsteady term or local acceleration, the
remaining three terms are convective acceleration.
35
(Refer Slide Time: 01:35)
Like we did in conservation of mass, if you simplify for different situation, then the
original the generic continuity equation get reduced as two-dimensional only with spatial
derivatives. Similarly, conservation of momentum equation also can be reduced for
different simplified situation. For example, if you say the flow is frictionless, then effect
of viscosity
μ
term is negligible. So, in the Navier-Stokes equation
μ
term
appearing as viscous term on the right hand side. So, that term is removed and you get
resultant equation or Euler’s equations. So, left hand side remains the same,
D
Dt
–
total derivative of the velocity, there is one term that is removed, because of the viscous
effect is not consider. The external force and pressure term remains same. So, this
equation is derived or deduced by scientist Euler, hence the name is given as Euler’s
equations..
So, theoretically, for any inviscid, where viscous effect is not there in incompressible
flow, you can directly either Navier-Stokes equation and momentum equation can be
used to obtain pressure as well as velocity field. So, you can also integrate this Euler’s
equation along a streamline and after some simplification, it results in what is known as
Bernoulli’s equation and that is given here
p v2
ρ + 2 + gz=constant . We know
Bernoulli’s equation is a energy equation. So, you get a pressure in a p, kinetic energy or
velocity energy and potential energy. So, Euler’s equation if you integrate, along a
streamline then you get a Bernoulli’s equation. So, Euler’s equation is derived or
36
deduced for frictionless flow. So, Bernoulli’s equation is the restriction for only
frictionless flow. You can also obtain Bernoulli’s equation for unsteady flow also.
37
(Refer Slide Time: 04:31)
So, next third equation, which is conservation of energy equation; once again we are not
going to the details of the derivation steps. We first state the energy equation itself which
is given here as rate of change in kinetic and internal energy is equal to sum of net inflow
of the kinetic energy, work done by the body force and net work done by the stress field
as well as net heat flow. And this definition is applied then there are many arithmetic
operation, finally, the form that is given here is given
ρCv
D
Dt
of temperature on left
hand side, and there are three other terms on the right hand side. So, in this equation,
Cv
is the coefficient of specific heat in constant volume; and k is the coefficient of
thermal conductivity; and q is any external heat source, and
ϕ
is a rate of dissipation
of mechanical energy and that is given by this expression.
So, in this expression, it is the summation and
∂u
∑ τ ij ∂ x i
, where i and j are indices it
j
is representing direction 1, 2, 3. So, if you substitute i is equal to one, j is equal to 1, 2, 3,
i is equal to 2, j is equal to 1, 2, 3; i is equal to three, j is equal to 1, 2, 3, you get so many
components in this equation. This index notation is also otherwise called tensor notation,
we are not going to the details of tensor notation here, only this term is expressed in this
form. So, as I mentioned before from the definition after for simple condition, the
equation is derived and it is given here. There are other forms of energy equation
available in other references.
38
(Refer Slide Time: 06:52)
As we did exercise, how to simplify conservation of mass, conservation of momentum
for different situation; conservation of energy equation is also simplified. So, in the case
of incompressible flow
ϕ
which represent the energy dissipation will be very, very
small, and hence the effect can be neglected from that equation. Similarly, if there is
absence of external source, then energy equation gets reduced to only one term on the
right hand side, so in most equation. So, we have conservation of mass and conservation
of momentum; conservation of momentum of course, there are three explicit equations
for each direction. So, in essence there are four equations, one for conservation of mass,
and three equations for conservation of momentum – x component, y component, and z
component.
So, if you look at number of variables, you have u, v, w – three, and pressure – four. So,
there are four unknowns and there are four equations. So, mathematically it is a closed
system of equation along with number of boundary condition you specify then you will
able to solve those four equations without any problem. If you are looking for only
simple basic fluid mechanics problem then those four equations are enough. And if you
have a problem where energy transfer is also important then you activate or include
energy equations also. So, whether you solve energy equation, in line with momentum
equation or not is a question. If for most of the situation, the energy equation is solved in
a decoupled manner with the continuity and momentum equations. What is the meaning
of decoupled, you solve mass equation and momentum equation get a converged solution
39
based on mass equation and momentum equations then you trigger or activate the energy
equation in the code, get a converged solution for energy equation, then moved to the
next iteration, the cycle repeats. So, this is known as a decoupled way of solving
equations.
But in problem where there is a natural convection, where temperature distribution
causes a buoyancy force, then this procedure is not applicable; we need to solve energy
equations coupled manner with the momentum equation, because in natural convection
problem, buoyancy force is an external acting as a external source term in the
momentum equation. Hence, we have to solve energy equations, as and when you are
solving momentum equation, which is going again as an energy, as a source term the
momentum equation.
(Refer Slide Time: 10:01)
Next, important topic is non-dimensionalization. What do we meaning of nondimensionalization. It is a method or a procedure by which unit quantities are replaced.
So, we have seen three major equations, mass, momentum and energy. In all the three
equations, we also observed the variables, velocity, density, gravity, viscosity then
temperature reserve. So, all these variables have units. The reserve a way by which you
can remove the units and solve the equations in non-dimensional form, and there is a
procedure and that is known as a non-dimensionalization procedure. How do we do, we
identify suitable variables and replace actual variable or non-dimensionalized actual
40
variable by the corresponding suitable variable which is acceptable. Now, what is the
advantage, it parameterize the problem in place on units. So, this reduces number of
parameters in the problem. And you can also identify by this procedure characteristic
properties of the system, which mean there is a particular scale exist in a flow either
velocity scale or a length scale or time scale, you can identify corresponding scale by the
non-dimensionalization and the scale information is very helpful either to control the
flow or manipulate the flow or to design a system based on the scale.
Now, the advantage is suppose, you are running or doing experiment, running a
simulation for one particular geometrical condition or flow condition, and there is a need
to repeat for some other condition, if you do non-dimensionalization then you do not
have to do this repetition of cases for different situation; results obtained one situation or
condition can be obtained with ease for another condition.
(Refer Slide Time: 12:25)
So, in connection with that, we need to also know many non-dimensional numbers and
there are also many other important numbers. So, I am listing here only few of them,
they may be more depending on the problem that you are studying. First one is the
Reynolds number, usual symbol is given as Re, and which is the ratio of inertial force to
the viscous force. Next is the capillary number, which is given a symbol Ca which is the
ratio of viscous force to the surface tension. Froude number, which is used for which is
generally used flows via gravity Fr consider. So, it is defined as ratio of inertial force to
41
the gravity force. Next non-dimensional number is a Weber number, again given a
symbol We, which defined as ratio of inertial force to the surface tension force. So, it
basically means either inertia is dominating or surface tension force is dominating
depending on the value of the number.
And heat transfer context, we have Nusselt number, which is given a symbol Nu and it is
the ratio of convective heat transfer to conductive heat transfer. Then there is Prandtl
number – Pr, which is ratio of momentum diffusivity to thermal diffusivity. The one
more number what is known as a Stanton number. So, which is defined based on heat
transferred to thermal capacity, and it is also related to Nusselt number and Prandtl
number as given here
Nu
. As I mentioned before, there are many more nonR e∗Pr
dimensional numbers for different problems.
(Refer Slide Time: 15:09)
So, we have seen important of non-dimensionalization, and some important nondimensional numbers. Now, we are actually going to do non-dimensionalization of
governing equation. We will do a detail derivation for one equation that is conservation
of mass, and you can follow the procedure to get non-dimensionalization equation for
other equations. So, to do that we need to define what is known as reference scale. So, in
a problem, you need to identify reference length scale, reference velocity scale. If you
consider for example, flow through a circular cross-section pipe, diameter of the pipe can
be a reference length scale. If you consider flow through a rectangular cross-section pipe,
42
then hydraulic diameter, which is defined as four a by p, where a is the area, and p is the perimeter that
can be a length scale. If you consider flow over an aerofoil, the cord length can be a length scale.
So, one needs to identify, which is the major influencing length scale in a problem. It
may vary from problem to problem. Then one also identify reference velocity scale. So,
again if you consider the flow through circular cross-section pipe, if the inlet is uniform
velocity then uniform velocity can be a reference velocity scale. The inlet is parabolic
profile either the bulk velocity can be a velocity scale or the average the middle
maximum velocity can be a reference velocity scale. If you consider a flow over a flat
plate, the free stream velocity
U∞
can be a reference velocity scale. So, one needs to
identify reference length scale and reference velocity scale. Once we do that in the
governing equation all the length scale related quantities are non-dimensionalized with
the reference scale. Similarly, all the velocity related quantities are non-dimensionalized
by the reference velocity scale.
And we also know you can get a time from velocity as well as length. So, we will see
how to do, let us say for example, all the length scale in all the length related
information, so in this case, x, y and z. So, x is non-dimensionalized with L, and this
non-dimensionalized quantity is referred with the symbol superscript star(*). So,
x * is
non-dimensionalized length and x is the length, actual length, L is the reference length,
x*
and we know both have the same unit. So,
has no units. You can define similarly
for other two dimensions length dimension, we use the length scale in all. So, it is
and
z
. And t-time is non-dimensionalized from these two
L
time. So, any time related quantity for example,
*
t =
L
U∞
y
L
will give you the
t
( L/U ∞ )
to get non-
dimensionalized time t * .
Similar manner, you can also do for velocity. So, it is
u*
is non-dimensionalized
velocity component in x-direction, which is u is the velocity dimensional quantity and
U∞
is the reference velocity. So,
u
U∞
will give the non-dimensionalized velocity
quantity u* . You can extend this to get
v
term appearing; the pressure is related to
U∞
43
*
and w * . And pressure, is also another
2
and you define reference density. So, if
you take the unit of density, and velocity square then you find the product of them has
the same unit as pressure, so you are able to non-dimensionalized pressure term
p
ρ∞ U 2∞
*
will result in
p
which is non-dimensionalized pressure.
And we have just now seen different non-dimensionalized number. So, Reynolds number
is appearing in momentum equation, when you non-dimensionalized and we know the
definition of Reynolds number is ratio of inertial force to the viscous force. And if you
use this non-dimensionalized quantity, then finally, you end up in expression for
Reynolds number as
ρ∞ U ∞ L
. Of course, you can define
μ
Reynolds number becomes
μ
ρ∞
also as a
ν
and
U ∞L
. So, all the * quantities are non-dimensionalized
ν
variables, now that we are done the first exercise, we can repeat this, we can substitute
this term in continuity equation to get a non-dimensionalized continuity equation.
(Refer Slide Time: 20:39)
Now, we will try to do non-dimensionalization of the continuity equation. So, we know
∂u ∂ v ∂w
+
+
=0 . And we just now learned how to represent them by length scale,
∂x ∂ y ∂z
velocity scale and that is written here. And we also defined u by
x
L
as
x
*
*
and so on. So, we get
*
*
U∞
as
u
*
and
∂u ∂v ∂ w
+
+
=0 ; so this equation is actually
∂ x* ∂ y* ∂ z*
44
non-dimensionalized continuity equation. You can immediately observe none of the
quantity have units. So, take any of these, first term for example,
dimensionalized there is no unit;
x
*
u*
is already non-
is non-dimensionalized, there is no unit.
Similarly, other two terms so no term has any unit. So, this entire equation has no unit.
You can extend this procedure to get non-dimensionalized momentum equation, and that
is given here. First term
∂u*
, similarly
*
∂t
u*
∂ u*
*
∂x
and so on up to last term also the
viscous term. So, we see here, as I explained continuity equation, here also no term has
unit. So,
∂u* , of course, you know already
u*
has no unit,
t*
has no unit. So,
the entire term has no unit, similarly, other terms so the entire equation is without any
particular unit. And one can extend this procedure to get non-dimensionalized ymomentum and z-momentum equations. So, if you solve for example, this equation for
one problem then you see the advantage, if there is a change in any design parameter, for
that problem then you need not repeat this calculation just for the sake of changed
dimensions or changed design condition.
(Refer Slide Time: 23:12)
We go to the next important topic, what is known as a vorticity stream function equation.
There are certain difficulties while solving Navier-Stokes equation. What are the
difficulties, one is the pressure gradient, pressure gradient terms appears on the right
45
hand side
∂p
,
∂x
∂p
∂y
and
∂p
. So, this pressure gradient term behaves like a
∂z
source term and if you observe we have a continuity equation and we have three
momentum equations. Primary variables u, v, w are there in these three four equations,
but there is no separate equation for pressure. Wherever the pressure is appearing in all
the three equations derivative
∂u
, this is the term first term in the momentum
∂x
equation, x-momentum equation, convective acceleration first term. And function u
multiplying its own derivative
∂u
∂x
is non-linear in nature. Hence treating this non-
linear term is again very trick.
Now, you may have to do many iteration to get a solution so, whether we can have an
alternative to overcome these two main difficulties. So, if you can eliminate pressure
term or and if you can get a equation where such a non-linearity behavior is not
appearing in that equation. Now, such alternative approach is what is known as a
vorticity stream function formulation.
(Refer Slide Time: 25:01)
So, we will do a detailed derivation vorticity stream function formulation. Starting point
is always again momentum equation. So, take a momentum equation and consider the 2D
situation, which means you can consider x and y momentum equation, unsteady term.
So, they are repeated here, x-momentum equation and y-momentum equation, and
46
continuity equation is also written here for the sake of completeness. Now, what we do
this is x-momentum equation referred a equation one, and y- momentum equation is
referred here as equation two. So, we are going to do some manipulation from these two
equations. And we are going to see that.
47
(Refer Slide Time: 25:49)
So, differentiate equation one which is x-momentum equation with respect to y. So, all
the terms in the x- momentum equation are differentiated with respect to y. We follow
similar exercise equation two, which is the y-momentum equation differentiate all of
them with respect to x and subtract the second equation from the first equation. So,
mathematically it is given here; this is the first equation in this bracket, first equation,
which is x-momentum equation, differentiate with respect to y. Similarly, the second
momentum equation differentiate with respect to x, whatever you obtained, subtract one
from the other. So, what we do will take term-by-term, and see how this is done.
(Refer Slide Time: 26:45)
48
Now, we will do that exercise term-by-term. Let us take the first term; first term is the
time derivative term. And you see here,
∂v
∂t
which is coming from the y-momentum
equation, and that is taken derivative with respect to x,
∂v
∂t
is coming from x-
momentum equation that is taken derivative with respect to y. So, subtract and you are
able to get this. Now, this partial derivative can be exchanged with this; similarly this
partial derivative can be exchanged with this. So, common term
∂v ∂u
,
∂x ∂ y
∂
∂t
is taken out and
term appearing inside the bracket. You can immediately recognize the
∂v ∂u
−
, we already defined, which is from the vorticity vector in the first class.
∂x ∂ y
So, this is one component of that vorticity vector
∂v ∂u
−
. So, if you substitute
∂x ∂ y
that expression is written here as
ω
ω z component and that is given by
into this expression, then you get that equation
∂ ω . So, this is the first term in the vorticity
∂t
transport equation, the time derivative term, first term in the vorticity transport equation.
We will extend this procedure for the second term, which is a convective term, again you
can recognize
∂v
, which is coming from the second term in the y-momentum
∂x
equation, take a partial derivative with respect to x then
∂u
∂x
which is the second term
in x-momentum equation take a partial derivative with respect to y. Subtract one from
the other then take a common term
∂
∂x
outside, you get
bracket and this term is same as what is shown here
vorticity.
49
∂v ∂u
−
∂x ∂ y
inside the
∂v ∂u
−
, and we define that as
∂x ∂ y
So, you get
u ∂ ω . So, as you can see here, this is the second term in the vorticity
∂x
transport equation. We are going to repeat this procedure for term-by-term to get a
complete vorticity transport equation.
50
(Refer Slide Time: 29:28)
So, finally, the resultant equation will look like this. First term
detail,
u∂ω
∂x
we have seen and
∂ ω , we have seen in
∂t
v ∂ ω , you can derive. Similarly, you can repeat
∂y
that exercise on the right hand side and you get the equation like this. So, if you look at
this equation, the form the way the equation looks all similar. We had a similar format for
u-momentum equation, except that the variable is now vorticity
ω ; otherwise you are
again able to recognize this is the local and these two are convective kind of term. And if
you put them together, you get total derivative of expression in terms of
ω . The
difference here is you see the function use u, but it is not multiplying its own derivative,
it is the different function. Hence the non-linearity associated with the convective term in
the original momentum equation is simplified in this equation.
So, if I express in terms of total derivative
Dω
Dt
on the left hand side; and then right hand side, is
representing all the three terms here
μ ∇ 2 ω . So, this equation five is
actually what is known as a parabolic in nature. We are going to talk about equation
nature next week. So, we will come to know what is parabolic in nature; right now we
just accept, this is parabolic and that equation five is what is known as vorticity transport
equation.
So, in this class, we have started momentum equation, went over the momentum
equation once again, simplification of the momentum equation, obtain Euler’s equation,
51
Bernoulli’s equation then non-dimensionalization, some important non-dimensionalized
numbers, we did a detailed work in on how to obtain non-dimensionalized continuity
equation, it helps to avoid repeating calculation for different situation. Then we went on
to do another important topic what is known as a vorticity stream function formulation;
in that we did the first part how to obtain a transport equation for vorticity. We will close
here for this class. So, next class, we will start from here obtain governing equation for
stream function and relating vorticity and stream function and few more interesting
topics.
Thank you.
52
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture – 04
(Refer Slide Time: 00:29)
I welcome you all once again to this course on CFD. We are now on to module four of
week one. Last class, we have seen some review on basic fluid mechanics, governing
equations, importance of terms, non-dimensionalization and why you want to do nondimensionalization. Today’s class we particularly see vorticity-stream function
formulation, classification of equations, examples for each classifications, solution
nature.
53
After that we will quickly review what we did towards end of last class. We observed
while solving Navier-Stoke equations, we have four equations, three momentum
equations and one continuity equation; there are four variables, primary velocity
variables u, v, w and pressure; though we have separately equations for velocity. There is
no separate equation for pressure; and pressure acts like a source term in all the three
equations. Another major difficulty is convective term; we noticed that in convective
term, velocity multiplying its own derivative, which behaves like a non-linear term, and
solution is obtained only through iteration. Now there is a question, is there a way to
overcome. So, alternatively, we have to devise the equation, in such a way there is no
pressure term as well as whether we can remove or rewrite non-linearity in the
convection term.
54
(Refer Slide Time: 02:35)
So, towards that we take first 2D unsteady incompressible flow situation twodimensional Navier-Stokes equations. So, we rewrite here full equations, we also write
continuity equations for 2D steady incompressible situation.
(Refer Slide Time: 03:00)
So differentiate equation one that is the x-momentum equation with respect to y, and
differentiate the second momentum equation for v with respect to x, and subtract one
from the other. This is the algebraic steps that we are going to follow, so that is written
here as
∂ of the entire x-momentum equation and
∂y
55
∂
∂x
of entire y-
momentum equation. this operator
∂
∂y
needs to be operated upon each term in this
equation; similarly for the other equation. So, what we do, we will take first term explain
how to do, also for the second term, then the procedure is repeated for the remaining
term.
(Refer Slide Time: 04:03)
So, we will first we will take the first term that is unsteady term, so
coming from the second momentum equation,
∂ ∂v which is
∂ x ∂t
∂ ∂ y , which is coming from the
∂ y ∂t
first momentum equation, subtract one from the other. And we know this partial
derivative can be interchanged, so
∂
∂t
common is taken out,
that. we also know the definition of vorticity,
which is
∂v ∂u
−
∂x ∂ y
is inside of
ω , we learned in the first class, so
∂v ∂u
−
.
∂x ∂ y
So if you substitute definition of vorticity in this expression then we get first term of the
vorticity transport equation, which is
∂ ω , you can repeat this exercise for each term,
∂t
so here I am showing you for the second term, which is
56
∂v
,
∂x
∂ ∂ v ,, which is the second term in the y-momentum equation. Similarly,
∂x ∂x
which is the second term in the first momentum equation, and you take a
velocity is outside. So, this if you do then we get
∂ v ∂u
−
u ∂
∂ x ∂x ∂ y
(
)
∂u
,
∂x
∂ ∂u and
∂ y ∂x
, this is same way
that common term, and here it is exchanged, so the common term is taken out. Once
57
again we recognize the term in the bracket as vorticity, so u ∂ ω
∂x
So, we get second term which is like convection term of the vorticity transport equation.
(Refer Slide Time: 06:10)
We repeat this exercise for each term, and we get a complete equation as this. So,
ρ ∂ ω +u ∂ ω + v ∂ ω
∂t
∂x
∂y
(
2
2
μ ∂ ω2 + ∂ ω2
∂x ∂ y
(
)
on the left hand side; and on the right hand side,
) . if you look at this term each of these term, first term is the unsteady
term, which is the local a acceleration, similar to local acceleration term in momentum
equation and next two terms are convection terms, similar to convection term in
momentum equation. Now we do replace them, rewrite this equation, taking the
Dω
; and on the right hand,
Dt
definition of total derivative so which is
ν ∇ 2ω
So,
equation five that is this equation, it is actually parabolic in nature. We are going to talk
about solution or equation classification in few slides down the line. So, right now we
just take that this is the parabolic equation and equation five is called vorticity transport
equation. So, last class, we had seen up to this point.
58
(Refer Slide Time: 07:41)
We just wanted to review and then we move onto the next part that is the stream
function. We know the stream function definition relating to the velocity
and
∂ψ
=−v
∂x
∂ψ
=u . Here also we start doing some arithmetic and calculus operation. So,
∂y
take the first term, differentiate with respect to x; take the second term, differentiate with
respect to y and add them up
side, you get
–
( ∂∂ vx − ∂∂ uy )
side, which is
∂ ∂ ψ + ∂ ∂ ψ = ∂(−v ) + ∂u . So, on the left hand
∂x ∂x ∂ y ∂ y
∂x
∂y
∂2 ψ ∂2 ψ
+
; and on the right hand side, you can rearrange a little bit, so
∂ x2 ∂ y2
. Again, we are able to observe the term in the bracket on the right hand
∂v ∂u
−
, which is the vorticity.
∂x ∂ y
Hence, we use the definition of the vorticity to rewrite that equation as
2
2
∂ ψ ∂ ψ
+ 2 =−ω ; in other words,
2
∂x ∂ y
∇ 2 ψ=− ω . We numbered this equation as
seven. And as I said before we are going to talk about classification of equation, two
slides down the line, and this equation seven is elliptic in nature. And
59
∇ 2 ψ , if it is
2
∇ ψ=0 , such a equation is called Laplace equation, whereas, if it is
to some source term on the right hand side, which is
equation.
60
−ω
2
∇ ψ equals
this is called Poisson
(Refer Slide Time: 09:46)
We rewrite this equation once again, that is writing equation four which is the vorticity
transport equation, and writing equation seven, which is in terms of stream function
relating to vorticity
relating
ω with
in terms of
terms of
2
∇ ψ=− ω . what we do, we substitute this relationship that is
ψ into this equation, so each of these term
ψ , we will see how it is. We also replace velocity variable u and v in
ψ , we get a equation like this
2
∇ ψ , similarly u is replaced with
sign,
are now written
ω
∂ψ
∂y
∂
∂t
and then
ω
is replaced with
and so on. the common term, common
−ve sign is the common, which is removed, cancelled from the entire equation,
so you get a finally, you get equation like this. if you look at this equation, first this is the
fourth order equation, because you have a fourth order term here. And then in this
equation only
ψ
is the variable, there are no other variables, so it is a complete
transport equation only with variable
ψ .
And this is the four scalar equation, because
ψ
does not have a direction. equation
seven, that is
∇ 2 ψ=− ω , and equation eight, which is a transport equation written
only with the
ψ , these two together are called vorticity-stream function equation. So
if you solve with corresponding boundary condition then you get
ψ
from equation
eight, which is related to equation seven with omega that is vorticity. And from stream
function
ψ and vorticity ω , one can recover the velocity field u and v.
61
(Refer Slide Time: 12:12)
So, now the question is we started the vorticity-stream function equation with a note that
there is no pressure term, but we are also interested to know the pressure in the flow
field. So if one solves using a vorticity-stream function equation, then how to get a
pressure is a question. So, we will setup a procedure to get pressure from vorticitystream function formulation also. Once again we rewrite the momentum equation for the
sake of immediate reference, which is given here, what is given here is the u-momentum
equation, again rewrite v-momentum equation. And then differentiate first momentum
that is x-momentum equation with respect to x, differentiate the second equation, which
is y-momentum equation with respect to y; add them together. I am not showing you the
full all the steps involved in the derivation, we get the term finally, like this, which is
2
∇ p
on the left hand side, and remaining terms on the right hand side.
One can also replace u and v in terms of
equal to
2ρ
ψ , so we get another equation,
2
∇ p
into remaining term. So, you can observe that once you have solve the
previous equation eight, which is at transport equation written with
ψ
as a single
variable then ω , which is the transport equation for vorticity from these two variables
after solution obtained one can get pressure field. Another point observe, as you can see
on the left hand side
2
∇ p
and then there is a source term on the right hand side, so
this equation is actually pressure Poisson equation. So, instead of solving momentum
equation, three momentum equation and one continuity equation, it is also
62
possible to approach by solving vorticity transport equation and get pressure field,
velocity field as well.
(Refer Slide Time: 14:46)
So, we move onto the next topic that is classification of PDE. We know we have already
seen also here; in Fluid Dynamics as well as in Heat Transfer, most of the transport
equations, they are all PDE. In general, PDE can be classified based on order, we have
already seen first order, second order, fourth order based on linearity, similarly based on
the solution nature. Particularly here, we are going to talk about classification of PDE
based on how the solution behaves like that is necessary to know, because that will also
decide what kind of initial boundary conditions required, what kind of final boundary
conditions required, before get into the solution of the equations. And it gives idea the
way or the direction in which the disturbance or solution propagates.
63
(Refer Slide Time: 15:46)
There is a general procedure, consider a linear second order PDE with two independent
variables, which is usually given here. And it is possible to fit any linear second order
PDE into this generic form
A
∂2 ϕ
∂2 ϕ
+
B
2
∂ x∂ y
∂x
and so on. So, it is possible to fit or
rewrite any governing equation into this generic form. this A, B, C are and so on, they
are function of independent variables or constants. we are going to make a classification
based on the discriminant that is
2
B −4 AC ; in other words, if
2
B −4 AC < 0 , that
values happens to be less than zero then equation is or the solution associated with the
equation is classified as elliptic PDE. Similarly, if
and B 2−4 AC > 0 , then it is hyperbolic.
64
2
B −4 AC=0
then it is parabolic;
(Refer Slide Time: 17:10)
We are going to see details of this. So, in elliptic PDE, there is no real characteristics,
there is no specific direction preference. So, for example, if through a stone into a pond
or well, there is ripple generated or a wave generated, and you can observe that ripple or
wave propagates like a circular fashion in all the in all the direction. So, there is no real
direction for this solution. So, information travels equally well in all direction up to the
boundary. In the case of hyperbolic PDE, disturbance propagates at a finite speed in a
limited region within the characteristics curve. There are two characteristics curves in
hyperbolic PDE, compressible flow falls under hyperbolic PDE. And parabolic PDE,
here information travels in only one direction along one characteristics curve.
Having defined the classification elliptic parabolic and hyperbolic one tends to ask the
question what about the Navier-Stokes equation itself. The complete Navier-Stoke
equation that is unsteady term, convection term, three-dimensional along with the
pressure term on the right hand side, does not fall under any one such category
specifically. They are coupled non-linear PDE, and as we have seen before with four
variables.
65
(Refer Slide Time: 18:53)
We will now specifically see what is elliptic PDE, so one of the example that is given
here is Laplace equation or Poisson equation,
∇ 2 ϕ =0 , this is called Laplace
equation. This equation is generic form, it has for pressure or for temperature
distribution, the phi can be any variable. If on the right hand side, if it is not 0, but it is
with our source term, which is given here as
G(x , y )
then that particular equation is
called Poisson equation. If you follow the discriminant procedure, taking the coefficient
values, so B is 0, A is 1, and C is 1, so if you rewrite
2
B −4 AC
then you get -4,
which happens to be less than 0, then you can also conform that this is the elliptic PDE.
So in elliptic PDE, as we have seen before, the solution is not having any particular
direction it moves in all direction equally without any bias up to the boundary point. This
is also given in this figure. So, you have to specify boundary condition on all the four
directions, and solution is restricted full domain.
66
(Refer Slide Time: 20:36)
So, next is a parabolic PDE, again I am giving one example, it is one-dimensional heat
conduction or diffusion equation and it is given for alpha positive, real constant as
∂T
∂2 T
= α 2 , it is a one-dimensional equation and capital T, which is to represent
∂t
∂x
temperature and this small t is for time. And follow the procedure of discriminant
evaluation B = 0, and C = 0, and
equation. So,
A= α , for this equation fitting with the generic
2
B −4 AC =0 . So, we know for that value equation is parabolic in
nature.
So, as you can see here, the time derivative component appears and we have observed
that Navier-Stoke equation, first term on the left hand side is the time derivative term.
Solution advances outward from the known initial values; that means, it only marches in
one direction and you need to specify initial values. So such a problem is also called
marching type problem. And sketch wise, it is given here, so this is the starting, and you
specify initial condition and there is a boundary condition on for different time value,
and solution marches in one direction. You do not come back and try to do boundary
condition implementation at time is equal to 0.
In today’s class, we have done a complete derivation on vorticity transport equation,
understood the advantage vorticity transport equation, how to obtain pressure field as
well as velocity field, once you solve the vorticity transport equation; the next topic, we
took classification of partial differential equation pertaining to solution obtain in Fluid
67
Dynamics as well as in Heat Transfer. We have understood what is elliptic PDE with an
example; we also described, what is parabolic PDE and how does the solution look like.
So we will take another interesting topic in next class.
Thank you.
68
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture – 05
(Refer Slide Time: 00:27)
Greetings to you all. We now move onto module five of this course. And this will end
week one syllabus. We actually did basic review, vorticity transport equation; then
towards end of last class, we started doing something about classification of PDE.
Review of the last few slides, as we mentioned elliptic PDE may have no preference for
direction for information travel or solution propagation. Hyperbolic PDE disturbance
propagates only at a finite speed in limited region. And today we are going to see
hyperbolic PDE. We also went through parabolic PDE by taking example of diffusion
equation. And we also explained we are able to classify Navier-Stokes equations and any
one particular category. It is a coupled non-linear PDE with four variables.
69
(Refer Slide Time: 01:22)
And we had seen this elliptic PDE by taking example of Laplace equation and Poisson
equation. And then we observed, the solution propagate in all direction and this is the
solution domain.
(Refer Slide Time: 01:37)
And we did parabolic PDE by taking example of one-dimensional diffusion equation.
And notice that the solution advances outward as shown here, from the initial value, this
IC is the initial value and solution propagate in one direction outward and such as
solution or problem is called Marching type problem or Marching type solution.
70
(Refer Slide Time: 02:12)
The third category, specifically called hyperbolic PDE; we consider one-dimensional
wave equation, and this is the second order
, where
is some real
constant. And we find out by fitting this with the generic equation, we find the
discriminant value,
and we observed that is greater than zero, and we classify
for such situation equation is hyperbolic. As we have seen in parabolic PDE, this is also
open-ended nature of solution; that means, it progresses and along the two characteristics
curves. So, two boundary conditions are required, because it is the second order
equation.
(Refer Slide Time: 03:10)
71
Now, we know that Navier-Stokes equation in full form does not fall under any one
category; it is a coupled non-linear PDE with four variables. It is parabolic, because it
has unsteady term; it is elliptic in space, because diffusion term. On the other hand, you
can simplify the Navier-Stokes equation for different situation, hence it will results in
different nature. For example, if you consider steady viscous flow problem then you do
not have a unsteady term, you only have diffusion term then the equation falls in the
category of elliptic nature. We can also classify energy equation and simplify energy
equation for different situation to get different nature of equation. So, solution require
one set of initial conditions and boundary conditions at all boundary points for time
greater than zero. Elliptic equations are generally very difficult to solve when compared
to parabolic.
So, usually what we do, we convert steady for example, we have then here steady
viscous flow equation; it is a elliptic equation, it is difficult to solve, so we convert
steady viscous flow or a steady problem elliptic nature into unsteady problem by adding
time derivative term. Now, you march a solution until you get a desired solution that is
until you reach steady state condition. So, we pseudo treat the governing equation,
change the form from elliptic to parabolic. The advantage is we have one initial
condition, progresses in time. It is only a marching in one direction, solution,
convergence obtaining is easy and finally, you get a steady state solution, so this is one
numerical trick that is followed to deal with elliptic nature of equation.
(Refer Slide Time: 05:51)
72
Now, we define nature of equation before that we got all governing equation. The next
step is to know something about boundary conditions. There are four types. The first one
we see Dirichlet boundary condition, here we simply specify a definite value for the
variable. So, for example, T if you are solving temperature equation, t is the variable, so
you can specify t as a function of time, or
of the boundary. And
specifically a value
at x =0 on one set
at another boundary at x = L for all time > 0. So, specifying
a particular value or a function then it is called Dirichlet boundary condition.
Initial conditions, so you can also specify for time is equal to zero, T as a function of x
for all x going from zero to L. This mean the domain computational domain extend in xdirection from zero value to L, end of the domain is L. So, along that x-direction specific
value of temperature T = 0 is given for time = 0 . This is initial condition. And for time
greater than zero at x = L, we have one value; at x is equal to zero, we have another
value. So, you specifically give that value such a type of boundary condition is called
Dirichlet boundary condition. Next is a Neumann boundary condition, here we specify
the derivative of the dependent variable. So, for example, you say
in the previous case, we said
derivative,
at x = L. So,
a specific value, here we are specifying the
at x = L for the same time ≥ zero.
(Refer Slide Time: 08:11)
73
Next, it is a Cauchy boundary condition. We have a mix of Dirichlet as well as Neumann
type. So, for example, in this problem figure, along this boundary zero to x, we specify a
derivative condition
on one side; on the other side, we specify a Dirichlet
boundary condition specific value at
. We have also another type, what is known
as a Robin’s condition, where the derivative of the dependent variables itself is specified
as a boundary condition. So, in this case, for example,
is given as
with
some coefficient, so this is what is known as a Robin’s boundary condition. So,
whenever you are going for a solution, you need to identify what kind of boundary
condition you want to impose, whether it is a derivative boundary condition or a specific
value of the boundary condition.
(Refer Slide Time: 09:19)
Next, we have also have to know what is the type of problems. So, there are two
classifications; one is boundary value problem, here independent variables are specified
on all boundaries. For example, steady state heat conduction equation is given here,
. And we know from previous class, this is the Laplace equation, and this
equation falls under elliptic nature of solution category. Now, boundary condition is
74
specified on all the boundaries. So, in this, variable is T – temperature and domain going
from x as well as in y. So, you specify boundary condition in all x and y.
75
(Refer Slide Time: 10:12)
Next category is initial value problem, here at least one independent variable has an open
region. Example - unsteady heat conduction problem, same equation that we had seen
before; if you add time derivative, it becomes unsteady heat conduction problem. And
we know it is a parabolic in nature, and the time starts from zero to infinity range. And
we specify temperature value, temperature is a variable here, is specify a temperature
value at time = 0. And there is no value specified at time is equal to infinity, so that is
why it is called initial value problem. The one variable, the variable has a open ended
solution.
By now, you have learned some aspects of CFD, and you will learn more aspects in
future classes. After this, let say you are ready to practice CFD. You have multiple
options here; either you write your own code or you have inherited code from somebody
or from open source. And another option to use any commercial software; here again in
commercial software, all the features are available, but some micro programming maybe
required from problem to problem. Whatever the case, all the numerical strategies that
you are choosing, for example, grid, order of accuracy, convergence criteria, matrix
inversion procedure, time steps and so on, all these have to be proved. Now, this stage of
CFD is what is known as a validation case. For this validation, there are many test
problems available.
76
These problems are simple in flow or flow over simple geometry, and they have features
representing features in complex flow. And these problems are tested and many results
are available in open literature either numerically or experimentally. So, one has to take
these standard bench mark cases, and first to prove all the numerical strategies that you
have chosen for this problem, compare the results obtained by your own strategies
against results available or reported in the open literature that stage is what is known as
validation stage. Now, there are many test problems available; in this particular lecture, I
am taking only few examples, some of them represent internal flow problem, some of
them represent external flow problem. Problems are flow in a cavity, flow through
backward facing step, flow passed a cube mounted in a channel, and boundary layer
problem. We will go into details of these flows from now.
(Refer Slide Time: 14:08)
So, here you will see few examples. The first one, I am showing here is lid driven cavity.
So, it is a cavity the hash mark that is shown on the side to represent it is a wall; and the
top, there is a lid and that is driven with a velocity u = U and v = 0 . And a boundary
condition imposed for this problem on all the sides, because you have already mentioned
it is a wall, on all the sides we put the velocity equal to zero that is u = v = 0 and such a
boundary condition is called no slip. And we also know if we specify a value for the
variable, it is called Dirichlet boundary condition. So, why are we interested in this
problem, this problem is very simple in nature, because it is rectangular, but there are
many features that are present inside the problem appears in
77
many other complex flow as well. So, there is a primary vortex and there are vortex in
the corner depending on the velocity condition, the vortex will grow in size, and you get
velocity distribution etcetera.
Depending on the velocity and depending on the size then you can define the Reynolds
number and it becomes either laminar flow or turbulent flow. The centre of the primary
vortex is offset, at top right corner for Reynolds number hundred. Then it moves towards
geometric centre of the cavity with increase in Reynolds number. So, the problem though
it is simple by going on changing the Reynolds number, it becomes slightly complex and
the way the vortex behaves also differ. Secondary vortices appear very near both right
and left bottom corners.
(Refer Slide Time: 16:16)
Next problem – test case problem is usually the backward facing step. Here simplified,
this is the inlet with velocity given as a parabolic inlet; and the top, there is wall that is
why you see hash mark; and in the bottom, there is a wall up to some distance then there
is a step and then these are step is also a wall, and then there is another wall in the
bottom, so because the step is facing the flow backward this is called backward facing
steps. The step has a height given by D, in the channel original channel width has a
height H. Now, because with this wall, and the top and everywhere is specify a boundary
condition u = v = 0.
78
(Refer Slide Time: 17:14)
And if you look at the flow pattern, so flow separates at this corner and then it comes and
reattaches. There is a recirculation zone, and reattachment point. The way where it
reattaches, what is the recirculation zone length depends on the Reynolds number and
the flow condition. And similarly, you also get to observe, these also secondary bubble
on the top wall, and the size of the bubble where the location the bubble depends on the
condition of the Reynolds number or any other flow conditions. There is also a another
characteristics what is known as a expansion ratio, which is nothing, but the channel
height to the step height and that decides also some flow parameter. Corner vortex
steadily evolves into a recirculation zone, depending on the Reynolds number. And
secondary recirculation observed on the channel upper wall.
79
(Refer Slide Time: 18:28)
So, we have seen example for two external flows. The next example is flow passed
cylinder circular in cross-section, square in cross-section; this falls under category
external flow. So, here flow pass a circular cylinder depending on the incoming left hand
side is the incoming velocity, what is shown here the uniform velocity of
. And there
is a separation point, and in this problem separation point for this geometry is not fixed,
it keeps moving oscillating on the surface, and where it oscillate, it depends on what is
the condition here, inlet condition and whether the flow is laminar or turbulent. Now,
behind the geometry, there is a one common famous one von karman vortex shedding,
and you can have a situation where it is laminar boundary layer transition and turbulent
boundary layer or it can be laminar boundary layer, laminar separation laminar wake, or
you can have a turbulent wake. Wake is nothing, but the flow region behind the
geometry that is what is marked here, and it is unstable and there is a shedding antisymmetrically at regular intervals from the cylinder.
80
(Refer Slide Time: 20:08)
Similar problem, but the geometry is square. The big difference between circular
cylinder and square cylinder is separation points are fixed that is at corner both top as
well as bottom. Now, that decides the dynamics the wake very differently. The flow
separate from this corner, the separation angle, and shear layer separate rolls into wake
or vortex roll up vortex shedding in the wake. So, for high Reynolds number, the flow
separates at leading edge.
(Refer Slide Time: 20:50)
81
Then third problem is the flow past flat plate and that forms a boundary layer. In this problem, that is
shown here incoming flow is the uniform velocity and what is shown here is the plate representing flat
plate, and so the flow starts from the leading edge. Initially it is laminar then there is a transition then
there is a turbulent. And later we will see the definition of boundary layer thickness, so whenever the
velocity reaches ninety-nine percent of the free stream velocity then you call that is a boundary layer
thickness. And the turbulent boundary layer again has sub classification, viscous sub layer, buffer layer
and so on. So, this forms another test case.
(Refer Slide Time: 21:50)
The next problem is flow past cube mounted in a channel. And you see two views of the
same problem, here is the channel, so upper is a wall and lower is a wall. And there is a
cube that is fixed to the bottom of the wall. And if you see from the top, and you see that
it is mounted in the centre in z-direction. And
is the velocity – incoming velocity or
it can also be a here it is shown as uniform velocity, it can also be a parabolic velocity
profile.
82
(Refer Slide Time: 22:18)
Now, why it is so complex, the geometry is very simple, so the incoming flow we will
feel the pressure or the presence of the geometry and there is a separation from the wall,
and forms what is known as a horse shoe vortex, and then behind the geometry it forms
what is known as arch vortex. So, prediction of this is critical. Now, this geometry has
many application, so depending on the height to the site, it can be represent models of
high rise building or it can be thought of as chips on a electronic board. So, all these test
problems all are very simple, but the flow feature represent flow feature noticed in many
complex situation. So, whenever you write a code or whenever you setup a numerical
scheme in a commercial software, you are suppose to validate by taking bench mark
cases and many literatures are available to get results and to conform the result that you
obtain again result reported in standard literature. So, with this, we come to end of week
one, in week one, we have seen all the important topics. And in week two, we will
actually start CFD techniques.
Thank you.
83
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture – 06
(Refer Slide Time: 00:35)
Greetings you all; last week, we had seen governing equations, boundary conditions and
some test cases. We are now onto the week two, and this week, we will see important topics,
computational domain, grid definitions and examples, Taylor’s series expansion, how to get
different forward, backward, central difference schemes, and higher order accurate scheme,
finite difference for non-uniform mesh, derivation of higher derivatives and mixed
derivatives. We will also see how to obtain finite difference formula by polynomials
procedure.
84
(Refer Slide Time: 01:08)
So, in general, there are three steps in CFD; pre-processing, solution and post processing. So,
in pre-processing, we just define definition of the problem, physical modeling of the problem,
then computational modeling. We can simplify the physical problem and do a modeling then
decide the domain, how much it should go in x-direction, how far it should take in other
directions then decide the type of mesh, choice of boundary condition depending on the
problem.
(Refer Slide Time: 02:02)
85
And in solution, we decide the discretization methods, then once you discretize the governing
equation, we get algebraic equation. We also setup few other numerical strategy, we are
going to look at that later. Then we invert the matrix, so there are again different ways of
doing matrix inversion. There if a solution progresses, where to stop; how to decide the
solution is reached the desired condition that we are looking for that is the deciding
convergence. And so decide terminating the simulation. So once we obtain solution, then
what are we looking for the post processing. So, you can visualize the results, you can
visualize or plot only the primary variables; so if you are solving for velocity u, v, w are
primary variables. You can also plot the derivatives of stream function is a derivative,
vorticity is the derivative.
You are also interested to find out say for example, force exerted or thrust developed that also
can be estimated. And if you are solving unsteady problem, then you can obtain all these
instantaneously or you can average and get a bulk quantities. You can represent the results
either in line plots or contour plots or super imposed one over the other plot of kind of plots.
Then post processing initially we do a simple form, you can also go to the advanced stage,
like find out the correlations or where the minimum, where is the maximum etc. So these are
all stages in post processing. So, we understand there are three main stages; pre-processing,
solutions and post processing. So, in this course, we are going to particularly look at sub
topics in each of these three main stages.
(Refer Slide Time: 04:26)
86
The first one is the pre-processing. We mentioned that domain where you are solving needs
to be specified, and this is known as a computational domain. By definition, it is region of
interest where solution is required and extent of the domain is important. So, how far you are
going in particular direction is important. The domain extension affects the solution accuracy,
computational time requires and the boundary condition enforced should not influence the
solution. So, the problem of interest and the boundary condition implementation should not
influence or affect the solution in the region of interest. Grid is a discrete representation of
the domain. So once you decide the domain, then you need discretize or you need to generate
mesh where you are solving governing equations. Grid divides the solution domain into
number of finite number of sub-domains or elements or control volume. So, grid or node
represents location where variables are to be solved for.
(Refer Slide Time: 05:59)
Just like computational domain grid also influences solution accuracy, rate of convergence
and computational domain computational time that is required to solve and get the answer. In
general, there are two types of grid, one is called structured grid, other one is called
unstructured grid.
87
(Refer Slide Time: 06:25)
So, I am just trying to explain with help of two example problem. So, what is shown here is
flow past square cylinder. The shaded portion what you see here is the square cylinder. Flow
is coming from left and impinges on the surface then we already seen in square cylinder
separation points are fixed and there is shear layer separation and vortex shedding happens.
There is a periodicity associated the shedding, and frequency of that vortex shedding is also
important. This is standard benchmark problem. Another case is flow past two-dimensional
hill. Again incoming flow is from left, this has slope and depending on this slope, the flow
may separate; if it separates, it comes back and reattaches downstream somewhere here that
depends on the slope of the front portion. If it is not separating, then it follows the geometry
and then flow afterwards. This geometry also can be thought of undulating surface.
88
(Refer Slide Time: 07:57)
So, first problem, square cylinder is placed, and it is three-dimensional simulation. So, we
have one view in x1, x2 plane; x1 refers to x direction and x2 refers to y direction. In other
view, x1, x3 are xz plane. The flow is coming from left to the right, and we specify inlet
condition uniform inflow Un equal to 1, and Vin in and Win equal to 0. So, the other two
components of velocities are 0, only U velocity is 1. And the characteristic dimension for this
problem is diameter of the cylinder, which is given here as D. So the domain, computational
domain is represented based on this characteristic dimension D, so you go in this problem
what is shown here is the 7D, from this side of the cylinder, inlet domain is placed at 7D;
similarly the exit is on the right more side, which is placed at a distance of 18D from this
surface of the cylinder.
Similarly, you can prescribe the location of the boundary in other two direction that is x 2 as
well as x3. So, now the question is how this 7D is decided. Why not it is 9D or 5D; similarly
for other dimensions; so this decides the solution accuracy and there is particular exercise that
one has to do before arriving at extend of the domain. Now coming to the boundary condition
on the surface of the geometry, for this problem, the geometry is fixed, it is not moving,
hence we specify no slip condition on the surface and all the four surface as well as span
wise. Then later we will see, what is radiation boundary condition, which is posed on the
other outlet condition, there is boundary condition called slip boundary condition and that is
specified in x2 direction, so that is boundary here as well as boundary here – top as well as on
the bottom, in this plane view, x1, x2 view.
89
And in third direction that is x3 direction z-direction, the geometry is actually 2D, which
means there is only one and in other direction it will extend infinity. And we have taken
domain size to be 4D, again there is a question how 4D is arrived. This again required some
experience and looking at the problem nature. So, in this domain in the x 3 direction is
extended infinitely, and because of that the boundary condition posed is periodic, which
means whatever solution happens at this end is posed at this end. Similarly, whatever solution
is obtained here on one side of the z-direction is posed on the other side of the z-direction,
such a boundary condition is called periodic boundary condition. So, you observe here, if a
problem is defined, there is need to specify optimally domain extend in all the direction, and
specification of the boundary condition in all the boundary locations.
(Refer Slide Time: 12:12)
Here is an another example problem, the geometry is somewhere here, and the flow is from
this direction and go into the other direction. And you can see here, only one quarter of the
geometry is shown, this is supposed to be the domain, one quarter of the actual domain, the
problem there is a symmetry, hence this is taken only one half and then you can repeat by
taking a mirror image of this domain.
90
(Refer Slide Time: 12:50)
So, we go to the definition of grid, we mention once we define computational domain, we
need to generate mesh including the geometry in the domain. And there are two
classifications mainly; one is the structured grid, another one is the unstructured grid. We
look into the definition of structured grid. So in structured grid, it consists of families of grid
lines, so in this figure, that is shown here, black line that you are seeing running vertically as
well as horizontally. Each one of them represent one grid line, and all the vertical grid lines
are one family, and all horizontal grid lines are another type of family. So in structured grid,
grid line that belongs to one particular family cross grid line that belong to the another family
only once. So, if you look at this figure, horizontal lines belong to one particular family
crosses the vertical line that belongs to another family at only one location. So for example,
here, the same horizontal line, it may run through, but it will meet or cut or cross another
vertical line at some other location.
Similarly, if you take any vertical line which belongs to one family, it crosses any other
horizontal line at only one place. So, if you take this particular line, it crosses the horizontal
line here then if you go along the same grid line at this location, it meets horizontal line at
some other point. So, it crosses another family at only one location. Similarly, grid lines that
belongs to the same family do not cross each other. So, in this case, as I mentioned before, all
the vertical lines are one family, all the horizontal lines are another family. You can observe
here vertical lines do not meet each other, so any vertical lines, it runs parallel to another
vertical line, another vertical line, another vertical line, they do not cross each other.
91
Similarly, if you take horizontal line that belongs to all horizontal line belongs to one family,
they run parallel to each other, and they do not meet each other.
(Refer Slide Time: 15:26)
So, node is defined as intersection of grid lines. So as I mentioned before, if you take one
horizontal line and one vertical line, the intersection point is actually a node. So, in structured
grid, each node has same number of surrounding nodes. So, if you consider here this is
particular node has surrounding nodes, say one top, another top, another node on the top, so
three nodes on the immediate top, then one node on the side -right side, one node on the left
side. Similarly, three nodes are there on the bottom, so 1, 2, 3 for this particular node. And
you go anywhere else in the domain, so for example, if you take here then you observe that
same three number of nodes, three nodes on the top, one left, one write and then three nodes
on the bottom. So, in structured grid, each node has equal number of surrounding nodes. So,
there are two important points to qualify or to qualitative structured grid one family line do
not cross the same line, and one family line crosses another family line only once.
And depending on the overall arrangement of the grid, grid can be called either O-type or Ctype or H-type. For example, in this, this is the flow past aerofoil, it is the structured grid, and
if you look at the overall shape, it looks like a alphabet C, so this is what is called C-grid.
And in this case, it can be body fitted, so this is an aerofoil, and you generate one family of
line close to the surface. You following the surface of the geometry, so you get that lines
shape similar to the geometry shape, and another family of line running perpendicular or in
92
other direction emerging from the surface, so you are seeing here all this line almost vertical
after some distance, and it is almost horizontal that is another family of line.
(Refer Slide Time: 18:11)
So, what is the advantage, in structured grid, as we have seen, we know for a particular node
what are the surrounding nodes and we know it is the same number of surrounding nodes
throughout the domain so that makes our job easier, so it is easy to have neighbor
connectivity. And because of that it is easy to do programming, because we know that you
can definitely say so many number of points are there, and it is same throughout. And later
we will see, all discretization of the governing equations will result in matrix form, in the
sense AX = B that kind of form we will get; and A is the coefficient matrix, which usually
comes from grid related quantity. And in structured grid, because of this specific behavior of
equal number of grid points everywhere the matrix appears to be very regular, hence there is
definite procedure or simplified procedure to invite a matrix.
It is not only always advantages, it is also disadvantages. It is suitable for simple geometry.
And there are regions where you are actually looking for a gradient or flow undergoes
through gradient or there is a sudden change in the geometry where you want to have a
clustering of mesh, and because it is so structured, it is very difficult to have a concentration
or clustering of grid points. Similarly, there are some flows, there are some region in flow,
where you are looking for a specific region, for example, there is injection, there is a low
pressure region, or there is a heat source then those specific regions requires grid of different
93
type or very fine mesh or completely a different from the structured mesh, so it is very
difficult to have a structured grid throughout the domain for this specific regions.
(Refer Slide Time: 20:35)
So, here is another example, this is the plate inclined and on the background you have seen
structured mesh, regular rectangular mesh. And what is shown here is zoomed view, very
near the geometry, and you can observe, the same uniform mesh everywhere, because you
want to have a fine mesh near the geometry and that is possible to do, but elsewhere you get
fine mesh.
(Refer Slide Time: 21:08)
94
This is another example, flow past two-dimensional hill. And this is again a body fitted grid.
So as you can see the geometry is going like this, and you have one family of grid line
following the geometric profile shape very closely, and it spreads as you are going in that
direction. There is another family line, which is showing here vertically and you also
observed that it changes slightly to satisfy a condition called normality of the surface, and this
is the body fitted grid. So, for the same geometry, you are seen here two types of two mesh,
both are structured, both are body fitted. The bottom one is the coarse mesh, the top one is the
fine mesh for the same geometry by the same grid arrangement, but number of grids are more
in the fine that is shown in the top and less that is shown in the bottom is called coarse mesh.
So, in today’s class, we got the definition of domain, then we went to the definition of
structured grid. I try to explain with some examples, and before that we had seen steps
involved in CFD, there are three main steps, and we did some explanation on task involved in
each steps. So, in next class, we will see examples and definition of unstructured grid and
then we slowly move onto finite difference procedure.
Thank you.
95
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture – 07
(Refer Slide Time: 00:55)
Welcome you all again this course on CFD. Today, we are on module two of week two. Last
class, we had seen grid, computational domain, steps involved in CFD. And today’s class, we
will go to next category the grid that is unstructured grid then we get into the procedure of
finite difference formula. So, in structure grid, we learned the family of grid lines, one family
of grid line do not cross same family of grid line. Then grid line that belongs to one particular
family cross grid line that belongs to another family only once, and we also learned that the
number surrounding nodes for every grid node is the same for the structure grid. We also
learned the advantages as well as disadvantages associated with structure grid.
96
(Refer Slide Time: 01:43)
So, there should be an alternative, which is known as unstructured grid. Here the elements or
control volume can have any shape, so there is a definite shape and that shape is same in case
of structure grid. Whereas in unstructured grid, you can have any shape, so what is shown
here is an example, here a flow passed aerofoil with front portion as well as attachment on the
back portion. As you can observe here, you have elements of different shape. It is usually a
triangle or quadrilaterals for the case of 2D or tetrahedral or hexahedral in the case of 3D. In
general, grids can be orthogonal or non-orthogonal. In the case of orthogonal grid, the lines
meet perpendicular; in the case of non-orthogonal, they do not meet at right angles.
(Refer Slide Time: 02:50)
97
Because of this grid arrangements, it is very well suited for a complex geometry, so as shown
before just before, flow pass on aerofoil with attachment in the front as well as the back with
the different geometry, second of a complex arrangement. Just one example, structure grid
generation is difficult; hence unstructured grid is very well suited. And we also observed
there is a flexibility in terms of clustering, so wherever there is a geometry change, or
wherever there is a flow change, flow condition change, wherever there is a gradient then you
want to have a fine mesh; elsewhere where there is a flow is can have a steady no geometry
then you do not handle to have a fine mesh, such flexibility is possible. It is also possible to
have even within the fine mesh, adjustment of growth rate or aspect ratio. But then you
observe that it is show uncomfortable to define exactly the node connectivity.
So for example, if I zoom one area, and such that mesh arrangement, you can see here one is
number 1, 2, 3, 4 they all are all elements and for each element, there is a node that is
defined, so for example, element 1 has node 9, 8, 5. Element 2 has node 12, 8, 9; similarly for
node 3 has three nodes and so on. So, one has to build the table explaining elements and
surrounding element nodes. So for example, element 1 has element 2, 5, 6; so node 1 has
element 2, 5, 6; and element 1 and 2, shares node 9 and 8 so that is what is shown here the
bracket 9 and 8. Similarly, element 5 and element 1 shares two nodes that is 8 and 5 that is
what is given here. Similarly, element 6 and element 1 shares two nodes 5 and 9 that is what
is given here. So you have to go and build a table connecting node, element, surrounding
node and surrounding element.
There is also another way of writing, so for example, node 8 is shared by five elements, so in
this case, it is 1, 2, 3, 4, 5. So, you can also build a table like this node eight that is this node
is shared by so many elements 2, 3, 5, 4, 1; so if I go in the cyclic order 2, 3, 4, 5, 1. So, one
has to build a table explaining nodal connectivity and elemental connectivity so such
complex situation is there for unstructured grid. when it comes to moving boundary, so when
it comes to problem where the geometry is moving, for example, elastic material or the
balloon moving or flow in this vibration, this is another example problem in such cases, grid
generation and to prove that generated grid at every instant of time, or every movement of the
problem requires enormous computational time, and there is a difficulty before going to the
solution. So, though unstructured grid looks very good for complex geometry or complex or
gradient change problem, flow condition change problem. It also has its own disadvantages.
So, obvious question is whether you can combine advantages of structured grid and
98
advantages of unstructured grid and get into the form what is known as hybrid kind of a
arrangement, yes, it is there. You can have hybrid kind of arrangement.
(Refer Slide Time: 07:31)
So we are going to see some examples of computational grids, this we have already seen
structured grid and unstructured grid for the same problem and same domain.
(Refer Slide Time: 07:43)
And even in the case of structured grid, we have a uniform mesh in the sense if you take all
the vertical lines, all the vertical lines are equally placed. So, if you say Δx is the distance
between one vertical line and the next immediate vertical line, the same Δx is maintained if
99
you go elsewhere. So, if you take this grid line, the next grid line is at a distance of Δx from
this grid line. Similarly, for the other direction, all the horizontal lines are equally placed, this
is what is known as uniform grid. And for the same problem for reasons of geometry change
or gradient happens, you do not want to have a uniform mesh, but you can have a fine mesh.
So, if you take for example, all the vertical lines, they are very closely placed here, then it is
slowly stretched, you get Δx higher, Δx when you far of in this direction. Similarly, if you
take all horizontal lines, then it is very finely placed near this bottom, then it is slowly
stretched and we get coarse mesh as you go away from this.
And you get here a different mesh size compared to mesh size in this corner. And elsewhere
it is different compared to some other place. So, this is what is known as non-uniform mesh.
So, the problem where you do not want have a uniform mesh throughout in some region then
it is possible to have combination of structured mesh. So, in some region you can have a
uniform mesh, structured grid still, in some other region, you can have a non-uniform mesh
structured grid still. So this combination also one has to decide where to have a fine mesh,
where to have a coarse mesh.
(Refer Slide Time: 09:47)
This another example is again a structured grid, as I mentioned at that time, depending on the
final shape of the grid, you can call it as a C grid or O grid. And here is the example for Ogrid; the centre that you see here is the geometry, the grid which is generated body fitted the
geometry and very close, it is very dense, near geometry is very dense, that is why we are not
100
able to see very clearly the grid line, but as you move away, it is stretched and you get clear.
And it is structured grid, so it follows the definition of structured grid. And all the grid lines,
they follow the orthogonal condition and you get to see here. And this is what is known as a
blocked structured grid; as I mentioned before, you can divide the entire computational
domain depending on the nature of the geometry or nature of the flow condition, you can
divide the region, and for each region, you can separately generate grid.
So, here is the example, you see bottom, there is a rectangular kind of a domain; and there is
a doom, which is circular kind of a domain, and here you have a uniform mesh in the
rectangular type of a domain. For one part of the domain, there is a uniform mesh then there
is another type of uniform mesh then third type of uniform mesh here. And then on the top –
doom, you have again structured grid, but it following a body fitted, some kind of a C shape
grid. So, what you have to be careful is the interface between one type of grid to the another
type of grid and that is need to be taken care of while solving. So, it is possible to generate
mesh region wise, zone wise, different type of structured grid or combination of structured
grid and unstructured grid.
(Refer Slide Time: 12:02)
One more example is overset grid, so as you can see here, the background blue color is the
uniform mesh and then there is a body fitted O type grid that is embedded over the
background mesh this is what is known as an overset grid.
101
(Refer Slide Time: 12:25)
Then this is again example for body-fitted grid, and this is geometry, which represent aerofoil
and you have a grid one family of line following closely the geometry and another family of
line that is running normal or emerging from the surface, and it follows the orthogonal
condition, so wherever the other family of line changes its gradient then this line, another
family line changes to satisfy normality condition or orthogonality conditions.
(Refer Slide Time: 13:12)
So, we have seen different examples for different types of grid. There is separate procedure
available to generate a grid itself. We are going to the details of the procedure, I am just
102
going to mention the procedure one is known as algebraic method, where you just solve
algebraic equation to get grid. Then there is a differential equation procedure and you can
recognize it has either elliptic type or parabolic type or hyperbolic scheme available. Then
there is also a variational method, and there is also a procedure called adaptive grid. So, in the
case of geometry, changing it shape as a function of time, or as a solution progresses then you
want to have grid adapting to the changes, so that is also possible and that is called adaptive
grid. To understand more about grid generation, you need to go to the separate detailed
procedure that is not covered in this course.
(Refer Slide Time: 14:52)
So, next important topic is how to discretize the governing equation. So to know or to do that
one has to know different discretization procedure available. A foundation for all this is finite
difference formulation. And in the case of difference formulation, it is basically derived from
Taylor series expansion of a function. So, if you are given a function f(x), the function can be
expanded, say in this case, it is expanded with respect to Δx in positive direction. And it is
∂f
Δx x 2 ∂2 f
Δx x3 ∂3 f
+
+
+... . and it
given in this formula, which is f ( x + Δxx )=f ( x ) + Δxx
∂x
2 ! ∂ x2
3 ! ∂ x3
( )
( ) ( )
goes on with many other higher order derivative terms. We have written limitted to only third
derivative.
103
You can also recognize that this follows some sequence, hence it can be rewritten in this form
∞
as f ( x ) + ∑
n=1
Δx x n ∂n f
. So you can cross check by substituting value for n in this and see
n ! ∂ xn
( )
whether you can recover this equation expanded form of that equation. Now as you can
observe partial derivative terms are appearing here, so for example, this term, which is
∂f
is
∂x
the first derivative, second derivative and third derivative. So, if you are interested to get only
the first derivative then you limit the expansion here and then get formula.
(Refer Slide Time: 16:51)
So, we will see that here. So, if you solve for
∂f
that formula is written here and all other
∂x
terms are taken to the other side. So, representing the sum of all the terms with the factors of
x and higher than we get
∂f
f ( x+ Δx x ) − f ( x )
of
and remaining term, which is shown in this
∂x
Δx x
highlighted portion. They are all not consider and Δx one is the leading term and that is ofx one is the leading term and that is of
order Δx one is the leading term and that is ofx, so this formula which is written here for the first derivative taking only the first two
terms and not considering other higher order terms such a formula is called first order finite
difference scheme with order of accuracy Δx one is the leading term and that is ofx. this you got expansion going forward in the
direction, in other words, f (x) is expanded with f(x+Δx) and +Δx is forward in the direction.Δx one is the leading term and that is ofx) and +Δx) and +Δx is forward in the direction.Δx one is the leading term and that is ofx is forward in the direction.
104
(Refer Slide Time: 18:24)
Basically, what is Δx one is the leading term and that is off,
∂f
, it is actually the derivative. So if you represent the function with
∂x
respect to x, and this is the function then b is where you are trying to evaluate the function,
and c is where you are trying to get expansion, so it is f(x+Δx) and +Δx is forward in the direction.Δx one is the leading term and that is ofx). So function is expanded in
forward direction. So, you show it here f(x) and f(x+Δx) and +Δx is forward in the direction.Δx one is the leading term and that is ofx). So,
∂f
is actually the derivative or
∂x
slope at this point x, and you can also represent in terms of i notation, so x is i there is a point
of interest, so x+Δx) and +Δx is forward in the direction.Δx one is the leading term and that is ofx becomes i+Δx) and +Δx is forward in the direction.1, so f(x+Δx) and +Δx is forward in the direction.Δx one is the leading term and that is ofx) becomes f(i+Δx) and +Δx is forward in the direction.1), f( x) becomes f(i) and you get
formula like this. And this is forward difference formula for the first derivative. And you can
observe that as you decrease the Δx one is the leading term and that is ofx, c becomes closer and closer and you get better
approximate of the first derivative. You can follow a similar procedure to get what is known
as a backward difference formula for the first derivative, and that is shown here as
f ( i ) − f ( i− 1 )
. So, this is forward difference and this is backward difference.
Δx x
So in this class, we have seen unstructured grid, examples for unstructured grid, advantages
and disadvantages, how to combine different unstructured grid or unstructured grid with
structured grid or different structured grid depending on different region in a problem. Then
we started building finite difference formula for the first derivative.
Thank you.
105
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture - 08
(Refer Slide Time: 00:29)
Welcome you all again to this course on CFD. We are now onto module three of week two.
So far, we have done definition of computational domain, structured grid and unstructured
grid, and how to obtain difference formula from Taylor’s series expansion. In today’s class,
we will take this to the next level of obtaining finite difference scheme for first as well as
second derivative, and then how to obtain higher order accurate scheme again by all the three
methods for the both first as well as second derivative. After that we will move to the
remaining syllabus content in the subsequent modules.
106
(Refer Slide Time: 01:24)
So, towards end of last class, we have derived forward difference scheme from Taylor’s
series expansion and by using i notation form, we wrote expression for first derivative as
at i is
∂f
∂x
f ( i+ 1 ) − f ( i )
∂f
. And graphically it is shown here; f on y-axis, x on x-axis, and
is
∂x
Δx
evaluated at point b; for the function that is represented here. And we also wrote down the
final formula for the same first derivative by using backward difference scheme and that is
shown here as
f ( i ) − f ( i− 1 )
∂f
=
. We also noticed that this is the order of Δx, which is ax, which is a
∂x i
Δx
|
leading term that we have not consider. It also to be noted the derivative error associated with
the derivative gets reduce as the Δx, which is ax is reduced. Now, in today’s class, we will see detail steps
on how to obtain this backward difference scheme formula.
107
(Refer Slide Time: 03:03)
So, as we did for difference scheme, we write down Taylor series expansion for the function
f(x) in backward direction as f ( x − Δx )=f ( x ) − Δx
( ∂∂ fx )+. .all other higher order terms. And
you have to notice that this is alternate sign with Δx, which is ax first term, then third term and so on. As
we did in the case of forward difference scheme, one can also write the entire expression in
∞
this format f ( x ) + ∑
n=1
( − Δ x )n ∂ n f
and all other higher order terms. So, we are interested only
n!
∂ xn
( )
in the first derivative, so we take only the term
∂f
and remaining terms are not consider. And
∂x
so this Δx, which is ax is taken to the other side then we are able to write in i form
and this also of the order Δx, which is ax.
108
f ( i ) − f ( i− 1 )
∂f
=
,
∂x i
Δx
|
(Refer Slide Time: 04:30)
So, in the next is we had forward differences scheme, backward differences scheme, there is
also what is known as a central differences scheme. So, in forward differences scheme, we
had expression for example, for
∂f
at b is related to values of the function at b and c. And in
∂x
the case of backward differences scheme, it is related to value of the function at b and a.
Now, in central difference scheme, it is related between a and c. Now, we will see the steps.
So, we again write down expression for Taylor series expansion f(x+Δx) like this, and (x-Δx)Δx, which is ax) like this, and (x-Δx, which is ax)
as shown here in equation 4, and these two are familiar. Now, we have to do again a small
arithmetic operation, and we observed here
∂f
∂f
, another
from equation three and four
∂x
∂x
respectively.
109
(Refer Slide Time: 05:39)
So, if you subtract equation four from equation 3 so this is equation 4, which is the backward
expansion formula. And this is expansion in the forward direction. So, if you subtract
equation 4 from equation 3, you can get f ( x + Δx ) − f ( x − Δx ), the first term get canceled,
second term, it becomes positive, so 2 Δx
∂ f 2 Δ x 3 ∂3 f
+
+... .+Δx) like this, and (x-Δx) all other higher order
∂x
3! ∂ x 3
( )
( )
terms. Again we are only interested in the first derivative here, so we retain the first
derivative and take remaining terms to the other side. So, if you write down
∂ f f ( x + Δx ) − f ( x − Δx )
=
+O ( Δ x )2, and here it is Δ x 3, and this Δ x here when it is divided
∂x
2Δx
here, the power gets reduced by one, so it is of order Δ x 2. In i form, it is written here
∂ f f ( i +1 ) − f ( i− 1 )
=
+O ( Δ x )2 .
∂x
2Δx
110
(Refer Slide Time: 07:11)
Now, we will also see how to write down difference formula for higher derivative. We had
seen so far f ( x + Δ x ) ; now we can also do the expansion for any length of Δ x. So, what is
shown here is for 2 Δ x, so f ( x +2 Δ x ), the formula is almost same except that Δ x is now
replaced with 2 Δ x. So, if you subtract equation 5 from equation 6, because we are interested
in the second derivative
∂2 f
. And we need to have other terms cancelled. So, we do
∂ x2
operation subtracting equation 5 from two times equation 6, so we get f ( x +2 Δx ) −2 f ( x + Δx ) ,
then some of the term will get cancelled. Now, you see here only the second derivative term
∂2 f
. We are again interested only in the second derivative, so we retain that on side
that is
∂ x2
and bring all other terms to the other side. Again, we have written here up to the next term
only all other terms are not written here. So, if you bring Δ x 2 from one side to the other side,
this Δ x 3 will get reduced to only Δ x.
111
(Refer Slide Time: 08:51)
If you do that way then we get
f ( x+ 2 Δx ) − 2 f ( x+ Δx ) +f ( x )
+O ( Δ x ) for the second derivative
Δ x2
f ( i+ 2 ) − 2 f ( i+1 ) + f ( i )
∂2 f
+O ( Δ x ) . Now, this is getting the
. And in i form, it is written here,
2
Δ x2
∂x
second derivative in the forward direction that is i+Δx) like this, and (x-Δx)2 and i+Δx) like this, and (x-Δx)1 function values are these two
locations are used. Just like we did for forward differencing, in the case of first derivative
here also we have expression evaluated based on function values in i+Δx) like this, and (x-Δx)2 on i+Δx) like this, and (x-Δx)1. Similarly, you
can also get expression in backward difference form following the same procedure, and what
is shown here is the final form which is
f ( i− 2 ) − 2 f ( i−1 ) + f ( i )
+O ( Δ x )for the same second
Δ x2
derivative, again with the O ( Δ x ).
112
(Refer Slide Time: 10:14)
You can also obtain central difference scheme for the same second derivative, so again we
write down Taylor series expansion in forward direction as well as in backward direction, and
we do the arithmetic operation add equation 3 and equation 4. So, we get f(x) and here f(x)
here two times, and we want only the second derivative, so after doing this operation then we
get
∂2 f f ( x + Δ x ) − 2 f ( x ) + f ( x − Δ x )
2
=
+O ( Δ x ) . So, you can observe the function value at
2
2
∂x
Δx
that point of interest, and function value on either side, so which is x + Δ x on the forward
direction and x − Δ x on the backward direction these values are used, so it is called central
difference scheme and this evaluated for second derivative. And you can also write in i form
that is what is given here as
f ( i+ 1 ) − 2 f ( i ) + f ( i−1 )
+O ( Δ x )2.
2
Δx
113
(Refer Slide Time: 11:41)
So, if you put all the three terms together in graphical form to get an idea of how these are
evaluated, so what is shown here is function on the y-axis that is f; and on the x-axis, you
have x mark; i is point of interest, i+Δx) like this, and (x-Δx)1 and i-1 are immediate neighbor on the right side and
left side. And you see a curve here that is actually the function and you are evaluating slope
of the function, so when you say derivative, when you say first derivative, you are actually
evaluating slope of the function, so
∂f
is evaluated at the point of interest at i. So, by
∂x
following forward difference formula, which is written here again
f ( i+ 1 ) − f ( i )
it is evaluated
Δx
the first derivative slope is evaluated by considering function values at i and i+Δx) like this, and (x-Δx)1. For
backward differencing, it is evaluated using the functions values at i and i-1; and for central
difference scheme, it is evaluated using function values at i+Δx) like this, and (x-Δx)1 and i-1.
So, you see here the function curve actually is this way, and you are evaluating slope by three
different methods, and for each method there is an error associated, it is not always perfect.
And we can also observed as you decrease the Δ x that is the distance between two
subsequent grid points, in this case, it is i and i+Δx) like this, and (x-Δx)1 or i and i-1, one can get a slightly error
reduced value for the same slope.
114
(Refer Slide Time: 13:46)
Now, we also have higher order FD, in the sense we have seen first derivative evaluated by
Taylor series formula with order of accuracy of Δ x. We observed that you can reduce the
error by reducing the grid spacing, but that is not always possible, we have a limitation in
having number of grid points or other practical difficulties to have a finer grid. So, is there a
way to get higher order without increasing the mesh size, it is possible by considering
additional terms in the Taylor series expansion and that is what we are going to see that is
known as getting higher order finite differences scheme again for any derivative, first
derivative, second derivative or any other derivative. So, in this case, we write down here the
first derivative formula
∂f
f ( x+ Δ x ) − f ( x )
in forward difference method, so
and remaining
∂x
Δx
term.
And you can observe that
∂2 f
is a immediate term, previously we did not consider, now we
∂ x2
know that we also got expression for the second derivative again by all the three schemes that
is forward difference, backward difference and central differences scheme. So, if we can
replace this second derivative appropriately, then follow some simplification, we will be able
to get higher order finite differences scheme for the same first derivative and we are going to
see that. So, in the case of first time when we did, we considered only the two terms, now to
get the higher order we will consider one more term. So, you have substitute, because we are
interested here forward difference, so you substitute for the second derivative in terms of
115
forward difference and that we already obtained the previous steps that is given here once
again, which is given as
f ( x+ 2 Δ x ) −2 f ( x + Δ x ) + f ( x )
+O ( Δ x ).
Δ x2
(Refer Slide Time: 16:45)
So, if you substitute this expression for the second derivative in this equation, and then
simplify you just try to account for all the terms together reorganize then one can get forward
difference approximation for the first derivative and that is shown here,
∂f
as
∂x
− f ( x +2 Δ x ) +4 f ( x+ Δ x ) − 3 f ( x )
. And here, the leading term that we have not considered is
2Δx
here. After dividing Δ x, you find this is Δ x 2; the term that is not considered becomes order
so O ( Δ x )2. And if you compare what expression we got the first step that is considering only
the first term so that we have
f ( x+ Δ x ) − f ( x )
of the O ( Δ x )for the same first derivative.
Δx
So, if you observe these two expressions very closely, here we consider immediate neighbor
that is x + Δ x and the higher order expression we consider immediate neighbor x + Δ x and one
more immediate neighbor, which is x +2 Δ x. So, you can get idea that by considering more
number of nodal points function values at more number of nodal points, you are able to
increase the order of accuracy; and in this case, as you can observe of O ( Δ x ) to of O ( Δ x )2.
116
Once again, this is not a permanent solution or a solution for all situations that is you can get
higher accuracy by considering more nodal points. There is always a limitation when it
comes to applying, for example, if you are in a computational domain, if you are on the right
side of the boundary then you have a very very limited choice of considering more points
beyond the boundary limit. To consider a forward difference scheme to get a derivative by
forward differences scheme, so you are limited by number of grids points available beyond
boundary location. So, either it is forward or backward, there is always a limitation.
(Refer Slide Time: 19:09)
So, just like we obtain higher order finite differences scheme by forward difference
procedure, we can also obtain higher order finite difference scheme by backward difference
procedure. So, what is shown here is backward differencing formula for the first derivative,
which was already obtained, and we follow the same procedure that is the second derivative
that is the next term that we have to consider; replace that second derivative term by
backward differencing formula that we also be obtained and that is shown here as
f ( x − 2 Δ x ) −2 f ( x − Δ x ) + f ( x )
and this of order by independently these are O ( Δ x ). Now, we
Δ x2
replace the second derivative term by this backward differencing formula for that term. And
again properly reorganize with the corresponding term and we end up getting backward
differencing formula, higher order finite difference scheme for the first derivative
you can again observe that this is rearranged.
117
∂f
, and
∂x
(Refer Slide Time: 20:28)
And we get finally, a formula like this, and as we observed in the case of forward difference
scheme f ( x − Δ x ) is a immediate neighbor point in the backward direction, and x − 2 Δ xis one
more additional point in the backward direction. Now, if you compare this formula with
lesser accuracy that is first order accurate then you get formula here, so only two points are
consider, and we have additional point consider and that results in a slightly next order that is
order second order accuracy. So, as I mentioned in the forward difference scheme, it is not
always possible to implement though it appears solution to get a higher order accuracy. So,
earlier we have seen by decreasing Δ x, you can slightly get higher accurate approximation,
alternatively as shown here by considering more points, you can get higher order
approximation for the same first derivative.
118
(Refer Slide Time: 21:40)
Now, the last few slides, we have seen how to obtain higher order finite difference scheme by
both forward differencing as well as backward differencing for the first derivative. We will
now extend this procedure to get higher order finite differences scheme for the second
derivative, for example, by central differencing procedure. What is shown here is the final
obtained formula; and as you can observe here this is of order four, and if you compare this
with the original expression that we obtained by second order accurate scheme, you observe
that second order accurate scheme has point of interest and one node on the left, and one node
on the right. To get fourth order accurate scheme, we have in addition two more nodes; one
more extra on the left, and one more extra on the right. So, by considering additional points,
one is able to obtain higher order, it is also possible to do similar exercise for higher
derivative schemes. Now, with this, we come to end of this class, we will take another
interesting part in the next class.
Thank you.
119
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture - 09
(Refer Slide Time: 00:39)
Greetings to you all, we are now onto module four of this course in this week. We have seen
so far finite differences scheme and how to obtain forward, backward, central differences
scheme for first derivative and same by to get higher order finite difference formula. In
today’s class, we will particularly find out how to get derivation for non-uniform mesh, and
how to get mixed derivative and how to obtain finite difference formula for higher
derivatives.
120
(Refer Slide Time: 01:02)
So, this is necessary in the sense you do not have always an options of getting a uniform
mesh throughout the domain; you want have finer mesh at some location and coarser mesh at
some other location. So, in such situation, you need to have a formula derived based on nonuniform spacing mesh. And this graphically shown here situation, where function and i is a
point of interest, and i+1 and i+2 unlike other case, distance between i+1 and i is Δ x, and
distance between i+2 and i+1 is α Δ x. And if you look from i, i+2 is at a distance of
(1+ α ) Δ x
. So, we follow the same procedure, write down Taylor series expansion
formula, but now with α as a coefficient for Δ x, so that is also given here, this is already
known f ( x + Δ x ) as f ( x + Δ x ) and so on – equation 1.
Now, the new difference here is for f of for the second point, which is α Δ x between i+1 and
i+2 or with respect to i, it is at distance of .
(1+ α ) Δ x So, if you write the expansion for
the function at i with respect to i+2 then you get formula written here f ( x + ( 1+α ) Δ x ) as this.
The only difference between equation 1 and equation 2 is Δx is replaced by x is replaced by
(1+ α ) Δ x ;
everywhere also, it is Δ x 2for example, is replaced by ( 1+α )2 and Δ x 2 and so on. So, as we
did in previous case, here also we are interested only the first derivative, so we consider only
the first term and follow some arithmetic operation to get derivative. And if you consider
higher term then you get corresponding either higher order derivatives, or higher derivatives
difference formula.
121
(Refer Slide Time: 03:58)
This equation 1 and this equation 2 by multiply equation 1 by 1+α and add it to equation 2
and we get the equation in this form f 1+2 − ( 1+α ) f i+1 +α f iequal to this. And we are interested
with second derivative here, so we retain that term, remaining terms are brought to the other
side so that is given here as f 1+2 − ( 1+α ) f i+1 +α f iand this coefficient is brought to the
denominator, and this is of O ( Δ x 3 ) and if you divide by Δ x 2 then you get of O ( Δ x ). So, we
obtain second derivative forward difference formula for non-uniform mesh, and this is the
O ( Δ x ). Now, if you substitute this expression into the equation 1, which is basically equation
for forward difference; after simplification, we get first derivative forward difference formula
with non-uniform spacing and that is alpha is here. So, this of O ( Δ x 2 ).
122
(Refer Slide Time: 05:30)
Now, you also have mixed derivative; that means, derivatives with two independent
variables. So, for example,
∂2u
; in this case, u is the function of x and y. So, there should
∂x ∂ y
be a procedure to obtain finite difference formula for this mixed derivative also. Now, we are
going to see how to get derivatives with two variables; otherwise, it is called mixed
derivative. Again function f is dependent on x and y, so we do the expansion – Taylor series
expansion with f ( x + Δ x , y+ Δ y ). And we see here the Taylor series expansion formula
written f ( x , y )+ Δ x
∂f
∂f
with new term here for the other direction Δ y
, so this comes as a
∂x
∂y
Δ x 2 ∂2 f Δ y 2 ∂ 2 f
pair. Now, again next term,
,
and other term. We are actually interested to
2 ! ∂ x 2 2! ∂ y 2
find out
∂2 f
, this is what is called mixed derivative or derivative in two direction. So, if
∂x ∂ y
you write in i form and j form, so i is for x-direction, and j is for y-direction and written here
as f i+1 , j+1 corresponding to f ( x + Δ x , y+ Δ y ). And we are actually interested in
we have written this expression for considering i+1 and j+1.
123
∂2 f
. Now,
∂x ∂ y
(Refer Slide Time: 07:53)
We can repeat this for different combination of i and j and that is what is given here, f i −1 , j− 1,
f i+1 , j −1; and f i −1 , j+1. So, in all the three expression here, and one expression in the previous
slide, we have a mixed derivative term
∂2 f
, and so we have four equations where the
∂x ∂ y
mixed derivative is appearing. So, we do simple arithmetic, add all of them and take a
average and you get finally, expression for mixed derivative as shown here. So,
∂2 f
which
∂x ∂ y
is evaluated at i, j with function values consider from neighboring points that is
f i +1 , j +1 − f i +1 , j − 1 − f i −1 , j+ 1+ f i −1 , j −1
. And this is of O ( Δ x 2 , Δ y 2 ). So, it is second order accurate
4 Δx Δ y
in both x-direction as well as y-direction.
Once again, we have written only for a uniform mesh, it is possible to obtain mixed
derivative expression also for non-uniform mesh, and for any combination of non-uniform
mesh. In the sense, it maybe uniform in x-direction, non-uniform in y-direction vice versa is
also true. And it maybe non-uniform in one way in x-direction and non-uniform in another
way in y-direction, so any possible combination of mesh is arrangement is possible. And it is
possible to obtain derivative for any arrangement of mesh.
124
(Refer Slide Time: 10:03)
The last slide we had seen how to obtain different scheme for the mixed derivative. I rewrite
that formula here again,
f i+1 , j +1 − f i+1 , j −1 − f i −1 , j+1 + f i −1 , j −1
∂2 f
2,
2
=
+O ( Δ x Δ y ) . Now, if
∂x ∂ y
4 ΔxΔ y
you look at the tensile, what is shown here is graphical representation, the blue color is a
point of interest, the nodal location x i, and y j. And it is influenced by neighboring nodes as
shown here. For example, this node is at x i+1 and y j+1; this node x i+1, y j− i; and here it is x i −1,
y j− i; and here it is y j+i x i −1. So, it looks for this mesh arrangement, which is uniformly
spaced in x-direction and uniformly spaced in y-direction. And also Δ x= Δ y that is why you
get equal it appears as if the mixed derivative at this point has a equal weightage from
surrounding mesh points.
It cannot be so in case of non-uniform mesh. So, we have obtained derivatives first
derivative, second derivative, mixed derivative uniform mesh and non-uniform mesh. We
have to see one more expression or one more expression for one more term that is higher
derivatives.
125
(Refer Slide Time: 12:02)
So, we extend the procedure, we got Taylor series expansion f ( x + Δ x ) , f ( x +2 Δ x ), now we
do one more I considering one more point that is x +3 Δ x. So, all the three expressions are
given here as equation 1, 2 and equation 3. Of course, now you understand the pattern, how
to write Taylor series expansion in any direction forward or backward by considering one
nodal point, two nodal point and three nodal points also for uniform mesh or non-uniform
mesh. By this time, you are very much familiar and you are able to recognize each term, each
expression in each term. So, equation 1 is for Δ x and equation 2 is for 2 Δ x, equation 3 for
x +3 Δ x. What is our goal, our goal is to get higher derivatives, so we have seen up to first
derivative
∂f
∂2 f
, second derivative
, now we are interested to get third derivative as an
∂x
∂ x2
example of higher derivative that is why we have consider three expressions. So, multiply
equation 1 by 3 and subtract from equation 3; so we are going to do two small arithmetic
operations equation 1 by 3, and equation subtracted from equation 3.
126
(Refer Slide Time: 13:40)
So, if you do that we get expression like this, three times 3 f ( x + Δ x ) − f ( x +3 Δ x ) on the left
hand side; on the right hand side, we have the remaining terms. We name this as equation 4.
Then one more small operation multiply equation 1 by 2 and subtract it from equation 2, then
we get one more equation that is shown here f ( x +2 Δ x ) − 2 f ( x+ Δ x ) on the left hand side; on
the right hand side, − f ( x ) and remaining term, and we name this equation as number 5. Now,
between 4 and 5, again we have to do small arithmetic operation, we are only interested in
∂3 f
, and that is appearing in both equation 4 and 5. This second
third derivative term that is
∂ x3
derivative term appearing in equation 4 and 5 needs to be removed; so, we do a small
arithmetic operation, solving the above two equation that is multiply equation 5 by 3 and add
it to equation 4, because the secondary derivative term that is here has coefficient one.
So, if you multiply this by 3 and if you add this corresponding term here, then you can
observe that this term also this term gets cancelled that is why this equation 5 is multiplied by
3
and
add
it
to
equation
4,
so
you
get
∂3 f
∂ x3
as
f ( x+ 3 Δ x ) − 3 f ( x+2 Δ x ) +3 f ( x + Δ x ) − f ( x )
+O ( Δ x ). So, in this class, what we have done, we
( Δ x )3
have done how to obtain finite difference procedure on a non-uniform mesh, and how to
obtain finite difference procedure or finite difference formula for mixed derivative that is
127
derivative in two direction. And third important subject was how to obtain finite difference
formula for higher derivative as on sample we took the third derivative
∂3 f
.
∂ x3
In next class, we will see how to obtain finite difference formula by other procedure that is
we have seen getting all finite difference formula only from Taylor series expansion, there
are also other procedures available, and we are going to see one such procedure in next class.
Thank you.
128
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture - 10
(Refer Slide Time: 00:27)
My greetings to you all, we are now to the last class for this week, which is module five. And
so far, we have seen about domain, different types of grid, how to obtain Taylor’s series
expansion from Taylor series expansion, how to obtain different difference formula and
higher order accurate scheme, and how to obtain finite difference scheme on non-uniform
mesh. Also obtaining difference formula for mixed derivatives. Now, today’s class, we will
particularly see how to get higher derivatives and getting finite difference formula by other
procedure, particularly we are going to see by polynomial procedure. So, we have seen so far
all these.
129
(Refer Slide Time: 01:22)
And we also have equation with higher order terms, for example, if you consider vorticity
transport equation or vorticity stream function formulation that we had seen last week. It has
a fourth order based on stream function. So, we should know how to evaluate or how to
obtain finite difference formula for any order as well.
(Refer Slide Time: 01:47)
And this we had seen towards end of last class, we repeat here for the sake of continuity. So,
Taylor series expansion it is written for three different spacing, f ( x + Δ x ) , f ( x +2 Δ x ) and
f ( x +3 Δ x ). By now you are familiar, how to write Taylor series expansion in any direction
130
that is either forward or backward, you are also familiar with the procedure to get any
difference formula. So, writing the equation for three different spacing, x +Δ x, x +2 Δ x and
x +3 Δ x. And what we are interested is the last term that is the third derivative term
∂3 f
, and
∂ x3
the term is there in all the three equations, equation 1, equation 2 and equation 3. So, we have
to do some kind of arithmetic operation, manipulation to get rid of the term first derivative as
well as second derivative. So, basically do two arithmetic operation the beginning,
considering the equation 1 and 3. So, multiply equation 1 by 3 and subtract it from equation
3, which is actually for f(x) evaluated at x +3 Δ x.
(Refer Slide Time: 03:17)
So, if you do that, you get this equation, 3 f ( x +3 Δ x ) that is the 1st equation and this is the 3 rd
equation term, so we have a term on left hand side, remaining term on the right hand side.
You can actually see term by term and verify this expression is correct, and numbered this
equation as 4. We do one more operation that is multiplying equation 1 by 2 and subtract it
from equation 2, so we get f ( x +2 Δ x ) − 2 f ( x+ Δ x )this is coming from the 1st equation that is
why we have the coefficient two here, so we said multiply equation by 2, so we have term on
the left hand side, and then remaining terms on the right hand side, and we numbered this
equation as 5. Once again we have to get only third derivative
derivative term in both equations 4 as well as 5.
131
∂3 f
is still have the second
∂ x3
So, one more small arithmetic operation that is multiply equation 5 by 3 and add it to
equation 4. So, if you do that, so the equation 5, you have the term Δ x 2 whose coefficient is
actually one, so if you multiply this by 3, and added to corresponding term in equation 4, they
both get cancelled. And finally, you get after rearrangement, finally, you get expression for
∂3 f
and which is given here and you can recognize that it requires three additional points in
∂ x3
the forward direction with respect to the function value itself, so
f (x)
is the point of
interest at unique function values at xx + Δ x, x +2 Δ x and x +3 Δ x.
And this is forward difference formula of O ( Δ x ). And you can just follow the procedure as
we did for first derivative and second derivative; you can also obtain backward difference
formula and this is also possible to obtain either forward or backward higher accuracy. So, in
this case, it is of O ( Δ x ), you can consider higher terms in the Taylor series expansion replace
them, do again arithmetic operation, follow all the algebraic carefully, it is possible to obtain
any order of accuracy and in any direction forward or backward.
(Refer Slide Time: 06:16)
Next, we are going to see another procedure. So far we have seen how to obtain difference
formula only from Taylor series expansion, but there are also other procedures, polynomial
approximation of a function, exponential fitting procedure, and there is also a different a class
of finite difference scheme what is known as compact finite differences scheme. So, as the
name indicates, you are able to obtain higher order accuracy scheme by considering only less
132
number of points and there is a procedure available to get this higher accuracy scheme by
considering only less number points and that is what is given as compact finite differences
scheme. We are not going to talk about compact finite difference schemes, we will see how to
obtain by polynomial approximation.
(Refer Slide Time: 07:21)
So, the way to do is, there are three steps one is approximating the function f as a polynomial;
so when you say polynomial, the obviously question is what degree it is required. So,
depending on the degree, the polynomial; obviously, one will get different accuracy scheme,
and the polynomial will have expression with coefficients and you can obtain or evaluate the
coefficient values substitute in the function subsequently to derivatives then you will get
difference formula. So, in this exercise, we are going to demonstrate that procedure by
considering second order polynomial and that is shown here, function f ( x ) is approximated
by second order polynomial as given here Ax2 + Bx+C . And this is your schematic graphical
representation of the function; this is the point of interest f ( i ) at i, neighboring points in the
forward direction i+1, which is the distance of Δ x, and i+2, which is at distance of 2 Δ x from
the point i or it is a distance of Δ x from the point i+1.
133
(Refer Slide Time: 08:47)
So, if you evaluate that function that is we have described quadratic polynomial function,
evaluate that function at three different point that we have shown i, i+1, i+2. So, the same
function is repeated for different nodal points, f i is A x i2+ B x i+C; similarly for f i+1, and f i+2.
Why we want to do this expressing the function at three points, because we have three
coefficients A, B, C for the quadratic polynomial that we have consider Ax2 + Bx+C. So, you
can immediately get the idea, if it is polynomial with the degree five then you need to get the
expression or function value evaluated at five nodal points.
Now, you need to evaluate coefficient A, B, C. So, first what we do, we find out these
function values at specific location. Say if we consider x i as zero, because that is your point
of interest then x i+1 is at distance of Δ x, and x i+2 is at distance of 2 Δ x with respect to i. So, it
is to be clear, it is only at a distance of Δ x from i+1, whereas, it is at distance of 2 Δ xfrom i.
Once again for simplification, we have consider only uniform mesh that is why it is two times
is coming here. And next we are going to see how to for non-uniform mesh also. So, if you
substitute these values, that is x i, x i+1, and x i+2 in this expression, we get three equations for
three coefficient A, B, C.
So, on substitution so x i=0 , first value; you substitute to the first equation A, B will go to
zero, remaining term only C and that is directly related to f i as f i=C. Then we substitute for
the second equation, f i+1= A Δ x2 + B Δ x+ C; similarly for third equation, Ax of x at i+2 is
134
replaced with
2Δ x
and square is there, so it is f i+1= A Δ x2 + B Δ x+ C. So, if you solve,
you already have value for C=f i that is also you can substitute then remaining two
coefficients A and B are evaluated by suitable arithmetic operation between these two
equations.
(Refer Slide Time: 11:58)
And if you follow that procedure, you get expression for coefficient A and B and that is what
is shown here. Coefficient value B as expressed in terms of i+2, i+1 and i as this way; and
similarly for coefficient value A is expressed in this form. Now, come back to the polynomial
expression that we have taken, quadratic polynomial function that we have taken, so
f (x)= Ax 2+ Bx+C . So, if you substitute values for A, B, C, you actually have function
evaluated based on function values in the subsequent forward points. So, you want first
derivative, take the first derivative
∂f
, and do the derivative on right hand side
∂x
2 Ax+ B , C goes to 0. Now, if you substitute for A and B in this expression from this
expression that we obtained for coefficient A and B, substitute B and substitute for A into this
expression, we get
defined
xi
∂f
∂x
evaluated at
x i , this is our point of interest. And we already
to be 0, so the first term goes to 0, and we have only B here, so
∂f
∂x
evaluated at i is same as B and that expression is here and repeated here for first derivative.
135
Now, the question is how to know what is the order of accuracy in this scheme, we know
from the Taylor series procedure, how to obtain order of accuracy. Now, what we do in this
expression, we substitute
f i +2 from the Taylor series expansion, similarly
Taylor series expansion,
fi
∂f
∂x
f i +1
from the
is same that is on the right hand side. And we also know
evaluated by different procedure by different order of accuracy and so on. So, we
replace
∂f
∂x
and replace all these term in Taylor series expansion and compare terms on
either side left hand side and right hand side, finally, you get that this scheme is second order
accurate forward difference expression. Though explain, how to obtain the accuracy it is not
shown here, what is important is to know that this is second order accurate forward different
scheme and you can also recognize immediately, we have consider two neighboring points
with respect to i, that is i+1 as well as i+2. And you can also recognize this expression from
the first exercise obtained from Taylor series expansion. Now, we have shown for the first
derivative
∂f
∂x
from this polynomial. So, if you do one more time derivative, then you will
get second derivative, so
∂f
∂x
is given here.
(Refer Slide Time: 15:28)
136
Do second derivative, so
∂2 f
∂ x2
and that is what is shown here. So,
∂2 f
∂ x2
is basically two
times A, because B also goes and A is already here that we obtained coefficient for A, and
this two two gets cancelled then we have only the remaining term for the coefficient; A and
this is actually the second derivative forward difference formula obtained from polynomial
procedure. And once again we follow the procedure of expanding this function from Taylor
series on the left hand side, and obtaining the difference formula from Taylor series and
compare the coefficients then you get the idea of order of accuracy of this scheme. And in
this case it is first order accurate forward difference scheme for the second derivative.
(Refer Slide Time: 16:42)
Now, we have seen before, we also have a situation of non-uniform mesh, so we should find
out how to do by polynomial procedure for non-uniform mesh also. So, function is given,
again second order polynomial function
Ax 2 +Bx +C . And graphical representation for
non-uniform mesh, so i is the point of interest, i+1 is an immediate neighbor point which is at
distance of
Δ x ; and i+2 is the next neighbor point, which is at distance of
respect to i+1, and at distance of (1+ α ) Δ x
αΔ x
with
with respect to i point. So, we follow the same
procedure expressing this quadratic polynomial that we have assumed at all the three points
then find out the procedure, how to estimate this coefficients A, B, C.
137
(Refer Slide Time: 17:42)
So, at
xi
, which is the point of interest, the function is the
x i+1 is Δ x , and
value is zero; and
x i+2 is . (1+ α ) Δ x Now, if you substitute in function, then we get
expression like this, and we already noticed that C is related to
f i +2
xi
fi
itself, and
f i +1 , and
are also expressed like this. We are interested to find out coefficient values of A and
B, and C is substituted as
f i , now between these two equation, you can solve and get A
and B, and you get expression for B as shown here, and expression for A as shown here.
(Refer Slide Time: 18:50)
138
So, we use these values C, B and A, and substitute in polynomial expression that we have
consider. And we are interested in the first derivative then it gets reduced to
you are interested in the second derivative, it gets reduced to
2 A x + B , if
2 A . So, substitute for A and
B, and substitute for A here, so subsequently you get first derivative evaluated at
xi ,
because that is the point of interest. At i, x will have a zero value, so if you substitute that the
term is only B for first derivative and that is shown here. Similarly, for the second derivative,
it is two times A, and evaluate, we have already evaluated coefficient value for A, and you
substitute we get this.
So, entire week what we have seen important aspect of CFD, the first step that is how to
obtain finite difference formula by two different procedure from Taylor series expansion
procedure and from polynomial procedure, and first derivative, second derivative third
derivative, uniform mesh, non-uniform mesh and how to obtain higher order accuracy
scheme and so on.
Thank you.
139
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture – 11
(Refer Slide Time: 00:44)
It is my pleasure to welcome you all again to this course on CFD. Today, we are on
week three, we will be teaching some more important aspects of this course. Before
going to this week content, let us see what we have done so far in this course. We have
reviewed in some important aspects of basic fluid mechanics, governing equation , nondimensionalization , some information about grid, then Taylor series expansion, how to
obtain different finite difference scheme, then boundary condition, and nature of
equation and its solution.
140
(Refer Slide Time: 01:12)
This week we will particularly talk about different approximation methods available;
then some basic information about three important approximation methods finite
volume, finite difference and finite element methods. Then each of these schemes, they
have some properties associated, we are going to have a definition of these properties
and explanation about these properties with some examples considered. Then whether
numerical scheme that you are chosen is good enough and what it should have and this is
what is known as analysis of numerical scheme. And there are three important aspects of
numerical scheme, we are going to talk about them definition of them and with
explanation, we understand these aspects. Finally, I will also try to give explanation with
some standard model equations available to understand some of the aspect that you will
learn in today’s class.
141
(Refer Slide Time: 02:43)
In general, CFD, we approximate the governing equation by different discretization
procedure and solve them. We have many methods available, but we will take or look at
only few methods which are very popular, finite difference method, finite volume
method and finite element method, these are three approximation methods commonly
used. But there are also special methods available for special situation, boundary element
method, spectral method, and there is another class of approach what is known as a
meshless method, one of them for example, is radial basis function methods, this is also
something called smooth particle hydrodynamics - SPH method. These are all advanced
topics in this course, we will limit ourselves to finite difference, finite volume and finite
element methods. And in this course, particularly I will focus on finite volume method in
detail, but next few lectures we will get a idea of what is finite difference method and
finite element method, and explanation with some example situation.
142
(Refer Slide Time: 04:13)
So, in finite volume method, we divide the domain into number of control volumes, then
we learned governing equations in two form, one is the differential form, another one is
the integral form. So, in finite volume method, we will mostly use integral form of the
governing equation, and this is applied to each control volume. In general, there are two
types of control volume grid, one is called node or vertex centered method, other one is
called cell centered method. So, in node centered finite volume mesh, CV is CV means
control volume it is defined first and then node is defined to each CV center. So, here is
the illustration, so if you look at this figure, black filled dots that what I am showing is a
node and you construct a finite volume around that node such that this node is at the
center of the control volume that you have consider. So, we define the CV, then we
define the node. How do we define the node, they are all mean of each faces, this is what
is known as a node centered finite volume.
143
(Refer Slide Time: 05:52)
There is another method called cell centered finite volume mesh. In this, nodes are
defined first, then control volumes are constructed around the node by median; in other
words, midpoints of the surrounding faces are suitably connected. So, if you look at that
mesh arrangement, so this each one of them are vertex then you construct a control
volume around that vertex by taking midpoint of that two vertex responsible for that
control volume. So, if you look at this figure, there is one vertex here, immediate adjust
vertex is here and you take a midpoint, and you have a face, control surface of the
control volume passing to that midpoint. So, CVs are defined or constructed around the
node by a median or midpoints of surrounding faces, which are suitably connected. So,
for each of this control volume, we construct a face, then if you see they are all cell
centered control volume.
In this procedure, solutions are defined at the center of the cell, and face fluxes that is
flux crossing each control surface are approximated using the values from two adjacent
control volumes. So, if you look at this surface then whatever flux crossing is defined
based on two adjacent control volume. And these are usually preferred in structured grid
arrangement, so we can have a finite volume mesh both in structured as well as
unstructured mesh arrangement.
144
(Refer Slide Time: 07:46)
So, we put both these mesh arrangement together, so this is the node or vertex centered
finite volume mesh, and this is cell centered finite volume mesh. By now we should able
to appreciate the difference between these two type of mesh; so in this, the vertex is
centered for the volume and in this cell is centered for the volume.
(Refer Slide Time: 08:16)
But we do not look at these in detail, they are usually suitable for complex geometries.
And then as I mentioned before, integral form of the governing equation is used.
Conservation equation for any generic variable ϕ , say it is given in integral form as
145
shown here. So, integral over the surface
∫ ρ ϕ v . nds
, so this will give you the flux
S
crossing control surface s; so it may be entering, it may be going out, so in general it is
called flux crossing. It is equated to any diffusion again integrated over the surface, so if
you have a control volume with
ϕ
surface then this is consider over
And then any generation in that within that volume, so this
dΩ
ϕ
surface.
represent volume, so
any generation within the volume is also accounted. So, this is nothing, but balance, so
budget accounting for flux crossing, diffusion as well as any generation. So, first
principle behind deriving governing equation, L.H.S – flux crossing the boundary
surface; R.H.S first is the diffusion, R.H.S second term is generation within control
volume.
Now, we need to evaluate these integrals, surface integral as well as volume integral
over finite volume mesh that you have considered. And they are approximated using
appropriate formula. So, when you say appropriate, we have volume, we have surface
integral, so we need to take those things into account. Second in the case of flux
crossing, if we are considering convection term, it is a non-linear term as we have
mentioned before and treatment of non-linear term requires separate procedure. So, we
have integration value or integration estimated differently for different quantities in this
equation that is meaning of the word appropriate formula.
(Refer Slide Time: 10:47)
146
Now, the integral form of governing equation is applied to each control volume, so
separately you apply for each control volume and we mentioned in the beginning the
entire domain is divided into number of control volumes so you apply this governing
equation to each control volume to all the nodes or all the control volume, so in total for
the entire domain as a whole. Then if you sum all the equations, so you have equation for
each control volume, and if you sum all of them together, then what happens all the
surface integral which are evaluated at the control surface for flux going in and for the
flux going out. If they two adjacent control volumes are there, they represent the same
quantity that is for volume one, it may be flux going out, and for the immediate adjacent;
volume two – control volume two, it may be flux going in. And if you extend this
explanation for all the control volumes together in a domain then you can understand the
surface integrals cancel out. Hence the conservation equation on a global basis is also
satisfied.
So, the finite volume method ensures conservation of laws definitely. It is not so in the
case of finite difference method, because we do not have such kind of integral form and
all the derivatives are expressed as the function of Taylor series expansion. Hence there
is a difference between finite volume and finite difference method. And in the case of
finite volume one more point that we have to note as I mentioned before, though it is
integral over the surface, we have the different quantities, one is the convection flux,
other one is the diffusion flux. And they need to be treated separately for some problem
or they may be treated same in some other problem or in a same domain, they may be
treated same or differently depending on the nature of the solution within that problem
description. So, accuracy is improved by choosing appropriate integral formula or
quadrature formula, which approximates expression in the integral equation.
147
(Refer Slide Time: 13:33)
So, next we will see some important aspects of finite difference method. So, as I
mentioned before, there are three methods finite volume method, finite difference
method and finite element method. Now, in this course, I am going to just touch upon
finite difference and finite element, but we will focus mostly on finite volume method, a
detailed procedure, how to construct discretized equation based on finite volume method
will be dealt in future classes. Now, let us see some important aspects of finite difference
method. Again as we did in finite volume, here we talk about individual nodes, so define
mesh or nodal points in the computational domain. Then develop all the functions as the
Taylor expansion around values at each mesh points. So, entire governing differential
equation is now replaced by a finite difference approximation accordingly for different
derivatives.
So, you have for example, if you take Navier-Stokes equation, x-momentum NavierStokes equation, convection terms are first order derivative, diffusion term is the second
order derivative. So, we need to have a expression separately for these derivatives. Also
you decide based on the order of accuracy, so we can have a convection term with
second order, third order accurate, diffusion term can be second order accurate, unsteady
term can be first order accurate; whichever order of accuracy that you are deciding
accordingly, you can have a different difference formula for each of the term. Then you
put them together then entire governing equation is now replaced by finite difference
148
equation. In FEM, that we are going to see in next, all these three steps are defined in
more general formulation, we are going to see with the example in the next slide.
(Refer Slide Time: 15:39)
So, while replacing that is differential equation by finite difference approximation, there
are two ways of expressing. First one is explicit way of expressing. So, in this case,
variable of interest, for example, if you are solving u-momentum equation, u is the
variable interest, and if you are solving say energy equation, temperature may be a
variable interest. So, whichever variable you are interested and whatever the nodal
location, if it is a one-dimensional, you represent by i form as x i or ui ; if it is a two
dimension, you have
i, j,
similarly for third direction, same way for temperature.
Similarly, if you are solving unsteady equation, and you are computing in iterative
procedure way then you have one more index to represent the time integration level.
For example, unsteady equation, unsteady momentum equation u at any nodal location
for two-dimensional
i, j
and then one more index superscript n to represent that you
are doing time integration and you are trying to find out or you know the value of u at n
location of the time. So, variable whose value to be determined at each mesh point
appears only once in the equation, depending on what scheme you are following. So,
usually it is on the left hand side, in the first step then it is moved to the right hand side
in the subsequent simplification steps. And this value variable whose value to be
determined is always on the left hand side, so all other quantities are moved to the right
149
hand side, so you have new value to be determined is equal to function of all old values.
Those old values are either from its own location a point of interest, but determined from
the previous time level in the case of unsteady formulation or it is related to for the same
time level, it is related to all the neighboring points. Such formulation is what is known
as explicit formulation.
The second one is what is known as a implicit formulation, where the variable whose
value to be determined also appears as part of the equation, which means you will have if
you write the finite difference equation, you will observe to the variable for which you
are trying to solve the equation appears both on left hand side as well as on the right
hand side. So, you may not be able to bring out a very clear expression for variable to be
determined, they also become part of right hand side equation, hence some
rearrangement needs to be done. This is what is known as a implicit formulation.
(Refer Slide Time: 19:09)
Now, let us get explanation of these with examples. For example, you take unsteady
2
diffusion equation one dimension and that is shown in this
∂u
∂ u
−α 2 , this is very
∂t
∂x
generic equation. In this case, we have taken variable as u for velocity, it can be
temperature also. Now, let see how to write as explicit formulation; so we have put
forward in time and central in space. Now, please recall, last week class, where we have
explained how to get first derivative, how to get second derivative in forward difference,
backward difference, central differencing.
150
Similarly, how to get lower order or how to get higher order accuracy scheme, again by
any of these procedures for any derivatives, first derivative, second derivative, third
derivative, so please recall all those.
Now, that is only a generic procedure, it is used for any equation, for example, in this
case, first we have a time derivative component
∂u
∂t
and in the second term is the
second derivative, but for the spatial expression. So, we can apply whatever Taylor series
expansion whatever procedure we got from there for forward difference, backward
difference can be applied to this equation also, whether it is time derivative or spatial
derivative it does not matter. In the sense, if you say forward in time and central in space
and you write it as FTCS. So, let us see how to write when we get equation like this, so
n+1
n
n
n
n
u i −u i
(ui−1−2 ui +ui +1)
=α
. Now, let us understand this equation; in this, for every
2
Δt
Δx
variable for example, u you have a subscript i and you have a superscript n+1, so
subscript i defines the nodal location, in this case, it is only one dimension, so it
represent
x i particular interest of point of interest, and superscript n or n+1 stands for
time location. So, in this case, n+1 means you are trying to find out value at new time
location and n, so
n
ui
represent you know the value at the same location i, but from a
previous time iterative value, so n corresponds to previous, and n+1 corresponds to
current.
So, what we said forward in time, so you can understand it is forward in time, so n+1
minus n, that is how you should try to understand. So, u of i n+1, u of i n same variable
at same x location, but at different time level and forward in time level that is why it is
forward in time, n+1 and n. Similarly, central in space; that means, it is central only in
space, so all the time quantities are already known that is why on the right hand side, you
have
uni−1
as a superscript, similarly
2u ni
and
uni+1 , so you can understand all
these variable values u are determined from nth level in time. So, nth level in time is
something that you have already determined before, hence the time level is explicit and
spatially if you look at spatially i is the point of interest, i-1 and i+1, you take values
from either side of the point of interest that is why it is i-1 which is on the left hand side
and i+1 which is on the right hand side, and i is the point of interest. But all the three
quantities are known from the previous
151
time level that is why you have superscript n appearing, so it is central in space, forward
in time.
Such a equation as I explained just now, only n+1 needs to be determined and that alone
will be there on the left hand side, you can rearrange the equation by considering uni
move it to the right hand side and club it along with this, and then you get explicit
expression to determine the value of
n+ 1
ui
. Now, I will explain all these by following
one finite difference equation form that is forward in time and central in space. You can
also write down expression based on forward in time, forward in space; forward in time,
backward in space; central in time and central in space. Now, we will see the same
formulation, how to write implicit form, so you can understand this is forward in time
still on the left hand side, because n+1 and n. Whereas on the right hand side, if you look
at the right hand side, it is central in space, i-1, i and i+1 as I explained before, i is the
point of interest. So, it is central in space, but you look at the superscript, all the
superscripts are all at n+1 level. So, this n+1 level is a point to be determined for at i
node, i+1 node, and also for i-1 node. Sometimes i-1 node, which is on the left hand side,
you would already determined, because it is on the left hand side, whereas, i+1 node, you
do not know.
So, if you look at the overall formulation, n+1
n+ 1
ui
appears on the left hand side, and
1
appear on the right hand side, so this becomes in implicit formulation. We do not
un+
i
go into advantage of explicit scheme, implicit scheme now. We will reserve that
explanation in the subsequent class. We just get idea of writing different finite difference
approximation. So, in this class, I have started telling something about three different
basic discretization procedure. We finished finite volume, we came to know different
mesh arrangement then we got some idea about finite difference procedure. We will
continue the next class the third type finite element method and then remaining
interesting topics.
Thank you.
152
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture - 12
Greetings to you all, we are going to next module for this week, course on CFD. So, last
class, we just started taking something about finite volume and finite difference method.
As I mentioned in last class, there is another popular method available in CFD, which is
finite element method. Basically the finite element method was developed for structural
analysis then people started using it for fluid flow and heat transfer calculation as well.
So, the one group of researchers, they use only finite element method for solving
different problems. Just like commercial CFD software available based on finite volume
method, you also have a commercial CFD software available based on finite element
method. And there are also attempts to combine advantage of finite volume, finite
difference and finite element methods; there are works based on this hybrid approach as
well. In this course, as I mentioned before we will focus mainly on finite volume method
and application of finite difference method. We will not talk in detail about finite
element method; I intend to give only a small introduction, and there are separate courses
available on finite element method and so you are encouraged to look those courses as
well as there are many reference books available.
(Refer Slide Time: 02:08)
153
So, in finite element method, governing equations are multiplied by a weighting
function. Then this is integrated over the entire domain. In simple form, so what is the
approximation, it is a linear shape within each element, so we divide in finite element
method entire domain into number of small elements, just like in finite volume, the
solution continuity across the boundary of each element is also ensured. This
approximation is then substituted into a form what is known as a weighted integral form
of the governing equation, and this is where two terminologies are used what is known
as strong form and weak form. The strong form of the governing equation is the original
equation with the corresponding boundary condition; the weak form is the approximation
to the governing equation that is why it is called weighted integral form of the governing
equation and in other words, it is called weak form of the equation. Discretized equations
to be solved are derived, so when we say weighted integral, we have made some
approximation, it needs to satisfied some properties; the property that needs to satisfied
is derivative of the integral with respect to each nodal value to be zero, this is one of the
requirement.
(Refer Slide Time: 03:43)
So, we will try to explain with some example problem. Consider one-dimensional
differential equation, so second derivative because it is one-dimensional. We have
written an ODE as such
d2 T
. And there are again procedure Galerkin procedure and
dx 2
Ritz method. We will not go into the details of this, so one of these methods is used to
simplify the second order ODE. Next, we discretize the domain
154
into number of elements. So, consider a rod with the length zero on left hand side, and
the length running to the other side, the length corresponds to L, and temperature on one
side is T zero, and temperature on the other side is
T L . We make a small restriction
the T L >T 0 that is right hand side temperature is greater than T 0 .
(Refer Slide Time: 04:53)
Now, this figure, previous figure is drawn again here, in addition to representing it with
help of finite element nodes. So, in this figure, number 1, 2, 3, 4, whatever is given in the
parenthesis, whatever is given in the bracket are element numbers and each elements
comprise of nodes, for example, element one has node one and two; similarly element
four has node 4 and 4. So, we need to establish a connectivity between node and the
element, which are represent by dots and numbered accordingly. Element three for
example, is connected by node 3 and node 3. So, in this, we consider linear
approximation for the temperature T = a1 + a2 * x, so we need to evaluate the
coefficients a1 and a2.
We use this approximation for one element at a time and then combine all of the local
equation to form what is known as the global set of equations. So, consider the first
element, for example, element one T1 which is already known, T1 is left side
temperature, which is given from the boundary condition as T0, but T2 is not known,
that is temperature at nodal location two is not known. So, from this situation or from
155
this condition, we can substitute in this linear approximation and evaluate coefficient a1
and a2 we have to do.
(Refer Slide Time: 06:55)
We will get
a 1=
T 1∗x 2−T 2∗x 1
, and
x 2−x 1
a 2=
T 2−T 1
, this is straight forward
x 2−x 1
procedure. You substitute the linear equation, you get two equations, two unknowns,
solve them and you get coefficients values. The original equation T(x) can be rewritten
as using this coefficient a two and a one, and given here
(x−x 1)
L
( x 2−x)
L
into T1, similarly
into T2. Where entities in the braces are called shape functions, usual
symbol is letter N, so there is a shape function corresponds to nodal value T1, there is
another shape function corresponding nodal value T2, and they are written here
( x 2−x)
, and
L
( x−x 1)
. So, you can rewrite the equation again, using the shape
L
function definition, so this T(x) = N1*T1+N2*T2. We are now explain for taking one
element and two nodes 1&2; imagine or assume that you are going to extend this for the
entire one-dimensional node, one-dimensional element that you have consider. So, we
have so many elements, extend this procedure for each element or in generic form, you
can write it as T(x) = [N] T{i}.
156
Now, in this case, N is the shape function and this is the matrix form. We are assuming
linear variation between two nodes and we are assuming that linear assumption is same
throughout the domain. So, we get same function for throughout the domain. So, it is
157
very simplified procedure, but we can have a different variation. So, this T of x is written
as N into T of i, and N is the row vector and T of i is the column vector.
(Refer Slide Time: 09:18)
Similarly, this equation is set up for each element. This approximation of T(x) is then
substituted in the Galerkin method integral equation or any other way of writing the
weighted form of the equation. Then after assembling matrix for each element to get a
coefficient matrix in the global form, then you can solve. So, matrix A will be a n X n
matrix, which corresponds to number of nodes, and constant matrix B will be a one
column vector which is on the right hand side. X is the unknown to be determined. So,
once you set up this equation AX = B and solve then you get variable X to be determine
for all the nodal location. So, global matrix is then solved either by direct or iterative
method, right now do not worry about what is direct or iterative method, we are going to
have a separate detailed explanation on matrix solution procedure, there will get to know
what is direct procedure, what is iterative procedure. So, variable X is obtained or in this
case, it is temperature T obtained in all the nodes and then you proceed like that. So, we
have explained what is finite element method by taking a simple example for one
dimensional.
158
(Refer Slide Time: 10:53)
What are the advantages, as I mentioned before, we can use this finite element method in
completely unstructured form, and it is very good for complex geometries. It works very
well on diffusion systems in general, and for well-posed results and which means
essentially the stability criteria is satisfied. Again we are going to have a next lecture,
where we are going to talk about how to analyze a numerical scheme, there are three
important aspects – consistency, convergence and stability, so there we will talk about
what is stability and how to obtain or how to understand the stability. The FEM is
supposed to ensure the stability criteria for a diffusion system, and which happens to be a
well posed problem.
Then convergence is also for free once you have established stability, since the
variational forms are almost consistent with the governing equation. So, once again, we
need to wait to understand these definitions and the connection between convergence,
consistent and stability, there is a theorem called Lac equivalence theorem. If a scheme
is consistent and stability is ensured then convergence is automatically ensured that is the
Lac equivalent theorem. We are going to talk about it again later. So, FEM ensures
convergence, because the variational form, which is used as a weighting to get a
weighted form of the governing equation or to get the weak form of the governing
equation, it always consistent. And we already seen the FEM procedure mostly ensures
stability, so once you ensure stability and consistent may convergence is automatically
satisfied. This is the major advantage with FEM procedure. As I mentioned before, we
159
are not going to talk in detail about FEM procedure that done totally in a different
course.
(Refer Slide Time: 13:21)
Another important aspect, what are the properties associated with the numerical scheme.
Numerical scheme, whatever method may be, so either you follow finite element, finite
volume, finite difference or combination of any of these, similarly any order of accuracy
you use, we are expected to have some properties satisfying for this scheme first one
conservativeness, boundedness and then transportiveness.
(Refer Slide Time: 13:53)
160
Let us get explanation on conservativeness, boundedness and transportiveness with some
examples. So, conservativeness – numerical schemes must satisfied all the basic
governing equations, whatever equation we have taken, all the governing equations are
derived based on some conservation laws. So, for example, continuity equation is for
conservation of mass, so for momentum equation for conservation of momentum and so
on. So, any numerical schemes whatever you have following, because it is written for the
governing equation, it should satisfy the basic conservation both locally as well as
globally. So, if you consider finite volume method, I already mentioned, the flux
crossing is accounted properly between two adjacent control volume and if you sum
them together for the entire domain, then conservation is automatically satisfied both
locally as well as globally.
So, net efflux of conserved quantity from one volume is equal to the net change of the
quantity in the control volume. So, if you consider the entire domain, then net quantity is
also conserved. So, collection of discrete equation for each control volume is summed up
over the entire domain, and it represents conservation of the physical variable. So, if you
are trying to get estimate of conservativeness or trying to get the definition of
conservativeness explained using a variable say momentum then that should be satisfied
for the entire domain. So, when a face or control surface is shared fully by two adjacent
control volume, then flux crossing one face or flux leaving the one face must be exactly
equal to flux entering the adjacent control volume or if you write in a form of discretized
way in one it will be positive, in other it will be negative, balancing each other.
So, sketch wise, so this control volume for a simplified control volume, whatever is
going out and this exactly the control surface is shared fully by two adjacent volumes
and whatever is going out is equally represented whatever is coming in here that is the
discretized form of this leaving must be same as discretized form what is entering for the
next control volume. So, if you ensure like that for each control volume and sum them up
for the entire computational domain then conservativeness can be ensured. Then as I
mentioned before, in finite volume, it is automatically ensured, whereas, in the finite
difference method, because we are simply following Taylor’s series expansion procedure
for each nodal location, the overall conservation satisfaction is not guaranteed.
161
(Refer Slide Time: 17:16)
Next property we are going to discuss is boundedness. We have transport equation for
every variable. In the transport equation for every variable, we have a balance term,
sometimes there is also a source term then we solve the transport equation in the
computational domain with boundary condition imposed on the domain. So, when you
solve, there is a specific property called boundedness by which we say the values obtain
should be within the values specified in the boundary condition, if there is no source term
in the equation or in the domain. So, when you say source term, or source generation for
example, momentum injection is one additional source term in such cases then you can
have values more than or beyond what is specified in the boundary location. So, we
define boundedness as a property must be bounded by the boundary values in the
absence of source terms.
Let us take for example, a multi species situation then we have a species equation for
each species. We try to find out concentration then in that case concentration of each
species can be between zero percent and hundred percent. concentration of any species
cannot go less than zero, in other words, negative values such situation is sometimes
otherwise it is also called realizable condition. Now, this boundedness ensures what is
known as diagonally dominance situation in a matrix. Once again when we discretized
the governing equation, finally, we arrive at system of linear equations, and we put them
in the form of a matrix AX=B, where A is the coefficient matrix, X is the unknown
column vector, and B on the right hand side is the known matrix. Now, we
162
need to invert this matrix to get solution vector, this inversion procedure depends on the
coefficient matrix nature. To have a stable solution, we should have diagonally dominant
matrix. Now, this boundedness ensures the matrix is diagonally dominant.
(Refer Slide Time: 20:12)
Let us try to explain this boundedness with the help of a simple problem. We consider a
rectangular domain as shown here, a simple domain, big the boundary is marked as A B,
B C, C D, and D A. Now, for simplicity sake, we consider this problem without any
source generation. And boundary condition specified or temperature along all the surface
and as shown here. So, along A B, it is 50°C; along BC, it is 50°C; along CD, it is 50°C,
again along DA, it is 50°C. Now, to solve this problem, what do we do, we discretize the
domain either by finite difference or finite volume method. It will have internally nodes
described, you solve the transport equation for energy which contains the temperature
term. We already mentioned there is no source term inside the domain, or there is no
source term in the equation. In such situation, when you solve the transport equation for
temperature, finally, the temperature values should be within the boundary condition
value that is specified. Now, for this problem, it is specified as 50°C, hence the values of
temperature inside the node should be within the boundary values that is 50°C. Physically
the temperature inside the domain cannot exceed the boundary values.
163
(Refer Slide Time: 21:59)
So, we go onto the third property what is known as the transportiveness. For this, we
define new number what is known as Peclet number, which is usually given by letter Pe,
and it is ratio of convective flux to the diffusive flux, and if you write convective flux as
ρ u , because u is the velocity and that tell you which direction how much it is going,
so that it becomes convective flux. The diffusive flux
and
Δx
Γ
is the diffusion coefficient,
is the gradient distance that we decide, so diffusive flux. A ratio of
convective flux to the diffusive flux is what is known as a Peclet number. It measures
relative strength of the convection term and diffusion term. So, any equation, governing
equation, for example, momentum equation, we have convective term on the left hand
side, diffusion term on the right hand side. Later, we will also see in turbulent flow, we
also a term equivalent to convection term, term equivalent to diffusion term. So, the
Peclet number gives the idea of the role of or the weightage of convection with respect to
the diffusion.
If there is no diffusion then Peclet number goes to zero, then condition at P which is the
point of interest is influenced by sources at W and E. So, I am just giving one figure to
explain this, so there are two control volume, for example, shown in here circle , P is the
point of interest that is the nodal value where you want to find, and E and W are two
adjacent nodes; E basically for east, and W representing west. If there is no diffusion,
then variable value at P or the flux at P is completely influenced by W and E that is equal
weightage. Now, this is the direction of the flow.
164
(Refer Slide Time: 24:14)
Now, the other case is as Pe increases that is convective flux to diffusive flux Pe – Peclet
number increases, the biasing towards upstream direction, it is influenced by source at
W. So, as you can see, the size of the domain of influence, which is given here, P comes
into the domain of influence of W node. So, the extreme case, when Peclet number is
almost infinity then the independent of source at E happens and it is purely decided by
value at W. So, this transportiveness, boundedness and conservativeness are three
important properties, which any numerical scheme should have. I also mentioned about
realizability, we already talked bit about it that is concentration. If you are talking about
multi component system, concentration value cannot go negative, it can have either
lowest value of zero or highest value of hundred that will be in a situation..
Similarly, if you consider energy, kinetic energy for example, or stress term – square of
the residual stress, they all can have only a positive value, it cannot have a negative
value. Individually they can go without squaring the term can go negative, but when you
square it, it has goes to positive only. So, kinetic energy for example, it can have only a
positive value. We will talk about this when we talk about turbulent flow, so this
property is called realizability condition. So, in this class, we learned little bit about finite
element method, procedure in a finite element method with help of example problem
one-dimensional diffusion equation. Then we talked about properties arising in a
numerical scheme or what properties in a numerical scheme should satisfied. So, next
165
class, we are going to have another important topic, how to analyze a numerical scheme
with some key definitions.
Thank you.
166
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture - 13
(Refer Slide Time: 00:28)
It is my pleasure to welcome you all for this course on CFD. We are now into the
module three of this week. So, far, we have done different approximation method,
introduction about finite volume, finite difference, finite element methods, then we
talked about properties associated with numerical schemes, mainly three properties
conservativeness, transportiveness, boundedness. Today’s class, we will particularly talk
about analysis of numerical scheme, there are again three aspects – consistency,
convergence and stability, particular theorem called Lax equivalent theorem that relates
or connects all the three aspects while doing the numerical analysis. We will talk about
these aspects in detail with example. Then it will be followed by explanation by taking
different model equations.
(Refer Slide Time: 01:31)
167
While doing CFD approximations are made at different stages. And you get errors arises
due to these approximations. First step in CFD is computational modeling of a physical
problem, either we take a physical problem in dou tau or we simplify the physical
problem and then solved. So, in any one of this stage, there is a possibility some
assumptions are made or there is an error in the conversion of computational modeling
from physical problem. Second aspect is appropriate choice of boundary condition, again
ill posed boundary condition may result additional error. There is also possibility that
you have computationally modeled properly, there is a problem in coding. So, you may
have index, for example, i at j replaced with j i, in such problem, you may not be able to
identify so easily, the program may run, but it may give wrong results after sometimes or
after some iteration. So, one has to go back and check the code and it is possible to debug
and fix the code for the correct coding. One more type of error is due to numerical
approximation. There are three possibilities, one is truncation error, other one is roundoff error, and third one is discretization error. So, we will now focus mainly on this
numerical approximation error associated due to the numerical approximation.
(Refer Slide Time: 03:46)
168
So, round-off error is the number of significant digits considered. So, we know there are
lot of mathematical operations, subtraction, addition, multiplication and division. And
each of these arithmetic operation, we handle numbers, and number of digits, significant
digits considered after the decimal make the difference in the solution. So, there is
something called single precision; in this we usually consider 8 digits after decimals. If
someone decides to higher accuracy then you go for double precision, where we consider
16 digits after decimals. So, there is a repeated calculation in terms of iteration or in
terms of unsteady calculation and over so many nodal points in a computational domain,
so though this appears this kind of error appears very small over cumulative this error
will affect the results. And next important error is a truncation error. This is resulting by
considering or neglecting leading terms while writing finite difference approximation.
Now, there is a third error what is known as a discretization error, this is a numerical
error without considering the round-off error.
(Refer Slide Time: 05:36)
169
So, this truncation error, we mentioned how many or what terms you are considering
while writing the finite difference form of governing equation. So, you can neglect or
you will consider up to some terms in the expansion then you will neglect the remaining
terms. Remaining terms can be odd order or even order. So, accordingly the error can be
two types, one is the dissipative error, here the leading neglected term is of odd order.
Now, this also behaves like a viscosity, so you know in basic fluid mechanics viscosity
helps in diffusion. So, this dissipative error, where you are neglecting leading term; and
if the leading term is of odd order, then it functions like numerical viscosity or artificial
viscosity, but that helps in smoothing the problem, and other hand, you may not get very
peak or accurate results. Second type is the dispersive error, where the leading term
neglected leading term is even order term and that results in what is known as a
overshoots or undershoots. So, you may have a solution with vigils.
Now, let us get explanation of these two types of errors with some illustration. So, in this
figure, what you see, there is a there are three curves; now there is a black line which is
going like a step function and that is the expected solution or exact solution obtained by
analytical way. Then if you are solve that equation with leading neglecting term as odd
order, and you mentioned it is a dissipative error and you get a solution, which is
represented by the red line here, so you see here it is smoothens, and you are not able to
get the peak here, or you are not able to get the peak here. It connects very smoothly
without any problem.
170
Of course, you can increase the leading term, for example, instead of first term, you can
take the second term or third term then you may have a slightly improved solution, but
still it never captures the peak that is the property associated with the dissipative error.
The second error is the dispersive error and that is due to leading even order term, and
the solution obtain will exhibit vigils that is overshoots and undershoots, so you can see
here light blue color and that is the type of solution you will get. So, you can see up and
down then and so on. So, you have a problem either because of the dissipative error or
because of the dispersive error.
(Refer Slide Time: 09:15)
Now, we will try to get the explanation of this from finite difference formula. So, we
already did how to obtain forward differences scheme for the first derivative. And
without going to the steps in details, we write down the final expression here, so
∂f
∂x
is given like this. Now, you have consider only the first term, the remaining terms are not
Δ x1 ∂2 f
2! ∂ x 2
( )
consider. So, this is the neglected term
and so on and followed by many
other terms. So, this is the leading term that is not consider and this is of odd order and
we mentioned, this is the dissipative error.
171
We also learned how to write the same first derivative by central difference formula, and
you get after a simplification, we are interested only in the
∂f
∂x
∂f
, so we rewrite so
∂x
equal to like this. And you observe this is the leading term which you
172
are not consider, and this leading term is of even order
Δx
2
is of even order and that
results is what is known as a dispersive error. So, the leading term if it is odd order, it
will be dissipative error; leading term if it is off even order, it will results in dispersive
error. You will get smooth solution, but you will not capture the peak. In the second
case, we will get a vigils, but it may be accurate. So, there is a though why not we
combine both that is you take advantage of forward difference or backward difference
and central difference. So, such a scheme combination of both is what is known as
hybrid scheme, and we will use that also to get solution.
(Refer Slide Time: 11:20)
Next, we go to the analysis of discretized equation. We mentioned there are three
aspects, one is the consistency, second convergence, third stability. Definition of
consistency – it defines the relationship between differential equation and its discrete
formulation. So, we have an original or given PDE then we rewrite or we replace the
PDE with the discretized and we get the discrete formulation. Now, whether the discrete
formulation actually represent the original PDE is the question. And that property or that
condition is what is known as a consistency. So, it is a condition on structure of the
numerical formulation. Second aspect is convergence, which connects the computed
solution to the exact solution of the differential equation, so what scheme you are using
and how it is convergent that information is obtained or analyzed by a property or aspect
called convergence. Third one is the stability, it establishes a relation between computed
solution and the exact solution of the discretized equations. This puts the condition on
173
behavior of the numerical scheme. So, next few lectures, we are going to get definition
and explanation with a model equation on these aspects, consistency, convergence and
stability.
(Refer Slide Time: 13:04)
There is a particular theorem called Lax equivalence theorem, which connects or relates
all these three aspects consistency, stability and convergence. The theorem reads like
this; for a well-posed initial value problem and a consistent discretization scheme,
stability is the necessary and sufficient condition for convergence. To get some more
explanation on this theorem, for a time-dependent initial value problem, if you analyze
the consistency and if you analyze the stability then convergences need not be analyzed,
it is satisfied automatically. So, when you are analyzing consistency, this leads to the
determination of order of this scheme as well as the truncation error. Similarly, when
you analyze the stability this tells on the frequency distribution of the error. So, if these
two are satisfied or analyzed properly then convergence need not be checked and it is
automatically satisfied by this theorem. The one point that is to be noted all these are
applicable particularly the stability is applicable for a linear problem, but in any practical
situation, all the problems are of non-linear, hence to do analysis on stability of a
particular scheme for a non-linear problem, one can locally linearize and carry out the
stability analysis. Similarly, stability analysis cannot be applied near boundaries.
(Refer Slide Time: 14:57)
174
Now, let us look at each of this in detail. First we take consistency, which measure
equivalence between original PDE and the finite difference equation, which replaces the
original PDE. So, when you replace the original PDE by a finite difference equation as
we know very well from Taylor series expansion, we consider only few terms and
remaining terms are neglected whatever order of accuracy that you are deciding. So, that
puts the truncation error and if the truncation error goes to zero as a function of
Δ x , which means if the length
Δt
and
Δx
Δt
or
goes to 0, the truncation error also
goes to zero then you recover from the finite difference equation the original PDE. If
such things happens then, the particular scheme is referred as consistent scheme.
So, we know the Taylor series expansion. We take example of one-dimensional
temperature diffusion equation and it is given here
∂T
, where T here refers to
∂t
2
temperature equal to
α
∂ T
2
∂x
( )
. Now, we know by Taylor series expansion, we can
separately write for time derivative and second order spatial derivative. Any scheme we
can write, we start off with forward in time and central scheme, so which is otherwise
shortly referred as FTCS – forward in time central in space. And for simplification
purpose, we will take the coefficient α to be one, so it will be only
175
∂T ∂2 T
.
=
∂t ∂ x 2
So, if you substitute forward in time on left hand side, you get finite difference equation
n+ 1
as
Ti
n
–Ti
, this is forward in time. And as I mentioned yesterday’s class, subscript i
Δt
or j stands for spatial and superscript n stands for time, so when you say n+1, it is
forward in
176
time minus n, so you get forward in time. Now, on the right hand side, we said central in
space, but times is at n level, so you can seen in the expression superscript n appears,
n
whereas, subscript it is central in space so you get
n
n
T i−1−2 T i +T i+1
Δx
2
So, this
expression we know already; independently we have learned by Taylor series expansion,
now we are substituting them together. Now, what we do, we perform Taylor series
expansion for each of these terms that is T in+1 ,T ni−1 , T ni+1 .
(Refer Slide Time: 18:30)
So, if you write the Taylor series expansion for each of the term, I am showing here for
each of the term up to certain terms for each term. For example,
n+1
Ti
, you can expand
in time – forward in time that is why it is n+1, and I have written up to four terms,
remaining terms are not written; similarly for all other terms that is
T in+1 ,T ni−1 . So, all
we have to do, we substitute this expansion in the finite difference equation, in this
equation and we will see how to do that.
(Refer Slide Time: 19:08)
177
So, if you substitute or rewrite or sum them properly then we get expression like this,
which is given
∂T ∂2 T
=
∂t ∂ x 2
and there are so many other terms and these terms are
coming from, this additional term what we have considered, because of the expansion.
Now, while writing this also, we have consider only two terms; one corresponds to time,
other corresponds to space, and whatever terms are not consider that decides the leading
error term, so this is of order Δ T
square and of order four in space Δ x .
(Refer Slide Time: 19:56)
Now, I put all the things together, so original PDE considered is given here. Discretized
equation is forward in time and central in space is also given here. Then upon Taylor
178
series expansion for each of the term substituting and rearranging, you get equation like
this. Now, what do we do to understand consistency, consistency definition if
and
Δx
ΔT
goes to zero, then original PDE should be recovered. So, we can understand
that from this. If you make
ΔT
that is appearing here itself
∂T ∂2 T
=
∂t ∂ x 2
going to 0 and
Δx
going to 0, then original PDE
. We get back the original PDE from the finite
difference equation, hence this particular scheme that is forward in time central in space
for this PDE said to be consistent. So, one can analyze any PDE by this way, this is the
very straight-forward procedure.
(Refer Slide Time: 21:11)
Now, we will take the next criteria, what is known as the convergence, so this is a
essential condition for any iterative procedure where to quit the calculation. Let say
usually end up in a algebraic equation, which is given here as
equation that we will be solved. A is a coefficient matrix; and
A Φ=b , this is set of
Φ
is the variable,
which you are interested, and b is the known coefficient, which is on the right hand side.
Let say you are doing iteration then, you get
Φ
value pervious level, you get Φ
value from the present level. The difference between the two is what is referred here as
epsilon and this is evaluated for the current level, so
ϵ n is what for the current level
and based on this, we decide whether to quit the particular iterative procedure. So, one
can setup a equation for residual; if you substitute
ϵ into the solution matrix that we
have put, we replace Φ by ϵ n and then you get residue,
179
residue mean equation is not satisfied some is remaining and that is given by
ρ ,
because it is evaluated at nth level superscript n is given.
(Refer Slide Time: 22:52)
There are many ways where you can use ϵ this to decide terminating a calculation. So,
if you take a absolute, so that is what is given here as modulus of
ΔΦ
which is
evaluated for the case of two-dimensional nodal location that is why it is subscript here
i,j and for the current level superscript n+1 is given. If the modulus of it is less than
specified value, so one can specify error limit, say
value for
ϵ
−5
10
or
−7
10
, some particular
can be said, whenever you are doing such calculations. And once that
difference Δ Φ
at the current level n+1 and at all i ,j location is less than convergence
limit of epsilon then you can say we can terminate calculation at that step and proceed
the next stage.
There also other methods, for example, the first one I written here, it is also possible to
write based on summation all the errors absolute errors and you say it is less than some
value prescribed value and such as called
L1 norm or you take summation, you take a
summation of the square all the error, so when you do square, there is no minus sign,
automatically everything goes to positive and you take a summation over the entire
domain and then you take a square root of it. And that also can be used as a criteria is
less than prescribed value ϵ and such is called
180
L2 norm. And we will talk about
these convergence criteria later classes also with different explanation. So, convergence
is also decided based on previous value and present value.
So, in today’s class, we talked about numerical analysis, particularly consistency and
convergence with some example. We will see you again with another important aspect of
this numerical scheme.
Thank you.
181
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture – 14
(Refer Slide Time: 00:26)
My greetings to you all, we are now onto the module four this week. In this week, we
said we will look into different approximation method, which we have already done.
Then some information about finite volume, finite difference and finite element method
that also we have done. Then properties associated with numerical schemes in terms of
conservativeness, boundedness and transportiveness; then we took important topic how
to analyze a numerical scheme. We listed consistency, convergence and stability. So last
class, we explained with the help of a model equation, get a clear explanation about
consistency and convergence. And today’s class, we will particularly talk about stability
and we try to get a detailed explanation how to use or how to check stability and extent
for a particular problem. And there is a theorem, Lax equivalent theorem, which connect
all these three together. Then we will follow it with in the next class explanation with
different model equations.
182
(Refer Slide Time: 01:39)
We said consistency, which defines relationship between differential equation and
discrete formulation; it otherwise talks about condition on structure of the numerical
formulation. Convergence it connects the computed solution to the exact solution of the
differential equation; in other words, it puts the condition on solution of the numerical
scheme. Third aspect is the stability, which establishes the relation between computed
solution and exact solution of the discretized equations.
(Refer Slide Time: 02:19)
183
We take the third aspect – stability. And we mentioned last class, there are types of
errors, truncation error and rounding off error. A numerical scheme is said to be stable if
the errors do not grow in the course of simulation or calculation that is there are within
some limits specified, if you get a solution then such a scheme said to be stable. Now
how to check stability for a particular numerical scheme, there are two popular methods,
one is the matrix method, second one is the von-Neumann’s method. In matrix method,
one find out the Eigen value and based on the Eigen value, one can explain where the
scheme is stable or not. There is another method von-Neumann’s method, where Fourier
series explanation is used.
And today’s class, we particularly talk about von-Neumann’s method and how to apply
for a discretized equation. As I mentioned last class, this von-Neumann method is
particularly suitable for linear equation, but most of the equation used in for practical
simulations are non-linear in nature; locally you can linearized and apply von-Neumann
method, so there is a limitation to apply von-Neumann method for a practical non-linear
problem. However, it gives idea whether the scheme is stable or not. And here as I
mentioned, finite difference equation is expanded in Fourier series form. And just like
linear equation is one limitation, this also not applicable near boundary.
(Refer Slide Time: 04:10)
So to get explanation on von-Neumann’s stability analysis, we take a model equation, so
it is again one-dimensional equation,
∂u
∂2 u
=α 2 . We have already seen this
∂t
∂x
184
equation, when we talked about consistency. Again we mentioned about what is FTCS,
which is forward in time central in space. So, if you write down for this forward in time,
n
u n+1
i −u i
Δt
that is forward in time equal to α uni−1 ,u i and so on, so this term is
actually central in space, because it takes point of interest i and one node on either side
i+1 and i-1, and this is evaluated at n time level. It is central in space and this is forward
in time.
Just rearrangement, we take this
Δt
to the other side uni also known value, because
it is evaluated at nth level also to the other side; only quantity to be determined is
so that is rewritten and you get this term
1
un+
=uni +d (..)
i
1
un+
i
into this. So, what is d, d is
αΔt
, so this Δ x 2 that is there in the denominator for the central space; and Δ t
2
Δx
, which is coming from the left hand side, which is because of the forward in time, and
all are combined together we get coefficient d and it is written as
express all these in term of Fourier component, so for example,
U n e I p Δ xi . So in this, where I is the imaginary number
αΔt
. We try to
Δ x2
uni
as capital
√−1 , and p is the wave
number and this decides the component. And you get expression for each of these terms,
1
is written here;
un+
i
uni±1 is also given here. We substitute this into this expression
and let us see how to do.
(Refer Slide Time: 06:48)
185
So, you also define
that expression as
θ =p Δ x , which is referred as phase angle. So, you can rewrite
1
un+
=U n+1 e I θ i , similarly for other term. We substitute these into
i
the original finite difference equation, which is written for one-dimensional diffusion
equation that is what is shown here. we observed that
eI θi
appear both on left hand
side as well as on terms on the right hand side. So, you can cancel some of the common
terms and then rearrange, it is purely arithmetic. Once we do that then we get final
expression as
cos θ
or
U n+ 1=U n [1+ d (e I θ −2+e−I θ )] . we know
cos θ
eI θ
expressed in terms of
can be expressed in terms of exponential form as
e I θ−e− I θ
. So,
2
if you substitute explanation for cos θ and e in these two and rearranging then you get
U n+ 1=U n [ 1+ 2 d(cos θ −1)] . What you observe is
U n+ 1
is related to
Un
times
some quantity, and this is actually the error quantity and which you know will be used
for doing the von-Neumann’s stability analysis.
(Refer Slide Time: 08:42)
So, if you write the bracket terms, which is
[1+2 d (cos θ−1)] , and this is what is
known as a amplification factor. And the usual symbol is G, so
U n+ 1=GU n , so the if
the error needs to be contained then for stable solution modulus of G needs to be less
than or equal to 1; in other words,
[1+2 d (cos θ−1)] and modulus of that terms needs
to be less than or equal to 1. So, you can understand how to obtain on this limit value for
θ or value for d. We know maximum
186
value of
cos θ
and we know d definition, so if we follow that you get a condition d
should be less than or equal to half and we just put the definition of d here again, where
d is related to
This
α
αΔt
.
Δ x2
is a coefficient, diffusion coefficient, which is coming from the equation
itself, so we do not have a much choice on
α . Whereas Δ t
and Δ x
are coming
Δt
Δx
from discretization and that we have a control. So, you can adjust
and
in
such a way the d is less than or equal to one by two or half, in order for this scheme that
you have chosen that is forward in time and central in space for that model equation, and
solution to be stable. One has to satisfy the condition d is less than or equal to half.
(Refer Slide Time: 10:47)
We will try to get explanation of the G graphically, so we know the expression and we
work out different values of G for different values of d. And G = 1 is in the blue color;
and here we have not marked modulus of G, so you get -ve sign here. And as you can see
this black line is for the value d = 0.6; and we put the condition
d≤0.5 , so this is
above that condition. And you can see here, for this range of
θ , it exceeds that
condition that G should be within one. Whereas if you take d = 0.5 that is the limit that
we set,
d≤0.5
that is the limit is 0.5. We can observe here, that is marked by this red
color line, and it just touches G equal to one limiting line and then other points are well
within that limiting
187
line. Similarly, for other values of d, they are well within the limiting line, hence the
scheme that we are chosen is stable for the particular that we have considered.
(Refer Slide Time: 12:25)
Let us explain this von-Neumann’s stability analysis. For another equation – twodimensional equation; we write down the equation again, but including two dimension
that is the second dimension. So it is
∂u
∂2 u ∂2 u
=α
+
∂t
∂ x2 ∂ y2
(
)
. We apply again forward in
time central in space scheme to this two-dimensional equation, and we get final
expression as shown here. So, forward in time is on the left hand side, so n+1 and n
appears; and on the right hand side, we have central in space, now applied for x-direction
as well as in y-direction. So, the first term in the bracket this term is for second
derivative in the x-direction, you can observe
ui−1 , j , ui , j ,u i+1 , j , but all at nth level.
Then second term in the parenthesis, this is for second derivative in the y-direction, but
again central in space, so you can observe, u is taken from nodal location i,j-1, u at (i,j), u
at (i, j+1), again it is evaluated nth level.
We rewrite this equation, we are interested only in the term
1
, all other terms are
un+
i, j
known from nth time level. Hence we rewrite this equation by keeping the unknown on
the left hand side, and taking all other terms to the other side. So for example, this
is taken from denominator on left hand side to the other side; then
Δt
uni , j is also taken, it
becomes positive. So, each term, for example, the first term, first set for second
188
derivative in the x-direction,
αΔt
Δ x2
as
d x ; similarly,
αΔt
Δ y2
is named as
dy .
So, you get finally, expression as shown here. let us apply when von-Neumann’s
stability analysis to this final discretized equation, following the same procedure as we
did for one-dimensional equation.
(Refer Slide Time: 15:12)
So consider the Fourier component of
eI pΔ x i
and
uni , j=U n , this capital U is for wave and
e I p Δ y j . we have additional term, when you compare the 1-D situation,
so one term is for x-direction, the second term is for y-direction. We extend this for all
other terms in that equation. For example,
uni±1, j±1
is also written as shown here. As we did in one-dimensional case, we define I
is actually
define
1
is written as shown here. Similarly, for
un+
i, j
√ −1 ; p and q are wave numbers respectively in x and y direction. We
θ =p Δ x , ϕ =q Δ y . So, with this definitions, and expression for individual
term, now we substitute in the final discretized equation and we get expression as shown
here.
You can identify or recognize the left hand side, for example,
U n+ 1 e I ( θ i+ϕ j)
is for
1
. Similarly, all other terms are independently written in this final expression as
un+
i, j
shown here. We will apply von-
189
Neumann’s stability analysis to this equation; in other words, we rearrange and then find
out amplification factor, limit for amplification factor and get idea on the stability
condition.
(Refer Slide Time: 17:29)
We rewrite again that expression, cancelling all the common terms from left hand side as
well as right hand side, finally, you get expression as shown here as capital
U n+ 1
which is related at n+1 level it is related to same variable at nth level in this way. Once
again we can express exponential in terms of
also again cos θ
,
cos ϕ
cos θ , so
cos θ
is used and for
ϕ
is used, so after this substitution and rearrangement, you
get expression as shown here, which is in terms of
cos θ and cos ϕ . just like we did
in the one-dimensional situation, here also we have a condition for the terms which are
written within this bracket.
190
(Refer Slide Time: 18:30)
That
is
what
is
known
as
amplification
factor,
which
is
given
as
G=1+2 d x (cos θ−1)+2 d y (cos ϕ −1) . So, for stable solution, condition is modulus of
G should be less than or equal to 1. We can manipulate arithmetically and then first
condition is always satisfied. The second condition is satisfied based on this condition
that
d x +d y ≤
dimensional,
1
1
. So if you recall in one-dimensional, we got d≤ ; now in two2
2
d x +d y ≤
1
. So, you can imagine, if you extend this procedure for three2
dimensional, then it will become
summed up condition that is
d x +d y + d z≤
1
, so whenever you have such a
2
d x +d y , which is summed up limiting condition then
there is a restriction.
So you recall d is defined as
dx =
α Δt
,
Δ x2
d y=
αΔt
, so similarly when it comes to two-dimensional
Δ x2
αΔt
, and you have a summed condition
Δ y2
d x +d y ≤
1
. So,
2
whenever you have such summed condition, it is becoming the restrictive, now it
becomes more restrictive in the case of three-dimensional where you have a summed up
condition for all the three directions together, so
191
d x +d y ≤
1
. And you known Δ t
2
is
one parameter you can control and
Δx
and
Δy ,
Δz
are spatial distribution in
respective direction that is another three parameter that you have to control, and together
you have to satisfy this condition. For that particular
192
scheme, that you have chosen for that particular equation that you are explaining and
error to be or calculation to be stable.
(Refer Slide Time: 21:10)
You can try it out, try taking the same model equation, we explained with forward in
time and central in space consistency as well as stability. You can try the same model
equation either in one d form or 2D form, and try it different other scheme that is
backward in time sorry backward in time is difficult, you can forward in time forward in
space or forward in time backward in space and so on. And try other model equation
again for consistency and stability with different discretization scheme.
For example, try 1D equation, we have consider only the diffusion, you can actually
include convection also as given here
∂u
∂u
∂2 u
=−a
+ α 2 . This particular equation
∂t
∂x
∂x
specifically is called Berger’s equation, this is Navier-Stokes equation without pressure
term such a equation called Berger’s equation. And there is a convection term, but this is
linearized, so in the usual in the original convection term instead of a, there will be u the
function variable itself
u
∂u
will be there. For the sake of understanding consistency
∂x
and stability it is linearized, so you get a, a is some other coefficient, which is not related
to the function variable u itself. So, such a equation is called Berger’s equation. You can
take other model equation and try with one of these schemes, understand consistency and
stability.
193
So, in today’s class, we have particularly talked about stability, explained stability. See
you again with another important topic next class.
194
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture – 15
Greetings to all of you, today’s class will be the last class for this week on this course
CFD. So far, we have done information about different approximation methods,
properties associated with the numerical scheme, then how to analyze a numerical
scheme for consistency, convergence and stability. In today’s class, we will get
explanation of these with some more example equations. First, let us consider as shows
in the past 1D unsteady diffusion equation
∂u
∂2 u
−α 2 =0 . We also learnt in the
∂t
∂x
previous lecture, different scheme available for this model equation; one of thing is
explicit scheme and forward in time central in space.
(Refer Slide Time: 01:45)
If
you
write
down
the
difference
equation,
we
get
this
form
n
u n+1
uni−1−2 uni +uni+1 2
i −u i
t=α
x . We mentioned forward in time, so the superscript n is
Δ
Δ
between n+1 and n, central in space so the subscript i which is used for space and it is
central, so we have node of interest i, and left node and right node i+1 and i-1. It is also
possible to write different other schemes, for example, forward in time forward in space,
forward in
195
time backward in space, central in time and central in space. And it is also possible to
write different order in any of these schemes and analyze appropriately. Order of this
scheme order of accuracy of this particular scheme is
already learned this scheme is stable for r≤
α
α
is here, and Δ t
Δt
Δ x2
Δt
and
1
, where r is defined as
2
Δ x 2 . And we
α
Δt
that is
Δ x2
is moved from left hand side to the other side, and this is
this is what we learned through von-Neumann’s stability analysis.
We can also write same forward in time central in space, but in explicit form. So we at
that time we mentioned what is explicit and what is implicit, and here also we are going
to reemphasize that point. So, this is forward in time on the left hand side for time
derivative
n
u n+1
i −u i
Δt
this term is same as what is explained here. There is the small
difference on the right hand side term for spatial differencing and here you can observe it
is central in space because ui−1 u ni ui +1 we consider, but it is implicit which means it is
evaluated or it is consider at the same time level, the time level here is n+1. So, all this
variables are considered at the same time level. So, you observe the superscript as n+1 in
all the three terms, such a scheme is called implicit scheme.
And both these schemes you can understand by the sketch here. So, explicit scheme is
what is shown here value at n+1 is evaluated based on values at n level, but using central
differencing scheme i+1 i and i-1 and this is for explicit scheme. And this figure
demonstrate, how it is for implicit scheme, we consider again values at i+1 at i-1, but at
n+1 level.
196
(Refer Slide Time: 05:28)
Now we have try to understand, how to get different explicit scheme, there is a scheme
called DuFort-Frankel scheme, which is central in time and space. So, if we look at time
derivative discretization, we observe here
1
n−1
. So, it is actually evaluated as
un+
i −ui
central scheme, but in time that is why you get superscript n+1 and n-1 corresponding
denominator two is appearing. And for spatial derivative, it is central in space, but there
is a small difference uni−1 , so it is explicit; the last term
ui+1 at n th level, hence it is
also explicit; the middle term is evaluated using central, so this is
1
un+
i
and
.
un−1
i
This happens to be unconditionally stable.
If you remember or just recall we learned forward in time central in space is
conditionally stable, whereas if you replace one particular term middle term by the
central in time, so n+1 and n-1 stability condition changes from conditionally stable to
unconditionally stable. And this scheme also happens to be of order of accuracy
and
Δ x2
and
Δ t2
Δt
. So, if we compare against forward in time central in space,
Δ x2
where it is conditionally stable and order of accuracy is
Δt
and
Δ x 2 . So, the
middle term, which is shown here for the FTCS u of i n which is completely explicit is
replaced with
1
un+
i
and
. So, for changing this slightly, you are able to get a
un−1
i
conditionally stable to unconditionally stable, and order of accuracy is also improved
you can observe that.
197
There is also small note to be observed that is for the same scheme DuFort-Frankel
1
scheme which is central in time and space, if you observe here un+
and un−1
, when
i
i
you are starting the calculation that is the time equal to zero level for example, then this
quantity that is
un−1
i
is not available, because we have not done the calculation when
you say n-1, it is before zero and that time it is not available. So, this particular scheme
DuFort-Frankel scheme self-starting at time equal to zero level is not possible, as data at
n-1 level is not available. So, at time is equal to zero alone, we do a calculation based on
any other scheme once that quantity is available then you can switch to DuFort-Frankel
scheme.
We move onto the next that is implicit scheme. So, general discretization for the same
n+1
model equation, so this is time derivative which is forward in time
n
u i – ui
. There is
Δt
small difference here on the right hand side for the spatial derivative, you get two
components here, first bracket term ui+1
ui and ui−1 , so it is central in space, but
on the superscript, you see n+1 for all the quantity. So, it is central in space, but implicit.
Now we move onto the next bracket term that is here, second central in space, but it
evaluated as explicitly at nth level. So, we can see all the superscript for all the three
terms as n.
This scheme is unconditionally stable for value of
θ , which is multiplying one part
1
. So, we have a factor called
2
1−θ the factor multiplying another part. Now
there are multiple variations for different values of
look at the first term if
θ≥
θ , if
θ =0
for that is if you
θ =0 , and implicit in time is not there, and you get one
multiplying the second part of the equation, the second part of the equation happens to be
fully explicit. So for
θ =0 , it will results in forward in time central in space explicit,
this we have already seen. And for
θ=
1
, 0.5 value, we get weightage actually,
2
weightage of equal weightage equal weightage of implicit scheme and equal weightage
of explicit scheme such a scheme is called crank Nicholson scheme, because it is
proposed by both this people and it is neither explicit completely nor implicit completely.
So, it is referred as semi explicit.
198
And for
θ =1 , so if you substitute
θ =1 in the second term 1 minus 1 cancels all.
So, the explicit part goes to 0, only the implicit part remains, so becomes fully implicit
scheme. So, you understand by writing this generalized
199
discretization equation, you are able to get three different scheme forward in time fully
explicit, then crank Nicholson scheme semi implicit fully implicit also you are able to
get. So, fully explicit, fully implicit and semi implicit all the three schemes are possible.
(Refer Slide Time: 12:16)
Next we take two-dimensional equation and try to get information about these quantities.
Again we will take explicit forward in time and central in space. So, you write down the
equation. Now the index for subscript, we have used i for x direction, now use i and j
correspondingly x and y direction. So, forward in time, this we have already known and
central in space, but we have two terms one for x, another one term for y. So, this term in
the first bracket is for derivative in x, and second term is for derivative in y. We write
accordingly central in space in x direction, so i-1 i and i+1 central in space in y direction,
so it is i,j-1 i,j i,j+1 and it is explicit. So, you observed all superscripts are n. So, all this
quantities are evaluated at n time level.
You can rewrite this equation, by bringing all the known terms on one side and the
quantity all variable that we determined on other side. So, in this case
1
un+
i, j
is the
quantity to be evaluated and that is retained on the left hand side as you can see here
1
and you bring all other quantity to the right hand side. So,
un+
i, j
+d y
d
un+
i, j
x
on set of term
another set of term. It is also again you can rewrite, because you observed
appears two other places. So, you bring all
uni , j and then ui−1 , j
200
uni , j
uni , j together, you will get a coefficient for
and
ui+1 , j
and the remaining terms. So, this is the way you rearrange and write for
coding purpose. And the
as α
dx
is explained as
α
Δt
; similarly,
Δ x2
dy
is explained
Δt
.
Δ y2
(Refer Slide Time: 14:55)
Now, let us look at this little more detail. Order of accuracy for this scheme is
time and
Δ x2
and
Δ y2
Δt
in
for two different spatial direction we also learnt through
last lecture that the scheme is stable only if
α
( ΔΔxt + ΔΔyt )≤ 12
2
2
this is what is known
as summed up condition and we also mentioned if you extend this for 3D you get one
more term here and it becomes restitute
then you have the limited option on
α
Δx
is given in the equation
or
Δt
if you fix
Δ y . So, that you satisfy stability
condition now we can rewrite the same in fully implicit form still following forward in
time and central in space. So, you get superscript on all the right hand side term as n+1
which means you are actually evaluating at the current time level some of them are not
evaluated some of them are part of the equation and if you rearrange as with it in the
previous case rearrange all the term accordingly.
So, in this case the only term that is known is
uni , j .
So, you move that to one side. So,
that is what is taken here, than all other terms are brought other side which are not known
201
because all are to be get to remain or to be evaluated at n+1 time level. So, you get
rearrange and you get this step of equation. So, this particular equation is run
202
through entire computational domain are along a line nodes along a line then you get
simultaneous equation for every node you will get one set of equation and you need to
put them together and invert the matrix. So, you get simultaneous equation is to be
solved because variables at different nodes are coupled with each other and this set of
equation will result in what is known as the pentadiagonal matrix.
In the next slide, I am going to show what is pentadiagonal matrix usually either you
adopt a separate procedure to invert a pentadiagonal matrix, it takes definitely time
consuming. There is an alternate way of doing the same that is same equation we are
using multiple methods of doing the same equation. The second have full dimensional
diffusion equation; first we have seen explicit forward in time and central in space then
we have seen implicit forward in time central in space we understand like order of
accuracy as well as stability condition.
(Refer Slide Time: 18:20)
Now, let us look at different matrices what we shown here is just diagonal matrix, only
one along the diagonal only one quantity is remaining, all other elements in the matrix
are have 0 value then there is another matrix called tridiagonal matrix, this will
extremely useful, we see later how it is used in CFD. In this the diagonal, main diagonal
what is shown in the red, there is a value along the main diagonal then there is
immediately there is one diagonal element one diagonal parallel to the which is called
super diagonal and we have values along that. Similarly immediately below there is
203
diagonal called sub diagonal and we have values along that all other elements in this
matrix is zero such a matrix is called tri diagonal matrix then we will see pentadiagonal
matrix. So, this has the same structure as tri diagonal matrix, so that is we have one
diagonal immediately below sub diagonal immediately above is a super diagonal, then
the one more column or one more diagonal which is called super super diagonal which is
following a super diagonal.
And we have values along the similarly on the lower side, one more diagonal, one more
line following closely the main diagonal, but just below the sub diagonal were values are
available. So, we have a pattern and this is what is called pentadiagonal that regular
pattern. Now if you look at it is also possible to have pentadiagonal of different pattern.
So, we can see main diagonal is there sub diagonal is also there super diagonal is also
there the next sub sub diagonal or super super diagonal is not there, but it is after there.
So, you get one more line with values another line with values. Now why I need to bring
this, because you may get what is known as different lap structured matrix for different
problem and solution procedures are different for each of this matrix structure.
(Refer Slide Time: 20:52)
Now, we will see little more detail about what we mentioned in the previous slide that is for
two-dimensional diffusion equations. If we do completely implicit scheme then it results in
pentadiagonal matrix inverting A, such a matrix is difficult. And there is alternative way of
doing what is known as splitting and that is referred here as alternating
204
direction implicit method. So, you solve the same equation, but in two steps in the first
step equation is discretized and implicitly solved in x direction and explicitly solved in y
direction. In the second step, equation is discretized and implicitly solved in y-direction
explicitly solved in x-direction.
So, each time step solution is advanced by n+
1
level, which means to go from n time
2
level to n+1 time level, it is obtained in two steps. Now such a matrix results in two
tridiagonal matrices, and there is a standard easy procedure available to invert such a
matrix. And this is easier compare to penta diagonal matrix. If it is a three dimensional
equation, we extend the same logic that is to go from n time level to n+1 time level
solution is advanced by
1
3
step. So, n,
n+
1
, and
3
n+
2
3
and n+1, so that results
in three tridiagonal matrices.
(Refer Slide Time: 22:49)
Now we look at the equation. So, first step equation discretized and implicitly solved in x
direction, explicitly in y direction. If we look at the expression for the time derivative, we
mention it advances by half. So, superscript is actually n plus half then it is implicit in x
direction. So, all the quantities which are corresponding to derivative in x direction
∂2 u
∂ x2
the scheme is central in space. So, you get i+1 i and i-1 as a subscript, but it is
205
implicit in time here evaluating at n+
1
and that n plus half appears in spatial
2
derivative term that is why becomes implicit in x direction. So, we have n plus half as a
superscript on terms corresponding to second derivative
∂2 u
∂ x2
still central in space and
it is explicit in y direction. So, terms corresponds to y direction that is
∂2 u
∂ y2
you are
evaluating central in space. So, we have j+1 j and j-1, but it is explicit in time. So, we
have superscript appearing here.
Now once you solve this equation that quantity that is becoming to be known that is
n+
1
2
ui , j .
So, in the second step the equation discretized and it is implicit in y direction
explicit in x direction. So, we switch implicit and explicit direction. Now we write down
the equation as I mentioned when we solve the first equation, the quantity that is coming
to be known is
n+
1
ui , j 2
at and that is taken and we mention it is explicit in x direction.
So, if we look at the derivative in the x direction term so that is
∂2 u
. All the
∂ x2
quantities are with the superscript n plus half which means it is explicit in x direction and
you have moved you actually come to correct time level n+1 and we mention it is
implicit in y direction.
So, term that corresponds to y direction is here when we look at the superscript where all
at n+1 level. So, same equation is split in first step it is x implicit in x direction explicit
in y direction and the second step we switch the direction It becomes implicit in y
direction and explicit in x direction. Now if you look at the order of accuracy, it is
Δ t Δ x2
and
Δ y2
and it is unconditionally stable. Whereas, fully explicit forward
in time central in space still is conditionally stable. So, we get advantage by doing this
alternating direction implicit that is we get matrix simplified from pentadiagonal to
tridiagonal matrix order of accuracy improved and it becomes unconditionally stable
now let us understand this by graphical sketch.
206
(Refer Slide Time: 26:48)
So, fully implicit forward in time central in space suppose these are the quantity grid and
this are nodes and nth level. So, i and j is here i, j is here and to evaluate i,j at n+1 time
level that is what displayed we moved we take all the quantities corresponding n+1 level
for this same problem, but if we do forward in time central in space by ADI method we
introduce one more plane at n plus half level and plane at n plus half level we do x sweep
and then at n+1 level we do y sweep. So, in today’s class, we particularly looked at how
to do different finite difference scheme or how to improve order of accuracy or how to
get conditionally stable unconditionally stable and very important topic alternating
direction implicit advantage associate with that.
207
(Refer Slide Time: 28:16)
With this class, we come to end of this week. And we have touched upon the initial
aspects of CFD that is basic information about finite volume, finite difference, and finite
element method, properties associated with the numerical scheme, conservativeness
transportiveness boundedness, how to analyze numerical scheme, consistency,
convergence and stability, and explanation with different model equations.
Thank you.
208
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture - 16
(Refer Slide time: 00:40)
Greetings to all you, I welcome you all again to this course on CFD. Today is the starting of
the week four we will be touching up on important topic what is known finite volume method
of discretization. This week we will particularly see diffusion equation in detail, convection
and diffusion term in Navier-Stoke equation in detail. We will do initially these in 1D form
then we will get to know how to do in two-dimensional as well as three-dimensional. Then
we will have a separate detailed working on convection term alone, we learned before
convection term is non-linear in nature hence a separate treatment is required for convection
term. We will talk about convection term treatment in detail with different schemes. Then we
will also illustrate with example these methods and show comparison wherever possible.
There is a special treatment for near boundary implementation, near boundary nodes we will
have to account for boundary condition and we will see how the finite volume formulation
gets rewritten for near boundary accounting. This will complete in detail the finite volume
formulation without time derivate term.
209
(Refer Slide time: 02:16)
So, in general, we know finite volume method is very much suitable for complex geometry.
And what is shown here is a just a simple structured mesh arrangement. You see here
horizontal lines as well as vertical lines and wherever they meet shown by a dot that is
supposed to represent node, and here you are seeing a node with control volume surrounding
that node which is shown by dotted horizontal line as well as vertical line. And this hash line
incline hash line supposed to represent the volume surrounding that particular node. And you
can extend this everywhere and the procedure is same or almost similar for unstructured grid
also.
In finite volume formulation, we use integral form of the governing equation, and it is given
as integral over surface flux for a particular surface and equal to first term on the right hand
side is for diffusion, and second term on the right hand side is for all the source term
accounted. And this is integrated over the volume and this is integral to the surface. Now
when we are writing finite volume formulation, the surface integrals as well as volume
integrals are approximated using appropriate formula and we are going to see them in detail
in subsequent lectures.
210
(Refer Slide time: 04:07)
Before we go in the details, we have to get familiarize with terminologies with regard to
finite volume mesh, and they are same for 2D as well as for 3D. What is shown here is a line,
which represent one-dimensional mesh and we have always dotted circle these are the nodes
along that one-dimensional grid; P is the point of interest and W, E that is capital letters W,
E, similarly capital letter WW and EE are to represent nodes. And then you construct control
volume between nodes. So, for example, between P and capital W, there is a control surface
and this is referred as small case w, similarly between node P and capital letter E which is on
the east side node, a control surface is constructed and that is referred by a small case letter E.
Now, we have to know distances between node and face, and node and surrounding nodes.
So, because it is one-dimensional, we have Δ X, and Δ x this is between node P and west face
w. So, we use Δ x Pw. Similarly the distance between node P and the east face e is given here
as Δ x Pe. The same way, distance between node to node, so for example, in this case between
node P and E is given as Δ x PE; similarly for other side. Now this west of west is referred as
WW; similarly, east of east is referred as EE. These are required in case you are deciding to
have higher order accuracy scheme.
211
(Refer Slide time: 06:50)
In general, Navier-Stoke equation if you neglect unsteady term and convection term then we
obtain diffusion equation and it is given here are d i v ( Γ grad ( ϕ ) ) + Sϕ =0. So, this Γ is a
diffusion coefficient depending on equation. Suppose if it is the temperature equation and
then this corresponds to diffusion coefficient correspond to temperature equation and ϕ is any
property.
The
control
volume
integration
of
this
equation
results
as
∫ d i v ( Γ grad ( ϕ ) ) dV + ∫ S ϕ dV equal to and this we are converting volume integral surface
CV
CV
integral and that is what you have seen on the right hand side. The source term is left as if it is
because if it is integrated over the volume, and we take average. So area integral gives the
flex entering or leaving the control volume. So, in this case, this n ⋅ dA, dA is the area vector,
n is vector normal to that area. So, this give actual flux either entering or leaving. And the
volume integral on the right hand side gives the source term over the control volume, so thats
what shown here. Now let us see how to actually apply this equation for the mesh details that
we have shown.
212
(Refer Slide time: 08:38)
So, this is the equation integrated the mesh and corresponding details are reproduced here, P
is the node of interest and we go from P to the left on the west node; on the right on to the
east node. We apply this integration for this mesh that is shown and we get here Γ A
evaluated at east face that is here − ΓA
dϕ
dx
dϕ
evaluated at west face that is here on the left side
dx
Because it is one dimension we are using d instead of the ∂ and source term is evaluated as
average over the surface over the volume, so it is S̄ ΔV . Now this is generalized form. So, in
one dimension, you actually do not have V, but this is generalized form. A cross sectional
area of the control volume and S̄ is the average value of the source term.
Now let us see how to evaluate each of these terms for the mesh that is shown here. For
example, Γ A
dϕ
dϕ
at east face that is on this side similarly Γ A
at the west face that is on
dx
dx
this side; suppose it happen to solve let this then you get ϕ evaluated at node P similarly at
node at E, EE and so on, similarly on the other side W and WW and so on. So, ϕ is variable
that is evaluated only at the node location, whereas
dϕ
is a gradient of ϕ which is required at
dx
the faces, so in this case required at the east face or at the west face.
213
(Refer Slide time: 10:50)
So, discretized equations are written on the cell faces that is what we have just seen, but we
know the values of the property only at the nodes, so P, E, W, EE and WW and so on.
However they need to be interpolated to get values on the faces. There are many interpolation
methods available. We will choose initially central approximation that is Γ where is evaluated
from, Γ available at P node and Γ available at W node as a average, so that is why it is
ΓW + Γ P
. Similarly Γ at the east face is evaluated from Γ, available at east as well as at P
2
node as the central approximation
ΓE+ ΓP
.
2
Now this Γ is diffusion coefficient I mentioned before. In general, it may be a fixed, other
word it may be a constant, it may not vary for some cases. Later you will learn Γ also as a
function of the temperature or as the function of the flow. In the case of two phase flows it
may vary from face to face. So, here we are actually talking about the general procedure. The
(
next term that is discretization equation is Γ A
dϕ
dϕ
. So, we write this as Γ W AW
dx w
dx
)
( ) . So,
W
we know the function value of P node, we know the function value at W node then use
approximation between these two nodes and we get
ϕ P − ϕW
, Δ x PW shown here that is the
Δ x PW
distance between node P and node W that is what shown here. We write similarly for other
214
(
face Γ A
dϕ
dx
)
e
as Γ e again
ϕE − ϕP
evaluated between the nodes P and E that is what is
Δ x PE
shown here as Δ x PE. Again the question is about A, if it is the uniform mesh then A will be
the same that is whether it is east face or west face. We are writing here generalized
procedure that is why we still use the subscript e and w.
So, for a situation when the control volume shape is changing from one face to another face
between node to node then this A can be used accordingly. This is again we are assuming a
uniforms mesh arrangement that means, distance between P and W, distance between W and
WW. Similarly on the other side, distance between P and E or distance between E and EE are
same, in such case the weightage are equal from both the side for contribution at particular
face. For example, for ϕ P and ϕ W will contribute same for evaluating ϕ at control surface w,
similarly then other side. If you are having non-uniform mesh arrangement and then you have
to take weightage accordingly and we will see that a little later.
(Refer Slide time: 14:42)
Now source term is usually a function of dependent variable; in this case it is ϕ itself. And it
is approximated in the linear form as S̄ Δ V =S u+ S p ϕ p; and su is the is a constant value and
this is a linear variation. We have seen individually details, now we have to substitute in the
discretized equation; this was the discretized equation we have seen how to evaluate each of
this for each face. So, we will substitute, we get Γ e A e
215
(
ϕE − ϕP
; similarly, other term then for
Δ x PE
)
source term. So the equation now is the discretized equation of the diffusion equation by
following finite volume procedure.
(Refer Slide time: 15:47)
We put all the things together; this was the original diffusion equation. And we get
discretized equation, these are evaluated for the node that we have defined and we get final
discretized equation in this form. We can observe in this equation ϕ P is a variable interest, P
is the node of interest and you want to evaluate ϕ at the node of interest P, and you find the
term appearing first term appearing in the second term also appear in the last term that is for
the source term. This is a variable at the node of interest. So, we need to collect that
coefficients, so collecting similar coefficient together as, so in this case ϕ P then you write
down all the terms corresponding to ϕ P together. So, you get
Γe
A that is what is coming
Δ x PE e
here as the first term. Similarly this term is here and then ϕ is also there and this is the
quantity of interest so you are retain that on the left hand side, and that is why some - sign
and + sign gets changed when you move from left to right then remaining terms are in this
equation ϕ Eand ϕ W again a group those coefficient properly, so ϕ W is written here and ϕ E is
written here. Constant for source term the Su is written separately.
Now, if you look at the equation for the moment you imagine terms in the bracket as one
coefficient. So, some coefficient into ϕ P equal to some coefficient ϕ W plus some coefficient ϕ E
plus Su. Now the mesh that I have shown P is the node of the interest it is at particular
216
instance or one particular location in the space you can imagine ϕ is running from left to
right. In the case of 1D that is all the notes of interest are going from left boundary to right
boundary then this equation is repeated for all the nodes from left boundary to right
boundary. Now if you can understand this is the point of interest and ϕ W and ϕ E or known
either from previous iteration or the current iteration that is why left hand side is unknown
and right hand side is known quantity.
(Refer Slide time: 18:34)
Rewrite that equation again as I mention all the bracket terms can be written as one value and
that is shown here as a E , a W and a P. And a E is actually the term corresponding to east Node
Γe
A . Similarly a W is the coefficient corresponding to the west node that is shown here.
Δ x PE e
Now you can observe that this term the first term for ϕ P is same as term for east node. If you
look at this
Γe
Γe
A e is the first term for ϕ P that is same as
A coefficient term for east
Δ x PE
Δ x PE e
node. So, that we already define as a E , similarly the second term in the ϕ P is corresponds to
Coefficient for ϕ W and that is what shown here. So, coefficient for ϕ P can be return in terms
of this coefficient and you see here a W +a E is the only term is not represented the other term is
S P and that you can add separately here. So, this is actually advantage because you evaluate
a E and a W and that is good enough and that can be used even in a P also.
217
So, in terms of these newly define coefficient the discretization equation is written as a
a P ϕ P =a E ϕ E + aW ϕ W that is. So, simple and as I mentioned before node P with the point of
interest it is just a representation. So, it for a 1D it will run from left boundary which is
already as the boundary condition node immediate to the left boundary all the way up to node
just before the right boundary. So, P will run from the left node left most node to the
rightmost node then this discretized equation will become system of equations.
And you can represent in the form of a matrix, we have to have some procedure for inverting
that matrices once inviting the matrices then all ϕ P are coming to be known such a procedure
is solving the linear equation system and will have a separate class on matrices inversion
procedure. So, near boundaries, in case of 1D case, for example the coefficient a W is actually
west to the node of interest P. So, near boundary P will be one node very next to the left
boundary; and for that node, there is no west node, because the west surface is the left
boundary itself, in such case the coefficient a W is made to 0. Similarly on the right side, node
very next to the boundary, there is no east node for that boundary, because east surface is the
boundary condition itself, is the location where the boundary condition is enforced. So, there
is no east node, hence for the right boundary node near the right boundary a E is made to 0.
You can imagine how it will be for the case of 2D and 3D, we will explain that in the
subsequent slide.
(Refer Slide time: 22:49)
218
We have Navier stock equation and definitely continuity equation what we are saying is just
one term in the Navier stock equation that is diffusion term will see how to do for continuity
equation. Finite volume formulation for continuity equation let us take 1D study
incompressible situation and continuity equation is written because it one d we can write as
du
d ( ρu )
=0.
=0 quotes it incompressible. So, the ρ will not be there becomes only
dx
dx
Again we are the same definition of node control volume distances define for 1D case. Now
if you write integration of this equation for the control value formulation when you get
( ρ u A )e − ( ρu A )w, because it is continuity equal to zero, it is very simple. Now this ρ is again
for in compressive flow not be there to come out and it the term will not be there. And if it is
constant mesh then they a will not be there it just only ue −uw =0of course, in 2D you have
velocity in vertical direction that become v corresponding to top as well as bottom.
(Refer Slide time: 24:22)
we let you to get a feel of how this is actually implemented for that you take one on heat
diffusion equation one dimensional steady state heat diffusion equation has shown here
d
dT
k
+ S=0where k is the thermal conductivity and for the problem that you are going to
dx dx
( )
explain k is the 1000 watt.meter/Kelvin and area is 0.0001 metre 2 and their source term that is
the very simple situation without anything it just heat diffusion. problem figures shown here
the cross section area that was shown here and boundary left boundary value given also
219
temperature the left boundary as 100 degree Kelvin similarly boundary on the right side that
is B T B given as a 400 degree Kelvin and the distance between left boundary to right
boundary is 1 metre.
(Refer Slide time: 25:39)
Now, we divide the length of the rod into five equal control volume. So, one metre divided by
5 will give Δ x=0.2 and that is shown here. So, this is the left boundary T A=100 and this is
right boundary T B=400 and define five equal control value five nodes 1,2,3,4,5 for
representation we are showing one control volume which is in blue colour and distance is
uniform between any two notes for Δ x is same between node one and two, and it is same
between node 3, node 2 and three similarly for other nodes near boundary. For example, left
boundary distance between node one and the left boundary half because you are having
uniform mesh it becomes Δ x /2.
Similarly, distance between node five in the right boundary is again because you are
following uniform mesh it is become Δ x /2. So, grids consists of five nodes and you are able
to distinguish node 2,3,4 are internal nodes; nodes are very near to the left boundary is node
number one node very near to right boundary is node number 5 we have the discretized form
of the equation only a diffusion equation and for the variable temperature, it is written here
ke
k
A e + w A w and we mention, there is no source term, so that term not appearing for
Δ x PE
Δ x PW
the coefficient temperature P. Similarly coefficient term for temperature evaluated at west
220
node and Coefficient term for temperature variable evaluated at east node. As I mentioned
before this node p will run from left to right in this case it will run from 1 to 5, so but node
one and node two are near the boundary; for the moment, We will consider only two three
four internal node. So, this equation is written for each internal node, for example, if you
write the equation for two then T W actually become T 1 and T E become T 3, now repeat the
procedure for 3 and 4.
(Refer Slide time: 28:27)
T
The discretized equation for nodal points 2, 3, 4 and you get the generalized forma E , a W , a P
as mention before this
k
k
A.
A and this the summation of other two coefficient. In this
Δx
Δx
case, diffusion coefficient is constant A is the 1D is also constant and Δ x is also same hence
it is happen very, very simple case near boundary loops that is for node one the west side
boundary A and we have this equation modify has k A
T E −T P
because for the node 1 each
Δx
side is available. Hence, we write full term where as on the west side only half is available
that is Δ x /2 and west side you have a boundary condition enforce that is reffered here as
temperature a so that is also used
T P− T A
and k A is the diffusion coefficient set to 0.
Δ x /2
In today’s class, I explained how to do for a diffusion equation finite volume producer for
diffusion equation we understand terminologies used in finite volume mesh and we able to
221
get approximation on east face and west face. We are able to understand how to deal for a
boundary nodes what term goes to zero for the left side and the right side, and to get some
more understanding of formulation we started with one example problem discretized
geometry into five nodal points equal distance. We could do internal nodes without any
difficulties a special treatment for boundary condition, location, node. And we explain for the
left boundary node that is node one there, the control surface to the left of the node one is A,
temperature condition at given and we see how was the finite volume formulation gets
reduced for the left boundary.
Next class we will continue this problem, and get idea of how to do for the right boundary set
up the complete equation including the boundary nodes, and how to solve the final one full
matrices, and we compare with the exact solution will also see how to extend this procedure
for 2D as soon as 3 D, but this I conclude today's class.
Thank you.
222
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture – 17
(Refer Slide Time: 00:47)
It is my pleasure to welcome you to this course again. Today is the module two for this week.
Last class, we had seen finite volume formulation for 1D diffusion equation in detail. We
understood the terminologies used in finite volume mesh, control volume arrangement, and
how to identify distance between node and node, distance between node and control surface.
Then we explained in detail diffusion equation then we understand with a help of example
problem the same formulation. We also try to do for near boundary node treatment. So, we
took example problem and we did up to left boundary node for that problem. We have also
written equation finite volume formulation for continuity equation.
223
(Refer Slide Time: 01:23)
To recapitulate what we did, this important to show again understand again the terminologies
used. Here is mesh arrangement, P is the point of interest, and the full circle is a node that is
marked here as a P which is the point of interest. Then for a uniform spacing, the
arrangement is shown, east side capital E and west side node is capital W. Similarly to the
west of west it is given here as WW; to the east of east is given here as EE. Then a control
volume is constructed around the node of interest. So, in this case, the full coloured shaded
portion is a control volume, and the left side surface is shown here as a w - small case w.
Similarly, the east side surface is shown here as small e; distance between node P and the
face because it is one dimensional x-direction we say it is Δ x Pw; similarly, the other side Δ x Pe
. Similarly distance between node and node, so here it is between node P and node W is again
Δ x, but it with a subscript capital P and capital W. We have seen all this.
224
(Refer Slide Time: 03:05)
We took this example problem that is one dimensional heat diffusion equation and for this
particular problem, we say source term is zero, it is very simple. And this is a illustration
required for that problem and the cross section is circular, and area is given as 0.0001 metre
square. The left boundary which is referred here as A, and temperature at that boundary is
given as 100 degree Kelvin. Similarly, the right boundary which is referred here as B, and
temperature at that boundary is 400 Kelvin; the distance between left boundary and right
boundary is given as 1 metre.
(Refer Slide Time: 03:52)
225
We said we will divide region into five equal control volumes. So, we have 1, 2, 3, 4, 5, and
we understood all the distance between node 2 to node 1, node 2 to node 3, because it is a
equal spacing. It is referred as Δ x for all the nodes in between nodes and for the node one
and node five which are near the boundary because it is equal spacing we have Δ x /2 as a
distance between node and the boundary. So, in this case distance between node one and the
left boundary is Δ x /2. So, we identify 2, 3, 4 nodes are internal nodes; 1 and 5 are boundary
nodes. We have a discretized form of the governing equation as previously derived and this
case there is no source term in that particular term is not there and again in this case k that is
a coefficient is constant and Δ x is also same value we also identify terms in the coefficient
for T P as same term as coefficient for T W and T E . So, this first term corresponds to coefficient
for T at east node similarly the second term here corresponds to coefficient for temperature at
west node. So, the T P coefficient of T P is summation of this two coefficient and that.
(Refer Slide Time: 05:36)
So, we write as a P T P=aE T E + aW T W with coefficient written as shown here and we say P is a
node of interest and it runs from left to right in this case we initially consider only internal
nodes. So, P will actually run from for node two three and four and we are able to evaluate
corresponding values
k
and A for node one the left side is boundary referred here as A
(Δ x)
and temperature is given as a boundary condition for node 1 right side that is east is available
226
hence for node one this is written separately k A
( T E −T P )
Δx
were as on the other side it is
boundary condition ( T P −T A ) which is a boundary condition the distance is Δ x /2.
(Refer Slide Time: 06:42)
Now, we will also try to do similarly for other node; before that we will identify that T P is a
node of is a node of interest is appearing in term here as well as in the term here. So, we
collect this coefficient. So,
( Δkx A+ Δ2kx A ) T equal to terms on right hand side. ( 2Δkx A ) T
considered as a source term Su + S P T P. Su=
P
( 2Δkx A ) T
227
A
and S P=−
( 2Δkx A ).
A
is
(Refer Slide Time: 07:29)
So, if you extend this procedure for the other node in this case 5. node 5 is a node next to the
right boundary and k A
full term
(T B− T P)
Δ x /2
again for node 5 west side that is 4 is available. So, we write
T P− TW
=0. Again the identify T P that is the point of interest appearing in both this
Δx
term collect corresponding coefficient. So, you are able to rewrite this equation in this form
( Δkx A+ Δ2kx ) T equal to ( Δkx A ) T +( 2Δkx A )T .
P
W
B
228
(Refer Slide Time: 08:38)
So, we have full discretized form for each node now we are done all this without actually
substituting this number. In particular example problem that we taken k is defined a is also
known and Δ x depending on the mesh that you are considered and in this case we considered
five nodal points one metre is a distance. So, Δ x becomes 0.2 we can substitute those values
and evaluate the conscience. So,
this 100 which is
kA
is one such value happens to be 100, if you substitute
Δx
kA
in this discretized equation for all the nodes node 1 to 5 then
Δx
corresponding coefficients are evaluated and they are tabulated here.
Let us try to understand this table the first column is for node 2, 3 4 are internal nodes full
discretized equation is available, hence 2, 3, 4 can be evaluated, and you get this coefficient
values evaluated as shown here. And we also learn in the problem statement there is no
source term, hence the external source term are all zero here. Now, for the node one, the left
boundary is there, but there is no west node hence the coefficient a W is actually zero, whereas
east node is available and you are able to evaluate east coefficient for the node one. And
similarly for node five there is no east node the east surface is the boundary condition
location itself, hence aE is zero and aW you are able to evaluate the boundary conditions which
are enforced appears as a source term and they appear for the corresponding node 1 as shown
here and for node 5 as shown here. While writing the discretized equation you also observed
that point of interest coefficient that is aP is the summation of neighbouring nodes coefficient.
229
So, in this case a P=aW + aE and then source term of course, in this case source term is not
there it is zero and we get here this a W +a E is evaluated as shown here right. So, for example,
100 + 100 = 200 you are also able to cross check right now this − S P is 200 here and that is
added to 100 in 300 here.
(Refer Slide Time: 11:54)
So, if you write this each if you write this set of linear equation in the form of matrix then
you will get a matrix and you can get a structure like this. So, this is T 1, T2, T3, T4, T5 are the
values to be determined and this is what is known as a column vector of unknown value to be
determined. And to the left of it is a coefficient matrix, this corresponds to each row
corresponds to one particular variable in this column vector. And the right hand side there is
another column matrix and that is a known value. So, in this case for example, temperature at
A is coming from boundary condition, temperature at B is coming from boundary condition,
hence it is a known value.
If you look at this matrix structure, you observe along the diagonal, so the values are here for
example, 300, 200, 200, 200, 300. This is main diagonal then you have one diagonal
following the diagonal just above that is called super diagonal;, in this case it is -100, -100, 100, -100. Similarly, there is one diagonal immediately following the main diagonal just
below -100 and so on. So, you get a structure what is known as a tridiagonal matrix, so one
main diagonal, immediate super diagonal and immediate sub diagonal. We have already seen
different matrix structure in last week class penta diagonal penta, diagonal of two different
230
forms, tridiagonal and only diagonal matrix. There is a separate procedure available how to
invert this matrix, we will reserve the discussion for next week class. So, in this case, if you
happen to invert this matrix then you determine these values of T1 to T5.
Above tri diagonal system of equation is solved to find the values at nodal points and it so
happen values are determine, and it is given here T1 to T5 in this form. And for this simple
problem, analytical method of getting the solution is possible, and that is what is referred as
exact solution, because it is a simple problem without any source term, it happens to be linear
distribution as temperature is equal to 800 x+ 100, and this runs from left side to the right
side. You can substitute value of x depending on your computational node and get exact
solution at the computational node and compare with your computed CFD computed results,
it so happen in this case they are almost the same. So, numerical solution obtained is same as
exact solution. It is a very simple problem, hence it is not a surprise that the both match. Later
we will see there are situation were exact solution is not matched.
(Refer Slide Time: 15:09)
So, what we have done and the example problem is without source term. So, you can try this
problem with a source term in this case the figure is shown L x is length, and because it is 1D,
it is one it is in x direction. And there is a temperature distribution from one side to the other
side; k value is given, length is given. In addition there is a heat generation source term value
is given as 1500 kilowatt per metre cube. Then though it will shown as a 3D that is dimension
in y direction as well as in z direction. There are so large that temperature variation along y
231
direction and z direction can be neglected, hence the problem is 1D. Solve this problem by
diffusion method that procedure explain for a diffusion equation with the different mesh size.
The last problem we have explained only with five nodal points. So, in this case you can try
starting with five and again try with eight and twenty what is happening. And there is again
the analytical solution available for this problem and that is also given here and compare this
scene.
(Refer Slide Time: 16:38)
We have seen so far one dimensional diffusion equation and we got explanation with the help
of an example. in now extreme for two dimensional now in the case of two dimensional
governing equation becomes
∂
∂ϕ
∂
∂ϕ
Γ
+
Γ
+S=0 and the mesh are the finite
∂x
∂x ∂y
∂y
(
) (
)
volume is shown here .In the case of one d it was only east and west now we have north as
well as south.
So, let us look at this figure in detail. So, P is the point of interest or node of interest and you
concept the contra volume around the point of interest now in two dimensional you have a
Δ y as well as Δ x define in the size as control volume to the interest P on the right side, we
have the east node; and the left side we have a west node in addition you have one node on
the north and one node on the south. As we did in 1D you also have to define to control
forces. So, this face you already learned is marked as w with a letter small letter case and east
side is marked with a letter case e with small case in 2D you have two more face one on the
232
north and there is shown in small case letter n similarly on the south you have one more face
which is north the letter s small case letter s.
(Refer Slide Time: 18:41)
Now, that we have described control volume and terminologies for the two dimensional
situation let us now go to the procedure of getting the discretized equation for two
dimensional equation when you integrate the governing equation over the control volume and
that is what is shown here. Let us now do the first term that is derivative in the x direction for
the sake of simplicity you consider uniform grid Δ y =Δ x. So, the first term is
( Γ A ∂∂ ϕx ) − ( Γ A ∂∂ ϕx ) +( Γ A ∂∂ ϕy ) −( Γ A ∂∂ ϕy ) . Now when you compare what we did for the
e
w
n
s
one dimensional case we have now two additional term for the second direction plus source
term S̄ Δ V =0.
233
(Refer Slide Time: 20:01)
We rewrite that equation again here. Now you need to evaluate
similarly
∂ϕ
at east face west face;
∂x
∂ϕ
at north face and south face. For that sake we reproduce finite volume
∂y
terminology as shown here. Now we have already done evaluation of fluxes at east face and
west
Γe Ae
face
(
in
one
dimensional
and
that
is
what
is
shown
here.
So,
ϕE − ϕP
ϕ P −ϕ W
− Γ w Aw
. We have now two more terms corresponding to y direction
Δ x PE
Δ x PW
)
(
)
they are shown here that is Γ n An
(
ϕ N −ϕ P
ϕP − ϕS
− Γ s As
. and source term is evaluated as
Δ y PN
Δ y PS
)
(
we did in one-dimensional case that is Su + S P ϕ P=0.
234
)
(Refer Slide Time: 21:46)
The same discretized equation is shown once again here. Now we need to rearrange as we did
in one dimensional case the point of interest term that is ϕ P appears in all the terms. So, we
rearrange we collect coefficients multiply ϕ P. So, when we rearrange the above equation we
get final equation as shown here. So, this equation on the left hand side has coefficients
multiplying ϕ P equal to all other terms on the right side. If you look at this equation left hand
side is unknown right hand side is contribution from neighbouring nodes; in the case of twodimensional case neighbouring nodes are west node, east node, north node and south node.
(Refer Slide Time: 22:49)
235
Let us rearrange the coefficients as we did in one dimensional case in the form of the
standard expression that is aE, aW now we have aN and aS also included. So, you can
immediately recognize aE is
Γe
Γw
Γn
Γs
A ethen aW is
A w,
A nis for aN and
A is
Δ x PE
Δ x PW
Δ y PN
Δ y PS s
for aS. The node of interest coefficient a P has contribution from neighbouring nodes that is
why it is written here as a W +a E +a N + aS + source term. So, the final discretized equation
becomes a P ϕ P =a E ϕ E + aW ϕ W + aN ϕ N + aS ϕ S .
(Refer Slide Time: 24:00)
Now in 3D, it will have one more term added in the governing equation correspondent to
third direction that is z direction. So, the term new term is
∂
∂ϕ
Γ
and source term equal to
∂z
∂x
(
)
zero. So, in 1D, it just element; in 2D becomes a area; in 3D,it becomes a volume and that is
a sketch, and this is the control volume have to shown. For a simple case a cube and always
dash lines corresponds to that cube representation and the coordinative is also shown here x y
z.
So, in x direction, you have along the x direction east node capital E east node and west node
and this is the point of interest P now along the y direction we have the north and south node
similarly along z direction we have a top t and bottom b is surface and node capital T and
bottom node capital B. So, for all the surface the centre of the surface is actually marked here
and that actually correspond to particular surface for example, small case letter t is centre
236
point for this particular top face similarly the b is marked small case letter b marked as a
centre point for this particular bottom face and so on other surface. Once again this is for
simple situation, a cube is taken, hence it is very simple all sides are equal and centre is able
to fix imagine how will you do for un structure term mesh.
(Refer Slide Time: 26:13)
So, procedure is the same as we did for 1D and 2D as we did in the case of 1D as well as 2D
we identify control surface and all the derivatives require at control surface are evaluated
based on functional values at the respective nodes. So, you observe here two new terms one
corresponds to top, another one corresponds to bottom. And we observe here the derivative
(
ϕT − ϕP
∂ϕ
the distance between nodes P and nodes T and this will give
; similarly for
∂z
Δ z PT
)
bottom and source term is there. Again you identify that node P which is the point of interest
appearing in all the terms in all the terms. So, we collect all terms there ϕ P put them together,
and you get the coefficient for ϕ P this is the node of interest or in other words it is unknown.
So, we retain on the left side, all other terms are brought to the right side. So, we get ϕ W , ϕ E
as we had seen in 1D, additional term north and south as we seen in 2D. Now two additional
term ϕ T and ϕ B for 3D. Similar observation terms inside coefficient for node ϕ P are nothing
but term for neighbour node. So, for example, first term
237
Γe
A is for node at E and you can
Δ x PE e
observe the similar for other neighbouring nodes. So, this becomes the summation of
individual neighbouring node contribution plus the source term.
(Refer Slide Time: 28:30)
So, similar pattern, we will follow aE, aW, aN, aS, now aT and aB, these are coefficients rewritten
and aP is coefficient for P node. And as observed before it is summation of all neighbouring
nodes
coefficient.
So,
final
discretized
equation
becomes
a P ϕ P =a E ϕ E + aW ϕ W + aN ϕ N + aS ϕ S + aT ϕ T + aB ϕ B, source term is not there source term is
already included in ϕ B. Now you can imagine how it will be by writing code or solving the
3D problem you have so many coefficients to be evaluated, and we will see how to handle
with is in future class. With this, I will come to the end of this class.
Thank you.
238
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture – 03
(Refer Slide Time: 00:45)
Greetings and welcome you again to this course on CFD. Last two lectures, we had seen
finite volume strategy for diffusion equation. We did that in detail, we took an example
problem and illustrated with the example problem including in the implementation of
boundary conditions. And last class, we are also seen how to extend explanation that we did
for one-dimensional to two-dimensional as well as three-dimensional. Today’s class, we will
particularly focus on convection as well as diffusion term included in the equation.
239
(Refer Slide Time: 01:16)
Just for the sake of completeness, we will repeat again the terminologies used in finite
volume strategy. This is the mesh that we have define for one-dimensional; P is the node of
interest, east node and west node, east of east node is given by EE, and west of west node is
given by WW. Distance between the point of interest P and the respective nodes are given by
corresponding subscript in this case for example, distance between node P and node W,
because it is 1D, it is Δ x PW , so it is Δ x PW . Similarly, distance between node and the
corresponding face in this case for example, the face w on the left side is given by Δ x and
corresponding subscript P and small case letter w. You can follow for the other face as well
as for other node.
240
(Refer Slide Time: 02:23)
So, in the general Navier-Stokes equation, if you neglect time dependent terms, then you get
convection term on the left side, diffusion term on the right side plus any source term and that
is what is shown here. So, d i v ( ρ u ϕ )=d i v ( Γ grad ( ϕ ) ) + S ϕ. ϕ is the variable any property, Γ
is the diffusion coefficient and u is the velocity vector. if you do the control volume
integration for this equation, it will result in this form
∫ n⋅ ( ρ ϕ u ) dA , so this gives the flux –
A
convective flux equal to diffusion on the right hand side plus source term the second term on
the right hand side. So, the R.H.S accounts for net diffusive flux and the generation or
destruction of ϕ. The L.H.S accounts for net convective flux.
241
(Refer Slide Time: 03:33)
We should know how to convert the volume integral into surface integral. Main difference
between convection term and diffusion term, convection term influences only in the flow
direction, whereas, diffusion term influences in any direction where there is a gradient. And
this difference in the behavior needs special attention when you are evaluating variables at
faces and to be used in convection term differently from diffusion term. Let us take an
example situation, again we take one-dimensional situation. So steady one-dimensional
convection diffusion for the sake of simplicity again we do not have a source term. So, we
write down the equation as given here,
d
d
dϕ
( ρ u ϕ )=
Γ
, because it is one-dimensional
dx
dx
dx
(
)
we write in differential form. Again we reproduced terminologies and mesh arrangement.
So, considering the same discretization as in 1D diffusion equation, integrating this equation
over
the
control
(
( ρ u ϕ )e − ( ρu ϕ ) w = Γ A
volume
will
result
in
final
form
like
this
dϕ
dϕ
− ΓA
. If you observe here, the right side terms are already
dx e
dx w
) (
)
familiar to you, we did that in detail when we did 1D diffusion equation. So, these quantity
are to be evaluated at east face and west face. Here on the left side, we have a convection flux
that has variable to be evaluated at east face and west face, whereas, the right side, it has the
derivative of the variable to be evaluated at east face and west face. So, you understand we
have additional complexity when we deal with convection term. If this convection is written
242
for say ϕ as the variable, u as the variable for ϕ then it becomes ( ρ u ϕ ) and ( ρ u u ) evaluated at
east face and west face.
(Refer Slide Time: 06:19)
So, we define separately convective flux and use the symbol letter F subscript c for
convective flux equal to ρ u. And diffusive flux F d=
Γ
. using this symbol the discretized
Δx
equation is rewritten as ( F c A ϕ ) e − ( F c A ϕ ) wequal to similar rearrangement on right side for
diffusion term. we did in the diffusion equation central differencing type of approximation to
get Δ ϕ at faces, we follow the same here also. So employing central differencing scheme to
evaluate Δ ϕ at control volume faces for diffusive fluxes and for simplicity sake, we assume
area is the same, so Ae = A w = A , which means all the area terms from this equation will get
cancelled. So you get finally, expression as shown here, F ce ϕe − F cw ϕ wequal to we followed
central differencing type of approximation and we already defined F d as Δ x, so
corresponding Δ x term goes there, so we get final form as shown here.
243
(Refer Slide Time: 08:12)
We have additional term that is the variable ϕ itself at control volume faces. For a uniform
grid arrangement, again linear type of interpolation can be used. So, ϕ evaluated at the east
face, ϕ define at the east face is evaluated from ϕ at node of interest P and ϕ at E, so it just
the linear approximation or central type approximation; similarly for other quantity ϕ that is
required at the west face is related to ϕ variable available at node P and W. Upon substituting
this replacement in the discretized equation then we get finally, this equation as shown here.
So, ϕ is actually replaced correspondingly, so this is for ϕ E and this term is for ϕ W ; and on the
right side, we have already written for diffusion flux.
(Refer Slide Time: 09:26)
244
(
We will have to do some more arithmetic that is F dw −
F cw
F
+ F de + ce and all these are
2
2
)(
)
coefficients multiplying ϕ P. In the previous equation, we collect all coefficients that is
multiplying the variable ϕ P, we rearranged then we get this form. So, this is the node of
interest and that is unknown and that is retained on the left hand side. Then on the right hand
side, similarly for west as well as east variable, coefficients are respectively written. As we
said many times before, P is the node of interest, and in this case for 1D, the node of interest
will run from left to right.
We do one more rearrangement, we will understand why we are doing this rearrangement, so
this F d w is retained and we would like to have
Fc w
with the minus sign. So what we do we
2
add Fcw full term and then subtract. So, eventually this
added newly will result in
Fc w
positive and minus Fcw which is
2
− F cw
F
. Similarly, we have only c e and we add F ce newly and
2
2
subtract, so if you put this term that is
− F ce
F
. + F c e the original positive c e is maintained.
2
2
This is for some convenient sake, you will understand equated to terms on the right hand side.
if you observe terms on the right hand side, for example, coefficients for ϕ W , it has a term
Fdw +
Fcw
and you are able to observe, similar term appearing as one of the coefficient on the
2
left side, so this is F d w +
Fcw
that is one term on the left side, which is same as coefficient
2
term for ϕ W .
Similarly, the second term on the right side, which is written as coefficient for ϕ at east face
at east node F d e −
Fc e
, again you are able to observe this coefficient appears as one of the
2
term in the coefficient for ϕ P as shown here. And these are new terms we are added purposely
to get coefficient terms as shown here, and similar to coefficient term on the right side. Again
you recall, how we did for diffusion equation, in diffusion equation, we had finally, written a
form aP that is coefficient for node of interest P is the summation of coefficient from the
245
surrounding nodes and that is the format we are getting it here also that is why we have to do
this rearranging.
(Refer Slide Time: 13:06)
Rearranging the coefficients as we did in diffusion equation, so we have a E as defined
Fdw +
Fcw
; then aW written as shown here, so you are able to write coefficient for a P as sum of
2
coefficient for west node, east node and this subtraction. So in essence, you observe, if you
have a diffusion equation, and you have written a code for diffusion equation, now we want
to improve the code or argument the code to include the convection term then all that you
have to do is just add this extra terms for a P, extra terms for the respective neighboring nodes,
so in this case, aW and aE. So, this is how the code is developed from one module to the next
module.
As I mentioned before, node P runs from left to right, so if you run node P from left to right,
in this case it is 1D, so we say it is running from left to right; in the case of 2D, you will also
run from in the y-direction from the top to bottom; and 3D, respectively for the third
direction. If you do so, then you will get set of linear algebraic equations. Then you have to
have a procedure for inverting the matrix. For the example illustration that we have taken, we
have considered without the source term, and it is possible to include source term and the
source term will go as a known term and it will go to the right side of the equation. And near
the boundaries, so in this case, for example, 1D case, left boundary node near the left
246
boundary, there is no west node, hence coefficient a W goes to zero. Similarly, node near the
right boundary, there is no east node, hence coefficient aE goes to 0. This is something that
we had seen in the diffusion equation and they do not change when you include convection
term also. So, the boundary conditions are reflected in the source term appropriately, this
again we had seen in the illustration that we used to explain diffusion equation. The
temperature term, which is enforce as a boundary condition appears on the right side of the
equation.
(Refer Slide Time: 16:03)
We explain all these for a uniform spacing. Variable ϕ appears in the convective flux and the
derivative of the variable appears in the diffusive flux. So, we need to evaluate variable as
well as derivative at face. And we have demonstrated with the help of a uniform mesh. In the
case of non-equal spacing, we also have to know how to do for non-equal spacing, because in
a practical situation, you do not have a luxury of having a uniform spacing mesh throughout
your domain. So, for non-uniform spacing, so this is terminology or mesh arrangement that
we use for uniform mesh. And we have ϕ evaluated using central approximation or linear
type of approximation. For non-uniform grids, we have to have a appropriate weightage
procedure, you account for contribution from respective nodes. So what is shown here, it is
illustration, we have one control volume as shown with a node marked as one then another
control volume with a node marked as two. Then we have also point of interest P, and the
control volume for P will run from one to two budding one to two. In such case, suppose you
want to find for P, say variable at P, then you can have weighted average procedure as shown
247
here; ϕ at P is evaluated based on area multiplying a variable at other node, similarly area of
the second control volume multiplying variable at that another control volume and
summation of area.
(Refer Slide Time: 18:10)
So, we have been talking about convective flux and variable ϕ present in the convective flux
and how to get variable evaluated at that face. this convective terms are non-linear in nature,
and it also multiplies its derivative. They are mostly influenced by direction of flow. So, we
have to have the correct evaluation of the variable and its derivative at that face, which is
very important as it affects accuracy and solution procedure. They should; obviously,
represent the correct flow physics and it decides accuracy as well as stability, and we will
observe with an example graph later, how it affects accuracy. We are going to discuss five
approximation schemes in detail. They are central approximation, pure upwind
approximation, hybrid scheme, power law scheme and QUICK approximation.
248
(Refer Slide Time: 19:31)
First, we will take central scheme, we have already seen the central scheme. The central
scheme as we noticed earlier it takes equal weightage from the neighboring nodes, because of
its nature, it is unable to identify the direction of the flow. So, for example, in this illustration
that is shown here, the flow is from left to right as marked here, we know the variable value
at west node, and node of interest P then the CD scheme assumes equal influencing from
either side that mean ϕ at this face w takes the value of ϕ at P and
ϕW
that is for the uniform
2
spacing. Suppose it is non-uniform spacing you take into account the weightage. Similarly,
for another situation, if the flow happens to be from right to left, then ϕ e is evaluated based on
ϕ at east node and ϕ at P node. why do we have this flow direction changing that may be a
curious question.
249
(Refer Slide Time: 20:58)
We will reproduce this slide that we had seen in week one lecture, this is the test case
problem flow through a backward facing step. And in this case, the inflow is here and it is a
fully developed parabolic velocity profile, and the top side is channel wall and bottom side
there is step and then there is a channel wall. As you have explained before at the corner, at
this tip of the corner flow separates and then it comes and reattaches on the bottom wall at
some distance, where it attaches it depends on the flow condition, Reynolds number and so
on. the question that is important is what is happening to this region, this is a recirculation
zone, and there is a eddy and flow re circulating in this region that mean if you define x and y
coordinates orientation to be as shown here then you can observe with respect to the
coordinate definition that you have chosen. For some parts, u velocity is positive; and for
some part, u velocity is negative. So, this is the main reason, why you have to have a scheme
which takes into account the convection of the flow also.
There is a another situation for the same problem, depending on the Reynolds number and
depending on the flow condition for the same geometry, you may have a situation where
there is secondary bubble formation on the top wall. Here also you can observe for some part
of the location, it is u that is positive that is going from left to right and for the some part of
the location u is negative that is going from right to left. And this u positive or u negative
depends on your coordinate definition. So for the coordinate definition that you have chosen I
have explained u positive and u negative. Of course, there is a difficulty near this boundary,
where it switches immediately between positive to negative. So, such difficulty or such
250
change of flow direction is very common in practical engineering problem, hence we have to
look in detail how to deal that situation. By conclude today’s class here, and we will look into
details about different methods of interpolation in the next class.
Thank you.
251
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture – 19
(Refer Slide Time: 00:20)
Greetings and welcome again to this course. Last class, we had particularly seen finite
volume strategy for convection and diffusion term put together. And we mentioned the need
for knowing different types of interpolation required for convection term and evaluating flux
at control volume faces. We also looked at in detail about CD approximation, and we took an
example problem of flow through a backward facing step, we understand in the same flow
even in the same geometry, we have a different flow region flow going in the reverse
direction. Hence, there is a need towards to take the flow physics represented appropriately in
the evaluation of flux at control volume faces.
252
(Refer Slide Time: 01:19)
For sake of continuity, again we reproduce control volume finite volume mesh and
terminologies used. The last class, we had this discretized equation including convection
term. So, convection term is on the left side, and diffusion term on the right side, we noticed
the convection term to be evaluated at face e and w; similarly diffusion flux to be evaluated at
face e and w, and this is for 1D situation. So, correct evaluation of variable and its derivatives
at the face is important. As I explained the help of illustration that should correctly represent
the flow physics and it also affects the accuracy as well as to some extend stability. We are
going to discuss five different approximation method to get flux or functional value at the
face; they are central approximation, pure upwind approximation, hybrid scheme, power law
scheme and QUICK approximation.
253
(Refer Slide Time: 02:37)
We have already seen central approximation and we noticed that central approximation does
not recognize the direction of the flow. It takes equal weightage from the neighbouring nodes.
For example, in this case if the flow is from left to right, and to evaluate variable at the face
west then the neighbouring nodes are P and W, it takes equal weightage from both these two
nodes. Similarly for other situation, if the flow is from right to left, then it take
correspondingly neighbouring nodes and then gives equal weightage that is for the uniform
mesh; then if it is non uniform mesh you take appropriate weightage, it does not factor the
flow direction
(Refer Slide Time: 03:34)
254
In the case of next scheme that is pure upwind then ϕ value at faces are determined based on
the direction nature of the convection velocity u. If you can recall illustration I explained in
the last class backward facing step spectrally mentioning about coordinate definition. So,
with respect to the coordinate definition then convection velocity direction also is decided.
This scheme which decided based on direction of the convection velocity u is what is known
as pure upwinding. Here the nodal value information, upstream of the point of node of
interest is considered to define value at the face. For example, we will take the same
illustration that we have just shown for central differences scheme. The flow is from left to
right and to evaluate variable at this face w, it is given same value as variable at the upstream
of the face. So, in this case upstream of this face node is at capital W that is this node. So,
variable available at this node is given and variable at this face is same as variable at this
node. So, in this case, ϕ at w equal to ϕ at node W; similarly for east face, upstream of this
east face is node P for the direction that you have shown that is left to right, so ϕ at e is same
as ϕ at P. Now you can see very clearly the difference between central approximation and
pure upwinding.
Let us take another case that is flow is from right to left as shown here. So, ϕ at east is same
as ϕ at east node, because for this face for the direction of the flow that is shown the upstream
node is E. Similarly if you to come to the other side for this face, upstream node is interest
node P itself for the direction of the flow that we have shown that is why ϕ at west face is
same as ϕ at node. So, you can see the difference between central type of approximation and
pure upwinding, it is called pure upwinding, later we are going to see some kind of weighted
average between pure upwinding and upstream biased upwinding.
255
(Refer Slide Time: 06:54)
Now as we did before convective flux is defined as ρ u with the symbol Fc now we have this
switching if the flow is from left to right then we take the upstream node if the flow is from
right to left you take corresponding upstream node. In a problem you have some regions
where the flow is from left to right in some other region you have flow right to left using the
same code we should have the provision check the convection velocity direction and switch
corresponding upstream side and that is explain in this slide for example, it is effected in the
coefficient in the neighbouring nodes.
So, it is aE and aW are the two neighbouring nodes for the node of interest P. If the flow is
from left to right that is the convectional velocity is positive for the definition of coordinate
that you have chosen then u is positive, so Fc is also positive. So, we write Fcw is greater than
zero and Fce greater than 0, then you have coefficient defined accordingly for the east face
and east node and for west node, if the flow is from right to left then for the coordinate
definition that you have chosen it becomes negative then corresponding F c goes to negative
that is why we have condition if Fcw less than zero and Fce less than zero then we rewrite the
coefficient accordingly. So, this switching depending on the direction of the velocity you can
actually incorporate the code also you can also have a check condition and then you can
switch between one scheme to another scheme are upstream node accordingly.
So, in more general form, so to put this two things together because in a code you will have
only a continuous line are one line representing all the situation we write a E as
256
F dw + max ( F cw , 0 ). So, this will take maximum of this two values zero is a limit and if it is
positive for the flow from left to right Fcw is positive. So, that will be taken and it added to the
Fdw and you get back the original coefficient expression. To get other condition then we again
write here if the flow is from right to left then Fce will be negative and
positive and greater than one. So, you have again condition
−F ce
max( 0,−F ce )
will be
and the
diffusion coefficient contribution. So, this condition that is defining max of zero and other
value minus Fce or Fcw will automatically switch inside the code you do not have to do
anything manually externally.
(Refer Slide Time: 10:35)
So, next we will see central differences scheme is second order accurate, but it does not
reflect the convection whereas upwind scheme pure upwind scheme that we have just now
seen the first order accurate as we have seen it only takes the nodal value upstream of the face
for the corresponding are the respective direction of the flow where as it does reflects the
convection of the flow. Now the obvious question either we can take or use utilize advantages
of both and put it to one particular scheme. So, for both accuracy can be improved either by
considering more or finer mesh points that is what we have shown is kind of second order
approximation for central scheme that is you take one node on the left one node on the right
and take a average you can actually extend it by taking extra node on either side. So, it can be
two nodes on one side and two nodes on the other side take a average accordingly. So, that
becomes next order of accuracy in central differences scheme similarly for pure upwinding
257
instead of taking just one node immediately upstream of the face you can actually take one
more node.
So, in this case for example, for the face at w, we considered node value at W in addition you
can consider node available at WW. So, we can increase order of accuracy by considering
more number of points; however, still the property remains the same that is they reflect
convection other one does not reflect the convection, but order is always higher. So, I just
give a illustrations just illustration for a particular problem and what is shown here is exact
solution that is by one particular what is shown here as a exact solution vertically if you use
pure upwinding with a mesh size 50 ×50 then you get a solution as shown by blue colour if
you have used lesser mesh size for the same pure upwinding 10 ×10 size then the black
colour line that shown here is a result if you made the mesh much finer.
So, in this case it is by 100 ×100 then you get a solution as shown by this colour whatever it
is the pure upwinding, it smise the solution. Hence you will never get to reach the exact
solution in spite of the fact that you increase the mesh size twice from 50 ×50 to 100 ×100
you still have some diffusion here exact solution is not obtained were as the central scheme
will try to capture this P. Hence there is the thought process whether you can combine
advantage of both schemes.
(Refer Slide Time: 14:13)
Alternatively, one can switch between two schemes that is central or pure upwinding either
based on some weightage. So, you decide if the flow is less than you can switch or if the flow
258
is normal then you can go to central differences scheme or you can take weigh you can
calculate first by central differences scheme second by pure upwinding and consider equal
weightage both and then combine them. So, this is what is known as a hybrid scheme
combining both the methods calculate the flux by both central differences scheme and
upwind method either you can give a equal weightage to both or you can decide the
weightage according to the problem any one of the method falls under the category what is
known as a hybrid scheme.
(Refer Slide Time: 15:14)
Now how to switch between the two. We have a number called Peclet number which is the
ratio of convictive flux to the diffused flux where is given by the letter symbol Pe, it is equal
to
Fc
. Pe is evaluated for each cell face and then it decides whether one has to switch
Fd
between central differences scheme pure upwinding or the hybrid type depending on a
condition that is using for a evaluation. So, for example, if Pe is less than or equal to two
which means it is Fc and Fd ratio. So, you can think of Pe is less than two then it is a central
approximation that is used if Peis greater than 2, which mean the numerator is very high and
denominator is very less; both these possibilities are there that mean convection is
dominating hence you can switch to pure upwinding. So, this condition also you can enforce
or you can incorporate your own code decide based on Peclet number and define the Peclet
number has ratio of convective flux with a diffusion flux.
259
(Refer Slide Time: 16:46)
There is one more special type of treatment what is known as a power law scheme and here
we have switching between two scheme The two schemes are slightly different the one
scheme is a hybrid of CD, pure upwinding the other scheme is pure upwinding itself. So, we
will have an option you consider mix of hybrid done mix of CD and pure upwinding has one
option or its only pure upwinding. So, this is what is known as a power law scheme and in
this scheme diffusion is set to zero. if the absolute value of Peclet number exceedes 10. So, in
the previous slide we put a condition Pe greater than two then it becomes pure upwinding.
Now this is condition above that condition. So, if absolute of Pe that mean you take only the
magnitude exceedes 10 then it is purely convection problem diffusion has no role hence the
diffusion is set to zero And we have only pure upwinding scheme applied.
So, mathematically you can have the expression Pe within the limit from 0 to 10, the flux is
evaluated by polynomial expression as given here. For example, flux crossing the east face is
given by a e =F ce and the coefficient ϕ E − β e ( ϕ E − ϕ P ) and this is for condition Pe between zero
to ten where this β is a coefficient which is actually the speciality of this scheme what is
known as a power loss scheme there you write
β
is given as 1 −0.1 Pe. Again we are
evaluating p at every face. So, here p is evaluated for east face because we are just explaining
5
for east face. So, ( 1 −0.1 Pe )e /Pe e just observe that if you substitute the limiting condition
that Pe=10 then 1 −0.1 ×10 it becomes 0 almost so that is actually what is used here right it
becomes purely upwinding right.
260
So, this part β e is 0 and Fce is purely ϕ at e that is the pure upwinding that is what shown here
for value definitely greater than 10 then ae is F ce ϕ from the node E if the value of P is less
than ten then you have a some fraction value here β and that goes into this value β has some
fraction value. For example, you say 0.9 then this is pure upwinding ϕ e is pure upwinding
first term the second term is kind of some central differencing. So, this has a combination of
pure upwinding and central differences type of evaluation. So, that is why I said it is a
combination hybrid between two schemes that is hybrid of CD and pure upwinding and pure
upwinding.
(Refer Slide Time: 20:38)
Next stream we are going to see is quadratic upwind scheme and in short form it is called
QUICK. So, what it does it takes three point upstream of the node and give a weightage to the
contribution from each node. So, it is use as three point upstream weighted quadratic
interpolation for cell face values now why we taught as come we noticed from the previous
lecture central difference type of approximation takes values from neighbouring nodes and
give a equal weightage where the pure upwinding takes the values from the upstream node
now if you fit quadratic among the three nodes then it is a kind of bias based on the direction
of the flow.
Let us see how to do with little more detail a quadratic curve is fit through three nodes and
how these three nodes are chosen is important one on each side of the interest. So, in this for
example, in the case of west face for the flow going from left to right one on each side is
261
node P and node W and one more node in the direction of the flow. So, if the flow is from left
to right again west of west that is WW is additional node will explain this again this falls
under the category what is known as a upwind biased scheme. So, we have a central
differences scheme we have a pure upwinding scheme we have a hybrid scheme we have a
power loss scheme now we have a upwind biased scheme. So, the scheme is the kind of
central, but it is not pure upwinding it is the mix of both, so it is upwind biased scheme.
Let us look at this illustration for example, ϕ at w at this face then we have a node P
immediate node on the right and node W on the left. So, these two are on either side for this
particular face then the flow is from left to right. So, u w subscript w is a convectional velocity
it is positive. So, for this convectional velocity condition the upstream condition is node WW.
So, we consider node WW, W and node P and we try to fit a quadratic curve to this three
nodes with some weightage. So, that is what is shown this expression here. So, ϕ at west face
is α 1 ϕW + α 2 ϕ P + α 3 ϕ WW , if the flow is from left to right that is uw is greater than zero.
Now, let us take the next case when the flow is from left to right and on the east face if u e is
greater than zero then the flow is from left to right ϕ e is evaluated for ϕ e two adjacent nodes
are east node and P node and one more upstream node in the direction of the flow. So, here
the flow is from left to right for that case one more node in the upstream is actually W. So,
the expression for ϕ e =α 4 ϕ P +α 5 ϕ E +α 6 ϕ W . Now coefficients α 1 to α 6 are to be evaluated.
So, in today’s class we have seen different kinds of interpolation, mathematical expression
how to implement them in details behind each of this scheme. You get a complete feeling of
the effect of central differences scheme, pure upwinding, upwind biased, hybrid scheme.
Now it is possible to implement all this schemes in one particular code, all that you have to
do is switching based on condition. Most of this commercial software has a similar provision
depending on the choice that you select in the option then it for the same convection term
calculation is switch the scheme. We come to end of this class; in the next class, we will
explain all these schemes with a help of illustration.
Thank you.
262
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture – 20
(Refer Slide Time: 00:27)
Greetings and welcome again to this course on CFD. Today is the last class for this week.
Last class, we had seen detail about interpolation, different types of interpolation particularly
central difference type of approximation, pure upwinding power law scheme hybrids scheme
and so on. In today’s class, we will focus mainly on scheme called QUICK and we will see
merits and demerits of this particular QUICK scheme.
263
(Refer Slide Time: 01:04)
QUICK otherwise called quadratic upwind interpolation scheme. It uses three point upstream
weighted interpolation. A quadratic fit is made through three nodes. And what are the three
nodes, one node on each side for particular face, and one extra node in the direction of the
flow, because one node extra is taken in the direction of the flow, this also can be classified
under the category what is known as upwind biased scheme. Let us take this illustration. In
this illustration, P is the node of interest and you construct control volume around that node
and respective node on the left side and right side are also marked. So, in this case, capital
letter E and capital letter W, then one node more is marked which is west of west that is
shown here WW. And for this illustration, the flow is consider form left to right as shown
here and you are interested to find out value of the variable on this face west face which is
marked here as uw, and you decide have a coordinates definition as shown here X and Y.
So, with respect to the coordinate definition, the flow is left to right and it is positive. Then ϕ
variable value at that face is related to α 1 ϕW + α 2 ϕ P , one more node in the direction flow that
is WW, which is gives here as α 3 ϕ WW . So, you can observe this is the face you are interested
to find out you have one node either sides and one extra node in the direction of flow.
Now, let us take the next case when the flow is from right to left as shown here. With respect
to the coordinate definition that you have using, the flow direction is negative. Now you want
to find out for this case variable on the face e, such case the expression as shown here ϕ e that
is on this face you have two neighbouring nodes one at E another one at P; one more node
264
upstream in the direction of the flow that is EE. So using this three nodal information, you
can evaluate variable value on this face u e the corresponding expression shown here,
ϕ e =α 4 ϕ P +α 5 ϕ E +α 6 ϕ EE ; coefficient α 1 to α 6 are to be evaluated.
(Refer Slide Time: 04:43)
Let us also have another description; so here is the example. So, in this figure, again P is node
of interest, control volume is constructed around the node of interest, and the coordinate
definition is also given as X Y as shown here. If you are interested to find out u on this face
that is west face which is shown here red colour then it is evaluated based on ϕ at W; in
another words uW that is the node then another node here which these two nodes are nodes on
either side then one more extra node in the direction of the flow which happens to be in this
case node at E. So, we have to consider u value at E node, u value at P node and u value at W
node, then you construct the quadratic fit then evaluate coefficients based on that you will get
variable value on this face.
Similarly another situation for value on this face that is e, you have node E capital letter E
that is on the right side of the face, and node P which is on the left side of the face. So, these
are nodes available on either side for this face E, and one more extra node which is in the
direction of the flow that is EE marked that is node marked by letter EE. So, if you look at the
quadratic fit that is marked in this colour, which is running through these nodes ϕ EE, ϕ E , and
ϕ P . Now let us look at these details with some more information.
265
(Refer Slide Time: 06:47)
So, we have to know how to do in the case of near boundary, near boundary you have a node
which is marked here P then this example right side right boundary there is value given by
the boundary condition that is marked here as ϕ RB, ϕ P. So, behind this t construct another
node which is known as mirror node and that mirror node for convenient it is taken as the
same distance as the distance between P node and the boundary. So, this node that is the
mirror node which is kept at distance same distance as distance between node P and right
boundary. Now we need to evaluate or get idea of value of the variable at this mirror node,
because we are consider the distance same as between P node and right boundary we use
linear approximation hence it is written here ϕ E mirror =2 ϕ RB − ϕ P.
266
(Refer Slide Time: 08:12)
To evaluate the value of ϕ at CV faces, we employ QUICK scheme, and for the nodes i, i-1
and i-2, where i is in the direction of flow, and it is immediate downstream node with respect
to the face. So, this particular formula is the generalized formula whether the flow is from left
to right or right to left of wherever you want to find, so that is what is given here ϕ at any
face. And for uniform spacing on in one-dimensional the formula is already evaluated and it
is shown here as
3
1
6
ϕ + ϕ − ϕ . So, in this, what is i, i is in the direction of the flow and
8 i − 1 8 i 8 i −2
it is immediate downstream node with respect to face your interested then you have i-1 and i2.
Let us see how to actually get idea of this by taking example. So, if u W that is your interest
variable value on the west face if it is happens to greater than 0, that mean if it positive then
ϕ w that is the interest 6/8 and i given here as the node in the direction of the flow immediate
downstream. So, for the west face is immediate downstream is the node of interest ϕ P. ϕ i −1 is
on the left side and i-2 is to left of W node which is ϕ WW . So, this formula, which is derive for
uniform equal facing is the generalized formula, and you can apply this for any side for any
direction if ue is greater than 0, which is the another example. Then you can understand how
to use again for ue greater than 0, which is flow left to right case i is immediate downstream
node is ϕ E then i-1 is on the left which is ϕ P and i-2 which is left of P node that is ϕ W .
267
(Refer Slide Time: 10:49)
So, we already learn from diffusion equation we apply central type of difference to evaluate
derivative on the faces and for simplicity face we assume it one dimensional with equal area.
So, Ae = A w = A . So, we put convection term also then we get final discretized form as shown
here. So, this F is the flux and subscript c stands for convection and e is stands for at the face
e. So, F ce ϕe − F cw ϕ w =F de ( ϕ E − ϕ P ) − F dw ( ϕ P − ϕW ) in this right side term is actually diffusion
term, and we have learn before the new is convection term we have learned that also how to
evaluate variable value on each face.
So, if you apply now QUICK type of approximation to get this variable value on faces you
get this substituted you have just now seen. So, we can substituted for ϕ E and ϕ W by quick
approximation to get this expression; once again in this expression, we look at ϕ P is the node
of interest and that term appears in the all terms here. As did before we collect all these
coefficients multiplying ϕ P and that is node of interest are unknown put them on the left side
all other quantities supposed to be known and take them to the right side once you do that
kind of rearrangement you get final equation as shown here. So, you can actually verify
whether they are done correctly. So, this term on the left side is the coefficient term for node
of interest and the right side there are suppose to be known either form previous situation are
as part of the current solution. So, this node of interest P it runs for this case of 1D from left
to right now when you do that you get system of linear equation than its setup a matrices
inverse you get solution.
268
(Refer Slide Time: 13:46)
So, as we did in the case of diffusion equation, this equation is also now written in the
standard form as shown here a P ϕ P =aW ϕW + a E ϕ E + aWW ϕ WW . If you able to recall compare this
expression, with the expression we obtain central differences scheme or pure upwind, and we
can tabulate as we did in the case of diffusion equation. So, aW, aE, aWW and aP, these are terms
in the equation and write corresponding coefficients and you can again observe that
coefficient for aW coefficient for aE, they appear as term in coefficient for a P. Hence, we
replace them with the corresponding coefficient aW, aE, in addition for this QUICK
formulation, we get similar expression so that is aWW, and these are the additional terms. So, it
is necessary only to calculate coefficients a W, aE and aWW, and they go into the expression of
aP also. Hence only the new term that we have to calculate in F ce and Fcw to get coefficient
value for aP.
269
(Refer Slide Time: 15:27)
Now, all that we have done is for one side, we will try to extend for other side the generic
expression for quadratic fit is shown. Now u w less than zero the previous case u w was greater
than zero ue was greater than 0. So, we fallow now for u w less than zero and u e less than zero;
that means, the flow is right to left, negative. So, again try to identify for any particular face
of interest i is in the direction of the flow in this case from right to left. And you are trying to
find out for west face in the direction of the flow west face immediate downstream node is
actually W node that what shown here then i-1 that is to the right of W node is P and i-2 that
is right of P is E node. So, corresponding coefficient values used. All that you do identifying
what is i for any particular face, and for the corresponding velocity condition. Second case u e
less than 0, again the flow is right to left negative velocity for the face e, i node which is
immediate downstream node in the direction of the flow is P node and i-1 is the E node and i2 is EE node we have to remember always the one dimensional terminologies then you can
immediately identify what is i, i-1 and i-2.
270
(Refer Slide Time: 17:21)
So, we follow the same sequence employing the central difference type of approximation for
derivative which is used diffusive term and employing QUICK type of approximation for the
evaluation of the variables at the faces then we get discretized form of the equation as shown
here. All that we have done in this case, we substituting corresponding QUICK formulation
for convection which is on the left side and right side diffusion. And we already know it.
again we can rearrange that is ϕ at P appear in all that term and you collect all those
coefficients and arrange them together in the standard form and that is now written here as
a P ϕ P =aW ϕW + a E ϕ E + aEE ϕ EE. So, this is for the case when the flow is right to left, and we
have already seen separately for the flow left to right. Now, we get the generic expression
because you have situation of flow coming to left to right or right to left we have no idea
prior. So, we have to get generic expression. So, you have to combine both of them together
and that what are going to see in the next slide, we obtain the expression separately for each
condition, we can get generic expression combine in both in condition.
271
(Refer Slide Time: 18:53)
And that is shown here that is a P ϕ P that the node interest and a W ϕW , a E ϕ E in central
approximation or pure upwind approximation we had expression up to here now when you
apply QUICK scheme you get to additional term ϕ EE and ϕ WW now correspondingly aP is
related to neighbouring node coefficient as shown here. So, a P is a W +a E then you also have
a EE and a WW . So, this are depending on the direction of the flow + F ce − F cw , we can also put
them together in generic form in this way as shown here. So, a W coefficient is written in
detail a WW coefficient written in detail and a E and a EE .
Now in this expression, if you look at carefully β is one new variable introduce because we
have flow coming from left to right as one case and flow coming from right to left as another
case. So, when you are actually writing a program your incorporate in QUICK scheme inside
your code, code should automatically detect in the direction of the flow and switch
accordingly even it is a QUICK scheme switch between the node according to the direction
of the flow and to enable that you have introduces new coefficient what is written here as β.
So, β is the coefficient that decide the direction of the flow accordingly the switching
between this side left side or right side will be taken β is define if β=1 then F cw >0 which
means flow is from left to right and β e =1then F ce > 0 . Please remember F stands for flux and
c stands for convective flux. So, e stands for east face. So, F ce means it is directly related to
velocity which is velocity condition on the east face when you say β e =1 which means the
flow is greater than zero which is positive, hence it is from left to right. Another situation if
272
β w =0 and β e =0 correspondingly flux at west face and flux at east face or less than zero
which means the flow from right to left so depending on the beta condition.
So, in your actual code you find out the direction of the velocity evaluate F cw if F cw >0 is
switch to one condition if F cw <0 you switch to another condition that is done in code and
correspondingly it is written for coefficients. For example, if you say β w =1 if you substitute
in this expression for aW in the particular term vanishes you can also check similarly for other
term when you write a code the switching according to the direction of the flow is done
automatically.
(Refer Slide Time: 22:44)
Now, though QUICK scheme appears good in terms of the direction of the flow and accuracy
combining the merits of central differences scheme as well as upwind different scheme. Now
let us look at specifically merits and demerits of QUICK scheme, it is upwind biased or
upwind weighted scheme. We have already seen there are two nodes one either side and one
extra node in the direction of the flow that is way it is called upwind biased scheme because it
is in the direction of the flow biased it is also possessing what is known as transportive
property and we have done quadratic fit. So, it is becomes third order accurate again
remember pure upwind is the first order accurate, central differences scheme is second order
accurate quadratic scheme is the third order accurate. So, by taking one exact node you are
able to improve the order of accuracy to next level and numerical are false diffusion is also
called numerical viscosity is reduces very small and it has an accuracy greater than central
273
differences scheme, pure up winding even hybrid scheme for the same mesh size. Though
these merits are there, it also have the demerits some time negative coefficient may happen
and that may lead to what is known as ill positioned matrix because we are look only
matrices at the end of the day, if the matrix is not properly form then you will not able to
invert the matrix and that may result in what is known as the stability problem.
So, in the case of QUICK scheme, sometime you may have a situation of ill positioned
matrix, and which may lead to what is known as stability problem. The one more important
property is tridiagonal structure, we are going to see in detail what is tri diagonal matrix, and
how do invert tridiagonal matrix in the case of central difference scheme had tridiagonal
structure of matrices that is you have one main diagonal immediately super and immediately
sub diagonal. Then there is separate procedure available to invert that type of matrices in this
QUICK scheme because you consider one exact node that tridiagonality of the structure is
disturbed and you have a separate procedure to invert that matrices one more demerits it can
give rise to sometime over shoots or undershoots. Let us get idea of what is overshoots and
undershoots with the help of the illustration.
(Refer Slide Time: 25:39)
What is shown here is one solution final obtain and you see here this is a black line which
correspond to solution obtain by analytical procedure or exact solution if you use pure up
wind mesh size 50 ×50 and get solution as shown in blue colour and for the same mesh size if
you use QUICK scheme then you get the solution as marked in red colour and you can
274
observe between the two the QUICK solution reaches the exact solution near for the same
mesh size it is also exhibits some overshoots and some undershoots because it is going below
zero which is the kind of unrealistic. For pure scheme it is not capturing exact distribution,
but there is a diffusion there is no overshoot or undershoot this is the property of what is
known as the numerical viscosity.
So, the numerical viscosity or false diffusion ensures smooth solution but it does not capture
accurately P or the maximum value. Whereas the QUICK procedure for the same mesh value
gets the solution very near to the actual solution; at the same time it results what is known as
overshoot and as well as undershoots. In today’s class, we have seen in detail about QUICK
formulation and I mention in detail for two situation when the flow is left to right when the
flow right left how to evaluate the variable value on east face and west face accordingly from
a generic quadratic interpolation formula. Then we put them together, we get a generic
expression and that had one extra coefficient by name β automatically ensure accordingly the
direction of the flow the switching term in coefficients. With this we come to end of
description about all type approximation; in next class, we will be see illustration with an
example.
Thank you.
275
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture – 21
(Refer Slide Time: 00:21)
Greetings and welcome again to this course. Last two classes, we had seen in details
about different types of interpolation to obtain variable value on face. Why do you want
to do that, because in convection term, we have the variable value appearing, and they
are to be evaluated on control surfaces. Accuracy of this scheme depends on what types
of approximation you are using. And we had seen five approximation procedure – central
differencing type approximation, pure upwinding, hybrid scheme, power law scheme and
Quick scheme. We had seen all these different approximation in detail, mathematical
formulation for different situation, and how to put along with diffusion equation
discretization, a generic formula finite volume difference formula, and how these
coefficients are related to each other. So, node of interest coefficient is related to
neighboring nodes.
And in the case of pure upwinding, we had a term called
α , which decides the direction
of the flow, according to the direction of the flow the switching happens. Similarly, in
the case of QUICK scheme, we had a factor by name β , which again depending on the
direction of the flow, it takes appropriate weightage or the correct
276
direction and switches. In today’s class and followed by next class, we will see with an
example how each of this scheme behave for different mesh size for the same problem
get a field for performance of each of these scheme.
(Refer Slide Time: 02:23)
Just to recapitulate here is a illustration for QUICK scheme and we already learned in
QUICK scheme, we have quadratic fit through three points, two points are on either side
of the node of interest and one additional point in the direction of the flow.
(Refer Slide Time: 02:45)
277
We had seen so far mainly three approximations, central differencing type, pure
upwinding and QUICK scheme. In this particular slide, we will see all of them together
get idea of how this coefficients are different for each scheme. For both CD type as well
as pure upwinding scheme, finite volume discretized equation is written as shown
a P ϕ P= aW ϕ W +a E ϕ E . As we said many times before, P is the node of interest, and it
runs from for the case of one-D, left to right; and aW and a E are neighboring nodes
coefficients, so node of interest coefficients a P is related to neighboring node
coefficient. In the case of CD, expression for coefficient, for a E , aW , a P are shown,
similarly for pure upwinding coefficients for aW , a E as well as a P are shown here.
You can understand now very well, the difference in the term if it is central type and if it
is pure upwinding. In the case of pure upwinding, we introduce a term called max of
F cw and zero, so it takes between the two whichever the maximum, which is actually
introduced for the purpose of direction of the flow. So, if the direction of the flow is from
left to right, then it is positive F cw will be used in this expression. Similarly, if the
direction is negative, then F cw will be negative, zero is the maximum then accordingly
zero that contribution that node will not be consider. This way of writing is helpful when
you are writing the code, it automatically switch between one side to other side based on
this control.
Next we will see QUICK; in the case of QUICK then we get expression
a P ϕ P= aW ϕ W +a E ϕ E +a EE ϕ EE +a WW ϕWW . We can immediately observe, the QUICK
scheme has two additional terms. Once again this is the generic expression, generic in
the sense, it accounts for any type of flow direction. So, when you compare CD or pure
upwinding, QUICK scheme has two additional information from QUICK scheme has
information from one additional node and that one additional node depends on the
direction and that is put in the generic expression as shown here. And a P as we did in
other two scheme once again relating to neighboring nodes, so a E , aW and a EE as well
as aWW and additional term.
Correspondingly, you can write down coefficient, so aW , aWW ,a E and a EE . We have
introduced new coefficient β , again that is decided based on the direction of the flow. If
278
β =1
, then the flow is from left to right, it is positive. If the β ≤ 0 , the flow is from
right to left then accordingly corresponding
279
weightage taken to determine the coefficient values. So, for example, if β =1 the term
in aW , this particular term is zero, there is no contribution from west node flux
contribution from the west face then that is used here. Similarly, you can try to
understand based on different values of β coefficient expression, and it is the generic
expression, so this helps in writing one code with different switching control option.
Now, we can also get a curious question where you can have code written employing for
example, all the three schemes that is CD, pure winding and QUICK the answer is yes,
because coefficients terms have same structure. As you can observe here, for example,
aW has a similar structure only additional terms are introduced. So, you can calculate
for CD and switch to pure upwind or switch to QUICK depending on the scheme that
you are deciding that automatically is decided based on the direction of the flow.
(Refer Slide Time: 08:15)
Now, we will take an example problem and try to get idea about performance of these
schemes. So, problem statement is given here. The figure shown is for one-dimensional,
the flow is form left to right; x is from 0 to L, is the length of the problem, variable value
at the left side is given as boundary condition ϕ at one, similarly the variable value at
the right side, ϕ = 0 is given on the right side. The question is solve the problem by
different approximation schemes – CD, pure upwinding and QUICK. Now, to get idea of
how these schemes behave for different flow condition we take two different flow
condition, u= 0.1 m / s another condition u= 2.5 m / s . Then to get the idea of for the
280
same speed, if you discretized with the five mesh points, if you discretized with twenty
mesh points, what is the different between five mesh points and twenty mesh points, the
Δx
is decided, the Δ x term goes into the expression of coefficient calculation.
So, to understand how this mesh spacing also influences the accuracy, we will have
another case solve the problem with two different mesh size, one for five equally spaced
mesh points, another twenty equally spaced mesh points. Now, in the further illustration,
we will not do all the combination, we will only look at few combinations and get the
idea of performance.
(Refer Slide Time: 10:01)
In the last slide, we explained the problem. Now, let us get some more explanation. 1-D
domain with the boundary condition meter per second at zero equal to 1, ϕ L =0 when x = L
is now discretized with five equally spaced cell. And for the problem define ρ is taken to be
3
1.0 kg / m and %gamma taken to be 0.1 kg m / s . Let us take two cases, and this is the
domain. We discretized the domain with five equal nodal points, 1, 2, 3, 4, 5 and they are
equally spaced. So, you see Δ x as the distance between node one and two, same way the
distance between node two and three and so on, because it is equally spaced. Node one which
is the node near to the left boundary, similarly node five which is the node near to the right
boundary, both are at the distance
281
of
Δx
2
with respect to the respective boundary. And boundary conditions are already
shown here, both left side as well as on the right side.
And for this problem analytical solution is already given and that is what it is displayed
here. Now, we take one of the case that u= 0.1 m / s and five mesh points. We calculate
convective flux as well as diffusive flux; convective flux equal to ρ u ;
ρ is already
3
defined as 1 kg/ m and u= 0.1 m / s , so ρ u , you will get 0.1. Similarly, for diffusive
Γ
Δ
x;
flux, it is defined as
Γ = 0.1
, Δ x = 0.2 and that is equal to 0.5. We want to
evaluate convective flux as well as diffusive flux to get the idea of role of convective
flux and diffusive flux. Now, this relation or weightage between convective flux and
diffusive flux will inform or tell us about performance by different discretization
scheme.
(Refer Slide Time: 12:41)
We first do central difference approximation. We already seen expression for
coefficients. Now, we substitute these values that is Fc , F d values in the expression for
each nodal location, and we get values as shown in this table. We can observe
immediately node one, left side is the boundary condition, hence aW =0 ; similarly for
node five, right side is the boundary condition and a E=0 . These are cross checking.
And the boundary condition on the left side as well as on the right side appears as a
282
source term and that is also shown here. All for all internal nodes for this particular
problem, there is no source, hence they go to zero. And we also mentioned point of
interest
283
node P runs from left to right, in this case, it runs from one to five. We also mentioned
point of interest node coefficient a P is related to neighboring node coefficient and that
is what is written here a P is related to a E +a W − S p .
And you can cross check here, take any one example, for example, node two, 0.55 for
aW , and 0.45 for a E , and there are no source term, hence a P is just 1 and it is shown
here. Now, you can write this in the form of matrix and that is shown here. So, if you
write a P ϕ p=a E ϕ E + aW ϕ W and that is what you will get the matrix. This coefficients are
already calculated. Now, if you look at this, this is the coefficient matrix multiplying
unknown variable column vector that is on the left side; on the right side, known value at
the column vector. So, this P, runs from left to right that is from one to five and that is
what is given here as unknown column vector.
So, this matrix if you look at, there is one main diagonal, and elements along the main
diagonal, 1.55 1.0 1.0 1.0 1.45, and there is a immediate super diagonal and immediate
sub diagonal. All other elements in this matrix are zero both above as well as below.
Such a matrix which has only three one main diagonal just above and just below is what
is known as tridiagonal matrix. And there is a separate procedure available what is
known as tridiagonal matrix algorithm. We will be looking at that detail in subsequent
class. So, once you invert this matrix by that procedure TDMA – tridiagonal matrix
algorithm procedure then you will get all the values at nodes one to five.
(Refer Slide Time: 16:13)
284
We also have a expression analytical solution, so we compare result obtain by analytical
solution against results obtained by central type approximation. For this particular case,
and that is what is shown in this graph, because the problem is very simple, the velocity
condition is only 0.1 m/s and five nodes only we are consider. The solution happens to
be almost same as exact solution. So, in this case, there is no serious remark in terms of
performance, it is only that for this condition CD exactly matches or very closely
matches with the exact solution.
(Refer Slide Time: 16:59)
Let us take performance, let us look at the performance by upwind scheme. We are not
going to the details of how each coefficients are calculated, because for this problem
with this value of 0.1 m/s and five nodes and density value and diffusion coefficient, it is
very easy to calculate the coefficients value, you can get again from the generic
expression, get the matrix and solve then you get solution by this upwind scheme
– pure upwind scheme. You observe here pure upwinding scheme it matches with the
exact solution for some points and then there is a deviation. So, this is pure upwinding,
results obtained by pure upwinding and this is solution obtained by exact solution, there
is a discrepancy here. Whereas in the previous case, for the same arrangement, the
difference is only in the scheme that is central difference scheme and here it is pure
upwinding the solution almost matches.
285
(Refer Slide Time: 18:05)
Let us look at the performance by third scheme that is QUICK scheme has three nodes;
one node on either sides and one extra node direction of the flow. In this particular
example problem, the direction of the flow is only one side that is from left to right
always. And so the performance almost matches with the exact solution. We will look
into this QUICK formulation in detail in next class. This idea here is to show
performance by QUICK scheme also in addition to performance by pure upwind as well
as CD.
(Refer Slide Time: 18:50)
286
Now, the second case is the higher velocity u= 2.5 m / s for the same problem that is
same domain, number of mesh points are same as five, u is increased from previous case
0.1 m/s now it is 2.5 m/s, which means it is convection dominated, hence you get flux
value calculated to be 2.5 and diffusion value calculated to be 0.5. Now, you can get idea
of ratio of convection flux to the diffusion flux it is the convection dominated problem.
And we know the transportive property is ensured better impure upwinding when
compared to central differencing. So, we again get details of all coefficients by one
scheme, this case it is central approximation with for this condition u= 2.5 m / s ,
maintain number of mesh points to be 5 and we get coefficient as shown here. These are
individually calculated what is shown here only the final value.
(Refer Slide Time: 20:10)
Now, if you look at the performance as I have been telling before velocity is increased
from 0.1 m/s to 2.5 m/s, it is a convective dominated problem now. Hence the CD
scheme will not be able to capture the direction and the performance is not up to the
mark. Once again what is plotted here is the exact solution and performance by central
scheme as you can see, there is a vigil, it is up and down and it is limited by a boundary
condition on one side as well as on the other side.
287
(Refer Slide Time: 20:46)
For the same problem that is velocity condition is 2.5 m/s, but the number of mesh point
is now increased from 5 to 20; in that case the diffusion flux, where Δ x appear in the
denominator is increased to 2.0. So, if you compare convection flux and diffusion flux,
the order is almost the same that is 2.5 and 2.0. This is convection flux, and diffusion
flux meant for that particular control volume. So, for the same problem, velocity
condition is the same 2.5 m/s. All that we have done increase the number of mesh points
from 5 to 20. Same scheme that is central approximation once again you calculate all the
coefficients. So, you can see node one, which is near the left boundary and node five
which near the right boundary and all others are internal nodes between 2 to 19, and we
get coefficient calculated. As we have observed before, internal nodes there is no source
generation, hence they are all zero, the boundary condition appears to source term for
near nodes that is what you see here node and node five they have value. Once again,
you can observe a P is related to neighboring coefficient, you can again cross check this
values.
288
(Refer Slide Time: 22:30)
Now, you see the performance the same scheme central differences scheme for the same
flow condition 2.5 m/s when it was with five mesh points it exhibited vigil in the
solution, the vigils are gone by increasing the number of mesh points from 5 to 20, and
you get solution very close to the exact solution without any oscillation ups and downs.
So, this is the way you can improve the solution accuracy if the order of accuracy is
constrained. So, in this case, you would decide to have a central difference scheme,
because it has a second order accurate, but it exhibited vigil or oscillating type of a
solution. Now, you can increase the mesh size and get away with the oscillation and get a
improved solution. For the same 2.5 m/s with 20 mesh points, we would like to see
performance by pure upwinding. We already know the pure upwinding has a property in
the direction of the flow, hence in this case the performance is not surprising, the
performance by the pure upwinding is almost same as the exact solution.
Now, with this, we looked at performance by two different schemes mainly central
differences scheme and pure upwinding for one particular problem and two different
flow condition and two different mesh condition. So, if you change the mesh from five to
twenty for the same flow condition QUICK gives better performance or improved
solution without any vigils as well as oscillation. Pure upwinding it performs better if
you increase the mesh size, the diffusion part is reduced. So, in the next class, we will
take the same example problem, we will try to understand performance by QUICK
289
scheme, and then we will put performance by all the scheme together in one plot and get
the idea of performance by all the schemes.
Thank you.
290
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture - 22
(Refer Slide Time: 00:28)
Welcome, and welcome again to this course on CFD. Today is our second module of this
week. So, far we have done detailed description about different interpolation scheme
available to obtain variable at face for using it in convection term. We have listed 5
different schemes central difference type that is otherwise linear interpolation scheme,
pure upwind, power laws scheme, hybrid scheme and quick scheme. We also took an
illustration and explained performance by central difference type scheme as well as pure
upwind scheme. In today’s class, we will particularly see performance by quick scheme
for the same illustration.
291
(Refer Slide Time: 01:18)
For the sake of completeness, we will list all the scheme information for CD and pure
upwind approximation. The generic formula is a P ϕ P= aW ϕ W +a E ϕ E . In the case of CD
scheme, coefficients aW , a E and a P are listed as shown, and you can recognize a P that
is the point of interest coefficient is the summation of neighboring coefficients that is
aW + a E +additional term . For pure upwind, again aW , a E and a P are listed and for the
sake of direction convenience and to write down one generic formula a condition is
imposed a condition is included in the coefficient as shown here. For example, aW is
written here as F dw +max ( F cw , 0) , which means if the flow direction is from left to
right, then it is positive with respect to the coordinate direction, then max of this
condition will result in considering F cw ; similarly for other coefficients. And as
observed in CD scheme, a P is again summation of neighboring coefficient plus
additional term.
For QUICK scheme, we have similar term that is aW ϕ W + aE ϕ E plus one extra node on
the upstream side, which is again considering both the side possibility, the generic
formula is given here. So, the final formula is a P ϕ P= aW ϕ W +a E ϕ E +a EE ϕ EE , which is
east of east plus aWW ϕ WW , which is west of west. As usual, the node interest coefficient
a P is related to neighboring nodes, so a P=¿ aW +a E + a EE + aWW and then additional
292
term. Now, let us look at the coefficients in details; aW , aWW , a E and a EE . Again this
formula has a generic condition incorporated here by including a coefficient β . For
β =1
, F cw > 0 , that mean the flow is from left to right, then it will take accordingly the
coefficient values. Similarly, for β = 0 , or F cw < 0 , the flow is from right to left, mostly
in the case of reverse flow then it will take appropriately. So, this generic formula is
suitable for any direction, similarly for pure upwinding. So, this helps while writing the
code, it automatically switches based on the flow velocity condition.
(Refer Slide Time: 04:47)
Now, let us look at problem statement once again. For the figure shown below, solve by
convection-diffusion finite volume formulation. So, in this figure, there is a convection
as well as diffusion for the problem, boundary condition is defined on one side that on
the left side at
x = L , ϕ = 0.
x = 0, ϕ = 1
then boundary condition of the other side right side, at
Now, flow is from left to right, hence it is only positive, so in the generic
coefficient, it will be considered accordingly. We mentioned just to consider
performance by difference scheme as well as to understand influence of mesh and
velocity condition, solve the problem by different approximation schemes, CD, pure
upwind and QUICK. Solve the problem for very low velocity u is equal to 0.1 m/s and
the high velocity of 2.5 m/s. So, the difference in velocity will decide the weightage of
convection term in the case of pure upwinding or hybrid scheme.
293
Similarly, solve it with 5 equally spaced mesh points or twemty equally spaced mesh
points, so the given domain length is x = 0 to x = L, length- L; if L =1, then if you divide
by 5 equally spaced mesh points, Δ x will be 0.02; if you divide by 20, then Δ x will be
0.02. In this Δ x term goes into the diffusion term calculation.
(Refer Slide Time: 06:29)
In the last slide, we explained the problem. Now, let us get some more explanation 1-D
domain with the boundary conditions ϕ 0=1 ; ϕ L =0 , when x= L is now discretized with
5 equally spaced cells. And for the problem define
ρ is taken to be 1.0
kg / m3 and
Γ
taken to be 0.1 kg m/s. Let’s take two cases, and this is the domain. We discretized the
domain with 5 equal nodal points, 1, 2, 3, 4, 5 and they are equally space. So, you see
Δx
as the distance between node 1 and 2, same way the distance between node 2 and 3
and so on, because it is equally spaced. Node one which is the node near to the left
boundary, similarly node 5 which is the node near to the right boundary, both are at the
distance of Δ x / 2 with respect to the respective boundary. And boundary conditions are
already shown here, both on side as well as on the right side.
And for this problem analytical solution is already given and that is what it is displayed
here. Now, we take one of the case that u = 0.1 m/s and 5 mesh points. We calculate
convective flux as well as diffusive flux; convective flux equal to
294
ρu
;
ρ is already defined as one
3
kg / m
and u = 0.1 m/s, so ρ u , you will get 0.1.
Γ
Similarly, for diffusive flux, it is defined as Δ x ;
Γ
= 0.1, Δ x = 0.2
Γ
and that Δ x =
0.5. We want to evaluate convective flux as well as diffusive flux to get the idea of role
of convective flux and diffusive flux. Now, this relation or weightage between
convective flux and diffusive flux will inform or tell us about performance by different
discretization scheme.
(Refer Slide Time: 09:08)
We know QUICK scheme illustration as shown here. This is given particularly for this
illustration problem. Where the flow is only one direction that is left to right that is what
you are seeing here, both uw as well as ue are shown from left to right. So, for the face
w,
ϕ W is your interest ϕ small case letter w is your interest, then you have a quadratic
fit running through 3 nodes. Say immediate downstream node is
the left is
ϕP
, the one node on
ϕW capital letter, then one node upstream is ϕ WW that is the quadratic fit.
ϕ
Similarly, for face ue , then you consider one node immediately downstream is E , the
one node on the other side
ϕ P , then one more node immediately upstream ϕW that is
the graphical representation of quadratic fit.
295
(Refer Slide Time: 10:13)
Now, we write down the generic formula ϕ at any face is as shown here. As I already
mentioned, in this formula, node the letter subscript i represent immediate downstream,
then i-1, and i-2 are upstream. The CD approximation to evaluate delta ϕ at CV faces
for diffusive flux is used, because in this problem, we have convection term as well as
diffusion term, and diffusion term, we mention we will use only central difference type
approximation. We already did that in detail.
Now, again for this problem, area is the same, so a E= aW , now we are using QUICK
scheme approximation for the evaluation of variable at the face. Now, after doing that
operation and putting in both the final discretize form then you will get in the regular
form, final discretized equation as shown here a P= aW +a E + aEE + aWW plus remaining
term. And for a P ϕ P is related to neighboring coefficients as shown here. When we
already listed this aW , aWW , a E , a EE ; in this problem, the flow is only form left to
right, so accordingly the coefficients are taken only suiting to the problem. And β is
defined as we did before.
296
(Refer Slide Time: 11:49)
Now, we apply this generic formula for each node separately. As we mentioned while
describing the problem figure, node 1 and node 5 are near boundary nodes; internal
nodes are 2, 3, 4, so 2, 3, 4 nodes we have the same expression and that is what is shown
here in this table, 2, 3, 4 then evaluate then you get this. For 1 and 5, there are boundary
nodes, and we have already explained the left side of the boundary node 1, and right side
of the boundary node 5, actually the boundary condition then accordingly you write
down the expression coefficient expression. Now, we have to substitute values that is
given in the problem statement in terms of ρΓ , velocity as well as number of mesh
point that you have consider. So, if you substitute those values in this flux calculation
properly, for example, F dw means diffusion flux at west face; similarly diffusion flux at
L and so on.
297
(Refer Slide Time: 13:04)
You substitute all those values then for this condition u = 0.2 m/s then evaluate and you
get this coefficients actually calculated. So, for node 1 as well as node 5, we have a
source term coming from the boundary condition. And for node 2 which is next to the
near boundary and that will have again aWW , a west of west, because in this problem,
the flow is from left to right, when you write down for node 2, then QUICK formula will
have a P , aW and aW , aWW , which is west of west. And in this problem, it happens to be
the boundary condition face so that will also appear as the source term, and that is what
is shown here as S P and Su . Node 3 and 4 is actually deep inside, and they do not have
the boundary condition incorporation. So, S p and Su will take the value of 0. So, this
numbers are obtained after substituting problem statement value that is u = 0.2 m/s, Δ x
based on the condition that 5 mesh points are used;
Γ
is already given,
ρ is given, then
if you substitute in the generic formula and take appropriately the boundary condition
then you are able to evaluate and get this values.
298
(Refer Slide Time: 14:43)
Now, this needs to be put in the form of matrix so that is what you will see here. So, in
the form of a matrix it is shown. There is one coefficient matrix then there is one
unknown column vector, and that is equal to another known column vector. So, in this
ϕ1
to
ϕ5
are nodal values to be determined and corresponding coefficients are written in
this Richardson coefficient matrix. As I explained before if you look at this matrix
particularly, we have one diagonal element, so in this case, it is 2.175, 1.075 5, 1.075,
1.075 and 1.925 these are all element along the diagonal. Then you have immediately
super diagonal, then there is one immediately sub diagonal so that is the tridiagonal
matrix structure. But for this problem, when you use QUICK scheme, you get additional
element, so the tridiagonality matrix structure is actually disturbed, this also we
explained before. Now, we are seeing it actually with the problem and corresponding
numerical values. There is a procedure to invert this matrix, we will reserve that matrix
inversion procedure for next class. So, once you do this matrix inversion, you are able to
get answer or unknown variables
ϕ 1 to ϕ5 .
299
(Refer Slide Time: 16:15)
Now, we have already mentioned there is a analytical solution available and you can
make a comparison. Now, this is comparison on the performance for the same problem,
but using a different value of u, 0.1 m/s. The previous slide I showed values
corresponding to 0.2 m/s and this is slightly lesser point one m/s, but everything else
same that is 5 mesh points,
ρ
and
Γ . And you see here performance, QUICK scheme
plot and exact analytical solution plot they are shown, and in this case, one exactly
matches with the other and that is why you are seeing only one color. And you can cross
check the left boundary, it is already given as one, in the right boundary it is 0, and there
are 5 nodal points 1, 2, 3, 4, 5. So, you are able to compare and you see performance
because it is so low velocity QUICK scheme performs equally well.
300
(Refer Slide Time: 17:23)
In the next plot, you see performance of the quick scheme, if you increase the velocity
from 0.1 m/s to 2.5 m/s, number of mesh points still remains as 5, then you see the
performance of the quick scheme. So, this color, the red color one is exact solution,
whereas, the quick scheme start showing from node 3, node 4, node 5 and then there is a
right boundary. This is because you are having a 5 mesh points and Δ x is 0.2 and you
compare convection is 2.5, and diffusion is 0.5, and performance of quick scheme is
poor. Now, we will see in the next slide same flow condition that is 2.5 m/s, instead of 5
mesh point for the same domain, increase at 20 mesh point.
301
(Refer Slide Time: 18:21)
And again ρ u value remains, because it is function of velocity and density is 2.5
Whereas diffusion is changed Γ / Δ x 0.1 by 0.05 is equal to 2.0. So, diffusion is now
2.0, which is almost of the same order as a convection, 2.0 is the diffusion flux and 2.5 is
the convection flux. Now, you see the performance of the quick scheme for the same
problem the results obtained are better, and it is very close to the solution obtained by
quick scheme. So, this plot tells you how important it is though the scheme is correct, if
you increase the mesh size then you are getting a better solution or correct solution. So, it
is necessary to check all the parameters before coming to the decision whether scheme is
good or flow conditions is not properly imposed. We have seen a similar one, last class
when we demonstrated CD scheme, similarly when we use
5 mesh points for higher velocity, the CD scheme was showing a vigil that is oscillation
and when we changed from 5 mesh points to twenty mesh points, solution improved.
302
(Refer Slide Time: 19:44)
Now, in this slide, I am going to make comparison of all the schemes. First one is
comparison for the flow condition, u = 0.1 m/s, this flow is very low velocity, hence the
scheme is not much influence. Even if you use 5 node points, you see here performance
by all the schemes almost matches with the exact solution and this not much difference.
Now, if I increase the velocity from 0.1 m/s to 2.5 m/s, you can see the comparison for
the same 5 nodes, you can see here exact solution is marked by this color. Then upwind
scheme is marked by a red color and you have a QUICK scheme and then this is QUICK
scheme and then we have a central difference scheme. We can make a interpretation with
this plot itself, upwind scheme is almost matching with exact solution and then central
differences scheme showing a very big variation or very big vigil, whereas, QUICK
scheme when you use a QUICK scheme though the performance is not matching, you
are able to see the vigil get reduced. Right from central difference scheme it gets reduced
this much. Similarly, on the other side, it gets reduced from to this side to this level.
And you can understand QUICK scheme is kind of combination of CD as well as pure
upwinding that we already mentioned when we explained the QUICK scheme. It has two
nodes on either side plus one node on the upstream side. So, two nodes on the either
side, behaves like a CD and one extra node on the upstream side behaves like a pure
upwinding. So, it has a influence of pure upwinding as well as CD scheme that is
303
information is very well captured in this comparison illustration, the performance by
QUICK scheme is better, though it is not good, but the vigil get reduced and it is getting
closer to the solution. And this much reduction, you can interpreted, because of the pure
upwinding type introduced to the QUICK scheme.
(Refer Slide Time: 22:12)
And if you increase the mesh size for the same problem from 5 to 20, then all the
schemes behaves very well. Then all are able to compare results are exact solution.
(Refer Slide Time: 22:28)
304
So, in this lecture, last the few classes, we have seen in detail finite volume formulation
for convection and diffusion term in Navier-Stokes equation. We also learned how to do
near boundary implementation. We learned there is a need to do different approximation
to get the variable value on the face. We learn 5 difference scheme, we also learn the
performance by taking one illustration. And by increasing the mesh size or by increasing
the flow condition performance differs. Most part of the lectures on this finite volume
formulation are adopted from book The Finite Volume Method authored by Versteeg and
Malalasekera.
So, next class, we are going to see another interesting topic until then have fun.
Thank you.
305
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture – 23
(Refer Slide Time: 00:25)
Greetings and welcome again to this course on CFD. Today is our third lecture for this
week that for the remaining week we are going to see in detail for time integration or
advance method, arrangement of variables. Another important topic what is known as a
pressure velocity coupling, there are different methods available under pressure velocity
coupling we are going to see them in detail.
306
(Refer Slide Time: 00:51)
So, time integration methods, in the general Navier stroke equation, we have considered
diffusion term separately; convection diffusion term together, and there is a one more
important term that is a time derivative term. So we have to know how to do that in finite
volume strategy as well. The general Navier Stoke equation is written as shown here
∂ ( ρ ϕ )+div ( ρ u ϕ )= div (Γ grad ( ϕ ))+ S
ϕ
∂t
, where
ϕ is any property and Γ is a diffusion
coefficient and u is a velocity vector. To recognise the terms on the L.H side first term
represent time derivative change, otherwise it is a local acceleration; second term is a
convective flux; on the right side, the diffusion term or any other source term. So we
perform the time integration on the control volume.
307
(Refer Slide Time: 01:54)
After suitable replacement of volume integrals of convective and diffusive terms, the CV
integration results as shown here. So you have a time derivative term, so you go from
present time level t by increment in time Δ t so the integration limit is from t to t + Δ t .
And then first term time derivative term integrated with the control volume that is a new
term we have seen for the first time; remaining all known before the convection term,
diffusion term or any source term. We can replace the time derivative term integration
over the control volume and integration over the derivative so change the order of
integration the time derivative term that will result in the formulation as shown here. So
this is from time t to t + Δ t .
308
(Refer Slide Time: 02:54)
So there are many methods available; first we will see two level methods. Two level
corresponds to it involves values of the unknown at two time levels; under the two level
methods, we have Euler method, trapezoidal method, predictor corrector method. And
there is a multi-point methods basically two level methods you can have a maximum of
second order accuracy. If you want to have higher order accuracy for the time derivative
integration also, we have to add a some other procedure and that is multi point methods
one of that we are already familiar is a Runge-Kutta method. We also have a
classification what is known as a explicit method as well as implicit method.
(Refer Slide Time: 03:46)
309
First we will see in detail Euler method, so in Euler method again you have forward
n+1
. Here superscript n+1 corresponds
Euler or explicit method and that is shown here ϕ
n+1
n
to time, so ϕ
means ϕ at new time level which is defined as n+1 is equated to ϕ
plus that is the old time level with some derivative. And graphically it is shown here t 0
and t 0+ Δ t and new value that is a function here at t 0+ Δ t is evaluated from ϕ at 0 time
0 that is what is shown by this. This is supposed to be the functional variable function,
this curve represent function variation. And backward Euler or implicit method which
takes the value at the function itself and that is shown graphically here. So t 0+ Δ t value
is use as at n+1 value also. both these methods that is Euler method is usually or it is you
can prove, there it is first order accurate in time.
Why do you have to worry about order of accuracy in time, so if you solve the Navier
Stoke equation in full, we already learned convection term, diffusion term discretization
of it and it is possible to increase the order of accuracy for convection term and diffusion
term. It is necessary as far as possible the time integration term also of the same order as
the spatial derivative terms, hence when you solve by that Navier-Stokes equation a
particular problem you can confidently say for example, it is second order accurate in
time; second order accuracy in space; otherwise, depending on the order of the accuracy
you have to make very clear statement. For example, if you use Euler’s scheme for time
integration, and second order accurate any second order accurate scheme for convection
as well as diffusion scheme then you have to say it is first order accurate in time and
second order accurate in space.
There is another procedure what is known as midpoint method, it is also called as
leapfrog method where you evaluate the function at half time level between previous
time level and current time level that is given here as
here. So value at
n+
1
2
is in middle and ϕ
n+1
n+
using ϕ
n+
1
2
1
2
and graphically it is shown
is used leapfrog method you
are to increase the order of accuracy from first order to second order accurate, and it is
also implicit method.
310
(Refer Slide Time: 07:00)
How do you obtain all this Euler’s methods? We have already learn Taylor series of
expansion we had use the Taylor series of expansion to get any order of accuracy
difference formula and we explain only for spatial they had not actually restricted only
for spatial there also used for time integration and that is what you have seen here. So in
this
case,
y(t+h)
by
Taylor
series
expansion
is
as
shown
here.
y(t+h)+hf (t , y(t ))+higher orderterms when you know that h2 two factorial second
derivative and so on you are only interested in first derivative for time. So we suitably
replace then you get different Euler formula. Next is the trapezoidal rule where this is
combination of both implicit as well as explicit, and you have a weightage of half fifty
percentage weightage for the explicit part and fifty percentage weightage for implicit
part, and this is also known as semi implicit scheme or Crank-Nicholson scheme.
Graphically it is shown here. So we have a trapezoidal rule, so t 0 at the point shown
here and t 0+ Δ t it is shown here, and you fit a trapezoidal curve you have a trapezoidal
fit between the two then you get this formula derive. It is explicit fifty percent, implicit
fifty percent so this is called semi implicit and it is a second order accurate in time.
311
(Refer Slide Time: 08:51)
Let us look at some details about explicit method. They are conditionally stable, you
already learned about stability von-Neumann stability analysis. Hence all the explicit
schemes are conditionally stable. There is a criteria called CFL criteria that is either you
have a limit on Δ t or you have a limit on Δ x . You have dealing with a time integration
method, so there is a limit on Δ t ; large Δ t is sometime preferred for a problem you
want to capture different scales when you want to have large Δ t . It easy to program
because current level values are not required, all the previous values are only required
and you would not have to work hard to write a very difficult program. It is less
computational time; for every step it takes only less computational time and less memory
per step. If you look at graphically the explicit method, so value at n+1 is evaluated
based on variable value at nth level from i-1, i and i+1.
Let us look at implicit method. All the implicit methods are unconditionally stable; that
means, you can have affords to use any Δ t . It usually follows iterative solution for
every time step explicit method one invention is enough, whereas implicit method
requires iterative procedure because it accounts for the variable value at the current time
level also. It is relatively hard to program as compared to explicit method and it takes
more computational time as well as memory for every step; graphically it is shown here.
So value at n+1 is evaluated based on value at n+1 based on, but at i, i-1 as well as i+1.
312
(Refer Slide Time: 11:07)
Let us look at the performance of this explicit scheme, implicit scheme, and the role of
Δt
in the explicit scheme. Already there is a problem considered that is unsteady one-
dimensional heat conduction example problem. We take this problem that is already
solved it is only a demonstration to show the effect of time step as well as to understand
explicit implicit method performance. So what is shown here is a time is a distance and
temperature for one particular calculation results obtain after 50 seconds. If you use
different Δ t , performance by explicit scheme and what is shown here is if you use time
step of 10 seconds that is Δ t is 10 seconds is slightly larger. When you have a explicit
scheme Δ t matrix, because it is conditionally stable.
And in this example we show two different Δ t one is Δ t = 10 s
and Δ t = 1 s , so which
is a smaller time step. And exact solution is already known for this problem that is
already plotted. And if you use Δ t = 10 s after the calculation is proceeded 50 seconds
you see performance there is a vigil it does not reach exact solution, it goes up, it goes
down it never reach at the exact solution. If you use Δ t = 1 s that is finer Δ t then you see
performance it reaches almost same as exact solution and performance is better so in next
plot for the same problem if you happen to imp if you happen to incorporate implicit
scheme and you see the performance.
313
(Refer Slide Time: 13:13)
For the same final times 50 seconds and then one Δ t = 10 s , we already noticed explicit
scheme, it shows step wise solution ,whereas implicit scheme it captures almost same as
exact solution. So you understand effect of implicit scheme as well as explicit scheme on
the results. You also have to see the time required to obtain the solution as well as
memory required to use explicit scheme or implicit scheme.
(Refer Slide Time: 13:54)
So the question is whether you can combine both implicit scheme, explicit scheme,
because each of them supposed to have some advantage in solution at new time step is
314
predicted by explicit scheme. And then the next step it is corrected using the implicit
scheme so such so such kind of two times procedure is called predictor corrector method
so one proposal is given here new time level is predicted by explicit scheme and it is
corrected by implicit scheme.
For example, predictor step because it is only predicted it is not a exact value we use a
superscript star so
ϕ * = ϕ n + f (t n , ϕ n ) Δ t
. And this we already know, it is forward Euler or
explicit scheme and star super script star indicates temporary value or predicted value,
and this will be corrected using a trapezoidal rule and that is what is shown here. So
when you use a trapezoidal rule, the predicted value becomes a known value and that is
what suitably used here. When you write down the explicit part and when you write
down the implicit part this what is known as a corrector step. So this method of two
levels and it is second order accurate in time.
(Refer Slide Time: 15:35)
2
In two level schemes highest order achievable is Δ t order of method is not the sole
indicator of its accuracy. The order only determines the rate at which error goes to zero
as the step size goes to zero. So the order, it is not just indicator of accuracy, even if you
increase the order determine rate at which error goes to zero. So if you decrease the Δ t
when you already seen in the results. If you have a Δ t very high Δ t the performance
by explicit scheme is poor, but the same explicit scheme performance better
315
if you reduce the Δ t , so for smaller f size higher order method will have a smaller error
than a lower order one. If the step size is small then one can estimate the discretization
error in the solution by comparing solution obtain by two different step size so it is
possible to get idea of one what is error in the new Δ t and that procedure what is
known as a Richardson extrapolation procedure.
(Refer Slide Time: 16:52)
So we have seen we have a two level method, the two level method highest possible
accuracy is second order accurate. The question is now whether it is possible to devise
the scheme to have the higher order accuracy even for time derivative term. I already
mention when you solve a Navier-Stokes equation full, you have a convection term,
diffusion term, pressure term or any other source term. And we know very well how to
obtain different higher order accuracy for all this term which are spatially derivatives.
We have to have a corresponding higher order accuracy possible even for the time
derivative term, so overall solution can be called of the same order of accuracy both in
time as well as in space. So we are going to look at procedure how to obtain higher order
methods even for time derivative and such a scheme is also known as a multi-point
scheme.
In multi-point scheme as a name indicated we use more points and how you obtain this
more points this additional points are either already computed at previous time level. So
for example, you are at correct time level n+1 we have a values at n just immediate
316
previous time level you also have a value at previous time level n-1 or n-2. So this one
possibility or the difference between time n and time n+1 can be divided into number of
points, and values can be computed at this intermediate points, such a scheme is also
multi point method. It is called accordingly multi point methods and there are multiple
options available, you already know a method called Runge Kutta method which is a
multi-point method.
One example of multi point method is shown here what is known as Adams-Bashforth
method. Here again we have a one predictor as well as one corrector. So
ϕ n+ 1 = ϕ n +
Δt
2
[
three times function evaluated at time level n and one time function evaluated at n-1level
] then this is actually one step, which is second order accurate Adams-Bashforth method.
It is also possible to increase even in Adams Bashforth method next level this is third
order accurate by considering one more additional points at much previous time level. So
n+1
n
n− 1
n− 2
the formula is finally shown here ϕ
is regulated to ϕ then ϕ
then ϕ
, so n is
a just immediate previous time level n-1 is one before n-2 is even one before that.
So by considering more points in the previous time level you are able to construct the
method this is what is known as Adams-Bashforth method. And how do you obtain this
coefficient 3, 23, 16, 5 I have already mentioned by using a Taylor series expansion even
for time then you are able to construct these methods. So first one uses only immediate
previous time level, it becomes second order accurate; the second one uses two time
levels before it becomes third order accurate. One more observation all this uses
previous time level, hence it becomes explicit scheme, so Adams-Bashforth scheme you
are able to obtain explicit second order as well as third order.
The next one is what is known as Adams-Moulton method. In this the second the third
order accurate scheme is shown here which consider values at time level n and time at n1 and then one more point which is at the present level itself that is time at n+1. So time
at n+1 is present time level and variable value at that present time level is used because
that is there on the n left hand side. So this scheme is implicit scheme. So you can
actually construct like this to get any order of accuracy multi point level, explicit,
implicit or combination of both a common procedure is used n-1 is
317
order of Adams-Bashforth method as a predictor, and nth order of Adams Moulton
method has also corrector.
So we have already seen Adams-Bashforth method two scheme second order accurate,
third order accurate; Adams Moulton method one scheme third order accurate. So you
can combine both in the form of predictor as well as corrector method. You can use these
Adams-Bashforth, Adams Moulton method independently; you can also combine both of
them in the form of the predictor as well as corrector method, and that what is described
here. You can use one order lower Adams-Bashforth method as a predictor and the one
order the decided order as a corrector. It is easy to construct any order of accuracy by this
Adams method and only one evaluation of derivative per time is possible.
Te disadvantages if you start your calculation say time is equal to zero then you do not
have values as a previous time level n-1, n-2, so any of this method Adams-Bashforth
method or Adams Moulton method are not self-starting. So, one has to restart to any
other previous completely explicit method, to get first value either at n-1, or n-2 before
switching it to Adams-Bashforth method or Adams Moulton method. So your initial
calculations are not accurate enough.
So in this class, we have seen different time integration procedures, explicit method,
implicit method, influence of explicit method, influence of implicit method for a
illustration problem, influence of Δ t on the performance by explicit method. Then we
also learned how to get higher order accuracy for time derivative by predictor, corrector
method and we showed Adams Bashforth method and Adams Moulton method and how
to combine them also. Next class, we will see another interesting topic until then have
fun.
Thank you.
318
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture – 24
(Refer Slide Time: 00:24)
Greetings, welcome again to this course on CFD. Today we will we doing fourth
module for this week. Syllabus we have listed for this week; illustration on the
performance by different interpolation scheme for convection term. And from this class,
we will go move onto time advancement, integration methods, arrangement of variables,
pressure velocity coupling. There are different methods available MAC, SIMPLE,
different versions of SIMPLE, projection methods. We will look into these details and
then move onto next module.
319
(Refer Slide Time: 01:12)
With regards to variables, once you define domain and mesh, then we need to select
points where variables have to be computed. It is critical because it decides the way the
governing equations are solved, the programming easiness, memory requirement and
overall computational time requirement. There are three approaches in general, what is
known as a staggered grid, colocated grid, and semi-staggered grid.
(Refer Slide Time: 01:52)
Let us look at one-by-one. The first one collocated grid, it is you can also read it as co
located. As the name indicate in this system all the variables are stored at the same
320
location. Approximation for the derivatives are straight forward; programming is easier,
memory requirement is minimum. If you look at the mesh arrangement, what is shown
here is for the finite difference procedure, and what is shown on the right side is for the
finite volume procedure. As you can see here, this is the location, where all the variables
are stored. So, in this example, the arrow going from left to right is for the u-velocity,
arrow going from bottom to top is for the v-velocity, and dotted point that is marked is
actually indicating node or location, where other variables are stored, scalar variables
like temperature, pressure or concentration. So, all the three variables for example, uvelocity, v-velocity, pressure are stored at the same location, this is for finite difference
arrangement. And you are going for finite volume type of arrangement then you can
definition at the centere of the volume as shown here. So, this is the location where scalar
variables are stored, and arrow going from left to right for u-velocity, arrow going from
bottom to top is for v-velocity.
As you can observe in both the cases, they are defines at the same location. Let say for
example, you are trying to find out first derivative
∂u
∂x
and
∂p
∂x
∂u
∂x
or the pressure
∂p
; both
∂x
appear in the u-momentum equation and for both you need to find the
derivative. And in this case, as you can see here, you are defining only grid, and the grid
is same for both u as well as pressure. Hence getting a derivative difference formula is
easier, same coding can be used just by change the variables from velocity to pressure,
you can obtain first derivative say
using only same location,
Δ x is
∂u
∂x
and
∂p
∂x
with much easier, because you are
also calculated only once and it can be stored. Hence
it is easier and memory requirement is minimum.
It is used when boundary conditions as well as its slopes are discontinuous. So, this co
located arrangement of variable extremely helpful when the boundary condition as well
as its slope is discontinuous. Like any other method, this also has some disadvantage,
what is known as checker-board problem. In the next slide, will explain what is checkerboard problem.
321
(Refer Slide Time: 05:16)
In this slide, what is shown in this figure is a computed pressure distribution on co
located arrangement. A particular control volume or the pressure cell is shown in the
shaded portion; P is the node of interest. For example, west node and west face, similarly
east face and east nodes are shown. Similarly, for other side, that is north node, north
face, south node and south face, they are also shown.
Δx
and
Δy
is a element
distance in x and y direction respectively. The numbers that is shown in this figure that is
90, 40, 90, 40, this is the pressure field obtained say by any procedure, let us not worry
about what is the procedure. If the pressure field happens to be as shown here, then how
we will find out how the derivative of the pressure in x and y behave.
So, obtain pressure at face e and w by linear interpolation, the pressure gradient term
∂p
∂x
for example, in the u-momentum equation is shown as here. So,
cell that is shown it is actually
∂p
. Now,
∂x
Pe
P e – Pw
Δx
∂p
∂x
for the
that is what it is shown here, because it is
is done by linear interpolation, pressure at node P – point of
interest, and pressure at node E – the adjacent node are used to get pressure at east face.
So, it is shown here
PE+ PP
. Similarly, for
2
Pw , you take pressure information
from node interest P, and west node and linear interpolation is used Δ x
322
is there. Now,
if you look at this overall, you have
between, so
PP
PP
appearing in both the term with the minus in
term gets cancelled. Finally, you have
You can obtain similarly the other pressure gradient term
P E – PW
.
2Δx
∂p
, which is appearing in
∂y
second momentum equation or v-momentum equation. Without going to the details, we
can immediately make a guess
interested to find out
∂p
∂x
and
∂ p P N −PS
=
∂y
2Δ y
∂p
∂y
. Now, what is to be noted you are
and you get expression without the node of
interest term appearing. So, it is to be noted that pressure at the central node P does not
appear in the final expression for this gradient
∂p
∂x
or
∂p
. Now, if you substitute
∂y
the pressure gradient term in discretized Navier-Stokes equation, then all the pressure
gradient term will go to zero, which otherwise means there is no source term appearing
in the discretized Navier-Stokes equation, which is unphysical. So, that means, the zero
source due to pressure in the discretized momentum equation, even though there is a
pressure field appearing as shown in this figure. And this is quite unphysical and this is
the problem with collocated arrangement.
(Refer Slide Time: 09:01)
Next arrangement is the staggered arrangement as a name indicate variables are stored at
staggering location, location or nodes where velocities and pressure are different, not
323
only pressure any scalar also different. So, here is the figure to explain what is the
staggered arrangement, for the same mesh, you can now observe at the centre of the
mesh is the pressure or any scalar variable is stored; arrow mark going from left to right
is indication for u velocity; and arrow mark going from bottom to top is for the v
velocity. So, u velocity variables are stored on the vertical line at this place, which is half
324
cell distance from the center in the x-direction. Similarly, v-velocity cells are stored on
the horizontal line as shown here, which is half- cell distance in the y-direction from the
center of the cell as shown here.
So, you have three locations, one for each velocity, and one for pressure or scalar;
whereas, in the co-located arrangement, we have the same location. Now, this results in
different computation. Pressure nodes are at the center. While the nodes for velocity are
staggered in line with the direction of the component. There is one big advantage, there
is a strong coupling between velocity and pressure, so as you can interpret from this
figure, the pressure at the center is responsible for the u-velocity flow as well as for the
v-velocity flow as shown in the figure. Hence there is a natural strong coupling between
velocity and pressure, and this avoids oscillations in pressure as well as velocity field.
(Refer Slide Time: 11:00)
Third arrangement is what is known as semi or partially staggered arrangement. In this,
velocity variables are stored at the same location; whereas, pressure or any other scalar
quantity is stored at the staggered node or at the center. So, this is the figure that is
explained in for the same mesh arrangement, u-velocity and v-velocity are stored at one
same location, whereas, pressure is at the center. So, it is in between colocated and
staggered. It combines advantage of staggered as well as colocated and it is found to be
good for non-orthogonal grid. Still it produces some oscillatory pressure or velocity
fields.
325
Now, let us look at all the three arrangements together, the left is the colocated
arrangement, middle is the semi-staggered or partial arrangement, in the right is the
staggered arrangement, so you can immediately get idea the advantage as well as
disadvantage. So, in the case of staggered arrangement, because locations are different,
you need to compute for each one of them separately hence it involved sometimes and
more memory requirement. Whereas, there is natural pressure and velocity coupling in
staggered grid arrangement. In the next example, we are going to use only staggered grid
arrangement and that is widely used in many codes as well commercial software.
(Refer Slide Time: 12:35)
We go to the next important topic what is known as pressure-velocity coupling. What is
the background behind pressure-velocity coupling or what do we mean by pressurevelocity coupling. By now we know in general there are three governing equations
respectively for three momentum or three velocity components, and there is one
continuity equation, this is the minimum requirement for any fluid flow calculations. In
each governing equation for momentum, there is a convection term and we repeat it
many times before convection terms are non-linear in nature. In total, there are four
variables that is there are three velocity components and one pressure. The number of
equations equal to number of variables is satisfied.
However, there is no separate equation for pressure, though it plays an important role in
all the momentum equation. Velocity variables are; however, very strongly coupled,
326
because you will observe you know already also that each velocity component appears in
every other momentum equation, including the continuity equation that way velocity
variables are very intimately coupled. Correct pressure field should be known and that
should be used in momentum equation, to obtain correct velocity field, which in turn
satisfies both momentum as well as continuity equation. This process of linkage within
momentum equation and continuity equation is what is known as a pressure-velocity
coupling. Now, this is very important stage in solving Navier-Stokes equation, there are
many methods available, we are going to look at specifically three, four method MAC
algorithm, SIMPLE algorithm, SIMPLER algorithm, projection methods.
(Refer Slide Time: 14:44)
Let us look at MAC algorithm first; this is otherwise called Marker and Cell method. For
any calculation, once you define mesh and you decide the variable location, you are able
to describe boundary conditions, but what about all the internal nodes. All the internal
nodes are initialized with some guess values, this step is called initialization. So, you
start the solution with the guess value of pressure and velocity component. We will now
explain the procedure for u-momentum equation, the procedure is same for v as well as
w momentum equation; between time level zero or between one iteration to the next
iteration, the velocity is intermediate velocity. Once you know the procedure for
discretization then you write down final discretized Navier-Stokes equation. In this case,
we mentioned, we will take x-momentum equation and that is what is shown here.
327
So, the time derivative term is retained on the left side, all other terms are brought to the
right side, which means all the terms are supposed to be known right side.
u* star is a
intermediate velocity and that is to be determined first then it will be corrected. So,
u
*
− un
dt
that is the time integration; for this case, what is shown here is a
first order Euler time integration; u with the superscript n refers to previous time level.
All the terms on the right side
∂p
∂x
and convection term, viscous diffusion term, we
follow any procedure for discretization, finally, we get this discretized equation. So, if
you solve this equation, then you get
u* , we name it as
u* , because it is an
intermediate velocity. The intermediate velocity may not satisfied continuity equation.
So, if you rewrite this equation, take
dt
to the other side; un is also known and that
is also taken to the other side, and this is the equation for
u* . So, if you solve, you get
u* , and this is at one node location, and for 1-D, it will run from left to right; for 2-D,
it will run the entire map. You can write the similar expression for v as well as w
velocity component for y as well as z direction. As we mentioned just now, this
v* ,
u* ,
w * are intermediate velocity component, and they will not satisfy or they may
not satisfy continuity equation. So, if you substitute ,
u* , v * ,
w*
in continuity
then you get what is known as a error in the continuity and it is referred here as
you write in the form of equation as shown here. So,
a error in the continuity.
(Refer Slide Time: 18:04)
328
∂u* ∂ v * ∂ w*
*
+
+
=D .
∂x ∂ y ∂ z
D* ,
D* is
And this
D* is used to obtain what is known as a correction in the pressure. And you
prescribe a limit for
D* ; if
D*
is greater than some prescribed value epsilon, for
example, 10−3 or 10−5 that is the tolerance level you can accept. This limit is set by
you, and it will change from problem to problem. You can also be change in one
calculations itself between different time level of the calculation. So, if the magnitude
D*
is greater than some prescribed value epsilon then you setup pressure correction
δp
as shown,
is correction in pressure equal to
defined as shown here,
1
1
1
ω
+
+
2
2
2 dt Δ x Δ y Δ z 2
[
−β D * . And what is
β , β is
] . Now, omega in this case is what is
known as relaxation parameter, we will talk about relaxation parameter later. So, once
you calculate
β , because all the quantities are known then you can calculate
δp ,
δ p is the change in pressure or correction in pressure.
Velocity components and pressure are corrected as given here. What is shown here is
again only for u velocity component, so
*
u(i
,
j , k)
for three dimension, hence we get three subscripts equal to
adjacent node also should be corrected that is
, we are writing it
u*(i , j , k)−
dt
δ p . The
Δx
u*(i +1 , j , k) equal to the old one plus the
correction in pressure. Similarly, the pressure is also corrected. So, in this equation,
u
*
that is on the left side is the new velocity,
can use them as a
u*
p
*
is the new pressure, you
or you can write it as u itself, it is immaterial. What is to be
noted is this is the corrected value and corrected pressure.
One can repeat this procedure for other two component v as well as w. Now, repeat this
step now for all the cells in computational domain until no cells has the magnitude
greater than
D*
that you have specified. So, this procedure is what is known as
Marker and Cell method, and this is again a popular method. So, this class we have
specifically seen arrangement of variables, three arrangement of variables, advantage and
disadvantage associated with them. Then we understood the need for pressure-velocity
coupling. We explained one procedure what is known as a Marker and Cell method. In
the next class, we will take another important method what is known as a SIMPLE
method.
Thank you and see you all again next class.
329
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture – 25
(Refer Slide Time: 00:27)
Welcome, welcome again to this course on CFD. This class is module five for this week.
We have seen so far illustration on the performance by different interpolation scheme for
convection term, time advancement, different methods in time advancement,
arrangement of variables in particular, three different arrangements we have seen. And
then need for pressure-velocity coupling, we described why one has to go for this
pressure-velocity coupling procedure. We listed four procedure, out of the four
procedure, last class we have particularly seen a method called Marker and Cell method MAC. So, this class, we will focus on another method what is known as SIMPLE
method.
330
(Refer Slide Time: 01:10)
For the sake of continuity, we will try to understand once again what is pressure-velocity
coupling, so in governing equations there are three governing equations, one for each
velocity component, and we have one continuity equation. There are three variables for
three velocity, and one for pressure, so in total there are four variables number of
equations four, number of variables four, hence it is satisfied. Though pressure appears in
each term, there is no separate equation for pressure, and pressure derivative plays an
important role in each momentum equation. However, velocity terms appear in each
equation, and they are strongly coupled. So, the linkage to connect between pressure and
velocity through these four equations is established by procedure what is known as the
pressure-velocity coupling procedure.
331
(Refer Slide Time: 02:18)
So, in this particular class, we are going to look at a scheme called SIMPLE scheme.
Before going to the detail, let us first understand what is again staggered arrangement. In
this figure, you see vertical lines - thick vertical lines, and then you are also able to see
dash vertical lines in between two thick vertical lines, you are able to see dash vertical
lines. Similarly, horizontal lines, you get thick horizontal line, and there is another thick
horizontal line, and there is a dash line in between horizontal lines. Here also you can see
the dash line in between two horizontal lines; on other side also you are able to see. We
have already seen staggered grid, velocity variables itself or stored at staggered location.
And pressure or any other scalar, you stored in some other location. So what is shown
here is a first u cell, that is marked in the red color and that is at one location; then v cell
is marked here, and then p cell is marked here. So, each variables are stored at different
locations and pressure cell is at different location. SIMPLE algorithm that we are going
to talk about this class is specifically explained for staggered arrangement. this figure is
repeated in the next slide the nodal information also included.
332
(Refer Slide Time: 03:56)
So, in this figure, which is repeat of the previous figure that with the nodal location also
marked. For example, you have a mesh and nodes marked, there are two different types
of letter, one is capital letter and another is small case letter. i is for the x-direction, and j
is for y-direction; so in the x-direction, all the thick vertical lines are marked with the
capital letters. So, in this case, I, I-1 and I+1. All the intermediate lines are marked with
small case letter i and i+1 and i-1. U velocity sits between two vertical lines as shown
here. if you go in the j-direction, J is capital J is used. And Next thick horizontal line is
marked as J+1, similarly the adjacent thick horizontal line is marked here as J-1. And
small case letter, for example, here small j is referred for dash horizontal line, similarly
for j+1, and j-1.
So, to locate a node that is given as P here is a pressure node, we have capital I and
capital J. The face on one side face is small i and capital J, because you are on the same
horizontal line. And you go to the other side, right side, you have small i+1 and capital J.
if you go vertically, capital I,J is here, and you go vertically up capital I is retained,
because you are on the same vertical line and small j+1 and I, J-1. And you can get idea
of all other important points. And in this figure, u-velocity is from left to right and that is
shown in the red color; and v-velocity is from top to bottom that is shown in this color.
And as we did before, u-cell is shown between two vertical lines in the staggered
arrangement; v-cell is shown between two horizontal lines in the staggered arrangement.
And pressure or scalar is marked as shown here in the
333
original grid line between two horizontal and two vertical. Now this index, please make
a note, because we are going to use this extensively in explaining the SIMPLE algorithm
that is small case letters and capital case letters.
(Refer Slide Time: 06:58)
So, in some situation instead of using small case and capital, they may use half, so for
example, i,
i+
1
2
, i+1,
i−
1
2
and i-1; similarly j,
j+
1
2
,
j–
1
2
, j+1 and j-1, any method
you can follow. SIMPLE algorithm was put forward by Patankar and Spalding in
nineteen seventy two. It is basically a predictor and corrector procedure for the
calculation of pressure on the staggered grid arrangement. Staggered grid and
corresponding arrangement of variables is used, and we explained just now through two
slides staggered arrangement of variables. Neighboring nodes coefficients are marked as
anb – subscript, and nb stands for neighboring nodes, and pressure can be discretized.
Now we have the Navier-Stokes equation, so you discretized all the terms, convection
term, viscous diffusion term, and pressure term. Pressure is also discretized by following
procedure. And coefficient of pressure after discretizing is denoted by A i , j .
So the momentum equation after discretized on the staggered grid is rewritten in this
form as shown here. So, ai , j U i , j equal to sum of all the neighboring nodes coefficients
plus pressure terms – discretized pressure terms plus any source term that may be there
in the momentum equation. So, this equation is the generic equation, in
334
the sense, if you run the variable i and j appropriately from left to right or from bottom to
top then you are able to write this equation for the all nodes in that domain. And this is
the neighboring node, and it is brought to the right side, because it is suppose to be node
either from the previous iteration or from the guess value.
(Refer Slide Time: 09:22)
The first step in SIMPLE procedure is initial guessing of the pressure as well as velocity
components. As I mentioned in the last class, we have a domain defined then you have a
grid defined, you also decide choice of variables location, boundary condition is defined.
You have to start the calculation or simulation. To start the simulation, we need to make
a guess, this step is called initialization. The same is followed even in the SIMPLE
*
procedure and we call this as a guess pressure denoted by p and guess velocity denoted
*
*
by u and v . We are explaining here for two dimension, and it can be extended to
include third dimension as well. So, discretized momentum equation, and we have just
now seen in the previous slide is then solved, so once you solved discretized momentum
equation, using the guess pressure then it will result in next step what is known as a
*
*
guessed velocity component u and v as shown here.
Now we can setup a equation for pressure correction p', and this p' pressure correction is
*
defined as shown here. Actual pressure is p, guess pressure is p , correction pressure is
p', so if you add the correction pressure to the guess pressure that will result in corrected
pressure field. We follow the similar procedure for the
335
*
velocity component, so u is the guess velocity and u' is the correction in velocity; if we
add them together, you get correct velocity field, similarly for the other component of
velocity.
(Refer Slide Time: 11:20)
So, at this point, if you subtract equations with guessed values from the equation with the
actual velocities, which means we have actually started with guess value, discretized
Navier-Stokes equation is the same. Suppose, you had used the actual velocity as well as
pressure field in the discretized momentum equation, and you have now discretized
momentum equation written with the guessed value pressure and velocity field. So, if
you subtract one from the other, then you get correction pressure as well as correction
*
velocity and that is what is shown here. So, ui , j is the actual velocity and u is the
guessed velocity; if you subtract the actual velocity from the guessed velocity that will
result in correction in velocity value and this is repeated for all the terms inside, so this is
for the neighboring node and remaining for pressure. And we already defined, we use the
symbol u' for the left side
*
'
u i , j – u i , j =u i , j
, so this is correction velocity; similarly on the
right side, from the neighboring node, correction velocity term and pressure term.
There is one important step in this equation if you look at, you are doing the summation
of all the neighboring nodes coefficients with the correction velocity. Suppose you had
actually solves with the original or the corrected actual velocity field then this
336
contribution term should go to zero. In other words, if we do not have any correction,
there will not be any contribution from the neighbor, actual velocity is directly related to
the pressure field, so that is what is important approximation made. At this point, I repeat
that approximation; and at this point, approximation is introduced that is summation of
’
a nb u nb
are dropped simply from the above equation for the velocitycorrections. And
omission of this term is the main approximation of SIMPLE algorithm.
So, once you drop this particular term, once you drop this term, summation of the
neighboring node contribution, the resultant equation is shown here. And we take the
coefficient ai , j that supposed to be known to the other side and you define another
variable, you define another coefficient
d i , j=
Ai, j
ai , j and that is multiplying correction in
pressure. So we have obtained one such expression correction in velocity u'. You can
repeat this procedure for same u' at different nodal location, for example,
'
u i+ 1 , j
;
*
similarly, for other component of velocity v'. We already defined u=u +u ' .
(Refer Slide Time: 15:02)
In the last slide, we got expression for velocity correction. Expression for velocity
correction had pressure correction term inside. Now, we get the corrected velocity as
337
*
shown here ui , j that is the corrected velocity equal to the guessed value that is u plus
the correction velocity as shown here. We follow this procedure for all the grid
338
points and also for velocity component v as well as w. So, we get all expression, we get
expression for all corrected velocity and we use that in the discretized continuity
equation. What is shown here is the continuity equation for 2D and discretized form with
the corrected velocity incorporated and you get finally, this expression. Now if you
substitute the corresponding expression in terms of pressure correction, into the
discretized continuity equation then we get equation as shown here. This equation is
equation for pressure correction and the node of interest where pressure correction needs
to be obtained is on the left hand side, and all other terms are brought to the other side.
So, this equation has a form similar to other discretized equation. The above equation is
the equation for pressure correction, which is other form of discretized continuity
equation, this step is what is known as pressure-velocity coupling stage.
(Refer Slide Time: 16:53)
I rewrite that equation in the standard form ai , j as shown here. And this is the procedure
that we have followed, whenever we did finite volume procedure, the neighboring nodes
are, neighboring nodes coefficients are separately written and the point of interest source
*
*
*
terms appears as shown here. We have used u expression here; the u and v as we
explained before is the guessed velocity field. The b' is the error in the continuity, which
happens because we have used guess velocity field in the continuity equation. When you
solve this equation, you get what is known as a p', which is the correction in pressure.
And you can subsequently get correct pressure field then velocity fields are obtained by
339
'
*
u
this expression p= p + p ' and i , j
is as shown here. And this is repeated for other
velocity component v and at all nodal location.
(Refer Slide Time: 18:09)
*
*
*
So, if I put all the steps in one slide, we start with initial guesses for u , v and p , the
momentum equations are solved. Pressure correction equation is setup and that is solved.
Then from that step you p' and that is used to obtain pressure as well as velocity. Once
you use the above pressure and velocity, then any other transport equation can be solved,
for example, temperature or concentration. The process is repeated, all the steps are
repeated until convergence criteria that you have set is satisfied. As we did in MAC
−3
−5
algorithm, here also we set up a condition for convergence, it may be 10 or 10 , it
depends on problem to problem. Once the convergence is satisfied, then we quit the
iteration procedure.
340
(Refer Slide Time: 19:15)
*
*
*
In terms of flow chart, it is shown here. So, we start with the initial guess p , u , v
*
and any other scalars that is generally written as ϕ and ϕ . So, you solve the discretized
*
*
momentum equation, we get u , v , solve the pressure correction equation, you get p'
then you correct pressure and velocity as shown here. Then solve all other discretized
transport equation, which is meant for any other scalar variable. We are still following
the same procedure as we did for pressure or velocity variable. So, following the finite
volume procedure, you get generic form of the discretized equation.
So, you get ϕ then you set up a convergence criteria, you check whether it is within
convergence limit that you have defined; if so, you can stop SIMPLE step or iteration,
move to the next step; if not, whatever velocity pressure that is obtained in this step is
now used as a guess pressure and guess velocity for the next iteration that is what it is
*
*
*
*
shown in this set p as p, u as u, v as v and ϕ as ϕ . So, this values are obtained
guessed know iterated solution and if it is not satisfying continuity, they are reset to
guessed value and procedure repeats. And you can see here, go back and repeat the
procedure.
So, in this class, we have seen one more method of pressure-velocity coupling, what is
known as a SIMPLE method. It is very popular and powerful method, people have used
341
it extensively, it is reported in many literature. Next class, we are going to see two other
procedure what is known as a SIMPLE consistent and projection methods.
Thank you and have a fun until then.
342
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture - 26
(Refer Slide Time: 00:23)
Greetings and it is my pleasure to welcome you all again to this course. We have seen so
far illustration on the performance by different approximation method used for
convection term, time advancement or integration methods available, arrangements of
variables, needs for pressure velocity coupling. Four methods we said we will take to
explain; we have already seen MAC, SIMPLE algorithm. And today’s class, we are
particularly going to see variants of SIMPLE that is SIMPLE R and SIMPLE C, and
projection method.
343
(Refer Slide Time: 01:01)
For the sake of completeness, we will go back and see what is pressure-velocity
coupling; we know there are three momentum equations for three velocity components
and one continuity equation. Velocity term appear in all the three equations as well as
continuity equation; pressure term appear in all the three equation for momentum. There
is no separate equation for pressure, though pressure gets in turn appears in all the three
momentum equations; otherwise you have four variables, and four equations, number of
equations equal to number of variables is satisfied. Velocity variables in turn they are
coupled, because each velocity term appears in every other equation, hence there is a
strong coupling among velocity components. And correct pressure should be specified in
the momentum equation, to get correct velocity field which satisfies the continuity
equation also. The procedure to link between momentum equation and continuity
equation, the procedure called pressure-velocity coupling is used. The linkage is set
through a procedure called pressure-velocity coupling.
344
(Refer Slide Time: 02:23)
We will have a re-look at simple procedure. Using the initial guesses for velocity
u* , v * and pressure
p* , momentum equations are solved. Pressure correction
equation is set up based on this guessed field in the continuity equation, when you solve
the continuity equation, we get pressure correction term. And this pressure correction
value is used to correct pressure as well as velocities. Using the above pressure and
velocities, one can solve any other transport equation as well. The process is repeated
until the convergence criteria is satisfied.
(Refer Slide Time: 03:15)
345
SIMPLE algorithm is shown in the flow chart as here. You start with the guess values,
solve the discretized momentum equation, to get
u* , v * . And this is used in the
continuity equation to obtain the pressure correction equation; once you solve this
equation, you get p' and that is used to correct pressure as well as velocity as shown here.
Once you solve pressure, velocities then you can take up any other scalar equation,
which is given here - the symbol
ϕ . You can follow any finite volume procedure to
get discretized equation for transport equation also. So, you solve this and you get ϕ .
And you check all of them for convergence, if convergence is satisfied you can stop the
iteration there, if it is not satisfied, you need to repeat this procedure. Before repeating
the procedure whatever value is obtained in this step as well as in this step, the pressure
velocity as well as any scalar variable or reset as guess pressure, guess velocity and
guess value for the scalar to proceed to the next iteration and the process is repeated. So,
this is algorithm for SIMPLE.
(Refer Slide Time: 04:43)
There are two versions available, variants of SIMPLE; first one is what is known as
SIMPLERevised, in short form it is also called SIMPLER. In this, the discretized
continuity equation is used to derive a discretized equation for pressure, instead of
pressure correction equation itself as in SIMPLE. The intermediate pressure field is
obtained directly without the use of a correction equation that is the difference between
SIMPLE algorithm and SIMPLE R. And velocities are obtained through velocity
corrections itself as in SIMPLE algorithm. Another variant is SIMPLEConsistent, in
346
other words SIMPLEC in short form, this was proposed by Van Doormal and Raithby in
1984. It follows almost the same steps as SIMPLE. Few additional steps are introduced
initially to get guessed velocity as well as pressure. We will look at those steps in the
next slide with algorithm flow chart displayed.
The SIMPLEC velocity correction equations omit terms that are less significant than
those omitted in SIMPLE algorithm. If you recall important step in SIMPLE algorithm,
you would drop the term correction contribution from the neighboring nodes that is
∑ anb u'nb
that is the neighboring node contribution and that term is drop and that is
important step in SIMPLE. Now, in SIMPLE C also, you will drop important term,
which are less significant than those omitted in SIMPLE algorithm.
(Refer Slide Time: 06:38)
Without go into the details, we have a flow chart to explain the SIMPLE C algorithm in
detail. So, here we start with the initial guess that is the initialized condition
,
v*
and
p* , u *
ϕ * . So, we calculate what is known as a pseudo-velocity as shown here.
And if you look at that expression, this is the discretized momentum equation, sum of
neighboring nodes plus source term and coefficient for the corresponding interest node as
shown here. Similarly, for the second velocity component v, again corresponding
velocity coefficient and neighboring nodes contribution plus source term that is there in
the v momentum equation. So, this is basically a discretized Navier-Stokes equation only
thing it is applied for different situation. So, if you solve this equation, you get u^
347
and
v^
that is used in the discretized continuity equation to get pressure, equation of
pressure as shown here. So, once you solve this equation, you get p; now this p is said as
p* . And this is the starting step for simple algorithm.
So, when you compare SIMPLE and SIMPLE C, you have two additional steps and these
two additional steps are introduce to get pressure and this guess pressure is supposed to
be closer to that actual pressure, because you obtain from solving the continuity
u^
equation, which is again obtain using
and
v^ obtained from the momentum
equation. Now, after this the steps are same as in SIMPLE, so you solve discretized
momentum equation, you get
u* , v *
then you set pressure equation, then you set
pressure correction equation, so p' is obtained through that pressure correction equation
solution and then velocities are corrected. So, you have two additional steps introduced
when compared to SIMPLE, in SIMPLE C.
(Refer Slide Time: 08:58)
This is followed and you get p, u, v and any other scalar, any other scalar
ϕ . Again
you solved transport equation, discretized form of the transport equation for the variable
ϕ , and you check for the convergence and you stop if convergence is satisfied.
Otherwise, repeat this procedure, go back to the first step that is again starting from
guess value and proceed. So, SIMPLE C, you can immediately make a guess, it takes
slightly longer time in initial, but then comparatively it takes less time because the guess
pressure as well as
348
guess velocities are closer to the actual pressure and velocity. So, we have seen in detail
two important algorithms SIMPLE and SIMPLE C.
(Refer Slide Time: 09:59)
Next go to the next method what is known as a projection method, the projection method
for the solution of incompressible, viscous flow fields and it is based on theory what is
known as Helmholtz-Hodge decomposition of velocity field. So, this decomposition
theory states that any vector, any velocity vector field u, on a simply connected domain
can be uniquely decomposed into a divergence-free which is called solenoidal part and
an irrotational part. So, in the projection method, the first step, as in the past is to obtain
intermediate velocity, you denote it as
u*
and it is computed explicitly using the
momentum equation with one big difference here is ignore pressure gradient term. So,
pressure gradient term appears in all the three momentum equation, you drop the term
then you have only convection term on one side, you have diffusion term on the other
side or any other source term. So, if you drop the pressure term, whatever velocity field
obtain is the intermediate velocity field and you denote it as u star.
And how do you bring the pressure into the system, you setup what is known as a
pressure Poisson equation, the pressure Poisson equation is solved, you get pressure then
velocities are corrected. So, pressure Poisson equation, we have already seen, it is an
elliptic equation. Now, in the next slide, I am going to explain how pressure Poisson
equation is obtained for 2-D. So, in the last step, velocities are projected on to the
349
divergence free space using the computed values of pressure that is you solve the
pressure Poisson equation, get a pressure and that is used to correct intermediate velocity
field
u* , v * and that is supposed to satisfy divergence free condition that is continuity
equation.
(Refer Slide Time: 12:09)
We write down here, the incompressible Navier-Stokes equation in differential form as
shown here, so
∂u
+(u . ∇ u)
∂t
on the left hand side, equal to
you obtain intermediate velocity field
get
u *−un
Δt
u*
−1
2
ρ ∇ p+ ν ∇ u . So,
by neglecting the pressure gradient, so you
corresponding to the time derivative term equal to the convection term is
now taken to the other side, so you have
(un . ∇ )un plus the viscous diffusion term.
Now, in this superscript n stands for the previous time level and * stands for the current
time level. In this case, * refers to intermediate velocity field to be obtained from by
solving this equation, before proceeding to the next level. So, if you solve this equation,
you get
u* ; similar to
u* , you will also obtain
v * ; so
u*
and
to obtain what is known as a pressure Poisson equation as shown here. So,
v*
are used
∇ 2 p u(n+1)
is related to intermediate velocity field as shown here. So, this is a linkage between
velocity and pressure, so once you solve this, you can correct the velocities.
350
So, intermediate velocity is projected onto the divergence free space and that is corrected
as shown here, un+ 1 which is the new or corrected velocity is related to the old or
351
intermediate velocity and with the correct pressure related as shown here. So, in this
pressure Poisson equation, we have a source term on the right side, the source term is
obtained by using a intermediate velocity field. If the source term goes to zero, then you
have the equation what is known as the Laplace equation, with the source term appearing
this equation called pressure Poisson equation. Now, in the next slide, I am going to
show how a pressure Poisson equation is derived for two-dimensional situation.
(Refer Slide Time: 14:34)
Let us rewrite the momentum equation, x-momentum equation is as shown here and ymomentum equation is as shown here. So, what we do, differentiate x-momentum
equation with respect to x, and y-momentum equation with respect to y and add both of
them together, so that will result in pressure Poisson term on the left side and
corresponding source term on the right side. In general that is for 3-D then all that you
have to do is take divergence of the Navier-Stokes equation and use divergence free
condition wherever possible, simplify to get pressure Poisson equation.
352
(Refer Slide Time: 15:19)
So, in this week, we have seen in detail time integration methods and various methods
available Euler method, multipoint method and then how to obtain predicted-corrector to
get higher order accuracy, arrangement of variables – collocated, stager, semi-stager,
advantages associated with each one of them. Need for doing a pressure-velocity
coupling and detail explanation for three methods that is MAC algorithm, SIMPLE
algorithm, and projection methods. Some part of the lectures on SIMPLE algorithm are
adopted from a book, The Finite Volume Method authored by Versteeg and
Malalasekera.
Thank you and we will see you in next class, next week with some other interesting
topics until then have a fun.
Thank you.
353
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture - 27
(Refer Slide Time: 00:28)
Greetings welcome again to this course on CFD. This week, we will talk about one important
subject called turbulent flows. Syllabus for this week introduction to turbulent flows,we
deriving governing equation for turbulent flows. we define a term called Reynolds stresses
and how to do modelling of Reynolds stresses. And we have variety of turbulence models, we
will talk about standard turbulences model, their different variants and explanation about the
performance. We will also talk in detailed about another class of model what is known as a
low-Re models.
354
(Refer Slide Time: 01:10)
Most of the flows encountered in engineering applications are turbulent in nature. For
example, flow through turbine, flow past buildings, automobiles, aircraft or any other
structure, flow in a channels, jet etc. You can also observe agar bathi smoke or cigarette
smoke, the origin and then diffusion or the spreading of the smoke, this is also due to what is
known as a turbulence characteristics of that flow. We also have separate branch called as
atmospheric turbulent, ocean turbulence etc. So, turbulence of exist all branches of
engineering.
At very low Re flows are usually consider to laminar whereas, at high enough Re, it becomes
turbulent. In the case of laminar flow it is a very steady flow very organised flow and its
possible to use Navier-Stokes equation or any other form of Navier-Stokes equation can be
used. In very simple situation, it is also possible to obtain analytical solution for laminar
flows. In other situation, it can be solved numerically without any further treatment in
equations; whereas, for turbulence flows we will see it later what are the characteristics
because of its nature it needs modification in equations, and special treatments before
turbulence model can be applied to engineering problems.
355
(Refer Slide Time: 03:07)
Let us start defining to turbulent flow its unsteady. So, you do not have anything like
unsteady term drop in Navier-Stokes equation it is irregular. So, you do not have any
predefined situation, non periodic motion we are worried about are we are concern about
three properties mass, momentum and scalar species it may be temperature it may be density
it may be concentration. So, in turbulence flows these quantities are transported and they
exibit fluctuation both in time as well as in space hence it becomes three dimensional. So, we
have learn three important property one is unsteady, irregular and three dimensional you can
have a situation of laminar flow unsteady, but it will not have a three dimensional in the flow
because of this there is a very good mixing of mass momentum as well as energy.
For example, you take coffee and you add sugar and to get fast mixing you stir it with the
spoon or stirrer then sugar get mixed quickly and this is the example of turbulence flow
mixing. Similarly as I mention before the cigarette smoke or agarbathi smoke spreading by
process diffusion gets faster, because the turbulence flows. And take a bucket of water you
drop a ink it is go by itself by laminar flow, but if you stir it then its go faster the spreading is
faster because of turbulence action. Fluid properties and velocity exhibit random variations
though they exhibits random variations it is possible to apply statistical tool one can obtain
average r m s or fluctuation squares. To statistical averaging results in accountable turbulence
related transport mechanisms and because of this it is possible to do what is known as
turbulent modelling which is a subject for this week it contain wide range of turbulent eddy
sizes.
356
So, when we talk about turbulent flow we talk about spectrum when we say spectrum where
is the range. We look for three information that is velocity time and length if we look for any
two the third one you can get that is from velocity and length we can get time or from
velocity and time you can get length information. So, in a flow you look for anyone of any
two of these information and you can obtain the third information by the dimensional
argument. So, when you say the spectrum for example, velocity information will have as
small as possible to as high as possible similarly when you say length information the eddy
size can be as small as possible to as high as possible. The eddies are fluid masses and they
undergo motions whenever the undergoes motions it cover some length in the flow and there
is the turn over time and that is what give you the time information. So, velocity length and
time related to eddy sizes it can be as small as possible to as high as possible there is a wide
range available in a turbulent flow and this is what is known as a spectrum and they exhibit
range of values the size and velocity of large eddies is on the order of the mean flow.
So, for example, if you consider flow through a circular cross section pipe then largest eddy
possible size is a diameter of the pipe itself. Then there is a process called energy cascading.
And now we explain that next slide with the help of the sketch the large eddies derive energy
from mean flow the intern passed to next small size they intern breath the next smallest size
and it goes finally, at the smallest size, it get dissipated by viscous action. So, energy is
transferred from larger eddies to immediate smaller eddies and then the cycle then immediate
smaller eddies and ends at smaller eddies is possible, this process is called energy cascading
process in the smallest eddies, turbulent energy is converted into internal energy by viscous
dissipation process.
357
(Refer Slide Time: 08:28)
This figure is an illustration to explain the energy cascade process as you can see here. These
are all larger eddy is possible in flow and there is an arrow to indicate the eddies are in the
motion with some angular velocity whenever the eddy comes back its position, then it is
called that is a time or whenever it is moves to the next position you called that is the length
information for the particular eddy. So, in this process cascading energy cascading process
largest eddy transfer energy come itself to the next smaller eddy then they intern transfer
energy to the next immediate smaller eddy and this stage goes until the smallest possible that
is want shown at the bottom as I am shown here where the energy get dissipated because of
the viscosity action. So, in Navier-Stokes equation we have a viscuss diffusion term and
actually plays roll here now what is an responsible mechanism for the transfer of energy from
one eddy to the next eddy is by what is known as the instability process and this instability is
created by initial component in the Navier-Stokes equation which is conventional terms.
358
(Refer Slide Time: 09:59)
This figure is from a book on turbulence by Davidson to get some more idea into the
definition of turbulent flow. I am showing here which flow through a pipe, there is a red
colour profile, which is a mean velocity profile. So, we learned what is mean by in
subsequent lectures now this portion alone. It is zoom, and it is shown here and you can see
clearly red line profile that is a mean velocity profile then you see wide variation and these
variations are shown with two different colours so the mean is denoted by ūi ( x , t ).
Now let us understand what is a symbol so i subscript stands for tenser notation. The next
lecture I am going to talk about tenser notation and some algebra association with tenser
notation the bar is stands for average the x stands for to represent in which direction that is
vector component then t stands for time. So, this u velocity profile, it is a function of both
space as well as time that is the meaning of writing ( x ,t ), now the mean is only one, but you
have seeing two different colours to represents the fluctuation. And you can seeing here to
represent fluctuation with respect to the mean. Now the fluctuation is function of time that is
why we get a one instant one fluctuation that is shown in one colour and it some other instant,
it will have some other fluctuation or the deviation from the mean which is shown by another
colour.
Now the deviation from the mean is represented by prime quantity because we are talking
about velocity in i. So, it is ui ' ( x , t ). So, fluctuation is a function of both space as well as time
and that is what is shown here with notation ( x ,t ). We explain just before that turbulent flow
359
exhibit three-dimensionality that is the function of both space as well as time and you are able
to understand with the help of this velocity profile and this is an another example this is a
velocity signal it is capture by the instrument in a jet flow at one particular x location. So, you
get any property, f for any property and t for time instant and you see one horizontal line to
represent its average and if you take the signal at a plot as a function of time you get a wide
variation. For example, if you open a tap and get jet coming out at centre of the jet if you
insert any velocity pickup instrument and you record the signal this over it appear.
(Refer Slide Time: 13:35)
This is another example to understand what is an turbulent flow. So, this is representation for
flow past to the building here is the building consider to a three-dimensional geometry flows
from left to right it will flow around as well as it will flow over now if you observe
immediate downstream here. These are lines to represent shear layer shedding and what is
that shut from to geometry and if you go slightly far enough then you see the motion it
becomes the turbulent. So, flow around on building gives rise to what is known as the
turbulent wake. So, wake is a region of the flow immediately begin the geometry. So, in this
case the geometry is building and this is a wake region. So, the wake becomes turbulent this
is important we have already mention turbulent flows exist in all works of engineering, in
case of building also there is a turbulent flow what we see in just representation, in terms of
isolated building, but in a urbanized setup we have varies high and immediately located
adjacent with each other then you need to steady flow through building.
360
(Refer Slide Time: 15:08)
Here is an illustration to understand though it is turbulent, how it is behaves for two different
Reynolds number. There are two pictures shown this is turbulent jets at two different Re on
the left Reynolds number is five thousand on the right Reynolds number is fifty thousand
different between them is one order of magnitude jet is suit at the bottom as i am shown here
and the same situation on the other side now you can get Reynolds number differently either
by increasing the velocity at the source or changing the geometric dimension at the source.
Now immediately after the exist, there are no problem flow appears to be laminar in both
situation, but as you move down stream. So, if you go little far either here are here at the
same location for both situations, you see different structure for two different Reynolds
number we will have a close look at one region in the next slide.
361
(Refer Slide Time: 16:19)
So, the same jet we take one small portion zoom try to understand how the turbulent flow
actually works for two different Reynolds number the bottom one is modest Re, and for the
top one high Re the flow appears to be left to right. Now in each figure, we have a big arrow
mark in also have a small curve line marks big arrow that is mark to represent large eddy
motion we already mention larger eddy is limited by geometry dimension of the flow in this
case the jet runs the jet is issued the geometry dimension is actually spread. So, in this case
for example, from this side to this side this is a geometric dimension spread that is a
limitation larger eddy will move between this limit and that is a motion that is it possible.
So, both in this case as well as in this case the large eddy is almost same. Whereas if you look
at small curvy line what you see on the top which is for the high Re you will see many small
curvy lines, and this curvy line sizes are smaller than what you will see in the modest Re. So,
modest Re also shows curvy line and these curvy lines represents smallest small eddy motion
in the smallest eddy is mark by the smallest curvy lines. So, the information from this sketch
is as you increase the Reynolds number the large eddy size is almost un effected where as the
smallest eddy is possible becomes smaller and smaller as you go on increase the Reynolds
number. you can observe once again at modest Re the curvy line which are represent smaller
eddy are only are having definite length that the same curvy line becomes smaller when you
increase the Reynolds number from modest Re to high Re. And this is very important because
when you model turbulence in flows latter you have to know what is the smallest mesh size
that you have to describe smallest mesh size capture smallest merge size the eddy size
362
motion and the prediction becomes better. So, I repeat as you increase the Reynolds number
the size of the smallest eddy becomes smaller and smaller. And that puts the limitation are
careful choice of the smallest mesh size that is possible.
(Refer Slide Time: 19:13)
Now, flows can be characterized by the Reynolds number we already know and the Reynolds
number definitions what is shown here
ρu l
one has to carefully interpreted by what is u and
μ
what is l. u is a velocity scale and l is length scale for example, flow through the circular
cross section pipe the well-known example if we consider velocity scale u it can be a
centreline velocity or it can be a average velocity bulk velocity similarly if you consider l
length for example, if you consider flow faster flat a the distance from the origin can be a
length if you consider smoke spreading from the cigaratte or from agarbathi, but from
agarbathi stick then distance from that origin wherever you are that becomes a length.
So, the Reynolds definition we know the ratio of inertial force to the viscous force, after
substituting formula for initial force and viscous force finally, arrived this formula. So, we
have to carefully interpreted u and l, u stands for velocity scale l stands for length scale. Thats
why we are seeing here length it can be x which is distance from leading edge or from the
source, it can be diameter of the pipe or it can be hydraulic diameter of the pipe depending on
the definition of u and l. For the same flow you can have the different Reynolds number and
you have carefully used the subscript. So, in this case for example, l is used then you write
363
Rel. So, we have two situation commonly encountered either external flow or internal flow.
So, external flow for example, flow as for a flat plate flow over an air fowling flow for the
cube obstacle buildings etc and flow for along a surface, we defined length scale l at the
distance from the origin of the source and that why Re x. Now that flow becomes a turbulent if
the Reynolds number defined based on the distance greater than or equal to five hundred
thousand.
Next situation flow past on obstacle or building or square cylinder surface etc then the
Reynolds number defined accordingly the dimension for example, if it is a building it can be
cross section or it can be height you have to define accordingly then Re d. If it is greater than
or above twenty thousand then the flow can be characterize is a turbulence flow. Next
situation is a internal flow well known example flow through circular cross section pipe, it
can be any cross section, it can be a sudden convergence section or it can be enlarging
section. So, Reynolds number it defined based on hydraulic diameter and if that value can be
greater than or equal to 2300 when the flow comes turbulence now this values are only a
guide line they did not be same at all situation they are also functions of what is known as
free term turbulence surface condition.
For example, if a consider flow through a circular cross section pipe we assume the internal
walls are perfectly smooth, it is possible have roughness introduce on walls then the surface
condition changes there roughness is supposed to clear roughness plays the role of enhancing
the turbulence. So, for the same geometry for the same velocity scale for the same length
scale if you introduce the roughness then the flow may become turbulent even before what is
defined as the two thousand three hundred similarly any disturbance upstream creator any
disturbance may cause transmission turbulence even at lower Reynolds number
364
(Refer Slide Time: 23:41)
Now we look at little more detail, we already mention though flow exhibits randomness it is
possible to approach the turbulent flow by what is known as the statistical methods and one
such a quantity is a averaging because we mention it is varying both in space as well as time.
It is possible to do both spatial averaging as well as time averaging for now we will limited to
only time averaging and explain turbulent flows with help of only time averaging quantity.
So, time averaging is usually used extract the mean flow from instantaneous once. So, we
will any quantity that is varying with time we refer it has a instantaneous. Once you do time
averaging then we get a mean quantity if you subtract one from the other then you get
fluctuation in other words the instantaneous quantity u for example, and if you subscript i to
representing in one direction or it a tensor quantity ui is split or decompose into average as
well as fluctuating component if you already learn with the help of this figure.
So, this is a figure for flow through pipe and velocity profile is marked with the red colour
and we take a one small portion zoom and see the velocity profile. You already mention we
have ūi ( x , t ) and that is shown here as a mean velocity profile and you have fluctuation the
two fluctuations marked just understand that you get different signal for different time level
and the deviation from the mean is marked by prime. So, in this case, it is ui ' ( x , t ). So, you
can put them together and that you give you the instantaneous quantity and that is want to
show the expression here ui ( x , t )=ūi ( x , t )+ ui ' ( x , t ) , where ui is instantaneous component ūi is
a time average component ui ' is a fluctuating component. We are explaining all this with the
365
help of one quantity that is velocity if you are involved with temperature density or any
concentration each one of them represented in the same bit that is decomposition
instantaneous quantity equal to mean average sorry instantaneous quantity is equal to mean
plus deviation from the mean or the fluctuation
(Refer Slide Time: 26:41)
Before going to further details let us have some information about tenser notation and some
algebra I would like to caution here whatever I am doing in this course is only very limited
and reader expected to take further references to understand more we use subscript i and j
each one of them take the value of 1, 2, 3. 1, 2, 3 corresponding to x, y and z direction
respectively in Cartesian coordinate system. If the subscript is repeating in a particular term
then it is summation if it is not repeating then for each value you get single term for example,
if you like ui as one term i subscript is repeating in both then it becomes the summation. So,
in this case, as a mention before i takes a value of 1, 2, 3. So, you write ui ui very explicitly as
u1 u1+ u2 u 2+u 3 u3 . So, this is the short form of writing this quantity ui ui if you write ui u j if
there is a term ui u j then the subscript is not repeating i takes a value independently 1, 2, 3 and
j take the value independently 1, 2, 3. So, we write complete form for every i value j will take
value 1, 2. 3.
So, we write here u1 u1 which mean i is 1 j is 1. u1 u2 which means i is 1 j is 2. u1 u3 which
means i is 1 and j is 3. So, you can observe each term is independent similarly i now takes the
value of two j will take again the value of one, two, three, separately another three component
366
u2 u1 ,u2 u2 ,u 2 u3 third possibility i takes a value of three and j takes a value of one two three.
So, you have u3 u1 ,u3 u2 ,u 3 u3 . So, you observe when you write a term ui u j i takes a value
independently 1, 2, 3 and for every value of i, j takes a value independently 1, 2, 3 in total in
get nine components nine independent component and all the nine independent component
are displayed here now you see immediately advantage of writing in tenser notation to
represent nine independent components it is so easy to write the help of subscript notation u i
u j. We also learn that index repeating that index is called dummy index if the index is non
repeating this called free index. Now what is the meaning of u1, u2, u3, we usually write x
velocity has u, y velocity has a v and z velocity has a w inside of writing that way we can also
write u1refers x component and u2 refers y components and u3 refers to z component velocity
we going to use one new term called kroncc ker delta which is given by the symbol δ with
the subscript i j this kronecker delta has a value of one if i equal to j or zero if i not equal to j
and this also is a matrix which is along the diagonal has a value 1, 1, 1 as I mention here.
Then i is equal to j it takes the value of one. So, you can observe this is δ 1,1 and this is δ 2,2 and
this is δ 3,3.
(Refer Slide Time: 31:20)
We will try to learn more information about rules of averaging average of average of average
itself in this case ū is average and you take the average of is that ū that ū itself average of
fluctuation is zero. So, u ' is a fluctuation if you take average that will go to zero. So,
fluctuation it may be positive and it may be negative if you take the average it will go to zero
average on the product of two fluctuation; however it is not zero. So, if you take u ' which is
367
a fluctuation for u velocity. v ', which is fluctuation for v velocity and you have a product of
these two fluctuation. And you applying time averaging on top of it they will they need not be
zero. averaging on the product of one averaged quantity and one fluctuating quantity is zero
expression wise ū is an one average quantity and v ' is fluctuation you have the product of
them ū v '. And you take the average on that is equal to zero average of the product of one
averaged quantity and one instantaneous quantity is a product of two average quantity. So, u
is an instantaneous quantity v̄ is a average quantity if multiply of both of them can you take
the average that will result in ūand v̄.
Average on the spatial derivative is a same as spatial derivative on the average; that means,
they are commutative in term of expression
∂f
is a derivative spatial derivative of the
∂x
function f. After you perform a spatial derivative and you do average that is the meaning of
average on derivative spatial derivative is same as you take a derivative on the average. So,
∂ f̄
average of spatial derivative is same as spatial derivative on the average, so they are
∂x
commutative. I am only giving limited information about statistical way of dealing, these
thing will be extremely helpful when we going to the detail of turbulent flow modelling. So,
in today’s class, I try to give information about what is turbulent flow with the help of
illustration, some information about tensor algebra, index notation and rules of averaging.
Next class, we will go into detail about equations.
Thank you.
368
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture - 28
Part -1
(Refer Slide Time: 00:23)
Greetings welcome, and welcome again. Today we move onto module two of this course. In
the last module, we explain about turbulence flows with some introduction. We took example
situation; flow passed building jet and so on. We also talked about mean velocity and
deviation from mean velocity or instantaneous velocity is decomposed into mean velocity and
fluctuation. We also learned a little bit about tensor notation and some algebra.
In this module, we will now focus specifically on deriving governing equation for turbulence
flows. While deriving equation for turbulence flows, we end up and getting a new term called
Reynolds stresses. We defined Reynolds stresses and modelling of Reynolds stresses by
different procedure. So, this particular module is split into two part; in the first part, I am
going to explain till we get the derivation of the Navier-Stokes equation for turbulence flows.
In part two, we will get some more detail about this Reynolds average stock Navier-Stokes
equation and Reynolds stresses terms.
369
(Refer Slide Time: 02:00)
We will also get explain about the closure problem. For the sake of completeness, I will have
to repeat important information about tensor and notation used. We used subscript i and j, and
i and j will take value 1, 2, 3. If the subscript is repeating in a particular term then it is a
summation; otherwise it is each term is a single term. For example, ui ui is a particular term
subscript i is repeating for every value of i you get one term, and then they are summed up.
And as you can see here ui ui means u1 u1+ u2 u 2+u 3 u3 .
If you have a term ui u j where subscript is not repeating and then every value of i and j, you
get u term; for every value of i 1, 2, 3, you have every value of j, so we have nine terms in
total and all the nine terms are listed here as u1 u1, u1 u2, u1 u3, similarly the last term u3 u3. u1 is
refer for x component of velocity, and u2 is used for y component of velocity v, and u3 is used
for z component of velocity w. We also learn a new term call Kronecker delta - δ ij. The
Kronecker delta as a value of one, if i is equal to j; otherwise it is 0. We also represented
Kronecker delta in the form of the matrix as shown here 1 0 0 0 1 0 and 0 0 1. So, it is a
diagonal matrix.
370
(Refer Slide Time: 03:56)
We will now start using index notation in detail and wherever possible I will repeat
information about index notation. We know there are two main equations one is a continuity
equation, other one is momentum equation. We will explain in detail how to derive continuity
equation for turbulent flow first what is shown here in continuity equation is general we
know for a study as well a incompressible situation the continuity equation is written as
shown here that is
∂u ∂ v ∂w
+
+
. Now the same continuity equation the form of the index
∂x ∂ y ∂z
notation is written here
∂ ui
=0 I mentioned if the subscript is repeating particular term it is
∂ xi
summation and in this term i is repeating one in the numerator one in the denominator. As
mentioned i takes a value of 1, 2, 3, and each term is obtain then they are summed up and that
is what get here.
When you substitute i is equal to one you get u or u1 and you get corresponding x direction i
is equal to two you get u2 or v and corresponding direction y i is equal to three you get w or
u3 and corresponding direction z. So, you understand the easiness same continuity equation
with three terms in the form of index notation and it written so concise. Now we substitute
the decomposition, we already learn the flow variable instantaneous can be written as a
summation of mean plus deviation from the mean for example, u instantaneous quantity is
written as a sum of mean ū plus deviation of the mean u ' now we use index notation it means
371
the decomposition is applied for any particular velocity component u, v, w. So, we substitute
this decomposition concept into each term in the above equation that is u, v, w that is the
meaning of using this index notation i. So,
∂ ui
=0 if you substitute ui which is now in
∂ xi
turbulent flow is interrupted as instantaneous quantity. So,
∂ ui
=0 continuity equation it is
∂ xi
very generic then you apply for turbulence flow you interrupted velocity as a instantaneous
velocity. So,
is
∂ ui
=0 you are applied the decomposition for the velocity ui as shown here that
∂ xi
∂ ( ūi +u ' )
∂ ūi
∂u i '
=0. So, you take that separately that is
as one component and
is another
∂ xi
∂ xi
∂ xi
component.
So, if you write down that way it becomes
∂ ūi
=0 . So, this equation that equation that is
∂ xi
mark as one is for instantaneous quantity that equation that is mark as two that is
∂ ūi
is a
∂ xi
mean quantity and if you subtract one minus two that is subtraction you perform then you get
equation based on fluctuating quantity as shown here. So, equation two is mean continuity
equation, and this particular equation where you use fluctuating quantity is a continuity
equation based on fluctuating variable. So, what we have done this slide, we are written a
generic continuity equation in very expanded form then we write the continuity equation in
index form when we used continuity equation for turbulent flow we interrupted that u as
instantaneous quantity we apply the decomposition for the instantaneous quantity as
summation of mean plus deviation.
So, if you substitute then you get two separate equation one based on mean quantity another
one based on fluctuating quantity in a expanded form you write
∂u ' ∂ v ' ∂ w '
+
+
=0 . So, you
∂x ∂ y ∂z
take this equation, and look at this equation that is initial written continuity equation and final
written continuity equation the format looks same, that it you have
∂
∂
∂
( u )+
( v ) + ( w ),
∂x
∂y
∂z
we use quantity one instantaneous other one mean other one fluctuating quantity. So, we have
372
continuity equation written in the same form the variable are interrupted differently for
different situation in the case of laminar flow it is a plain velocity component in the case of
turbulent flow we get two separate quantity one based on mean another one based on
fluctuating quantity.
Now, we can extend this procedure for any other equation is used to turbulent flow minimum
you use quantum equation if you are having any temperature to be consider the energy
equation are concentration separately we will use p c c equation. So, for each of this equation
we apply this decomposition principle and take a average to get corresponding equation to be
used for turbulent flow.
(Refer Slide Time: 11:00)
Now, let us try do it for momentum equation, I repeat again here continuity equation
∂ ui
=0
∂ xi
the continuity equation written in the index notation form. Now, momentum equation in the
index notation form is shown here, we already know otherwise called Navier-Stokes equation
2
∂u i
∂ u −1 ∂ p
( ∂ ui ) . Now in this equation u is only one term here again the next
+u j i =
+ν
i
∂t
∂ x j ρ ∂ xi
∂ x j∂ x j
term u j
∂ ui
in this term ui appears only once where as j index appears more than ones - twice.
∂ xj
So, for every quantity of j it will be one term that they are summed up that is the rule we learn
if the index is repeating then it is a summation otherwise each term single term.
373
So, i is single for every value of i you will get single term where else within the i for every
value of j you will get single term, but they are summed up. Now if you look at other term on
the right hand side. So,
∂p
is a single term now the diffusion term numerator ∂2 ui is a single
∂x
term there is denominator we have j index repeating. So, you get summation we already learn
Navier-Stokes equation in very detailed form. So, this equation if you use index values then
you get its expanded equation of the Navier-Stokes equation you can cross check. For
example, if we substitute value of i to be one then you get x momentum equation and for
every value of i equal to one for each term for the example second term on the left hand side
∂ ui is a convention term and u with the value of i equal to one is u itself whereas, j index
repeating is a summation. So, for every value of j we get one new term and then we are
added. So, u when j is equal to one it is u then j is equal two which is v and corresponding x j
will be y when j is equal to 3 it will be a w and corresponding xj will be z.
So, if you put them together it jet this
∂u
∂u
∂u
∂u
+u
+v
+w
. So, we get three terms, but
∂t
∂x
∂y
∂z
they are summed up and u is only one for value of i is equal to 1. Now, you can immediately
appreciate advantage of writing with in index notation in the original tensor notation form,
just only one term for covection and in the expanded form you get three different terms on
the right hand side. Once again when you substitute value of i is equal to one
∂p
can be
∂x
appear in the second term diffusion term ∂ x j ∂ x j if you expand j with value of one two three
and because its repeating summation you get
∂2 u ∂2 u ∂ 2 u
+
+
.
∂ x2 ∂ y2 ∂ z2
So, this first equation a x momentum or u momentum u momentum equation and we will now
repeat for next value of i that is two. So, when you substitute i is equal to two this then you
get v momentum equation or y momentum equation and that is want shown next equation
similarly if you substitute i is equal to three then we get third momentum equation of w
momentum equation that is want shown on the last equation. So, these three equations in the
detailed form, you are able to write very concise form using tensor notation as shown this
equation, I will know you will appreciate index notation and understand the way index
notation use to write that detail form of the equation.
374
(Refer Slide Time: 16:03)
You already learned turbulence flows exhibit the random or variation, with the time and these
are representation the quantity f as a function of time shows the fluctuation and we learn
continuity equation in tensor form momentum equation is tensor form. Now we have taken
out this equation to turbulent flows as a mention before this is generic equation. Now it
depends on how we are interrupting for turbulent flow the same equation all these quantities
what are the quantities in this equation u and u with index i 1, 2 3, the three variables that is
u, v, w or u1, u2, u3 then one more variables is pressure.
So, if you interpreted all these four variables in turbulent flow as a instantaneous quantity
then you applied decomposition for each one of this quantity we know the decomposition.
For example, ui instantaneous decomposed into summation of mean and deviation. So, if you
substitute can we get final Navier-Stokes equation to be used for turbulent flows. We learned
little bit about tensor algebra some important information about tensor algebra there are some
more thing that you do. So, we set time average on the derivative is a same as derivative on
the time average. Now, the second quantity in the Navier-Stokes equation on the left hand
side is a convention term, it has u j
∂
( u ).
∂ xj i
Now what do we do we applied decomposition into this. So, if you to do a time average, so
you get ūi +ui ' and then ū j+ u j ' and you take a time average on that quantity. Now why do we
375
do this, because if you take u j into the derivative, so it becomes
∂
( u u ) . So, you have a
∂x j i j
product of two velocity component now you want to apply decomposition to that product that
is ui u j you want apply decomposition u j is a one instantaneous velocity u j is a another
instantaneous velocity. So, if you write decomposition for the respective instantaneous
velocity, you get ūi +ui ' the second instantaneous velocity u j because ū j+ u j ' and we perform
finally, time averaging and that is what is shown over bar covering both the quantities.
Now we follow some rules we already listed few rules based on averaging after following
rule we are not going to the details. Finally, you get a term as shown here on the right hand
¯ a product plus ui ' u j ' . So, if you write this term substitute this term for the
side. So, u i ū j ❑
conversion term you can apply similar steps for each term separately, separately for
derivative, separately for pressure, separately for diffusion term and finally, you get a
equation as shown here. In this, i am not showing in detail about steps it is more important to
know the equation understand terms in the equation for detailed steps in the derivation one
has to look separately other material it is slightly beyond scope of present structure.
So, the final equation after performing decomposition for each variable following some
tensor algebra performing average then you get equation as shown here what is should be
noted important thing is first term for example, is a time derivative term this term has a same
form as a original Navier-Stokes equation original Navier-Stokes equation has a time
derivative term the time averaged Navier-Stokes equation also has a time derivative term and
this is ūi and this is only ui it is original Navier-Stokes equation as a mention it depends on
how you are interrupting for a turbulent flow the turbulent flow all these quantities are
interpreted as a instantaneous, the second term in the Navier-Stokes equation u j
second term the time averaged Navier-Stokes equation this is ū j
∂ ui
, the
∂ xj
∂ ūi
.
∂ xj
So, you can understand the second term appearance wise it is a same on the format wise it is
same both in the original Navier-Stokes equation and the average Navier-Stokes equation the
only difference is the variable. So, in the original Navier-Stokes equation it is instantaneous
whereas, in the average equation it is average quantity then you have one new term coming
376
into the picture that is
∂
( u ' u ' ) this is a new term which is coming of after applying
∂x j i j
decomposition following tensor algebra doing average on the original Navier-Stokes equation
then you end up getting one additional term in the time average Navier-Stokes equation and
that is what is shown here.
Now, come to the right side pressure derivative term is same as the pressure derivative term
in the original Navier-Stokes equation, except that it is time averagede pressure similarly the
diffusion is also same as the original Navier-Stokes equation except that. We use now time
average quantity in the average Navier-Stokes equation the new term that is shown here
∂
( u ' u ' ) . So, ui ' we know it is a fluctuation and bar is for average. So, this ui ' u j ' actually
∂x j i j
represent action of velocity fluctuation on the mean flow why it is mean flow because we
have written this equation for average all the terms appear as average. For example, ūi and p̄
the only different term is this fluctuating quantity ui ' u j ' now this quantity ui ' u j ' actually
represent velocity fluctuations. We known individually they represent velocity fluctuation,
the relation of velocity fluctuation on the mean flow is actually represented by this particular
term, now this term ui ' u j ' is main cause for turbulent flow modelling.
(Refer Slide Time: 24:15)
The last slide when we did the decomposition applied to convection term we end up getting a
term called Reynolds stresses I did not explain a convection term in detail in this slide we
377
will look into the convection term alone in detail. So, convection term is written I will shown
here u j
∂ ui ∂ ( u j ui )
. So, what we have done now taken that term u j inside the partial
=
∂ xj
∂ xj
derivative and that is what appearing here as
∂ ( u j ui )
. Now we have to explain why this can
∂ xj
written. So, if you actually perform partial derivatives on this variables ui u j by product rule.
So, you get first term as u j
∂ ui
∂u
∂
+u i j . So, it perform
on this variable ui u j apply the
∂
xj
∂ xj
∂ xj
product rule principle then you get two different term as shown here.
Now, if you look at this term carefully the first term is actual convection term that what we
have here u j
∂ ui
∂u j
so that is the exactly convection term. The second term we have ui
∂ xj
∂xj
actually represent continuity equation. We know for incompressible flow, the continuity
equation
here
∂ uj
=0 because of this it is possible to write convection term in the form as shown
∂x j
∂ ( u j ui )
. If you substitute decomposition for every velocity variable as ūi +ui ' then we
∂ xj
have ui u j written as ( ūi +ui ' ) ( u¯j +u j ' ) now you perform the product. So, we have ūi ū j for the
first term then ūi u j ' for the second term. Then third term ui ' ū j then ui ' u j ' . Now you perform
time averaging on this. So, they are shown separately here ūi ū j + ū i u j ' +ui ' u¯j +ui ' u j ' . Now we
apply what we learn in tensor algebra. So, this time averaging on the fluctuation, here also
time averaging on the fluctuation these two terms will go to zero. So, we have two terms that
is ūi ū j ; second term and third term they go to zero then we have ui ' u j ' . So, the first term will
be the convection term, but applied for turbulence flows the last term is an extra term and that
is a Reynolds stresses. With this come to part one of this lecture, then we move on to part
two.
378
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture - 29
Part – 2
(Refer Slide Time: 00:30)
In part two, we will get some more details about this Reynolds average Navier-Stokes
equation and Reynolds stress terms. We will also get explain about the closure problem. In
second part, we will explain why the problem of closure still remains. So, if we write the
equation and bring it to the other side, the new term if you bring the new term from left hand
side to the right hand side, the same average Naviers stoke equation can be rewritten in this
form. So, left hand side does not have that new term that is brought from there to the right
hand side, so left hand side remains the same as a original Navier stokes equation except that
we use average quantity. Right hand side first term pressure gradient term, the viscous
diffusion term is also there, but we have that additional term written and included in that
derivative term. Now these equations are specially called Reynolds averaged Navier-Stokes
equation in short form RANS.
Now this additional term ρ ui ' u j ' ; if you substitute units, so ρ is the density and u is the
velocity, if you substitute unit and check, it will have the same unit as μ
379
∂u
∂u
check μ
∂x
∂x
actually a stress. So, this quantity new term ρ ui ' u j ' also represent stress and that is why we
brought these two terms together and group them, and the derivative is taken separately
outside. Now in expanded form that is by substituting value for i and j following that index
notation guideline, for example, ui ' and u j ' is substitute i going from 1 to 3, and j going from
1 to 3, we get u ' 2, u ' v ' and u ' w '. And the derivative denominator, we have x j , xj ,, xj and xj
index is repeating and for every value of j you get one term, but then they are added and that
is why you get here summation term.
Next value of i, again j, we get another term; for next value of i and j we get another term.
These terms are additional terms appearing the Naviers-Stokes equation because of the
procedures of that we are followed decompositions of variable following tensor algebra
performing averaging, it will result in additional term called Reynolds stress term or i j is the
symbol used equal to − ρui ' u j ' . In terms of matrix, and I can write all these additional term
of matrix as shown here ρ u ' 2, ρ u ' v ', ρ u ' w ' and other quantities.
Now if you look at each term little more detail, along the diagonal as I am showing here, you
have u ' 2 , v ' 2 , and w ' 2 , and these are all what is known as a normal stress. So, along the
diagonal element, we get normal stress, off diagonal elements, for example, u ' v ' ,u ' w ',v ' w'
, these are three off diagonal elements on one side, similarly we have three off diagonal
elements on the other side. And these 3 plus 3 - 6 - off diagonal elements are called shear
stress, so following the convection σ for normal stress, and τ for shear stress, we write in the
form of a symbol for the stress on the right hand side corresponding left hand side, minus
sign is retained and ρ is retained.
Let us put that equation again, but in slightly different form. We know from one of the
beginning lecture that left hand side there are two terms one is for time derivative, other one
is for convection term. The time derivative term represent the local acceleration, convection
term convective acceleration. And if we put them together, that will give total acceleration
and that is what is shown here with capital D symbol ρ
D
( ū ). So, this represents total
Dt i
acceleration written with average quantity. And the right side, we have a pressure gradient
term then there are two terms we know already this μ is viscosity, and μ
380
∂u
will give you the
∂xj
stress and it is contribution from laminar part. So, we write τ ij with a subscript laminar
∂
,
∂x j
and the second part we used again the letter symbol τ for stress, but it is for turbulent flow.
So, we have
∂
( τ ) with a subscript turbulent. So, what it means is the equation looks
∂ x j ij
similar, if we put laminar stress part and turbulent stress part together, there is only addition
of turbulent stress part. And task of turbulence modelling is to model is additional stress term
that is ρ ui ' u j ' .
Now let us look at little more detail. We already mentioned turbulent flow exhibits
fluctuations both in time as well as in space. And it is quite random that means, it is difficult
to predict what the fluctuation will be either in the next instant of time or at the next spatial
location, but what is possible is the statistical way of dealing with that those variations. Now
if you look at this terms that is ui ' u j ' ; ui ' is fluctuation of one variable, and u j ' is a
fluctuation of another variable. We do not know the ui ' itself then it becomes much more
difficult the product of two variations, hence we have to model somehow, and replace the
governing equations accordingly and that process that stage that procedure is called
turbulence modelling.
(Refer Slide Time: 08:06)
I am showing here the same equation in a much detail form without using index notation.
The first set, we have Navier-Stokes equation, this is otherwise Reynolds average Navier-
381
Stroke equation. And we have bottom continuity equations all these terms are already
explained. Now you can definitely appreciate using of index notation to write terms and
finally equation. So, we have three terms for convection, three term for stress, and we have
three equations, all are compressed in one simple expression when use index notation. And
these stresses - additional stresses are known as Reynolds stress, they are also written in
matrix form, and we already mention elements along the diagonal that is u ' 2, v ' 2, w ' 2 there
are all normal stress, and off diagonal elements are shear stress. And we write again that
equation, now you appreciate difference between writing the index notation and in expanded
form of writing equation.
(Refer Slide Time: 09:32)
So, we write here again the Navier-Stoke equation obtain for turbulence flow as shown here.
We will try to get some more explanation, we rewrite this equation in the form as shown
here,
∂ ūi ∂ ū j
−1 ∂
( p̄ ) δ ij , this is the kronecker delta plus μ
+
− ρ ui ' u j ' . We identified the
ρ ∂ xj
∂ x j ∂ xi
(
)
terms as one, two, three inside this bracket. Let us get the explanation of those three terms,
the first term represent mean pressure stress, the second term is because the laminar viscosity
that is the dynamic viscosity μ. So, it is called mean viscous stress tensor, it is mean because
we are using ūi and ū j. The third term is actually Reynolds stress tensor, and this is coming
extra term because of the averaging procedure applied on the convection term. If the modulus
of the Reynolds stress terms that is |ui ' u j '| ρ is much much greater than the laminar stress bar
382
then that actually is the region of turbulent flow. In other words, in fully developed
turbulence at large Re, the role of viscous stress is negligible when compared to the role
played by Reynolds stress.
(Refer Slide Time: 11:18)
Let us tried to understand what is the meaning of closure problem. So, in the original setup,
we have continuity equation - one equation, and Naviers stress equation - three equations.
And in there are four variables that is u, v, w each velocity component and pressure is
additional term. So, there are four variables, and we have four equations; number of
equations is equal to number of variables is satisfied. In equation for turbulent flow, we just
now learned, you have still four basic variables that is three mean velocity and mean
pressure. In addition, we have six Reynolds stress term, but number of equation remains as
four still. Hence, condition that number of variable equal to number of equation is not
satisfied, and this result in well-known problem called closure problem that is we have more
variables in turbulent flow, we have ten variables that is four - primary variables, mean
velocity – three, pressure – one, and six additional stresses. So, we have ten variables,
whereas number of equations available are only four that is three momentum equation and
one continuity equation. Hence we have more variables than number of equations available
and this is what is known as a closure problem.
There is way to solve this closure problem either you can get additional equations for each of
those stresses or suitably replace the unknown variables in terms of known variable, hence
383
number of unknown variables gets reduced. In turbulent flow, it is possible to derive
additional equations for fluctuating quantities, and then find out also the equation for
Reynolds stresses. But every time, you write additional equation, it will only end up in more
unknowns, hence the closure problems remains. The alternative way is to suitably replace
unknown variables, that is the stress ui ' u j ' in terms of known variable. This process that is
replacing the unknown variable by a known variable is called turbulence modelling.
So, in today’s class, we have learned in detail about equations, continuity equation,
momentum equation, how to put them in index form, then how to apply decomposition
principle for each variable, and get continuity equation, momentum equation for turbulent
flow, momentum equation when it is applied to turbulent flow after averaging is perform is
referred as Reynolds average Navier-Stoke equation. We learned while doing this process, it
results in six additional unknown stress quantity, and they are to be replace with a known
quantity and this procedure is called turbulence modelling procedure. In next class, we are
going to talk about different models available until then have fun.
Thank you.
384
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture – 30
(Refer Slide Time: 00:21)
Greetings, welcome, and welcome again to this course. Last two classes, we have talked
about turbulent flows characteristics, then we learned how to derive governing equations
for turbulent flows. In today’s class we will continue that exercise, we try to understand
more about Reynolds stresses how to model Reynolds stresses, and different approaches
available to model these Reynolds stresses. Then we will see whether we can do
something about introducing standard turbulence models.
385
(Refer Slide Time: 01:00)
I rewrite here the governing equation for turbulent flow, which is specially called
Reynolds Average Navier-Stokes equation RANS. We understand terms in the equation;
two terms on the left hand side - time derivative term, convection term; on the right hand
- time and pressure radiant term then the additional term which is appearing, because of
time averaging procedure is ρ ui ' u j ' and this term appears from the convection term.
For the sake of convenience, we move it from the left hand side to the right hand side
and it is grouped along with viscous stress term. You can also check the unit wise
ρ ui ' u j ' , it has the same unit as stress term. In the expanded form that is by substituting
values for index i and j, and following that guide line for index notation, we are able to
write detailed of each terms as shown here. And these terms are additional in a NavierStokes equation and they are referred as Reynolds stress term, we use the symbol either
τ or R ij =− ρ ui ' u j ' .
Now we put only the stress term in the form of the matrix as shown here. So, we learned
that along the diagonal, we have the normal stress term which represented as
σ
and
off diagonal elements we have shear stress term which is represented as τ . Now if we
look at the shear stress term, for example, the first row we have ρ u ' v ' and ρ u ' w ' and
we look at the first column second row, so ρ u ' v ' first column third ρ u ' w ' .
386
So, if you look at first row second column that is ρ u ' v ' ; first column second row
element ρ u ' v ' , they are same. Similarly the other component ρ u ' w ' that is the last
element in the first row, and first column last element ρ u ' w ' they are same. Hence,
originally we have nine unknowns 3 by 3 - nine unknowns, three diagonal elements
stress term and six off diagonal element shear stress term. Among the six off diagonal
elements shear stress term only three appears that they are symmetric with respect to
diagonal. So, those three terms which appears on one side are same as three term that
appear on other side. Hence the total number of unknowns though it appears 9, it is
actually only six that is three along the diagonal and three off diagonal, total we have six
unknown, six additional stress or six Reynolds stresses unknown stresses.
In the standard notation form the same equation can be written using the time derivative
plus local plus convection term put together as the total derivative on the left hand side,
then you have pressure radiant term on the right hand side then we have laminar stress
term and turbulent stress term. As I mentioned in the last class, laminar and turbulent
stress, they are brought in the same way to compare the ordered on the role played by
each term appropriately to apply for turbulence flows. Now the job is to model these
unknown terms, the six additional stress term and procedure to model these six
additional stress term is what is known as the turbulence modeling.
(Refer Slide Time: 05:47)
387
We learned about the closure problem what is the meaning of closure problem. We
revisit that again originally we have continuity equation, and three equations as a NavierStokes equation. So, they are four equation and they are four variables, three velocity
component and one pressure term. The number of equations equal to number of variables
is satisfied. In turbulent flow, we have additionally six stress term whereas number of
equation remains as four, hence we have total ten variables but that number of equation
as four, hence it becomes a closure problem.
There are two ways of solving this closure problem either in somewhere rather you get
additional transport equation or PDE; or suitably replaced unknown variable in terms of
known variable that is what is known as turbulence model. In turbulent flow, if you try
derives additional equation, it is possible for each fluctuating quantity separately, also for
stresses. And if you happened to do then you will notice at the end it only results in
additional unknowns, hence the closure problem remains. In the next few slides, I am
going to explain how this actually will happen. So, the alternative is to replace suitably
unknown variables in terms of known variable, and this procedure is what is known as
the turbulence modeling.
(Refer Slide Time: 07:38)
We use the concept called eddy viscosity concept proposed by Boussinesq. And this
eddy viscosity is something like how viscosity is playing a role in laminar flow. The
turbulence is characterized by an isotropic eddy viscosity in more generic form it is
388
called eddy diffusivity, which helps in enhancing mixing between various constituents of
the flow, and based on dimensional argument eddy viscosity is proportional to density
multiplying by eddy length scale multiplying by eddy velocity scale. So, in a flow, you
have all the three scales length, velocity and time scales, and we know they are related to
each other based on dimensions. So, if any two quantities are known it is possible to find
the third one.
We use same symbol
μ
with the subscript t to represent eddy viscosity. So, eddy
viscosity μt is defined for the turbulent flow, and it plays same role as the fluid
viscosity we already know
μ
and
ν
defined for laminar flow. The kinematic or
dynamic viscosity is fluid dependent that mean you may have a air, you may have water
as a fluid media kinematic or dynamic viscosity is a fluid dependent, whereas the eddy
viscosity is a flow dependent that mean for the same fluid, for example, the water you
are dealing depending on the flow condition it may be varying spatially as well as
temporarily, whereas the dynamic viscosity or kinematic viscosity is fixed for the same
fluid for the same flow problem.
(Refer Slide Time: 09:46)
The starting point for all the turbulence modeling is a Boussinesq eddy viscosity
assumption. It is used to predict properties without having to know any prior knowledge
about turbulent structure. Now let me define some more quantity, what is known as the
turbulent length scale we use letter l, and it has the unit as m-meter, turbulent kinetic
389
energy symbol k which is square of the velocity, so m 2/s2 ; turbulent dissipation rate
ϵ
which is rate of dissipation of energy, so it becomes m 2/s3 then specific dissipation rate
ω , which is 1/s. We also define turbulent eddy viscosity
μt
and it has the same unit as
laminar viscosity kg/ms. Turbulent kinetic energy, dissipation rate and specific
dissipation rate, they are all related to eddy viscosity based on dimensional arguments as
ρk
μ =ρ k2/ϵ
shown here. So, μt = ω or t
.
It is also possible to relate these three coordinate based on again dimensional arguments,
1/ 2
for example, l=k / ω and ϵ = ω k . It is possible to write separate PDE, other words
transport equation for each one this quantity; turbulent kinetic energy, dissipation rate
and specific dissipation rate or length scale. And you solve them, you get respective
variables obtained. Then the turbulent viscosity is calculated based on the relation that
we have just now shown. This is then used to replace the unknown Reynolds stress based
on Boussinesq assumption. So, unknown Reynolds stress term is ui ' u j ' , either we can
use Rij or
μ / ρ is
ν
τij
is related to
μt
if you use
ρ on one side, otherwise it is
μt
and t stands for turbulent flow then we have velocity gradient terms
We already learned
δij
because
−2
k δ ij
3
.
is Kronecker delta and that takes the value of 1, if i equal to j
equal to 0, if i not equal to j. For this was a proposed by Boussinesq, and this is the
starting point foundation point for all the turbulence modeling, depending on how these
relationships are set up, you get different turbulence model.
390
(Refer Slide Time: 13:05)
The turbulence model have been in existence since identification of laminar flow and
turbulent flow in a flow region, there has been development on the modeling side, there
have been many attempts on improving the models are approached to solve the turbulent
flow itself. So, overall the turbulence modeling is classified as RANS approach, where
we solve time averaged Navier-Stokes equations. All turbulent length scales are modeled
in the RANS and we have depending on how these quantities are variables are related,
how this quantities mean you have turbulent kinetic energy, specific dissipation rate,
dissipation rate, length scale. The equation for length scale depending on how this are
related, we get different turbulent model. And this is one of the successful or most
widely used approach for calculating industrial turbulent flows.
We also have under this different classification what is known as the algebraic model or
zero equation model, one equation model, two equation model, and second order closure
model. So, this zero equation, one equation, and two equations represent number of
additional PDE you used to solve or to represent the turbulent flow second approach is
what is known as the direct numerical simulation. As the name indicates you obtain
solution without following any modeling strategy. So, theoretically all turbulent that is
laminar and transition flows can be simulated by numerically solving the full NavierStokes equation as I mentioned before the structure of the turbulent flow equation is a
same as the original Navier-Stokes equation. If you interrupted the variable as
instantaneous then it is for turbulent flow, otherwise it is for laminar flow.
391
So, it is possible to use the same equation even for turbulent flow, and it to solve or if
you resolve all the scales corresponding to velocity, length and time then you get what is
known as the direct numerical simulation approach. So, it resolves whole spectrum of
scales, absolutely no modeling is required; and other hand, though it looks very good.
There is a great disadvantage the cost is exhaustibly prohibitive it is very high, because
in order to resolve all the scales, you need to have mesh resolution as well as
δt
is very
fine enough that is very expensive and it is tried only as a academic level not attempted
for any industrial flows problem.
(Refer Slide Time: 16:27)
The other approach is what is known as the large eddy simulation in short form it is
called LES. It solves spatially averaged Naviers-Stokes equation where large eddies are
directly resolved, but small eddies smaller than the mesh that is used are modeled. It is
less expensive compared to DNS, but slightly more compare to RANS. The amount of
computational resources and efforts are still too large in recent there are attempt to use
LES for industrial problems as well there is alternative approach what is known as the
hybrid approach were we can combine RANS and LES appropriately. So, depending on
how they are combine you get a solution and this is called hybrid approach some
literature, they will call with special name what is known as the detached eddy
simulation, otherwise DES. We have three approaches RANS, LES and DNS and in
between there is a strategy hybrid approach.
392
(Refer Slide Time: 17:45)
Now go into the equation once again, I am displaying here the RANS equation, time
averaged Navier-Stokes equation, and we know this stress term and we identify normal
stress as well as shear stress. We also identify off diagonal elements shear stress or
symmetric with respect to the diagonal. Hence, total number of unknowns coming
through Reynolds stress is only six - 3 diagonal normal stress term and 3 off diagonal
shear stress term. In the conventional form, it is written with the time with material
derivative or total derivative on the left hand side; on the right hand side, we have
pressure derivative term, the second term based on laminar viscosity is written as the
laminar stress, and third term based on turbulent stress is written as here as turbulent
stress.
393
(Refer Slide Time: 18:51)
Now, the question is whether it is possible to get equation for stresses, because we
mention the closure problem that we have ten unknowns, now we have only 4 equations.
The two approaches either we get additional transport equation for those additional
stresses or new unknowns or replaced the unknowns by a known. In the first approach,
that is trying to derive equation for additional unknowns. We will end up getting more
unknowns, we are going to derive equation for those unknown, and at the end we will
observe that you get only more unknowns rather than closing the problems. So, this is the
equation that it is obtained for fluctuation. In this equation we use i and k, and these are
obtained very systematically following all the arithmetic that is we have a instantaneous
decompose into summation of mean and fluctuation. You apply this decomposition then
you get equation for fluctuations.
Now this is the representation, in the sense, the index notation i is very generic. So, you
can replace the index i by j and get the equation for another fluctuation. In other words,
we have one equation for one fluctuation, we have another equation for the second
fluctuation. So, if you multiply the above equation by and uj ' the second equation that
the ui ' then take the average. So, for each term that operation is performed each term
we multiply by uj ' in this then similarly in this each term is multiply by ui ' then you
do average then you get finally, an expression as shown here. It is purely arithmetic and
it is possible to obtain the final expression as shown here.
394
Now if you look at this expression, this expression, the term variable term is actually
ui ' u j ' that is a variable in this equation. Hence our desire the starting desire is to get
additional PDE for this unknown is obtained. However, when you look at this equation
in close, you will observe that you are getting a new term, the third order correlation
term ui ' u j ' uk ' .
(Refer Slide Time: 21:56)
So, this ui ' u j ' uk ' is a new unknown and you can identify by substituting value for i, j
and k we get so many unknowns, actually you get 27 new unknowns. Now we
understand the closure problem can never been achieved. So, there is alternative way that
we have to plan that is what we going to see in turbulence modeling. So, in this equation,
again we follow one step in the tensor algebra what is known as the contraction. The
contraction is nothing, but taking a trace or taking the isotropic part. So, if you substitute
i is equal to j then you will get all diagonal elements in the Reynolds stress tensor. So,
we get one equation for each normal stress term.
For example, if you substitute i equal to 1, and j equal to 1, it becomes first normal
stress; i is equal to 2, j is equal to 2, we get second normal stress; i is equal to 3, j equal
to 3, we get third normal stress. And you follow that for all the terms then you get
equation for each normal stress. And in trace procedure, the contraction because the
indexes is repeating, you do summation and that is written here k which is the symbol
395
used for denoting turbulent kinetic energy is τii /2 , and τ ii is nothing but normal stress
because we are doing trace into summation u¯1 ' 2 + u¯2 ' 2 + u¯3 ' 2 . And we follow this then on
this equation that is the transport equation for Reynolds stress, if you apply, the trace
procedure for each term and then after following some step, you get finally a equation
for turbulent kinetic energy.
So, in this equation k is the variable, and you get equation for turbulent kinetic energy.
Now in this equation again we have multiple terms; first term is an unsteady term,
second term is a convection term, third term which is the first term on the right hand side
is the production term, fourth term is a dissipation term. And there are three sub terms in
for a fifth term, the first term for the fifth term is a molecular diffusion term, second term
for the fifth term is the turbulent diffusion term, and the third term for the fifth term is
the pressure diffusion term. Let me give some more explanation the second term on the
left hand side is the convection term, this has u j as the convection velocity and
∂k
∂ xj
is
the variable and its corresponding spatial derivative.
Now, when you look at this term and again try to compare convection term in the
momentum equation. Convection term in the momentum equation is non-linear whereas
is straightly, this is linear. Now first term on the right hand side, which is marked here as
a third term this what is called production term
τij
.
τij
is a Reynolds stress term and
∂ ui
∂ x j is the mean velocity gradient, and this is the product of Reynolds stress with the
mean velocity gradient that will give you what is known as the production of turbulent
kinetic energy.
Then fifth term, there are three terms; first term is because of the molecular viscosity,
hence it is called molecular diffusion term. The second term we have turbulent
quantities, turbulent fluctuation quantity, and we can interpret this
uj ' one quantity
uj ' is a agent responsible for transporting this turbulence stress. We know ui ' u j ' is a
turbulent stress, and you have the additional term uj ' . So, we can interpret this term as a
turbulent diffusion term, and third term is the pressure diffusion term. Now the question
396
is all are supposed to be known expect for second term as well as third term and
dissipation term.
So, in today’s class, we have learned the first stage in the turbulence modeling, starting
from transport equation for each Reynolds stress term, and how to get the trace of it to
obtain what is known as the transport equation for turbulent kinetic energy. In the next
class, we will start from here and do actual modeling for those additional terms in the
transport question for the turbulent kinetic energy. And we go into standard k − ϵ and
k −ω
model expression and explanation.
Thank you.
397
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture – 31
(Refer Slide Time: 00:20)
Greetings and welcome again to this course on CFD. Last three classes, what we had seen
introduction to turbulence flows, we try to derive governing equation for turbulence flows,
try to understand the term Reynolds stresses. Reynolds stresses has two main component one
is normal stresses another one is shear stress; totally there are six unknown stresses. Then we
also learned few other new terms like turbulent kinetic energy, dissipation rate, specific
dissipation rate, eddy viscosity, Boussinesq eddy viscosity concept. In today’s class, we will
continued that try to understand something about how to model or what are the models
available to close the system of equation; particularly we will focus on what is known as the
standard turbulence model.
398
(Refer Slide Time: 01:14)
Just to recall what we did in last few classes, we defined a term called turbulent kinetic
energy use a symbol k, dissipation rate ϵ , specific dissipation rate ω and they are all related to
eddy viscosity on the basics of dimensional argument as shown here μt as eddy viscosity, t is
a subscript used to denote it is for turbulent flow equal to ρ k /ω or μt =ρ k 2 /ϵ and k ϵ on ω
are related to each other as ϵ=k ω. And you can check with the units on each side whether
they are matching. We can setup transport equation which are again basically partial
differential equation separately for each of this quantity turbulent kinetic energy, turbulent
dissipation rate, specific dissipation rate.
If you are setup that equation and you are solve that equation then respective variables will be
obtain after solving those equations. Then turbulent eddy viscosity is calculated using this
relation and it is used to close or to model Reynolds stresses based on what is known as the
Boussinesq assumption. The Boussinesq assumption is shown in the form of expression here.
We learned that ui ' u j ' is a Reynolds stresses, ui ' is fluctuation is one direction, and ui '
fluctuation in another direction is equal to τ ij or in some sense you can use Rij =μt
is a velocity gradient and
velocity
∂ ui
, which
∂ xj
∂ uj
which is also velocity gradient. And this is based on mean
∂x j
−2
k δ ij; δ ij is a Kronecker delta we learned. When is i equal to j it will have value 1,
3
399
and i not equal to j, it will have value zero.
Now if you look at this equation ν t is related to either k and ω or k and ϵ as shown here, and
the product in the velocity strain is actually based on mean velocity. So, we solve Navier¯ we solve k equation or
Stokes equation, average Navier-Stokes equation, we will obtain u ❑
ϵ or ω equation, we get respective quantity then that is replace that is the turbulent stress is
replaced using this relationship. One additional information as I mentioned last class, we
need to have out of the three minimum two quantities to be known. What are those three
quantities, velocity scale, length scale and time scale.
If any two is known, then third can be related, so these equation that is equation for turbulent
kinetic energy, dissipation rate and specific dissipation rate, they are suppose to give
information when it is solve information about velocity scale, length scale and time scale. For
example, k equation when it is solved, it will give information about velocity scale. If you
take square root of k, which is a basically meter per second that is actually velocity. So when
you solve k equation, it will give velocity scale; when you solve ϵ equation, it will give
length scale; and when you solve ω equation, it will give the time scale that is how this
ϵ =k ω relationship is obtained. So, any two should be obtained to close a system.
(Refer Slide Time: 05:29)
We will go back and look at the equation once again. We again insist on knowing the index
notation. So, Navier-Stokes equation is shown here, first term on the left hand side is a time
derivative term, second term is convection term equal to pressure gradient term plus viscous
400
diffusion term. So, i will take a value of 1, 2, 3; for every value of i, you get one equation.
For example, if you substitute i is equal to 1, then you will get u momentum equation or x
momentum equation. If you substitute i is equal to 2, you will get second momentum
equation; and i is equal to 3, and you will get third momentum equation. We also mention if
the index is repeating then it is a summation. So, second term index j is repeating, and for
every value of j, you will get one unique quantity and each one of them are summed up
finally. And we also learned that if the index is repeating that index is called dummy index if
the index is not repeating, it is called free index. So, the free index here is i the dummy index
actually j.
Now we apply the decomposition; decomposition is u, for example, can be decomposed into
ū+u ', where u is a instantaneous quantity, ū is a mean and u ' is a fluctuation. So, you
substitute the decomposition for each variable in this term. So, first term for example, ui is
written as ū+u '. Similarly u j and ui and pressure and another terms. So, each term is written
with the decomposition for the respective variables. Now the first equation as I have been
telling before is a Navier-Stokes equation, but in the case of turbulent flow context it is
interpreted as instantaneous velocity component used in the Navier-Stokes equation. So, this
is after decomposition applied.
And in this equation, it is easy to write after doing the time averaging for each term, in the
case of convection term it requires a special treatment. Now if you subtract this mean
equation from the instantaneous equation, then you apply averaging then it will result what is
known as the equation for the fluctuating quantity. Now how this is arrived what it be say we
said u instantaneous quantity is decomposed and return in the form of ū+u ' mean and
fluctuation. So, if you want fluctuation, you subtract mean from the instantaneous. So, u − ū
will give you u '. The same is used for the entire equation as such, so the first equation is a
instantaneous Navier-Stokes equation and the second equation is a Navier-Stokes equation
with decomposition applied, and you are subtract one from the other then you get equation
for fluctuation quantity and that is written as you shown here.
Now if you look at this equation again very closely, you have i and you have j, j is a index
that is repeating which is called dummy index; and i is a unique index that is the free index.
So, this equation is written for one fluctuating quantity for every value of i, i is equal to 1,
you get one fluctuating; i is equal to 2, you get another fluctuating quantity. So, you can write
this equation with other with index change, but still the basic information is that it is for the
401
fluctuating quantity.
(Refer Slide Time: 09:34)
So, we write that equation with the index change for j which is a dummy index and i is the
free index is maintain now we can rewrite the equation with some other index because of the
meaning the index is it is value 1, 2, 3 except that the repeat index it be maintain. So, in this
case for example, this is the original equation we obtain and rewrite this equation again with i
replace with j and k is retained that is a repeat index write you can observe that for all the
term i is replace with j and k is retained that is repeat in the index is maintain. It means it is a
equation for fluctuating quantity, but the other quantity u j the first equation is equation for
fluctuating quantity ui ' the second equation is a equation for fluctuating quantity for u j ' .
Now what do we do, we multiply the first equation by u j, second equation by ui , if sum them
up then take average. So, multiply the first equation by u j ' and the second equation by ui '
then take average why did we have to do Reynolds stresses, and the Reynolds stresses is
actually ui ' u j ' we have ui ' here first term for example, in the first equation ui ' . And if i
multiply the equation by u j ' then I get equation for ui ' u j ' ; similarly the second equation u j ' is
there. I want ui ' u j ' , so I multiply that equation by ui ' . So, you do this operation that is first
equation is multiplied by u j ' second equation is multiplied by ui ' then take average that will
result in a equation as shown here all the mathematics is done and then final expression is
shown here.
402
So, in these equation for example, the variable is ui ' u j ' . ui ' u j ' is actually Reynolds stresses
in other word we are able to obtain the transport equation or PDE equation or governing
equation for Reynolds stresses. So, it is possible to obtain equation for fluctuation as shown
here and equation for Reynolds stresses as shown here if can recall equation for mean
momentum equation that we had we had a new term ui ' u j ' appearing and we define that the
Reynolds stresses term and we want to close the Reynolds stresses term and we want for that
we started deriving equation. And you observe here, it will result in additional unknowns
rather than closing these systems. This equation will result in additional term that is used in
ui ' u j ' multiplying with another term uk ' for each variables we get one term totally it will
result in twenty seven terms, hence system is never close and there are many other new
unknowns.
For example, look at this term pressure term here it is ui '
∂ p'
. So, this ui ' itself we do not
∂ xj
know and there is p ' is a fluctuation derivative of the p ' multiplying by ui ' we have no idea
how to replace this term, that is why it is difficult in the case of turbulent modelling.
(Refer Slide Time: 13:23)
Nevertheless, deriving this equation is very helpful we are going to see that. So, the same
equation is written once again here. Now what we have do there is a procedure is called
taking the trace another word contraction or taking the isotropic part. Let us see the isotropic
part will learn that the Reynolds stresses term ui ' u j ' is actually a matrix second order tensor
403
along the diagonal of the matrix you have the normal stresses off the diagonal you have the
sure stresses. For example, , u1 ' 2 u2 ' 2, u3 ' 2, these all are normal stresses and off diagonal
u1 ' u2 ' , u1 ' u3 ' this is a shear stresses. So, when you say trace contraction for a second order
tensor then you only consider isotropic part or along the diagonal. So, in these equation, if
you substitute same value for the index i as well as j, so i is equal to 1, j is equal to 1, i is
equal to 2, j is equal to 2, i is equal to 3, j is equal to 3, then i will get 3 equation
corresponding to three normal stresses.
Now sum them together that you give you the turbulent kinetic energy k is in the form of
expression it is shown here τ ii . So, we wrote τ ij for Reynolds stresses. Now we have same
value for the index i as well as j. So, it is written τ ii /2 and what is τ ii is a normal stresses. So,
2
2
2
u1 ' +u2 ' +u3 ' now this is what is known as the turbulent kinetic energy or tke. So, if I
replace if I reduce this equation using the trace or isotropic part or contraction then I will get
a equation for turbulent kinetic energy that is the idea that is what happen it is shown here
this is a transport equation for turbulent kinetic energy.
Again we try to understand each term first term is a time derivative term second term is a
convection term these two term are in left side on the right side we have first term what is
known as the production term fourth term is a dissipation term and there are three terms in
the fifth term first term in the fifth term it is actually diffusion, but the diffusion is by
molecular viscosity μ second term is also a diffusion, but it is u ' this case u j ' . So, it is called
turbulent diffusion and third term is also diffusion, but that is by pressure. So, you have first
term in the fifth term as a first molecular diffusion or viscous diffusion second term is
turbulent diffusion and third term is pressure diffusion. Now in this equation, if you look at
we have replace second term and third term, and try to combine along with the first term
using the defined quantity for k − ϵ or using the Boussinesq eddy viscosity concept and that is
the modelling here done on this.
404
(Refer Slide Time: 17:04)
Now we will look at the details. So, turbulent transport first that is turbulent transport is the
second term and the fifth term that is the term I am showing here. So, u prime is a Reynolds
stresses and that is transported using the third quantity u j ' that is the way interpreted I repeat
again ui ' u j ' is a variable of this equation. For example, for Reynolds stresses and the agent
that is responsible for transporting the term is u j ' that is why it is refer has a turbulent
diffusion term in very generic form, we write that is a ϕ that Reynolds system you can
interrupted has ϕas a u j ' is our quantity. Now this if you say diffusion happens because the
gradient that is a general concept.
So, in this case what is the term that is getting diffuse that is a ϕ. So, ϕ can get diffuse only if
there is gradient in the ϕ. So, μt is a turbulent viscosity and
∂ϕ
is a diffusion gradient that is
∂x j
available diffusion to happen now the pressure diffusion term that is p ' u j ' and turbulent
diffusion term they are put together and they are written as
this
μt ∂ k
into the minus sign. Now
σk ∂ x j
∂k
is again, it is a gradient kinetic energy because this is the equation for kinetic energy.
∂x j
If you solve the variable, you will come to know this only k, hence we use gradient of k as a
known these two unknown or replace with the quantity that is known that quantity that will
405
becomes to known when you solve this equation with k itself. Hence we write
∂k
. Now
∂x j
k 3 /2
dissipation term ϵ is a model based on dimensional argument as seem you
. So, finally,
l
we get the model turbulent kinetic energy equation as shown here and we have Boussinesq
eddy viscosity concept to close to replace the Reynolds stresses as shown here.
(Refer Slide Time: 19:39)
So, we have mainly two basics turbulent model that is what is known as the standard k − ϵ
model and standard k − ω model. Standard k − ϵ model was proposed by Launder and
Spalding in 1972. In this the basic equation are equation for turbulent kinetic energy k, and
ρ k2
μ
ϵ
k,
ϵ
equation for dissipation rate and t , turbulent viscosity is related to
as shown here
.
ϵ
In the previous slide, I showed how to model equation or how to model terms in the equation
for turbulent kinetic energy and that is written once again here. There is a similar procedure
available derive equation for ϵ and model them, we are not going to do those detail. We take
the final expression and that is what is show here it has five constant as shown here c ϵ 1, c ϵ 2,
c μ, σ k, σ ϵ . So, equation for turbulent kinetic energy, dissipation rate along with five constants
with this relation for μt is called standard k − ϵ model.
406
(Refer Slide Time: 21:09)
We are going to see another standard model, standard k − ω model; μt is related as shown
here
ρk
; equation for k and equation for ω are shown here. It has again different sets of
ω
constant and so on. It is not possible to go through details of the derivation. The intention
here to introduce turbulence model equation and I am showing here standard k − ω model
equation. So, many commercial software, this is an equation that is solved when you choose
option k − ω model. Now these are constant and these are functions which are again tested
and derived for standard benchmark flows.
(Refer Slide Time: 22:01)
407
To conclude these equations along with the constants given are referred as a standard
turbulence model. They are also referred as high Reynolds number or high Re model. We
have to be carefully about the word high Re, when you say Re, here it is refers to local
Reynolds number. Again I go back to the first definition, Reynolds number is related to
velocity scale and length scale. So, depending on the choice of the velocity scale, length scale
you get different Reynolds number you can for a example flow through a circular cross
section pipe, you can take a mean velocity as a velocity scale or the center velocity as a
velocity scale. Similarly, diameter can be the length scale. If you take some other cross
section it be the hydraulic dimension can be a length scale. So, depending on the definition of
velocity scale and length scale, you get different Reynolds number.
Now in turbulent flow, it is also possible to define Reynolds number based on k as well as ϵ .
As I mentioned before k when you solve it gives a velocity scale; and ϵ when you solve, it
gives a length scale. So, you can define Reynolds number based on k and k − ϵ; similarly, it is
also possible to define Reynolds number based on k and ω and this high Re refers Reynolds
number define based on local velocity and local length scale. So, constant used in these
equation are obtained based on experimental data on some standard canonical problems. So,
in fluid mechanics, we have canonical problems, they are jet, wake, mixing layer and
boundary layer and standard some benchmark problems. So, we have experiment data and
these constants are obtained, so that these experimental data can be reproduced. It is also to
be noted that turbulent kinetic energy, dissipations rate, specific dissipation rate are related to
each other in terms of ϵ=ω k. The reason why I am saying here is again, we have equation
for ϵ , we have equation for ω, we have equation for kinetic energy. Let us see the kinetic
equations as a side and it is possible to obtain equation for ω from ϵ or it is possible to obtain
equation for one quantity from the another quantity.
408
(Refer Slide Time: 24:42)
Now, we look at different variants of standard models the standard k − ϵ and k − ω model are
develop very early 1970 or 80 with very assumptions and limitations their strength as well as
shortcomings are well documented in the literature many attempts have been made to develop
different variants of these two equations models to improve performance different proposal I
am listing here they are for example, k − ϵ, RNG based model, k − ϵ based relaizable model,
improved k − ω model, SST k − ω model algebraic stress model otherwise called ASM
Reynolds stress model otherwise called RSM low Re models and non-linear models it is not
possible for go through details of all these different proposal also the equations what i am to
do just descript in different in the explanations for some models and in the next class we are
going to see some details about low Re models.
409
(Refer Slide Time: 26:00)
So, RNG based k − ϵ model, it is similar n form of the standard k − ϵ equations, but include in
following that is additional is introduce the ϵ equation for interaction between turbulent
dissipation and means shear then that is accounts for what is known as a swirl on turbulence
where it is gets swirl for example, in compression we have a methodology called swirl
compression and that has a influence on turbulent and that is predicted better based on RNG
k − ϵmodel analytical formula of turbulent Prandtl number was introduced and then the
differential formula for effective viscosity. So, as we mentioned that
ω
μt
related to k and
it is also possible to get different expression and that is what is used in RNG k − ϵ
model and next set reliable k − ϵ model here again k equations almost same that we have a
improved equation for ϵ and then c μ who was one constant we mention there are five constant
in standard k − ϵ equation and c μ was one of the constant it has the value of 0.09.
So, in realisable ϵ model instead of constant value for c μ c μ express as a function of some
variables it may be velocity gradient it may be k or it may be ϵ for different proposal on
realisable k − ϵ model we have a different expression for c μ next is SST k − ω model; SST
stands for shear stress transport, k − ω model. As I mentioned before ϵ , ω, k are interrelated
as ϵ =ω k. We have a separately transport equation for k, separated transport equation for ω,
it is possible to derive one from the other or it is possible to combine together them together
switch within code itself depending on a region in the flow from
equation.
410
ϵ
equation to
ω
I repeat, it is possible to switch from one equation to another equation within the flow based
on some flow region condition from one equation to another equation by having one equation
by having one transport equation combining both ϵ and ω, and that what is approach in SST
k − ω model. As i mentioned here also listed k − ϵ and k − ω models that combine and
switching from one model from another model is by a function and this model happens to be
very successful for many engineering application.
So, in today’s class, we went through basics of modelling once again. We did few steps
related to deriving transport equation for turbulent fluctuation then transport equation for
Reynolds stresses. We learned that while deriving it only results in more unknown rather than
closing the system of equation. However, the exercise of deriving equation for Reynolds
stresses helped us that was the starting point for deriving equation for turbulent kinetic
energy. Equation for turbulent kinetic energy is obtained by doing a procedure called trays or
contraction on the equation for Reynolds stresses. A similar procedure is followed for
equation for
ϵ , and we learned two important basic turbulence model standard k − ϵ and
standard k − ω model. We also listed few proposals available in the literature as an alternative
improvement for the performance on these two models. We learned only the description
about these proposals. In next class, we are going to some detail about low Re models. And
with this, I close today’s class.
Thank you very much and see you again in next class.
411
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture - 32
(Refer Slide Time: 00:21)
Greetings and welcome again to this course on CFD. Last class, we had seen deriving
governing equations, Reynolds stresses, modelling strategy. In particular, we came to know
about standard models, standard k − ϵ and standard k − ω model. We also listed different
proposal available in the literature in standard k − ϵ and standard k − ω model to improve the
performances one such proposal was low Re model, and today's class in particular going to
see about low Re model.
(Refer Slide Time: 00:54)
412
Before going to the detail, I would like to present what is known as the boundary layer and
what is shown here is a flat plate, flow is coming from left to right with the uniform velocity
condition U U ∞ , and this is the leading edge, flow develops over the flat plate, initially you
have a flow in laminar then there is a transition point then you have turbulent boundary layer.
The turbulent boundary layer has three main region one is viscous sub layer as marked here
then buffer layer then log layer and boundary layer thickness is given by a symbol δ and
boundary layer is defined as velocity which is equivalent to 99% of free stream velocity or
incoming velocity 0.99 of U. So, boundary layer is thin region, and near the surface in which
velocity changes from zero at the surface as show here to the free stream value as shown
here. So, this may be either laminar bound layer or turbulent boundary layer depending on
Reynolds number.
Now in this case, Reynolds number we use velocity as a incoming velocity and the length
scale is the distance from the leading edge; obviously, if you are very close to leading edge,
the Reynolds number is small; and if you go very far, the Reynolds number is high, the flow
actually becomes turbulent. We have seen now flow past a flat plate the different regions that
is laminar, transition and turbulent region. In the turbulent region, we have further sub details,
we have three the different layers viscous sub layer, buffer layer and then log layer. So in the
next slide, I am going to explain in detail about these three different regions in a turbulent
boundary layer.
(Refer Slide Time: 03:06)
413
Before going to the details, we should first know what is the scaling; scaling the variables
near the wall. We have length scale and then velocity scale. In the velocity scale, we have
shear velocity u τ define, u and τ is friction or shear velocity and that is used to scale velocity.
And distance from the wall is give as y and ν is molecular viscosity. So, we define nondimensionalized velocity ū that is a mean velocity and because it is non-dimensionalized we
+
use superscript plus. So, ū equal to ū by the velocity scale that is used to non-
dimensionalized that is u τ;
ū
+
is actually ū .
uτ
Similarly, you can also non-dimensionalized the distance, so if you non-dimensionalized the
+
distance, it is becomes y . It is a non-dimensionalized wall normal distance. So, actual
distance is y, we use u τ as a velocity scale and ν is molecular viscosity. So, if we put them
+
together, you get non-dimensionalized wall normal distance which is written as y . So, in
this plot, we have horizontal axis, which is given logarithmic scale; and vertical axis, which is
define the usual linear scale. So this plot is a semi log plot; on one side, we have a linear scale
and other side you have a logarithmic scale. We have multiple curves with the different
colour. We will explain each one of this very carefully.
The first one is you have dash line, which is shown in the green colour; and you have actual
profile running as shown in blue colour. This blue colour is actual velocity profile then we
have one green colour curve which is superimposing over the actual profile for some distance
+
+
from the wall all the way up to some value of y . So, when you say y is plotted on the x
axis, so this becomes wall that is
y + equal to zero; and this green colour is empirical
414
+
+
relationship and that is given by the relationship as ū = y . So, this green colour line is the
empirical relationship and that is a linear relationship, because we are using semi log plot, it
appears as a curve. Then the next zone is buffer zone, we will not talk about it right now, we
have the log region, third zone is a log region and the expression for the log region is given
1
+
+
here that is ū = log y + B ; κ is a constant which is given a value 0.41 and B is another
κ
constant which is given a value 5.5.
And this expression, as you can observe is the semi log expression, because on one side, we
have a straight value; on the other side, we have a logarithm expression. And on this semi log
plot, this kind of expression will appear like a straight line and that is what is this region,
which is marked as a red colour. So, this red colour straight line that is appearing it actually
representation this logarithmic expression. So, the actual profile which is blue colour is partly
+
coinciding with the red colour for some part of y , you can observe here it is coinciding with
+
+
the red colour from this value of y to this value of y . So, then actual your profile deviates
from that expression now between this linear region, where the actual velocity profile
coincides with the green colour line, so that is a linear region. The another region is a log
region that is somewhere here in between you have the region that is what is known as a
buffer region.
So, we have three region, starting from the wall linear region, it is otherwise called viscous
sub layer region; buffer region which is in between then we have a log region where we have
a semi log of expression relating velocity and wall normal distance as shown here. After
some point of y plus, it is deviating from the logarithmic expression, so this plot is very, very
special because we are using non-dimensionalized velocity and non-dimensionalized wall
normal distance. It is special, because it is universal whatever the type of flow because we are
non-normalizing with respect to shear velocity
uτ
with respect to viscosity, this plot
becomes universal and that is the speciality of this plot.
Scaling the non-dimensional velocity and non-dimensional distance from the wall will result
in a predictable boundary layer profile for wide range of flow, because we are using respect
u τ and respect to ν, and you already learn it is possible to split the actual velocity profile into
three zones linear velocity profile or viscous sub layer region, buffer layer, logarithmic layer.
And there is a specific expression available for two zones and for outside log layer, it is
possible to predict velocity profile near the wall. Since the near wall conditions are often
415
predictable, functions can be used to determine near wall profiles, and these functions are
called wall functions. For wall functions are used to bridge the gap between wall and the first
nodal point. We are going to see in the next slide some detail about it. Important point from
this plot is universal which means it is applicable for wide range of flows, because for
different flows you get different ū and u τ, but you can non-dimensionalized, and they all fall
in the same plot.
(Refer Slide Time: 10:33)
y + is a non-dimensionalized distance from the wall as we said before and it is used to
measure the distance from the first node away from the wall; not necessarily, it is used for
other point as well. Now here is the description the shaded position is the wall and these are
all mesh horizontal lines, horizontal thick lines, and vertical thick lines are supposed with the
mesh and here is the boundary layer profile. And if you have the first node that is shown here
is a yellow circle that the first node for example, in your computation from the wall then that
+
+
+
is give y of the first node. Wall functions are only valid within specific y values, if y is
too high that is it happen to have first point somewhere here instead of here or if you have if
you happened on the first point little far away from this point, or it is very far from the wall.
Then the first computational node is near edge of the boundary layer and wall function will
be imposed too far in the domain; near wall physics is not captured, predicted or not
+
accounted properly. If y value is too low that very close to wall, then the first computational
node will lie in the laminar or viscous part of the boundary layer where wall functions are not
416
valid. Now, at this point again left reminder equation we derived mean momentum equation,
in the mean momentum equation, we had three terms on the right hand side first term for the
pressure, second term for the laminar stress and the third term of the turbulent stress.
+
Depending on the contribution of the laminar stress and turbulent stress then y will have the
+
influence. If y is very close to the wall, then we have a laminar viscosity playing role there
+
wall function is not suitable; if y is very far, you are actually outside the boundary layer
there also will not have any influence.
(Refer Slide Time: 12:55)
Fewer nodes are needed normal to the wall when all functions are used. So, you can use for
points define as shown here very close. And you can relate physics at this point with the wall
or the region between first point on the wall, the physics associated the region is represented
by what is known as a wall function. If you happen have a luxury of very fine mess near wall
as shown here, then wall function cannot be used because you are able to integrate all through
the wall layer up to the point on the wall.
(Refer Slide Time: 13:40)
417
So the prediction of near wall phenomenon, for example, you are interested in skin friction
coefficient or any wall normal velocity gradient, Nusselt number depends on mesh resolution
near the wall. So, very near wall local Re is very low and again the laminar stress referred to
the Reynolds average Navier-Stokes equation, we have terms corresponding to laminar stress
and terms corresponding to turbulent stress. So, laminar stress plays role higher then
turbulent stress. If the mesh near wall, the near wall mesh is fine enough then wall function
approach is not valid as shown in the figure in the previous slide. You have alternative one
you can go for two layer approach, other one you can go for low Re models. So, in the two
layer modelling approach, region very close to the near wall is solved separately either
empirically or by following one equation model or any other relationship. And away from
that region at some specific wall normal distance, you can use any one of the standard models
or their variants. If you are very near and there local Re is very low then damping function is
introduced which damps the turbulent viscosity depending on wall normal distance.
(Refer Slide Time: 15:25)
418
I am showing here list of low Re-two equation model available are proposed in the literature.
For every category, for example, k − ϵ model, k − ω model, we have list of proposal. I am
going to show only a general format of the low Re model and then one or two variance of the
low Re model.
(Refer Slide Time: 15:47)
So, general format we have here again for k − ϵ type turbulent models the equation for k and
we have equation for ϵ , the difference you will notice particularly ν t, ν t is the standard
cμ k2
turbulent models is
can be introduce a dumping function called f μ. f μ is a function
ϵ
419
which damps the turbulent viscosity very near the wall; in other words laminar viscosity we
start playing a dominant role. In this expression, we have different definition of the Reynolds
+
+
+
number ℜ t , R y and y , y is one; y we defined as wall normal distance
uτ y
ν
, it also
Reynolds number as I mentioned before.
Similarly R y is also a Reynolds number, if you look at the expression
√ k y , k we know it is
ν
the turbulent kinetic energy the unit is m 2/s2 . If we take a square root that will give you
velocity scale, so velocity scale distance divided by ν is actually Reynolds number. Similarly,
you can define another Reynolds number, so this is called turbulent Reynolds number getting
a Reynolds number based on k and ϵ , and this is based on absolute distance and other one
based on wall normal normalized distance.
(Refer Slide Time: 17:30)
So, different proposal that listed in the table the difference here is only the way function are
expressed and how different constant are obtained. So, Jones and Launder is one such
proposal some around 1972, an expression for this is available.
(Refer Slide Time: 17:48)
420
Similarly, another proposal Launder and Sharma again expression for functions and different
quantities are available here along with the prescribed boundary condition. These are all well
documented in the literature available in all standard books and it is difficult to go through all
the derivation in detail in this class.
(Refer Slide Time: 18:12)
+
Another important aspect is whether we can have some idea of y before starting the
+
calculation. We mention y is a factor where you decide whether you want to have a wall
function or you want to have a two layer approach or whether you can go for low Re model.
+
So, it is; obviously, beneficial if you know some idea about y before starting a solution and
that saves lot of time. Some empirical formula is available for example, what is listed here is
421
a flow over a flat plate
Δy
is the first normal distance from the wall. So,
+
Δ y =L y + √ 74 ℜ L−13 /14 . Now this will decide if you fix you are y for example, you want to
+
have first y value as 5, then using this expression you can get Δ y and Δ y is the distance on
the wall of the first node.
(Refer Slide Time: 19:26)
Just like we have boundary conditions for primary variable u, v, w and pressure, turbulence
equations k and ϵ also required boundary conditions. And several option exist for
specification of turbulence quantities preferable mostly at inlet, and you follows similar
expression at other locations; unless turbulence is being directly stimulated that is there is a
class of turbulence simulation called direct numerical simulation ,where there is no modelling
approach, Navier-Stokes equation and continuity question is solved as they are available. The
interpretation of the variable is each one of them represents instantaneous quantity. If you
happen to use the instantaneous Navier-Stokes and continuity equation as they are then you
are actually doing direct numerical simulation, you have only three or four variables, three
velocity component and one pressure component. We prescribed boundary condition for them
and there is no need for knowing about the boundary condition for k and ϵ .
There is another point what is known as intensity turbulent intensity and that is shown here.
Intensity is I,
urms
, where urms = √u1 ' 2 +u2 ' 2 +u3 ' 2 you take a square root, they will give the
ū
intensity. So, intensity normally is given either in experiment or appropriate condition. If it is
422
not given that one can take the value between three percent to five percent. In addition to
intensity, on also need to specify a lens scale, and from both you can get kinetic energy
estimate at the inlet. And results are very sensitive to the specification of this k, ϵ , ω at these
boundary condition location.
(Refer Slide Time: 21:56)
So, in this week, we had seen important topic introduction to turbulent flows, deriving
governing equation for turbulent flows, what is known as the Reynolds stress and how to
close Reynolds stress terms appearing in the mean momentum equation. Introduction to
standard models, different variants of the standard models and explanation associated with
them. We also learned little bit about what is known as low Re model and then some
information about boundary condition. With this, I close class for this week.
Thank you very much, we will see you next week until then have fun.
423
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture - 33
Greetings, welcome, and welcome again to this course on CFD. So far we have seen
different discretization procedure, particularly finite volume in detail; turbulent flows
and modeling, boundary condition implementation and how to arrive at generalized
discretized equation. This week class, we will focus on how to get a solution of linear
equations. There are two methods in particular direct methods and iterative methods.
(Refer Slide Time: 00:49)
In direct methods, we are going to see three methods gauss elimination method, a
specialized form of gauss elimination method called tridiagonal matrix algorithm, LU
decomposition. We will also talk about five different methods under iterative methods.
Then there is a procedure called preconditioning; if the matrix is in ill-condition, difficult
to get the solution then we do the procedure called preconditioning. We will talk about
different procedures available under preconditioning.
424
(Refer Slide Time: 01:29)
By now we know whether we follow finite difference or finite volume method,
discretizing the governing equations will results in system of algebraic equation. These
equations can be written in matrix form as
AX =B
, where A is a coefficient matrix;
X is a column vector of unknown and B is another known matrix. The coefficient matrix
A, it may be banded or sparse; for sparse, it is sparse, because we use different structural
grid or unstructured grid, we follow different discretization procedure. For example,
when we talked about finite volume procedure for convection, we have different
procedure pure upending, quick scheme or central type linear approximation and we
have different procedure for diffusion term. So, we put them together then it may result
in not a banded structure.
And you also observe the matrix coefficient matrix has many zero elements. Solving
such a system is very important, because it affects solution accuracy and it takes
computational time enormously. There are two approaches one is direct method, other
one is a iterative methods. To understand this knowledge on matrix will be very helpful
which would have studied in your basic undergraduate program. Matrix algebra in terms
of Kramer’s rule, Eigen values, pivoting, singular matrix, rank of the matrix all those
using this very helpful to understand the solution procedure.
425
(Refer Slide Time: 03:27)
We will now focus particularly on direct methods. We are going to talk about three
methods - Gauss elimination method, tridiagonal matrix algorithm, and LU
decomposition. In iterative methods, we have Jacobi method, point or line Gauss-Siedel
method, point or line successive over relaxation - SOR method, then there is an
alternative direction implicit - ADI method.
(Refer Slide Time: 03:55)
Gauss elimination method, it has basically two steps one is forward elimination and the
second step is a backward substitution. In the forward elimination, the method reduces a
426
given set of N equation into an equivalent triangular set. So, the coefficient matrix, at the
end of the forward elimination step will result in the form of what is known as the upper
triangular matrix. By doing so, at the end, the last equation will have one unknown and
the unknown is directly computed then the remaining unknowns are computed by a step
called backward substitution. This method is good, if the number of equation is less and
when the coefficient matrix is sufficiently simple. And for large number of equation to
be solved, which is the case for the example, say 3D calculation or if the matrix is sparse
then this procedure of Gauss elimination is not economical. It may also lead to erroneous
results. Number of floating point operation required in Gauss elimination method is of
N 3 . And we have today most of the programs are parallelized to get
the ordered
results quicker or turnaround time for computation to be as short as possible. In such
case, we should have a matrix inversion procedure also parallelizable, the gauss
elimination procedure is not parallelizable.
(Refer Slide Time: 05:43)
Let us look at in detail, a set of linear algebraic equation is shown here, where a as well
as b are constants. Same equation in the form of matrix is written here, coefficient matrix
a, it has elements
vector x from
vector
b1
to
x1
a11
for example, all the way up to
ann , then unknown column
to
x n . Then on the right hand side, we have the known column
bn . So coefficient matrix a has nxn size, and column vector unknown
column vector has a size nx1 in the final and right hand side b matrix has a size nx1. In
simple form, it is written as
A X i=B .
427
(Refer Slide Time: 06:41)
We will see the procedure for 3 x 3 combination matrix. So, here it is elements are given
a11
x3
a12
a13
for example, and column vector is given unknown
and the right side you have
b1
b2
x1
x2
b3 . So, in step one and two, because
there are only two steps in these because you have only 3 x 3 matrix; step one and two
involved pivoting and that is stage is called forward elimination. So, in the first step,
a11
a12
a13 is not altered, whereas the second row and third row are altered; and
altered coefficient is written with the superscript in the bracket one. Correspondingly
coefficient matrix on the b is also altered and that is also written here b(1)
and b(1)
.
2
3
Now you do the pivoting for the second step also, and you can observe the third row is
now altered as
a(2)
33
standing for that it is a second time pivoting, correspondingly
coefficient b also changed
. Now we can immediately observe the coefficient
b(2)
3
matrix, original coefficient matrix a is now reduced to upper triangular matrix as shown
here. The last row for corresponding unknown
x 3 and you can immediately get
then we follow what is known as the backward substitution in this direction to go
428
x3 ,
x 1.
(Refer Slide Time: 08:25)
So in forward elimination, we do row manipulation, we also have a procedure what is
known as the augmented matrix and which is represented here as A is the original matrix
with the line and b is element to use for augmentation. So,
way up to
ann
a11
a12
a1 n
all the
that the coefficient matrix is now augmented by including right side b
matrix and that is shown in this. Now, we perform elementary row manipulation reduce
that augmented matrix to U upper triangular matrix; with every time, we get the new
value for coefficient matrix b also. What is shown here is the skeleton of the program
used to perform this operation. So, do i = 1 to n - 1, do k = I + 1 to n row of k is equal to
row of k minus this is the pivoting operation and you end the do loops.
429
(Refer Slide Time: 09:36)
Now you do the backward substitution because all now becomes upper triangular matrix
and you can immediately recognize the last row of that matrix
unn is the only element,
all other elements are zero. So, if you write equation corresponding equations for this, it
becomes un n x n equal to
b'n . So, we directly get
other unknown coefficient in the reverse order from
x n , then we use that to obtain
x n−1 to x 1 . This is achieved by
what is known as recursive relationship and that is what is shown in this formula
n
x i=
b'i−∑ ji +1 uij x j
uii
. Now because that is a recursive relationship, it is also easy to
program and this is the structure of the program which you might use to get the
backward substitution.
430
(Refer Slide Time: 10:43)
We explained the gauss elimination procedure with the help of a simple matrix as shown
here. So, 50 1 2 1 40 4 2 6 30 are the elements of that matrix,
x1
x2
x3
are
column vector unknown values equal to the right side one two three. There is a exact
solution available for this matrix system and that is also listed as shown here as 0.016
0.041 and 0.091. We explained Gauss elimination procedure for this system in the next
two slides.
(Refer Slide Time: 11:25)
Coefficient matrix is written along with augmenting, considering the right side value 1 2
3 as shown here. So, we do few arithmetic operations, and we decide to have a two
431
decimal accuracy. So start with the augmented matrix as shown here. First operation,
perform multiply the first row by minus 1 by 50 factor and add to the second row. So,
second row, first element is 1, first row first element is 50, you want to make the second
row first element as zero. So, to do that we multiply first row by minus 1 by 50 and add
to the second row and that will result in zero for first element in the second row.
Similarly, the third row, the first element is two, and we have to make it to zero; to
achieve that, we have to do this operation; multiply the first row by minus 2 by 50 factor
and add to the third row. So, if you perform these two operations on this matrix including
the augmented column then it will result as shown here. The first row remains the same,
second row first value goes to zero that is the intention, similarly the third row first value
goes to zero that is again the intention, and remaining values gets adjusted because of
this operation. So, 40 become 39.98, 4 become 3.98, and 2 becomes 1.98. Similarly, for
the third row, because we are following accuracy up to two decimals, we have written
here values up to two decimals.
Please recall in the Gauss elimination, we have to make the matrix, upper triangular. So,
the lower part has to go to zero that means, in this case, we have to make the second
element third row also zero. So, to do that we have to perform one more operation as
given here; multiply the second row by 6 by 40 and add to third row, and that will result
in the second element the third row has zero, the remaining values gets adjusted as
shown here. So, original matrix which is displayed here gets converted into upper
triangular matrix as shown here, so 50 1 2 0 39.98 3.98 0 0 and 28.41and 2.67.
432
(Refer Slide Time: 14:28)
So, we do first forward elimination, and then backward substitution, the matrix is
reproduced here. So, backward substitution is start from the last row. So, last row is
28.41 into
x 3 equal to 2.67. So, to perform you get value as 0.0938. We compare this
against the exact value that is 0.091, and the error is approximately 2.2 percent. We do
the back substitution, so second row will give you the
the
x1
x 2 value and first row will give
value as shown here, and corresponding deviation percentage with respect to
the true value is also shown here. So, they are within acceptable level that is 2 to 2.5
percent.
(Refer Slide Time: 15:23)
433
The possible problem in Gauss elimination zero may be there on the diagonal element
and when we perform floating operation, we may end up a statement like dividing by
zero. And we have observed, there are many floating point operation, in other words
flops, and which may cause numerical precision problem because you are handling so
many operations, and every time you are approximating. And any error introduced at any
state will propagate and finally, you may get erroneous result and system may be ill
condition for matrix condition determinant A is the approximately are very close to zero
situation. There are solutions available for this kind of problem; one you can carry more
significant figures. So, instead of limiting to three decimals, you can know as the double
precision just handles up to 16 significant positions after decimals. Then it is also
possible to have different pivoting strategy in the next few slides, we are going to talk
about different pivoting strategy.
(Refer Slide Time: 16:39)
So, pivoting we have three different types, first one is what is known as row pivoting; it
is also otherwise called partial pivoting. It is good for many situations; at every step at i,
we find the max corresponding to k i to n and all other elements are adjusted for that
maximum value. So, move corresponding row to the pivot position. It avoids any zero
elements because you are finding out maximum value, and zero is automatically avoided
and that helps to avoid dividing by zero error. And it keeps number of small and
minimizes round off error, and it uses an equation with large element value to find
xi .
It maintains diagonal dominance, we already seen why it maintain diagonal dominance.
434
The row pivoting does not affect order of the variable. So, this is very important because
we are dealing with the matrix, we are dealing with unknown coefficient, it should not
change the order of the variable, and it is included because of these properties in any
good Gaussian elimination procedure, so normally we do only row pivoting.
(Refer Slide Time: 18:06)
Next pivoting is the column pivoting for j 1 to n get the largest value. So, this is like row
pivoting instead of row, we consider column. And reorder remaining variables
column pivoting results in changing the order of the unknown
x j , this
x i , hence it may lead to
complexity in the algorithm, and this is usually not preferred. There is another procedure
what is known as the complete or full pivoting, where we perform both row pivoting as
well as column pivoting. If coefficient matrix A is symmetric then we need to pay
attention to preserve symmetry while doing this kind of pivoting. So, in today’s class, we
have particularly seen Gauss elimination in detail; tomorrow’s class, we see a special
form of Gauss elimination procedure, what is known as the Thomas algorithm for
triangular system of matrix.
Thank you.
435
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture - 34
It is my pleasure to welcome you again to this course on CFD. Last class, we started
discussing about matrix inversion procedure; we listed three direct inversion procedure
gauss elimination, TDMA and L U decomposition. In last class, we did in detail gauss
elimination, and today’s class we see in particular tridiagonal matrix algorithm otherwise
TDMA.
(Refer Slide Time: 00:48)
We know in Gauss elimination, there are two steps forward elimination and backward
substitution, bulk of the time consume in forward elimination because in the backward
substitution and it becomes completely upper triangular and we start from the last row in
substitute and get the unknown. Hence most of the time is appear to be spend in the
forward elimination process. We also learned different discretization procedure for
example, central differencing, forward differencing, backward differencing pure up
ending, quick and combination. And whatever the method you follow for some
combination, the coefficient matrix will result in what is known as a tri-diagonal form.
And we have already seen in previous class, diagonal matrix, tridiagonal matrix and
penta diagonal matrix. The tridiagonal matrix structure is displayed here again. So, this
436
will have one mine diagonal, which is marked here in red colour, and immediately above
is a super diagonal and immediately below is a sub diagonal.
So, you see in this matrix we have values restricted only to limited region of the matrix
and you have for most of the places zeros, so obviously, matrix of this nature applying
Gauss elimination is not economical. So, we need to find some alternative way where
you do not need to handling zeros, hence reduce computational time substantially. So,
you follow what is known as a simplified form of Gauss elimination procedure, it was
proposed by Thomas, just called Thomas algorithm for tridiagonal matrix; in short form,
it is called TDMA. Only one element needs to be eliminated in the forward elimination
process then when the algorithm reaches the last row, you have an equation with only
one unknown on the left side and the known on the right side. So, you are immediately
able to get the unknown, then we follow what is known as a backward substitution to get
all the unknowns.
(Refer Slide Time: 03:15)
We will see TDMA little more detail now. So, when ordinary differential equations or
partial differential equation or finite difference say in this case central different scheme,
we know in central differences scheme we have node of interest and one more on either
side left as well as right. And if you apply CDS scheme for the full domain, then the
resulting algebraic equation will have a simple structure and each equation will have
variables at its own nodes and immediate left as well as right, such a system linear
437
equations with n rows is given here. So,
b1 u1 +c 1 u2 =d 1 ; and we go to the next row
a2 u1 +b2 u2 +c 2 u3 =d 2 , and all the way up to the
N th
row,
a N u N−1+ b N uN =d N .
Now in the first row, we have only two contributions that is because you have on the left
side boundary condition and boundary condition is accounted as a source term and that is
added and you get d 1 .
Similarly, the last row again has only two contribution, there was for the last row, the
right side is again boundary condition and that is appearing as a source term and added to
know value
d N . Now the same algebraic question in the form of matrix it is shown
here. So, b1 c 1 , remaining all zeros; similarly, all the way up to last row
aN , bN
is a coefficient matrix multiplying the unknown column vector, you want to
uN
u1
this
to
on both on left side then on the right side you have a known column vector.
(Refer Slide Time: 05:23)
We repeat that again here and to solve this, we follow same procedure as Gauss
elimination procedure that is you have a forward elimination and backward substitution;
only thing it is slightly modify for this matrix structure. And after working out, you are
able to set what is known as a recursive relationship and that is what is shown here. So,
uN
which is the last unknown is equated to
now it is a backward substitution;
ui=qi−
438
q N , and you go in the reverse, because
ui c i
, where i goes from n-1 in the reverse
pi
order all the way to 1, so this is what is a backward substitution. Now we define q and p
as given here;
p1=b 1 , q1 =
d1
p1
and then this is
439
for the first for the remaining from 2 to N, q and p are defined as shown here. Now this
relationship is already worked out, what I am showing here is only final expression, and
this is in the form of a recursive relationship.
(Refer Slide Time: 06:42)
What is shown here is a sample FORTRAN code listing to achieve what is known as a
TDMA. So, equations are numbered from 1 to N; one special point to be noted here is
matrix has values only along three diagonals - main diagonal, sub diagonal and super
diagonal, remaining elements are all zero. So, we do not store the matrix in full form; we
only store main diagonal, super diagonal and sub diagonal as independent matrix and
that is what is A, B and C. So, in, A for example, we will have all elements belonging to
the sub diagonal; B will have element belong to the main diagonal, and C will have the
element belong to the super diagonal. So, they are independently store that way you do
not store full Matrix because the full matrix are zeros and it is expensive in terms of
memory as well as handling those zeros that is the specialty of this TDMA procedure.
And we also noticed we have one more column vector on the right side, the known
column vector and that is stored in D and X is unknown column vector. So, we call
subroutine TDMA with arguments and you define A, B, C, D and we defined two new
variables P and Q related to the recursive relationship. So, we follow the formula and
write this FORTRAN listing, this will result in some form of forward elimination. And
the next step is the backward substitution, there you get solution better itself. So, the last
440
row is one that we can find first, so
X (N )=Q( N )
then we do in the reverse
N 1=N −I , we go in the reverse and find complete column vector.
(Refer Slide Time: 08:48)
We also have the similar simple code listing, but written in C language as shown here.
So, double * a , * b , * c
as we did before a, b, c are diagonals corresponding to
main diagonal sub diagonal and super diagonal; and n is a number of rows that is
required to be solved. Then you modify so in this instead of P and Q in the previous
slide, here we defined some other quantity, you calculate d then substitute in the
backward substitution form, you get the answer for unknown column vector.
441
(Refer Slide Time: 09:32)
We will try to take an example problem and explain TDMA procedure. Problem
statement - solve one-dimensional diffusion equation in the domain x going from 0 to 1
with the boundary condition
u(x=0 ,t)
is always zero and u(1,t) = 0 for all
time≥0 . And at initial condition the
time=0 , we have boundary condition
u(x , 0)=sin π x . So, this is a initial condition, and these are all boundary condition
applied at x=0, at x=1 for
t ≥0 . And specifically it is given follow Crank Nicholson
scheme C-N scheme. We already learned this before; we will repeat it here again. So,
consider one dimensional unsteady diffusion equation
∂u
∂2 u
−α 2 =0 . We know
∂t
∂x
what is FTCS, that is forward in time central in space. So, we have forward in time for
the time derivative and central in space for second order special derivative.
And this is a explicit scheme in the sense all the variables are known from the previous
time level that is what is given in the superscript as n. The current value to be determine
is given the superscript n+1 and that is only one quantity appearing for entire equations;
remaining all from previous time level, and in terms of schematic that is shown here. So,
n+1 level value required at n+1 level is determined from value is already found at nth
level. In this problem specifically it is Crank-Nicholson scheme. So, for the same
governing equation, we write down Crank-Nicholson scheme and that is shown here. So,
the left hand side you have the time derivative term that is same forward
442
in time; the difference is only for the special
∂
∂
2
u
x 2
that is
written in the form of Crank-Nicholson scheme. We know Crank Nicholson scheme is a
semi implicit scheme that is it is half explicit and half implicit and you are able to
identify that here.
So, we have one set of term with superscript n+1, we have another set of term for the
superscript n and there is weightage of that is what is in the denominator here two,
corresponding molecule is schematics is given here. So, n+1 value is determined with the
values from n+1 as well as values known from nth level. Now we can rewrite this
specifically for the sake of writing code r is a new variable defined as α
Δt
(Δ x )2
and all
this n+1 values are to be determined. So, we take all of them on the left hand side and all
quantity with the superscript n is known from the previous time level, and they are taken
to the right hand side. This equation needs to be solved, when you apply CrankNicholson scheme.
(Refer Slide Time: 13:16)
Now, if put this form of a matrix, so in the last slide, for the example problem, onedimensional diffusion equation, we defined discretized equation; now we define
computational domain as shown here. It is going from x=0 on the left side to x =1 on the
right side. We take four spacing otherwise three grid points. So, at one, two, and three
and they are equally space on
Δx
happened to be 0.25. On the left side, boundary
condition is defined as well as on the right side of boundary
443
condition is defined. For the sake of simplicity, we assume
Δt
way of value r equal to one and we already define r to be α
Δt
.
2
(Δ x )
and
α
in such a
We rewrite the discretized equation here again. Now we use the value r and apply the
discretized questions at every nodal point, and we get algebraic equation as shown here.
As you can observe, the first row has influence of left side boundary; last row has
influence of right side boundary. Now the same algebraic question is written in the form
of matrix as shown here that is 4 -1 0 , -1 4 -1, 0 -1 4 the coefficient matrix and then
one unknown column vector; on the right side, you have a known column vector.
(Refer Slide Time: 14:53)
Now we apply the recursive relationship, we define two quantities p and q. So, p1 q 1
and
pi ,q i
for i going from 2 to N, there were also defined. We try to apply for this
example problem. So, we get
for example,
p1=b 1=4 ;
q1 =0.25 . And we calculate other values
p2, q2, p3, q 3 ; once you find this can we do the backward substitution and
that is also defined in terms of recursive relationship
u N =qN , and
ui=qi−
c i u i+1
.
pi
And it is backward substitution, so i is going from n minus 1, all the way to one. We
substitute n is equal to 3 that is the last row and then n minus 1 is equal to 2. So, we get
444
u N =qN
which is otherwise
u3=q3=−1 , and we calculate for the remaining
u2 u 1 using this
445
relationship, and substituting appropriate values, and the values are shown here it is so
easy in TDMA.
(Refer Slide Time: 16:10)
Now we have the TDMA for a simple system, but in some problem, you may have to
force what is known as a periodic boundary condition. Periodic boundary condition
means values are repeated from one boundary to the next boundaries and the domain you
supposed to extend in the periodic way indefinitely. When such situation is there, we
pose periodic boundary condition, the matrix tridiagonal matrix gets slightly modified as
shown here. The main diagonal, sub diagonal, super diagonal they are same. Now in the
first row, we have one more element or value added; and the last column as shown here
a1
Similarly, last value in the first column again gets alter by the periodic boundary
condition and it is shown here as
c N . The TDMA procedure with just now explained
is suitable for other boundary condition and it is slightly modified as Sherman-Morrison
formula, we are not going to discuss that here and still we can use it TDMA procedure
we have explained.
446
(Refer Slide Time: 17:32)
So, overall as you observe through example problem and also through recursive
relationship, we understand it is very easy to program. And in practice, you do not
actually have full coefficient matrix stored, only diagnosis are stored as a separate
column vector. Number of operation because we are not handling with zeros, number of
operation when compared to the Gauss elimination procedure is substantially reduced,
now it is only of order n. It saves lot of computational time, because we are not handling
zeros; memory requirement is also less. It is one of the successful algorithm and it is
used by many researches for their own calculation.
Cases where you end up getting penta diagonal matrix, for example, we learned before
what is known as alternating direction implicit, alternating direction implicit was a
reduced form of the penta diagonal matrix solution procedure, where the original penta
diagonal matrix is reduced into two tridiagonal matrix by having a method of explicit in
x-direction, implicit in y-direction and then next stage implicit in x-direction, explicit in
y-direction; you learned that before we will see that again. So, by that procedure, the
original penta diagonal matrix its reduced tridiagonal matrix; similarly, there is another
operation called operator splitting that also results in reducing original matrix into
tridiagonal matrix. There are procedures available to convert penta diagonal matrix and
septa diagonal matrix into tridiagonal matrix once it is reduced then we can apply TDMA
procedure to get the solutions.
447
(Refer Slide Time: 19:33)
We have listed three direct methods one is Gauss elimination, second is a TDMA, third
one is LU decomposition. In LU decomposition, the full matrix A is split or decomposed
into two as
A=LU , where the L stands for lower triangular matrix and U stands for
upper triangular Matrix and that is in the form of matrix that is shown A - full original
coefficient matrix is decomposed into L Matrix and U matrix. So, in this class, we have
seen in detail tridiagonal matrix algorithm procedure, we also had an example problem.
We listed advantages associated with the TDMA procedure. And in the next class, we are
going to see details about what is known as LU decomposition again with listing an
example problem.
Thank you.
448
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture – 35
It is my pleasure to welcome you again to this course. Last two classes, we have seen in
detail about Gauss elimination procedure, special form of Gauss elimination procedure,
what is known as a tridiagonal matrix algorithm. In this class, we are going to see one
more direct method what is known as LU decomposition.
(Refer Slide Time: 00:40)
LU decomposition, so A coefficient matrix, say for example, has no zero value element it
is full matrix. In LU decomposition, matrix A is decomposed into two matrices; such as
L and U, where L refers to lower triangular matrix and U referred to upper triangular
matrix. And it is shown here, A=LU. And in the form of a matrix notation, it is shown
here a coefficient matrix
a11
to ann . It is now decomposed into L matrix and U
matrix and structure of L matrix given, it has diagonal element value as 1, and it has
elements on the lower side of the diagonals has shown here from l to 1 and all the way up
to last row. Values on the upper part of this L matrix are zero. The lower part of the
diagonal element of the U matrix are zero and it has values from the diagonal, and all the
way up to the upper part. So this in case
U 11 U 22 U nn are values along the diagonal and
other upper side it is fill with values.
449
(Refer Slide Time: 02:09)
So, procedure of the LU decomposition and solution is given in this flowchart. So, given
coefficient matrix equation AX=B, such a initial system. Now coefficient matrix A is
decomposed L and U product of L and U. Now, we rewrite equation is A is equal to B
has LUX = B. Now in this, we substitute UX = D. So, we write now in L U X equal to B
as L D equal to B. When we solve this equation, we get the D known and that is by
forward substitution. Initially we defined UX = D, we rewrite here now in this is D is
known because we got it from the previous set LD = B. Now X is the unknown variable
column vector and U upper triangular matrix. So, then we do the product and that should
be equal to the column matrix. Now when you solve this, we get finally X. So, in LU
decomposition, there are additional steps in terms of decomposing the given matrix A in
the form of L and U. And as you can observe it has steps overlapping with steps involved
in gauss elimination procedure that is forward elimination and backward substitution.
450
(Refer Slide Time: 04:02)
Now, the question is how to find or how to decompose given coefficient matrix A into L
and U. In other words, how to find element values in coefficient in coefficient matrix L
and U. The mathematics is already given there is recursive procedure and what is shown
here is the final steps in the recursive procedure. So calculation of elements in L and U
matrix and
l ij
equal to
ai j
that is original value that is value in the original
j−1
coefficient matrix
l ij =aij −∑ l ik u kj . Similarly, for upper diagonal matrix
k=1
uij , there
is another recursive relationship that is what is also displayed here. This recursive
relation gets reduced for the first j is equal to 1, the rule gets reduced to
for i = 1, the upper triangular matrix
uij get reduced to u1 j=
a1 j
. Now this sets first
l 11
row element for a case of u, and first column elements for a case of l.
451
l i 1=ai 1 . And
(Refer Slide Time: 05:46)
Now, we try to have a sample code listing for that operation that we just explain to get
element values in coefficient matrix L and U. So, do for i = 1, n
Li 1=A i 1 , so this step
finds first column elements in L matrix. Similarly for U(1,j) j run from 1 to n
U (1 , j)=
A1 j
L11
and this gives first row elements for U matrix. Then we find out other
elements in L matrix and U matrix with the help of recursive relationship we displayed
just now. The same relationship is written in the form a programming listing here. so for
j is equal to 2 to n and for i j to n , k 1 to j-1 you accumulate the sum of
U kj
Lik
and
end do we find elements of coefficient matrix L. Similarly for U matrix that is
also listed here. What is shown here is not actual program is the only skeleton of what
can go in the code meant for writing to find out LU decomposition any language can be
used what is show here is based on Fortran coding language.
452
(Refer Slide Time: 07:14)
So once L and U are determined, solution to the equation the original equation is
obtained has explain here
Ax=b
is the original set of linear equation, where x is
unknown column vector and form of transpose it is here; b is again known value matrix
on the right hand side that also in the given form of transpose here. We have decomposed
the original A matrix into LU. So, we rewrite A = LUx = b. So, solutions is obtained in
two steps; first we write Ux = y where y =
solution is obtained as
y1
to
yn
transpose then Ly = b. So,
y 1=b 1 and y i is equal to this recursive relationship and where
i is equal to 2 to n. And
x n , this is now backward substitution is again by recursive
relationship as shown here.
453
(Refer Slide Time: 08:28)
Let us explain the LU decomposition procedure and finding the solution with the help of
an example. So, it is given find X of the unknown vector
[
matrix as shown here
1 2 4
3 8 14
2 6 13
]
x
y
z
[]
with the coefficient
and D matrix as shown here as
3
13
4
[]
. The first
step is to get LU decomposition of the given coefficient matrix, and we rewrite L as
given here. So, L matrix as diagonal element as 1 and
L21 L31 L32
are elements in a L
matrix, and upper part of the L matrix are 0. Similarly for U matrix and lower part of the
matrix are 0, and you have along diagonal values
U 11 U 22 U 33
and then upper part. So,
if you multiply L and U and equated to given coefficient then you are able to find values
of L and U and that is what we are going to show here.
So if you multiply, for example, this is 3 x 3 matrix, this is again 3 x 3 matrix, so it is
possible to multiply. So
1 x U 11 that becomes a first element for the product matrix L
and U; similarly for other coefficient elements. You can observe, for example, last row
L31 U 11
and then
L31 U 12+ L32 U 22
and you get similarly expression for all the
elements in that product matrix L and U. This is equated to the original coefficient
454
matrix A that is what is shown here
[
1 2 4
3 8 14
2 6 13
]
and that is what displayed here. Now
all that we do we set up an equation three equations.
455
(Refer Slide Time: 10:38)
So, we have to use this to find entries in the L and U. It is easier in this example;
however, it is good to understand. So, U 11 directly get the values of 1, U 12 gets the
value of 2, and
U 13
gets the value of 4. Now, we write equation for other entries. So,
L21 U 11 =3 , if you substitute
U 11
you get the value of
L21 U 1 2+ U 22 =8 ; if you substitute values for
U 12
you get values for
U 22
U 22
L21
as 3. Similarly,
we get if the substitute value
as 2. You can extent for this third row and following
algebraic you finally get values for U 23 as 2.
(Refer Slide Time: 11:30)
456
Again continue that exercise to find coefficient values in the L matrix, and all the steps
are shown here, and you get values of
L31
L32
and then remaining
U 33 . So, if
you substitute finally, we get LU decomposition of a given matrix as shown here. So,
given matrix A is shown here is equal to product of L matrix and U matrix. As defined
before in L matrix diagonal elements are having value of 1 and the lower part of the
diagonal elements that is they are having value as 3 2 1 and upper part having zero value.
Similarly U matrix, you have values along the diagonal and an upper part again there are
some values, but the lower part has zero value.
(Refer Slide Time: 12:28)
Now, once you find L and U decomposition of the given matrix, now we have to find a
column vector x y z. So to solve a system application by LU decomposition you need
follow procedure given below give a find L and U which you have already done. Now
set Y = U X so that becomes LY = B. Now if you solve this because L is now triangular
system and Y is now becoming unknown B is again known from the original set. So,
when you solve this equation LY = B then we get Y. Then once you get Y, we already
defined Y = U X, now if you solve by backward substitution you get X, and that is what
is the initial interest. Let us apply this steps for the example problem that we have just
now explained, so L is already obtained as shown here, and U also obtain as shown here.
457
(Refer Slide Time: 13:40)
So, LY = B for the vector Y as define as
y1
y2
y3
[]
. Now LY = B; so B values also given
in the problem; L is shown here and Y is
y1
to
y3
. Now you can solve this by
what is known as forward substitution; if you perform operation from the top, for
example, that is directly known
we get
3 y 1+ y 2=13 ,
y1
y 1=3 . Now perform the operation for the second row
is already determine substituting you get the value
to be 4. Now from the last row, we get
known, solve for
y3
2 y1 + y 2 + y 3=4
this
y 2 is known
y2
y 1 is
you get value of -3. So, in the set up LY = B, we have now got
Y.
(Refer Slide Time: 14:44)
458
So, once we set up this equation, we solve by backward substitution. You can
immediately observe the last row, so 3z = -6. If you solve you get value of z to be -2.
Now take the second row, so 2y + 2z = 4, again value of z is known substitute you get
value of y to be 4. Now take the first row top equation, so x + 2y + 4z = 3, and if you
solve for the substituting valve of y and z get x valve to be 3. So, final solution is
x
3
y= 4
z
−2
[][ ]
. So we have explained given a coefficient matrix how to decompose into
L and U. And how to follow from there to get solution; first steps is forward substitution
using L matrix; second step is backward substitution using U matrix.
(Refer Slide Time: 15:55)
So, if you look at advantages with respect to gauss elimination. It is very popular, it is
easy to program, there is no need to store zeros either for L matrix or U matrix. So, if you
observe carefully given coefficient matrix A split into L and U and upper triangular part
for L has zero value, lower triangular for U as zero value. And though they are actually
represent that in actual program for while doing the program to get L and U matrix you
do not handling zeros at all. Similarly, L matrix has value of 1 along the diagonal,
because it is fixed for any coefficient matrix and do not be stored; instead 1 is possible to
store coefficient values of U matrix in L matrix itself wherever zeros are appearing in L
matrix.
459
Hence finally, though it appears as if given matrix A is split into two different matrices;
natural coding it is not so. The given matrix A itself is used to store both L and U as
shown here. So, given matrix a11 a 12 a1 n
all the way up to a n n is now replaced with L
and U as shown here. We already know for L matrix diagonal element values are
1. And we also just now mentioned, there is no need to store 1 because it is default for
any coefficient matrix that place is used to store values of U matrix
U 11
along the
diagonal all the way up to u n n; and upper part of the L matrix has zero value and that is
used to store U matrix as shown here
U 12 all the way other elements. Hence the given
coefficient matrix A itself is used to write L and U. so, this becomes easier to program
and it also become very popular because it is easy to solve any matrix.
So, in this today’s class, particularly we talked in detail about LU decomposition way of
solving a given coefficient matrix, we explain procedure with the help of a simple
example problem. We also listed a sample coding for structure, it is possible to write the
code in any language appropriately for getting LU decomposition and then proceed to
get answer for a given coefficient matrix. Next class, we will talk about another
procedure what is known as iterative procedure.
Thank you.
460
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture – 36
(Refer Slide Time: 00:34)
Welcome again to the course on CFD. Today you are on module four of this week. So
far, we have seen direct methods in detail. Today, we are going to see a new procedure
what is known as the iterative methods. Any linear system can be solve by Gauss
elimination, LU decomposition procedure. The question is if the matrix becomes
complicated whether the gauss elimination or LU decomposition procedure is
economical or the whether it lead to some erroneous solution in such situation what do
we do. The second question whether it is computationally or in terms of time wise
economical to do direct methods or is there a way that we can go by iterative way we can
get the solution.
There are other issues for example, triangular factors of a sparse matrix. So, sparse
matrix is you are not able to identify matrix into some form. It has elements distributed
throughout. It has values distributed here and there in the particular coefficient matrix,
such matrix is called sparse matrix, and triangular factorization of the sparse matrix is
usually very expensive. While solving we have error due to computer arithmetic
handling of numbers rounding of errors or there is also error due to discretization. And
461
discretization errors are usually much higher when compared to machine rounding of
error. We should have method which is more accurate than discretization error an
iterative methods provides a suitable alternative, and it is also good for problems
involving non-linear. So, it is suitable for non-linear problems. In iterative methods, one
initial makes a guess of the solution then progressively improve and get the accurate
solutions. Each iteration is less expensive, number of iterations required happens to be
small, hence over all computation time requirement is also less when compared to direct
method.
(Refer Slide Time: 02:53)
So, we start with initial guess that is x at to zero, and substitute into the right hand side of
all the equation generate new approximation value and we call that x upon. By this way
we go on repeat and this is the multivariate one point iteration. So, in mathematically x at
j+1 is equal to x at j by some function g that is way it is called multivariate one point
iteration. And repeat this process until you have two conditions either you specify
maximum more of iteration or you specify some convergence limit. We learnd to about
convergence limit that one such criteria under the convergence limit for example. If that
different between present value and old value take the absolute and you specify some
limit, if that absolute value of difference is less than the specified value then you can
terminate the iteration this is one such convergence criteria. So, you repeat this procedure
either specifying convergence criteria or you forcibly say we will to the iterations only
462
for specs number of iteration say 500, 1000 whatever be the error accumulation. Slowly
as the calculation proceeds that will also come down.
(Refer Slide Time: 04:25)
So, start with the list of linear equations as we did before a11 x 1+ a12 x 2 +a13 x3
way and then b one on the right side. Similarly for all the rows we get ask row
to all the way up to
value. So,
ann x n
equal to
all the
an 1 x1
bn . Now what we to is start with initial guess
x 1 is an to be determine and all other terms of the equation for brought to
the right side as shown here. Now in these values for
x 2 x 3 all the way up to
x n or
from the guess value or from the previous iterated value. So, you get approximately
values for
x 1 . Now we go to
x 2 and all the way up to
463
xn .
(Refer Slide Time: 05:24)
We will explain different iterative procedure by taking one example problem and that is
shown here as a 2 D Laplace equation
∂ 2 u ∂2 u
+
=0 . And this is an elliptic equation.
∂ x2 ∂ y2
If that example equation that we have taken is discretized using second order accurate
central difference scheme then we get finite differenced form of that equation on that is
shown here. So, let me read that term
u ni+1 j−2uijn +uni−1 j
. So, this is the central
Δ x2
difference
to
scheme
∂
∂
which
is
apply
the
first
time
in
this
equation
2
u
x 2
and we use two subscript one i for x second j for y and as
usual superscript n is used here for iteration level. We write a similar term for the second
derivative in the y direction and that is what is shown here. Now j is given index j+1 j
and j-1. A corresponding computational molecule is shown here. So, i and j is the point
of interest, and we consider values from neighbors (i-1,j), (i+1, j) in the x direction;
similarly the y direction, you have (I, j+1 ) (I,j-1). So, these four neighboring notes
contributes for the solution at node i,j.
464
(Refer Slide Time: 07:13)
For the example problem, the computational domain with the mesh arrangement is
shown, Δ x
and Δ y
are the respective spatial different between two mesh points in
x direction as well as in y direction. And we define a new term
β=
Δx
Δy
and we apply
boundary condition along x as well as along y.
(Refer Slide Time: 07:43)
With the specific of nodal points, the same computational domain is repeated here. So,
(1,1) , (2,1), (3,1), (4,1), (5,1) for example, is along the first row for first in y direction,
then we extend this for the remaining nodes and it is marked
465
here. We define another term
α =−2(1+ β2) now we apply at the discretized equation
what we had before what we are the n before that is set second order central difference
scheme
∂2 u
∂ y2
use this definition of
α
and
β for this miss arrangement you are
apply for each nodal point.
For example (1,1), (2,1) this may be coming along the boundary are you take a second
row. So, (1,2) for again on left side boundary (5,2) is again near the right side boundary.
So, we have apply, for example, for the node (2,2) discretized equation then we get the
first equation as shown here. So, (2,2) node is influenced by neighbouring notes that
(1,2), (3,2), (2,2),( 2,3) their respectively (i-1 j) (i+1 j) (i j+1) and (i j-1). So, you get
corresponding equation written here. We extend this procedure for all the notes. So, it is
(2,2) is their (3,2) and (4,2). In the same way equation are written for all the nodal points.
(Refer Slide Time: 09:32)
Now, if you put all those equation in the form of matrix an you structure as shown here.
Now in this
α , we already define %beta also we have define those α and β or
definitions are for convenience. So, that discretized equation and the matrix are return
elegantly. If you look at in this matrix then along the diagonal you have
α
and
immediately above super diagonal immediately below sub diagonal then there are two
zeros entry then you have %beta square that is also appearing parlor to the to the
diagonal
466
on the upper side as well as on the lower side. So, this is like one form offers for matrix
an all the unknown u vector are given then known coefficient value is given on rights
side.
(Refer Slide Time: 10:30)
You will explain different iterative procedure for that matrix and that example problems
first one is Jacobi iteration method in this the equation are solved using initial guest
values of the neighbouring points are from previously computed values. So, that final
difference equation becomes as shown here the node of interest that is
iteration value superscript is n+1. So,
ui , j
current
1
is the one that we determine at the node of
un+
i, j
interest i, j and all the neighbouring notes are taken to the right side there are either
determined from the previous level are known from the guess value and that is again
molecule.
467
(Refer Slide Time: 11:31)
So, we have rewritten the form of that discretized equation when you follow Jacobi
iteration method the next one is a point Gauss-Seidel iteration method in this method the
current values of the dependent variable are used as soon as they are immediately
available. So, the discretized form his return for point Gauss-Seidel iteration as shown
here though it looks similar you to pay attention to particular term that is
1
un+
i−1 j
with
1
and un+
i j−1 . So, in the computational molecule, if you look at i,j is the point of interest
ui−1 , j
is on the left side and
ui j−1
is at the bottom values at these two nodes are
known from just immediately completed iteration procedure. So, they can be
immediately use behave their available that way the nodal value i,j is more realistic go be
learn from this discretization i,j value is influenced by neighbouring nodes.
So, if you take very close value then the solution can be obtain faster an in this procedure
values at node (i-1,j) and (i, j-1) or known from just completed iteration. So, why not use
it and that is idea of point Gauss-Seidel iteration method and we are going from point to
point that is why the word point is used. So, discretized equation written for point GaussSeidel iteration procedure has values immediately found included that is why you is
super script n plus 1 for left side node as well as node at the bottom.
468
(Refer Slide Time: 13:32)
Next is Line Gauss Seidel method; in this method, the finite difference equation in
rewritten with the unknown points at (i-1, j) (i,j) and (i+1,j) and you can see the equation
here. So, i-1 j then we define 1+β2
1
i,j than un+
equal to values at j+1 and j-1 here
i+1 j
this is a long the line because i-1 is on the left side i,j is a point of interest and i+1 is on
the right side. So, we identify notes along that particular line and they all have to be
inverted together and that is the idea behind Line Gauss-Seidel method.
If we extend this procedure, for all i at particular j, then it will result in what is in system
of linear equation and it will have a finally, tridiagonal matrix form, because, if you look
at this equation again i,j is the point of interest on you have one on the left side one the
right side, and extend this for all i an j for the particular j then it will result in tri diagonal
matrix form and we learned TDMA procedure in the previous class. At this step is
repeated for next line and you finally get one full matrix. Though individually it as
appears to be taking more computational time per iteration, the convergence rate is faster
than that is required for Gauss-Seidel method.
469
(Refer Slide Time: 15:24)
Graphically the line iteration procedure is shown. So, initially you have values along this
particular j node not known previously iterative values as shown by the triangle or from
the previous known previous time level or previous iterative values as shown again with
a triangle. So, along this particular j and you setup equation, when you solve equation for
the particular j then this nodes values are coming to known and they are used for the next
level as shown here. So, now for the same line j it becomes triangle that we need is a
known value this triangle becomes unknown value along the same j and then we have
previously iterated value just above.
(Refer Slide Time: 16:32)
470
So, this way you repeat this procedure and you get complete solution next we see a
procedure called point successive over relaxation method, otherwise PSOR. So, we know
the solution is progressing and it is likely to reach the solution in the same direction, and
this is what is known as the directional change. So if trend is observed why not we
accelerate and that is idea and that is implemented by a procedure called over relaxation
method. So,
uin+, j1
is to be determine we now introduced factor called
1−ω . So, this is kind of fraction. So,
actually o. If ω <1
ω
an
ω as one then it the contribution of uni , j is
is say for example, 0.2 then becomes 0.8, the
1−ω
becomes
0.8.
So, we take 80 percent weightage of previous level value for the same node i,j that is a
meaning of the term
(1−ω )uni , j
and the remaining terms. Again we introduced
for taking wait age of neighbouring notes if the relaxation parameter
ω
ω
is equal to
one then it will result in Gauss-Seidel method which we have just now seen. If the
ω
has value between zero and one the method is called under relaxation method if it is
above 1 then the method is called over relaxation method. Now what is shown here is
only a sample example equation, you can write this for auxiliary equation as well. And
you need to define
ω differently for different equation different variable will behave
differently when you iterate.
(Refer Slide Time: 18:37)
471
Next is a line successive over relaxation method is the same as PSOR only thing it is
implemented for the line as a whole. So, we have
1
then for i+1 value extra and
ω un+
i−1 j
similarly for neighbouring nodes contribution.
(Refer Slide Time: 19:02)
There is another procedure what is known as the alternating direction implicit ADI
method. In this method, we go from nth to n+1 level in two steps that is n to
then
n+
1
2
n+
1
2
and
to n+1. Now every time one set is given in implicit another set is given in
explicit. The first step for example, it is implicit in x-direction and explicit in y-direction,
accordingly you can rewrite the discretized equation. So, we get final discretized
equation as shown here. The next stage
n+
1
2
value is known and it is explicit in x-
direction. So, it is taken to other side and implicit in y direction that is taken on the left
side. And you already learned this is usually applied for Penta diagonal matrix, and by
applying this ADI procedure it gets reduced in to tridiagonal matrix and it is possible to
apply TDMA procedure to get solution. It is also possible to introduced a relaxation
parameter as we did in SOR procedure and accelerate the solution.
472
(Refer Slide Time: 20:33)
Now, ADI method is explain graphically as shown here. So, value at n,
n+
1
, you do
2
to sweep in x direction and n+1 you to sweep in y direction. So, in this class, we have
seen in detail, particularly iterative methods to explain different procedure, we took an
example problem that is Laplace equation; we discretized by second order scheme, and
we explain different iterative procedure for that example problem. We understood
advantages. We also learned method of reaching faster by a procedure called over
relaxation or under relaxation.
Thank you.
473
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture – 37
It is my pleasure to welcome you again to this course on CFD. Today is the last class for
this week; previously we have done detail procedure for direct methods as well as
iterative methods. There are some difficulties while employing iterative methods; and
today's class, we particularly going to see what difficulties will be there, and how to
overcome those difficulties. There is a procedure called preconditioning and today's class
we are going to talk about different preconditioning and how to check what kind of
preconditioning to be done.
(Refer Slide Time: 00:57)
Need for free conditioner the convergence rate of iterative methods depends on
properties of the coefficient matrix of the linear system. For example, if the coefficient
matrix A is ill-conditioned then convergence of the iterative methods becomes very, very
slow. And for large sparse matrices, which usually happens when you deal with PDE for
fluid dynamics or heat transfer. It is usually difficult to compute or solve such situation
with the help of LU decomposition. In those situation, we follow a procedure called pre
conditioner; a pre conditioner essentially transformers the original system Ax=B into an
equivalent system which has almost the same solution as what it be for the
474
original system and that equivalent system is easier to solve and it has better
convergence rate.
(Refer Slide Time: 02:06)
Let us get some more idea above this preconditioning. A is the original coefficient matrix
and x use letter symbol M for pre conditioner then we find inverse of the pre conditioner
as
M
−1
then you find product of
M −1 A and condition number for that
product matrix, then the convergence rate is govern by the condition number of the
product matrix that is
M −1 A . The choice of the M should be such that the condition
number is reduced without increasing the cost of solving the system with M. For
instance, if A x= b then matrix M is as close as A, in such a way the transformed system
M −1 A x=M −1 b
has a same solution as the original system A x = b, but the spectral
properties of its coefficient matrix
M −1 A
the system and getting the solution.
475
may be more favourable for transforming
(Refer Slide Time: 03:29)
The nature of the system of equation that is whether it is well condition or ill-conditioned
is important to trust the accuracy of the solution; another criteria to trust accuracy the
solution is what is known as a condition number and that is based on what is known as a
row sum norm. Now, let us explain what is row sum norm and how to obtain condition
number. To find row sum norm, sum of absolute values of the elements of the each row
of the matrix A, the maximum out of such values is what is known as a row sum norm of
the particular matrix A; in terms of expression it is shown here. So, you find for that
coefficient matrix A corresponding elements, you sum them up for j going from one to n
and you take the maximum of all the rows and that becomes the row sum norm of that
coefficient matrix A and it is mathematically given here.
From that row sum norm, it is possible to find or define condition number as product of
row sum norm of coefficient matrix and row sum norm of its inverse. So, for the given
matrix A, you have one row sum norm. If you happen in to inverse of it that is A inverse,
you have another row sum norm for that particular inversed matrix, and you take a
product of it that will result in what is known as condition number. In the last slide, I
mentioned about condition number row sum norm, we will now explain or get idea of
these definitions with the help of a matrix. Before going to the detail let us first
understand what is ill-conditioned and well-conditioned system of matrix.
476
(Refer Slide Time: 05:34)
For example, you consider a system AX = B, this system can be either well-conditioned
or ill conditioned. Let us get an idea of what is well conditioned or ill conditioned with
the help of the example. Well-conditioned system definition any small change in the
coefficient matrix A or the right hand side matrix B will lead to only a small change in
the solution vector x. Consider the system A X=B, where coefficient matrix A is defined
as with the elements as
side vector B as ,
[12 23] , and solution vector x as [ xy ] , and then right and
[ 47 ] . If you solve this, you get answer as [ xy ]=[21]
. Now, what we
do we make a small change in the coefficient matrix as shown here instead of one it is
now 1.001; similarly, other elements as 2.001 2.001, 3.001; the solution vector remains
the same, the matrix on the right also remains the same
For such system where there is only a small change in the coefficient matrix solution will
look like this; x and y equal to 1.999 and 1.001. And you can observe that these values
are very close to the original value of 2 and 1. Let us take the other case where you make
a small change the right hand side matrix and that is what is shown here. So, coefficient
matrix is the same, the right hand side matrix now it is 4.001 and 7.001, for such system
solution appears to be as shown here; x and y equal to 2.003 and 0.999. So, you can
observe, for this example, if you make a small change either in the coefficient matrix or
on right on side matrix, it results only a small change in the solution matrix.
477
(Refer Slide Time: 07:56)
Let us take the other example to understand what is ill conditioned system. In the case of
in condition system, any small change in the coefficient matrix or the right on side matrix
will lead to a large chain in the solution vector. Consider again example matrix as shown
here
[12
2
3.999
]
and
x
y
as the solution vector equal to right hand side as shown
here. Solution of this system is as shown here
[ xy ]=[21] .
We take the first case, we change the coefficient matrix slightly, so instead of 1 2 2 3.99,
we get 1.001 2.001 2.001 3.998, right hand side matrix is same. For this system solution
appears to be as shown here x and y equal to minus 3.994 and 0.01388. You can observe
here, this value is very much different from the original solution value. Let us take the
other case where we change right hand side matrix and it is shown here B as 4.001 7.998
the coefficient matrix is the same. Now, for this system, solution matrix appears to be as
shown here; x = -3.999 and y =4.0. Once again you can observe by comparing solution
matrix for this system with original system, there is a very big difference and this kind of
a system is what is called ill-conditioned system.
478
(Refer Slide Time: 09:49)
Now, let us go to the definition of rows sum norm and try to explain. Consider the matrix
A as shown here with elements
[
10 −7 0
−3 2.099 6
5
−1 5
]
. We define row sum norm as a
maximum of summation of rows and we take the magnitude of the elements to calculate
row sum norm. And formula wise, it is shown here, and this is infinity norm equal to
summation sign. And in this case, we have three rows, so j is equal to 1 to 3, and we
consider each element and we take the magnitude for each element for all i. Now, for
this example matrix, we try to apply this definition, so max of first row [10 -7 0] and that
is what is shown here; second row [-3 2.099 6] and that is what is shown in second
bracket terms; third row is shown in the third bracket term. Then you find the summation
and you find maximum is 17. So, row sum norm infinity norm for this matrix is 17.
479
(Refer Slide Time: 11:09)
Let us find out how to do condition number. For this, we take another example matrix,
simplified matrix A as
[12
2
3.999
2
. So, we find row
] , inverse of this [−3.99
2
−1 ]
sum norm of the original matrix 5.999, and row sum norm of the inverse matrix as 5.999.
Now, condition number is a product of row sum norm of both the matrix. So, as defined
here condition number of matrix A equal to row sum norm of original matrix multiplying
row sum norm. So, we substitute the values and we get value as 35.998.
(Refer Slide Time: 11:57)
480
So, we explain with the help of example coefficient matrix row sum norm and how to get
condition number. Now, we proceed to know about different preconditioning available.
The choice of pre conditioner M should have the following properties; it use should
entail low memory requirements, it should not add to additional memory; its inverse
should be easily obtainable. Please remember we want to do preconditioning, because
original coefficient matrix, there was difficulty in getting the inverse. We multiply their
original coefficient matrix A with preconditioner – M, the pre conditioner M should be
easily inverse able. Then the transformed problem should converge faster than the
original problem.
Different preconditioning techniques are available such as left preconditioning, right
preconditioning and split preconditioning. Common and simple methods to arrive at M;
first one Jacobi preconditioner, where the diagonal elements of the coefficient matrix a
itself is a preconditioner. So, M is a symbol we are using to identify it is a pre
conditioner. So, it is possible to use the diagonal elements of the original coefficient
matrix as a preconditioner and such method is called Jacobi preconditioning. Second one
Gauss-Siedel pre conditioner, where the lower plus the diagonal is used as a
preconditioner M. Third option available symmetric Gauss-Siedel preconditioner and M
in such case is given by this expression where (D+L) multiplying
D−1
and then (D
+U). Then last one successive over relaxation preconditioner – SOR, where M is defined
with the product of
1
ω
multiplying
D+ ω
parameter.
481
in to L, where
ω
is a relaxation
(Refer Slide Time: 14:24)
There are other popular preconditioners are available for example, in complete L U and
incomplete Cholesky for iterative methods like BiCGSTAB and conjugate gradient
method respectively. There is also another technique called multigrid technique, which is
also classified under preconditioner. Choice of pre conditioner is very important and it
varies from problem to problem. So, far we have seen matrix inversion procedure, direct
methods, iterative methods and then preconditioning methods which is helpful in the
case of iterative methods.
(Refer Slide Time: 15:19)
482
Over all, unique system of equations, there is the procedure to get the solution. Problems
in Fluid Dynamics and Heat Transfer involve solution of coupled system of equations,
where we have dominant or dependent variable appearing in every other equation. There
are two approaches; in the first approach, all the variables are solved simultaneously and
this is called simultaneous coupled solution approach; in the second approach, every
transport equation is solved until its convergence is reached then the next transport
equation is trigged to get the solution, such approach is called segregated approach. We
will have some more explanation about these two methods.
(Refer Slide Time: 16:16)
In the case of simultaneous approach, all the transport equations are solved
simultaneously. For example, you have force convection problem where you have a
where Navier-Stokes equation and there is the energy equation. Both Navier-Stokes of
equation and energy equation are called handled simultaneously. Solution of one
immediately affects the solution of the other. In solution matrix obtained for such
simultaneous approaches is the block-banded structure, and this method is chosen where
equation are linear and very tightly coupled. I gave an example of force convection heat
transfer problems.
483
(Refer Slide Time: 16:57)
In the case of segregated approach, when equations are non-linear and complex, then it is
advisable to go by solving one equation at a time get a converged solution then go to the
next equation. So, equations are solved one by one until each one of them are converged
fully or partially. While solving equation for one dependent variable, other variables
appearing in the particular equation or assume to be known either from previous iteration
values or previous time level value. The whole cycle is repeated until all equations are
satisfied to the convergence criteria fully.
(Refer Slide Time: 17:47)
.
484
We also want to learn another procedure called under relaxation. Algebraic equation for
any generic variable
ϕ , whether you follow finite difference or finite volume method,
we finally, will have a form as shown here
A p ϕ np plus neighbouring node coefficients
multiplying the variable equal to known value on the right side. In this p - the subscript p
is used for node of interest. If you solve this equation then you get
ϕ
at the node of
interest p at the current time level n. Now, the question is whether to use that value as it
is or whether you can relax little bit and then use it for the next iteration, such procedure
it is what known as under relaxation procedure.
Say this equation linear equation
a way as soon here ϕ n
ϕ n is allowed to change by a fraction α ϕ in such
to ϕ n−1 that is the previously obtain value minus α
new value with the new old value. So, this difference
ϕ new − ϕn−1
times
will tell how much
the difference has happened between last iteration or last time value with the current
iteration or current time value. You take a fraction of it that is what is given by the factor
α , and you can add or subtract the old value, where
ϕ new
is given by previous
expression as shown here.
(Refer Slide Time: 19:41)
Now, if you employ that under relaxation procedure in the linear system of equation,
they get rewritten in the form as shown here including relaxation factor. So, in
programming it the easy all that you have to do is explain alpha the beginning of the
calculation then the values are adjusted according to the expression as shown here. First
485
term on the left side, and term on the right side are modified diagonal elements and
source vector respectively.
is called relaxation parameter. So, while solving
αϕ
equation, you can appropriately define relaxation parameter for different variable. For
example, velocity can have one value, pressure can have another value, and if you are
solving for turbulent flow k and
ϵ
variables can have another value. So, alpha is the
relaxation parameter which varies for different variable. If
called under relaxation; if α >1
α <1
such a procedure is
hen the procedure is called over relaxation. It is
different for different governing equation and the value is decided based on different
numerical trails and experience.
So, in this week, we have seen in matrix inversion procedure; there are two methods direct methods and iterative methods. We went in detail for direct method, Gauss
elimination, tridiagonal matrix algorithm, L U decomposition method. We also listed five
methods under iterative methods and we learned a technique called preconditioning
technique to be used for iterative methods. We also learned couple of other things what is
known as how to proceed to get solution segregated solver and simultaneous solver.
There is also one more technique called under relaxation technique, which helps in fast
convergence. With this, we come to the end of this week class; next week, we are going
to have a demonstration of a code, description of the problem, how the code is written
and how to obtain different results.
Thank you.
486
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture - 38
Greetings and it is my pleasure to welcome you again to this course on CFD. We are now
onto the week eight of this course, and this is the last week for this course. So far, we have
lean different techniques in CFD. And in this week, we are going to particular see how some
of these techniques are applied for a problem. So, in this week, we will try to explain
different discretization, convection and diffusion, pressure velocity coupling method, time
integration procedure for a test problem. And we will also display corresponding code and
how these are actually implemented in a working code. For this purpose to take a test
problem what is known as lid driven cavity.
(Refer Slide Time: 01:30)
So, we will first define the problem then explain different numerical strategy to approach
CFD to get a solution for this problem. We will do detailed procedure and explanation of
every step, and display corresponding code. Once you get solution then we are interested to
see the result in different form, and that stage of CFD is what is known as post processing. In
addition to primary variable in its forms, you also have derivatives of primary variables and
we will explain how to get different post processing using this primary variables and show
that result.
487
(Refer Slide Time: 02:35)
The problem considered is the lid driven cavity shown here what is shown here is a 2D
cavity, it can be three-dimensional also. So, in this, we have depth and then width depending
on the ratio of depth to width, it can become the square cavity or cavity of different aspect
ratio. Now all the three sides are wall that is have it is representation as hash line; on the top,
you have the lid and it is driven by a velocity and for this particular case u is equal to u, a
specific velocity is given. Now this can be one particular value or it can be a function of sin
or cos. If it is 2D then it becomes square cavity, if it is 3D it become three-dimensional cubic
cavity.
Now in this problem, the geometry is very simple and you can also understand from the
figure. Once you have this driving velocity imposed on one side of the problem then you
have a primary vertex form at the centre, and you have a corner vertex form at these two
corners. You can have a Dirichlet type of boundary condition that is specified a particular
value for the variable this is what is known as Dirichlet condition this we explain in the week
one or week two lecture. So, in this figure Dirichlet boundary condition is in terms are
velocity as you can see here
u=v=0
you have velocity driving condition
on all the three sides of the wall. Then on the top,
u=u ,
v =0 . It is also possible to prescribe
Neumann type of boundary condition for pressure. Depending on the Reynolds number it
may be a laminar flow or turbulent flow. As I mentioned in the beginning, you have primary
vertex form and you have vertex from and these two corners. Now depending on Reynolds
488
number a primary vertex either stays at the centre or it moves to one corner. Secondary
vortices appear very near the bottom right and left corners.
(Refer Slide Time: 05:31)
The intension of this week class is to completely understand the concepts of discretization
solving the Navier-Stokes equation using a model problem of flow inside a lid driven cavity.
As I explained previous slide for this problem the top wall in other words the lid of the cavity
is moving to the right with a specific uniform velocity and thus create the flow inside the
cavity. As shown here, so u=1m/ s, it is the specific velocity given and the lid is moving
from left to right.
489
(Refer Slide Time: 06:21)
We mention you can have a vorticity steam function formulation of the governing equation or
it is also possible to solve using primary variables. When you say primary variables they are
u, v, w and pressure, because we consider two-dimensional situation, we have only u and v
pressure is always there. For the sake of simplicity, we consider explicit Euler time
integration, because it is explicit, we learn scheme is conditionally stable. Reynolds number
we need define, and we need to have a length scale and velocity scale. The length scale in this
problem it can be a side of the cavity or it can be aspect ratio of the cavity. In this particular
problem, because we are considered square cavity all the sides are equal. So, the side of the
cavity can be length scale and the top lid with the driven velocity is considered as the velocity
scale.
So, the Reynolds number computed based on this length scale and velocity scale is 1. This is
only for demonstration purpose; you can increase the Reynolds number and investigate the
flow inside this problem. We have a diffusion term on the right side and convection term on
the left side. So, diffusion term and convection term in Navier-Stokes equations are
discretized explicitly. So, coefficient matrices are not formed for solving u as well as v
momentum equations. Then we have procedure called pressure velocity coupling; we learned
three four methods that is MAC algorithm, SIMPLE, SIMPLE R, SIMPLE C and projection
method. In this demonstration problem, we use what is known as projection method to solve
incompressible flow equation.
490
(Refer Slide Time: 08:46)
You also learnt what is projection method. However, for the sake of completeness, we repeat
the steps involved in projection method. There are basically three steps; in the first step, we
solve momentum equation without considering pressure term. So, in this problem, we are
considering 2D situation, so you have u-momentum equation and v-momentum equation. In
u-momentum equation, we have
−∂ p
−∂ p
; in the v-momentum equation we have
. So, in
∂x
∂y
the projection method, we do not consider these pressure gradient term and solve without
considering, hence the obtained solution does not satisfy the divergence condition that is
 ⋅V =0. Based on this velocity we set up the Poisson equation for pressure, which is linked
with continuity equation also, hence we get the Poisson equation. Once you solve Poisson
equation then you get the pressure. Project the intermediate velocity onto the divergence free
vector space using the pressure calculated above; and this pressure act as a Lagrange
multiplier and ensures continuity is satisfied, this is important step in the projection method.
491
(Refer Slide Time: 10:24)
Once you solve the momentum equation neglecting pressure terms, we get equation as shown
here. So, you have a time derivative term as the first term on the left hand side and then
convention term as a second term on the left hand side then we have only diffusion turn on
the right hand side. We are not considering any other source term hence the equation appear
as simple as shown here. Pressure terms are neglected, only convection and diffusion terms
are consider. Discretization is performed for convection term as well as diffusion term at nth
time step, making the scheme explicit. So, the discretized equation for u momentum equation
is shown here, all are evaluated at nth time level; new time level quantity to be determined is
given by the superscript star, because pressure is not considered, obtain velocity is the
temporary velocity field since we use superscript star.
492
(Refer Slide Time: 11:40)
Now to obtain the pressure Poisson equation, divergence of moment equation is consider,
considering only the pressure terms. So,
n+1
*
∂u
=−∇ p and that implies u −u =− ∇ p. Take
∂t
Δt
the divergence of the above equation to obtain equation what is known as pressure Poisson
equation. So, we do that step here as shown. So, we get − ∇2 p on one side, and source term
for the pressure Poisson equation is on the left side. Now we can repeat all the steps for the
second momentum equation that is v momentum equation. Since the flow should be
divergence free, but that is what the meaning of ∇ ⋅ v=0; in other words continuity is
satisfied. At new time level n+1, we have the condition ∇ ⋅ un+1=0. Now using this condition,
−∇ ⋅ ( u* )
the above equation gets reduced to as shown here
=− ∇2 p, and this equation is what
Δt
is known as a pressure Poisson equation.
493
(Refer Slide Time: 13:14)
Using the pressure calculator the previous step that is one solve the pressure Poisson
equations you get pressure p every where. it is also what getting remembered that passion
equation or the Laplace equation or elliptic equation. And we need to have boundary
conditions prescribe on all the sides using the pressure calculator in the previous steps can
*
project intermediate velocity u on the divergence free vector space as shown here. So,
un+1 −u*
*
=− ∇ p and un+1 is the final corrected velocity equal to u − Δ t ∇ p and this is
Δt
important steps in the projection method and this is called projection step.
(Refer Slide Time: 14:17)
494
Now, we have a test case problem lid driven cavity define the problem with the boundary
conditions. We already mentioned top wall lid is moving to the right the velocity of 1 m/s. If
you are using velocity to prescribe boundary condition then you have Dirichlet boundary
condition or if you using a pressure then you have Neumann of the boundary condition, the
cavity is square with a dimensions 1 metre by 1 metre and for both velocity as well as
pressure type of boundary condition there is a description given here. So, the first one is for
velocity as you can observe here, the Dirichlet boundary condition applied for velocity u
equal to zero v equal to zero and so on. Now if you using pressure to apply Neumann type of
boundary condition and that is what shown here. So,
∂p
∂p
=0 on this vertical faces and
=0
∂x
∂y
on this horizontal faces.
(Refer Slide Time: 15:26)
We also learn about storage of variables; we have three possibilities, one is collocated,
staggered and then semi-staggered. We learnt collocated method of storing the variable result
what is known as checker board problem and there is a pressure oscillation. To avoid that we
have another method what is known as staggered way of storing the variables. In staggered
scheme, we have the u-velocity unknown are located on the vertical faces and v velocity
nodes are located on horizontal faces; and pressure is stored at the centre of the cell. The gird
runs from i is equal to 1 to i is equal to imax; you specify how many grids are required in x
direction and how many grid you design in the y direction. This is the simple problems, hence
we use structured grid; we can use again uniform grid or non-uniform gird. In this problem,
495
we define with the uniform grid. Staggering the u, v and pressure unknowns removes the
pressure oscillation which is a case in the case of collocated grid arrangement.
(Refer Slide Time: 16:48)
Steps in simulating cavity flow; first we do grid generation then discretize the governing
equation and solve the momentum equation to obtain intermediate velocity
u* ,
v* ;
solve pressure Poisson equation, project the intermediate velocity onto the divergence free
space using the pressure calculated in the previous step, then repeat the process till the
solution is converged. So, we have a convergence criteria defined; based on that convergence
criteria decide whether iteration needs to be stopped or to be continued. Once you get
solution then you are interested in post processing. Post processing of the results can be in
many forms, you can have contours, you can have a line or can go for advanced post
processing, stream function, vorticity contour and so on.
496
(Refer Slide Time: 17:56)
So for the purpose of explanation, we take a simplified grid, structured uniform grid with the
4 by 4 grid points that is four in the x-direction, four grid points the y-direction. We define
uniform grid in such a way Δ x= Δ y . Three cells are created along x-direction and three cells
are created along y-direction. The grid coordinates run from i equal to 1 to i equal to imax, j
equal to 1 to j equal to jmax along x and y direction respectively. And this is a gird
arrangement shown here. So, i is x direction, j in y direction, we define four girds in i
direction, so 1, 2, 3, 4; similarly, four grids in y direction 1, 2, 3, 4; so 4 by 4 results in three
cells in the respective directions. So, we have totally 9 cells. We are going to follow finite
difference method of solving or discretization the equation, and we also mention staggered
grid is used to store variables. So, dx and dy are uniform, because we define number of grids
in x direction and y direction to the same, that is 4 by 4 in this case, we can find out what is d
x and d y.
497
(Refer Slide Time: 19:40)
So, this is the corresponding code that is used to generate grid. So, we have a command; gird
size and other parameters; i run along x direction, j runs along y direction. Re is Reynolds
number; dx dy cell sizes along x and y direction; dt is a time step value velocity is actually lid
velocity. We already defined imax to be four actually change into any number; this is a
number of grid size in x direction similarly for y direction j max equal to four this is the grid
size in y direction. And this is required in later, I am now showing you actual working code
written in Matlab. So, what is shown here is a beginning of that code. So, some parameters
needs to be defined beginning of the code and this one such parameter what is shown here is
the iteration that is given as numbers twenty thousand and this is the tolerance limit or
convergence limit that is error one ten to the power minus four; Reynolds number is 1,
velocity is 1. So, in this particular slide, we are interested to see how the grid is generated and
what is a corresponding code available to generate a grid.
So, we have compute parameters, then dx=1 / ( imax −1 ) and dy =1/ ( jmax − 1 ). We decide
number of grid lines in the particular direction that is given by imax and jmax, then the
starting point for x for grid in the x direction. So, x = 0, it goes to 1, and with the
Δx
it
that is defined as dx. Similarly in y direction, it starts from y = 0, and ends at 1, because we
have define the side of the square cavity as 1, and we have also explain the dx equal to dy; for
simplicity we are considered dx is equal to dy. And in this particular line, we have y is equal
to zero, dx it can also be dy and starting from y = 0 to y = 1.0. In this module one of this
week, we have explained the test case problem and then we have decided on discretization
498
procedure, pressure velocity coupling, storing of variables, grid arrangement then I displayed
actual working code, how the grid is generated. In the next module, we will go to next part of
the algorithm where we talk about discretization of convection terms and diffusion term.
Thank you.
499
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture – 39
(Refer Slide Time: 00:28)
Greetings and welcome again to this course on CFD. In this module, we are going to talk
about discretization of convection term and diffusion term in detail. Last class, we have listed
algorithm steps to do the test case problem of flow in a lid driven gravity, grid generation,
discretization of the governing equation, solving the momentum equation to obtain
intermediate velocities, solved the pressure Poisson equation, project the intermediate
velocity on a divergence free space, using the pressure obtain from the pressure Poisson
equation, repeat the process till the convergence is obtained. Once you get solution then we
do post processing. So, in this particular module, we are going to talk about two steps two
and three that is discretization of the governing equations and solving the momentum
equation to obtain intermediate velocities. As we did in module one, in this module also, we
will show corresponding code and explain each step.
500
(Refer Slide Time: 01:27)
The governing equations are discretized on a staggered grid we mentioned in the last module,
we have three options staggered grid, collocated grid and semi staggered grid. Collocated
grid results in oscillation, hence we go for staggered grid. And we are using finite difference
method to solve the equation, the staggered grid arrangement is shown in the next slide. uvelocity nodes are present on the vertical faces and v-velocity nodes are present on the
horizontal faces, and pressure is stored at the centre of the cell.
(Refer Slide Time: 02:03)
501
And this is a schematic to explain what is staggered grid. So, we have vertical thick lines as I
am showing here, then you also have a dashed vertical lines as I am showing here. Then we
have horizontal thick lines, I am showing now. And in between two horizontal thick line we
have a dash horizontal lines as I am showing here. And this is staggered arrangement for final
volume procedure. So, u velocity is stored as shown here, this is a u velocity, this is a finite
volume cell for solving u momentum equation, and this is a finite volume mesh for solving v
momentum equation. And pressure or any another scalar in stored in this finite volume mesh.
So, as you can observe u, v and pressure are stored at different location that is why the name
staggered grid.
(Refer Slide Time: 03:17)
For the problem that we have considered you are following finite difference procedure, hence
for the finite different procedure and for the problem the staggered grid arrangement is shown
here. We have i that is grid lines x direction running from 1 to i equal to i max, we define
four grid in x direction, so 1, 2, 3, 4 vertical lines; similarly four horizontal lines for grid in y
direction, so we have 1, 2, 3, 4 and that is running from j equal to 1 to j equal to j max,
because it is staggered, we have u velocity which is shown here by a triangle and v velocity
which is show by circle and pressure at the centre of the cell which is shown by into mark.
So, you can observe in finite difference procedure for staggered grid, velocities, how the
velocities are stored, u velocities are stored on the vertical face, v velocity are stored on
horizontal face, and pressure is stored at the centre of the cell. We have defined 4 by 4 mesh
arrangement and that results in nine cells.
502
(Refer Slide Time: 04:43)
Now, we have define boundary conditions in two different forms you can have a Dirichlet
type of boundary condition, where use primary variables and you can have a Neumann type
of boundary condition where we use pressure. Now to apply boundary condition, we need to
have what is known as a ghost cell that is cell beyond the actual computational domain. So,
what is shown here is for y direction the thick black line is actually is the actual grid
arrangement, so 3 by 3 then we have a ghost node define extending the domain. So, we have
a red colour that is a ghost line. So, j is actually jmax+1 because jmax is actually the last
horizontal black colour line.
Now, we define one more ghost node in y direction in on the both sides. So, one on the upper
side, j is equal to jmax+1; another one on the lower side that it is beyond this j = 1 this shown
by the red colour. This is required to apply the boundary condition. So, u-staggered grid with
the ghost cell for boundary condition implementation. So, number of u velocity unknown
becomes imax, because we do not have a any extra line in the i direction when you solve u
momentum equation, we have only extra in j-direction, so that is jmax +1 is considered.
Number of u velocity unknown becomes imax × jmax +1.
503
(Refer Slide Time: 06:39)
Similar arrangement for v cell, we will look into that when we do the v-momentum equation.
And this is the code snippet which actually does what we have just now explained nx is the
number of cells in x direction; ny number of cells along y direction, and we have a variable
declaration, p is for pressure. Now we have defined array size for the p zeros imax +1 and
jmax +1. So, pressure unknowns are nx+2 × ny+2 including ghost nodes, because when you
come to pressure, it is appearing both the equation. So, we have a ghost node appearing x
direction as well as in y direction. Then this is RHS p is the pressure Poisson equation, you
have a source term on right hand side, and that what is define here as RHS. And there again
initialised with zeros of imax +1 and jmax +1. Then we have to calculate divergence and that
is also stored vertical velocities are actually v. So, v_star is a temporary velocity which is the
first step in the projection method. So, v_star are define zeros imax+1 to jmax and v is actual
velocity again define zeros imax +1 and jmax.
So, v is a velocity unknown this is with nx+2 multiply by ny+1 because when you solve v
momentum equation you required ghost nodes in other direction, so that why it becomes
nx+2, and ny+1 is number of nodes available in the y directions itself. Similarly for u
velocity which is otherwise horizontal velocity u_star and u they are also define array with
array imax and jmax+1. So, you can observe here for v_star it is imax+1, j max; for u_star it
is imax and jmax+1. This is for intermediate velocity and u velocity. And when you solve u
velocity then we have a ghost node defined in other direction. So, it becomes nx+1 * ny+2, it
is a number of minimum required array size.
504
(Refer Slide Time: 09:13)
We follow the projection step method. So, momentum equation is solved without considering
the pressure term momentum equation is discretized in the following manner. We will
explain first with the help of u momentum equation, the procedure is same for v momentum
equation. So, u momentum equation after neglecting pressure term is written here we need to
discretized and the discretized equation is as shown here. So, it is explicit we already
mentioned. So, we have the all the known quantity with superscription only unknown is star
quantity. So,
u❑ − un
and all the known’s are taken to the other side as shown here, where u is
Δt
the velocity vector and of course it is for v also its included.
505
(Refer Slide Time: 10:10)
Consider the u momentum equation, the above discretized equation is written specifically
now for u momentum equation as shown here. Now there is one small difference between the
first equation and second equation for convection term. This u n can be taken inside the partial
derivative and that is written here as
∂ n2
( u ) . You can actually perform this operation that is
∂x
n
∂ n2
( u ) you can write it as 2 un ∂ u , and other term; and one term actually goes to zero
∂x
∂x
because of the continuity. So, it is possible to write the convection term in different form and
one form is as shown here. This is for convenient because u is define at one location. So,
anyway you can take into the part inside the partial derivative, and any additional terms
which is coming because of this partial derivative inclusion will go to zero once you satisfy
the continuity, and vn again is taken to the other side as shown here.
So, if you do the partial derivative for both these term together, you will have one extra term
from the first term as
∂u
∂v
. Similarly one extra term from the second term as
, if you sum
∂x
∂y
them up, it is actually the continuity which is actually zero. Consider the first diffusion term
that is a second term here. So, it is written as shown ν
(
∂2 un ∂2 un
+
and ν is maintain. Now
∂ x2 ∂ y2
)
we follow second order central differences scheme for the derivative, the second derivative
506
∂2 u n
that is what is shown here. So, for the first term in the bracket
the discretized equation is
∂ x2
shown here, because we mentioned it is explicit, we have all superscript n. So,
n
n
n
ui −1 , j+ ui+1 , j − 2u i , j
. Similarly for the second derivative in y direction and that is what is
Δ x2
shown here.
(Refer Slide Time: 12:48)
Corresponding code, so we have memory allocation u_star. α is -dt/(Re)/(dx^2*du^2).
Compute the explicit term, diffusion terms are calculated here and we follow staggered grid.
So, we have the east, west, north, south terminology to be used here. So, u east and u west are
calculated by taking the average of the velocities at staggered node points, because we want u
at staggered location. So, for i = 2 to imax-1 and for j=2 to jmax. diffusion term at i, j equal to
α ¿ dy 2 ( ui+1 , j − 2u i− 1 , j ). So, this first three terms in this particular bracket or for the first
∂2 u
∂2 u
derivative
second order central differences scheme for
because we have α define
∂ x2
∂ x2
has − dt /ℜ / ( dx 2 dy 2) , we do not have a Δ y 2 , we are actually multiplying here α, so that needs
to be accounted properly, hence we have Δ y 2 multiplying the entire factor.
507
∂2 u
2
Similarly, when you do the second derivative for y direction that is
2 , we have only Δ y ,
∂y
we do not have a Δ x 2 where as alpha is generically define considering both Δ x 2 and Δ y 2 . So,
extra Δ x 2 needs to be accounted properly, hence we have Δ x 2 multiplying the finite
∂2 u
difference of
and i shown here, so ui,
∂ y2
j+ 1
– 2ui, j + ui, j-1. So, this is actually central
differencing one is the point of interest and one on the right side one on left side.
(Refer Slide Time: 15:33)
Next convection term we have u dou u
∂u
∂u
+v
and we can derive convection term
∂x
∂y
considering the u and v inside the partial derivative. So, the first term is actually
n n
∂u n2 ∂ ( u v ) . So, if you actually perform the partial derivative on the terms inside the
+
∂x
∂y
bracket, you will get two additional terms and those two terms together we will go to zero
because of the continuity equation. Now we are following staggered grid arrangement on
finite difference procedure. So, we have a north east west south terminology the coming into
the picture. So, we have first term in the discretized form is shown here
v nnorth2 − v nsouth2
the second term discretized form unorth at nth level.
.
Δy
508
uneast 2 −unwest 2
plus for
Δx
Now what you have to be careful is we have to evaluate u at east west north and south and
there done separately here now we have to recall what we did in finite volume treatment on
convection term it is a convection terms are non-linear that is u
phases and we need to get
∂u
we need to evaluate u at
∂x
∂u
at phases and that is what is followed here we explain three
∂x
different procedures that is pure upwinding central differencing type of approximation, linear
approximation, QUICK approximation, hybrid type etc and what is shown here is a linear
approximation or central difference in type approximation. So, u at east is
ui , j+u i+1 , j
;
2
similarly for u at west, and u at north, and u at south, and v also we follow the same and that
is from j direction. So,
v i , j+1 + vi +1 , j+1
v
+v
similarly v at south i , j −1 i +1 , j − 1 . We explain all this
2
2
in detail, when we did finite volume formulation for convection term.
(Refer Slide Time: 18:28)
Corresponding code snippet is given here. So, u for i = 2 to imax-1; for j=2 to jmax u at east,
u at west, u at north, u at south, v at north, v at south all are calculated. Once you calculate,
then you write a convection term for i comma j as explain the discretized equation and it is
shown here, dx and dy are already defined, hence they are directly used. Now we have dx
and dy for simplicity sake uniform and equal. If it is not uniform then we have to take
corresponding weightage in dx and dy will also be as a function of array.
509
(Refer Slide Time: 19:24)
In the last slide, I mentioned about rewriting convection term, I did not explain at that time
why are how it can rewritten and there is no change in the actual equation. This slide as well
as the next slide, I going to explain in detail, how the convection term can be written. So,
u ⋅ ∇ u is written as u
u
∂u
∂ u ∂u 2
∂u
∂u
∂u
∂u
+v
.
=2u
=u
+u . So, 2 u expanded as
∂x
∂y ∂x
∂
x
∂x
∂x
∂x
∂ (uv )
∂u
∂u
∂u
∂v
+u
=v
+u
and then
. If you put these two together then we get
∂x
∂x
∂y
∂y
∂y
∂u
∂u
∂u 2 ∂ ( uv )
∂u
∂u
∂u
∂v
+
=u
+v
+ u
+u
. So, we have u
and v
grouped separately as
∂x
∂y
∂x ∂y
∂x
∂y
∂x
∂y
(
)
shown here.
510
(Refer Slide Time: 21:07)
We rewrite that equation again as shown here, but in an incompressible flow, we know the
continuity equation for two-dimensional flow as shown here,
rewritten form of the convection term that is
∂u ∂ v
+ =0. Hence the
∂x ∂ y
∂u
∂u
∂u 2 ∂ ( uv )
+v
same as u
, hence there is
+
∂x
∂y
∂x ∂y
no additional term introduced, because of this rewriting.
(Refer Slide Time: 21:46)
511
So, u momentum equation, we follow explicit discretization the computation of intermediate
velocities become a simple substitutions because we do not need to store, it is directly related
to velocity component in the form of discretized equation. So,
u* − un
equal to minus
Δt
convection terms plus diffusion term without pressure term. So, the left hand side,
convection term is brought to the right hand side, and diffusion term on the right hand side
remain same, we follow explicit formulation hence it is written as simple as shown here. So,
u* =un + Δ t × this term.
(Refer Slide Time: 22:32)
So, corresponding code is shown here for i= 2 to imax-1 and for j=2 to jmax. We calculate
intermediate velocity, we use u*i,j as ui , j + Δt ; in the code we use dt multiplying convection
term and diffusion term end. Once you solve equation, you need to ensure implementation of
*
*
boundary condition and that is applying boundary condition u on the left wall, ui , j to j max
is equal to 0, because we are following Dirichlet type of boundary condition using the
primary variable we mentioned u equal to v equal to o on all the three walls. So, we have a
*
left wall, right wall bottom wall and the top wall we have velocity specified for u. So, ui , j 1
*
to i max j max+1 that is in the top line grid line is equal to 2 into velocity minus uimax , jmax .
In this module, we have seen in particular convention term discretization, diffusion term
discretization, and we learned what is known as to ghost node, ghost node cell in x direction
and y direction when you solve respectively u momentum equation and v momentum
512
equation for the implementation of boundary condition. We also showed corresponding
codes and including implementation of boundary condition. In the next module, we will
proceed with the some other explanation and proceed with all the next stage in the algorithm.
Thank you.
513
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture - 40
(Refer Slide Time: 00:42)
Greetings and it is my pleasure to welcome you to special course on CFD. In this week, we
mention, we will have a demonstration of a working code, employing different numerical
strategies we learned during the last seven weeks. The problem we consider to demonstrate
the flow lid driven cavity. We listed in last module algorithm or steps involved in arriving at
a code and numerical strategy. Step one grid generation then discretization of the governing
equations, solving the momentum equation to obtain intermediate velocities, solving pressure
Poisson equation then project the intermediate velocity onto a divergence free space, using
the pressure obtained through pressure Poisson equation, and repeat the above steps until
convergence is ensure. Once we obtained the results, then we look it to the flow through
different post processing, and how to plot different quantities.
The last two modules we basically did how to do grid generation, because the geometry is
very simple, we consider uniform grid and the structured grid, 4 by 4 mesh arrangements and
then we started doing something about governing equation discretization. We started with umomentum equation; in the u-momentum equation, we had diffusion term explained in the
last module. In this module, we will particularly focus further on u-momentum equation,
514
considering the convection term; and then extend this procedure for the next momentum
equation that is v momentum equation.
(Refer Slide Time: 02:29)
Continuation of the last class, whenever you solve momentum equation, we have to
implement boundary conditions, and we defined because it is wall on three sides for the
primary variable u and v, we define no slip condition. And on the top wall, we had velocity
driving the lid as the boundary condition. And the pressure, we apply Neumann type of
boundary condition that is derivatives of pressure equal to zero. So, first we see, how to
implement boundary condition for u velocity. So, left wall u and for left wall i is actually 1,
and j running from 2 to j max equal to 0.0. On the right wall, grid in x direction is i max, and
again it is running in the j direction from 2 to j max equal to 0.0. Bottom wall since for u
node, they do not coincide with the wall, we have to somehow ensure the no slip condition is
also satisfied. So, we take average of north and south nodes, which indirectly will ensure the
no slip condition is imposed on the bottom wall.
So,
mathematically
it
is
u (1 :imax ,1 ) +u ( 1:imax , 2 )
=0
2
which
will
result
in
u ( 1:imax , 1 )=−u ( 1 :imax , 2 ). So, this way you ensure appropriate boundary condition
imposed on the bottom wall. On the top wall, we mentioned the lid is moving to the right
with the velocity of 1 metre per second, and that is also ensure in the similar way that is take
a
average.
So,
in
this
case,
now
515
it
is
u ( 1:imax , 1 );
in
j
it
is
u (1 :imax , jmax ) +u ( 1 :imax , 1: jmax )
=0 and that should be set to the desire velocity that is
2
1.0. Now you rearrange, you get expression u ( 1:imax , 1 )=2 −u ( 1:imax , 2 ).
(Refer Slide Time: 05:28)
*
Now in terms of code, you see that u because, we first do without pressure term included
*
*
solve the u-momentum equation. So, such a velocity is given superscript ,u , v that they are
all predicted velocities then once you corrected, they will be set to that actual velocity. So,
this is done immediately after solving u momentum equation without considering pressure
*
*
term. So, it is called u , so u ( 1, 2: jmax ) =0 . So, this is for enforcing boundary condition on
*
the left wall; similarly the next line u ( imax , 2 : jmax )for j direction equal to 0, this is to
impose boundary condition on the right wall, and similarly for bottom wall as well as for top
wall.
516
(Refer Slide Time: 06:37)
We have now explained in detail u-momentum equation considering separately diffusion
term and convection term, and how to impose boundary condition. We will extend this
procedure for the second momentum equation that is v-momentum equation, without pressure
term in the v-momentum equation, equation is written as shown here, because we are solving
without pressure term, the velocity is given superscript. So, it is
term from the left side is got to the right side. So, un
v* − vn
equal to convection
Δx
∂ vn n ∂ vn
with a minus sign, because it
+v
∂x
∂y
is brought by the left side plus this viscous diffusion term as shown here. We mention we are
solving explicitly, so all the superscript for other quantities are with n.
Last module we also mention the convection term can be rewritten as shown here. So, this u n
is brought inside the partial derivatives as shown here that is
∂ n n
( u v ) plus; again for the
∂x
second term, vn is brought inside the square partial derivatives. So,
∂ n2
( v )plus the diffusion
∂y
term. In the next slide, I am going to explain how this can be written and what actually it
results. Consider the diffusion term first. So, diffusion term that is ν
(
2
∂ ( n ) ∂2 ( n )
v + 2 v at nth
∂ x2
∂y
)
level, and that we are using second order central differences scheme. So, the first term is for
517
the x direction, so we have i-1,j, i+1, j-2 times v i, j evaluated at the nth level divide by Δ x 2.
Now the second term is for the second derivative in the y direction that is evaluated again
using central differences scheme in the second direction, so vi,
j-1
+ vi,
j+1
- 2 times vi,
j
evaluated at nth level divided by Δ y 2 .
(Refer Slide time: 09:12)
We mention in order to have boundary conditions enforce we should have ghost cells that is
they are not actually part to the grid that have you define, but there are extra nodes in
particular directions. And for simplicity, we take those extra grid lines at the same distance as
a original grid lines. For example, we defined 4 by 4 grid lines. So, we have four in vertical
line, so 1, 2, 3, 4; similarly four in the horizontal, so 1, 2, 3, 4. Now for the v momentum
equation, because we are following the standard grid arrangements of variables, we need to
have one more extra grid line on either side as a ghost cell or ghost node. So, these are shown
by a red colour line. So, this is in the left side and another one is in the right side as shown
here.
Now for simplicity sake, we defined Δ x of the ghost grid line and ghost cell same as the
immediate adjacent cell. Similarly for the other direction, because v is in staggered grid
arrangements, they are all stored along the horizontal line and they are shown this picture
with the full circle as shown here. So, this is for the v velocity, similarly for these are all
storing v velocity. So, v staggered grid with ghost cell for boundary condition
implementation. We have had a similarity when we did u momentum equation, but it was in
518
the j direction; now for v momentum equation, it is in the i direction. Because of this extra
ghost grid or ghost cell number of v velocity unknowns now becomes imax+1 * jmax.
(Refer Slide Time: 11:17)
So, corresponding code part of the code snippet, so function v_star old v equal to v
momentum and you have argument defined as i max, j max, dt, dx, dy, Reynolds number u, v
and old v. So, v_star you defined memory zeros imax+1, jmax; convective term zeros.
imax+1 jmax and α is a new variable you defined. If you can recall we have unsteady term on
the left side. So,
v* − vn
equal to the convection term brought from the left side to the right
Δt
side and then we have a diffusion term. The diffusion term
∂2 v n ∂2 v n
+
. So, if you discretize,
∂ x2 ∂ y2
we have Δ x 2, Δ y 2 , and this α is taking those terms those coefficient appropriately. So, -dt is
brought from the left side and Reynolds number associated with ν, and Δ x 2 and Δ y 2 .
∂2 v
So, when you write the diffusion term, we have α, and for the first term that is
. We
∂ y2
explain that we are doing second order central differences scheme then we have
corresponding terms here that is vi+1,j, vi,j, vi-1,j and this should be divided by Δ x 2 because α
has both Δ x 2 and Δ y 2 , we multiply by Δ y 2 for the first step. Similarly the second term in the
diffusion term is
∂2 v
; if you write it in difference form it is by Δ y 2 , and we are multiplying
∂ y2
519
by α commonly. So, extra term is adjusted in numerated as dx 2 into the second order central
differences scheme for the second term, so we have v evaluated v taken from
vi , j +1 − 2 v i , j + v i , j − 1.
(Refer Slide Time: 13:48)
So, once we get diffusion term explained, we will now move on to convection term. So,
convection term is rewritten including the u multiplying and v multiplying into the partial
derivative. So, it is
∂ ( un v n ) ∂ v n2
, and we write in terms of north, east, west, south. So, we
+
∂x
∂y
v neast 2 − v nwest 2
v nnorth2 − v nsouth2
have u east at nth level;
. Similarly for the second term as
. Now if
Δx
Δy
you recall what we learned in week four lesson, convection term treatment, we have a
different approximation procedure, central differential type of approximation, pure
upwinding approximation, QUICK type of approximation, power law scheme, hybrid
scheme.
So, in this, we implement central different type of approximation. So, u at east is evaluated
from the neighbouring nodes in this way. So,
corresponding west is i minus 1, so
ui , j+u i , j +1
; similarly for the west, the
2
ui −1, j+1 +ui −1 , j
. Similarly for v, so v at east is evaluated by
2
520
central differential type of approximation similarly for the other one; and also for north and
south. So, once we defined all these, we see corresponding code.
(Refer Slide Time: 16:02)
So, for i running from 2 to imax and for j running from 2 to jmax - 1, because on the top that
is the last j, we have a boundary condition implemented. So, it is only up to j - 1; u east, veast
then uwest, vwest, vnorth, vsouth all are individually evaluated based on expression we have defined
in previous slide. Then all are put together as convective term i comma j equal to minus on
for one term plus other term. So, these are individually written here, coefficient for
coefficient for
d (u v )
and so on for each line.
dx
521
d (u v )
dx
(Refer Slide Time: 17:04)
V momentum equation because we have following explicit discretization, the computation of
intermediate velocity becomes a straight forward as shown here.
v* − vn
equal to minus
Δx
convection term plus diffusion term. So, we directly used, we have independently evaluated
convection term, we have independently evaluated diffusion term. So, we directly used this
*
expression to get what is known as a v . So, v *=v n + Δ t ( − convectionterm +diffusion term ) .
(Refer Slide Time: 17:42)
522
So, compute the fractional step velocity, otherwise v_star(v:imax, 2:jmax) and for j, 2 to jmax
− v star – v ( i, j ) + dt ( convection term ) – diffusionterm. As we did in u-momentum equation, as
soon as we solve particular equation by discretization procedure, we need to enforce
boundary condition; we did that for u as u _star boundary condition, similarly we should do
for v_star also.
(Refer Slide Time: 18:23)
So, top wall, v ( 2 :imax , jmax=0 ); bottom wall, v ( 2 : imax , jmax=0 ); left side wall since the
velocity nodes do not coincide with the wall and average of the east and west nodes is
considered to apply the boundary condition. So,
rearrange
this
expression
as
shown
here.
v ( 2,1 : jmax ) + v ( 1 , 1: jmax )
=0and if you
2
Similarly
on
the
right
side
wall
v ( imax+1, 1: jmax )+ v ( imax , 1: jmax )
=0, and if rearrange you get the expression as shown
2
here and this is what we enforce the boundary condition code as shown here.
523
(Refer Slide Time: 19:32)
So, boundary conditions are v star ∈i direction 2i max ∧ jis 1equal zero , this is for bottom wall;
v star ( 2:imax , jmax )=0, this is for the top wall. Please recall on the top wall, we have imposed
velocity driving condition, but that is only for u velocity and v velocity is set to zero. Now for
the left v star ( 1,i : jmax ,1 )=− v star ( 2,1 : jmax )this on the left side. Again we should recall what
we did for u velocity on the bottom wall, because we do not have a node coinciding with that
particular wall, because we are following staggered grid arrangements, we do not have a node
coinciding with that wall, we need to have a rearrangements in such a way that boundary
condition is actually enforced. So for that only we have a extra ghost cell or ghost node. So,
the average between the ghost node and the immediate node adjacent to the boundary
condition location that is the left side wall is actually written this form. So,
v star ( 1,i : jmax ,1 )=− v star ( 2 ,1 : jmax ) , this is for node on the right of the left wall and this is
from the ghost cell. So, they are equated in such a way, the boundary condition v equal is to
zero is enforced on the left side wall. Similarly for the right side wall again using ghost node
and ghost cell, we have written line for enforcing boundary conditions for v_star. We did this
in detail for u_star in beginning of this lecture.
So, in this module, we continued the u momentum equation for enforcing boundary condition
then we repeated the procedure for v momentum equation. We consider separately
convection term, diffusion term, and how to put them together to get v_star; once you get
solution, we need to enforce boundary condition and we follow the same procedure as we did
for u for the right side, left side wall and for the top as well as for the bottom wall. In the next
524
module, we are going to talk about pressure term, projection method and subsequently
linking pressure and velocity.
Thank you.
525
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture - 41
It is my pleasure to extend greetings again to all of you. We are now onto the module four of
this week. In this week we mentioned, we will actually explain with a help of the working
code, how to write a code and for that purpose, we have taken a test case problem of flow in a
lid driven cavity. In the last three lectures, we explained about grid and then different
components of u-momentum equation, v-momentum equation. In other words, how to writes
separately for convection term, diffusion term and put term together to get
u* ,
v * . And
then we also explained how to enforce boundary condition as soon as you solve momentum
equation, we have to impose boundary condition, and for the left wall, right wall, bottom wall
and top wall respectively. Now in this module, we are going to talk particularly about the
pressure or the projection method, how to solve pressure Poisson equation and enforcing
boundary condition for pressure Poisson equation and corresponding code with explanation.
(Refer Slide Time: 01:36)
So for the sake of continuity, I am listing here all the steps that we mentioned to solve this
particular problem. So, grid generation we have already done; discretization of the governing
equations, separately convection term, diffusion term, solving the momentum equation to
obtain intermediate velocities
u*
and
v * . Now in this class, we are going to talk about
526
how to solve pressure Poisson equation. Then we project the intermediate velocity onto the
divergence free space using the pressure calculated through the previous step, correct the
velocities and then we repeats the steps until the solution is converged. Last step, once we get
all the variables we look into the flow to different post processing.
(Refer Slide Time: 02:25)
We mentioned we are following to do the pressure velocity coupling a procedure called
projection method. In projection method, there are three steps involved; first - solve the
momentum equation without considering the pressure term. So, we obtain what is known as
intermediate velocity denoted as
u*
and
v * , because we are not consider pressure term
it will not satisfied the continuity equation. In other words, ∇ ⋅ v=0. Then you solve the
pressure Poisson equation to obtain pressure gradients enforcing continuity or divergence free
condition that is ∇ ⋅ v=0.
Project the intermediate velocity onto the divergence free vector space using the pressure
calculated in the previous step. And in incompressible flows the pressure acts as a Lagrange
multiplier and ensures the continuity is satisfied. This is the step that involved in pressurevelocity coupling. Please recall we listed four methods MAC algorithm, Marker and Cell
algorithm, SIMPLE and different versions of SIMPLE that is SIMPLE R, SIMPLE C and
then projection method. For this demonstration, we are using projection methods.
527
(Refer Slide Time: 03:56)
This is the third step that is using the intermediate velocities obtain in the previous step that is
by solving u momentum and v momentum equation, pressure Poisson equation is set up and it
∇ ⋅ (u*)
is solved. So, we have
= ∇ 2 pwhich is the pressure Poisson equation. Discretization of
Δt
the pressure Poisson equation is done using the standard five point stencils. Such as
−
(
*
*
∂2 p ∂2 p
1 ∂u ∂ v
, this is the pressure Poisson equation, this is separately
+
+
=−
Δt ∂ x ∂ y
∂ x2 ∂ y2
)
(
)
obtain we already listed how to obtained this pressure Poisson equation.
528
(Refer Slide Time: 05:00)
So, you consider the left hand side of the pressure Poisson equation that is
(
∂2 p ∂2 p
,
+
∂ x2 ∂ y2
)
because it is secondary derivative we use second order central different switch scheme for
pressure. So, we get
p i+1, j+ p i− 1, j −2 pi , j
( Δ x )2
for the first term. Now for the second term that is
second derivative in the y-direction, we have
p i , j +1+ p i , j − 1 − 2 pi , j
( Δ y )2
. Pressure is not indicated at
any time level to account for the fact that pressure acts as a Lagrange multiplier imposing the
continuity constraint that mean the pressure is only local at the particular time. The above
discretization results in what is known as penta diagonal matrixes; again please recall we
mentioned different matrixes possible; tridiagonal matrix, just diagonal and penta diagonal
matrixes of different form. So, this pressure Poisson equation discretization of the pressure
Poisson equation will result in penta diagonal matrix. Coefficient matrix is formed with
special importance to the corner as well as edge nodes.
529
(Refer Slide Time: 06:34)
So, we have again ghost grid and ghost cells strategy to impose boundary condition. Please
recall what we learned in the two previous modules; separately we have done for u velocity
and separately we have done for v velocity. Then we respectively solved u momentum
equation and v momentum equation, because we are following staggered grid arrangement of
variable storage, we need to have one extra grid on either side for the respective equation.
And pressure is it the centre of the shell in staggered grid arrangement. So, we have ghost
grid as well as ghost shell on all the sides that is both x as well as in y. And those are shown
by this a red colour line. So, these are all extra cell in x-direction similarly in other xdirection; and for y-direction at the top as well as at the bottom. So, p staggered grid with
ghost cell for boundary condition implementation because of this extra ghost node or ghost
cell number of p velocity unknowns now becomes imax+1 * jmax+1.
530
(Refer Slide Time: 08:00)
Consider the left hand side of the pressure Poisson equation, so again that is what I am
showing here, we have already mentioned we are following second order central difference
scheme to get the second derivative, and then we mentioned it will result in what is known as
penta diagonal matrix.
(Refer Slide Time: 08:20)
So, corresponding code is displayed here. So, tnp is number is nodes imax-1 * jmax-1 that is
the total number of pressure nodes; and for j 2 to j max, and for i 2 to i max if j is not equal to
j max then we have define this. So, this for coefficients of pressure for the node i, j-1. We
531
have written similar thing for each location. So, this for example, this particular line is for
coefficients of pressure at i, j+1, we have written similarly for each. So, coefficient for p at
general nodes I, j is shown here, and I would like emphasize once again these special
treatments that is (i, j-1), (i, j+1), (i-1, j) and (i+1, j) these are for corner nodes and edge
nodes and this particular line is for all internal nodes.
(Refer Slide Time: 09:34)
So, the nature of the penta diagonal matrix after the coefficients are evaluated is shown here.
So, we have d1 a1 then there is the element 0 then there is the value f1. Along the diagonal of
the coefficient matrix, we have value; immediately below sub diagonal, we have value;
immediately above sub diagonal, we have value, then we haves zeros and then values f1 to f
5 ,f6; similarly on the lower side, e4 to e9 after the zero values. And pressure column vector,
unknown column vector is multiplying the coefficient matrix equal to central differences
scheme known value is written as a known vector on the right side. If you observe the nature
of the matrix, we conclude that first and second sub diagonal have some terms that is what is
this which are zeros and we have to carefully construct coefficient matrix taking that into
account.
532
(Refer Slide Time: 10:49)
We have explained how do to the L. H. S of the pressure Poisson equation; now we do for
right hand side of pressure Poisson equation. The right hand side pressure Poisson equation
*
*
as actually the source term, which is related to intimidate velocities u and v as shown here
that is
−1 ∂u * ∂ v *
. We write to finite difference form of the source term as shown here.
+
Δt ∂ x ∂ y
(
)
*
*
*
*
−1 u i , j −ui − 1, j v i , j − v i , j− 1
So,
.
+
Δt
Δx
Δy
(
)
(Refer Slide Time: 11:41)
533
So, corresponding code is displayed here. So, the right side is actually right side column
vector is actually given as b p commands are returns first few lines. So, R.H.S vector of the
pressure Poisson equation, this function calculates the R.H.S vector of pressure Poisson
*
*
equation by considering divergence of the intermediate velocities u and v . So, we define the
function with corresponding arguments as shown here. Initially they are set to zeros with the
memory size related to number of nodes as shown here. Now for 1, 2 to i max and for j 2 to j
max, b p is calculated as shown here. This is exactly what we explained in the previous slide;
only thing in it is written in matlab code form as shown here. So, we have calculated
separately the right side term and separately left side term.
(Refer Slide Time: 12:45)
Now we have to enforce boundary condition for pressure. For the present case that is for the
pressure we enforce boundary condition in form of Neumann type; for velocity, we enforce
through Dirichlet boundary condition. So, the left side wall
we
need
to
have
extra
ghost
nodes
∂p
=0 and using the ghost nodes,
∂x
enforced
boundary
condition.
So,
p ( 2, 2 : jmax ) − p ( 1,2 : jmax )
∂p
=0. So, if you rewrite this equation,
=0. So, this is actually
∂x
Δx
so we have p ( 2,2 : jmax )= p ( 1,2 : jmax ). Similarly for the right side wall, again Neumann
type
boundary
condition
for
pressure
534
∂p
=0,
∂x
we
have
p ( imax +1, 2: jmax ) − p ( imax , 2 : jmax )
=0. So, if you rearrange, we get value for the ghost
Δx
cell node such as p ( imax+1, 2 : jmax )= p ( imax , 2 : jmax ).
(Refer Slide Time: 14:39)
Similarly, the top wall
∂p
=0; again similar arrangement only thing you have to now pay
∂y
attention to j value. So, it is jmax+1, which is above the top wall and jmax which is just
below the top wall equal to Δ y, so that will result in
∂p
=0. And if you rewrite p(2:imax) for
∂y
x-direction and jmax +1 is just above the lid equal to p( 2:imax) for i, and jmax in to just
below the lit. Bottom wall
∂p
=0, again using the ghost nodes now we have to pay attention
∂y
carefully again for value of j. So, i is from 2 :imax, j is two minus again p at 2:imax j is at 1
by Δ y is equal to zero. And you rearrange, we get expression as shown here.
535
(Refer Slide Time: 15:53)
So, there are all implemented as shown in this code. We will come to this command after
explain in this. So, all Neumann type boundary condition for pressure, pressure boundary
conditions p ( 2:imax ,1 )= p ( 2:imax ,2 ) on the left side. Similarly for the right side wall,
bottom wall, top wall as we explained in the previous slide; only thing it is return in mat lab
code language. Now there is the procedure called pinning the pressure at a particular point.
So, when we you are using Neumann type of boundary condition for pressure it tenders the
coefficient matrix singular. So, if when get a matrix as a singular, it is very difficult to solve.
So, to avoid that situation and to make the matrix invertible pressure has to be pinned at a
point that is we are actually interested in a problem only the pressure difference not the actual
pressure itself. We use this so we say at any one point pressure is made to zero and all other
pressures are referred with respect to that point and this process is called pinning the pressure.
So, for the matrix to invertible the pressure has to be pinned at a point, pinning the pressure at
a point does not affect the overall solution, because the absolute pressure does not matter,
what matter is only the pressure gradient. So, if you look at u momentum equation, v
momentum equation, we have only
∂p
∂p
and
. So, all that it matter is the pressure gradient;
∂x
∂y
actual pressure itself is not that much important, and this is used to set the procedure called
pinning and that helps to make the coefficient matrix as invertible. So, pin the pressure at a
corner, so we can pin pressure at any point, in this example, you have pin the pressure at one
corner that is what is f at 1 equal to 0.0. Now solve the pressure Poisson equation as shown
536
here. We can again set convergence criteria separately for pressure Poisson equation and then
return and end.
So, in this module, we have learned in detail how to solve to a pressure Poisson equation
*
*
from the predicted velocity u and v . The pressure Poisson equation has a left side as well as
right side term. We looked at left side term and right side term separately. We also learned a
procedure called pinning the pressure, and pinning the pressure helps to make the matrix
invertible then we also learn how to enforce boundary condition for pressure. For the
pressure, we follow Neumann type of boundary condition and to impose the boundary
condition, because we are following staggered grid arrangement we need to have a ghost
node on all the sides for pressure. This is appropriately accounted and we looked at
corresponding lines in the code. In the next module, we are going to see complete assembly
of the code and solution obtains how to do post processing from the solution corresponding
display of the code.
Thank you.
537
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture - 42
Greetings and it is my pleasure to welcome you again to this course on CFD. This is the
last module for this week. In this module, we mentioned, we will take example problem
of flow in a lid driven cavity, and explained step-by-step steps involved in CFD,
discretization procedure, corresponding display of working code. In the last module, we
are going to complete this procedure and in addition we are also going to see different
post processing and corresponding display of code.
(Refer Slide Time: 01:02)
Steps involved in doing the simulation of flow in lid driven cavity are listed here. We
already mentioned about this in other module as well. Hence the fifth step is the one we
are going to see in particularly in this module. Fifth step is project the intermediate
velocity onto a divergence free space; using the pressure calculated in the projection
step. So this particular step is otherwise also called correction step. Then you repeat this
process until the solution has reached the convergence condition. Once you obtained the
velocity field then you do post processing to get different information about the flow.
538
(Refer Slide Time: 02:00)
So, in the projection step method, we already seen predicted step solving the pressure
Poisson equation to get pressure everywhere. Using this pressure computed in the
pressure Poisson equation, the intermediate velocity which are calculated without
*
*
considering the pressure term, and they are also referred as u , v ; these two velocities
are projected onto the divergence free space using the fractional step algorithm. And this
particular step is called correction step and it is listed here. So, u n+1 that is a new velocity
*
*
equal to u −Δ t ∇ p ; similarly for v as well. And if you discretize the above equation,
for
u
as
well
ui , jn+1=u i , j* −Δ t (
as
v
velocity,
then
we
have
as
shown
here
pi +1, j − pi , j
p −p
v i , jn+1 =v i , j*− Δ t( i , j+1 i , j )
)
Δx
Δy
. Similarly for v,
.
539
that
is
(Refer Slide Time: 03:50)
You will see the corresponding code here. So, function u v projection step i max, j max,
*
*
dt, dx, dy, u , v , p, velocity; then u is already initialized, and v is also initialized with
corresponding number of required array size; for u, it is imax, jmax+1; for v, it is
imax+1, jmax. Now we do the projecting the intermediate velocity onto a divergence free
vector space first for u velocity next this lines are for. So, for i equal to 2 to imax-1, and
for j 2 to jmax, ui,j =ui,j −dt
¿
(
pi+1, j −p i,j
dx
)
. In the form of code, it is dt by dx. These are
same as what we have seen in previous slide in the form of equation. Similarly, now for
the v velocity, so for i is 2 to imax, and for j 2 to jmax-1,
540
v i , j= v i , j*−d t(
pi , j+1− p i, j
)
dy
.
(Refer Slide Time: 05:22)
And what is shown here is complete listing of outer loop code. So, we start from here, in
right pressure Poisson coefficient matrix. So, Ap equal to get coefficient matrix imax,
jmax, dx, dy. Then outer loop iteration, time is equal to zero which is, you start the
iteration by initializing time. So, first it is time equal to zero then for i equal to one to
iteration that is number of iteration you can decide or the convergence criteria you can
*
decide. So, time is equal to time+dt which is also defined u ,
old u equal to u
*
momentum and corresponding argument; similarly v , old v equal to v momentum and
corresponding arguments. So, these two lines represent solving the u momentum
*
*
equation for respective velocity that is u and v then we know pressure Poisson
equation has right side term and left side term.
So, this bp is calculating the right side term of the pressure Poisson equation, we have
seen them independently in detail in previous modules. What you are seen here is the
*
complete listing of outer loop. So, bp equal to get R.H.S imax, jmax, dt, dx, du, dy, u
*
and v . So, this line calculate the R.H.S vector of pressure Poisson matrix then you
solve the pressure Poisson equation that is what shown here. Then you project the step,
this we are just now seen to get u and v. Once you get u and v at the new time level after
the final correction step, you calculate for the divergence and Courant number. So,
divergence, Cn, Cn represents Courant number, and there is separate argument for the
divergence div, Cn, imax, jmax, dt, dx, dy, u, v.
541
So, you can decide if the number of iteration is more than the desire number of iteration
or you can decide based on Courant criteria. So, Cmax is the maximum iteration, so
converge u, old u. And you can also have some display on the screen for checking the
progress of the code. So it will display this particular lines will display iteration number,
Courant number and maximum value. If the convergence maximum is less than the error
that you specified, and it will break; otherwise it will continue, and you have final
display again.
(Refer Slide Time: 08:38)
So, once you get solution then we have to do post processing, there are various methods
available for post processing. You can look at u, v this are two velocity listed in this twodimensional simulation. You can look at u and v at every node; you can also look at
pressure at every node. You can also look at u and v in different form for examples
stream function vorticity contour. And these are listed here. So, you can have a contours
of velocity and we have the stream function contours, vorticity contours, centerline
velocity you can have a velocity line plotted at any specific x and y grid line then you
can have a contours of pressure etc. So, plotting the contours of velocity pressure and
centerline velocities are straightforward, obtaining the stream function and vorticity
values from the velocity values are explained in the subsequent slides.
542
(Refer Slide Time: 09:46)
So, this is the example problem, we had that is flow in a lid driven cavity. And this
particular slide, we will try to see what is known as the center line velocity. So, this line
that is shown here corresponds to x at half of this length. Please recall, we define the
coordinate along this horizontal line is x coordinate line, and along this vertical line is y
coordinate line. So, at the center of this face, you have a line mark and we are going to
see velocity plotted along this line, and that is what shown here. And we mentioned one
of beginning lectures; we have what is known as the non-dimensionalization. So, u that
is the local velocity is non-dimensionalized with the driving velocity; the driving
velocity is the velocity scale; and in this problem, we have taken driving velocity to be 1.
If you non-dimensionalized any velocity by driving velocity then you get u by u and that
is what is plotted on the y-axis, and the length of the cavity in this case it is square and
that is taken as l and that is used non-dimensionalized distance. So, we are going to plot
along this line that is marked, and this is in y direction that is non-dimensionalized with
the length. So, you have
y /l
going from 0 to 1. So, zero is on this side and one is on
the other side. We mentioned that we have boundary condition that is
u=0 . So, at
y /l=1 , you have the maximum velocity, because it is non-dimensionalized, you have
u/u=1 . And on this side that is on the bottom, you have the wall and you have the
velocity boundary condition, no slip condition
u=0 . So, you have
point, and it goes down to some negative value at particular value of
543
u=0
at this
y /l then it starts
showing positive value that is the interpretation of this line. It is also possible to plot
velocity variation along any particular location both horizontally as well as vertically.
(Refer Slide Time: 12:13)
And you can also look at the velocity in the form of contour. So, what is shown as u
velocity contour, so this gives you variation of velocity for the entire domain in the
whole. So, this red color corresponds to maximum velocity and each line corresponds to
one particular value. So, along this contour line the velocity values remains the same and
blue color corresponds to very low velocity, and that is the interpretation of this contour
plot.
544
(Refer Slide Time: 12:54)
You can also look at pressure in the form of contour and that is what shown here again
for the entire domain and you plot contour along with legend and that is what shown here
in the form of color bar. So, you can interpret as red color corresponds to value 60 and
blue color corresponds to value -60, and this picture tells us the flow symmetric and that
is why you get the symmetric pressure contour.
(Refer Slide Time: 13:28)
545
Next the stream function contour, we know the definition of the stream function relating
u= ∂ Ψ
v = −∂ Ψ
∂ y and
∂ x employing the above definition, so to get stream
to velocity
function relating to velocity. So, now, we can take any velocity, for now we take v
velocity, so v i , j=−(
Ψ i+1 , j−Ψi , j
) . Please remember stream lines are contours of stream
Δx
function constant stream function and what we are done here is a discretized form of this
particular equation. So, you define any particular line as a reference Ψ given the value
Ψ
of zero then you can go on integrate based on this velocity and this Δ x to get i+1 . So,
Ψ i+1 , j = Ψ i , j −v i , j Δ x stream function is calculated using the above relation, and you have
the corresponding display of the code shown here.
(Refer Slide Time: 14:51)
So, function
initialized
Ψ
equal to stream function imax, jmax, dx, dy, u and v and
beginning
zeros
imax,
jmax.
And
for
i
2
to
Ψ
are
imax-1
Ψ(i ,2 : jmax−1)=Ψ (i−1,2 : jmax )−dx v (i ,2 : jmax −1) . This line is same as what we
have seen in the previous slide, it calculate for all i location.
546
(Refer Slide Time: 15:42)
And once you get the values of psi you can look at the contour as shown here, again
there is a corresponding color definition in the form of the legend shown here. So, color
map and corresponding color values indication is also given here. So, the square cavity,
so y is going from one to as y is going from zero to one x is going from 0 to 1; and at the
center, we have the very low value, and this point we have the very low value, and we
have contours connecting all constant value of
function contour.
(Refer Slide Time: 16:25)
547
Ψ
and this is the meaning of stream
Next we have the vorticity contour. So, vorticity again defined based on the velocity
component as shown here, ω =
∂ v ∂u
−
. And you employing the above definition write
∂x ∂y
the discrete form of the equation
ω i , j=
v i +1 , j −v i , j u i , j +1−ui , j
−
Δx
Δy
. So, using this you can
calculate the vorticity.
(Refer Slide Time: 17:03)
And it is shown in the form of the code. So, we have function
subroutine of function to calculate
ω
ω
that is the separate
and you define corresponding arguments vorticity
imax, jmax, dx, dy, u, v. So, you give velocity fields u v, you give Δ x , Δ y , and imax,
jmax to the function it will give you the vorticity. as usual it initialize the
you calculate
ωi, j
ω
ω
array, then
as shown here. So, for i equal to 1 to imax, for j equal to 1 to jmax,
equal to based on velocity component v and based on velocity component u. And
this is again a code written corresponding to the mathematical definition we had in the
previous slide. And you also defined a specific location so
ω 1 , jmax
,
ω imax , 1
and
ω imax , jmax
ω 1,1
. So, these are values of
locations.
548
ω
is defined as shown here
at boundary condition
(Refer Slide Time: 18:28)
And once you get
ω , again you will look at a flow through ω
in the form of vorticity
contour as shown here. Again you can have a interpretation, color and then
corresponding values are given here. So, you can have idea where is the maximum
and where is the minimum
ω,
ω.
(Refer Slide Time: 18:52)
The complete flow chart for this problem is given here. The first step we have the grid
generation, second step discretization of the governing equation, third step to solve
momentum equation to obtain the intermediate velocities, we have separately u and v
549
momentum equation, you can solve them separately. Once you get
u*
and
v*
then
we get pressure Poisson equation, and we solved pressure Poisson equation again
separately. Then this intermediate velocity is obtained or corrected by this projection step
on the divergence free space. Once you get correct velocities then they are post
processed to get results and to look into the flow.
(Refer Slide Time: 19:37)
Complete listing of the code is given. We have seen the code part-by-part now. We will
see the entire code Navier-Stokes equation, explicit formulation, lid driven cavity flow
the code is based on projection step method proposed by Chorin. So, we have all this
initial lines then you define grid size on another parameters i runs along x direction, j
runs along y direction Reynolds number is defined and that is used symbol Re; dx, dy are
cell sizes along x and y direction; dt is a time step value, velocity is the lid velocity that
is the boundary condition on the top wall. So these are commands written.
Again we have explained in beginning grid, we are using only 4, but to get good results
we are actually change the grid to 33 that is why you see here i max 33 grid size in x
direction; similarly j max equal to 33 grid size in y direction. So, we set the limit of
iteration to 20000, and the convergence criteria that is error in the divergence as 1*10 -4,
Reynolds number as 1, and velocity boundary condition on the top wall as 1. So, once
you define number of grid lines then you calculate dx and dy and that is what shown here
550
dx =
1
imax −1
, and
dy =
1
jmax −1
. So, x is going from 0 by Δ x value upto the value of
1.0. Similarly y is going from 0 to 1 with the step value of dy, dt equal to 0.0002
(Refer Slide Time: 21:44)
And we have the complete listing of the code; we have already seen part-by-part. So this
is the first line is for the pressure Poisson coefficient matrix then you have the outer loop
time spent then iteration starts. So, we calculate separately u momentum, v momentum
and this line corresponds to right side vector of the pressure Poisson matrix then you
solve the pressure Poisson equation, you get solution for pressure, then do the projection
step to get the correct u and v velocity check for divergence, and also check Courant
number then you check whether it is between number of iteration and between Courant
number then you break or you continue. Then finally you can have the list of display the
number of iteration total iteration Courant number etc.
551
(Refer Slide Time: 22:49)
And this same now we have included the post processing lines also, we have stream
function and we have
ω , and finally, we can also plot results this is the complete
working code using Matlab.
(Refer Slide Time: 23:04)
We have explained the algorithm and corresponding code part in detail. Now we will put
an entire algorithm, and then we will explain how the code is actually running, and also
discuss the results obtained. What is shown here is a Matlab code, in Matlab platform
itself. Now let us start seeing looking at the lines Navier-Stokes equation, explicit
552
formulation, lid driven cavity flow and this are certain commands. Then we have clear
screen, first one we start talking about grid we explain initially with 4 by 4, the actual
running of the code we run with 33 by 33. So, imax is 33, and jmax is 33. The number of
iteration allowed is about 20000, and for convergence criteria we set the limit 10 -4,
Reynolds number is 1, and lid driven velocity condition is 1. Then we define grid based
on this, so
dx =
1
imax −1
, and
dy=
1
jm ax −1
and dt is also set a 0.0002, then we do the
memory allocation of all the variables.
(Refer Slide Time: 24:26)
So, pressure then RH side of the pressure equation and divergence calculation vertical
velocity; in that we have predicted velocity v_star and actual velocity; similarly for
horizontal velocity u_star u then boundary condition. u_star we define boundary
condition for u_star as shown here. Then velocity and collocated mesh this is required
we solved equations or we stored variables at staggered location. Once we obtained
solution then we need to do post processing. To enable post processing we convert the
variable from staggered grid to collocated grid arrangement and that is done using this
collocated definition of the variables. Then we solve pressure Poisson equation.
553
(Refer Slide Time: 25:24)
So, we have the u star u momentum
(Refer Slide Time: 25:28)
Now comes the outer loop, so we have u_star u momentum and that is given in detail in
this particular function. We have seen all this in detail convective term again initialized;
α
is a common factor that is also defined. Then we calculate for convection term, u at
different location and that what we shown here; u_east, u_west, u_north, u_south
similarly v_north and v_south, finally you calculate convective term then you compute
554
fractional step velocity including convection term as well as diffusion term as shown
here.
(Refer Slide Time: 26:01)
And that will be u_star because we have neglected pressure in the first step. Once you
calculate u_star, you need to apply boundary condition and corresponding lines are
shown here.
(Refer Slide Time: 26:19)
And come back to main code, so we have explained u momentum, similar steps are there
in v momentum function also.
555
(Refer Slide Time: 26:31)
That is again displayed here separately v_star equal to convection term and diffusion
term. Once you find v_star apply the boundary condition as shown here. Come back to
main, so we have u momentum, v momentum explained then pressure Poisson equation
set the right side of the pressure Poisson equation first that is in the module get R.H.S;
again go to the particular module.
(Refer Slide Time: 26:58)
556
And it is show here, initialized and calculate all the coefficient values of the right side
matrix. Go to the main then we solved the pressure Poisson equation press; Poisson is the
corresponding module go to the press Poisson dot m.
(Refer Slide Time: 27:15)
So, we have initialized pressure then f R.H.S vector of the pressure poisson equation.
(Refer Slide Time: 27:28)
Then we define pinning of the pressure because, we are interested only the pressure
difference and one point is pin to 0 and all over values are referred with respect to a
pinned point and that is what this particular line. Then we solve the matrix and this is
557
inbuilt matrix inversion procedure, so pressure is obtained. Once you obtained pressure
then the applied boundary condition for left side, right side, bottom wall and top wall.
Again go to the main. So, we are done now pressure Poisson equation, we got pressure,
then this pressure is projected to get the corrected velocity, and that is what done in the
module projection step. So, we go to the projection step module.
(Refer Slide Time: 28:16)
So, again values are initialized zeros for u and v then you correct the velocity. So, u_star
was initially obtained. So, pressure is obtained from pressure Poisson equation using this
two, you get the correct velocity expression as shown. And once you get u then we need
to ensure boundary condition that is also done using these lines for left boundary, right
boundary, bottom wall and top wall.
558
(Refer Slide Time: 28:49)
Similarly for v equation, so v_star is used and pressure - corrected pressure is used. So,
you get correct velocity. Once you get correct second component of velocity v apply
boundary condition for v and that is done by these lines go back to the main.
(Refer Slide Time: 29:07)
So, we have done pressure Poisson projection step to get correct u and v velocity. Now
we need to check whether divergence is satisfied. So, we have separate module So,
divcn.
559
(Refer Slide Time: 29:21)
Let us go to that module, so in divcn calculate the continuity error. So, this is
∂v
∂y
∂u
∂x
and
, then you calculate also the Courant number it is helpful. So, you calculate the
Courant number based on this expression here. Come back to the main. So, we calculate
divergence then we calculate Courant number then we calculate converge.
(Refer Slide Time: 29:53)
560
Next we go to converge. This finds out the absolute error and finds the maximum of
absolute error separately for u velocity and v velocity. And these are lines here and you
find the maximum of these two and that is what is attributed here as a C max. So, come
back to the main. So, cmax is compared against convergence limit that is set; and if it is
satisfied then we break; otherwise, we repeat the steps. So, once the solution are obtained
then we do a post processing.
(Refer Slide Time: 30:28)
Before going to the post processing, you see the number of displayed commands here.
So, display on the screen iteration then Cn for Courant number, then Cmax displays
maximum convergence obtained. Similarly at the end of the loop, again we have display
of total iteration number of time it has taken and then corresponding Courant number.
561
(Refer Slide Time: 31:01)
Then we do a post processing, before doing the post processing we have to convert the
staggered arrangement of variables to the collocated arrangement of variables; in other
words all the variables are stored at one location. So, it is easy to calculate derivatives
and put it to get stream function and vorticity. So, this particular line does the
conversion, because we have defined simple uniform grid, it is a basic arithmetic we get
summation, average and then we get u and v at collocated location. Once you get u and v
we calculate stream function. So, we have a separate module stream function.
(Refer Slide Time: 31:45)
562
So, we go to the stream function module and that is calculated as shown here. So, we
can calculate stream function either from u velocity or from v velocity. So, what is used
here is from u velocity, and then you can also calculate from v velocity. So, both are
here. So, one in the green line, green color is based on u velocity, and one that is actually
used here is based on v-velocity. Again come back to the main. So, we calculate stream
function then we calculate vorticity. So, vorticity again based on velocity.
(Refer Slide Time: 32:28)
So vorticity is shown here, so based on the expression and using the corresponding
velocity component, vorticity is defined; and these are lines - specific lines for
calculating vorticity at specific locations.
563
(Refer Slide Time: 32:42)
So, come back to the main then again we have plotting. So, we calculate stream function
vorticity; and from solution, we have velocity and pressure we can plot them and look at
the results. So, we go to the separate modules plot results.
(Refer Slide Time: 33:05)
So, in plot results we have again x axis defined y axis defined, then stream function
label is given stream function contour. So, contour function then plot vorticity contour,
plot pressure contour then corresponding figure with the color bar then plot centerline
velocity. So, let us go back to the main part.
564
(Refer Slide Time: 33:44)
So, we have everything explained. Now we will actually run the code. So, we have
already got all the results just look at one-by-one. So, this is the running of the code with
the iteration number, Courant number and convergence criteria specified, every line is
with that number. So, program has gone around 313 iteration total time is 0.0662, and Cn
is 0.005862. Now just look at the results this is the velocity vectors, and you can see the
velocity with the corresponding arrow mark. Then we have next figure for stream
function contour we have explained this separately, now it is run and got along with the
code, this is for the vorticity, and this is for pressure, and this is for centerline velocity.
In this module, we have particularly seen projection step, correction step, getting the u
and v velocity, and then looking at the results by different post processing. We can have
u and v velocity plotted as it is; either in the form of the line or in the form of the
contour. We can also look at the results in the form of the pressure contour. In addition,
we also seen how to get stream function and vorticity values, and plotting corresponding
contours. We have also listed we have also displayed complete listing of the code and
explained line-by-line from the beginning of the code till the end. And this completes
end of this week eight lecture.
Thank you.
565
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture - 43
Conclusion
(Refer Slide Time: 01:00)
It is my pleasure to greet you again. This is the concluding lecture on for the entire
course. In this concluding lecture, I want to overview what all we have done week-byweek; on that way you will have the overall picture of the course. In week 1, we did
review
of
the
basic
fluid
mechanics
including
governing
equation,
non-
dimensionalization ,classification of equations, PDEs, type of boundary condition and
then we derived vorticity-stream function equation. In week 2, we spend time on grid
then we started going to the Taylor’s series of expansion; from Taylor’s series of
expansion, we got different finite difference formula, first order, second order, forward,
backward, central, higher order, uniform mesh and non-uniform mesh.
In
week
3,
explained
different
properties
conservativeness,
boundedness,
transportiveness. Then numerical errors and characteristics associated with finite
difference scheme in terms of consistency, conservativeness, stability and lack
equivalence theorem. We explained all these with the help of example problem. We also
gave different assignments based on this. Then we also explained finite difference
equations for different model equations and explained for those examples different
566
properties. Week 4, was a main subject; we started talking about finite volume
formulation in detail. So, we have talked in detail about convective terms, non-linearity
associated with convective term, how to treat convective term exclusively. We had
different approximation procedure; we explained all of them with the help of the
corresponding formula in detail. Then we also took an example problem and variation in
the example problem, and performed explained the performance of these schemes and
illustration explaining how same schemes behaves differently for different numerical
condition.
(Refer Slide Time: 03:02)
Week 5, the time integration procedure, where we talked about different time integration
methods available and comparison of them explicit formulation, implicit formulation and
how to construct any higher order methods for time discretization as well. Then we
moved on to what is known as the pressure-velocity coupling method. We learned
pressure does not have the separate equation, but somehow we have to link between
momentum equation and mass equation. We had explained three four procedures –
SIMPLE, MAC and then projection method.
In week 6, we talked in detailed about the turbulent flows, characteristics of turbulent
flows, modeling of these equations, and different models available, advantages and some
applications. We also gave different assignments based on whatever explained in this
module. In week 7, is dedicated for matrix inversion procedures. Whatever method we
567
follow for discretization finite difference, finite volume or finite element method finally,
they will end up with the form of the matrix equation. So, we have to know how to invert
them. And there are different methods available direct method and iterative methods.
And in direct methods, we listed three examples Gauss elimination method, L U
decomposition, and Thomas algorithm for tridiagonal matrix algorithm. Similarly in the
iterative method, we explained many methods Gauss-Siedal method then S O R methods.
We also talked about what is known as the pre conditioner, ill condition of a matrix and
pre conditioner, different preconditioning procedure available.
And putting together all of them we had in 8th week. A working code problem
considered was flow in a lid driven cavity, and then we explain numerical algorithm
step-by-step, using the projection step method, then corresponding code working code
was displayed and line-by-line of that code was explained. Then at the end of it we have
the complete code then actual running of the code, and the results obtained everything
was explained in detail. We believe this as created interest in you, you also believe this
as created some confidence in you. We wish that you continue your interest and learn
more and more.
Thank you.
568
Foundation of Computational Fluid Dynamics
Dr. S. Vengadesan
Department of Applied Mechanics
Indian Institute of Technology, Madras
Lecture - 44
Assignment
Greetings this particular video is about assignment that we are giving for week seven and
week eight. So far, we have given objective type assignment, whereas in week seven we have
given programming assignment. Week seven forms matrix solution procedure and it is
necessary that you practice them. Hence, we have given a programming assignment, there are
three languages possible C, C++ and Python. We have given four problems one based on
Gauss elimination method, second problem based on TDMA procedure, and third problem
based on LU decomposition and fourth problem based on iterative procedure. Coding
language is part of this course, hence you must know any one of these languages and start
programming and become part of the CFD community.
In the week eight, we discussed in detail a test case problem that is flow in a lid driven cavity,
and we have demonstrated with the help of a matlab code. We are also providing you the
complete working code as a separately; and to strengthen further this knowledge, we are
giving you advice to practice more problem. So, this particular video is talk about what all the
problem that you can try with this knowledge, you are most welcome to use this mat lab code
as it is or you convert this mat lab code to any language that you are comfortable with; for
example, C or C++ and Python. In our regular CFD course, this is how we practise. All the
students are encouraged or given assignment to start coding write from the beginning itself.
For example, we will start writing the diffusion equation then there is slowly build the code
as we proceed with the syllabus content. We are trying to do a similar one in this exercise
also. Now I am going to explain something more about assignment that we wanted to practice
for week eight.
569
(Refer Slide Time: 02:48)
So, the problem that we are considered the week eight was lid driven cavity example. We
define the problem, we define the boundary condition, we mention the top wall or the lid is
moving from left to right with the specific velocity condition. And for velocity, we used
Dirichlet boundary condition; and for pressure, we used Neumann boundary condition. The
cavity in two-dimensional situation is a square’ if it is the three dimensional situation it
becomes a cube, with the dimension of 1 metre by 1 metre by 1 metre. And this is the
illustration we used to explain problem as well as the boundary condition implementation.
So, on the left, you see explanation for velocity boundary condition; top is the lid moving
with the velocity 1 m/s, and v=0, and all the three sides velocity equal to 0, of a pressure on
all four sides we have Neumann type boundary condition. So, accordingly in the x direction it
is
∂p
∂p
=0; in the y direction, it is
=0.
∂x
∂y
570
(Refer Slide Time: 04:11)
Now, based on this, the same problem can be extended and you can try anyone of this
problem. We have used central scheme for convection term. If you can recall in week five,
we taught different other schemes for example, pure upwind, QUICK scheme, hybrid
scheme. Increasing the Reynolds number will have the reflection on effect of these schemes.
Hence, you can try changing the code from central difference scheme to any one of this
schemes, and try increasing the Reynolds number to understand yourself the behaviour of
these schemes for different Reynolds number for the same set of mesh. In the problem
demonstration, we have used top lid moving with a constant velocity for example, u=1m/ s.
It is also possible to oscillate the lid with the sinusoidal velocity that is a sin ( ω t ) where a is
an amplitude, which is related to some major length scale related to the problem for example,
length dimension of the cavity and ω is the frequency you can try with different compound.
So, this will give you not linearly moving lid, but it will give oscillating lid.
So, instead of square you can also try cubic cavity, you can also try changing the aspect ratio,
so it becomes deep cavity or shallow cavity depending on the definition of aspect ratio and
depending on value of aspect ratio. So, aspect ratio means depth to the width. And we explain
the problem with only primitive variable that is u momentum equation, v momentum
equation and continuity equation. You can also include any other scalar equation, for
example, you can include energy equation and solve for temperature distribution. Here again
there are two further the possibilities for boundary condition, one you can use constant heat
flux boundary condition, other one constant temperature boundary condition. Then predict
571
Nusselt number variation and understand the thermal characteristics associated with this flow.
Another possible variation, we explained the problem with top lid moving, it is not necessary
only top lid should move, you can also have another side wall also moving; it is possible that
they side wall move with same direction of the velocity or they can move into opposite
direction of the velocity.
(Refer Slide Time: 07:00)
Next problem that we advice to try flow through a backward facing step we explain this
problem much earlier. However, I am interested to explain that problem again. So, the inflow
is on left side, you can have a fully developed flow velocity profile explained as given here
u ( y ) with some expression as a parabolic expression. Then on the top is a wall with a
boundary condition u=0 and v=0, then you can define different steps height D and get to
know the effect of step height on the flow parameter then you have this as the wall, the side
step is also a wall and then bottom is also a wall.
572
(Refer Slide Time: 07:46)
We understood the behaviour associated with this problem, flow separates at the beginning of
the step as I am showing here, then it comes back at reattaches on the bottom wall as I am
showing here. Then there is a eddy or re circulating zone, prediction of the recirculation zone
is very important and especially in the case of you deal with temperature or energy equation
then prediction of skin friction along the wall is also important. We also know there is a
corner vortex that is formed and slowly it becomes a re-circulating region depending on the
Reynolds number. There is also a secondary circulation form on the top wall as I am showing
here. This again depending on the Reynolds number, hence you can try increasing the
Reynolds number, and observe yourself whether you are getting a secondary bubble on the
top.
573
(Refer Slide Time: 08:49)
The third problem that we can think of is flow in a contour. So, flow through a circular cross
section pipe as I am showing here. You can give at the inlet either the parabolic velocity
profile as it is described here or you can describe a uniform velocity at the inlet. If you are
giving a uniform velocity at the inlet, it will take a long channel for the flow to develop and
become a fully developed velocity profile as it is shown here. If you are giving already a
parabolic profile, which is very close to the fully developed condition then you need only a
smaller length and flow will develop. Again boundary conditions are given u=v=0 on both
the side wall. So, velocity u in a x-direction is a function of y and velocity is maximum at the
mid-plane of the free surface.
574
(Refer Slide Time: 09:46)
Next problem you can think of is flow past cube in a channel; it is a three dimensional
problem. So, one view is shown here, the top view is shown in here; the cube is actually
placed in one view as I am showing here, and from the top, you get to see figure as shown
here. Once again you can have a variation in the inlet velocity condition, either you can
prescribe the uniform velocity as I am showing here or you can also prescribe a fully
developed velocity profile as we did in the previous example. Prediction of this flow is very
interesting, we also observe the flow understand presence of the body and separates at this
point and flow go around the geometry and create different interesting fluid dynamics
phenomena behind the geometric.
575
(Refer Slide Time: 10:42)
The next one flow in a channel with the cavity the first problem that we discussed is a closed
cavity, it is also possible to have a cavity has part of the channel and that is what you are
seeing here. So, the top is a wall, and this is a channel, suddenly you are experiencing a
cavity; it is like combination of cavity and backward facing step. So, for short cavities, a
weak vortex is formed and occupied downstream half of the cavity; and for long cavities,
boundary layer fluid is ejected into the cavity causing separation and forming a strong vortex.
So, you have two such possibilities.
(Refer Slide Time: 11:28)
576
The last problem that we are advising you to try is external flow. So far, we have done
internal flow, it is also interesting as well as important to know how schemes behaves
differently for external flow. External flows we are discussing two important problem flow
past circular cylinder, flow past square cylinder, the two problems are given. So, if you have
the code written, then it is only changing the geometry from circular cylinder to square
cylinder. The difference is in the case of circular cylinder separation point shown as shown in
here it is not fixed it changes according to the Reynolds number and that dynamic change of
the separation point results in different wake pattern. Whereas in the case of square cylinder
separation points are fixed whatever the Reynolds number and that gives a different wake
pattern.
So, as far as week eight is concern, I repeat again we are sharing you matlab code. You are
most welcome use that code as it is or you can take that code format and write your own code
in whatever language you are comfortable with. And try all these problem, there is no
submission it is only to increase your confidence level and for better practice as well as to
understand behaviour of different schemes. We will have separately on small assignment as
in the previous weeks a multiple choice question, but that is not that much learning unless
you practice CFD with your own code.
Thank you.
577
THIS BOOK IS NOT FOR SALE
NOR COMMERCIAL USE
(044) 2257 5905/08
nptel.ac.in
swayam.gov.in
Download