Viscoelastic wormlike micelles are formed by surfactants assembling into elongated cylindrical structures. These structures respond to flow by aligning, breaking and reforming. Their response to the complex flow fields encountered in porous media is particularly rich. Here we use a realistic mesoscopic Brownian Dynamics model to investigate the flow of a viscoelastic surfactant (VES) fluid through individual pores idealized as a step expansion-contraction of size around one micron. In a previous study, we assumed the flow field to be Newtonian. Here we extend the work to include the non-Newtonian flow field previously obtained by experiment. The size of the simulations is also increased so that the pore is much larger than the radius of gyration of the micelles. For the non-Newtonian flow field at the higher flow rates in relatively large pores, the density of the micelles becomes markedly non-uniform. In this case, we find that the density in the large, slowly moving entry corner regions is substantially increased. © 2008 EDP Sciences, Società Italiana di Fisica and Springer-Verlag.