Relative permeability and capillary pressure diagrams are the most important input parameters for reservoir engineering calculations as the provider of large volumes of fluid flow hydrodynamics data within a porous medium. One of the most important phenomena related to these parameters is hysteresis (dependence on saturation history) and non-wetting phase trapping. In this study, using Starfish Pore Network modeling code and performing the necessary additional innovations in C ++, for a sample of water-wet sandstone and water-oil system, first oil bounding relative permeability curve was modeled. Then, in order to investigate the mechanism of oil trapping during the water flooding process, an intermediate curve (scanning) in an desired initial oil saturation (about 0.7) and the main curve (bounding) in the irreducible water saturation were calculated and modeled. The amount of oil saturation, trapped at the end of main imbibition process was 63 percent which is in good agreement with the results of Dong (2009). Also, using Carlson's experimental equation, the simulated scanning curve at saturation of about 0.7 was calculated and it was observed that the Carlson equation, except at the end of the curve, ie near the final trapped oil saturation, predicted a higher value for relative permeability,Then end points of the intermediate curves (in several different saturations) were calculated, which is equal to the amount of oil trapped, and finally the graph known as IR (trapped oil saturation in terms of initial oil saturation) was plotted. Spiteri and Land trapping models were used to validate the obtained results. It was concluded that the amount of trapped oil predicted by the code was totally less than Carlson model but more than Spiteri model in high initial oil saturations ( 0.7). In fact in Spiteri model, the amount of trapped oil decreased at initial high oil saturations.