diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /2126/CH5 | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '2126/CH5')
-rwxr-xr-x | 2126/CH5/EX5.1/1.sce | 30 | ||||
-rwxr-xr-x | 2126/CH5/EX5.10/10.sce | 24 | ||||
-rwxr-xr-x | 2126/CH5/EX5.11/11.sce | 23 | ||||
-rwxr-xr-x | 2126/CH5/EX5.12/12.sce | 41 | ||||
-rwxr-xr-x | 2126/CH5/EX5.13/13.sce | 136 | ||||
-rwxr-xr-x | 2126/CH5/EX5.14/14.sce | 35 | ||||
-rwxr-xr-x | 2126/CH5/EX5.15/15.sce | 21 | ||||
-rwxr-xr-x | 2126/CH5/EX5.16/16.sce | 22 | ||||
-rwxr-xr-x | 2126/CH5/EX5.17/17.sce | 30 | ||||
-rwxr-xr-x | 2126/CH5/EX5.18/18.sce | 24 | ||||
-rwxr-xr-x | 2126/CH5/EX5.19/19.sce | 33 | ||||
-rwxr-xr-x | 2126/CH5/EX5.2/2.sce | 34 | ||||
-rwxr-xr-x | 2126/CH5/EX5.20/20.sce | 63 | ||||
-rwxr-xr-x | 2126/CH5/EX5.21/21.sce | 52 | ||||
-rwxr-xr-x | 2126/CH5/EX5.22/22.sce | 36 | ||||
-rwxr-xr-x | 2126/CH5/EX5.23/23.sce | 50 | ||||
-rwxr-xr-x | 2126/CH5/EX5.24/24.sce | 49 | ||||
-rwxr-xr-x | 2126/CH5/EX5.25/25.sce | 24 | ||||
-rwxr-xr-x | 2126/CH5/EX5.26/26.sce | 22 | ||||
-rwxr-xr-x | 2126/CH5/EX5.27/27.sce | 40 | ||||
-rwxr-xr-x | 2126/CH5/EX5.28/28.sce | 25 | ||||
-rwxr-xr-x | 2126/CH5/EX5.3/3.sce | 27 | ||||
-rwxr-xr-x | 2126/CH5/EX5.4/4.sce | 27 | ||||
-rwxr-xr-x | 2126/CH5/EX5.5/5.sce | 19 | ||||
-rwxr-xr-x | 2126/CH5/EX5.6/6.sce | 13 | ||||
-rwxr-xr-x | 2126/CH5/EX5.7/7.sce | 56 | ||||
-rwxr-xr-x | 2126/CH5/EX5.8/8.sce | 27 | ||||
-rwxr-xr-x | 2126/CH5/EX5.9/9.sce | 27 |
28 files changed, 1010 insertions, 0 deletions
diff --git a/2126/CH5/EX5.1/1.sce b/2126/CH5/EX5.1/1.sce new file mode 100755 index 000000000..a9c34f9f4 --- /dev/null +++ b/2126/CH5/EX5.1/1.sce @@ -0,0 +1,30 @@ +clc
+clear
+
+//Input data
+Px=150 //Pressure before the shock in kPa
+Tx=25+273 //Temperature before the shock in K
+Py=350 //Pressure just after the shock in kPa
+k=1.4 //Adiabatic constant
+R=287 //Specific gas constant in J/kg-K
+
+//Calculations
+p1=Py/Px //Pressure ratio
+Mx=1.4638 //Mach number before the shock
+My=0.716 //Mach number after the shock from gas tables @Mx
+t1=1.294 //Temperature ratio after and before the shock from gas tables @p1
+Ty=t1*Tx //Temperature ratio after the shock in K
+ax=sqrt(k*R*Tx) //Velocity of sound before the shock in m/s
+Cx=ax*Mx //Velocity of gas before the shock in m/s
+ay=sqrt(k*R*Ty) //Velocity of sound after the shock in m/s
+Cy=ay*My //Velocity of gas after the shock in m/s
+p2=0.942 //Stagnation pressure ratio after and before the shock from gas tables @p1
+ds=R*log(1/p2) //Change in entropy in J/kg-K
+p3=3.265 //Stagnation pressure after shock to Static pressure before shock from gas tables @p1
+Poy=p3*Px //Stagnation pressure after shock in kPa
+Pox=Poy/p2 //Stagnation pressure before shock in kPa
+pr_loss=Pox-Poy //Loss of stagnation pressure of air in kPa
+dd=(1000/R)*((Py/Ty)-(Px/Tx)) //Increase in density of air in kg/m^3
+
+//Output
+printf('(A)Mach number before shock is %3.4f\n (B)After shock:\n Mach number is %3.3f\n Static temperature is %3.3f K\n Velocity is %3.2f m/s\n (C)Increase in density of air is %3.2f kg/m^3\n (D)Loss of stagnation pressure of air is %3.2f kPa\n (E)Change in entropy is %3.3f J/kg-K',Mx,My,Ty,Cy,dd,pr_loss,ds)
diff --git a/2126/CH5/EX5.10/10.sce b/2126/CH5/EX5.10/10.sce new file mode 100755 index 000000000..12157abcc --- /dev/null +++ b/2126/CH5/EX5.10/10.sce @@ -0,0 +1,24 @@ +clc
+clear
+
+//Input data
+a1=0.4 //Ratio of throat area to exit area
+p1=0.8 //Ratio of static pressure to Stagnation pressure at inlet
+At=1 //Throat area in m^2
+
+//Calculation
+a2=1/a1 //reciprocal of a1 to find in gas tables
+//Pox=Po1=Po, Poy=Po2
+a2p2=a2*p1 //Area pressure ratio i.e. (A2*P2)/(At2*Po2)
+M2=0.28 //Exit mach number from gas tables @a2p2
+a3=2.166 //Ratio of exit area to throat area after shock from gas tables @a2p2
+p2=0.947 //Static to stagnation pressure ratio at exit from gas tables @a2p2
+p3=a2/a3 //Stagnation pressure ratio after and before shock
+Mx=1.675 //Mach number before the shock @p3
+My=0.647 //Mach number after the shock from gas tables @Mx
+a4=1.14 //Ratio of area after shock to throat area after shock from isentropic gas tables @My
+a5=1.315 //Ratio of area before shock to throat area before shock from isentropic gas tables @My
+Ax=a5*At //Area at shock in m^2
+
+//Output
+printf('(A)Mach number across the shock: Mx=%3.3f (My=%3.3f)\n (B)Area at shock is %3.3f m^2',Mx,My,Ax)
diff --git a/2126/CH5/EX5.11/11.sce b/2126/CH5/EX5.11/11.sce new file mode 100755 index 000000000..2d9fc360b --- /dev/null +++ b/2126/CH5/EX5.11/11.sce @@ -0,0 +1,23 @@ +clc
+clear
+
+//Input data
+a1=1/3 //Ratio of throat area to exit area
+p1=0.4 //Ratio of static pressure to Stagnation pressure at inlet
+
+//Calculation
+a2=1/a1 //reciprocal of a1 to find in gas tables
+//we know Pox=Po1=Po, Poy=Po2, At=Atx and Aty=At2
+a2p2=a2*p1 //Area pressure ratio i.e. (A2*P2)/(At2*Po2)
+M2=0.472 //Exit mach number from gas tables @a2p2
+a3=1.397 //Ratio of exit area to throat area after shock from gas tables @a2p2
+p2=0.858 //Static to stagnation pressure ratio at exit from gas tables @a2p2
+p3=a3/a2 //Stagnation pressure ratio after and before shock
+Mx=2.58 //Mach number before the shock @p3
+My=0.506 //Mach number after the shock from gas tables @Mx
+p4=9.145 //Stagnation pressure after shock to Static pressure before shock from gas tables @My
+a4=2.842 //Ratio of area before shock to throat area
+p5=0.051 //Ratio of Pressure before shock to Stagnation pressure at entry
+
+//Output
+printf('At section where shock occurs:\n (A)Mach number Mx=%3.2f and My=%3.3f\n (B)Static Pressure is %3.3f*Po1 (units depend on Po1)\n (C)Area of cross section is %3.3f*At (units depend on At)',Mx,My,p5,a4)
diff --git a/2126/CH5/EX5.12/12.sce b/2126/CH5/EX5.12/12.sce new file mode 100755 index 000000000..9a9db0449 --- /dev/null +++ b/2126/CH5/EX5.12/12.sce @@ -0,0 +1,41 @@ +clc
+clear
+
+//Input data
+Po=300 //Pressure in reservoir in kPa
+To=500 //Temperature in reservoir in K
+At=1 //Throat area in m^2
+Ax=2 //Area just before the shock in m^2
+Ay=2 //Area just after the shock in m^2
+A2=3 //Exit area in m^2
+
+//Calculation
+a1=Ax/At //Area ratio
+Mx=2.2 //Mach number upstream of shock
+p1=0.0935 //Ratio of pressure before shock to stagnation pressure before shock from gas tables @Mx
+Px=p1*Po //pressure before shock in kPa
+t1=0.50 //Ratio of temperature before shock to stagnation pressure before shock from gas tables @Mx
+Tx=t1*To //temperature before shock in K
+My=0.547 //Mach number downstream of shock
+p2=5.480 //Static pressure ratio after and before the shock from gas tables @My
+Py=Px*p2 //Static pressure after shock in kPa
+t2=1.857 //Temperature ratio after and before the shock from gas tables @My
+Ty=t2*Tx //Temperature ratio after the shock in K
+p3=6.716 //Stagnation pressure after shock to Static pressure before shock from gas tables @My
+Poy=Px*p3 //Stagnation pressure after shock in kPa
+Po2=Poy //Exit stagnation pressure in kPa, Since total pressure remains same after shock
+t3=0.943 //Static to stagnation pressure after shock from isentropic gas tables @My
+Toy=Ty/t3 //Stagnation pressure after shock in K
+To2=Toy //Exit stagnation temperature in K, Since temperature remains after shock
+a2=1.255 //Ratio of area after shock to throat area after shock from isentropic gas tables @My
+Aty=Ay/a2 //Throat area after shock in m^2
+At2=Aty //Throat area at exit in m^2
+a3=A2/At2 //Areas ratio
+M2=0.33 //Exit mach number from gas tables @a3
+p4=0.927 //Static to Stagnation pressure at exit from gas isentropic gas tables @a3
+P2=Po2*p4 //Exit pressure in kPa
+t4=0.978 //Static to Stagnation temperature at exit from gas isentropic gas tables @a3
+T2=To2*t4 //Exit temperature in K
+
+//Output
+printf('(A)Pressure at section (x) Px=%3.2f kPa\n (B)Pressure at section (y) Px=%3.3f kPa\n (C)Stagnation pressure at section (y) Poy=%3.2f kPa\n (D)Throat area of cross section at section (y) Aty=%3.4f m^2\n (E)Stagnation pressure at exit Po2=%3.2f kPa\n (F)Throat area of cross section at exit At2=%3.4f m^2\n (G)Static Pressure at exit P2=%3.2f kPa\n (H)Stagantion temperature at exit To2=%3i K\n (I)Temperature at exit T2=%3i k',Px,Py,Poy,Aty,Po2,At2,P2,To2,T2)
diff --git a/2126/CH5/EX5.13/13.sce b/2126/CH5/EX5.13/13.sce new file mode 100755 index 000000000..4b622d910 --- /dev/null +++ b/2126/CH5/EX5.13/13.sce @@ -0,0 +1,136 @@ +clc
+clear
+
+//Input data
+Po1=500 //Stagnation pressure in kPa
+To1=600 //Stagnation temperature in K
+C1=100 //inlet velocity in m/s
+A1=0.01 //Inlet Area in m^2
+A2=0.01 //Exit Area in m^2
+Mx=1.2 //Mach number before the shock
+Ax=37.6 //Area just before the shock in cm^2
+Ay=37.6 //Area just after the shock in cm^2
+Px=109.9 //Pressure before the shock in kPa
+Poy=350 //Stagnation pressure after shock in kPa
+k=1.4 //Adiabatic constant
+R=287 //Specific gas constant in J/kg-K
+Cp=1005 //Specific heat capacity at constant volume in J/kg-K
+
+//Calculation
+T1=To1+(C1^2/(2*Cp)) //Inlet static temperature in K
+ai_1=sqrt(k*R*T1) //Velocity of sound at inlet in m/s
+M1=C1/ai_1 //Inlet Mach number
+p1=0.973 //Static to Stagnation pressure ratio at entry from gas tables @M1
+P1=Po1*p1 //Inlet static pressure in kPa
+d1=P1*10^3/(R*T1) //Density at inlet in kg/m^3, P1 in Pa
+m=d1*A1*C1 //Mass flow rate at inlet in kg/s
+p2=0.528 //Ratio of critical pressure to stagnation pressure from gas tables @M=1
+Pt=Po1*p2 //Critical pressure in kPa
+t1=0.834 //Ratio of critical temperature to stagnation temperature from gas tables @M=1
+Tt=t1*To1 //critical temperature in K
+ai_t=sqrt(k*R*Tt) //Velocity of sound at critical state in m/s
+Ct=ai_t //Velocity of air at critical state in m/s
+a1=2.964 //Ratio of inlet area to critical area from gas tables @M=1
+At=A1/a1 //critical area in m^2
+dt=Pt/(R*Tt) //Density at critical state in kg/m^3
+mt=dt*At*Ct //Mass flow rate at critical satate in kg/s
+//Sub-division (a)
+a2=1.030 //Ratio of area after shock to critical area from gas tables @Mx
+Ay_a=At*a2 //Area after shock in cm^2
+p3=0.412 //Ratio of upstram of shock to stagnation pressures from isentropic gas tables @Mx
+Px_a=Po1*p3 //Pressure upstram of shock in kPa
+t2=0.776 //Ratio of upstram of shock to stagnation temperature from isentropic gas tables @Mx
+Tx_a=To1*t2 //Temperature upstram of shock in K
+My_a=0.84 //Mach number downstream of shock from normal shock gas tables @Mx
+p4=1.497 //Static pressure ratio after and before the shock from gas tables @My
+Py_a=Px_a*p4 //Static pressure after shock in kPa
+t3=1.099 //Temperature ratio after and before the shock from gas tables @My
+Ty_a=Tx_a*t3 //Temperature ratio after the shock in K
+p5=2.407 //Stagnation pressure after shock to Static pressure before shock from gas tables @My
+Poy_a=Px_a*p5 //Stagnation pressure after shock in kPa
+a3=1.204 //Ratio of area after shock to throat area after shock from isentropic gas tables @My
+At2_a=(Ay_a/a3)*10^4 //Throat area at exit in m^2, calculation mistake in textbook
+a4=A2/At2_a //Ratio of areas to find gas tables
+M2_a=0.2 //Exit mach number at section-A from gas tables @a4
+p5=0.973 //ratio of exit pressure to stagnation pressure after shock from gas tables
+P2_a=p5*Poy_a //exit pressure in kPa
+//Sub-division (b)
+a5=Ax/At //Ratio of area before shock to critical area
+Mx_b=1.4 //Mach number at section-B from gas tables @a5
+p6=0.314 //Ratio of upstram of shock to stagnation pressures from isentropic gas tables @Mx_b
+Px_b=Po1*p6 //Pressure upstram of shock in kPa
+t4=0.718 //Ratio of upstram of shock to stagnation temperature from isentropic gas tables @Mx_b
+Tx_b=To1*t4 //Temperature upstram of shock in K
+p20=3.049 //Stagnation pressure ratio after shock to Static pressure before shock from gas tables
+Poy_b=Px_b*p20 //Stagnation pressure after shock in kPa
+My_b=0.735 //Mach number downstream of shock from normal shock gas tables @Mx_b
+p7=2.085 //Static pressure ratio after and before the shock from gas tables @My_b
+Py_b=Px_b*p7 //Static pressure after shock in kPa
+t5=1.260 //Temperature ratio after and before the shock from gas tables @My_b
+Ty_b=Tx_b*t5 //Temperature after the shock in K
+a6=1.071 //Ratio of area after shock to throat area after shock from isentropic gas tables My_b=0.735
+At2_b=Ay/a6 //Throat area at exit in m^2
+a7=A2/At2_b //Ratio of areas
+M2_b=0.21 //Exit mach number at section-B from gas tables @a7
+p8=0.9697 //ratio of exit pressure to stagnation pressure after shock from gas tables
+P2_b=p8*Poy_b //exit pressure in kPa
+//Sub-division (c)
+p9=Px/Po1 //Ratio of upstram of shock to stagnation pressures
+Mx_c=1.65 //Mach number at section-B from gas tables @p9
+a8=1.292 //Ratio of area before shock to critical area from gas tables @p9
+Ax_c=At*a8*10^4 //Area before shock in cm^2
+t6=0.647 //Ratio of upstram of shock to stagnation temperature from isentropic gas tables @p9
+Tx_c=To1*t6 //Temperature upstram of shock in K
+My_c=0.654 //Mach number downstream of shock from normal shock gas tables @Mx_c
+p10=3.0095 //Static pressure ratio after and before the shock from gas tables @My_c
+Py_c=Px*p10 //Pressure downstram of shock in kPa
+t7=1.423 //Temperature ratio after and before the shock from gas tables @My_c
+Ty_c=Tx_c*t7 //Temperature after the shock in K
+p12=4 //Stagnation pressure after shock to Static pressure before shock from gas tables @Mx_c
+Poy_c=Px*p12 //Stagnation pressure after shock in kPa
+a9=1.136 //Ratio of area after shock to throat area after shock from gas tables My_c=0.654
+At2_c=Ax_c/a9 //Throat area at exit in m^2
+a8=A2/At2_c //Ratio of areas
+M2_c=0.23 //Exit mach number at section-B from gas tables @a8
+p11=0.964 //ratio of exit pressure to stagnation pressure after shock from gas tables
+P2_c=p11*Poy_c //exit pressure in kPa
+//Sub-division (D)
+p13=Poy/Po1 //Pressure ratio, Since Pox=Po1
+Mx_d=2.04 //Mach number upstream of shock from gas tables @p13
+My_d=0.571 //Mach number downstream of shock from gas tables @p13
+p14=4.688 //Static pressure ratio after and before the shock from gas tables @My_d
+t8=1.72 //Temperature ratio after and before the shock from gas tables @My_d
+p15=5.847 //Stagnation pressure after shock to Static pressure before shock from gas tables @Mx_d
+p16=0.120 //Ratio of upstram of shock to stagnation pressures from isentropic tables @Mx_d
+Px_d=Po1*p16 //Pressure upstram of shock in kPa
+t9=0.546 //Ratio of upstram of shock to stagnation temperature from isentropic gas tables @Mx_d
+Tx_d=To1*t9 //Temperature upstram of shock in K
+p21=4.688 //Static pressure ratio after and before the shock from gas tables
+Py_d=Px_d*p21 //Pressure downstram of shock in kPa
+t12=1.72 //Ratio of upstram of shock to stagnation temperature from isentropic gas tables
+Ty_d=Tx_d*t12 //Temperature after the shock in K
+a9=1.745 //Ratio of area before shock to throat area from isentropic gas tables
+Ax_d=At*a9*10^4 //Area before shock in cm^2
+a10=1.226 //Ratio of area after shock to throat area after shock from isentropic tables @My_d
+At2_d=(Ax_d/a10) //Throat area at exit in cm^2
+a11=A2/At2_d //Ratio of areas
+M2_d=0.29 //Exit mach number at section-B from gas tables @a11
+p17=0.943 //ratio of exit pressure to stagnation pressure after shock from gas tables
+P2_d=p17*Poy //exit pressure in kPa
+//Sub-division (e)
+a12=Ax/At //Ratio of areas
+Mx_e=2.62 //Mach number upstream of shock from gas tables @a12
+t10=0.421 //Ratio of upstram of shock to stagnation temperature from isentropic gas tables
+Tx_e=To1*t10 //Temperature upstram of shock in K
+p18=0.0486 //Ratio of upstram of shock to stagnation pressures from isentropic tables @Mx_e
+Px_e=p18*Po1 //Pressure upstram of shock in kPa
+My_e=0.502 //Mach number downstream of shock from gas tables @Mx_e
+p19=7.842 //Static pressure ratio after and before the shock from gas tables @My_e
+Py_e=Px_e*p19 //Pressure downstram of shock in kPa
+P2_e=Py_e //Exit pressure in kPa
+t11=2.259 //Temperature ratio after and before the shock from gas tables @My_d
+Ty_e=Tx_e*t11 //Temperaure downstram of shock in K
+T2_e=Ty_e //Exit temperature in K
+
+//Output
+printf('At throat:\n Mass flow rate is %3.2f kg/s\n Area at throat is %3.5f m^2\n Pressure is %3i kPa\n Temperature is %3.1f K\n Velocity is %3.1f m/s\n (a)At section (A):\n Pressure upstream is %3i kPa\n Temperature upstream is %3.1f K\n Mack number downstream is %3.2f\n Pressure downstream is %3.3f kPa\n Temperature downstream is %3.3f K\n Stagnation pressure downstream is %3.1f kPa\n Area is %3.3f cm^2\n At exit:\n Mach number is %3.1f\n Pressure is %3.1f kPa\n (b)At section (B):\n Pressure upstream is %3i kPa\n Temperature upstream is %3.1f K\n Mack number upstream is %3.1f\n Mack number downstream is %3.3f\n Pressure downstream is %3.2f kPa\n Temperature downstream is %3.2f K\n Stagnation pressure downstream is %3.1f kPa\n Area is %3.3f cm^2\n At exit:\n Mach number is %3.2f\n Pressure is %3.1f kPa\n (c)At section (C):\n Area upstream is %3.2f cm^2\n Temperature upstream is %3.1f K\n Mack number upstream is %3.2f\n Mack number downstream is %3.3f\n Pressure downstream is %3.2f kPa\n Temperature downstream is %3.2f K\n Stagnation pressure downstream is %3i kPa\n Area is %3.4f cm^2\n At exit:\n Mach number is %3.2f\n Pressure is %3.1f kPa\n (d)At section (D):\n Pressure upstream is %3i kPa\n Temperature upstream is %3.1f K\n Area upstream is %3.3f cm^2\n Mack number upstream is %3.2f\n Mack number downstream is %3.2f\n Pressure downstream is %3.2f kPa\n Temperature downstream is %3.2f K\n Area is %3.3f cm^2\n At exit:\n Mach number is %3.2f\n Pressure is %3.2f kPa\n (e)At section (E):\n Pressure upstream is %3.1f kPa\n Temperature upstream is %3.1f K\n Mack number upstream is %3.2f\n Mack number downstream is %3.3f\n Pressure downstream is %3.1f kPa\n Temperature downstream is %3.2f K\n At exit:\n Temperature is %3.2f K\n Pressure is %3.1f kPa\n',m,At,Pt,Tt,Ct,Px_a,Tx_a,My_a,Py_a,Ty_a,Poy_a,At2_a,M2_a,P2_a,Px_b,Tx_b,Mx_b,My_b,Py_b,Ty_b,Poy_b,At2_b,M2_b,P2_b,Ax_c,Tx_c,Mx_c,My_c,Py_c,Ty_c,Poy_c,At2_c,M2_c,P2_c,Px_d,Tx_d,Ax_d,Mx_d,My_d,Py_d,Ty_d,At2_d,M2_d,P2_d,Px_e,Tx_e,Mx_e,My_e,Py_e,Ty_e,T2_e,P2_e)
diff --git a/2126/CH5/EX5.14/14.sce b/2126/CH5/EX5.14/14.sce new file mode 100755 index 000000000..b3bace8ac --- /dev/null +++ b/2126/CH5/EX5.14/14.sce @@ -0,0 +1,35 @@ +clc
+clear
+
+//Input data
+T=300 //Temperature in K
+P=1.01325*10^5 //Absolute pressure in Pa
+k=1.4 //Adiabatic constant
+R=287 //Specific gas constant in J/kg-K
+C_1=60 //Velocity of air in m/s
+C_2=200 //Velocity of air in m/s
+C_3=500 //Velocity of air in m/s
+d_hg=13600 //Density of mercury in kg/m^3
+g=9.81 //Acceleration due to gravity in m/s^2
+
+//Calculation
+a=sqrt(k*R*T) //Sound velocity in m/s
+M_1=C_1/a //Mach number
+dP1=(P*C_1^2)/(2*R*T) //Difference in mercury levels in Pa
+dP1_hg=(dP1/(d_hg*g))*1000 //Difference in mercury levels in mm of Hg
+M_2=C_2/a //Mach number
+p1=(1+((k-1)/2)*M_2^2)^(k/(k-1)) //Stagnation to static pressure ratio
+Po=p1*P //Stagnation pressure in Pa
+dP2=abs(Po-P) //Difference in mercury levels in Pa
+dP2_hg=(dP2/(d_hg*g))*1000 //Difference in mercury levels in mm of Hg
+M_3=C_3/a //Mach number & M_3=Mach number just before shock
+My=0.723 //Mach number just after shock
+p1=2.2530 //Ratio of pressure after shock to before shock from gas tables @My
+Py=p1*P //Pressure after shock in Pa
+p2=0.706 //Ratio of pressure after shock to Stagnation pressure from gas tables @My
+Po=Py/p2 //Stagnation pressure in Pa
+dP3=Po-Py //Difference in mercury levels in Pa
+dP3_hg=(dP3/(d_hg*g))*1000 //Difference in mercury levels in mm of Hg
+
+//Output
+printf('Difference in mercury levels at velocity equal to:\n (A)%2i m/s is %3.3f mm of Hg\n (B)%3i m/s is %3.1f mm of Hg\n (C)%3i m/s is %3i mm of Hg',C_1,dP1_hg,C_2,dP2_hg,C_3,dP3_hg)
diff --git a/2126/CH5/EX5.15/15.sce b/2126/CH5/EX5.15/15.sce new file mode 100755 index 000000000..d30f0bb73 --- /dev/null +++ b/2126/CH5/EX5.15/15.sce @@ -0,0 +1,21 @@ +clc
+clear
+
+//Input data
+Px=16 //Pressure before the shock in kPa
+Poy=70 //Stagnation pressure after shock in kPa
+To=300+273 //Stagnation temperature in K
+k=1.4 //Adiabatic constant
+
+//Calculation
+p1=Poy/Px //Pressure ratio
+Mx=1.735 //Mach number upstream of shock
+My=0.631 //Mach number downstream of shock
+p2=0.84 //Ratio of stagnation pressures after and before shock from gas tables
+t1=1.483 //Temperature ratio after and before shock from gas tables
+Tx=To/(1+((k-1)/2)*Mx^2) //Temperature upstream of shock in K
+Ty=Tx*t1 //Temperature downstream of shock in K
+Pox=Poy/p2 //Stagnation pressure before shock in kPa
+
+//Output
+printf('(A)Mach number of the tunnal is Mx=%3.3f (My=%3.3f)\n (B)Upstream of the tube:\n Static temperature is %3i K\n Total pressure is %3.1f kPa\n (C)Downstream of the tube:\n Static temperature is %3i K\n Total pressure is %3i kPa',Mx,My,Tx,Pox,Ty,Poy)
diff --git a/2126/CH5/EX5.16/16.sce b/2126/CH5/EX5.16/16.sce new file mode 100755 index 000000000..700717d05 --- /dev/null +++ b/2126/CH5/EX5.16/16.sce @@ -0,0 +1,22 @@ +clc
+clear
+
+//Input data
+Py=455 //Pressure downstream of shock in kPa
+Ty=65+273 //Temperature downstream of shock in K
+dP=65 //Difference between dynamic and static pressure in kPa
+k=1.4 //Adiabatic constant
+R=287 //Specific gas constant in J/kg-K
+
+//Calculation
+Poy=dP+Py //Stagnation pressure after shock in kPa
+p1=Py/Poy //Pressure ratio
+My=0.44 //Mach number downstream of shock from isentropic gas tables @p1
+Mx=3.8 //Mach number upstream of shock from normal shock gas tables @My
+t1=3.743 //Temperature ratio after and before the shock from gas tables @My
+Tx=Ty/t1 //Temperature before the shock in K
+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
+
+//Output
+printf('(A)Mach number is Mx=%3.1f (My=%3.2f)\n (B)Velocity is %3.2f m/s',Mx,My,Cx)
diff --git a/2126/CH5/EX5.17/17.sce b/2126/CH5/EX5.17/17.sce new file mode 100755 index 000000000..af5e0e880 --- /dev/null +++ b/2126/CH5/EX5.17/17.sce @@ -0,0 +1,30 @@ +clc
+clear
+
+//Input data
+k=1.4 //Adiabatic constant
+Px=1.01325 //Pressure before the shock in bar
+Tx=15+273 //Temperature before the shock in K
+Py=13.789 //Pressure just after the shock in bar
+R=287 //Specific gas constant in J/kg-K
+
+//Calculation
+p1=Py/Px //Pressure ratio
+Mx=3.47 //Mach number upstream of shock from normal shock gas tables @p1
+My=0.454 //Mach number downstream of shock from isentropic gas tables @p1
+t1=3.213 //Temperature ratio after and before the shock from gas tables @Mx
+Ty=Tx*t1 //Temperature downstream of shock in K
+p2=15.574 //Stagnation pressure after shock to Static pressure before shock from gas tables @Mx
+Poy=Px*p2 //Stagnation pressure after shock in bar
+ax=sqrt(k*R*Tx) //Velocity of sound before the shock in m/s
+Cx=Mx*ax //Velocity of air before the shock in m/s
+Csh=Cx //Since Csh=Cx, see dig.
+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
+C_y=Cx-Cy //Air velocity just inside the shock in m/s
+P_y=Py //Pressure of air in bar, Since a powerful explosion creates a brief but intense blast wind as it passes
+a_y=sqrt(k*R*Ty) ////Velocity of sound after the shock in m/s
+M_y=C_y/a_y //Mach number
+
+//Output
+printf('(A)Shock speed is %3.2f m/s\n (B)Air velocity just inside the shock is %3.2f m/s',Cx,C_y)
diff --git a/2126/CH5/EX5.18/18.sce b/2126/CH5/EX5.18/18.sce new file mode 100755 index 000000000..ea85c96e3 --- /dev/null +++ b/2126/CH5/EX5.18/18.sce @@ -0,0 +1,24 @@ +clc
+clear
+
+//Input data
+T=300 //Temperature in K
+P=1.5 //Pressure in bar
+C_y=150 //Air velocity just inside the shock in m/s
+k=1.4 //Adiabatic constant
+R=287 //Specific gas constant in J/kg-K
+
+//Calculation
+ax=sqrt(k*R*T) //Velocity of sound before the shock in m/s
+Mx=sqrt(((C_y*(k+1))/(2*ax))+1) //Mach number before the shock
+My=0.79 ////Mach number after the shock from normal shock gas tables
+Cx=Mx*ax //Velocity of gas before the shock in m/s
+p1=1.775 //Stagnation pressure ratio after and before the shock from gas tables @My
+Py=P*p1 //Pressure just after the shock in bar
+t1=1.1845 //Temperature ratio after and before the shock from gas tables @My
+Ty=T*t1 //Temperature ratio after the shock in K
+ay=sqrt(k*R*Ty) //Velocity of sound after the shock in m/s
+Csh=My*ay //Speed of the wave in m/s
+
+//Output
+printf('(A)Speed of the wave is %3.1f m/s\n (B)At rest condition:\n Pressure is %3.4f bar\n Temperature is %3.2f K',Csh,Py,Ty)
diff --git a/2126/CH5/EX5.19/19.sce b/2126/CH5/EX5.19/19.sce new file mode 100755 index 000000000..52caef4be --- /dev/null +++ b/2126/CH5/EX5.19/19.sce @@ -0,0 +1,33 @@ +clc
+clear
+
+//Input data
+Mx=2 //Mach number before the shock
+a1=3 //Diffuser area ratio
+Pox=0.1 //Stagnation pressure before shock in bar
+Tx=300 //Temperature before the shock in K
+k=1.4 //Adiabatic constant
+
+//Calculation
+t1=0.555 //Static to stagnation temperature ratio before shock from isentropic gas tables @Mx,k=1.4
+Tox=Tx/t1 //Stagnation temperature before shock in K
+p1=0.128 //Static to stagnation pressure ratio before shock from isentropic gas tables @Mx,k=1.4
+Px=Pox*p1 //Pressure before the shock in bar
+My=0.577 //Mach number after the shock
+p2=4.5 //Pressure ratio after and before the shock from gas tables @Mx
+Py=Px*p2 //Pressure just after the shock in bar
+t2=1.687 //Temperature ratio after and before the shock from gas tables @Mx
+Ty=Tx*t2 //Temperature ratio after the shock in K
+p3=0.721 //Stagnation pressure ratio after and before shock from gas tables @Mx
+Poy=Pox*p3 //Stagnation pressure after shock in kPa
+a2=1.2195 //Ratio of area after shock to throat area after shock from gas tables @My
+a3=a2*a1 //Ratio of exit area to throat area at exit
+M2=0.16 //Exit mach number from gas tables @a3
+t3=0.9946 //Static to stagnation temperature ratio at exit from isentropic gas tables @Mx
+T2=Tox*t3 //Exit Temperature in K, Since Tox=Toy=T02 in case of diffuser
+p4=0.982 //Static to stagnation pressure ratio at exit from isentropic gas tables @Mx
+P2=Poy*p4 //Exit pressure in bar, Calculation mistake in textbook
+eff=((((Tox/Tx)*(Poy/Pox)^((k-1)/k))-1)/(((k-1)/2)*Mx^2))*100 //Diffuser efficiency including shock in percent
+
+//Output
+printf('(A)At the diffuser exit:\n Mach number is %3.2f\n Pressure is %3.3f bar\n Temperature is %3.2f K\n (B)Diffuser efficiency including shock is %3.3f percent',M2,P2,T2,eff)
diff --git a/2126/CH5/EX5.2/2.sce b/2126/CH5/EX5.2/2.sce new file mode 100755 index 000000000..b9254b448 --- /dev/null +++ b/2126/CH5/EX5.2/2.sce @@ -0,0 +1,34 @@ +clc
+clear
+
+//Input data
+Tx=350 //Temperature before the shock in K
+Px=137.8 //Pressure before the shock in kPa
+Cx=750 //Velocity before the shock in m/s
+k=1.4 //Adiabatic constant
+R=287 //Specific gas constant in J/kg-K
+
+//Calculation
+ax=sqrt(k*R*Tx) //Velocity of sound before the shock in m/s
+Mx=Cx/ax //Mach number before the shock
+My=0.577 //Mach number after the shock from gas tables @Mx
+p1=4.5 //Static pressure ratio after and before the shock from gas tables @My
+Py=Px*p1 //Static pressure after shock in kPa
+t1=1.687 //Temperature ratio after and before the shock from gas tables @My
+Ty=Tx*t1 //Temperature ratio after the shock in K
+p2=5.641 //Stagnation pressure after shock to Static pressure before shock from gas tables @My
+Poy=Px*p2 //Stagnation pressure after shock in kPa
+p3=0.721 //Stagnation pressure ratio after and before the shock from gas tables @My
+Pox=Poy/p3 //Stagnation pressure before shock in kPa
+ds=R*log(1/p3) //Change in entropy in J/kg-K
+t2=0.555 //Static to Stagnation temperature ratio before shock from isentropic gas tables @Mx,k=1.4
+Tox=Tx/t2 //Stagnation temperature before shock in K
+p4=0.128 //Static to Stagnation pressure ratio from isentropic gas tables @Mx,k=1.4
+Pox=Px/p4 //Stagnation pressure in kPa
+t4=0.937 //Static to Stagnation temperature ratio before shock from normal shock gas tables @Mx,k=1.4 (Tox=Toy Checked)
+Toy=Ty/t4 //Stagnation temperature after shock in K
+ay=sqrt(k*R*Ty) //Velocity of sound after the shock in m/s
+Cy=(My*ay) //Velocity of gas after the shock in m/s
+
+//Output
+printf('(A)At inlet to shock:\n Stagnation pressure is %3.1f kPa\n Stagnation temperature is %3.2f K\n Mach number is %3.0f\n (B)After shock:\n Stagnation pressure is %3.2f kPa\n Stagnation temperature is %3.2f K\n Static pressure is %3.1f kPa\n Static temperature is %3.2f K\n Mach number is %3.3f\n Velocity is %3.2f m/s\n (C)Change in entropy across the shock is %3.2f J/kg-K',Pox,Tox,Mx,Poy,Toy,Py,Ty,My,Cy,ds)
diff --git a/2126/CH5/EX5.20/20.sce b/2126/CH5/EX5.20/20.sce new file mode 100755 index 000000000..cda2a7de5 --- /dev/null +++ b/2126/CH5/EX5.20/20.sce @@ -0,0 +1,63 @@ +clc
+clear
+
+//Input data
+k=1.3 //Adiabatic constant
+R=287 //Specific gas constant in J/kg-K
+P1=1 //Inlet pressure in bar
+T1=400 //Inlet temperature in K
+D=0.3 //Duct diameter in m
+M1=2 //Mach number at entry
+Mx=1.5 //Mach number upstream of shock
+M2=1 //Mach number at outlet
+f=0.003 //Friction factor
+
+//Calculation
+d1=P1*10^5/(R*T1) //Density at inlet in kg/m^3
+a1=sqrt(k*R*T1) //Velocity of sound at inlet in m/s
+C1=M1*a1 //Gas velocity at inlet in m/s
+A1=%pi*D^2/4 //Inlet Area of the duct in m^2
+m=d1*C1*A1 //Mass flow rate in kg/s
+p1=0.131 //Static to Stagnation pressure ratio at entry from gas tables (M1,k=1.4,isentropic)
+Po1=P1/p1 //Stagantion pressure at inlet in bar
+t1=0.625 //Static to Stagnation temperature ratio at entry from gas tables (M1,k=1.4,isentropic)
+To1=T1/t1 //Stagnation temperature at inlet in K
+p2=0.424 //Static to Critical pressure ratio at inlet from gas tables,fanno flow tables @M1,k=1.4
+Pt1=P1/p2 //Critical pressure in bar
+p3=1.773 //Stagnation pressure ratio at entry to critical state from gas tables,fanno flow tables @M1,k=1.4
+Pto1=Po1/p3 //Stagnation pressure at critical state in bar
+t2=0.719 //Static to Critical temperature ratio at inlet from gas tables,fanno flow tables @M1,k=1.4
+Tt1=T1/t2 //Critical temperature in K
+X1=0.357 //frictional constant fanno parameter from gas tables,fanno flow tables @M1,k=1.4
+p4=0.618 //Ratio of Static pressure before shock to critical pressure at entry from gas tables (fanno flow,Mx,k=1.4)
+Px=Pt1*p4 //pressure before shock in bar
+t3=0.860 //Ratio of Static temperature before shock to critical temperature at entry from gas tables (fanno flow,Mx,k=1.4)
+Tx=Tt1*t3 //Temperature before shock in K
+p5=1.189 //Ratio of Stagnation pressure before shock to Stagnation pressure at critical state at entry from gas tables (fanno flow,Mx,k=1.4)
+Pox=Pto1*p5 //Stagnation pressure at critical state in bar
+Xx=0.156 //frictional constant fanno parameter from gas tables,fanno flow tables @Mx,k=1.4
+X3=X1-Xx //Overall frictional constant fanno parameter upstream of duct
+L1=(X3*D)/(4*f) //Length upstream of duct in m
+My=0.7 //Mach number downstream of shock from gas tables @Mx
+p6=2.413 //Static pressure ratio after and before the shock from gas tables @My
+Py=Px*p6 //Pressure after shock in bar
+t4=1.247 //Temperature ratio after and before the shock from gas tables @My
+Ty=Tx*t4 //temperature after shock in K
+p7=0.926 //Stagnation pressure ratio after and before the shock from gas tables @My
+Poy=Pox*p7 //Stagnation pressure after shock in bar
+p8=1.479 //Ratio of pressure after shock to pressure at critical state from gas tables @My
+Pt=Py/p8 //Critical pressure in bar
+p9=1.097 //Ratio of Stagnation pressure after shock to Stagnation pressure at critical state from gas tables @My
+Pot=Poy/p9 //Stagnation pressure at critical state in bar
+t5=1.071 //Ratio of temperature after shock to temperature at critical state from gas tables @My
+Tt=Ty/t5 //Critical temperature in K
+Xy=0.231 //frictional constant fanno parameter from gas tables,fanno flow tables @My,k=1.4
+X2=0 //frictional constant fanno parameter from gas tables,fanno flow tables @M=1,k=1.4
+X4=Xy-X2 //Overall frictional constant fanno parameter downstream of duct
+L2=(X4*D)/(4*f) //Length downstream of duct in m
+ds1=R*log(Po1/Pox) //Change of entropy upstream of the shock in J/kg-K
+ds2=R*log(Pox/Poy) //Change of entropy across the shock in J/kg-K
+ds3=R*log(Poy/Pot) //Change of entropy downstream of the shock in J/kg-K
+
+//Output
+printf('(A)Length of the duct upstream and downstream of the duct is %3.3f m and %3.3f m respectively\n (B)Mass flow rate of the gas is %3.3f kg/s\n (C)Change of entropy:\n Upstream of the shock is %3.2f J/kg-K\n Across the shock is %3.3f J/kg-K\n Downstream of the shock is %3.4f J/kg-K',L1,L2,m,ds1,ds2,ds3)
diff --git a/2126/CH5/EX5.21/21.sce b/2126/CH5/EX5.21/21.sce new file mode 100755 index 000000000..5bfbb2401 --- /dev/null +++ b/2126/CH5/EX5.21/21.sce @@ -0,0 +1,52 @@ +clc
+clear
+
+//Input data
+P1=0.685 //Inlet pressure in bar
+T1=310 //Inlet temperature in K
+D=0.6 //Duct diameter in m
+M1=3 //Mach number at entry
+Mx=2.5 //Mach number upstream of shock
+M2=0.8 //Mach number at outlet
+f=0.005 //Friction factor
+k=1.4 //Adiabatic constant
+R=287 //Specific gas constant in J/kg-K
+
+//Calculation
+d1=P1*10^5/(R*T1) //Density at inlet in kg/m^3
+a1=sqrt(k*R*T1) //Velocity of sound at inlet in m/s
+C1=M1*a1 //Air velocity at inlet in m/s
+A1=%pi*D^2/4 //Inlet Area of the duct in m^2
+m=d1*C1*A1 //Mass flow rate in kg/s
+p1=0.218 //Static to Critical pressure ratio at inlet from gas tables,fanno flow tables @M1,k=1.4
+Pt1=P1/p1 //Critical pressure in bar
+t1=0.428 //Static to Critical temperature ratio at inlet from gas tables,fanno flow tables @M1,k=1.4
+Tt1=T1/t1 //Critical temperature in K
+X1=0.522 //frictional constant fanno parameter from gas tables,fanno flow tables @M1,k=1.4
+p2=0.292 //Ratio of Static pressure before shock to critical pressure at entry from gas tables (fanno flow,Mx,k=1.4)
+Px=Pt1*p2 //pressure before shock in bar
+t2=0.533 //Ratio of Static temperature before shock to critical temperature at entry from gas tables (fanno flow,Mx,k=1.4)
+Tx=Tt1*t2 //Temperature before shock in K
+Xx=0.432 //frictional constant fanno parameter from gas tables,fanno flow tables @Mx,k=1.4
+X3=X1-Xx //Overall frictional constant fanno parameter upstream of duct
+L1=(X3*D)/(4*f) //Length upstream of duct in m
+My=0.513 //Mach number downstream of shock from gas tables @Mx
+p3=7.125 //Static pressure ratio after and before the shock from gas tables @My
+Py=Px*p3 //Pressure after shock in bar
+t3=2.138 //Temperature ratio after and before the shock from gas tables @My
+Ty=Tx*t3 //temperature after shock in K
+p4=2.138 //Ratio of pressure after shock to pressure at critical state from gas tables @My
+Pt=Py/p4 //Critical pressure in bar
+t4=1.143 //Ratio of temperature after shock to temperature at critical state from gas tables @My
+Tt=Ty/t4 //Critical temperature in K
+p5=1.289 //Ratio of pressure at exit to pressure at critical state from gas tables @M2
+P2=Pt*p5 //Exit pressure in bar
+t5=1.064 //Ratio of temperature at exit to temperature at critical state from gas tables @M2
+T2=Tt*t5 //Exit temperature in K
+Xy=1.069 //frictional constant fanno parameter from gas tables,fanno flow tables @My,k=1.4
+X2=0.073 //frictional constant fanno parameter from gas tables,fanno flow tables @M2,k=1.4
+X4=Xy-X2 //Overall frictional constant fanno parameter downstream of duct
+L2=(X4*D)/(4*f) //Length downstream of duct in m
+
+//Output
+printf('(A)Length L1 and L2 are %3.1f m and %3.2f m respectively\n (B)State of air at exit:\n Pressure is %3.3f bar\n Temperature is %3.1f K\n (C)Mass flow rate through the duct is %3.2f kg/s',L1,L2,P2,T2,m)
diff --git a/2126/CH5/EX5.22/22.sce b/2126/CH5/EX5.22/22.sce new file mode 100755 index 000000000..3dcfb24a0 --- /dev/null +++ b/2126/CH5/EX5.22/22.sce @@ -0,0 +1,36 @@ +clc
+clear
+
+//Input data
+At=24 //Throat area in cm^2
+A2=50 //Exit area in cm^2
+Po=700 //Stagnation pressure in kPa
+To=100+273 //Stagnation temperature in K
+Ax=34 //Area before the shock in cm^2
+Ay=34 //Area after the shock in cm^2
+
+//Calculation
+a1=Ax/At //Ratio of areas
+Mx=1.78 //Mach number upstream of shock from gas tables @a1
+t1=0.61212 //Ratio of temperature before shock to critical state from isentropic gas tables @Mx
+Tx=To*t1 //temperature before shock in K
+p1=0.179 //Ratio of pressure before shock to critical state from isentropic gas tables @Mx
+Px=Po*p1 //pressure before shock in kPa
+My=0.621 //Mach number downstream of shock from gas tables @Mx
+p2=3.5298 //Static pressure ratio after and before the shock from gas tables @My
+Py=Px*p2 //Pressure after shock in kPa
+t2=1.51669 //Temperature ratio after and before the shock from gas tables @My
+Ty=Tx*t2 //temperature after shock in K
+p3=4.578 //Ratio of Stagnation pressure after the shock to static pressure before shock from gas tables @My
+Po2=Px*p3 //Stagnation pressure at exit in bar
+a2=1.16565 //Ratio of area after shock to critical area across shock from isentropic gas tables @My
+At2=Ay/a2 //critical area at exit in cm^2
+a3=A2/At2 //Ratio of areas
+M2=0.36 //Exit mach number from gas tables (a3,k=1.4,isentropic)
+p4=0.914 //Static to Stagnation pressure ratio at exit from gas tables (a3,k=1.4,isentropic)
+P2=Po2*p4 //Stagnation pressure ratio at exit in kPa
+t3=0.975 //Static to Stagnation temperature ratio at exit from gas tables (a3,k=1.4,isentropic)
+T2=To*t3 //Stagnation temperature at exit in K
+
+//Output
+printf('(A)Properties of fluid just after shock:\n Mach number My=%3.3f\n Temperature is %3.2f K\n Pressure is %3.2f kPa\n (B)Exit mach number is %3.2f\n (C)Properties of fluid at exit:\n Pressure is %3i kPa\n Temperature is %3.3f K',My,Ty,Py,M2,P2,T2)
diff --git a/2126/CH5/EX5.23/23.sce b/2126/CH5/EX5.23/23.sce new file mode 100755 index 000000000..1a183c193 --- /dev/null +++ b/2126/CH5/EX5.23/23.sce @@ -0,0 +1,50 @@ +clc
+clear
+
+//Input data
+D=0.4 //Duct diameter in m
+Po=12 //Stagnation pressure in kPa
+To=600 //Stagnation temperature in K
+f=0.0025 //Friction factor
+M1=1.8 //Mach number at entry
+M2=1 //Mach number at outlet
+Mx=1.22 //Mach number upstream of shock
+
+//Calculations
+A2=%pi*D^2/4 //Exit area in cm^2
+p1=0.174 //Static to Stagnation pressure ratio at entry from gas tables (M1,k=1.4,isentropic)
+P1=Po*p1 //Inlet pressure in bar
+t1=0.607 //Static to Stagnation temperature ratio at entry from gas tables (M1,k=1.4,isentropic)
+T1=To*t1 //Inlet temperature in K
+a1=1.094 //Ratio of area at exit to critical area across shock from isentropic gas tables @M1,k=1.4
+Ax=A2/a1 //Area before the shock in cm^2
+Dt=sqrt((Ax*4)/(%pi))*10^2 //Duct diameter at throat in cm
+p2=0.474 //Static to Critical pressure ratio at inlet from gas tables,fanno flow tables @M1,k=1.4
+Pt=P1/p2 //Critical pressure in bar
+t2=0.728 //Static to Critical temperature ratio at inlet from gas tables,fanno flow tables @M1,k=1.4
+Tt=T1/t2 //Critical temperature in K
+X1=0.242 //frictional constant fanno parameter from gas tables,fanno flow tables @M1,k=1.4
+p3=0.788 //Ratio of Static pressure before shock to critical pressure at entry from gas tables (fanno flow,Mx,k=1.4)
+Px=Pt*p3 //pressure before shock in bar
+t3=0.925 //Ratio of Static temperature before shock to critical temperature at entry from gas tables (fanno flow,Mx,k=1.4)
+Tx=Tt*t3 //Temperature before shock in K
+Xx=0.039 //frictional constant fanno parameter from gas tables,fanno flow tables @Mx,k=1.4
+X3=X1-Xx //Overall frictional constant fanno parameter upstream of duct
+L1=(X3*D)/(4*f) //Length upstream of duct in m
+My=0.83 //Mach number downstream of shock from gas tables @Mx
+p4=1.57 //Static pressure ratio after and before the shock from gas tables @My
+Py=Px*p4 //Pressure after shock in bar
+t4=1.141 //Temperature ratio after and before the shock from gas tables @My
+Ty=Tx*t4 //temperature after shock in K
+p5=1.2375 //Ratio of pressure after shock to pressure at critical state from gas tables @My
+Pt=Py/p5 //Critical pressure in bar
+t5=1.055 //Ratio of temperature after shock to temperature at critical state from gas tables @My
+Tt=Ty/t5 //Critical temperature in K
+Xy=0.049 //frictional constant fanno parameter from gas tables,fanno flow tables @My,k=1.4
+X2=0 //frictional constant fanno parameter from gas tables,fanno flow tables @M=1,k=1.4
+X4=Xy-X2 //Overall frictional constant fanno parameter downstream of duct
+L2=(X4*D)/(4*f) //Length downstream of duct in m
+L=L1+L2 //Length of duct in m
+
+//Output
+printf('(A)Length of the pipe is %3.2f m\n (B)Diameter of the nozzle throat is %3.3f cm\n (C)At the pipe exit:\n Pressure is %3.3f bar\n Temperature is %3.2f K',L,Dt,Pt,Tt)
diff --git a/2126/CH5/EX5.24/24.sce b/2126/CH5/EX5.24/24.sce new file mode 100755 index 000000000..69a5ecdb1 --- /dev/null +++ b/2126/CH5/EX5.24/24.sce @@ -0,0 +1,49 @@ +clc
+clear
+
+//Input data
+Po=700 //Stagnation pressure in kPa
+To=500+273 //Stagnation temperature in K
+a1=3.5 //Ratio of exit area to throat area
+m=5.5 //Mass flow rate in kg/s
+Cp=1.005 //Specific heat capacity at constant pressure in kJ/kg-K
+k=1.4 //Adiabatic constant
+
+//Calculation
+My=1/sqrt(k) //Mach number downstream of shock
+M2=2.8 //Mach number at outlet from gas tables @a1
+t1=0.389 //Static to Stagnation temperature ratio at exit from gas tables (M1,k=1.4,isentropic)
+T2=To*t1 //Exit temperature in K
+p1=0.0369 //Static to Stagnation pressure ratio at exit from gas tables (M1,k=1.4,isentropic)
+P2=Po*p1 //exit pressure in kPa
+p2=0.2 //Ratio of pressure at exit to pressure at critical state at exit from Rayleigh flow gas tables @M2
+Pt2=P2/p2 //Exit pressure at critical state in kPa
+t2=0.315 //Ratio of temperature at exit to temperature at critical state at exit from Rayleigh flow gas tables @M2
+Tt2=T2/t2 //Exit temperature at critical state in K
+t3=0.674 //Ratio of Stagnation temperature at exit to stagnation temperature at critical state at exit from Rayleigh flow gas tables @M2
+Tto2=To/t3 //Exit stagnation temperature at critical state in K
+Mx=1.2 //Mach number upstream of shock from gas tables @My
+p3=0.796 //Ratio of Static pressure before shock to critical pressure at exit from gas tables (Rayleigh flow,Mx,k=1.4)
+Px=Pt2*p3 //Static pressure before shock in kPa
+t4=0.912 //Ratio of Static temperature before shock to critical temperature at exit from gas tables (Rayleigh flow,Mx,k=1.4)
+Tx=Tt2*t4 //Static temperature before shock in K
+t5=0.978 //Ratio of Stagnation temperature before shock to critical Stagnation temperature at exit from gas tables (Rayleigh flow,Mx,k=1.4)
+Tox=Tto2*t5 //Stagnation temperature before shock in K
+p4=1.513 //Static pressure ratio after and before the shock from gas tables @Mx
+Py=Px*p4 //Pressure after shock in kPa
+t6=1.128 //Temperature ratio after and before the shock from gas tables @Mx
+Ty=Tx*t6 //temperature after shock in K
+t7=0.875 //Ratio of Temperature after the shock to Stagnation temperature after shock from gas tables @Mx
+Toy=Ty/t7 //Stagnation temperature after shock in K,
+p5=1.207 //Ratio of pressure after shock to pressure at critical state from gas tables @My
+Pt=Py/p5 //Critical pressure in kPa
+t8=1.028 //Ratio of temperature after shock to temperature at critical state from gas tables @My
+Tt=Ty/t8 //Critical temperature in K
+t9=0.978 //Ratio of Stagnation temperature after shock to Stagnation temperature at critical state from gas tables @My
+Tot=Toy/t9 //Stagnation temperature at critical state in K, calculation mistake in textbbok
+q1=Cp*(Tox-To) //Amount of heat added in upstream of shock in kJ/s
+q2=Cp*(Tot-Toy) //Amount of heat added in downstream of shock in kJ/s
+Q=m*(q1+q2) //Amount of heat added in two pipe section in kJ/s
+
+//Output
+printf('(A)Amount of heat added in two pipe section is %3.2f kJ/s\n (B)Properties:\n Upstream of shock:\n Pressure is %3.1f kPa\n Temperature is %3.3f K\n Stagnation temperature is %3.2f K\n Mach number is %3.1f\n Downstream of shock:\n Pressure is %3.3f kPa\n Temperature is %3.3f K\n Stagnation temperature is %3.1f K\n Mach number is %3.3f\n At the throat:\n Pressure is %3.2f kPa\n Temperature is %3.3f K\n Stagnation temperature is %3.2f K\n At the exit:\n Pressure is %3.2f kPa\n Temperature is %3.2f K\n Mach number is %3.2f',Q,Px,Tx,Tox,Mx,Py,Ty,Toy,My,Pt,Tt,Tot,P2,T2,M2)
diff --git a/2126/CH5/EX5.25/25.sce b/2126/CH5/EX5.25/25.sce new file mode 100755 index 000000000..4425d3e60 --- /dev/null +++ b/2126/CH5/EX5.25/25.sce @@ -0,0 +1,24 @@ +clc
+clear
+
+//Input data
+M1=2.8 //Inlet mach number
+sig=42 //Shock wave angle in degree
+Px=1 //Pressure upstream of shock in bar(Assuming)
+k=1.4 //Adiabatic constant
+
+//Calculations
+Mx=M1*sind(sig) //Mach number before the shock
+My=0.601 //Mach number after the shock from gas tables @Mx
+p1=3.98 //Static pressure ratio after and before the shock from gas tables @Mx
+Py=Px*p1 //Pressure after shock in bar
+p2=4.994 //Stagnation pressure after shock to Static pressure before shock from gas tables @Mx
+Poy=Px*p2 //Stagnation pressure after shock in bar
+p3=0.788 //Stagnation pressure ratio after and before the shock from gas tables @Mx
+Pox=Poy/p3 //Stagnation pressure before shock in kPa
+dPl=Pox-Poy //Total pressure loss in bar
+def=atand(((M1^2*sind(2*sig))-(2/tand(sig)))/(2+(M1^2*(k+cosd(2*sig))))) //Deflection angle in degree
+M2=My/(sind(sig-def)) //Downstream mach number
+
+//Output
+printf('(A)Deflection angle is %3i degree\n (B)Downstream mach number is %3.3f\n (C)Static pressure is %3.3f bar\n (D)Total pressure loss is %3.3f bar',def,M2,Py,dPl)
diff --git a/2126/CH5/EX5.26/26.sce b/2126/CH5/EX5.26/26.sce new file mode 100755 index 000000000..1e898702b --- /dev/null +++ b/2126/CH5/EX5.26/26.sce @@ -0,0 +1,22 @@ +clc
+clear
+
+//Input data
+M1=2 //Inlet mach number
+sig=40 //Shock wave angle in degree
+Px=0.5 //Pressure upstream of shock in bar
+Tx=273 //Temperature upstream of shock in K
+k=1.4 //Adiabatic constant
+
+//Calculation
+Mx=M1*sind(sig) //Mach number before the shock
+My=0.796 //Mach number after the shock from gas tables @Mx
+p1=1.745 //Static pressure ratio after and before the shock from gas tables @Mx
+Py=p1*Px //Pressure after shock in bar
+t1=1.178 //Static temperature ratio after and before the shock from gas tables @Mx
+Ty=Tx*t1 //Temperature after shock in K
+Ws=atand(((M1^2*sind(2*sig))-(2/tand(sig)))/(2+(M1^2*(k+cosd(2*sig))))) //Wedge semi angle in degree
+W=2*Ws //Wedge angle in degree
+
+//Output
+printf('(A)Static pressure is %3.4f bar\n (B)Temperature behind the wave is %3.2f K\n (C)Mach number of flow passing over wedge is %3.3f\n (D)Wedge angle is %3.2f degree',Py,Ty,Mx,W)
diff --git a/2126/CH5/EX5.27/27.sce b/2126/CH5/EX5.27/27.sce new file mode 100755 index 000000000..bc88759f0 --- /dev/null +++ b/2126/CH5/EX5.27/27.sce @@ -0,0 +1,40 @@ +clc
+clear
+
+//Input data
+def=15
+M1=2
+k=1.4
+
+//Calculation
+//Using relation def=atand(((M1^2*sind(2*sig))-(2/tand(sig)))/(2+(M1^2*(k+cosd(2*sig))))) and converting into 6th degree polynomial of sind(sig)=x
+C=((2*tand(def))+((M1^2)*k*tand(def))+((M1^2)*tand(def))) //Constant value for convenience
+D=(2*M1^2*tand(def)) //Constant value for convenience
+a=4 //Value of constant in polynomial
+b=0 //Coefficient of power 1 i.e. x^1
+c=(4+C^2+(8*M1^2)) //Coefficient of power 2 i.e. x^2
+d=0 //Coefficient of power 3 i.e. x^3
+e=(4*(M1^4))+(2*C*D)+(8*M1^2) //Coefficient of power 4 i.e. x^4
+f=0 //Coefficient of power 5 i.e. x^5
+g=(4*M1^4)+D^2 //Coefficient of power 6 i.e. x^6
+p4=poly([a b -c -d e f -g],'x','c') //Expression for solving 6th degree polynomial
+disp('Values for sine of wave angle are:\n')
+disp(roots(p4))
+sig1=asind(0.9842) //Strong shock wave angle in degree, nearer to 90 degree
+sig2=asind(0.7113) //Weak shock wave angle in degree, nearer to 45 degree
+//(a)Strong Shock Wave
+Mx_1=M1*sind(sig1) //Mach number before the shock of stong shock wave
+My_1=0.584 //Mach number after the shock from gas tables @Mx_1
+p1=4.315 //Static pressure ratio after and before the shock from gas tables @Mx_1
+t1=1.656 //Static temperature ratio after and before the shock from gas tables @Mx_1
+d1=p1/t1 //Density ratio after and before the shock of stong shock wave
+M2_1=My_1/(sind(sig1-def)) //Exit mach number of stong shock wave
+Mx_2=M1*sind(sig2) //Mach number before the shock of weak shock wave
+My_2=0.731 //Mach number after the shock from gas tables @Mx_2
+p2=2.186 //Static pressure ratio after and before the shock from gas tables @Mx_2
+t2=1.267 //Static temperature ratio after and before the shock from gas tables @Mx_2
+d2=p2/t2 //Density ratio after and before the shock of weak shock wave
+M2_2=My_2/(sind(sig2-def)) //Exit mach number of weak shock wave
+
+//Output
+printf('\nStrong Shock Wave:\n (A)Wave angle is %3.1f degree\n (B)Pressure ratio is %3.3f\n (C)Density ratio is %3.3f\n (D)Temperature ratio is %3.3f\n (E)Downstream Mach number is %3.3f\n Weak Shock Wave:\n (A)Wave angle is %3.1f degree\n (B)Pressure ratio is %3.3f\n (C)Density ratio is %3.3f\n (D)Temperature ratio is %3.3f\n (E)Downstream Mach number is %3.3f',sig1,p1,d1,t1,M2_1,sig2,p2,d2,t2,M2_2)
diff --git a/2126/CH5/EX5.28/28.sce b/2126/CH5/EX5.28/28.sce new file mode 100755 index 000000000..33e4574ed --- /dev/null +++ b/2126/CH5/EX5.28/28.sce @@ -0,0 +1,25 @@ +clc
+clear
+
+//Input data
+k=1.3 //Adiabatic constant
+P1=0.345 //Inlet pressure in bar
+T1=350 //Inlet temperature in K
+M1=1.5 //Inlet mach number
+P2=0.138 //Exit pressure in bar
+
+//Calculation
+p1=0.284 //Pressure ratio at entry from gas tables @M1,k=1.3
+Po=P1/p1 //Stagnation Pressure in bar
+t1=0.748 //Temperature ratio at entry from gas tables @M1,k=1.3
+To=T1/t1 //Stagnation temperature in K
+p2=P2/Po //Pressure ratio
+M2=2.08 //Final Mach number from isentropic gas tables @p2
+t2=0.606 //Temperature ratio at exit from gas tables @M2,k=1.3
+T2=To*t2 //The temperature of the gas in K
+w1=12.693 //Prandtl Merger function at M1
+w2=31.12 //Prandtl Merger function at M2
+def=w2-w1 //Deflection Angle in degree
+
+//Output
+printf('(A)Deflection Angle is %3.3f degree\n (B)Final Mach number is %3.2f\n (C)The temperature of the gas is %3.3f K',def,M2,T2)
diff --git a/2126/CH5/EX5.3/3.sce b/2126/CH5/EX5.3/3.sce new file mode 100755 index 000000000..185e68719 --- /dev/null +++ b/2126/CH5/EX5.3/3.sce @@ -0,0 +1,27 @@ +clc
+clear
+
+//Input data
+Tx=0+273 //Temperature before the shock in K
+Px=60 //Pressure before the shock in kPa
+Cx=497 //Air Velocity before the shock in m/s
+k=1.4 //Adiabatic constant
+R=287 //Specific gas constant in J/kg-K
+
+//Calculation
+ax=sqrt(k*R*Tx) //Velocity of sound before the shock in m/s
+Mx=Cx/ax //Mach number before the shock
+My=0.70109 //Mach number after the shock from gas tables @Mx
+p1=2.45833 //Static pressure ratio after and before the shock from gas tables @My
+Py= p1*Px //Static pressure after shock in kPa
+t1=1.32022 //Temperature ratio after and before the shock from gas tables @My
+Ty=Tx*t1 //Temperature ratio after the shock in K
+p2=3.41327 //Stagnation pressure after shock to Static pressure before shock from gas tables @My
+Poy=p2*Px //Stagnation pressure after shock in kPa
+p3=0.92979 //Stagnation pressure ratio after and before the shock from gas tables @My
+Pox=Poy/p3 //Stagnation pressure before shock in kPa
+ay=sqrt(k*R*Ty) //Velocity of sound after the shock in m/s
+Cy=ay*My //Velocity of air after the shock in m/s
+
+//Output
+printf('After shock:\n (A)Mach number is %3.5f\n (B)Velocity is %3.3f m/s\n (C)Stagnation pressure is %3.3f kPa\n',My,Cy,Poy)
diff --git a/2126/CH5/EX5.4/4.sce b/2126/CH5/EX5.4/4.sce new file mode 100755 index 000000000..cdd5373f8 --- /dev/null +++ b/2126/CH5/EX5.4/4.sce @@ -0,0 +1,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)
diff --git a/2126/CH5/EX5.5/5.sce b/2126/CH5/EX5.5/5.sce new file mode 100755 index 000000000..34fb891ee --- /dev/null +++ b/2126/CH5/EX5.5/5.sce @@ -0,0 +1,19 @@ +clc
+clear
+
+//Input data
+Mol=39.9 //Molar mass of a gas in kg/mol
+k=1.67 //Specific heat ratio
+Mx=2.5 //Mach number before the shock
+Px=40 //Pressure before the shock in kPa
+Tx=-20+273 //Temperature before the shock in K
+
+//Calculation
+My=0.554 //Mach number after the shock from gas tables @Mx
+p1=7.567 //Static pressure ratio after and before the shock from gas tables @My
+Py=p1*Px //Static pressure after shock in kPa
+t1=2.805 //Temperature ratio after and before the shock from gas tables @My
+Ty=Tx*t1 //Temperature ratio after the shock in K
+
+//Output
+printf('Downstream the normal shock:\n Mach number is %3.3f\n Pressure is %3.2f kPa\n Temperature is %3.3f K',My,Py,Ty)
diff --git a/2126/CH5/EX5.6/6.sce b/2126/CH5/EX5.6/6.sce new file mode 100755 index 000000000..48d7ee78d --- /dev/null +++ b/2126/CH5/EX5.6/6.sce @@ -0,0 +1,13 @@ +clc
+clear
+
+//Input data
+Mx=2 //Mach number before the shock
+Px=50 //Pressure before the shock in kPa
+
+//Calculation
+p1=6.335 //Stagnation pressure after shock to Static pressure before shock from gas tables @Mx
+Poy=p1*Px //Stagnation pressure after shock in kPa
+
+//Output
+printf('Pressure acting on the front of the body is %3.2f kPa',Poy)
diff --git a/2126/CH5/EX5.7/7.sce b/2126/CH5/EX5.7/7.sce new file mode 100755 index 000000000..3ffd55e82 --- /dev/null +++ b/2126/CH5/EX5.7/7.sce @@ -0,0 +1,56 @@ +clc
+clear
+
+//Input data
+Po=800 //Pressure in reservoir in kPa
+To=40+273 //Temperature in reservoir in K
+M2a=2.5 //Mach number at exit from diagram
+At=25 //Throat Area in cm^2
+Ax=40 //Area just before the shock in cm^2
+Ay=40 //Area just after the shock in cm^2
+k=1.4 //Adiabatic constant
+R=287 //Specific gas constant in J/kg-K
+
+//Calculation
+t1=0.834 //Ratio of critical temperature and stagnation temperature from gas tables @M=1
+Tt=To*t1 //Critical temperature in K
+p1=0.528 //Ratio of critical pressure and stagnation pressure from gas tables @M=1
+Pt=Po*p1 //Critical pressure in kPa
+dt=Pt*10^3/(R*Tt) //Density in kg/m^3, Pt in Pa
+at=sqrt(k*R*Tt) //Velocity of sound at throat in m/s
+Ct=at //Air Velocity of sound at throat in m/s
+m=dt*At*10^-4*Ct //Mass flow rate in kg/s
+p2=0.0585 //Ratio of exit to stagnation pressure from isentropic gas tables @M2=2.5
+a1=2.637 //Ratio of exit to critical area from isentropic gas tables @M2=2.5
+A2=a1*At //Exit area in cm^2
+a2=Ax/At //Area ratio
+M=1.94 //Mach number upstream of shock from gas tables @a2
+p3=0.140 //Ratio of upstram of shock to stagnation pressures from isentropic gas tables @M
+Px=p3*Po //Pressure upstram of shock in kPa
+t2=0.570 //Ratio of upstram of shock to stagnation temperature from isentropic gas tables @M
+Tx=t2*To //Temperature upstram of shock in K
+My=0.588 //Mach number downstream of shock from normal shock gas tables @M
+p4=4.225 //Static pressure ratio after and before the shock from gas tables @My
+Py=Px*p4 //Static pressure after shock in kPa
+t3=1.639 //Temperature ratio after and before the shock from gas tables @My
+Ty=Tx*t3 //Temperature ratio after the shock in K
+p5=2.338 //Stagnation pressure after shock to Static pressure before shock from gas tables @My
+Poy=p5*Px //Stagnation pressure after shock in kPa
+p6=0.749 //Stagnation pressure ratio after and before the shock from gas tables @My
+Pox=Poy/p6 //Stagnation pressure before shock in kPa
+//Here At2=Aty, Po2=Poy, Toy=To2=To1=To
+p7=0.79 //Static to stagnation pressure ratio after shock from isentropic gas tables @My
+Po2=Py/p7 //Stagnation pressure at exit in kPa
+t4=0.935 //Static to stagnation temperature ratio after shock from isentropic gas tables @My
+To2=Ty/t4 //Stagnation temperature in K (checked)
+a3=1.2 //Ratio of areas after shock i.e. (Ay/At2)
+At2=Ay/a3 //Critical area after shock in cm^2
+a4=A2/At2 //Ratio of areas
+M2b=0.31 //Mach number at exit from gas tables @a4(as per section-b)
+p8=0.936 //Static to stagnation pressure ratio at exit from isentropic gas tables @M2b
+P2=Po2*p8 //Exit pressure in kPa
+t5=0.981 //Static to stagnation temperature ratio after shock from isentropic gas tables @M2b
+T2=To2*t5 //Exit temperature in K
+
+//Output
+printf('CASE-I:\n (A)Mass flow rate is %3.2f kg/s\n (B)Exit area is %3.1f cm^2\n CASE-II:\n (A)Temperature is %3.3f K\n (B)Pressure is %3.1f kPa',m,A2,T2,P2)
diff --git a/2126/CH5/EX5.8/8.sce b/2126/CH5/EX5.8/8.sce new file mode 100755 index 000000000..fda2ec93e --- /dev/null +++ b/2126/CH5/EX5.8/8.sce @@ -0,0 +1,27 @@ +clc
+clear
+
+//Input data
+Px=1 //Pressure before the shock in bar
+Tx=17+273 //Temperature before the shock in K
+Cx=500 //Air Velocity before the shock in m/s
+k=1.4 //Adiabatic constant
+R=287 //Specific gas constant in J/kg-K
+
+//Calculation
+ax=sqrt(k*R*Tx) //Velocity of sound before the shock in m/s
+Mx=Cx/ax //Mach number before the shock
+My=0.715 //Mach number after the shock from gas tables @Mx
+p1=2.335 //Static pressure ratio after and before the shock from gas tables @My
+Py=p1*Px //Static pressure after shock in bar
+t1=1.297 //Temperature ratio after and before the shock from gas tables @My
+Ty=Tx*t1 //Temperature ratio after the shock in K
+ay=sqrt(k*R*Ty) //Velocity of sound after the shock in m/s
+Cy=ay*My //Velocity of air after the shock in m/s
+C_y=Cx-Cy //Velocity of air in m/s
+M_y=C_y/ay //Mach number impared upstream of the wave front
+t2=0.939 //Static to stagnation temperature ratio after shock from isentropic gas tables @M_y
+T_oy=Ty/t2 //Stagnation temperature of air in K
+
+//Output
+printf('(A)Pressure is %3.3f bar\n (B)Temperature is %3.2f K\n (C)Velocity of air is %3.2f m/s\n (D)Stagnation temperature is %3.2f K\n (E)Mach number is %3.3f',Py,Ty,C_y,T_oy,M_y)
diff --git a/2126/CH5/EX5.9/9.sce b/2126/CH5/EX5.9/9.sce new file mode 100755 index 000000000..2acface67 --- /dev/null +++ b/2126/CH5/EX5.9/9.sce @@ -0,0 +1,27 @@ +clc
+clear
+
+//Input data
+Mx=3 //Mach number before the shock
+Tx=27+273 //Temperature before the shock in K
+Px=1 //Pressure before the shock in bar
+k=1.4 //Adiabatic constant
+R=287 //Specific gas constant in J/kg-K
+
+//Calculation
+My=0.475 //Mach number after the shock from gas tables @Mx
+p1=10.333 //Static pressure ratio after and before the shock from gas tables @My
+Py=p1*Px //Static pressure after shock in bar
+t1=2.679 //Temperature ratio after and before the shock from gas tables @My
+Ty=Tx*t1 //Temperature ratio after the shock in K
+p2=12.061 //Stagnation pressure after shock to Static pressure before shock from gas tables @My
+Poy=p2*Px //Stagnation pressure after shock in bar
+p3=0.328 //Stagnation pressure ratio after and before the shock from gas tables @My
+Pox=Poy/p3 //Stagnation pressure before shock in kPa
+ay=sqrt(k*R*Ty) //Velocity of sound after the shock in m/s
+Cy=ay*My //Velocity of air after the shock in m/s
+ds=R*log(1/p3) //Change in entropy in J/kg-K
+e=(Py-Px)/Px //Strength of shock
+
+//Output
+printf('(I)Downstream of the shock:\n (A)Pressure is %3.3f bar\n (B)Temperature is %3.1f K\n (C)Gas velocity is %3.2f m/s\n (D)Mach number is %3.3f\n (II)Total head pressure ratio is %3.3f\n (III)Entropy change across the shock is %3.3f J/kg-K\n (IV)Strength of the shock is %3.3f',Py,Ty,Cy,My,p3,ds,e)
|