This study focuses on two-dimensional heat transfer and unsteady flow past two tandem heated porous square cylinders using lattice Boltzmann method combined with block-structured topology-confined mesh refinement. The effects of the Reynolds number (30≤Re≤150), the Darcy number (10−5≤Da≤10−2), and spacing ratio (1.5≤L/D≤5, where L and D are distance of two adjacent cylinder centers and square cylinder length, respectively) are investigated. The intended analysis links hydrodynamic and heat transfer coefficients and wake structures in parameter space of Re−Da−L/D to fluid mechanics. For upstream cylinder, drag coefficients decrease with a reduction of Da and range of Re≥100, while wake length increases with an increment of L/D ratio at the same range of Re. Time-averaged normalized velocity increases at higher permeability levels. A significant augmentation in a time-averaged Nusselt number is reported for an increase in Da and full L/D range. For downstream cylinder, the interaction of fluid vortices in the gap between the cylinders affects the flow pattern, causing irregularities in the drag coefficient variation. The impacts of L/D on the wake length is more obvious than that of Da. Both the wake length and time-averaged Nusselt number values are proportional to an increase in L/D. Consequently, all the investigated results of the upstream cylinder are significantly altered from those of the downstream cylinder due to the shadowing effect of the upstream cylinder.