diff options
Diffstat (limited to 'Fluid_Mechanics/Chapter2.ipynb')
-rwxr-xr-x | Fluid_Mechanics/Chapter2.ipynb | 920 |
1 files changed, 920 insertions, 0 deletions
diff --git a/Fluid_Mechanics/Chapter2.ipynb b/Fluid_Mechanics/Chapter2.ipynb new file mode 100755 index 00000000..ffb67770 --- /dev/null +++ b/Fluid_Mechanics/Chapter2.ipynb @@ -0,0 +1,920 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:db7a54602402420ebc03881b70578491b776f0322d83cb209fd1e5faed86cdad" + }, + "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 2.1 Page no 44" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "from math import *\n", + "\n", + "\n", + "d = 10 # diameter of hydraulic press in meters\n", + "\n", + "d1 = 1 # diameter of piston in meters\n", + "\n", + "W = 1000 # weight in Newtons\n", + "\n", + "Ap = math.pi*d1**2/4 # Area of piston in m**2\n", + "\n", + "Ar = math.pi*d**2/4 # Area of rram in m**2\n", + "\n", + "\n", + "p = W/Ar # pressure to be supplied by the oil in N/cm**2\n", + "\n", + "F = p*Ap # Force applied on the piston\n", + "\n", + "print \"Using the pascal's law a weight of 1000N can be lifted by applying a force only of \",round(F,1),\"N\"\n", + " " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Using the pascal's law a weight of 1000N can be lifted by applying a force only of 10.0 N\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 2.2 Page no 53" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "h = 1 # ocean depth below the surface in km\n", + "\n", + "gma = 10070 # Specific weight of sea water\n", + "\n", + "\n", + "P =gma*h # Pressure in kN/m**2\n", + "\n", + "print \"Pressure = \",round(P),\"kN/m**2\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Pressure = 10070.0 kN/m**2\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 2.3 Page no 53" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "p1 = 150*10**3 # Pressure at point 1 in kN/m**2\n", + "\n", + "Sg = 0.85 # Specific gravity of oil\n", + "\n", + "h = 0.8 # height of oil 2 i tank in meters \n", + "\n", + "g = 9810 # specific gravity \n", + "\n", + "h1 = 2.0 # height of oil 3 in tank\n", + "\n", + "\n", + "p2 = (p1 + Sg*h*g)\n", + "\n", + "p3 = (p2 + g*h1)/1000\n", + "\n", + "print \"Pressure at the bottom of the tank is\",round(p3,1),\"kN/m**3\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Pressure at the bottom of the tank is 176.3 kN/m**3" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 2.4 Page no 54" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "from math import *\n", + "\n", + "from __future__ import division\n", + "\n", + "Po = 570 # mercury barometer reading in mm\n", + "\n", + "T = 273 -5 # temperature in K\n", + "\n", + "p = 750 # mercury barometer reading in mm\n", + "\n", + "n = 1.2345 # for polytropic atmosphere\n", + "\n", + "R =287 # univerasl gas constant in J/Kg-K\n", + "\n", + "g = 9.81 \n", + "\n", + "r = p/Po\n", + "\n", + "\n", + "y = -(R*T/(g*0.19))*(1 - (r)**((n-1)/n))\n", + "\n", + "print \"Height of the mountain is\",round(y,0),\"m\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Height of the mountain is 2208.0 m\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 2.5 Page no 57" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "h1 = 500 # height in mm\n", + "\n", + "h2 = 950 # height in mm\n", + "\n", + "S1 = 1 # specific gravity fo water\n", + "\n", + "S2 = 1.5 # specific gravity of liquid 2\n", + "\n", + "w = 9810 # specific weight of water\n", + "\n", + "\n", + "ha = ((h2*S2)-(h1*S1))/1000\n", + "\n", + "Pa = w*ha/1000 # Pressure in kPa\n", + "\n", + "print \"Pressure in the pipe = \",round(Pa,3),\"kPa\"\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Pressure in the pipe = 9.074 kPa\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 2.6 Page no 66" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "from __future__ import division\n", + "\n", + "from math import *\n", + "\n", + "d = 1 # diameter of the gate in m\n", + "\n", + "w = 9810 # specific weight in N/m**3\n", + "\n", + "A = pi*d**2/4 # area of the gate\n", + "\n", + "Ig = pi*d**4/64 # mamm moment of inertia\n", + "\n", + "theta = pi/2\n", + "\n", + "y1= 5+0.5\n", + "\n", + "\n", + "F = w*round(A,3)*(y1) # the answer will come out to be different as they have used the value of Area as 0.78 \n", + "\n", + "\n", + "h1 = y1 + (Ig*math.sin(theta)*math.sin(theta)/(A*y1))\n", + "\n", + "\n", + "F1 = (F*(h1 - 5))/d\n", + "\n", + "print \"Magnitude of the force required to open the gate = \",round(F1,0),\"N\" \n", + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Magnitude of the force required to open the gate = 21659.0 N\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 2.7 Page no 67" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "from math import *\n", + "\n", + "\n", + "l =2 # length of the plate in m\n", + "\n", + "b =1 # width of the plate\n", + "\n", + "theta = pi/3\n", + "\n", + "h = 0.75 # depth of the plate\n", + "\n", + "w = 9810 # specific weight of water\n", + "\n", + "\n", + "A = 1*2\n", + "\n", + "y1 = h + 1*sin(theta)\n", + "\n", + "F = w*A*y1/1000\n", + "\n", + "print \"(a) Total force = \",round(F,2),\"kN\"\n", + "\n", + "Ig = (b*l**3)/12\n", + "\n", + "h1 = y1 + (Ig*sin(theta)*sin(theta)/(2*y1))\n", + "\n", + "print \"(b) Position of center of pressure = \",round(h1,3),\"m\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a) Total force = 31.71 kN\n", + "(b) Position of center of pressure = 1.616 m\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 2.8 Page no 68" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "from math import *\n", + "\n", + "\n", + "d = 6 # diameter of the gate in ft\n", + "\n", + "A =pi*d**2/4 # area of the gate\n", + "\n", + "p1 = 600 # pressure on top in psia\n", + "\n", + "y1 = 10 +2 + 3*sin(pi/6)\n", + "\n", + "F = 62.4*A*y1\n", + "\n", + "F1 = p1*A\n", + "\n", + "\n", + "Tf = F+F1\n", + "\n", + "print \"Total hydrostatic force =\",round(Tf,0),\"lbs\"\n", + "\n", + "Ig = pi*d**4/64\n", + "\n", + "h1 = y1 + ((Ig*sin(pi/6)*sin(pi/6))/(A*y1))\n", + "\n", + "H = ((F*h1)+(F1*y1))/Tf\n", + "\n", + "print \"point of location on the center plate = \",round(H,2),\"ft\"\n", + "\n", + "\n", + "Hf = p1/62.4 # equivalent fluid height\n", + "\n", + "y2 = Hf+y1\n", + "\n", + "Tf1 = 62.4*A*y2\n", + "\n", + "h2 = y2 + ((Ig*sin(pi/6)*sin(pi/6))/(A*y2))\n", + "\n", + "H1 = y2-Hf\n", + "\n", + "print \" OR point of location on the center plate from method 2 = \",round(H1,2),\"ft\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total hydrostatic force = 40783.0 lbs\n", + "point of location on the center plate = 13.52 ft\n", + " OR point of location on the center plate from method 2 = 13.5 ft\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 2.10 Page no 74" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "\n", + "\n", + "R = 4 # radius of the gate in ft\n", + "\n", + "w = 1 # width of the gate in ft\n", + "\n", + "gma =62.4 # specific weight of water\n", + "\n", + "y1 = 4 # distance of center of the gate\n", + "\n", + "xv1 = 2 # distance in ft\n", + "\n", + "xv2 = 1.7 # distance in ft\n", + "\n", + "\n", + "Fh = R*y1*gma\n", + "\n", + "Ig = w*R**3/12\n", + "\n", + "yh = y1 + (Ig/(R*y1))\n", + "\n", + "Fv1 = R*2*gma\n", + "\n", + "Fv2 = pi*R**2*gma/4\n", + "\n", + "Fv = Fv1 + Fv2\n", + "\n", + "Xv = (Fv1*xv1+Fv2*xv2)/(Fv)\n", + "\n", + "print \"Horizontal component acting on the plate = \",round(Fh,2),\"lbs\"\n", + "\n", + "print \"Vertical component acting on the plate = \",round(Fv,2),\"lbs\"\n", + "\n", + "print \"location of Xv =\",round(Xv,2),\"ft\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Horizontal component acting on the plate = 998.4 lbs\n", + "Vertical component acting on the plate = 1283.34 lbs\n", + "location of Xv = 1.82 ft\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 2.11 Page no 77" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "from math import *\n", + "\n", + "from __future__ import division\n", + "\n", + "\n", + "p = 50 # pressure in psia\n", + "\n", + "gma = 62.4 # specific weight in ft\n", + "\n", + "h1 = p*144/gma # equivalent height of water surface in ft\n", + "\n", + "R = 4 # radius of gate in ft\n", + "\n", + "w = 1 # width of the gate in ft\n", + "\n", + "A = R*w\n", + "\n", + "y1 = h1 + 2.5 + 2 # center of pressure\n", + "\n", + "xv1 = 2 # center of pressure1 for x direction force\n", + "\n", + "xv2 = 1.7 # center of pressure2 for x direction force\n", + "\n", + "\n", + "Fh = gma*A*y1 # hiorizontal force\n", + "\n", + "Ig = 5.33 # moment of inertia\n", + "\n", + "yh = y1 + (Ig/(A*y1)) # location of horizontal component\n", + "\n", + "y2 = h1+2.5\n", + "\n", + "Fv1 = gma*(R*y2) # vertical force component 1\n", + "\n", + "Fv2 = gma*(pi*R**2/4) # vrtical force component 2\n", + "\n", + "Fv = Fv1 + Fv2 # vertical force component\n", + "\n", + "Xv = (Fv1*xv1+Fv2*xv2)/(Fv)\n", + "\n", + "print \"(a) Horizontal component acting on the plate = \",round(Fh,0),\"lbs\" # The answer for horizontal force in the book is wrong\n", + "\n", + "print \"(b) Vertical component acting on the plate = \",round(Fv,2),\"lbs\"\n", + "\n", + "print \"location of vertical component Xv =\",round(Xv,2),\"ft from the left wall\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a) Horizontal component acting on the plate = 29923.0 lbs\n", + "(b) Vertical component acting on the plate = 30208.14 lbs\n", + "location of vertical component Xv = 1.99 ft from the left wall\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 2.13 Page no 84" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "from math import *\n", + "\n", + "from __future__ import division\n", + "\n", + "\n", + "l = 3 # length in m\n", + "\n", + "b = 4 # breadth in m\n", + "\n", + "h = 15 # height in m\n", + "\n", + "S = 0.9 # specific gravity of barge\n", + "\n", + "Sw = 1.09 # specific gravity of water\n", + "\n", + "Wd = 150*10**3 # addditional weight in kN\n", + "\n", + "V = l*b*h # volume in m**3\n", + "\n", + "Wb = gma*S*V # weight of barge\n", + "\n", + "Tw = Wb + Wd # total weight in kN\n", + "\n", + "gma = 9810 # specific density \n", + "\n", + "\n", + "Fb = Tw # since barge is floating\n", + "\n", + "V1 = Fb/((gma/1000)*Sw) # volume in m**3\n", + "\n", + "\n", + "d = (V1/(h*b))/1000\n", + "\n", + "print \"Depth to which water would rise = \",round(d,2),\"m\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Depth to which water would rise = 0.25 m\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 2.14 Page no 85 " + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "from math import *\n", + "\n", + "from __future__ import division\n", + "\n", + "import numpy as np\n", + "\n", + "\n", + "W = 0.4 * 9.81 # weight of the solid cylinder in N\n", + "\n", + "\n", + "A = np.array([(1,-0.96),(1,1)])\n", + "\n", + "b = np.array([0,6.37])\n", + "\n", + "x = np.linalg.solve(A,b)\n", + "\n", + "X = x[0]\n", + "\n", + "Y = x[1]\n", + "\n", + "print \"X = \",round(X,2),\"cm\"\n", + "\n", + "print \"Y = \",round(Y,2),\"cm\"\n", + "\n", + "b = 8 -x[0]\n", + "\n", + "print \"The bottom of the solid cylinder will be \",round(b,2),\"cm above the bottom\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "X = 3.12 cm\n", + "Y = 3.25 cm\n", + "The bottom of the solid cylinder will be 4.88 cm above the bottom\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 2.15 Page no 86" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "from math import *\n", + "\n", + "\n", + "l =100 # length of the pan in cm\n", + "\n", + "w = 20 # width of the pan in cm\n", + "\n", + "d = 4 # depth of the pan in cm\n", + "\n", + "L = 1.5 # load in N/m\n", + "\n", + "gma = 9810 # sepcific weight\n", + "\n", + "\n", + "Fb = gma*(d*w*l/(2*l**3)) # weight on the pan\n", + "\n", + "W = Fb-L # weight of the pan\n", + "\n", + "X1 = w/3\n", + "\n", + "X2 = w/2\n", + "\n", + "theta = math.atan(d/w)*180/pi\n", + "\n", + "x = ((X2-X1)*cos(theta*pi/180))\n", + "\n", + "\n", + "M = W*x\n", + "\n", + "print \"Weight of the pan =\",round(W,1),\"N\"\n", + "print \"Magnitude of right momentum = \",round(M,1),\"N.cm\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Weight of the pan = 37.7 N\n", + "Magnitude of right momentum = 123.4 N.cm\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example no 2.16 Page no 90" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "from math import *\n", + "\n", + "from __future__ import division\n", + "\n", + "\n", + "\n", + "Io = 15*4**3/12 # moment of inertia in m**4\n", + "\n", + "V = 15*4*2.71 # Volume in m**3\n", + "\n", + "Gb = ((3/2)-(2.71/2)) \n", + "\n", + "W = 1739.2 # weight of the barge from the previous example in kN\n", + "\n", + "Mg = (Io/V)-Gb # metacentric height in m\n", + "\n", + "print \"(a) Metacentric height = \", round(Mg,3),\"m\"\n", + "\n", + "M = W*Mg*sin(pi*6/180)\n", + "\n", + "print \"(b) Righting moment =\",round(M,1),\"kN.m\"\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a) Metacentric height = 0.347 m\n", + "(b) Righting moment = 63.1 kN.m\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example no 2.17 Page no 92" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "from math import *\n", + "\n", + "from __future__ import division\n", + "\n", + "\n", + "l=6 # length of the tank\n", + "\n", + "w =2 # width of the tank\n", + "\n", + "d = 3 # depth of the tank\n", + "\n", + "a = 3 # acceleration in m/s**2\n", + "\n", + "theta = pi/6\n", + "\n", + "W = 9810 # specific weight\n", + "\n", + "X = 0\n", + "\n", + "po=0 # pressure at the origin\n", + "\n", + "\n", + "A = np.array([(1,-1),(1,1)])\n", + "\n", + "b = np.array([-1.38,3.0])\n", + "\n", + "x = np.linalg.solve(A,b)\n", + "\n", + "Y1 = x[0]\n", + "\n", + "Y2 = x[1]\n", + "\n", + "\n", + "P = po - W*(2.61*X/9.81) - W*(1+(1.5/9.81))*(-Y2)\n", + "\n", + "print\"Amximum pressure occurs at the bottom of the tank =\",round(P,3),\"N\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Amximum pressure occurs at the bottom of the tank = 24768.9 N\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 2.18 Page no 98" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "from math import *\n", + "\n", + "from __future__ import division\n", + "\n", + "\n", + "d = 1 # diamter of the jar in ft\n", + "\n", + "h =2 # height of the jar in ft\n", + "\n", + "H = 1 # height of water in the jar in ft\n", + "\n", + "N = 150 # RPM\n", + "\n", + "g = 32.2 # acceleration due to gravity in ft/s**2\n", + "\n", + "\n", + "w = 2*pi*N/60\n", + "\n", + "ho = H+((w**2*(d/2)**2)/(4*g))\n", + "print \"(a) Height of paraboliod revolution of base = \", round(ho,2),\"ft\"\n", + "\n", + "Pmax = 62.4*ho\n", + "\n", + "print \"(b) Maximum pressure corresponding to maximum height = \",round(Pmax,1),\"lbs/ft**2\"\n", + "\n", + "z = H - ((w**2*(d/2)**2)/(4*g))\n", + "\n", + "r = 0.2 # distance from center\n", + "\n", + "y = -(0.52-0.25)\n", + "\n", + "P = po + (62.4*w**2*r**2/(2*g))-(62.4*y)\n", + "\n", + "print \"(c) Pressure =\",round(P,1),\"lbs/ft**2\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a) Height of paraboliod revolution of base = 1.48 ft\n", + "(b) Maximum pressure corresponding to maximum height = 92.3 lbs/ft**2\n", + "(c) Pressure = 26.4 lbs/ft**2\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file |