Use left mouse click to draw a barrier, and right mouse click to erase it.
This program is based on the Fluid Dynamics Simulation by Daniel Schroeder by following this instructional document also by him.