This article analyzes the natural convection of nanofluid within a porous cavity containing a partially-heated vertical wall and wavy lower and upper walls. Numerical simulations are performed to explore the effects of the Rayleigh number (Ra), Darcy number (Da), porosity (ε), volume fraction of nanoparticles (φ), amplitude of wavy surface (αw), length of partially-heated wall surface (LH∗), and irreversibility distribution ratio (χ) on the Bejan number (Be), total entropy generation (St), mean Nusselt number (Num), and energy-flux-vector distribution. The results show that for high values of Da and Ra, circulation regions are developed in the energy-flux-vector distribution and hence convection heat transfer dominates. Consequently, Num and St both increase, while Be reduces as Ra, ε and Da increase. For low values of Da and Ra, the effects of Da, Ra and ε on Num and St are insignificant, and Be approaches unity since conduction heat transfer dominates. As φ and αw increase, Num and Be increase, but St decreases. Moreover, as LH∗ increases, Num and St also increase. For a high value of Ra, St increases and Be reduces as χ is increased. Finally, for a low value of Ra, the effect of χ on St is insignificant and Be ≈ 1.