#initialisation of variables
a1=12.56 #Area(in^2)
s1=24 #stroke(in^3)
a2=3.14 #Area(in^2) displacement of ram
s2=24 #stroke in^3
Ve=0.785 #Extension volume in^3
#CALCULATIONS
Ve=a1*s1 #extension volume
Vs=a2*s2
Vr=Ve-Vs #Retraction volume
Vt=Ve+Vr #Total volume
#RESULTS
print('Displacement of the cylinder would be = %.2f in^3' %Vt)
#initialisation of variables
A=0.785 #area
Q=100 #gal/min flow rate
D=1 #in diameter
v=0.05 #viscocity Newts
#CALCULATIONS
V=Q/(A*3.12) #velocity
Nr=(12*V*D)/v #reynolds number
#RESULTS
print('The velocity would be = %.2f lbf-ft' %V)
print('The Reynolds number would be = %.2f Hence the flow is turbulent' %Nr)
#initialisation of variables
Nr=4000 #reynolds number
Nr2=2000 #reynolds number
m=0.27 #P viscocity
D=2.54 #cm diameter
p=0.85 #pressure gm/cm^3
m2=27 #cP viscocity
D2=1 #in diameter
#CALCULATIONS
V=(Nr*m)/(D*p) #velocity
# for lower critical velocity
V2=(Nr2*m)/(D*p)
v=m2/p
vn=0.001552*v
vh=(Nr*vn)/(12*D2)
vl=(Nr2*vn)/(12*D2)
#RESULTS
print('The velocity would be = %.2f cm/sec' %V)
print('The lower velocity would be = %.2f cm/sec' %V2)
print('Using reynolds formula the velocity would be = %.2f ft/sec' %vh)
print('Using reynolds formula the lower velocity would be = %.2f ft/sec' %vl)