In this study, numerical analysis and optimization for the convective heat transfer and fluid flow over a facing step in the presence of an elliptic shaped porous object located downstream of the step are considered. The COBYLA optimization algorithm is used to find the optimum location and size of the porous object in order to maximize average Nu number. Air and nano-diamond/Fe3O4 hybrid nanofluid as the coolant in the thermo-fluid system. It is observed that the presence of the obstacle, varying its permeability, aspect ratio and location in the channel profoundly affect the fluid flow features and improvement amount in the heat transfer rate. The average Nu number is first reduced by about 14.7% and then increased by about 6.8% when the permeability of the object is increased. The optimum value of the Nu number is found as 2.037 while the optimum location and sizes are found as (Sx, Sy, r1, r2)=(0.538H,0.4509H,0.2138H, 0.348H) when air is used as heat transfer fluid. The average heat transfer rate is reduced with higher aspect ratio while the value of Nu number at the optimum point is 33% higher as compared to case with aspect ratio of 0.5. The average Nu number variation shows non-monotonic behavior for horizontal location of the object. When the object is closer to the top wall, the average Nu number becomes higher while the value at the optimum point is 19.8% higher in the parametric study. At the optimum operating point, hybrid nanoparticle addition in the fluid brings further enhancement of 28.4% in the average heat transfer.