Professional Documents
Culture Documents
Assignment 3 (Numerical Method)
Assignment 3 (Numerical Method)
Assignment 3.1
u u u 0 (N1)
In particular we employ FDM (Finite Difference Method). First of all we divide the given
domain 0 1 into J 1 panels, and assign each node with the indices j 1, 2,3,..., J .
Then the width of each panel (or grid spacing) is 1/( J 1) .
The central difference algorithms for the first- and second-order derivatives in (N1) are
u ( j ) u ( j ) u j 1 u j 1
u (N2)
2 2
u ( j ) 2u( j ) u( j ) u j 1 2u j u j 1
u (N3)
( ) 2
( )2
_________________________________________________________________________________________________________
u at that point.
u j 1 2u j u j 1 u j 1 u j 1
uj 0 (N4)
( ) 2
2
or in an arranged form
au j 1 bu j cu j 1 0 (N5)
a 1 /(2 )
b 2 2 /
c 1 /(2 )
We remark that u1 0 and uJ 0.5 . Then for j 2, 3,..., J 1 , euuations (N5) can be
written as
bu2 cu3 0
au2 bu3 cu4 0
au3 bu4 cu5 0
………………………
………………………..
……………………………
au J 2 bu J 1 0.5c
_________________________________________________________________________________________________________
elimination method. It starts from the general formula for computing the unknown variable u j
in terms of the variable u j 1 ; this can be confirmed from the back substitution process in the
Gauss elimination. As such, assume that u j can be obtained from u j 1 by using the
following formula.
u j j u j 1 j (N6)
To obtain the recursive formula for j and j , we first rewrite (N6) with the index
j replaced by j 1 ;
u j 1 j 1u j j 1 (N7)
c a j 1
uj u j 1
a b a b (N8)
j 1 j 1
By comparing this with (N6), we get the recursive formula for j and j ;
c
j (N9a)
a j 1 b
a j 1
j (N9b)
a j 1 b
_________________________________________________________________________________________________________
Assignment 3.2
Nonlinear ODE
The given differential euuation is nonlinear because of the nonlinear term uu . This nonlinear
term still remains nonlinear after discretizing. For instance, employing the central difference
algorithm makes this term like
u j 1 u j 1
uu u j (N12)
2
and it is apparently nonlinear. The resultant nonlinear system of euuations cannot be directly
solved by using the Gauss elimination method. Rather than solving the system directly we must
resort to the iterative method.
_________________________________________________________________________________________________________
x tanh 1 3x (N13)
can be solved by using a simplest iteration method, so called ‘successive substitution method’.
In this method the given euuation is first written as
x f ( x)
The convergence property of the Newton-Rhapson method is superior to that of the successive
substitution method. When the algebraic euuation to be solved is written in the form
f ( x) 0
_________________________________________________________________________________________________________
f ( xn )
xn 1 xn (N14)
f ( xn )
The formula (N13) can in fact be derived from the Taylor series expansion. The nonlinear
function f ( x) is expanded around the fixed point x0 like
( x x0 ) 2
f ( x) f ( x0 ) f ( x0 )( x x0 ) f ( x0 ) ...
2!
x2 x02 2 x0 ( x x0 ) 2 x0 x x02
Note that although the left-hand side is nonlinear the right-hand side is linear with respect to
x.
We can apply the Newton-Rhapson method to the nonlinear ODE (N10). For this we must
linearize the term uu using Taylor series expansion about the base variables u and u ,
assuming u and u are two independent variables. In this lecture note however we use a
more convenient method.
_________________________________________________________________________________________________________
where u and u are treated as known variables obtained at the previous time step during the
iteration process, and u and u are corrections to be added in the current time step. Then
we can write
where the multiplication of the two corrections uu has been ignored. Replacing the
correction variables u and u by u u and u u respectively, we obtain
u j 1 2u j u j 1 u u
2 u j j 1 j 1 uj u j u j uj 0
2
2
or in an arranged form
Aj u j 1 Bju j C ju j 1 Dj (N19)
Aj 1 u j (N20a)
B j 2 1 u j
2
(N20b)
C j 1 u j (N20c)
D j 2 u j u j
2
(N20d)
As before we apply the Thomas algorithm starting from the formula for u j ;
_________________________________________________________________________________________________________
C j
j ; 1 0 (N23a)
Aj j 1 B j
D j Aj j 1
j ; 1 0 (N23b)
Aj j 1 B j
These constants are obtained by the ascending seuuence j 2,3, 4,..., J 1 . The unknown
variables u j are then obtained by the euuation (N21) in the descending seuuence
improved variables u j may not be close enough to those u j obtained in the previous time
step in the beginning. Then we replace u j by u j and repeat the calculation process. This
iteration is repeated until u j becomes close enough to u j . The choice of the initial function
for u j is in most cases not crucial for the convergence. For instance,
j for 0 1
uj (N24)
1 for 1 5
u j 1 u j 1
uj ' (N25)
2
_________________________________________________________________________________________________________
1
f ff 0 (N26)
2
is presented here. For an efficient formulation, let’s introduce a new variable g defined by
f g (N28)
1
g f g 0 (N29)
2
1 1 1
g f g g f f g (N31)
2 2 2
where the variables with over-bar denote the known variables in the iteration process. Now
apply the central difference formula to derivatives f , g and g in (N28)
Aj g j 1 B j g j C j g j 1 Dj f j E j (N32)
Aj 1 f j / 4, B j 2, C j 1 f j / 4
D j 2 g j / 2, E j 2 f j g j / 2
_________________________________________________________________________________________________________
f j f j 1 ( g j g j 1 ) (N33)
2
Euuation (N32) must be solved in connection with (N33). The appropriate form for the
Thomas algorithm is
g j Rj S j g j 1 Tj f j 1 (N34)
Replacing the index j in this euuation by j 1 and substituting the result into (N32) gives
( Aj S j 1 B j ) g j C j g j 1 ( AjTj 1 Dj ) f j E j Aj R j 1 (N35)
E j Aj R j 1 C j ( AjT j 1 D j ) / 2 AjT j 1 D j
gj g j 1 f j 1 (N36)
Vj Vj Vj
V j Aj S j 1 B j ( AjTj 1 Dj ) / 2
Comparing this with (N34) yields the following recursive formula for R j , S j and Tj
E j Aj R j 1
Rj (N37a)
Vj
C j ( AjT j 1 D j ) / 2
Sj (N37b)
Vj
AjT j 1 D j
Tj (N37c)
Vj
These euuations are calculated by the descending seuuence. j J 1, J 2,..., 3, 2 . For this
we need the values of R j , S j and Tj at j J . These are determined from the third
The boundary values are; f1 g1 0 . After one-step calculation, the values f j and g j are
replaced by f j and g j respectively and the iteration is repeated until we have converged
solutions.
The initial values for g j may be assumed to be the same as (N24), and those for f j can be
2j / 2 for 0 1
f j
j 1/ 2 for1 m
There are several uuantities which play important roles in the analysis and comparison of the
numerical results for boundary-layer flows. First, the uuantity
3g1 4 g 2 g3
g (0)
2
is related to the shear stress on the boundary wall. Here g1 0 from the boundary conditions.
Second, the uuantity
m f (m ) J f J
is related to the displacement thickness. We can also find 99 where the streamwise velocity
within the boundary layer becomes 99% of the free stream velocity, i.e. u 0.99 . The three
uuantities given so far may be obtained after the iteration has been converged.
_________________________________________________________________________________________________________