summaryrefslogtreecommitdiff
path: root/3785/CH12
diff options
context:
space:
mode:
Diffstat (limited to '3785/CH12')
-rw-r--r--3785/CH12/EX12.1/Ex12_1.sce16
-rw-r--r--3785/CH12/EX12.10/Ex12_10.sce14
-rw-r--r--3785/CH12/EX12.2/Ex12_2.sce19
-rw-r--r--3785/CH12/EX12.3/Ex12_3.sce10
-rw-r--r--3785/CH12/EX12.4/Ex12_4.sce17
-rw-r--r--3785/CH12/EX12.5/Ex12_5.sce16
-rw-r--r--3785/CH12/EX12.6/Ex12_6.sce18
-rw-r--r--3785/CH12/EX12.7/Ex12_7.sce27
-rw-r--r--3785/CH12/EX12.8/Ex12_8.sce10
9 files changed, 147 insertions, 0 deletions
diff --git a/3785/CH12/EX12.1/Ex12_1.sce b/3785/CH12/EX12.1/Ex12_1.sce
new file mode 100644
index 000000000..88e59ce10
--- /dev/null
+++ b/3785/CH12/EX12.1/Ex12_1.sce
@@ -0,0 +1,16 @@
+// Example 12_1
+clc;funcprot(0);
+// Given data
+T=300;// Temperature in K
+R_a=287.0;// Gas constant for air in J/kg.K
+C_pbyR_a=3.5;
+R_h=2077;// Gas constant for helium in J/kg.K
+C_pbyR_h=2.5;
+
+// Calculation
+// (a)
+a=sqrt((C_pbyR_a/(C_pbyR_a-1))*R_a*T);// m/s
+printf("\n(a)The speed of sound in air,a=%3.1f m/s",a);
+// (b)
+a=sqrt((C_pbyR_h/(C_pbyR_h-1))*R_h*T);// m/s
+printf("\n(b)The speed of sound in helium,a=%4.0f m/s",a);
diff --git a/3785/CH12/EX12.10/Ex12_10.sce b/3785/CH12/EX12.10/Ex12_10.sce
new file mode 100644
index 000000000..284179459
--- /dev/null
+++ b/3785/CH12/EX12.10/Ex12_10.sce
@@ -0,0 +1,14 @@
+// Example 12_10
+clc;funcprot(0);
+// Given data
+u_0=100;// The average speed in m/s
+r=1.31;// The specific heat ratio
+a_0=446.1;// m/s
+
+// Calculation
+// (a)
+u_out_1=((2/(r+1))*a_0)+(((r-1)/(r+1))*u_0);// The outflow speed of section 1 in m/s
+mfr_ratio_1=(u_out_1/a_0)^(2/(r-1))*(u_out_1/u_0);// The mass flow rate ratio of section 1
+u_out_2=-(((2/(r+1))*a_0)-(((r-1)/(r+1))*u_0));// The outflow speed of section 2 in m/s
+mfr_ratio_2=(-u_out_2/a_0)^(2/(r-1))*(-u_out_2/u_0);// The mass flow rate ratio of section 2
+printf("\n(a)The outflow speed of section 1,u_out=%3.1f m/s \n The outflow speed of section 1,u_out=%3.1f m/s \n(b)The mass flow rate ratio of section 1 is %1.3f \n The mass flow rate ratio of section 2 is %1.3f",u_out_1,u_out_2,mfr_ratio_1,mfr_ratio_2);
diff --git a/3785/CH12/EX12.2/Ex12_2.sce b/3785/CH12/EX12.2/Ex12_2.sce
new file mode 100644
index 000000000..4f059fa2a
--- /dev/null
+++ b/3785/CH12/EX12.2/Ex12_2.sce
@@ -0,0 +1,19 @@
+// Example 12_2
+clc;funcprot(0);
+// Given data
+T=20;// °C
+SPL=20;// Sound Pressure level in dB
+// From table 1.1,
+rho_0=1.204;// kg/m^3
+gamma=3.5/2.5;// Specific heat ratio
+
+// Calculation
+// (a) Inverting equation 12.18,
+Pa=2*10^-5*(1*10^(20/10));// Pa
+// (b) From equation 12.17,
+a=(gamma*1.013*10^5*rho_0)^(1/2);// m/s
+va=Pa/(rho_0*a);
+//(c) From equation 12.17,
+P_sw=(Pa)^2/(rho_0*a);
+printf('\n(a)The pressure amplitude is %1.0e Pa \n(b)The velocity amplitude is %1.2e m/s \n The power per unit area,P_sw=%1.2e W/m^2',Pa,va,P_sw);
+// The answer provided in the book is wrong
diff --git a/3785/CH12/EX12.3/Ex12_3.sce b/3785/CH12/EX12.3/Ex12_3.sce
new file mode 100644
index 000000000..f80edcbc5
--- /dev/null
+++ b/3785/CH12/EX12.3/Ex12_3.sce
@@ -0,0 +1,10 @@
+// Example 12_3
+clc;funcprot(0);
+// Given data
+r=1.4;// The specific heat ratio
+p_s=6*10^5;// The pressure in the large tank in Pa
+p_t=5*10^4;// The pressure in the test section in Pa
+
+// Calculation
+M_t=sqrt((2/(r-1))*((p_t/p_s)^(-(r-1)/r)-1));// Mach number
+printf("\nThe Mach number M_t in the test section is %1.3f",M_t);
diff --git a/3785/CH12/EX12.4/Ex12_4.sce b/3785/CH12/EX12.4/Ex12_4.sce
new file mode 100644
index 000000000..dd3e876fc
--- /dev/null
+++ b/3785/CH12/EX12.4/Ex12_4.sce
@@ -0,0 +1,17 @@
+// Example 12_4
+clc;funcprot(0);
+// Given data
+p_s=4*10^5;// Pressure in Pa
+a_s=347.2;// Sound speed in m/s
+A_c=1*10^-4;// The flow area in m^2
+p_a=1*10^5;// The atmospheric pressure in Pa
+r=1.4;// The specific heat ratio
+V_c=0.5787;
+
+// Calculation
+rho_c=(r*p_s)/a_s;// kg/m^3
+m_c=rho_c*V_c*A_c;// kg/s
+V_c=a_s/(sqrt(1+(r-1)/2));// m/s
+p_c=((2/(r+1))^(r/(r-1)))*p_s;// N
+F=(m_c*V_c)+((p_c-p_a)*A_c);// N
+printf('\nThe mass flow rate of air from the tank=%1.2e kg/s \nThe external force F required to restrain the tank from moving is %2.2f N',m_c,F);
diff --git a/3785/CH12/EX12.5/Ex12_5.sce b/3785/CH12/EX12.5/Ex12_5.sce
new file mode 100644
index 000000000..1563e54cc
--- /dev/null
+++ b/3785/CH12/EX12.5/Ex12_5.sce
@@ -0,0 +1,16 @@
+// Example 12_5
+clc;funcprot(0);
+// Given data
+r=1.3;// The specific heat ratio
+V_e=0.90;// Exit velocity in % of maximum possible velocity
+
+// Calculation
+V_mebya_s=sqrt(2/(r-1));// The maximum possible exit velocity
+function[X]=machnumber(y)
+ X(1)=(V_e*V_mebya_s)-(y(1)*(1+((0.3*y(1)^2)/2))^(-1/2));
+endfunction
+y=[1];
+M_e=fsolve(y,machnumber);// The Mach number of the exit flow
+A_ebyA_c=M_e*((2/(r+1))*((1+(((r-1)/2)*(M_e)^2))))^((r+1)/(2*(r-1)));// The area ratio
+D_r=sqrt(A_ebyA_c);// Corresponding diameter ratio
+printf("\nThe exit Mach number,M_e=%1.3f \nThe area ratio=%1.3e \nThe diameter ratio=%2.2f",M_e,A_ebyA_c,D_r)
diff --git a/3785/CH12/EX12.6/Ex12_6.sce b/3785/CH12/EX12.6/Ex12_6.sce
new file mode 100644
index 000000000..71c4b7641
--- /dev/null
+++ b/3785/CH12/EX12.6/Ex12_6.sce
@@ -0,0 +1,18 @@
+// Example 12_6
+clc;funcprot(0);
+// Given data
+a_1=347.2;// m/s
+p_1=1*10^5;// Pa
+r=1.4;// The specific heat ratio
+V_p=100;// The velocity of piston in m/s
+
+// Calculation
+C=((r+1)*V_p)/(2*a_1);
+function[X]=machnumber(y)
+ X(1)=y(1)^2-(C*y(1))-1;
+endfunction
+y=[1];
+M_1=fsolve(y,machnumber);// The shock Mach number
+V_s=M_1*a_1;// The shock speed in m/s
+p_2=(((2*r*M_1^2)-(r-1))/(r+1))*p_1;// The pressure on the piston face in Pa
+printf("\nThe shock Mach number,M_1=%1.3f \nThe shock speed,V_s=%3.1f m/s \nThe pressure on the piston face,p_2=%1.2e Pa",M_1,V_s,p_2);
diff --git a/3785/CH12/EX12.7/Ex12_7.sce b/3785/CH12/EX12.7/Ex12_7.sce
new file mode 100644
index 000000000..6c237a46b
--- /dev/null
+++ b/3785/CH12/EX12.7/Ex12_7.sce
@@ -0,0 +1,27 @@
+// Example 12_7
+clc;funcprot(0);
+// Given data
+D=1;// The diameter of gas pipeline in m
+epsilon=5*10^-5;// Surface roughness in m
+p_1=2*10^6;// Pressure in Pa
+T_1=20;// Temperature in °C
+a_1=446.1;// The natural gas sound speed in m/s
+mu_1=9*10^-6;// Viscosity in Pa s
+r=1.31;// The specific heat ratio
+R=518.3;// The gas constant in J/kg.K
+V_1=10;// The pipe flow speed in m/s
+
+// Calculation
+rho_1=(p_1)/(R*(T_1+273.15));// The density in kg/m^3
+Re_D=(rho_1*V_1*D)/mu_1;// Reynolds number
+function[X]=frictionfactor(y)
+ X(1)=-(2.0*log10(((epsilon/D)/3.7)+(2.51/(Re_D*sqrt(y(1))))))-(1/sqrt(y(1)));
+endfunction
+// Guessing a value of f=1*10^-2;
+y=[1*10^-2];
+f=fsolve(y,frictionfactor);// Friction factor
+M_1=V_1/a_1;// Mach number
+L_max=((D/f)*(((1-M_1^2)/(r*M_1^2))+(((r+1)/(2*r))*log(((r+1)*M_1^2)/(2*(1+((r-1)*M_1^2/2)))))))/1000;// The pipe length at which the flow would be choked in m
+V_c=((V_1/M_1)*(sqrt((2+((r-1)*M_1^2))/(r+1))));// The flow speed in m/s
+p_c=(p_1*V_c*M_1^2)/V_1;// The pressure at the point of choked flow in Pa
+printf("\nThe pipe length at which the flow would be choked,L_max=%3.1f km \nThe flow speed at the point of choked flow,V_c=%3.0f m/s \nThe pressure at the point of choked flow,p_c=%1.3e Pa",L_max,V_c,p_c);
diff --git a/3785/CH12/EX12.8/Ex12_8.sce b/3785/CH12/EX12.8/Ex12_8.sce
new file mode 100644
index 000000000..c2fae6951
--- /dev/null
+++ b/3785/CH12/EX12.8/Ex12_8.sce
@@ -0,0 +1,10 @@
+// Example 12_8
+clc;funcprot(0);
+// Given data
+theta=10;// The half angle of two dimensional wedge in degree
+beta=20;// The attached shock wave angle in degree
+r=1.4;// The specific heat ratio
+
+// Calculation
+M=sqrt(((2*tand(theta))+(2*cotd(beta)))/((2*cosd(beta)*sind(beta))-((r+(cosd(beta)*cosd(beta)))*tand(theta))));// The Mach number M of the flow in the wind tunnel
+printf("The Mach number M of the flow in the wind tunnel,M=%1.3f",M);