{
 "metadata": {
  "name": "",
  "signature": "sha256:0458e76e5cbaddd943b9a671e1b1b350576726b8ff19fee2507d932165451e88"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 3 : Flow of Fluids"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.1 Page No : 62"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Variables\n",
      "d1 = 0.3\n",
      "d2 = 0.1\n",
      "z1 = 6.\n",
      "z2 = 3.\n",
      "p1 = 200.*1000\n",
      "q1 = 0.07\n",
      "a1 = math.pi*d1*d1/4\n",
      "a2 = math.pi*d2*d2/4\n",
      "v1 = q1/a1\n",
      "v2 = q1/a2\n",
      "w = 9810.\n",
      "g = 9.81\n",
      "\n",
      "# Calculations \n",
      "#applying bernoulli equation\n",
      "p2 = ((z1-z2)+(((v1**2)-(v2**2))/(2*g))+(p1/w))*w\n",
      "\n",
      "# Results \n",
      "print \"pressure at point B in N/m2\",round(p2,2),\"N/m**2\"\n",
      "\n",
      "# note : rounding off error."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "pressure at point B in N/m2 190202.44 N/m**2\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.2 Page No : 63"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Variables\n",
      "d1 = 1.\n",
      "d2 = 0.5\n",
      "q = 0.1\n",
      "p1 = 70.*1000\n",
      "l = 60.\n",
      "z2 = 0.\n",
      "z1 = l/20\n",
      "a1 = math.pi*d1*d1/4\n",
      "a2 = math.pi*d2*d2/4\n",
      "v1 = q/a1\n",
      "v2 = q/a2\n",
      "w = 9810.\n",
      "g = 9.91\n",
      "\n",
      "# Calculations \n",
      "# applying bernoulli equation\n",
      "p2 = ((z1-z2)+(((v1**2)-(v2**2))/(2*g))+(p1/w))*w\n",
      "\n",
      "# Results \n",
      "print \"presssure at lower end in N/m2 %d\"%round(p2,3),\"N/m**2\"\n",
      "\n",
      "# note : rounding off error."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "presssure at lower end in N/m2 99309 N/m**2\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3 Page No : 64"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "d1 = 0.2\n",
      "d2 = 0.1\n",
      "l = 4.\n",
      "x = 30.\n",
      "p1 = 392.4*1000\n",
      "q = 0.035\n",
      "z1 = 0\n",
      "\n",
      "# Calculations \n",
      "z2 = l*math.sin(math.radians(x))\n",
      "a1 = math.pi*d1*d1/4\n",
      "a2 = math.pi*d2*d2/4\n",
      "v1 = q/a1\n",
      "v2 = q/a2\n",
      "w = 9810.\n",
      "g = 9.81\n",
      "p2 = ((z1-z2)+(((v1**2)-(v2**2))/(2*g))+(p1/w))*w\n",
      "\n",
      "# Results \n",
      "print \"pressure intensity at outlet in N/m2\",round(p2,2),\"N/m**2\"\n",
      "\n",
      "# note : rounding off error."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "pressure intensity at outlet in N/m2 363471.12 N/m**2\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.4 Page No : 65"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "d1 = 0.2\n",
      "d2 = 0.1\n",
      "d3 = 0.15\n",
      "v1 = 4\n",
      "g = 9.81\n",
      "\n",
      "# Calculations \n",
      "vh1 = (v1**2)/(2*g)\n",
      "a1 = 3.142*d1*d1/4\n",
      "a2 = 3.142*d2*d2/4\n",
      "a3 = 3.142*d3*d3/4\n",
      "v2 = (a1*v1)/a2\n",
      "vh2 = (v2**2)/(2*g)\n",
      "v3 = (a1*v1)/a3\n",
      "vh3 = (v3**2)/(2*g)\n",
      "q = a1*v1\n",
      "mf = q*1000\n",
      "\n",
      "# Results \n",
      "print \"velocity head at point 1\",round(vh1,3),\"m\"\n",
      "print \"velocity head at point 2\",round(vh2,3),\"m\"\n",
      "print \"velocity head at point 3\",round(vh3,3),\"m\"\n",
      "print \"mass flow rate in kg/sec\",mf\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "velocity head at point 1 0.815 m\n",
        "velocity head at point 2 13.048 m\n",
        "velocity head at point 3 2.577 m\n",
        "mass flow rate in kg/sec 125.68\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.5 Page No : 66"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "d1 = 0.2\n",
      "d2 = 0.5\n",
      "p1 = 98.1*1000\n",
      "p2 = 58.86*1000\n",
      "q = 0.2\n",
      "z1 = 0\n",
      "z2 = 4.\n",
      "g = 9.81\n",
      "s = 0.87\n",
      "\n",
      "# Calculations \n",
      "a1 = 3.142*d1*d1/4\n",
      "a2 = 3.142*d2*d2/4\n",
      "v1 = q/a1\n",
      "v2 = q/a2\n",
      "w = 9810\n",
      "ph1 = p1/(w*s)\n",
      "ph2 = p2/(w*s)\n",
      "vh1 = (v1**2)/(2*g)\n",
      "vh2 = (v2**2)/(2*g)\n",
      "th1 = vh1+ph1+z1\n",
      "th2 = vh2+ph2+z2\n",
      "tl = th1-th2\n",
      "\n",
      "# Results \n",
      "print \"loss of head in m,flow from 1 to 2\",round(tl,3),\"m\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "loss of head in m,flow from 1 to 2 2.61 m\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.6 Page No : 67"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "d1 = 0.3\n",
      "d2 = 0.15\n",
      "a1 = 3.142*d1*d1/4\n",
      "a2 = 3.142*d2*d2/4\n",
      "H = 0.18\n",
      "Cd = 0.85\n",
      "s2 = 13.6\n",
      "s1 = 1.\n",
      "w = 9810.\n",
      "\n",
      "# Calculations \n",
      "h = H*((s2/s1)-1)\n",
      "g = 9.81\n",
      "q = (Cd*a1*a2*((2*g*h)**0.5))/(((a1**2)-(a2**2))**0.5)\n",
      "q1 = q*1000\n",
      "\n",
      "# Results \n",
      "print \"rate of flow in litres/sec\",round(q1,2)\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "rate of flow in litres/sec 103.5\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.7 Page No : 68"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Variables\n",
      "q = 0.1\n",
      "d1 = 0.2\n",
      "Cd = 0.9\n",
      "H = 0.4\n",
      "s1 = 1.\n",
      "s2 = 13.6\n",
      "g = 9.8\n",
      "\n",
      "# Calculations \n",
      "h = H*((s2/s1)-1)\n",
      "a1 = math.pi*d1*d1/4\n",
      "z = 1+(((Cd*a1*((2*g*h)**0.5))/q)**2)\n",
      "a2 = ((a1**2)/z)**0.5\n",
      "d2 = (4*a2/3.1)**0.5\n",
      "\n",
      "# Results \n",
      "print \"diameter of throat in m\",round(d2,3)\n",
      " \n",
      "# note : rounding off error. "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "diameter of throat in m 0.117\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.8 Page No : 68"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "q = 0.08\n",
      "d1 = 0.3\n",
      "d2 = 0.15\n",
      "a1 = 3.142*d1*d1/4\n",
      "a2 = 3.142*d2*d2/4\n",
      "h = 1.5\n",
      "g = 9.81\n",
      "\n",
      "# Calculations \n",
      "z = (a1*a2*((2*g*h)**0.5))/(((a1**2)-(a2**2))**0.5)\n",
      "Cd = q/z\n",
      "\n",
      "# Results \n",
      "print \"co-efficient of meter\",round(Cd,3)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "co-efficient of meter 0.808\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.9 Page No : 69"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "s2 = 13.6\n",
      "s1 = 0.9\n",
      "H = 0.25\n",
      "h = H*((s2/s1)-1)\n",
      "Cd = 0.98\n",
      "w = 9810*s1\n",
      "d1 = 0.3\n",
      "d2 = 0.15\n",
      "\n",
      "# Calculations \n",
      "a1 = 3.142*d1*d1/4\n",
      "a2 = 3.142*d2*d2/4\n",
      "dz = 0.3\n",
      "g = 9.81\n",
      "q = (Cd*a1*a2*((2*g*h)**0.5))/(((a1**2)-(a2**2))**0.5)\n",
      "dp = (h+dz)*w\n",
      "\n",
      "# Results \n",
      "print \"discharge of the oil in m3/sec\",round(q,4)\n",
      "print \"pressure diffrence in entrance and throat section \",dp,\"N/m**2\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "discharge of the oil in m3/sec 0.1488\n",
        "pressure diffrence in entrance and throat section  33795.45 N/m**2\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.10 Page No : 70"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "H = 0.1\n",
      "w = 9810.\n",
      "sw = 12.\n",
      "\n",
      "# Calculations \n",
      "h = H*(w/sw)\n",
      "Cv = 0.96\n",
      "g = 9.81\n",
      "v = Cv*((2*g*h)**0.5)\n",
      "v1 = v*18/5\n",
      "\n",
      "# Results \n",
      "print \"speed of the plane\",round(v1,2),\"Km/hr\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "speed of the plane 138.41 Km/hr\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.11 Page No : 71"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Variables\n",
      "d1 = 0.05\n",
      "d2 = 0.025\n",
      "\n",
      "# Calculations \n",
      "a1 = math.pi*d1*d1/4\n",
      "a2 = math.pi*d2*d2/4\n",
      "Cd = 0.94\n",
      "g = 9.81\n",
      "k = ((((a1**2)/(a2**2))-1)*(1-(Cd**2)))/(2*g*(a1**2)*(Cd**2))\n",
      "\n",
      "# Results \n",
      "print \"venturimeter constant m-5/s2\",round(k,3)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "venturimeter constant m-5/s2 26123.403\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.12 Page No : 73"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Variables\n",
      "d0 = 0.05\n",
      "d1 = 0.1\n",
      "H = 0.09\n",
      "s2 = 13.6\n",
      "s1 = 1\n",
      "g = 9.81\n",
      "\n",
      "# Calculations \n",
      "h = H*((s2/s1)-1)\n",
      "Cd = 0.65\n",
      "a1 = math.pi*d1*d1/4\n",
      "a0 = math.pi*d0*d0/4\n",
      "q = (Cd*a1*a0*((2*g*h)**0.5))/(((a1**2)-(a0**2))**0.5)\n",
      "q1 = q*(10**6)\n",
      "\n",
      "# Results \n",
      "print \"actual flow rate in cm3/sec\",round(q1,3),\"cm**3/s\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "actual flow rate in cm3/sec 6217.469 cm**3/s\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}