  We present in detail a set of algorithms to carry out fluid displacements in
a dynamic pore-network model of immiscible two-phase flow in porous media. The
algorithms are general and applicable to regular and irregular pore networks in
two and three dimensions with different boundary conditions. Implementing these
sets of algorithms, we describe a dynamic pore-network model and reproduce some
of the fundamental properties of both the transient and steady-state two-phase
flow. During drainage displacements, we show that the model can reproduce the
flow patterns corresponding to viscous fingering, capillary fingering and
stable displacement by altering the capillary number and the viscosity ratio.
In steady-state flow, the model verifies the linear to non-linear transition of
the effective rheological properties and satisfy the relations between the
seepage velocities of two-phase flow in porous media.
