0% found this document useful (0 votes)
8 views

Chapter9_Prob41

The document discusses the estimation of ground temperature at various depths for the design of underground pipes, using a mathematical model. It provides MATLAB scripts to calculate temperature at a specific depth after a set time and to generate plots showing temperature as a function of time and depth. The results include temperature calculations and visual representations of the data.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Chapter9_Prob41

The document discusses the estimation of ground temperature at various depths for the design of underground pipes, using a mathematical model. It provides MATLAB scripts to calculate temperature at a specific depth after a set time and to generate plots showing temperature as a function of time and depth. The results include temperature calculations and visual representations of the data.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

1

9.41 In the design of underground pipes, there is a need to esti-


Surface
mate the temperature of the ground. The temperature of the temperature TS
ground at various depths can be estimated by modeling the
ground as a semi-infinite solid initially at constant temperature.
The temperature at depth, x, and time, t, can be calculated from
the expression:
x
x
-------------
T ( x, t ) – T S
--------------------------- = erf  -------------  = -------
2 αt

x 2
e –u 2 du
Ti – TS  2 αt  π 0 Soil initial
where T S is the surface temperature, T i is the initial soil tem- temperature Ti

perature, and α = 0.138 × 10 –6 m2/s is the thermal diffusivity of


oC
the soil. Answer the following questions taking T S = – 15
and T i = 12 oC.
6
(a) Find the temperature at a depth x = 1 m after 30 days ( t = 2.592 × 10 s).
(b) Write a MATLAB program in a script file that generates a plot that shows the temperature as a function
of time at a depth of x = 0.5 m for 40 days. Use increments of 1 day.
(c) Write a MATLAB program that generates a three-dimensional plot (T vs. x and t) showing the temper-
7
ature as a function of depth and time for 0 ≤ x ≤ 3 m and 0 ≤ t ≤ 2.592 × 10 s.
Solution
(a) The following MATLAB program in a script uses MATLAB’s built-in function quad to solve the
problem:

clear all
Ts=-15; Ti=12;
alpha=0.138e-6;
x=1; t=2.592e6;
b=x/(2*sqrt(alpha*t));
T=Ts+(Ti-Ts)*2/pi*quad('exp(-x.^2)',0,b)

When the script file is executed, the following result is displayed in the Command Window:

T =
-3.3784

Excerpts from this work may be reproduced by instructors for distribution on a not-for-profit basis
for testing or instructional purposes only to students enrolled in courses for which the textbook
has been adopted. Any other reproduction or translation of this work beyond that permitted by
Sections 107 or 108 of the 1976 United States Copyright Act without the permission of the
copyright owner is unlawful.
2

(b) The following MATLAB program in a script uses MATLAB’s built-in function quad to solve the
problem:

clear
Ts=-15; Ti=12;
alpha=0.138e-6;
x=0.5;
tdays=[0.01, 1:1:40]; %Starting with a value close to zero.
tsec=tdays*24*60*60;
b=x./(2*sqrt(alpha*tsec));
n=length(tsec);
for i=1:n
T(i)=Ts+(Ti-Ts)*2/sqrt(pi)*quad('exp(-x.^2)',0,b(i));
end
plot(tdays,T)
xlabel('Time (day)'), ylabel('Temperature (C)')

When the script file is executed, the following figure is displayed in the Figure Window:
14

12

10

8
Temperature (C)

−2

−4

−6
0 10 20 30 40
Time (day)

(c) The following MATLAB program in a script uses MATLAB’s built-in function quad to solve the
problem:

% Solution of Problem 9.41c (Script file)

Excerpts from this work may be reproduced by instructors for distribution on a not-for-profit basis
for testing or instructional purposes only to students enrolled in courses for which the textbook
has been adopted. Any other reproduction or translation of this work beyond that permitted by
Sections 107 or 108 of the 1976 United States Copyright Act without the permission of the
copyright owner is unlawful.
3

clear
Ts=-15; Ti=12;
alpha=0.138e-6;
x=[0.01 0.2:0.2:3]; %Starting with a value close to zero.
m=length(x);
tdays=[0.01, 1:1:30]; %Starting with a value close to zero.
tsec=tdays*24*60*60;
n=length(tsec);
[X,Y]=meshgrid(tdays,x);
for j=1:m
xa=x(j);
b=xa./(2*sqrt(alpha*tsec));
for i=1:n
T(j,i)=Ts+(Ti-Ts)*2/sqrt(pi)*quadl('exp(-xa.^2)',0,b(i));
end
end
%plot(tdays,T(j,:))
mesh(Y,X,T)
ylabel('Time (day)'), xlabel('Depth (m)')
zlabel('Temperature (C)')

Excerpts from this work may be reproduced by instructors for distribution on a not-for-profit basis
for testing or instructional purposes only to students enrolled in courses for which the textbook
has been adopted. Any other reproduction or translation of this work beyond that permitted by
Sections 107 or 108 of the 1976 United States Copyright Act without the permission of the
copyright owner is unlawful.
4

When the script file is executed, the following figure is displayed in the Figure Window:

15

10
Temperature (C)

−5

−10

−15
30
20 3
Time (day) 2
10
1 Depth (m)
0 0

Excerpts from this work may be reproduced by instructors for distribution on a not-for-profit basis
for testing or instructional purposes only to students enrolled in courses for which the textbook
has been adopted. Any other reproduction or translation of this work beyond that permitted by
Sections 107 or 108 of the 1976 United States Copyright Act without the permission of the
copyright owner is unlawful.

You might also like