Store an axis without choosing a head
Use a symmetric, traceless two-by-two tensor. The director angle determines its two components; the scalar order measures how strongly the rods align. Reversing the director leaves both components unchanged. In this convention, perfect order has scalar amplitude one, while the diagonal component for horizontal rods is one half.
Different papers absorb the factor of two into their order variable. Compare definitions before comparing numerical activities. The formula below fixes the convention used for this derivation.
Only spatial changes of stress supply a bulk force
Choose the active stress as minus activity times the order tensor; positive activity is extensile in this convention. A uniform order tensor gives a uniform active stress and no bulk force in a periodic domain. Curvature and changes of order create spatial stress gradients.
Pressure adjusts to prevent compression. Viscosity resists velocity gradients and substrate friction resists velocity itself. The resulting screened Stokes equation is an instantaneous force balance: there is no fluid acceleration term. Friction is a deliberate addition to the unfrictional continuum context of Giomi’s 2015 paper.
Pressure removes the longitudinal part
A Fourier mode is a sinusoidal pattern with a known wave vector. Spatial derivatives become multiplications by its wave-vector components. Split the force into a part parallel to this vector and a part perpendicular to it. Pressure cancels the parallel part; only the perpendicular part drives an incompressible velocity.
Divide that transverse force by viscosity times wave number squared plus friction. This gives both the magnitude and phase of the velocity mode. The zero-wave-number velocity is set to zero in a periodic simulation with no imposed throughflow.
Worked example
Test one sinusoid all the way through
Set the off-diagonal order component to an amplitude times the sine of a vertical wave number times height, and set the diagonal component to zero. Its stress divergence points horizontally and varies as a cosine in height. Because the force is perpendicular to the wave vector, pressure does not remove it.
With activity 2, amplitude 0.1, viscosity 1, friction 1 and wave number 1 in consistent dimensionless units, the horizontal velocity amplitude is minus 0.1. Reverse activity and the velocity reverses. Set activity to zero and the flow vanishes. This signed example catches an incorrect stress sign or derivative as well as an incorrect amplitude.
A grid derivative approximates a continuous derivative, so compare progressively finer grids. The benchmark supplied with this course records the continuum error at resolutions 16, 32 and 64. Its decreasing error tests the force-to-velocity calculation independently of whether a moving defect looks plausible.
Let the rods respond to the flow
A dynamic nematic field needs another equation. Local relaxation favours a finite degree of order, elasticity smooths rapid spatial changes, advection carries the pattern, and flow rotation turns it. A flow-alignment term can also orient rods along a stretching direction. These ingredients create feedback between order and flow.
The browser model evolves two order components with a stated minimal relaxation, advection, rotation and alignment law, and recomputes flow from the resulting active stress. It is a small periodic continuum model with friction. Its parameter choices are teaching choices, not measured coefficients for a particular tissue.
A defect track is extracted from this evolving order field. For a positive half defect, asymmetry permits directed motion; a negative half defect has threefold symmetry in its ideal texture. In a many-defect flow, both also respond to neighbours and advection. Compare tracks in controlled initial configurations before assigning all motion to self-propulsion.