Both 2- and 3-dimensional computational studies of two-phase flow within a horizontal pipe with a vertical deadleg placed downstream of an oil/water supply source were considered as part of a model subsea petroleum production system. Two-phase continuity and momentum relations were solved using the open-source computational software OpenFOAM. The unsteady flow behavior of the two-phase dispersed mixture which consists of 90%–10% slurry of 32.8 API crude oil-water at the inlet port (Reynolds number of 2.1 × 105) was investigated. With the 2-D simulations, the effects of the average inlet velocity, diameter of the deadleg and length of the deadleg on the oil fraction within the deadleg and the stagnant zones were studied. Results of the 3-D unsteady simulations exhibited the complex vortical flow field and separation of the two phases that evolved within the deadleg leading to migration of separated oil to the top of the deadleg.