Automated Contingency Management for Water Recycling System