Integrated design of chemical waste water treatment systems