The flow of fluids in multi-phase porous media results due to many interesting natural phenomena. The counter-current water imbibition phenomena, that occur during oil extraction through a cylindrical well is an interesting problem in petroleum engineering. During the secondary oil recovery process, water is injected into a porous media having heterogenous and homogenous characteristics. Due to the difference in viscosities of fluids in oil wells, the counter-current imbibition phenomenon occurs. At that moment, the imbibition equation V i = âV n is satisfied by the viscosities of oil and water. In this paper, we have analyzed the governing mathematical model of the imbibition phenomenon occurring during the secondary oil recovery process. A new soft computing algorithm is designed and adapted to analyze the mathematical model of dual-phase flow in detail. Weighted Legendre polynomials based artificial neural networks are hybridized with an efficient global optimizer the Whale Optimization Algorithm (WOA) and a local optimizer the Nelder-Mead algorithm. It is established, that our algorithm LeNN-WOA-NM is efficient and reliable in calculating high-quality solutions in less time. We have compared our experimental outcome with state-of-the-art results. The quality of our solutions is judged based on values of absolute errors, MAD, TIC, and ENSE. It is obvious that LeNN-WOA-NM algorithm can solve real application problems efficiently and accurately. INDEX TERMS Counter-current imbibition phenomena, homogeneous porous media, heterogeneous porous media, capillary pressure, soft computing algorithm, weighted Legendre neural networks, Nelder-Mead algorithm, whale optimization algorithm. I. INTRODUCTION T HIS paper models the phenomena of counter-current imbibition in the multi-phase flow of two immiscible fluids through heterogeneous and homogenous porous mediums that occurs during the secondary oil recovery process or water flooding [1]. In applied sciences, various changes occur in porous mediums having multi-phase flows of different fluids. In the past few decades, researchers are focused on studying the flows in underground petroleum reservoirs [2]. The primary recovery process includes the production of oil by simple natural decompression with no effect of external forces at wells [3]. In secondary oil recovery or water flooding process, fluids like water, polymer, steam are injected into a reservoir through injection wells located in rocks that have fluid communication with production wells. This process is called the immiscible displacement process [3].