summaryrefslogtreecommitdiff
path: root/3765/CH4/EX4.3/Ex4_3.sce
blob: c387df1f907ca8b1715d35d24c1abcc8937e25f8 (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

clc
// Example 4.3.py
// In Example 4.1, the free stream mach number is increased to 5.0. 
// Calculate the pressure and Mach number behind the wave, and compare these
// results with those of Example 4.1.


// Variable declaration 
M1 = 5.0          // upstream mach number
p1 = 1.0          // upstream pressure (in atm)
T1 = 288          // upstream temperature (in K)
theta = 20.0        // deflection (in degrees)

// Calculations 
// subscript 2 means behind the shock

// from figure 4.5 from M1 = 5.0, theta = 20.0 deg.
beta1 = 30.0                 // shock angle (in degrees)

// degree to radian conversion is done by multiplying by %pi/180
//
Mn1 = M1 * sin(beta1*%pi/180) // upstream mach number normal to the shock

// from Table A2 for Mn1 = 2.5
p2_by_p1 = 7.125            // p2/p1
Mn2 = 0.513

p2 = p2_by_p1 * p1          // p2 (in atm) = p2/p1 * p1
M2 = Mn2/(sin((beta1-theta)*%pi/180)) // mach number behind the shock


printf("\n Shock wave angle %.2f degrees",(beta1))

printf("\n p2 = %.3f atm", p2)

printf("\n M2 = %.2f ", M2)