1
00:00:01,070 --> 00:00:06,110
Now what we will do is to solve the Navier Stokes equation.

2
00:00:06,230 --> 00:00:16,040
Navier Stokes Equation is an equation or equations that describe the fluid motion, and by solving them,

3
00:00:16,040 --> 00:00:17,960
we can actually simulate fluids.

4
00:00:18,920 --> 00:00:25,760
Of course, there are many forms of stokes equations, and the form we will deal with is a two dimensional

5
00:00:25,760 --> 00:00:26,420
form.

6
00:00:26,690 --> 00:00:33,470
However, the form that actually we're going to solve, of course we will solve this one, but we will

7
00:00:33,470 --> 00:00:35,570
consider a steady state solution.

8
00:00:35,930 --> 00:00:41,990
A steady state solution is simply any change of anything with time will equal to zero.

9
00:00:42,320 --> 00:00:52,040
So in this equation, what we will do is basically this is Navier Stokes equation du over dt plus u

10
00:00:52,070 --> 00:00:55,520
du over dx plus v du over dy.

11
00:00:55,730 --> 00:01:05,100
So this is the momentum equation in the x direction equals minus one rho over multiplied by d, p over

12
00:01:05,100 --> 00:01:15,770
d, x plus kinematic viscosity and the second derivation of u over and second derivation of u over d

13
00:01:15,770 --> 00:01:15,960
y.

14
00:01:17,160 --> 00:01:21,120
So this is the X direction of momentum equation.

15
00:01:21,150 --> 00:01:29,310
The momentum equation in the V direction or in the Y direction can be donated by DV over DT plus.

16
00:01:29,910 --> 00:01:37,560
Here you got the same thing, but we need to change u here to V and here you will have to also change

17
00:01:37,560 --> 00:01:38,280
this to V.

18
00:01:38,910 --> 00:01:42,450
The last equation we need to solve is the continuity equation.

19
00:01:42,480 --> 00:01:50,920
Of course this is make sure the, the the the the the mass is preserved.

20
00:01:50,940 --> 00:01:56,580
So this is usually Navier-Stokes equation have three equations.

21
00:01:56,580 --> 00:02:02,580
The first one is the continuity, which is make sure that the mass is preserved.

22
00:02:02,580 --> 00:02:08,880
And and this is how the finalists form or in this form that we are going to solve.

23
00:02:08,880 --> 00:02:15,030
And they have the the momentum that has to be preserved.

24
00:02:15,060 --> 00:02:17,260
And the last one is the energy equation.

25
00:02:17,260 --> 00:02:25,690
But because in this solution, what we will not really or we will not solve any energy change, so we

26
00:02:25,690 --> 00:02:27,940
will just put it nothing like it will.

27
00:02:28,150 --> 00:02:30,370
We will not consider it so.

28
00:02:31,760 --> 00:02:38,420
So for city state, what we need to do is this location or let's make it a bit.

29
00:02:39,610 --> 00:02:46,450
This one and this one has to be equals to zero.

30
00:02:46,930 --> 00:02:49,050
And here also zero.

31
00:02:49,090 --> 00:02:49,930
Nothing.

32
00:02:50,320 --> 00:02:51,000
Why?

33
00:02:51,040 --> 00:02:57,490
Because when we have a fluid at steady state, time doesn't change.

34
00:02:57,640 --> 00:03:09,250
So the solution we will do is well, basically most of the this the solvers in the in the choosing pens

35
00:03:09,280 --> 00:03:13,480
is actually explicit in implicit in nature.

36
00:03:13,480 --> 00:03:22,150
So we will solve the whole X and Y together and we keep updating it as we go through our data that we

37
00:03:22,150 --> 00:03:27,640
will create that is boundary condition, initial condition and not initial condition.

38
00:03:27,640 --> 00:03:34,390
In this case it will be random and the most important is the boundary condition and the of course the

39
00:03:34,390 --> 00:03:37,570
pens, the loss we have to keep solving.

40
00:03:39,920 --> 00:03:41,510
So let's start.

41
00:03:42,920 --> 00:03:50,690
Of course, this tutorial or class is built, of course, on Navier Stokes equation.

42
00:03:50,690 --> 00:04:03,610
However, if we want to see the documentation, we can see this code cover Sinaia flow.

43
00:04:04,820 --> 00:04:08,450
This one, basically the equation looks similar.

44
00:04:08,450 --> 00:04:11,690
We can see this equation and if we.

45
00:04:12,750 --> 00:04:15,300
See the this equation.

46
00:04:15,300 --> 00:04:23,460
We can see how similar they both look dude here dude, why it exists here.

47
00:04:23,490 --> 00:04:25,940
P over x exists everywhere is exist.

