WorksPhysics and Astronomy
Simulating the swimming motion of a flagellated bacterium in a microstructured bio-fluid
Abstract
We develop a numerical framework to simulate the locomotion of a flagellated bacterium with a spheroidal head (such as Escherichia coli) in biological fluids like mucus, which are entangled polymer solutions exhibiting elasto-viscoplastic (EVP) rheology and porous microstructure. To account for the scale disparity between the large bacterial head and the slender flagellar bundle, whose thickness is comparable to the pore size, we employ a two-fluid model in which the bundle directly drives the solvent and exchanges momentum with the polymer phase via drag proportional to their relative velocity. The numerical implementation combines a finite-difference discretization of the two-fluid equations with a slender-body theory (SBT) to model flagellar forcing. A key observation is that the coupled mass and momentum equations for these inertialess flows, together with SBT, are linear in the pressure and velocity fields and in the force distribution along the flagellar bundle. By treating the polymer stress as a body force, we decompose the flow field and hydrodynamic moments into three additive contributions: kinematic (motion), flagellar forcing, and polymer stress. This decomposition allows several components of the flow to be precomputed and enables the determination of swimming velocity via a resistivity formulation driven by polymer-induced forces, which greatly improves computational efficiency during transient calculations of the polymer stress and the resulting flow. We validate the method and use it to analyze how polymer microstructure and its interactions with the bacterial head and tail affect motility in complex biofluids.
Banner appropriate to article type will appear here in typeset article
Introduction
Flagellated bacteria such as Escherichia coli, a common and sometimes pathogenic member of the human microbiome, inhabit complex biological environments such as mucus, a protective hydrogel coating all wet epithelial surfaces [7, 54, 24 a]. Mucus exhibits elastoviscoplastic (EVP) rheology and contains a porous microstructure formed by entangled polymers [26]. During locomotion, E. coli furls up its individual flagellar filaments into a rotating helical bundle that propels the organism by overcoming drag on its spheroidal head [9, 25]. The head and flagellar bundle differ in radius by nearly two orders of magnitude (– vs. – [28]), resulting in qualitatively different interactions with the mucosal medium: the head senses a continuum, while the flagellar bundle probes the microstructure. This scale disparity, combined with length-scale dependent spatial heterogeneity in mucus and swimmer geometry, gives rise to diverse swimming behaviors.
Computational modeling serves as a valuable complement to experiments by enabling controlled isolation of geometrical and rheological effects. However, simulating both flagellar nanoscale geometry and mucus microstructure remains computationally prohibitive despite a few recent attempts using first principles approach [58]. To address this, we develop a multiscale framework that models mucus as a two-fluid interpenetrating continua [38], and develop a novel computational framework coupling two-fluid slender-body theory for the flagellar bundle with a finite-difference solver for the flow of polymeric fluid [51]. This approach captures the distinct interactions of the bacterial head and the flagellar bundle with the surrounding fluid and enables simulations in fluids with microstructure and non-Newtonian (EVP) rheology.
The Reynolds number, defined as the ratio of inertial to viscous forces, at the scale of an individual E. coli bacterium is on the order of to [44], indicating effectively inertialess dynamics. These bacteria swim via a characteristic run-and-tumble motion, consisting of straight, ballistic runs interrupted by tumbling events that randomly reorient their direction, enabled by the transient unfurling of the flagellar bundle. Experiments in polymer solutions show that E. coli exhibits altered motility compared to Newtonian fluids of the same viscosity: it follows straighter trajectories [43], tumbles less frequently (Qu & Breuer 2020), bundles its flagella more quickly (Qu et al. 2018), and swims faster [32, 43] (Qu & Breuer 2020). One proposed explanation is extreme shear-thinning near the flagellar bundle, which reduces local viscosity and drag [31, 32] (Qu & Breuer 2020), though this is not supported by bulk rheology. An alternative hypothesis attributes the enhanced speed to reduced wobbling of the cell body caused by elastic stresses [43]. More recently, Kamdar et al. [22] reported qualitative similarities in motility between dilute polymeric and colloidal solutions, suggesting that polymer microstructure, rather than viscoelasticity, may dominate swimming speed in dilute and semi-dilute regimes. Viscoelasticity may instead influence secondary behaviors such as reduced tumbling and faster bundling, which indirectly enhance motility. A detailed review of how polymer elasticity and microstructure affect bacterial swimming is provided in Narayanan et al. [38].
In addition to elastic effects, the yield-stress behavior of EVP biofluids has attracted growing interest. EVP fluids exhibit a critical yield stress - below which they behave as elastic solids and above which they flow like viscoelastic liquids. This creates spatial regions around a swimmer that may be either yielded or unyielded, depending on the local stress field. Yield stress plays a biologically significant role in microbial motility. For instance, Helicobacter pylori overcomes the yield stress of the stomach’s mucosal lining by acidifying its local environment, fluidizing the mucus and allowing penetration of the protective barrier [8]. Similarly, Figueroa-Morales et al. [17] showed that E. coli can penetrate mucus by mechanically shearing it. Motivated by such findings, several theoretical and experimental studies have explored the motion of simplified swimmers in yield-stress fluids, including waving sheets [2, 19], flexible filaments [21], rigid helices [20], squirmers [16], and synthetic swimmers [39].
These studies demonstrate that yield stress can strongly influence swimming behavior, sometimes even enhancing swimming speed [19, 21], and that performance depends sensitively on swimmer geometry [39]. A commonly proposed mechanism is that the swimmer yields the surrounding material in a narrow region, creating a lubricated tunnel that allows it to slip through the medium. In particular, the experiments of Nazari et al. [39] show that if the swimmer can exceed the yield strain to rotate its helical flagella, and if the yield stress is not too large compared to its thrust, then a sufficiently wide yielded region can form to enable locomotion. The pitch angle of the helix is critical: low angles are hindered by yield stress, while higher angles can lead to enhanced propulsion. However, the mechanistic role of the hydrodynamic interactions between the flagellar bundle and the influence of the bacterial head remain poorly understood. These open questions motivate the need for numerical simulations. Moreover, no existing theoretical or computational model captures a bacterium swimming in a yield-stress fluid while accounting for microscale heterogeneity in the surrounding medium.
Our simulations isolate specific behaviors such as tumbling and provide detailed access to fields including polymer stretch, polymer stress, and local velocity perturbations. This enables mechanistic insight into how bacteria exploit the non-Newtonian rheology and microstructure of mucus to enhance motility compared to Newtonian fluids. To improve model accuracy, we incorporate a complete rheological description including yield stress and account for non-continuum effects. These features are essential for accurately modeling biofluids such as mucus, which behave as concentrated polymer solutions with microstructural scales comparable to flagellar bundle thickness [53] (Li et al. 2021).
To resolve fluid heterogeneity at the flagellar scale, we employ a two-fluid model that allows the solvent and polymer phases to respond independently to flagellar forcing. Originally introduced by Doi [15], two-fluid models describe the relative motion between polymer and solvent phases due to concentration gradients in inhomogeneous flows. In our formulation, the two interpenetrating phases consist of a Newtonian solvent and an elastoviscoplastic polymer network. Prior applications of this model to microorganisms or active probes typically assume a purely elastic polymer phase and restrict attention to simple geometries such as spheres [14, 37] (Fu et al. 2008), cylinders [36], or filaments [56]. A recent exception is the work of Moradi et al. [35], which generalizes the two-fluid formulation to spherical particles in viscoelastic media.
Around E. coli, the flagellar bundle, whose diameter is comparable to the microstructural scale, exerts different forces on the polymer and solvent phases, thereby driving relative motion. The pore size of mucus varies with physiological state; for example, bacterial infection can increase pore size while reducing viscosity and yield stress [7]. In this work, we consider cases where the pore size is much larger than the flagellar diameter, so the bundle does not directly contact the polymer network. In such cases, the flagellar bundle exerts force only on the solvent, which then couples indirectly to the polymer. When the bundle and pore sizes are comparable, the flagellar bundle interacts with both phases directly. This scenario can be modeled by enforcing slip at the polymer phase and no-slip at the solvent. Both cases were explored by Narayanan et al. [38] using a Newtonian two-fluid model, revealing that swimming behavior depends sensitively on how the bundle couples to the two phases. Here, we extend that approach to include a non-Newtonian polymer phase with yield stress and incorporate hydrodynamic interactions with the full bacterial geometry.
The numerical method builds on the finite-difference scheme of Sharma & Koch [51], formulated in prolate spheroidal coordinates, and extends it to the two-fluid setting. This coordinate system enables exact representation of the particle (bacterial head) shape. A uniform grid in spheroidal coordinates concentrates grid points near the particle surface in Euclidean space, improving resolution where flow gradients are strongest. It also allows practical approximation of an infinite domain with a finite number of points. The helical flagellar bundle is modeled as an external body force using slender-body theory. In contrast to previous approaches for modeling flagellar forcing [10, 30, 33, 34, 3], our method avoids the need for regularization.
The remainder of the paper is organized as follows. § 2 introduces the governing equations for particle motion, flagellar forcing, background flow, and polymer stress. These equations are decomposed exactly into kinematic, non-Newtonian, and flagellar components, as described in § 3. The numerical method, presented in § 4, leverages this decomposition to precompute basis flows that can be combined online to construct full solutions. This modular approach also avoids iterative enforcement of integral constraints. In § 5, we apply the method to investigate the role of polymer microstructure in swimming through a quiescent medium. § 6 summarizes our findings and provides directions for future research.
Problem formulation
We consider a flagellated bacterium, swimming in an unbounded fluid (Figure 1). The organism consists of a prolate spheroidal head (aspect ratio ) and a helical flagellar bundle. The surrounding medium is a two-phase fluid comprising a Newtonian solvent and a polymeric phase.
Figure 1. Schematic of a bacterium with a spheroidal head and helical flagellar bundle, showing helix geometry and key variables.
In the low Reynolds number regime, the incompressible mass and momentum conservation equations for the solvent and polymer phases are
Here, , , and denote the velocity, pressure, and viscosity of each phase ( for solvent and for polymer), and is the force per unit length along the flagellar centerline. The stresses in the solvent and polymer phase are
The flagellar bundle, being slender and having a size comparable to pore size, directly forces only the solvent. This results in a relative velocity , which decays over a screening length , associated with the microstructural pore size. The far-field velocity is prescribed as:
Boundary conditions on the bacterial head depend on the ratio of pore size to head size. For small pores, both phases satisfy no-slip:
For pore sizes comparable to the head, polymers can slip past the surface [5], leading to free-slip boundary conditions on the head:
The flagella’s helical centerline is parameterized by arc length as
where , , and are the flagellar bundle’s radius, pitch angle, and pitch length, respectively. The remainder of this section discusses (i) polymer stress modeling, (ii) computation of via slender body theory, (iii) force and torque constraints, and (iv) the coupling between these components.
Polymer stress and constitutive modeling
Polymer elasticity enters the momentum equation via the stress tensor , modeled using an ensemble of elastic dumbbells [6]. Each dumbbell consists of a pair of spherical beads connected by a spring. The polymer stress, generated by stretching of these springs, is related to the configuration tensor as
where is the polymer concentration, is the relaxation time, and depends on the chosen constitutive model (see Table 1).
| Model | Oldroyd-B | FENE-P | FENE-CR | Giesekus |
Table 1. Stress and relaxation functions and for common models. In FENE models, and , with being the ratio of the maximum extensibility to the radius of gyration of the polymers. The Giesekus model introduces a mobility factor that implicitly restricts the maximum polymer stretch.
The configuration tensor (defined as the outer product of the polymer end-to-end vector, averaged over spring orientations) evolves as
where , first proposed by Saramito [49], is a yielding limiter:
The deviatoric stress norm compares the polymer stress against the yield stress . When , the polymer behaves as a viscoelastic solid with viscosity and elasticity . Once yielding occurs, the material flows as a viscoelastic liquid. Here, is the relaxation function and varies with the choice of constitutive model (Table 1). The Oldroyd-B model assumes linear springs and is widely used for its simplicity, though it predicts unbounded stretch in extensional flows. The FENE-P and FENE-CR models introduce finite extensibility and are more suitable for dilute polymer solutions (Anna & McKinley [1]). For more concentrated systems like melts, the Giesekus model offers a better fit (Bird et al. [6]). We next describe how to compute the flagellar forcing using slender body theory, and how it couples with the fluid and polymer fields.
Slender-body theory and hydrodynamic coupling
The force distribution along the flagellar bundle is computed using slender body theory (SBT), which approximates the flagellar bundle as a distribution of point forces along its centerline. Matched asymptotic expansions yield the following integral equation (Narayanan et al. [38]) for at each point along the flagellar bundle:
where is the vector between two points on the flagellar centerline, and is the slenderness ratio. We assume that the uncoiled flagellar bundle resembles a prolate spheroid with major and minor axes and , respectively. If the geometry deviates significantly, corrections are required to account for the blunt ends.
The background velocity includes contributions from external flow, the head-induced disturbance, and polymer stresses. The final term on the left-hand side of equation (15) accounts for corrections due to polymer–solvent interactions via Brinkman and Stokes Green’s functions:
where the screening parameter is , and the scalar functions are given by
The velocity field represents the solvent flow induced by in a Newtonian two-fluid system:
subject to incompressibility and far-field conditions:
These equations resemble the full flow equations (2.1)–(2.3), but exclude the bacterial head and polymer stress , and replace the line force with a single point force source term. Here,
Since the flagellar bundle is too slender to directly interact with the polymer network, the polymer’s influence on arises indirectly through the background flow . The regular disturbance from the head is captured by the difference . These hydrodynamic interactions inform the computation of . To complete the determination of bacterial swimming, we now impose global force and torque balance conditions on the bacterium.
Force and torque free constraints
To close the governing system of equations introduced above, the bacterial translational velocity, , and the rotational velocity of the head, , must be determined. These quantities are determined by enforcing global force and torque balance on the organism:
The motor applies a torque that drives the flagellar bundle to rotate at angular velocity . To maintain torque balance, the head counter-rotates at . The motor torque depends on their relative rotation, :
where characterizes the torque–speed relationship. Based on experimental measurements [4], takes the piecewise form:
with constants defined in Figure 2 and Table 2.
Figure 2. Plot of the motor torque as a function of motor angular velocity . See Table 2 for typical values of the constants.
| () | () | () | (deg) | (–) | () | (mPa·s) | (pN·nm) | (pN·nm) | (pN·nm·s) | (rad/s) | (rad/s) |
| 0.03 | 7 | 2 | 41 | 240 | 1.5 | 1 | 1250 | 3750 | −1.91 |
Table 2. Values of the various parameters corresponding to E. coli used in simulations.
The total stress on the head is the sum of solvent and polymer contributions, . The resulting hydrodynamic force and torque are:
The flagellar force and torque are computed from the force per unit length :
In the following part, we summarize the role of each component of our model described above and provide an overview of how everything fits together.
Operator formulation and model overview
The objective is to determine the swimming velocities , , and of a flagellated bacterium given an internal motor torque . This torque drives the flagellar bundle to rotate at an angular velocity , generating a hydrodynamic torque (equation (26)). To satisfy torque balance (equation (25)), the head counter-rotates at , producing a resisting torque . Meanwhile, the rotating flagellar bundle also induces a distributed force along its length, which generates a net thrust that is balanced by the hydrodynamic drag on the head, , resulting in a net swimming velocity (equation (24)).
The force distribution is computed from slender-body theory (equation (15)), and depends on the swimming kinematics, flagellar geometry, fluid viscosities, and , the screening length , and an effective background velocity . This background includes contributions from the imposed flow, head–tail hydrodynamic interactions, and the polymeric stress field. In turn, drives the fluid velocity field via the solvent momentum equation (2), which is coupled to the velocity of polymer phase through -dependent drag (equations (2)–(3)) and to the stress field through polymer momentum balance (3). The polymer stress evolves according to the configuration tensor via the constitutive relation (12) and (13), completing a closed nonlinear system involving bacterial motion, fluid mechanics, and polymer microstructure. This modular formulation enables efficient, non-iterative evaluation by treating each subsystem separately and exploiting linearity in the inputs.
As a starting point, we temporarily treat the polymer stress as a known input. With this assumption, the remaining system, comprising the hydrodynamic equations and the slender-body formulation, is linear in its unknowns. This structure is best expressed in operator form, which we now present.
Main fluid problem (MFP). The viscoelastic flow around the bacterium, governed by equations (1)–(3) and boundary conditions (6)–(10), can be compactly written as:
with the interior and boundary parts:
Flagellum-only flow. The velocity field generated by the flagellar bundle in isolation (equations (19)–(21)) follows a similar structure:
Slender-body theory (SBT). The force distribution and swimming kinematics are determined from:
The unknown vectors are:
The interior source vectors are
Here, . The quantities and depend linearly on the fluid stresses and polymer contribution. The shared mass–momentum operator for the main fluid problem and flagellum-only flow system is:
and that for the SBT system is:
where the operator acts only on such that represents all the terms on the left hand side of equation (15). Parameters and (either equal to and or and ) account for piecewise motor torque, following equation (28) and Figure 2.
Figure 3 shows the directional dependencies between subsystems. The main fluid problem depends on , , and provided by , while the flagellum-only flow uses the same . In turn, the SBT system requires , , , and from and from .
Nonlinear coupling and decomposition. In this sub-section, so far, we assumed the polymer stress, , was known. In reality, is tightly coupled to the flow field (Figure 3): it modifies the velocity and pressure fields through momentum balance, which in turn alter , , and . The , and then determine the appropriate values of , , and to maintain a force and torque free motion. These and are required as boundary conditions in the momentum balance. Meanwhile, evolves in response to . This creates a feedback loop that, if approached naively, would require iterative solution strategies such as a secant method [42].

