Penetration of a wetting front in a porous medium interacting with the flow