Sunteți pe pagina 1din 3

Assignment 2

Continuum mechanics (4MT317) 2019


Martin Kroon

Introduction
In this assignment we consider heat flow in 1D. Consider the insulated steel rod below. The
cross-section of the rod is indicated by the blue area, and the rod has a circular cross-section.
The surrounding brownish areas indicate the insulation. The insulation means that no heat flow
takes place in directions perpendicular to the x1 -direction. Hence, this heat flow problem can
be modelled using the 1D equation
d2 T
ρ cp Ṫ = k 2 , (1)
dx1
where T = T (x1 ,t) is the temperature, t is time, ρ = 7900kg/m3 is the density of steel, cp =
510J/(kg·K) is the specific heat capacity of steel, and k = 45W/(m·K) is the coefficient of heat
conduction of steel.

20◦ C T (x1 ,t) 20◦ C

Figure 1: Insulated rod.

The insulated rod is first kept at a temperature of 0◦ C for a long time, and at time t = 0 it
is placed in a room with a temperature of 20◦ C. Hence, for t > 0 the boundaries of the rod
(red areas), i.e. at x1 = 0 and x1 = 1m, can be assumed to have the prescribed temperature
T (0,t) = T (1m,t) = 20◦ C.
Your task is to obtain an approximate, numerical solution of T (x1 ,t) using Matlab.

Numerical method
Both the time dimension t and the spatial dimension x1 are discretized. We consider t ∈ [0,tmax]
with tmax = 36000s (10h). Discrete values of t are denoted by t1 , . . ., t j−1, t j , t j+1 , . . ., where j
is an index and where a constant time increment, ∆t = t j+1 −t j = 1s, should be used. Similarly,
the spatial dimension is discretized using nel = 100 elements. The discrete values of x1 are
x1,1 , . . ., x1,i−1 , x1,i , x1,i+1 , . . ., where i is an index and h = x1,i+1 − x1,i = 1cm. The associated
values of the temperature field are T (x1,i ,t j ).
The time derivative of T is approximated as

T (x1,i ,t j ) − T (x1,i ,t j−1)


Ṫ (x1,i ,t j ) ≈ . (2)
∆t

1
For the approximation of d2 T /dx21 , we first introduce the entities

dT T (x1,i ,t j ) − T (x1,i−1 ,t j )
= , (3)
dx1 i−1/2
h

dT T (x1,i+1 ,t j ) − T (x1,i ,t j )
= . (4)
dx1 i+1/2
h
The second derivative is then approximated as

dT dT

d2 T dx1 i+1/2 dx1 i−1/2 T (x1,i+1 ,t j ) − 2T (x1,i ,t j ) + T (x1,i−1 ,t j )
(x1,i ,t j ) ≈ = . (5)
dx21 h h2

The following computational scheme may then be used for establishing the history of the dis-
tribution of T for the rod:

• t=0
• j=0
• T = zeros(nel + 1,1)
• T (1) = 20
• T (nel + 1) = 20
• Told = T
• α = k/(ρ cp )
• Other initializations as necessary
• While t < tmax
• t ← t + ∆t
• j ← j+1
• Loop over i = 2 : nel
d2 T
• = (Told (i + 1) − 2Told (i) + Told(i − 1))/h2
dx21
d2 T
• T (i) = Told (i) + ∆t α
dx21
• End
• Told ← T
• End

Note that the code above is not exactly Matlab code but needs to be translated into such. Note
also that the current distribution of T , i.e. T (x1 ) at time t = t j , is stored in the vector T above,
and the vector Told holds the distribution from the previous time step t = t j−1 .

2
Results and report
In the report of the assignment, show plots of the temperature variation (T vs. x1 ) inside the
rod for the times t = 10s, 1000s, 3600s (1h), and 36000s (10h). Describe the meaning of your
results in words as well.

S-ar putea să vă placă și