In [17]:

```
import math
print"Introduction to heat transfer by S.K.Som, Chapter 9, Example 1"
#A vertical cooling fin, Approximately a flat plate length,(L)=0.4m high is exposed to saturated steam(temprature,Tg=100Â°C) at atmospheric pressure.
L=0.4;
Tg=100;
#The fin is maintained at temprature,Tw=90Â°C by cooling water.
Tw=90;
print"The properties of condensate(liquid water) are evaluated at the mean film temprature "
#tf is mean film temprature
print"The mean film temprature inÂ°C is"
tf=(Tg+Tw)/2
print"tf=",tf
#The properties of condensate are density(rho=962kg/m**3),conductivity(k=0.677W/(m*K)),viscosity(mu=3*10**-4 kg/(m*s))
rho=962;
k=0.677;
mu=3*10**-4;
#The value rhov=0.598kg/m**3 and hfg=2.27*10**6J/kg at 100Â°C are found from steam table
#g is acceleration due to gravity =9.81m/s**2
g=9.81;
rhov=0.598;#rhov is vapour density
hfg=2.27*10**6;#hfg is enthalpy of vaporisation
print"hfg=",hfg
#The average heat transfer coefficient over length L is hbarL=0.943*((rho*(rho-rhov)*g*h*L**3)/(mu*k*(Tg-Tw)))**(1/4)
print"The average heat transfer coefficient over length L in W/(m**2*K)"
hbarL=0.943*((rho*(rho-rhov)*g*hfg*k**3)/(mu*L*(Tg-Tw)))**(1/4)
print"hbar=",hbar
#The rate of heat transfer per unit width is Q=hbarL*L*(Tg-Tw)
print"The rate of heat transfer per unit width in W/m "
Q=hbarL*L*(Tg-Tw)
print"Q=",Q
#The rate of condensation is given by mdotc=(Q/hfg)
print"The total rate of condensation in kg/(s*m)"
mdotc=(Q/hfg)
print"mdotc=",mdotc
print"We have to check whether the flow is laminar or not "
#Reynolds no is given by ReL=(4*mdotc)/(mu)
print"Reynolds no. is"
ReL=(4*mdotc)/(mu)
print"Therefore the flow is laminar and hence the use of the equation is justified"
print"ReL=",ReL
```

In [16]:

```
import math
print"Introduction to heat transfer by S.K.Som, Chapter 9, Example 2"
#Steam is condensed at temprature(Tg=100Â°C) on the outer surafce of a horizontal tube of length(L=3m) and diameter(d)=50mm or .05m
Tg=100;
L=3;
D=0.05;
#The Tube surface is maintained at temprature,Tw=90Â°C
Tw=90;
#tf is mean film temprature
print"The mean film temprature inÂ°C is"
tf=(Tg+Tw)/2
print"tf=",tf
#The properties of condensate are density(rho=962kg/m**3),conductivity(k=0.677W/(m*K)),viscosity(mu=3*10**-4 kg/(m*s))
rho=962;
k=0.677;
mu=3*10**-4;
#The value rhov=0.598kg/m**3 and hfg=2.27*10**6J/kg at 100Â°C are found from steam table
#g is acceleration due to gravity =9.81m/s**2
g=9.81;
rhov=0.598;#vapour density
hfg=2.27*10**6;#enthalpy of vaporisation
print"hfg=",hfg
#The average heat transfer coefficient hbar=0.745*((rho*(rho-rhov)*g*hfg*k**3)/(mu*D*(Tg-Tw)))**(1/4)
print"The average heat transfer coefficient in W/(m**2*K)"
hbar=0.745*((rho*(rho-rhov)*g*hfg*k**3)/(mu*D*(Tg-Tw)))**(1/4)
print"hbar=",hbar
#The rate of condensation is given by mdotc=(hbar*(pi*D*L)*(Tg-Tw))/hfg
print"The total rate of condensation in kg/s"
mdotc=(hbar*(math.pi*D*L)*(Tg-Tw))/hfg
print"Check for reynolds no."
print"mdotc=",mdotc
#For a horizontal tube having length,L,perimeter is P=2L
P=2*L;
#Re is reynolds number
print"Reynolds number is"
Re=(4*mdotc)/(mu*P)
print"Re=",Re
```

