Simulating flow and reactive transport in porous media