In [8]:

```
print "Principles of Heat transfer, Seventh Edition, Frank Kreith, Raj M Manglik and Mark S Bohn, Chapter 9, Example 1"
#Temperature of the tungsten filament in Kelvin
T=1400;
print "a)Wavelength at which the monochromatic emissive power of the given tungsten filament is maximum in meters"
#Wavelength in m
lamda_max=2.898e-3/T
print "{:.2e}".format(lamda_max)
print "b)Monochromatic emissive power at calculated maximum wavelength in W/m**3"
#Emissive power in W/m3
Eb_max=12.87e-6*(T**5)
print "{:.2e}".format(Eb_max)
#Given wavelength in meters
lamda=5e-6;
#Product of wavelength and temperature in m-K
lamda_T=lamda*T;
print "c)Monochromatic emissive power at given wavelength in W/m**3"
#Emissive power in W/m3
Eb_lamda=Eb_max*(2.898e-3/(lamda_T))**5*(((math.e**4.965)-1)/((math.e**(0.014388/lamda_T)-1)))
print "{:.2e}".format(Eb_lamda)
print "Thus ,Monochromatic emissive power at 5e-6 m wavelength is 25.4% of the Monochromatic emissive power at maximum wavelength"
```

In [10]:

```
print "Principles of Heat transfer, Seventh Edition, Frank Kreith, Raj M Manglik and Mark S Bohn, Chapter 9, Example 2"
#Temperature at which sun is radiating as a blackbody in K
T=5800;
#Lower limit of wavelength for which glass is transparent in microns
lamda_l=0.35;
#lower limit of product of wavelength and temperature in micron-K
lamda_l_T=lamda_l*T;
#Lower limit of wavelength for which glass is transparent in microns
lamda_u=2.7;
#lower limit of product of wavelength and temperature in micron-K
lamda_u_T=lamda_u*T;
# For lamda_T= 2030, ratio of blackbody emission between zero and lamda_l to the total emission in terms of percentage
r_l=6.7;
# For lamda_T= 15660, ratio of blackbody emission between zero and lamda_u to the total emission in terms of percentage
r_u=97;
#Total radiant energy incident upon the glass from the sun in the wavelength range between lamda_l and lamda_u
total_rad=r_u-r_l;
print "Percentage of solar radiation transmitted through the glass in terms of percentage"
rad_trans=total_rad*0.92 #Since it is given that silica glass transmits 92% of the incident radiation
print round(rad_trans,1)
```

In [23]:

```
print "Principles of Heat transfer, Seventh Edition, Frank Kreith, Raj M Manglik and Mark S Bohn, Chapter 9, Example 3"
#Area of the flat black surface in m**2
A_1=10e-4;
#Radiation emitted by the flat black surface in W/m** sr
I_1=1000;
# Another surface having same area as A1 is placed relative to A1 such that length of radiation ray connecting dA_1 and dA_2 in meters
r=0.5;
#Area in m**2
A_2=10e-4;
# Since both areas are quite small, they can be approximated as differential surface areas and the solid angle can be calculated as
#d_omega21=dA_n2/r**2 where dA_n2 is the projection of A2 in the direction normal to the incident radiation for dA_1,thus
#Angle between the normal n_2 ant the radiation ray connecting dA_1 and dA_2
theta_2=30;
#Therefore solid angle in sr
d_omega21=(A_2*math.cos(theta_2*math.pi/180)/(r**2));
print "Irradiation of A_2 by A_1 in watt"
#Irradiation in W
q_r12= I_1*A_1*math.cos(90*math.pi/180-theta_2*math.pi/180)*d_omega21
print round(q_r12,5)
```

In [24]:

```
print "Principles of Heat transfer, Seventh Edition, Frank Kreith, Raj M Manglik and Mark S Bohn, Chapter 9, Example 4"
#Hemispherical emissivity of an aluminum paint at wavelengths below 3 microns
epsilon_lamda_1=0.4;
#Hemispherical emissivity of an aluminum paint at longer wavelengths
epsilon_lamda_2=0.8;
#At room temperature 27 degree celcius, product of lamda and T in micron-K
lamda_T_1=3*(27+273);
#At elevated temperature 527 degree celcius, product of lamda and T in micron-K
lamda_T_2=3*(527+273);
#From Table 9.1
# For lamda_T_1, ratio of blackbody emission between zero and lamda_l to the total emission
r_1=0.00016;
# For lamda_T_2, ratio of blackbody emission between zero and lamda_u to the total emission
r_2=0.14;
print "Thus, the emissivity at 27°C"
#Emissivity
epsilon=0.8
print epsilon
print "emissivity at 527°C"
#Emissivity at higher temp.
epsilon=(r_2*epsilon_lamda_1)+(epsilon_lamda_2*0.86)
print epsilon
print "The reason for the difference in the total emissivity is that at the higher temperature,the percentage of the total emissive power in the low-emittance region of the paint is appreciable, while at the lower temperature practically all the radiation is emittedat wavelengths above 3 microns"
```

In [26]:

```
print "Principles of Heat transfer, Seventh Edition, Frank Kreith, Raj M Manglik and Mark S Bohn, Chapter 9, Example 5"
#Temperature of the sun in K
T=5800;
#For the case of Solar irradiation, value of the product of lamda and T in micron-K
lamda_T_1=3*T;# value of lamda is taken from Example 9.4
#From table 9.1
# For lamda_T_1, ratio of blackbody emission between zero and lamda_l to the total emission
r_1=0.98;
#This means that 98% of the solar radiation falls below 3 microns
#Hemispherical emissivity of an aluminum paint at wavelengths below 3 microns
epsilon_lamda_1=0.4;
#Hemispherical emissivity of an aluminum paint at longer wavelengths
epsilon_lamda_2=0.8;
print "Effective absorptivity for first case"
#Effective absorptivity
alpha_1=(r_1*epsilon_lamda_1)+(epsilon_lamda_2*0.02)
print round(alpha_1,3)
#For the case second with source at 800 K, value of the product of lamda and T in micron-K
lamda_T_2=3*800;
# For lamda_T_2, ratio of blackbody emission between zero and lamda_l to the total emission
r_2=0.14;
print "Effective absorptivity for second case"
#Effective absorptivity
alpha_2=(r_2*epsilon_lamda_1)+(epsilon_lamda_2*0.86)
print round(alpha_2,3)
```

In [29]:

```
print "Principles of Heat transfer, Seventh Edition, Frank Kreith, Raj M Manglik and Mark S Bohn, Chapter 9, Example 6"
#Stefan–Boltzmann constant in W/m**2 K**4
sigma=5.67e-8;
#Temperature of the painted surface in K
T=1000;
#Temperature of the sun in K
T_s=5800;
#Given, below 2 microns the emissivity of the surface is 0.3,so
lamda_1=2; #wavelength in microns
epsilon_1=0.3; #emissivity
#Given, between 2 and 4 microns emmisivity is 0.9,so
lamda_2=4;#wavelength in microns
epsilon_2=0.9;#emissivity
#Given, above 4 microns emmisivity is 0.5, so
epsilon_3=0.5;#emissivity
#value of the product of lamda_1 and T in micron-K
lamda_1_T=2e-3*T;
#From table 9.1
# For lamda_1_T, ratio of blackbody emission between zero and lamda_l to the total emission
r_1=0.0667; #1st ratio
#value of the product of lamda_2 and T in micron-K
lamda_2_T=2e-3*T;
#From table 9.1
# For lamda_2_T, ratio of blackbody emission between zero and lamda_l to the total emission
r_2=0.4809; #2nd ratio
print "a)Effective emissivity over the entire spectrum"
#Effective emissivity
epsilon_bar=epsilon_1*r_1+epsilon_2*(r_2-r_1)+epsilon_3*(1-r_2)
print round(epsilon_bar,4)
print "b)Emissive power in W/m**2"
#Emissive power in W/m**2
E=epsilon_bar*sigma*T**4
print "{:.1e}".format(E)
#value of the product of lamda_1 and T_s in micron-K
lamda_1_T_s=2e-3*T_s;
#From table 9.1
# For lamda_1_T_s, ratio of blackbody emission between zero and lamda_l to the total emission
r_1_s=0.941;
#value of the product of lamda_2 and T_s in micron-K
lamda_2_T_s=2e-3*T_s;
#From table 9.1
# For lamda_2_T_s, ratio of blackbody emission between zero and lamda_l to the total emission
r_2_s=0.99;
print "c) Average solar absorptivity"
#Average solar absorptivity
alpha_s=epsilon_1*r_1_s+epsilon_2*(r_2_s-r_1_s)+epsilon_3*(1-r_2_s)
print round(alpha_s,3)
# the answer in textbook is slightly different due to approximation
```

