This article investigates the fluid dynamics and heat transfer properties in a trapezoidal enclosure containing a heated cylindrical object. It involves the interaction of multiple physical processes such as the magnetic field, thermal radiation, porous materials, and aqueous copper oxide nanoparticles. The governing partial differential equations are analyzed numerically through the continuous Galerkin finite element algorithm. The analysis takes into account various physical parameter factors, including the Richardson number (0–5), the Hartmann number (5−40), the Darcy number (0.001−0.1), thermal radiation parameter (0.5−2), and nanoparticle volume concentration (0.01−0.1). The physical mechanism of thermal and mass transfer in the enclosure caused by various factors is fully explored. In addition, the multiple expression programming (MEP) technique is implemented to report a comparative analysis of flow profiles and thermal distribution. The findings demonstrated that at low Ri, the primary flow within the cavity is driven by the shear friction generated by the moving walls. The growing importance of radiative heat transfer reduces the effectiveness of convective heat transfer, resulting in a decline in the average Nusselt number with R. The heat transfer rate rises up to 27.7% as ϕ augments; however, its value declines by 9.37% against Ha. The expected results obtained by the MEP approach are very consistent with the numerical ones. There is no doubt that the new MEP concept provides a valuable tool for researchers to predict the heat transfer behavior of any data set in cavities of different shapes. It is expected to provide new idea for the development of efficient cooling systems and the improvement of energy efficiency in various engineering applications.