Figure 3. Schematic showing the coupling between the polymer stress, and three subproblems involving unknowns in equation (36). The three subproblems are the main fluid–polymer system, the flagellum-only flow, and the slender-body theory solver.
Instead, we exploit a key property: the linearity of the hydrodynamic subproblems. The entire system can be exactly decomposed into a Newtonian (motion-induced) component and a non-Newtonian (polymer stress-driven) component. The swimming velocities , , and influence only the Newtonian part. The polymer stress contributes additively through a non-Newtonian subproblem. This resistivity formulation allows us to isolate the effect of and solve for bacterial motion without iterations. A similar decomposition, valid for elastoviscoplastic media, was introduced by Sharma & Koch [51] for inertialess flow of non-Newtonian liquids past passive particles. In the next section, we extend that approach to include active forcing from a flagellar bundle and the additional coupling via slender-body theory and the flagellum-only flow.
Exact linear decomposition of flow fields and hydrodynamic moments
We begin by considering the main fluid problem, . As illustrated in Figure 3, its inputs include the head velocity , the background flow , the flagellar force distribution , and the polymer stress . These, whether specified or arising from coupled components, are assembled into the composite source vector in equation (31).
As seen in equations (31) and (37), depends linearly on its inputs and may therefore be decomposed as
where the superscripts , , and denote contributions from motion (bacterial head motion and background flow), polymer stress, and flagellar forcing, respectively.
This defines three sub-problems:
each obtained by substituting the appropriate source term and unknowns into (31). For example the polymer stress induced problem is:
such that the field is driven only by in a quiescent fluid with a stationary head. The motion-driven field corresponds to a translating–rotating bacterial head (without flagella or polymer stress) in a Newtonian two-fluid medium with background flow . The field represents the flow induced by in a quiescent fluid with a stationary head. Only satisfies the full boundary conditions (2.6)–(2.10), with replacements such as , etc. Sub-problems and satisfy the same boundary conditions with homogeneous (zero) right-hand sides and are purely source-driven.
The flagellar sub-problem, , corresponds to the flow generated by a line distribution of two-fluidlets adjacent to a stationary head. These two-fluidlets, analogous to Stokeslets in Newtonian media, are the singularity solutions of the two-fluid Newtonian equations (Narayanan et al. [38]). The modular decomposition of , particularly the separation of motion- and flagella-induced components, enables precomputation of flow fields associated with and across a broad range of fluid parameters. This significantly improves computational efficiency by avoiding repeated solutions of these sub-problems during the time integration of the polymer constitutive equations.
The hydrodynamic force and torque on the head can also be decomposed into corresponding components:
The components and are due to the motion of an isolated head in a quiescent two-fluid and can be obtained from the resistivity problem:
Here, , , , and are resistance tensors that may be computed analytically for a sphere or numerically for a spheroid in a two-fluid medium. These calculations can be performed offline prior to the transient simulation. These calculations need to be performed only once and they remain valid across a wide range of flow parameters. In principle, the spheroidal harmonics formulation of Dabade et al. [11, 12] could also be extended to Newtonian two-fluid systems to enable analytical evaluation for a spheroid. This is possible since the general solutions for flows past spheroids are available for both Stokes and Brinkman flow, and the two-fluid equations can be readily re-written as Stokes and Brinkman equations for the combined (mixture) and difference fields Narayanan et al. [38]. However, in our current implementation, we stick with numerical calculations for a spheroid. The resistance tensors depend on head shape, screening length, and the viscosity ratio between the solvent and polymer phases. The components and account for contributions from polymer-induced velocity, pressure, and stress fields:
where
Similarly, the remaining components and , due to flagellar forcing, can be expressed in a matrix–vector form, with the vector being and the matrix precomputed offline. Critically, expressing the dependence of hydrodynamic forces and torques on , , and in this matrix–vector form allows us to avoid iterative solutions for these quantities, thereby enhancing computational efficiency. In the remaining part of this section we will consider further details on these precomputations and reformulation to the equations presented in the previous section to enable iteration free numerical evaluations.
Precomputations for flow due to kinematic motion (MFP(M))
The bacterial head undergoes translational and rotational motion, while the imposed background flow consists of uniform and linear components. The relative far-field flow experienced by the head can therefore be represented as a linear combination of translational and linear basis flows:
where,
The coefficients and are determined by the bacterial velocity and background flow through an appropriate change of reference frame. Accordingly, the vector can be constructed as a linear combination of these eleven basis flows, and the resulting motion-induced flow field is given by
where each basis flow or represents the response of an isolated bacterial head (without flagella) to a unit translational or linear flow in a Newtonian two-fluid medium. These basis fields can be computed either analytically using spheroidal harmonics ([11, 12]) or numerically using finite difference methods ([51]). A similar basis decomposition strategy was used in Sharma et al. [50] to analyze spheroid dynamics in viscosity-stratified flows. Using the precomputed basis fields, the velocity components and as well as the corresponding pressures and can be expressed as linear combinations of stored field solutions, scaled by the translational and rotational velocities and background flow parameters . The fields proportional to and are denoted as and for later use.
Pre-computations for flows due to flagellar forcing (MFP(Flag) and Flag)
We discretize the helical centerline of the flagellar bundle into points, whose position vectors are given by for . At each point, we place a point force, thereby replacing the continuous force integral with a discrete sum (see Figure 4). This discretization strategy, standard in slender-body theories, reduces the original integral formulation to a matrix–vector system ([47, 38]). The force distribution is obtained by solving and is treated as unknown for now. The source term in is approximated via a Riemann sum:

