import math
#calculate Reynolds number and Maximum velocity and Volumetric flow rate and "Pressure gradient along the pipe
RD=0.83;
rho_w=1000.; ## density of water in kg/m^3
v=2.3; ## m/s
d=0.012; ## m
u=0.08; ## dynamic viscocity in kg/m/s
rho_oil=RD*rho_w;
Re=rho_oil*v*d/u;
print'%s %.1f %s'%("Reynolds number =",Re,"")
v_max=2*v;
print'%s %.1f %s'%("Maximum velocity =",v_max,"m/s^-1")
Q=math.pi/4*d**2*v;
print'%s %.2f %s'%("Volumetric flow rate =",Q,"m^3/s^-1")
p=-128.*Q*u/math.pi/d**4;
print'%s %.3f %s'%("Pressure gradient along the pipe = ",p,"Pa/m^-1")
import math
#calculate Rate at which oil must be supplied
c=0.001; ## m
p1=15*10**3; ## Pa
u=0.6; ## kg/m/s
R=6.; ## ratio of R2/R1
Q=math.pi*c**3*p1/(6*u*math.log(R));
print'%s %.8f %s'%("Rate at which oil must be supplied =",Q,"m^3/s")
#without round off error we cant get exact result
import math
#calculate "The load the pad will support and The rate at which oil must be supplied
F=6*10**3; ## Pa
b=0.12; ## m
f=F*b;
print'%s %.f %s'%("The load the pad will support =",f,"N/m")
dp=12*10**3; ## N/m^2
dx=0.12; ## m
c=0.00018; ## m
u=0.5; ## kg/m/s
V=5.; ## m/s
q=(dp/dx)*c**3/12./u + V*c/2.;
print'%s %.5f %s'%("The rate at which oil must be supplied =",q,"m^2/s")
import math
#calculate "Velocity of the dashpot
d_p=0.05; ## diameter of piston in m
d_c=0.0504; ## diameter of cylinder in m
SG=0.87;
rho_w=1000.; ## kg/m^3
v=10**-4; ## m^2/s
dp=1.4*10**6; ## Pa
l=0.13; ## m
c=(d_c-d_p)/2.; ## clearance
u=SG*rho_w*v; ## Dynamice viscocity
Vp=dp*c**3/(6.*u*l*(d_p/2.+c));
print'%s %.4f %s'%("Velocity of the dashpot =",Vp,"m/s")
import math
#calculate Dynamic viscosity and Kinematic viscosity and Reynolds number of sphere and Reynolds number
d=0.00475; ## m
g=9.81; ## m/s^2
rho_s=1151.; ## kg/m^3
rho=880.; ## kg/m^3
u=0.006; ## m/s
F=math.pi/6.*d**3*g*(rho_s-rho);
rat_d=0.25; ## ratio of d/D
rat_F=1.8; ## ratio of F/Fo
dynamic=F/(1.8*3*math.pi*u*d);
kinematic=dynamic/rho;
print'%s %.3f %s'%("Dynamic viscosity = ",dynamic,"kg/m/s")
print'%s %.5f %s'%("Kinematic viscosity =",kinematic,"m^2/s")
print("Reynolds number of sphere ")
Re=rho*u*d/dynamic;
print'%s %.3f %s'%("Reynolds number =",Re,"")
import math
#calculate viscosity of the liquid
D=0.120; ## m
h=0.08; ## m
c=0.001; ## m
t=0.01875; ## m
rev=65.; ## revolutions per min
T=4*10**-3; ## N.m
K1=math.pi*h/4./c;
K2=math.pi/32./t;
u=T/(rev*2*math.pi/60.)/(K1*D**3+K2*D**4);
print'%s %.4f %s'%("viscosity of the liquid =",u,"pa.s")
import math
#calculate Volumetric flow rate of oil and The load supported by the bearing
V=10.; ## m/s
h1=0.0005; ## m
h2=0.00025; ## m
L=0.1; ## m
b=0.1; ## m
RD=0.87;
u=2*10**-4; ## m^2/s
rho_w=1000.; ## kg/m^3
H=h1/h2;
Q=V/2*(1+H**2)/(1+H**3)*b*h1;
print'%s %.5f %s'%("Volumetric flow rate of oil =",Q,"m^3/s")
F=V/2.*(1.-(1.+H**2)/(1.+H**3))*12.*RD*rho_w*u/h1**2*L**2/4.*b;
print'%s %.1f %s'%("The load supported by the bearing =",F,"N")