The interplay between bulk flow and boundary conditions on the distribution of micro-swimmers in channel flow

While previous experimental and numerical studies of dilute micro-swimmer suspensions have focused on the behaviours of swimmers in the bulk flow and near boundaries, models typically do not account for the interplay between bulk flow and the choice of boundary conditions imposed in continuum models. In our work, we highlight the effect of boundary conditions on the bulk flow distributions, such as through the development of boundary layers or secondary peaks of cell accumulation in bulk-flow swimmer dynamics. For the case of a dilute swimmer suspension in Poiseuille flow, we compare the distribution (in physical and orientation space) obtained from individual based stochastic models with those from continuum models, and identify mathematically sensible continuum boundary conditions for different physical scenarios (i.e. specular reflection, uniform random reflection and absorbing boundaries). We identify that the spread of preferred cell orientations is dependent on the interplay between rotation driven by the shear flow (Jeffery orbits) and rotational diffusion. We find that in the absence of hydrodynamic wall-interactions, swimmers preferentially approach the walls perpendicular to the surface in the presence of high rotational diffusion, and that the preferential approach of swimmers to the walls is shape-dependent at low rotational diffusion (when suspensions tend towards a fully deterministic case). In the latter case, the preferred orientations are nearly parallel to the surface for elongated swimmers and nearly perpendicular to the surface for near-spherical swimmers. Furthermore, we highlight the effects of swimmer geometries and shear throughout the bulk-flow on swimmer trajectories and show how the full history of bulk-flow dynamics affects the orientation distributions of micro-swimmer wall incidence.


Introduction
Microorganisms are ubiquitous and can be found in disparate systems such as soils, surfaces and fluids.While microorganisms are not all harmful, and some are important for the daily processes of larger lifeforms, like gut bacteria in humans (Rinninella et al. 2019) and microalgae in the marine food-chain (Arrigo 2005), there exist a number of pathogenic or toxic microorganisms (Hallegraeff et al. 2004).Pathogenic bacteria are sources of infections and infectious diseases, ranging from typhoid fever (Salmonella typhi), to tuberculosis (Mycobacterium tuberculosis), pneumonia (Streptococcus, Pseudomonas) and food illnesses (other Salmonella) (Bodey et al. 1983;Rowe, Ward & Threlfall 1997;Hardy 1999;Ohl & Miller 2001;Cohen-Poradosu & Kasper 2007;Gordon & Parish 2018).Meanwhile, harmful algal blooms (Anderson et al. 2021) can produce highly potent neurotoxins (e.g.Alexandrium catenella), block sunlight for aquatic plants, and lead to hypoxic and anoxic water (Mohd-Din et al. 2020).A neurotoxin build-up can lead to serious injury or death in marine animals, freshwater animals and humans.The motility of many microorganisms (Jarrell & McBride 2008;Kearns 2010) makes them effective pathogens (Ottemann & Miller 1997) especially when using medical equipment.For example, biofilms can develop inside medical devices, such as catheters, and subsequent upstream motility of the microorganisms can then lead to infection (Figueroa-Morales et al. 2020).To develop improved insertion devices it is essential to understand the behaviours of motile microorganism suspensions in sheared flows, especially as the microorganisms approach surfaces.Harmful microorganisms can also contaminate water transport infrastructure, and if not dealt with early on (or prevented from colonising surfaces) can lead to illness, serious injury or death in local populations which consume the water.The prevention of such contamination is important for population well-being and also the associated industries which seek to meet governmental regulation targets.Since motile microorganisms are exceedingly small and typically on the micron scale (Childress 1981), swimming microorganisms perceive the fluids through which they traverse as highly viscous environments, and adapt their behaviour for motility in a regime with negligible inertia (Stokes flow).For this traversal, some motile microorganisms have developed long, slender appendages, known as flagella, which can create propulsion through various means (Brennen & Winet 1977).Bacteria swim by bundling their appendages and rotating them via specialised motors at flagellar bases; sperm pass waves along their tails (Lauga 2016); and microalgae (Goldstein 2015) use different strokes (recovery and effective strokes) to create asymmetry with various degrees of coordination (e.g.breaststroke motion in Chlamydomonas or metachronal waves in Volvox).
A field of much recent interest has been the study of microswimmers near walls, whether these be hydrodynamic interactions, the mechanisms of reorientation or accumulation to form biofilms.Experiments in confined environments have shown swimming cells to be attracted to surfaces with some authors hypothesising that the hydrodynamic interaction of the cells with the walls realigns bacteria parallel to the walls (Berke et al. 2008) whilst puller-type algae (front actuated swimmers which pull in the fluid from the direction of propulsion) approach walls at steep angles (Buchner et al. 2021).In microfluidic channels, the phenomenon of upstream swimming has been observed for bacteria (Hill et al. 2007;Kaya & Koser 2009) where E. coli swimming in a region below a critical flow speed can reorient and swim against the direction of fluid flow.However, in the presence 976 A13-2 https://doi.org/10.1017/jfm.2023.897Published online by Cambridge University Press of strong flow, swimming is dominated by fluid advection, and cells are transported downstream.In three dimensions, E. coli have also been observed to swim in clockwise circles near rigid surfaces (Frymier et al. 1995;Vigeant & Ford 1997;Giacché, Ishikawa & Yamaguchi 2010).Three-dimensional models for monotrichous bacteria near walls (Park, Kim & Lim 2019), which account for hydrodynamic interactions via regularised Stokeslets and the method of images, have also highlighted the importance of body aspect ratios to the inclination angles near walls and the radii of circular trajectories along walls, while finding that flagellar length affects whether bacteria can leave the wall.Meanwhile, numerical models without hydrodynamic interactions propose that the reorientation of swimmers interacting with walls can be explained purely mechanistically, by hitting a wall, maintaining orientation for a finite time scale, rotating via Brownian rotation and swimming away (Li & Tang 2009;Li et al. 2011;Costanzo et al. 2012;Elgeti & Gompper 2013).In this paper, we will study microswimmer distributions and microswimmer wall interactions for a dilute suspension via continuum modelling and stochastic individual-based simulations.Here we do not account for intercellular nor cell-wall hydrodynamic interactions, instead focusing on the impact of the bulk flow and swimmer geometry on cell trajectories, and explore a range of simplified boundary interactions.We can neglect the intercellular hydrodynamics as the suspensions are dilute.
We are interested in the relationship between the bulk flow and attachment dynamics, that occur through swimmer-wall interactions.To study the bulk behaviours of suspensions of microswimmers, continuum models have been developed to capture collective dynamics.These are developed as an alternative to expensive individual-based simulations.These types of models have been used to study several suspension phenomena such as bioconvection (Pedley & Kessler 1992), downwelling gyrotactic swimming (Fung, Bearon & Hwang 2020) or determining how sheared flow can lead to layer formation below surface levels for gyrotactic swimmers (Maretvadakethope, Keaveny & Hwang 2019).Early continuum-type models include advection-diffusion equations as introduced by Kessler (1986) where deterministic, directional dynamics are captured via advection terms, and diffusion terms act to capture the randomness of microswimmers.For gyrotactic swimmers, Pedley & Kessler (1990) developed a model which allowed both the directional swimming and the diffusion coefficient to be modified by the flow.It also accounted for reorientation of non-spherical particles by incorporating the reorientation of cells as described by Jeffery's equation (Jeffery 1922;Hinch & Leal 1972).This is particularly important due to the assumption that cells in a volume element swim relative to the fluid in the direction of cell orientation.Another continuum model of note is the Smoluchowski equation, which models active suspensions using continuum kinetic theories, as reviewed in detail by Saintillan & Shelley (2013).The Smoluchowski equation describes the cell distribution via a probability distribution function dependent on time, physical space and orientational space.For three-dimensional physical space, the problem has seven-dimensional dependence and is rarely solved in full generality due to the computational cost.To reduce the problem the effective transport coefficients for the advection and diffusivity can be estimated by only using the local flow dynamics, and in generalised Taylor dispersion (GTD) the diffusivity is approximated from the probability distribution function of a tracer particle in orientation and physical space (Frankel & Brenner 1993;Hill & Bees 2002;Manela & Frankel 2003).Although the GTD model is more accurate than the Pedley & Kessler (1990) model at high shear rates (Croze et al. 2013;Croze, Bearon & Bees 2017;Fung et al. 2020), it can fail for straining dominated flows.A recent new transport model (Fung, Bearon & Hwang 2022)  dispersion terms approximated as functions of local flow fields, allowing it to be applied for any global flow field.In our study of boundaries and bulk distributions we will consider a two-dimensional physical space Smoluchowski equation which reduces the problem to three-dimensional dependencies.The results from our study will have implications on broadening the validity of models such as the doubly periodic Poiseuille flow models (Vennamneni, Nambiar & Subramanian 2020), justifying their application in capturing the dynamics and cell distributions for bounded domains.
Given that the geometry of swimmers (particularly their aspect ratios) affect swimmer orientations in the bulk flow, the orientation distributions for swimmers interacting with walls are affected as well, thus prompting our study into determining how bulk flow and cell shape play a role in how microswimmers approach walls.Furthermore, there is the problem of determining appropriate boundary conditions to be used in continuum models, such as in Bearon & Hazel (2015) and Ezhilan & Saintillan (2015).For the physical scenario where cells are conserved in the flow and there is no absorption at the walls, a natural boundary condition is a no-flux condition in physical space.This corresponds to the integral of the flux terms over all orientations being zero at the wall.Meanwhile, for the case of wall absorption, the flux at the wall is non-zero and time-dependent.A no-flux condition by itself does not specify the probability density of orientation distributions at the wall, and is not a sufficient condition to obtain a unique solution.In Bearon & Hazel (2015) and Ezhilan & Saintillan (2015) a pointwise no-flux boundary condition was proposed for a finite element solution, imposing that the flux in every direction must be zero for all microscale orientations.However, this is not a sensible boundary condition because the formulation of the two-dimensional equilibrium Smoluchowski equation leads to unrealistic cell densities in a boundary layer.We note that while some continuum models impose the additional constraint of perfect symmetry in azimuthal angles and spatial changes in orientation at boundaries to satisfy no-flux (Jiang & Chen 2020), there exist further implicitly and explicitly imposed boundary conditions of interest that satisfy cell conservation.We also note that in individual-based dynamics, there exist various boundary interactions for Brownian swimmers (Jakuszeit, Croze & Bell 2019), such as specular reflection (Volpe, Gigan & Volpe 2014;Kumar et al. 2021), and different types of surface sliding models (Sipos et al. 2015;Spagnolie et al. 2015;Zeitz, Wolff & Stark 2017).Potential-free methods (Peng & Brady 2020;Kumar et al. 2021) have also been developed to study suspension dynamics.In our study we consider suspensions in channels with height W = 426 μm (see table 1) and typical bacterial lengths of 1-2 μm.The separation of length scales allows us neglect particle size.We approximate surface interactions as point-like (Saintillan & Shelley 2013;Ezhilan & Saintillan 2015) without concern about swimmer exclusion areas at the wall, as required when studying swimmers in microfluidic channels (Chen & Thiffeault 2021).We further ignore hydrodynamic interactions with walls for simplicity, allowing us to study various pinball-like wall interactions.
In this paper, we develop and analyse dynamics captured by two types of mathematical models (continuum models and stochastic individual-based models) to determine under what conditions it is sensible to use different continuum model boundary conditions to capture different types of physical wall-interactions.We also study the underlying bulk-flow behaviours which lead to different distributions of wall interactions.We will introduce governing equations ( § 2.1) and outline the numerical methods for solving these ( § 2.2) via an individual-based stochastic method ( § 2.2.1) and continuum model ( § 2.2.2).We will consider three types of particle-wall interactions (specular reflection, uniform random reflection and wall absorption) using individual based stochastic models and consider the validity of three continuum models to capture the corresponding dynamics.We compare the relationships between specular reflection at wall boundaries with a  Berg (1993) and Rusconi et al. (2014) and used by Bearon & Hazel (2015).
continuum doubly periodic Poiseuille flow model ( § 3.1.1);between randomised reflections and continuum model with constant Dirichlet wall conditions ( § 3.1.2);and between perfectly absorbing boundaries and a continuum model with zero Dirichlet constant wall conditions ( § 3.1.3).Finally, we will also analyse the role of shape, shear and diffusion dependent bulk flow dynamics on wall-interaction behaviour ( § 3.2) and develop a novel accumulation index to quantify the importance of underlying deterministic trajectories on wall interactions ( § 3.2.2).

