Welcome student to week 11 of course, hydraulic
engineering. This week we are going to study
topic called introduction to computational
fluid dynamics. This is in continuation to
the last week is module where we studies with
viscous fluid flow and we derived the Navier-stokes
equation. So, computational fluid dynamics
is nothing more than solution of this Navier-stokes
equation. The reverse stroke equation is quite
complex.
So, there are different ways of solving those.
So, this module is dedicated to that it says
this is a undergraduate course we are not
going to give you too many details, but at
least touch upon all the basic concepts of
computational fluid dynamics. So, let us get
started with this.
So, the first question that is very common
and very obvious that you should have in mind
is what is CFD so, the analysis of practical
fluid flow problems involve 2 fundamental
approaches. So, if you try to solve any practical
fluid flow problems, we can use 2 approaches
one is experimentation and the second is the
calculation. So, experimentation requires
the constructions of model which are tested
in various facilities.
One topic we have already said and read in
this course was dimensional analysis is very
critical to this experimentation because,
we when we do the experiments in the lab to
be able to apply those in real life we need
to study dimensional analysis and the as it
is written here experimentation involves the
construction of models, which are tested in
various facilities, whereas calculation involves
solution of differential equations.
Whatever the differential equation of the
problem that we form that is the solution
to that differential equation is called calculation.
So, this calculation can be performed in 2
ways one is analytically or the second is
computationally analytical is mathematical
solution, for example, like you solve the
integration is an integral equation by hand
using the formulas of math computational is
using the computers.
So, the field of study devoted to the solution
of the equation of fluid through the use of
computers is called computational fluid dynamics
or CFD. So this is a very crude definition,
but at your level we can say that the field
of study devoted to solution of the equations
of fluid flow through the use of computers
is called computational fluid dynamics or
CFD. So, the equations of fluid flow could
be Isler equation Bernoulli’s equation.
So, they are in a broad sense from the CFD
but in reality, the solution of Navier Stokes
it is 
called 
computational fluid dynamics or CFD, C stands
for computational F stands for fluid, D stands
for dynamics. In this field of study called
computational fluid dynamics, experimental
results are used, and they are often used
and what is the purpose of using those experimental
results? They are used for validation of the
CFD solution.
So if we get a computer based solution from
the equations, we use computer to solve those
equation and we get some answers results.
How do we know if it is correct or not? So,
what we generally do is we do the mathematical
calculations for the same situation as one
of the experiments had been done before either
we do the experiment in the lab or somebody
else might have done.
But beforehand we know the experimental results
of a situation for the same situation we do
math computer based solution and we may try
to check if the results that we have got from
the computer is the same or very close to
the experimental results or not. So, this
process is called validation means so, it
will validate it will justify or this will
say that, the CFD solution is ok or not.
So, if the board or the solution is successfully
validated against experimental results or
a real life field study, that process is called
the validation of the CFD solution. So, computational
fluid dynamics can handle laminar flows with
very, I mean with ease, it is not a problem
at all the problems become complicated when
we have turbulent fluid flow.
So, the CFD solutions for turbulent flow situations
are much more complex all right. The accuracy
of the turbulence CFD solutions depends on
the appropriateness of the turbulence models.
So, you will be late Study in this module
that there are something called turbulence
model just to name them one is you know k
epsilon k omega there are different model.
So, these are called turbulence model.
There is something called which cannot be
actually said turbulence model, but, a different
way of solving this technique is called largely
simulation there is something called direct
numerical simulation. So, the accuracy of
these turbulence CFD calculation depends which
module which model are we going to apply,
we will see that direct numerical simulation
gives the best results most accurate results
largely simulations give the second best results.
And the last is Reynolds averaged navier stokes
equation in Reynolds averaged navier stokes
equation there are different turbulence modules.
But everything comes with a cost. For example,
you must just know that direct numerical simulation
although it has the best accuracy, but the
time of computation that is required is extremely
high. So, largely simulation are the second
best the act in terms of accuracy, but cost
wise it is also very high Of course, less
than direct numerical simulation.
Whereas, Reynolds average navier stokes equation
has less than accuracy than the above 2, but
the time of computation is far less than what
these 2 type of models in CFD takes, but we
will come to those later as well. So, this
is what it means the accuracy of the turbulence
CFD solution depend upon the appropriateness
of the turbulence model, which turbulence
model is appropriate.
Now, going to differential equations of the
fluid flow So, the differential equations
of fluid flow are we have been going through
this for a long time now, one is continuity
equation that we have seen for example, incompressible
flow del v = 0, which you have seen actually
in the last week is model with lectures on
viscous fluid flow and the second is the Navier
stokes equation. So, these are the 2 equations
differential equations of fluid flow.
And the solution of these equations through
computers is called CFD computational fluid
dynamics. So, the aim of CFD is to seek the
solution of these equations for practical
flow situations under consideration. You remember
when we started this lecture, we defined CFD
the use of computers to solve the fluid flow
equation. So, these are the fluid flow equation
that we are talking about continuity equation.
And the Navier stokes equation and the aim
of CFD is to seek the solution of these equations
and it should be for a practical flow situation
we should not assume say a velocity of 1 lakh
meters per second or something like that,
no, I mean the this the simulation should
be very much practical in nature like a velocity
of 1 meters per second or a wave traveling
with a wave height of 1 meter if we assume
a wave height of like hundred meters, it might
not be very real for example.
So, for an incompressible flow of Newtonian
fluid this is the continuity equation del
v = 0 and this is continuity equation or the
conservation equation. The second equation
if you can remember what is this yes this
is navier stokes equation which is actually
a transport equation and this navier stokes
equation is for incompressible flow we want
this one. So, as I said navier stokes equation
can be classified as transport equation and
continuity equation can be classified as conservation
equation. So, this transport equation transports
what it is a transport of linear momentum.
So, for 3 dimensional flow in Cartesian coordinates,
there are 4 coupled differential equations
involving 4 unknowns. So if there is a flow
which is occurring in 3 dimension, there are
4 different equations, which involves 4 unknowns.
So one of the unknown will be the velocity
new direction, the other is going to be the
velocity in redirection and the third one
is going to be velocity in w direction.
All 3 directions are velocities, and the fourth
one is going to be the pressure. These are
the 4 unknown as it is already written here
u, v, w and p. And if there are 4 equations,
I mean, there are 4 variable value variables
u, v, w, and p. There are 4 coupled differential
equations. So, these are the 4 equation. So,
this is nothing but del v = 0 as it is returned
del u by del x + delta v by del y del w by
del z.
So, now you would understand why I taught
the viscous fluid flow lecture before and
we derived it everything, because, this particular
module CFD comprises of many visions and it
is it will help you a lot if you can recognize
these equations. So, now, you can easily remember
that this was equation of continuity, this
1 rho del u del t + u del u del x + v del
u del y + w del u del z = - del p del x +
mu del u squared by del x squared + rho g
x. This is Momentum in x direction.
Similarly, and this actually we have derived
all these equations right we wrote it in a
general form in terms of i and j but if you
write it in i j and k separately there is
going to be 3 equations navier stokes equations
for 
incompressible flow. So, this is momentum
in the y direction and this is momentum in
z direction.
CFD is the technique of obtaining the solution
of these coupled differential equations using
numerical methods. So, we are refining the
C definition of CFD as we are going on initially
we describe we said that CFD is the computer
solution of the flow equations and flow equations
can be many right even Isler equation can
be the solution I mean the flow equations,
then we went and said CFD is the technique
of obtaining solutions for momentum and continuity
equation.
And now, we say that these equations are copper
differential equations, and we use solve it
using which methods numerical methods. I am
hopeful that in you are B.tech course, you
have studied a course called numerical methods
in engineering, where the different techniques
are taught. We will go to the basics of that,
some of them in this module as well. CFD involve
the phrase replacing the partial differential
equation that is PDE with discretized algebraic
equation.
That approximates the partial differential
equation for example, I mean will So, for
example, if they there is dp by dx, so, we
have to replace it with for example, delta
p by delta x or P2 - P1 divided by some things
like that this is very basic to right but
I hope this will make it clear to you what
is discretized algebraic equation. So, this
is like an algebraic equation. So, CFD involves
replacing the partial differential equations
with discretize algebraic equations that approximate
the partial differential equation so, that
is why there was a proximate sign when I wrote
those.
Now, what is the solution procedure? The solution
procedure in general any CFD problems involves
the following steps. First is we have to define
the geometry of the flow, we have to discretize
the domain we will come to it what defining
the geometries what discretization of the
domain is and then there is a solver stage.
And in the end after the solution is solved,
there is post processing, is after the results
are obtained, we have to show it graphically
or we have to find some values we have to
interpret those results that we got in most
of the cases plotting the results is termed
as post processing.
So, defining the geometry and the discretization
of the domain, these 2 things are called preprocessing.
So, something that you have to do before the
calculation can begin in the computer, all
right. And the post processing is something
that you have to do after the calculations
have something to be done with the results
after calculations have finished whereas preprocessing
steps to be completed before the calculation
can begin on computer. So, this is the general
definition of preprocessing and post processing.
So now as we said that the first step is defining
the geometry. So, this step includes the creation
of a CAD model what is CAD computer aided
design. So, you use some software is are there
are even tools available within the computational
fluid dynamics models where you can define
the geometry or derive for example, suppose
for example, there is a tank right and there
is a pier. And you have to and this is open
no I am just drawing it in 2d assume it is
3d and flow is coming through this right.
So, you will have to define this tank and
this so, you can do it using the CAD models
and this is defining the geometry. So, what
does this CAD model do the CAD model define
the shape and size of the domain in which
the flow equations shall be solved so, what
do they do the CAD model define the shape
say for example, as we said it was rectangular
in shape right and the size of the domain.
So, what the length of the for example and
what would be the water depth for example,
here water depth or mean your depth of the
tank actually not the water depth I love this
one 
and also the width in 3d shape and the size
of the domain. So, for this is a CAD model
for you see this resembles the wing of an
aeroplane for example. And this has been taken
from fetchcfd.com this image that is why we
have given a reference so as alright.
So, the second step was discretization of
the domain. So, this process is known as grid
generation or mesh generation. So, the process
this particular process of discretization
involves developing a set of algebraic equations
based on discrete points in the flow domain
to be used in place of partial differential
equation we told that the way that it is to
be done instead of partial differential equation
we try to transform it into algebraic equations.
So, for that for example, if this is a you
know domain we need to know so, suppose we
have to divide it right that is how we are
going to ride delta x and we have to divide
it in so let us say We have divided into so
many different parts in x and y direction.
So, pardon my brain. So, the process of distribution
was developing a set of algebraic equation
based on discrete points in the flow domain.
So, you know, we will so, this is what meshing
is, so, we divide our domain into so many
small parts and these are helpful, because
then we can actually use of these points the
if you remember if we if you remember from
your limits class suppose del p del x can
be approximated as P2 - P1 divided by x 2
- x 1. So, this we always used to right limit
delta x goes to 0 right. So, this means that
the grid should be as small as possible for
this process to be done the which process
that converting the partial differential equation
in into the algebraic form.
So for example, if there is a flow U coming
from this side we have defined 1.2 point 3456787.
So i t i is the strength of vortex and the
ix panel i x d i, d i d x + 1. So, this is
the way that we do and we have taken this
figure from m2 and m1 is official. So defining
these points or forming those points using
the help of computer is called the mesh generation.
So, the most common discretization techniques
available for the numerical solution of partial
differential equations are the finite difference
method. The second is finite element method
and another one is finite volume method. So,
we will go into small details of this, so
that you have a broader idea, you will not
become expert overnight and all these techniques,
but will give you a very, good understanding
and overall a holistic picture of what computational
fluid dynamics is. So, we will touch briefly
all of these topics.
So, as I said that these are these 3 are some
of the most commonly used discretization techniques
available for numerical solution. So, this
is the second step in this CFD solution first
was the which was the first one if you go
back and you see, the first one was defining
the geometry. The second one was discretization
of the domain and as I said, discretization
of domain can be done using 3 different methods.
First finite difference method, second is
finite element method and third is finite
volume method. So, if you see to this figure,
the continuous flow field is described in
terms of discrete value that describe location.
In finite difference method, the flow field
is dissected into a set of grid points. And
the continuous functions are approximated
by discrete values of these functions calculated
at grid point. So, what happens in finite
difference the flow field is dissected into
a set of grid points as I showed you, right
so, this is 1 grid or these are grid points
in x direction this is grid in y direction
and the continuous functions are approximated
by discrete values of these functions.
So, what we do we calculate the value suppose
the velocity and pressure we will calculate
at this point we will calculate at this point
using the our conversion of partial differential
equation to the algebraic equation. This is
the thing that I was trying to explain. So,
if this is the delta x has been the mesh size
or grid delta y. So, this is this method is
called in finite difference method. If this
is I this is i + 1 this is - 1, this is you
know suppose this point is I, j. So, this
will be this point is going to be i, j + 1,
this point is going to be i + 1, j + 1 now
this is how it is defined. So, this is I,
j - 1, this is i + 1, j - 1.
So, in 
finite element or finite volume method the
flow field is broken into a smaller fluid
element called cells. Alright. So, for 2D
domain cells are areas all right, and for
3d domains, these cells are volumes. So, the
differential equations are written in appropriate
form for each element and this set of resulting
algebraically equations are solved numerically.
So the differential equations are written
for each of these elements.
And the set of resulting algebraic equations
are solved numerically, so we write this equation
for each of these elements if there are thousand
element we write thousand equations, and we
solve it numerically.
So this is an example where you see it is
a 2d domain and therefore this is a cell.
In the computational domain, it is 2d. This
is 3 dimensional come become computational
domain. And you see, these are like volumes
or you can also think in a way that this 2D,
I mean, for a same object, we have shown a
2d representation, we can say and we have
shown a 3d representation. It is up to you
how you want to take it.
But the main message of that needs to be conveyed
here is that for 2d domains, the cells are
areas and for 3d domains, the cells are volume.
So, I think this is a nice point to stop this
lecture, and we will resume in our next lecture
from this point. So, thank you for listening.
I will see you in the next class.