Figure 4. Discretization of the helical line of singularities into points. Each point on the helix (blue stars) carries a two-fluidlet, a fundamental singularity of the two-fluid medium.
Here, denotes the field induced by a unit point force in the -th direction placed at , adjacent to a stationary spheroidal head in a quiescent two-fluid medium.
The problem , defined in equation (34), is structurally identical to but assumes that the point forces act in isolation, i.e., without the bacterial head. The resulting flow from each singularity is denoted . Using equations (2.36 and (38), the twofluidlet vector is written as:
governed by:
with source term and boundary conditions
The flow due to a single two-fluidlet can be computed analytically using canonical Stokeslet and Brinkmanlet ([38]), and the total flagellar bundle-induced flow is:
To account for the bacterial head, we compute the modified fields numerically. These are decomposed as:
where satisfies
with as , and boundary conditions at the head surface:
for no slip condition on the polymer phase, and
for a perfectly slipping polymer phase.
Here, , and similarly for . Solving for avoids directly resolving singularities, as the flow at the head surface is smooth and numerically tractable.
After computing , we recover and obtain the total flow:
This procedure also yields the hydrodynamic force and torque on the head:
Here, columns to of and represent the head’s force and torque from unit forces in directions 1 to 3 at .
Finally, since the solvent velocity from flagellar forcing is the first component of in equation (36), we write:
where is assembled from the solvent velocity fields generated by individual point forces.
Reformulating the SBT problem (SBT)
Based on the previous two subsections, several components in the SBT forcing term (equation (37)) can be expressed as matrix–vector products involving the unknown vector (defined in equation (36)). We therefore reformulate the SBT problem in operator form as:
where
Here, arises from the prescribed motor torque parameters, and is the disturbance field generated by the head in a Newtonian two-fluid medium subject to the imposed background flow . The terms and denote externally imposed force and torque, respectively. All these components can be evaluated prior to the start of the transient simulation. The only components that must be computed online at each time step are those arising from polymer-induced effects, namely, the polymer-induced solvent velocity and the polymer-induced force and torque on the head, and . These depend on the polymer stress field and must be updated dynamically.
From the discussion in this section, it is evident that only the solution to and the polymer constitutive equations must be computed afresh at each time step. All other components, , , and , are obtained by superposing precomputed flow fields. Moreover, solving the SBT system involves inverting a fixed matrix , which is computationally inexpensive relative to evaluating and evolving the polymer model. In the next section, we describe how this formulation is implemented in our numerical algorithm.
Time-stepping algorithm for coupled swimmer–polymer dynamics
Our numerical algorithm based on the formulation presented in the previous two sections is summarized in algorithm 1.
Algorithm 1 Numerical solution of the two-fluid swimming problem
Input: Head and flagellar geometry, fluid parameters, motor torque characteristics, and imposed forces and torques used to compute , , , and in equation (68).
Precompute: Basis and singularity-driven flow fields, resistivity tensors for and , and assemble the tensors in equation (67) and background flow in equation (68).
Initialization (at , i.e., ):
Set (unstretched polymers), implying .
Invert (equation (66)) to obtain , , , and .
Assemble , , and using precomputed basis flows (see equations (51), (56), and (63)).
Compute .
for each time step , do
Given: , and
(A) Evolve polymer stress: Solve equations (2.12)–(2.14) to compute using and .
(B) Compute polymer-induced flow: Solve (see equation (42)) to obtain , , , and , and update and from equation (47).
(C) Update swimming kinematics: Invert (equation (66)) with current , , and to recompute , , , and (i.e., redo step 4).
(D) Update polymer phase velocity: Reassemble , , and ; then compute (i.e., redo step 5 and the non-Newtonian extension of step 6).
Advance to next time step
end for
Output: Time-evolving fields , , , , , and .
The algorithm proceeds with prescribed geometric and rheological inputs: head and flagellar aspect ratio and length, flagellar radius, pitch angle and length (equation (11)), solvent and polymer viscosities and , and the screening length . The motor parameters , , and (equation (28)) are grouped as and . External forces () and torques () are also prescribed, and the computational domain radius is chosen to approximate far-field conditions.
The operator in equation (38) is inverted using a two-fluid extension of the finite-difference solver developed in Sharma & Koch [51], hereafter referred to as the two fluid solver. This solver discretizes the continuum operators , , and using variable-order central differences, with specialized treatment near poles and internal boundaries in prolate spheroidal coordinates. In the present work, we extend the single-fluid viscoelastic formulation of Sharma & Koch [51] to a two-fluid system by appending the governing equations of the solvent and polymer fluids.
For the prescribed geometry and rheology, the basis flows and from equation (51) are obtained using the two fluid solver with zero head boundary conditions and either or imposed at . The zero head boundary conditions refer to equation (7) or equations (8)–(10) with zero right-hand side, depending on polymer size. Mixed boundary conditions may also be implemented as a weighted combination of these limits. These flows are then used to construct the tensors , , , and in (equation (67)) and the vector in (equation (68)).
As described in section 3.2, we compute the regular field by subtracting the analytically known singular solution from the full numerical solution of the singularity-driven flow around the head. This is also achieved using the two fluid solver. These fields are used to build the tensors , , and in . The discrete form of is obtained following the procedure laid down by Rodenborn et al. [47]. Matrix inversion is performed using LU decomposition as implemented in the open-source solver AGMG ([40]), which is also employed within the two fluid solver.
Initially, the polymers are assumed to be unstretched, so that , and consequently . Under this assumption, we solve for the flagellar force distribution , translational velocity , and angular velocities and by inverting the operator in equation (66). This inversion is performed twice: once using , , and again using , , as defined in equation (28). The solution that yields a motor angular velocity corresponding to the smaller value of is selected, consistent with the piecewise motor torque–speed curve shown in Figure 2. This provides the full Newtonian two-fluid solution, incorporating flagellar bundle–head interactions beyond the resistive-force approximation used in Narayanan et al. [38]. Results from such an investigation are shown in § 5.
The resulting polymer velocity field perturbs the initially unstretched polymer distribution, inducing nonzero . We solve the polymer constitutive equations (2.12)–(2.14) using the same numerical strategy as in Sharma & Koch [51], but now convecting and stretching polymers using instead of a single velocity for both polymers and solvent. A forward Euler scheme is used for the first step, followed by a second-order Crank–Nicolson scheme. A high-order upwind discretization is used for convective terms to ensure numerical stability.
After obtaining , the polymer-induced flow is computed by inverting equation (42) using the two fluid solver. The swimming kinematics are then updated by solving , completing steps 10–12 of algorithm 1. The steps 8–12 are repeated for a prescribed number of time steps , or until a steady swimming velocity is achieved.
The flow velocities required for the SBT calculations, namely and , are computed on the spheroidal grid. However, within the SBT framework, these velocities are needed at the discrete flagellar points shown in Figure 4, which do not coincide with the vertices of the spheroidal grid. Rather than interpolating between these two sets of discrete points, which would introduce accuracy concerns, we develop a boundary integral formulation to evaluate the velocities directly at the flagellar locations. This method uses the analytical form of the Stokes and Brinkman Green’s functions, along with the numerically computed fluid stress on the head. The full formulation is described in appendix § 8.
In the remaining part of this section we provide tests validating various components of this numerical solver.
Validation
The numerical solver designed above is novel in its entirety. While direct validation of the full two-phase EVP swimming problem is not possible due to the absence of prior benchmarks, we validate the solver rigorously by comparing individual sub-problems to known analytical and numerical results. Most of these available results are limited to spherical particles, barring a few exceptions. In our implementation of the solver, we simulate dimensionless versions of the governing equations (c)-(c), (c)-(c), (c), where we use the minor radius of the spheroid () to normalize length, and to normalize stress, with the velocity and time scales set by the problem being solved. For problems where the particle motion is prescribed, the prescribed velocity (or angular velocity) sets , with being the time scale. For solving mobility-type problems, where the input forces and torques are specified (as in the swimming bacterium problem described here), is set by these input forces.
Handling two fluids
We first validate the two fluid solver for Newtonian (two-fluid) flow (i.e. ), which is directly used in pre-computing and from equation (51). We compare results for flow around a sphere with theoretical predictions from Narayanan et al. [38]. In our spheroidal coordinate framework, a sphere is modeled as a particle with aspect ratio , while the normalized radius of the outer boundary of the domain is set to 200, where the length scale used for normalization is the minor radius of the spheroid, which is almost the same as the head radius for a spherical head. The sphere translates with velocity and rotates with angular velocity in a quiescent fluid, with slip boundary conditions applied on the polymer phase to mimic a large microstructure length scale. The drag and torque on the solvent and polymer phases are plotted against theoretical predictions for a range of in Figure 5, where is the screening length and is the head radius.
Figure 5. Plot of the dimensionless drag force on a translating sphere due to (a) the solvent and (b) polymer as a function of , for different viscosity ratios, simulated using the two-fluid Newtonian solver and compared with analytical solutions from Narayanan et al. [38]. (c) shows the solvent torque on a rotating sphere. The polymer torque is zero due to the slip condition.
This comparison tests the efficacy of the two fluid solver to solve , as decomposed in equation (41). We also present evidence of grid-independence in Figure 5(d), where we plot the force and torque on a translating and a rotating sphere for a medium with for three different mesh resolutions to show that the numerical results are converged, with finer resolutions leading to closer agreement with theory for . The close agreement (within 3% relative error for the finest mesh resolution) validates the solver for a wide range of , with increasing errors for due to numerical stiffness. Thus, in all simulations we restrict and our mesh resolution to (the finest resolution in Figure 5(d)). Good agreement was also observed for the no-slip boundary condition on both solvent and polymer fluids (not shown).
EVP constitutive law
The single-fluid solver of Sharma & Koch [51] has previously been validated for various viscoelastic constitutive models but not yet for elastoviscoplastic (EVP) fluids. Also, there is no prior work considered for two-fluid EVP systems. Thus, to validate this aspect, we compare drag on a sphere in a single-fluid EVP liquid with the immersed boundary method simulations of Sarabian et al. [48]. Figure 6a shows the evolution of drag on a sphere of radius translating with speed in an EVP fluid with viscosity and polymer viscosity for two Bingham numbers , where is the yield stress. Steady-state values from Sarabian et al. [48] are also shown for comparison. Discrepancies are attributed to confinement in Sarabian et al. [48]’s rectangular domain, whereas our simulation is unbounded. Overall, our predictions of steady-state drag (Figure 6b) match those from Sarabian et al. [48].
Figure 6. (a) Drag coefficient on a sphere translating in an EVP fluid as a function of dimensionless time, compared to steady-state value from Sarabian et al. [48]. (b) Steady-state drag versus .
Recently, Yazdi & D’Avino [57] has performed simulations of a sedimenting spheroid in the same EVP media as Sarabian et al. [48], and has provided results on the drag and yielded domains for spheroids of different aspect ratio. We benchmark our single-fluid solver with this study as well (Figure 7), where we observe similar yielded regions and a steady-state drag coefficient and sedimentation velocity that is within 10% of the values provided by Yazdi & D’Avino [57]. These results once again serve to validate the solver of Sharma & Koch [51], which is now shown to work well even with EVP constitutive laws.

Figure 7. (a) Yielded region (red) around a sedimenting spheroid in a single-fluid EVP medium () at ( - dimensionless simulation time) for and , where and . The shape of these surfaces agree with those observed by Yazdi & D’Avino [57] (Fig.5(a),6(a)). (b) Steady-state dimensionless sedimenting velocity () and drag coefficient for the same spheroids as (a) () compared between our work and that of Yazdi & D’Avino [57].
Flagellar bundle forcing: Stokeslet next to a sphere
To compute flagellar forcing, we precompute flows due to point forces (two-fluidlets) placed near the bacterial head and assemble them into the tensors , , and in . The numerical solution computes only the regular part, , while the singular part, , is known analytically. The difference between the two provides boundary conditions on the surface of the head. Since no such (analytical) solution exists for two-fluid medium or spheroids, we validate our method in a single-fluid Newtonian medium by comparing the numerical solution from the solver of Sharma & Koch [51] with analytical results from Oseen [41]. These correspond to a Stokeslet oriented along the axis of symmetry and placed at varying distances from a spherical particle. Figure 8a shows the computed force on the sphere for three different grid resolutions. The relative error, shown in Figure 8b, remains within , demonstrating high accuracy.
Figure 8. (a) Dimensionless force on a sphere due to a Stokeslet along the axial direction, versus radial Stokeslet location, compared with analytical results from Oseen [41]. (b) Relative error (%) in the numerical prediction.
As the singularity approaches the head, the boundary condition region nears the singular core, reducing accuracy. Similarly, when the singularity is placed far from the head, the local grid resolution is coarser due to spheroidal clustering, again slightly degrading accuracy. Despite these effects, the error remains small. This method avoids artificial regularization of singularities and can be extended to higher-order singularities near spheroidal particles.
In the next section, we utilize the solver to explore novel effects of microstructure on bacteria swimming in a two-fluid medium.
Effect of microstructure on the motion of a swimming bacterium in a bio-fluid
As discussed in § 2, the screening length in the two-fluid model parametrizes the pore size in an entangled polymer solution, which constitutes the microstructure length scale of the medium. While the bacterial head is much larger than the pore size and interacts with the polymer solution as a continuum, the slender flagellar bundle has a thickness comparable to the pores of the polymer network, leading to novel effects on the swimming motion. Herein, we simulate a straight swimming flagellated bacterium in this two-fluid medium, and analyze the effect of this length-scale dependent heterogeneity caused by the microstructure of the swimming medium. Although the numerical framework supports a non-Newtonian medium, we restrict our attention here to a Newtonian medium to isolate the role of microstructure.
In the limit , the solvent and polymer fluids move together in unison (), and the fluid behaves as a standard single-phase Newtonian liquid with viscosity equal to the sum of the two fluids, . In contrast, for large screening lengths (), the polymer does not experience direct forcing from the flagellar bundle, and the bacterial head imparts independent hydrodynamic stresses on the two fluids. In this section, we explore how the swimming velocity of a flagellated bacterium depends on the screening length , as well as on the viscosity ratio between the solvent and polymer fluids. The geometric parameters of the bacterium and the input motor torque for motion are taken from experimental measurements on E. coli by Berg [4]; Martinez et al. [32], as summarized in Table 2.
In § 5.1 we assume the pore size of the polymer network to be much smaller than the bacterial head radius (), and thus impose a no-slip condition on the polymer fluid at the head surface (equation (7)). Then in § 5.2 we consider the pore sizes to be comparable to the bacterial head (or equivalently polymer chains to be long enough), such that they slip past the head (equations (8)–(10)). In both these cases the pore size in the polymer network is assumed to be much larger than the flagellar bundle thickness (). These cases highlight the effect of microstructure at the length scale of the flagellar bundle and the entire bacterium respectively. We first describe these results for a bacterium with a spherical head, before describing the effect of the spheroidal shape of the head.
Effects of microstructure at the length scale of flagellar bundle
Figure 9a shows the swimming speed , normalized by , the swimming speed in a single-phase Newtonian liquid of viscosity (hereafter referred to as ’mixture’), plotted as a function of , where is the radius of the head, for three different values of the viscosity ratio .
Figure 9. Results with no-slip polymers. (a) Swimming speed normalized by the velocity in a single-fluid Newtonian medium of viscosity as a function of . (b) Swimming speed normalized by the velocity in a pure solvent () as a function of . (c) Normalized angular velocity of the head and (d) normalized angular velocity of the flagellar bundle as functions of for different . Red solid lines denote predictions from resistive force theory [38].
As increases from zero, the swimming speed initially increases, reaching up to 1.8 times the single-phase value for , with a maximum near . This enhancement exceeds predictions from resistive force theory (RFT) [38] (dashed horizontal lines in Figure 9a), which neglects hydrodynamic interactions between the head and the flagellar bundle. The degree of enhancement is found to scale with the viscosity ratio . At larger values of , the swimming speed gradually decreases but remains above the mixture value within the range of considered.
Figure 9b shows the swimming speed , normalized by the speed in a pure solvent (, viscosity ), as a function of at fixed . The speed decreases monotonically with increasing polymer viscosity. Figure 9c and Figure 9d show the normalized angular velocities of the head () and flagellar bundle (), respectively. Although is nearly independent of and agrees with the RFT predictions, increases with for fixed , highlighting the non-trivial coupling between the flagellar bundle and the microstructure of the medium. This is because, the head in this case always sees the two-fluid medium as a mixture (since no-slip condition is applied to both solvent and polymer), whereas the bundle gets decoupled from the polymer as increases. Thus for large , the bundle essentially rotates in a solvent, and therefore experiences less resistance to rotation than when . This can also be seen from Figure 10, which plots the radial velocity in the solvent and polymer fluids due to the motion of the bacterium for two values of . We see that the polymer field closely resembles the solvent field as , whereas the polymer flow corresponds to that of the flow due to a translating and rotating sphere for . This decoupling explains the dependent increase in flagellar rotation seen in Figure 9d.

Figure 10. Radial velocity fields of the solvent and polymer fluids for (a),(b) and (c),(d) . At small , the polymer fluid experiences local forcing from the flagellar bundle, while at large , the flow resembles that induced by a translating and rotating sphere, with no (direct) forcing from the bundle. The velocity is non-dimensional and is scaled by , where as shown in Table 2.
There are two major features in the swimming speed of a bacterium, that are caused by the microstructure of the swimming medium. First, one observes a non-monotonic variation of the swimming speed with (Figure 9a), and second, the enhancement in velocity relative to mixture is larger for larger viscosity ratio . The physical reason for these two observations are provided below. In order to understand the non-monotonic behavior, we first plot the flow field produced by a rotating helix, when subject to an input torque, in Figure 11. We see that the rotation of the helix produces an axial flow along the length of the helix, whereas very close to the surface of the helical bundle, the flow field is rotational (as can be seen by the streamlines in Figure 11a). This implies that the thrust force produced by the rotating helix (for a given input torque) is proportional to both the angular speed of the helix and the resistance to the (axial) flow offered by the medium over a length scale of the helix.

Figure 11. (a) Azimuthal velocity field () and (b) axial velocity field () of the solvent for due to a helix subject to an input torque . The flow field is rotational in a plane perpendicular to the helical axis, whereas the rotation of helix also produces an axial flow, which generates the thrust needed for propulsion.
In Figure 12a, we plot the angular speed of a helix rotated by an input torque as a function of for different values of (note that in our bacterium simulations ). These are calculated from the slender body theory for a helix in two-fluid medium (eq. (15)) without the presence of bacterial head. Figure 12b plots the thrust produced by the same helix as a function of for different values of . Both these values are normalized by their corresponding values in a mixture (viscosity ). We note from Figure 12b, that the thrust produced is non-monotonic. This can be understood in conjunction with Figure 12a, where we see that as increases from zero, the angular velocity of the helix increases. This is because the resistance to flow closer to the helix surface decreases with increasing , where now locally, the helix starts seeing less of the polymers. But on larger length scales (of ), the resistance to flow is still that due to the mixture. This increase in angular velocity, combined with the large length scale resistance corresponding to that of the mixture (maximum possible resistance to flow), leads to an increase in thrust. This increase continues until , when the (local) resistance to rotation of the helix has dropped entirely to that corresponding to solvent alone, and subsequent increase in now results in a drop in the large length scale resistance to flow (as the polymer becomes decoupled from helix over larger length scale). This results in the angular velocity plateauing off and the thrust decreasing for . This results in the non-monotonic variation of the thrust, that also results in the non-monotonic variation in swimming speed.
Figure 12. Plot of normalized angular velocity of the helix () and (b) the thrust force generated by a rotating helix, when subject to a given input torque () for different values of , with the ratio of pitch to helix radius () kept constant. Note that the thrust is non-monotonic with the maximum always occurring at . The results are obtained from slender body theory for a helix in two-fluid medium (eq. (15), Narayanan et al. [38]).
To understand the second feature, we plot the normalized thrust and the thrust-to-drag ratio for a force-free rotating helix, subject to a given input torque () for different in Figure 13. The thrust-to-drag ratio is obtained by dividing the thrust generated for a given torque to drag on a translating helix moving with a unit velocity . This ratio therefore is equal to the force-free swimming velocity of a helix subject to a given input torque. From the plot, we see that this ratio is larger than the mixture value, with this ratio being larger for larger . This can be understood as follows, for both (mixture with viscosity ) and (pure solvent with viscosity ), the thrust produced by a helix for a given torque is the same owing to Stokesian linearity and is independent of viscosity. However, the drag on the helix increases with increasing in the limit , and is independent of in the limit as the helix only moves in a pure solvent in this limit. Therefore for the same thrust, at large and finite , the drag experienced by the helix drops, and therefore the force-free swimming velocity increases as increases, and the increase is larger for larger as the drag on helix drops by a larger amount. Together, these two features of the two-fluid slender body theory directly contribute to the same features observed in the plot of swimming velocity of a bacterium (Figure 9a).
Figure 13. Plot of (a) normalized thrust force generated by a rotating helix, and (b) the ratio of thrust to drag (free-swimming velocity) when subject to a given input torque () for different values of . Note that for this calculation the radius of helix is fixed at . The results are obtained from slender body theory for a helix in two-fluid medium (eq. (15), Narayanan et al. [38]).
The fact that the trends obtained for a helix in a two-fluid medium are also observed for a swimming bacterium can be further justified by using a resistivity formulation for bacterium motion, accounting for the direction of swimming:
The off-diagonal terms represent the coupling between translational and rotational motion, which is absent in the flow around passive spherical or spheroidal particles. The coefficient represents the contribution to the force on the head due to translation of the head (with unit velocity), is the contribution due to rotation of the head (with unit angular velocity), and and represent the contributions to the head force due to translation and rotation of the flagellar bundle, respectively. Importantly, the coefficient represents the dominant contribution to the thrust due to the rotation of the bundle. Our numerical method offers us a unique advantage of selectively understanding each of these coefficients and their contribution to the overall bacterial motion, a feature that so far been unaddressed in earlier studies on the same. To that end, we first solve a simpler system where the hydrodynamic interactions (HI) between the head and the bundle are turned off. Here, the resistivity formulation reduces to:
Here, and are the Stokesian resistance to the motion of the bacterial head in the two-fluid medium, which for the case considered here, reduces to and for the spherical head. Similarly, the coefficients , , , can be calculated using the two-fluid slender body theory (eq. (15)),Narayanan et al. [38], where unlike in RFT, the slender body theory accounts for the HI between different points on the helix. Using these coefficients, and by imposing force-free, torque-free and input torque constraints, one can calculate the swimming parameters for a bacterium, which is plotted in figure 14, where it is compared with the swimming velocity from the full calculation (corresponding to eq. (69) with HI between head and the bundle included), and the RFT prediction (Narayanan et al. [38]). These results serve two crucial purposes. First, it shows that HI between different points on the helix affects the swimming motion more than HI between the head and the helix, inclusion of which only slightly changes the reduced system prediction. Second, it also justifies our earlier explanation, where characteristic features from the SBT calculation for a helix carried over to the swimming velocity of the bacterium. This however does not imply HI between the head and the bundle aren’t important. While the results above correspond to purely Newtonian two-fluid medium, the presence of non-linear effects like viscoelasticity and inertia can significantly alter the contributions from HI. In these cases, all the coefficients in eq. (69) become time-dependent and they can be tracked with our numerical method.
Figure 14. Plot of (a) normalized swimming velocity, (b) head angular velocity and (c) tail angular velocity for . The velocities from the reduced system (eq. (70) without HI between head and bundle) are compared from the prediction from the full calculation (eq. (69))
While HI between the head and the bundle don’t significantly affect the swimming parameters, relative to when these interactions aren’t included, one can still understand how HI at different and affect swimming motion in order to thoroughly explain bacterial motion. To this end, we plot the drag on the head and the (net) thrust generated by the flagellar bundle in Figure 15 and compare it with the drag and thrust without HI. In plotting the former, we essentially calculate , and similarly for the thrust , after calculating , and that satisfies the motion constraints. We see that HI between head and the bundle increases the (net) thrust generated by the bacterium, and also the drag on the head. However the swimming velocity is slightly smaller for the bacterium when HI is included between the head and the bundle because the increase in thrust is overcompensated by an increase in the drag. Similar comments can be made about the torque on the head and the bundle, which result in smaller angular velocities of the head and the bundle with HI.
Figure 15. (a) Drag and torque on the head as functions of , for a bacterium swimming in the two-fluid medium with and without HI between the head and the bundle. (b) Net thrust produced by the flagellar bundle for the same. Note that HI between head and the bundle increase both drag and thrust with the former being significantly more than the latter.
While the results above pertained to bacterium with a spherical head, our method can in fact model a spheroidal head with aspect ratio greater than 1. In Figure 16a,Figure 16b we plot the swimming parameters for a bacterium with a spheroidal head with aspect ratio and , which are roughly the range of aspect ratios of E. coli head measured in experiments.
Figure 16. Plot of (a) normalized swimming velocity, (b) absolute dimensionless swimming velocity, (c) head angular velocity and (c) tail angular velocity for , and three different head aspect ratio . The velocities follow similar trend as the spherical case, with higher head aspect ratio leading to smaller swimming and head angular velocity relative to the spherical case.
We see that here, the results follow similar trend as the case with spherical head (, but the absolute values of swimming velocity decreases slightly with increasing . This can be attributed to the higher drag on a spheroid relative to the drag on a sphere in Stokesian regime.
Effects of microstructure at the length scale of the head
As mentioned earlier, when the polymer network exhibits larger pore size or when the polymer chains are large, they can slip past the bacterial head and are therefore modeled using the slip boundary conditions given in equations (8)–(10). In contrast to the previous case, where only the flagellar bundle experienced different resistances from the solvent and polymer fluids, here, the head does as well.
Figure 17 shows the same swimming parameters as in Figure 9, but for the case of slipping polymers. The overall trends are qualitatively similar to those observed for the no-slip case. However, the enhancement in swimming velocity at is notably larger, reaching 2.9 times the speed in a single fluid mixture of viscosity for , compared to 1.8 for no-slip polymers. This may be attributed to the reduced resistance from the polymer fluid when slip is allowed at the head. Another significant difference is the behavior of the head’s angular velocity, , which now increases with (Figure 17c). In contrast, for the no-slip case, was independent of . This can once again be attributed to the reduced resistance to rotation when the polymer is allowed to slip. These results underscore the influence of polymer microstructure not just on the flagellar bundle but also on the bacterial head.
Figure 17. Same plots as in Figure 9, but for the case of slipping polymers.
Conclusion
We have developed a numerical framework that simultaneously incorporates several important features of bacterial swimming and the surrounding biological fluid that are often neglected in computational modeling. These include the non-Newtonian elastoviscoplastic (EVP) rheology of the bio-fluid, the length-scale dependent spatial heterogeneity of the bio-fluid (polymer microstructure), and the length-scale dependent differential response of the bio-fluid. To strike a balance between capturing key physical features and maintaining computational feasibility, we do not resolve individual polymer-flagellar bundle interactions. Instead, we adopt a two-fluid model consisting of a polymer fluid and a Newtonian solvent fluid. In this model, the flagellar bundle directly drives the solvent, and momentum is exchanged between the two fluids via a drag force proportional to their relative velocity and inversely proportional to a characteristic screening length, , which is a measure of the microstructural length scale. We model two types of polymer-bacterial head interactions: no-slip and perfectly slipping polymers that generate no tangential stress on the bacterial head. These boundary conditions mimic the behavior of short and long polymer chains, respectively. The flagellar forcing on the solvent is modeled using slender-body theory (SBT) as formulated by Narayanan et al. [38]. In addition to microstructural interactions, the polymer also generates a polymer stress, , which captures the EVP response of the medium. As illustrated in Figure 3, the computational framework couples three main components: the two-fluid mass and momentum equations (), slender-body theory for flagellar forcing ( and ), and constitutive equations for polymer stress.
In the absence of polymer stress , the entire problem is linear in the unknown variables: the translational and angular velocities of the bacterium, the background flow, and the force distribution along the flagellar bundle. Recognizing this allows us to decompose both the flow field around the swimmer and the hydrodynamic moments (net force and torque) into three contributions: those induced by rigid-body kinematics, by flagellar forcing, and by . The flows and moments due to kinematics and flagellar forcing can themselves be further decomposed into elementary components that are pre-computed for a given bacterial head shape and flagellar geometry. Once is introduced, the total flow and moment are computed by adding the contributions from these pre-computed components and the polymer stress. This linear decomposition enables a resistivity formulation in which the swimming velocities and the flagellar force distribution are obtained by solving a linear system involving a resistivity matrix. This matrix is assembled from pre-computed flow fields, and the resulting formulation satisfies force- and torque-free conditions, as well as slender-body theory constraints, in a non-iterative manner. This not only simplifies the algorithm but also makes it significantly more efficient.
When , the problem is quasi-steady. However, the viscoelastic stress evolves according to a time-dependent constitutive law, making the full EVP problem transient. At each time step, only two components must be updated: the stress (via time integration of the constitutive equations) and the flow induced by (obtained by inverting one component of the mass–momentum equation). Both steps are performed using a two-fluid extension of the finite-difference solver developed by Sharma & Koch [51], written in the particle reference frame and prolate spheroidal coordinates. The computational domain consists of the bacterium centered within a nearly spherical outer boundary. Pre-computed flows due to kinematic and flagellar forcing are also obtained by inverting the mass–momentum equations using this finite-difference technique. The discretization of the flagellar bundle in the slender-body formulation follows the method of Rodenborn et al. [47]. This modular strategy combines operator decomposition, pre-computed basis flows, and a flexible two-fluid solver into a versatile numerical framework for simulating bacterial swimming in an elastoviscoplastic, microstructured media. Arbitrary linear or uniform background flows can also be imposed at the outer boundary, enabling exploration of a wide range of swimming behavior such as rheotaxis, upstream swimming etc. Additionally, the framework can also be extended to compute suspension-averaged stress in dilute bacterial suspensions using ensemble-averaging techniques ([27]), under the assumption of negligible swimmer–swimmer interactions.
In this work, we have used the numerical framework to study the effect of polymer microstructure on bacterial swimming in a quiescent fluid by turning off the EVP response. Focusing on a bacterium with a spherical head, we systematically varied the screening length to study its influence on motility. We found that the improvement of swimming speed near , originally predicted by Narayanan et al. [38] using resistive force theory (RFT), is significantly amplified when hydrodynamic interactions (HI) are included between the head and the flagellar bundle. Using a linear resistivity framework, we demonstrate that these interactions enhance drag, thrust, and redistribute the force density along the flagellar bundle. Interestingly, while the angular velocity of the head remains largely unaffected by , the flagellar rotation rate shows a strong dependence on the microstructural length scale. At values near the peak enhancement, the polymer velocity field is substantially disturbed by flagellar forcing, whereas at large , the polymer response is largely due to the head and the swimming speed gain diminishes. This enhancement is even more pronounced for long polymers that can slip past the bacterial head, compared to the no-slip case. Contrary to the no-slip scenario, polymer slipping also increases the rotation speed of the bacterial head. These findings underscore the critical role of both microstructure and polymer–surface boundary conditions in modulating bacterial propulsion in complex fluids.
As the solver incorporates multiple key features of bacterial swimming in biological fluids, it can now be used to explore the interplay between different non-Newtonian properties, such as yield stress, viscoelasticity, and microstructural length scale (), and their impact on swimming efficiency in quiescent media. By quantifying how polymer microstructure alters bacterial translation and rotation, the solver offers predictive insight that can inform future laboratory experiments and biomedical applications. Recent work by Torres Maldonado et al. [55] has shown that shear-thinning viscoelasticity enhances upstream swimming of bacteria near walls by inducing a reorientation torque that aligns the swimmer against the flow. This behavior has important implications for wastewater contamination and the design of medical devices to prevent bacterial invasion, such as upstream migration in the urinary tract. Since the flow near walls approximates simple shear, and previous studies have shown that viscoelasticity can produce a wide range of orientation dynamics for spheroids in shear flow [13, 52], our framework provides a natural extension to investigate how EVP rheology and microstructure influence swimmer alignment and navigation in such environments. Another interesting phenomena that can be addressed with our framework is the effect of bacterial wobbling on the swimming characteristics. Past experiments by Patteson et al. [43]; Kamdar et al. [22] etc. have suggested swimming enhancement can result from a reduction in bacterial wobbling and the method can also be retrofitted to simulate a wobbling bacterium, for instance by using the model proposed by Kamdar et al. [22], in order to understand the relative importance of the different physical features (wobbling, shear-thinning, yield stresses etc.) that govern the swimming motion.
Together, these capabilities position the framework as a powerful tool for exploring how the interplay of microstructure, viscoelasticity, and boundary interactions shapes microbial locomotion in complex biological fluids, with implications for both fundamental science and biomedical applications.
Author contributions
AS and SVN contributed equally to the work.
Competing Interests
The authors declare no conflicts of interest.
Funding Sources
AS was supported by the U.S. Department of Energy, Office of Science, Advanced Scientific Computing Research (ASCR) Early Career Research Program. This paper describes objective technical results and analysis. Any subjective views or opinions that might be expressed in the paper do not necessarily represent the views of the U.S. Department of Energy or the United States Government. Sandia National Laboratories is a multimission laboratory managed and operated by National Technology and Engineering Solutions of Sandia, LLC, a wholly owned subsidiary of Honeywell International Inc., for the U.S. Department of Energy’s National Nuclear Security Administration under contract DE-NA0003525.
This work was supported by the NSF CBET: Fluid Dynamics Award 2135617
Appendix A
Evaluating flow fields at points along the flagellar bundle using boundary integral formula
As mentioned in § 4, to obtain the required flow velocities in the SBT equation (15) we use a boundary integral formulation (BIF) technique rather than interpolating the numerically evaluated fields from the prolate spheroidal grid to the helical flagellar bundle. We describe the BIF in this section. For notational convenience, we set the solvent viscosity and the polymer viscosity . The governing equations for the two-fluid Newtonian medium in the absence of flagellar forcing are given by:
We define the mixture and difference fields as and , which yields:
Note that equation (A4) corresponds to the Stokes equations and equation (A5) to the Brinkman equations. Thus, the solution can be expressed using a suitable combination of the boundary integral formulas for Stokes and Brinkman flows. We consider a domain bounded by the head surface and a fictitious surface that will eventually be pushed to infinity (see Figure 18). Applying the boundary integral representation for Stokes flow in such a domain gives:

Figure 18. The domain bounded by the head surface and the fictitious outer surface , with normal vectors pointing into the fluid domain.
Similarly, the boundary integral expression for the difference field is:
Finally, the solvent and polymer velocities in equations (A 1)–(A 3) can be recovered from the BIF-computed fields and as:
That can be expressed in a condensed form:
where,
Note that the tensor is the two-fluid Green’s function whose components are given by [38]:
The numerical inputs for these integrals are the fluid stress and velocity at the bacterial head. While at the surface for the main flow component corresponding to , the flagellar flow component, , is obtained as a correction to the singularity-driven flow defined by equations (58)–(62). This leads to a finite at the surface, justifying the inclusion of the second term in equation (A 9).
Due to computational cost, we do not evaluate these integrals to obtain velocities corresponding to and at every point in the domain. Instead, we compute them only at the discrete points along the flagellar bundle, which is computationally inexpensive and avoids interpolation errors. A similar boundary integral formulation can be derived for the velocity induced by the polymeric stresses in equation (42). In that case, however, the volumetric forcing term introduces an additional volume integral alongside the surface integrals. We compared the interpolated velocities due to at the helix points using such a boundary integral formula against a Lagrangian polynomial interpolation scheme and found the former to be less accurate than the latter. Therefore we use a Lagrange polynomial interpolation of a higher order in the solver.
References
- [1]Anna, Shelley L & McKinley, Gareth H 2008 Effect of a controlled pre-deformation history on extensional viscosity of dilute polymer solutions. Rheologica acta 47, 841–859.DOI
- [2]Balmforth, N.J., Coombs, D. & Pachmann, S. 2010 Micro elasto-hydrodynamics of swimming organisms near solid boundaries in complex fluids. Quarterly Journal of Mechanics and Applied Mathematics 63, 267.
- [3]Barrett, A., Fogelson, A.L., Forest, G.M., Gruninger, C., Lim, S. & Griffith, B.E. 2024 Flagellum pumping efficiency in shear-thinning viscoelastic fluids. Journal of Fluid Mechanics 999, A2.DOI
- [4]Berg, H.C. 2003 The rotary motor of bacterial flagellar bundle. Annual Review of Biochemistry 72, 19–54.
- [5]Berg, H.C. & Turner, L. 1979 Movement of microorganisms in viscous environments. Nature 278, 349–351.pubmed.ncbi.nlm.nih.gov/370610
- [6]Bird, R.B., Armstrong, R.C. & Hassager, O. 1987 Dynamics of polymeric liquids. Vol. 1: Fluid mechanics. New York, NY: John Wiley and Sons Inc.
- [7]Bustos, N.A., Ribb eck, K. & Wagner, C.E. 2023 The role of mucosal barriers in disease progression and transmission. Advanced Drug Delivery Reviews 200, 115008.DOI
- [8]Celli, J.P., Turner, B.S., Afdhal, N.H., Keates, S., Ghiran, I., Kelly, C.P., Ewoldt, R.H., McKinley, G.H., So, P., Ern emilli, S. & Bansil, R. 2009 Helicobacter pylori moves through mucus by reducing mucin viscoelasticity. Proceedings of the National Academy of Sciences 106 (34), 14321–14326.DOI
- [9]Chattopadhyay, Suddhashil, Moldovan, Radu, Yeung, Chuck & Wu, XL 2006 Swimming efficiency of bacterium escherichia coli. Proceedings of the National Academy of Sciences 103 (37), 13712–13717.pubmed.ncbi.nlm.nih.gov/16954194
- [10]Cortez, R. 2001 The method of regularized stokeslets. SIAM Journal on Scientific Computing 23, 1204–1225.DOI
- [11]Dabade, Vivekanand, Marath, Navaneeth K & Subramanian, Ganesh 2015 Effects of inertia and viscoelasticity on sedimenting anisotropic particles. Journal of Fluid Mechanics 778, 133–188.DOI
- [12]Dabade, Vivekanand, Marath, Navaneeth K & Subramanian, Ganesh 2016 The effect of inertia on the orientation dynamics of anisotropic particles in simple shear flow. Journal of Fluid Mechanics 791, 631–703.DOI
- [13]D’Avino, Gaetano, Hulsen, MA, Greco, Francesco & Maffettone, PL 2014 Bistability and metastability scenario in the dynamics of an ellipsoidal particle in a sheared viscoelastic fluid. Physical Review E 89 (4), 043006.
- [14]Diamant, H. 2015 Response of a polymer network to the motion of a rigid sphere. European Physical Journal E 38, 32.DOI
- [15]Doi, M. 1990 Effects of viscoelasticity on polymer diffusion. In Dynamics and Patterns in Complex Fluids (ed. A. Onuki & K. Kawasaki). Springer.DOI
- [16]Eastham, P.S., Mohammadigoushki, H. & Shoele, K. 2022 Squirmer locomotion in a yield stress fluid. Journal of Fluid Mechanics 948, A54.DOI
- [17]Figueroa-Morales, N., Dominguez-Rubio, L., Ott, T.L. & Aranson, I.S. 2019 Mechanical shear controls bacterial penetration in mucus. Scientific Reports 9, 9713.
- [19]Hewitt, D.R. & Balmforth, N.J. 2017 Taylor’s swimming sheet in a yield-stress fluid. J. Fluid Mech. 828, 33–56.DOI
- [20]Hewitt, D.R. & Balmforth, N.J. 2018 Viscoplastic slender body theory. J. Fluid Mech. 856, 870–897.DOI
- [21]Hewitt, D.R. & Balmforth, N.J. 2022 Locomotion with a wavy cylindrical filament in a yield-stress fluid. J. Fluid Mech. 936, A17.DOI
- [22]Kamdar, S., Shin, S., Leishangthem, P., Francis, L.F., Xu, X. & Cheng, X. 2022 The colloidal nature of complex fluids enhances bacterial motility. Nature 603, 819–822.DOI
- [24]Kaper, James B, Nataro, James P & Mobley, Harry LT 2004b Pathogenic escherichia coli. Nature reviews microbiology 2 (2), 123–140.
- [25]Kaya, Tolga & Koser, Hur 2009 Characterization of hydrodynamic surface interactions of escherichia coli cell bodies in shear flow. Physical review letters 103 (1.3), 138103.pubmed.ncbi.nlm.nih.gov/19905544
- [26]Kirch, J., Schneider, A., Abou, B., Hopf, A., Schaefer, U.F., Schneider, M., Schall, C., Wagner, C. & Lehr, C.M. 2012 Optical tweezers reveal relationship between microstructure and nanoparticle penetration of pulmonary mucus. Proc. Nat. Acad. Sci. 109 (45), 18355–18360.DOI
- [27]Koch, Donald L, Lee, Eric F & Mustafae, Ibrahim 2016 Stress in a dilute suspension of spheres in a dilute polymer solution subject to simple shear flow at finite deformed numbers. Physical Review Fluids 1 (1), 013301.DOI
- [28]Lauga, E. 2016 Bacterial hydrodynamics. Ann. Rev. Fluid Mech. 48, 105–130.DOI
- [30]Lim, S. & Peskin, C.S. 2012 Fluid-mechanical interaction of flexible bacterial flagella by the immersed boundary method. Phys. Rev. E 85 (3), 036307.pubmed.ncbi.nlm.nih.gov/22587180
- [31]Man, Y. & Lauga, E. 2015 Phase-separation models for swimming enhancement in complex fluids. Phys. Rev. E 92, 023004.arxiv.org/abs/1506.08286
- [32]Martinez, V.A., Schwarz-Linek, J., Ruffer, M., Wilson, L.G., Morozov, A.N. & Poon, W.C.K. 2014 Flagellated bacterial motility in polymer solutions. Proc. Nat. Acad. Sci. USA 111, 17771–17776.DOI
- [33]Montenegro-Johnson, T.D., Smith, A.A., Smith, D.J., Loghin, D. & Blake, J.R. 2012 Modelling the fluid mechanics of cilia and flagella in reproduction and development. Eur. Phys. J. E 35, 111.
- [34]Montenegro-Johnson, T.D., Smith, D.J. & Loghin, D. 2013 Physics of rheologically enhanced propulsion: Different strokes in generalized stokes. Phys. Fluids 25, 081903.
- [35]Moradi, M., Shi, W. & Nazockdast, E. 2022 General solutions of linear poro-viscoelastic materials in spherical coordinates. J. Fluid Mech. 946, A22.DOI
- [36]Morozov, K.I. & Lehshansky, A.M. 2022 Motility of slender objects in entangled polymer solutions. Macromol. 55, 3116–3128.
- [37]Morozov, K.I. & Lehshansky, A.M. 2023 On the Mobility of Nanoparticles in Entangled Polymer Solutions. Macromol. 56, 9014–9026.DOI
- [38]Narayanan, S.V., Koch, D.L. & Hormozi, S. 2024 A swimming bacterium in a two-fluid model of a polymer solution. J. Fluid Mech. 1001, A8.DOI
- [39]Nazari, F., Shoele, K. & Mohammadigoushki, H. 2023 Helical locomotion in yield stress fluids. Phys. Rev. Lett. 130, 114002.DOI
- [40]Notay, Y. 2008 Agmg software and documentation. https://www.agmg.eu.
- [41]Oseen, C.W. 1927 Hydrodynamik. Leipzig: Akad. Verlag.
- [42]Padhy, S., Shaqfeh, ESG, Iaccarino, G., Morris, JF & Tonmukayakul, N 2013 Simulations of a sphere sedimenting in a viscoelastic fluid with cross shear flow. Journal of Non-Newtonian Fluid Mechanics 197, 48–60.DOI
- [43]Patteson, A.E., Gopinath, A., Goulian, M. & Aratia, P.E. 2015 Running and tumbling with E. coli in polymeric solutions. Sci. Rep. 5, 15761.DOI
- [44]Purcell, Edward M 2014 Life at low reynolds number. In Physics and our world: reissue of the proceedings of a symposium in honor of Victor F Weisskopf, pp. 47–67. World Scientific.
- [47]Rodenborn, B., Chen, C.H., Swinney, H.L., Liu, B. & Zhang, H.P. 2013 Propulsion of microorganisms by a helical flagellar bundle. Proc. Nat. Acad. Sci. 110, E338–E347.
- [48]Sarabian, M., Rosti, M.E., Brandt, L. & Hormozi, S. 2020 Numerical simulations of a sphere settling in simple shear flows of yield stress fluids. J. Fluid Mech. 896, A17.
- [49]Saramito, P. 2009 A new elastoviscoplastic model based on the herschel–bulkley viscoplastic model. J. Non-Newt. Fluid Mech. 158, 154–161.DOI
- [50]Sharma, Arjun, Bosler, Peter A, Govindarajan, Rama & Koch, Donald L 2025 Sedimentation and shear-induced dynamics of spheroids in fluids with spatial viscosity variations. Journal of Fluid Mechanics 1007, A53.DOI
- [51]Sharma, A. & Koch, D.L. 2023a Finite difference method in prolate spheroidal coordinates for linear flow past a spheroid in viscoelastic fluids with zero to moderate inertia. J. Comp. Phys. 495, 112559.
- [52]Sharma, Arjun & Koch, Donald L 2023b Rotation of a fibre in simple shear flow of a dilute polymer solution. Journal of Fluid Mechanics 976, A9.arxiv.org/abs/2310.00792
- [53]Spagnolie, S.E. & Underhill, P.T. 2023 Swimming in complex fluids. Ann. Rev. Condens. Matter Phys. 14, 381–415.DOI
- [54]Tenaillon, Olivier, Skurnik, David, Picard, Bertrand & Denamur, Erick 2010 The population genetics of commensal escherichia coli. Nature reviews microbiology 8 (3), 207–217.DOI
- [55]Torres Maldonado, Bryan O, Théry, Albane, Tao, Ran, Brosseau, Quentin, Mathijssen, Arnold JTM & Arratia, Paulo E 2024 Enhancement of bacterial rheotaxis in non-newtonian fluids. Proceedings of the National Academy of Sciences 121 (50), e2417641121.DOI
- [56]Townsend, A.K. & Keaveny, E.E. 2024 Undulatory swimming in suspensions and networks of flexible filaments. J. Fluid Mech. 993, A10.DOI
- [57]Yazdi, Alie Abbasi & D’Avino, Gaetano 2024 Sedimentation of a spheroidal particle in an elastoviscoplastic fluid. Physics of Fluids 36, 043119.arxiv.org/abs/2403.15178
- [58]Zottl, Andreas & Yeomans, Julia M 2019 Enhanced bacterial swimming speeds in macromolecular polymer solutions. Nature Physics 15, 554–558.DOI











