Lecture 54 : Boundary Conditions IV

IIT Kanpur July 201
20 followers
2 Video Views·Oct 5, 2024
Hello everyone, welcome back. So, yesterday or in the last class, we saw the implementation
of wall boundary condition, symmetry boundary condition and the fluidic boundary condition.
Today, we will discuss about the implementation of the inlet and outlet boundary condition.
So, we have seen this picture earlier. So, we will focus will be today on this pressure
inlet, velocity inlet and mass flow inlet and the different outlet boundary conditions.
So, for incompressible, it is slightly easy. So, the implementation of the boundary conditions
are different for the compressible flow and incompressible flow. We will look at these
flows separately.
So, let us go to the incompressible flow. So, one of the easiest boundary condition
that you can implement is the velocity inlet. So, before we even get into that, you must
know one thing is that we cannot specify the pressure and velocity at the same time as
the boundary condition either at inlet or the outlet. So, if you specify let us say
both pressure and velocity, that is basically over specification. Why? Because these variables
are coupled to each other. So, if you specify the pressure, the velocity will be calculated
from the CFD code to ensure that whatever pressure value that you have fixed, they are
basically honored. On the other hand, if you specify the velocity, the pressure will be
calculated from the CFD code in such a way that your fixed velocity, whatever value you
are giving is honored. But, you cannot specify both pressure and velocity. So, that is one
thing you must remember that if you are writing a code, you should not give both pressure
and velocity at either inlet or outlet. So, in the velocity inlet, if you know the
velocity, then you can just provide the velocity there. But, in many cases, you do not know
the velocity. But, if by some means, if you know the velocity, you can just give the velocity
and the angles, may be alpha and beta, that will be used to calculate u, v and w, the
three components. That is the only thing that you need to specify and you can get the pressure
from the CFD code. Now, this is used only in compressible code. Why? Because as you
will see that when you go to the compressible code, it becomes a hyperbolic equation, mainly
the hyperbolic equation. Then, there are waves which will come in through the inlet.
So, that will change your velocity. So, if your velocity is v, let us say there are some
waves which are basically travelling. So, that will be v plus v prime. So, you cannot
fix the velocity there. So, fixing the velocity is very hard in compressible code, especially
at high Mach number. So, that is why we use this velocity inlet boundary condition for
the incompressible code, where we specify all these velocities and the pressure is computed
using the CFD code, which is there inside your domain. This is good for external dynamics,
but you should know that this can only be true when the velocity is sufficiently low
that the Mach number is not very high. That means it is nearly incompressible.
So, why it is good for this kind of flows is because you know the velocity of the, let
us say the car is travelling or the aircraft is travelling and so on and so forth. In fact,
in the case of car, if you want to simulate flow behind a car, so what you do? So, in
reality your car is moving and your road is fixed. Basically, your air velocity is not
that high, but the car velocity is very high. On the other hand, if you want to do CFD simulation,
a better approach is keep the car fixed and keep the velocity of the car to the velocity
of the air in the opposite direction. So, that is one way to basically simulate flow
over a car. Otherwise, you have to basically, if your car is moving, then it may go out
of the domain. Even if you use a periodic domain, then also you have to take care of
the moving mass and so on and so forth, but instead of moving the car, you can just move
the air. Same is the case with aircraft or the wing.
The other condition is the pressure inlet. Now, this pressure inlet is used for all flows,
all kind of flows. It is a general boundary condition. It is available in the compressor
flow or decompressor flow. In fact, in open form also you will have implementation of
this everywhere and why it is general boundary condition because the pressure is usually
known. So, let us say if you have a reservoir here, from there something is coming in. So,
you know this reservoir pressure. So, this pressure is often called the total pressure
P naught or the stagnation pressure P t. From there, let us say you have kept something
here for the measurement here and this is your window. So, you may not know the velocity
here, but you will know the pressure here. So, that is why the pressure inlet is very
common. So, if you want to do the same thing in CFD, you just use this, use the pressure
inlet here and kind of pressure outlet here. So, in this case, we fix the total pressure
which is kind of pressure in the reservoir here or whatever P naught. You can take this
total pressure. In fact, you can use the static pressure also. Some of the solvers, you can
specify the static pressure also. In fluent specifically, you specify total pressure
and it is a better idea to basically specify total pressure than the static pressure is
because you can use this relation easily. So, your P naught is fixed and you allow this
P n or u to vary in such a way that your P naught is fixed. So, you will have initial
condition at t equal to 0. You have to respect some initial condition and the static pressure
will be taken from the previous iteration. It also depends on what kind of outlet you
have. Let us say at the outlet, let us say you have a nozzle and you are putting some
kind of back pressure here. So, the back pressure will also affect the pressure on this side.
We went to the slightly compressible, but when in the incompressible flow, let us say
you have a turbine blade and this is the domain that you have and the mass number is very
low, but you have some total pressure here and some static pressure, which we call as
back pressure here. So, this pressure will also affect the domain everywhere. If you
fix the total pressure here and let the pressure on the boundary, static pressure on the boundary
P and u evolve with iteration by considering the back pressure here at the outlet. So,
it will be basically, you will take it from the previous iteration and it will go in the
loop. Velocity is calculated in the Bernoulli relation, which is given here and this is
a sign. So, if you know the P naught, P is taken from the last iteration, you get the
velocity of u and it is basically keep on recalculated using the equation and this will
be repeated. Your total pressure is fixed, but your 2 to 4 will be repeated. So, this
way you will see that as your iteration goes towards the convergence, you will get the
static pressure, which you expect at the inlet. So, this is the typical pressure inlet condition
for the incompressible flow. Now, you need something at the outlet also.
So, there are, before I go to outflow, let us go to the pressure outlet. So, the static
pressure is specified at outlet. As I told you in this example, that you just provide
this back pressure at the outlet and the pressure at the inlet will adjust based on
the back pressure. Why we not give the pressure at the inlet also and only at the outlet because
we want this pressure to be calculated from the CFD. We can only specify either the total
pressure or the static pressure. Once you give the back pressure, you recall the incompressible
flow situation. Any information is basically instantaneously available everywhere in the
domain. So, if you have a back pressure at the outlet, it will affect the flow at the
inlet also. So, you are not basically fixing the pressure at the inlet here. This is ignored
in the supersonic flow. We will look at the supersonic flow, why it is ignored, but basically
you can think of a situation. This is your inlet and outlet. You give the P naught here.
Use the Bernoulli's equation to calculate U. P is taken from the CFD code and you give
the back pressure here or the pressure outlet here. That is the only information you can,
you have to give and you can calculate all other information using the Bernoulli's equation.
As the situation goes and as solution goes to the convergence, you will get your desired
static pressure here. Now, you can also compare this pressure inlet with the velocity inlet
also. Let us say your Mach number is very low or the flow is incompressible and you
can try seeing a velocity inlet simulation and pressure inlet simulation. If you have
a good information on the velocity and you will see that the difference will not be very
much at the inlet. Let us say in terms of velocity even if it is pressure inlet, but
what is very important is that you have one thing fixed and other is floating.
So, let us say if you use a pressure inlet, your P naught is fixed. That cannot change.
That is the boundary condition. It is not changing with time. Your U and P will be changing.
The velocity and static pressure will be changing. If you use the velocity inlet, your velocity
is fixed. That cannot change with time and the other values will have to be adjusted
ensuring that your velocity is fixed. Your pressure may change, your P naught may change
and all these things will change if you are using a velocity. That is very important thing
to understand. Eventually, let us say if you use the pressure inlet for the flow where
you also know the velocity and you got some velocity V and you second you did the V velocity
inlet and got the velocity which is P naught. You will see that this V and this P will be
very close to each other and this P naught and this P naught will be very close to each
other, but they will not be equal because you have kept the things floating.
So, towards the convergence, they will be very close to each other, but they will not
be equal. Sometimes, if you want to calculate, let us say you want to calculate C P based
on your P at the inlet or the pressure at the inlet and let us say if you have used
the velocity or the boundary condition which is velocity inlet, then you have to take the
average pressure at the inlet to get your P and then you can use this relation C P equal
to P minus P infinity by half. So, you know the pressure. So, let us say if you have a
cylinder here or let us say an aerofoil here. So, you know the pressure here at every point.
At every point, you need P infinity which is your free stream pressure, but what boundary
condition you have given? You have given the boundary condition of velocity. Then, you
have to calculate the P infinity at the inlet. So, after your simulation is done, you have
got the converged solution. Go back and calculate the average pressure at the inlet. That will
be P infinity and then you do P minus P infinity by half. That is how your different inlets
and outlets work. This is for incompressible flow.
Another one you can use for the incompressible flow is your outflow. So, in this what we
do is that we set all the flow gradients to 0. Let us say if you have a flow which is
like this. So, what are the criteria that you have? That flow should be fully developed.
So, if you look at how the flow looks like because of this step, there will be a separation
bubble here. If you try to plot the velocity, it will look like this. You have a separation
region here. If you go here, then it will probably look like this and then it will somewhere
here. It will become fully developed. So, in order to basically apply outflow, you have
to make sure that you are going to a region where the gradients are not changing. You
have to go sufficiently far in the domain where the gradients are not changing. Then
only you can apply the outflow because by definition, the outflow means the flow gradients
are 0. So, the flow should be fully developed. Then only you can use this. If you try to
use it here, it is wrong. I mean you cannot use outflow here. So, application of outflow
is not allowed here, but if you make the domain sufficiently far, then you can use
this outflow boundary condition. Further, if the flow has got lot of unsteadiness, then
also you cannot use this kind of boundary condition. So, these are some of the boundary
conditions that we saw for the incompressible flow, pressure inlet, pressure outlet, velocity
inlet and outflow. Again, this outflow cannot be used with the pressure inlet. So, you cannot
have at inlet, you have pressure and total pressure and outlet as outflow because again
it creates the pressure difference that you want will not be physical. That is why you
can use this outflow. Only you have the velocity inlet or may be mass flow inlet on those kind
of boundary conditions, but not the pressure inlet. If you are using the outflow, these
are some of the considerations that you need to take when you are applying the boundary
condition.
Now, let us go to the compressible flow. Now, the compressible flow is slightly tricky.
If you say compressible flow, your flow can be subsonic, supersonic, may be hypersonic,
transonic. There are different regimes and flow phenomena change depending on which regime
you are. In the subsonic also, it can be very low subsonic or high subsonic. In the subsonic,
it is typically a mark less than 1. Let us say mark less than 0.3. This is low subsonic.
It can be comparable to the incompressible flow. Let us say if you are around mark equal
to 8 or something like that greater than 0.8, then the flow can be transonic.
So, what can happen that the flow can be locally supersonic or locally subsonic. So, the specification
of one boundary condition, let us say you said give this pressure may not be applicable
because as we will see depending on whether the flow is supersonic or subsonic, the application
of the pressure boundary condition matters. So, the first thing is to determine whether
the flow is locally inflow or outflow. You may have a domain which is this is your inflow
or inlet. This is outlet. You know that, but you have to look at locally whether the flow
is inflow or outflow especially if you have a domain which is complicated.
Let us say you have a domain like this. Then, you have to find out whether it is inflow
or outflow. So, how do you do that? So, what you need to do is basically you need to find
out u dot n, the normal velocity. If the normal velocity is going greater than 0, then it
is outflow. It is also called u perpendicular. If it is less than 0, then this is inflow.
Why because this normal is always outward. So, this is normal and this is u. When you
say u dot n, it is negative that it is inflow. When it is out, so this u is also going out
here and n is also out here. So, u dot n is out here. So, you can see the diagram here.
This is your n and this is your u. So, this is inflow because that u dot n is negative
and this is your u dot n is positive. This is interior and this is outside. Another thing
you should see that whether the flow is supersonic or subsonic. So, for that what you need to
do is you need to see, you need to compare your flow at the boundary. Basically, your
mark number you have to calculate or you have to basically do a magnitude of u divided by
c, which is greater than 1 or less than 1. If it is greater than or equal to 1, this
is supersonic. If it is less than or equal to 1, this is subsonic. Similarly, for outflow,
you have to see whether the mark number is greater than or less than because as we will
see that depending on what kind of flow you have, your boundary condition matters. So,
this we already saw that when u dot n is greater than 0, outflow is less than 0.
Now, what we will do is we will analyze the Euler equations for a compressible flow. Why
we are going to do that is because we know that this compressible equations are dominantly
hyperbolic in nature. For the hyperbolic equations as we have seen when we are trying to find
out the characteristic is that it will have the real characteristic, real Eigen values.
So, that will give us information. So, Eigen values are basically is an indication that
in which direction the wave is travelling. So, if the flow is let us say supersonic,
your all Eigen values will be positive. That means all travelling in one direction. If
it is subsonic, some may be positive, some may be negative and then accordingly you have
to specify the boundary condition. So, I have written the equations here in the
primitive variable form. These are the Euler equations. Why Euler? Why not Navier Stokes?
It is because we are assuming that your boundary is sufficiently far away from where the activity
is happening, where the core activity is happening. So, that means your viscous effects
are not that dominant in that region. You can use the Navier Stokes characteristic also
but that will become very complicated. So, there are NSCBC Navier Stokes characteristic
boundary conditions but they are slightly more complicated. In fact, much more complicated
and what people have seen that whether you use Navier Stokes or Euler at the boundary
and if the boundary is taken sufficiently far away, it does not matter much.
So, we will focus on the Euler characteristic because it is easy to analyze and easy to
implement also. So, you have this equation del rho by del t plus del by del x rho u equal
to 0 and del rho u by del t plus del by del x rho u square plus v equal to 0 and del rho
u by del t plus del by del x rho u. This is Euler and also this is 1D. So, we will
analyze for 1D equation. Now, the flow may be 2D or 3D but what matters for this practical
implementation is basically your normal velocity u dot n. So, as we saw that that gives you
whether it is inflow or outflow. So, we will be basically interested in u perpendicular
and then you can make a local 1D assumption there and implement all these equations.
So, if you expand it, this will become d rho by d t plus rho d u by d x plus u del rho
by del x. This is what is written here. So, you can see this u del rho by del x. This
is given here u del rho by del x and then rho d u by d x. So, this is your first equation.
The second equation you can for second equation, you have to use both the continuity equation
or the equation 1 and the momentum equation. So, you can basically expand the momentum
equation second one and you can write u del rho by del t plus rho del u by del t plus
you have to expand this other term also equal to 0 and then you have to subtract this equation
1 and you will get an equation which will become d u by d t and plus u del u by del
x plus 1 by rho del u by del x which is what is given here by the second equation.
Similarly, for the third equation, you have to use E equal to basically kinetic energy
plus half u i u i or half u is 0.1 d and plus c v t and use those ideal gas equation and
you have to basically use this d rho by d t going to 0 and finally, you will get an
equation in terms of pressure. So, you please go back and work this out and you will get
an equation which is in terms of pressure. So, right now I have written everything in
the matrix form. So, I hope you know how to read this matrix. We have discussed this also
the matrix form earlier. So, we have been equation which is d rho by d t d u by d t
and d p by d t and this particular thing we call as matrix A and we are interested in
the Eigen values of this matrix A. That will give us the characteristic and these are your
velocity. This I am given as the capital U, bold U. So, you can write this entire equation
in this form and if you want to get the characteristic, what you need to do? You need to find the
Eigen values of this matrix A. So, your A matrix is given as u rho 0. So,
u 1 by rho u 1 by rho and then 0 rho A square and you want to do minus lambda equal to 0
and then you have to do determinant of this. So, not the matrix, but the determinant. So,
you can see this. If you do this u minus lambda, it will become u minus lambda square
minus A square equal to 0. You have three Eigen values. One is u minus lambda equal
to 0. So, one will be lambda equal to u, other will be lambda equal to u plus A, third will
be lambda equal to u minus A. So, these are three Eigen values that you got and according
to each Eigen value, you can now use this Eigen vector. So, basically you have to do
A x equal to lambda x and take each Eigen value. Let us say you call it this is lambda
1, this is lambda 2, lambda 3. So, for take u minus A, so put this value 0. Let us say
if you took lambda 2, let me work this out for you. If you take for lambda 2, it will
become this equation. If you put lambda equal to u, 0 rho 0, 0 0 1 by rho and 0 rho A square
equal to 0. Then, you have to basically x is equal to 0. This is what you are interested
in because I have already done A minus lambda I. I have taken this lambda out. You are interested
in what is the value of x. For that, you get a null space. This is 0 and you can see that
if you use 1 0 0, this will go to 0. So, your Eigen values are 1 0 0. Eigen vector
is 1 0 0. Then, you will have from corresponding to u minus A. Similarly, you will have this
and u plus A. This will be Eigen vector. You can calculate and make an Eigen vector matrix
which is basically rho minus A rho A square 1 0 0 rho A rho A square. This is your Eigen
vector matrix capital X. Now, we will do little bit of algebraic trick.
So, you know that your A is equal to x lambda x inverse. How do you know that? So, if you
write this Eigen value matrix, this will become. So, you have this where lambda is the Eigen
value matrix lambda 1 0 0 0 lambda 2 0 0 0 lambda 3. So, this is how your Eigen vector
matrix is. So, if you do x inverse, this will become A equal to x lambda x inverse.
That is one part. Similarly, you can write x inverse A x is equal to lambda. Why you
are able to write it is because you have got distinct Eigen values. You can get the inverse
distinct Eigen values. That means your Eigen vectors are also independent. You can get
the inverse and you can add this form. So, use this value. So, you have this relation
d u by d t equal to A del by del x. Replace this A by x lambda x inverse and then multiply
by x inverse u. So, then what will happen that this x inverse u if you multiply, this
will get cancelled out. So, you get a new matrix which is. So, this x inverse u is also
a vector. We call this vector d. We got a new relation which is d v by d t equal to
lambda del by del x. Now, recall lambda is now I mean only this is lambda 1 0 0 0 lambda
2 0 and 0 0 lambda 3. Now, it is a decoupled equation. Earlier it was coupled. If you look
at the earlier equation that we had, this is a coupled equation. You cannot decouple
u and p, but now it has a new variable which is given by v. This is a decoupled equation.
So, you can write it may be d v 1 by d t plus lambda 1 d v 1 by d x equal to 0 d v 2 by
d t plus lambda 2 d v 2 by d x equal to 0 and so on and so forth lambda 3 d v 3 by d
x equal to 0. So, now what we learn here is that we have decoupled equation and what are
the values of v. So, let us look at here. So, if you do x inverse u, this is the value
of v. This is your v. This is your new vector and you can write everything in this and this
is your u. This is your lambda and finally, your equations will look something like this.
This is your final equation. These are called the characteristic form of the Euler equation
form of only Euler equations. If you go to 3 d, so right now we have 3 waves. We are
travelling with a speed u minus a u and u plus a. So, these are basically entropy waves,
acoustic waves, thermal waves and so on and so forth. In the 3 d, we will have two more
which are will be basically u and u. We will have u plus u minus a u and u plus a. So,
there will be with this 3 d, there are 5 waves. So, what you can decouple the equations and
write it. So, if you take one equation at a time, so because these are all decoupled,
all these elements are 0. You can see here the decoupled equations. You can write it
this is d p by d t and you can remove some terms. So, may be 1 by 2 a square. So, this
will become rho a d u by d t u minus a. So, this is the variable that you have which is
propagating at the speed of u minus a. Similarly, you can write for the second one and similarly,
you can write for the third one. So, these are 3 characteristic equation that we got.
So, in summary if you look at these 3 equations, so we have a wave which is d u minus d p by
rho a equal to 0 which is travelling at a speed of u minus a. Similarly, this d v 0
which is at corresponding to d x by d t equal to u and this is the wave. So, these are the
wave speeds and this is basically the variable which is travelling that wave speed. So, there
are 3 characteristic waves corresponding to u minus a, u and u plus a. So, now we have
these characteristic equations. We will look at the implication of this characteristic
equation in the next class. Thank you very much.
