Anda di halaman 1dari 7

12/19/2013

1
Computational Fluid Dynamics

Implicit method
1
9
-
D
e
c
-
1
3

21
2
2
x
u
t
u
c
c
=
c
c
o
Therefore parabolic equation can be written as:
2
1
1
1 1
1
1
2
x
u u u
t
u u
n
i
n
i
n
i
n
i
n
i
A
+
=
A

+ +
+
+
o
2
1
1
1 1
1
1
) 2 (
x
t
r u u u u r u
n
i
n
i
n
i
n
i
n
i
A
A
= = +
+

+ +
+
+
o
Difference equation is:
Time (n+1) Time (n)
SCHEME is ORDER (At, Ax
2
)
t
u u
n
i
n
i
A

+1
2
1
1
1 1
1
2
x
u u u
n
i
n
i
n
i
A
+
+

+ +
+
Requires Matrix Solvers.
Known as the Fully Implicit Method.
Computational Fluid Dynamics
Crank Nicholson
Approximating the derivatives at mid-point in
time (n+0.5, i) with half the time step, we
have:
LHS:


RHS:




1
9
-
D
e
c
-
1
3

22
2
2
x
u
t
u
c
c
=
c
c
o
( ) ( )
( ) t
u u
n
i
n
i
A

+ + +
5 . 0 2
5 . 0 5 . 0 5 . 0 5 . 0
(

A
+
+
A
+

+ +
+ +
2
1
1
1 1
1
2
1 1
2 2
2
1
x
u u u
x
u u u
n
i
n
i
n
i
n
i
n
i
n
i
| | | | | |
2
1
1 1 2
1
1
2
1
1
1 1 2
1
2 2
x
u u u u u u
n
i
n
i
n
i
n
i
n
i
n
i
A
+ + + +

+

+ +
+ +
2
5 . 0
1
5 . 0 5 . 0
1
2
x
u u u
n
i
n
i
n
i
A
+
+

+ +
+
( ) t
u u
n
i
n
i
A

+
5 . 0 2
1
12/19/2013
2
Computational Fluid Dynamics
Crank Nicholson
Crank Nicholson in 1947 proposed this method to allow
greater time steps in their calculations.
The resulting difference equation is:






In this case we have three unknowns on the RHS of the
equation.
Therefore the new value

+1
is not given directly in
terms of known values as is the case of the Explicit
method.


1
9
-
D
e
c
-
1
3

23
Time (n+1) Time (n)
n
i
n
i
n
i
n
i
n
i
n
i
ru u r ru ru u r ru
1 1
1
1
1 1
1
) 2 2 ( ) 2 2 (
+
+
+
+ +

+ + = + +
2
x
t
r
A
A
=
o
SCHEME is ORDER (At
2
, Ax
2
)
Computational Fluid Dynamics
Explicit vs Implicit
1
9
-
D
e
c
-
1
3

24
i-1 i i+1
i-1 i i+1
n
-
1






n




n

+
1

i-1 i i+1
Explicit Crank-Nicholson Fully Implicit
O(At, Ax
2
) O(At, Ax
2
) O(At
2
, Ax
2
)
Computational molecules show differences between the schemes
If there is more than one node at timestep n+1 the scheme is implicit
n
-
1






n






n
+
1

n
-
1






n






n
+
1

12/19/2013
3
Computational Fluid Dynamics
Comparison
Explicit method
Unknown values at
current time step depend
only on known values at
previous time step

Advantage:
Easy to implement in
software and solve
Disadvantage:
Restrictions on time step
for stability.

Implicit method
Unknown values at
current time step depend
on known values at
previous time step and on
each other
Disadvantage:
Requires solution of
system of equations
Advantage:
No restrictions on time step

1
9
-
D
e
c
-
1
3

25
Computational Fluid Dynamics
Example
Consider heat loss from a heated rod subject
to the above equations:


Use the explicit scheme with mesh spacing
0.1 and timestep 0.001 to obtain
approximate values for u(x,0.03).
Now change the timestep to 0.01. What
happens?


1
9
-
D
e
c
-
1
3

28
ICE ICE
0 ) , 1 ( ) , 0 ( = = t u t u
1 0
2
2
s s
c
c
=
c
c
x
x
u
t
u
x x u t sin ) 0 , ( =
12/19/2013
4
Computational Fluid Dynamics
Solution
The problem is set up as follows
1
9
-
D
e
c
-
1
3

29
=sin(t*c24)
) 2 (
1 1
1 n
i
n
i
n
i
n
i
n
i
u u u r u u
+
+
+ + =
Explicit Equation:
= C25+rr*(D25-2*C25+B25)
Name rr
=B22/B21^2
Computational Fluid Dynamics

1
9
-
D
e
c
-
1
3

30
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0.00 0 0.31 0.59 0.81 0.95 1.00 0.95 0.81 0.59 0.31 0
0.01 0 0.28 0.53 0.73 0.86 0.90 0.86 0.73 0.53 0.28 0
0.02 0 0.25 0.48 0.66 0.77 0.81 0.77 0.66 0.48 0.25 0
0.03 0 0.23 0.43 0.59 0.70 0.73 0.70 0.59 0.43 0.23 0
0.04 0 0.20 0.39 0.54 0.63 0.66 0.63 0.54 0.39 0.20 0
0.05 0 0.18 0.35 0.48 0.57 0.60 0.57 0.48 0.35 0.18 0
0.06 0 0.17 0.32 0.44 0.51 0.54 0.51 0.44 0.32 0.17 0
0.07 0 0.15 0.29 0.39 0.46 0.49 0.46 0.39 0.29 0.15 0
0.08 0 0.14 0.26 0.35 0.42 0.44 0.42 0.35 0.26 0.14 0
0.09 0 0.12 0.23 0.32 0.38 0.40 0.38 0.32 0.23 0.12 0
0.10 0 0.11 0.21 0.29 0.34 0.36 0.34 0.29 0.21 0.11 0
0.11 0 0.10 0.19 0.26 0.31 0.32 0.31 0.26 0.19 0.10 0
0.12 0 0.09 0.17 0.24 0.28 0.29 0.28 0.24 0.17 0.09 0
0.13 0 0.08 0.15 0.21 0.25 0.26 0.25 0.21 0.15 0.08 0
0.14 0 0.07 0.14 0.19 0.22 0.24 0.22 0.19 0.14 0.07 0
0.15 0 0.07 0.13 0.17 0.20 0.21 0.20 0.17 0.13 0.07 0
0.16 0 0.06 0.11 0.16 0.18 0.19 0.18 0.16 0.11 0.06 0
0.17 0 0.05 0.10 0.14 0.17 0.17 0.17 0.14 0.10 0.05 0
0.18 0 0.05 0.09 0.13 0.15 0.16 0.15 0.13 0.09 0.05 0
0.19 0 0.04 0.08 0.11 0.13 0.14 0.13 0.11 0.08 0.04 0
0.20 0 0.04 0.07 0.10 0.12 0.13 0.12 0.10 0.07 0.04 0
0.21 0 0.04 0.07 0.09 0.11 0.11 0.11 0.09 0.07 0.04 0
0.22 0 0.03 0.06 0.08 0.10 0.10 0.10 0.08 0.06 0.03 0
0.23 0 0.03 0.05 0.08 0.09 0.09 0.09 0.08 0.05 0.03 0
0.24 0 0.03 0.05 0.07 0.08 0.08 0.08 0.07 0.05 0.03 0
0.25 0 0.02 0.04 0.06 0.07 0.08 0.07 0.06 0.04 0.02 0
0.26 0 0.02 0.04 0.06 0.07 0.07 0.07 0.06 0.04 0.02 0
0.27 0 0.02 0.04 0.05 0.06 0.06 0.06 0.05 0.04 0.02 0
0.28 0 0.02 0.03 0.05 0.05 0.06 0.05 0.05 0.03 0.02 0
0.29 0 0.02 0.03 0.04 0.05 0.05 0.05 0.04 0.03 0.02 0
0.30 0 0.01 0.03 0.04 0.04 0.05 0.04 0.04 0.03 0.01 0
12/19/2013
5
Computational Fluid Dynamics

Results for dt=0.001
1
9
-
D
e
c
-
1
3

31
Computational Fluid Dynamics

Results for dt=0.01
1
9
-
D
e
c
-
1
3

32
12/19/2013
6
Computational Fluid Dynamics
Example
Solve the same equation as the previous
example, but use the Crank-Nicholson
scheme to obtain approximate values for
with the time step 0.001.
Now change the time step to 0.01. What
happens?

1
9
-
D
e
c
-
1
3

33
n
i
n
i
n
i
n
i
n
i
n
i
ru u r ru ru u r ru
1 1
1
1
1 1
1
) 2 2 ( ) 2 2 (
+
+
+
+ +

+ + = + +
2
x
t
r
A
A
=
o
Computational Fluid Dynamics
Solution
The problem is set up as follows:
1
9
-
D
e
c
-
1
3

34
| |
1
1
1
1 1 1
1
) 2 2 (
) 2 2 (
1
+

+
+ +
+
+ + + +
+
=
n
i
n
i
n
i
n
i
n
i
n
i
ru ru ru u r ru
r
u
2
x
t
r
A
A
=
o
Name FLAG
0: Initialize
1: Iterate (solve)
Implicit Equation
=IF(FLAG=0,0,(rr*B25+(2-2*rr)*C25+rr*D25+rr*B26+rr*D26)/(2+2*rr))
[B26 & D26 are at current time-step]
Name rr
=B22/B21^2
Iteration counter
=IF(FLAG=0,0,E19+1))
12/19/2013
7
Computational Fluid Dynamics
Results
For dt = 0.001, courant number = 0.1 and
after 7 iterations.
1
9
-
D
e
c
-
1
3

35
Computational Fluid Dynamics
Results
For dt = 0.01, courant number = 1 and after
20 iterations, with convergence.
1
9
-
D
e
c
-
1
3

36

Anda mungkin juga menyukai