We describe the development and application of a three-dimensional pore-scale network simulator for modeling capillary-dominated three-phase flow in porous media where the wettability varies from pore to pore, i.e., where each pore is allowed to have a different oil-water contact angle from a chosen distribution. Physical constraint equations for the remaining gas-oil and gas-water contact angles are implemented. In weakly wetted pores wetting films are absent, which reduces the continuity of the various phases in the network and increases the number of phase clusters that are disconnected from inlet or outlet. Mobilization of disconnected clusters requires incorporation of double and multiple displacement chains that involve a string of neighboring phase clusters, e.g., gas?oil?gas?oil?water. Furthermore, when multiple displacement chains cause disconnected clusters to reconnect to the outlet, the phase pressures at the outlet boundary are updated consistent with the pressures within the system. A number of benchmark simulations for systems with nonuniform wettability, mixed-wet with the larger pores oil-wet, are presented. The outcome of these simulations is presented as phase paths in saturation space and in the form of pore occupancy histograms and histograms of the length and type of displacement chains. Comparison of simulated saturation paths with those of an analytical capillary bundle model with the same wettability show good agreement where phase continuity is high and decreasing agreement as phase continuity in the network decreases. The saturation paths and occupancy and displacement statistics for a number of water-alternating-gas injection (WAG) simulations bring out the various features of the model, in particular, those related to the wettability. We find that multiple displacements do occur, mainly during higher-order WAG floods, although their effect on oil recovery seems limited. Variation of the outlet boundary pressure differences has an effect in certain regions of the saturation space that are defined by the analytical model. ©2002 The American Physical Society.