In [9]:

```
print "Principles of Heat Transfer, 7th Ed. Frank Kreith et. al Chapter - 6 Example # 6.1 "
#Inlet temperature in degree C
Tin = 10;
#Outlet temperature in degree C
Tout = 40;
#Diameter in m
D = 0.02;
#Massflow rate in kg/s
m = 0.01;
#Heat flux in W/m2
q = 15000;
#From Table 13 in Appendix 2, the appropriate properties of water at an
#average temperature between inlet and outlet of 25°C are
#Density in kg/m3
rho = 997;
#Specific heat in J/kgK
c = 4180;
#Thermal conductivity in W/mK
k = 0.608;
#Dynamic vismath.cosity in Ns/m2
mu = 0.00091;
print "Reynolds Number is"
#Reynolds number
Re = (4*m)/((math.pi*D)*mu)
print int(Re)
print "Flow is Laminar"
#Since the thermal-boundary condition is one of uniform heat flux, Nu= 4.36 from Eq. (6.31)
#Nusselt number
Nu = 4.36;
print "Heat transfer coefficient in W/m2K"
#Heat transfer coefficient in W/m2K
hc = (Nu*k)/D
print int(hc)
#The length of pipe needed for a 30°C temperature rise is obtained from a heat balance
print "Length of pipe in m"
#Length of pipe in m
L = ((m*c)*(Tout-Tin))/((math.pi*D)*q)
print round(L,2)
print "Inner surface temperature at outlet in degree C"
#Inner surface temperature at outlet in degree C
Ts = q/hc+Tout
print round(Ts,2)
#The friction factor is found from Eq. (6.18)
print "Friction factor is"
#Friction factor is
f = 64/Re
print round(f,4)
#Average velocity in m/s
U = (4*m)/(((rho*math.pi)*D)*D);
print "The pressure drop in the pipe in N/m2"
#The pressure drop in the pipe in N/m2
deltaP = ((((f*L)*rho)*U)*U)/(D*2)
print round(deltaP,1)
#Efficiency
n = 0.5;
#The pumping power P is obtained from Eq. 6.19
print "Pumping power in W is"
#Pumping power in W
P = (m*deltaP)/(rho*n)
print round(P,6)
```

In [11]:

```
print "Principles of Heat Transfer, 7th Ed. Frank Kreith et. al Chapter - 6 Example # 6.2 "
#Diameter in m
D = 0.01;
#Wall thickness in m
t = 0.02/100;
#Massflow rate in kg/s
m = 0.05;
#Inlet temperature in degree C
Tin = 35;
#Outlet temperature in degree C
Tout = 45.0;
#Assuming a constant tube temp. in degree C
T = 100.0;
#From Table 16 in Appendix 2, we get the following properties for oil at
#40°C
#Density in kg/m3
rho = 876.0;
#Specific heat in J/kgK
c = 1964.0;
#Thermal conductivity in W/mK
k = 0.144;
#Dynamic vismath.cosity in Ns/m2
mu = 0.21;
#Prandtl number
Pr = 2870.0;
#Reynolds Number is
Re = (4*m)/((math.pi*D)*mu);
#For laminar flow and constant temperature assumption
#Nusselt number
Nu = 3.66;
#Heat transfer coefficient in W/m2K
hc = (Nu*k)/D;
#Heat transfer rate in W
q = (m*c)*(Tout-Tin);
#LMTD in degree K
LMTD = (T-Tout-(T-Tin))/math.log((T-Tout)/(T-Tin));
print "Length of pipe in m is"
#Length of pipe in m
L = q/(((math.pi*D)*hc)*LMTD)
print round(L,2)
```

In [14]:

```
print "Principles of Heat Transfer, 7th Ed. Frank Kreith et. al Chapter - 6 Example # 6.3 "
#Bulk temperature in degree K
T = 293;
#Side of square duct in m
b = 0.1;
#Length of square duct in m
L = 5;
#Wall temperature in degree K
Tw = 300;
#Velocity in m/s
U = 0.03;
#Hydraulic diameter in m
D = 4*((b*b)/(4*b));
#Physical properties at 293 K from Table 19 in Appendix 2 are
#Density in kg/m3
rho = 810;
#Specific heat in J/kgK
c = 2366;
#Thermal conductivity in W/mK
k = 0.167;
#Dynamic vismath.cosity in Ns/m2
mu = 0.00295;
#Prandtl number
Pr = 50.8;
#Reynolds Number is
Re = ((U*D)*rho)/mu;
#Hence, the flow is laminar. Assuming fully developed flow, we get the
#Nusselt number for a uniform wall temperature from Table 6.1
Nu = 2.98;
#Heat transfer coefficient in W/m2K
hc = (Nu*k)/D;
#Similarly, from Table 6.1, the product Re*f=56.91
print "Friction factor is"
#Friction factor
f = 56.91/Re
print round(f,4)
```

In [15]:

```
print "Principles of Heat Transfer, 7th Ed. Frank Kreith et. al Chapter - 6 Example # 6.4 "
#Temperature of device camath.sing in degree K
Ts = 353;
#Length of holes in m
L = 0.3;
#Diameter of holes in m
D = 0.00254;
#Inlet temperature in degree K
Tin = 333;
#Velocity in m/s
U = 0.2;
#The properties of water at 333 K, from Table 13 in Appendix 2, are
#Density in kg/m3
rho = 983;
#Specific heat in J/kgK
c = 4181;
#Thermal conductivity in W/mK
k = 0.658;
#Dynamic vismath.cosity in Ns/m2
mu = 0.000472;
#Prandtl number
Pr = 3;
#Reynolds Number is
Re = ((U*D)*rho)/mu;
if (((Re*Pr)*D)/L)>10 :
#Eq. (6.42) can be used to evaluate the heat transfer coefficient.
#But math.since the mean bulk temperature is not known, we shall evaluate all the properties first at the inlet bulk temperature Tb1 ,
#then determine an exit bulk temperature, and then make a second iteration to obtain a more precise value.
#At the wall temperature of 353 K
#Vismath.cosity in SI units
mus = 0.000352;
#From Eq. (6.42)
#Nusselt number
Nu = (1.86*((((Re*Pr)*D)/L)**0.33))*((mu/mus)**0.14);
#Heat transfer coefficient in W/m2K
hc = (Nu*k)/D;
#mass flow rate in kg/s
m = ((((rho*math.pi)*D)*D)*U)/4;
#Inserting the calculated values for hc and m into Energy balance equation, along with Tb1 and Ts and
#gives Tb2=345K
#For the second iteration, we shall evaluate all properties at the new average bulk temperature
#Bulk temp. in degree C
Tb = (345.0+Tin)/2;
#At this temperature, we get from Table 13 in Appendix 2:
#Density in kg/m3
rho = 980.0;
#Specific heat in J/kgK
c = 4185;
#Thermal conductivity in W/mK
k = 0.662;
#Dynamic vismath.cosity in Ns/m2
mu = 0.000436;
#Prandtl number
Pr = 2.78;
#New reynolds Number is
Re = ((U*D)*rho)/mu;
#With this value of Re, the heat transfer coefficient can now be calculated.
#We obtain the following similarly
#Nusselt number
Nu = 5.67;
#Heat transfer coefficient in W/m2K
hc = (Nu*k)/D;
#Similarly putting this value in energy balance yields
#Bulk temperature in degree K
Tb2 = 345;
print "Outlet temperature in degree K"
#Outlet temperature in degree K
print round(Tb2,2)
```

In [21]:

```
print "Principles of Heat Transfer, 7th Ed. Frank Kreith et. al Chapter - 6 Example # 6.5 "
#Velocity in ft/s
U = 10.0;
#Outer diameter in inches
D = 1.5;
#Inner diameter in inches
d = 1.0;
#Temperature of water in degree F
Tw = 180.0;
#Temperature of wall in degree F
Twall = 100.0;
#The hydraulic diameter D for this geometry is 0.5 in.
D = 0.5;
#Umath.sing properties given in the table provided
#Reynolds number
Re = (((U*D)*3600)*60.8)/(12*0.75);
#Prandtl number
Pr = (1*0.75)/0.39;
#The Nusselt number according to the Dittus-Boelter correlation [Eq. (6.60)]
Nu = (0.023*(125000**0.8))*(Pr**0.3);
print 'The Nusselt number according to the Dittus-Boelter correlation comes out to be \n',int(Nu)
#Umath.sing the Sieder-Tate correlation [Eq. (6.61)]
#Nusselt number
Nu = 358;
print 'The Nusselt number according to the Sieder-Tate correlation comes out to be \n',Nu
#The Petukhov-Popov correlation [Eq. (6.63)] gives
#Friction factor
f = (1.82*log10(125000)-1.64)**(-2);
#K1 of Eq. 6.63
K1 = 1+3.4*f;
#K2 of Eq. 6.63
K2 = 11.7+1.8/(Pr**0.33);
#Nusselt number
Nu = 370;
#The Sleicher-Rouse correlation [Eq. (6.64)] yields
#a of Eq. 6.64
a = 0.852;
#b of Eq. 6.64
b = 1/3.0+0.5/math.exp(0.6*4.64);
#Reynolds number
Re = 82237;
#Nusselt number
Nu = 5+(0.015*(Re**a))*(4.64**b);
print 'Nusselt number according to The Sleicher-Rouse correlation comes out to be \n',int(Nu)
print "Assuming that the correct answer is Nu=370"
print "The first two correlations underpredict by about 10% and 3.5%, respectively"
print "while the Sleicher-Rouse method overpredicts by about 10.5%."
```

In [23]:

```
print "Principles of Heat Transfer, 7th Ed. Frank Kreith et. al Chapter - 6 Example # 6.6 "
#Mass flow rate in kg/s
m = 3;
#Diameter of tube in m
D = 5/100.0;
#Temperature of fluid in degree K
Tb = 473.0;
#Temperature of wall in degree K
Ts = 503.0;
#Density in kg/m3
rho = 7700.0;
#Specific heat in J/kgK
c = 130.0;
#Thermal conductivity in W/mK
k = 12.0;
#Kinematic vismath.cosity in m2/s
nu = 0.00000008;
#Prandtl number
Pr = 0.011;
#The rate of heat transfer per unit temperature rise in W is
q = (m*c)*1;
#Reynolds Number is
Re = (D*m)/(((((rho*math.pi)*D)*D)*nu)/4);
#The heat transfer coefficient in W/m2K is obtained from Eq. (6.67)
hc = ((k*0.625)*((Re*Pr)**0.4))/D;
#Surface area in m2
A = q/(hc*(Ts-Tb));
print "Required length of tube in m is"
#Required length of tube in m
L = A/(math.pi*D)
print round(L,4)
```

In [27]:

```
print "Principles of Heat Transfer, 7th Ed. Frank Kreith et. al Chapter - 6 Example # 6.7 "
#Temperature of airstream in degree C
Tair = 20;
#Velocity of air in m/s
U = 1.8;
#Side of circuit in m
L = 27/1000.0;
#Spacing in the circuit in m
H = 17/1000.0;
#At 20°C, the properties of air from Table 28, Appendix 2, are
#Density in kg/m3
rho = 7700.0;
#Specific heat in J/kgK
c = 130.0;
#Thermal conductivity in W/mK
k = 0.0251;
#Kinematic vismath.cosity in m2/s
nu = 0.0000157;
#Prandtl number
Pr = 0.011;
#Reynolds number
Re = (U*H)/nu;
#From Fig. (6.27), we see that the second integrated circuit is in the inlet region and estimate Nu2 =29.
#Nusselt number in second circuit
Nu2 = 29;
print "Heat transfer coefficient along 2nd circuit in W/m2K"
#Heat transfer coefficient in W/m2K
hc2 = (Nu2*k)/L
print round(hc2)
#The sixth integrated circuit is in the developed region and from Eq. (6.79)
#Nusselt number in sixth circuit
Nu6 = 21.7;
print "Heat transfer coefficient along 6th circuit in W/m2K"
##Heat transfer coefficient in W/m2K
hc6 = (Nu6*k)/L
print round(hc6,1)
```