This study presents the investigation of the local entropy generation in compressible flow through a suddenly expanding pipe. Air is used as fluid. The air enters into the pipe with a turbulent profile using 1/7 th power law. The simulations are extended to include different expansion ratios reduced gradually from 5 to 1. To determine the effects of the mass flux, φ" the ambient heat transfer coefficient, hamb
, and the inlet temperature, Tin
, on the entropy generation rate, the compressible flow is examined for various cases of these parameters. The flow and temperature fields are computed numerically with the help of the Fluent computational fluid dynamics (CFD) code. In addition to this CFD code, a computer program has been developed to calculate numerically the entropy generation and other thermodynamic parameters by using the results of the calculations performed for the flow and temperature fields. The values of thermodynamic parameters in the sudden expansion. (SE) case are normalized by dividing by their base quantities obtained from the calculations in the uniform cross-section (UC) case. The contraction of the radius of the throat (from 0.05 to 0.01 m) increases significantly the maximum value of the volumetric entropy generation rate, (about 60%) and raises exponentially 11 times the total entropy generation rate with respect to the its base value. The normalized merit number decreases 73% and 40% with the contraction of the cross-section and with the increase of the ambient heat transfer coefficient (from 20 to 100 W/m2
-K), respectively, whereas it rises 226% and 43% with the decrease of the maximum mass flux (from 5 to 1 kg/m2
-s) and with the increase of the inlet temperature (from 400 to 1000 K), respectively. Consequently, the useful energy transfer rate to irreversibility rate improves as the mass flux decreases and as the inlet temperature increases.