Chapter 6: The Energy Equation and its Applications

Example 6.1, Page 170

In [1]:
from __future__ import division
import math


 #Initializing  the  variables  
Pc  =  0;                                                                  #  Atmospheric  Pressure
Z3  =  30+2;                                                            #height  of  nozzle
Ep  =  50  ;                                                              #Energy  per  unit  weight  supplied  by  pump
d1  =  0.150;                                                          #Diameter  of  sump
d2  =  0.100;                                                          #Diameter  of  delivery  pipe
d3  =  0.075  ;                                                        #Diameter  of  nozzle
g  =  9.81;                                                              #  Acceleration  due  to  gravity
Z2  =  2;                                                                  #Height  of  pump
rho  =  1000;                                                          #  Density  of  water

 #Calculations
U3  = (2*g*(Ep-Z3)/(1+5*(d3/d1)**4  +  12*(d3/d2)**4))**0.5;
U1  =  U3/4;
Pb  =  rho*g*Z2  +  3*rho*U1**2;
print "Velocity of Jet through nozzle (m/s) :",round(U3,3)
print "Pressure in the suction pipe at the inlet to the pump at B (kN/m^2) :",round(Pb/1000,3)     
Velocity of Jet through nozzle (m/s) : 8.314
Pressure in the suction pipe at the inlet to the pump at B (kN/m^2) : 32.58

Example 6.2, Page 183

In [2]:
from __future__ import division
import math

 #Initializing  the  variables  
x  =  45;                                                                  #  Inclination  of  pipe
l  =  2;                                                                    #Length  of  pipe  under  consideration
Ep  =  50  ;                                                              #Energy  per  unit  weight  supplied  by  pump
d1  =  0.2;                                                              #Diameter  of  sump
d2  =  0.1;                                                              #Diameter  of  delivery  pipe
g  =  9.81;                                                              #  Acceleration  due  to  gravity
rho  =  1000;                                                          #  Density  of  water
V1  =  2;
RD_oil  =  0.9;                                                      #  relative  density  of  oil
RD_Merc  =  13.6;                                                  #  Relative  density  of  Mercury

 #Calculations
V2  =  V1*(d1/d2)**2;
dZ  =  round(l*math.sin(math.radians(x)),3);       # it is used in book as 1.414,by rounding so here also
rho_Oil  =  RD_oil*rho;
rho_Man  =  RD_Merc*rho;
dP  =  0.5*rho_Oil*(V2**2-V1**2)  +  rho_Oil*g*dZ;
h  =  rho_Oil  *(  dP/(rho_Oil*g)-  dZ)/(rho_Man  -  rho_Oil);

print "Pressure Difference(N/m2) : ",round(dP,0)
print "Difference in the level of mercury (m):",round(h,3)
Pressure Difference(N/m2) :  39484.0
Difference in the level of mercury (m): 0.217

Example 6.3, Page 187

In [3]:
from __future__ import division
import math


 #Initializing  the  variables  
d1  =  0.25;                                                            #Pipeline  diameter
d2  =  0.10;                                                            #Throat  diameter
h  =0.63;                                                                #Difference  in  height
rho  =  1000;                                                          #Density  of  water
g  =  9.81                                                                #Acceleration  due  to  gravity

 #Calculations
rho_Hg  =  13.6*rho;
rho_Oil  =  0.9*rho;
A1  =  (math.pi*d1**2)/4;                                            #  Area  at  entry
m  =  (d1/d2)**2;                                                    #Area  ratio
Q  =  (A1/(m**2-1)**0.5)*(2*g*h*(rho_Hg/rho_Oil  -1))**0.5;

print "Thepretical Volume flow rate (m3/s ):",round(Q,3)
Thepretical Volume flow rate (m3/s ): 0.105

Example 6.4, Page 190

In [4]:
from __future__ import division
import math


 #Initializing  the  variables  

x  =  1.5;
y  =0.5;
H  =  1.2;
A  =  650*10**-6;
Q  =0.117;
g  =  9.81;

 #Calculations
Cv  =(x**2/(4*y*H))**0.5;
Cd  =  Q  /  (60*A*(2*g*H)**0.5);
Cc  =  Cd/Cv;


print "Coefficient of velocity :",round(Cv,3)
print "Coefficient of Discharge :",round(Cd,3)
print "Coefficient of contraction :",round(Cc,3)
Coefficient of velocity : 0.968
Coefficient of Discharge : 0.618
Coefficient of contraction : 0.639

Example 6.5, Page 192

In [5]:
from __future__ import division
import math


 #Initializing  the  variables  
