summaryrefslogtreecommitdiff
path: root/839/CH6/EX6.2/Example_6_2.sce
blob: 4abb1d09a4a131c477fd40c64b4bcb536bf0f5b1 (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
//clear//
clear;
clc;

//Example 6.2
//Given
Tr = 1000; //[R] 
pr = 20; //[atm]
Ma_a = 0.05;
gama = 1.4;
gc = 32.174; //[ft-lb/lbf-s^2]
M = 29;
R = 1545;
//(a)
//Using Eq.(6.45)
A = 2*(1+((gama-1)/2)*Ma_a^2)/((gama+1)*Ma_a^2);
fLmax_rh = (1/Ma_a^2-1-(gama+1)*log(A)/2)/gama  

//(b)
//Using Eq.(6.28), the pressure at the end of the isentropic nozzle pa
A = (1+(gama-1)*(Ma_a^2)/2); 
pa = pr/(A^(gama/(gama-1)))  // [atm]
//From Example 6.1, the density of air at 20atm and 1000R is 0.795 lb/ft^3
//Using Eq.(6.17), the acoustic velocity 
Aa  = sqrt(gc*gama*Tr*R/M) //[m/s]
//The velocity at the entrance of the pipe 
ua  = Ma_a*Aa //[m/s]
//When L_b = L_max, the gas leaves the pipe at the asterisk conditions, where 
Ma_b = 1;
// Using Eq.(6.43)
A = (gama-1)/2;
Tstar = Tr *(1+A*Ma_a^2)/(1+A*Ma_b^2) // [K]
// Using Eq.(6.44)
rho_star = 0.795*Ma_a/sqrt(2*(1+(gama-1)*Ma_a^2/2)/(2.4)) //[lb/ft^3]
//Using Eq.(6.39)
pstar = p0*Ma_a/sqrt(1.2) // [atm]
//Mass velocity through the entire pipe
G = 0.795*ua //[lb/ft^2-s]
ustar = G/rho_star //[ft/s]

//(c)
//Using Eq.(6.45) with f_Lmax_rh = 400

err = 1;
eps = 10^-3;
Ma_ac = rand(1,1);
i =1;
while((err>eps))  
  A = 2*(1+((gama-1)/2)*Ma_ac^2)/((gama+1)*Ma_ac^2);
  B = gama*400+1+(gama+1)*log(A)/2;
  Ma_anew  = sqrt(1/B);
  err = Ma_ac-Ma_anew;
  Ma_ac = Ma_anew;
end
Ma_ac;
uac  = Ma_ac*ua/Ma_a //[ft/s]
Gc = uac*0.795 //[lb/ft^2-s]