Non-steady drainage in a layered soil