summaryrefslogtreecommitdiff
path: root/Fluid_Mechanics,Thermodynamics_of_Turbomachinery_by_S.L.Dixon/Chapter2.ipynb
blob: bb8ece3ce1dc37646f6385387f223fa2efdf7e15 (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:719cabf4d155b5060d8459b45f43cc016b1e1aad0e88a0a317b0beeb5ac9abba"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter2-Basic Thermodynamics, Fluid Mechanics: Definitions of Efficiency"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1-pg40"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate the polyefficency and overall total to total efficiency\n",
      "\n",
      "##given data\n",
      "gamma = 1.4;\n",
      "pi = 8.;##pressure ratio\n",
      "T01 = 300.;##inlet temperature in K\n",
      "T02 = 586.4;##outlet temperature in K\n",
      "\n",
      "##Calculations\n",
      "##Calculation of Overall Total to Total efficiency\n",
      "Tot_eff = ((pi**((gamma-1.)/gamma))-1.)/((T02/T01)-1.);\n",
      "\n",
      "##Calculation of polytropic efficiency\n",
      "Poly_eff = ((gamma-1.)/gamma)*((math.log(pi))/math.log(T02/T01));\n",
      "\n",
      "##Results\n",
      "print'%s %.2f %s'%('The Overall total-to-total efficiency is ',Tot_eff,'');\n",
      "print'%s %.2f %s'%('The polytropic efficiency is ',Poly_eff,'');\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Overall total-to-total efficiency is  0.85 \n",
        "The polytropic efficiency is  0.89 \n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex2-pg44"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate the\n",
      "\n",
      "##given data\n",
      "T01 = 1200.;##Stagnation temperature at which gas enters in K\n",
      "p01 = 4.;##Stagnation pressure at which gas enters in bar\n",
      "c2 = 572.;##exit velocity in m/s\n",
      "p2 = 2.36;##exit pressure in bar\n",
      "Cp = 1.160*1000.;##in J/kgK\n",
      "gamma = 1.33\n",
      "\n",
      "##calculations\n",
      "T2 = T01 - 0.5*(c2**2)/Cp;##Calculation of exit temperature in K\n",
      "Noz_eff = ((1.-(T2/T01))/(1.-(p2/p01)**((gamma-1.)/gamma)));##Nozzle efficiency\n",
      "\n",
      "##Results\n",
      "print'%s %.2f %s'%('Nozzle efficiency is ',Noz_eff,'');\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Nozzle efficiency is  0.96 \n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex3-pg51"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate the\n",
      "\n",
      "##given data\n",
      "cp = 0.6;##coefficient of pressure\n",
      "AR = 2.13;##Area ratio\n",
      "N_R1 = 4.66;\n",
      "\n",
      "##calculations\n",
      "cpi = 1. - (1./(AR**2));\n",
      "Diff_eff = cp/cpi;##diffuser efficiency\n",
      "theta = 2.*(180./math.pi)*math.atan((AR**0.5 - 1.)/(N_R1));##included cone angle\n",
      "\n",
      "##Results\n",
      "print'%s %.2f %s'%('cpi = \\n',cpi,'');\n",
      "print'%s %.2f %s'%('The included cone angle can be found = ',theta,' deg.');\n",
      "\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "cpi = \n",
        " 0.78 \n",
        "The included cone angle can be found =  11.26  deg.\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex4-pg52"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate the\n",
      "\n",
      "##given data\n",
      "AR = 1.8;##Area ratio\n",
      "cp = 0.6;##coefficient of pressure\n",
      "N_R1 = 7.85;\n",
      "\n",
      "##calculations\n",
      "Theta = 2.*(180./math.pi)*math.atan((AR**0.5 - 1.)/(N_R1));##included cone angle\n",
      "cpi = 1.-(1./(AR**2));\n",
      "Diff_eff = cp/cpi;##diffuser efficeincy\n",
      "\n",
      "##Results\n",
      "print'%s %.2f %s'%('The included cone angle can be found = ',Theta,' deg.\\n');\n",
      "print'%s %.2f %s'%('cpi = \\n',cpi,'');\n",
      "print'%s %.2f %s'%('Diffuser efficiency = ',Diff_eff,'');\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The included cone angle can be found =  4.98  deg.\n",
        "\n",
        "cpi = \n",
        " 0.69 \n",
        "Diffuser efficiency =  0.87 \n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex5-pg53"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate the\n",
      "\n",
      "##given data\n",
      "AR = 2.0;##Area ratio\n",
      "alpha1 = 1.059;\n",
      "B1 = 0.109;\n",
      "alpha2 = 1.543;\n",
      "B2 = 0.364;\n",
      "cp = 0.577;##coefficient of pressure\n",
      "\n",
      "##calculations\n",
      "cp = (alpha1 - (alpha2/(AR**2))) - 0.09;\n",
      "Diff_eff = cp/(1.-(1./(AR**2)));##Diffuser efficiency\n",
      "\n",
      "##Results\n",
      "print'%s %.2f %s'%('The diffuser efficiency = ',Diff_eff,'');\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The diffuser efficiency =  0.78 \n"
       ]
      }
     ],
     "prompt_number": 6
    }
   ],
   "metadata": {}
  }
 ]
}