summaryrefslogtreecommitdiff
path: root/Fundamentals_Of_Aerodynamics_by_J._D._Anderson_Jr./CHAPTER03.ipynb
blob: 23bbec207ef66ad7ae5a56d36a53016ba74210fc (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
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
{
 "metadata": {
  "name": "",
  "signature": "sha256:673810cabac48e32fa28182f2f2ca38e3fabfd4e716ae55b274dc47aad093ef0"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "CHAPTER03 : FUNDAMENTALS OF INVISCID INCOMPRESSIBLE FLOW"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E01 : Pg 63"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# All the quantities are expressed in SI units\n",
      "import math \n",
      "from math import sqrt\n",
      "rho_inf = 1.23;    # freestream density of air at sea level\n",
      "p_inf = 101000.;    # freestream static pressure\n",
      "v_inf = 50.;        # freestream velocity\n",
      "p = 90000.;         # pressure at given point\n",
      "\n",
      "# The velocity at the given point can be expressed as\n",
      "v = sqrt((2.*(p_inf-p)/rho_inf) + (v_inf**2.));\n",
      "\n",
      "print\"The velocity at the given point is V =\",v,\"m/s\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The velocity at the given point is V = 142.780176712 m/s\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E02 : Pg 64"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# All the quantities are expressed in SI units\n",
      "rho = 1.225;       # freestream density of air along the streamline\n",
      "p_1 = 101314.1;    # pressure at point 1\n",
      "v_1 = 3.05;        # velocity at point 1\n",
      "v_2 = 57.91;       # velocity at point 2\n",
      "# The pressure at point 2 on the given streamline can be given as\n",
      "p_2 = p_1 + 1/2*rho*((v_1**2) - (v_2**2));\n",
      "print\"The pressure at point 2 is p2 =\",p_2,\"Pa\\n\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The pressure at point 2 is p2 = 101314.1 Pa\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E03 : Pg 69"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# All the quantities are expressed in SI units\n",
      "import math \n",
      "rho = 1.225;       # freestream density of air along the streamline\n",
      "delta_p = 335.16;   # pressure difference between inlet and throat\n",
      "ratio = 0.8;       # throat-to-inlet area ratio\n",
      "# The velocity at the inlet can be given as\n",
      "v_1 = math.sqrt(2*delta_p/rho/(((1/ratio)**2)-1));\n",
      "print\"The value of velocity at the inlet is V1 =\",v_1,\"m/s\\n\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The value of velocity at the inlet is V1 = 31.1897419034 m/s\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E04 : Pg 72"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# All the quantities are expressed in SI units\n",
      "import math \n",
      "rho=1.23;           # freestream density of air along the streamline\n",
      "v=50.;               # operating velocity inside wind tunnel\n",
      "rho_hg = 13600.;       # density of mercury\n",
      "ratio = 12.;           # contraction ratio of the nozzle\n",
      "g = 9.8;              # acceleration due to gravity\n",
      "w = rho_hg*g;         # weight per unit volume of mercury\n",
      "# The pressure difference delta_p between the inlet and the test section is given as\n",
      "delta_p = 1./2.*rho*v*v*(1.-(1./ratio**2.));\n",
      "# Thus the height difference in a U-tube mercury manometer would be\n",
      "delta_h = delta_p/w;\n",
      "print\"The height difference in a U-tube mercury manometer is delta_h =\",delta_h,\"m\\n\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The height difference in a U-tube mercury manometer is delta_h = 0.0114557541767 m\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E05 : Pg 73"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# all the quantities are expressed in SI units\n",
      "import math \n",
      "from math import sqrt \n",
      "ratio = 12.;        # contraction ratio of wind tunnel nozzle\n",
      "Cl_max = 1.3;      # maximum lift coefficient of the model\n",
      "S = 0.56;          # wing planform area of the model\n",
      "L_max = 4448.22;   # maximum lift force that can be measured by the mechanical balance\n",
      "rho_inf = 1.225;   # free-stream density of air\n",
      "# the maximum allowable freestream velocity can be given as\n",
      "V_inf = sqrt(2.*L_max/rho_inf/S/Cl_max);\n",
      "# thus the maximum allowable pressure difference is given by\n",
      "delta_p = 1./2.*rho_inf*(V_inf**2.)*(1.-(ratio**-2.));\n",
      "print\"The maximum allowable pressure difference between the wind tunnel setling chamber and the test section is delta_p =\",delta_p,\"Pa\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The maximum allowable pressure difference between the wind tunnel setling chamber and the test section is delta_p = 6067.76041667 Pa\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E06 : Pg 75"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# all the quantities are expressed in SI units\n",
      "\n",
      "V2 = 100.*1609./3600.;        # test section flow velocity converted from miles per hour to meters per second\n",
      "p_atm = 101000.;            # atmospheric pressure\n",
      "p2 = p_atm;                # pressure of the test section which is vented to atmosphere\n",
      "rho = 1.23;                # air density at sea level\n",
      "ratio = 10.;                # contraction ratio of the nozzle\n",
      "\n",
      "# the pressure difference in the wind tunnel can be calculated as\n",
      "delta_p = rho/2.*(V2**2.)*(1.-(1./ratio**2.));\n",
      "\n",
      "# thus the reservoir pressure can be given as\n",
      "p1 = p2 + delta_p;\n",
      "\n",
      "p1_atm = p1/p_atm;         # reservoir pressure expressed in units of atm\n",
      "\n",
      "print\"The reservoir pressure is p1 =\",p1_atm,\"atm\"\n",
      "\n",
      "#Ex3_6b\n",
      "# all the quantities are expressed in SI units\n",
      "\n",
      "V2 = 89.4;        # test section flow velocity converted from miles per hour to meters per second\n",
      "p_atm = 101000;            # atmospheric pressure\n",
      "p2 = p_atm;                # pressure of the test section which is vented to atmosphere\n",
      "rho = 1.23;                # air density at sea level\n",
      "ratio = 10;                # contraction ratio of the nozzle\n",
      "\n",
      "# the pressure difference in the wind tunnel can be calculated as\n",
      "delta_p = rho/2*(V2**2)*(1-(1/ratio**2));\n",
      "\n",
      "# thus the reservoir pressure can be given as\n",
      "p1 = p2 + delta_p;\n",
      "\n",
      "p1_atm = p1/p_atm;         # reservoir pressure expressed in units of atm\n",
      "\n",
      "print\"The new reservoir pressure is p1 =\",p1_atm,\"atm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The reservoir pressure is p1 = 1.01204192792 atm\n",
        "The new reservoir pressure is p1 = 1.0486663505 atm\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E07 : Pg 80"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# all the quantities are expressed in SI units\n",
      "import math \n",
      "p0 = 104857.2;             # total pressure as measured by the pitot tube\n",
      "p1 = 101314.1;             # standard sea level pressure\n",
      "rho = 1.225;               # density of air at sea level\n",
      "\n",
      "# thus the velocity of the airplane can be given as\n",
      "V1 = math.sqrt(2*(p0-p1)/rho);\n",
      "\n",
      "print\"The velocity of the airplane is V1 =\",V1,\"atm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The velocity of the airplane is V1 = 76.0569067293 atm\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E08 : Pg 82"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# all the quantities are expressed in SI units\n",
      "\n",
      "V_inf = 100.1;                # freestream velocity\n",
      "p_inf = 101314.1;             # standard sea level pressure\n",
      "rho_inf = 1.225;              # density of air at sea level\n",
      "\n",
      "# the dynamic pressure can be calculated as\n",
      "q_inf = 1/2*rho_inf*(V_inf**2);\n",
      "\n",
      "# thus the total pressure is given as\n",
      "p0 = p_inf + q_inf;\n",
      "\n",
      "print\"The total pressure measured by pitot tube is p0 =\",p0,\"Pa\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The total pressure measured by pitot tube is p0 = 101314.1 Pa\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E09 : Pg 85"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# all the quantities are expressed in SI units\n",
      "import math \n",
      "p0 = 6.7e4;                # total pressure as measured by the pitot tube\n",
      "p1 = 6.166e4;              # ambient pressure at 4km altitude\n",
      "rho = 0.81935;             # density of air at 4km altitude\n",
      "\n",
      "# thus the velocity of the airplane can be given as\n",
      "V1 = math.sqrt(2*(p0-p1)/rho);\n",
      "\n",
      "print\"The velocity of the airplane is V1 =\",V1,\"m/s =\",V1/0.447,\"mph\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The velocity of the airplane is V1 = 114.169709845 m/s = 255.413221129 mph\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E10 : Pg 88"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# all the quantities are expressed in SI units\n",
      "import math \n",
      "from math import sqrt\n",
      "V1 =114.2;                 # velocity of airplane at 4km altitude\n",
      "rho = 0.81935;             # density of air at 4km altitude\n",
      "q1 = 1./2.*rho*(V1**2.)        # dynamic pressure experienced by the aircraft at 4km altitude\n",
      "rho_sl = 1.23;             # density of air at sea level\n",
      "# according to the question\n",
      "q_sl = q1;                 # sealevel dynamic pressure\n",
      "# thus the equivallent air speed at sea level is given by\n",
      "Ve = sqrt(2*q_sl/rho_sl);\n",
      "print\"The equivallent airspeed of the airplane is Ve =\",Ve,\"m/s\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The equivallent airspeed of the airplane is Ve = 93.2069457878 m/s\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E11 : Pg 89"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# all the quantities are expressed in SI units\n",
      "V_inf = 45.72;        # freestream velocity\n",
      "V = 68.58;            # velocity at the given point\n",
      "# the coeeficient of pressure at the given point is given as\n",
      "Cp = 1. - (V/V_inf)**2.;\n",
      "print\"The coefficient of pressure at the given point is Cp =\",Cp"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The coefficient of pressure at the given point is Cp = -1.25\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E12 : Pg 91"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# all the quantities are expressed in SI units\n",
      "import math \n",
      "from math import sqrt,pi\n",
      "Cp = -5.3;            # peak negative pressure coefficient\n",
      "V_inf = 24.38;        # freestream velocity\n",
      "\n",
      "# the velocity at the given point can be calculated as\n",
      "V = sqrt(V_inf**2*(1-Cp));\n",
      "\n",
      "print\"The velocity at the given point is V =\",V,\"m/s\"\n",
      "\n",
      "#Ex3_12b\n",
      "# all the quantities are expressed in SI units\n",
      "import math \n",
      "Cp = -5.3;            # peak negative pressure coefficient\n",
      "V_inf = 91.44;        # freestream velocity\n",
      "# the velocity at the given point can be calculated as\n",
      "V = math.sqrt(V_inf**2*(1-Cp));\n",
      "\n",
      "print\"The velocity at the given point is V =\",V,\"m/s\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The velocity at the given point is V = 61.1933143407 m/s\n",
        "The velocity at the given point is V = 229.512578479 m/s\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E13 : Pg 100"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# all the quantities are expressed in SI units\n",
      "# When p = p_inf, Cp = 0, thus\n",
      "# 1-4*(sin(theta)**2) = 0\n",
      "# thus theta can be given as\n",
      "#theta = (asind(1/2), 180-asind(1/2), 180-asind(-1/2), 360+asind(-1/2));            # sine inverse of 1/2 and -1/2 where theta varies from 0 to 360 degrees\n",
      "theta1=30.;#\n",
      "theta2=150.;#\n",
      "theta3=210.;#\n",
      "theta4=330.;#\n",
      "print\"The angular locations where surface pressure equals freestream pressure are theta=\",theta1,theta2,theta3,theta4,\"degrees\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The angular locations where surface pressure equals freestream pressure are theta= 30.0 150.0 210.0 330.0 degrees\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E14 : Pg 103"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# All the quantities are expressed in SI units\n",
      "import math \n",
      "Cl = 5;                              # lift coefficient of the cylinder\n",
      "V_by_Vinf = -2 - Cl/2/math.pi;            # ratio of maximum to freestream velocity\n",
      "\n",
      "# thus the pressure coefficient can be calculated as\n",
      "Cp = 1 - (V_by_Vinf**2);\n",
      "\n",
      "print\"The peak negative pressure coefficient is Cp =\",Cp"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The peak negative pressure coefficient is Cp = -5.95176382404\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E15 : Pg 106"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# All the quantities are expressed in SI units\n",
      "#theta = (180-asind(-5/4/math.pi) 360+asind(-5/4/math.pi));        # location of the stagnation points\n",
      "theta1=203.4;#\n",
      "theta2=336.6;#\n",
      "print\"The angular location of the stagnation points are theta =\",theta1, theta2,\"degrees\"\n",
      "#function temp = Cp(thet)\n",
      "#   temp = 0.367 -3.183*sind(thet) - 4*(sind(thet)**2);    # Cp written as a function of theta\n",
      "#endfunction\n",
      "Cp90=-6.82;#\n",
      "print \"\\nCp =\",Cp90\n",
      "#[k] = roots([-4 -3.183 0.367]);\n",
      "#theta_2 = 180/math.pi*(math.pi-asin(k(1)), 2*math.pi+asin(k(1)), asin(k(2)), math.pi-asin(k(2)));\n",
      "theta_2_1=243.9;#\n",
      "theta_2_2=296.11;#\n",
      "theta_2_3=5.86;#\n",
      "theta_2_4=174.1;#\n",
      "Cp270=-0.45;#\n",
      "print\"\\nThe angular location of points on the cylinder where p = p_inf is theta =\",theta_2_1,theta_2_2,theta_2_3,theta_2_4\n",
      "print\"\\nThe value of Cp at the bottom of the cylinder is Cp = \",Cp270"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The angular location of the stagnation points are theta = 203.4 336.6 degrees\n",
        "\n",
        "Cp = -6.82\n",
        "\n",
        "The angular location of points on the cylinder where p = p_inf is theta = 243.9 296.11 5.86 174.1\n",
        "\n",
        "The value of Cp at the bottom of the cylinder is Cp =  -0.45\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E16 : Pg 110"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# All the quantities are expressed in SI units\n",
      "import math \n",
      "rho_inf = 0.90926;        # density of air at 3km altitude\n",
      "V_theta = -75;            # maximum velocity on the surface of the cylinder\n",
      "V_inf = 25;               # freestream velocity\n",
      "R = 0.25;                 # radius of the cylinder\n",
      "\n",
      "# thus the circulation can be calculated as\n",
      "tow = -2*math.pi*R*(V_theta+2*V_inf);\n",
      "\n",
      "# and the lift per unit span is given as\n",
      "L = rho_inf*V_inf*tow;\n",
      "\n",
      "print\"The Lift per unit span for the given cylinder is L=\",L,\"N\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Lift per unit span for the given cylinder is L= 892.663917563 N\n"
       ]
      }
     ],
     "prompt_number": 17
    }
   ],
   "metadata": {}
  }
 ]
}