We describe a new approach for simulation of multiphase flows through heterogeneous porous media, such as oil reservoirs. The method, which is based on the wavelet transformation of the spatial distribution of the single-phase permeabilities, incorporates in the upscaled computational grid all the relevant data on the permeability, porosity, and other important properties of a porous medium at all the length scales. The upscaling method generates a nonuniform computational grid which preserves the resolved structure of the geological model in the near-well zones as well as in the high-permeability sectors and upscales the rest of the geological model. As such, the method is a multiscale one that preserves all the important information across all the relevant length scales. Using a robust front-detection method which eliminates the numerical dispersion by a high-order total variation diminishing method (suitable for the type of nonuniform upscaled grid that we generate), we obtain highly accurate results with a greatly reduced computational cost. The speedup in the computations is up to over three orders of magnitude, depending on the degree of heterogeneity of the model. To demonstrate the accuracy and efficiency of our methods, five distinct models (including one with fractures) of heterogeneous porous media are considered, and two-phase flows in the models are studied, with and without the capillary pressure.