Boundary condition.
Of all we need to keep this one is a little bit open because we will specify different boundary condition.
The initial condition, we will not specify it.
Let it be whatever, like let it be initialized randomly based on just initialize randomly.
Now, in our case, the wall.
We need to boundary condition for wall, boundary condition for inlet, boundary condition for outlet.
And we have, of course, you, we have V and we have pressure.
So we have three components and three types of boundary conditions.
And we now we need to tell the program where this boundary condition points are located.
So to do that, we have a different way.
A little bit different than before.
Dot direc.
Rich lit boundary.
Condition and we add in the geometry.
And.
Lambda.
We have X.
And it's going to be zero.
Why?
It's zero because its boundary, if it's wall, its non-slip condition.
And this is the U.
And then we want to define the boundary.
The wall, which this is going to be a function that defines where is this zero going to be applied?
A component.
And is going to be equal zero.
So what we have done here is we said the.
Boundary condition and it will take boundary condition method.
It will have this geometry x lambda, it will be zero, the value of it.
And this is going to be the U and boundary wall is going to be the boundary wall.
We will define it later.
So here it we will have a function called boundary one.
And it will take some.
Thinks.
And we have other functions.
Let's see.
So this is the boundary wall.
And of course, we will define all of this boundary condition.
We will define it the.
We do the same geometry, everything boundary one, it will be the same thing and it will be component
one.
So this is basically how we're going to work U and V, and then we will have inlet again, U and V,
and we will have outlet P and V this time.
And because it should be zero.
Now the boundary wall, which is this one that we need, define it.
How can we tell the program that we have the location is the boundary?
Well, at this point or in this format, he will pass to type the computer program.
The DVD is going to pass two values.
The first one is X, which is the location of the boundary.
And if the point is on boundary.
Daddy.
Bone.
De.
He will tell us if this point that he will pass exists on the boundary or and he will tell us the location
of this point.
Let's let's see how it is like this is this is for future.
This is what we want to see.
What is the program is giving.
And here we can just write this is the X, which is the location of points and here is on boundary and
we pass on the on boundary.
It's a little bit strange way of programming, but.
This is we have to always go with the rules of deepest.
Okay, So this is how can we say the point is on boundary or not?
We need a logical thing.
This is this is going to be true or false.
If it's true, the point is considered on boundary and not just on boundary in the wall boundary.
And it will have the value of zero.
If it's not, then it's not so.
What do we need to do is we need to return.
On wall.
If the point is on wall or the point is not.
Not on the wall.
That's just what we need to do.
And in order to do that, what we need to do is we need to define this function.
Which will be a logical function.
NP dot logical.
Logical.
And.
Y means and like it should be.
The component of this function should be well accepted by both.
And now this will be will have the first component here.
And a second component here.
So how can we define it?
The first one is we want to make sure that this point is on boundary.
And the other one is, well, where is the the the actual wall?
So here the first thing is we just pass this point.
If it's on boundary or it's not on boundary, it will be a little bit complicated.
But let's write it step by step.
The second thing is we need an function of logical well component.
This is going to be the hardest boundary to define, but later it will be easier.
So in order to do that, we have to say the first thing is.
N.p dot or n.p.
Whereas.
N.p.
Dot again logical.
Logical.
And this time is or.
Why is or because we want to say that if the point located on the upper wall or the lower war is going
to be true, it is on the bond.
If it's not, well, it's false.
So this is the first component is.
In.
Dot.
Is close.
Close to what?
This x one.
Is close to minus D over two.
Minus D over two means what means it is on the lower part of the well of the the the wall.
Why we put one?
Because x going to have two values X and y.
The first value is going to x zero is x, which we are not interested.
And the second value is one which is we are interested.
The Y should be minus D over two and.
The R's are tolerance.
What does it mean?
It's a clause.
We have to define these variables.
E to the power minus five.
This is the.
The relative tolerance.
And we have another.
A tolerance with it.
I think it's total tolerance.
I'm not sure.
But it's I think it's the value tolerance.
It has to be this much.
So this is basically we tell the program that we need the point to be on the lower surface of this thing.
But we have another thing.
We have not just the lower surface.
We have also the upper surface.
So is close to this.
And or the point is close to.
A well.
Well, it's close one to minus D over two.
This way.
So basically here what we did is we made.
The computer or we made deep.
If it's close, if this one is close to this, it will give us true.
Or if this point is close to the over two, it will give us true and on boundary.
If we.
We got the value on boundary, all of this.
And so if it's in the on the boundary and it's on the upper surface or lower surface, it is true.
And by that we already finished defining our wall boundary a little bit complicated, but it's kind
of logical this way.
Of course there's another way to compute it, but the same we did in the heat equation, which all the
points in the boundary we can define, we define the past equation, but you can actually make if statements,
if it's if the value is this much and this much you put this value, but it will become a little bit
more complicated, the coding of it.
So here is a little bit cleaner way of defining it for a little bit complex problems.
Okay, now we understand how to do it.
Let's continue now.
PC.
So if it's on the boundary on the wall and a component zero, which is you, component one is V, we
always put them as zero.
PC.
Inlet.
U equals.
Same thing.
Geometry inlet.
But here.
What do we need?
We need you and.
You and.
Now the boundary has to be inlet boundary.
So boundary.
And let we do the same for boundary condition.
However, this time for V and the component is one.
But the inlet should have a V equals this place.
It will have.
It should have a V equals a zero.
So the flow is completely horizontal.
And of course you can change it if you want.
But the idea of this problem, we want to see the growth of the boundary layer.
So you inlet here and V is zero.
This is component one.
It seems everything seems reasonable.
We can see.
Okay, we are ready to write the boundary well condition or the boundary function.
So we take this one boundary inlet and x.
And it will pass also on boundary.
And here what we need to do is.
Will return.
We can put it like on.
And let equals.
NP dot.
Logical.
And.
Same thing here.
But we need to remove.
This one.
So here we just care about the inlet.
And an inlet is only one part.
So we don't have to we don't have to put logical is close to x one.
Just a little.
We will change it a little bit.
Now here logical is basically is close to this and on boundary.
And this is is close and.
Think this one.
No need for it.
Yeah.
This way.
So we need logical it has to be on boundary and it has to be close to.
The thing to close to now, Inlet means X has to be X has to be close to minus.
L over two.
And we have the tolerances.
That's it.
Return.
What?
On inlet.
Interesting.
It's it's very simple.
Like, we have a logical end.
It has to be close.
Is it close to X0 is close to minus L over two if it's correct.
And it is a boundary point, then you return True.
If not, it will return.
Of course.
False.
Okay.
So the last thing is will we have is boundary condition for out.
For outlet pressure.
And of course, boundary condition for the dot is the same thing.
Now here.
What is the pressure at the outlet?
Make it simple.
Put it.
Zero.
But of course it's not very logical.
It means vacuum, but who cares?
Like we just it's just a numerical thing.
Now, here too, is pressure is two, is here is pressure and PC.
Outlet.
V equals we take the whole thing.
And this is going to be the first component.
This is not going to be inlet.
It's going to be outlet.
Outlet and the function is outlet.
Geometry.
X is zero zero You and it's very nice now.
Think so?
000101.
And this is two because it's pressure and one is the V.
V seems good outlet.
We just need to define the function.
And we take this one and we just modify a little bit on.
Outlet.
Keep it on outlet and the tolerances on boundary.
Now zero has to be.
Plus L over two.
If it's on the L over two, we have to apply this boundary condition.
And.
While everything else is the same.
So now we are ready to run this thing.
We just shift, enter.
And shift.
Enter.
We have a problem.
And you n no need for this.
Shift into.
And now we defined our boundary condition.
So the next step, what we are going to do is we need to define the A and of course, the data.
And at that point, well, what we will get is something that looks like this.
This is going to be the printout of X and bound on boundary.
True.
This is going to be the well, the print out of this x going to be looks like this.
It's a numpy array of x and y.
And on boundary it will give us true or false.
So this is what we are going to see.
However, I just want to show you because.
Because it's a library.
The problem is we cannot we don't have really control like to to to see how things are.
So at least unless, you know, the whole thing is a little bit completed, but we will see these print
out statements.