{
 "metadata": {
  "name": "",
  "signature": "sha256:f1e32f78d016d65eaf62d619ce157e62f2d402e55bfc70a9a046c3e8d919d007"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 11 : Pumping Machinery"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.1 Page No : 223"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#initialisation of variables\n",
      "\n",
      "import math \n",
      "h= 75. \t#ft\n",
      "e= 0.75\n",
      "k= 0.01\n",
      "Q= 3000. \t#gal/min\n",
      "k1= 1.2\n",
      "N= 1500.\n",
      "g= 32.2 \t#ft/sec**2\n",
      "D= 0.836 \t#ft\n",
      "\n",
      "#CALCULATIONS\n",
      "W= h/e\n",
      "v1= math.sqrt((W-h)/k)\n",
      "Q1= Q/374.06\n",
      "f1= Q1/(k1*D**2)\n",
      "u1= math.pi*D*N/60\n",
      "w1= W*g/u1\n",
      "B= math.degrees(math.atan((f1/(u1-w1))))\n",
      "\n",
      "#RESULTS\n",
      "print  'Diameter of impeller = %.3f ft '%(D)\n",
      "print  ' Blade angle at outlet edge of impeller = %.f degrees '%(B)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Diameter of impeller = 0.836 ft \n",
        " Blade angle at outlet edge of impeller = 30 degrees \n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.3 Page No : 226"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#initialisation of variables\n",
      "V= 150. \t#ft**3/sec\n",
      "A1= 750. \t#r.p.m\n",
      "di= 21. \t#in\n",
      "do= 30. \t#in\n",
      "v= 50. \t#ft/sec\n",
      "A= 70. \t#degrees\n",
      "w= 4.\t#in\n",
      "p= 30. \t#per cent\n",
      "p1= 25. \t#per cent\n",
      "sv= 12.8 \t#ft**3/lb\n",
      "g= 32.2 \t#ft/sec**2\n",
      "\n",
      "#CALCULATIONS\n",
      "u= A1*2*math.pi*di/(24*60)\n",
      "u1= A1*2*math.pi*do/(24*60)\n",
      "f1= V/(math.pi*(do/12)*(1./3))\n",
      "w1= u1-f1*1/math.tan(math.radians((A)))\n",
      "v1= math.sqrt(f1**2+w1**2)\n",
      "P= (u1**2+v**2-(f1**2/(math.sin(math.radians(A)))**2))/(2*g)\n",
      "h= 30*v1**2/(100*2*g)\n",
      "Nh= v1**2/(20*2*g)\n",
      "Prt= P+Nh\n",
      "W= u1*w1/g\n",
      "e= Prt*100/W\n",
      "Power= Prt*V/(sv*550)\n",
      "\n",
      "#RESULTS\n",
      "print 'Total pressure rise = %.1f ft of air'%(Prt)\n",
      "print ' manometric efficiency = %.1f percent'%(e)\n",
      "print  ' Power = %.2f hp '%(Power)\n",
      "\n",
      "#The answer is a bit different due to rounding off error in textbook\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Total pressure rise = 137.9 ft of air\n",
        " manometric efficiency = 58.5 percent\n",
        " Power = 2.94 hp \n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.4 Page No : 228"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#initialisation of variables\n",
      "g= 32.2 \t#ft/sec**2\n",
      "u1= 90. \t#ft/sec\n",
      "w1= 70. \t#ft\n",
      "e= 0.8\n",
      "h1= 10. \t#ft\n",
      "h2= 16. \t#ft\n",
      "h3= 5. \t#ft\n",
      "k= 2./5\n",
      "f1= 20. \t#ft/sec\n",
      "f= 18.   \t#ft/sec\n",
      "a= 45. \t    #degrees\n",
      "x1= 164.4 \t#ft\n",
      "\n",
      "#CALCULATIONS\n",
      "Hm= u1*w1/g\n",
      "Hm1= e*Hm\n",
      "lh= Hm-Hm1-h1-h2-h3\n",
      "vg= k*math.sqrt(f1**2+w1**2)\n",
      "pr= ((f**2+u1**2-f1**2/(math.sin(math.radians(a)))**2)/(2*g))-h2\n",
      "pr1= x1-pr\n",
      "ge= pr1*g*2*100/(vg/k)**2\n",
      "\n",
      "#RESULTS\n",
      "print  'manometer Head = %.1f ft '%(Hm1)\n",
      "print  ' outlet velocity from guides = %.1f ft/sec '%(vg)\n",
      "print  ' Pressure rise through impeller only = %.1f ft '%(pr)\n",
      "print  ' Guide balde efficiency = %.f per cent '%(ge)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "manometer Head = 156.5 ft \n",
        " outlet velocity from guides = 29.1 ft/sec \n",
        " Pressure rise through impeller only = 102.4 ft \n",
        " Guide balde efficiency = 75 per cent \n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.6 Page No : 231"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#initialisation of variables\n",
      "D1= 7.5 \t#in\n",
      "Q1= 850. \t#gal/min\n",
      "p1= 62.4 \t#lb/ft**3\n",
      "N1= 1800.\n",
      "D2= 15. \t#in\n",
      "Q2= 12000. \t#gal/min\n",
      "p2= 64. \t#lb/ft**3\n",
      "N1= 1800. \t#r.p.m \n",
      "H1= 14. \t#lb/ft**2\n",
      "\n",
      "#CALCULATIONS\n",
      "N2= Q2*N1*(D1)**3/(Q1*D2**3)\n",
      "P1= p1*H1/144\n",
      "P2= P1*N2**2*D2**2*p2/(N1**2*p1*D1**2)\n",
      "\n",
      "#RESULTS\n",
      "print  'N2 = %.f r.p.m '%(N2+4)\n",
      "print  ' P2 = %.f lb/in**2 '%(P2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "N2 = 3180 r.p.m \n",
        " P2 = 78 lb/in**2 \n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.8 Page No : 234"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#initialisation of variables\n",
      "r= 5.\n",
      "\n",
      "#CALCULATIONS\n",
      "sr= r**2\n",
      "sr1= r**2/r\n",
      "\n",
      "#RESULTS\n",
      "print  'Corresponding ratio = %.f '%(sr)\n",
      "print  ' Corresponding ratio = %.f '%(sr1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Corresponding ratio = 25 \n",
        " Corresponding ratio = 5 \n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.9 Page No : 236"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#initialisation of variables\n",
      "e= 0.88\n",
      "w= 1.25 \t#in\n",
      "d= 10.   \t#in\n",
      "q= 630.  \t#gal/min\n",
      "a= 40.   \t#degrees\n",
      "g= 32.2 \t#ft/sec**2\n",
      "e1= 0.83\n",
      "\n",
      "#CALCULATIONS\n",
      "Q= q/(6.24*60)\n",
      "f1= Q/(e*math.pi*(d/12)*(w/12))\n",
      "u1= 1000*(w*4/12)*2*math.pi/60\n",
      "w1= u1-f1*1/math.tan(math.radians(a))\n",
      "W= u1*w1/g\n",
      "lr= (f1**2+u1**2-f1**2/(math.sin(math.radians(a)))**2)/(2*g)\n",
      "mh= e1*W\n",
      "p= mh-lr\n",
      "v1= math.sqrt(f1**2+w1**2)\n",
      "ke= v1**2/(2*g)\n",
      "pke= p*100/ke\n",
      "me= 100*lr/W\n",
      "\n",
      "#RESULTS\n",
      "print  'Velocity of flow = %.f ft/sec'%(f1)\n",
      "print  ' Work done = %.1f ft-lb/lb'%(W)\n",
      "print  ' manometric efficiency = %.1f ft'%(mh)\n",
      "print  ' Pressure recovered = %.1f ft head'%(p)\n",
      "print  ' Kinetic energy discharge = %.f ft-lb/lb'%(ke)\n",
      "print  ' Percentage of kinetic energy recovered = %.1f per cent'%(pke)\n",
      "print  ' manometric efficiency = %d percent'%(me)\n",
      "\n",
      "#The answer is a bit different due to rounding off error in textbook\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Velocity of flow = 7 ft/sec\n",
        " Work done = 47.8 ft-lb/lb\n",
        " manometric efficiency = 39.7 ft\n",
        " Pressure recovered = 11.2 ft head\n",
        " Kinetic energy discharge = 20 ft-lb/lb\n",
        " Percentage of kinetic energy recovered = 55.7 per cent\n",
        " manometric efficiency = 59 percent\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.10 Page No : 239"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#initialisation of variables\n",
      "W1= 7640. \t#gal/min\n",
      "W2= 11400. \t#gal/min\n",
      "Hm= 63. \t#ft\n",
      "Hm1= 80. \t#ft\n",
      "ep1= 72. \t#per cent\n",
      "ep2= 76. \t#per cent\n",
      "\n",
      "#CALCULATIONS\n",
      "whp1= W1*Hm/(60*550)\n",
      "whp2= W2*Hm1/(60*550)\n",
      "bhp1= whp1*100/ep1\n",
      "bhp2= whp2*100/ep2\n",
      "w1= W2/10\n",
      "\n",
      "#RESULTS\n",
      "print  'For both pumps discharge = %.f gal/min against an 80-ft head'%(W2)\n",
      "print  ' delivery from one pump = %.1f h.p '%(bhp1)\n",
      "print  ' delivery from two pumps = %.1f h.p '%(bhp2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "For both pumps discharge = 11400 gal/min against an 80-ft head\n",
        " delivery from one pump = 20.3 h.p \n",
        " delivery from two pumps = 36.4 h.p \n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.11 Page No : 241"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#initialisation of variables\n",
      "h= 94.   \t#ft\n",
      "w= 62.4 \t#lb/ft**3\n",
      "e= 0.58\n",
      "p= 73.5 \t#per cent\n",
      "\n",
      "#CALCULATIONS\n",
      "WHP= h*e*w/550\n",
      "BHP= WHP/(p/100)\n",
      "\n",
      "#RESULTS\n",
      "print 'W.H.P= %.2f h.p'%(WHP)\n",
      "print ' Brake horse power= %.1f'%(BHP)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "W.H.P= 6.19 h.p\n",
        " Brake horse power= 8.4\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.12 Page No : 243"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#initialisation of variables\n",
      "sl= 12. \t#ft\n",
      "l= 20.  \t#ft\n",
      "d= 4.   \t#in\n",
      "dp= 6.  \t#in\n",
      "lst= 18. \t#in\n",
      "k= 0.025\n",
      "H= 32.   \t#ft\n",
      "g= 32.2 \t#ft/sec**2\n",
      "pf= 6.   \t#ft\n",
      "a= 33.83 \n",
      "a1= 9.53\n",
      "\n",
      "#CALCULATIONS\n",
      "A= math.sqrt((H-sl-d)*g/a)*a1\n",
      "Q= 2*math.pi*(dp/12)**2*lst/(12*4*60)\n",
      "v= Q/(math.pi*(d/12)**2/4)\n",
      "kh= v**2/(2*g)\n",
      "fh= k*l*v**2*12/(2*g*d)\n",
      "N= math.sqrt((H-sl-pf)/(kh+fh))\n",
      "\n",
      "#RESULTS\n",
      "print  'premissible speed = %.1f r.p.m'%(A)\n",
      "print  ' maximum premissible speed = %.1f r.p.m'%(N)\n",
      "\n",
      "#The answer is a bit different due to rounding off error in textbook\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "premissible speed = 37.2 r.p.m\n",
        " maximum premissible speed = 168.8 r.p.m\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.13 Page No : 245"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#initialisation of variables\n",
      "b= 6.    \t#in\n",
      "s= 12. \t    #in\n",
      "d= 4. \t    #in\n",
      "a1= 30. \t#degrees\n",
      "a2= 90. \t#degrees\n",
      "a3= 120. \t#degrees\n",
      "N= 120. \t#r.p.m\n",
      "n= 4.\n",
      "#calculations\n",
      "A= 2*math.pi*N/60\n",
      "V= math.pi*(b/12)**2*n/4\n",
      "v= (b/12)**2*A*(b/12)/(d/12)**2\n",
      "Q1= v*math.pi*(d/12)**2*math.sin(math.radians(a1))/4\n",
      "Q2= v*math.pi*(d/12)**2*math.sin(math.radians(a2))/4\n",
      "Q3= v*math.pi*(d/12)**2*math.sin(math.radians(a3))/4\n",
      "Q4= V-Q1\n",
      "Q5= Q2-V\n",
      "Q6= Q3-V\n",
      "a4= math.degrees(math.asin(V/(v*math.pi*(d/12)**2)))+a1\n",
      "A= 180-a4\n",
      "\n",
      "#RESULTS\n",
      "print  'rate of flow at a1 = %.3f cuses'%(Q4)\n",
      "print  ' rate of flow at a2 = %.3f cuses'%(Q5)\n",
      "print  ' rate of flow at a3 = %.3f cuses'%(Q6)\n",
      "print  ' crak angle = %.1f degrees'%(a4)\n",
      "print  ' crak angle = %.1f degrees'%(A)\n",
      "\n",
      "#The answer is a bit different due to rounding off error in textbook\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "rate of flow at a1 = 0.169 cuses\n",
        " rate of flow at a2 = 0.448 cuses\n",
        " rate of flow at a3 = 0.283 cuses\n",
        " crak angle = 39.2 degrees\n",
        " crak angle = 140.8 degrees\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.14 Page No : 247"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math \n",
      "\n",
      "#initialisation of variables\n",
      "n= 2. \t#strokes/sec\n",
      "dp= 6. \t#in\n",
      "ds= 18. \t#in\n",
      "ds1=4. \t#in\n",
      "l= 20. \t#ft\n",
      "l1= 20. \t#ft\n",
      "f= 0.008\n",
      "la= 5. \t#ft\n",
      "A= 60. \t#r.p.m\n",
      "f= 0.008\n",
      "w= 62.4 \t#lb/ft**3\n",
      "g=32.2\n",
      "\n",
      "#CALCULATIONS\n",
      "V= math.pi*(ds/12)*n*(dp/12)**2/4\n",
      "vmp= 2*math.pi*A*(ds/24)/60\n",
      "vmp1= vmp*(dp**2/ds1**2)\n",
      "hfmax= 4*f*(l-la)*vmp1**2/(2*g*ds1/12)\n",
      "H1= round(2*hfmax/3,1)\n",
      "H2= H1*13\n",
      "Wls= (H1+H2)*w*math.pi/16*1.5*2\n",
      "mv= V/(math.pi*(ds1/12)**2/4)\n",
      "lh= round(4*f*(l-la)*mv**2/(2*g*(ds1/12)),2)\n",
      "lhf= 12*lh\n",
      "Wls1= (lh+13.21)*w*math.pi*1.5/16 *2  \n",
      "WS= Wls-Wls1\n",
      "\n",
      "#RESULTS\n",
      "print 'Work lost per second= %.f ft lb/sec'%(Wls)\n",
      "print  ' Work saved per second = %.f ft-lb/sec'%(WS)\n",
      "\n",
      "#The answer is a bit different due to rounding off error in textbook\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Work lost per second= 875 ft lb/sec\n",
        " Work saved per second = 352 ft-lb/sec\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.15 Page No : 248"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#initialisation of variables\n",
      "d= 7.5  \t#in\n",
      "s= 15.   \t#in\n",
      "l= 36.  \t#ft\n",
      "h1= 34. \t#ft\n",
      "h2= 12. \t#ft\n",
      "L= 10. \t    #ft\n",
      "g= 32.2 \t#ft/sec**2\n",
      "f= 0.008\n",
      "l1= 20. \t#ft\n",
      "d1= 4.  \t#in\n",
      "h3= 110. \t#ft\n",
      "w= 62.4 \t#lb/ft**3\n",
      "l2= 180. \t#ft\n",
      "\n",
      "#CALCULATIONS\n",
      "Q= (math.pi/4)*(d)**2*(s/12)*2*(l/60)/144\n",
      "v= Q/((math.pi/4)*(d1/12)**2)\n",
      "a= (d/4)**2*(d/12)*(l*2*math.pi/60)**2\n",
      "H= h1-h2-(L*a/g)-(v**2*0.5/g)-(4*f*l1*v**2/(2*g*(d1/12)))\n",
      "H1= h1+h3+(L*a/g)+(v**2*0.5/g)+(4*f*l2*v**2/(2*g*(d1/12)))\n",
      "dh= (H1-H)*w/144\n",
      "NP= dh*(math.pi/4)*d**2\n",
      "\n",
      "#RESULTS\n",
      "print  'Head at piston = %.2f ft of water absolute'%(H)\n",
      "print  ' Head at piston = %.2f ft of water absolute'%(H1)\n",
      "print  ' Difference on head of piston = %.f lb/in**2'%(dh)\n",
      "print  ' Net load on piston = %.f lb'%(NP)\n",
      "\n",
      "#The answer is a bit different due to rounding off error in textbook\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Head at piston = 11.04 ft of water absolute\n",
        " Head at piston = 161.59 ft of water absolute\n",
        " Difference on head of piston = 65 lb/in**2\n",
        " Net load on piston = 2882 lb\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.16 Page No : 250"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math \n",
      "from numpy import *\n",
      "from numpy.linalg import *\n",
      "\n",
      "#initialisation of variables\n",
      "f= 0.009\n",
      "dc= 3.5 \t#in\n",
      "ds= 6. \t#in\n",
      "r= 0.25\n",
      "sl= 8. \t#ft\n",
      "d= 2.5 \t#in\n",
      "l= 14. \t#ft\n",
      "el= 8. \t#ft\n",
      "ed= 22.5 \t#in\n",
      "ph= 4. \t#ft\n",
      "g= 32.2 \t#ft/sec**2\n",
      "f= 0.009\n",
      "\n",
      "#CALCULATIONS\n",
      "BC= el+l\n",
      "v= math.sqrt(BC*g/(l*(d/2)*(r)*(dc/d)**2))*9.55\n",
      "vec=roots([2,1/r,-1])\n",
      "H1= 77\n",
      "MV= math.sqrt(BC*g/(l*(d/2)*(r)*(dc/d)**2))*r*(math.sin(math.radians(H1))+(math.sin(math.radians(2*H1))/8))\n",
      "mvp= MV*dc**2/d**2\n",
      "hf= 4*f*(sl+l)*mvp**2/(2*g*(d/12))\n",
      "\n",
      "#RESULTS\n",
      "print  'pump speed = %.1f r.p.m'%(v)\n",
      "print  ' Friction head = %.3f ft'%(hf)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "pump speed = 86.8 r.p.m\n",
        " Friction head = 1.240 ft\n"
       ]
      }
     ],
     "prompt_number": 15
    }
   ],
   "metadata": {}
  }
 ]
}