As a first step towards understanding the distribution of swimming micro-organisms in flowing shallow water containing vegetation, we formulate a continuum model for dilute suspensions in horizontal shear flow, with a maximum Reynolds number of 100, past a single, rigid, vertical, circular cylinder that extends from a flat horizontal bed and penetrates the free water surface. A numerical platform was developed to solve this problem, in four stages: first, a scheme for computation of the flow field; second, a solver for the Fokker–Planck equation governing the probability distribution of the swimming direction of gyrotactic cells under the combined action of gravity, ambient vorticity and rotational diffusion; third, the construction of a database for the mean swimming velocity and the translational diffusivity tensor as functions of the three vorticity components, using parameters appropriate for the swimming alga, Chlamydomonas nivalis; fourth, a solver for the three-dimensional concentration distribution of the gyrotactic micro-organisms. Upstream of the cylinder, the cells are confined to a vertical strip of width equal to the cylinder diameter, which enables us to visualise mixing in the wake. The flow downstream of the cylinder is divided into three zones: parallel vortex shedding in the top zone near the water surface, oblique vortex shedding in the middle zone and quasi-steady flow in the bottom zone. Secondary (vertical) flow occurs just upstream and downstream of the cylinder. Frequency spectra of the velocity components in the wake of the cylinder show two dominant frequencies of vortex shedding, in the parallel- and oblique-shedding zones respectively, together with a low frequency, equal to the difference between those two frequencies, that corresponds to a beating modulation. The concentration distribution is calculated for both active particles and passive, non-swimming, particles for comparison. The concentration distribution is very similar for both active and passive particles, except near the top surface, where upswimming causes the concentration of active particles to reach values greater than in the upstream strip, and in a thin boundary layer on the downstream surface of the cylinder, where a high concentration of active particles occurs as a result of radial swimming.