There is a gravitational force on the particles accelerating them to the right (this is the pressure).
When a particle encounters the walls, it loses its horizontal velocity, its vertical velocity is reversed. This simulates the frictional drag.
The particles begin with random velocities, the velocity profile settles to a parabolic shape.
A few particles are colored black to help picture the flow.
Code by Lawrence Hook