summaryrefslogtreecommitdiff
path: root/Fluid_Mechanics_by_John_F._Douglas/Chapter_3.ipynb
blob: 68980a408fc29a095a441bc792983ec594e1df6a (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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
{
 "metadata": {
  "name": "",
  "signature": "sha256:540962ba0b5999b583f0620c9dca124d46f25fe569649c6c842d96cfa42351a3"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 3: Static Forces on Surfaces. Buoyancy"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.1, Page 65"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "\n",
      " #Initializing  the  variables\n",
      "a  =  2.7;                                                                #Upper  edge\n",
      "b  =  1.2  ;                                                              #Lower  edge\n",
      "width  =  1.5;                                                        #Width  of  trapezoidal  plate\n",
      "h  =  1.1;                                                                #Height  of  water  column  above  surface\n",
      "rho  =  1000;\n",
      "g  =  9.81                                                                #Acceleration  due  to  gravity\n",
      "phi  =  90                                                                #Angle  between  wall  and  surface\n",
      "\n",
      " #Calculations\n",
      "A  =  0.5*(a+b)*width;                                        #Area  of  Trapezoidal  Plate\n",
      "y  =  (2*(0.5*width*0.75)*0.5  +  (1.2*width)*0.75)/A;\n",
      "z  =  y+h;                                                                #Depth  of  center  of  pressure\n",
      "R  =  rho*g*A*z                                                      #Resultant  force\n",
      "\n",
      "I0  =  1.2*1.5**3/12  +1.2*1.5*1.85**2  +  1.5*1.5**3/36  +  1.5*0.75*1.6**2  #Second  moment  of  area\n",
      "D  =  (math.sin(math.degrees(phi)))**2*I0/(A*z);                          #depth  of  center  of  pressure\n",
      "M  =  R*(1.8533-1.1);                                          #Moment  about  hinge\n",
      "print \"Moment about the hinge line (kN/m):\",round(M/1000)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Moment about the hinge line (kN/m): 38.0\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.2, Page 67"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "\n",
      " #Initializing  the  variables\n",
      "w  =  1.8;                                                                #Width  of  plate\n",
      "h1  =  5;                                                                  #Height  of  plate  and  water  in  upstream\n",
      "h2  =  1.5;                                                              #Height  of  water  in  downstream\n",
      "rho  =  1000;\n",
      "g  =  9.81  ;                                                            #Acceleration  due  to  gravity\n",
      "\n",
      " #Calculations\n",
      "def waterForce(area,meanHeight):\n",
      "    F  =  rho  *  g  *  area  *  meanHeight;\n",
      "    return F\n",
      "\n",
      "P  =  waterForce(w*h1,h1/2)-waterForce(w*h2,h2/2);#  Resultant  force  on  gate  \n",
      "x  =  (waterForce(w*h1,h1/2)*(h1/3)  -  waterForce(w*h2,h2/2)*(h2/3))/P;#  point  of  action  of  p  from  bottom\n",
      "R  =  P/(2*math.sin(math.radians(20)));                                          #  Total  Reaction  force\n",
      "Rt  =  1.18*R/4.8;                                                #Reaction  on  Top\n",
      "Rb  =  R  -  Rt  ;                                                      #Reaction  at  bottom\n",
      "\n",
      "print \"Reaction at top    (kN):\",round(Rt/1000,1)\n",
      "print \"Reaction at bottom (kN):\",round(Rb/1000,2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Reaction at top    (kN): 72.2\n",
        "Reaction at bottom (kN): 221.45\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3, Page 70"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "\n",
      "\n",
      "\n",
      " #Initializing  the  variables\n",
      "D  =  1.8;                                                                #Depth  of  tank\n",
      "h  =  1.2;                                                                #Depth  of  water\n",
      "l  =  3;                                                                    #Length  of  wall  of  tank\n",
      "p  =  35000;                                                            #Air  pressure\n",
      "rho  =  10**3;                                                          #Density  of  water\n",
      "g  =  9.81;                                                              #Acceleration  due  to  gravity\n",
      "\n",
      "\n",
      " #Calculations\n",
      "Ra  =  p*D*l;                                                          #Force  due  to  air\n",
      "Rw  =  .5*(rho*g*h)*h*l;                                    #Force  due  to  water\n",
      "R  =  Ra  +  Rw;                                                        #  Resultant  force\n",
      "x  =  (Ra*0.9+Rw*0.4)/R;                                    #  Height  of  center  of  pressure  from  base\n",
      "print \"Resultant force on the wall                     (kN) :\",round(R/1000,2)\n",
      "print \"Height of the centre of pressure above the base (m)  :\",round(x,2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Resultant force on the wall                     (kN) : 210.19\n",
        "Height of the centre of pressure above the base (m)  : 0.85\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.4, Page 72"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "\n",
      "  \n",
      "\n",
      " #Initializing  the  variables\n",
      "R  =  6;                                                                    #  Radius  of  arc\n",
      "h  =  2*R*math.sin(math.radians(30));                                              #Depth  of  water\n",
      "rho  =  10**3;                                                          #Density  of  water\n",
      "g  =  9.81;                                                              #Acceleration  due  to  gravity\n",
      "\n",
      " #Calculations\n",
      "Rh  =  (rho*g*h**2)/2;                                          #  Resultant  horizontal  force  per  unit  length\n",
      "Rv  =  rho*g*((60/360)*math.pi*R**2  -R*math.sin(math.radians(30))*R*math.cos(math.radians(30)));#  Resultant  vertical  force  per  unit  length\n",
      "R  =  (Rh**2+Rv**2)**0.5;                                        #  Resultant  force  on  gate\n",
      "theta  =  180/math.pi*math.atan(Rv/Rh);                                      #Angle  between  resultant  force  and  horizontal\n",
      "\n",
      "print \"Magnitute of resultant force                  (kN/m)   :\",round(R/1000,2)\n",
      "print \"Direction of resultant force to the horizontal(Degrees):\",round(theta,2)\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Magnitute of resultant force                  (kN/m)   : 179.45\n",
        "Direction of resultant force to the horizontal(Degrees): 10.27\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.5, Page 75"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "\n",
      " #Initializing  the  variables\n",
      "B  =  6;                                                                    #  Width  of  pontoon\n",
      "L  =  12;                                                                  #Length  of  pontoon\n",
      "D  =  1.5;                                                                #Draught  of  pontoon\n",
      "Dmax  =  2;                                                              #Maximum  permissible  draught\n",
      "rhoW  =  1000;                                                        #Density  of  fresh  water\n",
      "rhoS  =  1025;                                                        #Density  of  sea  water\n",
      "g  =  9.81;                                                              #Acceleration  due  to  gravity\n",
      "\n",
      " #Calculations\n",
      "def Weight(D):\n",
      "    W  =  rhoW*g*B*L*D;\n",
      "    return W\n",
      "\n",
      "W  =  Weight(D);                                                    #  Weight  of  pontoon  in  fresh  water  =  weight  of  water  displaced\n",
      "Ds  =  W/(rhoS*g*B*L);                                        #Draught  in  sea  water\n",
      "L  =  Weight(Dmax)  -  Weight(D);                      #  maximum  load  that  can  be  supported\n",
      "\n",
      "print \"Weight of pontoon (kN) :\",round(W/1000,1)\n",
      "print \"Draught in sea    (m)  :\",round(Ds,2)\n",
      "print \"Load              (kN) :\",round(L/1000,2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Weight of pontoon (kN) : 1059.5\n",
        "Draught in sea    (m)  : 1.46\n",
        "Load              (kN) : 353.16\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.6, Page 80"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "\n",
      "\n",
      "\n",
      " #Initializing  the  variables\n",
      "D  =  1.8;                                                                #  Diameter  of  buoy\n",
      "H  =  1.2;                                                                #Height  of  buoy\n",
      "W  =  10*10**3;                                                        #Weight  of  buoy\n",
      "L  =  2*10**3;                                                          #Load\n",
      "G  =  0.45;                                                              #  Center  of  gravity\n",
      "rho  =  1025;                                                          #Density  of  sea  water\n",
      "g  =  9.81;                                                              #Acceleration  due  to  gravity\n",
      "\n",
      " #Calculations\n",
      "Z  =  4*(W+L)/(rho*g*math.pi*D**2);                        #  Depth  of  Immersion\n",
      "BG  =  (math.pi*D**4/64)/(math.pi*D**2*Z/4);\n",
      "Z  =  0.5*Z  +BG;                                                #  Position  of  combined  center  of  gravity\n",
      "Z1  =  ((W+L)*Z-0.45*W)/L;                              #Maximum  height  of  load  above  bottom\n",
      "\n",
      "print \"Maximum height of center of gravity above bottom (m) :\",round(Z1,3)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Maximum height of center of gravity above bottom (m) : 1.748\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.7, Page 83"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "\n",
      " #Initializing  the  variables\n",
      "l  =  20;                                                                  #  Length  of  barage\n",
      "b  =  6;                                                                    #Width  of  barage\n",
      "r  =  3;                                                                    #Radius  of  circular  top  of  barage\n",
      "W  =  200*10**3;                                                      #Weight  of  empty  barage\n",
      "d1  =  0.8;                                                              #  Depth  of  water  in  1st  half\n",
      "d2  =  1;                                                                  #  Depth  of  water  in  2nd  half\n",
      "rho  =  1000;                                                          #Density  of  water\n",
      "R  =  0.8;                                                                #Relative  density  of  liquid\n",
      "g  =  9.81;                                                              #Acceleration  due  to  gravity\n",
      "ZG  =  0.45;                                                            #  Center  of  gravity  of  barage\n",
      "\n",
      " #Calculations\n",
      "I00  =  l*b**3/12  +math.pi*b**4/128;\n",
      "ICC  =  l*(.5*b)**3/12;\n",
      "L  =  d1*rho*g*l*b/2*(d1+d2);                          #  Weight  of  liquid  load\n",
      "W  =  L  +  W;                                                          #Total  weight\n",
      "A  =  l*b  +math.pi*r**2/2;                                          #  Area  of  plane  of  waterline\n",
      "V  =  W/(rho*g);                                                  #  Volume  of  vessel  submerged\n",
      "D  =  V/A  ;                                                              #Depth  submerged\n",
      "ZB  =  .5*D;                                                            #Height  of  center  of  buoyancy\n",
      "NM  =  ZB-ZG  +(1/V)*(I00-R*2*ICC);                #  Effective  metacentric  height\n",
      "P  =  R*rho*g*l*b/2*(d2-d1);                            #overturning  moment  \n",
      "theta  =  math.atan(P*1.5/(W*NM))*180/math.pi;                      #Angle  of  roll\n",
      "# converting into degrees and minutes\n",
      "thetaD=round(theta-1)\n",
      "thetaM=(theta-thetaD)*60/100\n",
      "print \"Angle of roll is\",thetaD,\"degrees\",round(thetaM,2),\"minutes\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Angle of roll is 2.0 degrees 0.37 minutes\n"
       ]
      }
     ],
     "prompt_number": 7
    }
   ],
   "metadata": {}
  }
 ]
}