Conservation equation for ψ
We begin by considering the conservation equation for the probability distribution of microswimmers ψ(x, p, t) that is dependent on swimmer position, x, swimmer orientation, p, and time, t, where ∇ x and ∇ p are the gradient operators in physical space and orientational space on a unit sphere of orientations Ω, respectively.The translational flux, ẋ, and orientational flux, ṗ, as given in Saintillan & Shelley (2013), are The translational flux is dependent on the fluid velocity u, the cell swimming at speed V s in direction p and translational diffusion D T .The orientational flux for an asymmetric swimmer with a shape factor (Bretherton constant) β, consists of the rotation characterised by the rate-of-strain tensor E, background vorticity ω and Brownian rotational diffusion d r .The shape factor β is restricted to 0 ≤ β < 1 for prolate shapes as in previous studies (Bearon & Hazel 2015) where β = 0 corresponds to spherical swimmers.We do not consider oblate swimmers as most microswimmers of interest are spherical or rod-shaped (Dusenbery 1998).
There is no flux through the walls in a confined geometry if the flux at the walls satisfies where n is normal to the wall.Due to the non-penetration of the fluid at the walls, this can be simplified to (2.7) A no-flux condition is of interest for problems that require cell conservation such as when individual cells undergo specular or random reflection at boundaries.Note, however, that no-flux does not hold for absorbing boundaries.

Two-dimensional channel flow
To expand upon the study of two-dimensional channel flow as motivated by experiments (Rusconi, Guasto & Stocker 2014) and numerical studies (Bearon & Hazel 2015;Vennamneni et al. 2020), let us consider a horizontal channel of height W (as shown in figure 1a), such that for a coordinate system (X, Y) with orthonormal base vectors i, j, the channel walls are at positions Y = ±W/2.Suppose there is a parabolic flow through the channel with velocity where U is the centreline flow speed of the channel.
We also take the cell orientation to be constrained in the two-dimensional plane, so that the direction of orientation p can be defined in terms of the angle θ measured from the horizontal, p = cos θi + sin θj. (2.9) We non-dimensionalise the system with length and time scales L = W/2 and T = W/2U, respectively, such that our coordinate system can be redefined as (x, y) = (2X/W, 2Y/W), with boundaries located at y = ±1.Taking ψ to be independent of x, this leads to the two-dimensional conservation equation There is no flux at the boundaries if the following condition is satisfied: (2.11) Note that (2.11) is not suitable to use as a boundary condition on its own due to the non-uniqueness of its solutions (Bearon & Hazel 2015).Here, ν = V s /U is the ratio of the swimming speed to the centreline velocity, Pe = 2U/Wd r is the rotational Péclet number and Pe T = WU/2D T is the translational Péclet number.The parameters used are given in table 1.We also introduce the cell concentration distribution n( y, t) = 2π 0 ψ(θ, y, t) dθ. (2.12) For the steady state problem, with ψ independent of time, the time-independent cell concentration distribution is Taking the limits of Pe T , Pe → ∞ we can extract the case of a purely deterministic system without diffusion.Computationally, this is implemented by replacing the diagonal entries of the matrix with zeros.The effect of rotational diffusion in x-y space is illustrated in figure 1(c), where the IBM is augmented with an x-direction advection term (details given in Appendix A).
For the SDE, we consider boundary conditions for three types of physical boundary interactions at walls y = ±1: specular reflection; uniform random reflection; and an absorbing boundary (see figure 1b).In the case of specular reflection (boundary condition S), swimmers with angles of incidence θ i instantaneously reorient to θ r = 2π − θ i such that θ i , θ r ∈ [0, 2π).For uniform random reflection (boundary condition R) (2.18) where U(0, 1) is a uniformly distributed random number in the interval (0, 1).Meanwhile, for a perfectly absorbing boundary (boundary condition A) trajectories terminate upon impact with a wall.
To calculate the probability distribution ψ from the stochastic IBM in bounded domains we run simulations for 10 6 stochastic swimmers which are uniformly initialised over the domain (θ, y) ∈ [0, 2π) × [−1, 1] with sampling step size dt = 0.1 with 20 subintervals each (which are then calculated to approximate the continuous process better).For the case of specular reflection S and random uniform reflection R we impose a normalisation condition 2π 0 1 −1 ψ(θ, y) dy dθ = 4π for ease of comparison of θ distributions at the wall ( § § 3.1.1and 3.1.2).Similarly, for the absorbing boundary case A ( § 3.1.3),we introduce an initial normalization condition 2π 0 1 −1 ψ(θ, y, 0) dy dθ = 4π.Time step convergence is checked by comparing the concentration distributions obtained with sampling step size dt = 0.025.For any simulation where we want distributions at runtime T sim the probability distribution is calculated from trajectory end-states.The runtime for endstate convergence (i.e. when doubling the runtime does not change the macroscopic properties of the probability distribution such as local cell densities) is shape dependent, and adjusted accordingly.For comparison with the specular reflection problem and verification against continuum models we also develop a double Poiseuille flow model.For this, we extend the flow domain to allow for a doubly periodic flow profile as shown in figure 2(c).The background fluid flow, u, for domain y such that the background flow for y ∈ [−1, 1] is identical to the background flow for a simple Poiseuille flow in the channel.We implement periodic boundaries in y, such that for incident positions and impose a normalisation condition 2π 0 2 −2 ψ(θ, y) dy dθ = 8π.

