summaryrefslogtreecommitdiff
path: root/Fluid_mechanics
diff options
context:
space:
mode:
Diffstat (limited to 'Fluid_mechanics')
-rwxr-xr-xFluid_mechanics/Chapter_10.ipynb234
-rwxr-xr-xFluid_mechanics/Chapter_11.ipynb485
-rwxr-xr-xFluid_mechanics/Chapter_2.ipynb406
-rwxr-xr-xFluid_mechanics/Chapter_3.ipynb105
-rwxr-xr-xFluid_mechanics/Chapter_4.ipynb777
-rwxr-xr-xFluid_mechanics/Chapter_5.ipynb244
-rwxr-xr-xFluid_mechanics/Chapter_6.ipynb118
-rwxr-xr-xFluid_mechanics/Chapter_7.ipynb874
-rwxr-xr-xFluid_mechanics/Chapter_8.ipynb802
-rwxr-xr-xFluid_mechanics/Chapter_9.ipynb450
-rwxr-xr-xFluid_mechanics/README.txt10
-rwxr-xr-xFluid_mechanics/screenshots/chap2.pngbin63575 -> 0 bytes
-rwxr-xr-xFluid_mechanics/screenshots/chap3.pngbin67113 -> 0 bytes
-rwxr-xr-xFluid_mechanics/screenshots/chap4.pngbin42703 -> 0 bytes
14 files changed, 0 insertions, 4505 deletions
diff --git a/Fluid_mechanics/Chapter_10.ipynb b/Fluid_mechanics/Chapter_10.ipynb
deleted file mode 100755
index bdfb09f7..00000000
--- a/Fluid_mechanics/Chapter_10.ipynb
+++ /dev/null
@@ -1,234 +0,0 @@
-{
- "metadata": {
- "name": "",
- "signature": "sha256:8ebaaa4d9fc694c6b4303418dc1faf3eef2d83f1637b122e018c6c5eac0aba66"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 10 - Dynamic lift"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2a - Pg 427"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the max. theoretical propulsive force\n",
- "#Initialization of variables\n",
- "import math\n",
- "vel=50. #mph\n",
- "w=240. #rpm\n",
- "r0=3. #ft\n",
- "L=30. #ft\n",
- "rho=0.00230 #slug/ft^2\n",
- "theta=30*math.pi/180. #radians\n",
- "#calculations\n",
- "V=vel*5280./3600.\n",
- "T=2*math.pi*r0*r0 *w*2*math.pi/60.\n",
- "Fl=rho*V*T*L\n",
- "F=r0*Fl*math.cos(theta)\n",
- "#results\n",
- "print '%s %d %s' %(\"Max. theoretical porpulsive force =\",F,\"lb\")\n",
- "print '%s' %(\"The answers are a bit different from textbook due to rounding off error\")"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Max. theoretical porpulsive force = 18683 lb\n",
- "The answers are a bit different from textbook due to rounding off error\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2b - Pg 428"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the force required for the operation\n",
- "#Initialization of variables\n",
- "import math\n",
- "vel=50. #mph\n",
- "w=240. #rpm\n",
- "r0=3. #ft\n",
- "L=30. #ft\n",
- "rho=0.00230 #slug/ft^2\n",
- "theta=30*math.pi/180. #radians\n",
- "Cl=2\n",
- "Cd=1\n",
- "#calculations\n",
- "vc=r0*w\n",
- "V=vel*5280./3600.\n",
- "vr=vc/V\n",
- "A=2*r0*L\n",
- "Fl=Cl*A*0.5*rho*V*V \n",
- "Fd=Cd*A*0.5*rho*V*V\n",
- "F=r0*(Fl*math.cos(theta) + Fd*math.sin(theta))\n",
- "#results\n",
- "print '%s %d %s' %(\"Force required =\",F,\"lb\")\n",
- "print '%s' %(\"The answers are a bit different from textbook due to rounding off error\")"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Force required = 7454 lb\n",
- "The answers are a bit different from textbook due to rounding off error\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3a - Pg 432"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the boundary circulation\n",
- "#Initialization of variables\n",
- "W=7500 #pounds\n",
- "rho=0.00230\n",
- "V=175*5280/3600 #ft/s\n",
- "B=50\n",
- "#calculations\n",
- "T=W/(rho*V*B)\n",
- "#results\n",
- "print '%s %d %s' %(\"Boundary circulation =\",T,\"ft^2/s\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Boundary circulation = 254 ft^2/s\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3b - Pg 433"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the horsepower required for the operation\n",
- "#Initialization of variables\n",
- "W=7500. #pounds\n",
- "rho=0.00230\n",
- "V=175*5280./3600. #ft/s\n",
- "B=50.\n",
- "A=350. #ft^2\n",
- "#calculations\n",
- "Cl=W/(A*0.5*rho*V*V)\n",
- "Cd=0.03\n",
- "Fd=Cd*A*0.5*rho*V*V \n",
- "hp=Fd*V/550.\n",
- "#results\n",
- "print '%s %d %s' %(\"Horsepower required =\",hp,\"hp\")"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Horsepower required = 371 hp\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 4 - Pg 437"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the horsepower required for the operation\n",
- "#Initialization of variables\n",
- "import math\n",
- "Fl=7500. #pounds\n",
- "rho=0.00230\n",
- "V=175*5280./3600. #ft/s\n",
- "B=50\n",
- "A=350 #ft^2\n",
- "#calculations\n",
- "Vi=2*Fl/(math.pi*rho*V*B*B)\n",
- "Cl=Fl/(A*0.5*rho*V*V)\n",
- "Cdi=Cl*Vi/(V)\n",
- "Fdi=Cdi*A*0.5*rho*V*V\n",
- "hp=Fdi*V/550\n",
- "#results\n",
- "print '%s %.1f %s' %(\"Horsepower required =\",hp,\"hp\")"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Horsepower required = 44.1 hp\n"
- ]
- }
- ],
- "prompt_number": 6
- }
- ],
- "metadata": {}
- }
- ]
-} \ No newline at end of file
diff --git a/Fluid_mechanics/Chapter_11.ipynb b/Fluid_mechanics/Chapter_11.ipynb
deleted file mode 100755
index ec13c1a6..00000000
--- a/Fluid_mechanics/Chapter_11.ipynb
+++ /dev/null
@@ -1,485 +0,0 @@
-{
- "metadata": {
- "name": "",
- "signature": "sha256:525b51e826bc42c9a4490de8234c350df60c3a09744a8e35af1f480f12f531bc"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 11 - Flow of liquids in open channels"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 1a - Pg 454"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the discharge using darcy equation\n",
- "#Initialization of variables\n",
- "import math\n",
- "rho=1.94 #slugs/ft^3\n",
- "mu=2.34e-5 #lb-sec/ft^2\n",
- "y=5 #ft\n",
- "T=25 #ft\n",
- "d=10 #ft\n",
- "slope=3./2. \n",
- "g=32.2 #ft/s^2\n",
- "S=0.001\n",
- "#calculations\n",
- "A=y*d+ 2*0.5*y*(slope*y)\n",
- "WP=d+ 2*math.sqrt(3*3 +2*2) /2 *y\n",
- "R=A/WP\n",
- "e=0.01 #ft\n",
- "rr=2*R/e\n",
- "f=0.019\n",
- "C=math.sqrt(8*g/f)\n",
- "V=C*math.sqrt(R*S)\n",
- "Q=V*A\n",
- "#results\n",
- "print '%s %.1f %s' %(\"Discharge using Darcy equation =\",Q,\"ft^3/s\")\n",
- "print '%s' %(\"The answer is a bit different due to rounding off error in textbook\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Discharge using Darcy equation = 569.3 ft^3/s\n",
- "The answer is a bit different due to rounding off error in textbook\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 1b - Pg 453"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the discharge using kutter ganguillet method\n",
- "#Initialization of variables\n",
- "import math\n",
- "rho=1.94 #slugs/ft^3\n",
- "mu=2.34e-5 #lb-sec/ft^2\n",
- "y=5 #ft\n",
- "T=25 #ft\n",
- "d=10 #ft\n",
- "slope=3./2. \n",
- "g=32.2 #ft/s^2\n",
- "S=0.001\n",
- "n=0.017\n",
- "#calculations\n",
- "A=y*d+ 2*0.5*y*(slope*y)\n",
- "WP=d+ 2*math.sqrt(3*3 +2*2) /2 *y\n",
- "R=A/WP\n",
- "e=0.01 #ft\n",
- "rr=2*R/e\n",
- "f=0.019\n",
- "C=(41.65 + 0.00281/S + 1.811/n)/(1+( 41.65 + 0.00281/S)*n/math.sqrt(R))\n",
- "V=C*math.sqrt(R*S)\n",
- "Q=V*A\n",
- "#results\n",
- "print '%s %.1f %s' %(\"Discharge using kutter ganguillet formula =\",Q,\" ft^3/s\")\n",
- "print '%s' %(\"The answer is a bit different due to rounding off error in textbook\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Discharge using kutter ganguillet formula = 517.0 ft^3/s\n",
- "The answer is a bit different due to rounding off error in textbook\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 1c - Pg 455"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the discharge using bazin formula\n",
- "#Initialization of variables\n",
- "import math\n",
- "rho=1.94 #slugs/ft^3\n",
- "mu=2.34e-5 #lb-sec/ft^2\n",
- "y=5. #ft\n",
- "T=25. #ft\n",
- "d=10. #ft\n",
- "slope=3./2.\n",
- "g=32.2 #ft/s^2\n",
- "S=0.001\n",
- "m=0.21\n",
- "#calculations\n",
- "A=y*d+ 2*0.5*y*(slope*y)\n",
- "WP=d+ 2*math.sqrt(3*3 +2*2) /2 *y\n",
- "R=A/WP\n",
- "e=0.01 #ft\n",
- "rr=2*R/e\n",
- "f=0.019\n",
- "C=157.6 /(1+ m/math.sqrt(R))\n",
- "V=C*math.sqrt(R*S)\n",
- "Q=V*A\n",
- "#results\n",
- "print '%s %.1f %s' %(\"Discharge using bazin formula =\",Q,\" ft^3/s\")\n",
- "print '%s' %(\"The answer is a bit different due to rounding off error in textbook\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Discharge using bazin formula = 688.7 ft^3/s\n",
- "The answer is a bit different due to rounding off error in textbook\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 1d - Pg 456"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the discharge using darcy equation\n",
- "#Initialization of variables\n",
- "import math\n",
- "rho=1.94 #slugs/ft^3\n",
- "mu=2.34e-5 #lb-sec/ft^2\n",
- "y=5. #ft\n",
- "T=25. #ft\n",
- "d=10. #ft\n",
- "slope=3./2. \n",
- "g=32.2 #ft/s^2\n",
- "S=0.001\n",
- "n=0.017\n",
- "#calculations\n",
- "A=y*d+ 2*0.5*y*(slope*y)\n",
- "WP=d+ 2*math.sqrt(3*3 +2*2) /2 *y\n",
- "R=A/WP\n",
- "e=0.01 #ft\n",
- "rr=2*R/e\n",
- "f=0.019\n",
- "C=1.486*math.pow(R,(1./6.)) /n\n",
- "V=C*math.sqrt(R*S)\n",
- "Q=V*A\n",
- "#results\n",
- "print '%s %.1f %s' %(\"Discharge using Darcy equation =\",Q,\"ft^3/s\")\n",
- "print '%s' %(\"The answer is a bit different due to rounding off error in textbook\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Discharge using Darcy equation = 516.6 ft^3/s\n",
- "The answer is a bit different due to rounding off error in textbook\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 1e - Pg 456"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the froude number\n",
- "#Initialization of variables\n",
- "import math\n",
- "rho=1.94 #slugs/ft^3\n",
- "mu=2.34e-5 #lb-sec/ft^2\n",
- "y=5. #ft\n",
- "T=25. #ft\n",
- "d=10. #ft\n",
- "slope=3./2. \n",
- "g=32.2 #ft/s^2\n",
- "S=0.001\n",
- "n=0.017\n",
- "#calculations\n",
- "A=y*d+ 2*0.5*y*(slope*y)\n",
- "WP=d+ 2*math.sqrt(3*3 +2*2) /2 *y\n",
- "R=A/WP\n",
- "e=0.01 #ft\n",
- "rr=2*R/e\n",
- "f=0.019\n",
- "C=(41.65 + 0.00281/S + 1.811/n)/(1+( 41.65 + 0.00281/S)*n/math.sqrt(R))\n",
- "V=C*math.sqrt(R*S)\n",
- "T=d+ 2*(slope*y)\n",
- "yh=A/T\n",
- "Nf=V/(math.sqrt(g*yh))\n",
- "#results\n",
- "print '%s %.2f' %(\"froude number = \",Nf)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "froude number = 0.56\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 1f - Pg 456"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the critical depth\n",
- "#Initialization of variables\n",
- "import math\n",
- "rho=1.94 #slugs/ft^3\n",
- "mu=2.34e-5 #lb-sec/ft^2\n",
- "y=5. #ft\n",
- "T=25. #ft\n",
- "d=10. #ft\n",
- "slope=3./2. \n",
- "g=32.2 #ft/s^2\n",
- "S=0.001\n",
- "n=0.017\n",
- "#calculations\n",
- "A=y*d+ 2*0.5*y*(slope*y)\n",
- "WP=d+ 2*math.sqrt(3*3 +2*2) /2 *y\n",
- "R=A/WP\n",
- "e=0.01 #ft\n",
- "rr=2*R/e\n",
- "f=0.019\n",
- "C=(41.65 + 0.00281/S + 1.811/n)/(1+( 41.65 + 0.00281/S)*n/math.sqrt(R))\n",
- "V=C*math.sqrt(R*S)\n",
- "Q=V*A\n",
- "T=d+ 2*(slope*y)\n",
- "yh=A/T\n",
- "yc=2.88 #ft\n",
- "#results\n",
- "print '%s' %(\"yc is obtained using trial and error method\")\n",
- "print '%s %.2f %s' %(\"Critical depth =\",yc,\"ft\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "yc is obtained using trial and error method\n",
- "Critical depth = 2.88 ft\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2 - Pg 459"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the minimum scale ratio\n",
- "#Initialization of variables\n",
- "import math\n",
- "Re=4000.\n",
- "rho=1.94 #slugs/ft^3\n",
- "vm=5.91 #ft/s\n",
- "mu=3.24e-5 #ft-lb/s^2\n",
- "Rm=3.12 #ft\n",
- "#calculations\n",
- "lam3=Re*mu/(vm*4*Rm*rho)\n",
- "lam=math.pow(lam3,(2./3.))\n",
- "#results\n",
- "print '%s %.2e' %(\"Minimum scale ratio = \",lam)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Minimum scale ratio = 9.36e-03\n"
- ]
- }
- ],
- "prompt_number": 7
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3 - Pg 462"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the discharge, depth of the channel, froude numbers and also the force applied\n",
- "#Initialization of variables\n",
- "import math\n",
- "yc=2. #ft\n",
- "g=32.2 #ft/s^2\n",
- "d=10. #ft\n",
- "gam=62.4\n",
- "rho=1.94\n",
- "B=10. #ft\n",
- "#calculations\n",
- "Vc=math.sqrt(g*yc)\n",
- "Ac=yc*d\n",
- "Q=Vc*Ac\n",
- "y1=5.88 #ft\n",
- "y2=0.88 #ft\n",
- "V1=2.73 #ft/s\n",
- "V2=18.25 #ft/s\n",
- "Nf1=0.198\n",
- "Nf2=3.43\n",
- "F= 0.5*gam*y1*y1 *B - 0.5*gam*y2*y2 *B - Q*rho*V2 +Q*rho*V1\n",
- "#results\n",
- "print '%s %.1f %s' %(\"Discharge in the channel =\",Q,\"ft^3/s\")\n",
- "print '%s %.2f %s %.2f %s' %(\"\\n Depth of the channel at upstream and downstream =\",y1,\"ft and\",y2, \"ft\")\n",
- "print '%s %.3f %s %.3f' %(\"\\n froude numbers at upstream and downstream =\",Nf1,\" and \",Nf2)\n",
- "print '%s %d %s' %(\"\\n Force applied =\",F,\"lb\")\n",
- "print '%s' %(\"The answers are a bit different from textbook due to rounding off error\")"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Discharge in the channel = 160.5 ft^3/s\n",
- "\n",
- " Depth of the channel at upstream and downstream = 5.88 ft and 0.88 ft\n",
- "\n",
- " froude numbers at upstream and downstream = 0.198 and 3.430\n",
- "\n",
- " Force applied = 5713 lb\n",
- "The answers are a bit different from textbook due to rounding off error\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 4 - Pg 470"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the distance from vena contracta and also the total distance\n",
- "#Initialization of variables\n",
- "import math\n",
- "S0=0.0009\n",
- "n=0.018\n",
- "w=20 #ft\n",
- "d=0.5 #ft\n",
- "Q=400 #ft^3/s\n",
- "g=32.2 #ft/s^2\n",
- "#calculations\n",
- "y2=4 #ft\n",
- "V2=Q/(w*y2)\n",
- "Nf2=V2/math.sqrt(g*y2)\n",
- "yr=0.5*(math.sqrt(1+ 8*Nf2*Nf2) -1)\n",
- "y1=yr*y2\n",
- "L1=32.5\n",
- "L2=37.1 \n",
- "L3=51.4\n",
- "L=L1+L2+L3\n",
- "#results\n",
- "print '%s %.1f %s %.2f %s' %(\"distance from vena contracta =\",y2,\"ft and\",y1,\"ft\")\n",
- "print '%s %.1f %s' %(\"\\n Total distance =\",L,\" ft\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "distance from vena contracta = 4.0 ft and 1.20 ft\n",
- "\n",
- " Total distance = 121.0 ft\n"
- ]
- }
- ],
- "prompt_number": 9
- }
- ],
- "metadata": {}
- }
- ]
-} \ No newline at end of file
diff --git a/Fluid_mechanics/Chapter_2.ipynb b/Fluid_mechanics/Chapter_2.ipynb
deleted file mode 100755
index f518cad4..00000000
--- a/Fluid_mechanics/Chapter_2.ipynb
+++ /dev/null
@@ -1,406 +0,0 @@
-{
- "metadata": {
- "name": "",
- "signature": "sha256:8249f270a6314fb49f84df63266820d87dfa51fe64fed0b9dd11afa539cb500b"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 2 - Fluid Statics"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 1 - Pg 10"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the final pressure and specific weight of the gas\n",
- "#Initialization of variables\n",
- "import math\n",
- "gam=0.0765 #lb/ft^3\n",
- "p=14.7 #psia\n",
- "dz=10560. #ft\n",
- "#calculations\n",
- "pg=p*144./gam\n",
- "p2=p*math.exp(-dz/pg)\n",
- "gam2=p2/p*gam\n",
- "#results\n",
- "print '%s %.2f %s' %(\"Final pressure =\",p2,\"psia\")\n",
- "print '%s %.4f %s' %(\"\\n Final specific weight =\",gam2,\"lb/ft^3\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Final pressure = 10.04 psia\n",
- "\n",
- " Final specific weight = 0.0522 lb/ft^3\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2 - Pg 12"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the final pressure and specific weight\n",
- "#Initialization of variables\n",
- "import math\n",
- "gam=0.0765 #lb/ft^3\n",
- "p=14.7 #psia\n",
- "dz=10560. #ft\n",
- "n=1.235\n",
- "#calculations\n",
- "pg=p*144./gam\n",
- "p2=p*math.pow((1- dz/pg *(n-1)/n),(n/(n-1)))\n",
- "gam2=math.pow((p2/p),(1/n)) *gam\n",
- "#results\n",
- "print '%s %.2f %s' %(\"Final pressure =\",p2,\"psia\")\n",
- "print '%s %.4f %s' %(\"\\n Final specific weight =\",gam2,\"lb/ft^3\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Final pressure = 9.89 psia\n",
- "\n",
- " Final specific weight = 0.0555 lb/ft^3\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3 - Pg 16"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the absolute pressure\n",
- "#Initialization of variables\n",
- "pb=28.5 #in mercury\n",
- "d=13.6 #g/cc\n",
- "gam=62.4\n",
- "pobs=-4. #psi\n",
- "#calculations\n",
- "patm=pb/12. *gam*d/144.\n",
- "pabs=patm+pobs\n",
- "P=pabs*144./gam\n",
- "#results\n",
- "print '%s %.1f %s' %(\"Absolute pressure =\",pabs,\"psia\")\n",
- "print '%s %.1f %s' %(\"\\n Absolute pressure in feet of water =\",P,\"ft of water\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Absolute pressure = 10.0 psia\n",
- "\n",
- " Absolute pressure in feet of water = 23.1 ft of water\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 4 - Pg 18"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the pressure gauge at B and also the absolute pressure of air\n",
- "#Initialization of variables\n",
- "pb=28. #in mercury\n",
- "d=13.6 #g/cc\n",
- "gam=62.4\n",
- "xm=15. #in\n",
- "xw=10. #in\n",
- "patm=28. #in\n",
- "#calculations\n",
- "pB=-xm/12 *gam/144 *d + xw*gam/144\n",
- "pair=patm/12 *gam/144 *d - xm/12 *gam/144 *d\n",
- "#results\n",
- "print '%s %.2f %s' %(\"The pressure gauge at B indicates a reading of\",-pB,\"psi vacuum\")\n",
- "print '%s %.2f %s' %(\"\\n Absolute pressure of Air =\",pair,\"psia\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The pressure gauge at B indicates a reading of 3.03 psi vacuum\n",
- "\n",
- " Absolute pressure of Air = 6.38 psia\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5 - Pg 20"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the pressure difference and also compare the pressures at A and B\n",
- "#Initialization of variables\n",
- "pb=28.5 #in mercury\n",
- "d=13.6 #g/cc\n",
- "gam=62.4\n",
- "xm=10. #in\n",
- "xw=2. #ft\n",
- "#calculations\n",
- "dp= xw*gam/144 - xm/12 *gam/144 + xm/12 *gam/144 *d\n",
- "#results\n",
- "print '%s %.2f %s' %(\"Pressure difference =\",dp,\"psi\")\n",
- "if dp>0:\n",
- " print '%s' %(\"\\n Pressure at A is greater than that at B\")\n",
- "elif dp==0:\n",
- " print '%s' %(\"\\n Pressure at both A and B are equal\")\n",
- "else:\n",
- " print '%s' %(\"\\n Pressure at A is less than that at B\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Pressure difference = 5.42 psi\n",
- "\n",
- " Pressure at A is greater than that at B\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6 - Pg 24"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the magnitude of total force, vertical and horiontal locations of the total force.\n",
- "#Initialization of variables\n",
- "import math\n",
- "import scipy\n",
- "from scipy import integrate\n",
- "gam=62.4\n",
- "x1=4. #ft\n",
- "x2=6. #ft\n",
- "y1=6. #ft\n",
- "z=8. #ft\n",
- "dy=1. #ft\n",
- "angle=60.*math.pi/180. #radians\n",
- "#calculations\n",
- "A1=x1*x2\n",
- "A2=1/2. *y1*y1\n",
- "yc = (A1*(x1+x2+dy) + A2*(x1+x2))/(A1+A2)\n",
- "hc=yc*math.sin(angle)\n",
- "F=hc*gam*(A1+A2)\n",
- "ic1=1/12. *x1*y1*y1*y1\n",
- "ic2=1/36. *y1*x2*x2*x2\n",
- "ad1=A1*(x1+x2+dy-yc)*(x1+x2+dy-yc)\n",
- "ad2=A2*(x1+x2-yc)*(x1+x2-yc)\n",
- "It=ic1+ic2+ad1+ad2\n",
- "ydc=It/(yc*(A1+A2))\n",
- "def momen(u):\n",
- " m= gam*math.sin(angle) *(2*x1+u)*0.5*(x2-u)*(y1-u)\n",
- " return m;\n",
- "\n",
- "MED, err =scipy.integrate.quad( momen,0,y1)\n",
- "FEDC=gam*math.sin(angle) *A2*(x1+x2)\n",
- "xed=MED/FEDC\n",
- "xp= (A1*2*(x1+x2+dy) + (x1+x2)*(A2)*(x1+xed))/(A1*(x1+x2+dy) + A2*(x1+x2))\n",
- "#results\n",
- "print '%s %d %s' %(\"Magnitude of total force =\",F,\"lb\")\n",
- "print '%s %.3f %s' %(\"\\n Vertical location of force =\",ydc,\"ft\")\n",
- "print '%s %.2f %s' %(\"\\n Horizontal location of force =\",xp,\"ft from AB\")\n",
- "print '%s' %(\"\\n Direction of force is perpendicular to the plane surface\")\n",
- "print '%s' %(\"The answers are a bit different from textbook due to rounding off error\")"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Magnitude of total force = 23993 lb\n",
- "\n",
- " Vertical location of force = 0.266 ft\n",
- "\n",
- " Horizontal location of force = 3.58 ft from AB\n",
- "\n",
- " Direction of force is perpendicular to the plane surface\n",
- "The answers are a bit different from textbook due to rounding off error\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 7 - Pg 27"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the magnitude of force and the horizontal distance from line of action of Fv\n",
- "#Initialization of variables\n",
- "import math\n",
- "gam=62.4\n",
- "z=10. #ft\n",
- "z2=5. #ft\n",
- "z3=4.25 #ft\n",
- "p=2. #psig\n",
- "#calculations\n",
- "h=p*144./gam\n",
- "Av=z*z\n",
- "Fh=gam*(z+h)*Av\n",
- "hpc=1/12. *z*z*z*z /((h+z)*z*z)\n",
- "Fv=gam*(z2+h) *z*z + gam*math.pi/4. *z*z *z\n",
- "xp= (gam*(z2+h) *z*z *z2 + gam*math.pi/4. *z*z *z*z3)/(Fv)\n",
- "F=math.sqrt(Fh*Fh + Fv*Fv)\n",
- "#results\n",
- "print '%s %d %s' %(\"Magnitude of force =\",F,\"lb\")\n",
- "print '%s %.2f %s' %(\"\\n horizontal distance from line of action of Fv =\",xp,\"ft from AG\")\n",
- "print '%s' %(\"The answers are a bit different from textbook due to rounding off error\")"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Magnitude of force = 142127 lb\n",
- "\n",
- " horizontal distance from line of action of Fv = 4.66 ft from AG\n",
- "The answers are a bit different from textbook due to rounding off error\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 8 - Pg 33"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate whether the barge is stable and also find the location of the metacenter\n",
- "#Initialization of variables\n",
- "import math\n",
- "gam=0.0765 #lb/ft^3\n",
- "l=40. #ft\n",
- "w=16. #ft\n",
- "d=8. #ft\n",
- "z=6. #ft\n",
- "BG=1. #ft\n",
- "#calculations\n",
- "I=1/12. *l*w*w*w\n",
- "V=l*w*z\n",
- "IVG=I/V - BG\n",
- "MB=I/V\n",
- "#results\n",
- "print '%s %.2f %s' %(\"I/V -BG =\",IVG,\"ft \")\n",
- "if IVG >0:\n",
- " print '%s' %(\"\\n Barge is stable\")\n",
- "else:\n",
- " print '%s' %(\"\\n The barge is unstable\")\n",
- "\n",
- "print '%s %.2f %s' %(\"\\n Location of metacenter =\",MB,\"ft above the center of buoyancy \")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "I/V -BG = 2.56 ft \n",
- "\n",
- " Barge is stable\n",
- "\n",
- " Location of metacenter = 3.56 ft above the center of buoyancy \n"
- ]
- }
- ],
- "prompt_number": 9
- }
- ],
- "metadata": {}
- }
- ]
-} \ No newline at end of file
diff --git a/Fluid_mechanics/Chapter_3.ipynb b/Fluid_mechanics/Chapter_3.ipynb
deleted file mode 100755
index 8d368fbf..00000000
--- a/Fluid_mechanics/Chapter_3.ipynb
+++ /dev/null
@@ -1,105 +0,0 @@
-{
- "metadata": {
- "name": "",
- "signature": "sha256:dee9d655eeb9028db41fd96e05f9acf5955fd88886936fffc7d4e9aa14bb4a71"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 3 - Fluid Kinematics"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 1 - Pg 52"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the mean velocity of flow at both the sections\n",
- "#Initialization of variables\n",
- "import math\n",
- "gam=0.0765 #lb/ft^3\n",
- "Q=100. #ft^3/sec\n",
- "d1=2.5 #ft\n",
- "d2=9. #in\n",
- "l=12. #ft\n",
- "#calculations\n",
- "A1=math.pi/4. *d1*d1\n",
- "V1=Q/A1\n",
- "A2=math.pi*l*d2/12.\n",
- "V2=Q/A2\n",
- "#results\n",
- "print '%s %.1f %s' %(\"Mean velocity of flow at section 1 =\",V1,\"ft/sec\")\n",
- "print '%s %.2f %s' %(\"\\n Mean velocity of flow at section 2 =\",V2,\"ft/sec\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Mean velocity of flow at section 1 = 20.4 ft/sec\n",
- "\n",
- " Mean velocity of flow at section 2 = 3.54 ft/sec\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5 - Pg 60"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the horizontal and vertical components of velocity\n",
- "#Initialization of variables\n",
- "x=3. \n",
- "y=1.\n",
- "#calculations\n",
- "u=-3*y*y\n",
- "v=-6*x\n",
- "#results\n",
- "print '%s %d' %(\"Horizontal component of velocity = \",u)\n",
- "print '%s %d' %(\"\\n vertical component of velocity = \",v)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Horizontal component of velocity = -3\n",
- "\n",
- " vertical component of velocity = -18\n"
- ]
- }
- ],
- "prompt_number": 2
- }
- ],
- "metadata": {}
- }
- ]
-} \ No newline at end of file
diff --git a/Fluid_mechanics/Chapter_4.ipynb b/Fluid_mechanics/Chapter_4.ipynb
deleted file mode 100755
index 49f2ce7e..00000000
--- a/Fluid_mechanics/Chapter_4.ipynb
+++ /dev/null
@@ -1,777 +0,0 @@
-{
- "metadata": {
- "name": "",
- "signature": "sha256:bf4ed226827aaf378bd6d43d8ae5845adf36d75f20c124d2087db252462cf40c"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 4 - Fluid Dynamics"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 1 - Pg 79"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate dp/ds at both upper and lower ends\n",
- "#Initialization of variables\n",
- "rho=1.5 #g/cc\n",
- "g=32.2 #ft/s^2\n",
- "dzds=-0.5\n",
- "x1=0\n",
- "x2=3\n",
- "#calculations\n",
- "def func(s):\n",
- " dpds=-rho*g*dzds - rho*(3+9*s)*9\n",
- " return dpds\n",
- "\n",
- "r1=func(x1)\n",
- "r2=func(x2)\n",
- "#results\n",
- "print '%s %.1f %s' %(\"At the upper end, dp/ds =\",r1,\"lb/ft^2 per foot\")\n",
- "print '%s %.1f %s' %(\"\\n At the lower end, dp/ds =\",r2,\"lb/ft^2 per foot\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "At the upper end, dp/ds = -16.3 lb/ft^2 per foot\n",
- "\n",
- " At the lower end, dp/ds = -380.9 lb/ft^2 per foot\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2 - Pg 80"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the pressure difference between the two points\n",
- "#Initialization of variables\n",
- "g=32.2 #ft/s^2\n",
- "v1=3. #ft/s\n",
- "z1=1.5 #ft\n",
- "rho=1.5 #g/cc\n",
- "z2=0\n",
- "v2=30. #ft/s\n",
- "#calculations\n",
- "dp= rho*(v2*v2 /2. - g*z1 +g*z2 - v1*v1 /2.)\n",
- "#results\n",
- "print '%s %.1f %s' %(\"pressure difference =\",dp,\"lb/ft^2\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "pressure difference = 595.8 lb/ft^2\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3 - Pg 85"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the net power transferred\n",
- "#Initialization of variables\n",
- "pd=15. #psia\n",
- "rhod=0.005#slug/ft^3\n",
- "pi=150. #psia\n",
- "rhoi=0.03 #slug/ft^3\n",
- "dz=-25. #ft\n",
- "vd=1000. #ft/s\n",
- "vi=100. #ft/s\n",
- "ud=200. #Btu/slug\n",
- "ui=250. #Btu/slug\n",
- "g=32.2 #ft/s^2\n",
- "J=778.\n",
- "uff=5. #ft/s\n",
- "Q=50. #Btu/sec\n",
- "#calculations\n",
- "pr=pd/rhod*144. - pi/rhoi *144.\n",
- "zr=g*(dz)\n",
- "vr=(vd*vd -vi*vi)/2.\n",
- "ur=(ud-ui)*J\n",
- "jeh=J*Q*g/uff\n",
- "gem=pr+zr+vr+ur+jeh\n",
- "power=gem*uff/g\n",
- "#results\n",
- "print '%s %d %s' %(\"Power transferred =\",power,\"ft-lb/sec\")\n",
- "print '%s' %(\"The answers are a bit different from textbook due to rounding off error\")"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Power transferred = 64877 ft-lb/sec\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 4 - Pg 89"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the kinetic energy correction factor\n",
- "#Initialization of variables\n",
- "import math\n",
- "import scipy\n",
- "from scipy import integrate\n",
- "r0=1. \n",
- "ri=0.\n",
- "#calculations\n",
- "def func1(y):\n",
- " v= 2*math.pow(y,(1./7.)) *(y-1)\n",
- " return v\n",
- "\n",
- "V,err=scipy.integrate.quad(func1,ri,r0)\n",
- "def func2(y):\n",
- " alpha= 1/ (math.pi*V*V*V) *2*math.pi *math.pow((y),(3./7.)) *(y-1) \n",
- " return alpha\n",
- "\n",
- "a2,err2=scipy.integrate.quad(func2,ri,r0)\n",
- "#results\n",
- "print '%s %.2f' %(\"Kinetic energy correction factor = \",a2)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Kinetic energy correction factor = 1.06\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5a - Pg 92"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the pressure at the lower end if friction is neglected\n",
- "#Initialization of variables\n",
- "gam=62.4\n",
- "pu=40. #psia\n",
- "zu=25. #ft\n",
- "vu=8. #ft/s\n",
- "g=32.2 #ft/s^2\n",
- "vl=8. #ft/s\n",
- "zl=0 #ft\n",
- "#calculations\n",
- "pl= gam*(pu*144. /gam +zu-zl+ (vu*vu -vl*vl)/(2*g))/144.\n",
- "#results\n",
- "print '%s %.2f %s' %(\"Pressure at the lower end if friction is neglected =\",pl,\"psig\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Pressure at the lower end if friction is neglected = 50.83 psig\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5b - Pg 92"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the pressure at the lower end if friction is not neglected\n",
- "#Initialization of variables\n",
- "hl=5.\n",
- "gam=62.4\n",
- "pu=40. #psia\n",
- "zu=25. #ft\n",
- "vu=8. #ft/s\n",
- "g=32.2 #ft/s^2\n",
- "vl=8. #ft/s\n",
- "zl=0 #ft\n",
- "#calculations\n",
- "pl= gam*(pu*144. /gam +zu-zl-hl+ (vu*vu -vl*vl)/(2*g))/144.\n",
- "#results\n",
- "print '%s %.2f %s' %(\"Pressure at the lower end if friction is neglected =\",pl,\"psig\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Pressure at the lower end if friction is neglected = 48.67 psig\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6a - Pg 94"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the discharge flow rate.\n",
- "#Initialization of variables\n",
- "import math\n",
- "gam=62.4\n",
- "pa=0\n",
- "za=15. #ft\n",
- "va=0\n",
- "pg=0\n",
- "zg=0\n",
- "g=32.2 #ft/s^2\n",
- "dg=2. #in\n",
- "#calculations\n",
- "vg= math.sqrt(2*g*(pa/gam +za+va*va /(2*g) -pg/gam - zg))\n",
- "Ag=math.pi/4. *(dg/12.)*(dg/12.)\n",
- "Q=Ag*vg\n",
- "#results\n",
- "print '%s %.2f %s' %(\"discharge =\",Q,\"ft^3/sec\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "discharge = 0.68 ft^3/sec\n"
- ]
- }
- ],
- "prompt_number": 8
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6b - Pg 95"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the pressure at the points C,D,E and F\n",
- "#Initialization of variables\n",
- "import math\n",
- "gam=62.4\n",
- "pa=0\n",
- "za=15. #ft\n",
- "va=0\n",
- "pg=0\n",
- "zg=0\n",
- "g=32.2 #ft/s^2\n",
- "d=4. #in\n",
- "dg=2. #in\n",
- "zd=25. #ft\n",
- "#calculations\n",
- "vg= math.sqrt(2*g*(pa/gam +za+va*va /(2*g) -pg/gam - zg))\n",
- "Ag=math.pi/4. *(dg/12.)*(dg/12.)\n",
- "Q=Ag*vg\n",
- "A=math.pi/4. *(d/12.)*(d/12.)\n",
- "v4=Q/A\n",
- "pc=-v4*v4 *gam/(2*g*144.)\n",
- "pgd= za-zd - v4*v4 /(2*g)\n",
- "pd=pgd*gam/144.\n",
- "pe=-v4*v4 *gam/(2*g*144.)\n",
- "pfg= za- v4*v4 /(2*g)\n",
- "pf=pfg*gam/144.\n",
- "#results\n",
- "print '%s %.2f %s' %(\"Pressure at C =\",pc,\" psig\")\n",
- "print '%s %.2f %s' %(\"\\n Pressure at D =\",pd,\" psig\")\n",
- "print '%s %.2f %s' %(\"\\n Pressure at E =\",pe,\" psig\")\n",
- "print '%s %.2f %s' %(\"\\n Pressure at F =\",pf,\" psig\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Pressure at C = -0.41 psig\n",
- "\n",
- " Pressure at D = -4.74 psig\n",
- "\n",
- " Pressure at E = -0.41 psig\n",
- "\n",
- " Pressure at F = 6.09 psig\n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 7 - Pg 97"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the time required\n",
- "#Initialization of variables\n",
- "import math\n",
- "import scipy\n",
- "from scipy import integrate\n",
- "d1=6. #ft\n",
- "d2=3. #in\n",
- "pa=2. #ft\n",
- "d=13.6 \n",
- "sg=0.75\n",
- "h1=5. #sec\n",
- "h2=3. #sec\n",
- "g=32.2 #ft/s^2\n",
- "#calculations\n",
- "pag=pa/12. *d/sg\n",
- "def func(h):\n",
- " time= -d1*d1 /(d2/12.)/(d2/12.) /(math.sqrt(2*g)) *math.pow((pag+h),(-0.5))\n",
- " return time\n",
- "ti,err=scipy.integrate.quad(func,h1,h2)\n",
- "#results\n",
- "print '%s %.1f %s' %(\"Time required =\",ti,\" sec\")\n",
- "print '%s' %(\"The answers are a bit different from textbook due to rounding off error\")"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Time required = 54.3 sec\n",
- "The answers are a bit different from textbook due to rounding off error\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 8 - Pg 100"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the rate of flow \n",
- "#Initialization of variables\n",
- "import math\n",
- "x=12. #ft\n",
- "angle=30.*math.pi/180. #degrees\n",
- "g=32.2 #ft/s^2\n",
- "z=-2. #ft\n",
- "d=2. #in\n",
- "#calculations\n",
- "vj= x/math.cos(angle) *math.sqrt(g/(2*(x*math.tan(angle) -z)))\n",
- "Q=math.pi/4. *(d/12.)*(d/12.) *vj\n",
- "#results\n",
- "print '%s %.2f %s' %(\"Rate of flow =\",Q,\" ft^3/s\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Rate of flow = 0.41 ft^3/s\n"
- ]
- }
- ],
- "prompt_number": 11
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 9 - Pg 103"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the net discharge\n",
- "#Initialization of variables\n",
- "import math\n",
- "x=10. #in of mercury\n",
- "sg=13.6 #g/cc\n",
- "d1=8. #in\n",
- "d2=4. #in\n",
- "g=32.2 #ft/s^2\n",
- "#calculations\n",
- "vdiff=x/12. *sg- x/12.\n",
- "Vts=vdiff/(1-math.pow((d2/d1),4))\n",
- "Vt=math.sqrt(2*g*Vts)\n",
- "Q=Vt*math.pi/4. *(d2/12.)*(d2/12.)\n",
- "#results\n",
- "print '%s %.2f %s' %(\"Discharge =\",Q,\"ft^3/s\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Discharge = 2.34 ft^3/s\n"
- ]
- }
- ],
- "prompt_number": 12
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 11 - Pg 107"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the horsepower input of the test pump\n",
- "#Initialization of variables\n",
- "import math\n",
- "gam=62.4\n",
- "ds=12. #in\n",
- "dd=10. #in\n",
- "Q=4. #ft^3/s\n",
- "pd=40. #psia\n",
- "ps=-6. #psia\n",
- "zd=5. #ft\n",
- "zs=0\n",
- "g=32.2 #ft/s^2\n",
- "#calculations\n",
- "vs=Q/(math.pi/4. *math.pow((ds/12.),2))\n",
- "vd=Q/(math.pi/4. *math.pow((dd/12.),2))\n",
- "emp = (pd-ps)*144./gam + zd-zs + (vd*vd - vs*vs)/(2*g)\n",
- "hpp=emp*Q*gam/550.\n",
- "#results\n",
- "print '%s %.1f %s' %(\"Horsepower input of the test pump =\",hpp,\"hp\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Horsepower input of the test pump = 50.6 hp\n"
- ]
- }
- ],
- "prompt_number": 13
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12 - Pg 117"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the horizontal and vertical components of force\n",
- "#Initialization of variables\n",
- "import math\n",
- "d1=12. #in\n",
- "d2=8. #in\n",
- "v1=15. #ft/s\n",
- "p1=12. #psig\n",
- "p2=5.85 #psig\n",
- "rho=1.94 #ft^3/slug\n",
- "angle=60.*math.pi/180. #degrees\n",
- "#calculations\n",
- "Q=math.pi/4. *(d1/12.)*(d1/12.) *v1\n",
- "v2=Q/(math.pi/4. *(d2/12.)*(d2/12.))\n",
- "pa1=p1*math.pi/4. *(d1)*(d1)\n",
- "pa2=p2*math.pi/4. *(d2)*(d2)\n",
- "qv1=rho*Q*v1\n",
- "qv2=rho*Q*v2\n",
- "Fx=pa1+qv1+ math.cos(angle)*(pa2+qv2)\n",
- "Fy=math.sin(angle)*(pa2+qv2)\n",
- "#results\n",
- "print '%s %d %s' %(\"Horizontal component of force =\",Fx,\"lb\")\n",
- "print '%s %d %s' %(\"\\n Vertical component of force =\",Fy,\"lb\")\n",
- "print '%s' %(\"The answers are a bit different from textbook due to rounding off error\")"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Horizontal component of force = 2232 lb\n",
- "\n",
- " Vertical component of force = 922 lb\n",
- "The answers are a bit different from textbook due to rounding off error\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14a - Pg 127"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the exit velocity of the pump\n",
- "#Initialization of variables\n",
- "import math\n",
- "de=4. #in\n",
- "T=1000. #lb\n",
- "g=32.2 #ft/s^2\n",
- "vele=8.5 #lb/s\n",
- "pe=16.5 #psia\n",
- "pa=14.7 #psia\n",
- "#calculations\n",
- "Ae=math.pi/4. *de*de\n",
- "Ve= (T-(pe-pa)*Ae)*g/vele\n",
- "#results\n",
- "print '%s %d %s' %(\"Exit velocity =\",Ve,\"ft/s\")\n",
- "print '%s' %(\"The answers are a bit different from textbook due to rounding off error\")"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Exit velocity = 3702 ft/s\n",
- "The answers are a bit different from textbook due to rounding off error\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14b - Pg 127"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the thrust in the pipe\n",
- "#Initialization of variables\n",
- "import math\n",
- "de=4. #in\n",
- "T=1000. #lb\n",
- "g=32.2 #ft/s^2\n",
- "vele=8.5 #lb/s\n",
- "pe=16.5 #psia\n",
- "pa=14.7 #psia\n",
- "pa2=1 #psia\n",
- "#calculations\n",
- "Ae=math.pi/4 *de*de\n",
- "Ve= (T-(pe-pa)*Ae)*g/vele\n",
- "T2=vele/g *Ve + (pe-pa2)*Ae\n",
- "#results\n",
- "print '%s %d %s' %(\"Thrust =\",T2,\"lb\")"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Thrust = 1172 lb\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 16 - Pg 133"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the downstream depth and horsepower dissipation\n",
- "#Initialization of variables\n",
- "q=240. #ft^3/sec/ft\n",
- "v1=60. #ft/s\n",
- "gam=62.4 \n",
- "rho=1.94 #slug/ft^3\n",
- "g=32.2 #ft/s^2\n",
- "#calculations\n",
- "y1=q/v1\n",
- "v2=8.6 #ft/s\n",
- "y2=28. #ft\n",
- "hl= (y1+ v1*v1 /(2*g)) - (y2+ v2*v2 /(2*g))\n",
- "hpp=hl*q*gam/550.\n",
- "#results\n",
- "print '%s %.1f %s' %(\"Downstream depth =\",y2,\"ft\")\n",
- "print '%s %d %s' %(\"\\n Horsepower dissipation =\",hpp,\"hp per foot width\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Downstream depth = 28.0 ft\n",
- "\n",
- " Horsepower dissipation = 837 hp per foot width\n"
- ]
- }
- ],
- "prompt_number": 17
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 17 - Pg 137"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the acceleration required\n",
- "#Initialization of variables\n",
- "dh=3. #in\n",
- "L=12. #in\n",
- "g=32.2 #ft/s^2\n",
- "#calculations\n",
- "a=dh/L *g\n",
- "#results\n",
- "print '%s %.2f %s' %(\"Acceleration =\",a,\" ft/s^2\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Acceleration = 8.05 ft/s^2\n"
- ]
- }
- ],
- "prompt_number": 18
- }
- ],
- "metadata": {}
- }
- ]
-} \ No newline at end of file
diff --git a/Fluid_mechanics/Chapter_5.ipynb b/Fluid_mechanics/Chapter_5.ipynb
deleted file mode 100755
index 3591a061..00000000
--- a/Fluid_mechanics/Chapter_5.ipynb
+++ /dev/null
@@ -1,244 +0,0 @@
-{
- "metadata": {
- "name": "",
- "signature": "sha256:0e0637dca57f500478b778450aaaee0067016f8da4c67cbada5f889a38068276"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 5 - Fluid viscosity and flow of real fluids"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3 - Pg 187"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the viscosity of oil\n",
- "#Initialization of variables\n",
- "import math\n",
- "m=1155. #lb\n",
- "gam=62.4\n",
- "spg=0.93\n",
- "t=3*60. #sec\n",
- "d=1./6. #in\n",
- "L=20. #ft\n",
- "dp=2.5 #psi\n",
- "#calculations\n",
- "Q=m/(t*spg*gam)\n",
- "A=math.pi/4. *d*d\n",
- "V=Q/A\n",
- "mu=dp*d*d *144./(32.*V*L)\n",
- "#results\n",
- "print '%s %.4f %s' %(\"Viscosity of oil =\",mu,\"lb-sec/ft^2\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Viscosity of oil = 0.0031 lb-sec/ft^2\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 4 - Pg 187"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the values of alpha and beta\n",
- "#Initialization of variables\n",
- "import math\n",
- "import scipy\n",
- "from scipy import integrate\n",
- "g=32.2\n",
- "gam=62.4\n",
- "r0=1.\n",
- "#calculations\n",
- "def func1(r):\n",
- " al=8./math.pow(r0,8) *math.pow((r0*r0-r*r),3) *(2*r)\n",
- " return al\n",
- "alpha,err=scipy.integrate.quad(func1,0,r0)\n",
- "def func2(r):\n",
- " a2=4/math.pow(r0,6) *math.pow((r0*r0 -r*r),2) *(2*r)\n",
- " return a2\n",
- "bet,err2=scipy.integrate.quad(func2,0,r0)\n",
- "#results\n",
- "print '%s %d' %(\"Alpha = \",alpha)\n",
- "print '%s %.2f' %(\"\\n beta = \",bet)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Alpha = 2\n",
- "\n",
- " beta = 1.33\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- " Example 5a - Pg 188"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the direction of flow and the loss of energy\n",
- "#Initialization of variables\n",
- "spg=0.93\n",
- "mu=3.1e-3 #lb-sec/ft^2\n",
- "gam=62.4\n",
- "z=50. #m\n",
- "p1=60. #psia\n",
- "p2=25. #psia\n",
- "#calculations\n",
- "p1g=144.*p1\n",
- "p2g=144.*p2 + spg*gam*z\n",
- "dp=p1g-p2g\n",
- "#results\n",
- "if p1g>p2g:\n",
- " print '%s' %(\"The flow is in upward direction\")\n",
- "else:\n",
- " print '%s' %(\"The flow is in downward direction\")\n",
- "\n",
- "print '%s %d %s' %(\"\\n Energy loss=\",dp,\"ft-lb/ft^3\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The flow is in upward direction\n",
- "\n",
- " Energy loss= 2138 ft-lb/ft^3\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5b - Pg 189"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the flow rate\n",
- "#Initialization of variables\n",
- "import math\n",
- "hl=2140. #ft-lb/ft^3\n",
- "spg=0.93\n",
- "mu=3.1e-3 #lb-sec/ft^2\n",
- "gam=62.4\n",
- "z=50. #m\n",
- "p1=60. #psia\n",
- "p2=25. #psia\n",
- "d=1. #in\n",
- "#calculations\n",
- "V= hl*(d/12.)*(d/12.) /(32*mu*z)\n",
- "Q=V*math.pi/4. *(d/12.)*(d/12.)\n",
- "Q2=Q*7.48*60.\n",
- "#results\n",
- "print '%s %.2f %s' %(\"Flow rate =\",Q2,\"gal/min\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Flow rate = 7.33 gal/min\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 7 - Pg 194"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the flow in model\n",
- "#Initialization of variables\n",
- "muw=2.04e-5 #lb-sec/ft^2\n",
- "rhow=1.94 #slugs/ft^3\n",
- "mua=3.74e-7 #lb-sec/ft^2\n",
- "rhoa=0.00237 #slug/ft^3\n",
- "Qw=200. #gal/min\n",
- "Lr=5.\n",
- "#calculations\n",
- "Qa=Qw*Lr *(rhow/rhoa)*(mua/muw)\n",
- "#results\n",
- "print '%s %d %s' %(\"Flow in model =\",Qa,\"gal/min\")\n",
- "print '%s' %(\"The answers are a bit different from textbook due to rounding off error\")"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Flow in model = 15007 gal/min\n",
- "The answers are a bit different from textbook due to rounding off error\n"
- ]
- }
- ],
- "prompt_number": 1
- }
- ],
- "metadata": {}
- }
- ]
-} \ No newline at end of file
diff --git a/Fluid_mechanics/Chapter_6.ipynb b/Fluid_mechanics/Chapter_6.ipynb
deleted file mode 100755
index 424aea7a..00000000
--- a/Fluid_mechanics/Chapter_6.ipynb
+++ /dev/null
@@ -1,118 +0,0 @@
-{
- "metadata": {
- "name": "",
- "signature": "sha256:27148bed2cbad8357ddcdc8e0ee434be3797107d2f692797bdf3a1e36c7e8d1a"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 6 - Dimensional analysis and model similitude"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3 - Pg 230"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the flow rate of water and pressure drop\n",
- "#Initialization of variables\n",
- "dg=0.5 #in\n",
- "dw=12. #in\n",
- "rhog=0.022 #slug/ft^3\n",
- "rhow=1.94 #slug/ft^3\n",
- "muw=2.34e-5 #lb-sec/ft^2\n",
- "mug=3.50e-7 #lb-sec/ft^2\n",
- "Qg=0.15 #ft^3/s\n",
- "dpg=100. #lb/ft^2\n",
- "#calculations\n",
- "Vr=dg/dw *rhog/rhow *muw/mug\n",
- "Qr=Vr*dw*dw /dg/dg\n",
- "Qw=Qr*Qg\n",
- "dpr=rhow/rhog *(Vr)*Vr\n",
- "dpw=dpr*dpg\n",
- "#results\n",
- "print '%s %.2f %s' %(\"Flow rate of water =\",Qw,\"ft^3/s\")\n",
- "print '%s %.1f %s' %(\"\\n Pressure drop =\",dpw,\"lb/ft^2\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Flow rate of water = 2.73 ft^3/s\n",
- "\n",
- " Pressure drop = 8.8 lb/ft^2\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 4 - Pg 231"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the velocity ratio, time ratio, acceleration ratio and force ratio.\n",
- "#Initialization of variables\n",
- "import math\n",
- "Lr=1./10.\n",
- "rhom=2.\n",
- "rhop=1.94\n",
- "#calculations\n",
- "Vr=math.sqrt(Lr)\n",
- "Tr=Lr/Vr\n",
- "ar=Vr/Tr\n",
- "Fr=rhom/rhop *ar*Lr*Lr*Lr\n",
- "#results\n",
- "print '%s %.4f' %(\"Velocity ratio = \",Vr)\n",
- "print '%s %.4f' %(\"\\n Time ratio = \",Tr)\n",
- "print '%s %d' %(\"\\n Acceleration ratio = \",ar)\n",
- "print '%s %.6f' %(\"\\n Force ratio = \",Fr)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Velocity ratio = 0.3162\n",
- "\n",
- " Time ratio = 0.3162\n",
- "\n",
- " Acceleration ratio = 1\n",
- "\n",
- " Force ratio = 0.001031\n"
- ]
- }
- ],
- "prompt_number": 2
- }
- ],
- "metadata": {}
- }
- ]
-} \ No newline at end of file
diff --git a/Fluid_mechanics/Chapter_7.ipynb b/Fluid_mechanics/Chapter_7.ipynb
deleted file mode 100755
index 26326ec8..00000000
--- a/Fluid_mechanics/Chapter_7.ipynb
+++ /dev/null
@@ -1,874 +0,0 @@
-{
- "metadata": {
- "name": "",
- "signature": "sha256:a67e8661ab863efba6ffe8486e33132e755624949690c50df8ae76d2d928ed8b"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 7 - Flow of incompressible fluids in closed conduits"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 1a - Pg 241"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the reynolds number of the flow\n",
- "#Initialization of variables\n",
- "import math\n",
- "z1=2. #ft\n",
- "Q=0.1 #gal/min\n",
- "alpha=2.\n",
- "g=32.2 #ft/s^2\n",
- "L=4. #ft\n",
- "D=1./96. #ft\n",
- "#calculations\n",
- "v2=Q/(7.48*60* math.pi/4. *D*D)\n",
- "hl=z1-alpha*v2*v2 /(2*g)\n",
- "Nr=64./hl *L/D *v2*v2 /(2*g)\n",
- "#results\n",
- "print '%s %d %s' %(\"Reynolds number is\",Nr,\".Hence the flow is laminar\")\n",
- "print '%s' %(\"The answers are a bit different from textbook due to rounding off error\")"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Reynolds number is 1459 .Hence the flow is laminar\n",
- "The answers are a bit different from textbook due to rounding off error\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 1b - Pg 242"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the kinematic viscosity\n",
- "#Initialization of variables\n",
- "import math\n",
- "z1=2 #ft\n",
- "Q=0.1 #gal/min\n",
- "alpha=2.\n",
- "g=32.2 #ft/s^2\n",
- "L=4. #ft\n",
- "D=1./96. #ft\n",
- "#calculations\n",
- "v2=Q/(7.48*60* math.pi/4. *D*D)\n",
- "hl=z1-alpha*v2*v2/(2*g)\n",
- "Nr=64./hl *L/D *v2*v2 /(2*g)\n",
- "mu=v2*D/Nr\n",
- "#results\n",
- "print '%s %.2e %s' %(\"Kinematic viscosity =\",mu,\"ft^2/s\")\n",
- "print '%s' %(\"The answers are a bit different from textbook due to rounding off error\")"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Kinematic viscosity = 1.87e-05 ft^2/s\n",
- "The answers are a bit different from textbook due to rounding off error\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Exaple 1c - Pg 242"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the theoretical entrance transistion length\n",
- "#Initialization of variables\n",
- "import math\n",
- "z1=2. #ft\n",
- "Q=0.1 #gal/min\n",
- "alpha=2.\n",
- "g=32.2 #ft/s^2\n",
- "L=4. #ft\n",
- "D=1./96. #ft\n",
- "#calculations\n",
- "v2=Q/(7.48*60* math.pi/4. *D*D)\n",
- "hl=z1-alpha*v2*v2 /(2*g)\n",
- "Nr=64./hl *L/D *v2*v2 /(2*g)\n",
- "Ld=0.058*Nr*D\n",
- "#results\n",
- "print '%s %.3f %s' %(\"Theoretical entrance transistion length =\",Ld,\"ft\")\n",
- "print '%s' %(\"The answers are a bit different from textbook due to rounding off error\")"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Theoretical entrance transistion length = 0.882 ft\n",
- "The answers are a bit different from textbook due to rounding off error\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2 - Pg 246"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the horsepower required for the motor\n",
- "#Initialization of variables\n",
- "import math\n",
- "Q=350. #gal/min\n",
- "D=6. #in\n",
- "rho=0.84\n",
- "gam=62.4\n",
- "g=32.2 #ft/s^2\n",
- "mu=9.2e-5 #lb-sec/ft^2\n",
- "L=5280. #ft\n",
- "#calculations\n",
- "V=Q/(7.48*60*math.pi/4. *math.pow((D/12),2))\n",
- "Nr=V*D/12 *rho*gam/g /mu\n",
- "f=0.3164/math.pow((Nr),0.25)\n",
- "hl=f*L*12/D *V*V /(2*g)\n",
- "hp=hl*gam*Q*rho/(550*7.48*60.)\n",
- "#results\n",
- "print '%s %.2f %s' %(\"Horsepower required =\",hp,\"hp/mile\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Horsepower required = 4.44 hp/mile\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3 - Pg 250"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the values of the coefficients alpha and beta\n",
- "#Initialization of variables\n",
- "n=7.\n",
- "import math\n",
- "#calculations\n",
- "alpha= math.pow((n+1),3) *math.pow((2*n+1),3) /(4*math.pow(n,4) *(n+3)*(2*n+3))\n",
- "bet=math.pow((n+1),2) *math.pow((2*n+1),2) /(2*n*n *(n+2)*(2*n+2))\n",
- "#results\n",
- "print '%s %.2f' %(\"alpha = \",alpha)\n",
- "print '%s %.2f' %(\"\\n beta = \",bet)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "alpha = 1.06\n",
- "\n",
- " beta = 1.02\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5 - Pg 252"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the mass flow rate and horsepower input of the fan\n",
- "#Initialization of variables\n",
- "import math\n",
- "spg=0.84\n",
- "z=1. #in\n",
- "gam=62.4\n",
- "patm=14.7 #psia\n",
- "T=459.6+85 #R\n",
- "R=53.3\n",
- "g=32.2 #ft/s^2\n",
- "D=3. #ft\n",
- "mu=3.88e-7 #lb-sec/ft^2\n",
- "#calculations\n",
- "dp=spg*z/12. *gam\n",
- "rho=patm*144. /(R*T*g)\n",
- "umax=math.sqrt(2*dp/rho)\n",
- "V=0.8*umax\n",
- "Nr=V*D*rho/mu\n",
- "V2=0.875*umax\n",
- "mass=rho*math.pi/4. *D*D *V2\n",
- "emf=V2*V2 /(2*g)\n",
- "hp=emf*mass*g/550.\n",
- "#results\n",
- "print '%s %.2f %s' %(\"Mass flow rate =\",mass,\"slug/sec\")\n",
- "print '%s %.2f %s' %(\"\\n Horsepower input of the fan =\",hp,\"hp\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Mass flow rate = 0.87 slug/sec\n",
- "\n",
- " Horsepower input of the fan = 2.34 hp\n"
- ]
- }
- ],
- "prompt_number": 7
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 7a - Pg 266"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the velocity using several equations listed above\n",
- "#Initialization of variables\n",
- "import math\n",
- "D=36. #in\n",
- "rho=0.00226 #slug/ft^3\n",
- "mu=3.88e-7 #lb-sec/ft^2\n",
- "umax=62.2 #ft/s\n",
- "V=54.5 #ft/s\n",
- "Nr=9.5e5\n",
- "r0=18. #in\n",
- "r=12. #in\n",
- "n=8.8\n",
- "k=0.4\n",
- "#calculations\n",
- "f=0.0032 + 0.221/(math.pow(Nr,0.237))\n",
- "Vs=math.sqrt(f/8) *V\n",
- "y=r0-r\n",
- "u1=umax*math.pow((y/r0),(1/n))\n",
- "u2=umax+ 2.5*Vs*math.log(y/r0)\n",
- "u3=umax+ Vs/k *(math.sqrt(1-y/r0) + math.log(1-math.sqrt(1-y/r0)))\n",
- "u4=Vs*(5.5+ 5.75*math.log10(Vs*y/12 *rho/mu))\n",
- "#results\n",
- "print '%s %.1f %s' %(\"Using equation 7-13, velocity =\",u1,\" ft/s\")\n",
- "print '%s %.1f %s' %(\"\\n Using equation 7-18, velocity =\",u2,\" ft/s\")\n",
- "print '%s %.1f %s' %(\"\\n Using equation 7-25, velocity =\",u3,\" ft/s\")\n",
- "print '%s %.1f %s' %(\"\\n Using equation 7-34a, velocity =\",u4,\" ft/s\")"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Using equation 7-13, velocity = 54.9 ft/s\n",
- "\n",
- " Using equation 7-18, velocity = 56.5 ft/s\n",
- "\n",
- " Using equation 7-25, velocity = 57.6 ft/s\n",
- "\n",
- " Using equation 7-34a, velocity = 56.7 ft/s\n"
- ]
- }
- ],
- "prompt_number": 8
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 7b - Pg 266"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the outer edge buffer zone distance and also its thickness\n",
- "#Initialization of variables\n",
- "import math\n",
- "D=36. #in\n",
- "rho=0.00226 #slug/ft^3\n",
- "mu=3.88e-7 #lb-sec/ft^2\n",
- "umax=62.2 #ft/s\n",
- "V=54.5 #ft/s\n",
- "Nr=9.5e5\n",
- "r0=18. #in\n",
- "r=12. #in\n",
- "n=8.8\n",
- "k=0.4\n",
- "#calculations\n",
- "f=0.0032 + 0.221/(math.pow(Nr,0.237))\n",
- "Vs=math.sqrt(f/8.) *V\n",
- "y=r0-r\n",
- "delta1=D*5*math.sqrt(8) /(Nr*math.sqrt(f))\n",
- "vss=70.\n",
- "thick=13*delta1\n",
- "#results\n",
- "print '%s %d' %(\"Outer edge of buffer zone is at \",vss)\n",
- "print '%s %.4f %s' %(\"\\n Thickness of buffer zone =\",thick,\"in\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Outer edge of buffer zone is at 70\n",
- "\n",
- " Thickness of buffer zone = 0.0645 in\n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 7c - Pg 266"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the velocity using the given equations\n",
- "#Initialization of variables\n",
- "import math\n",
- "D=36. #in\n",
- "rho=0.00226 #slug/ft^3\n",
- "mu=3.88e-7 #lb-sec/ft^2\n",
- "umax=62.2 #ft/s\n",
- "V=54.5 #ft/s\n",
- "Nr=9.5e5\n",
- "r0=18. #in\n",
- "r=12. #in\n",
- "n=8.8\n",
- "k=0.4\n",
- "#calculations\n",
- "f=0.0032 + 0.221/(math.pow(Nr,0.237))\n",
- "Vs=math.sqrt(f/8) *V\n",
- "delta1=D*5*math.sqrt(8.) /(Nr*math.sqrt(f))\n",
- "y=delta1\n",
- "u2=Vs*Vs *delta1/12. *rho/mu\n",
- "u1=62.2 *math.pow((delta1/18.),(1/n))\n",
- "#results\n",
- "print '%s %.1f %s' %(\"using equation 7-13, velocity =\",u1,\"ft/s\")\n",
- "print '%s %.1f %s' %(\"\\n using equation 7-30, velocity =\",u2,\"ft/s\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "using equation 7-13, velocity = 24.5 ft/s\n",
- "\n",
- " using equation 7-30, velocity = 10.4 ft/s\n"
- ]
- }
- ],
- "prompt_number": 10
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 7d - Pg 266"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the velocity using the listed equations\n",
- "#Initialization of variables\n",
- "import math\n",
- "D=36. #in\n",
- "rho=0.00226 #slug/ft^3\n",
- "mu=3.88e-7 #lb-sec/ft^2\n",
- "umax=62.2 #ft/s\n",
- "V=54.5 #ft/s\n",
- "Nr=9.5e5\n",
- "r0=18. #in\n",
- "r=12. #in\n",
- "n=8.8\n",
- "k=0.4\n",
- "#calculations\n",
- "f=0.0032 + 0.221/(math.pow(Nr,0.237))\n",
- "Vs=math.sqrt(f/8.) *V\n",
- "delta1=D*5*math.sqrt(8.) /(Nr*math.sqrt(f))\n",
- "y=14*delta1\n",
- "u2=62.2*math.pow((y/18.),(1/n))\n",
- "u3=Vs*(5.50 + 5.75*math.log10(Vs*y/12 *rho/mu))\n",
- "#results\n",
- "print '%s %.1f %s' %(\"Using equation 7-13, velocity =\",u2,\"ft/s\")\n",
- "print '%s %.1f %s' %(\"\\n using equation 7-34a, velocity =\",u3,\"ft/s\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Using equation 7-13, velocity = 33.1 ft/s\n",
- "\n",
- " using equation 7-34a, velocity = 33.5 ft/s\n"
- ]
- }
- ],
- "prompt_number": 11
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 7e - Pg 266"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the shearing stress using both the equations\n",
- "#Initialization of variables\n",
- "import math\n",
- "D=36. #in\n",
- "rho=0.00226 #slug/ft^3\n",
- "mu=3.88e-7 #lb-sec/ft^2\n",
- "umax=62.2 #ft/s\n",
- "V=54.5 #ft/s\n",
- "Nr=9.5e+5\n",
- "r0=18. #in\n",
- "r=12. #in\n",
- "n=8.8\n",
- "k=0.4\n",
- "#calculations\n",
- "f=0.0032 + 0.221/(math.pow(Nr,0.237))\n",
- "Vs=math.sqrt(f/8.) *V\n",
- "delta1=D*5*math.sqrt(8.) /(Nr*math.sqrt(f))\n",
- "u2=Vs*Vs *delta1/12. *rho/mu\n",
- "T0=rho*Vs*Vs\n",
- "T02=mu*u2/delta1 *12.\n",
- "#results\n",
- "print '%s %.5f %s' %(\"Using equation 7-9a, shearing stress =\",T0,\"lb/ft^2\")\n",
- "print '%s %.5f %s' %(\"\\n Using equation 7-28, shearing stress =\",T02,\"lb/ft^2\")\n",
- "print '%s' %(\"The answers are a bit different due to rounding off error in textbook\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Using equation 7-9a, shearing stress = 0.00979 lb/ft^2\n",
- "\n",
- " Using equation 7-28, shearing stress = 0.00979 lb/ft^2\n",
- "The answers are a bit different due to rounding off error in textbook\n"
- ]
- }
- ],
- "prompt_number": 12
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 8 - Pg 273"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the required velocity\n",
- "#Initialization of variables\n",
- "import math\n",
- "umax=62.2 #ft/s\n",
- "r0=18. #in\n",
- "e=0.0696 #in\n",
- "r=6. #in\n",
- "#calculations\n",
- "Vs=umax/(8.5 + 5.75*math.log10(r0/e))\n",
- "u=Vs*(8.5 + 5.75*math.log10(r/e))\n",
- "#results\n",
- "print '%s %.1f %s' %(\"Velocity =\",u,\"ft/s\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Velocity = 54.6 ft/s\n"
- ]
- }
- ],
- "prompt_number": 13
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 9 - Pg 277"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the flow rate and roughness factor\n",
- "#Initialization of variables\n",
- "import math\n",
- "d=8. #in\n",
- "V=3.65 #ft/s\n",
- "u1=4.75 #ft/s\n",
- "r0=4. #in\n",
- "#calculations\n",
- "f=0.0449\n",
- "Q=V*math.pi/4. *math.pow((d/12),2)\n",
- "Vs=(u1-V)/3.75\n",
- "r0e=math.pow(10,((u1/Vs - 8.5)/5.75))\n",
- "e=r0/r0e\n",
- "#results\n",
- "print '%s %.2f %s' %(\"Flow rate =\",Q,\"ft^3/s\")\n",
- "print '%s %.3f %s' %(\"\\n roughness factor =\",e,\"in\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Flow rate = 1.27 ft^3/s\n",
- "\n",
- " roughness factor = 0.184 in\n"
- ]
- }
- ],
- "prompt_number": 14
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 10 - Pg 285"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the pressure difference per foot of horizontal pipe\n",
- "#Initialization of variables\n",
- "import math\n",
- "e0=0.00085 #ft\n",
- "alpha=0.25 #/year\n",
- "t=15. #years\n",
- "r0=3. #in\n",
- "Q=500. #gal/min\n",
- "d=6. #in\n",
- "mu=2.04e-5 #lb-sec/ft^2\n",
- "rho=1.94 #slugs/ft^3\n",
- "g=32.2 #ft/s^2\n",
- "L=1. #ft\n",
- "gam=62.4\n",
- "#calculations\n",
- "e15=e0*(1+ alpha*t)\n",
- "ratio=r0/(12.*e15)\n",
- "V=Q/(7.48*60*math.pi/4. *math.pow((d/12),2))\n",
- "Nr=V*d*rho/(mu*12)\n",
- "f=0.036\n",
- "hl=f*L/(d/12.) *V*V /(2*g)\n",
- "dp=gam*hl\n",
- "#results\n",
- "print '%s %.2f %s' %(\"Pressure difference =\",dp,\"lb/ft^2 per foot of horizontal pipe\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Pressure difference = 2.25 lb/ft^2 per foot of horizontal pipe\n"
- ]
- }
- ],
- "prompt_number": 15
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 11 - Pg 289"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the horsepower required\n",
- "#Initialization of variables\n",
- "import math\n",
- "d2=4. #in\n",
- "d1=3. #in\n",
- "e=0.0005 #ft\n",
- "mu=3.75e-5 #lb-sec/ft^2\n",
- "rho=1.94 #slugs/ft^3\n",
- "Q=100. #gal/min\n",
- "L=100. #ft\n",
- "g=32.2 #ft/s^2\n",
- "gam=62.4\n",
- "#calculations\n",
- "A=math.pi/4. *(math.pow((d2/12),2) -math.pow((d1/12),2))\n",
- "WP=math.pi*(d1+d2)/12.\n",
- "R=A/WP\n",
- "RR= 2*R/e\n",
- "V= Q/(7.48*60*A)\n",
- "Nr=V*4*R*rho/mu\n",
- "f=0.035\n",
- "hl=f*L/(4*R) *V*V /(2*g)\n",
- "hp=hl*Q/(7.48*60) *gam/550.\n",
- "#results\n",
- "print '%s %.2f %s' %(\"horsepower required =\",hp,\" hp/100 ft\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "horsepower required = 0.56 hp/100 ft\n"
- ]
- }
- ],
- "prompt_number": 16
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 12 - Pg 296"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the discharge flow\n",
- "#Initialization of variables\n",
- "import math\n",
- "p1=25. #psig\n",
- "p2=20. #psig\n",
- "d1=18. #in\n",
- "d2=12. #in\n",
- "Cl=0.25\n",
- "gam=62.4\n",
- "g=32.2 #ft/s^2\n",
- "#calculations\n",
- "Vr=(d2/d1)*(d2/d1)\n",
- "xv=(p2-p1)*144/gam\n",
- "V22=xv/(-1-Cl+Vr*Vr) *2*g\n",
- "V2=math.sqrt(V22)\n",
- "Q=V2*math.pi/4. *(d2/12.)*(d2/12.)\n",
- "#results\n",
- "print '%s %.1f %s' %(\"Discharge =\",Q,\"ft^3/s\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Discharge = 20.9 ft^3/s\n"
- ]
- }
- ],
- "prompt_number": 17
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13 - Pg 300"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the discharge flow rate\n",
- "#Initialization of variables\n",
- "import math\n",
- "V61=10.8 #ft/s\n",
- "V81=6.05 #ft/s\n",
- "r0=3 #in\n",
- "e=0.00015\n",
- "d1=6. #in\n",
- "rho=1.94 #slugs/ft^3\n",
- "mu=2.34e-5 #ft-lb/s^2\n",
- "#calculations\n",
- "roe=r0/(12*e)\n",
- "Nr1=V61*(d1/12.)*rho/mu\n",
- "f6=0.0165\n",
- "V6=11.6 #ft/s\n",
- "V8=6.52 #ft/s\n",
- "Q=V6*math.pi/4 *(d1/12.)*(d1/12.)\n",
- "#results\n",
- "print '%s %.2f %s' %(\"Discharge =\",Q,\"ft^3/s\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Discharge = 2.28 ft^3/s\n"
- ]
- }
- ],
- "prompt_number": 18
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 14 - Pg 302"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the diameter of steel pipe\n",
- "#Initialization of variables\n",
- "import math\n",
- "L=1000. #ft\n",
- "Q=2000/(7.48*60) #ft63/s\n",
- "g=32.2 #ft/s^2\n",
- "p=5. #psi/1000 ft\n",
- "gam=62.4\n",
- "sp=0.7\n",
- "f=0.02\n",
- "r0=0.904/2.\n",
- "e=0.00015\n",
- "mu=7e-6 #lb-ft/s^2\n",
- "L=1000. #ft\n",
- "#calculations\n",
- "hl=p*144/(sp*gam)\n",
- "D5=f*8*L*Q*Q /(math.pi*math.pi *g*hl)\n",
- "D=math.pow(D5,(1./5.))\n",
- "Nr=4*Q*sp*gam/(g*(math.pi*D*mu))\n",
- "f2=0.0145\n",
- "D5=f2*8*L*Q*Q /(math.pi*math.pi *g*hl)\n",
- "D1=math.pow(D5,(1./5.))\n",
- "#results\n",
- "print '%s %.3f %s' %(\"Diameter of steel pipe =\",D1,\" ft\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Diameter of steel pipe = 0.848 ft\n"
- ]
- }
- ],
- "prompt_number": 19
- }
- ],
- "metadata": {}
- }
- ]
-} \ No newline at end of file
diff --git a/Fluid_mechanics/Chapter_8.ipynb b/Fluid_mechanics/Chapter_8.ipynb
deleted file mode 100755
index 76c114d3..00000000
--- a/Fluid_mechanics/Chapter_8.ipynb
+++ /dev/null
@@ -1,802 +0,0 @@
-{
- "metadata": {
- "name": "",
- "signature": "sha256:f292d23876c88421bcfc8b761169402a2885837db02032e303215ae83f2c5cf5"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 8 - Fluid compressibility and incompressible flow"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 1 - Pg 323"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the initial and final volumes. Also, calculate the final temperature of the gas\n",
- "#Initialization of variables\n",
- "import math\n",
- "pi=14.7 #psia\n",
- "pf=50. #psia\n",
- "cp=0.240 #Btu/lb R\n",
- "cv=0.170 #Btu/lb R\n",
- "J=778\n",
- "T=60+459.6 #R\n",
- "#calculations\n",
- "R=J*(cp-cv)\n",
- "k=cp/cv\n",
- "gam=pi*144./(R*T)\n",
- "V=1/gam\n",
- "Vf=V*math.pow((pi/pf),(1/k))\n",
- "Tf=T*(pf*Vf/(pi*V))\n",
- "#results\n",
- "print '%s %.2f %s' %(\"Initial volume =\",V,\"ft^3\")\n",
- "print '%s %.2f %s' %(\"\\n Final volume =\",Vf,\"cu ft\")\n",
- "print '%s %.1f %s' %(\"\\n Final temperature =\",Tf,\" R\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Initial volume = 13.37 ft^3\n",
- "\n",
- " Final volume = 5.62 cu ft\n",
- "\n",
- " Final temperature = 742.6 R\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2 - Pg 325"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the pressure difference across the pipe\n",
- "#Initialization of variables\n",
- "import math\n",
- "ratio=0.99\n",
- "E=3.19e5 #lb/in^2\n",
- "#calculations\n",
- "pd=-E*math.log(ratio)\n",
- "#ersults\n",
- "print '%s %d %s' %(\"Pressure difference =\",pd,\"psi\")\n",
- "print '%s' %(\"The answers are a bit different from textbook due to rounding off error\")"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Pressure difference = 3206 psi\n",
- "The answers are a bit different from textbook due to rounding off error\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3 - Pg 329"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the speed of test plane\n",
- "#Initialization of variables\n",
- "import math\n",
- "k=1.4\n",
- "g=32.2 #ft/s^2\n",
- "R=53.3 #ft-lb/lb R\n",
- "T=389.9 #R\n",
- "Nm=2\n",
- "#calculations\n",
- "c=math.sqrt(k*g*R*T)\n",
- "V=Nm*c*3600/5280.\n",
- "#results\n",
- "print '%s %.1f %s' %(\"Speed of test plane =\",V,\"mph\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Speed of test plane = 1319.9 mph\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 4a - Pg 337"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the velocity at section 2\n",
- "#Initialization of variables\n",
- "import math\n",
- "T1=584.6 #R\n",
- "g=32.2 #ft/s^2\n",
- "k=1.4\n",
- "R=53.3 #ft-lb/lb R\n",
- "V1=600 #ft/s\n",
- "T2=519.6 #R\n",
- "#calculations\n",
- "Nm1=V1/(math.sqrt(k*g*R*T1))\n",
- "Nm22= ((1+ (k-1)/2 *Nm1*Nm1)/(T2/T1) -1)*(2/(k-1))\n",
- "Nm2=math.sqrt(Nm22)\n",
- "V2=Nm2*math.sqrt(k*g*R*T2)\n",
- "#results\n",
- "print '%s %d %s' %(\"Velocity at section 2 =\",V2,\"ft/s\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Velocity at section 2 = 1068 ft/s\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 4b - Pg 337"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the pressure difference between two stations\n",
- "#Initialization of variables\n",
- "import math\n",
- "T1=584.6 #R\n",
- "g=32.2 #ft/s^2\n",
- "k=1.4\n",
- "R=53.3 #ft-lb/lb R\n",
- "V1=600 #ft/s\n",
- "T2=519.6 #R\n",
- "pa=14.7 #psi\n",
- "p1=50 #psia\n",
- "#calculations\n",
- "Nm1=V1/(math.sqrt(k*g*R*T1))\n",
- "Nm22= ((1+ (k-1)/2 *Nm1*Nm1)/(T2/T1) -1)*(2/(k-1))\n",
- "Nm2=math.sqrt(Nm22)\n",
- "pr=math.pow(((1+ (k-1)/2 *Nm1*Nm1)/(1+ (k-1)/2 *Nm2*Nm2)),(k/(k-1)))\n",
- "p2=pr*(p1+pa)\n",
- "dp=p1+pa-p2\n",
- "#results\n",
- "print '%s %.1f %s' %(\"Pressure difference between two stations =\",dp,\"psi\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Pressure difference between two stations = 21.9 psi\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 4c - Pg 338"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the area ratio\n",
- "#Initialization of variables\n",
- "import math\n",
- "T1=584.6 #R\n",
- "g=32.2 #ft/s^2\n",
- "k=1.4\n",
- "R=53.3 #ft-lb/lb R\n",
- "V1=600 #ft/s\n",
- "T2=519.6 #R\n",
- "#calculations\n",
- "Nm1=V1/(math.sqrt(k*g*R*T1))\n",
- "Nm22= ((1+ (k-1)/2 *Nm1*Nm1)/(T2/T1) -1)*(2/(k-1))\n",
- "Nm2=math.sqrt(Nm22)\n",
- "Ar= Nm1/Nm2 *math.pow(((1+ (k-1)/2 *Nm2*Nm2)/(1+ (k-1)/2 *Nm1*Nm1)),((k+1)/(2*(k-1))))\n",
- "#results\n",
- "print '%s %.3f' %(\"Area ratio = \",Ar)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Area ratio = 0.754\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 4d - Pg 338"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the density of air at both the stations\n",
- "#Initialization of variables\n",
- "import math\n",
- "T1=584.6 #R\n",
- "g=32.2 #ft/s^2\n",
- "k=1.4\n",
- "R=53.3 #ft-lb/lb R\n",
- "V1=600 #ft/s\n",
- "T2=519.6 #R\n",
- "pa=14.7 #psi\n",
- "p1=50 #psia\n",
- "#calculations\n",
- "Nm1=V1/(math.sqrt(k*g*R*T1))\n",
- "Nm22= ((1+ (k-1)/2 *Nm1*Nm1)/(T2/T1) -1)*(2/(k-1))\n",
- "Nm2=math.sqrt(Nm22)\n",
- "pr=math.pow(((1+ (k-1)/2 *Nm1*Nm1)/(1+ (k-1)/2 *Nm2*Nm2)),(k/(k-1)))\n",
- "p2=pr*(p1+pa)\n",
- "rho1=(p1+pa)*144./(g*R*T1)\n",
- "rho2=p2*144./(g*R*T2)\n",
- "#results\n",
- "print '%s %.5f %s' %(\"Density of air at station 1 =\",rho1,\"slug/ft^3\")\n",
- "print '%s %.5f %s' %(\"\\n Density of air at station 2 =\",rho2,\"slug/ft^3\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Density of air at station 1 = 0.00929 slug/ft^3\n",
- "\n",
- " Density of air at station 2 = 0.00692 slug/ft^3\n"
- ]
- }
- ],
- "prompt_number": 7
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5 - Pg 345"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the mass rate of air flow\n",
- "#Initialization of variables\n",
- "import math\n",
- "p0=19.7 #psia\n",
- "R=53.3 #lb-ft/lb-R\n",
- "T0=539.6 #R\n",
- "g=32.2 #ft/s^2\n",
- "pa=14.7 #psia\n",
- "d=1 #in\n",
- "k=1.4\n",
- "#calculations\n",
- "rho0=p0*144/(g*R*T0)\n",
- "pr=pa/p0\n",
- "G=math.pi/4 *(d/12.)*(d/12.) *math.pow((2*k/(k-1) *p0*144*rho0),(0.5)) *math.pow((pr),(1/k)) *math.pow((1-math.pow(pr,((k-1)/k))),0.5)\n",
- "#results\n",
- "print '%s %.5f %s' %(\"Mass rate of air flow =\",G,\"slug/sec\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Mass rate of air flow = 0.00978 slug/sec\n"
- ]
- }
- ],
- "prompt_number": 8
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6 - Pg 346"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the mass rate of air flow\n",
- "#Initialization of variables\n",
- "import math\n",
- "p0=64.7 #psia\n",
- "R=53.3 #lb-ft/lb-R\n",
- "T0=539.6 #R\n",
- "g=32.2 #ft/s^2\n",
- "pa=14.7 #psia\n",
- "d=1. #in\n",
- "k=1.4\n",
- "#calculations\n",
- "rho0=p0*144/(g*R*T0)\n",
- "pr=pa/p0\n",
- "G=math.pi/4 *(d/12)*d/12. *math.pow((k*p0*144*rho0),(0.5)) *math.pow((2/(k+1)),((k+1)/(2*(k-1))))\n",
- "#results\n",
- "print '%s %.5f %s' %(\"Mass rate of air flow =\",G,\"slug/sec\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Mass rate of air flow = 0.03616 slug/sec\n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 7a - Pg 347"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the weight of air flow through the nozzle\n",
- "#Initialization of variables\n",
- "import math\n",
- "k=1.4\n",
- "R=53.3 #lb-ft/lb R\n",
- "pe=14.7 #psia\n",
- "p0=114.7 #psia\n",
- "T0=524.6 #R\n",
- "g=32.2 #ft/s^2\n",
- "d=0.5 #in\n",
- "#calculations\n",
- "pr=pe/p0\n",
- "prcr=0.528\n",
- "pr=prcr*p0\n",
- "rho0= p0*144/(g*R*T0)\n",
- "G=math.pi/4 *(d/12)*d/12. *math.pow((k*p0*144*rho0),(0.5)) *math.pow((2/(k+1)),((k+1)/(2*(k-1))))\n",
- "Wt=G*g\n",
- "#results\n",
- "print '%s %.4f %s' %(\"weight of air flow through the nozzle =\",Wt,\"lb/s\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "weight of air flow through the nozzle = 0.5233 lb/s\n"
- ]
- }
- ],
- "prompt_number": 10
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 7b - Pg 348"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the exit Mach number, exit velocity and the exit area\n",
- "#Initialization of variables\n",
- "import math\n",
- "k=1.4\n",
- "R=53.3 #lb-ft/lb R\n",
- "pe=14.7 #psia\n",
- "p0=114.7 #psia\n",
- "T0=524.6 #R\n",
- "g=32.2 #ft/s^2\n",
- "d=0.5 #in\n",
- "Nm1=1.\n",
- "#calculations\n",
- "pr=pe/p0\n",
- "Nme=math.sqrt(2/(k-1) *(math.pow(1./pr,(k-1)/k) -1))\n",
- "Te=T0/(1+ (k-1)/2 *Nme*Nme)\n",
- "Ve=Nme*math.sqrt(k*g*R*Te)\n",
- "At=math.pi/4. *(d)*d\n",
- "Ae=Nm1/Nme *math.pow(((1+ (k-1)/2 *Nme*Nme)/(1+ (k-1)/2 *Nm1*Nm1)),((k+1)/(2*(k-1)))) *At\n",
- "#results\n",
- "print '%s %.2f' %(\"Mach number exit = \",Nme)\n",
- "print '%s %d %s' %(\"\\n Exit velocity =\",Ve,\"ft/s\")\n",
- "print '%s %.3f %s' %(\"\\n Exit area =\",Ae,\" in^2\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Mach number exit = 2.00\n",
- "\n",
- " Exit velocity = 1672 ft/s\n",
- "\n",
- " Exit area = 0.331 in^2\n"
- ]
- }
- ],
- "prompt_number": 11
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 8a - Pg 349"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the exit mass flow rate, pressure, temperature, velocity and mach number\n",
- "#Initialization of variables\n",
- "import math\n",
- "k=1.4\n",
- "R=53.3 #lb-ft/lb R\n",
- "p0=100. #psia\n",
- "T0=534.6 #R\n",
- "g=32.2 #ft/s^2\n",
- "d=0.5 #in\n",
- "Nm1=1.\n",
- "A=2./144. #ft^2\n",
- "#calculations\n",
- "print '%s' %(\"Exit mach number is found using trial and error\")\n",
- "Nme=2.44\n",
- "rho0=p0*144/(g*R*T0)\n",
- "G= A*math.sqrt(k*p0*144*rho0) *math.pow((2/(k+1)),((k+1)/(2*(k-1))))\n",
- "pe=p0*math.pow((1/(1+(k-1)/2 *Nme*Nme)),(k/(k-1)))\n",
- "Te=T0/(1+ (k-1)/2 *Nme*Nme)\n",
- "Ve=Nme*(math.sqrt(k*g*R*Te))\n",
- "#results\n",
- "print '%s %.3f %s' %(\"\\n Exit mass flow rate =\",G,\"slug/s\")\n",
- "print '%s %.2f %s' %(\"\\n Exit pressure =\",pe,\"psia\")\n",
- "print '%s %.1f %s' %(\"\\n Exit temperature =\",Te,\" R\")\n",
- "print '%s %d %s' %(\"\\n Exit velocity =\",Ve,\"ft/s\")\n",
- "print '%s %.2f' %(\"\\n Exit mach number = \",Nme)\n",
- "print '%s' %(\"The answers are a bit different from textbook due to rounding off error\")"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Exit mach number is found using trial and error\n",
- "\n",
- " Exit mass flow rate = 0.143 slug/s\n",
- "\n",
- " Exit pressure = 6.43 psia\n",
- "\n",
- " Exit temperature = 244.0 R\n",
- "\n",
- " Exit velocity = 1868 ft/s\n",
- "\n",
- " Exit mach number = 2.44\n",
- "The answers are a bit different from textbook due to rounding off error\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 8b - Pg 350"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the exit mass flow rate, pressure, temperature,velocity and mach number\n",
- "#Initialization of variables\n",
- "import math\n",
- "k=1.4\n",
- "R=53.3 #lb-ft/lb R\n",
- "p0=100. #psia\n",
- "T0=534.6 #R\n",
- "g=32.2 #ft/s^2\n",
- "d=0.5 #in\n",
- "Nm1=1.\n",
- "A=2./144. #ft^2\n",
- "#calculations\n",
- "print '%s' %(\"Exit mach number is found using trial and error\")\n",
- "Nme=0.24\n",
- "rho0=p0*144/(g*R*T0)\n",
- "G= A*math.sqrt(k*p0*144*rho0) *math.pow((2/(k+1)),((k+1)/(2*(k-1))))\n",
- "pe=p0*math.pow((1/(1+(k-1)/2 *Nme*Nme)),(k/(k-1)))\n",
- "Te=T0/(1+ (k-1)/2 *Nme*Nme)\n",
- "Ve=Nme*(math.sqrt(k*g*R*Te))\n",
- "#results\n",
- "print '%s %.3f %s' %(\"\\n Exit mass flow rate =\",G,\"slug/s\")\n",
- "print '%s %.2f %s' %(\"\\n Exit pressure =\",pe,\"psia\")\n",
- "print '%s %.1f %s' %(\"\\n Exit temperature =\",Te,\" R\")\n",
- "print '%s %d %s' %(\"\\n Exit velocity =\",Ve,\"ft/s\")\n",
- "print '%s %.2f' %(\"\\n Exit mach number = \",Nme)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Exit mach number is found using trial and error\n",
- "\n",
- " Exit mass flow rate = 0.143 slug/s\n",
- "\n",
- " Exit pressure = 96.07 psia\n",
- "\n",
- " Exit temperature = 528.5 R\n",
- "\n",
- " Exit velocity = 270 ft/s\n",
- "\n",
- " Exit mach number = 0.24\n"
- ]
- }
- ],
- "prompt_number": 13
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 9 - Pg 355"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the upstream Mach number, pressure, Temperature\n",
- "#Initialization of variables\n",
- "import math\n",
- "k=1.4\n",
- "R=53.3 #lb-ft/lb R\n",
- "pu=6.43 #psia\n",
- "Tu=244. #R\n",
- "Nmu=2.44\n",
- "#calculations\n",
- "Nmd = math.sqrt(((k-1)*Nmu*Nmu +2)/(2*k*Nmu*Nmu - (k-1)))\n",
- "pd=pu*(2*k*Nmu*Nmu - (k-1))/(k+1)\n",
- "Td=Tu*(2*k*Nmu*Nmu - (k-1))/(k+1) *((k-1)*Nmu*Nmu +2)/((k+1)*Nmu*Nmu)\n",
- "#results\n",
- "print '%s %.3f' %(\"Mach number upstream = \",Nmd)\n",
- "print '%s %.1f %s' %(\"\\n Pressure upstream =\",pd,\"psia\")\n",
- "print '%s %.1f %s' %(\"\\n Temperature upstream =\",Td,\"R\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Mach number upstream = 0.519\n",
- "\n",
- " Pressure upstream = 43.6 psia\n",
- "\n",
- " Temperature upstream = 507.2 R\n"
- ]
- }
- ],
- "prompt_number": 14
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 10 - Pg 359"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the pressure and temperature at section 1\n",
- "#Initialization of variables\n",
- "import math\n",
- "k=1.4\n",
- "R=53.3 #lb-ft/lb R\n",
- "e=0.0005 #ft\n",
- "mu=3.77e-7 #lb-sec/ft^2\n",
- "pe=14.7 #psia\n",
- "Te=524.6 #R\n",
- "g=32.2 #ft/s^2\n",
- "Vi=12.5 #ft/s\n",
- "l=6. #in\n",
- "b=8. #in\n",
- "L=100. #ft\n",
- "#calculations\n",
- "rhoe=pe*144/(R*g*Te)\n",
- "Ve=Vi/(g*rhoe*(l*b/144.))\n",
- "Nme=Ve/(math.sqrt(k*g*R*Te))\n",
- "Rd=l*b/(2*(l+b)) /12.\n",
- "rr=2*R/e\n",
- "Nr=Ve*4*Rd*rhoe/mu\n",
- "f=0.019\n",
- "f2=1/(2*k) *(1/Nme*Nme -1) - (k+1)/(4*k) *math.log((1+ (k-1)/2 *Nme*Nme)/(Nme*Nme *(1+(k-1)/2)))\n",
- "ff=f*L/(8*Rd) +f2\n",
- "Nm1=0.305\n",
- "Tr2=(1+ (k-1)/2 *Nm1*Nm1)/(1+ (k-1/2))\n",
- "Tre=(1+ (k-1)/2 *Nme*Nme)/(1+ (k-1/2))\n",
- "pr2=Nm1*math.pow((1+ (k-1)/2 *Nm1*Nm1),(0.5)) /math.pow((1+(k-1)/2),0.5)\n",
- "pre=Nme*math.pow((1+ (k-1)/2 *Nme*Nme),(0.5)) /math.pow((1+(k-1)/2),0.5)\n",
- "p1=pe/pr2 *pre\n",
- "T1=Te/Tr2 *Tre\n",
- "#results\n",
- "print '%s %.1f %s' %(\"Pressure at section 1 =\",p1,\"psia\")\n",
- "print '%s %.1f %s' %(\"\\n Tempreature at section 1 =\",T1,\"R\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Pressure at section 1 = 21.5 psia\n",
- "\n",
- " Tempreature at section 1 = 535.1 R\n"
- ]
- }
- ],
- "prompt_number": 15
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 11 - Pg 364"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the limiting pressure and distance in both adiabatic and non-adiabatic cases\n",
- "#Initialization of variables\n",
- "import math\n",
- "k=1.4\n",
- "R=53.3 #lb-ft/lb R\n",
- "g=32.2 #ft/s^2\n",
- "T1=534.6 #R\n",
- "V1=400. #ft/s\n",
- "p1=350. #psia\n",
- "f=0.02\n",
- "D=6./12. #ft\n",
- "#calculations\n",
- "Nm1=V1/math.sqrt(k*g*R*T1)\n",
- "Nm2= 1. /math.sqrt(k)\n",
- "p2=p1*(Nm1)/Nm2\n",
- "fl= math.log(Nm1/Nm2) + 1./(2.*k*Nm1*Nm1) *(1- Nm1*Nm1/Nm2*Nm2)\n",
- "L12=fl*2*D/f\n",
- "ps=p1*Nm1*math.pow((1+ (k-1)/2 *Nm1*Nm1),0.5) /math.pow((1+(k-1)/2),0.5)\n",
- "Nm2=1.\n",
- "fl2= -(k+1)/(4*k) *math.log((1+ (k-1)/2 *Nm1*Nm1)/(Nm1*Nm1 *(1+ (k-1)/2.))) + 1/(2*k*Nm1*Nm1) *(1- Nm1*Nm1 /Nm2*Nm2)\n",
- "L2=fl2*2*D/f\n",
- "#results\n",
- "print '%s %.1f %s' %(\"Limiting pressure =\",p2,\" psia\")\n",
- "print '%s %.1f %s' %(\"\\n Distance =\",L12,\" ft\")\n",
- "print '%s %.1f %s' %(\"\\n Limiting pressure in adiabatic case =\",ps,\" psia\")\n",
- "print '%s %.1f %s' %(\"\\n Distance required =\",L2,\"ft\")\n",
- "print '%s' %(\"the answer is a bit different due to rounding of error in textbook\")"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Limiting pressure = 146.2 psia\n",
- "\n",
- " Distance = 81.8 ft\n",
- "\n",
- " Limiting pressure in adiabatic case = 114.2 psia\n",
- "\n",
- " Distance required = 84.2 ft\n",
- "the answer is a bit different due to rounding of error in textbook\n"
- ]
- }
- ],
- "prompt_number": 16
- }
- ],
- "metadata": {}
- }
- ]
-} \ No newline at end of file
diff --git a/Fluid_mechanics/Chapter_9.ipynb b/Fluid_mechanics/Chapter_9.ipynb
deleted file mode 100755
index f131ead9..00000000
--- a/Fluid_mechanics/Chapter_9.ipynb
+++ /dev/null
@@ -1,450 +0,0 @@
-{
- "metadata": {
- "name": "",
- "signature": "sha256:6e08f75972be45750168908e0258e415f396bd3e7aae6981e62e0a4fd06177dc"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 9 - Fluid flow about immersed bodies"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 1a - Pg 389"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the values of Fd\n",
- "#Initialization of variables\n",
- "import math\n",
- "import numpy\n",
- "rho=2.45 #slugs/ft^3\n",
- "mu=9.2e-3 #lb-sec/ft^2\n",
- "x=3.\n",
- "v=3. #ft/s\n",
- "B=6./12. #ft\n",
- "L=36./12. #ft\n",
- "#calculatons\n",
- "Nr=v*x*rho/mu\n",
- "y=([1.32, 1.46, 1.328])\n",
- "Cd = numpy.zeros(len(y))\n",
- "for i in range (0, len(y)):\n",
- "\tCd[i]=y[i]*math.pow(Nr,(-0.5))\n",
- "Fd = numpy.zeros(len(Cd))\n",
- "for i in range (0, len(y)):\n",
- "\tFd[i]=2*Cd[i]*B*L*(0.5*rho*v*v)\n",
- "\n",
- "#results\n",
- "print '%s' %(\"Drag on the plates using different formulae blasius, parabola and pohlhauser in order\")\n",
- "print '%.3f %.3f %.3f' %(Fd[0],Fd[1],Fd[2])"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Drag on the plates using different formulae blasius, parabola and pohlhauser in order\n",
- "0.892 0.986 0.897\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 1b - Pg 390"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calcualte the boundary layer thickness and the shearing thickness\n",
- "#Initialization of variables\n",
- "import math\n",
- "import numpy\n",
- "x=36./12.\n",
- "rho=2.45 #slugs/ft^3\n",
- "mu=9.2e-3 #lb-sec/ft^2\n",
- "v=3. #ft/s\n",
- "#calculatons\n",
- "Nr=v*x*rho/mu\n",
- "z=([4.91, 5.48, 4.65])\n",
- "x=36./12.\n",
- "delta = numpy.zeros(len(z))\n",
- "for i in range (0, len(z)):\n",
- "\tdelta[i]=z[i] /math.sqrt(Nr) *x\n",
- "\n",
- "\n",
- "f=([0.332, 0.365, 0.322])\n",
- "T=numpy.zeros(len(f))\n",
- "for i in range (0,len(f)):\n",
- "\tT[i]=f[i]*mu*v/x *math.sqrt(Nr)\n",
- "\n",
- "#results\n",
- "print '%s' %(\"Boundary layer thickness = \")\n",
- "print '%s' %(\"In order of Blasius, parabola and pohlhauser\")\n",
- "print '%.3f %.3f %.3f' %(delta[0],delta[1],delta[2])\n",
- "print '%s' %(\"Shearing stress = \")\n",
- "print '%s' %(\"In order of Blasius, parabola and pohlhauser\")\n",
- "print '%.3f %.3f %.3f' %(T[0],T[1],T[2])\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Boundary layer thickness = \n",
- "In order of Blasius, parabola and pohlhauser\n",
- "0.301 0.336 0.285\n",
- "Shearing stress = \n",
- "In order of Blasius, parabola and pohlhauser\n",
- "0.150 0.164 0.145\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2a - Pg 398"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the total frictional drag and horsepower required\n",
- "#Initialization of variables\n",
- "import math\n",
- "e=0.01 #ft\n",
- "rho=2 #slugs/ft^3\n",
- "mu=2.6e-5 #lb sec/ft^2\n",
- "speed=10. #knots\n",
- "L=250. #ft\n",
- "A=30000. #ft^2\n",
- "#calculations\n",
- "V=speed*1.69\n",
- "Nrl=V*L*rho/mu\n",
- "Cdf=1.32 /math.sqrt(Nrl)\n",
- "Fd=Cdf*A*0.5*rho*V*V\n",
- "hp=Fd*V/550.\n",
- "#results\n",
- "print '%s %d %s' %(\"Total frictional drag =\",Fd,\"lb\")\n",
- "print '%s %.1f %s' %(\"\\n Horsepower required =\",hp,\"hp\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Total frictional drag = 627 lb\n",
- "\n",
- " Horsepower required = 19.3 hp\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2b - Pg 397"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the total frictional drag and horsepower required\n",
- "#Initialization of variables\n",
- "import math\n",
- "e=0.01 #ft\n",
- "rho=2 #slugs/ft^3\n",
- "mu=2.6e-5 #lb sec/ft^2\n",
- "speed=10 #knots\n",
- "L=250. #ft\n",
- "A=30000. #ft^2\n",
- "#calculations\n",
- "V=speed*1.69\n",
- "Nrl=V*L*rho/mu\n",
- "Cdf=0.074/math.pow(Nrl,0.2) -1700./Nrl\n",
- "Fd=Cdf*A*0.5*rho*V*V\n",
- "hp=Fd*V/550.\n",
- "#results\n",
- "print '%s %d %s' %(\"Total frictional drag =\",Fd,\"lb\")\n",
- "print '%s %.1f %s' %(\"\\n Horsepower required =\",hp,\"hp\")\n",
- "print '%s' %(\"The answer given in textbook is wrong. please use a calculator\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Total frictional drag = 12537 lb\n",
- "\n",
- " Horsepower required = 385.2 hp\n",
- "The answer given in textbook is wrong. please use a calculator\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 2c - Pg 398"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the total frictional drag and horsepower required\n",
- "#Initialization of variables\n",
- "import math\n",
- "e=0.01 #ft\n",
- "rho=2. #slugs/ft^3\n",
- "mu=2.6e-5 #lb sec/ft^2\n",
- "speed=10. #knots\n",
- "L=250. #ft\n",
- "A=30000. #ft^2\n",
- "#calculations\n",
- "V=speed*1.69\n",
- "Nrl=V*L*rho/mu\n",
- "Cdf=1/math.pow((1.89 + 1.62*math.log10(L/e)),(2.5))\n",
- "Fd=Cdf*A*0.5*rho*V*V\n",
- "hp=Fd*V/550.\n",
- "#results\n",
- "print '%s %d %s' %(\"Total frictional drag =\",Fd,\"lb\")\n",
- "print '%s %.1f %s' %(\"\\n Horsepower required =\",hp,\"hp\")\n",
- "print '%s' %(\"The answers are a bit different from textbook due to rounding off error\")"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Total frictional drag = 35117 lb\n",
- "\n",
- " Horsepower required = 1079.1 hp\n",
- "The answers are a bit different from textbook due to rounding off error\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3 - Pg 398"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the drag on the model\n",
- "#Initialization of variables\n",
- "import math\n",
- "V=200. #ft/s\n",
- "L=5. #ft\n",
- "B=2. #ft\n",
- "rho=0.00232 #slug/ft^3\n",
- "mu=3.82e-7 #lb-sec/ft^2\n",
- "p2=14.815 #psia\n",
- "pa=14.7 #psia\n",
- "#calculations\n",
- "Nr=V*L*rho/mu\n",
- "Cdf=0.0032\n",
- "Fdf=Cdf*math.pi*L*B*0.5*rho*V*V\n",
- "Fd=(p2-pa)*math.pi/4. *(B*12)*(B*12) -Fdf\n",
- "#results\n",
- "print '%s %.2f %s' %(\"Drag on the model =\",Fd,\"lb\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Drag on the model = 47.36 lb\n"
- ]
- }
- ],
- "prompt_number": 7
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 4 - Pg 405"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the velocity of the flow\n",
- "#Initialization of variables\n",
- "import math\n",
- "p1=14.7 #psia\n",
- "z1=3 #ft\n",
- "gam=62.4\n",
- "rho=1.94 #slug/ft^3\n",
- "pa=0.4 #psia\n",
- "za=1 #ft\n",
- "#calculations\n",
- "v3=(pa-p1)*144 + (za-z1)*gam\n",
- "V=math.sqrt(-v3*2/(3*rho))\n",
- "#results\n",
- "print '%s %.1f %s' %(\"Velocity of flow =\",V,\" ft/s\")\n",
- "print '%s' %(\"The answer is a bit different due to rounding off error in textbook\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Velocity of flow = 27.4 ft/s\n",
- "The answer is a bit different due to rounding off error in textbook\n"
- ]
- }
- ],
- "prompt_number": 8
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5 - Pg 410"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the horsepower required\n",
- "#Initialization of variables\n",
- "import math\n",
- "rpm=60. \n",
- "rho=2. #slugs/ft^3\n",
- "mu=3.5e-5 #lb-sec/ft^2\n",
- "D=4./12. #ft\n",
- "r=2. #ft\n",
- "#calcualtions\n",
- "V=rpm*2*math.pi/60. *2\n",
- "Nr=V*D*rho/mu\n",
- "Cd=1.1\n",
- "Fd=Cd*math.pi/4. *(D)*D *0.5*rho*V*V\n",
- "T=2*Fd*r\n",
- "w=rpm*2*math.pi/60.\n",
- "hp=T*w/550.\n",
- "#results\n",
- "print '%s %.2f %s' %(\"Horsepower required =\",hp,\" hp\")\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Horsepower required = 0.69 hp\n"
- ]
- }
- ],
- "prompt_number": 9
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 6 - Pg 414"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#calculate the terminal velocity\n",
- "#Initialization of variables\n",
- "import math\n",
- "g=32.2 #ft/s^2\n",
- "h=60000. #ft\n",
- "F=2000. #;b\n",
- "d=3. #ft\n",
- "rho=0.00231\n",
- "#calculations\n",
- "V=math.sqrt(2*g*h)\n",
- "print '%s' %(\"By trail and error\")\n",
- "Cd=0.25\n",
- "Nm=0.87\n",
- "A=math.pi/4. *d*d\n",
- "Vt=math.sqrt(2*F/(Cd*A*rho))\n",
- "#results \n",
- "print '%s %.1f %s' %(\"terminal velocity =\",Vt,\" ft/s\")\n",
- "print '%s' %(\"The answers are a bit different from textbook due to rounding off error\")"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "By trail and error\n",
- "terminal velocity = 989.9 ft/s\n",
- "The answers are a bit different from textbook due to rounding off error\n"
- ]
- }
- ],
- "prompt_number": 2
- }
- ],
- "metadata": {}
- }
- ]
-} \ No newline at end of file
diff --git a/Fluid_mechanics/README.txt b/Fluid_mechanics/README.txt
deleted file mode 100755
index fe81edb3..00000000
--- a/Fluid_mechanics/README.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-Contributed By: Jaya Pratyusha Kothuri
-Course: btech
-College/Institute/Organization: Sri Mittapalli College of Engineering
-Department/Designation: Computer Science and Engineering
-Book Title: Fluid mechanics
-Author: Pao, Richard H F
-Publisher: John Wiley, New York
-Year of publication: 1961
-Isbn: 0486683567
-Edition: 1 \ No newline at end of file
diff --git a/Fluid_mechanics/screenshots/chap2.png b/Fluid_mechanics/screenshots/chap2.png
deleted file mode 100755
index c7186e17..00000000
--- a/Fluid_mechanics/screenshots/chap2.png
+++ /dev/null
Binary files differ
diff --git a/Fluid_mechanics/screenshots/chap3.png b/Fluid_mechanics/screenshots/chap3.png
deleted file mode 100755
index ea5bf942..00000000
--- a/Fluid_mechanics/screenshots/chap3.png
+++ /dev/null
Binary files differ
diff --git a/Fluid_mechanics/screenshots/chap4.png b/Fluid_mechanics/screenshots/chap4.png
deleted file mode 100755
index 440b52f2..00000000
--- a/Fluid_mechanics/screenshots/chap4.png
+++ /dev/null
Binary files differ