diff options
author | kinitrupti | 2017-05-12 18:53:46 +0530 |
---|---|---|
committer | kinitrupti | 2017-05-12 18:53:46 +0530 |
commit | f270f72badd9c61d48f290c3396004802841b9df (patch) | |
tree | bc8ba99d85644c62716ce397fe60177095b303db /Hydraulics_by_J._Lal/Chapter_3.ipynb | |
parent | 64d949698432e05f2a372d9edc859c5b9df1f438 (diff) | |
download | Python-Textbook-Companions-f270f72badd9c61d48f290c3396004802841b9df.tar.gz Python-Textbook-Companions-f270f72badd9c61d48f290c3396004802841b9df.tar.bz2 Python-Textbook-Companions-f270f72badd9c61d48f290c3396004802841b9df.zip |
Removed duplicates
Diffstat (limited to 'Hydraulics_by_J._Lal/Chapter_3.ipynb')
-rwxr-xr-x | Hydraulics_by_J._Lal/Chapter_3.ipynb | 705 |
1 files changed, 705 insertions, 0 deletions
diff --git a/Hydraulics_by_J._Lal/Chapter_3.ipynb b/Hydraulics_by_J._Lal/Chapter_3.ipynb new file mode 100755 index 00000000..6b36939a --- /dev/null +++ b/Hydraulics_by_J._Lal/Chapter_3.ipynb @@ -0,0 +1,705 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:97f449fad397b42ecb1501f787392dc6e0950fafed8997a70fb14e2a9c19a198" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 3 : Flow Through Orifices Mouthpieces Nozzles" + ] + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.1 page no : 70" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#initialisation of variables\n", + "\n", + "import math \n", + "Q = 16. \t\t\t#gpm\n", + "w = 62.4 \t\t\t#lb/ft**3\n", + "d = 1. \t\t\t#in\n", + "h = 2+(5./12) \t\t\t#ft\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "x = 11.5 \t\t\t#ft\n", + "h1 = 1.2 \t\t\t#in\n", + "#CALCULATIONS\n", + "Cd = Q*10/(60*w*(math.pi*(d/12)**2/4)*math.sqrt(2*g*h))\n", + "Cv = math.sqrt(x**2/(4*(h1/12)*h*12**2))\n", + "Cc = Cd/Cv\n", + "Cr = (1-Cv**2)/Cv**2\n", + "#RESULTS\n", + "print 'Cc = %.3f '%(Cc)\n", + "print 'Cv = %.3f '%(Cv)\n", + "print 'Cd = %.3f '%(Cd)\n", + "print 'Cr = %.3f '%(Cr)\n", + "\n", + "# note : answers are slightly different because of rounding error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Cc = 0.644 \n", + "Cv = 0.975 \n", + "Cd = 0.628 \n", + "Cr = 0.053 \n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.2 page no : 71" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "Ww = 261. \t\t\t#lb/min\n", + "a = 1. \t\t\t#in**2\n", + "h = 4. \t\t\t#ft\n", + "y = 5. \t\t\t#ft\n", + "W1 = 10.65 \t\t\t#lb\n", + "l = 1. \t\t\t#ft\n", + "Q = 261. \t\t\t#lb/min\n", + "w = 62.4 \t\t\t#lb/ft**3\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "#CALCULATIONS\n", + "v = Q*144./(w*60)\n", + "F = W1*l/y\n", + "v = F*g*60./Q\n", + "vth = math.sqrt(2*g*h)\n", + "Cv = v/vth\n", + "Q1 = Ww/w\n", + "Qth = vth*60./144\n", + "Cd = Q1/Qth\n", + "Cc = Cd/Cv\n", + "#RESULTS\n", + "print 'Cv = %.3f '%(Cv)\n", + "print 'Cd = %.3f '%(Cd)\n", + "print 'Cc = %.3f '%(Cc)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Cv = 0.982 \n", + "Cd = 0.625 \n", + "Cc = 0.637 \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.3 page no : 74" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#initialisation of variables\n", + "\n", + "import math \n", + "Q = 10. \t\t\t#ft**3/sec\n", + "a1 = 1. \t\t\t#ft**2\n", + "a2 = 4. \t\t\t#ft**2\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "p1 = 12. \t\t\t#lb/in**2\n", + "v1 = 10. \t\t\t#ft/sec\n", + "w = 62.4 \t\t\t#lb/ft**3\n", + "#RESULTS\n", + "v2 = v1*a1/a2\n", + "Hl = (v1-v2)**2/(2*g)\n", + "p2 = ((p1*144/w)+(v1**2/(2*g))-(v2**2/(2*g))-Hl)*(w/144)\n", + "W = Hl*v1*w/550.\n", + "\n", + "#RESULTS\n", + "print 'Head lost = %.3f ft of water '%(Hl)\n", + "print 'Pressure in larger part of pipe = %.2f lb/in**2 '%(p2)\n", + "print 'Work done = %.3f HP '%(W)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Head lost = 0.873 ft of water \n", + "Pressure in larger part of pipe = 12.25 lb/in**2 \n", + "Work done = 0.991 HP \n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.4 page no : 78" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#initialisation of variables\n", + "\n", + "import math \n", + "Cc = 1.\n", + "Cv = 0.833\n", + "d = 2. \t\t\t#in\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "H = 12. \t\t\t#ft\n", + "Pa = 34. \t\t\t#lb/in**2\n", + "#/CALCULATIONS\n", + "Q = Cc*Cv*math.pi*(d/12)**2*math.sqrt(2*g*H)/4\n", + "Cd = Cc*Cv\n", + "Pc = Pa-0.92*H\n", + "#RESULTS\n", + "#RESULTS\n", + "print 'Discharge = %.3f cu ft/sec '%(Q)\n", + "print 'Coefficient of discharge = %.3f '%(Cd)\n", + "print 'Pressure at Vent-contraction = %.2f ft of water '%(Pc)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge = 0.505 cu ft/sec \n", + "Coefficient of discharge = 0.833 \n", + "Pressure at Vent-contraction = 22.96 ft of water \n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.5 page no : 81" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "H = 4. \t\t\t#ft\n", + "d = 1. \t\t\t#in\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "Cc = 0.5\n", + "#CALCULATIONS\n", + "Q = Cc*math.pi*(d/12)**2*math.sqrt(2*g*H)/4\n", + "#RESULTS\n", + "print 'Actual Discharge = %.4f cu ft/sec '%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Actual Discharge = 0.0438 cu ft/sec \n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.6 page no : 82" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "\n", + "D = 4. \t\t\t#ft\n", + "d = 2. \t\t\t#in\n", + "H1 = 6. \t\t\t#ft\n", + "H2 = 2. \t\t\t#ft\n", + "t = 4. \t\t\t#min\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "w = 62.4 \t\t\t#lb/ft**3\n", + "H = 5. \t\t\t#ft\n", + "#CALCULATIONS\n", + "Cd = (2.*(math.pi/4.)*D**2*(math.sqrt(H1)-math.sqrt(H2)))/(t*60*(math.pi/4)*(d/12)**2*math.sqrt(2*g))\n", + "Q = Cd*(math.pi/4)*(d/12)**2*math.sqrt(2*g*H)*w*60/10\n", + "#RESULTS\n", + "print 'Cd = %.3f '%(Cd)\n", + "print 'Discharge = %.1f gpm'%(Q)\n", + "\n", + "# note : answers are slightly different because of rounding error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Cd = 0.619 \n", + "Discharge = 90.8 gpm\n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.7 page no : 84" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "H1 = 10. \t\t\t#ft\n", + "H2 = 2. \t\t\t#ft\n", + "Cd = 0.61\n", + "d1 = 8. \t\t\t#ft\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "d2 = 3. \t\t\t#ft\n", + "#CALCULATIONS\n", + "a = d2**2./144\n", + "H0 = H1*d2/(d1-d2)\n", + "t = math.pi*(d1/2)**2*((2/5.)*(H1**(5./2)-H2**(5./2))+2*H0**2*(math.sqrt(H1)- \\\n", + "math.sqrt(H2))+(4./3)*H0*(H1**(3./2)-H2**(3./2)))/(60*Cd*a*math.sqrt(2*g)*(H1+H0)**2)\n", + "\n", + "#RESULTS\n", + "print 'time required to lower the water level = %.2f min'%(t)\n", + "\n", + "# Note : answer is different because of rounding error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "time required to lower the water level = 5.14 min\n" + ] + } + ], + "prompt_number": 26 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.8 page no : 85" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#initialisation of variables\n", + "D = 10. \t\t\t#ft\n", + "H1 = 17. \t\t\t#ft\n", + "H2 = 5. \t\t\t#ft\n", + "d = 3. \t\t\t#in\n", + "Cd = 0.62\n", + "g =32.2 \t\t\t#ft/s**2\n", + "#CALCULATIONS\n", + "t1 = (2*math.pi*D**2/4)*(math.sqrt(H1)-math.sqrt(H2))/(Cd*math.sqrt(2*g)*math.pi*(d/12)**2/4)\n", + "t2 = math.pi*(14./15)*H2**(5./2)*4/(Cd*math.pi*(d/12.)**2*math.sqrt(2*g))\n", + "t = t1+t2\n", + "#RESULTS\n", + "print 'time required to empty the vessel = %.f sec'%(t)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "time required to empty the vessel = 1885 sec\n" + ] + } + ], + "prompt_number": 27 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.9 page no : 86" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "Cd = 0.8\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "d = 3. \t\t\t#in\n", + "#CALCULATIONS\n", + "t = (60*2/(math.pi*(d/12)**2*math.sqrt(2*g)/4*Cd))*(6-d)**(3./2)/(3*60./2)\n", + "#RESULTS\n", + "print 'time to emptify biler = %.2f min'%(t)\n", + "\n", + "# note : answer is different because of rounding error." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "time to emptify biler = 21.98 min\n" + ] + } + ], + "prompt_number": 33 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.10 page no : 87" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "\n", + "#initialisation of variables\n", + "A = 100 * 27 # sq ft\n", + "dif = 8 - 3. # ft\n", + "a = 2. # sq ft\n", + "Cd = 0.8 # Co-efficient\n", + "\n", + "#CALCULATIONS\n", + "t1 = round(A*((a/3 * 22.7) - a/3 * 5.19 - (a/3*11.2))/(Cd*2*8.02*dif))\n", + "t2 = round(A*(2./3)*11.2/(Cd*a*8.02*dif))\n", + "t = t1 + t2\n", + "\n", + "#RESULTS\n", + "print 'Total time to empty the tank = %d sec'%t" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total time to empty the tank = 491 sec\n" + ] + } + ], + "prompt_number": 45 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.11 page no : 89" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math \n", + "#initialisation of variables\n", + "H1 = 9. \t\t\t#ft\n", + "H2 = 4. \t\t\t#ft\n", + "Cd = 0.6\n", + "a = 4. \t\t\t#in**2\n", + "A1 = 72. \t\t\t#ft**2\n", + "A2 = 24. \t\t\t#ft**2\n", + "g =32.2 \t\t\t#ft/s**2\n", + "#CALCULATIONS\n", + "t = (2*A1*A2/(A1+A2))*(math.sqrt(H1)-math.sqrt(H2))*144/(Cd*60*a*math.sqrt(2*g))\n", + "#RESULTS\n", + "print 'time required to reduce the water level difference = %.1f min'%(t)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "time required to reduce the water level difference = 4.5 min\n" + ] + } + ], + "prompt_number": 26 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.12 pageno : 91" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#initialisation of variables\n", + "import math \n", + "l = 80. \t\t\t#ft\n", + "w = 12. \t\t\t#ft\n", + "t = 3. \t\t\t#min\n", + "Hl = 12. \t\t\t#ft\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "Cd = 0.6\n", + "#CALCULATIONS\n", + "s = math.sqrt(2*l*w*Hl**(1./2)/(Cd*math.sqrt(2*g)*t*60.))\n", + "#RESULTS\n", + "print 'side of the square orifice = %.2f ft'%(s)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "side of the square orifice = 2.77 ft\n" + ] + } + ], + "prompt_number": 46 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.13 page no : 92" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "#initialisation of variables\n", + "import math \n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "Cd = 0.6\n", + "d = 2. \t\t\t#in\n", + "H1 = 5. \t\t\t#ft\n", + "\n", + "#CALCULATIONS\n", + "K = round(Cd * math.pi/4 * (d/12)**2 * math.sqrt(g*2),3)\n", + "t = d*math.pi*(0.5*math.log(1.89) - 0.235)/K**2 \n", + "v = round(math.sqrt(2*g*H1)/2.)\n", + "q = v*Cd*math.pi*(d/12)**2./4\n", + "\n", + "#RESULTS\n", + "print \"Time required to raise the level is : %.2f sec\"%t\n", + "print 'Total discharge = %.3f cfs'%(q)\n", + "\n", + "# Note : answers may vary because of rounding error. Please calculate manually." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Time required to raise the level is : 47.47 sec\n", + "Total discharge = 0.118 cfs\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.14 page no : 95" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "Cd = 0.62\n", + "H = 9. \t\t\t#in\n", + "l = 3. \t\t\t#ft\n", + "g = 32.2 \t\t\t#t/sec**2\n", + "#CALCULATIONS\n", + "Q1 = Cd*(H*l/12)*math.sqrt(2*g*3*H/24.)\n", + "Q2 = Cd*2*l*math.sqrt(2*g)*((H/6)**(3./2)-(H/12)**(3./2))/3\n", + "#RESULTS\n", + "print 'Discharge by appropriate formula = %.2f cfs'%(Q1)\n", + "print ' Discharge by exact formula = %.2f cfs'%(Q2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Discharge by appropriate formula = 11.87 cfs\n", + " Discharge by exact formula = 11.82 cfs\n" + ] + } + ], + "prompt_number": 54 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 3.15 pageno : 95" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math \n", + "#initialisation of variables\n", + "\n", + "Cd = 0.62\n", + "B = 2.5 \t\t\t#ft\n", + "H2 = 8. \t\t\t#ft\n", + "H1 = 7. \t\t\t#ft\n", + "g = 32.2 \t\t\t#ft/sec**2\n", + "h = 4. \t\t\t#ft\n", + "#CALCULATIONS\n", + "Q1 = round(2*Cd*B*math.sqrt(2*g)*(H2**(3./2)-H1**(3./2))/3)\n", + "Q2 = Cd*math.sqrt(2*g)*math.sqrt(H2)*B*(h-1)\n", + "Q = Q1+Q2\n", + "#RESULTS\n", + "print 'Total discharge = %d cfs'%(Q)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total discharge = 139 cfs\n" + ] + } + ], + "prompt_number": 60 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file |