Numerical simulations are presented which, in conjunction with the accompanying experimental investigation by Petitjeans & Maxworthy (1996), are intended to elucidate the miscible flow that is generated if a fluid of given viscosity and density displaces a second fluid of different such properties in a capillary tube or plane channel. The global features of the flow, such as the fraction of the displaced fluid left behind on the tube walls, are largely controlled by dimensionless quantities in the form of a Péclet number Pe, an Atwood number At, and a gravity parameter. However, further dimensionless parameters that arise from the dependence on the concentration of various physical properties, such as viscosity and the diffusion coefficient, result in significant effects as well. The simulations identify two distinct Pe regimes, separated by a transitional region. For large values of Pe, typically above O(103), a quasi-steady finger forms, which persists for a time of O(Pe) before it starts to decay, and Poiseuille flow and Taylor dispersion are approached asymptotically. Depending on the strength of the gravitational forces, we observe a variety of topologically different streamline patterns, among them some that leak fluid from the finger tip and others with toroidal recirculation regions inside the finger. Simulations that account for the experimentally observed dependence of the diffusion coefficient on the concentration show the evolution of fingers that combine steep external concentration layers with smooth concentration fields on the inside. In the small-Pe regime, the flow decays from the start and asymptotically reaches Taylor dispersion after a time of O(Pe). An attempt was made to evaluate the importance of the Korteweg stresses and the consequences of assuming a divergence-free velocity field. Scaling arguments indicate that these effects should be strongest when steep concentration fronts exist, i.e. at large values of Pe and At. However, when compared to the viscous stresses, Korteweg stresses may be relatively more important at lower values of these parameters, and we cannot exclude the possibility that minor discrepancies observed between simulations and experiments in these parameter regimes are partially due to these extra stresses.