summaryrefslogtreecommitdiff
path: root/Fluid_Mechanics_by_John_F._Douglas/Chapter_13.ipynb
blob: 664b4abf8467f7a518af6891b58bbd28284cfdca (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
{
 "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": {}
  }
 ]
}