summaryrefslogtreecommitdiff
path: root/2126/CH5/EX5.4/4.sce
blob: cdd5373f82b50d16cce98de24a7d0bdf1dedb263 (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
clc
clear

//Input data
Px=30 //Pressure before the shock in kPa
Tx=-30+273 //Temperature before the shock in K
pr=2.6 //Pressure ratio across the shock wave
k=1.4 //Adiabatic constant 
R=287 //Specific gas constant in J/kg-K

//Calculation
Mx=1.54 //Mach number before the shock from gas tables @pr
My=0.687 //Mach number after the shock from gas tables @Mx
t1=1.347 //Temperature ratio after and before the shock from gas tables @My
Ty=t1*Tx //Temperature ratio after the shock in K
p1=3.567 //Stagnation pressure after shock to Static pressure before shock from gas tables @My
Poy=p1*Px //Stagnation pressure after shock in kPa
p2=0.917 //Stagnation pressure ratio after and before the shock from gas tables @My
Pox=Poy/p2 //Stagnation pressure before shock in kPa
dP=Pox-Poy //Change in stagnation pressure in kPa
ax=sqrt(k*R*Tx) //Velocity of sound before the shock in m/s
Cx=(Mx*ax) //Air Velocity before the shock in m/s
ay=sqrt(k*R*Ty) //Velocity of sound after the shock in m/s
Cy=(My*ay) //Velocity of air after the shock in m/s

//Output
printf('(A)Velocities upstream and downstream of shock wave are %3.2f m/s and %3.2f m/s respectively\n (B)Change in stagnation pressure is %3.3f kPa',Cx,Cy,dP)