Continuum model
To solve the two-dimensional continuum model for the probability distribution ψ, we use a Galerkin finite element method, as in Bearon & Hazel (2015), implemented in the C++ library oomph-lib (Heil & Hazel 2006).We solve for the continuum solution by multiplying (2.10) by a y-and-θ -dependent test function N(θ, y), integrating over the domain, and integrating by parts, to obtain the weak form (2.21) The equations are discretised using finite elements on a grid n θ × n y , with n θ and n y varying dependent on the boundary condition type and Péclet number of interest.Across all models, simple periodic boundary conditions are applied in the θ-direction to ensure the angles of orientation wrap around, i.e. ψ(0, y) = ψ(2π, y) for all y.Three different boundary conditions will be applied for the continuum problem: a doubly periodic Poiseuille flow model DP; a pinned non-zero Dirichlet constraint D C ; and a pinned zero Dirichlet constraint D 0 .Note that while models like DP satisfy no-flux (2.11) by symmetry and periodicity arguments, we do not explicitly impose no-flux in any of the continuum models.Furthermore, no-flux is inherently not satisfied by zero Dirichlet constraint D 0 except for the trivial solution ψ(θ, y) = 0 for all (θ, y).
A Dirichlet constraint (D C ) will be imposed for a wall-bounded domain The values of the constant emerges upon the enforcement of the normalisation condition 2π 0 1 −1 ψ(θ, y) dy dθ = 4π.When solving the steady-state equilibrium problem (i.e. the first term in (2.21) is set to zero), the elements in the θ-direction are uniformly distributed and the elements in the y-direction are non-uniform to allow for higher resolutions near the wall.A piecewise linear scaling is implemented to restrict half the elements to |y| ≥ 0.99.
For the double Poiseuille problem (DP), we adapt the finite element model by extending the flow domain to allow for a doubly periodic flow profile as shown in figure 2(c) and shown in (2.19) such that the background flow for y ∈ [−1, 1] is identical to the background flow for a simple Poiseuille flow in the channel.For the steady-state problem we implement periodic boundary conditions with normalisation condition 2π 0 3 −1 ψ(θ, y) dy dθ = 8π.The double Poiseuille flow profile is C 0 continuous in shear and C 1 continuous in velocity at y = ±1.While the extended flow velocity profile introduces a discontinuity in the second derivative of the flow velocity in y about y = 1, this does not lead to any difficulties with the finite element discretisation, as the implementation only requires continuity of the first derivative.The elements in the y and θ-directions are uniformly distributed.

Results
First, we study different physical boundary-interaction scenarios and determine appropriate continuum boundary conditions for capturing their dynamics ( § 3.1).We consider three types of wall interactions: specular reflection S ( § 3.1.1);uniform random reflection R ( § 3.1.2);and absorbing boundary A ( § 3.1.3).For each case we find a corresponding continuum model.Then, we consider different bulk flow and particle properties and analyse how they affect cells approaching boundaries ( § 3.2) for the diffusive case ( § 3.2.1)and for the deterministic case ( § 3.2.2).

