Answer
$q_{max}= 1180$ kJ/kg
Work Step by Step
The inlet Mach number and stagnation temperature are
$$
\begin{aligned}
& c_1=\sqrt{k R T_1}=\sqrt{(1.4)(0.287 \mathrm{~kJ} / \mathrm{kg} \cdot \mathrm{K})(400 \mathrm{~K})\left(\frac{1000 \mathrm{~m}^2 / \mathrm{s}^2}{1 \mathrm{~kJ} / \mathrm{kg}}\right)}=400.9 \mathrm{~m} / \mathrm{s} \\
& \mathrm{Ma}_1=\frac{V_1}{c_1}=\frac{100 \mathrm{~m} / \mathrm{s}}{400.9 \mathrm{~m} / \mathrm{s}}=0.2494 \\
& T_{01}=T_1\left(1+\frac{k-1}{2} \mathrm{Ma}_1^2\right)=(400 \mathrm{~K})\left(1+\frac{1.4-1}{2} 0.2494^2\right)=405.0 \mathrm{~K}
\end{aligned}
$$ The Rayleigh flow functions corresponding to the inlet and exit Mach numbers are (Table A-34):
$$
\begin{aligned}
& \mathrm{Ma}_1=0.2494: \quad T_{01} / T^*=0.2559 \\
& \mathrm{Ma}_2=0.8: \quad T_{02} / T^*=0.9639 \\
\end{aligned}
$$ Then the exit stagnation temperature and the heat transfer are determined to be
$$
\begin{aligned}
& \frac{T_{02}}{T_{01}}=\frac{T_{02} / T^*}{T_{01} / T^*}=\frac{0.9639}{0.2559}=3.7667 \rightarrow T_{02}=3.7667 T_{01}=3.7667(405.0 \mathrm{~K})=1526 \mathrm{~K} \\
& q=c_p\left(T_{02}-T_{01}\right)=(1.005 \mathrm{~kJ} / \mathrm{kg} \cdot \mathrm{K})(1526-405) \mathrm{K}=1126 \mathrm{~kJ} / \mathrm{kg} \cong 1130 \mathrm{~kJ} / \mathrm{kg}
\end{aligned}
$$ Maximum heat transfer will occur when the flow is choked, and thus $\mathrm{Ma}_2=1$ and thus $T_{02} / T^*=1$. Then,
$$
\begin{aligned}
& \frac{T_{02}}{T_{01}}=\frac{T_{02} / T^*}{T_{01} / T^*}=\frac{1}{0.2559} \rightarrow T_{02}=T_{01} / 0.2559=(405 \mathrm{~K}) / 0.2559=1583 \mathrm{~K} \\
& q_{\max }=c_p\left(T_{02}-T_{01}\right)=(1.005 \mathrm{~kJ} / \mathrm{kg} \cdot \mathrm{K})(1583-405) \mathrm{K}=1184 \mathrm{~kJ} / \mathrm{kg} \cong 1180 \mathrm{~kJ} / \mathrm{kg}
\end{aligned}
$$