import math
import matplotlib.pyplot as plt
%matplotlib inline
#Variable Deceleration
V_dot_cfm=range(0,1500,250) #Volumetric Flow rate in cubic feet per second
V_dot_mps=transpose(V_dot_cfm)/2118.83 #Volumetric flow rate in m^/s
rho_air=1.184 #Density of air in kg/m^3
rho_water=998 #Density of water in kg/m^3
Patm=101.3 #Atmospheric Pressure in kPa
v=1.562*10**-5 #Kinematic Viscosity in m^2/s
D=0.23 #Diameter in m
g=9.81 #Acceleration due to gravity in m/s^2
f=0.0209 #Friction coefficient from table
L=13.4 #Length in m
V=6.81 #Velocity of flow in m/s
alpha=1.05 #Constant
C=(1/0.0254) #Conversion factor
#Minor Loss Coefficients
ml_1=1.3
ml_2=0.21
ml_3=1.8
#Calculations
Re=(4*V_dot_mps)/(v*pi*D) #Reynolds Number
#Friction coefficient values from Moddy Chart
f1=[0,0.023,0.022,0.0185,0.0175,0.0162]
f=transpose(f1)
#Cross Sectional Area
A=(pi*D**2)/4 #Area of the pipe cross section in m^2
V1=transpose(V_dot_mps)/A #Velocity array in m/s
V=transpose(V1) #Velocity in m/s
#Minor Losses
Kl=ml_1+(5*ml_2)+ml_3 #Minor losses
H_required=(alpha+(f*(L/D))+Kl)*(V**2/(2*g)) #Required net head in m of air
H_required_inches=H_required*(rho_air/rho_water)*C #Head Required in inches of water
H_av=[0.9,0.95,0.9,0.77,0.4,0] #Table values taken fro plotting
#Result
print "The Plot shows the variation of the head required and the head available as a function"
print "Of V_dot. The intersection point tells the operating point."
plt.plot(V_dot_cfm,H_required_inches,V_dot_cfm,H_av)
plt.ylabel('H,inches H2O')
plt.xlabel('V_dot,cfm')
plt.show()
import math
#Variable Decleration
rho=998 #Density in kg/m^3
g=9.81 #Acceleration due to gravity in m/s^2
V_dot=0.0233 #Volumetric flow rate in m^3/s
H_small=7.3 #Head in m
H_big=21.9 #Head in m
n_pump_small=0.7 #Efficiency of the pump in fraction small
n_pump_big=0.765 #Efficiency of pump in fraction big
#Calculations
bhp_small=(rho*g*V_dot*H)/n_pump_small #Required bhp in kW
#Similarly for 241.3mm impeller we get 6.53kW
bhp_big=(rho*g*V_dot*H_big)/n_pump_big
#Result
print "The required bhp is",round(bhp_small,2),"W"
print "The required bhp is",round(bhp_big,2),"W"
print "Clearly the small one is better as it uses less power"
import math
#Variable Decleration
n_dot=900 #Speed in rpm
V_closed=0.45 #Volume of motor oil in cm^3
n=0.5 #Number of rotations
#Calculations
V_dot=n_dot*(2*V_closed/n) #Volumetric Fow rate in cm^3/min
#Result
print "The volumetric Flow rate is",round(V_dot),"cm^3/min"
import math
#Variable Decleration
n_dot=1750 #Speed in rpm
w=183.3 #Angular Speed in rad/s
g=9.81 #Acceleration due to gravity in m/s^2
alpha1=0 #Angle in degrees
alpha2=40 #Angle in degrees
b1=0.052 #Inlet blade width in m
b2=0.023 #Outlet blade width in m
V_dot=0.13 #Volumetric Flow rate in m^3/s
rho_water=1000 #Density of water in kg/m^3
rho_air=1.2 #Density of air in kg/m^3
r1=0.04 #Inlet radius in m
r2=0.08 #Outlet radius in m
#Calcualtions
V1_n=V_dot/(2*pi*r1*b1) #Normal Component of Velocity in m/s
V1=V1_n #Since Vt is zero Velocity in m/s
V2_n=V_dot/(2*pi*r2*b2) #Normal Component of velocity in m/s
V2_t=V2_n*tan((alpha2*pi)/180) #Tangential Component of velocity in m/s
#Applying the Bernoullis principle
H=(w/g)*(r2*V2_t) #Net head in m
Hwater_column=H*(rho_air/rho_water)*1000 #Equivalent water column in mm of water
bhp=rho_air*g*V_dot*H #bhp required in W
#Result
print "The net Head produced is",round(Hwater_column),"mm of water"
print "The brake horsepower required is",round(bhp,1),"W"
import math
#Variable Decleration
r1=0.1 #Inlet Radius in m
r2=0.18 #Outlet radius in m
b1=0.05 #Inlet width in m
b2=0.03 #Outlet width in m
V_dot=0.25 #Volumetric Flow rate delivered in m^3/s
n=1720 #Speed of the impeller in rpm
rho=1226 #Density of the fluid in kg/m^3
g=9.81 #Acceleration due to gravity in m/s^2
H=14.5 #Head in m
#Calculations
#Required horse power
W_water_horsepower=rho*g*V_dot*H #Required Horse Power in W
W_dot_water_hp=W_water_horsepower/745.7 #Required Horse Power in hp
w=n*(2*pi/60) #Angular Speed in rad/s
beta1=(arctan((V_dot)/(2*pi*b1*w*r1**2)))*(180/pi) #Blade inlet angle in degrees
#Using elemetary analysis
V2_n=V_dot/(2*pi*r2*b2) #Normal Component of Velocity in m/s
V2_t=(g*H)/(w*r2) #Tangential Component of velocity in m/s
#Simplfying Calculation
a=w*r2-V2_t
beta2=arctan(V2_n/a)*(180/pi) #Angle in degrees
#Result
print "The angel beta1 is",round(beta1,2),"degrees"
print "The angle beta2 is",round(beta2,2),"degrees"
print "The horsepower required is",round(W_dot_water_hp,1),"hp"
import math
#Variable Decleration
D_propeller=0.34 #Overall Diameter of the propeller in m
alpha=14 #Angle of attack in degrees
n=1700 #Speed of the propeller in rpm
D_hub=0.055 #Diameter of the hub assembly in m
V=13.4 #Velocity of the plane in m/s
#Calculations
C=60/(2*pi) #Conversion factor
phi1=(arctan((V*C)/(n*D_hub*0.5)))*(180/pi) #Angle in degrees
theta1=alpha+phi1 #Pitch Angle at arbitrary radius in degrees
phi2=(arctan((V*C)/(n*D_propeller*0.5)))*(180/pi) #Angle in degrees
theta2=alpha+phi2 #Pitch angle at the tip in degrees
#Result
print "The pitch angle at any radius is",round(theta1,1),"degrees"
print "The pitch angle at the tip is",round(theta2,1),"degrees"
import math
#Variable Decleration
V_in=47.1 #Velocity at the inlet in m/s
beta_st=60 #trailing edge at Angle in degrees
n=1750 #Speed of the impeller in rpm
r=0.4 #Radius in m
#Calculations
V_st=V_in/cos((beta_st*pi)/180) #Velocity leaving the trail in m/s
u_theta=((n*2*pi)/60)*r #Tangential Velocity of rotor blades in m/s
beta_r1=(arctan((u_theta+V_in*tan((beta_st*pi)/180))/V_in))*(180/pi) #Angle of leading edge in degrees
beta_rt=(arctan(u_theta/V_in))*(180/pi) #Angle in degrees
#Result
print "The leading edge and trailing edge angles are",round(beta_r1,2),"degrees and",round(beta_rt,2),"degrees"
print "We select number like 13 15 and 17 rotor blades"
import math
#Variable Decleration
n=1170 #Speed of the pump in rpm
H=23.5 #Required head in ft
V_dot=320 #Gasoline pumped gallon/minute
Ratio=3.658*10**-4 #Nsp/Nsp_US ratio
#Calcualtions
Nsp_US=(n*V_dot**0.5)/(H**0.75) #Pump specific speed in US units
Nsp=Nsp_US*(Ratio) #Normalizes pump specific speed
#Result
print "The Nsp_US value is",round(Nsp_US,2),"and Nsp value is",round(Nsp,3),"which tells"
print "A centrifugal Pump is the best suitable one"
import math
#Variable Decleration
wa=1 #Setting as unit speed
#Calculations
wb=2*wa #Speed
bhp_ratio=(wb/wa)**3 #Ratio od required shaft power
#Result
print "The ratio of required shaft power is",round(bhp_ratio)
import math
import matplotlib.pyplot as plt
%matplotlib inline
#Variable Decleration
D_A=0.06 #Diameter of pump A in m
n_A=1725 #Operating Speed in rpm
w_A=180.6 #Operating Angular Speed in rad/s
V_B_dot=2.4*10**-3 #Volumetric Flow rate in m^3/s
V_A_dot=5*10**-4 #Volumetric Flow rate in m^3/s
H_A=1.5 #Head in m
rho_water=998 #Density of water in kg/m^3
g=9.81 #Acceleration due to gravity in m/s^2
n_pump_A=0.81 #Efficiency of pump A in fraction
H_B=4.5 #Head in m
rho_B=1226 #Density of fluid in kg/m^3
#Calculations
#Part(a)
bhp_A=(rho_water*g*V_A_dot*H_A)/n_pump_A #Required Power in W
C_Q=V_A_dot/(w_A*D_A**3) #Capacity Coefficient
C_H=(g*H_A)/(w_A**2*D_A**2) #Head Coefficient
C_P=bhp_A/(rho_water*w_A**3*D_A**5) #Power Coefficient
#Plotting
V_dot1=range(100,800,100) #Volumetric flow rate in cm^3/s
H1=[180,185,175,170,150,95,54] #Head in cm
n_pump1=[32,54,70,79,81,66,38] #Efficiency of the pump in percentage
#BHP calculations
V_dot=transpose(V_dot1)
H=transpose(H1)
n_pump=transpose(n_pump1)
bhp_A1=rho_water*g*V_dot
bhp_A2=bhp_A1*H
bhp_A=bhp_A2/n_pump
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(V_dot1,bhp_A)
plt.xlabel('V_dot,cm^3/s')
plt.ylabel('H,cm and n in %')
ax2 = ax.twinx()
ax2.plot(V_dot1,H1,V_dot1,n_pump1)
plt.ylabel('bhp,W')
ax.grid()
plt.show()
#Curve Fitted Data Yields
CQ_star=0.0112
CH_star=0.133
CP_star=0.00184
npump_star=0.812
#Part(b)
Db=((V_B_dot**2*CH_star)/(CQ_star**2*g*H_B))**0.25 #Design Diameter of pump B in m
w_B=V_B_dot/(CQ_star*Db**3) #Angular speed at B in rad/s
bhp_B=CP_star*rho_B*w_B**3*Db**5 #Required brake horse power in W
#Result
print "The required diameter of Pump is",round(Db,3),"m"
print "The required rotational speed is",round(w_B),"rad/s"
print "The required Brake Horse Power is",round(bhp_B),"W"
#Note: The graph might seem incorrect at the first sight. Check the scale of the plot.
import math
#Variable Decleration
rho=998 #Density of fluid in kg/m^3
g=9.81 #Acceleration due to gravity in m/s^2
V_dot=12.8 #Volumetric Flow rate in m^3/s
H_gross=325 #Gross Head in m
C=10**-6 #Conversion Factor
n_turbine=0.952 #Efficiency of turbine in fraction
n_generator=0.945 #Efficiency of generator in fraction
n_other=1-0.035 #Other efficieny in fraction
no=12 #Number of Turbines
#Calculations
W_dot=rho*g*V_dot*H_gross*C #Ideal Power produced in MW
W_electrical_dot=W_dot*n_turbine*n_other*n_generator #Actual Electric Power in mW
W_total=no*W_electrical_dot #Total Power produced in MW
#Result
print "The electrical power generated is",round(W_total),"MW"
#The answer differs due to decimal point accuracy
#Answer in the text has been rounded off and multiplied hence the inconsistency
import math
#Variable Decleration
r2=2.5 #Inlet Radius in m
r1=1.77 #Outlet raius in m
b2=0.914 #Runner blade width at inlet in m
b1=2.62 #Runner blade width at outlet in m
n_dot=120 #Speed in rpm
w=12.57 #Rad/s
alpha1=10 #Angle in degrees
alpha2=33 #turning of flow in degrees
V_dot=599 #Volumetric Flow rate in m^3/s
H_gross=92.4 #Gross Head in m
C=10**-6 #Conversion Factor
g=9.81 #Acceleration due to gravity in m/s^2
#Calculations
#Part(a)
#Runner Inlet
V2_n=V_dot/(2*pi*r2*b2) #Normal Component of velocity in m/s
V2_t=V2_n*tan((alpha2*pi)/180) #Tangential Component in m/s
beta2=(arctan(V2_n/(w*r2-V2_t)))*(180/pi) #Runner leading edge angle in degrees
#Runner Outlet
V1_n=V_dot/(2*pi*r1*b1) #Normal Component of velocity in m/s
V1_t=V1_n*tan((alpha1*pi)/180) #Tangential Component in m/s
beta1=(arctan(V1_n/(w*r1-V1_t)))*(180/pi) #Runner leading edge angle in degrees
#Using Euler Turbomachine Equation
W_shaft=rho*w*V_dot*(r2*V2_t-r1*V1_t)*C #Shaft output power in MW
H=W_shaft/(rho*g*V_dot*C) #Net Head in m
#Part(b)
#Similiary repeat calculations for part(b) and part(c)
#Result
#Results are for only part a
print "The inlet runner blade angle is",round(beta2,1),"degrees"
print "The outlet runner blade angle is",round(beta1,1),"degrees"
print "The output power is",round(W_shaft),"MW"
print "The net head required is",round(H,1),"m"
import math
#Variable Decleration
Cp=0.4 #Power Coefficient
n_gearbox=0.85 #Efficiency in fraction
rho=1.204 #Density of air in kg/m^3
V=10 #Velocity of flow in m/s
D=12.5 #Diameter in m
#Calculations
W_dot_op=(n_gearbox*Cp*pi*rho*V**3*D**2)/8 #Work done in W
#Result
print "Electric Power produced is",round(W_dot_op),"W"
import math
#Variable Decleration
D_A=2.05 #Diameter in m
n_A=120 #Speed in rpm
w_A=12.57 #Angular Speed in rad/s
V_A_dot=350 #Volumetric Flwo rate in m^3/s
H_A=7.5 #Head of water in m*10
H_B=10.4 #Head of water in m*10
bhp_A=242 #Brake Horse Power at A in MW
n_turbine_A=0.942 #Efficiency of turbine A
rho_A=998 #Density of water in kg/m^3
#Calculations
a=H_B/H_A
rho_B=rho_A #Density in kg/m^3
n_B=n_A #Speed at b in rpm
D_B=D_A*(a**0.5) #Diameter of the new pump in m
V_B_dot=V_A_dot*(n_B/n_A)*((D_B/D_A)**3) #Volumetric Flow rate at B in m^3/s
bhp_B=bhp_A*(rho_B/rho_A)*((n_B/n_A)**3)*((D_B/D_A)**5) #Brake Horse Power in MW
n_turbine=1-(1-n_turbine_A)*((D_A/D_B)**0.2) #Efficiency correction in fraction
#Result
print "The brake horse power is",round(bhp_B),"MW"
print "The diameter of the new turbine is",round(D_B,2),"m"
print "The volumetric Flow rate is",round(V_B_dot),"m^3/s"
print "The corrected efficiency is",round(n_turbine,3)
import math
#Variable Decleration
w_A=12.57 #Angular Speed in rad/s
rho_A=998 #Density of fluid in kg/m^3
g=9.81 #Acceleration due to gravity in m/s^2
H_A=75 #Head in m
bhp_A=242*10**6 #Brake Horse Power at A in W
H_B=104 #Head in m
bhp_B=548 *10**6 #Brake Horse Power at B in W
#Calculations
#For Turbine A
Nst_A=(w_A*bhp_A**0.5)/(rho_A**0.5*g**1.25*H_A**1.25) #Dimensionless specific speed at A
#For turbine B
w_B=w_A #Angular Speed in rad/s
rho_B=rho_A #Density of fluid in kg/m^3
Nst_B=(w_B*bhp_B**0.5)/(rho_B**0.5*g**1.25*H_B**1.25) #Dimensionless specific speed at B
Nst_US_A=43.46*Nst_B #Turbine specific speed in US units
#Result
print "The Turbine Specific Speed in US units is",round(Nst_US_A,1)