The intention of this paper is to present the numerical analysis of thermal performance and exergy transfer through high porosity metal foams filled partially in a horizontal pipe. The heater is embedded in the pipe's circumference and is assigned with known heat input. To enhance heat transfer, aluminum metal foam of pore density 10 with porosity 0.95 is inserted adjacent to the pipe's inner wall. To determine the optimal thickness of metal foam for enhancing its performance thermodynamically, metal foams with five different thicknesses (10, 20, 40, 60, and 80 mm) are examined in this research for a fluid velocity ranging from 0.7 to 7 m/s under forced convection heat transfer condition. The Darcy– Brinkman–Forchheimer and local thermal nonequilibrium (LTNE) models are used for forecasting the flow features and heat transfer through the metal foams, respectively. The numerical methodology implemented in this research is confirmed by comparing the present outcomes with the experimental outcomes accessible in the literature and found a fairly good agreement between them. The thermal performance is assessed in terms of heat transfer enhancement ratio and performance factor, and the thermodynamic performance is evaluated based on exergy analysis. In the exergy analysis, the parameters like mean exergy-based Nusselt number (), merit function (MF), and nondimensional exergy destruction (I*) are considered for the evaluation. The result shows a better performance from partially filled metal foams than from completely filled metal foams.