import math
#variable initialisation
V1=11 #Velocity in m/s
r=0.075 #radius in m
Ry=400 #total load in N
rho=800 #oil density in kg/m^3
g=9.81 #gravity
#Calculation
A1=(math.pi/4)*(r**2)
Q=A1*V1
#since the jet is issuing into atmosphere p1=p2=0
#h=equilibrium height of the plane above 1,V2=velocity of the plate just before impact
#Ry=rho*Q*V1**2
h=(((Ry/(rho*Q))**2)-(V1**2))/(-(2*g))
print "The equilibrium height of the plate is",round(h,3),"m"
import math
#variable initialisation
Q=0.06 #discharge in m^3/s
D1=15 #Diameter 1 in cm
D2=5 #Diameter 2 in cm
ga=9.79 #unit length of water in kN/m^3
g=9.81 #gravity
rho= 998 #relative density
#Calculation
A2=((math.pi)/4)*((D2/100)**2)
V2=Q/A2
V1=V2*((D2/D1)**2)
#By applying Bernoullis equation to sections 1 and 2,by assuming the bend to be in the horizontal plane,
p1=round(((((V2**2)/(2*g))-((V1**2)/(2*g)))*ga),1)
#By momentum equation in the x-direction,
A1=((math.pi)/4)*((D1/100)**2)
Rx=rho*Q*(V2-(-V1))+((p1*1000)*A1)
#The force exerted by the fluid on the pipe,and hence on the bolts in section1,is equal and opposite to Rx.
print "F=",int(Rx)," N and acts to the left,i.e. in the negative x-direction,as a pull (tension) on the joint."
import math
#variable initialisation
D1=0.5 #diameter in m
D2=0.25 #diameter in m
ga=9.79 #unit length of water in kN/m^3
g=9.81 #gravity
p1=15.0 #pressure at section 1 in kPa
h=2 #height in m
rho=0.998 #relative density
Q=0.5 #discharge in m
#Calculation
A1=(math.pi/4)*(D1**2)
A2=(math.pi/4)*(D2**2)
V1=D1/A1 #Velocities at section 1 and 2
print "(i)V1=",round(V1,3),"m/s"
V2=D1/A2
print "V2=",round(V2,3),"m/s"
#By applying Bernoullis theorem to sections 1 and 2,
p2=(((p1/ga)+(V1**2)/(2*g))-(h+(V2**2)/(2*g)))*ga #Calculating pressure at section 2
print "(ii)P2=",round(p2,3),"kPa(guage)"
#Now,consider a control volume.
r1=D1/2
r2=D2/2
#weight of water in the control volume which is in the shape of frustum of cone
W=round((ga*(math.pi/3))*(h*((r1**2)+(r1*r2)+(r2**2))),3)
#Applying linear momentum equation in the vertical direction to cv
#reaction force on the water in the control volume
Ry=round((rho*Q*(V2-V1))-(-W+(p1*A1)+(-p2*A2)),3)
#F=Net force on the nozzle walls is equal and opposite to Ry
print "(iii)F=",Ry,"kN acting vertically downwards"
#variable initialisation
A1=0.01 #Area of cross section 1 in m^2
V1=20 #velocity1 in m/s
V2=10 #velocity2 in m/s
A2=0.02 #Area of cross section 2 in m^2
rho=1000 #density of water in kg/m^3
#Calculation
Q1=V1*A1
Q2=V2*(A2-A1)
Q=Q1+Q2 #total flow
V3=Q/A2 #velocity 3
#By momentum equation in the x-direction:
#p1*A2-p2*A2=Mout-Min
#let us take (p1-p2) as a
a=(-(rho*((Q*V3)-(Q1*V1)-(Q2*V2)))/A2)
print "(p2-p1)=",round(a/1000,0),"kPa"
import math
#variable initialisation
D=1 #diameter in cm
Q=2500 #discharge in cm^3/s
r=0.30 #radius in m
#Calculation
a=round((math.pi/4)*(D**2),4)
print "answer calculated in this book for V2 is wrong.It should be as follows,"
V2=(Q/(2*a))/100
print "V2=",round(V2,2),"m/s" #relative velocity of jet
#T=-rho*Q*r(U2-V2) #Torque
omega=V2/r #angular velocity
print "omega",round(omega,2),"rad./s"
N=(omega/(2*math.pi))*60 #Speed of rotation per minute,
print "N=",round(N,1),"rpm"
import math
#variable initialisation
rho=998 #relative density of water in kg/m^3
Q=2.5 #discharge in L/s
D=1 #diameter in cm
r=0.30 #radius in cm
#calculation
a=round((math.pi/4)*(D**2),4)
print "answer calculated in this book for V2 is wrong.It should be as follows,"
V2=((Q*1000)/(2*a))/100
print "V2=",round(V2,2),"m/s" #relative velocity of jet
To=rho*Q*r*V2 #when the sprinkler is stationary
print "Torque To=",round((To)/1000,2),"N.m"
import math
#variable initialisation
Q=1.5 #discharge in L/s
A=0.8 #area in cm^2
V2=9.375 #relative velocity in m/s
V3=9.375 #relative velocity in m/s
r3=0.4 #radius in cm
r2=0.3 #radius in cm
rho=998 #density of water in kg/m^3
#calculation
Qn=Q/2
V=(Q*1000)/(A*2)
#absolute velocity,V2=v2+omega*r2
#V3=v3-omega-omega*r3
#r2V2=r3V3,for zero frictional resistance
omega=(r3*V2-r2*V2)/(r3*r3+r2*r2)
N=(omega*60)/(math.pi*2)
print "(i)Torque on the arm"
print "N=",round(N,2),"rpm"
To=(-rho*Qn*(-r3*V3+r2*V2))/1000
print "(ii)When the arm is stationary"
print "To=",round(To,3),"N.m"