Preventing the formation of deposits or corrosion