Rainwater used to flow down those channels in the castle wall and was then stored in a large cistern.