# Chapter 8 : Measuring Devices¶

### example 8.4 page number 336¶

In [1]:
import math

pressure_difference = 3.4          #in mm water
pressure = 1.0133*10**5            #in pa
temperatue = 293.        #in K
mass_of_air = 29.       #in Kg

density_air = pressure/(temperatue*8314)*mass_of_air      #in kg/m3
print "Density of air = %f kg/cu m"%(density_air)

delta_p = pressure_difference*9.8           #in pascal, acceleration due to gravity, g=9.8
Height=4
density_difference = delta_p/(9.8*Height);
print "Density difference = %f kg/cu m"%(density_difference)

density_mixture= density_air-density_difference;      #in kg/m3
print "Density of mixture = %f kg/cu m"%(density_mixture)

Density of air = 1.206309 kg/cu m
Density difference = 0.850000 kg/cu m
Density of mixture = 0.356309 kg/cu m


### example 8.5 page number 341¶

In [2]:
import math

diameter=0.6;     #in m
disk_distance=1.25*10**-3;    #in m
speed=5.;      #revolutions/min
torque=11.5;  #in Joules

viscosity=(2*disk_distance*torque)/(3.14*(10*3.14)*(diameter/2)**4);

print "viscosity = %f Pa-s"%(viscosity)

viscosity = 0.035999 Pa-s


### example 8.6 page number 342¶

In [3]:
import math
diameter =10.;               #in mm
density_of_solution = 1750.;     #in kg/m3
density_of_air = 1.2;           #in kg/m3
velocity = 0.9;          #in mm/s

viscosity = (density_of_solution-density_of_air)*9.8*(diameter*10**-3)**2/(18*velocity*10**-3);         #expression for finding viscosity

print "viscosity of solution = %f Pa-s"%(viscosity)

v=(0.2*viscosity)/(density_of_solution*diameter*10**-3);
if v>0.9 :
print "system follows stokes law"

viscosity of solution = 105.791605 Pa-s
system follows stokes law


### example 8.7 page number 367¶

In [4]:
import math

density_of_water = 1000.;     #in kg/m3
viscosity = 1*10.**-3;         #in Pa-s
pipe_diameter = 250.;         #in mm
orifice_diameter = 50.;       # in mm
density_of_mercury = 13600.;  # in mm
manometer_height = 242.;      #in mm

height_water_equivalent = (density_of_mercury-density_of_water)*(manometer_height*10**-3)/(density_of_water)     #in m

Co = 0.61;
velocity = Co*(2*9.8*height_water_equivalent/(1-(orifice_diameter/pipe_diameter)**4))**0.5;     #in m/s

Re = (orifice_diameter*10**-3*velocity*density_of_water)/viscosity;
print "reynolds number = %f which is greater than 30000"%(Re)

if Re>30000:
print "velocity of water = %f m/s"%(velocity)

rate_of_flow = (3.14*(orifice_diameter*10.**-3)**2./4)*velocity*density_of_water;
print "rate of flow = %f litre/s"%(rate_of_flow)

reynolds number = 235976.385359 which is greater than 30000
velocity of water = 4.719528 m/s
rate of flow = 9.262073 litre/s


### example 8.8 page number 368¶

In [5]:
import math
pipe_diameter=0.15;          #in m
venturi_diameter=0.05;       #in m
pressure_drop=0.12;           #m of water
flow_rate=3.;                 #in kg/s
density = 1000.;              #in kg/m3
viscosity = 0.001            #in Pa-s

velocity = ((4./3.14)*flow_rate)/(venturi_diameter**2*density);
print "velociy = %f m/s"%(velocity)

Cv=velocity*((1-(venturi_diameter/pipe_diameter)**4)/(2*9.8*pressure_drop))**0.5;
print "coefficient of discharge = %f"%(Cv)

Re = velocity*(venturi_diameter/pipe_diameter)**2*pipe_diameter*density/viscosity;
print "reynolds No = %f"%(Re)

velociy = 1.528662 m/s
coefficient of discharge = 0.990593
reynolds No = 25477.707006


### example 8.9 page number 369¶

In [6]:
import math
h1=0.66;       #in m
h2=0.203;      #in m
h3=0.305      #in m
density=1000.;  #in kg/m3
pB=68900.;      #in Pa
s1=0.83;
s2=13.6;

print ("part 1")
pA=pB+(h2*s2-(h1-h3)*s1)*density*9.81;    #in Pa
print "pressure at A = %f Pa"%(pA)

print ("part 2")
pA1=137800.      #in Pa
pressure=735.   #mm Hg
pB1=pA1-(h2*s2-(h1-h3)*s1)*density*9.81;
pressure_B=(pB1-pressure*133.3)/9810.;        #m of water
print "pressure at B = %f m of water"%(pressure_B)

part 1
pressure at A = 93092.931500 Pa
part 2
pressure at B = 1.593432 m of water


### example 8.10 page number 370¶

In [7]:
import math
density_oil=900.;       #in kg/m3
viscosity_oil=38.8*10**-3;    #in Pa-s
density_water = 1000.;       #in kg/m3
diameter=0.102              #in m

print "manometer reading as m of oil = %f m"%(delta_H)

maximum_velocity=(2*9.8*delta_H)**0.5;
print "maximum_velocityVmax) = %f m/s"%(maximum_velocity)

Re=diameter*maximum_velocity*density_oil/viscosity_oil;
print "if Re<4000 then v=0.5*Vmax Re = %f"%(Re)
if Re<4000 :
velocity=maximum_velocity*0.5;

print "velocity = %f m/s"%(velocity)

flow_rate=(3.14/4)*diameter**2*velocity*1000;
print "flow rate =%f litre/s"%(flow_rate)

manometer reading as m of oil = 0.100000 m
maximum_velocityVmax) = 1.400000 m/s
if Re<4000 then v=0.5*Vmax Re = 3312.371134
velocity = 0.700000 m/s
flow rate =5.716998 litre/s


### example 8.11 page number 372¶

In [8]:
import math
flow_rate_steel=1.2;     #l/s
density_steel=7.92;
density_kerosene=0.82;
density_water=1;

flow_rate_kerosene =(((density_steel-density_kerosene)/density_kerosene)/((density_steel-density_water)/density_water))**0.5*flow_rate_steel

print "maximum_flow rate of kerosene = %f litre/s"%(flow_rate_kerosene)

maximum_flow rate of kerosene = 1.342303 litre/s


### example 8.12 page number 373¶

In [9]:
from scipy.optimize import fsolve
import math
initial_CO2 = 0.02;       #weight fraction
flow_rate_CO2 = 22.5;     #gm/s
final_CO2=0.031;          #weight fraction

def f(x):
return initial_CO2*x+0.0225 - 0.031*(x+0.0225)

flow_rate_flue_gas=fsolve(f,0)

print "flow rate of flue gas = %f kg/s"%(flow_rate_flue_gas)

flow rate of flue gas = 1.982045 kg/s

In [ ]: