Get 20M+ Full-Text Papers For Less Than $1.50/day. Start a 14-Day Trial for You or Your Team.

Learn More →

Efficient simulation of filament elastohydrodynamics in three dimensions

Efficient simulation of filament elastohydrodynamics in three dimensions Efficient simulation of filament elastohydrodynamics in three dimensions 1, ∗ 2, † 1, ‡ Benjamin J. Walker, Kenta Ishimoto, and Eamonn A. Gaffney Wolfson Centre for Mathematical Biology, Mathematical Institute, University of Oxford, Oxford, OX2 6GG, UK Research Institute for Mathematical Sciences, Kyoto University, Kyoto, 606-8502, Japan (Dated: October 23, 2020) Fluid-structure simulations of slender inextensible filaments in a viscous fluid are often plagued by numerical stiffness. Recent coarse-graining studies have reduced the computational requirements of simulating such systems, though have thus far been limited to the motion of planar filaments. In this work we extend such frameworks to filament motion in three dimensions, identifying and circumventing coordinate-system singularities introduced by filament parameterisation via repeated changes of basis. The resulting methodology enables efficient and rapid study of the motion of flexible filaments in three dimensions, and is readily extensible to a wide range of problems, including filament motion in confined geometries, large-scale active matter simulations, and the motility of mammalian spermatozoa. PACS numbers: 47.15.G-, 47.63.Gd, 87.15.La I. INTRODUCTION The coupled elasticity and hydrodynamics of flexible inextensible filaments on the microscale are of significance to much of biology, biophysics and soft matter physics. For example, many organisms possess slender flagella or cilia, utilised for driving flows and even locomotion, whilst investigation into the role of synthetic filaments as both soft deformable sensors and methods of propulsion has been the subject of recent enquiry [1–9]. As a result, the complex mechanics of fluid-structure interaction has been well-studied, utilising methods such as the slender body and resistive force theories of Hancock [2], Gray and Hancock [10], Johnson [11], through to the exact representations of boundary integral methods as used by Pozrikidis [6, 7, 12]. A fundamental barrier to much numerical investigation has been the severe stiffness associated with the equations of filament elasticity when coupled to viscous fluid dynamics. Hence, as remarked in the recent and extensive review of du Roure et al. [13], an appropriate framework, capable of realising efficient simulation of filament elastohydrodynamics, is crucial for the numerical study of filament mechanics. Recently, significant progress has been made in resolving the dynamics of planar filaments, with the work of Moreau et al. [14] presenting a coarse-grained model of filament elasticity that overcame much of the stiffness previously associated with slender elastohydrodynamics. Key to this approach was the integration of the pointwise force and moment balance equations, the spatial discretisation of which yielded a relatively simple system of ordinary differential equations to solve in order to describe filament motion. Additionally demonstrated to be flexible in the original publication of Moreau et al., this framework has been extended to include non-local hydrodynamics in both infinite and semi-infinite domains, and applied to a variety of single and multi-filament problems [15, 16]. However, being confined to two dimensions limits the potential scope and applicability of these approaches, with three dimensional filament motion being readily and frequently observed in a plethora of biophysical systems, such as the complex flagellar beating found in spermatozoa or the helically-driven monotrichous bacterium Escherichia coli [3, 17]. However, for non-planar filaments in three dimensions there is currently no methodology analogous to that of Moreau et al., with state-of-the-art frameworks still plagued by extensive numerical stiffness, necessitating costly computation to the extent that practical simulation studies have been limited and parameter space studies are largely prohibited. With three dimensions inherently more challenging than lower dimensional settings, this field has seen developments such as the recent work of Schoeller et al. [18], which utilises a quarternion representation of filament orientation to parameterise the three dimensional shape of the slender body. However, in this framework, numerical care is required to satisfy the inextensibility condition, with similar such consideration necessary in the earlier methodologies of Olson et al. [19], Simons et al. [20], Ishimoto and Gaffney [21], Bouzarth et al. [22], each of which are equipped with non-local slender-body hydrodynamics and consider nearly inextensible filaments. Consequently, these existing approaches often require the use of sophisticated computing hardware in order to simulate filament motion, with typical simulations of Ishimoto and Gaffney having a runtime of multiple hours on high performance computing clusters. The recent work of Jabbarzadeh and Fu [23] compared and contrasted these nearly inextensible approaches Corresponding author: benjamin.walker@maths.ox.ac.uk ishimoto@kurims.kyoto-u.ac.jp gaffney@maths.ox.ac.uk arXiv:1907.04823v5 [physics.flu-dyn] 22 Oct 2020 2 with a truly inextensible scheme, concluding that both accuracy and efficiency was afforded by the latter in a range of biological and biophysical modelling scenarios. Despite their improved efficiency, typical walltimes for these filament simulations are measured on a timescale of hours on typical hardware. Thus, there remains significant scope for the development of an efficient framework for the simulation of inextensible elastic filaments in three dimensions, one in which filament dynamics can be rapidly computed on non-specialised hardware on timescales of seconds or minutes, thus facilitating a wealth of future studies and explorations into complex and previously intractable biological and physical systems. Hence, the fundamental objective of this study is to develop and describe an efficient framework for the numerical simulation of filament mechanics in three dimensions. We will build upon the recent and significant work of Moreau et al. [14], extending their approach to include an additional spatial dimension via a generalisation of the Frenet triad and integration of the governing equations of elasticity. We will overcome fundamental issues with simple single parameterisations of a filament in three dimensions, presenting an effective computational approach utilising adaptive reparameterisation and basis selection. We will then validate the presented framework by consideration of three candidate test problems, simulating well-documented behaviours of filaments in a viscous fluid and including a side-by-side comparison against the existing and recent methodology of Ishimoto and Gaffney [21]. Finally, we will showcase the flexibility and general applicability of the presented approach by describing and exemplifying a number of methodological extensions. II. METHODS A. Equations of elasticity We consider a slender, inextensible, unshearable filament in a viscous Newtonian fluid, with its centreline described by x(s), parameterised by arclength s ∈ [0, L] for dimensional filament length L. We model the filament as a Kirchhoff rod with arclength-independent material parameters, circular cross-sections, and, in the first instance, no intrinsic curvature or intrinsic torsion. Both the filament and fluid inertia are negligible for the physical scales associated with many applications, especially those associated with cellular flagella and cilia; hence there is no inertia here and throughout. Along the filament we have the pointwise conditions of force and moment balance, given explicitly by n − f = 0 , (1) m + x × n − τ = 0 , (2) s s for contact force and torque denoted n,m respectively and where a subscript of s denotes differentiation with respect to arclength. The quantity f is the force per unit length applied on the fluid medium by the filament, which we will later express in terms of the filament velocity x˙ , where here a dot denotes a time derivative. Similarly, τ is the torque per unit length applied on the fluid medium by the filament. Whilst any standard boundary condition may be considered in the formalism below, throughout we impose zero force and torque at the filament ends so that n(0) = n(L) = m(0) = m(L) = 0 . (3) In the Kirchhoff framework note that the contact force is not constitutive, but simply an undetermined Lagrange multiplier for the intrinsic constraints of inextensibility and no shearing of the filament cross section in any direction [24]. Thus we may eliminate n(s) at the earliest opportunity; using the boundary condition n(L) = 0 and Eq. (1) we have n(s) = − f(s˜) ds˜. (4) This relation is also subject to the constraint that the boundary condition n(0) = 0 is satisfied, generating a global force balance constraint for the applied force per unit length, 0 = f(s˜) ds˜, (5) which we carry forward into the formalism below together with the elimination of n(s) via Eq. (4). Thus, and as originally considered in Moreau et al. [14], integration of Eq. (2) and use of the boundary condition m(L) = 0, reveals 3 the integrated moment balance − (x(s˜) − x(s)) × f(s˜) + τ(s˜) ds˜ = m(s) . (6) Given a right-handed orthonormal director basis {d (s),d (s),d (s)}, generalising the Frenet triad such that d 1 2 3 3 corresponds to the local filament tangent, following Nizette and Goriely [25] we define the twist vector κ by ∂d = κ × d (7) ∂s for α = 1, 2, 3. Writing κ = κ d , for bending stiffness EI we use the Euler-Bernouilli constitutive relation of α α the Kirchhoff formalism to relate the contact torque m and the twist vector κ [24], via m = EI κ d + κ d + κ d , (8) 1 1 2 2 3 3 1 + σ where σ is the Poisson ratio [25], assumed to be constant. With this constitutive relation the integrated moment balance equations in the d directions are simply EI − d (s) · (x(s˜) − x(s)) × f(s˜) + τ(s˜) ds˜ = κ (s) , (9) α α 1 + δ σ α,3 for α = 1, 2, 3 and where δ denotes the Kronecker delta. a,b B. Filament discretisation In discretising the filament we follow the approach of Walker et al. [16], as previously applied to planar filaments and itself building upon the earlier work of Moreau et al. [14]. We approximate the filament shape with N piecewise- linear segments, each of constant length Δs, with segment endpoints having positions denoted by x , . . . ,x and 1 N+1 the constraints of inextensibility and the absence of cross section shear are satisfied inherently. The endpoints of the th i segment correspond to x and x for i = 1, . . ., N, with the local tangent d being constant on each segment i i+1 3 and denoted d . In what follows we will consider a discretisation of d ,d such that they are also constant on each 1 2 i i segment, and we denote these constants similarly as d ,d . Writing s for the constant arclength associated with each 1 2 material point x , we apply Eq. (9) at each of the s for i = 1, . . ., N, splitting the integral at the segment endpoints i i to give sj+1 EI − d · (x(s˜) − x ) × f(s˜) + τ(s˜) ds˜ = κ (s ) , (10) i α i 1 + δ σ α,3 j=i th for α = 1, 2, 3. On the j segment, x may be written as x(s) = x + η(x − x ), where η ∈ [0, 1] is given by j j+1 j η = (s − s )/Δs. Additionally discretising the force per unit length as a continuous piecewise-linear function, with η as above we have f(s) = f + η(f − f ) on the segment, where we write f = f(s ). Substitution of these j j+1 j j j parameterisations into Eq. (10) and subsequent integration yields, after simplification, EI i τ − d · I + I = κ (s ) , (11) α i α i i 1 + δ σ α,3 where the integral contribution of the force and torque densities are denoted I and I respectively. With this i i discretisation I has reduced to   " # " #   2 2 Δs Δs Δs Δs f j j I = x − x + d × f + x − x + d × f , (12) j i j j i j+1 3 3   2 6 2 3 j=i 4 in agreement with expressions for planar filaments found in Moreau et al. [14], Walker et al. [16]. As we will highlight below, the contributions of the applied torque per unit length are relatively small given the slenderness of the filament, τ th motivating a less refined discretisation for I . Hence, taking the piecewise constant discretisation τ = τ on the j segment, we have the simple expression I = Δsτ . (13) j=i From the above we see explicitly that the integral component of each moment balance equation may be written as a linear operator acting on the f and the τ . Similarly, with this piecewise-linear force discretisation the integrated j j force balance of Eq. (1) simply reads Δs − (f + f ) = n(0) . (14) j j+1 j=1 We write F = [f , f , f , . . . , f , f , f ] for components f , f f of f with respect to some 1,x 1,y 1,z N+1,x N+1,y N+1,z j,x j,y, j,z j fixed laboratory frame with basis {e ,e ,e }, and similarly T for the vector of components of applied torque per unit x y z length. Here and throughout, forces and torques are written with respect to the laboratory reference frame. With this notation, we may write the equations of force and moment balance as − B = R , (15) where B is a matrix of dimension (3N + 3)× (6N + 3) with rows B . For k = 1, 2, 3 the first 3N + 3 columns are given by Δs B = [1, 0, 0, 2, 0, 0, 2 . . ., 2, 0, 0, 1, 0, 0] , Δs B = [0, 1, 0, 0, 2, 0, 0, 2 . . ., 2, 0, 0, 1, 0] , (16) Δs B = [0, 0, 1, 0, 0, 2, 0, 0, 2 . . ., 2, 0, 0, 1] , and correspond to the force balance of Eq. (14), with the remaining 3N columns zero. The remaining rows of B encode the moment balance of Eq. (11) as expanded in Eq. (12), organised in triples such that B projects 3(i−1)+3+α th i th i τ the i moment balance equation onto d , in that this (3i + α) row of B captures the d component of −(I + I ). α α i The cross products inherited from Eq. (12) may now be notationally simplified by use of the cyclic property of the scalar triple product, explicitly giving   " # " #   2 2 Δs Δs Δs Δs f j j i i i d · I = d · x − x + d × f + d · x − x + d × f (17) α α j i j α j i j+1 i 3 3  2 6 2 3  j=i   " # " #   2 2 Δs Δs Δs Δs j j i i = d × x − x + d · f + d × x − x + d · f , (18) j i j j i j+1 α α 3 3   2 6 2 3 j=i with the latter expression readily transcribed as a linear operator acting on the f for j = i, . . ., N. Analogously, we have i τ i d · I = Δsd · τ , (19) α i α j=i from which a linear operator acting on the τ for j = i, . . . , N can be constructed. Accordingly, the (3N + 3)-vector R is given by EI R = [0, 0, 0, κ (s ), κ (s ), κ (s ), κ (s ), . . . , κ (s )] , (20) 1 1 2 1 3 1 1 2 3 N 1 + δ σ α,3 5 so that the local moment balance is expressed relative to the local director basis. We remark that each of the quantities involved in the construction of B and R are well-defined for a general filament in three dimensions, given the local directors d and d and computing the components of the twist vector as κ = d ·∂ d , κ = d ·∂ d , and 1 2 1 3 s 2 2 1 s 3 κ = d · ∂ d . In terms of the discretised filament, these arclength derivatives are approximated via finite differences 3 2 s 1 in practice. Additionally, we will proceed assuming that the filament is moment-free at the base, which additionally enforces κ (0) = κ (0) = κ (0) = 0. 1 2 3 C. Coupling hydrodynamics We now relate the force density f acting on the fluid to the velocity of each segment endpoint, utilising the commonly-applied method of resistive force theory as introduced by Hancock [2], Gray and Hancock [10] and adopted by Moreau et al. [14] for planar filaments, incurring typical errors logarithmic in the aspect ratio of the filament. Here −2 taking the radius of the filament to be ǫ = 10 L, which more generally is assumed to be small in comparison to the filament length, simple resistive force theory gives the leading order relation between filament velocity and force density as f = −C u , f = −C u . (21) t t t n n n Here f and f denote the components of the force density tangential and normal to the filament, with analogous t n definitions of u and u . We will utilise the expression of Gray and Hancock [10], with t n 2πµ 4πµ C = , C = , (22) t n log 2L/ǫ − 0.5 log 2L/ǫ − 0.5 where µ is the medium viscosity, noting the relation C = 2C . We approximate the local filament tangent at the n t i−1 segment endpoint x as the average of d and d for i = 2, . . ., N, with the tangent for i = 1 and i = N + 1 3 3 1 N simply being taken as d and d respectively. By linearity, and again assuming a piecewise-linear force density along 3 3 segments, we may write the coupling of translational kinematics to hydrodynamics as X = AF , (23) where A is a square matrix of dimension 3(N + 1) × 3(N + 1) and is a function only of the segment endpoints x . Of dimension 3(N + 1), the vector X corresponds to the linear velocities of the segment endpoints, and is constructed analogously to F with respect to the laboratory frame. This relation results from the application of the no-slip condition at the segment endpoints, coupling the filament to the surrounding fluid. In order to relate the rate of rotation of each segment to the viscous torque τ acting on it, we here consider an th approximation of the finite segment as an infinite rotating cylinder, associating the torque per unit length on the i segment with the rotation ω about its local tangent d via the relation of Chwang and Wu [26]: 2 i τ = 4πµǫ ω d (24) i i and in particular the ǫ scaling entails the torque per unit length contributions are relatively small. Here we recall that µ is the viscosity of the fluid medium, and ǫ is the radius of the filament. We may write this relation as a linear operator on ω = [ω , . . . , ω ] , written simply as T = Aω. This crude approximation may readily be substituted 1 N for non-local hydrodynamics via the method of regularised Stokeslet segments, which will likely be a topic of future work. Similarly, non-local hydrodynamics may be utilised in place of Eq. (23), as used for two-dimensional filament studies by Hall-Mcnair et al. [15] and Walker et al. [16], the latter incorporating a planar no-slip boundary and still yielding an explicit linear relation analogous to Eq. (23). Combining Eqs. (15), (23) and (24) yields the linear system " #" # " # −1 ˙ ˙ A 0 X X − B = −BA = R , (25) ω ω 0 A where A is invertible and A is defined to be a block matrix of dimension (6N + 3) × (4N + 3) with non-zero blocks −1 A and A. 6 D. Parameterisation We may parameterise the tangents d on each linear segment by the Euler angles θ ∈ [0, π], φ ∈ (−π, π], ψ ∈ i i i (−π, π] for i = 1, . . . , N [24]. With this parameterisation we may make a choice of d and d , taking here the three 1 2 orthonormal vectors to be i ⊤ d = [−s c − c c s , +c c − c s s , s s ] , (26) φ ψ θ φ ψ φ ψ θ φ ψ θ ψ i ⊤ d = [+s s − c c c ,−c s − c s c , s c ] , (27) φ ψ θ φ ψ φ ψ θ φ ψ θ ψ i ⊤ d = [s c , s s , c ] , (28) θ φ θ φ θ written with respect to the laboratory frame and where s ≡ sin θ , c ≡ cosθ , and analogously for s , c , s and c . θ i θ i φ φ ψ ψ From the directors we recover ! ! i i d · e d · e y z i 3 1 θ = arccos d · e , φ = arctan , ψ = arctan . (29) i z i i i i d · e d · e x z 3 2 As the discretised filament is piecewise linear, for j = 1, . . ., N + 1 we may write j−1 j−1 X X i i x = x + Δs d , x˙ = x˙ + Δs d . (30) j 1 j 1 3 3 i=1 i=1 With d parameterised as above, we can thus express x˙ as a linear combination of the derivatives of θ and φ for 3 j i i i = 1, . . ., j − 1, in addition to including the time derivative of the base point x . Hence we may write ˙ ˙ QΘ = X , (31) Θ = [x , x , x , θ , . . ., θ , φ , . . ., φ , ψ , . . ., ψ ] , (32) 1,x 1,y 1,z 1 N 1 N 1 N where Q is a 3(N + 1) × 3(N + 1) matrix and x , x x are the components of x in the basis {e ,e ,e }. 1,x 1,y, 1,z j x y z Explicitly, Q may be constructed via   Q Q Q 11 12 13 ˜   ˜ Q Q Q 0 Q = , Q = [Q] , (33) 21 22 23 P Q Q Q 31 32 33 where the matrices Q are of dimension (N +1)×3, with Q and Q being of dimension (N +1)×N, for k = 1, 2, 3. k1 k2 k3 th th In the definition of Q, the subscript P denotes that the i row of Q is permuted to the P (i) row of Q, where  3(i − 1) + 1 , i = 1, . . ., N + 1 , 3(i − N − 2) + 2 , i = N + 2, . . ., 2N + 2 , P (i) = (34) 3(i − 2N − 3) + 3 , i = 2N + 3, . . ., 3N + 3 . This permutation of Q allows us to define the sub-blocks simply, given explicitly as 1 , j = k , i,j Q = k = 1, 2, 3 , k1 0 , otherwise, + cosθ cosφ , j < i , i,j j j Q = Δs 0 , j ≥ i , − sinθ sinφ , j < i , i,j j j Q = Δs 0 , j ≥ i , + cosθ sin φ , j < i , i,j j j Q = Δs 0 , j ≥ i , + sinθ cosφ , j < i , i,j j j Q = Δs 0 , j ≥ i , − sinθ , j < i , i,j j Q = Δs 0 , j ≥ i , i,j Q = 0 . 33 7 Further, in this parameterisation we may readily relate the local rate of rotation about d , denoted ω as in ˙ ˙ Eq. (24), to θ, φ, ψ and their time derivatives. Explicitly, this relationship is ω = cos(θ)φ +ψ, and is notably linear in the derivatives of the Euler angles. Thus, we form the composite matrix Q = , (35) 0 C I where I is the N × N identity matrix and the N × N matrix C has diagonal elements C = cos(θ ) for i = 1, . . ., N, N i i with all other elements zero. The upper block, Q, maps the parameterisation into the laboratory frame, whilst the lower blocks convert between the parameterisation and the local rate of rotation about d as written in director basis. The (4N + 3) × 3(N + 1) matrix Q now encodes the expressions of velocities and rotation rates in terms of the parameterisation, via " # QΘ = , (36) noting that the representation of ω is relative to the director basis, whilst the representation of X is relative to the basis of the laboratory frame. Having constructed Q, we now combine Eqs. (25) and (36) to give − BAQΘ = R , (37) noting in particular that the matrix BAQ is square and of dimension (3N + 3) × (3N + 3). Naively, this system of ordinary differential equations can be readily solved numerically to give the evolution of the filament in the surrounding fluid. However, the use of a single parameterisation to describe the filament will in general lead to degeneracy of the linear system and ill-defined derivatives in both space and time, issues which we explore and resolve numerically in the subsequent sections. E. Coordinate singularities i ⊤ Consider a straight filament aligned with the e axis, with each of the d = [0, 0, 1] written in the laboratory frame. For this filament θ = 0 for all i, whilst the φ are undetermined, arbitrary and notably need not be the same i i on each segment. Were we to attempt to formulate and solve the linear system of Eq. (37), both φ and its derivatives would be ill-defined, and correspondingly we would be unable to solve the system for the filament dynamics, which are physically trivial in this particular setup. In more generality, if a filament were to have any segment pass through one of the poles θ = {0, π} of this coordinate system, φ would be undetermined on the segment and arbitrary, with attempts to solve our parameterised system of ordinary differential equations failing. Further, were a segment to pass close to but not through a pole, time derivatives of φ would necessarily become large, with φ well-defined but varyingly rapidly as the segment moves close to the pole of the coordinate system. These large derivatives would artificially introduce additional stiffness to the elastohydrodynamical problem, inherent only to the parameterisation and not the underlying physics. This problem is well known for Euler angle parameterisations, and is commonly referred to as the ‘gimbal lock’. Analogous issues with arclength derivatives occur when considering neighbouring segments, with the value of φ varying rapidly and artificially between segments that reside near the pole of the coordinate system. In this latter case however, our formulation of the elastohydrodynamical problem circumvents the need for evaluation of φ , instead considering only derivatives of the smooth quantities d , though we are not able to resolve issues with s α temporal derivatives in the same way. In order to avoid the numerical and theoretical problems associated with singular points in the filament parameterisation, we exploit the finiteness of the set of angles θ along with the independence of the underlying elastohydrodynamical problem from the parameterisation. Throughout this work we have assumed a fixed laboratory frame with basis {e ,e ,e }, present only so that vector quantities may be written component-wise for convenience. Our choice x y z of such a basis is arbitrary, with the physical problem of filament motion being independent of our selection of particular basis vectors. It is with respect to this basis that we have defined the Euler angles θ, φ, ψ, from which the aforementioned coordinate singularities appear if any of the θ approach zero or π. Thus, if one makes a choice of ⋆ ⋆ ⋆ ⋆ basis {e ,e ,e } such that the corresponding Euler angles θ are some δ-neighbourhood away from the poles of the x y z i new parameterisation, the system of ordinary differential equations given in Eq. (37) may be readily solved, at least initially. Should the solution in the new coordinate system approach one of the new poles θ = 0, π, a new basis can again be chosen, and this process iterated until the filament motion has been captured over a desired interval. 8 ⋆ ⋆ ⋆ We note that for sufficiently small δ > 0 such a choice of basis {e ,e ,e } necessarily exists due to the finiteness of x y z the set of θ , with δ in practice able to be sufficiently large so as to limit the effects of coordinate singularities. Thus, subject to reasonable assumptions of smoothness of the filament position x, such a process of repeatedly changing basis when necessary will prevent issues associated with the parameterisation described above, and will in practice enable the efficient simulation of filament motion without introducing significant artificial stiffness or singularities. III. IMPLEMENTATION, VERIFICATION AND EXTENSIONS A. Selecting a new basis (a) (b) FIG. 1. An example choice of a new parameterisation in order to avoid coordinate singularities. Shown in blue are the points on the unit sphere corresponding to (θ , φ ), with their antipodes displayed in yellow. (a) Before a change of basis and subsequent i i reparameterisation, we see that these points are located near to the θ = 0 and θ = π axes, which are shown as black vertical lines. A new potential location for the θ = 0 axis is shown in orange, selected so as to maximise the distance from the (θ , φ ) i i and their antipodes. (b) Following reparameterisation, the points and antipodes are located maximally away from the new axis. This example scenario corresponds to a helical filament initially with θ = π/6 for i = 1, . . . , 50. Initially choosing an arbitrary laboratory basis {e ,e ,e }, the above formulation is implemented in MATLAB , x y z with the system of ordinary differential equations (ODEs) of Eq. (37) being solved using the inbuilt stiff ODE solver ode15s, as described in detail by Shampine and Reichelt [27]. This standard variable-step, variable-order solver allows −5 −4 for configurable error tolerances, typically set here at 10 for absolute error and 10 for relative error, in general significantly below the error associated with the piecewise-linear filament discretisation. Derivatives with respect to arclength are approximated with fourth order finite differences, with the resulting dynamics insensitive to this choice of scheme. Initially and at each timestep, the values of θ are checked to determine if they are within δ of a coordinate singularity, typically with δ = π/50. Should the parameterisation be approaching a singularity, a new basis is chosen and the problem recast in this basis. A natural method of selecting a new basis is perhaps to choose one uniformly at random. Indeed, by considering the worst-case scenario of the N tuples (θ , φ ) uniformly and disjointly covering the surface of the unit sphere, which i i together θ and φ parameterise, the probability that any random basis results in a scenario with min {θ , π − θ } < δ i i i is given by 2N sin (δ/2), a consequence of elementary geometry. With this quantity being significantly less than unity for a wide range of N with δ large enough to avoid severe artificial numerical stiffness, as discussed above, a practical implementation for the simulation of filament elastohydrodynamics as formulated above may simply select a new basis randomly, repeating until a suitable basis is found. With δ = π/50 and N = 50, the probability of rejecting a candidate new basis is bounded above by 10%, thus in practice one should expect to find an appropriate basis within few iterations of the proposed procedure. 9 Alternatively, and as we will do throughout this work, one may instead proceed in a deterministic manner, selecting a near-optimal basis from knowledge of the existing parameterisation. Given the set of parameters θ and φ , we i i ˆ ˆ ˆ ˆ may choose a θ ∈ [0, π] and φ ∈ [0, 2π) so as to maximise the distance of (θ, φ) from each of the (θ , φ ) and their i i ˆ ˆ antipodes. In practice, an approximate solution to this problem is attained by selecting (θ, φ) from a selection of preset test points in order to maximise the distance from the (θ , φ ), where distance is measured on the surface of the i i unit sphere that θ and φ naturally parameterise, as shown in Fig. 1. It should be noted that this process of selection ˆ ˆ impacts negligibly on computational efficiency with 10,000 test points. With these choices of θ and φ, we form a new basis by mapping the original basis vector e to the vector e , given explicitly by ⋆ ⊤ ˆ ˆ ˆ ˆ ˆ e = [sin θ cosφ, sinθ sin φ, cosθ] . (38) ⋆ ⋆ Choosing the other members of the orthonormal basis e ,e arbitrarily, expressed in this new basis the accompanying x y filament parameterisation will be removed from any coordinate singularities by construction, as exemplified in Fig. 1(b). B. Validation In what follows we validate the presented methodology against known filament behaviours and a sample three dimensional simulation via an existing methodology. Initial configurations and parameter values for each can be found in the Appendix, with behaviours qualitatively independent of these parameter choices and filament setups. 1. Relaxation of a planar filament Noting there is no analytical test solution for the dynamics of a fully 3D Kirchhoff rod in a viscous fluid, to the best of our knowledge, we consider validations by comparison with numerical studies in the literature, though we additionally utilise invariance of the centre of mass as a gold standard below, where applicable. Firstly, we validate the presented approach by considering the problem of filament relaxation in two dimensions, a natural and well- studied subset of the three dimensional framework. We consider the simple case of a symmetric curved filament in the e e plane, which will provide a test of symmetry preservation, integrated moment balance, and hydrodynamics x y via qualitative comparisons with the earlier works of Moreau et al. [14] and Hall-Mcnair et al. [15]. Simulating the relaxation of such a filament to a straight equilibrium condition with N = 40 segments takes less than 2 s on modest hardware (Intel Core™ i7-6920HQ CPU), from which we immediately see retained the computational efficiency of the framework of Moreau et al. which this work generalises. Present throughout the computed motion is the left-right symmetry of the initial condition, with the filament shape evolving smoothly even with a small number of segments, as shown in Fig. 2. Further, the centre of mass, which in exact calculation would be fixed in space due to the overall −3 force-free condition on the filament, is captured numerically with errors on the order of 10 L, demonstrating very good quantitative satisfaction of this condition. Of note, in Fig. 2b we have verified that this error is of the same order of magnitude as that generated by the two-dimensional methodology of Walker et al. [16]. 2. Planar bending of a filament in shear flow Further, whilst the above is reassuring and serves to validate a subset of the implementation, we note from Eqs. (26) and (27) that motion cast in the e e plane of the laboratory frame may often render the evolution of one of the x y directors d ,d trivial. In order to avoid this we may consider planar problems in slightly more generality, posing a 1 2 problem that is planar though not aligned with the e e plane. As an exemplar such problem we attempt to recreate x y a typical but complex behaviour of a flexible filament in a shear flow, that of the J-shape and U-turn [28], aligning both the filament and the background flow in a plane spanned by e and e + e . In order to ensure the absence y x z of alignment of the parameterisation with the e e plane, we disable the adaptive system of basis selection for the x y purpose of this example, and simulate the motion of a filament in a shear flow. The background flow with velocity u and vorticity Ω is incorporated into the framework via the transformation u 7→ u − u , ω 7→ ω − Ω · d /2, yielding b i i the modified system − BAQΘ = R − BAU (39) for a vector U of background flows and vorticities evaluated at segment endpoints and midpoints, respectively. Details of the flow field and initial setup are given in the Appendix. 10 (a) (b) FIG. 2. The two-dimensional relaxation of a symmetric planar filament, simulated with N = 40 segments. (a) Symmetry is preserved throughout the dynamics, with the relaxation in qualitative agreement with that used for verification in the two-dimensional works of Moreau et al. [14], Hall-Mcnair et al. [15], Walker et al. [16]. (b) Translation of the centre of −3 mass throughout the motion, analytically zero, is captured numerically with errors on the order of 10 L by the proposed methodology, notably the same order of magnitude as that attained with the two-dimensional methodology of Walker et al. [16]. Axes x and x correspond to the unit vectors e and e respectively. x y x y (a) (b) (c) FIG. 3. The planar evolution of a filament in shear, exhibiting a rich and well-documented dynamics. (a) Having aligned both the filament and shear flow in a plane not parallel to the e e plane, with the directors non-trivial in this setup, we simulate x y the motion of the filament through two distinct morphological transitions: (b) the characteristic J-shape and (c) the subsequent U-turn (cf. Liu et al. [28, Fig. 1, Movies S5, S6]). We note that the choosing of an improved basis for computation has been disabled for this example, and yields a twofold increase in computational efficiency if enabled. Arrows indicate the direction of the background shear flow. Axes x , x ,x correspond to the unit vectors e , e ,e , respectively. The plane containing the x y z x y z filament and the shear flow is shown in grey. Adopting the timescale T to be the inverse of the shearing rate of the flow, we consider a parameter regime in which one would expect to see to formation of J-shape and subsequently a U-turn, defined by their characteristic morphologies in Liu et al. [28, Figure 1, Movies S5, S6] and from which an appropriate parameter choice is obtained. Notably, the impact of thermal noise perturbations is not considered here, in contrast to Liu et al. [28], preventing a quantitative comparison. In Fig. 3 we present the initial, J-shape, and U-turn configurations of the filament as simulated via the proposed methodology, with computation requiring approximately 20 s with N = 50 segments. The simulated filament shapes are in qualitative agreement with those shown in Liu et al. [28, Figure 1], and serve as further validation of the coarse-grained methodology. Notably, enabling the described method of basis selection effectively casts this problem in the e e plane, affording a twofold increase in computational efficiency and highlighting the x y benefits of adaptive reparameterisation. 3. Relaxation of a non-planar filament Finally, we consider truly non-planar relaxation of filaments in three dimensions. Typical simulations of such a relaxation with N = 50 segments have a runtime of approximately 10s on the modest hardware described above, often requiring at most one choice of basis though naturally problem dependent, and provide reasonable accuracy. Thus, even 11 when considering inherently three-dimensional problems we see retained in this methodology the low computational cost of the formulation of Moreau et al. [14], representing significant improvements in computational efficiency over recent studies in three dimensions [19–21]. This is particularly evident when directly comparing the presented coarse- grained methodology with the results of Ishimoto and Gaffney [21], considering in this case the relaxation of a helical configuration to a straight equilibrium. A side-by-side comparison of the relaxation dynamics as computed by the proposed methodology and that presented in Ishimoto and Gaffney is shown in Fig. 4, noting that the work of Ishimoto and Gaffney [21] considers an actively driven nearly inextensible filament, of which relaxation dynamics are a natural subset. Figure 4 highlights good agreement between methodologies that is in line with the level of accuracy typically afforded by resistive force theories used here, recalling errors logarithmic in the filament aspect ratio. Figure 4e shows a quantitative evaluation of the computed solutions, with the deviation of the filament centre of mass from the initial condition shown as solid black curves for each methodology. With the force-free condition implying that the filament centre of mass should not move throughout the relaxation dynamics, this measured deviation serves as an assessment −2 of the accuracy of both frameworks, with each exhibiting variation only on the order of 10 L. Also shown in Fig. 4e is a dimensional measure of the difference between the two computed solutions, here denoted E(t) and defined as the non-negative root of E (t) = x (s, t) − x (s, t) ds , (40) P IG where x (s, t) and x (s, t) denote the filament centreline as computed by the proposed methodology and that used P IG by Ishimoto and Gaffney, respectively. Numerically approximating this integral with quadrature and noting that this −2 error is consistently on the order of 10 L throughout the relaxation, we see evidenced good quantitative agreement between the two frameworks, thus validating the proposed methodology. We also remark that the solution of Ishimoto and Gaffney [21] does not perfectly satisfy filament inextensibility, with variation in total length of approximately 1%, which may have some impact on the computed dynamics. Thus, when computing E(t) as defined above, we treat s ∈ [0, L] as a material parameter, with the differences in position x (s, t)−x (s, t) therefore capturing discrepancies P IG between the simulated locations of the material point with undeformed arclength s at time t, with s not necessarily equal to the deformed arclength in the solution of Ishimoto and Gaffney [21]. In contrast to the agreement between solutions, there is a stark difference between the associated time required for computation. Taking N = 100 segments and computing until relaxation, the coarse-grained framework calculated −5 the solution in approximately 30 s on personal computing hardware with ODE error tolerances of 10 , whilst the computations utilising the implementation of Ishimoto and Gaffney required 2.5 h on a high performance computing cluster. A thorough investigation of the time required for computation with the presented methodology for various choices of the parameters ǫ and N is showcased in Fig. 5, from which we note the remarkable performance of this simple implementation across parameter regimes, with the walltime naturally dependent on the discretisation parameter N. C. Model extensions 1. Intrinsic curvature In order to showcase the versatility of the presented framework, we demonstrate its simple extension to filaments with non-zero intrinsic or reference curvature, which can exhibit complex buckling behaviours [29]. Recalling the constitutive relation of Eq. (8), the effect of an intrinsic curvature κ is to alter the bending moments, yielding the modified constitutive relation 0 0 0 m = EI [κ − κ ]d + [κ − κ ]d + [κ − κ ]d , (41) 1 1 2 2 3 3 1 2 3 1 + σ 0 0 where we have written κ = κ d in the local director basis. Notably, the reference curvature can plausibly depend α α on a variety of quantities, including time, arclength, and spatial position, with an example being the modelling of an internally driven filament by a time-dependent intrinsic curvature [18, 19]. Practically, the inclusion of such an intrinsic curvature amounts to a simple subtraction of the reference curvature from the computed components of κ at each instant, with R as given in Eq. (20) being modified accordingly. Doing so, we simulate the relaxation of a straight filament with a non-zero intrinsic curvature, with the reference curvature explicitly given by κ = πd + 2πd corresponding to a helical configuration. As shown in Fig. 6, the filament indeed 2 3 −2 relaxes to a helix, with the walltime of this simulation being 15 s on a laptop computer, having taken ǫ = 10 L and N = 70 segments, noting that the filament shape has been sufficiently resolved with this discretisation. 12 (a) (b) (e) (c) (d) FIG. 4. The relaxation of a filament in three dimensions. Shown are the results of simulating this motion via (a,b) the proposed framework and (c,d) the methodology presented in Ishimoto and Gaffney [21], in turn heavily based on the work of Olson et al. [19] shown from multiple perspectives at multiple timepoints. In both cases we observe relaxation from a non-planar, helical configuration to a straight filament, and good agreement between the two computed solutions, in particular given the logarithmic accuracy of resistive force theories. (e) A quantitative comparison between the two frameworks, with solid lines showing the Euclidean distance of the filament centre of mass from its initial location, analytically zero by the force-free −2 condition though here on the order of 10 L. The dashed curve quantifies the error between the computed solutions, denoted 2 2 E, with the square of this error defined as E = kx − x k ds/L, where x and x are the locations of the filament P IG P IG centreline as computed by the proposed methodology and that used by Ishimoto and Gaffney, respectively. Computation with the presented methodology took approximately 30 s on a modest laptop computer, in comparison to the multiple hours required on sophisticated cluster hardware for the methodology of Ishimoto and Gaffney. Here we have simulated filament motion with N = 100 segments. Axes x ,x ,x correspond to the unit vectors e ,e ,e , respectively. x y z x y z 2. Clamped and internally driven filaments Finally, we consider the simple extensions to both clamped filaments and to those with actively generated internal moments, the latter being akin to the active beating of biological cilia and flagella [30]. For time and arclength- dependent active moment density m , its inclusion into the presented framework acts to modify the moment balance of Eq. (2) to m + x × n − τ + m = 0 . (42) s s Repeating the integration of the pointwise moment balance from s = s to s = L as in Section II leads to a modified form of Eq. (11), explicitly given as EI i τ i a − d · I + I = κ (s ) − d · I , (43) α i α i i α i 1 + δ σ α,3 where the integrated active moment density is written as a a I = m ds˜. (44) For a given active moment density, assumed to be integrable, I may be readily computed either analytically or numerically, with its components in the local d direction then modifying R from Eq. (20) accordingly. Clamping the filament at the base is somewhat simpler, in that the overall force and moment balance conditions on the filament are merely replaced by enforcing no motion or rotation at the base. These conditions may be stated concisely as ˙ ˙ ˙ x˙ (0) = 0 , θ = φ = ψ = 0 , (45) 1 1 1 13 FIG. 5. Walltimes associated with the 3D filament relaxation of Fig. 4 for various choices of the parameters ǫ and N. With N = 200 corresponding to a very fine discretisation of the filament, we observe a maximum walltime of under 6 minutes on a modest laptop computer, approximately 25x faster than the similar computations of Ishimoto and Gaffney [21] on sophisticated cluster hardware, albeit for different parameter values. There is a strong dependence of the walltime on the level of discretisation, −5 −4 N, as expected. Here, the absolute and relative error tolerances of the ODE solver are set to 10 and 10 , respectively. All axes, including the colour axis, are logarithmically scaled for visual clarity. For reference, the parameter combination signified −3 by a cross corresponds to a walltime of 2.5 s, with N = 63 and ǫ/L ≈ 3.2 × 10 . FIG. 6. The relaxation of a straight filament with non-zero intrinsic curvature to a helical configuration, with reference curvature 0 −2 specified as κ = πd2 + 2πd3. Having taken N = 70 segments and ǫ = 10 L, we observe the smooth relaxation of the filament away from its initial straight configuration, computed in 15 s on a modest laptop computer. Axes x , x ,x correspond to the x y z unit vectors e , e ,e , respectively. x y z supplanting the force and moment-free conditions of Eqs. (5) and (6), having taken s = 0 in the latter. Implementing these minor modifications, as an example we specify a travelling wave of internal moment given by m = 5 sin(s − −2 t)d + 5 cos(s − t)d and simulate the active motion of a clamped filament, taking N = 50 and ǫ = 10 L. Snapshots 1 2 of this eventually periodic motion are shown in Fig. 7, with the motion simulated up until t = 8π from a straight initial configuration and with a walltime of around 8 s. IV. DISCUSSION In this work we have seen that the motion of inextensible unshearable filaments in three dimensions can be concisely described by a coarse-grained framework, building upon the principles of Moreau et al. [14] in order to minimise numerical stiffness associated with the governing equations of elastohydrodynamics. This representation was readily implemented via an Euler angle parameterisation, with adaptive basis selection and reparameterisation overcoming coordinate singularities associated with a fixed representation of the dynamics. We have further demonstrated the efficacy of the proposed deterministic method for basis selection by explicit simulation of non-planar filament dynamics, which is able to afford reductions in numerical stiffness even when separated from singularities of the parameterisation. The presented framework retains the flexibility and extensibility of the formulations of Moreau et al. [14], Hall-Mcnair 14 FIG. 7. The 3D beating of a clamped filament driven by prescribed active internal moments. Having specified a travelling wave of out-of-phase sinusoidal active moments m = 5 sin(s − t)d + 5 cos(s − t)d , an initially straight filament deforms to a 1 2 −2 periodic driven motion, with the tip of the filament following a circular path. Here we have taken ǫ = 10 L and N = 50, noting that the filament shape has been resolved smoothly with this level of discretisation. Computation required approximately 8 s on modest hardware, simulating up until t = 8π. Axes x ,x ,x correspond to the unit vectors e ,e ,e , respectively. x y z x y z et al. [15], Walker et al. [16], with background flows, active moment generation, body forces and other effects or constraints being simple to include in this representation. The simplicity of these possible extensions speaks to the broad utility of the proposed approach, with potential for use in the simulation of both single and multiple filamentous bodies in fluid under a wide variety of circumstances and conditions. In formulating our methodology we have made the simplifying assumption of coupling fluid dynamics to forces via resistive force theory, which is well-known to incur errors logarithmic in the filament aspect ratio, though variations remain in widespread use [14, 30–35]. Resistive force theories additionally suffer from locality, in that portions of the filament do not directly interact with one another through the fluid. A natural development of the presented approach would therefore be the inclusion of non-local hydrodynamics, perhaps via the regularised Stokeslet segment methodology of Cortez [36] as included in the work of Walker et al. [16], or lightweight singular slender body theories such as those of Tornberg and Shelley [4], Johnson [37], Walker et al. [38]. Such improvements may also include the consideration of confined geometries, with motion in a half space of particular pertinence to typical microscopy of flagellated organisms. Despite the many possible directions for hydrodynamic refinement, we note that the linearity of Stokes flows necessitates that any relations between forces and velocities be linear, with explicit formulations simply giving rise to modified linear operators A that may be readily inserted into the described framework. In the wider context of methods for soft filament simulation, the scope of which is illustrated by the generality of the approach of Gazzola et al. [39], the proposed framework enables rapid simulation of the subclass of purely inextensible filaments. This modeling assumption has been demonstrated to be a valid approximation of nearly inextensible filaments in a variety of contexts [23], affording greatly improved computational efficiency over previous approaches that we have compounded here, albeit with reduced hydrodynamic fidelity. However, we expect that the addition of improved hydrodynamics will have minimal impact on the computational efficiency of the presented methodology, with this efficiency not being derived from our use of simple resistive force theory, as noted by Hall- Mcnair et al. [15], Walker et al. [16] for their non-local refinements of the 2D theory of Moreau et al. [14]. In summary, we have presented, verified and exemplified a novel framework for the rapid simulation of inextensible, unshearable filaments in a viscous fluid at zero Reynolds number. Despite the improved generality of this methodology over existing two-dimensional approaches, we have retained the computational efficiency and simplicity of the work of Moreau et al. [14], affording significant extensibility and thus facilitating a vast range of previously unrealisable biological and biophysical studies into filament dynamics on the microscale. ACKNOWLEDGEMENTS We are grateful to Prof. Derek Moulton for discussions on elastic filaments, and to Prof. David Smith for discussions on basis rotation. B.J.W. is supported by the UK Engineering and Physical Sciences Research Council (EPSRC), grant EP/N509711/1. K.I. acknowledges MEXT Leading Initiative for Excellent Young Researchers (LEADER), JSPS KAKENHI for Young Researcher (JP18K13456), and JST, PRESTO Grant Number JPMJPR1921, Japan. Elements of the simulations were performed using the cluster computing system within the Research Institute for Mathematical Sciences (RIMS), Kyoto University. 15 The computer code used and generated in this work is freely available from https://gitlab.com/bjwalker/3d-filaments.git. Appendix: Parameters and initial conditions We nondimensionalise the system Eq. (37) as in Walker et al. [16], resulting in a dimensionless system of the form 8πµL ˆ ˆ ˆ ˆ ˆ − E BAQΘ = R , E = (A.1) h h EI T for timescale T and elastohydrodynamic number E , where dimensionless counterparts are given by 1 L EI ˆ ˆ ˙ ˆˆ ˆ B = L B , A = A , Qθ = Qθ , R = R , (A.2) 8πµ T L having multiplied the force balance equations by Δs to unify dimensions. All examples begin with the filament base, x , coincident with the origin of the laboratory frame, and we set Poisson’s ratio to zero, i.e. σ = 0 throughout though note a lack of sensitivity of results to this choice. 1. Relaxation of a planar filament In simulating the relaxation of a filament in the e e plane, we impose the initial filament shape as x y π i − 1 1 θ = π/2 , φ = − , ψ = 0 , for i = 1, . . ., N (A.3) i i i 2 N − 1 2 with respect to standard laboratory Euler angles. Filament motion is simulated with E ≈ 1.6 × 10 , though this choice is arbitrary given the invariance of the dynamics to rescalings in time (assuming that the rescaling is not so extreme as to break the inertialess assumption). 2. Planar bending of a filament in shear flow In order to generate the characteristic behaviours of the J-shape and U-turn we initialise the filament via π i − 1 θ = π/4 , φ = − , ψ = 0 , for i = 1, . . ., N . (A.4) i i i 12 N − 1 We align a background shear flow in the same plane as the filament, proportional in strength to the coordinate in the e direction, denoted y. Explicitly, this flow u is given in the laboratory frame in dimensionless form by y b u = √ y(e + e ) , (A.5) b x z having taken the timescale T to be the inverse of the dimensional shear rate. Simulation proceeds with E ≈ 4.7 × 10 , consistent with the regime found in Liu et al. [28], and we note that the tip of the filament initially curves into the oncoming background flow in y < 0. 3. Relaxation of a non-planar filament Taking N = 100 segments, we impose the helical initial condition i − 1 θ = π/3 , φ = 2π , ψ = 0 , for i = 1, . . ., N . (A.6) i i i N − 1 We simulate filament motion with E ≈ 3.1 × 10 , with results insensitive to this choice. The parameters used in the implementation of Ishimoto and Gaffney [21] are as in their publication, with the image system for a plane wall accordingly removed and the actively generated torques set to zero to allow for filament relaxation in free space. In particular, whilst the filaments of Ishimoto and Gaffney [21] are extensible, the extensional modulus of these filaments is sufficiently high so as to provide near inextensibility in their results, enabling meaningful comparison. 16 4. Relaxation of a non-straight filament Taking N = 70 segments, we impose the straight initial condition θ = π/2 , φ = 0 , ψ = 0 , for i = 1, . . . , N . (A.7) i i i 0 5 The intrinsic curvature is specified as κ = πd + 2πd . We simulate filament motion with E ≈ 1.5 × 10 , with 2 3 h results insensitive to this choice. 5. Active beating of a clamped filament Taking N = 50 segments, we impose the straight initial condition θ = π/2 , φ = 0 , ψ = 0 , for i = 1, . . . , N . (A.8) i i i The active moment density is specified as m = 5 sin(s − t)d + 5 cos(s − t)d . We simulate filament motion with 1 2 E = 10 up until t = 8π. [1] J. Gray, Ciliary movement (Cambridge University Press, Cambridge [England], 1928). [2] G. J. Hancock, The self-propulsion of microscopic organisms through liquids, Proceedings of the Royal Society of London. Series A. Mathematical and Physical Sciences 217, 96 (1953). [3] H. C. Berg and R. A. Anderson, Bacteria swim by rotating their flagellar filaments, Nature 245, 380 (1973). [4] A. K. Tornberg and M. J. Shelley, Simulating the dynamics and interactions of flexible fibers in Stokes flows, Journal of Computational Physics 196, 8 (2004). [5] M. Roper, R. Dreyfus, J. Baudry, M. Fermigier, J. Bibette, and H. A. Stone, On the dynamics of magnetically driven elastic filaments, Journal of Fluid Mechanics 554, 167 (2006). [6] C. Pozrikidis, Shear flow over cylindrical rods attached to a substrate, Journal of Fluids and Structures 26, 393 (2010). [7] C. Pozrikidis, Shear flow past slender elastic rods attached to a plane, International Journal of Solids and Structures 48, 137 (2011). [8] S. Tottori, L. Zhang, F. Qiu, K. K. Krawczyk, A. Franco-Obreg´on, and B. J. Nelson, Magnetic helical micromachines: fabrication, controlled swimming, and cargo transport, Advanced Materials 24, 811 (2012). [9] F. Meng, D. Matsunaga, and R. Golestanian, Clustering of Magnetic Swimmers in a Poiseuille Flow, Physical Review Letters 120, 188101 (2018), arXiv:1710.08339. [10] J. Gray and G. J. Hancock, The Propulsion of Sea-Urchin Spermatozoa, Journal of Experimental Biology 32, 802 (1955). [11] R. E. Johnson, Slender-body theory for Stokes flow and flagellar hydrodynamics, Ph.D. thesis, California Institute of Technology (1977). [12] C. Pozrikidis, Boundary integral and singularity methods for linearized viscous flow (Cambridge University Press, 1992). [13] O. du Roure, A. Lindner, E. N. Nazockdast, and M. J. Shelley, Dynamics of Flexible Fibers in Viscous Flows and Fluids, Annual Review of Fluid Mechanics 51, 539 (2019). [14] C. Moreau, L. Giraldi, and H. Gadˆelha, The asymptotic coarse-graining formulation of slender-rods, bio-filaments and flagella, Journal of The Royal Society Interface 15, 20180235 (2018). [15] A. L. Hall-Mcnair, T. D. Montenegro-Johnson, H. Gadˆelha, D. J. Smith, and M. T. Gallagher, Efficient implementation of elastohydrodynamics via integral operators, Physical Review Fluids 4, 1 (2019). [16] B. J. Walker, K. Ishimoto, H. Gadˆelha, and E. A. Gaffney, Filament mechanics in a half-space via regularised Stokeslet segments, Journal of Fluid Mechanics 879, 808 (2019). [17] R. Yanagimachi, The movement of golden hamster spermatozoa before and after capacitation, Reproduction 23, 193 (1970). [18] S. F. Schoeller, A. K. Townsend, T. A. Westwood, and E. E. Keaveny, Methods for suspensions of passive and active filaments, Journal of Computational Physics , 109846 (2020). [19] S. D. Olson, S. Lim, and R. Cortez, Modeling the dynamics of an elastic rod with intrinsic curvature and twist using a regularized Stokes formulation, Journal of Computational Physics 238, 169 (2013). [20] J. Simons, L. Fauci, and R. Cortez, A fully three-dimensional model of the interaction of driven elastic filaments in a Stokes flow with applications to sperm motility, Journal of Biomechanics 48, 1639 (2015). [21] K. Ishimoto and E. A. Gaffney, An elastohydrodynamical simulation study of filament and spermatozoan swimming driven by internal couples, IMA Journal of Applied Mathematics 83, 655 (2018). [22] E. L. Bouzarth, A. T. Layton, and Y.-N. Young, Modeling a semi-flexible filament in cellular Stokes flow using regularized Stokeslets, International Journal for Numerical Methods in Biomedical Engineering 27, 2021 (2011). [23] M. Jabbarzadeh and H. C. Fu, A numerical method for inextensible elastic filaments in viscous fluids, Journal of Computational Physics 418, 109643 (2020), arXiv:2003.05608. [24] S. S. Antman, Nonlinear Problems of Elasticity, Applied Mathematical Sciences, Vol. 107 (Springer-Verlag, New York, 2005). 17 [25] M. Nizette and A. Goriely, Towards a classification of Euler-Kirchhoff filaments, Journal of Mathematical Physics 40, 2830 (1999). [26] A. Chwang and T. Y.-T. Wu, Hydromechanics of low-Reynolds-number flow. Part 1. Rotation of axisymmetric prolate bodies, Journal of Fluid Mechanics 63, 607 (1974). [27] L. F. Shampine and M. W. Reichelt, The MATLAB ODE Suite, SIAM Journal on Scientific Computing 18, 1 (1997). [28] Y. Liu, B. Chakrabarti, D. Saintillan, A. Lindner, and O. du Roure, Morphological transitions of elastic filaments in shear flow, Proceedings of the National Academy of Sciences 115, 9438 (2018). [29] S. Lim, Dynamics of an open elastic rod with intrinsic curvature and twist in a viscous fluid, Physics of Fluids 22, 024104 (2010). [30] H. Gadˆelha, E. A. Gaffney, D. J. Smith, and J. C. Kirkman-Brown, Nonlinear instability in flagellar dynamics: a novel modulation mechanism in sperm migration?, Journal of The Royal Society Interface 7, 1689 (2010). [31] E. Lauga, W. R. DiLuzio, G. M. Whitesides, and H. A. Stone, Swimming in circles: Motion of bacteria near solid boundaries, Biophysical Journal 90, 400 (2006). [32] J. Sznitman, X. Shen, R. Sznitman, and P. E. Arratia, Propulsive force measurements and flow behavior of undulatory swimmers at low Reynolds number, Physics of Fluids 22, 121901 (2010). [33] M. P. Curtis, J. C. Kirkman-Brown, T. J. Connolly, and E. A. Gaffney, Modelling a tethered mammalian sperm cell undergoing hyperactivation, Journal of Theoretical Biology 309, 1 (2012). [34] R. D. Schulman, M. Backholm, W. S. Ryu, and K. Dalnoki-Veress, Undulatory microswimming near solid boundaries, Physics of Fluids 26, 10.1063/1.4897651 (2014). [35] A. S. Utada, R. R. Bennett, J. C. N. Fong, M. L. Gibiansky, F. H. Yildiz, R. Golestanian, and G. C. L. Wong, Vibrio cholerae use pili and flagella synergistically to effect motility switching and conditional surface attachment, Nature Communications 5, 4913 (2014). [36] R. Cortez, The method of regularized Stokeslets, SIAM Journal on Scientific Computing 23, 1204 (2001). [37] R. E. Johnson, An improved slender-body theory for Stokes flow, Journal of Fluid Mechanics 99, 411 (1980). [38] B. J. Walker, M. P. Curtis, K. Ishimoto, and E. A. Gaffney, A regularised slender-body theory of non-uniform filaments, Journal of Fluid Mechanics 899, A3 (2020). [39] M. Gazzola, L. H. Dudte, A. G. McCormick, and L. Mahadevan, Forward and inverse problems in the mechanics of soft filaments, Royal Society Open Science 5, 171628 (2018). http://www.deepdyve.com/assets/images/DeepDyve-Logo-lg.png Physics arXiv (Cornell University)

