© 2020 Elsevier LtdTaking a more complex engineering geometry into account, magnetohydrodynamic natural convection of nanofluid (Cu-water) in a wavy walled enclosure having a circular hot cylinder inside is investigated by employing Galerkin-weighted residual formulation. In order to investigate the flow and heat transfer characteristics from several perspectives and increase the ability of adaptation to various engineering applications, the influences of the Hartmann number, Ha, Rayleigh number, Ra, and nanoparticle concentration are examined in detail. In addition to that, heat generation and heat absorption situations are also considered within the present work, which are simulated by a heat coefficient in a range of −10 ≤ q ≤ +10. The results revealed that increasing Ha has an insignificant effect on Nusselt number, Nu, at low Ra, however, it significantly pulls Nu down up to 33% for higher Ra, because of restricting convection. It is found that the heat coefficient, q, has a remarkable impact on Nu at low Ra, while its significance is diminished when Ra is increased. For q < 0, the heat absorption creates a heat sink, which increases Nu up to 34%, while the heat generation (q > 0) conversely reduces Nu up to 48%. Besides, variation in heat coefficient does not considerably affect the improvement impact of nanoparticles.