diff options
author | Thomas Stephen Lee | 2015-09-04 22:04:10 +0530 |
---|---|---|
committer | Thomas Stephen Lee | 2015-09-04 22:04:10 +0530 |
commit | 64419e47f762802600b3a2b6d8c433a16ccd3d55 (patch) | |
tree | 14ad7c37c9547cd516f141494f3fa375621edbaa /Fluid_Mechanics_by_John_F_Douglas/Chapter_16.ipynb | |
parent | 10f6fb8cd1d840a3042651dfaa6fd5af4924b94a (diff) | |
download | Python-Textbook-Companions-64419e47f762802600b3a2b6d8c433a16ccd3d55.tar.gz Python-Textbook-Companions-64419e47f762802600b3a2b6d8c433a16ccd3d55.tar.bz2 Python-Textbook-Companions-64419e47f762802600b3a2b6d8c433a16ccd3d55.zip |
add/remove/update books
Diffstat (limited to 'Fluid_Mechanics_by_John_F_Douglas/Chapter_16.ipynb')
-rwxr-xr-x | Fluid_Mechanics_by_John_F_Douglas/Chapter_16.ipynb | 144 |
1 files changed, 144 insertions, 0 deletions
diff --git a/Fluid_Mechanics_by_John_F_Douglas/Chapter_16.ipynb b/Fluid_Mechanics_by_John_F_Douglas/Chapter_16.ipynb new file mode 100755 index 00000000..73f04778 --- /dev/null +++ b/Fluid_Mechanics_by_John_F_Douglas/Chapter_16.ipynb @@ -0,0 +1,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": {} + } + ] +}
\ No newline at end of file |