In [1]:

```
print "Principles of Heat Transfer, 7th Ed. Frank Kreith et. al Chapter - 8 Example # 8.1 "
#Outer dia in m
d = 0.0254;
#mass flow rate of hot fluid in kg/s
mh = 6.93;
#Specific heat of hot fluid n J/kgK
ch = 3810;
#Inlet temperature of hot fluid in degree C
Thin = 65.6;
#Outlet temperature of hot fluid in degree C
Thout = 39.4;
#mass flow rate of cold fluid in kg/s
mc = 6.3;
#Specific heat of cold fluid n J/kgK
cc = 4187;
#Inlet temperature of cold fluid in degree C
Tcin = 10;
#Overall heat transfer coefficient in W/m2K
U = 568;
#Umath.sing energy balance, outlet temp. of cold fluid in degree C
Tcout = Tcin+((mh*ch)*(Thin-Thout))/(mc*cc);
#The rate of heat flow in W
q = (mh*ch)*(Thin-Thout);
print "Parallel-flow tube and shell"
#From Eq. (8.18) the LMTD for parallel flow
#Temperature difference at inlet in degree K
deltaTa = Thin-Tcin;
#Temperature difference at outlet in degree K
deltaTb = Thout-Tcout;
#LMTD in degree K
LMTD = (deltaTa-deltaTb)/log(deltaTa/deltaTb);
#From Eq. (8.16)
print "Heat transfer surface area in m2 is"
#Heat transfer surface area in m2
A = q/(U*LMTD)
print round(A,2)
print "Counterflow tube and shell"
#LMTD in degree K
LMTD = 29.4;
print "Heat transfer surface area in m2 is"
#Heat transfer surface area in m2
A = q/(U*LMTD)
print round(A,2)
A1 = A;#To be used further as a copy of this area
print "Counterflow exchanger with 2 shell passes and 72 tube passes"
#Correction factor found from Fig. 8.15 to the mean temperature for counterflow
P = (Tcout-Tcin)/(Thin-Tcin);
#Heat capacity ratio
Z = (mh*ch)/(mc*cc);
#From the chart of Fig. 8.15, F= 0.97
F = 0.97; #F-Factor
print "Heat transfer surface area in m2 is"
#Heat transfer surface area in m2 is
A = A1/F
print round(A,2)
print "Cross-flow, with one tube pass and one shell pass, shell-side fluid mixed"
#Umath.sing same procedure, we get from charts
F = 0.88; #F-Factor
print "Heat transfer surface area in m2 is"
#Heat transfer surface area in m2 is
A = A1/F
print round(A,2)
```

In [2]:

```
print "Principles of Heat Transfer, 7th Ed. Frank Kreith et. al Chapter - 8 Example # 8.2 "
#mass flow rate of hot fluid in kg/s
mh = 1;
#Specific heat of hot fluid n J/kgK
ch = 2100;
#Inlet temperature of hot fluid in degree C
Thin = 340;
#Outlet temperature of hot fluid in degree C
Thout = 310;
#Specific heat of cold fluid n J/kgK
cc = 4187;
#Inlet temperature of cold fluid in degree C
Tcin = 290;
#Outlet temperature of cold fluid in degree C
Tcout = 300;
#The heat capacity rate of the water in J/kgK is, from Eq. (8.14)
cc = ch*((Thin-Thout)/(Tcout-Tcin));
#Temperature ratio P and Z is, from Eq. (8.20)
P = (Thin-Thout)/(Thin-Tcin); # P Temperature ratio
Z = (Tcout-Tcin)/(Thin-Thout); # Z Temperature ratio
#From Fig. 8.14, F0.94 and the mean temperature difference in degree K is
#F Value
F = 0.94;
#Temperature difference at inlet in degree K
deltaTa = Thin-Tcout;
#Temperature difference at outlet in degree K
deltaTb = Thout-Tcin;
#LMTD in degree K
LMTD = (deltaTa-deltaTb)/log(deltaTa/deltaTb);
#Mean temperature difference in degree K
deltaTmean = F*LMTD;
#From Eq. (8.17) the overall conductance in W/K is
UA = ((mh*ch)*(Thin-Thout))/deltaTmean;
#With reference to the new conditions and Eq. 6.62
#Conductance in W/K
UA = UA*((3/4.0)**0.8);
#Number of transfer units(NTU) value
NTU = UA/(((3/4.0)*mh)*ch);
#Heat capacity ratio
K = (((3/4.0)*mh)*ch)/cc;
#From Fig. 8.20 the effectiveness is equal to 0.61
#Effectiveness
E = 0.61;
#New inlet temperaturre of oil in degree K
Toilin = 370;
#From eq. 8.22a
print "Outlet temperature of oil in degree K"
#Outlet temperature of oil in degree K
Toilout = Toilin-E*(Toilin-Tcin)
print round(Toilout,2)
```

In [7]:

