summaryrefslogtreecommitdiff
path: root/Fluid_Mechanics_by_John_F._Douglas/Chapter_15.ipynb
blob: 95bd78ec54ceb921b69210b850503684e67ba7b0 (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:4f421cc7413696fe7c281427d95aff4b53c3ab081abe9cd6d31d1e2df1133e5a"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "    Chapter 15: Uniform Flows in Open Channels"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 15.1, Page 516"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "\n",
      "\n",
      " #Initializing  the  variables\n",
      "B  =4;\n",
      "D  =  1.2;\n",
      "C  =  7.6;\n",
      "n  =  0.025;\n",
      "s  =  1/1800;\n",
      "\n",
      " #Calculations\n",
      "W  =  B  +  2*1.5*D;\n",
      "A  =  D*(B+C)/2;                                                #  Area  of  parallelogram  formed\n",
      "P  =  B  +2*1.2*(D**2+(1.5)**2)**0.5;\n",
      "m  =A/P;\n",
      "i=s;\n",
      "C  =  (23+0.00155/i+1/n)/(1+(23+0.00155/i)*n/(m)**0.5);         #  By  Kutter  formula\n",
      "Q1  =  C*A*(m*i)**0.5;\n",
      "Q2  =  A*(1/n)*m**(2/3)*(i)**0.5;\n",
      "\n",
      "print \"Q using Chezy formula with C determined from the Kutter formula (m^3/s) :\",round(Q1,2)\n",
      "print \"Q using the Manning formula                                     (m^3/s) :\",round(Q2,2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Q using Chezy formula with C determined from the Kutter formula (m^3/s) : 5.65\n",
        "Q using the Manning formula                                     (m^3/s) : 5.69\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 15.2, Page 518"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "\n",
      " #Initializing  the  variables\n",
      "Q  =  0.5;\n",
      "C  =  80;\n",
      "i  =  1/2000;\n",
      "\n",
      " #Calculations\n",
      "\n",
      "# A = D**2+(3/4)*D**2 = (7/4)*D**2\n",
      "D = ((4/7)*(Q/C)*(2/i)**0.5)**(2/5)\n",
      "\n",
      "#Result\n",
      "print \"Optimum depth = Optimum Width (in metres):\",round(D,3)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Optimum depth = Optimum Width (in metres): 0.552\n"
       ]
      }
     ],
     "prompt_number": 1
    }
   ],
   "metadata": {}
  }
 ]
}