Lecture 53 : Boundary Conditions III

IIT Kanpur July 201
20 followers
2 Video Views·Oct 5, 2024
Hello everyone, welcome back. So, we are towards the end of our lecture series on CFD, applied
CFD course and we have looked at different kind of equations, Navier-Stokes equations,
we looked at the schemes, the stability, when to use what kind of a scheme, if the flow
is highly non-linear, if the flow has got shocks or what kind of schemes you should
use, how to basically balance between the robustness of a scheme and the accuracy of
a scheme and so on and so forth. So, this all is fine, but one very important
ingredient that is missing, if you want to do a CFD simulation is the boundary conditions.
So, even if your all your equations are right and you are using a very accurate scheme,
very stable scheme, but if your boundary conditions are not right, your either your flow will
diverge or you will get an inaccurate simulation. So, in the next few lectures, we will be basically
focusing on the boundary conditions, because that is one of the most important aspect of
your CFD simulation, whether you get a right solution or a wrong solution depends on how
you set the boundary condition. Further, like unlike a physical wind tunnel,
there are some numerical considerations also, which is necessary in a setup of boundary
conditions. So, in a physical wind tunnel, you may basically put your walls away and
you may get a good solution, for in numerical cases often it is not convenient to put boundary
very far, because that will increase your grid size drastically and hence the competition
cost. So, we want to basically make a balance here also, that we want to keep our boundary
as close to the body as possible. At the same time, we do not want our scheme to blow up
or get the spurious solution or the wrong solution. So, these are some of the challenges
that we will look at when we discuss about the boundary condition.
So, if you look at a typical grid, so let us say this is my typical grid, you can think
of this flow as a lid open cavity flow or any flow you see, let us say if you have a
backward facing step flow. So, these are kind of internal flow, so you will make a grid
like this, then in this case you will have boundary, these all regions are your boundaries,
you have to provide the boundary condition for all these regions. Internally, you can
use your equations to solve it, but on all the external parts you have to provide the
boundary condition. Let us say, if you want to simulate flow past an aerofoil and then
you make a grid around this like this, this is your computational domain.
And then, you make a grid which goes like this, something like this, let us say you
have made a grid like this, which will have domain like this, it will go all the way to
the aerofoil. So, in this case also you have to give boundary condition on this region,
this is your external boundary. And then, you have to give the boundary condition on
your aerofoil also, you can replace aerofoil by a wing, an aircraft, a cylinder, so these
kind of flows are basically external flows. So, this is external flow and this is internal
flow, for example, flow in a pipe, flow inside a channel, all these kind of flows are internal.
So, in all of these you basically require specification of the boundary conditions on
the boundaries. So, if you think of this is my grid, so let us say this is my grid, which
is start from here, these are all boundaries of my domain, you can have divided into several
parts. So, let us say if you can use the i j system, so you have 1, 2, 3, 4, 5, 6,
7, 8, 8 grid points in this direction. And similarly, you can have 1, 2, 3, 4, 5, 6,
7, 8, 9, so basically at i equal to 1, which is basically your left most boundary, this
one you have to specify the boundary condition. So, this is what is basically blown up and
get some, similarly at i equal to 8 here, i equal to 8, which is basically I mean the
general is n, so the far right boundary, there you also have to do the boundary condition.
Similarly, for j equal to 1 and j equal to n y, let us say let us call it n x and n y,
you have to provide the boundary condition. So, at the bottom here and on the top, your
boundary condition depends on the kind of flow you have. Let us say from internal flow,
you might have an inlet or you have an outlet, then you can have may be wall at the bottom.
Let us say if you are doing flow in a channel, both top and bottom, so your flow if you are
showing flow in a channel, so you have wall on top and bottom. And something is coming
in, something is going out. So, this is you will have to put wall on top and bottom and
then something is going in, something is going out. So, you have to give the boundary conditions
for all those things. So, generally if you see, so if the flow is incompressible, then
as you know that density is not varying. So, the boundary conditions that you need is for
the velocity and for the pressure. I am not talking about the turbulent flow as of now,
when you go to the turbulent flow, you need to specify some more boundary conditions.
For the case of compressible flow, you need the velocity boundary condition, pressure
boundary condition and temperature boundary conditions. And you can use this ideal gas
equation or an appropriate relation between p rho and T to get the value of rho. For an
ideal gas, you can use rho equal to p by R T. If you know the pressure, velocity and
temperature, you can get that. Or you can, you may choose that I do not want temperature,
you can put a boundary condition on density or you can put a boundary condition on density
and temperature and not on pressure. So, all these combinations are possible, but you cannot
give boundary condition for both pressure, temperature and density because that will
be over specification. Then you cannot satisfy this relation.
If the flow is turbulent, then you have some more equation that you are solving. So, for
example, in the RANS equation that we saw, you may have a model which is k epsilon model
or k omega model or let us say if you have 4 equation model like gamma, Re theta, k omega
model, S S T k omega model. So, for all each of these variable that you are using, the
additional variables in the equation, you need to provide boundary condition for each
of them. And for if you are doing L E S and D N S, so we will look at L E S after the
boundary conditions. So, you would see that they are solving the
non-dimensional equation as it is. So, if there is a turbulence in your domain, so you
need to basically or if the turbulence is coming towards the inlet. So, if this is your
inlet and you see that the flow which is getting in here is turbulent. So, in that case, you
have to make sure that you give a provide, you provide appropriate turbulent inlet here.
So, that is slightly difficult than RANS because RANS you are giving the statistical quantity
like the k and epsilon and omega. So, for example, this is the turbulence kinetic energy.
If you have L E S and D N S, you have to provide U prime, V prime, W prime, E prime and so
on and so forth or T prime. So, you need to basically give the fluctuations themselves
rather than any correlation. So, then it becomes slightly complicated when you go to L E S
and D N S and let us say you have 10 percent or 5 percent turbulence density. You have
to appropriately find the fluctuations corresponding to that intensity. So, that basically you
get that number of 5 percent intensity and whatever length scale that you have.
We will not go into the detail. If you are doing L E S and D N S, you will know about
those approaches. There are approaches like you can have some kind of digital filter is
one approach which gives you the correlated turbulent fluctuations. See, you have to make
sure that your U prime bar goes to 0, but U prime U prime bar is not going to 0 or U
prime V prime bar is not going to 0. So, those correlations you need to obey. So, you have
something called digital filter or you can what you can do is you can simulate turbulence
in a box. So, you can just pre-compute your turbulent
fluctuations. Let us say before you basically feed in here, you simulated a turbulence in
a box got this U prime V prime W prime and so on and so forth. You keep on feeding this
from the inlet apart from your mean velocity which is U bar V bar. So, that is another
way, but you have to make sure that it is also temporarily correlated because this fluctuation
will be changing in time. So, that another is homogenous isotropic turbulence. In some
cases where it is in equilibrium, there are approaches like recycling. So, whatever thing
that is coming out from here, you basically rescale it and put it back. So, that approach
is called recycling and rescaling. The idea is that let us say if you are not
putting the turbulent flow also in the beginning because of the Navier-Stokes equations because
non-linearity the turbulence get developed and by the time it comes out of the outlet,
the flow is turbulent and correlated and that fluctuation are feeding in back in your active
inlet. Also, there are synthetic approaches, synthetic turbulence approaches where you
can basically generate the fluctuations. Recently, there are machine learning approaches which
are also coming in to give you this turbulent fluctuation. So, that is an additional difficulty
in the LES and DNS that you do not only give the boundary conditions for the mean flow,
but also for the fluctuations. So, we will not discuss this part in the boundary conditions.
If you are interested, you can look for appropriate books and there are lot of literature where
you can see how to provide the inflow boundary condition, turbulent boundary conditions for
the LES and DNS. One more important point that typically we
use this conserved variables in the compressive flow especially in the compressive flow, but
giving the boundary condition, let us say for rho u and rho v and rho is not straight
forward. So, what we will do? We will basically give the boundary conditions in your primitive
variable which is rho u, v and t and then they will be converted to rho, rho u, rho
v and rho v for the iteration. So, your equations will be in this, but you will give boundary
conditions in this rho u, v, t and that you need to do every time. So, basically in every
loop, in every iteration you have to convert your conserved variable to primitive variable
and then provide a boundary condition to the primitive variable, convert it back to the
conserved variable and run in the loop. Now, if you look any typical software, you
will have several boundary conditions available for you to implement. So, first of all you
should know what is your flow like. So, that is very important to know what you are going
to simulate, where there is a wall, whether there should be flow coming in, whether the
flow should be coming out. So, typically let us say if you look fluent or open form
this kind of software or any software for that matter, there are some boundary conditions
which are very common. For example, there will be a pressure inlet and corresponding
there is a pressure outlet. If the flow is coming in from some location and going out
from another location, then you have to give the pressure inlet and pressure outlet.
So, this is general, this is there for compressible flow, incompressible flow, all kind of flow
subsonic, supersonic, hypersonic. Although the implementation is slightly different,
we will discuss that later. For if the flow is incompressible, you have got velocity inlet.
This is not there for compressible. We will look for the reason when we discuss about
inlet and outlet. If the flow is compressible, then you could use mass flow inlet. Basically,
this is rho u a because your density is also varying and velocity also varying. So, instead
of using the velocity inlet, you will be using the mass flow inlet. This can also be implemented
for incompressible flow, but I mean it serves no different purpose than the velocity inlet
because ultimately rho is constant. Then if you have an outlet, you can have kind
of outflow. It can only be used with the velocity inlet. It cannot be used the pressure inlet.
So, that is one requirement that your pressure inlet, you cannot use outflow because the
pressure gradient that you want in the flow is not achieved if you are using a outflow
with the pressure inlet. So, in the pressure inlet, you are specifying the pressure. In
the outflow, you are making sure that all the gradients are going to 0. It is basically
very far from the body. So, when we have the detailed discussion, we will come to this
very soon. Let us discuss what are the boundary conditions that are available typically for
the compressible. You have the pressure outlet, but then you also have an option of non-reflective
boundary condition. So, we will discuss these things also later.
If you have a wall, you can have a slip wall. Basically, things are slipping on the wall.
It is not sticking to the wall or you can have no slip wall which is more physical condition
where the particles on the wall are sticking. Basically, the velocity is going to 0, identically
0 on the wall. Then, there is something called symmetry. So, if your domain is symmetrical,
let us say if you are trying to simulate flow in a channel and you are basically doing at
mean flow or at Reynolds number when the flow is identically symmetrical. So, it is like
let us say your flow is like this which is symmetric around the 0 axis. So, that what
you can do? You can basically ignore the top part and do the simulation only for the half
part. So, how does it help you? It basically reduces your compressible effort. In 2D, it
will become just half. In 3D, you will have more savings because you do not have the third
dimension also. So, basically it reduces your compressible effort a lot, but it has to be
utilized with care. You have to make sure that the flow is really symmetric. For example,
if you take flow past a cylinder and Reynolds number, let us say 100, your vortex setting
starts. Sometimes, it will set from the top. Sometimes, it will set from the bottom. So,
simulating this kind of flow with symmetry is not advised. In fact, you will get wrong
results if you just take the half the cylinder. So, on the other hand, let us say Reynolds
number is very low. Reynolds number is 10, where the flow is symmetric from both the
sides of the cylinder. Then, you can use the symmetry boundary condition. So, you have
to use this boundary condition with care. So, in this case, you can take the example
channel. You can use the symmetry here on the top. You can use may be slip or no slip
at the bottom. Then, the flow is coming in from here. So, you can use some kind of inlet
here and flow is going out from here. So, you can use some kind of outlet. So, remember
this terminology. Outlet is different from outflow. These are the names which are used
in the literature. They have got some physical meaning assigned with why they are called
outlet or why they are called outflow. There is another also very popular boundary
condition, which is called far field. This is used typically for the commercial flow.
So, let us say you have a cylinder here and you create a domain, which is very far away
from the cylinder. If the cylinder diameter is let us say one, then you make it may be
20 times or 50 times the diameter of the cylinder. Then, the implementation of boundary condition
is easy. You can use a boundary condition, which is called far field. This is only for
the commercial flow. You can also have the periodic boundary condition. So, what I am
showing you here is a series of turbine blades. So, if you see any turbine, the blades are
basically mounted on a shaft. You can see that if you want to simulate the entire shaft,
you have to simulate 100s of blades or 200s of blades, whether in compressor or in turbine.
Instead of doing that, you can basically just take the region between the two blades and
say that whatever is happening on the top is basically repeated from what is happening
in the bottom. So, it is assumed that I mean the flow is symmetric on top and bottom or
cyclic on top and bottom. In that case, you can use a periodic boundary condition on top
and bottom. That also helps you basically reduce the computational cost a lot. Let us
say that if I have I am trying to simulate a wave, which is basically repeating like
this. So, instead of simulating a very long domain, whether a wave is repeating, what
you can do is you can truncate it somewhere. It may be here and may be here. You can use
the periodic boundary condition. So, that really helps you in saving the computational
cost. So, here I am saying there are two kinds of periodic boundary conditions. One is the
translational and another is rotational. So, translational is for example, if it is
a linear cascade and you know what is the distance between the two, you just shift the
property from here. So, you want to copy this value to this value or this to this value.
You know what is the distance here. Let us call it d. So, you basically use the values
here. I mean shift the value here by d. You can have something on the rotational. Let
us say if you see a burner. So, you can have a burner here, then here and let us say you
have several burners like this. So, instead of basically simulating this entire thing,
you can may select to basically choose a domain, which is like this. Instead of choosing an
entire domain, you can just choose a domain like this and then use a periodic boundary
condition here. So, then you can use the rotational periodic here. You know the theta here and
at what angle you have to do, you can use the rotational periodic boundary condition
there.
So, now let us take the boundary conditions one by one. So, we will go to inlet and outlet
in the next class. Today, we are going to discuss boundary conditions, which are very
simple to implement and which does not have any ambiguity. So, for example, the boundary
conditions like wall boundary condition, symmetric boundary condition and the periodic boundary
condition. So, there is no ambiguity in these boundary conditions, but if you go to let
us say the inflow and outflow or inlet and outlet, there are many ways you can implement
this inlet and outlet. You have to be very careful for which variable you are basically
specifying. For example, you cannot specify both velocity and the pressure at the inlet
or outlet. That is kind of over specification. So, today we will discuss these simple boundary
conditions wall symmetric and periodic. So, the wall is very easy. So, let us say if you
have a surface here, which is wall and then you have a flow, which is happening on top
of this. So, what the wall boundary conditions is that you can take normal component and
the tangential component of the flow. So, if the normal component is 0, that is called
the no penetration. That means your u normal is 0. It has to be satisfied for every wall
whether it is slip or no slip. So, the particle cannot penetrate to the wall. So, in this
picture if you see your u normal is going to be 0 for any case. Now, comes the part
which is u tangential. What happens to the flow which is tangential to the surface? So,
if the flow is no slip, then the velocity of the particle on the wall will be equal
to the velocity of the wall. So, if the wall is stationary, it has got no motion. Then
the velocity of the particle on the surface will be 0. So, that is called the no slip
boundary condition. In this no slip will also be u t will be equal to 0, but there is also
an artificial boundary condition. It may be physical also at very high Mach number, where
the flow is not sticking to the surface. In that case, what will happen that your u t
if I can call this u t on the wall will be equal to the free stream velocity or the velocity
on top of the wall or the velocity on top of the layer. So, your u t will become the
value if let me call it u that will be equal to let us call u infinity. So, your velocity
the tangential velocity is not 0 if it is slip condition. Remember if the wall is moving
at a velocity of u, then in the no slip the u t will be equal to u wall. If the wall is
moving at a velocity of u w, recall the example of the lid driven cavity. So, it is a very
simple example and with well different boundary condition. All three surfaces are wall and
the top one is moving at a velocity u. Let us call u w here and then because of the vortex
forms. So, all four you will be applying the no slip boundary condition, but in this case
here u will equal to 0, v equal to 0, u equal to 0, v equal to 0, u equal to 0, v equal
to 0 and here u equal to u wall and v equal to 0. So, this is also no slip because it
is not slip because here the wall itself is moving. So, the no slip says that the particle
acquires the velocity of the surface. That is what all no slip means. So, the slip wall
or the inviscid wall. So, slip wall is typically used in numericals to study the viscous effects.
So, what you can do for some surface you remove the viscosity, use the slip condition. So,
if you do flow over a flat plate and if you use the slip condition. So, your transistor
velocity is not slipping here. The u n, I mean the v is equal to 0, but u is not equal
to 0. So, you will not get a boundary layer. So, you will get a surface which will be like
this, no boundary layer. So, this is your slip condition. Basically, it is slipping
on the surface. On the other hand, if you use the no slip boundary condition and what
will happen? You will get a boundary layer like this. This is your no slip condition
because the velocity is 0 here on the surface and then the velocity will increase and at
the boundary layer thickness or little above the boundary layer thickness, it will acquire
the free stream velocity. So, the no penetration is satisfied. Once again, the flow slips on
the wall, the tensile velocity is equal to u and there will be no boundary layer typically
used with the Euler equations or the inviscid equations. In those cases, you should not
use the viscous wall, but the no slip wall. Second is the no slip wall. Here, both the
no penetration and no slip are satisfied. Both the normal gradient as well as tensile
velocity gradient are 0. The boundary layer will develop and basically, you will satisfy
for both the velocity, but what about the pressure and temperature? Temperature is specifically
if you are doing a compressible flow or even in incompressible flow, if you are using a
thermal equation or I mean you are putting some source term. So, the normal pressure
gradient is set to 0 on the wall. So, if you have wall, you use the normal pressure gradient.
So, 0 will see how you do that numerically, how you implement that in a code. For the
temperature boundary condition, you have two kinds of walls. One is adiabatic wall and
another is isothermal wall. When it is adiabatic wall, that means the gradient is going to
0. There is no wall flux. So, your temperature gradient is going to be 0. Often, we use the
isothermal wall. Let us say you heat the wall or you cool the wall. So, you are basically
fixing the temperature of the wall. So, then you have to set the temperature at the temperature
of the wall. So, that is called the isothermal wall. Once you know the pressure and temperature,
you can calculate the density using the ideal gas law or any relation which relates these
three variables. Now, how do you implement this d p by d n equal to 0 numerically in
a code? So, if you look at this picture, this is my i equal to i and j is equal to 1 and
the second surface is j equal to 2. We want to get d p by d n. In this case, d p by d
y is like this x and y at y equal to 0, which is basically d p by d y at j equal to 1.
So, what you can do? You can use the Taylor series expansion. So, if you write it at 2,
you can use p i at a given i j plus 1 is equal to p i j plus delta n, which in this case
is delta y. Whatever distance you have, this is your delta y into d p by d n and then higher
orders. Then, what you can you have to say that my d p by d n goes to 0. That means,
the value at i j, so p i comma j is equal to p i comma j plus 1. In this case, this
is p i comma 1, which is the value at the wall is equal to p i comma 2. So, you know
the value of pressure next layer. On the next layer, just use that value. This is the first
order approximation. Let us say you can have the wall on top also. Let us say you may call
this n y. So, then you will have p i n y is equal to p i. Then, you have to take the value
from the layer just below that n y minus 1. This is basically the gradient goes to 0.
These conditions are also called the Neumann conditions. I am sure you know the Dirichlet
and Neumann conditions. In Dirichlet, you apply the basically fix the value. In Neumann,
you fix the gradient. So, here we are fixing the gradient and making sure that d p by d
y is equal to 0. You can also have the second order approximation.
So, you can take the two layers. So, this is my wall. I can take one layer here. If
this is my j, this is my j plus 1. I am taking another layer, which is j plus 2. Then, you
write the Taylor series for j plus 1 and j plus 2. Then, what you do is you can eliminate
this del 2 p by del 1 square because you want the second order relation just to make the
Neumann equation more correct. So, what you can do is this is 2 square delta n square
by 2. So, you can multiply this by 4 and then subtract multiply by 1. So, a into 4 and b
into 1 minus b into 1. So, that will get 4 p i j plus 1 is equal to 4 p i j plus 4 delta
n delta p by delta n. There is a p i j plus 2 is equal to p i j plus 2 delta n delta p
by delta n. You can get the delta p by delta n from here. That will become, I think this
will become 4 p i j plus 1 minus 3 p i j and minus p i j plus 1. So, this is how you can
get j plus 2 by 2. I hope I am correct. You can verify this. So, basically what I am saying
that you will get a relation, which is j plus 1, j plus 2, j plus 1 and j and delta n. You
can set this value to be 0. That is how you get the value of p i j. That is the purpose.
You want to get the value of p i j. This is the p i j. So, you will get the value of p
i j. We are using the value of not only the first layer, but also the second layer to
get the value of p i j. Next is the symmetric boundary condition.
So, as I told you, I gave you an example of channel, but here you can see that let us
say you have a flow over an aircraft and you are looking for basically a mean flow, which
is basically symmetric to this airplane. So, for example, the plane is something like this,
which is basically completely symmetric to what we have here. Something like this and
the flow is completely symmetric to this, the mean flow. So, then you can use the symmetric
boundary condition. You can forget about the top part here and put the symmetry at center
and do this. So, here also if it is, I mean the cross flow,
I mean on the cylinder. So, you can only solve half of this if the angle of attack is 0.
So, again you have to be very careful what kind of flow you are simulating, whether there
is an unsteadiness in the flow. This boundary condition cannot be for example, used for
LDS or DNX. You cannot use it because the flow is changing instantly. So, there will
not be any symmetry even at decent Reynolds number, decently higher Reynolds number, but
for the range flow or very low Reynolds number flow, when the flow is symmetric, then you
can use this kind of boundary condition. So, only applicable in symmetric flows, you
have to be very careful, not unsteady like vortex shedding, LDS or DNS. So, this implementation
wise numerically it is very close to the free slip boundary condition or slip boundary condition.
It is like an inviscid valve. So, what we are saying that once you have a symmetry,
so there is no flow occurring across this. So, there v is equal to 0, v will go to 0
and there cannot be any flux. So, that means your del u by del y equal to 0, del p by del
y equal to 0 and that is how you calculate the value of u and y, u and p and v everything
here at the symmetric. So, set normal flow to 0, set normal derivative to 0. The additional
way to do it that because there is no shear stress here, set wall shear stress to 0 at
the symmetric. So, that is how you can obtain it and as I was saying that if you look at
the implementation of the slip boundary condition. So, here also what you do, you set v equal
to 0 because there cannot be any penetration and for others you put the gradient equal
to 0. So, implementation wise the slip boundary condition and the symmetric boundary condition
both are similar numerically, but in terms of physical concept they are completely different
thing. Symmetry is used to basically reduce your compression cost.
Finally, look at the periodic boundary condition. So, here you have series of turbine blades
and I was showing the picture that instead of doing this for the entire blade, you can
just choose one blade and then you know that what is the spacing between the two blades.
You make your grid in such a way that the spacing is honored on top and bottom. So,
this is the spacing which is d which is equal to the spacing d here and then you put the
periodic boundary condition on top and bottom. So, that it will reduce your computational
cost a lot and how do you implement it numerically? So, very simple way to think about it, I mean
you will think of a ring. So, if this is your ring, this is your 1, 2, 3 and keep on going
all the way, it will come back to n minus 1, this n. So, whatever is 1 is also equal
to n. So, if you now open it up, now you will have 1, 2, 3, n minus 1 and so on and so forth.
So, if you would have continued and this will become your n plus 1 and this you can call
it may be 0. So, your 0 value is equal to n minus 1 and n plus 1 is really equal to
value of 2. In some of the code, the way it has implemented is instead of basically closing
it here, you go and basically go like this. So, this is your 1, 3 and this is your basically
and if you do not. So, for this you need to use ghost conditions, you need to have extra
cells which is beyond 1 and n. So, if you do not want to do that, so what codes do is
you can call it, this one is n, this one is n minus 1. So, you need the value at boundary
1 and you need the value at boundary of n. So, u 1 you can call it as u n minus 1 which
is the internal node and u n is equal to u 2. So, what we did, we shifted by 1. So, 1
become 1 minus 1 and n become 2. So, you do not need any ghost conditions in this particular
case. So, with this we will stop the class today.
In the next class, we will look at the several implementation of the latent and octet boundary conditions.
Thank you very much.
