Design and operation of water treatment systems using nanoparticles