Specular reflection (boundary condition S)
In this section we investigate the IBM with specular reflection S and consider how it compares with a continuum doubly periodic Poiseuille flow, DP.In the literature, double Poiseuille flows have been used for studying low and high shear trapping in the bulk flow of bacterial suspensions to circumvent the problem of explicitly implementing a boundary (Vennamneni et al. 2020), but there has been no comparison between the wall dynamics of specular reflection IBMs and continuum doubly periodic Poiseuille models.
Consider the case of a bounded, stochastic IBM with boundary condition S (figure 2b) with Pe = 10 1 , Pe T = 10 6 , ν = 0.04 and β = 0.99, quantifying rotational diffusion, translational diffusion, velocity ratios and cell shape, respectively.The lowest trajectory in figure 2 highlights a cell trajectory which starts oriented downstream near the bottom wall (θ = 2π), reorients rapidly until it is aligned upstream (θ = π), and enters a region of accumulation (the yellow region) closer to the bottom wall.Once there, the cell moves up and down in the channel due to translational diffusion effects with orientation approximately parallel to the flow direction.If no longer pointed parallel to the flow direction due to rotational diffusion and shear effects, it reorients rapidly again.The extended alignment with the flow direction is a result of the shape-dependent Jeffery orbits, in which local sheared flows cause particle rotation and straining.In addition to reorientation due to Jeffery orbits, there exist additional variations of cell trajectories in orientation space because rotational diffusion can counteract or enhance reorientations and thereby affect the spreading of trajectories in physical space.
The macroscopic areas of accumulation in phase space (θ, y) are dependent on both the shape and the motility of the swimmers.The thickness and location of the areas of accumulation are dependent on the balance between deterministic shape-dependent effects and diffusion effects.In figure 3(a-c) we consider probability distribution functions of cell distributions for β = 0.99, ν = 0.04 and Pe T = 10 6 .For high diffusion (see figure 3a), there exist two regions of accumulation and two regions of depletion of equal widths at each wall, resulting from strong, continuous mixing of cells.With increasing Pe (see figure 3b,c), the relative diffusive effects decrease and deterministic effects begin to dominate.Due to the nature of Jeffery orbits (which have been described earlier), more cells will be parallel to the flow direction.The reduced diffusion ensures decreased spreading in orientation space, thereby leading to thinner areas of accumulation in the (θ, y) phase space.For very weak rotational diffusion Pe = 10 4 (see figure 3c) the areas  of accumulation become very thin and cells swim away from the walls leading to peaks of accumulation at (θ, y) = (π, ±0.5), in agreement with observations by Rusconi et al. (2014) and Zöttl & Stark (2013).
Next, we consider the continuum doubly periodic Poiseuille flow, that serves as a potential alternative for capturing the bulk flow in the bounded domain.Consider the finite element model with a doubly periodic flow profile as shown in figure 2(c).Comparing the lower subdomain for the finite element double Poiseuille model θ ∈ [0, 2π], y ∈ [−1, 1] in figure 2(a) with the bivariate stochastic IBM distribution (figure 2b) we find similar bulk-flow dynamics with regions of cell accumulation above y = −1, at angles slightly greater than θ = 0, π.Meanwhile, just below y = 1, near the 'upper wall', there also exist two areas of accumulation of equal intensity, but of flipped geometry, for angles just below θ = 2π and θ = π.In both cases, these areas of accumulation correspond to swimmers oriented close to the horizontal, but pointing out of the wall and into the wall, respectively.When comparing the probability density distributions of the doubly periodic Poiseuille continuum model (figure 3d-f ) with the IBM with specular reflection (figure 3a-c) for increasing Pe, we observe the same sharpening of accumulation areas, with the occurrence of localised peaks in both figure 3(c, f ).The thickness of the areas of accumulation agree as well as the intensity of cell accumulations.
Next, we compare the cell concentration distributions of swimmers, n( y), across the channel height y ∈ [−1, 1] for β = 0.99, for different values of rotational diffusion (Pe = 1, 10 1 , 10 2 , 10 4 ).Direct comparisons between the doubly periodic continuum model (figure 4a), a doubly periodic IBM (figure 4b),and the wall-bounded IBM with specular reflection S (figure 4c specular reflection exhibits some cell depletion as highlighted in figure 4(d).The observed depletion is observed consistently for medium Pe, and is a result of specular reflection in the IBM.Comparing with the bivariate distribution in figures 2(b) and 3(b), we note that there is a cell depletion around θ = 0 for y = −1 and θ = π at y = 1 that is not captured by the continuum model.A contributing factor to this cell depletion is finite time stepping.Due to the finite nature of time steps in the SDE problem, cell trajectories can drift, leading to reduced cells around θ = 0 for y = −1 and θ = π at y = 1.No matter how small the time-step error, cumulative effects can lead to considerable errors over long times, hence producing less accurate local distributions as time evolves (see Appendix B for details of cell trajectory drift in deterministic problems and at medium Péclet numbers).For high Pe the migration of cells towards the channel centre due to low shear trapping (Vennamneni et al. 2020) results in low cell concentrations at the wall.The effects of drifting due to finite time step sizes are small because there are low cell concentrations at the wall.Meanwhile, for low Pe, the high rotational diffusion results in model-dependent depletion being largely counteracted.However, it is important to note that while the finite time step can contribute to the localised depletion, the observed depletion for medium Pe is significantly larger than those expected from compounded cell drifting.This suggests that the regions of cell depletion are inherent features of specular reflection at medium Pe.While the origin of these large dips are still unclear, their appearance only for a range of medium Péclet shows that there exists a balance between advective time scales and rotational diffusion time scales over which a stable layer of depletion occurs.Overall, we note that the observed structures and positions of cell distributions obtained across all three models are in good agreement in the bulk flow across the studied range of rotational diffusions, capturing centreline cell depletion measured for medium-to-high rotational effects (low-to-medium Péclet numbers) as observed in experiments (Rusconi et al. 2014) as well as numerical and analytical studies (Bearon & Hazel 2015;Vennamneni et al. 2020).The strong agreement in the bulk flow and near the walls for high and low Pe suggests that the doubly periodic Poiseuille continuum model might be a sensible modification for capturing the cell distributions of elongated swimmers undergoing specular reflection at high and low diffusion effects, but not for medium Pe near the wall.
While the cell concentration distribution n( y) tells us about the agreement in the relationship between the three models in terms of cell accumulation for β = 0.99, it does not allow for any insight into the orientations of the swimmers at or near the walls.In figure 5 we compare the probability density distributions ψ(θ, y) for the doubly periodic Poiseuille flow continuum model (figure 5a-c), the IBM double periodic Poiseuille flow case (figure 5d-f ) and the IBM specular reflection model (figure 5g-i), for Péclet numbers Pe = 1 (figure 5a,d,g), Pe = 10 1 (figure 5b,e,h) and Pe = 10 2 (figure 5c, f,i).For direct comparison between the doubly Poiseuille models we plot the distributions at y = −1, given by solid lines, for shape parameter β = 0, 0.5, 0.99.To provide a comparison between the continuum model and the IBM we need to account for the numerical cell depletion.To capture near-wall cell distributions, we plot the probability distributions just beyond the model-induced depletion area near the walls at y near = −1 + 3 for = 0.04, as dashed lines.
We note that across the continuum models for spherical swimmers (β = 0 given by the blue lines), the orientation distribution is constant, indicating that surface interactions in the absence of hydrodynamic wall interactions, show no preferential orientation.This uniformity is due to spherical swimmers undergoing a constant rate of reorientation in sheared flows as spheres have no preferred direction.This is confirmed further by both IBM models, which do not display any preferential wall interactions orientations for all considered orientational Péclet numbers.For shape parameters β = 0.99 with Pe = 10 4 (blue), Pe = 10 2 (red), Pe = 10 1 (yellow) and Pe = 1 (purple).
For the case of high rotational diffusion, Pe = 1, we note that all distributions for non-spherical swimmers peak at approximately θ = π/4 and θ = 5π/4 (with troughs at approximately θ = 3π/4 and θ = 7π/4) across all models, with peak concentrations increasing with cell elongation.As the rotational diffusion decreases, corresponding to an increase in the rotational Péclet number, the peaks shift towards θ = 0 and θ = π for all β, with peaks clearly sharpening for the case of β = 0.99.For β = 0.5 there is a non-monotonic change in ψ peak , shifting from ψ peak ≈ 1.3 to ψ peak ≈ 1.5 to ψ peak ≈ 1 for Pe = 1, 10 1 , 10 2 , respectively.The shift in peaks has a two-fold origin: the relative roles of advection and swimming (deterministic effects) versus diffusion effects, and the shift in the bulk cell distributions due to high-and low-shear trapping.In the aforementioned case, as rotational diffusion effects decrease (increase from Pe = 1 to Pe = 10 1 ) the decrease in randomness leads to decreased orientational spreading and sharper peaks.The slight elongation of cells (β = 0.5) results in cells spending more time aligned parallel to the flow direction.Meanwhile high-and low-shear trapping are phenomena observed by Vennamneni et al. (2020), where high-shear trapping refers to the shape and rotational diffusion-dependent migration of cells towards channel walls, and similarly, low-shear trapping refers to the migration of swimmers towards the centreline.In our studies, both high-shear trapping and low-shear trapping are captured for β = 0.99, as evidenced by the high-shear trapping leading the peak of the wall distribution increasing from ψ peak ≈ 1.6 to ψ peak ≈ 4 to ψ peak ≈ 8, for Pe = 1, 10 1 , 10 2 , respectively, before a transition to low-shear trapping for Pe = 10 4 in figure 4 as the cells move away from the walls.
We further compare the profiles across the different models.For a small Péclet number Pe = 1 (see figure 5a,g) the profiles at y near (the dashed lines) are in good agreement, with   similar peak magnitudes and spreads.The IBM distributions for β = 0 are in agreement with the doubly Poiseuille cases in figure 5(a-i).For Pe = 10 2 and β = 0.99 (figure 5c,i) the central peaks about θ = π are of similar height.However, the central peak about θ = π is slightly larger in the individual-based model, due to the localised depletion of the peak profile about θ = 0.The depletion of the peak is, however, minor as the rotational diffusion is sufficiently large to feed more cells into the depletion areas.It is further worth noting that at Pe = 10 2 drifting in long time distributions is only significant at y near for elongated swimmers as the deterministic trajectories of elongated swimmers point more sharply away from the wall about θ = 0, leading to an increased radius of depletion compared with more spherical swimmers.Running IBM double Poiseuille simulations, as shown in figure 5(d-f ) corresponding to Pe = 1, 10 1 , 10 2 , we find that the probability distributions at y = −1 (solid lines) match with those obtained from the continuum model figure 5(a-c) after sufficiently long runtimes.
Comparing the specular reflection IBM with the continuum double Poiseuille models, we find a good fit in the probability distributions at y = −1 + 3 within the studied range of rotational diffusion strengths and elongations.We see that all peak height and width distributions are in agreement, with only a slight discrepancy between the peak heights at Pe = 10 2 for β = 0.99 in the specular reflection IBM, indicating larger spatial depletion at high Pe for strong elongation.
The good fit between the specular reflection IBM and the doubly periodic Poiseuille continuum model for small and large Pe raises the question of how the doubly periodic model's symmetry constraints on ψ and ∂ψ/∂y at y = ±1 relate to the literature (Jiang & Chen 2019, 2020).From figure 5(a-f ), we note that for the periodic boundary cases, the equilibrium cell probability density distributions satisfy ψ(θ, ±1) = ψ(θ + π, ±1) and that the derivatives satisfy (∂ψ/∂y)(θ, ±1) = −(∂ψ/∂y)(θ + π, ±1).Note that it is not necessary for all the derivatives to be identically zero for all θ.The combination of these symmetries ensures the flux condition J θ (±1) = −J θ +π (±1), the integral no-flux at the boundary and impermeability are all satisfied for the equilibrium problem.We note that this observed boundary flux relationship for the DP model differs from Jiang & Chen (2019, 2021), in which for their time-evolving continuum models with non-uniform initial condition, the flux condition itself was prescribed to be specular, by imposing the equivalent of J θ (±1) = −J 2π−θ (±1), through the constraints ψ(θ, ±1) = ψ(2π − θ, ±1) and (∂ψ/∂y)(θ, ±1) = −(∂ψ/∂y)(2π − θ, ±1), in our coordinate system.This was then compared with a double Poiseuille with half-channel flows being in the same direction which has a jump in shear at y = ±1.We note that the imposed conditions in Jiang & Chen (2019) satisfy the no-flux condition, and though the bulk results are consistent across Jiang & Chen (2019) and our model, the imposed wall behaviours in Jiang & Chen (2019) differ from those that emerge in our continuum model.Recalling, that our continuum model does not capture the dip at the wall from the specular IBM for medium Pe, we consider the probability distribution ψ even closer to the bottom wall at y = −1 + for β = 0.99 and Pe = 10 1 in figure 5(h) as given by the dotted line.We find that the distribution can change significantly across the small length scale of 2 , from a π-periodic distribution to a π-symmetric probability distribution.This wall symmetry is consistent with the model developed by Jiang & Chen.Furthermore, it has been confirmed via private communications that the alternate model used in Jiang & Chen (2019, 2021) captures the near-wall dips that the DP model does not capture, suggesting it is a more appropriate boundary condition for medium Pe and potentially more appropriate overall.As both systems satisfy the no-flux and the expected bulk flow dynamics, this reinforces the importance and sensitivity in the choice of boundary conditions when developing continuum models for active suspension dynamics.
While we have shown that the dynamics from specular reflection are well captured by a continuum approximation with doubly periodic boundary conditions, we know that microswimmers' surface interactions are not perfect specular reflections with a variety of factors affecting surface scattering (Kantsler et al. 2013;Théry et al. 2021).A swimmer near the wall may remain oriented upstream for a significant period of time, it may attach to the surface, or it may leave the surface at varying outgoing angles which may  be independent of the incident angles.Keeping this in mind, we consider the effects of two further wall-interaction models: perfectly random reflections ( § 3.1.2)and perfect absorption ( § 3.1.3)

Random reflections (boundary condition R)
In this section, we consider the effects of random uniform reflections at the boundaries on the equilibrium dynamics of microswimmer suspensions.Consider the model with random uniform reflection out of the wall as defined by (2.18), such that the angle of reflection of each swimmer is independent of the angle of incidence.In figure 6(a-c), we see the bivariate cell probability density distribution ψ for β = 0.99 for varying rotational Péclet numbers.By inspection, the bulk flow distributions are similar to those found via the doubly periodic continuum model and the specular reflection IBM, with areas of cell accumulations which sharpen with increased Pe.However, from figure 6(c) we clearly note the appearance of secondary peaks at (θ, y) = (0, ±0.93) for Pe = 10 4 , and also note smaller peaks occurring at (θ, y) = (0.13, −0.94) and (θ, y) = (2π − 0.13, 0.94) for Pe = 10 2 (figure 6b).No clear peak is visible for Pe = 1, as rotational effects dominate deterministic secondary structures.We note further, that the upper bound of the aforementioned secondary peaks are bounded at θ = 0 by the cusp of the deterministic trajectory originating from y = −1 and θ = π.
Noting that the secondary peaks are wholly introduced by the uniform reflective conditions, we seek to determine the appropriate continuum model boundary condition to obtain the corresponding bulk dynamics.To capture the uniformity of reflection, and lack of orientation preference upon reflection, we consider a continuum model with a constant Dirichlet wall-boundary condition (constraint D C introduced in § 2.2.2) such that ψ is the same constant on both walls.From figure 6(d-f ) we find secondary peaks occurring at the same points in phase space, indicating that slightly away from the wall there is an enhanced number of cells swimming downstream.To further confirm the suitability of comparing the IBM with random uniform reflection with the continuum model with a constant Dirichlet boundary condition, we consider the cell number density distributions in figure 7. We compare the distribution obtained from both models in figure 7(c) for β = 0.99.We find that both profiles for Pe = 10 4 (the blue lines) have the same primary peaks about y = ±0.5 as observed for the IBM with specular reflection, but we also get a significant peak in density about y = ±0.93 in both figures.We further note that in both the continuum and IBM models the minimum cell densities occur at y ≈ ±0.85.While there are discrepancies in the size of the secondary peaks found near the wall via the IBM, we find that their size is limited by the finite time steps.Too large time steps result in cells drifting away from the secondary peaks.We find that there is a computational trade off in the total runtime required to capture the macroscopic effects (such as the peaks and troughs) and the smallness of time steps required to capture the slim secondary peaks.This drift-dependent reduction in the peak is especially prominent for the case of Pe = 10 4 where diffusive effects are weak.For this case, the slim secondary peaks are highly susceptible to compounded drift effects as the peaks occur just below a separatrix that for deterministic trajectories would separate cells that would always interact with the wall and those that cannot.In this case, compounded time-step dependent drifts are large enough that they can push cells out of a region that would allow for cells to interact with the wall.This ultimately leads to some cells depleting from the secondary peak to the nearest trough of cell accumulation and to the primary peaks.
Comparing figures 7(a) and 7(b) we similarly find the distributions for Pe = 10 2 to be a good match with the previous models (figure 4) except at the locations of the secondary peaks.Finally, there is good agreement between the IBM and continuum models for Pe = 1, suggesting that overall the uniform reflection boundary is most accurate for low Pe.

Perfectly absorbing boundary (boundary condition A)
Our final boundary condition of interest is the case of perfect wall attachment A, i.e. any swimmer that encounters the wall will adhere to it.For ease of comparing the effect on the bulk dynamics we allow for specular reflection at the top wall (y = 1) while enforcing a perfectly absorbing bottom wall, such that cell trajectories are terminated upon contact with the bottom wall (y = −1).It is worth noting that given the presence of diffusive effects, given sufficient time, all cells will attach to the bottom wall.
Let us begin by considering a snapshot of the bivariate probability density distributions ψ at time T = 600 for the stochastic IBM.In figure 8(a) (β = 0.99 and Pe = 1), the distributions show clear depletion near the bottom wall, as all cells that have been able to encounter the bottom have attached.In figure 8(b) (for Pe = 10 2 ) fewer cells are captured by the bottom wall by time T = 600, however, there is a clear depletion, and the accumulation band in the bottom-half contains approximately 75 % the number of cells compared with their upper-half channel specular-reflecting counterparts.Finally, we consider figure 8(c) (for Pe = 10 4 ).The yellow line is a separatrix for fully deterministic cell trajectories, where all cells below the line must interact with the wall, and all cells above will not in the absence of diffusion.We find that figure 8(c) mainly has depletion of cells originating below the separatrix, as cell diffusion is very small.For the absorbing boundary condition, there exists a non-zero flux because cells are leaving the bulk flow at the boundaries.In figure 8(g) we consider the fraction of cells absorbed at the bottom wall in time, which measures the cumulative cell flux at the wall.We find that the highest absorption rate is at the start when the cell density near the surface is at its highest.As the rate of cell absorption decreases continuously in time, the integral of the flux must change in time too.We also note see that by T sim = 600 approximately 30 %, 12 % and 5 % of total cells were absorbed at the bottom wall for Pe = 1, 10 2 , 10 4 , respectively, with absorption plateauing earliest for Pe = 10 4 (yellow line).Therefore, higher diffusion effects yield higher rates of wall absorption for extended times.
In figure 8(d-f ), we consider the normalised orientation distributions of the cells which have been absorbed at the bottom wall.In figure 8(d) we find that in the presence of high diffusion, the wall-encounter probability distributions are wide, centred about θ peak ≈ 21π/16, and the distributions remain unchanged for T = 50, 100, 600.For Pe = 10 2 in figure 8(e), the peak near θ = π continuously increases in time.This is due to a localised increase in the number of swimmers crossing the separatrix (from figure 8c) with time.The rotational diffusion is sufficiently weak that deterministic effects dominate and cells are quickly captured by the absorbing condition just above θ = π.Finally, for figure 8( f ), we note a similar increase in the peak near θ = π.In fact, across figure 8(d-f ), we find that the peak orientations at which absorptions occurs shifts from θ peak ≈ 21π/16 towards θ peak = π with decreasing rotational diffusion.The difference in distribution for increasing Péclet number is a result of swimming and fluid advection dominating diffusion effects.The role of diffusion effects on cell interactions with walls will be studied in more detail in § 3.2.
We compare these results with the time evolving continuum model where we model the perfectly absorbing wall at y = −1 with Dirichlet boundary condition D 0 (see § 2.2.2 for details), and use the double Poiseuille profile to capture the reflective boundary condition at y = 1.Note that as the continuum formulation imposes the constraint ψ( y = −1, θ, t) = 0 for all times, the continuum model cannot provide wall probability distributions comparable to figure 8.In figure 9 we compare the early time evolution of cells near the absorbing boundary using the continuum model with boundary condition D 0 and stochastic boundary condition A. At t = 0, the stochastic system is initially uniformly distributed (see figure 9b), and the continuum model (figure 9a) has a uniform distribution everywhere except at the very thin boundary layer as defined in § 2.2.2.By t = 0.4, it is clear from figure 9(c,d) that cells near the wall oriented into the wall with π < θ < 2π move to the bottom wall, and those with orientations 0 < θ < π swim away from the bottom wall, leaving an area of depletion.Across both models, with increasing time (figure 9e, f ), the depletion area grows, emanating into the bulk domain from 0 ≤ θ < π as cells continue to be absorbed at y = −1 and π ≤ θ < 2π.This persists despite the emergence of the macroscopic areas of accumulation sharpening in time.In figure 9(g,h  .Snapshots of the effects of a perfectly absorbing wall condition for different Pe at the bottom wall for an IBM (with dynamics at the top wall prescribed by specular reflection) on the bulk dynamics (a-c) at T sim = 600 and on normalised wall orientation probability distributions for β = 0.99 (d-f ) for runtimes T sim = 50, 100, 600.The yellow line in (c) is a separatrix between fully deterministic trajectories which interact with the bottom wall and those that do not.In figures (d-f ), the black dashed lines correspond to wall distributions for β = 0.99 as calculated by the accumulation index (see § 3.2.2).Here: (a,d) Pe = 1; (b,e) Pe = 10 2 ; and (c, f ) Pe = 10 4 ; (g) time evolution of the fraction of cells absorbed by the bottom wall.
we see the time evolution of the cell concentration distributions for absorbing boundaries at different instants in time (see also supplementary movie 1).The concentration profiles capture the cell depletion away from the wall across both models.The depletion front (the location in y at which we see sharp dip in cell concentration n( y)) moves into the bulk at comparable rates across the IBM and continuum models in figure 9(g,h).While the macroscopic areas of accumulation are already visibly beginning to form (see figure 9a-f ) it is worth noting that in the time-evolving cell concentration profiles the cell distributions are still uniform near the wall aside from the region of cell depletion due to the absorption boundary condition.This stands in contrast to the cell equilibrium profiles for other boundary conditions (see figures 4 and 7) where there are greater spatial variations in n( y) cell concentration across y.This highlights the existence of a faster time scale of interest, which will be discussed further in § 3.2.2.

Bulk flow dynamics effects on wall approach
In this section we analyse how the underlying bulk flow dynamics of swimmers of different shapes in sheared fluids impact their orientations at wall-approach in the θ-y space.This is of particular interest as individual swimmer dynamics inform how suspensions interact with the walls, and sheds insights into why swimmers of different geometries are more likely to interact with walls at different preferred orientations, thereby affecting their likelihood of wall attachment and biofilm formation.

Diffusive wall approach
From the perfectly absorbing IBM ( § 3.1.3)we know that as time evolves the orientation of the cells as they interact with boundaries evolves (see figure 8d-f ).The time evolution and spread of orientations at the point of wall interaction is shown to be diffusion dependent.We can analyse the extent of diffusion dependence by considering two regions of cell origin.If cells are initially uniformly distributed in the phase space, in the deterministic case we can clearly divide the cells in the phase space into two regions with respect to the yellow deterministic streamline in figure 8(c).We call the area of interactions (below the yellow line) 'Region 1', and the area above 'Region 2'.In the absence of diffusion, only Region 1 cells interact with the walls.However, with increasing diffusion, larger quantities of microswimmers cross the deterministic streamlines, and more cells from Region 2 interact with the walls.The shift in interactions is captured in figure 10 for fixed IBM runtime T sim = 600 through stacked probability distributions, where the total number of wall interactions across 51 bins are normalised to 1.For the case of Pe = 10 4 with β = 0.99, the orientation distribution peaks tend towards θ → π as β → 1 (see figure 10c).This means that there is increased upstream alignment with elongation.From figure 10(d) we find that in this low rotational diffusion case, over 80 % of all wall interactions originate from Region 1, and this percentage decreases monotonically with Pe, irrespective of swimmer shape.An increase in rotational diffusivity, corresponding to Pe = 1 (figure 10a) shifts the peak of the distribution to θ peak ≈ 21π/16.

Deterministic wall approach and underlying dynamics
To further understand what happens when there is an absorbing wall we develop a novel accumulation index to capture the orientation for the fully deterministic case.To analyse shape effects on wall interactions we consider the deterministic problem, in which we keep the purely deterministic drift term and remove diffusion dynamics, such that dy dt = ν sin θ, (3.1) where C is a constant dependent on particle initial conditions (θ 0 , y 0 ).From this we derive the trajectories y(θ ; H, β, ν) in phase space θ-y, for any particle with initial condition (θ 0 , y 0 ) and corresponding constant of motion H: From the trajectories we extract information regarding the expected wall interactions and trajectory times, and develop a novel accumulation index determining the distribution of expected wall interactions in the case of a uniformly seeded domain.Example trajectories are shown in figure 11(b) for ν = 0.04, where β = 0 and β = 0.99.The shape of the trajectories themselves are dependent upon the elongation of the swimmers as highlighted in figure 11(b,c), where the black lines correspond to spherical swimmers (β = 0), and the red dash-dotted lines correspond to β = 0.99.Elongated swimmers undergo increasing strain effects, such that swimmers spend extended times oriented with the flow direction (θ = 0, π).With increased elongation, the reorientation in phase space (∂y/∂θ) steepens about θ = 0 and θ = π, thus leading to a change in total area enclosed by trajectories through θ = π, y = ±1 and the cell trajectories upon wall approach.
Supposing there is an initial, uniform distribution over the entire phase plane θ × y ∈ [0, 2π) × [−1, 1], the accumulation index, A I , is defined as where I W (θ, θ + δθ) is the total number of swimmers that interact with the bottom wall at y = −1 with orientations ranging in [θ, θ + δθ] (see schematic in figure 11a), and N is the total number of swimmers.The accumulation indices for orientations of incidence captured in figure 11(d) correspond to the velocity ratio ν = 0.04.For a fixed centreline flow velocity, the increased accumulation index for ν = 0.1 results from the increased swimming velocity V s enabling swimmers to traverse larger vertical distances prior to shear-induced reorientation.This, in turn, allows larger proportions of swimmers in an initially uniformly distributed domain to interact with the walls.Further points of interest include the orientation θ peak at which maximal wall interactions occur.In the accumulation index (figure 11d) there is a shift in the peak interaction orientation θ peak from approximately θ peak ≈ 21π/16 to θ peak ≈ π, with  cell elongation.We find similar shape-based shifts in peak wall-interaction orientation with the absorbing boundary condition in figure 11(e).
The absorbing boundary condition distributions are shown to be in agreement with the accumulation index in the case of small rotational diffusion for shape dependent simulation runtimes T sim .We consider the role of swimmer shape for wall interactions as elongation affects swimming trajectories in sheared flows, especially in linearly varying shear flows.Trajectories, in turn, affect the time it takes for cells with specific initial positions and orientations to swim and rotate before cells encounter the walls.We find that the accumulation index captures the wall interactions in short runtimes only, as the clear shape-dependent shift in peak interaction orientations (figure 11e) disappears for sufficiently long runtimes, highlighting the transience of the accumulation index distribution.In figure 11( f ), the total proportion of swimmers which interact with the bottom wall 2π 0 A I (θ ) dθ are shown for a range of shape factors and velocity ratios.For small swimming velocities, for swimmers of all considered shape factors, only a small proportion of swimmers are expected to interact with the lower wall.The proportion of wall interactions increases monotonically with swimming velocity, and increases fastest for β > 0.9, with over 70 % of swimmers interacting with the bottom wall for ν > 0.3.
While swimmer shape affects the orientations at which swimmers are most likely to interact with the bottom wall we find that all particle trajectories are not of equal  time duration.While separate identical particles on the same trajectories will have the same orbit duration in the deterministic problem, identical particles on different trajectories will have different closed-loop orbits in phase space and with different orbit durations.In figure 12, the colour maps highlight the time taken for a trajectory starting at position (θ 0 , y 0 ) to terminate at the bottom wall (i.e. at y = −1, θ ∈ [π, 2π]) via an absorbing wall boundary condition.The longest trajectories have durations ranging from T ≈ 6, for β = 0, to T ≈ 45, for β = 0.99, indicating that slender, elongated cells can take over seven times longer to complete a single full orbit, compared with spherical cells.This indicates, that strongly elongated particles have over seven times fewer opportunities for wall interactions over the fixed time interval of the faster orbit.Although a larger proportion of cells are likely to come into contact with walls at orientation θ peak (as in figure 11d), the particles initially oriented about θ = π have the longest closed loop trajectories and consequent orbit durations, while cells about θ = 0 have the shortest closed loop trajectories and corresponding orbit times.When considering a Lagrangian perspective, this acts as a limiting factor for the number of wall interactions per interaction orientation.The number of orbits that a particle can undergo over a fixed simulation runtime T sim is of biological interest, as it affects the probability of biofilm formation due to increased opportunities for cell attachment.Finally, we note that the accumulation index captures the deterministic limit of the perfectly absorbing boundary A (as shown in figure 11e) for runtimes corresponding to the longest closed-loop orbit durations calculated for each cell shape in figure 12.

Conclusions
Using a finite element framework for continuum distributions of dilute suspensions of microswimmers we have studied the coupled relationship between the bulk flow cell dynamics and the boundary dynamics.We find that in order to capture the dynamics of different individual-based wall dynamics (specular reflection, uniform random reflection, absorbing boundaries), it is necessary to be cautious in the choice of boundary constraints for continuum model approximations.We find that a doubly periodic Poiseuille continuum approximation yields a good equilibrium approximation for IBM microswimmer dynamics in a wall-bounded Poiseuille flow with specular reflection for the case of high and low Pe.We find that this continuum model effectively captures the macroscopic suspension distributions such as peaks of accumulation and cell depletion at the walls due to low-shear trapping in y−θ phase space.This is especially noteworthy as this offers justification for 976 A13-25 https://doi.org/10.1017/jfm.2023.897Published online by Cambridge University Press the use of doubly periodic Poiseuille flow models like Vennamneni et al. (2020) to capture simple bounded domains with a reflective wall condition for high and low Pe.However, the doubly periodic Poiseuille flow model fails to capture dips in cell accumulation very close to walls for medium Pe.In these regions, alternate continuum models as prescribed by Jiang & Chen (2019) are better approximations of specular reflection.Comparing our model with the models in Jiang & Chen (2019) also highlights that the observed dips are due to specular reflection and not purely a result of shear-induced trapping.We also find that a constant boundary approximation in the equilibrium continuum model yields good agreement with an IBM with random reflections capturing additional secondary peaks of cell accumulation near the walls.For these models, we find that the uniform reflection boundary is most accurate for low to medium Pe, outside the limit where time-step sizes influence cell drifts from the secondary peaks.It is important to note that both results highlight that there exist clear limiting cases for the use of different continuum models and that the use of continuum approximations for dilute microswimmer suspensions must be made carefully.Given that cumulative effects of time-step errors are a common problem in Hamiltonian systems, a potential avenue for future research lies in studying the deterministic system from a Hamiltonian perspective to determine if there exist any symplectic integrators for the system that minimise numerical drifting.This could allow for the uncoupling of time-step effects and the inherent cell drifts at the walls due to the balance of advection and diffusion effects.Meanwhile, as the long-term limit of an absorbing boundary condition is all diffusing cells being attached to the wall, we developed a time-evolving continuum model with a zero Dirichlet boundary condition restricted to shorter simulation runtimes T sim < 1 due to computational costs.This model effectively captures the evolution of near-wall distributions due to wall absorption, and we have quantified the time and diffusion dependence of wall absorption for elongated particles.
The shape of the swimmers and rotational diffusion experienced by the swimmers is shown to significantly affect the orientation distributions.From a Eulerian perspective, there are no preferred cell orientations for spherical cells, while more elongated swimmers exhibit a clear preference for orientation upstream and downstream.This preference has smallest orientational spread for β = 0.99, for which the distributions are most peaked at angles just above θ = {0, π} (i.e.pointing downstream and out of the bottom wall and pointing upstream and into the bottom wall), with approximately 40 % of cells being shown to interact with the walls with incidence angles θ ∈ [π − 0.25, π + 0.5].From a Lagrangian perspective, this is due to elongated swimmers spending over 60 % of their orbits aligned with the flow (|θ − π| < 0.1 and |θ − 2π| < 0.1).On decreasing the rotational Péclet number, Pe, the spread of maximum wall incidence shifts from θ peak = π to θ peak ≈ 21π/16 as diffusion dominates deterministic dynamics.For the case of an absorbing boundary condition, when decreasing the rotational diffusion, the wall-incidence distributions tend towards the distributions as captured by the novel accumulation index based on deterministic trajectories for runtimes corresponding to shape-dependent orbits, highlighting the importance of bulk flow swimmer trajectories on wall-interaction distributions.
The deterministic dynamics of individual trajectory dynamics in the phase plane θ-y capture the shift in peak orientation distribution from θ peak ≈ 21π/16 to θ peak = π for spherical to highly elongated swimmers via the accumulation index.The perpendicular approach of spherical swimmers towards surfaces and the parallel approach of elongated swimmers towards walls, have been observed for both Chlamydomonas (Buchner et al. 2021)  studies which include hydrodynamic interactions.Our results suggest that the orientational preferences are influenced by the fundamental bulk behaviours of differently shaped swimmers.
We find that in the absence of diffusion, elongated particles take over seven times as long before interacting with the wall compared with a spherical swimmer.It is possible that elongated swimmers, therefore, must maximise each opportunity they have near the wall.Once near a wall, elongation leads to increased resistance to random Brownian rotation allowing swimmers to remain oriented parallel to flows for longer periods which improves their chemotactic sampling accuracy.Additionally, longer periods of alignment with walls allow for longer periods of mechanosensing, which increases the chances of surface attachment being initiated.
While we have considered multiple idealised wall interaction models, true biological wall interactions do not follow pin-ball dynamics, uniformly random reflections or perfect absorption, especially due to hydrodynamic interactions.In the literature, there is ongoing study into how individual swimmers interact with surfaces in the absence of flows, and even then swimmers are shown to reorient due to hydrodynamic forces.One of the nuances picked up by the accumulation index is that the bulk flow dynamics affect the likelihood of how cells approach the wall.For actual accumulation, this is also dependent on the attachment mechanisms of different swimmers, and attachment rates which are not accounted for here.Ideally, future models will combine the models with hydrodynamic interactions.For microswimmers in nature, there exist further variables which affect the likelihood of attachment and reorientation like pili attachment location (Proft & Baker 2009;Jain et al. 2012;Melville & Craig 2013), chemical signals (Wadhams & Armitage 2004), hydrodynamic stresses (Boyle & Lappin-Scott 2006;Conrad & Poling-Skutvik 2018) and cell deformability (Yoshida & Onoe 2020).Further experimental data regarding pili, and observed attachment rates at different cell orientations are required to refine the models to specific swimmer types and to draw further conclusions regarding the likelihood and speed of initial biofilm formation.Supplementary movie.Supplementary movie is available at https://doi.org/10.1017/jfm.2023.897.For the case of the stochastic individual-based model, regions of accumulation occur in the θ-y phase space, as observed for the doubly periodic Poiseuille flow and the wall-bounded formulation in § 3.1.1.However, in the case of the wall-bounded distribution with specular reflection at the walls, a drop in cell accumulation occurs around θ = 0 at y = −1, and θ = 2π at y = 1 which increases with increased runtime.While the origin of this dip for specular reflection is not fully understood, their appearance only for a range of medium Péclet shows that there exists a balance between advective time scales and rotational diffusion time scales over which a stable layer of depletion occurs.When diffusive and advective effects are comparable they can combine to effectively remove cells from near-wall regions.However, if diffusion is low, cells do not move away; and if advection is low, cells do not get carried away.
The depletion is further compounded by a time-stepping effect that partially contributes to the drop in local cell density.The contributing factor lies in the discrete nature of the numerical method.
To illustrate this, consider the case of a purely deterministic system such that the cells must all follow predetermined trajectories.However, as time is discretised the time steps are of finite size.As shown in the schematic in figure 13( f ), if a swimmer (the blue particle) begins on a deterministic trajectory given by the dotted blue line, due to discrete step sizes, the swimmer will gradually drift farther from the continuous trajectory with consecutive steps.This effect is compounded when the last step in the orbit (see the red particle on the right) undergoes specular reflection (the red particle on the left) to a position firmly outside its previous deterministic trajectory.With each cycle of reflection, the particle moves farther from θ = 0, and contributes to local cell depletion.In a fully deterministic case for β = 0.99, over a runtime T = 600, we have found a 50 % cell depletion in a radius r (= 0.08) about (θ, y) = (0, −1), when increasing the step size from dt = 10 −3 to dt = 0.1 as seen in figure 13(a,b).
In the diffusive case for β = 0.99 with Pe = 10 1 and Pe T = 10 6 , over a runtime T = 600, we find enhanced cell depletion about (θ, y) = (0, −1), when increasing the step size from dt = 0.01 to dt = 1 as seen in figure 13(c,d).In this case, at T = 600, we have found a 20 % cell depletion in a radius of r about (θ, y) = (0.2, −1).While decreasing the time step size does not completely remove the cell depletion at the wall (see figure 13e), it does decrease it.

Figure 1 .
Figure 1.(a) Schematic of two-dimensional Poiseuille flow and individual swimmer trajectories.Swimmers are not drawn to scale.(b) Schematic of specular reflection S, uniform random reflection R and absorbing boundary A effects.(c) Sample trajectories computed by the individual-based method (IBM) model in a dimensionless channel, in the absence of translational diffusion effects, for β = 0.99, ν = 0.04 and initial positions x 0 = 0, y 0 = 0, 0.6.Dotted lines correspond to fully deterministic trajectories and solid lines correspond to trajectories with rotational effects, Pe = 10 4 .
Figure 2. A comparison of the bulk dynamics in a continuum double Poiseuille model, with a stochastic simulation with wall-bounded specular reflection for Pe = 10 1 , β = 0.99, ν = 0.04 and Pe T = 10 6 .(a) Finite element continuum simulation for (n θ = 100, n y = 500) double Poiseuille bivariate ψ distribution for flow with periodic boundaries DP.(b) The IBM stochastic bivariate ψ distribution for single Poiseuille flow with specular reflection S at y = ±1.Example cell trajectories of cells swimming in sheared flow are overlaid in θ -y phase space (white lines), with snapshots in time given by dots along each trajectory (black to white in time).(c) Flow profile for double Poiseuille flow in (a).In (a,b) the colourmap (blue to yellow) indicates the probability distribution of cells in the phase space.
with time step dt = 10 −4 .The elements in the θ-directions are uniformly distributed, and the elements in the y-direction are non-uniformly distributed via a tanh function over 976 A13-10 https://doi.org/10.1017/jfm.2023.897Published online by Cambridge University Press
) show clear agreement in the cell concentrations and accumulations.Direct comparison between the DP continuum problem and IBM specular reflection S in figure 4(d) shows clear agreement for high Pe.Deviations between the models are only notable very close to the walls for medium Pe where the IBM with 976 A13-12 https://doi.org/10.1017/jfm.2023.897Published online by Cambridge University Press

Figure 4 .
Figure 4. Cell number density distributions for (a) the continuum model distribution with doubly periodic Poiseuille flow; (b) IBM with doubly periodic Poiseuille flow; (c) the IBM distribution with specular reflection boundary condition; and (d) the direct comparison between IBM with specular reflection boundary condition (dashed lines) and the distributions of the continuum model with doubly periodic Poiseuille flow (solid lines).For shape parameters β = 0.99 with Pe = 10 4 (blue), Pe = 10 2 (red), Pe = 10 1 (yellow) and Pe = 1 (purple).

976Figure 7 .
Figure 7. Cell density distributions for (a) IBM with uniform random wall reflection; (b) the distribution of continuum model with constant wall distribution; and (c) the direct comparison between IBM with uniform random wall reflection (dashed lines) and the distributions of the continuum model with constant wall distribution (solid lines).For shape parameters β = 0.99 with: Pe = 10 4 (blue); Pe = 10 2 (red); Pe = 10 1 (yellow); and Pe = 1 (purple).
), 976 A13-19 https://doi.org/10.1017/jfm.2023.897Published online by Cambridge University Press Figure8.Snapshots of the effects of a perfectly absorbing wall condition for different Pe at the bottom wall for an IBM (with dynamics at the top wall prescribed by specular reflection) on the bulk dynamics (a-c) at T sim = 600 and on normalised wall orientation probability distributions for β = 0.99 (d-f ) for runtimes T sim = 50, 100, 600.The yellow line in (c) is a separatrix between fully deterministic trajectories which interact with the bottom wall and those that do not.In figures (d-f ), the black dashed lines correspond to wall distributions for β = 0.99 as calculated by the accumulation index (see § 3.2.2).Here: (a,d) Pe = 1; (b,e) Pe = 10 2 ; and (c, f ) Pe = 10 4 ; (g) time evolution of the fraction of cells absorbed by the bottom wall.

