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_13.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_13.ipynb')
-rwxr-xr-x | Fluid_Mechanics_by_John_F_Douglas/Chapter_13.ipynb | 142 |
1 files changed, 142 insertions, 0 deletions
diff --git a/Fluid_Mechanics_by_John_F_Douglas/Chapter_13.ipynb b/Fluid_Mechanics_by_John_F_Douglas/Chapter_13.ipynb new file mode 100755 index 00000000..664b4abf --- /dev/null +++ b/Fluid_Mechanics_by_John_F_Douglas/Chapter_13.ipynb @@ -0,0 +1,142 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:1f446f61d8838d40d2e31fd72ef3a0bc1e1a7f291c54a48c1366aef232ac3797" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 13: Compressible Flow around a Body" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.1, Page 444" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "import math\n", + "\n", + "\n", + " #Initializing the variables\n", + "rho0 = 1.8;\n", + "R = 287;\n", + "T = 75+273; # Temperature in kelvin \n", + "gma = 1.4; \n", + "Ma = 0.7;\n", + "\n", + " #Calculations\n", + "P0 = rho0*R*T;\n", + "c = (gma*R*T)**0.5;\n", + "V0 = Ma*c;\n", + "Pt = (P0**((gma-1)/gma) + rho0*((gma-1)/gma)*(V0**2/(2*P0**(1/gma))))**(gma/(gma-1));\n", + "rhoT = rho0*(Pt/P0)**(1/gma);\n", + "Tt = Pt/(R*rhoT)-273;\n", + "\n", + "print \"Staganation Pressure (kN/m2 ) :\",round(Pt/1000,1)\n", + "print \"Temperature (Degree Celcius) :\",round(Tt,1)\n", + "print \"Density of airstream (kg/m3) :\",round(rhoT,3)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Staganation Pressure (kN/m2 ) : 249.4\n", + "Temperature (Degree Celcius) : 109.1\n", + "Density of airstream (kg/m3) : 2.274\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.2, Page 454" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "import math\n", + "\n", + "\n", + " #Initializing the variables\n", + "R = 287;\n", + "T = 28+273;\n", + "gma = 1.4;\n", + "P = 1.02*10**5;\n", + "rhoHg = 13.6*10**3;\n", + "g = 9.81;\n", + "\n", + " #Calculations\n", + " #Case(a)\n", + "U0 = 50;\n", + "c = (gma*R*T)**0.5;\n", + "Ma = U0/c;\n", + "rho = P/(R*T);\n", + "DelP = 0.5*rho*U0**2; #Pt-P\n", + "ha = DelP/(rhoHg*g);\n", + "\n", + " #Case(b)\n", + "U0 = 250;\n", + "Ma = U0/c;\n", + "Pt = P*(1+(gma-1)*Ma**2/2)**(gma/(gma-1)); \n", + "DelP = Pt-P\n", + "hb = DelP/(rhoHg*g);\n", + "\n", + " #Case (c)\n", + "U0 = 420;\n", + "Ma1 =U0/c;\n", + "P2 = P*((2*gma/(gma+1))*Ma1**2 - ((gma-1)/(gma+1)));\n", + "N = Ma1**2 +2/(gma-1); # Numerator\n", + "D = 2*gma*Ma1**2/(gma-1)-1;\n", + "Ma2 = (N/D)**0.5;\n", + "Pt2 = P2*(1+(gma-1)*Ma2**2/2)**(gma/(gma-1));\n", + "hc = (Pt2-P2)/(rhoHg*g) ; \n", + "\n", + "print \"Difference in height of mercury column in case (a) in mm :\",round(ha*1000,2)\n", + "print \"Difference in height of mercury column in case (b) in mm :\",round(hb*1000,1)\n", + "print \"Difference in height of mercury column in case (c) in mm :\",round(hc*1000,0)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Difference in height of mercury column in case (a) in mm : 11.06\n", + "Difference in height of mercury column in case (b) in mm : 314.2\n", + "Difference in height of mercury column in case (c) in mm : 684.0\n" + ] + } + ], + "prompt_number": 2 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file |