Protecting wastewater systems against hydrogen sulfide and other aggressive substances