Figure 9 .
Figure 9. Early time evolution near the bottom boundary of a double Poiseuille absorbing boundary continuum model (a,c,e,g), and the stochastic IBM with specular reflection upper boundary and perfectly absorbing lower boundary (b,d, f,h), for ν = 0.04, β = 0.99, Pe = 10 4 , Pe T = 10 6 .Here: T sim = 0 (a,b); T sim = 0.4 (c,d); and T sim = 0.8 (e, f ).Cell concentration n( y) evolution near the lower wall for the continuum model with boundary condition D 0 (g) and the IBM with absorbing boundary condition A (h).

Figure 10 .
Figure 10.Stacked probability distribution of angle of incidence for particles striking the lower wall (y = −1), for ν = 0.04 and Pe T = 10 6 .The blue distribution corresponds to particles which are expected to strike the wall in the absence of diffusive effects (originating in Region 1), and the red, correspond to particles that would not strike the bottom wall in the absence of diffusive effects (originating in Region 2).The overall envelope characterises the distribution of cells striking the bottom wall and integrates to 1.For β = 0.99, (a) Pe = 1, (b) Pe = 10 2 and (c) Pe = 10 4 .(d) Ratio of cell-wall interactions with cells originating in Region 1 to total cell-wall interactions, for varying β and Péclet numbers.