B  =  0.7;
H1  =  0.4;
H2  =  1.9;
g  =9.81;
z  =  1.5  ;                                                              #  height  of  opening

 #Calculations
Q_Th  =  2/3  *B*(2*g)**0.5*(H2**1.5  -  H1**1.5);
A  =  z*B;
h  =  0.5*(H1+H2);
Q  =  A*(2*g*h)**0.5;

print "Percentage error in discharge (%):",round((Q-Q_Th)*100/Q_Th,2)
Percentage error in discharge (%): 1.98

Example 6.6, Page 195

In [6]:
from __future__ import division
import math


 #Initializing  the  variables  
Cd  =  0.6;                                                              #Coefficient  of  discharge
Q  =  0.28;
x  =  90;                                                                  #Theta
g  =  9.81;
dH  =  0.0015;

 #Calculations
H  =  (Q*(15/8)/(Cd*(2*g)**0.5*math.tan(math.radians(x/2))))**(2/5)
Frac_Q  =  5/2  *(  dH/H);

print "Percentage error in discharge(%)",round(Frac_Q*100,2)
Percentage error in discharge(%) 0.72

Example 6.7, Page 196

In [7]:
from __future__ import division
import math


 #Initializing  the  variables  
B  =  0.9;
H  =  0.25;
alpha  =  1.1;
g  =  9.81;  

 #Calculations
Q  =  1.84  *  B  *  H**(3/2);
print "Q(m3/s) :",Q

i  =  1;
while(i  <= 3):
    v  =  Q  /(1.2*  (H+0.2));
    print "V(m/s) :",round(v,4)
    k  =    ((1  +  alpha*v**2/(2*g*H))**1.5  -(alpha*v**2/(2*g*H))**1.5  );
    Q  =  k*  1.84  *  B  *  H**(3/2);
    print "Q(m3/s) :",round(Q,4)
    i  =  i+1;
Q(m3/s) : 0.207
V(m/s) : 0.3833
Q(m3/s) : 0.2161
V(m/s) : 0.4001
Q(m3/s) : 0.2168
V(m/s) : 0.4016
Q(m3/s) : 0.2169

Example 6.8, Page 197

In [8]:
from __future__ import division
import math


 #Initializing  the  variables  
rho  =  1000;
v  =  66  ;
Q  =  0.13;
g  =  9.81;  
z  =240;

 #Calculations
P_Jet  =    0.5*rho*v**2*Q;
P_Supp  =  rho*g*Q*z;
P_Lost  =    P_Supp  -P_Jet;
h  =  P_Lost/(rho*g*Q);
eff  =  P_Jet/P_Supp;

print "Part(a) - power of the jet(kW):                  ",round(P_Jet/1000,2)
print "Part(b) - power supplied from the reservoir (kW):",round(P_Supp/1000,2) 
print "Part(C) - head used to overcome losses (m):      ",round(h,2)
print "Part(d) - Efficiency(%) :                        ",round(eff*100,1)
Part(a) - power of the jet(kW):                   283.14
Part(b) - power supplied from the reservoir (kW): 306.07
Part(C) - head used to overcome losses (m):       17.98
Part(d) - Efficiency(%) :                         92.5

Example 6.9, Page 203

In [9]:
from __future__ import division
import math
from scipy import integrate

 #Initializing  the  variables  
r1  =  0.2;
Z1  =  0.500;
Z2  =  0.340;
g  =  9.81;
rho  =  0.9*1000  ;

 #Calculations
r0  =  r1*((2-2*Z2/Z1)**0.5);
omega  =   round((2*g*Z1/r0**2)**0.5,1)

def G(r):
    out  =r**3  -  r*r0**2;
    return out
    
results = integrate.quad(G, r0, r1)

F  =  rho*omega**2*math.pi*results[0];

print r0,r1
print "Part(a) Speed of rotation (rad/s ):",round(omega,1)
print "Part(b) Upward force on the cover (N): ",round(F,1)
0.16 0.2
Part(a) Speed of rotation (rad/s ): 19.6
Part(b) Upward force on the cover (N):  56.3

Example 6.10, Page 206

In [10]:
from __future__ import division
import math


 #Initializing  the  variables  
Ra  =  0.2;
Rb  =  0.1;
H  =  0.18;
Za  =  0.125;

 #Calculations
Y  =    Ra**2*(H-Za);
Zb  =  H  -  Y/Rb**2;

print "Height above datum of a point B on the free surface at a radius of 100 mm (mm):",Zb*1000
Height above datum of a point B on the free surface at a radius of 100 mm (mm): -40.0