diff options
author | debashisdeb | 2014-06-20 15:42:42 +0530 |
---|---|---|
committer | debashisdeb | 2014-06-20 15:42:42 +0530 |
commit | 83c1bfceb1b681b4bb7253b47491be2d8b2014a1 (patch) | |
tree | f54eab21dd3d725d64a495fcd47c00d37abed004 /Fluid_Mechanics_ | |
parent | a78126bbe4443e9526a64df9d8245c4af8843044 (diff) | |
download | Python-Textbook-Companions-83c1bfceb1b681b4bb7253b47491be2d8b2014a1.tar.gz Python-Textbook-Companions-83c1bfceb1b681b4bb7253b47491be2d8b2014a1.tar.bz2 Python-Textbook-Companions-83c1bfceb1b681b4bb7253b47491be2d8b2014a1.zip |
removing problem statements
Diffstat (limited to 'Fluid_Mechanics_')
-rw-r--r-- | Fluid_Mechanics_/Chapter1.ipynb | 49 | ||||
-rw-r--r-- | Fluid_Mechanics_/Chapter10.ipynb | 24 | ||||
-rw-r--r-- | Fluid_Mechanics_/Chapter11.ipynb | 16 | ||||
-rw-r--r-- | Fluid_Mechanics_/Chapter12.ipynb | 18 | ||||
-rw-r--r-- | Fluid_Mechanics_/Chapter2.ipynb | 56 | ||||
-rw-r--r-- | Fluid_Mechanics_/Chapter3.ipynb | 33 | ||||
-rw-r--r-- | Fluid_Mechanics_/Chapter4.ipynb | 28 | ||||
-rw-r--r-- | Fluid_Mechanics_/Chapter5.ipynb | 31 | ||||
-rw-r--r-- | Fluid_Mechanics_/Chapter6.ipynb | 8 | ||||
-rw-r--r-- | Fluid_Mechanics_/Chapter7.ipynb | 25 | ||||
-rw-r--r-- | Fluid_Mechanics_/Chapter8.ipynb | 33 | ||||
-rw-r--r-- | Fluid_Mechanics_/Chapter9.ipynb | 50 |
12 files changed, 0 insertions, 371 deletions
diff --git a/Fluid_Mechanics_/Chapter1.ipynb b/Fluid_Mechanics_/Chapter1.ipynb index e770487c..2869f384 100644 --- a/Fluid_Mechanics_/Chapter1.ipynb +++ b/Fluid_Mechanics_/Chapter1.ipynb @@ -28,9 +28,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Density of air\n", "\n", - "#Given \n", "\n", "Mw = 29.0 # Molecular weight of air\n", "\n", @@ -40,7 +38,6 @@ "\n", "p = 50*144*47.88 # Pressure in N/m**2\n", "\n", - "# Solution\n", "\n", "rho = p/(R*T) # from the state law\n", "\n", @@ -71,9 +68,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Reduction in volume\n", "\n", - "# Given\n", "\n", "dP = 10**6 # Pressure drop in N/m**2\n", "\n", @@ -81,7 +76,6 @@ "\n", "bta = 2.2*10**9 # Bulk modulus of elasticity in N/m**2\n", "\n", - "# Solution\n", "\n", "dV = -dP*V/bta # Change in volume in m**3\n", "\n", @@ -114,9 +108,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Volume reduction\n", "\n", - "# Given\n", "\n", "bta1 = 2.28*10**9 # Bulk modulus of elasticity at 20 deg C and 103.4 N/m**2\n", "\n", @@ -126,7 +118,6 @@ "\n", "p2 = 1034 # Pressure in N/m**2\n", "\n", - "# Solution \n", "\n", "bavg = (bta1+bta2)/2 # bulk modulus average in N/m**2\n", "\n", @@ -168,9 +159,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Volume reduction \n", "\n", - "# Given\n", "\n", "patm = 14.6 # Atmospheric pressure in psia\n", "\n", @@ -179,7 +168,6 @@ "p2 = 102 # gauge pressure at point 2 in psia\n", "\n", "V = 1 # volume in m**3\n", - "# solution\n", "\n", "p = p1+patm # absolute pressure in psia\n", "\n", @@ -224,11 +212,9 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Sonic velocity of air\n", "\n", "from math import *\n", "\n", - "# Given\n", "\n", "k = 1.4 # gas constant\n", "\n", @@ -236,7 +222,6 @@ "\n", "T = 68+460 # temperature in *oR\n", "\n", - "# solution\n", "\n", "c = sqrt(k*R*T)\n", "\n", @@ -267,11 +252,9 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Force required to move the piston\n", "\n", "from math import *\n", "\n", - "# Given\n", "\n", "d = 0.05 # diameter of cylinder 1 in m\n", "\n", @@ -287,7 +270,6 @@ "\n", "A = pi*l*d # area in m**2\n", "\n", - "# Solution \n", "\n", "tau = mu*U/Y # Shear stress in N/m**2\n", "\n", @@ -320,27 +302,19 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Distance between the walls; Shear Stress; Location of maximum velocity\n", "\n", "from math import *\n", "\n", "from sympy import *\n", "\n", - "# Given\n", "\n", "mu = 1.005*10**-3 # Viscosity of water in Ns/m**2\n", "\n", - "# Solution \n", "\n", - "# Part a\n", "\n", - "# Velocity is given by the formula u = 10*(0.01*y-y**2)\n", "\n", - "# two boundary conditions must be satisfied\n", "\n", - "# at y=0;u=0 at the bottom of the plate\n", "\n", - "# at y=Y ; u = 0 at top of the plate\n", "\n", "Y = 0.01 # Distance between the walls\n", "\n", @@ -348,11 +322,8 @@ "\n", "print \" (a) Distance between the walls = \",round(Y1,1),\"cm\"\n", "\n", - "# Part b\n", "\n", - "# tau = mu*du/dy # Newtons law of viscosity\n", "\n", - "# differentiate u wrt y\n", "\n", "y = Symbol('y')\n", "\n", @@ -364,8 +335,6 @@ "\n", "U = uprime\n", "\n", - "#print U\n", - "# for y =0 at the bottom plate we get \n", "\n", "U1 = 0.01 # from U\n", "\n", @@ -373,19 +342,14 @@ "\n", "print \" (b) Shear stress = \",round(tau,9),\"N/m**2\"\n", "\n", - "# Part c\n", "\n", - "# Shaer stress at 20um from the wall\n", "\n", "tau1 = mu*10*(0.01-2*20*10**-6) # using the equation of U and y = 20*10**-6 calc shear stress in N/m**2\n", "\n", "print \" (c) Shear Stress at 20 um from the plate = \",round(tau1,9),\"N/m**2\"\n", "\n", - "# Part D\n", "\n", - "# Distance at which shaer stress is zero can be found from the location of maximum velocity \n", "\n", - "# equating uprime = 0\n", "\n", "y1 = 0.01/2 # shear stress location\n", "\n", @@ -423,9 +387,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Shaft torque for linear and non linear distribution of velocity \n", "from math import *\n", - "# Given\n", "\n", "d = 0.1 # diameter of shaft in m\n", "\n", @@ -443,9 +405,7 @@ "\n", "mu = 0.44 # Viscosity of SAE-30 oil in Ns/m**2\n", "\n", - "# Solution\n", "\n", - "# part a\n", "\n", "F = 2*pi*r1*l*mu*U/t\n", "\n", @@ -453,7 +413,6 @@ "\n", "print \" (a) For linear distribution of velocity , shaft torque = \",round(T,2),\"m.N\"\n", "\n", - "# part b\n", "\n", "F1 = 2*pi*l*mu*U/log(r2/r1)\n", "\n", @@ -488,9 +447,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Watts of energy lost to overcome friction\n", "from math import *\n", - "# Given\n", "\n", "mu = 0.44 # viscosity of the oil in Ns/m**2\n", "\n", @@ -533,15 +490,12 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Excessive pressure inside droplet\n", "\n", - "# Given\n", "\n", "d = 0.01 # diameter in m\n", "\n", "sigma = 0.073 # surface tension in N/m\n", "\n", - "# Solution \n", "\n", "dP = 4*sigma/d # pressure excessive\n", "\n", @@ -572,9 +526,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Height to which alcohol will rise\n", "\n", - "# Given\n", "\n", "sigma = 0.022 # surface tension in N/m\n", "\n", @@ -584,7 +536,6 @@ "\n", "d = 0.002 # diameter in m\n", "\n", - "# Solution \n", "\n", "\n", "h =4*sigma*1000/(gma*S*d) # capillary height in m\n", diff --git a/Fluid_Mechanics_/Chapter10.ipynb b/Fluid_Mechanics_/Chapter10.ipynb index fc9fd648..679a7dd2 100644 --- a/Fluid_Mechanics_/Chapter10.ipynb +++ b/Fluid_Mechanics_/Chapter10.ipynb @@ -29,13 +29,11 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Top width, area of lfow, hydraulic radius\n", "\n", "from math import *\n", "\n", "from __future__ import division\n", "\n", - "# Given\n", "\n", "b = 3 # base of the channel\n", "\n", @@ -43,7 +41,6 @@ "\n", "y = 2 # depth of the channel\n", "\n", - "# Solution\n", "\n", "T = b + 2*z*y\n", "\n", @@ -99,13 +96,11 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Discharge for the trapezoidal channel\n", "\n", "from math import *\n", "\n", "from __future__ import division\n", "\n", - "# Given\n", "\n", "z = 1.0 # slide slope\n", "\n", @@ -117,7 +112,6 @@ "\n", "n = 0.012 # for concrete\n", "\n", - "# Solution\n", "\n", "A = (b+z*y)*y\n", "\n", @@ -125,7 +119,6 @@ "\n", "R = A/P\n", "\n", - "# from mannings eqquation\n", "\n", "Q = A*(1/n)*(R**(2/3)*S**(1/2))\n", "\n", @@ -156,19 +149,16 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Determine cross sectional area\n", "\n", "from __future__ import division\n", "\n", "from math import *\n", "\n", - "# Given\n", "\n", "z = 1\n", "\n", "Q = 10000/60 # discharge of water in ft**#/s\n", "\n", - "# Solution\n", "\n", "y = (Q/(1.828*2.25*sqrt(0.5)))**(2/5)\n", "\n", @@ -204,13 +194,11 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Calculate criticcal depth\n", "\n", "from math import *\n", "\n", "from __future__ import division\n", "\n", - "# Given\n", "\n", "y = 2.5 # depth\n", "\n", @@ -218,7 +206,6 @@ "\n", "g = 9.81 # acceleration due to gravity in m/s**2\n", "\n", - "# Solution\n", "\n", "Yc = (20**2/g)**(1/3)\n", "\n", @@ -249,13 +236,11 @@ "cell_type": "code", "collapsed": false, "input": [ - "# determine normal depth, flow regine, critical depth\n", "\n", "from math import *\n", "\n", "from __future__ import division\n", "\n", - "# Given\n", "\n", "Q = 15 # flow rate in m**3/s\n", "\n", @@ -267,9 +252,7 @@ "\n", "z = 0.5 # slope\n", "\n", - "# Solution\n", "\n", - "# We use a trial and error method here to find the value of y i.e. normal depth\n", "\n", "y = 2.22 # we take the value of y as 2.2 m\n", "\n", @@ -289,7 +272,6 @@ "\n", "print \"b )F = \",round(F,2),\" Since the Froude number is less than 1, the flow is subcritical\"\n", "\n", - "# we use trail and error to find the value of yc for critical depth\n", "\n", "yc = 1.08\n", "\n", @@ -325,13 +307,11 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Height, type and length of jump and loss of energy\n", "\n", "from math import *\n", "\n", "from __future__ import division\n", "\n", - "# Given\n", "\n", "b = 60 # base width in ft\n", "\n", @@ -341,7 +321,6 @@ "\n", "g = 32.2\n", "\n", - "# Solution\n", "\n", "V1 = Q/(b*y1)\n", "\n", @@ -394,13 +373,11 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Determine flow rate\n", "\n", "from math import *\n", "\n", "from __future__ import division\n", "\n", - "# Given\n", "\n", "d = 6 # depth of the channel\n", "\n", @@ -412,7 +389,6 @@ "\n", "g = 32.2\n", "\n", - "# Solution\n", "\n", "y2 = y1 - h - 0.75\n", "\n", diff --git a/Fluid_Mechanics_/Chapter11.ipynb b/Fluid_Mechanics_/Chapter11.ipynb index 93e3588f..618f66c5 100644 --- a/Fluid_Mechanics_/Chapter11.ipynb +++ b/Fluid_Mechanics_/Chapter11.ipynb @@ -28,13 +28,11 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Example 11.1\n", "\n", "from math import *\n", "\n", "from __future__ import division\n", "\n", - "# Given\n", "\n", "T1 = 273 + 15 # temperature in K\n", "\n", @@ -42,7 +40,6 @@ "\n", "Cp = 0.24 # cp for air in kcal/kgK\n", "\n", - "# Solution\n", "\n", "dh = Cp*(T2-T1) # enthalpy per kg of air\n", "\n", @@ -75,13 +72,11 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Example 11.2\n", "\n", "from math import *\n", "\n", "from __future__ import division\n", "\n", - "# Given\n", "\n", "T1 = 273 + 15 # temperature in K\n", "\n", @@ -95,7 +90,6 @@ "\n", "k = 1.4 # gas constant\n", "\n", - "# solution\n", "\n", "dS = Cv*log((T2/T1)**k*(P2/P1)**(1-k))\n", "\n", @@ -128,7 +122,6 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Example 11.3\n", "\n", "from math import *\n", "\n", @@ -183,15 +176,12 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Example 11.4\n", "\n", "from math import *\n", "\n", "from __future__ import division\n", "\n", - "# Given\n", "\n", - "# for water\n", "\n", "S =1 # specific gravity\n", "\n", @@ -199,7 +189,6 @@ "\n", "bta = 2.2*10**9 # Bulk modulus of elasticity\n", "\n", - "# ethly alcohol\n", "\n", "S1 =0.79 # specific gravity\n", "\n", @@ -207,7 +196,6 @@ "\n", "bta2 = 1.21*10**9 # Bulk modulus of elasticity\n", "\n", - "# for air\n", "\n", "k = 1.4 # gas constant for air\n", "\n", @@ -215,7 +203,6 @@ "\n", "T = 273+20 # temperature in K\n", "\n", - "# Solution\n", "\n", "C1 = sqrt(bta/rho)\n", "\n", @@ -257,13 +244,11 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Example 11.5\n", "\n", "from math import *\n", "\n", "from __future__ import division\n", "\n", - "# Given\n", "\n", "P1 = 1.5 # pressure in psia\n", "\n", @@ -275,7 +260,6 @@ "\n", "V1 = 1500 # velocity in ft/s\n", "\n", - "# Solution\n", "\n", "c1 = sqrt(k*R*T1)\n", "\n", diff --git a/Fluid_Mechanics_/Chapter12.ipynb b/Fluid_Mechanics_/Chapter12.ipynb index 06c84068..29dbb6ff 100644 --- a/Fluid_Mechanics_/Chapter12.ipynb +++ b/Fluid_Mechanics_/Chapter12.ipynb @@ -28,13 +28,11 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Example 12.1\n", "\n", "from math import *\n", "\n", "from __future__ import division\n", "\n", - "# Given\n", "\n", "Q = 0.25 # discharge from the pump in m**3/s\n", "\n", @@ -48,7 +46,6 @@ "\n", "w = 2*pi*N/60 # angular velocity\n", "\n", - "# Solution\n", "\n", "Eff = gma*Q*H*100/(T*w) # efficiency\n", "\n", @@ -79,13 +76,11 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Example 12.2\n", "\n", "from math import *\n", "\n", "from __future__ import division\n", "\n", - "# Given\n", "\n", "d = 0.4 # diameter of the pump in m\n", "\n", @@ -99,7 +94,6 @@ "\n", "g = 9.81 # acceleration due to gravity in m/s**2\n", "\n", - "# Solution\n", "\n", "w = 2*pi*N/60 # anggular velocity in rad/s\n", "\n", @@ -168,21 +162,17 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Example 12.3\n", "\n", "from math import *\n", "\n", "from __future__ import division\n", "\n", - "# Given\n", "\n", "d = 0.36 # diameter of the impeller of pump\n", "\n", "N = 1500 # Speed of impeller in RPM\n", "\n", - "# Solution\n", "\n", - "# For best efficiency\n", "\n", "Q1 = 82 # discharge in l/s\n", "\n", @@ -194,7 +184,6 @@ "\n", "H2 = 20 # head in m\n", "\n", - "# Solving the simulataneous equation we get\n", "\n", "D2 = 38.45\n", "\n", @@ -230,13 +219,11 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Example 12.4\n", "\n", "from math import *\n", "\n", "from __future__ import division\n", "\n", - "# Given\n", "\n", "q = 500 # discharge in cgm\n", "\n", @@ -252,9 +239,7 @@ "\n", "N = 1800 # speed in RPM\n", "\n", - "# Solution\n", "\n", - "# for water at 65 deg C\n", "\n", "nu = 1.134*10**-5 # viscosity in ft**2/s\n", "\n", @@ -304,13 +289,11 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Example 12.5 \n", "\n", "from math import *\n", "\n", "from __future__ import division\n", "\n", - "# Given\n", "\n", "H = 60 # height in m\n", "\n", @@ -324,7 +307,6 @@ "\n", "w = 9810 # specific weight\n", "\n", - "# Solution\n", "\n", "Npsh_m = sigma*60 # minimum NPSH\n", "\n", diff --git a/Fluid_Mechanics_/Chapter2.ipynb b/Fluid_Mechanics_/Chapter2.ipynb index 24cd4f37..ffb67770 100644 --- a/Fluid_Mechanics_/Chapter2.ipynb +++ b/Fluid_Mechanics_/Chapter2.ipynb @@ -28,11 +28,9 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Force applied on the piston\n", "\n", "from math import *\n", "\n", - "# Given \n", "\n", "d = 10 # diameter of hydraulic press in meters\n", "\n", @@ -44,7 +42,6 @@ "\n", "Ar = math.pi*d**2/4 # Area of rram in m**2\n", "\n", - "# Solution \n", "\n", "p = W/Ar # pressure to be supplied by the oil in N/cm**2\n", "\n", @@ -78,15 +75,12 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Pressure in kN/m**2\n", "\n", - "# Given\n", "\n", "h = 1 # ocean depth below the surface in km\n", "\n", "gma = 10070 # Specific weight of sea water\n", "\n", - "# Solution\n", "\n", "P =gma*h # Pressure in kN/m**2\n", "\n", @@ -117,9 +111,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Pressure at the bottom of the tank\n", "\n", - "# Given\n", "\n", "p1 = 150*10**3 # Pressure at point 1 in kN/m**2\n", "\n", @@ -131,7 +123,6 @@ "\n", "h1 = 2.0 # height of oil 3 in tank\n", "\n", - "# Solution \n", "\n", "p2 = (p1 + Sg*h*g)\n", "\n", @@ -164,9 +155,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Height of the mountain\n", "\n", - "# Given\n", "from math import *\n", "\n", "from __future__ import division\n", @@ -185,7 +174,6 @@ "\n", "r = p/Po\n", "\n", - "# Solution\n", "\n", "y = -(R*T/(g*0.19))*(1 - (r)**((n-1)/n))\n", "\n", @@ -216,9 +204,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Pressure in the pipe\n", "\n", - "# Given\n", "\n", "h1 = 500 # height in mm\n", "\n", @@ -230,7 +216,6 @@ "\n", "w = 9810 # specific weight of water\n", "\n", - "# Solution\n", "\n", "ha = ((h2*S2)-(h1*S1))/1000\n", "\n", @@ -264,9 +249,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Force required to open the gate\n", "\n", - "# Given\n", "\n", "from __future__ import division\n", "\n", @@ -284,21 +267,16 @@ "\n", "y1= 5+0.5\n", "\n", - "# Solution\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", - "# depth of the COP\n", "\n", "h1 = y1 + (Ig*math.sin(theta)*math.sin(theta)/(A*y1))\n", "\n", - "# moment about hinge A\n", "\n", "F1 = (F*(h1 - 5))/d\n", "\n", "print \"Magnitude of the force required to open the gate = \",round(F1,0),\"N\" \n", - "#The area calculated in the book is 0.785 and that calculated from code is 0.78. \n", - "#This difference of 0.005 is causing the answer to change from the original\n" ], "language": "python", "metadata": {}, @@ -325,11 +303,9 @@ "cell_type": "code", "collapsed": false, "input": [ - "# total force ; position of the center of pressure \n", "\n", "from math import *\n", "\n", - "# Given\n", "\n", "l =2 # length of the plate in m\n", "\n", @@ -341,7 +317,6 @@ "\n", "w = 9810 # specific weight of water\n", "\n", - "# Solution\n", "\n", "A = 1*2\n", "\n", @@ -383,11 +358,9 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Hydrostatic force and point of location \n", "\n", "from math import *\n", "\n", - "# Given\n", "\n", "d = 6 # diameter of the gate in ft\n", "\n", @@ -401,7 +374,6 @@ "\n", "F1 = p1*A\n", "\n", - "# Solution\n", "\n", "Tf = F+F1\n", "\n", @@ -415,7 +387,6 @@ "\n", "print \"point of location on the center plate = \",round(H,2),\"ft\"\n", "\n", - "# method 2\n", "\n", "Hf = p1/62.4 # equivalent fluid height\n", "\n", @@ -456,11 +427,9 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Horizontal and Vertical components\n", "\n", "import math\n", "\n", - "# Given\n", "\n", "R = 4 # radius of the gate in ft\n", "\n", @@ -474,7 +443,6 @@ "\n", "xv2 = 1.7 # distance in ft\n", "\n", - "# Solution \n", "\n", "Fh = R*y1*gma\n", "\n", @@ -523,13 +491,11 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Vertical and Horizontal components\n", "\n", "from math import *\n", "\n", "from __future__ import division\n", "\n", - "# Given\n", "\n", "p = 50 # pressure in psia\n", "\n", @@ -549,7 +515,6 @@ "\n", "xv2 = 1.7 # center of pressure2 for x direction force\n", "\n", - "# Solution\n", "\n", "Fh = gma*A*y1 # hiorizontal force\n", "\n", @@ -600,13 +565,11 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Depth to which water would rise\n", "\n", "from math import *\n", "\n", "from __future__ import division\n", "\n", - "# Given\n", "\n", "l = 3 # length in m\n", "\n", @@ -628,7 +591,6 @@ "\n", "gma = 9810 # specific density \n", "\n", - "# Solution\n", "\n", "Fb = Tw # since barge is floating\n", "\n", @@ -664,7 +626,6 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Level at which cylinder will float\n", "\n", "from math import *\n", "\n", @@ -672,11 +633,9 @@ "\n", "import numpy as np\n", "\n", - "# Given\n", "\n", "W = 0.4 * 9.81 # weight of the solid cylinder in N\n", "\n", - "# Solution\n", "\n", "A = np.array([(1,-0.96),(1,1)])\n", "\n", @@ -723,11 +682,9 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Weight of the pan and the magnitude of righting moment\n", "\n", "from math import *\n", "\n", - "# Given\n", "\n", "l =100 # length of the pan in cm\n", "\n", @@ -739,7 +696,6 @@ "\n", "gma = 9810 # sepcific weight\n", "\n", - "# Solution\n", "\n", "Fb = gma*(d*w*l/(2*l**3)) # weight on the pan\n", "\n", @@ -753,7 +709,6 @@ "\n", "x = ((X2-X1)*cos(theta*pi/180))\n", "\n", - "# momentum equation \n", "\n", "M = W*x\n", "\n", @@ -786,15 +741,12 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Metacentric height and rightning moment \n", "\n", "from math import *\n", "\n", "from __future__ import division\n", "\n", - "# Continued from example 2.15\n", "\n", - "# Given\n", "\n", "Io = 15*4**3/12 # moment of inertia in m**4\n", "\n", @@ -803,7 +755,6 @@ "Gb = ((3/2)-(2.71/2)) \n", "\n", "W = 1739.2 # weight of the barge from the previous example in kN\n", - "# Solution\n", "\n", "Mg = (Io/V)-Gb # metacentric height in m\n", "\n", @@ -840,13 +791,11 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Maximum pressure in the tank\n", "\n", "from math import *\n", "\n", "from __future__ import division\n", "\n", - "# Given\n", "\n", "l=6 # length of the tank\n", "\n", @@ -864,7 +813,6 @@ "\n", "po=0 # pressure at the origin\n", "\n", - "# Solution\n", "\n", "A = np.array([(1,-1),(1,1)])\n", "\n", @@ -876,7 +824,6 @@ "\n", "Y2 = x[1]\n", "\n", - "# AMximum pressure at the bottom of the tank\n", "\n", "P = po - W*(2.61*X/9.81) - W*(1+(1.5/9.81))*(-Y2)\n", "\n", @@ -907,13 +854,11 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Height of the paraboloid revolution; maxm=imum pressure and location ; pressure at the point 0.2 from the center\n", "\n", "from math import *\n", "\n", "from __future__ import division\n", "\n", - "# Given\n", "\n", "d = 1 # diamter of the jar in ft\n", "\n", @@ -925,7 +870,6 @@ "\n", "g = 32.2 # acceleration due to gravity in ft/s**2\n", "\n", - "# Solution\n", "\n", "w = 2*pi*N/60\n", "\n", diff --git a/Fluid_Mechanics_/Chapter3.ipynb b/Fluid_Mechanics_/Chapter3.ipynb index e702596e..845caa9a 100644 --- a/Fluid_Mechanics_/Chapter3.ipynb +++ b/Fluid_Mechanics_/Chapter3.ipynb @@ -28,19 +28,15 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Dimension of flow field ; velocity components at (1,2) ; magnitude and direction of velocity \n", "\n", "from math import *\n", "\n", - "# Given\n", "\n", - "# V = 4*Xi-4Yj\n", "\n", "x=1 # x co-ordinate\n", "\n", "y=2 # y co-ordinate\n", "\n", - "# Solution\n", "\n", "print \"(a) u = 4*X; v = -4*Y \"\n", "\n", @@ -83,13 +79,11 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Discharge and mass flow rate\n", "\n", "from math import *\n", "\n", "from __future__ import division\n", "\n", - "# Given\n", "\n", "d = 0.3 # diameter of pipe in m\n", "\n", @@ -99,7 +93,6 @@ "\n", "A = pi*d**2/4\n", "\n", - "# Solution\n", "\n", "Q=A*v\n", "\n", @@ -135,7 +128,6 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Mean Velocity\n", "\n", "from math import *\n", "\n", @@ -143,7 +135,6 @@ "\n", "from scipy import integrate\n", "\n", - "# Given\n", "\n", "Vo = 10 # velocity in m/s\n", "\n", @@ -153,7 +144,6 @@ "\n", "N = 1\n", "\n", - "# Solution\n", "\n", "R = lambda r: (10*r-1000*r**3)\n", "\n", @@ -192,7 +182,6 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Sketch the stream lines in the first quadrant\n", "\n", "import matplotlib.pyplot as plt\n", "\n", @@ -204,22 +193,17 @@ "\n", "from sympy import *\n", "\n", - "#init_printing(use_unicode=False, warp_line=False, no_global=True)\n", "\n", - "# Given\n", "\n", - "# V = 4*y(m)i+2(m)j\n", "\n", "x = Symbol('x')\n", "U = integrate(2,x)\n", "\n", - "#print u\n", "\n", "y = Symbol('y')\n", "\n", "V = integrate(-4*y,y)\n", "\n", - "#print V\n", "\n", "Zhi = U + V\n", "\n", @@ -276,7 +260,6 @@ "cell_type": "code", "collapsed": false, "input": [ - "# magnitude and direction of flow field\n", "\n", "from math import *\n", "\n", @@ -284,13 +267,11 @@ "\n", "import numpy as np\n", "\n", - "# Given\n", "\n", "x = 2 # X co-ordinate\n", "\n", "Y = 4 # Y co-ordiante\n", "\n", - "# Solution\n", "y = Symbol('y')\n", "\n", "zhi = 4*x*y\n", @@ -348,7 +329,6 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Determine velocity ; convective accleration\n", "\n", "from math import *\n", "\n", @@ -360,7 +340,6 @@ "\n", "from scipy import integrate\n", "\n", - "# Given\n", "\n", "d1 = 0.09 # diameter in cm\n", "\n", @@ -370,7 +349,6 @@ "\n", "mdot = 25 # mass flow rate in kg/s\n", "\n", - "# Solution\n", "\n", "x = Symbol('x')\n", "\n", @@ -392,7 +370,6 @@ "\n", "V1 = vprime\n", "\n", - "# at x = 0.1 m we get dv/dx = 0..09\n", "\n", "VPrime = 0.09\n", "\n", @@ -426,15 +403,11 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Is the flow irrotational\n", "\n", "from math import *\n", "\n", - "# Given\n", "\n", - "# w = (16y-12x)i +(12y-9x)j\n", "\n", - "# Solution\n", "\n", "y = Symbol('y')\n", "\n", @@ -453,10 +426,7 @@ "\n", "v = zhiprime1\n", "\n", - "#Vx = -9 # differentiate V wrt x\n", "\n", - "#Vx = -9 # differentiate V wrt x\n", - "#Uy = 16 # differentiate U wrt y\n", "\n", "z = v-u\n", "\n", @@ -490,11 +460,9 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Velocity in larger section\n", "\n", "from math import *\n", "\n", - "# Given\n", "\n", "d1 = 0.1 # diameter in m\n", "\n", @@ -502,7 +470,6 @@ "\n", "V1 = 30 # velocity in m/s\n", "\n", - "# Solution\n", "\n", "V2 = (d1**2/d2**2)*V1\n", "\n", diff --git a/Fluid_Mechanics_/Chapter4.ipynb b/Fluid_Mechanics_/Chapter4.ipynb index 20d6f3d5..ea310eb2 100644 --- a/Fluid_Mechanics_/Chapter4.ipynb +++ b/Fluid_Mechanics_/Chapter4.ipynb @@ -28,13 +28,11 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Difference in pressure at top and bottom\n", "\n", "from math import *\n", "\n", "from __future__ import division\n", "\n", - "# Given\n", "\n", "d1 = 0.1 # diameter in m\n", "\n", @@ -52,7 +50,6 @@ "\n", "g = 9.81\n", "\n", - "# Solution\n", "\n", "V1 = Q/A1 # velocity at section 1\n", "\n", @@ -87,13 +84,11 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Actual discharge\n", "\n", "from math import *\n", "\n", "from __future__ import division\n", "\n", - "# Given\n", "\n", "d = 2.5 # diameter in cm\n", "\n", @@ -105,7 +100,6 @@ "\n", "g = 9.81 # acceleration due to gravity in m/s**2 \n", "\n", - "# Solution\n", "\n", "Q = Cd*A*sqrt(2*g*h)/100\n", "\n", @@ -137,7 +131,6 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Discharge through the orifice\n", "\n", "from __future__ import division\n", "\n", @@ -147,7 +140,6 @@ "\n", "import numpy as np\n", "\n", - "# Given\n", "\n", "H1 = 3 # height in m\n", "\n", @@ -159,7 +151,6 @@ "\n", "g = 9.81 # acceleration due to grvity in m/s**2\n", "\n", - "# Solution\n", "\n", "q = lambda h: h**(1/2)\n", " \n", @@ -194,7 +185,6 @@ "cell_type": "code", "collapsed": false, "input": [ - "# discharge through orifice\n", " \n", "from math import *\n", "\n", @@ -204,7 +194,6 @@ "\n", "import numpy as np\n", "\n", - "# Given\n", "\n", "b = 1 # bredth of the tank\n", "\n", @@ -222,7 +211,6 @@ "\n", "A = 1*0.3 # area of submerged section in m**2\n", "\n", - "# Solution\n", "\n", "q = lambda h: h**(1/2)\n", " \n", @@ -261,13 +249,11 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Determine flow rate of water\n", "\n", "from math import *\n", "\n", "from __future__ import division\n", "\n", - "# Given\n", "\n", "d1 = 2 # radius of pipe\n", "\n", @@ -283,7 +269,6 @@ "\n", "Cd = 0.95\n", "\n", - "# Solution\n", "\n", "V2 = sqrt(21582/0.9375)\n", "\n", @@ -318,13 +303,11 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Velocity of stream point at the point of insertion\n", "\n", "from math import *\n", "\n", "from __future__ import division\n", "\n", - "# Given\n", "\n", "dx = 0.5 # in ft\n", "\n", @@ -332,7 +315,6 @@ "\n", "g = 32.2 # acceleration due to gravity in ft/s**2\n", "\n", - "# solution\n", "\n", "V = sqrt(2*g*dx)\n", "\n", @@ -363,7 +345,6 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Discharge throught the system\n", "\n", "from math import *\n", "\n", @@ -379,7 +360,6 @@ "\n", "d = 15 # diameter of the nozzle in cm\n", "\n", - "# Solution\n", "\n", "V2 = sqrt(2*g*z1/4.25)\n", "\n", @@ -414,14 +394,12 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Power input to the pump\n", "\n", "from math import *\n", "\n", "from __future__ import division\n", "\n", "\n", - "# Given\n", "\n", "Eff = 0.8 # pump efficiency\n", "\n", @@ -443,7 +421,6 @@ "\n", "z1 = 30 # height in m\n", "\n", - "# Solution\n", "\n", "V1=(2/6)**2*V2\n", "\n", @@ -482,11 +459,9 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Pressure head at A and B\n", "\n", "from math import *\n", "\n", - "# Given\n", "\n", "Q = 0.2 # discharge in m**3/s\n", "\n", @@ -504,13 +479,11 @@ "\n", "g =9.81 # acceleration due to gravity in m/s**2\n", "\n", - "# Solution\n", "\n", "V=Q/A # Velocity of in m/s\n", "\n", "Hl1 = (0.02*100*V**2/(0.25*2*9.81))\n", "\n", - "# pressure head at A\n", "\n", "Pa =(z1-za-(V**2/(2*g))-Hl1)\n", "\n", @@ -518,7 +491,6 @@ "\n", "print \"Elevation at height A =\",round(El,2),\"m\"\n", "\n", - "# pressure head at B\n", "\n", "hs = z3 - z1 + (0.02*(500/0.25)*(V**2/(2*g))) \n", "\n", diff --git a/Fluid_Mechanics_/Chapter5.ipynb b/Fluid_Mechanics_/Chapter5.ipynb index 92a56ea7..73c391ca 100644 --- a/Fluid_Mechanics_/Chapter5.ipynb +++ b/Fluid_Mechanics_/Chapter5.ipynb @@ -28,11 +28,9 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Resultant force on the elbow\n", "\n", "from math import *\n", "\n", - "# Given\n", "\n", "Q = 0.3 # Water flow rate in m**3/s\n", "\n", @@ -60,13 +58,10 @@ "\n", "theta = 45*pi/180 # angle in deg\n", "\n", - "# Soultion\n", "\n", - "# Applying the X momentum equation we get\n", "\n", "Rx = F1 - F2*cos(theta)-rho*Q*(V2*cos(theta)-V1)\n", "\n", - "# Applying the Y momentum equation\n", "\n", "Ry = F2*sin(theta)+rho*Q*(V2*sin(theta)-0)\n", "\n", @@ -104,11 +99,9 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Force exerted by the jet on the vane\n", "\n", "from math import *\n", "\n", - "# Given\n", "\n", "V1 = 80 # Velocity in ft/s\n", "\n", @@ -120,21 +113,16 @@ "\n", "a = pi/3 # angle of pipe bend\n", "\n", - "# Solution\n", "\n", "Q = A1*V1 # Total discharge in m**3\n", "\n", - "# Applying bernoullis at point 1 and 2\n", "\n", "V2 = sqrt((2*g*V1**2/(2*32.2))-3*2*g)\n", "\n", - "# Pressure at the end of the section are atmospheric and hence 0\n", "\n", - "# momentum equation in X direction\n", "\n", "Rx = -(rho*Q*(V2*cos(a)-80))\n", "\n", - "# momentum equation in Y direction\n", "\n", "Ry = (rho*Q*(V2*sin(a)-0))\n", "\n", @@ -172,9 +160,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Force needed to hold the Y position \n", "\n", - "# Given\n", "\n", "from __future__ import division\n", "\n", @@ -206,7 +192,6 @@ "\n", "rho = 1000 # density in kg/m**3\n", "\n", - "# Solution\n", "\n", "V1 = Q1/A1\n", "\n", @@ -262,9 +247,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Normal force on the plate\n", "\n", - "# Given\n", "from math import *\n", "\n", "d = 2 # diameter in inches\n", @@ -279,7 +262,6 @@ "\n", "g = 32.2 # acceleration due to gravity in ft/s**2\n", "\n", - "# Solution\n", "\n", "Rx = (gma*Q*V)/g # horizontal force required to keep plate in position\n", "\n", @@ -310,9 +292,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Force on the plate ; work doen per second; efficiency\n", "\n", - "# Given\n", "\n", "from math import *\n", "\n", @@ -326,7 +306,6 @@ "\n", "g = 9.81 # acceleration due to gravity in m/s^2\n", "\n", - "# Solution\n", "\n", "Q =A*V # Discharge in m**3/s\n", "\n", @@ -373,9 +352,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Force exerted on the plate\n", "\n", - "# Given\n", "from math import *\n", "\n", "d = 3 # diameter in inches\n", @@ -386,7 +363,6 @@ "\n", "rho = 1.94 # density in lbs/ft**3\n", "\n", - "# Solution\n", "\n", "V = Q/A # velocity in ft/s\n", "\n", @@ -428,9 +404,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Angle of blade tips at inlet and exit ; work done on the vane; efficiency of the vane\n", "\n", - "# Given\n", "\n", "from math import *\n", "\n", @@ -444,7 +418,6 @@ "\n", "g = 9.81\n", "\n", - "# Solution\n", "\n", "V1x = V1*cos(alpha)\n", "\n", @@ -460,7 +433,6 @@ "\n", "Vr2 = Vr1\n", "\n", - "# from trial and error we get the blade tip angle at inlet and outlet\n", "\n", "print \"a ) Angle of blade top at inlet and Outlet, Phi = 4 deg\"\n", "\n", @@ -505,9 +477,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Thrust on the plane; propeller efficiency ; theoretical horsepower ; pressure difference acros the blades\n", "\n", - "# Given\n", "\n", "from math import *\n", "\n", @@ -519,7 +489,6 @@ "\n", "mf = 0.0022 # mass flow rate in slugs/ft**3\n", "\n", - "# Solution\n", "\n", "V1 = v*5280/3600 # velocity in ft/s\n", "\n", diff --git a/Fluid_Mechanics_/Chapter6.ipynb b/Fluid_Mechanics_/Chapter6.ipynb index c0425cb0..0eb8031a 100644 --- a/Fluid_Mechanics_/Chapter6.ipynb +++ b/Fluid_Mechanics_/Chapter6.ipynb @@ -28,13 +28,10 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Velocity of the flow\n", "\n", - "# Given\n", "\n", "L = 10 # length scale lp/l\n", "\n", - "# crue oil at 20 deg C\n", "\n", "rhop = 0.86*998.2 # density inn kg/m**3\n", "\n", @@ -42,13 +39,11 @@ "\n", "Vp = 2.5 # Velocity in m/s\n", "\n", - "# water at 20 deg C\n", "\n", "rhom = 998.2 # density in kg/m**3\n", "\n", "mum = 1.005*10**-3 # viscosity in Ns/m**2\n", "\n", - "# Solution\n", "\n", "Vm = Vp*L*(rhop/rhom)*(mum/mup) # velocity in m/s\n", "\n", @@ -79,9 +74,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Mximum head on the crest and corresponding discharge for dynamically similar conditions\n", "\n", - "# Given\n", "\n", "from __future__ import division\n", "\n", @@ -95,7 +88,6 @@ "\n", "L = (1/50) # length scale\n", "\n", - "# Solution\n", "\n", "Qm = 100000*(L)**(5/2) # model discharge in cfs\n", "\n", diff --git a/Fluid_Mechanics_/Chapter7.ipynb b/Fluid_Mechanics_/Chapter7.ipynb index e5a10ae6..baafd643 100644 --- a/Fluid_Mechanics_/Chapter7.ipynb +++ b/Fluid_Mechanics_/Chapter7.ipynb @@ -28,13 +28,11 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Is the flow laminar or turbulent\n", "\n", "from math import *\n", "\n", "from __future__ import division\n", "\n", - "# Given\n", "\n", "nu1 = 0.804*10**-6 # viscosity in m**2/s\n", "\n", @@ -42,11 +40,9 @@ "\n", "D = 0.02 # diameter in m/s\n", "\n", - "# for water \n", "\n", "rho = 995.7 # density in kg/m**3\n", "\n", - "# for gylcerine\n", "\n", "mu = 8620*10**-4 # viscosity in Ns/m**2\n", "\n", @@ -54,7 +50,6 @@ "\n", "nu2 = mu/(S*rho) # viscosity of glycerine in Ns/m**2\n", "\n", - "# Solution\n", "\n", "R1 = V*D/nu1\n", "\n", @@ -101,7 +96,6 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Eddy Viscosity; mixing length ; turbulence constant\n", "\n", "from math import *\n", "\n", @@ -123,9 +117,7 @@ "\n", "rho = 1000 # density in kg/m**3\n", "\n", - "#y = 0.3\n", "\n", - "# solution\n", "\n", "Up = diff(8.5+0.7*log(y),y)\n", "\n", @@ -174,7 +166,6 @@ "cell_type": "code", "collapsed": false, "input": [ - "# PLot boundary layer distribution and total drag on the plate\n", "\n", "from math import *\n", "\n", @@ -190,9 +181,7 @@ "\n", "import matplotlib.pyplot as plt\n", "\n", - "# Given\n", "\n", - "# for glycerine\n", "\n", "S = 1.26 # specific gravity \n", "\n", @@ -204,9 +193,7 @@ "\n", "V=1 # velocity in m/s\n", "\n", - "# Solution\n", "\n", - "# from blasius equation\n", "\n", "x = [0,0.1,0.5,1.0,2.0];\n", "\n", @@ -214,17 +201,12 @@ "\n", "tauo = K2*rho*V**2/(sqrt(1462)*np.sqrt(x))\n", "\n", - "#plt.figure()\n", "plt.plot(x, d, 'r')\n", "plt.xlabel('x(m)')\n", "plt.ylabel('delta(cm),tauo(N/m**2)')\n", - "#plt.title('delta v/s x')\n", - "#plt.legend('d')\n", "\n", "plt.plot(x, tauo, 'b')\n", "plt.xlabel('x')\n", - "#plt.ylabel('tauo(N/m**2)')\n", - "#plt.title('tauo v/s x(m)')\n", "plt.legend('d''t')\n", "plt.show()\n" ], @@ -245,7 +227,6 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Sketch the boundary layer and drag on the plate\n", "\n", "import numpy as np\n", "\n", @@ -257,7 +238,6 @@ "\n", "from numpy import sqrt\n", "\n", - "# Given\n", "\n", "rho = 1.197 # air density in kg/m**3\n", "\n", @@ -275,7 +255,6 @@ "\n", "l3 = 0.951 # length from 0 to 0.951\n", "\n", - "# Solution\n", "\n", "X = Rec/525576\n", "\n", @@ -332,7 +311,6 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Determine drag on the sphere\n", "\n", "from math import *\n", "\n", @@ -340,7 +318,6 @@ "\n", "from __future__ import division\n", "\n", - "# Given\n", "\n", "d = 0.01 # doameter of sphere in m\n", "\n", @@ -352,11 +329,9 @@ "\n", "rho = S*1000 # density\n", "\n", - "# Solution\n", "\n", "R = rho*v*d/mu\n", "\n", - "# for the above rho\n", "\n", "Cd = 35\n", "\n", diff --git a/Fluid_Mechanics_/Chapter8.ipynb b/Fluid_Mechanics_/Chapter8.ipynb index 51f3481e..6972a7f7 100644 --- a/Fluid_Mechanics_/Chapter8.ipynb +++ b/Fluid_Mechanics_/Chapter8.ipynb @@ -28,9 +28,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Determine maximum velocity and shear stress\n", "\n", - "# Given\n", "\n", "from math import *\n", "\n", @@ -46,7 +44,6 @@ "\n", "g = 9.81 # acceleration due to gravity in m/s**2\n", "\n", - "# properties of kerosene\n", "\n", "mu = 19.1*10**-4 # viscosity of kerosene at 20 deg C\n", "\n", @@ -54,17 +51,13 @@ "\n", "rho = 1000 # density in kg/m**3\n", "\n", - "# Solution\n", "\n", - "# calculating direction of flow\n", "\n", "p1 = (P1+g*z*S)*1000 # point 1\n", "\n", "p2 = (P2)*1000 # point 2\n", "\n", - "# direction of flow is from point 1-2\n", "\n", - "# shear stress\n", "\n", "Sp = -((p1-p2)/sqrt(L**2+z**2))\n", "\n", @@ -74,19 +67,16 @@ "\n", "print \"(a) Maximum shear stress =\",round(Tau_max,3),\"N/m**2\"\n", "\n", - "# maximum velocity\n", "\n", "Vmax = r**2*Sp/(4*mu)\n", "\n", "print \"(b) Maximum velocity =\",round(Vmax,3),\"m/s\"\n", "\n", - "# discharge\n", "\n", "Q = pi*r**4*Sp/(8*mu)\n", "\n", "print \"(c) Discharge = \",round(Q,7),\"m**3/s\"\n", "\n", - "# calculate reynolds number\n", "\n", "V = Vmax/2\n", "\n", @@ -122,9 +112,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Determine the head loss\n", "\n", - "# Given\n", "\n", "d = 0.02 # diameter of the pipe in m\n", "\n", @@ -134,11 +122,9 @@ "\n", "g = 9.81 # acceleration due to gravity in m/s**2\n", "\n", - "# for water at 5 deg C\n", "\n", "nu = 1.54*10**-6 # kinematic viscosity of water in m**2/s\n", "\n", - "# Solution\n", "\n", "R = v*d/nu\n", "\n", @@ -178,13 +164,10 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Horsepower required to pump 50 tons of oil\n", "\n", - "# Given\n", "\n", "from math import *\n", "\n", - "# oil properties\n", "\n", "S = 0.92 # specific gravity\n", "\n", @@ -198,7 +181,6 @@ "\n", "g = 32.2 # acceleration due to gravity in ft/s**2\n", "\n", - "# Solution\n", "\n", "Q = W*2000/(gma*3600) # discharge in ft**3/s\n", "\n", @@ -244,9 +226,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Viscosity of the liquid in poise\n", "\n", - "# Given\n", "\n", "from math import *\n", "\n", @@ -268,9 +248,7 @@ "\n", "a = pi*d1**2/4\n", "\n", - "# Solution\n", "\n", - "# From derivation we obtain a equation for T\n", "\n", "H2 = H1-(V/A)\n", "\n", @@ -303,13 +281,10 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Velocity distribution; Discharge ; shear on the upper plate\n", "\n", - "# Given\n", "\n", "from math import *\n", "\n", - "# properties of kerosene oil at 20 deg C\n", "\n", "S = 0.81 # specific gravity of oil\n", "\n", @@ -327,35 +302,27 @@ "\n", "theta = pi/6 # angle of inclination\n", "\n", - "# Solution\n", "\n", - "# point 1\n", "\n", "P1 = p1*144 + gma*l*sin(theta)\n", "\n", - "# point 2\n", "\n", "P2 = p2*144\n", "\n", - "# flow is taking from poont 2-1\n", "\n", "Sp = (P2-P1)/4\n", "\n", - "# equation for u = 2154.75*y-359125*y**2\n", "\n", "y = h\n", "\n", - "# discharge per ft width\n", "\n", "q = (2154.75*y**2/2) - (359125*y**3/3)\n", "\n", "print \"Discharge q = \",round(q,3),\"per unit ft of the plate\"\n", "\n", - "# to find shear at the top of the plate take du/dy = 0\n", "\n", "dV = 2154.75 - 718250*h\n", "\n", - "# shear stress\n", "\n", "T = -mu*dV\n", "\n", diff --git a/Fluid_Mechanics_/Chapter9.ipynb b/Fluid_Mechanics_/Chapter9.ipynb index 6c911620..503ee70d 100644 --- a/Fluid_Mechanics_/Chapter9.ipynb +++ b/Fluid_Mechanics_/Chapter9.ipynb @@ -28,23 +28,19 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Determine Head loss\n", "\n", "from math import *\n", "\n", - "# Given\n", "\n", "S = 1.26 # specific gravity\n", "\n", "mu = 0.826 # kinematic viscosity in Ns/m**2\n", "\n", - "# for water\n", "\n", "rho = 998 # density of water in kg/m**3\n", "\n", "mu1 = 1.005*10**-3 # viscosity in Ns/m**2\n", "\n", - "# for glycerine\n", "\n", "rho1 = S*rho # density of glycerine in kg/m**3\n", "\n", @@ -58,7 +54,6 @@ "\n", "l =100 # length of the pipe\n", "\n", - "# Solution\n", "\n", "V = Q/A\n", "\n", @@ -114,13 +109,10 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Discharge of water\n", "\n", "from math import *\n", "\n", - "# Given\n", "\n", - "# for water\n", "\n", "nu = 1.007*10**-6 # viscosity in m**2/s\n", "\n", @@ -136,7 +128,6 @@ "\n", "g = 9.81 # acceleration due to gravity in m/s**2\n", "\n", - "# Solution\n", "\n", "A = sqrt(2*g*D*hf/L)\n", "\n", @@ -183,11 +174,9 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Size of the case iron\n", "\n", "from math import *\n", "\n", - "# Given\n", "\n", "Q =0.1 # discharge in m**3/s\n", "\n", @@ -201,13 +190,11 @@ "\n", "g = 9.81 # acceleration due to gravity in m/s**2\n", "\n", - "# Solution\n", "\n", "A = 8*L*Q**2/(hf*g*pi**2)\n", "\n", "B = 4*Q/(pi*nu)\n", "\n", - "# for D = 0.172 ; f=0.01\n", "D = 0.172\n", "\n", "r = e/D\n", @@ -216,7 +203,6 @@ "\n", "f = 0.022 # for Re and r\n", "\n", - "# for D1=0.199 ; f=0.021\n", "\n", "D1 = 0.199\n", "\n", @@ -253,11 +239,9 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Head loss \n", "\n", "from math import *\n", "\n", - "# Given\n", "\n", "L = 500 # length of the pipe in ft\n", "\n", @@ -267,7 +251,6 @@ "\n", "S = 0.004\n", "\n", - "# Solution\n", "\n", "Hf = S*L\n", "\n", @@ -298,11 +281,9 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Head loss of water\n", "\n", "from math import *\n", "\n", - "# Given\n", "\n", "Q = 0.1 # water flow rate in m**3/s\n", "\n", @@ -314,7 +295,6 @@ "\n", "g = 9.81 # acceleration due to gravity in m/s**2\n", "\n", - "# Solution\n", "\n", "r = log(d/e,10)\n", "\n", @@ -351,11 +331,9 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Head loss by conveyance method\n", "\n", "from math import *\n", "\n", - "# Given\n", "\n", "Q = 0.1 # water flow rate in m**3/s\n", "\n", @@ -369,7 +347,6 @@ "\n", "S = 5.43 \n", "\n", - "# Solution\n", "\n", "r = log(d/e,10)\n", "\n", @@ -404,24 +381,18 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Solve using the conveyence method\n", "\n", "from math import *\n", "\n", - "# given\n", "\n", "eps = 0.025*10**-2 # for cast iron epsilon = 0.0025 cm\n", "\n", - "# we get the value of K = 0.432 m**2/s\n", - "# we need to do trial and error to find the value of D\n", "\n", - "# we use the value of D = 0.2 m\n", "\n", "D = 0.2 # value in m\n", "\n", "g = 9.81\n", "\n", - "# Solution\n", "\n", "K = (pi/4)*sqrt(2*g)*(2*log10(D/(eps))+1.14)*D**(2.5)\n", "\n", @@ -452,11 +423,9 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Determine head loss\n", "\n", "from math import *\n", "\n", - "# Given\n", "\n", "d = 0.1 # diameter of the pipe\n", "\n", @@ -468,7 +437,6 @@ "\n", "g = 9.81 # acceleration due to gravity in m/s**2\n", "\n", - "# for water\n", "\n", "nu = 1.007*10**-6 # viscosity in m**2/s\n", "\n", @@ -476,7 +444,6 @@ "\n", "r = e/(10*d)\n", "\n", - "# Solution\n", "\n", "V = Q/A\n", "\n", @@ -523,13 +490,10 @@ "cell_type": "code", "collapsed": false, "input": [ - "# discharge through the pipe\n", "\n", "from math import *\n", "\n", - "# Given\n", "\n", - "# for water\n", "\n", "nu = 1.007*10**-6 # viscosity in m**2/s\n", "\n", @@ -547,7 +511,6 @@ "\n", "f2 = 0.022 # foe e/d2\n", "\n", - "# Solution\n", "\n", "V3 = sqrt(2*g*100/((8.4*(f1)+268.85*(f2)+4.85)))\n", "\n", @@ -555,7 +518,6 @@ "\n", "V2 = (d3/d2)**2*V3\n", "\n", - "# reynolds number for pipe BC\n", "\n", "R1 = V1*d1/nu\n", "\n", @@ -590,11 +552,9 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Replace the flow system\n", "\n", "from math import *\n", "\n", - "# Given\n", "\n", "D = 0.2 # diameter of pipe 1\n", "\n", @@ -608,7 +568,6 @@ "\n", "r = e/(100*D) \n", "\n", - "# Solution\n", "\n", "V = Q/(pi*(0.2)**2/4)\n", "\n", @@ -653,11 +612,9 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Discharge through each branch\n", "\n", "from math import *\n", "\n", - "# Given\n", "\n", "e = 0.025 # in cm\n", "\n", @@ -671,7 +628,6 @@ "\n", "g = 9.81\n", "\n", - "# Pipe 1\n", "\n", "r1 = e/D # r1 for pipe 1\n", "\n", @@ -683,7 +639,6 @@ "\n", "hf1 = f*L1*V1**2/(2*g*D1)\n", "\n", - "# pipe 2\n", "\n", "hf2 = hf1\n", "\n", @@ -701,7 +656,6 @@ "\n", "Q2 = V2*(pi*D2**2/4)\n", "\n", - "#pipe 3\n", "\n", "hf3=hf1\n", "\n", @@ -733,7 +687,6 @@ "\n", "print \"Discharge through branch 3 =\",round(q3,3),\"m**3/s\"\n", "\n", - "# Actual head loss\n", "\n", "d = 0.5\n", "\n", @@ -777,11 +730,9 @@ "cell_type": "code", "collapsed": false, "input": [ - "# Find minimum depth below the ridge\n", "\n", "from math import *\n", "\n", - "# Given\n", "\n", "e = 0.00015 # from moody's chart\n", "\n", @@ -801,7 +752,6 @@ "\n", "L = 1000 # length in ft\n", "\n", - "# Solution\n", "\n", "f = 0.011 # assume\n", "\n", |