Lorentz forces influence on nanofluid flow in a porous enclosure with complex hot cylinder is investigated. Darcy model is taken into account to present governing equations. Numerical simulations are examined for various amount of Rayleigh number for porous medium ($Ra=102,250$ and $103$), number of undulations ($N=3,4,5$ and $6$), volume fraction of CuO–water (*ϕ* = 0 and 0.04), and Hartmann number for porous medium (Ha = 0 to $20$). Figures 3–5 demonstrate the impacts of number of undulations, Rayleigh and Hartmann numbers for porous medium on streamlines and isotherms. As nanofluid temperature augments, the nanofluid begins moving from the warm surface to the outer one and dropping along the circular cylinder, afterward mounting again at the inner cylinder, generating a clockwise revolving vortex inside the cavity. In dominance of conduction mode, isotherms follow the shape of cylinders. $|\Psi max|$ augments as buoyancy force augments and it reduces as Lorentz force enhances. For odd values of *N*, very small eddy generates around $\zeta =90\u2009deg$. This phenomenon is observed because of opposition of the crest in contradiction of the flow movement between the hot and cold walls. But there is no secondary eddy near $\zeta =90\u2009deg$ for even values of *N* because the crest is parallel to the gravity force. As buoyancy forces enhances, eddies become stronger and thermal plume generate near the center line. Increasing Hartmann number causes the thermal plume to diminish and change the heat transfer mechanism from convection to conduction. So, Nu reduces with the rise of Lorentz forces. In the absence of Lorentz force when *N* = 3, Ra = 1000, two vortexes which rotates in reverse direction appear near the vertical center line. So strong thermal plume appears in this region. As Lorentz force augments, these two vortexes merge together, and the thermal plume vanishes. Figure 6 depicts the influence of $N,\u2009\u2009\varphi \u2009,Ra\u2009$, and $Ha$ for porous media on $Nuave$. The correlation for $Nuave$ is