from __future__ import division
import math
#Initializing the variables
l = 60 ; #Length of pipeline
rho = 1000; # Density of liquid
a = 0.02; #Acceleration of fluid
#Calculations
delP = rho*l*a; #Change in pressure
print "Increase of pressure difference required (kN/m2):",delP/1000
from __future__ import division
import math
#Initializing the variables
v = 5; #Velocity of jet
rho = 1000; #density of water
d = 0.025; #Diameter of fixed nozzle
#Calculations
#--Part(a) Variation of force exerted normal to the plate with plate angle--//
header = "Theta\t vcos(x)\t pAv\t Force"
unit = "deg\t m/s\t kg/s\t N"
A = math.pi*d**2/4;
x = range(0,91,15);
for c in range(len(x)):
x[c]=1.0*x[c]
m = round(rho*A*v,2);
ma = [m,m,m,m,m,m,m];
vcomp=[]
force=[]
for c in x:
vcomp.append(round(v*math.cos(math.radians(c)),2))
force.append(round((rho*A*v**2)*math.cos(math.radians(c)),2))
print header
print unit
for c in range(len(x)):
mm=str(x[c])+' \t '+str(vcomp[c])+' \t'+str(ma[c])+' \t'+str(force[c])
print mm
##value = [x,vcomp,ma,force]
##print value,unit, header
#--Part(b) Variation of force exerted normal to the plate with plate velocity--//
header ="Theta\t v\t u\t v-u\t pA(v-u)\t Force\t"
unit ="deg\t m/s\t m/s\t m/s\t kg/s\t N\t"
x = [0,0,0,0,0]
v = [5,5,5,5,5]
u = range(2,-3,-1);
D=[]
Prod=[]
Force=[]
for c in range(5):
D.append(v[c]-u[c])
Prod.append(round((rho*A*D[c]),2))
Force.append(round((rho*A*D[c]**2),2))
print '\n',"(b)","\n",header
print unit
for c in range(len(x)):
mm=str(x[c])+' \t '+str(v[c])+' \t '+str(u[c])+' \t '+str(D[c])+' \t '+str(Prod[c])+' \t '+str(Force[c])
print mm
from __future__ import division
import math
#Initializing the variables
x = 60; #Angle of deflection theta
rho = 1000; # Density of liquid
V1 = 30; #Acceleration of fluid
V2 = 25;
m = .8; #Discharge through A
#Calculations
def Reaction(Vin , Vout):
R = m*(Vin -Vout) ;
return R
Rx = Reaction(V1,V2*math.cos(math.radians(x)));
Ry = -Reaction(0,V2*math.sin(math.radians(x)));
print "Reaction in X-direction (N) :",Rx
print "Reaction in Y-direction (N) :",round(Ry,2)
print "Net Reaction (N) :",round((Rx**2 +Ry**2)**0.5,2)
print "Inclination of Resultant Force with x-direction (Degrees):",round(180/math.pi*math.atan(Ry/Rx),2)
from __future__ import division
import math
#Initializing the variables
v1 = 36 ; #Exit velocity
u = 15; #Velocity of vane\
x = 30; # Angle between vanes and flow
rho = 1000; # Density of water
d = .1; # Diameter of jet
#Calculations
alp = (180/math.pi)*math.atan((v1*math.sin(math.radians(x))/(v1*math.cos(math.radians(x))-u)));
v2 = 0.85*v1*math.sin(math.radians(x));
bta = (180/math.pi)*math.acos((u*math.sin(math.radians(alp))/v2));
m = (rho*math.pi*v1*d**2)/4;
Vin = v1*math.cos(math.radians(x));
Vout = v2*math.cos(math.radians(90));
Rx = m*(Vin-Vout);
print "Inlet Angle (Degrees) :", round(alp,2)
print "Outlet Angle (Degrees) :", round(bta,2)
print "Force exerted by vanes (N) :", round(Rx)
from __future__ import division
import math
#Initializing the variables
rho = 850 ; # Density of liquid
a = 0.02 #Acceleration of fluid
x = 45 ;
d1 = .5 ;
d2 = .25;
p1 = 40*10**3;
p2 = 23*10**3;
Q = .45;
#Calculations
A1 = (math.pi*d1**2)/4;
A2 = (math.pi*d2**2)/4;
v1 = Q/A1;
v2 = Q/A2;
Rx = p1*A1 - p2*A2*math.cos(math.radians(x)) - rho*Q*(v2*math.cos(math.radians(x))-v1);
Ry = p2*A2*math.sin(math.radians(x)) + rho*Q*v2*math.sin(math.radians(x));
print "Resultant force on the bend (kN) :",round((Rx**2 +Ry**2)**0.5/1000,3)
print "Inclination of Resultant Force with x-direction (Degrees):",round(math.atan(Ry/Rx)*180/math.pi)
from __future__ import division
import math
#Initializing the variables
v = 4.9; #Velocity of Jet
rho = 1000; # Density of water
d = 0.05;
u = 1.2 # Velocity of tank
#Calculations
Vout = v;
Vin = 0;
m = rho*math.pi*d**2*v/4;
R = m*(Vout-Vin);
print "Reaction of jet on tank (N) :",round(R,2)
print "Work done per second (W) :",round(R*u,2)
from __future__ import division
import math
from scipy import integrate
#Initializing the variables
Vj = 5*10**6; # Velocity of Jet
Mr = 150000; # Mass of Rocket
Mf0 = 300000; # Mass of initial fuel
Vr = 3000; # Velocity of jet relative to rocket
g = 9.81; # Acceleration due to gravity
#Calculations
m = Vj/Vr; #Rate of fuel consumption
T = Mf0/m; # Burning time
def f(t,m,Vr,Mr,Mf0,g):
return m*Vr /(Mr + Mf0 - m*t) - g;
args = (5000/3,3000,150000,300000,9.81)
Vt = integrate.quad(f, 0.0, 180, args)
def h(t,Vr,g):
return -g*t - Vr*math.log(1 - t/269.95);
args = (3000,9.81)
Z1 = integrate.quad(h, 0.0, 180, args)
Z2 = Vt[0]**2/(2*g);
print "(a)Burning time (s) :",T
print "(b)Speed of rocket when all fuel is burned (m/s):",round(Vt[0],2)
print "(c)Maximum height reached (km) :",round((Z2+Z1[0])/1000,1)
from __future__ import division
import math
#Initializing the variables
V = 200; #Velocity in still air
Vr = 700; #velocity of gas relative to engine
mf = 1.1; # Fuel Consumption
r = 1/40 ;
P1 =0;
P2 = 0;
#Calculations
m1 = mf/r;
T = m1*((1+r)*Vr -V);
print "(a)Thrust (kN) :",T/1000
W = T*V;
print "(b)Work done per second (kW) :",W/1000
Loss = 0.5*m1*(1+r)*(Vr-V)**2;
print "(c)Efficiency (%) :",round(W/(W+Loss)*100,1)
from __future__ import division
import math
#Initializing the variables
rho = 1000; # Density of water
Q = 10; #Acceleration of fluid
r2 = 1.6;
r1 = 1.2;
V1 = 2.3;
V2 = 0.2;
rot = 240;
#Calculations
Tf = rho*Q*(V2*r2 - V1*r1);
T = -Tf;
n = rot / 60;
P = 2*round(math.pi,3)*n*T;
print "Torque exerted by fluid (N.m):",T
print "Theoretical power output (kW) :",round(P/1000,2)