Design of water treatment plants