Professional Documents
Culture Documents
Introduction!
What is Computational
Fluid Dynamics (CFD)?!
Finite Difference or!
Finite Volume Grid!
Grid must be
sufficiently fine to
resolve the flow!
Beginning of
CFD!
pi-1,j+1
pi-1,j
pi-1,j-1
pi,j+1
ui+1/2,j+1
ui-1/2,j
pi,j
ui+1/2,j
pi,j-1
pi+1,j
vi+1,j-1/2
vi,j-1/2
ui-1/2,j-1
pi+1,j+1
vi+1,j+1/2
vi,j+1/2
vi-1,j-1/2
ui+1/2,j-1
pi+1,j-1
ui-1/2,j+1
vi-1,j+1/2
The development of computer fluid dynamics has been closely associated with the evolution
of large high-speed computers. At first the principal incentive was to produce numerical
techniques for solving problems related to national defense. Soon, however, it was
recognized that numerous additional scientific and engineering applications could be
accomplished by means of modified techniques that extended considerably the capabilities of
the early procedures. This paper describes some of this work at The Los Alamos National
Laboratory, where many types of problems were solved for the first time with the newly
emerging sequence of numerical capabilities. The discussions focus principally on those with
which the author has been directly involved.
Commercial
Codes!
" !u
!u
!u
! p 1 # ! 2u ! 2u &
+u
+v
="
+
+
!x
!y
! x Re %$ ! x 2 ! y 2 ('
"y ! t
!v
!v
! p 1 # ! 2v ! 2v &
! !v
+u
+v
="
+
+
!
t
!
x
!
y
! y Re %$ ! x 2 ! y 2 ('
!x
!"
!"
!"
1 #% ! 2 " ! 2" &
+u
+v
=
+
!t
!x
!y Re $ !x 2 !y 2 '
!=
where!
u=
!"
!"
; v=#
!y
!x
!=
"v "u
#
"x "y
gives!
! 2" ! 2"
+
= #$
! x2 ! y2
" v "u
#
"x " y
!"
!$ !" !$ !"
1 % ! 2" ! 2" (
=#
+
+
+
!t
! y ! x ! x ! y Re '& ! x 2 ! y 2 *)
Elliptic equation!
! 2" ! 2"
+
= #$
! x2 ! y2
where!
u=
!"
!"
; v=#
!y
!x
(x, y)
f i, j = f (x, y)
f i, j +1
j+1
f i!1, j f i, j
f i+1, j
i -1
f i!1, j = f (x ! h, y)
f i, j +1 = f (x, y + h)
f i, j !1
j-1
f i+1, j = f (x + h, y)
i+1
!"
!$ !" !$ !"
1 % ! 2" ! 2" (
=#
+
+
+
!t
! y ! x ! x ! y Re '& ! x 2 ! y 2 *)
The advection equation is:!
n+1
i, j
" ! i,n j
#t
n
n
n
n
% $ i,n j +1 " $ i,n j "1 ( % ! i+1,
( % $ i+1,
( % ! i,n j +1 " ! i,n j "1 (
" ! i"1,
" $ i"1,
j
j
j
j
"'
*'
* +'
*'
*
2h
2h
2h
2h
&
)&
) &
)&
)
+
n
n
n
n
n
1 % ! i+1, j + ! i"1, j + ! i, j +1 + ! i, j "1 " 4! i, j (
'
*
2
Re &
h
)
! 2" #%
! 2" #
+ 2 % = &' i,n j
2
!x $ i, j !y $ i, j
f i, j !1 = f (x, y ! h)
!" #
!& !" #
!& !" #
1 ') ! 2" ! 2" #*
=%
+
+
+
!t $ i, j
!y !x $ i, j !x !y $ i, j Re ( !x 2 !y 2 $ i, j
!2 f ! 2 f
+
=
!x 2 !y 2
n
fi n+1, j ! 2 fi,nj + fi!1,
f n ! 2 f i,nj + fi n, j !1
j
+ i, j +1
=
2
h
h2
n
n
n
n
n
1 % ! i+1, j + ! i#1, j + ! i, j +1 + ! i, j #1 # 4! i, j ( .
'
*0
Re &
h2
) 0/
! 2" ! 2"
+
= #$
! x2 ! y2
n
n
! i+1,
+ ! i"1,
+ ! i,n j +1 + ! i,n j "1 " 4! i,n j
j
j
h2
= "# i,n j
Moving wall!
Stationary wall!
Stationary wall!
Stationary wall!
j=NY!
! i, j and " i , j
Grid
boundaries
coincide
with domain
boundaries!
stored at
each grid
point!
! = Constant
j=2!
j=1!
i=1! i=2!
! i, j = 0
j=ny!
on the boundary!
Need vorticity
on the
boundary!!
i=NX!
!=
"v "u
"u
!
=!
"x " y
"y
i=nx!
u=
!"
!y
= ! i, j =1
The velocity at j=3/2 can be found
by centered differences:!
j=3
j=2
j=1
u(i, 23 ) =
Uwall
i -1
i+1
Similar expressions
can be found for
the other walls!
! (i,1) = "
Solve by SOR!
2 n
! "i, j+1 = # 0.25 (! "i +1, j + ! "i$1,+1j + !i," j +1 + ! "i, +1
j$1 + h % i, j )
+ (1$ # )! "i, j
Limitations on the
time step!
! "t 1
#
h2
4
(|u | + | v |)!t
#2
"
t=t+dt!
t=t+!t!
For l=1:MaxIterations!
for i=2:nx-1; for j=2:ny-1!
s(i,j)=SOR for the stream function!
end; end!
end!
v(i,j)=!
for i=2:nx-1; for j=2:ny-1!
rhs(i,j)=Advection+diffusion!
end; end!
v(i,j)=v(i,j)+dt*rhs(i,j)!
17 by 17!
Dt=0.01!
D=0.1!
Vorticity!
17 by 17!
Dt=0.01!
D=0.1!
Streamfunction!
25
0.1
20
0.08
15
0.06
10
5
0.02
-5
-10
20
0
20
15
20
15
10
10
5
0
15
20
15
10
10
5
0
9 by 9 grid!
17 by 17 grid!
Vorticity!
0.04
Streamfunction!