Patterning of wettability for controlling capillary-driven flow in closed channels.