```
print "Principles of Heat Transfer, 7th Ed. Frank Kreith et. al Chapter - 8 Example # 8.3 "
#Airflow rate in kg/s
mair = 0.75;
#Inlet temperature of air in degree K
Tairin = 290;
#Hot gas flow rate in kg/s
mgas = 0.6;
#Inlet temperature of hot gases in degree K
Tgasin = 1150;
#wetted perimeter on air side in m
Pa = 0.703;
#wetted perimeter on gas side in m
Pg = 0.416;
#cross-sectional area of gas passage (per passage) in m2
Ag = 0.0016;
#cross-sectional area of air passage (per passage) in m2
Aa = 0.002275;
#heat transfer surface area in m2
A = 2.52;
#Given that unit is of the cross-flow type, with both fluids unmixed.
#length of air duct in m
La = 0.178;
#hydraulic diameter of air duct in m
Dha = (4*Aa)/Pa;
#length of gas duct in m
Lg = 0.343;
#hydraulic diameter of gas duct in m
Dhg = (4*Ag)/Pg;
#The heat transfer coefficients can be evaluated from Eq. (6.63) for flow
#in ducts.
#Heat transfer coefficient for air in W/m2K
ha = La/Dha;
#Heat transfer coefficient for gas in W/m2K
hg = Lg/Dhg;
#Assuming the average air-side bulk temperature to be 573 K and the average
#gas-side bulk temperature to be 973 K, the properties at those temperatures are, from Appendix 2, Table 28.
#Specific heat of air in J/kgK
cair = 1047;
#Thermal conductivity of air in W/mK
kair = 0.0429;
#Dynamic vismath.cosity of air in Ns/m2
muair = 0.0000293;
#Prandtl number of air
Prair = 0.71;
#Specific heat of hot gas in J/kgK
cgas = 1101;
#Thermal conductivity of hot gas in W/mK
kgas = 0.0623;
#Dynamic vismath.cosity of hot gas in Ns/m2
mugas = 0.00004085;
#Prandtl number of hot gas
Prgas = 0.73;
#The mass flow rates per unit area in kg/m2s
#mass flow rate of air in kg/m2s
mdotair = mair/(19*Aa);
#mass flow rate of gas in kg/m2s
mdotgas = mgas/(18*Ag);
#The Reynolds numbers are
#Reynolds number for air
Reair = (mdotair*Dha)/muair;
#Reynolds number for gas
Regas = (mdotgas*Dhg)/mugas;
#Umath.sing Eq. (6.63), the average heat transfer coefficients in W/m2K
hair = (((0.023*kair)*(Reair**0.8))*(Prair**0.4))/Dha;
#Since La/DHa=13.8, we must correct this heat transfer coefficient for
#entrance effects, per Eq. (6.68). The correction factor is 1.377.
#Corrected heat transfer coefficient of air in W/m2K
hair = 1.377*hair;
#Similarly for hot gas
#Heat transfer coefficient in W/m2K
hgas = (((0.023*kgas)*(Regas**0.8))*(Prgas**0.4))/Dhg;
#Correction factor=1.27;
#Corrected heat transfer coefficient of gas in W/m2K
hgas = 1.27*hgas;
#Overall conductance in W/K
UA = 1/(1/(hair*A)+1/(hgas*A));
#The number of transfer units, based on the gas, which has the smaller heat capacity rate
NTU = UA/(mgas*cgas);
#The heat capacity-rate ratio
Z = (mgas*cgas)/(mair*cair);
#and from Fig. 8.21, the effectiveness is approximately 0.13.
#Effectiveness
E = 0.13;
print "Gas outlet temperature in degree K"
#Gas outlet temperature in degree K
Tgasout = Tgasin-E*(Tgasin-Tairin)
print round(Tgasout)
print "Air outlet temperature in degree K"
#Gas outlet temperature in degree K
Tairout = Tairin+(Z*E)*(Tgasin-Tairin)
print round(Tairout)
```

In [11]:

```
print "Principles of Heat Transfer, 7th Ed. Frank Kreith et. al Chapter - 8 Example # 8.4 "
#Pressure of steam in inches of Hg
P = 4;
#At this pressure, temperture of condenmath.sing steam in degree F
Thin = 125.4;
#Flow rate of seawater in lb/s
mw = 25000.0;
#Specific heat of water in Btu/lb F
c = 0.95;
#Inlet and outlet temperature of seawater in degree F
Tcin = 60.0;
Tcout = 110.0;
#Heat transfer coefficient of steam in Btu/h ft2 F
hsteam = 600.0;
#Heat transfer coefficient of water in Btu/h ft2 F
hwater = 300.0;
#Outer diameter in inches
OD = 1.125;
#Inner diameters in inches
ID = 0.995;
#required effectiveness of the exchanger
E = (Tcout-Tcin)/(Thin-Tcin);
#For a condenser, Cmin/Cmax=0, and from Fig. 8.20, NTU =1.4.
NTU = 1.4;
#The fouling factors from Table 8.2 are 0.0005 h ft2°F/Btu for both sides of the tubes.
#F-Factor
F = 0.0005;
#The overall design heat-transfer coefficient in Btu/h ft2 F per unit outside area of tube is, from Eq. (8.6)
U = 1/(1/hsteam+F+(OD/((2*12)*60))*log(OD/ID)+(F*OD)/ID+OD/(hwater*ID));
#The total area A is 20*pi*D*L, and math.since U*A/Cmin=1.4
print "The length of the tube in ft is"
#The length of the tube in ft
L = (((1.4*mw)*c)*12)/(((Tcin*math.pi)*OD)*U)
print round(L,1)
```

In [12]:

```
print "Principles of Heat Transfer, 7th Ed. Frank Kreith et. al Chapter - 8 Example # 8.5 "
print "There is no computations in this example."
print "It is theoretical"
```