In [7]:

```
from __future__ import division
import math
#Variables
D=0.001; #diameter of tube,m
T1=293; #temperature of cold water, K
T2=347; #temperature of hot water, K
T3=320; #operating temperature of hot water, K
Q=6000; #heat flux,W/m**2
v=0.2 ; #speed of water,m/s
k=0.6367; #thermal conductivity,W/(m*K)
#Calculations
v1=1.541*10**-7; # molecular diffusivity, m**2/s
v2=0.556*10**-6; #molecular diffusivity, m**2/s
Re=D*v/v2; #reynolds no.
L=D*(54-11/48*Q*D/k)*v*k/(4*Q*v1); #length that is down the tube for water reach to 74 C at its hottest point,m
#Results
print "Length that is down the tube for water reach to 74 C at its hottest point is :",round(L,3),"m ,while we did not evaluate the thermal entry length here, it may be shown to be much, much less than 1785 diametres.\n"
```

In [2]:

```
from __future__ import division
import math
#Variables
T1 = 300; # air temp.,K
T2=313; # final air temp.,K
v=2; # air velocity,m/s
D=0.01; # inner diameter of pipe,m
l=0.2; # length surrounded by heater
nu=16.4*10**-6; # Dynamic viscocity, m^2/s
Pr=0.711; # prandtl no.
Cp=1004; # Specific heat, J/kg.K
k=0.0266; # thermal conductivity ,W/(m.K)
#Calculations
Red=v*D/(nu); # reynolds no.
G=Red*Pr*D/l; # graetz no.
Q=1.159*Cp*v*(T2-T1)*(1/80); # power input, W/m**2
Tex=T2+Q*D/(5.05*k) # wall temp. at the exit,K
Tex1=Tex-273;
#Results
print "Power input is :",Q,"W/m^2\n"
print "Wall temp. at the exit is:",round(Tex1,3)," C\n"
```

In [10]:

```
from __future__ import division
import math
#Variables
m=21.5; #mass flow rate, kg/s
D=0.12; #diameter of pipe, m
T1=363; #pipe temperature,K
T2=323; #bulk temp. of fluid,K
a=977; #density, kg/m**3
Uw=3.1*10**-4; #wall side viscosity,N*s/m**2
Ub=5.38*10**-4; #bulk viscosity, N*s/m**2
Pr=2.47; #prandtl no.
nu=4.07*10**-7; #dynamic viscocity, m^2/s
k=0.661; #thermal conductivity ,W/(m.K)
#Calculations
rt=Ub/Uw; #Ration of bulk and wall side viscocities
u=m/(a*math.pi*(D/2)**2); #average velocity,m/s
Re=u*D/(nu); #reynolds no.
f=1/(1.82/2.303*math.log(Re)-1.64)**2; #formula for friction factor for smooth pipes
Nu=(f/8*Re*Pr)/(1.07+12.7*math.sqrt(f/8)*(Pr**(2/3)-1))*rt**0.11;#formula for nusselt no.in fully developed flow in smooth pipes
h=Nu*k/D # convective heat transfer coefficient,W/(m**2)/K
#corrected friction factor = friction factor at bulk temp.*K where K=(7-u1/u2)/6 for wall temp.>bulk temp.
f1=f*((7-rt)/6); #corrected friction factor
#Results
print "Correlation friction factor. is :",round(f1,4),"\n"
print "Convection heat transfer coefficient is :",round(h,1),"W/(m^2)/K \n"
```

In [18]:

```
from __future__ import division
import math
#Variables
m=21.5; #mass flow rate, kg/s
e=260*10**-6; #wall roughness,m
D=0.12; #diameter of pipe, m
T1=363; #pipe temperature,K
T2=323; #bulk temp. of fluid,K
a=977; #density, kg/m**3
Uw=3.1*10**-4; # wall side viscosity,N*s/m**2
Ub=5.38*10**-4; #bulk viscosity, N*s/m**2
Pr=2.47; #prandtl no.
k=0.661; #thermal conductivity ,W/(m.K)
#Calculations
u=m/(a*math.pi*(D/2)**2); #average velocity,m/s
Re=u*D/(4.07*10**-7); #reynolds no.
f=math.pow((1.8*math.log((6.9/Re+(e/D/3.7)**1.11),10)),-2);#friction factor from haaland equation.
Re1=Re*e/D*math.sqrt(f/8); #roughness reynols no.
Nu=(f/8)*Re*Pr/(1+math.sqrt(f/8)*(4.5*Re1**(0.2)*math.sqrt(Pr)-8.48));#correlation for local nusselt no.
h=Nu*k/D/1000; #convection heat transfer coefficient, kW/(m**2*K)
#Results
print "Correlation friction factor is :",round(f,6),"\n"
print "Convection heat transfer coefficient is :",round(h,1),"kw/(m^2*K)\n"
print "In this case wall roughness causes a factor of 1.8 increase in h and a factor of 2 increase in f and the pumping power.we have omitted the variable properties hre as they were developed for smooth walled pipes"," t in this case wall roughness causes a factor of 1.8 increase in h and a factor of 2 increase in f and the pumping power.we have omitted the variable properties hre as they were developed for smooth walled pipes."
```