Figure 11 .
Figure 11.Deterministic dynamics and the accumulation index.(a) Schematic of the accumulation index highlighting the area of phase space (blue) from which cells will interact with the bottom wall over orientation space δθ.The cell trajectories are shown via arrows; (b) streamlines at constants of motion for ν = 0.04, β = 0, 0.99 (solid black and dash-dotted red, respectively); (c) streamlines at constants of motion for ν = 0.1, β = 0, 0.99 (solid black and dash-dotted red, respectively); (d) accumulation index (proportion of initially uniformly distributed cells in the phase space that are incident upon the bottom wall at angles θ ) for β = 0, 0.5, 0.99, for ν = 0.04; (e) distribution of wall interactions with absorbing boundary conditions (solid lines) for Pe = 10 4 for β = 0, 0.5, 0.99 with T sim = 5, 6, and 50, respectively, and the corresponding accumulation index distributions (dashed lines) and ( f ) proportion of total area of phase space incident on the bottom wall 2π 0 A I (θ; β, ν) dθ as a function of shape, β, for various swimming speeds, ν.

Figure 12 .
Figure 12.Shape dependence of time taken for trajectories beginning at (θ 0 , y 0 ) to reach an absorbing wall condition at y = −1, θ ∈ [π, 2π).From this we can extrapolate the total number of wall interactions by swimmers in the 'trapped' domain over a fixed total runtime.For ν = 0.04, (a) β = 0 and (b) β = 0.99.

Figure 13 .
Figure 13.Figures to highlight the sensitivity of the IBM to finite time steps, and how these affect the observed boundary interactions.(a-e) The IBM Poiseuille flow, for β = 0.99, ν = 0.04.Purely deterministic IBM for T sim = 600 near bottom wall in (a,b), with (a) dt = 10 −3 and (b) dt = 0.1.(c-e) The IBM Poiseuille flow, for β = 0.99, ν = 0.04, Pe = 10 1 , Pe T = 10 6 , for T sim = 600 near bottom wall in (c,d), (c) dt = 0.01 and (d) dt = 1.(e) Cell density distribution n( y) for diffusive case (Pe = 10 1 and Pe T = 10 6 ) for dt = 1 (blue line) and dt = 0.01 (red line).( f ) Schematic of deterministic trajectory of a particle at bottom wall in continuous time (blue dotted line) highlighting the trajectory deviation for particles of finite time step.Red particle on the right overshoots the wall, and is reflected to the red particle on the left.