10_Misc_Fluid_flow_II
10_Misc_Fluid_flow_II
ux and uy ( Ux2 Uy2) Psi2 Initial2
y x
Note that flow left-to-right (ux > 0) requires being larger at the top (largest y value).
at interior points will be found using the relaxation method so that satisfies Poisson's
equation. Finding this way gives us a simple solution for the flow. Many other flow solutions
are possible, thus our answer is not unique.
Try it: Show that the divergence of the fluid velocity is zero indicating that describes an
incompressible fluid.
The grid
There is no reason to assign values to the xi and yj that are on the grid. It is sufficient to know
the number of x grid points imax, the number of y grid points jmax, and the grid spacings x and
y.
imax 18 The number of x grid points. These are on the horizontal axis.
jmax 18 The number of y grid points. These are on the vertical axis.
BB BB 0
imax jmax
for i 0 imax
for j 0 jmax
BB 1
i j
j i jmax j i
BB 0 if
i j jmax 3 imax jmax 3 imax
BB
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0
3 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
T
BB 4 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0
5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0
6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
7 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
9 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
Initial Initial 0
imax jmax
for i 0 imax
for j 0 jmax
jmax
Initial 0.5 jmax if j BB =0
i j 2 i j
jmax
Initial 0.5 jmax if j BB =0
i j 2 i j
Initial
5/11/2012 Miscellaneous Exercises Fluid Flow II 3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
0 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9
1 0 0 0 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9
2 0 0 0 0 0 0 9 9 9 9 9 9 9 9 9 9 9 9 9
3 0 0 0 0 0 0 0 0 0 9 9 9 9 9 9 9 9 9 9
T
Initial 4 0 0 0 0 0 0 0 0 0 0 0 0 9 9 9 9 9 9 9
5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 9 9 9
6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9
7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
Avg is defined as a simple average of the Psi values at surrounding points. If we had not
assumed x = y = 1, then the average have to be a properly weighted average.
At the left and right boundaries, i = 0 and i = imax, symmetric boundary conditions are applied.
It is assumed that the point just outside the boundary has the same y value and the point just
inside the boundary. These boundary conditions are applied by having two extra loops in the
program for the boundary points i = 0 and i = imax.
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9
1 8.3 8.3 8.5 9 9 9 9 9 9 9 9 9 9 9 9 9
2 7.4 7.5 7.6 7.9 8.1 8.3 9 9 9 9 9 9 9 9 9 9
3 6.5 6.6 6.7 6.8 7 7.3 7.6 7.9 8.2 9 9 9 9 9 9 9
T
Psi1 4 5.5 5.6 5.6 5.8 5.9 6.2 6.4 6.7 7 7.4 7.7 8.1 9 9 9 9
5 4.5 4.5 4.6 4.7 4.8 5 5.2 5.4 5.6 5.9 6.2 6.6 7.1 7.4 7.9 9
6 3.4 3.4 3.5 3.5 3.6 3.8 3.9 4.1 4.3 4.5 4.7 5 5.3 5.6 6 6.6
7 2.3 2.3 2.3 2.4 2.4 2.5 2.6 2.7 2.9 3 3.2 3.3 3.6 3.8 4.1 4.4
8 1.1 1.2 1.2 1.2 1.2 1.3 1.3 1.4 1.4 1.5 1.6 1.7 1.8 1.9 2 2.2
9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
ii 1 imax 1 jj 1 jmax 1 Define a new set of indices that does not include the
boundary points.
The finite-differencing above is centered on the point ii,jj. If this point is in the fluid, then the sum
of the neighboring BB values is equal to 4. If this sum is not 4, the velocity vector is set to zero
so that it does not appear in the plot.
Psi1 Psi1
ii jj 1 ii jj 1
Ux if BB BB BB BB = 4 0
ii jj ii jj 1 ii jj 1 ii 1 jj ii 1 jj
2 Δy
Uy
if BB BB BB BB = 4
Psi1ii1 jj Psi1ii1 jj 0
ii jj ii jj 1 ii jj 1 ii 1 jj ii 1 jj
2 Δx
5/11/2012 Miscellaneous Exercises Fluid Flow II 5
Vector field plot of u and contour plots of Psi1 and the boundary matrix BB
The stream function been plotted as a contour plot using a small number of contour lines.
d
2 2
where 1 and 2 refer to the lower boundary and
u x dy
1 1
dy
dy 2 1 upper boundary, respectively.
This integral has the same value for all vertical paths through the nozzle because has the
same value at all points on the upper nozzle boundary and the same (lower) value at all points in
the lower nozzle boundary. The length of the flow vectors increases from left to right as the area
of the nozzle decreases.
5/11/2012 Miscellaneous Exercises Fluid Flow II 6
The boundary points are the top and bottom of the domain (the duct) and the boundary of the
object. The points on the boundary of the duct and the boundary of the circular object have their
BB value set to 0.
BB2 BB2 0
imax jmax
for i 0 imax
for j 0 jmax
BB2 1
i j
BB2 0 if j = 0 j = jmax
i j
The intial values of are made zero at the duct walls and -1 at the circular object. The equal
values at the top and bottom boundaries specify that there is not net flow in the duct from left to
right. A value of -1 on the object creates a positive gradient near the upper duct wall and a
negative gradient near the lower duct wall. Hence the flow is clockwise. At the left and right
boundaries, there is flow to the right in the upper half plane and flow to the left in the lower half
plane.
Initial2 Initial 0
imax jmax
for i 0 imax
for j 0 jmax
Initial 0
i j
Find the values using the Psi function for the new conditions Psi2 Psi( BB2 Initial2 )
5/11/2012 Miscellaneous Exercises Fluid Flow II 7
Psi2
ii jj 1
Psi2
ii jj 1
Ux2 if BB2 BB2 BB2 BB2 = 4 0
ii jj ii jj 1 ii jj 1 ii 1 jj ii 1 jj
2 Δy
Psi2
ii 1 jj
Psi2
ii 1 jj
Uy2 if BB2 BB2 BB2 BB2 = 4 0
ii jj ii jj 1 ii jj 1 ii 1 jj ii 1 jj
2 Δx
Try it: Change the values at the duct walls so that there is a net flow from left to right
superimposed upon the circular flow.
Try it: Rewrite the exercise so that the flow is correct if x and y are arbitrary.
Reference
A. M. Kuethe and J. D. Schetzer, Foundation of Aerodynamics (Wiley, New York, 1967),
chapter 2.