Sie sind auf Seite 1von 6

Numerical Methods

Practical Work 2
1 Dimensional Heat Equation

Mayur Srivatsav V S
Jerol Soibam

October 2015

Introduction

We will focus on solving partial dierential equation Cp @T


') = 0 in which T is temperature
@t +div(~
~
and '
~=
gradT
is Fourier Flux. This simplifies in 1 D as:
Cp

@T
@
+
(
@t
@x

@T
)
@x

(1)

, Cp , represent the density(kgm 3),the heat capacity(W m 2 K 1 ) and the conductivity(W m 2 K


of the material. This problem can be found when considering the temperature evolution in a bar of
length L. Initial and boundary conditions have to be fixed in order to solve a well-posed problem:
T (0, x) = 400 Initial
T (t, 0) = 300 Dirichlet Condition
T (t, L) = 500 Dirichlet Condition

(2)

Figure 1:
Time and spatial variable x will be uniformly discretised:

2
2.1

t and

x = 1/(n + 1)

Finite dierence explicit method


Relation between the Space and Time coordinate

Assuming the value of


equation 1 we have:

to be constant and equal to 1, to use the dimensional numbers Te,


x,t, from
@ Te
@ 2 Te
=
@ t
@ x2

(3)

LetTjk = T (tk , xj )

2.2

To obtain the 1-D Heat equation

In order to obtain the heat equation:


Tjk+1 = cTjk

k
2c)Tjk + cTjk + cTj+1
where c =

+ (1

T
x2

(4)

To obtain the Time derivative, we use the First derivative approximation of the Forward dierence,
y(t + h) y(t)
h
0
y(t + t) y(t)
y (t) =
t
@T
T (t + t) T (t)
=
@t
t
0

y (t) =

Tjk+1 Tjk
@Tj
=
@t
t
To obtain the Space derivative, we use the Second derivative approximation of the Centered
dierence,
y(x + h) 2y(x) + y(x h)
y (x) =
h2
1

(5)

@2T
T (x + h)
=
@x2
@2T
T (x +
=
@x2

2T (x) + T (x
h2

x)

h)

2T (x) + T (x
x2

x)

k
c(Tj+1
2Tjk + Tjk 1 )
@2T
=
, where x2 =
2
@x
t
Using the eqn(3) we equate the equations (5) and (6) to obtain,

Tjk+1

Tjk
t

k
c(Tj+1

k
Tjk+1 = cTj+1
+ (1

t
c

=1

(6)

2Tjk + Tjk 1 )
t
2c)Tjk + cTjk

(7)

Boundary Conditions
T (0, x) = 0.5
T (t, 0) = 0
T (t, 1) = 1

On assuming values less than 2 for j, we see that the equation(7) tends to give a negative result,
and hence we take the values of j to be between 2 and (n-1), i.e. 2 < j < (n 1).
At j = 2 ,
At j = 3 ,
.
.
At j = (n-1) ,

T2k+1 = cT3k + (1
T3k+1 = cT4k + (1

2c)T2k + cT1k
2c)T3k + cT2k

Tnk+11 = cTnk + (1

2c)Tnk

+ cTnk

(8.1)
(8.2)

(8.3)

System of equations in Matrix form

Applying the boundary condition on the equation (7), we obtained numerous results for dierent
values of j. In order to represent all the results in a simplified manner, we depict it in a matrix
form:
T~ k+1 = AT~ k + ~b

System of Equations

5.1

Fortran program to solve the 1 dimensional heat equation

Results

Figure 2: Stable condition at CFL = 0.45

Determination of stability for c > 1/2

Figure 3: Unstable condition at CF L > 0.5

6.1

Stability of the Equation

It is seen from the above graphs that when CF L = 0.45, the Temperature at time step with respect
to Space coordinate is a smooth curve, and is stable in nature until CF L = 0.5. When CFl is
varied beyond 0.5, the temperature evolution curve is highly irregular.

Von Neumann Condition


k
Tj+1
Tjk
2 x

= 50

k
Tj+1
= 100 x + Tjk

(9)

k
Now, putting the value of Tj+1
in equation (7), we get,

Tjk+1 = c(100 x + Tjk 1 ) + (1


Tjk+1

2cTjk 1

+ (1

2c)Tjk

2c)Tjk + cTjk
+ (100 c

x)

(10)

For executing the program to satisfy the Von Neumann condition, certain changes are required in
the code used to solve the 1 dimensional heat equation, as shown below:

7.1

Results

Figure 4: Stable condition at CFL = 0.45

Figure 5: Unstable condition at CFL = 0.51


The stability of the above graphs is determined by solving the Von Neumann condition. For a
stable condition the value of G is such that 1 <= G <= 1, for all values of . Hence the value of
c should be less than 0.5 for gain (G) to remain within limits.
G=1

4c(sin2 )
2

(11)

Conclusion

From the graphs, it is seen that the curves depicting temperature evolution are smooth and stable
for both the conditions (i.e. Drichlet and Von Neumann Condition) for a given value of CF L < 0.5.
However, when the value of CFL is slightly increased beyond 0.5, the temperature evolution curve
becomes unstable, and hence the 1-D Heat equation is valid as long as the value of CF L < 0.5.
Also, it is observed that as long as the CF L < 0.5, the Heat equation is more stable when the Von
Neumann condition is applied when compared to the Drichlet Heat equation.

Das könnte Ihnen auch gefallen