In [31]:

```
print "Principles of Heat transfer, Seventh Edition, Frank Kreith, Raj M Manglik and Mark S Bohn, Chapter 9, Example 7"
#Temperature of the oxidised surface in Kelvin
T=1800;
#Area of the oxidised surface in m**2
A=5e-3;
#Stefan–Boltzmann constant in W/m**2 K**4
sigma=5.67e-8;
print "a)Emissivity perpendicular to the surface"
#Emissivity
epsilon_zero=0.70*math.cos(0)
print round(epsilon_zero,3)
print "b)Hemispherical emissivity"
#Hemispherical emissivity
epsilon_bar=((-1.4)/3)*((math.cos(90*math.pi/180))**3-(math.cos(0))**3)
print round(epsilon_bar,3)
print "c)Emissive Power in Watt"
#Emissive Power in W
E=epsilon_bar*A*sigma*T**4
print round(E,3)
# the answer in textbook is slightly different due to approximation
```

In [34]:

```
print "Principles of Heat transfer, Seventh Edition, Frank Kreith, Raj M Manglik and Mark S Bohn, Chapter 9, Example 8"
# Theoretical Proof
print "The given example is theoretical and does not involve any numerical computation"
```

In [33]:

```
print "Principles of Heat transfer, Seventh Edition, Frank Kreith, Raj M Manglik and Mark S Bohn, Chapter 9, Example 9"
#Window arrangement consists of a long opening with dimensions
#Height in meters
h=1;
#Length in meters
l=5;
#width of table in meters
w=2;
#Assuming that window and table are sufficiently long and applying crossed string method, we get
#Distance ab in m
ab=0;
#Distance cb in m
cb=w;
#Distance ad in m
ad=h;
#Distance cd in m
cd=math.sqrt(l);
print "Shape factor between the window and the table"
#Shape factor between the window and the table
F_12=0.5*(ad+cb-cd)
print round(F_12,4)
```

In [37]:

```
print "Principles of Heat transfer, Seventh Edition, Frank Kreith, Raj M Manglik and Mark S Bohn, Chapter 9, Example 10"
#Window area in ft**2
A1=6*20;
#Second area in ft**2
A2=4*20;
#Assuming A5=A1+A2
#Area in ft**2
A5=A1+A2;
#From Fig. 9.27
#Shape Factors required
F56=0.19;
F26=0.32;
F53=0.08;
F23=0.19;
print "Shape factor"
#Shape factor
F14=(A5*F56-A2*F26-A5*F53+A2*F23)/A1
print round(F14,3)
print "Thus,only about 10% of the light pasmath.sing through the window will impinge on the floor area A4"
```

In [40]:

```
print "Principles of Heat Transfer, 7th Ed. Frank Kreith et. al Chapter - 9 Example # 9.11 "
#Absolute boiling temperature of liquid oxygen in R
T1 = 460-297.0;
#Absolute temperature of sphere in R
T2 = 460+30;
#Diameter of inner sphere in ft
D1 = 1;
#Area of inner sphere in ft2
A1 = (math.pi*D1)*D1;
#Diameter of outer sphere in ft
D2 = 1.5;
#Area of outer sphere in ft2
A2 = (math.pi*D2)*D2;
#Stefans constant
sigma = 0.1714;
#Emissivity of Aluminium
epsilon1 = 0.03;#Sphere1
epsilon2 = 0.03;#Sphere2
#Umath.sing Eq. 9.74
print "Rate of heat flow by radiation to the oxygen in Btu/h is"
#Rate of heat flow by radiation to the oxygen in Btu/h
q = ((A1*sigma)*((T1/100.0)**4-(T2/100.0)**4))/(1/epsilon1+(A1/A2)*((1-epsilon2)/epsilon2))
print round(q,1)
```

In [28]:

```
print "Principles of Heat Transfer, 7th Ed. Frank Kreith et. al Chapter - 9 Example # 9.12 "
# As the example involves no calculations and the code for matlab is already given in the textbook thus following the guidelines this exapmle is to be skipped
```

In [29]:

```
print "Principles of Heat Transfer, 7th Ed. Frank Kreith et. al Chapter - 9 Example # 9.13 "
# As the example involves no calculations and the code for matlab is already given in the textbook thus following the guidelines this exapmle is to be skipped
```

In [16]:

```
print "Principles of Heat Transfer, 7th Ed. Frank Kreith et. al Chapter - 9 Example # 9.14 "
#Absolute temperature of first plate in degree R
Ta = 2040+460.0;
#Absolute temperature of second plate in degree R
Tb = 540+460.0;
#Stefans constant
sigma = 0.1718;
#For first radiation band, heat transfer is calculated
#Emissivity of A
epsilonA = 0.1;
#Emissivity of B
epsilonB = 0.9;
#Shape factor
Fab = 1/(1/epsilonA+1/epsilonB-1);
#The percentage of the total radiation within a given band is obtained from Table 9.1.
#Coefficients of T**4
A = 0.375;
#Coefficients of T**4
B = 0.004;
#Rate of heat transfer in first band in Btu/h ft2
q1 = (Fab*sigma)*(A*((Ta/100.0)**4)-B*((Tb/100.0)**4));
#Similarly for other two bands, heat transfer in Btu/h ft2
q2 = 23000;
#heat transfer in Btu/h ft2
q3 = 1240;
print "Total rate of radiation heat transfer in Btu/h ft2"
#heat transfer in Btu/h ft2
q = q1+q2+q3
print round(q)
# The answer is slightly different in textbook due to approximation
```

In [13]:

```
print "Principles of Heat Transfer, 7th Ed. Frank Kreith et. al Chapter - 9 Example # 9.15 "
#Temperature in degree K
T = 800;
#Diameter of sphere in m
D = 0.4;
#Partial pressure of nitrogen in atm
PN2 = 1;
#Partial pressure of H2O in atm
PH2O = 0.4;
#Partial pressure of CO2 in atm
PCO2 = 0.6;
#The mean beam length for a spherical mass of gas is obtained from Table 9.7
#Beam length in m
L = (2/3)*D;
#The emissivities are given in Figs. 9.46 and 9.47
#Emissivity of H2O
epsilonH2O = 0.15;
#Emissivity of CO2
epsilonCO2 = 0.125;
#N2 does not radiate appreciably at 800 K, but math.since the total gas pressure
#is 2 atm, we must correct the 1-atm values for epsilon.
#From Figs. 9.48 and 9.49 the pressure correction factors are
#Pressure correction factor for H2O
CH2O = 1.62;
#Pressure correction factor for CO2
CCO2 = 1.12;
#From fig. 9.50
#Chnage in emissivity
deltaEpsilon = 0.014;
#Finally, the emissivity of the mixture can be obtained from Eq. (9.114):
print "Emissivity of the mixture is"
#Emissivity of the mixture
epsilonMix = CH2O*epsilonH2O+CCO2*epsilonCO2-deltaEpsilon
print round(epsilonMix,3)
```

In [11]:

```
print "Principles of Heat Transfer, 7th Ed. Frank Kreith et. al Chapter - 9 Example # 9.16 "
#Total pressure in atm
Pt = 2;
#Temperature in degree K
TH2O = 500.0;
#Mean beam length in m
L = 0.75;
#Partial pressure of water vapor in atm
PH2O = 0.4;
#Source temperature in degree K
Ts = 1000.0;
#Since nitrogen is transparent, the absorption in the mixture is due to the water vapor alone.
#Parameters required
#A Parameter in atm-m
A = PH2O*L;
#B Parameter in atm
B = (Pt+PH2O)/2.0;
#From Figs. 9.46 and 9.48 we find
#For water, C factor in SI units
CH2O = 1.4;
#Emissivity of water
epsilonH2O = 0.29;
#From Eq. (9.115) the absorptivity of H2O is
print "Absorptivity of H2O is"
alphaH2O = (CH2O*epsilonH2O)*((TH2O/Ts)**0.45)
print round(alphaH2O,2)
```