Efficient simulation of filament elastohydrodynamics in three dimensions

Physics , Volume 2020 (1907) – Jul 10, 2019

Loading next page...
 
/lp/arxiv-cornell-university/efficient-simulation-of-filament-elastohydrodynamics-in-three-8Zl2nHCVDC
ISSN
2469-990X
eISSN
ARCH-3341
DOI
10.1103/PhysRevFluids.5.123103
Publisher site
See Article on Publisher Site

Abstract

Efficient simulation of filament elastohydrodynamics in three dimensions 1, ∗ 2, † 1, ‡ Benjamin J. Walker, Kenta Ishimoto, and Eamonn A. Gaffney Wolfson Centre for Mathematical Biology, Mathematical Institute, University of Oxford, Oxford, OX2 6GG, UK Research Institute for Mathematical Sciences, Kyoto University, Kyoto, 606-8502, Japan (Dated: October 23, 2020) Fluid-structure simulations of slender inextensible filaments in a viscous fluid are often plagued by numerical stiffness. Recent coarse-graining studies have reduced the computational requirements of simulating such systems, though have thus far been limited to the motion of planar filaments. In this work we extend such frameworks to filament motion in three dimensions, identifying and circumventing coordinate-system singularities introduced by filament parameterisation via repeated changes of basis. The resulting methodology enables efficient and rapid study of the motion of flexible filaments in three dimensions, and is readily extensible to a wide range of problems, including filament motion in confined geometries, large-scale active matter simulations, and the motility of mammalian spermatozoa. PACS numbers: 47.15.G-, 47.63.Gd, 87.15.La I. INTRODUCTION The coupled elasticity and hydrodynamics of flexible inextensible filaments on the microscale are of significance to much of biology, biophysics and soft matter physics. For example, many organisms possess slender flagella or cilia, utilised for driving flows and even locomotion, whilst investigation into the role of synthetic filaments as both soft deformable sensors and methods of propulsion has been the subject of recent enquiry [1–9]. As a result, the complex mechanics of fluid-structure interaction has been well-studied, utilising methods such as the slender body and resistive force theories of Hancock [2], Gray and Hancock [10], Johnson [11], through to the exact representations of boundary integral methods as used by Pozrikidis [6, 7, 12]. A fundamental barrier to much numerical investigation has been the severe stiffness associated with the equations of filament elasticity when coupled to viscous fluid dynamics. Hence, as remarked in the recent and extensive review of du Roure et al. [13], an appropriate framework, capable of realising efficient simulation of filament elastohydrodynamics, is crucial for the numerical study of filament mechanics. Recently, significant progress has been made in resolving the dynamics of planar filaments, with the work of Moreau et al. [14] presenting a coarse-grained model of filament elasticity that overcame much of the stiffness previously associated with slender elastohydrodynamics. Key to this approach was the integration of the pointwise force and moment balance equations, the spatial discretisation of which yielded a relatively simple system of ordinary differential equations to solve in order to describe filament motion. Additionally demonstrated to be flexible in the original publication of Moreau et al., this framework has been extended to include non-local hydrodynamics in both infinite and semi-infinite domains, and applied to a variety of single and multi-filament problems [15, 16]. However, being confined to two dimensions limits the potential scope and applicability of these approaches, with three dimensional filament motion being readily and frequently observed in a plethora of biophysical systems, such as the complex flagellar beating found in spermatozoa or the helically-driven monotrichous bacterium Escherichia coli [3, 17]. However, for non-planar filaments in three dimensions there is currently no methodology analogous to that of Moreau et al., with state-of-the-art frameworks still plagued by extensive numerical stiffness, necessitating costly computation to the extent that practical simulation studies have been limited and parameter space studies are largely prohibited. With three dimensions inherently more challenging than lower dimensional settings, this field has seen developments such as the recent work of Schoeller et al. [18], which utilises a quarternion representation of filament orientation to parameterise the three dimensional shape of the slender body. However, in this framework, numerical care is required to satisfy the inextensibility condition, with similar such consideration necessary in the earlier methodologies of Olson et al. [19], Simons et al. [20], Ishimoto and Gaffney [21], Bouzarth et al. [22], each of which are equipped with non-local slender-body hydrodynamics and consider nearly inextensible filaments. Consequently, these existing approaches often require the use of sophisticated computing hardware in order to simulate filament motion, with typical simulations of Ishimoto and Gaffney having a runtime of multiple hours on high performance computing clusters. The recent work of Jabbarzadeh and Fu [23] compared and contrasted these nearly inextensible approaches Corresponding author: benjamin.walker@maths.ox.ac.uk ishimoto@kurims.kyoto-u.ac.jp gaffney@maths.ox.ac.uk arXiv:1907.04823v5 [physics.flu-dyn] 22 Oct 2020 2 with a truly inextensible scheme, concluding that both accuracy and efficiency was afforded by the latter in a range of biological and biophysical modelling scenarios. Despite their improved efficiency, typical walltimes for these filament simulations are measured on a timescale of hours on typical hardware. Thus, there remains significant scope for the development of an efficient framework for the simulation of inextensible elastic filaments in three dimensions, one in which filament dynamics can be rapidly computed on non-specialised hardware on timescales of seconds or minutes, thus facilitating a wealth of future studies and explorations into complex and previously intractable biological and physical systems. Hence, the fundamental objective of this study is to develop and describe an efficient framework for the numerical simulation of filament mechanics in three dimensions. We will build upon the recent and significant work of Moreau et al. [14], extending their approach to include an additional spatial dimension via a generalisation of the Frenet triad and integration of the governing equations of elasticity. We will overcome fundamental issues with simple single parameterisations of a filament in three dimensions, presenting an effective computational approach utilising adaptive reparameterisation and basis selection. We will then validate the presented framework by consideration of three candidate test problems, simulating well-documented behaviours of filaments in a viscous fluid and including a side-by-side comparison against the existing and recent methodology of Ishimoto and Gaffney [21]. Finally, we will showcase the flexibility and general applicability of the presented approach by describing and exemplifying a number of methodological extensions. II. METHODS A. Equations of elasticity We consider a slender, inextensible, unshearable filament in a viscous Newtonian fluid, with its centreline described by x(s), parameterised by arclength s ∈ [0, L] for dimensional filament length L. We model the filament as a Kirchhoff rod with arclength-independent material parameters, circular cross-sections, and, in the first instance, no intrinsic curvature or intrinsic torsion. Both the filament and fluid inertia are negligible for the physical scales associated with many applications, especially those associated with cellular flagella and cilia; hence there is no inertia here and throughout. Along the filament we have the pointwise conditions of force and moment balance, given explicitly by n − f = 0 , (1) m + x × n − τ = 0 , (2) s s for contact force and torque denoted n,m respectively and where a subscript of s denotes differentiation with respect to arclength. The quantity f is the force per unit length applied on the fluid medium by the filament, which we will later express in terms of the filament velocity x˙ , where here a dot denotes a time derivative. Similarly, τ is the torque per unit length applied on the fluid medium by the filament. Whilst any standard boundary condition may be considered in the formalism below, throughout we impose zero force and torque at the filament ends so that n(0) = n(L) = m(0) = m(L) = 0 . (3) In the Kirchhoff framework note that the contact force is not constitutive, but simply an undetermined Lagrange multiplier for the intrinsic constraints of inextensibility and no shearing of the filament cross section in any direction [24]. Thus we may eliminate n(s) at the earliest opportunity; using the boundary condition n(L) = 0 and Eq. (1) we have n(s) = − f(s˜) ds˜. (4) This relation is also subject to the constraint that the boundary condition n(0) = 0 is satisfied, generating a global force balance constraint for the applied force per unit length, 0 = f(s˜) ds˜, (5) which we carry forward into the formalism below together with the elimination of n(s) via Eq. (4). Thus, and as originally considered in Moreau et al. [14], integration of Eq. (2) and use of the boundary condition m(L) = 0, reveals 3 the integrated moment balance − (x(s˜) − x(s)) × f(s˜) + τ(s˜) ds˜ = m(s) . (6) Given a right-handed orthonormal director basis {d (s),d (s),d (s)}, generalising the Frenet triad such that d 1 2 3 3 corresponds to the local filament tangent, following Nizette and Goriely [25] we define the twist vector κ by ∂d = κ × d (7) ∂s for α = 1, 2, 3. Writing κ = κ d , for bending stiffness EI we use the Euler-Bernouilli constitutive relation of α α the Kirchhoff formalism to relate the contact torque m and the twist vector κ [24], via m = EI κ d + κ d + κ d , (8) 1 1 2 2 3 3 1 + σ where σ is the Poisson ratio [25], assumed to be constant. With this constitutive relation the integrated moment balance equations in the d directions are simply EI − d (s) · (x(s˜) − x(s)) × f(s˜) + τ(s˜) ds˜ = κ (s) , (9) α α 1 + δ σ α,3 for α = 1, 2, 3 and where δ denotes the Kronecker delta. a,b B. Filament discretisation In discretising the filament we follow the approach of Walker et al. [16], as previously applied to planar filaments and itself building upon the earlier work of Moreau et al. [14]. We approximate the filament shape with N piecewise- linear segments, each of constant length Δs, with segment endpoints having positions denoted by x , . . . ,x and 1 N+1 the constraints of inextensibility and the absence of cross section shear are satisfied inherently. The endpoints of the th i segment correspond to x and x for i = 1, . . ., N, with the local tangent d being constant on each segment i i+1 3 and denoted d . In what follows we will consider a discretisation of d ,d such that they are also constant on each 1 2 i i segment, and we denote these constants similarly as d ,d . Writing s for the constant arclength associated with each 1 2 material point x , we apply Eq. (9) at each of the s for i = 1, . . ., N, splitting the integral at the segment endpoints i i to give sj+1 EI − d · (x(s˜) − x ) × f(s˜) + τ(s˜) ds˜ = κ (s ) , (10) i α i 1 + δ σ α,3 j=i th for α = 1, 2, 3. On the j segment, x may be written as x(s) = x + η(x − x ), where η ∈ [0, 1] is given by j j+1 j η = (s − s )/Δs. Additionally discretising the force per unit length as a continuous piecewise-linear function, with η as above we have f(s) = f + η(f − f ) on the segment, where we write f = f(s ). Substitution of these j j+1 j j j parameterisations into Eq. (10) and subsequent integration yields, after simplification, EI i τ − d · I + I = κ (s ) , (11) α i α i i 1 + δ σ α,3 where the integral contribution of the force and torque densities are denoted I and I respectively. With this i i discretisation I has reduced to   " # " #   2 2 Δs Δs Δs Δs f j j I = x − x + d × f + x − x + d × f , (12) j i j j i j+1 3 3   2 6 2 3 j=i 4 in agreement with expressions for planar filaments found in Moreau et al. [14], Walker et al. [16]. As we will highlight below, the contributions of the applied torque per unit length are relatively small given the slenderness of the filament, τ th motivating a less refined discretisation for I . Hence, taking the piecewise constant discretisation τ = τ on the j segment, we have the simple expression I = Δsτ . (13) j=i From the above we see explicitly that the integral component of each moment balance equation may be written as a linear operator acting on the f and the τ . Similarly, with this piecewise-linear force discretisation the integrated j j force balance of Eq. (1) simply reads Δs − (f + f ) = n(0) . (14) j j+1 j=1 We write F = [f , f , f , . . . , f , f , f ] for components f , f f of f with respect to some 1,x 1,y 1,z N+1,x N+1,y N+1,z j,x j,y, j,z j fixed laboratory frame with basis {e ,e ,e }, and similarly T for the vector of components of applied torque per unit x y z length. Here and throughout, forces and torques are written with respect to the laboratory reference frame. With this notation, we may write the equations of force and moment balance as − B = R , (15) where B is a matrix of dimension (3N + 3)× (6N + 3) with rows B . For k = 1, 2, 3 the first 3N + 3 columns are given by Δs B = [1, 0, 0, 2, 0, 0, 2 . . ., 2, 0, 0, 1, 0, 0] , Δs B = [0, 1, 0, 0, 2, 0, 0, 2 . . ., 2, 0, 0, 1, 0] , (16) Δs B = [0, 0, 1, 0, 0, 2, 0, 0, 2 . . ., 2, 0, 0, 1] , and correspond to the force balance of Eq. (14), with the remaining 3N columns zero. The remaining rows of B encode the moment balance of Eq. (11) as expanded in Eq. (12), organised in triples such that B projects 3(i−1)+3+α th i th i τ the i moment balance equation onto d , in that this (3i + α) row of B captures the d component of −(I + I ). α α i The cross products inherited from Eq. (12) may now be notationally simplified by use of the cyclic property of the scalar triple product, explicitly giving   " # " #   2 2 Δs Δs Δs Δs f j j i i i d · I = d · x − x + d × f + d · x − x + d × f (17) α α j i j α j i j+1 i 3 3  2 6 2 3  j=i   " # " #   2 2 Δs Δs Δs Δs j j i i = d × x − x + d · f + d × x − x + d · f , (18) j i j j i j+1 α α 3 3   2 6 2 3 j=i with the latter expression readily transcribed as a linear operator acting on the f for j = i, . . ., N. Analogously, we have i τ i d · I = Δsd · τ , (19) α i α j=i from which a linear operator acting on the τ for j = i, . . . , N can be constructed. Accordingly, the (3N + 3)-vector R is given by EI R = [0, 0, 0, κ (s ), κ (s ), κ (s ), κ (s ), . . . , κ (s )] , (20) 1 1 2 1 3 1 1 2 3 N 1 + δ σ α,3 5 so that the local moment balance is expressed relative to the local director basis. We remark that each of the quantities involved in the construction of B and R are well-defined for a general filament in three dimensions, given the local directors d and d and computing the components of the twist vector as κ = d ·∂ d , κ = d ·∂ d , and 1 2 1 3 s 2 2 1 s 3 κ = d · ∂ d . In terms of the discretised filament, these arclength derivatives are approximated via finite differences 3 2 s 1 in practice. Additionally, we will proceed assuming that the filament is moment-free at the base, which additionally enforces κ (0) = κ (0) = κ (0) = 0. 1 2 3 C. Coupling hydrodynamics We now relate the force density f acting on the fluid to the velocity of each segment endpoint, utilising the commonly-applied method of resistive force theory as introduced by Hancock [2], Gray and Hancock [10] and adopted by Moreau et al. [14] for planar filaments, incurring typical errors logarithmic in the aspect ratio of the filament. Here −2 taking the radius of the filament to be ǫ = 10 L, which more generally is assumed to be small in comparison to the filament length, simple resistive force theory gives the leading order relation between filament velocity and force density as f = −C u , f = −C u . (21) t t t n n n Here f and f denote the components of the force density tangential and normal to the filament, with analogous t n definitions of u and u . We will utilise the expression of Gray and Hancock [10], with t n 2πµ 4πµ C = , C = , (22) t n log 2L/ǫ − 0.5 log 2L/ǫ − 0.5 where µ is the medium viscosity, noting the relation C = 2C . We approximate the local filament tangent at the n t i−1 segment endpoint x as the average of d and d for i = 2, . . ., N, with the tangent for i = 1 and i = N + 1 3 3 1 N simply being taken as d and d respectively. By linearity, and again assuming a piecewise-linear force density along 3 3 segments, we may write the coupling of translational kinematics to hydrodynamics as X = AF , (23) where A is a square matrix of dimension 3(N + 1) × 3(N + 1) and is a function only of the segment endpoints x . Of dimension 3(N + 1), the vector X corresponds to the linear velocities of the segment endpoints, and is constructed analogously to F with respect to the laboratory frame. This relation results from the application of the no-slip condition at the segment endpoints, coupling the filament to the surrounding fluid. In order to relate the rate of rotation of each segment to the viscous torque τ acting on it, we here consider an th approximation of the finite segment as an infinite rotating cylinder, associating the torque per unit length on the i segment with the rotation ω about its local tangent d via the relation of Chwang and Wu [26]: 2 i τ = 4πµǫ ω d (24) i i and in particular the ǫ scaling entails the torque per unit length contributions are relatively small. Here we recall that µ is the viscosity of the fluid medium, and ǫ is the radius of the filament. We may write this relation as a linear operator on ω = [ω , . . . , ω ] , written simply as T = Aω. This crude approximation may readily be substituted 1 N for non-local hydrodynamics via the method of regularised Stokeslet segments, which will likely be a topic of future work. Similarly, non-local hydrodynamics may be utilised in place of Eq. (23), as used for two-dimensional filament studies by Hall-Mcnair et al. [15] and Walker et al. [16], the latter incorporating a planar no-slip boundary and still yielding an explicit linear relation analogous to Eq. (23). Combining Eqs. (15), (23) and (24) yields the linear system " #" # " # −1 ˙ ˙ A 0 X X − B = −BA = R , (25) ω ω 0 A where A is invertible and A is defined to be a block matrix of dimension (6N + 3) × (4N + 3) with non-zero blocks −1 A and A. 6 D. Parameterisation We may parameterise the tangents d on each linear segment by the Euler angles θ ∈ [0, π], φ ∈ (−π, π], ψ ∈ i i i (−π, π] for i = 1, . . . , N [24]. With this parameterisation we may make a choice of d and d , taking here the three 1 2 orthonormal vectors to be i ⊤ d = [−s c − c c s , +c c − c s s , s s ] , (26) φ ψ θ φ ψ φ ψ θ φ ψ θ ψ i ⊤ d = [+s s − c c c ,−c s − c s c , s c ] , (27) φ ψ θ φ ψ φ ψ θ φ ψ θ ψ i ⊤ d = [s c , s s , c ] , (28) θ φ θ φ θ written with respect to the laboratory frame and where s ≡ sin θ , c ≡ cosθ , and analogously for s , c , s and c . θ i θ i φ φ ψ ψ From the directors we recover ! ! i i d · e d · e y z i 3 1 θ = arccos d · e , φ = arctan , ψ = arctan . (29) i z i i i i d · e d · e x z 3 2 As the discretised filament is piecewise linear, for j = 1, . . ., N + 1 we may write j−1 j−1 X X i i x = x + Δs d , x˙ = x˙ + Δs d . (30) j 1 j 1 3 3 i=1 i=1 With d parameterised as above, we can thus express x˙ as a linear combination of the derivatives of θ and φ for 3 j i i i = 1, . . ., j − 1, in addition to including the time derivative of the base point x . Hence we may write ˙ ˙ QΘ = X , (31) Θ = [x , x , x , θ , . . ., θ , φ , . . ., φ , ψ , . . ., ψ ] , (32) 1,x 1,y 1,z 1 N 1 N 1 N where Q is a 3(N + 1) × 3(N + 1) matrix and x , x x are the components of x in the basis {e ,e ,e }. 1,x 1,y, 1,z j x y z Explicitly, Q may be constructed via   Q Q Q 11 12 13 ˜   ˜ Q Q Q 0 Q = , Q = [Q] , (33) 21 22 23 P Q Q Q 31 32 33 where the matrices Q are of dimension (N +1)×3, with Q and Q being of dimension (N +1)×N, for k = 1, 2, 3. k1 k2 k3 th th In the definition of Q, the subscript P denotes that the i row of Q is permuted to the P (i) row of Q, where  3(i − 1) + 1 , i = 1, . . ., N + 1 , 3(i − N − 2) + 2 , i = N + 2, . . ., 2N + 2 , P (i) = (34) 3(i − 2N − 3) + 3 , i = 2N + 3, . . ., 3N + 3 . This permutation of Q allows us to define the sub-blocks simply, given explicitly as 1 , j = k , i,j Q = k = 1, 2, 3 , k1 0 , otherwise, + cosθ cosφ , j < i , i,j j j Q = Δs 0 , j ≥ i , − sinθ sinφ , j < i , i,j j j Q = Δs 0 , j ≥ i , + cosθ sin φ , j < i , i,j j j Q = Δs 0 , j ≥ i , + sinθ cosφ , j < i , i,j j j Q = Δs 0 , j ≥ i , − sinθ , j < i , i,j j Q = Δs 0 , j ≥ i , i,j Q = 0 . 33 7 Further, in this parameterisation we may readily relate the local rate of rotation about d , denoted ω as in ˙ ˙ Eq. (24), to θ, φ, ψ and their time derivatives. Explicitly, this relationship is ω = cos(θ)φ +ψ, and is notably linear in the derivatives of the Euler angles. Thus, we form the composite matrix Q = , (35) 0 C I where I is the N × N identity matrix and the N × N matrix C has diagonal elements C = cos(θ ) for i = 1, . . ., N, N i i with all other elements zero. The upper block, Q, maps the parameterisation into the laboratory frame, whilst the lower blocks convert between the parameterisation and the local rate of rotation about d as written in director basis. The (4N + 3) × 3(N + 1) matrix Q now encodes the expressions of velocities and rotation rates in terms of the parameterisation, via " # QΘ = , (36) noting that the representation of ω is relative to the director basis, whilst the representation of X is relative to the basis of the laboratory frame. Having constructed Q, we now combine Eqs. (25) and (36) to give − BAQΘ = R , (37) noting in particular that the matrix BAQ is square and of dimension (3N + 3) × (3N + 3). Naively, this system of ordinary differential equations can be readily solved numerically to give the evolution of the filament in the surrounding fluid. However, the use of a single parameterisation to describe the filament will in general lead to degeneracy of the linear system and ill-defined derivatives in both space and time, issues which we explore and resolve numerically in the subsequent sections. E. Coordinate singularities i ⊤ Consider a straight filament aligned with the e axis, with each of the d = [0, 0, 1] written in the laboratory frame. For this filament θ = 0 for all i, whilst the φ are undetermined, arbitrary and notably need not be the same i i on each segment. Were we to attempt to formulate and solve the linear system of Eq. (37), both φ and its derivatives would be ill-defined, and correspondingly we would be unable to solve the system for the filament dynamics, which are physically trivial in this particular setup. In more generality, if a filament were to have any segment pass through one of the poles θ = {0, π} of this coordinate system, φ would be undetermined on the segment and arbitrary, with attempts to solve our parameterised system of ordinary differential equations failing. Further, were a segment to pass close to but not through a pole, time derivatives of φ would necessarily become large, with φ well-defined but varyingly rapidly as the segment moves close to the pole of the coordinate system. These large derivatives would artificially introduce additional stiffness to the elastohydrodynamical problem, inherent only to the parameterisation and not the underlying physics. This problem is well known for Euler angle parameterisations, and is commonly referred to as the ‘gimbal lock’. Analogous issues with arclength derivatives occur when considering neighbouring segments, with the value of φ varying rapidly and artificially between segments that reside near the pole of the coordinate system. In this latter case however, our formulation of the elastohydrodynamical problem circumvents the need for evaluation of φ , instead considering only derivatives of the smooth quantities d , though we are not able to resolve issues with s α temporal derivatives in the same way. In order to avoid the numerical and theoretical problems associated with singular points in the filament parameterisation, we exploit the finiteness of the set of angles θ along with the independence of the underlying elastohydrodynamical problem from the parameterisation. Throughout this work we have assumed a fixed laboratory frame with basis {e ,e ,e }, present only so that vector quantities may be written component-wise for convenience. Our choice x y z of such a basis is arbitrary, with the physical problem of filament motion being independent of our selection of particular basis vectors. It is with respect to this basis that we have defined the Euler angles θ, φ, ψ, from which the aforementioned coordinate singularities appear if any of the θ approach zero or π. Thus, if one makes a choice of ⋆ ⋆ ⋆ ⋆ basis {e ,e ,e } such that the corresponding Euler angles θ are some δ-neighbourhood away from the poles of the x y z i new parameterisation, the system of ordinary differential equations given in Eq. (37) may be readily solved, at least initially. Should the solution in the new coordinate system approach one of the new poles θ = 0, π, a new basis can again be chosen, and this process iterated until the filament motion has been captured over a desired interval. 8 ⋆ ⋆ ⋆ We note that for sufficiently small δ > 0 such a choice of basis {e ,e ,e } necessarily exists due to the finiteness of x y z the set of θ , with δ in practice able to be sufficiently large so as to limit the effects of coordinate singularities. Thus, subject to reasonable assumptions of smoothness of the filament position x, such a process of repeatedly changing basis when necessary will prevent issues associated with the parameterisation described above, and will in practice enable the efficient simulation of filament motion without introducing significant artificial stiffness or singularities. III. IMPLEMENTATION, VERIFICATION AND EXTENSIONS A. Selecting a new basis (a) (b) FIG. 1. An example choice of a new parameterisation in order to avoid coordinate singularities. Shown in blue are the points on the unit sphere corresponding to (θ , φ ), with their antipodes displayed in yellow. (a) Before a change of basis and subsequent i i reparameterisation, we see that these points are located near to the θ = 0 and θ = π axes, which are shown as black vertical lines. A new potential location for the θ = 0 axis is shown in orange, selected so as to maximise the distance from the (θ , φ ) i i and their antipodes. (b) Following reparameterisation, the points and antipodes are located maximally away from the new axis. This example scenario corresponds to a helical filament initially with θ = π/6 for i = 1, . . . , 50. Initially choosing an arbitrary laboratory basis {e ,e ,e }, the above formulation is implemented in MATLAB , x y z with the system of ordinary differential equations (ODEs) of Eq. (37) being solved using the inbuilt stiff ODE solver ode15s, as described in detail by Shampine and Reichelt [27]. This standard variable-step, variable-order solver allows −5 −4 for configurable error tolerances, typically set here at 10 for absolute error and 10 for relative error, in general significantly below the error associated with the piecewise-linear filament discretisation. Derivatives with respect to arclength are approximated with fourth order finite differences, with the resulting dynamics insensitive to this choice of scheme. Initially and at each timestep, the values of θ are checked to determine if they are within δ of a coordinate singularity, typically with δ = π/50. Should the parameterisation be approaching a singularity, a new basis is chosen and the problem recast in this basis. A natural method of selecting a new basis is perhaps to choose one uniformly at random. Indeed, by considering the worst-case scenario of the N tuples (θ , φ ) uniformly and disjointly covering the surface of the unit sphere, which i i together θ and φ parameterise, the probability that any random basis results in a scenario with min {θ , π − θ } < δ i i i is given by 2N sin (δ/2), a consequence of elementary geometry. With this quantity being significantly less than unity for a wide range of N with δ large enough to avoid severe artificial numerical stiffness, as discussed above, a practical implementation for the simulation of filament elastohydrodynamics as formulated above may simply select a new basis randomly, repeating until a suitable basis is found. With δ = π/50 and N = 50, the probability of rejecting a candidate new basis is bounded above by 10%, thus in practice one should expect to find an appropriate basis within few iterations of the proposed procedure. 9 Alternatively, and as we will do throughout this work, one may instead proceed in a deterministic manner, selecting a near-optimal basis from knowledge of the existing parameterisation. Given the set of parameters θ and φ , we i i ˆ ˆ ˆ ˆ may choose a θ ∈ [0, π] and φ ∈ [0, 2π) so as to maximise the distance of (θ, φ) from each of the (θ , φ ) and their i i ˆ ˆ antipodes. In practice, an approximate solution to this problem is attained by selecting (θ, φ) from a selection of preset test points in order to maximise the distance from the (θ , φ ), where distance is measured on the surface of the i i unit sphere that θ and φ naturally parameterise, as shown in Fig. 1. It should be noted that this process of selection ˆ ˆ impacts negligibly on computational efficiency with 10,000 test points. With these choices of θ and φ, we form a new basis by mapping the original basis vector e to the vector e , given explicitly by ⋆ ⊤ ˆ ˆ ˆ ˆ ˆ e = [sin θ cosφ, sinθ sin φ, cosθ] . (38) ⋆ ⋆ Choosing the other members of the orthonormal basis e ,e arbitrarily, expressed in this new basis the accompanying x y filament parameterisation will be removed from any coordinate singularities by construction, as exemplified in Fig. 1(b). B. Validation In what follows we validate the presented methodology against known filament behaviours and a sample three dimensional simulation via an existing methodology. Initial configurations and parameter values for each can be found in the Appendix, with behaviours qualitatively independent of these parameter choices and filament setups. 1. Relaxation of a planar filament Noting there is no analytical test solution for the dynamics of a fully 3D Kirchhoff rod in a viscous fluid, to the best of our knowledge, we consider validations by comparison with numerical studies in the literature, though we additionally utilise invariance of the centre of mass as a gold standard below, where applicable. Firstly, we validate the presented approach by considering the problem of filament relaxation in two dimensions, a natural and well- studied subset of the three dimensional framework. We consider the simple case of a symmetric curved filament in the e e plane, which will provide a test of symmetry preservation, integrated moment balance, and hydrodynamics x y via qualitative comparisons with the earlier works of Moreau et al. [14] and Hall-Mcnair et al. [15]. Simulating the relaxation of such a filament to a straight equilibrium condition with N = 40 segments takes less than 2 s on modest hardware (Intel Core™ i7-6920HQ CPU), from which we immediately see retained the computational efficiency of the framework of Moreau et al. which this work generalises. Present throughout the computed motion is the left-right symmetry of the initial condition, with the filament shape evolving smoothly even with a small number of segments, as shown in Fig. 2. Further, the centre of mass, which in exact calculation would be fixed in space due to the overall −3 force-free condition on the filament, is captured numerically with errors on the order of 10 L, demonstrating very good quantitative satisfaction of this condition. Of note, in Fig. 2b we have verified that this error is of the same order of magnitude as that generated by the two-dimensional methodology of Walker et al. [16]. 2. Planar bending of a filament in shear flow Further, whilst the above is reassuring and serves to validate a subset of the implementation, we note from Eqs. (26) and (27) that motion cast in the e e plane of the laboratory frame may often render the evolution of one of the x y directors d ,d trivial. In order to avoid this we may consider planar problems in slightly more generality, posing a 1 2 problem that is planar though not aligned with the e e plane. As an exemplar such problem we attempt to recreate x y a typical but complex behaviour of a flexible filament in a shear flow, that of the J-shape and U-turn [28], aligning both the filament and the background flow in a plane spanned by e and e + e . In order to ensure the absence y x z of alignment of the parameterisation with the e e plane, we disable the adaptive system of basis selection for the x y purpose of this example, and simulate the motion of a filament in a shear flow. The background flow with velocity u and vorticity Ω is incorporated into the framework via the transformation u 7→ u − u , ω 7→ ω − Ω · d /2, yielding b i i the modified system − BAQΘ = R − BAU (39) for a vector U of background flows and vorticities evaluated at segment endpoints and midpoints, respectively. Details of the flow field and initial setup are given in the Appendix. 10 (a) (b) FIG. 2. The two-dimensional relaxation of a symmetric planar filament, simulated with N = 40 segments. (a) Symmetry is preserved throughout the dynamics, with the relaxation in qualitative agreement with that used for verification in the two-dimensional works of Moreau et al. [14], Hall-Mcnair et al. [15], Walker et al. [16]. (b) Translation of the centre of −3 mass throughout the motion, analytically zero, is captured numerically with errors on the order of 10 L by the proposed methodology, notably the same order of magnitude as that attained with the two-dimensional methodology of Walker et al. [16]. Axes x and x correspond to the unit vectors e and e respectively. x y x y (a) (b) (c) FIG. 3. The planar evolution of a filament in shear, exhibiting a rich and well-documented dynamics. (a) Having aligned both the filament and shear flow in a plane not parallel to the e e plane, with the directors non-trivial in this setup, we simulate x y the motion of the filament through two distinct morphological transitions: (b) the characteristic J-shape and (c) the subsequent U-turn (cf. Liu et al. [28, Fig. 1, Movies S5, S6]). We note that the choosing of an improved basis for computation has been disabled for this example, and yields a twofold increase in computational efficiency if enabled. Arrows indicate the direction of the background shear flow. Axes x , x ,x correspond to the unit vectors e , e ,e , respectively. The plane containing the x y z x y z filament and the shear flow is shown in grey. Adopting the timescale T to be the inverse of the shearing rate of the flow, we consider a parameter regime in which one would expect to see to formation of J-shape and subsequently a U-turn, defined by their characteristic morphologies in Liu et al. [28, Figure 1, Movies S5, S6] and from which an appropriate parameter choice is obtained. Notably, the impact of thermal noise perturbations is not considered here, in contrast to Liu et al. [28], preventing a quantitative comparison. In Fig. 3 we present the initial, J-shape, and U-turn configurations of the filament as simulated via the proposed methodology, with computation requiring approximately 20 s with N = 50 segments. The simulated filament shapes are in qualitative agreement with those shown in Liu et al. [28, Figure 1], and serve as further validation of the coarse-grained methodology. Notably, enabling the described method of basis selection effectively casts this problem in the e e plane, affording a twofold increase in computational efficiency and highlighting the x y benefits of adaptive reparameterisation. 3. Relaxation of a non-planar filament Finally, we consider truly non-planar relaxation of filaments in three dimensions. Typical simulations of such a relaxation with N = 50 segments have a runtime of approximately 10s on the modest hardware described above, often requiring at most one choice of basis though naturally problem dependent, and provide reasonable accuracy. Thus, even 11 when considering inherently three-dimensional problems we see retained in this methodology the low computational cost of the formulation of Moreau et al. [14], representing significant improvements in computational efficiency over recent studies in three dimensions [19–21]. This is particularly evident when directly comparing the presented coarse- grained methodology with the results of Ishimoto and Gaffney [21], considering in this case the relaxation of a helical configuration to a straight equilibrium. A side-by-side comparison of the relaxation dynamics as computed by the proposed methodology and that presented in Ishimoto and Gaffney is shown in Fig. 4, noting that the work of Ishimoto and Gaffney [21] considers an actively driven nearly inextensible filament, of which relaxation dynamics are a natural subset. Figure 4 highlights good agreement between methodologies that is in line with the level of accuracy typically afforded by resistive force theories used here, recalling errors logarithmic in the filament aspect ratio. Figure 4e shows a quantitative evaluation of the computed solutions, with the deviation of the filament centre of mass from the initial condition shown as solid black curves for each methodology. With the force-free condition implying that the filament centre of mass should not move throughout the relaxation dynamics, this measured deviation serves as an assessment −2 of the accuracy of both frameworks, with each exhibiting variation only on the order of 10 L. Also shown in Fig. 4e is a dimensional measure of the difference between the two computed solutions, here denoted E(t) and defined as the non-negative root of E (t) = x (s, t) − x (s, t) ds , (40) P IG where x (s, t) and x (s, t) denote the filament centreline as computed by the proposed methodology and that used P IG by Ishimoto and Gaffney, respectively. Numerically approximating this integral with quadrature and noting that this −2 error is consistently on the order of 10 L throughout the relaxation, we see evidenced good quantitative agreement between the two frameworks, thus validating the proposed methodology. We also remark that the solution of Ishimoto and Gaffney [21] does not perfectly satisfy filament inextensibility, with variation in total length of approximately 1%, which may have some impact on the computed dynamics. Thus, when computing E(t) as defined above, we treat s ∈ [0, L] as a material parameter, with the differences in position x (s, t)−x (s, t) therefore capturing discrepancies P IG between the simulated locations of the material point with undeformed arclength s at time t, with s not necessarily equal to the deformed arclength in the solution of Ishimoto and Gaffney [21]. In contrast to the agreement between solutions, there is a stark difference between the associated time required for computation. Taking N = 100 segments and computing until relaxation, the coarse-grained framework calculated −5 the solution in approximately 30 s on personal computing hardware with ODE error tolerances of 10 , whilst the computations utilising the implementation of Ishimoto and Gaffney required 2.5 h on a high performance computing cluster. A thorough investigation of the time required for computation with the presented methodology for various choices of the parameters ǫ and N is showcased in Fig. 5, from which we note the remarkable performance of this simple implementation across parameter regimes, with the walltime naturally dependent on the discretisation parameter N. C. Model extensions 1. Intrinsic curvature In order to showcase the versatility of the presented framework, we demonstrate its simple extension to filaments with non-zero intrinsic or reference curvature, which can exhibit complex buckling behaviours [29]. Recalling the constitutive relation of Eq. (8), the effect of an intrinsic curvature κ is to alter the bending moments, yielding the modified constitutive relation 0 0 0 m = EI [κ − κ ]d + [κ − κ ]d + [κ − κ ]d , (41) 1 1 2 2 3 3 1 2 3 1 + σ 0 0 where we have written κ = κ d in the local director basis. Notably, the reference curvature can plausibly depend α α on a variety of quantities, including time, arclength, and spatial position, with an example being the modelling of an internally driven filament by a time-dependent intrinsic curvature [18, 19]. Practically, the inclusion of such an intrinsic curvature amounts to a simple subtraction of the reference curvature from the computed components of κ at each instant, with R as given in Eq. (20) being modified accordingly. Doing so, we simulate the relaxation of a straight filament with a non-zero intrinsic curvature, with the reference curvature explicitly given by κ = πd + 2πd corresponding to a helical configuration. As shown in Fig. 6, the filament indeed 2 3 −2 relaxes to a helix, with the walltime of this simulation being 15 s on a laptop computer, having taken ǫ = 10 L and N = 70 segments, noting that the filament shape has been sufficiently resolved with this discretisation. 12 (a) (b) (e) (c) (d) FIG. 4. The relaxation of a filament in three dimensions. Shown are the results of simulating this motion via (a,b) the proposed framework and (c,d) the methodology presented in Ishimoto and Gaffney [21], in turn heavily based on the work of Olson et al. [19] shown from multiple perspectives at multiple timepoints. In both cases we observe relaxation from a non-planar, helical configuration to a straight filament, and good agreement between the two computed solutions, in particular given the logarithmic accuracy of resistive force theories. (e) A quantitative comparison between the two frameworks, with solid lines showing the Euclidean distance of the filament centre of mass from its initial location, analytically zero by the force-free −2 condition though here on the order of 10 L. The dashed curve quantifies the error between the computed solutions, denoted 2 2 E, with the square of this error defined as E = kx − x k ds/L, where x and x are the locations of the filament P IG P IG centreline as computed by the proposed methodology and that used by Ishimoto and Gaffney, respectively. Computation with the presented methodology took approximately 30 s on a modest laptop computer, in comparison to the multiple hours required on sophisticated cluster hardware for the methodology of Ishimoto and Gaffney. Here we have simulated filament motion with N = 100 segments. Axes x ,x ,x correspond to the unit vectors e ,e ,e , respectively. x y z x y z 2. Clamped and internally driven filaments Finally, we consider the simple extensions to both clamped filaments and to those with actively generated internal moments, the latter being akin to the active beating of biological cilia and flagella [30]. For time and arclength- dependent active moment density m , its inclusion into the presented framework acts to modify the moment balance of Eq. (2) to m + x × n − τ + m = 0 . (42) s s Repeating the integration of the pointwise moment balance from s = s to s = L as in Section II leads to a modified form of Eq. (11), explicitly given as EI i τ i a − d · I + I = κ (s ) − d · I , (43) α i α i i α i 1 + δ σ α,3 where the integrated active moment density is written as a a I = m ds˜. (44) For a given active moment density, assumed to be integrable, I may be readily computed either analytically or numerically, with its components in the local d direction then modifying R from Eq. (20) accordingly. Clamping the filament at the base is somewhat simpler, in that the overall force and moment balance conditions on the filament are merely replaced by enforcing no motion or rotation at the base. These conditions may be stated concisely as ˙ ˙ ˙ x˙ (0) = 0 , θ = φ = ψ = 0 , (45) 1 1 1 13 FIG. 5. Walltimes associated with the 3D filament relaxation of Fig. 4 for various choices of the parameters ǫ and N. With N = 200 corresponding to a very fine discretisation of the filament, we observe a maximum walltime of under 6 minutes on a modest laptop computer, approximately 25x faster than the similar computations of Ishimoto and Gaffney [21] on sophisticated cluster hardware, albeit for different parameter values. There is a strong dependence of the walltime on the level of discretisation, −5 −4 N, as expected. Here, the absolute and relative error tolerances of the ODE solver are set to 10 and 10 , respectively. All axes, including the colour axis, are logarithmically scaled for visual clarity. For reference, the parameter combination signified −3 by a cross corresponds to a walltime of 2.5 s, with N = 63 and ǫ/L ≈ 3.2 × 10 . FIG. 6. The relaxation of a straight filament with non-zero intrinsic curvature to a helical configuration, with reference curvature 0 −2 specified as κ = πd2 + 2πd3. Having taken N = 70 segments and ǫ = 10 L, we observe the smooth relaxation of the filament away from its initial straight configuration, computed in 15 s on a modest laptop computer. Axes x , x ,x correspond to the x y z unit vectors e , e ,e , respectively. x y z supplanting the force and moment-free conditions of Eqs. (5) and (6), having taken s = 0 in the latter. Implementing these minor modifications, as an example we specify a travelling wave of internal moment given by m = 5 sin(s − −2 t)d + 5 cos(s − t)d and simulate the active motion of a clamped filament, taking N = 50 and ǫ = 10 L. Snapshots 1 2 of this eventually periodic motion are shown in Fig. 7, with the motion simulated up until t = 8π from a straight initial configuration and with a walltime of around 8 s. IV. DISCUSSION In this work we have seen that the motion of inextensible unshearable filaments in three dimensions can be concisely described by a coarse-grained framework, building upon the principles of Moreau et al. [14] in order to minimise numerical stiffness associated with the governing equations of elastohydrodynamics. This representation was readily implemented via an Euler angle parameterisation, with adaptive basis selection and reparameterisation overcoming coordinate singularities associated with a fixed representation of the dynamics. We have further demonstrated the efficacy of the proposed deterministic method for basis selection by explicit simulation of non-planar filament dynamics, which is able to afford reductions in numerical stiffness even when separated from singularities of the parameterisation. The presented framework retains the flexibility and extensibility of the formulations of Moreau et al. [14], Hall-Mcnair 14 FIG. 7. The 3D beating of a clamped filament driven by prescribed active internal moments. Having specified a travelling wave of out-of-phase sinusoidal active moments m = 5 sin(s − t)d + 5 cos(s − t)d , an initially straight filament deforms to a 1 2 −2 periodic driven motion, with the tip of the filament following a circular path. Here we have taken ǫ = 10 L and N = 50, noting that the filament shape has been resolved smoothly with this level of discretisation. Computation required approximately 8 s on modest hardware, simulating up until t = 8π. Axes x ,x ,x correspond to the unit vectors e ,e ,e , respectively. x y z x y z et al. [15], Walker et al. [16], with background flows, active moment generation, body forces and other effects or constraints being simple to include in this representation. The simplicity of these possible extensions speaks to the broad utility of the proposed approach, with potential for use in the simulation of both single and multiple filamentous bodies in fluid under a wide variety of circumstances and conditions. In formulating our methodology we have made the simplifying assumption of coupling fluid dynamics to forces via resistive force theory, which is well-known to incur errors logarithmic in the filament aspect ratio, though variations remain in widespread use [14, 30–35]. Resistive force theories additionally suffer from locality, in that portions of the filament do not directly interact with one another through the fluid. A natural development of the presented approach would therefore be the inclusion of non-local hydrodynamics, perhaps via the regularised Stokeslet segment methodology of Cortez [36] as included in the work of Walker et al. [16], or lightweight singular slender body theories such as those of Tornberg and Shelley [4], Johnson [37], Walker et al. [38]. Such improvements may also include the consideration of confined geometries, with motion in a half space of particular pertinence to typical microscopy of flagellated organisms. Despite the many possible directions for hydrodynamic refinement, we note that the linearity of Stokes flows necessitates that any relations between forces and velocities be linear, with explicit formulations simply giving rise to modified linear operators A that may be readily inserted into the described framework. In the wider context of methods for soft filament simulation, the scope of which is illustrated by the generality of the approach of Gazzola et al. [39], the proposed framework enables rapid simulation of the subclass of purely inextensible filaments. This modeling assumption has been demonstrated to be a valid approximation of nearly inextensible filaments in a variety of contexts [23], affording greatly improved computational efficiency over previous approaches that we have compounded here, albeit with reduced hydrodynamic fidelity. However, we expect that the addition of improved hydrodynamics will have minimal impact on the computational efficiency of the presented methodology, with this efficiency not being derived from our use of simple resistive force theory, as noted by Hall- Mcnair et al. [15], Walker et al. [16] for their non-local refinements of the 2D theory of Moreau et al. [14]. In summary, we have presented, verified and exemplified a novel framework for the rapid simulation of inextensible, unshearable filaments in a viscous fluid at zero Reynolds number. Despite the improved generality of this methodology over existing two-dimensional approaches, we have retained the computational efficiency and simplicity of the work of Moreau et al. [14], affording significant extensibility and thus facilitating a vast range of previously unrealisable biological and biophysical studies into filament dynamics on the microscale. ACKNOWLEDGEMENTS We are grateful to Prof. Derek Moulton for discussions on elastic filaments, and to Prof. David Smith for discussions on basis rotation. B.J.W. is supported by the UK Engineering and Physical Sciences Research Council (EPSRC), grant EP/N509711/1. K.I. acknowledges MEXT Leading Initiative for Excellent Young Researchers (LEADER), JSPS KAKENHI for Young Researcher (JP18K13456), and JST, PRESTO Grant Number JPMJPR1921, Japan. Elements of the simulations were performed using the cluster computing system within the Research Institute for Mathematical Sciences (RIMS), Kyoto University. 15 The computer code used and generated in this work is freely available from https://gitlab.com/bjwalker/3d-filaments.git. Appendix: Parameters and initial conditions We nondimensionalise the system Eq. (37) as in Walker et al. [16], resulting in a dimensionless system of the form 8πµL ˆ ˆ ˆ ˆ ˆ − E BAQΘ = R , E = (A.1) h h EI T for timescale T and elastohydrodynamic number E , where dimensionless counterparts are given by 1 L EI ˆ ˆ ˙ ˆˆ ˆ B = L B , A = A , Qθ = Qθ , R = R , (A.2) 8πµ T L having multiplied the force balance equations by Δs to unify dimensions. All examples begin with the filament base, x , coincident with the origin of the laboratory frame, and we set Poisson’s ratio to zero, i.e. σ = 0 throughout though note a lack of sensitivity of results to this choice. 1. Relaxation of a planar filament In simulating the relaxation of a filament in the e e plane, we impose the initial filament shape as x y π i − 1 1 θ = π/2 , φ = − , ψ = 0 , for i = 1, . . ., N (A.3) i i i 2 N − 1 2 with respect to standard laboratory Euler angles. Filament motion is simulated with E ≈ 1.6 × 10 , though this choice is arbitrary given the invariance of the dynamics to rescalings in time (assuming that the rescaling is not so extreme as to break the inertialess assumption). 2. Planar bending of a filament in shear flow In order to generate the characteristic behaviours of the J-shape and U-turn we initialise the filament via π i − 1 θ = π/4 , φ = − , ψ = 0 , for i = 1, . . ., N . (A.4) i i i 12 N − 1 We align a background shear flow in the same plane as the filament, proportional in strength to the coordinate in the e direction, denoted y. Explicitly, this flow u is given in the laboratory frame in dimensionless form by y b u = √ y(e + e ) , (A.5) b x z having taken the timescale T to be the inverse of the dimensional shear rate. Simulation proceeds with E ≈ 4.7 × 10 , consistent with the regime found in Liu et al. [28], and we note that the tip of the filament initially curves into the oncoming background flow in y < 0. 3. Relaxation of a non-planar filament Taking N = 100 segments, we impose the helical initial condition i − 1 θ = π/3 , φ = 2π , ψ = 0 , for i = 1, . . ., N . (A.6) i i i N − 1 We simulate filament motion with E ≈ 3.1 × 10 , with results insensitive to this choice. The parameters used in the implementation of Ishimoto and Gaffney [21] are as in their publication, with the image system for a plane wall accordingly removed and the actively generated torques set to zero to allow for filament relaxation in free space. In particular, whilst the filaments of Ishimoto and Gaffney [21] are extensible, the extensional modulus of these filaments is sufficiently high so as to provide near inextensibility in their results, enabling meaningful comparison. 16 4. Relaxation of a non-straight filament Taking N = 70 segments, we impose the straight initial condition θ = π/2 , φ = 0 , ψ = 0 , for i = 1, . . . , N . (A.7) i i i 0 5 The intrinsic curvature is specified as κ = πd + 2πd . We simulate filament motion with E ≈ 1.5 × 10 , with 2 3 h results insensitive to this choice. 5. Active beating of a clamped filament Taking N = 50 segments, we impose the straight initial condition θ = π/2 , φ = 0 , ψ = 0 , for i = 1, . . . , N . (A.8) i i i The active moment density is specified as m = 5 sin(s − t)d + 5 cos(s − t)d . We simulate filament motion with 1 2 E = 10 up until t = 8π. [1] J. Gray, Ciliary movement (Cambridge University Press, Cambridge [England], 1928). [2] G. J. Hancock, The self-propulsion of microscopic organisms through liquids, Proceedings of the Royal Society of London. Series A. Mathematical and Physical Sciences 217, 96 (1953). [3] H. C. Berg and R. A. Anderson, Bacteria swim by rotating their flagellar filaments, Nature 245, 380 (1973). [4] A. K. Tornberg and M. J. Shelley, Simulating the dynamics and interactions of flexible fibers in Stokes flows, Journal of Computational Physics 196, 8 (2004). [5] M. Roper, R. Dreyfus, J. Baudry, M. Fermigier, J. Bibette, and H. A. Stone, On the dynamics of magnetically driven elastic filaments, Journal of Fluid Mechanics 554, 167 (2006). [6] C. Pozrikidis, Shear flow over cylindrical rods attached to a substrate, Journal of Fluids and Structures 26, 393 (2010). [7] C. Pozrikidis, Shear flow past slender elastic rods attached to a plane, International Journal of Solids and Structures 48, 137 (2011). [8] S. Tottori, L. Zhang, F. Qiu, K. K. Krawczyk, A. Franco-Obreg´on, and B. J. Nelson, Magnetic helical micromachines: fabrication, controlled swimming, and cargo transport, Advanced Materials 24, 811 (2012). [9] F. Meng, D. Matsunaga, and R. Golestanian, Clustering of Magnetic Swimmers in a Poiseuille Flow, Physical Review Letters 120, 188101 (2018), arXiv:1710.08339. [10] J. Gray and G. J. Hancock, The Propulsion of Sea-Urchin Spermatozoa, Journal of Experimental Biology 32, 802 (1955). [11] R. E. Johnson, Slender-body theory for Stokes flow and flagellar hydrodynamics, Ph.D. thesis, California Institute of Technology (1977). [12] C. Pozrikidis, Boundary integral and singularity methods for linearized viscous flow (Cambridge University Press, 1992). [13] O. du Roure, A. Lindner, E. N. Nazockdast, and M. J. Shelley, Dynamics of Flexible Fibers in Viscous Flows and Fluids, Annual Review of Fluid Mechanics 51, 539 (2019). [14] C. Moreau, L. Giraldi, and H. Gadˆelha, The asymptotic coarse-graining formulation of slender-rods, bio-filaments and flagella, Journal of The Royal Society Interface 15, 20180235 (2018). [15] A. L. Hall-Mcnair, T. D. Montenegro-Johnson, H. Gadˆelha, D. J. Smith, and M. T. Gallagher, Efficient implementation of elastohydrodynamics via integral operators, Physical Review Fluids 4, 1 (2019). [16] B. J. Walker, K. Ishimoto, H. Gadˆelha, and E. A. Gaffney, Filament mechanics in a half-space via regularised Stokeslet segments, Journal of Fluid Mechanics 879, 808 (2019). [17] R. Yanagimachi, The movement of golden hamster spermatozoa before and after capacitation, Reproduction 23, 193 (1970). [18] S. F. Schoeller, A. K. Townsend, T. A. Westwood, and E. E. Keaveny, Methods for suspensions of passive and active filaments, Journal of Computational Physics , 109846 (2020). [19] S. D. Olson, S. Lim, and R. Cortez, Modeling the dynamics of an elastic rod with intrinsic curvature and twist using a regularized Stokes formulation, Journal of Computational Physics 238, 169 (2013). [20] J. Simons, L. Fauci, and R. Cortez, A fully three-dimensional model of the interaction of driven elastic filaments in a Stokes flow with applications to sperm motility, Journal of Biomechanics 48, 1639 (2015). [21] K. Ishimoto and E. A. Gaffney, An elastohydrodynamical simulation study of filament and spermatozoan swimming driven by internal couples, IMA Journal of Applied Mathematics 83, 655 (2018). [22] E. L. Bouzarth, A. T. Layton, and Y.-N. Young, Modeling a semi-flexible filament in cellular Stokes flow using regularized Stokeslets, International Journal for Numerical Methods in Biomedical Engineering 27, 2021 (2011). [23] M. Jabbarzadeh and H. C. Fu, A numerical method for inextensible elastic filaments in viscous fluids, Journal of Computational Physics 418, 109643 (2020), arXiv:2003.05608. [24] S. S. Antman, Nonlinear Problems of Elasticity, Applied Mathematical Sciences, Vol. 107 (Springer-Verlag, New York, 2005). 17 [25] M. Nizette and A. Goriely, Towards a classification of Euler-Kirchhoff filaments, Journal of Mathematical Physics 40, 2830 (1999). [26] A. Chwang and T. Y.-T. Wu, Hydromechanics of low-Reynolds-number flow. Part 1. Rotation of axisymmetric prolate bodies, Journal of Fluid Mechanics 63, 607 (1974). [27] L. F. Shampine and M. W. Reichelt, The MATLAB ODE Suite, SIAM Journal on Scientific Computing 18, 1 (1997). [28] Y. Liu, B. Chakrabarti, D. Saintillan, A. Lindner, and O. du Roure, Morphological transitions of elastic filaments in shear flow, Proceedings of the National Academy of Sciences 115, 9438 (2018). [29] S. Lim, Dynamics of an open elastic rod with intrinsic curvature and twist in a viscous fluid, Physics of Fluids 22, 024104 (2010). [30] H. Gadˆelha, E. A. Gaffney, D. J. Smith, and J. C. Kirkman-Brown, Nonlinear instability in flagellar dynamics: a novel modulation mechanism in sperm migration?, Journal of The Royal Society Interface 7, 1689 (2010). [31] E. Lauga, W. R. DiLuzio, G. M. Whitesides, and H. A. Stone, Swimming in circles: Motion of bacteria near solid boundaries, Biophysical Journal 90, 400 (2006). [32] J. Sznitman, X. Shen, R. Sznitman, and P. E. Arratia, Propulsive force measurements and flow behavior of undulatory swimmers at low Reynolds number, Physics of Fluids 22, 121901 (2010). [33] M. P. Curtis, J. C. Kirkman-Brown, T. J. Connolly, and E. A. Gaffney, Modelling a tethered mammalian sperm cell undergoing hyperactivation, Journal of Theoretical Biology 309, 1 (2012). [34] R. D. Schulman, M. Backholm, W. S. Ryu, and K. Dalnoki-Veress, Undulatory microswimming near solid boundaries, Physics of Fluids 26, 10.1063/1.4897651 (2014). [35] A. S. Utada, R. R. Bennett, J. C. N. Fong, M. L. Gibiansky, F. H. Yildiz, R. Golestanian, and G. C. L. Wong, Vibrio cholerae use pili and flagella synergistically to effect motility switching and conditional surface attachment, Nature Communications 5, 4913 (2014). [36] R. Cortez, The method of regularized Stokeslets, SIAM Journal on Scientific Computing 23, 1204 (2001). [37] R. E. Johnson, An improved slender-body theory for Stokes flow, Journal of Fluid Mechanics 99, 411 (1980). [38] B. J. Walker, M. P. Curtis, K. Ishimoto, and E. A. Gaffney, A regularised slender-body theory of non-uniform filaments, Journal of Fluid Mechanics 899, A3 (2020). [39] M. Gazzola, L. H. Dudte, A. G. McCormick, and L. Mahadevan, Forward and inverse problems in the mechanics of soft filaments, Royal Society Open Science 5, 171628 (2018).

Journal

PhysicsarXiv (Cornell University)

Published: Jul 10, 2019

There are no references for this article.