Numerical analysis employing a finite volume method is used to explore the impact of a magnetic field and the radius of a heated semi-circular body on heat transfer by natural convection and fluid flow structures within a square enclosure. The current study is governed by specific control parameters, such as the Hartmann number (0 <= Ha <= 60), the tilt of the magnetic field (0 degrees <= gamma <= 180 degrees), the Rayleigh number (10(3) <= Ra <= 10(6)), and the size of the heated semi-circular body (0.1 <= R <= 0.4). The Prandtl number is set at Pr = 6.2. The results are presented using streamlines, isotherms, and mean Nusselt numbers. The outcomes show that raising the Rayleigh number and the radius of the heated semi-circular body improves heat transfer, while increasing the Hartmann number reduces heat transfer. Furthermore, it was demonstrated that the direction of the magnetic field has a considerable and symmetrical effect on the flow and temperature fields, impacting heat transfer. Specifically, for Rayleigh numbers of Ra = 10(5) and Ra = 10(6), the Nusselt number is improved by 25.2% and 6%, respectively, as the angle gamma raises from 0 degrees to 90 degrees