{
 "metadata": {
  "name": "",
  "signature": "sha256:2f07cf575072954f2c364fa1bc9af38d9d9d43725d39198530552558da11415c"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 3 : Flow of Water"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.1 Page No : 67"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\t\n",
      "#initialisation of variables\n",
      "d1 = 1. \t\t#ft\n",
      "d2 = 6. \t\t#in\n",
      "h1 = 5. \t\t#ft\n",
      "h2 = 15. \t\t#ft\n",
      "Pa = 15. \t\t#lbs\n",
      "v1 = 10. \t\t#ft/sec\n",
      "w = 62.4 \t\t#lbs/ft**3\n",
      "g = 32.2 \t\t#ft/sec**2\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "v2 = v1/(d2/12)**2\n",
      "Pb = (w*((Pa+(Pa*144/w)+(v1**2/(2*g)))-h1-(v2**2/(2*g))))/144\n",
      "\t\t\n",
      "#RESULTS\n",
      "print  'Pb = %.2f lbs/in**2 '%(Pb)  \n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Pb = 9.24 lbs/in**2 \n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.2 Page No : 69"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\n",
      "#initialisation of variables\n",
      "d1 = 4. \t\t#ft\n",
      "d2 = 2. \t\t#ft\n",
      "h1 = 50. \t\t#ft\n",
      "h2 = 45. \t\t#ft\n",
      "g = 32.2 \t\t#ft/sec**2\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "r = (d1**2/d2**2)\n",
      "v1 = round(math.sqrt((h1-h2)*2*g/(r**2-1)),1)\n",
      "Q = v1*math.pi*d1**2/4\n",
      "\n",
      "#RESULTS\n",
      "print  'discharge through pipe = %.2f cubic feet per second '%(Q)\n",
      "\n",
      "# rounding off error"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "discharge through pipe = 57.81 cubic feet per second \n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3 Page No : 70"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math \n",
      "\t\t\n",
      "#initialisation of variables\n",
      "z1 = 10. \t\t#/m\n",
      "h1 = 10. \t\t#m\n",
      "v1 = 12. \t\t#ft/sec\n",
      "v2 = 4. \t\t#m/sec\n",
      "k = 0.6\n",
      "w = 62.4 \t\t#lb/in**2\n",
      "g = 32.2 \t\t#ft/sec**2\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "p = (w/144)*(z1+h1+(v1**2/(2*g))-(v2**2/(2*g))-(k*(v1-v2)**2/(2*g)))\n",
      "\t\t\n",
      "#RESULTS\n",
      "print  'pressure at bottom end  = %.2f lb/in**2'%(p)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "pressure at bottom end  = 9.27 lb/in**2\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.4 Page No : 73"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\n",
      "#initialisation of variables\n",
      "d = 4.   \t\t#ft\n",
      "d1 = 5./4 \t\t#ft\n",
      "g = 32.2 \t\t#ft/sec**2\n",
      "h = 3. \t    \t#ft\n",
      "K = 1.\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "C = (math.pi/4)*d**2*math.sqrt(2*g)/(math.sqrt((d**2/d1**2)**2-1))\n",
      "Q = K*math.sqrt(h)*C\n",
      "V = Q/(math.pi*d1**2/4)\n",
      "\t\t\n",
      "#RESULTS\n",
      "print  'Velocity at the throat = %.2f ft/sec '%(V)\n",
      "\n",
      "# ronding off error"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Velocity at the throat = 13.97 ft/sec \n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.5 Page No : 74"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\n",
      "#initialisation of variables\n",
      "d = 9. \t\t#in\n",
      "d1 = 4. \t\t#in\n",
      "g = 32.2 \t\t#ft/sec**2\n",
      "dh = 10. \t\t#in\n",
      "sg = 13.6 \n",
      "K = 1.\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "C = (((math.pi/4)**2*(d*d1)**2*math.sqrt(2*g)/144**2)/(math.sqrt((math.pi*d**2/12**2)**2-(math.pi*d1**2/12**2)**2)))+0.52\n",
      "h = (sg-1)*dh/12\n",
      "Q = K*C*math.sqrt(h)\n",
      "\t\t\n",
      "#RESULTS\n",
      "print  'Discharge passing through the pipe = %.2f cuses '%(Q)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Discharge passing through the pipe = 2.26 cuses \n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.6 Page No : 76"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\n",
      "#initialisation of variables\n",
      "sm = 13.6\n",
      "so = 0.8\n",
      "di = 8. \t\t#in\n",
      "dt = 4. \t\t#in\n",
      "K = 0.98\n",
      "v = 1.  \t\t#ft\n",
      "g = 32.2 \t\t#ft/sec**2\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "s = sm/so\n",
      "dp = v*12*(s-1)/12\n",
      "A = math.pi*(di/12)**2/4\n",
      "At = math.pi*(dt/12)**2/4\n",
      "C = A*math.sqrt(2*g)/(math.sqrt((A/At)**2-1))\n",
      "Q = C*math.sqrt(v*12+dt)*K\n",
      "\t\t\n",
      "#RESULTS\n",
      "print  'Discharge passing through the pipe = %.2f cuses '%(Q)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Discharge passing through the pipe = 2.84 cuses \n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.7 Page No : 77"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\n",
      "#initialisation of variables\n",
      "s = 1./10\n",
      "d1 = 6. \t\t#in\n",
      "d2 = 2. \t\t#in\n",
      "l = 20. \t\t#in\n",
      "p = 15. \t\t#lbs/in**2\n",
      "p1 = 6. \t\t#lbs/in**2\n",
      "K = 0.95\n",
      "g = 32.2 \t\t#ft/sec**2\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "H = (l*s/12)-(p1*144/(2*g))+(p*144/(2*g))\n",
      "C = math.sqrt(2*g)*(math.pi*(d1/12)**2)/(4*(math.sqrt((d1**2/d2**2)**2-1)))\n",
      "Q = C*K*math.sqrt(H)*374.7\n",
      "\n",
      "#RESULTS\n",
      "print  'Discharge passing through the pipe = %.f Gallons/minute '%(Q)\n",
      "\n",
      "# note : rounding off error at value of H in textbook. so answer is slightly different"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Discharge passing through the pipe = 282 Gallons/minute \n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.8 Page No : 78"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\n",
      "#initialisation of variables\n",
      "d1 = 12. \t\t#in\n",
      "Q = 4.25 \t\t#ft**3/sec\n",
      "h = 18. \t\t#ft\n",
      "K = 0.98\n",
      "g = 32.2 \t\t#ft/sec**2\n",
      "sm = 13.6\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "R = math.sqrt((K*math.sqrt(2*g)*math.sqrt(h)*(math.pi*(d1/12)**2/4)/Q)+1)\n",
      "d2 = math.sqrt(d1**2/(144*R))\n",
      "dh = (sm-1)*(h/(12*2))\n",
      "d3 = Q*math.sqrt(dh/h)\n",
      "\t\t\n",
      "#RESULTS\n",
      "print  'Diameter of the throat = %.2f ft '%(d3)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Diameter of the throat = 3.08 ft \n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.9 Page No : 81"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\n",
      "#initialisation of variables\n",
      "R = 4. \t\t#in\n",
      "r = 0.5 \t\t#in\n",
      "c = 0.007\n",
      "K = 33.96\n",
      "w = 62.4 \t\t#lb/ft**3\n",
      "pa = 12.13 \t\t#lb/in**2\n",
      "pb = 14.7 \t\t#lb/in**2\n",
      "w1 = 2.5 \t\t#lbs\n",
      "Q = 40. \t\t#gals/min\n",
      "h = 1.86\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "va = Q*4*(2*r*12)**2/(6*w*math.pi)\n",
      "vb = Q*(2*r*12)**2/(6*w*2*R*math.pi*0.32)\n",
      "vx = vb*R/2\n",
      "pu = 2*math.pi*w*h\n",
      "pd = pb*math.pi*R**2\n",
      "RP = pb*math.pi*R**2-2*math.pi*w*(0.5*K*((R/12)**2-(r/12)**2)-c*math.log(R/r))-pa*math.pi*r**2+w1\n",
      "\t\t\n",
      "#RESULTS\n",
      "print  'velocity va = %.1f ft/sec'%(va)\n",
      "print  'velocity vb = %.2f ft/sec'%(vb)\n",
      "print  'velocity vx = %.2f ft/sec'%(vx)\n",
      "print  'pressure px = %.1f lbs/in**2'%(pb)\n",
      "print  'upward pressure  = %.1f lbs'%(pu)\n",
      "print  'downward pressure  = %.1f lbs'%(pd)\n",
      "print  'Resultant pressure  = %.1f lbs'%(RP)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "velocity va = 19.6 ft/sec\n",
        "velocity vb = 1.91 ft/sec\n",
        "velocity vx = 3.83 ft/sec\n",
        "pressure px = 14.7 lbs/in**2\n",
        "upward pressure  = 729.3 lbs\n",
        "downward pressure  = 738.9 lbs\n",
        "Resultant pressure  = 9.4 lbs\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.10 Page No : 86"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math \n",
      "\t\t\n",
      "#initialisation of variables\n",
      "d = 1.  \t\t#ft\n",
      "h = 4. \t    \t#ft\n",
      "h1 = 3. \t\t#ft\n",
      "p = 25. \t\t#percent\n",
      "g = 32.2 \t\t#ft/sec**2\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "h2 = ((h/4)-(h1/4))*h*2\n",
      "w = math.sqrt(h2*2*g/(d/2)**2)\n",
      "N = w*60/(2*math.pi)\n",
      "h3 = (h-h1**2/4)*2\n",
      "w1 = math.sqrt(h3*2*g/(d/2)**2)\n",
      "N1 = w1*60/(2*math.pi)\n",
      "\t\t\n",
      "#RESULTS\n",
      "print  'original volume = %.1f R.P.M '%(N1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "original volume = 286.7 R.P.M \n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.12 Page No : 89"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\n",
      "#initialisation of variables\n",
      "R2 = 2. \t\t#ft\n",
      "R1 = 1. \t\t#ft\n",
      "w = 200. \t\t#r.p.m\n",
      "g = 32.2 \t\t#ft/sec**2\n",
      "\t\t\n",
      "#CALCULATIONS\n",
      "v2 = R2*math.pi*w*R2/60\n",
      "v1 = R2*math.pi*w*R1/60\n",
      "H = (v2**2-v1**2)/(2*g)\n",
      "\t\t\n",
      "#RESULTS\n",
      "print  'centrifugal head = %.1f ft of watrer '%(H)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "centrifugal head = 20.4 ft of watrer \n"
       ]
      }
     ],
     "prompt_number": 11
    }
   ],
   "metadata": {}
  }
 ]
}