summaryrefslogtreecommitdiff
path: root/Fluid_Mechanics_by_John_F_Douglas/Chapter_10.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Fluid_Mechanics_by_John_F_Douglas/Chapter_10.ipynb')
-rwxr-xr-xFluid_Mechanics_by_John_F_Douglas/Chapter_10.ipynb341
1 files changed, 341 insertions, 0 deletions
diff --git a/Fluid_Mechanics_by_John_F_Douglas/Chapter_10.ipynb b/Fluid_Mechanics_by_John_F_Douglas/Chapter_10.ipynb
new file mode 100755
index 00000000..510f6bab
--- /dev/null
+++ b/Fluid_Mechanics_by_John_F_Douglas/Chapter_10.ipynb
@@ -0,0 +1,341 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:03b40b6d5c44ff714aac13480905f296c46afa917e2740a687e8aa66bb21b428"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 10: Laminar and Turbulent Flows in Bounded System"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.1, Page 329"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "import math\n",
+ "import sympy\n",
+ "from sympy import symbols,diff,solve\n",
+ "\n",
+ " #Initializing the variables\n",
+ "mu = 0.9;\n",
+ "rho = 1260;\n",
+ "g = 9.81;\n",
+ "x = 45; #theta in degrees\n",
+ "P1 = 250 * 10**3;\n",
+ "P2 = 80* 10**3;\n",
+ "Z1 = 1;\n",
+ "Z2 = 0; # datum\n",
+ "U = -1.5;\n",
+ "Y = 0.01;\n",
+ "\n",
+ " #Calculations\n",
+ "gradP1 = P1+ rho*g*Z1;\n",
+ "gradP2 = P2+ rho*g*Z2;\n",
+ "DPstar = (gradP1-gradP2)*math.sin(math.radians(x))/(Z1-Z2);\n",
+ "A = U/Y; # Coefficient U/Y for equation 10.6\n",
+ "B = DPstar/(2*mu) # Coefficient dp*/dx X(1/2mu) for equation 10.6\n",
+ "y = symbols('y')\n",
+ "v = round((A + B*Y),1)*y -round(B)*y**2\n",
+ "duBYdy = diff(v,y);\n",
+ "tau = 0.9*duBYdy;\n",
+ "stagPnts = solve(duBYdy,y)\n",
+ "ymax=stagPnts[0] #value of y where derivative vanishes.;\n",
+ "umax = (A + B*Y)*ymax + B*ymax**2; # Check the value there is slight mistake in books answer\n",
+ "def u(y):\n",
+ " z = (A + B*Y)*y -B*y**2;\n",
+ " return diff(z,y)\n",
+ "def dif(y):\n",
+ " return round((A + B*Y)) -2*round(B)*y\n",
+ "\n",
+ "taumax=abs(mu*dif(Y))\n",
+ "\n",
+ "print \"velocity distribution :\",v\n",
+ "print \"shear stress distribution :\",mu*dif(y)\n",
+ "print \"maximum flow velocity (m/s) :\",round(umax,2)\n",
+ "print \"Maximum Shear Stress (kN/m^2):\",(round(taumax)/1000)\n",
+ " \n",
+ "\n",
+ "print "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "velocity distribution : -71638.0*y**2 + 566.4*y\n",
+ "shear stress distribution : -128948.4*y + 509.4\n",
+ "maximum flow velocity (m/s) : 3.36\n",
+ "Maximum Shear Stress (kN/m^2): 0.78\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.2, Page 335"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "import math\n",
+ "\n",
+ "\n",
+ " #Initializing the variables\n",
+ "mu = 0.9;\n",
+ "rho = 1260;\n",
+ "d = 0.01;\n",
+ "Q = 1.8/60*10**-3; #Flow in m**3 per second\n",
+ "l = 6.5;\n",
+ "ReCrit = 2000;\n",
+ " #Calculations\n",
+ "A = (math.pi*d**2)/4;\n",
+ "MeanVel = Q/A;\n",
+ "Re = rho*MeanVel*d/mu/10; # Check properly the answer in book there is something wrong\n",
+ "Dp = 128*mu*l*Q/(math.pi*d**4)\n",
+ "Qcrit = Q*ReCrit/Re*10**3;\n",
+ "\n",
+ "print \"Pressure Loss (kN/m2) :\",round(Dp/1000,0)\n",
+ "print \"Maximum Flow rate (litres/s) :\",round(Qcrit,0)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pressure Loss (kN/m2) : 715.0\n",
+ "Maximum Flow rate (litres/s) : 112.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.3, Page 341"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "import math\n",
+ "\n",
+ "\n",
+ " #Initializing the variables\n",
+ "mu = 1.14*10**-3;\n",
+ "rho = 1000;\n",
+ "d = 0.04;\n",
+ "Q = 4*10**-3/60; #Flow in m**3 per second\n",
+ "l = 750;\n",
+ "ReCrit = 2000;\n",
+ "g = 9.81;\n",
+ "k = 0.00008; # Absolute Roughness\n",
+ "\n",
+ " #Calculations\n",
+ "A = (math.pi*d**2)/4;\n",
+ "MeanVel = Q/A;\n",
+ "Re = rho*MeanVel*d/mu;\n",
+ "Dp = 128*mu*l*Q/(math.pi*d**4);\n",
+ "hL = Dp/(rho*g);\n",
+ "f = 16/Re;\n",
+ "hlDa = 4*f*l*MeanVel**2/(2*d*g); # By Darcy Equation\n",
+ "Pa = rho*g*hlDa*Q;\n",
+ "\n",
+ " #Part(b)\n",
+ "Q = 30*10**-3/60; #Flow in m**3 per second\n",
+ "MeanVel = Q/A;\n",
+ "Re = rho*MeanVel*d/mu;\n",
+ "RR = k/d; # relative roughness\n",
+ "f = 0.008 #by Moody diagram for Re = 1.4 x 10**4 and relative roughness = 0.002\n",
+ "hlDb = 4*f*l*MeanVel**2/(2*d*g); # By Darcy Equation\n",
+ "Pb = rho*g*hlDb*Q;\n",
+ "\n",
+ "\n",
+ "print \"!---- Case (a) ----!\\n\",\"Head Loss(mm) :\",round(hlDa*1000,1)\n",
+ "print \"Power Required (W) :\",round(Pa,4)\n",
+ "print \"\\n!---- Case (b) ----!\\n\",\"Head Loss(m) :\",round(hlDb,2)\n",
+ "print \"Power Required (W) :\",round(Pb,0)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "!---- Case (a) ----!\n",
+ "Head Loss(mm) : 92.5\n",
+ "Power Required (W) : 0.0605\n",
+ "\n",
+ "!---- Case (b) ----!\n",
+ "Head Loss(m) : 4.84\n",
+ "Power Required (W) : 24.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.4, Page 343"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "import math\n",
+ "\n",
+ "\n",
+ " #Initializing the variables\n",
+ "w = 4.5;\n",
+ "d = 1.2 ;\n",
+ "C = 49;\n",
+ "i = 1/800;\n",
+ "\n",
+ " #Calculations\n",
+ "A = d*w;\n",
+ "P = 2*d + w;\n",
+ "m = A/P;\n",
+ "v = C*(m*i)**0.5;\n",
+ "Q = v*A;\n",
+ "\n",
+ "print \"Mean Velocity (m/s):\",round(v,2)\n",
+ "print \"Discharge (m3/s) :\",round(Q,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mean Velocity (m/s): 1.53\n",
+ "Discharge (m3/s) : 8.28\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.5, Page 348"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "import sympy\n",
+ "from sympy import symbols\n",
+ "\n",
+ " #Initializing the variables\n",
+ "r,R = symbols('r R')\n",
+ "\n",
+ "#Calculations\n",
+ "rbyR=round((1-(49/60)**7),3)\n",
+ "r = (rbyR)*R \n",
+ "\n",
+ "#Result\n",
+ "print \"radius at which actual velocity is equal to mean velocity is\",r"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "radius at which actual velocity is equal to mean velocity is 0.758*R\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10.7, Page 355"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "import math\n",
+ "\n",
+ "\n",
+ " #Initializing the variables\n",
+ "d1 = 0.140;\n",
+ "d2 = 0.250;\n",
+ "DpF_DpR = 0.6; #Difference in head loss when in forward and in reverse direction\n",
+ "K = 0.33 #From table\n",
+ "g = 9.81;\n",
+ " #Calculations\n",
+ "ratA = (d1/d2)**2;\n",
+ "v =(DpF_DpR*2*g/((1-ratA)**2-K))**0.5;\n",
+ "\n",
+ "print \"Velocity (m/s):\",round(v,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity (m/s): 9.13\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file