Many engineering and industrial applications rely on heat transfer (HT) as a basic and central process. Therefore, engineers and researchers place significant emphasis on optimizing HT rates. Here, we numerically attempt to maximize the heat transmission rate of mixed convection of nanoencapsulated phase change material in a square compartment. The compartment is differentially heated and incorporates two cold rotating cylinders. The Galerkin finite element approach is utilized for addressing the system governing equations. A range of various factors affecting the thermal activity in the compartment were considered. These factors include the speed of spinning cylinders (Re = 0–1000), the porousness of the compartment (Da = 10−5–10−2), the magnetic field intensity (Ha = 0–100), and the concentration of nanoadditives (ϕ = 0%–8%). The obtained numerical findings demonstrated that the thermal activity inside the compartment is positively correlated to the speed of the spinning cylinders, the concentration of nanoadditives, and the porousness of the compartment. In contrast, increasing the intensity of the magnetic field obstructs the heat transmission. It was noted that at the highest Re number, the average Nusselt number augmented by 257% and 13.6% when increasing Da and ϕ, respectively.