Abstract. Oversampling techniques are often used in porous media simulations to achieve high accuracy in multiscale simulations. These methods reduce the effect of artificial boundary conditions that are imposed in computing local quantities, such as upscaled permeabilities or basis functions. In the problems without scale separation and strong non-local effects, the oversampling region is taken to be the entire domain. The basis functions are computed using single-phase flow solutions which are further used in dynamic two-phase simulations. The standard oversampling approaches employ generic global boundary conditions which are not associated with actual flow boundary conditions. In this paper, we propose a flow based oversampling method where the actual two-phase flow boundary conditions are used in constructing oversampling auxiliary functions. Our numerical results show that the flow based based oversampling approach is several times more accurate than the standard oversampling method. We provide partial theoretical explanation for these numerical observations.