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)
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)
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"
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)
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)
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)
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
manometer_reading=0.9; #m of water
delta_H=manometer_reading*(density_water-density_oil)/density_oil;
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)
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)
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)