Two and three dimensional simulation of flow and particle transport in porous media