summaryrefslogtreecommitdiff
path: root/Fluid_Mechanics_by_John_F_Douglas/Chapter_16.ipynb
blob: 73f047786843e40b1762da07fdf3172e7ad94d6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
{
 "metadata": {
  "name": "",
  "signature": "sha256:130e6e124bfc557e016f12e2356b74f1d97ea210c47b1944be1ebda3297e63a8"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 16: Non-Uniform Flow in Open Channels"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.2, Page 541"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "\n",
      "\n",
      " #Initializing  the  variables\n",
      "B  =  [1.4 ,0.9];\n",
      "D  =  [0.6 ,0.32];\n",
      "g  =  9.81;\n",
      "h  =  0.03;\n",
      "Z  =  0.25;  \n",
      "\n",
      " #Calculations\n",
      "Q1  =  B[1]*D[1]*(2*g*h/(1-(B[1]*D[1]/B[0]*D[0])**2))**0.5\n",
      "E  =  D[0]-Z;\n",
      "Q2  =  1.705*B[1]*E**1.5;\n",
      "\n",
      "print \"Volume flow rate (m3/s) :\",round(Q2,4) "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Volume flow rate (m3/s) : 0.3177\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.3, Page 546"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "\n",
      "\n",
      " #Initializing  the  variables\n",
      "a  =0.5;\n",
      "b  =  0.5;\n",
      "Dn  =  1.2;\n",
      "s  =  1/1000;\n",
      "C  =  55;\n",
      "g  =  9.81;\n",
      "\n",
      " #Calculations\n",
      "c = (1+a)/b;  \n",
      "QbyB = Dn*C*(Dn*s)**0.5;\n",
      "q = QbyB;\n",
      "Dc = (q**2/g)**(1/3);\n",
      "\n",
      "header  =  \"Mean Depth(Dm)    Numenator    Denominator\\t L\"\n",
      "unit  =    \"   (m) \\t  \\t \\t  \\t(m)\"\n",
      "\n",
      "m=[]\n",
      "Dm=[]\n",
      "N=[]\n",
      "D=[]\n",
      "Lm=[]\n",
      "total=0\n",
      "for c in range(7):    \n",
      "    m.append(2.4-0.15*c);\n",
      "    Dm.append((m[c]+m[c]-0.15)/2); \n",
      "    N.append(1 - (Dc/Dm[c])**3) ;    # Numerator\n",
      "    D.append(1 - (Dn/Dm[c])**3);     # Denominator\n",
      "    Lm.append(150*(N[c]/D[c]));\n",
      "    total = total +Lm[c];\n",
      "\n",
      "print header\n",
      "print unit\n",
      "for c in range(7):\n",
      "    mm=str(Dm[c])+'\\t       '+str(round(N[c],4))+'        '+str(round(D[c],4))+' \\t'+str(round(Lm[c],2))\n",
      "    print mm\n",
      "    \n",
      "print \"\\ndistance upstream covered (approx in m):\",round(total)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Mean Depth(Dm)    Numenator    Denominator\t L\n",
        "   (m) \t  \t \t  \t(m)\n",
        "2.325\t       0.9576        0.8625 \t166.54\n",
        "2.175\t       0.9482        0.8321 \t170.94\n",
        "2.025\t       0.9358        0.7919 \t177.26\n",
        "1.875\t       0.9192        0.7379 \t186.86\n",
        "1.725\t       0.8962        0.6634 \t202.65\n",
        "1.575\t       0.8636        0.5577 \t232.27\n",
        "1.425\t       0.8159        0.4028 \t303.8\n",
        "\n",
        "distance upstream covered (approx in m): 1440.0\n"
       ]
      }
     ],
     "prompt_number": 2
    }
   ],
   "metadata": {}
  }
 ]
}