import math
# Variables
# given
h = 12.; #[W/m**2*K] - heat transfer coefficeint
k = 400.; #[W/m*K] - thermal conductivity
# Calculation and Results
# (a) for sphere
r = 5.*10**-2; #[m] - radius of copper sphere
Lc = ((4*math.pi*((r)**3))/3)/(4*math.pi*((r)**2));
Nbi = h*Lc*(1./k);
print " a) The biot no. is Nbi = %.0e"%(Nbi);
# (b) for cyclinder
r = 0.05; #[m] - radius of cyclinder
L = 0.3; #[m] - height of cyclinder
Lc = (math.pi*((r)**2)*L)/(2*math.pi*r*L);
Nbi = h*Lc*(1./k);
print " b) The biot no. is Nbi = %.1e"%(Nbi);
# (c) for a long square rod
L = .4; #[m] - length of copper rod
r = 0.05; #[m] - radius of a cyclinder havimg same cross sectional area as that of square
x = ((math.pi*r**2)**(1./2));
Lc = ((x**2)*L)/(4*x*L);
Nbi = h*Lc*(1./k);
print " c) The biot no. is Nbi = %.3e"%(Nbi);
# Variables
# given
d = 1*0.0254; #[m]
Lr = d/2; #[m];
Lz = (1.2/2)*(0.0254);
x = Lz;
r = Lr;
k = 0.481;
h = 20.;
mr = k/(h*Lr);
mz = k/(h*Lz);
nr = r/Lr;
nz = x/Lz;
t = 1.2; #[sec]
# Calculations
alpha = 1.454*10**-4;
Xr = (alpha*t)/(Lr**2);
Xz = (alpha*t)/(Lz**2);
# using the above value of m,n,X the value for Ycz and Ycr from fig 13.14 is
Ycr = 0.42;
Ycz = 0.75;
Yc = Ycr*Ycz;
T_infinity = 400.; #[K]
To = 295.;
Tc = T_infinity-(Yc*(T_infinity-To));
# Results
print " The temperature t the centre is Tc = %.0f K"%(Tc);
# Answer is vary because of rounding error.
from numpy import *
# Variables
# given
T_x0 = 300.; #[K]
Tw = 400.; #[K]
L = 0.013; #[m]
alpha = 2.476*(10**-5); #[m**/sec]
h = 600.; #[W/m**2*K]
pcp = 3.393*(10**6); #[J/m**3*K]
L = 0.013; #[m]
del_tax = L/10.;
betaa = 0.5;
del_tat = 0.03;
# Calculations
del_tat = betaa*((del_tax)**2)*(1./alpha);
T_infinity = 400.; #[K]
# to be sure that the solution is stable, it is customary to truncate this number
del_tat = 0.03; #[sec]
# betaa = alpha*del_tat*((1./del_tax)**2);
Told = zeros(11)
for i in range(11):
Told[i] = 300.;
a = ((2*h*del_tat)/(pcp*del_tax));
b = ((2*alpha*del_tat)/(pcp*((del_tax)**2)));
Tnew = zeros(11)
for j in range(11):
Tnew[0] = (T_infinity*0.08162)+(Told[0]*(1-0.08162-0.8791))+(Told[1]*0.8791)
for k in range(9):
Tnew[k+1] = (betaa*Told[k+2])+((1.-2*betaa)*(Told[k+1]))+(betaa*Told[k]);
Tnew[10] = ((2*betaa)*(Told[9]))
Told = Tnew;
# Results
print "Told values : " ,(Told);
# Variables
p = 2050.; #[kg/m**3] - density of soil
cp = 1840.; #[J/kg*K] - heat cpapacity of soil
k = 0.52; #[W/m*K] - thermal conductivity of soil
alpha = 0.138*10**-6; #[m**2/sec]
t = 4*30*24*3600; #[sec] - no. of seconds in 4 months
Tx = -5.; #[degC]
Tinf = -20.; #[degC]
T0 = 20.; #[degC]
# from the fig 13.24 the dimensionless dismath.tance Z is
Z = 0.46;
# Calculations
# then the depth is
x = 2*((alpha*t)**(1./2))*Z
# Results
print " the depth is x = %.1f m = %.1f ft"%(x,x*3.6/1.10);
# Variables
d = 0.01; #[m] - diameter of cyclindrical porous plug
D = 2.*10**-9; #[m**2/sec] - diffusion coefficient
t = 60.*60; #[sec]
r = d/2.;
m = 0.;
Ca_inf = 0.;
Ca_0 = 10.;
X = (D*t)/((r)**2);
# from fig 13.14 the ordinate is
Y = 0.7;
# Calculations
Ca_c = Ca_inf-Y*(Ca_inf-Ca_0);
# Results
print " the concentration of KCL at the centre after 60 min is Ca = %.2f kg/m**3"%(Ca_c);