In [13]:

```
import math
print"Introduction to heat transfer by S.K.Som, Chapter 9, Example 3"
#A vertical plate having length,(L)=1.5m is maintained at temprature(Tw) of 60Â°C in the presence of saturated steam(temprature,Tg=100Â°C) at atmospheric pressure.
L=1.5;
Tg=100;
Tw=60;
#Consider the width of plate to be (B)=0.3m
B=0.3;
#tf is the mean film temprature
print"The mean film temprature inÂ°C is"
tf=(Tg+Tw)/2
print"tf=",tf
#The relevant properties are desity(rho=972kg/m**3),conductivity(k=0.670W/(m*K)),viscosity(mu=3.54*10**-4 kg/(m*s))
#specific heat(cp=4.2J/(kg*K)),vapur density(rhov(100Â°C)=0.598k/m**3),Enthalpy of vaporisation(hfg(100Â°C)=2.27*10**6J/kg)
#g is acceleration due to gravity =9.81m/s**2
g=9.81;
rho=972;
k=0.670;
mu=3.54*10**-4;
cp=4.2;
rhov=0.598;
hfg=2.27*10**6;
#The average heat transfer coefficient over length L is hbar=0.943*((rho*(rho-rhov)*g*h*L**3)/(mu*k*(Tg-Tw)))**(1/4)
print"The average heat transfer coefficient over length L in W/(m**2*K)"
hbar=0.943*((rho*(rho-rhov)*g*hfg*k**3)/(mu*L*(Tg-Tw)))**(1/4)
print"hbar=",hbar
#The rate of heat transfer Q=hbarL*A*(Tg-Tw)
#Area(A)=L*B
A=L*B;
print"The rate of heat transfer in kW "
Q=(hbar*A*(Tg-Tw))/1000
print"Q=",Q
#The film thickness at the trailing edges is found out by delta=((4*mu*k*x*(Tg-Tw))/(g*hfg*rho*(rho-rhov)))**(1/4)
print"(b)The film thickness at the trailing edges in m is"
#at trailing edges x=1.5m
x=1.5;
delta=((4*mu*k*x*(Tg-Tw))/(g*hfg*rho*(rho-rhov)))**(1/4)
print"delta=",delta
#The rate of condensation is given by mdotc=(Q/hfg)
print"The total rate of condensation in kg/s"
mdotc=((Q*1000)/hfg)
print"mdotc=",mdotc
#v is the average flow velocity
print"Hence the average flow velocity at the trailing edge in m/s is"
v=(mdotc)/(rho*delta*B)
print"v=",v
```

In [11]:

```
import math
print"Introduction to heat transfer by S.K.Som, Chapter 9, Example 4"
#Saturated freon-012 at Temprature(Tg)=35Â°C is condensed horizontal tube of diameter(D)=15mm or.015m at a lower vapour velocity.
#length,L=1m,Since per meter of tube is considered.
L=1;
Tg=35;
D=0.015;
#The tube wall is maintained at temprature(Tw)=25Â°C
Tw=25;
#For freon-12 at 35Â°C,enthalpy of vaporisation(hfg=131.33kJ/kg) and vapour density(rhov=42.68kg/m**3)
hfg=131.33*10**3;
rhov=42.68;
#tf is mean film temprature
print"The mean film temprature inÂ°C is"
tf=(Tg+Tw)/2
print"tf=",tf
#The relevant properties at 30Â°C are density(rho=1.29*10**3kg/m**3),conductivity(k=0.071W/(mK)),viscosity(mu=2.50*10**-4kg/(m*s)),specific heat(cp=983J/(kg*Â°C))
rho=1.29*10**3;
k=0.071;
mu=2.50*10**-4;
cp=983;
#g is acceleration due to gravity =9.81m/s**2
g=9.81;
#we found the modified enthalpy by using following equation hfgdash=hfg+(3/8)*cp*(Tg-Tw)
print" Modified enthalpy in J/kg is"
hfgdash=hfg+((3/8)*cp*(Tg-Tw))
print"hfgdash=",hfgdash
#The average heat transfer coefficient over length L is hbar=0.555*((rho*(rho-rhov)*g*hfgdash*k**3)/(mu*D*(Tg-Tw)))**(1/4)
print"The average heat transfer coefficient over length L in W/(m**2*K)"
hbar=0.555*((rho*(rho-rhov)*g*hfgdash*k**3)/(mu*D*(Tg-Tw)))**(1/4)
print"hbar=",hbar
#The rate of condensation is given by mdotc=(hbar*(pi*D*L)*(Tg-Tw))/hfg
print"The total rate of condensation in kg/hr"
mdotc=((hbar*(math.pi*D*L)*(Tg-Tw))/hfg)*3600
print"mdotc=",mdotc
```

In [7]:

```
import math
print"Introduction to heat transfer by S.K.Som, Chapter 9, Example 5"
#A nickel wire of length(L)=0.1m,Diameter(D)=1mm or .001m
#Submerged horizontally in water at pressure=1 atm(101kPa) requires current,I=150A at voltage ,E=2.2V to maintain wire at temprature(T1)=110Â°C
L=0.1;
T1=110;
D=0.001;
I=150;
E=2.2;
#Area(A)=(math.pi*D*L)
A=math.pi*D*L;
#The saturation temprature of water at one atmospheric pressure(101kPa) is T2=100Â°C.
T2=100;
#We can write from energy balance E*I=h*A*(T1-T2),we can find heat transfer coefficient from it.
#h is heat transfer coefficient
print"Heat transfer coefficient in W/m**2 is"
h=(E*I)/(A*(T1-T2))
print"h=",h
```

In [18]:

```
import math
print"Introduction to heat transfer by S.K.Som, Chapter 9, Example 6"
#In a laboratory experiment,A current(I)=100A burns out a nickel wire having Diameter(D)=1mm or 0.001mm,length(L)=0.3m
I=100;
D=.001;
L=0.3;
#It is submerged horizontally in water at one atmospheric pressure.
#For saturated water at one atmospheric pressure,density(rhol=960kg/m**3),vapour density(rhov=0.60kg/m**3),enthalpy of vaporisation(hfg=2.26*10**6J/kg),surface tension(sigma=0.055N/m).
rhol=960;
rhov=0.60;
hfg=2.26*10**6;
sigma=0.055;
#Area(A)=(pi*D*L)
A=math.pi*D*L;
#g is acceleration due to gravity =9.81m/s**2
g=9.81;
#The wire is burnt out when heat reaches its peak
#We use following expression to determine critical heat flux qc=0.149*hfg*rhov*((sigma*g*(rhol-rhov))/rhov**2)**(1/4)*((rhol+rhov)/rhol)**(1/2)
print"Critical Heat flux in W/m**2 is"
qc=0.149*hfg*rhov*((sigma*g*(rhol-rhov))/rhov**2)**(1/4)*((rhol+rhov)/rhol)**(1/2)
print"qc=",qc
#From the energy balance E*I=qc*A
#E is the burn out voltage
print"The burn out voltage in Volts is "
E=(qc*A)/I
print"E=",E
```

In [19]:

```
import math
print"Introduction to heat transfer by S.K.Som, Chapter 9, Example 7"
#A heated nickel plate at temprature (T1)=110Â°C is submereged in water at one atmospheric pressure.
T1=110;
#For nucleate boiling coefficient(csf=0.006) and n=1
csf=0.006;
n=1;
#For saturated water at one atmospheric pressure,density of liquid(rhol=960kg/m**3),vapour density(rhov=0.60kg/m**3)
#enthalpy of vaporisation(hfg=2.26*10**6J/kg),surface tension(sigma=0.055N/m),saturation temprature(T2)=100Â°C
T2=100;
rhol=960;
rhov=0.60;
hfg=2.26*10**6;
sigma=0.055;
#g is acceleration due to gravity =9.81m/s**2
g=9.81;
#We take specific heat of liquid(cpl=4.216kJ/(kg*K)),prandtl number of liquid(Prl=1.74),viscosity of liquid(mul=2.82*10**-4kg/(m*s))
cpl=4.216*10**3;
Prl=1.74;
mul=2.82*10**-4;
#The heat flux q is given by expression q=(mul*hfg)*(((rhol-rhov)*g)/sigma)**(1/2)*((cpl*(T1-T2))*(csf*hfg*prl**n))**3
print"Heat flux q in W/m**2 is"
q=(mul*hfg)*(((rhol-rhov)*g)/sigma)**(1/2)*((cpl*(T1-T2))/(csf*hfg*Prl**n))**3
print"The peak heat flux for water at one atmospheric pressure is qc=1.24*10**6(found in example 9.6).Since q<qc,The regime of boiling is nucleate."
print"q=",q
```

In [21]:

```
import math
print"Introduction to heat transfer by S.K.Som, Chapter 9, Example 8"
#A Copper bar whose one end is exposed to boiling water while the other end is encapsulated by an electric heater.
#Thermocouples are inserted in the bar to measure the tempratures at two locations A and b at distances xA=10mm and xB=30mm from the surface.
xA=.010;
xB=.030;
#Under steady condition nucleate boiling is maintained in saturated water at atmospheric pressure and the tempratures are TA=140Â°C and TB=180Â°C,n=1
TA=140;
TB=180;
n=1;
#The values of relevant properties of water and other parameters are
#density of liquid(rhol=960kg/m**3),vapour density(rhov=0.60kg/m**3),specific heat of liquid(cpl=4.216 kJ/(kg*K))
#enthalpy of vaporisation(hfg=2.26*106J/kg),prandtl number of liquiid(Prl=1.74),viscosity of liquid(mul=2.82*10**-4kg/(m*s)),surface tension(sigma1=0.055N/m).
rhol=960;
rhov=0.60;
cpl=4.216*10**3;
hfg=2.26*10**6;
Prl=1.74;
mul=2.82*10**-4;
sigma1=0.055;
#We have to know the value of heat flux(q) and the surface temprature(Tw).
#Since we know the tempratures at location A and B,The heat flux q is determined by fourier law of heat conduction in the bar at steady-state as
#q=k*((TB-TA)/(xB-xA))
#We take for copper conductivity,k=375W/(m*K)
k=375;
print"The heat flux in W/m**2 is"
q=k*((TB-TA)/(xB-xA))
print"q=",q
#g is acceleration due to gravity =9.81m/s**2
g=9.81;
#The surface temprature is given by Tw=TA-((TB-TA)/(xB-xA))*xA
print"The surface temprature in Â°C is"
Tw=TA-((TB-TA)/(xB-xA))*xA
print"Tw=",Tw
#Temprature,T=100Â°C,since copper bar is exposed to boiling water.
T=100;
#Now we use following equation to determine csf,q=(mul*hfg)*(((rhol-rhov)*g)/sigma1)**(1/2)*((cpl*(Tw-T))/(csf*hfg*Prl**n))**3
#Manipulating above equation to find csf we get csf=((cpl*(Tw-T))/(((q/((mul*hfg)*(((rhol-rhov)*g)/sigma1)**(1/2))**(1/3))*hfg*Prl**n))
print"The value of the coefficient csf is "
csf=((cpl*(Tw-T))/(((q/((mul*hfg)*(((rhol-rhov)*g)/sigma1)**(1/2)))**(1/3))*hfg*Prl**n))#[NOTE:The answer in the book is incorrect.(Calcultion mistake)]
print"csf=",csf
```