from __future__ import division
# given data
L=1 # in m
rho=1600 # in kg/m**3
k=40 # in w/mK
Cp=4*10**3 # in J/kgK
a=900 # in degree C
b=-300 # in degree C/m
c=-50 # in degree C/m**2
Qg=1*10**3 # in kW/m**2
A=10 # area in m**2
#t=a+b*x+c*x**2 at any instant, so
# dtBYdx= b+2*c*x
# d2tBYdx2 = 2*c, then
# Part(a)
#q1= -k*A*dtBYdx , at
x=0#
q1= -k*A*(b+2*c*x) # in w
#q2= -k*A*dtBYdx , at
x=L#
q2= -k*A*(b+2*c*x) # in w
E_stored= (q1-q2)+Qg*A*L # in watt
print "The rate of change of energy storage = %0.1e watt" %E_stored
# Part(b)
alpha= k/(rho*Cp) # in m**2s
d2tBYdx2 = 2*c#
dtBYdtoh= alpha*(d2tBYdx2+Qg/k ) # in degree C/sec
print "Rate of change of temperature = %0.3e degree C/sec" %dtBYdtoh
print "Since dt by dx is independent of x. Hence time rate of charge of temperature throughout wall will remain same."
from math import exp
from numpy import log, pi
# given data
k=40 # in W/mK
rho=7800 # in kg/m**3
C=450 # in J/kgK
d=20*10**-3 # in m
r=d/2#
t_i=400 # in degree C
t=85 # in degree C
t_infinite=25 # in degree C
h=80 # in W/m**2K
#l_s=V/A = (4/3*pi*r**3)/(4*pi*r**2) = r/3
l_s=r/3 # in m
Bi= h*l_s/k#
# since Biot number is less than 0.1, hence lumped heat capacity system analysis can be applied
# Part(a)
# Formula (t-t_infinite)/(t_i-t_infinite)= %e**(-h*A*toh/(rho*V*C)) = %e**(-h*toh/(rho*l_s*C))
toh= -log((t-t_infinite)/(t_i-t_infinite))*(rho*l_s*C)/h # in sec
print "The time require to cool the sphere = %0.3f sec" %toh
# Part(b)
# dtBYdtoh = h*A*(t_i-t_infinite)/(rho*V*C) = h*(t_i-t_infinite)/(rho*l_s*C)
dtBYdtoh = h*(t_i-t_infinite)/(rho*l_s*C) # in degree C/sec
print "Initial rate of cooling = %0.3f degree C/sec" %dtBYdtoh
# Part(c)
A=4*pi*r**2#
toh=60#
q_in= h*A*(t_i-t_infinite)*exp(-h*toh/(rho*l_s*C)) # in watt
print "Instantaneous heat transfer rate = %0.3f watt" %q_in
# Part(d) Total energy transferred during first one minute
V=4/3*pi*r**3#
TotalEnergy = rho*C*V*(t_i-t_infinite)*(1-exp(-h*toh/(rho*C*l_s)))#
print "Total energy transferred during first one minute = %0.3f watt" %TotalEnergy
# Note: Answer of first and last part in the book is wrong
from math import exp
# given data
k=40 # in W/mK
rho=8200 # in kg/m**3
C=400 # in J/kgK
D=6*10**-3 # in m
R=D/2#
t_i=30 # in degree C
t_infinite1=400 # for 10 sec in degree C
t_infinite2=20 # for 10 sec in degree C
h=50 # in W/m**2K
# Part(a)
#l_s= V/A = R/3
l_s= R/3 # in m
#toh= rho*V*C/(h*A) = rho*C*l_s/h
toh= rho*C*l_s/h # in sec
print "Time constance = %0.1f sec" %toh
# Part (b)
Bi= h*l_s/k#
# since Bi < 0.1 , hence lumped heat capacity analysis is valid. Now , temperature attained by junction in 10 seconds when exposed to hot air at 400 degree C
toh=10 # in sec
# (t-t_infinite1)/(t_i-t_infinite1)= %e**(-h*A*toh/(rho*V*C)) = %e**(-h*toh/(rho*l_s*C))
t= exp(-h*toh/(rho*l_s*C))*(t_i-t_infinite1)+t_infinite1 # in degree C
print "The junction is taken out from hot air stream and placed in stream of still air 20 degree C."
print "The initial temperature in this case = ",round(t,3)
t_i=t#
toh=20 # in sec
t= exp(-h*toh/(rho*l_s*C))*(t_i-t_infinite2)+t_infinite2 # in degree C
print "The temperature attained by junction = %0.3f degree C" %t
# Note: In the last, calculation to find the value of t is wrong so Answer in the book is wrong
from math import log
# given data
k=8 # in W/mK
alpha=4*10**-6 # in m**2/s
h=50 # in W/m**2K
D=6*10**-3 # in m
R=D/2#
T=0.5 # where T = (t-t_infinite)/(t_i-t_infinite)
#l_s= V/A = R/3
l_s= R/2 # in m
Bi= h*l_s/k#
# since Bi < 0.1 , hence lumped heat capacity analysis can be applied
# toh= rho*V*C/(h*A) = rho*C*l_s/h = k*l_s/(h*alpha)
toh= k*l_s/(h*alpha) # in seconds
print "Time constant = %0.f seconds" %toh
# It is given that (t-t_infinite)/(t_i-t_infinite) = 0.5 = %e**(-h*A*c /(rho*V*C)) = %e**(-h*c/(rho*l_s*C)) = %e**(-h*alpha*c/(l_s))
# or (t-t_infinite)/(t_i-t_infinite) = %e**(-h*alpha*c/(l_s)#
c= -log(T)*l_s/(h*alpha) # in sec
print "The time required to temperature change to reach half of its initial value = %0.1f seconds" %c
# given data
#t=450-500*x+100*x**2+150*x**3 at any instant, so
# dtBYdx= -500+200*x+450*x**2
L=0.5 # thickness of the wall in meter
k=10 # in W/mK
# Rate of heating entering in the wall per unit area, at
x=0#
#q1= -k*dtBYdx
q1= -k*(-500+200*x+450*x**2) # in W/m**2
# Rate of heat going out of the wall per unit area , at
x=L#
q2= -k*(-500+200*x+450*x**2) # in W/m**2
E=q1-q2 # in W/m**2
print "Heat energy stored per unit area = %0.0f W/m**2" %E
from __future__ import division
# given data
k=385 # in W/mK
h=100 # in W/m**2K
delta =2*10**-3 # thickness of plate in meter
A=25*25 # area of plate in square meter
rho=8800 # kg/m**3
C=400 # J/kg-K
# l_s= V/A= L*B*delta/(2*L*B) = delta/2
l_s= delta/2 # in meter
Bi= h*l_s/k#
# since Bi < 0.1 , hence lumped heat capacity analysis can be applied
# Part(i)
# toh= rho*V*C/(h*A) = rho*C*l_s/h
toh= rho*C*l_s/h # in second
print "Time constant = %0.1f seconds" %toh
# Part(ii)
t_i=400 # in degree C
t=40 # in degree C
t_infinite=25 # in degree C
# (t-t_infinite)/(t_i-t_infinite) = %e**(-h*A*toh /(rho*V*C)) = %e**(-h*toh/(rho*l_s*C))
toh= -log((t-t_infinite)/(t_i-t_infinite))*rho*C*l_s/h # in sec
print "The time required for the plate to reach the temperature of 40 degree C = %0.1f seconds" %toh
from math import log
# given data
k=380 # in W/mK
delta =6*10**-2 # thickness of plate in meter
rho=8800 # kg/m**3
C=400 # J/kg-K
# l_s= V/A = delta/2
l_s= delta/2 # in meter
t=80 # in degree C
t_i=200 # in degree C
t_inf=30 # in degree C
hw= 75 # in W/m**2K
ha= 10 # in W/m**2K
# Part(i)
# ha*A*(t-t_inf_a)+ hw*A*(t-t_inf_w) = -rho*V*C*dtBYdtho, since t_ini_a = t_inf_w = t_inf = 30 degree C
# (ha+hw)*A*(t-t_inf)= -rho*V*C*dtBYdtho
# (ha+hw)/(rho*C*V)*A*dtoh = -dt/(t-t_inf)
# integrate('(ha+hw)/(rho*V*C)*A','toh',0,toh) = integrate('1/(t-t_inf)','t',t_i,t)
toh= -rho*l_s*C/(ha+hw)*log((t-t_inf)/(t_i-t_inf))#
print "Time required to cool plate to 80 degree C is :",round(toh,1),"seconds =",round(toh/60,2),"minutes"
# Part (ii)
t= -rho*l_s*C/(2*ha)*log((t-t_inf)/(t_i-t_inf))#
print "Time required to cool plate in only air is :",round(t,1),"seconds =",round(t/60,2),"minutes"
from numpy import pi
# given data
k=45 # in W/m degree C
d =0.1 # in meter
l =0.30 # in meter
t=800 # in degree C
t_i=100 # in degree C
t_infinite=1200 # in degree C
h= 120 # in W/m**2 degree C
alpha=1.2*10**-5 # in meter
rhoC= k/alpha#
V=pi/4*d**2*l # in m**3
A= pi*d*l + 2*pi/4*d**2 # in m**2
# l_s= V/A = (pi/4*d**2*l)/(pi*d*l + 2*pi/4*d**2) = d*l/(4*l+2*d**2)
l_s = d*l/(4*l+2*d**2)#
Bi= h*l_s/k#
# since Bi < 0.1 , hence lumped heat capacity analysis can be applied
# (t-t_infinite)/(t_i-t_infinite) = %e**(-h*A*toh /(rho*V*C)) = %e**(-h*toh/(rho*l_s*C)) = %e**(-h*toh/(rhoC*l_s))
toh = -log((t-t_infinite)/(t_i-t_infinite))*rhoC*l_s/h # in sec
# So, the velocity of ingot passing through the furnace
FurnaceLength = 8*100 # in cm
time = toh#
Velocity = FurnaceLength/time # in cm/sec
print "Maximum speed = %0.4f cm/sec" %Velocity
from math import log
# given data
rho=8500 # in kg/m**3
C=400 # J/kgK
toh=1 # in sec
h= 400 # in W/m**2 degree C
t=198 # in degree C
t_i=25 # in degree C
t_infinite=200 # in degree C
# Part (1)
# toh =rho*V*C/(h*A) = rho*C*l_s/h
l_s= toh*h/(rho*C)#
# l_s = V/A = r/3
r=3*l_s # in m
r=r*10**3 # in mm
d=2*r # in m
print "Junction diameter needed for the thermocouple = %0.3f mili miter" %d
# Part(ii)
# toh= -rho*V*C/(h*A)*log((t-t_infinite)/(t_i-t_infinite))
toh = -toh*log((t-t_infinite)/(t_i-t_infinite))#
print "Time required for the thermocouple junction to reach 198 degree C = %0.3f seconds" %toh
# given data
L=40*10**-2 # in m
k=1.5 # in W/mK
A=4 # in square meter
alpha=1.65*10**-3 # in m**2/h
#T = 50-40*x+10*x**2+20*x**3-15*x**4 , so
# dtBYdx= -40+20*x+60*x**2-60*x**3
# d2tBYdx2 = 20+120*x-180*x**2
# Part (a) Heat entering the slab
#q1= -k*A*dtBYdx , at
x=0#
qi= -k*A*(-40+20*x+60*x**2-60*x**3) # in w
print "Heat entering the slab = %0.0f watt" %qi
# Heat leaving the slab
#ql= -k*A*dtBYdx , at
x=L#
ql= -k*A*(-40+20*x+60*x**2-60*x**3) # in w
print "Heat leaving the slab = %0.2f watt" %ql
# Part (b) Rate of heat storage
RateOfHeatStorage = qi-ql # in watt
print "Rate of heat storage = %0.2f watt" %RateOfHeatStorage
# Part (c) Rate of temperature change
# d2tBYdx2 = 1/alpha*dtBYdtoh
# dtBYdtoh= alpha*d2tBYdx2, at
x=0#
dtBYdtoh = alpha*(20+120*x-180*x**2) # in degree C/h
print "The rate of temperature change at entering the slab = %0.3f degree C/h" %dtBYdtoh
# dtBYdtoh= alpha*d2tBYdx2, at
x=L
dtBYdtoh = alpha*(20+120*x-180*x**2) # in degree C/h
print "The rate of temperature change at leaving the slab = %0.3f degree C/h" %dtBYdtoh
# Part (d) for the rate of heating or cooling to be maximum
# dBYdx of dtBYdtoh = 0
# dBYdx of (alpha*d2tBYdx2) =0
# d3tBYdx3 = 0
x=120/360 # in meter
print "The point where rate of heating or cooling is maximum = %0.3f meter" %x
from math import log
# given data
k=40 # in W/m degree C
d =12*10**-3 # in meter
t=127 # in degree C
t_i=877 # in degree C
t_infinite=52 # in degree C
h= 20 # in W/m**2 degree C
rho=7800 # in W/m**2K
C=600 # in J/kg K
r=d/2 # in meter
#l_s = V/A = r/3
l_s = r/3#
Bi= h*l_s/k#
# since Bi < 0.1 , hence lumped heat capacity analysis can be applied
# (t-t_infinite)/(t_i-t_infinite) = %e**(-h*A*toh /(rho*V*C)) = %e**(-h*toh/(rho*l_s*C)) = %e**(-h*toh/(rho*C*l_s))
toh = -log((t-t_infinite)/(t_i-t_infinite))*rho*C*l_s/h # in sec
print "Time required for cooling process =",round(toh,3),"seconds =",round(toh/60,2),"minutes"
# given data
D=10*10**-2 # in m
b=D/2#
h= 100 # in W/m**2 degree C
T_o=418 # in degree C
T_i=30 # in degree C
T_infinite=1000 # in degree C
print " (A) For copper cylinder "
k=350 # in W/mK
alpha=114*10**-7 # in m**2/s
Bi= h*b/k#
theta_0_t = (T_o-T_infinite)/(T_i-T_infinite)#
Fo=18.8#
# Formula Fo= alpha*t/b**2
t=Fo*b**2/alpha#
print "Time required to reach for the cylinder centreline temperature 418 degree C =",round(t,3),"seconds =",round(t/3600,3),"hours"
# (2) Temperature at the radius of 4 cm
theta_0_t = 0.985#
# Formula theta_0_t = (T-T_infinite)/(T_o-T_infinite)
T= theta_0_t*(T_o-T_infinite)+T_infinite # in degree C
print "Temperature at the radius of 4 cm = %0.2f degree C" %T
print "It has very less temperature gradients over 4 cm radius"
print " (B) For asbestos cylinder "
k=0.11 # in W/mK
alpha=0.28*10**-7 # in m**2/s
Bi= h*b/k#
theta_0_t = (T_o-T_infinite)/(T_i-T_infinite)#
Fo=0.21#
# Formula Fo= alpha*t/b**2
t=Fo*b**2/alpha#
print "Time required to reach for the cylinder centreline temperature 418 degree C =",round(t,3),"seconds =",round(t/3600,1),"hours"
# (2) Temperature at the radius of 4 cm
theta_x_t = 0.286#
# Formula theta_x_t = (T-T_infinite)/(T_o-T_infinite)
T= theta_x_t*(T_o-T_infinite)+T_infinite # in degree C
print "Temperature at the radius of 4 cm = %0.3f degree C" %T
print "It has large temperature gradients"
from numpy import pi
# given data
D=5*10**-2 # in m
b=D/2#
h= 500 # in W/m**2 degree C
k=60 # in W/m**2K
rho=7850 # in kg/m**3
C=460 # in J/kg
alpha=1.6*10**-5 # in m**2/s
T_i=225 # in degree C
T_infinite=25 # in degree C
t=2 # in minute
# Part(i)
Bi= h*b/k#
Fo= alpha*t/b**2#
theta_0_t = 0.18#
# Formula theta_0_t = (T_o-T_infinite)/(T_i-T_infinite)
T_o= theta_0_t*(T_i-T_infinite)+T_infinite # in degree C
print "Centreline Temperature of the sphere after 2 minutes of exposure = %0.f degree C " %T_o
# Part(2)
depth= 10*10**-3 # in meter
r=b-depth # in meter
rBYb=r/b#
theta_x_t = 0.95#
# Formula theta_x_t = (T-T_infinite)/(T_o-T_infinite)
T= theta_x_t*(T_o-T_infinite)+T_infinite # in degree C
print "The Temperature at the depth of 1 cm from the surface after 2 minutes = %0.1f degree C" %T
# Part (3)
BiSquareFo= Bi**2*Fo#
QbyQo= 0.8 # in kJ
A=4/3*pi*b**3#
Qo= rho*A*C*(T_i-T_infinite) # in J
Qo=Qo*10**-3 # in kJ
# The heat transffered during 2 minute,
Q= Qo*QbyQo # in kJ
print "The heat transffered during 2 minutes = %0.3f kJ" %Q