summaryrefslogtreecommitdiff
path: root/Elementary_Fluid_Mechanics/ch9.ipynb
diff options
context:
space:
mode:
authornice2014-09-15 12:50:58 +0530
committernice2014-09-15 12:50:58 +0530
commitdfe3c858e90bb33c32f84a46e0a17cdd93b38e11 (patch)
tree8c68c3908ca451c3c8362fa104272af669de99d8 /Elementary_Fluid_Mechanics/ch9.ipynb
parentcb9f5bedfa86923784f479aff86cd9d22c09f0ff (diff)
downloadPython-Textbook-Companions-dfe3c858e90bb33c32f84a46e0a17cdd93b38e11.tar.gz
Python-Textbook-Companions-dfe3c858e90bb33c32f84a46e0a17cdd93b38e11.tar.bz2
Python-Textbook-Companions-dfe3c858e90bb33c32f84a46e0a17cdd93b38e11.zip
added books
Diffstat (limited to 'Elementary_Fluid_Mechanics/ch9.ipynb')
-rwxr-xr-xElementary_Fluid_Mechanics/ch9.ipynb780
1 files changed, 780 insertions, 0 deletions
diff --git a/Elementary_Fluid_Mechanics/ch9.ipynb b/Elementary_Fluid_Mechanics/ch9.ipynb
new file mode 100755
index 00000000..bbe5b2d4
--- /dev/null
+++ b/Elementary_Fluid_Mechanics/ch9.ipynb
@@ -0,0 +1,780 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:0b5a0b6f6c6e071c339201ca91727b19aa4afe9cff0ebf23f723c14d23de7be3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9 : Fluid Flow in Pipes"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.1 Page No : 281"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math \n",
+ "\n",
+ "# variables\t\t\n",
+ "d = 6.;\t \t#inches\n",
+ "v = 15.;\t\t#fps\n",
+ "l = 100.;\t\t#ft\n",
+ "h_L = 17.5;\t\t#ft\n",
+ "\n",
+ "# calculations \n",
+ "f = round(h_L*(d/(12*l))*(2*32.2/v**2),3);\n",
+ "V_f = v*math.sqrt(f/8.);\n",
+ "\n",
+ "# results \n",
+ "print 'The friction velocity = %.2f fps'%(V_f);\n",
+ "\n",
+ "#incorrect answer in textbook"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0.025\n",
+ "The friction velocity = 0.84 fps\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.2 Page No : 285"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math \n",
+ "\t\t\n",
+ "# variables\n",
+ "T = 100.;\t\t# degreeF\n",
+ "d = 3.;\t\t # inches\n",
+ "Re = 80000.;\t# Reynolds number\n",
+ "e = 0.006;\t\t# inches\n",
+ "l = 1000.;\t\t#feet\n",
+ "f1 = 0.021;\t\t#friction factor\n",
+ "nu = 0.729*10**-5;\t\t# sqft/sec\n",
+ "\n",
+ "# calculations \n",
+ "V = Re*nu/0.25;\n",
+ "h_L1 = f1*(l/0.25)*(V**2 /(2*32.2));\n",
+ "f = 0.316/Re**0.25;\n",
+ "h_L = (f/f1)*h_L1;\n",
+ "\n",
+ "# results \n",
+ "print 'Head loss expected = %.1f ft and head loss expected if the pipe were smooth = %.2f ft'%(h_L1,h_L);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Head loss expected = 7.1 ft and head loss expected if the pipe were smooth = 6.35 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.3 Page No : 288"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math \n",
+ "\t\t\n",
+ "# variables\n",
+ "T = 100.;\t\t#degreeF\n",
+ "d = 3.;\t\t # inches\n",
+ "Re = 80000.;\t# Reynolds number\n",
+ "e = 0.006;\t\t#inches\n",
+ "l = 1000.;\t\t#ft\n",
+ "f = 0.0255;\t\t#friction factor\n",
+ "V = 2.33;\t\t#fps\n",
+ "\n",
+ "# calculations \n",
+ "h_L = f*(l/0.25)*(V**2 /(2*32.2));\n",
+ "\n",
+ "# results \n",
+ "print 'Head loss expected = %.1f ft'%(h_L);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Head loss expected = 8.6 ft\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.4 Page No : 290"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math \n",
+ "\t\t\n",
+ "# variables\n",
+ "Q = 100.;\t\t#gallons per minute\n",
+ "sg = 0.90;\n",
+ "nu = 0.0012;\t# lb-sec/sqft\n",
+ "d = 3.;\t\t # in\n",
+ "l = 1000.;\t\t#ft\n",
+ "r = 1.;\t\t #in\n",
+ "V = 4.53;\t\t#fps\n",
+ "\n",
+ "# calculations \n",
+ "Re = V*(d/12)*sg*1.935/nu;\n",
+ "h_L = (64/Re)*(12*l/d)*(V**2 /(2*32.2));\n",
+ "v = 2*V*(1 - (2/d)**2);\n",
+ "tau = 62.4*sg*h_L/(2*l*12);\n",
+ "\n",
+ "# results \n",
+ "print 'v = %.2f fps, h_L = %.1f ft of oil and tau = %.3f psf'%(v,h_L,tau);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "v = 5.03 fps, h_L = 49.6 ft of oil and tau = 0.116 psf\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.5 pageno : 293"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# variables\n",
+ "# assume\n",
+ "v_vc = 0.80 \n",
+ "V = 8.35 #fps\n",
+ "R = 737000\n",
+ "f = 0.019 # from fig.\n",
+ "\n",
+ "# calculations\n",
+ "V_Vc = 1./(1+ 4.07* math.sqrt(f/8))\n",
+ "Q = math.pi * V/4\n",
+ "# results\n",
+ "print \"V/Vc = %.3f\"%V_Vc\n",
+ "print \"Q = %.2f cfs\"%Q"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "V/Vc = 0.834\n",
+ "Q = 6.56 cfs\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.6 Page No : 295"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math \n",
+ "\t\t\n",
+ "# variables\n",
+ "Q = 90.;\t\t# gallons per minute\n",
+ "T = 68.;\t\t#degreeF\n",
+ "d = 3.;\t\t # in\n",
+ "l = 3000.;\t\t#ft\n",
+ "r = 1.;\t\t # in\n",
+ "f = 0.018;\n",
+ "\n",
+ "# calculations \n",
+ "V = Q/(60*7.48*0.25*math.pi*(d/12)**2);\n",
+ "Re = V*(d/12)*1.935/(0.000021);\n",
+ "h_L = f*(l/0.25)*(V**2 /(2*32.2));\n",
+ "tau_0 = f*1.935*V**2 /8;\n",
+ "tau1 = 2*tau_0/d;\n",
+ "v_c = V*(1+4.07*math.sqrt(f/8));\n",
+ "v_ = math.sqrt(tau_0/1.935);\n",
+ "v1 = v_*(5.50+5.75*math.log10(v_*(r/(2*12))/0.00001085));\n",
+ "v1_ = v_c-v_*5.75*math.log10(0.5*d/(r/2));\n",
+ "delta = d*32.8/(Re*math.sqrt(f));\n",
+ "\n",
+ "# results \n",
+ "print 'Head lost = %.1f ft of water \\\n",
+ "\\nWall shear stress = %.3f psf \\\n",
+ "\\nthe center velocity = %.2f fps \\\n",
+ "\\nshearing stress = %.3f psf \\\n",
+ "\\nv1 = %.2f fps \\\n",
+ "\\ndelta = %.4f in.'%(h_L,tau_0,v_c,tau1,v1_,delta);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Head lost = 56.0 ft of water \n",
+ "Wall shear stress = 0.073 psf \n",
+ "the center velocity = 4.87 fps \n",
+ "shearing stress = 0.048 psf \n",
+ "v1 = 4.34 fps \n",
+ "delta = 0.0078 in.\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.7 Page No : 298"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math \n",
+ "\t\t\n",
+ "# variables\n",
+ "d = 12.;\t\t# in\n",
+ "v = 10.;\t\t#fps\n",
+ "e = 2.;\t\t #in\n",
+ "k = 0.002;\t\t#relative roughness\n",
+ "l = 1000.;\t\t#ft\n",
+ "\n",
+ "# calculations \n",
+ "f = (1/(1.14+2*math.log10(1/k)))**2;\n",
+ "v_c = v*(1+4.07*math.sqrt(f/8));\n",
+ "tau_0 = f*1.935*v**2 /8;\n",
+ "v2 = v_c - tau_0*5.75*math.log10(0.5*d/e);\n",
+ "v2_ = 8.48*tau_0 + tau_0*5.75*math.log10(e/(12*k));\n",
+ "h_L = f*(l)*v**2 /(2*32.2); \n",
+ "\n",
+ "# results \n",
+ "print 'f = %.4f, v_c = %.2f fps, v2 = %.1f fps and h_L = %.1f ft of water'%(f,v_c,v2_,h_L);\n",
+ "\n",
+ "#there are small errors in the answer given in textbook"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "f = 0.0234, v_c = 12.20 fps, v2 = 11.0 fps and h_L = 36.3 ft of water\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.8 Page No : 300"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math \n",
+ "\t\t\n",
+ "# variables\n",
+ "V = 4.08;\t\t # fps\n",
+ "Re = 93800.;\t\t#Reynolds number\n",
+ "r = 1.;\t\t#in\n",
+ "m = 1./7;\n",
+ "R = 3.;\t\t#in\n",
+ "\n",
+ "# calculations \n",
+ "f = 0.316/(Re**0.25);\n",
+ "v_c = V/(2/((m+1)*(m+2)));\n",
+ "v1 = v_c*(r/R)**(1./7);\n",
+ "tau_0 = f*1.935*V**2 /8;\n",
+ "\n",
+ "# results \n",
+ "print 'f = %.3f, v_c = %.2f fps, v1 = %.2f fps and wall shear = %.3f ps'%(f,v_c,v1,tau_0);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "f = 0.018, v_c = 5.00 fps, v1 = 4.27 fps and wall shear = 0.073 ps\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.9 Page No : 302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math \n",
+ "\t\t\n",
+ "# variables\n",
+ "p = 14.7;\t\t#psia\n",
+ "T = 60.;\t\t# degreeF\n",
+ "l = 2000.;\t\t#ft\n",
+ "b = 18.;\t\t#in\n",
+ "h = 12.;\t\t# in\n",
+ "v = 10.;\t\t# fps\n",
+ "\n",
+ "# calculations \n",
+ "R_h = (b*h)/(2*12*(b+h));\n",
+ "Re = v*4*R_h*0.0763/(32.2*0.000000375);\n",
+ "f = 0.019;\n",
+ "h_L = f*(l/(4*R_h))*v**2 /(2*32.2);\n",
+ "del_p = 0.0763*h_L;\n",
+ "\n",
+ "# results \n",
+ "print 'loss of head = %.1f ft of air and the pressure drop = %.2f psf = %.3f psi'%(h_L,del_p,del_p*0.0069);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "loss of head = 49.2 ft of air and the pressure drop = 3.75 psf = 0.026 psi\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.10 Page No : 305"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math \n",
+ "\n",
+ "# variables\n",
+ "Q = 90.;\t\t#gpm\n",
+ "d = 3.;\t\t#in\n",
+ "l = 3000.;\t\t#ft\n",
+ "\n",
+ "# calculations \n",
+ "V = Q/(60*7.48*0.25*math.pi*(d/12)**2);\n",
+ "R_h = (d/12)/4;\n",
+ "C_hw = 140;\n",
+ "S = (V/(1.318*140*R_h**0.63))**(1/0.54);\n",
+ "h_L = S*l;\n",
+ "\n",
+ "# results \n",
+ "print 'The loss of head = %.1f ft of water'%(h_L);\n",
+ "\n",
+ "\t\t"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The loss of head = 65.7 ft of water\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.11 Page No : 307"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from sympy import *\n",
+ "import math \n",
+ "\n",
+ "# variables\n",
+ "G = 40.;\t\t# lb/min\n",
+ "d = 3.;\t\t# in\n",
+ "T = 100.;\t\t# degreeF\n",
+ "p = 50.;\t\t# psia\n",
+ "l = 2000.;\t\t#ft\n",
+ "\n",
+ "# calculations \n",
+ "Re = ((G/60)*(d/12))/(0.0491*32.2*4*10**-7);\n",
+ "f = 0.015;\n",
+ "gam1 = p*(144/(53.3*(T+460)));\n",
+ "V1 = (G/60)/(gam1*0.0491);\n",
+ "a = math.sqrt(1.4*32.2*53.3*(T+460));\n",
+ "M1 = V1/a;\n",
+ "M2_limit = math.sqrt(1/1.4);\n",
+ "l = (((1-(M1/M2_limit)**2)/(1.4*M1**2)) - 2*math.log(M2_limit/M1))*(0.25/0.015);\n",
+ "p2 = 38.9;\t\t#psia, from trial and error method \n",
+ "#p2 = Symbol('p2')\n",
+ "#ans = solve((G/60)**2 * 53.3*560/(32.2 * 0.0491**2) * (2*log(p/p2) + gam1*l/0.25) - (144**2 * (p**2 - p2**2)))\n",
+ "\n",
+ "# results \n",
+ "print 'p2 = %.1f psia'%(p2);\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "p2 = 38.9 psia\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.12 Page No : 312"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math \n",
+ "\t\t\n",
+ "# variables\n",
+ "d = 12.;\t\t# in\n",
+ "D = 24.;\t\t#in\n",
+ "theta = 20.;\t\t#degrees\n",
+ "G = 10.;\t\t#cfs\n",
+ "p = 20.;\t\t#psi\n",
+ "\n",
+ "# calculations \n",
+ "V12 = G/(0.25*math.pi);\n",
+ "V24 = V12/4;\n",
+ "K_L = 0.43;\n",
+ "p24 = ((p*144/62.4) + (V12**2 /(2*32.2)) - ((V24**2)/(2*32.2)) - K_L*(V12-V24)**2 /(2*32.2))/2.314;\n",
+ "\n",
+ "# results \n",
+ "print 'Pressure in the larger pipe = %.1f psi'%(p24);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure in the larger pipe = 20.7 psi\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.13 Page No : 322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math \n",
+ "\n",
+ "# variables\n",
+ "d = 12.;\t\t# in\n",
+ "l = 1000.;\t\t#ft\n",
+ "h1 = 200.;\t\t#elevation\n",
+ "h2 = 250.;\t\t#elevation\n",
+ "T = 50.;\t\t#degreeF\n",
+ "f1 = 0.030;\n",
+ "\n",
+ "# calculations \n",
+ "V1 = math.sqrt((h2-h1)*2*32.2/(0.5+f1*l +1));\n",
+ "R1 = V1/0.00000141;\n",
+ "f2 = 0.019;\n",
+ "V2 = math.sqrt((h2-h1)*2*32.2/(0.5+f2*l +1));\n",
+ "R2 = V1/0.00000141;\n",
+ "Q = 0.25*math.pi*(d/12)**2 *V2; \n",
+ "\n",
+ "# results \n",
+ "print 'Velocity = %.1f fps \\\n",
+ "\\nflow rate = %.1f cfs'%(V2,Q);\n",
+ "\n",
+ "\t\t#there is a minute error in the answer given in textbook"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity = 12.5 fps \n",
+ "flow rate = 9.8 cfs\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.14 Page No : 322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math \n",
+ "\t\t\n",
+ "# variables\n",
+ "l = 200.;\t\t#ft\n",
+ "Q = 0.1;\t\t#cfs\n",
+ "del_h = 5.;\t\t#ft\n",
+ "T = 50.;\t\t#degreeF\n",
+ "d = 0.187;\t\t#ft\n",
+ "\n",
+ "# calculations \n",
+ "V = Q/(0.25*math.pi*d**2);\n",
+ "R = V*d/0.0000141;\n",
+ "f = (del_h*2*32.2/V**2 -(1+0.5))*(d/l);\n",
+ "\n",
+ "# results \n",
+ "print 'Required diameter of the pipe = %.2f in.'%(d*12);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Required diameter of the pipe = 2.24 in.\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.15 Page No : 324"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math \n",
+ "\t\t\n",
+ "# variables\n",
+ "Q = 2.5;\t\t#cfs\n",
+ "T = 50.;\t\t#degreeF\n",
+ "d1 = 8.;\t\t#in\n",
+ "d2 = 6.;\t\t#in\n",
+ "l1 = 1000.;\t\t#ft\n",
+ "l2 = 2000.;\t\t#ft\n",
+ "\n",
+ "# calculations \n",
+ "V8 = Q/(0.25*math.pi*(d1/12)**2);\n",
+ "V6 = Q/(0.25*math.pi*(d2/12)**2);\n",
+ "R8 = V8*0.667/0.0000141;\n",
+ "f8 = 0.020;\n",
+ "R6 = V6*0.5/0.0000141;\n",
+ "f6 = 0.019;\n",
+ "h_L8 = f8*(l1/0.667)*(V8**2 /(2*32.2));\n",
+ "h_L6 = f6*(l2/0.5)*(V6**2 /(2*32.2));\n",
+ "Ep = 100+h_L8+h_L6;\n",
+ "n = Q*62.4*(Ep)/550;\n",
+ "V8 = math.sqrt((30/f8)*2*32.2/(l1/0.667));\n",
+ "Q_max = V8*0.25*math.pi*(d1/12)**2;\n",
+ "\n",
+ "# results \n",
+ "print 'Maximum reliable flow that can be pumped = %.1f cfs'%(Q_max);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum reliable flow that can be pumped = 2.8 cfs\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9.16 Page No : 327"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math \n",
+ "\t\t\n",
+ "# variables\n",
+ "Q = 5.;\t\t#cfs\n",
+ "d = 12.;\t\t#in\n",
+ "l = 5000.;\t\t#ft\n",
+ "h = 70.;\t\t#ft\n",
+ "L = 2000.;\t\t#ft\n",
+ "\n",
+ "# calculations \n",
+ "K = (h/Q**1.85);\n",
+ "a = (L/l)*K;\n",
+ "b = ((l-L)/l)*K;\n",
+ "Q_ = (h/((b+a*(0.5**(1.85)))))**(1/1.85);\n",
+ "Q_A = Q_/2;\n",
+ "Q_B = Q_/2;\n",
+ "del1 = Q_-Q;\t\t#gain capcaity\n",
+ "percent = (del1/Q)*100;\t\t#gain percentage\n",
+ "\n",
+ "# results \n",
+ "print 'The gain of capacity by looping the pipe is %.1f cfs or %d percentage'%(del1,percent);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gain of capacity by looping the pipe is 1.0 cfs or 20 percentage\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file