48
00:04:25,950 --> 00:04:36,090
So it's quite useful to consider this tutorial or in order to understand what's going on in our equations.

49
00:04:36,090 --> 00:04:40,380
So this is like many parts of the code.

50
00:04:40,380 --> 00:04:44,400
You can see it's similar to our part of code.

51
00:04:45,480 --> 00:04:51,780
The Navier-Stokes equation in the documentation of deep is not being considered.

52
00:04:52,140 --> 00:04:53,010
However.

53
00:04:54,040 --> 00:05:04,660
It's basically like we we we hope it will like it's not a problem because this equation is more or less

54
00:05:04,660 --> 00:05:05,290
the same.

55
00:05:06,160 --> 00:05:09,810
So let's step by step, start writing this solver.

56
00:05:09,820 --> 00:05:13,410
So here it's Navier Stokes Deep.

57
00:05:14,750 --> 00:05:27,050
Um Navier Stokes deep XD main and we start by always importing well a.

58
00:05:28,210 --> 00:05:30,580
With TensorFlow tensor.

59
00:05:31,360 --> 00:05:33,470
Flow as tf.

60
00:05:34,670 --> 00:05:44,810
Just some libraries import deep XD as the the e import numpy.

61
00:05:45,900 --> 00:05:49,980
As MP and for plotting import.

62
00:05:51,120 --> 00:05:52,230
Import.

63
00:05:53,170 --> 00:05:55,630
Matplotlib.

64
00:05:57,710 --> 00:05:58,460
Lip.

65
00:05:59,170 --> 00:06:06,520
Dot pyplot as plt and we shift enter a tensor.

66
00:06:08,070 --> 00:06:08,610
Ten.

67
00:06:11,970 --> 00:06:12,670
Flow.

68
00:06:13,430 --> 00:06:14,060
Flow.

69
00:06:16,190 --> 00:06:16,790
Yeah.

70
00:06:21,810 --> 00:06:23,010
Yeah, this is it.

71
00:06:23,010 --> 00:06:27,030
So now what we will do is we start by row.

72
00:06:27,060 --> 00:06:35,820
We put some values Mu which is the viscosity, of course, kinematic viscosity is mu over rho so we

73
00:06:35,820 --> 00:06:37,050
will use mu over rho.

74
00:06:37,050 --> 00:06:44,730
But of course we can, we can even new and put the value of nu or we can just mu and we divide by rho

75
00:06:44,730 --> 00:06:47,430
it will be the same because it's one at the end.

76
00:06:47,460 --> 00:06:51,390
We're not really considering the physics of the flow.

77
00:06:51,510 --> 00:07:01,560
Rather we are considering the actual numerical or uh, like mathematical modeling or like just modeling

78
00:07:01,560 --> 00:07:03,150
of the problem.

79
00:07:03,330 --> 00:07:12,900
So these, this is D and L, basically it's the boundary or the competition zone we are considering.

80
00:07:13,050 --> 00:07:17,580
In our case, what we have is or what we are going to have.

81
00:07:18,800 --> 00:07:21,830
Maybe it's better black like this.

82
00:07:22,100 --> 00:07:25,850
What we will have is we will have el.

83
00:07:28,000 --> 00:07:29,170
The length.

84
00:07:30,610 --> 00:07:32,080
Of this one.

85
00:07:37,460 --> 00:07:39,710
This 60.

86
00:07:46,630 --> 00:07:52,630
So here is L and D is the width.

87
00:07:53,330 --> 00:07:54,710
And x.

88
00:07:55,040 --> 00:07:57,290
The x axis is going.

89
00:07:58,090 --> 00:08:00,010
To pass.

90
00:08:01,230 --> 00:08:08,010
This is the x axis in the middle and the y axis also going to pass in the middle.

91
00:08:08,840 --> 00:08:10,860
As here is not so much middle here.

92
00:08:10,880 --> 00:08:11,660
About here.

93
00:08:13,150 --> 00:08:16,270
So this is basically our competition domain.

94
00:08:17,230 --> 00:08:23,740
And what we will have also regarding the boundary condition, we can consider it.

95
00:08:23,740 --> 00:08:27,520
This one which is here is.

96
00:08:28,430 --> 00:08:29,600
You in?

97
00:08:30,460 --> 00:08:31,780
Basically the flow.

98
00:08:32,050 --> 00:08:33,790
And here is.

99
00:08:34,740 --> 00:08:36,330
Just wall.

100
00:08:37,580 --> 00:08:39,530
So here we will have.

101
00:08:39,800 --> 00:08:40,460
What is it?

102
00:08:40,490 --> 00:08:41,150
Wall.

