C.V. Ammonia plus space out to the hot gas.
Substitute the work into the energy equation and solve for the heat transfer
1Q2 = m(h2 - h1) = 2.5 (1583.5 – 1434.6) = 372.25 kJ
1S2 gen = m(s2 – s1) - 1Q2/Tgas
= 2.5 (6.8379 – 6.3187) – 372.25/473.15
= 0.511 kJ/K
Remark: This is an internally reversible- externally irreversible process. The * is generated in the space between the 200oC gas and the ammonia. If there are any ∆T in the ammonia then it is also internally irreversible.