Numerical Simulation and Homogenization of Two-Phase Flow in Heterogeneous Porous Media