In: Mechanical Engineering
Air flows through a constant area duct. The pressure and temperature of the air at the inlet to the duct are P1 = 100 kPa absolute, and T1 = 298 K, respectively. Inlet Mach number is M1 = 0.1. Heat is transferred to the air as it flows through the duct and as a result the Mach number at the exit increases.
Write a Matlab code and plot the following:
a) Find the pressure and temperature at the exit, while the exit Mach number changes between M=0.2 to 0.99 with
increments of ?M=0.01.
b) Find the amount of heat that is transferred to the air per unit mass of air.
clc;
clear all;
P1=100;
cp=1.00;
T1=298;
M1=0.1;
y=1.4;
T_01=(1+(y-1)*0.5*M1^2)*T1;
M2=[0.2:0.01:0.99];
P2=((1+y*M1^2)./(1+y*M2.^2))*P1;
T2=((((1+y*M1^2)./(1+y*M2.^2)).^2).*(M2/M1).^2).*T1;
figure(1);
plot(M2,P2);
title('Exit Mach Number vs Exit
Pressure','FontSize',16,'FontWeight','bold','Color','k');
xlabel('Exit Mach
Number','FontSize',16,'FontWeight','bold','Color','k');
ylabel('Exit
Pressure','FontSize',16,'FontWeight','bold','Color','k');
figure(2);
plot(M2,T2);
title('Exit Mach Number vs Exit
Temperature','FontSize',16,'FontWeight','bold','Color','k');
xlabel('Exit Mach
Number','FontSize',16,'FontWeight','bold','Color','k');
ylabel('Exit
Temperature','FontSize',16,'FontWeight','bold','Color','k');
T_02=((((1+(y-1)*0.5*M2.^2)/(1+(y-1)*0.5*M1^2)).*(((1+y*M1^2)./(1+y*M2.^2)).^2).*(M2/M1).^2)*T_01);
q=cp*(T_02-T_01);
M_exit=M2';
heat_transfer=q';
T=table(M_exit,heat_transfer)
M_exit heat_transfer
______ _____________
0.2 809.26
0.21 910.63
0.22 1014.7
0.23 1121.3
0.24 1230.1
0.25 1340.9
0.26 1453.4
0.27 1567.3
0.28 1682.5
0.29 1798.7
0.3 1915.5
0.31 2032.9
0.32 2150.6
0.33 2268.4
0.34 2386
0.35 2503.3
0.36 2620.1
0.37 2736.1
0.38 2851.3
0.39 2965.5
0.4 3078.4
0.41 3190
0.42 3300.1
0.43 3408.6
0.44 3515.4
0.45 3620.3
0.46 3723.4
0.47 3824.4
0.48 3923.3
0.49 4020.1
0.5 4114.6
0.51 4206.9
0.52 4296.8
0.53 4384.3
0.54 4469.5
0.55 4552.2
0.56 4632.5
0.57 4710.3
0.58 4785.6
0.59 4858.5
0.6 4928.9
0.61 4996.8
0.62 5062.3
0.63 5125.4
0.64 5186
0.65 5244.3
0.66 5300.2
0.67 5353.7
0.68 5405
0.69 5454
0.7 5500.7
0.71 5545.3
0.72 5587.7
0.73 5628
0.74 5666.2
0.75 5702.4
0.76 5736.6
0.77 5768.9
0.78 5799.3
0.79 5827.9
0.8 5854.7
0.81 5879.7
0.82 5903
0.83 5924.7
0.84 5944.8
0.85 5963.3
0.86 5980.3
0.87 5995.9
0.88 6010
0.89 6022.8
0.9 6034.2
0.91 6044.3
0.92 6053.2
0.93 6061
0.94 6067.5
0.95 6072.9
0.96 6077.3
0.97 6080.6
0.98 6083
0.99 6084.3