In [19]:

```
from __future__ import division
import math
#Variables
T1 = 293; # air temp.,K
D=0.01; # inner diameter of pipe,m
v=0.7 # air velocity,m/s
T2=333; #pipe wall temp.,K
t=0.25; # distance down the stream
#Calculations
Re=v*D/(1.66*10**-5); # reynolds no.
# the flow is therefore laminar, to account for the thermal entry region, we compute the graetz no.
Gz=Re*(0.709)*D/t; # graetz no.
Nu=4.32 # nusselt no., Nu=3.657+(0.0668*Gz**(1/3)/(0.04+Gz**(-2/3)))
h=3.657*(0.0268)/D; # average convective heat transfer coefficient. W/(m**2*K)
a=1-math.exp((-h/(1.14*1007*v))*(4*t)/D); # (Tb-T1)/(T2-T1)=a (suppose)
Tb=a*(T2-T1)+T1; # temperature 0.25 m farther down stream.
Tb1=Tb-270.6;
#Results
print "Temperature 0.25 m farther down stream is :",round(Tb1,3)," C\n"
```

In [2]:

```
from __future__ import division
import math
#Variables
Tbin=290; #inlet bulk temp.,K
v=1; #speed of air, m/s
a=0.09; #area of steel,m**2
l=15; #length of duct running outdoors through awarm air,m
To=310; #temp. of warm air,K
h=5; #heat transfer coefficient due to natural convection and thermal radiation.
Dh=0.3; #hydraulic diameter,m
#Calculations
Re=v*Dh/(1.578*10**-5); #reynolds no.at Tbin
Pr=0.713; #prandtl no.
f=1/(1.82/2.303*math.log(Re)-1.64)**2; # formula for friction factor for smooth pipes
Nu=(f/8*Re*Pr)/(1.07+12.7*(f/8)**(0.5)*(Pr**(2/3)-1));#formula for nusselt no.in fully developed flow in smooth pipes
h=Nu*0.02623/Dh; # convective heat transfer coefficient,W/(m**2)/K
#the remaining problem is to find the bulk temperature change.the thin metal duct wall offers little thermal ressistance, but convection ressistance outside the duct must be considered.
U=(1/4.371+1/5)**-1; #U=1/Ain*(1/(h*A)in+1/(h*A)out)**-1
Tbout=(To-Tbin)*(1-math.exp(-U*4*l/(1.217*v*1007*Dh)))+Tbin;#outlet bulk temp., K
Tbt1=Tbout-273; #outlet bulk temp. in degree C
#Results
print "Outside bulk temp. change is :",round(Tbt1,3),"C\n"
```

In [1]:

```
from __future__ import division
import math
#Variables
D=0.0001; #diameter of heater,m
T1 = 293; #air temp.,K
T2=313; #heater temp.,K
p=17.8; #dissipating heat,W/m
#Calculations
h=p/(3.14*D*(T2-T1)); # average convective heat transfer coefficient. W/(m**2*K)
Nu=h*D/0.0264; #nusselt no., Nu=h*D/thermal conductivity
Pr=0.71; #prandtl no.
Re=((Nu-0.3)*(1+(0.4/Pr)**(2/3))**0.25/(0.62*Pr**(1/3)))**2;#reynolds no.
u=1.596*10**(-5)/(D)*Re+0.2; #air velocity, m/s
#Results
print "Air velocity is :",round(u,3),"m/s\n"
print "The data scatter in Red is quite small less than 10 percent, it would appear. therefore, this method can be used to measure local velocities with good accuracy.if the device is calliberated, its accuracy is improved further, such an air speed indicator is called a hot wire anemometer."
```