In the present paper, the first and second laws of thermodynamics are utilized to select the optimized position of porous insert to achieve maximum heat transfer and minimum pressure drop and entropy generation inside a double-pipe heat exchanger. Four different porous inserts configuration are considered in the heat exchanger, where the porous layers are placed at the core of the inner tube, wall of the inner tube, and inner or outer walls on outer tube for these cases. In addition, the effects of Darcy number and thermal conductivity of porous material on entropy generation, heat transfer enhancement and pressure drop penalty are investigated. The flow and heat transfer are modeled numerically using the finite volume approach, while for the porous layers, Darcy–Brinkman–Forchheimer model is applied to model the flow characteristics. It was found that for outer tube of a double-pipe heat exchanger, placing the porous layer in the inner wall creates larger pressure drops. For inner tube, it is better to place the porous layer at the center, while for outer one, it is better to insert the porous layer at inner wall (interface wall) to achieve the higher values of heat transfer rate. Moreover, the thermal and viscous entropy generations are more pronounced for the cases, where the porous substrate is not located at the core of the heat exchanger.