103
00:08:42,080 --> 00:08:44,330
Or here we are also going to have a wall.

104
00:08:45,220 --> 00:08:50,920
And here we will have the boundary we have is, um.

105
00:08:52,130 --> 00:08:56,360
Basically or not basically is is constant pressure.

106
00:08:57,250 --> 00:09:05,260
We know that at this there will be a velocity of the fluid that will make this thing converge.

107
00:09:05,260 --> 00:09:07,810
And this is we don't want to specify it here.

108
00:09:07,810 --> 00:09:14,590
We know it's inlet velocity and that the wall is non-slip condition, which is u is equal zero and the

109
00:09:14,590 --> 00:09:20,440
end we don't want to define U but what we have to define is p the pressure.

110
00:09:20,710 --> 00:09:24,370
So pressure equals well value.

111
00:09:26,480 --> 00:09:31,040
I forget basically how much, but I think I will just say the code.

112
00:09:31,190 --> 00:09:34,430
So basically here we will have a pressure.

113
00:09:35,280 --> 00:09:39,990
A in here, that's going to be kind of constant pressure surface.

114
00:09:39,990 --> 00:09:42,690
So this is the domain we have.

115
00:09:42,720 --> 00:09:47,400
It will spread from minus a this is, of course.

116
00:09:49,250 --> 00:09:52,790
The whole thing like this is the whole thing is hell.

117
00:09:52,820 --> 00:09:55,640
This is the whole thing is you.

118
00:09:55,670 --> 00:10:01,430
So the, the the actual domain is going to spread from minus.

119
00:10:04,580 --> 00:10:06,540
Over two to.

120
00:10:07,580 --> 00:10:10,220
Plus L over two.

121
00:10:10,930 --> 00:10:19,240
And in here it will minus the over two to here, which is plus the over two.

122
00:10:24,530 --> 00:10:25,390
And that's it.

123
00:10:26,500 --> 00:10:28,260
So this is the computation domain.

124
00:10:28,280 --> 00:10:33,250
The boundary condition, as said here is inlet, here is wall, and here is a constant pressure.

125
00:10:34,860 --> 00:10:35,850
Let's apply it.

126
00:10:37,270 --> 00:10:39,370
So this is these values.

127
00:10:39,370 --> 00:10:47,410
And then we have to start writing basically our we can start by writing geometry.

128
00:10:47,410 --> 00:10:48,730
So geometry.

129
00:10:49,420 --> 00:10:54,250
Geometry equals E dot.

130
00:10:58,070 --> 00:11:00,500
Geometry.

131
00:11:05,160 --> 00:11:05,850
Dot.

132
00:11:07,860 --> 00:11:08,430
Rick.

133
00:11:09,510 --> 00:11:10,350
Dangle.

134
00:11:11,540 --> 00:11:12,950
And X.

135
00:11:14,400 --> 00:11:15,150
Min.

136
00:11:17,450 --> 00:11:18,500
Oh, not here.

137
00:11:18,530 --> 00:11:24,770
This is how the syntax from minus L over two to.

138
00:11:25,680 --> 00:11:28,230
Well l over over to.

139
00:11:30,000 --> 00:11:30,810
And.

140
00:11:31,830 --> 00:11:33,000
X max.

141
00:11:33,900 --> 00:11:34,830
Equals.

142
00:11:36,150 --> 00:11:37,060
Uh, well.

143
00:11:40,200 --> 00:11:40,860
Sorry.

144
00:11:40,860 --> 00:11:42,750
This is x max.

145
00:11:47,050 --> 00:11:48,620
Minus D over two.

146
00:11:48,640 --> 00:11:52,660
This is a rectangle, so we need to put two parameters.

147
00:11:53,210 --> 00:11:54,040
I'll show you.

148
00:11:54,740 --> 00:12:00,110
So basically here, this point, we need to define this point.

149
00:12:01,460 --> 00:12:01,850
Put it.

150
00:12:03,780 --> 00:12:07,050
We need to define this point and this point.

151
00:12:07,060 --> 00:12:16,530
So this point is minus X over over two and minus L over two, and the maximum is a plus the over two

152
00:12:16,530 --> 00:12:18,270
and plus L over two.

153
00:12:18,600 --> 00:12:21,030
So this is where this thing comes from.

154
00:12:22,890 --> 00:12:23,910
L Over two.

155
00:12:24,510 --> 00:12:27,240
L Over two and D over two.

156
00:12:27,540 --> 00:12:30,000
So this is the geometry.

157
00:12:30,000 --> 00:12:31,620
And we shift.

158
00:12:31,620 --> 00:12:31,860
Enter.

159
00:12:31,890 --> 00:12:32,370
Of course.
