Dynamics of two-phase flow in vertical pipes