Upscaling immiscible capillary-controlled two-phase flow in porous media