In [6]:

```
print "Principles of Heat Transfer, 7th Ed. Frank Kreith et. al Chapter - 9 Example # 9.17 "
#Temperature of flue gas in degree F
Tgas = 2000.0;
#Inner-wall surface temperature in degree F
Tsurface = 1850.0;
#Partial pressure of water in atm
p = 0.05;
#Convection heat transfer coefficient in Btu/h ft2 F
h = 1.0;
#Length of square duct in ft
L = 2.0;
#Volume in ft3
V = L*L;
#Surface area in ft2
A = 4*L;
#The rate of heat flow from the gas to the wall by convection per unit
#length in Btu/h ft is
qc = (h*A)*(Tgas-Tsurface);
#Effective beam length in m
L = ((0.3058*3.4)*V)/A;
#Product of partial pressure and L
k = p*L;
#From Fig. 9.46, for pL=0.026 and T=2000F, we find
#Emissivity
epsilon = 0.035;
#Absorptivity
alpha = 0.039;
#stefans constant
sigma = 0.171;
#Assuming that the brick surface is black, the net rate of heat flow from the gas to the wall by radiation is, according to Eq. (9.117)
qr = (sigma*A)*(epsilon*(((Tgas+460)/100.0)**4)-alpha*(((Tsurface+460.0)/100)**4));#Btu/h
print "Total heat flow from the gas to the duct in Btu/h"
#Total heat flow from the gas to the duct in Btu/h
q = qc+qr
print round(q,2)
# The answer is slightly different in textbook due to approximation
```

In [4]:

```
print "Principles of Heat Transfer, 7th Ed. Frank Kreith et. al Chapter - 9 Example # 9.18 "
#Emissivity
epsilon = 0.8;
#Stefan's constant
sigma = 0.1714;
#Temperature of walls in degree F
Twall = 440;
#Temperature indicated ny thermocouple in degree F
Tt = 940;
#Heat transfer coefficient in Btu/h ft2 F
h = 25;
#The temperature of the thermocouple is below the gas temperature because the couple loses heat by radiation to the wall.
#Under steady-state conditions the rate of heat flow by radiation from the thermocouple junction to the wall equals the rate of heat flow by convection from the gas to the couple.
#Umath.sing this heat balance, q/A in Btu/h ft2
q = (epsilon*sigma)*(((Tt+460)/100)**4-((Twall+460)/100)**4);
print "True gas temperature in degree F"
#True gas temperature in degree F
Tg = Tt+q/h
print round(Tg)
# The answer is slightly different in textbook due to approximation
```

In [2]:

```
print "Principles of Heat Transfer, 7th Ed. Frank Kreith et. al Chapter - 9 Example # 9.19 "
#Emissivity of thermocouple
epsilonT = 0.8;
#Emissivity of shield
epsilonS = 0.3;
#Stefan''s constant
sigma = 0.1714;
#Temperature of walls in degree F
Tw = 440;
#Temperature indicated ny thermocouple in degree F
Tt = 940.0;
#Heat transfer coefficient of thermocouple in Btu/h ft2 F
hrt = 25.0;
#Heat transfer coefficient of shield in Btu/h ft2 F
hrs = 20.0;
#Area for thermocouple be unity ft2
At = 1.0;
#Corresponding area of shield in ft2
As = 4.0;#Inside dia=4*dia of thermocouple
#From Eq. (9.76)
#View factors Fts and Fsw
Fts = 1/((1-epsilonT)/(At*epsilonT)+1/At+(1-epsilonS)/(As*epsilonS));
Fsw = As*epsilonS;
#Assuming a shield temperature of 900°F, we have, according to Eq. (9.118)
#Temperature in degree F
Ts = 923;
#Coeffcients for heat balance are as following
#A parameter Btu/h-F
A = 9.85;#A=hrt*At
#B parameter Btu/h-F
B = 13.7;#B=hrs*As
#Umath.sing heat balance
print "Correct temperature of gas in degree F"
#Correct temperature of gas in degree F
Tg = Ts+(B*(Ts-Tw)-A*(Tt-Ts))/((hrs*2)*As)
print round(Tg,2)
# The answer is slightly different in textbook due to approximation
```