Computational rheology in Python: constitutive models, Brownian dynamics, log-conformation solvers, yield-stress flow and suspensions
How the flow of polymer solutions, melts, gels and suspensions is computed, with every model and method written out in NumPy and checked against an exact solution or an independent calculation.
The book has six parts. The first treats the kinematics that any constitutive equation must respect: frame indifference, convected derivatives, the conformation tensor with its free energy, and the log-conformation formulation that keeps the tensor positive definite at high Weissenberg number. The second computes the stress of a polymer solution from stochastic simulations of dumbbells and chains, with a semi-implicit step for finitely extensible springs, variance reduction and hydrodynamic interaction. The third closes the stochastic models into constitutive equations (FENE-P, Rolie-Poly, Pom-Pom), compares closures with the simulations, and treats flow curves that are not monotonic and the shear bands that follow. The fourth treats yield-stress fluids: exact solutions, the error of regularization, the augmented Lagrangian method that needs none, and a model that is elastic below the yield stress. The fifth couples the stress to the momentum equation: start-up of channel flow with configuration fields, and a two-dimensional solver for cavity flow. The sixth treats particle simulations of suspensions, passive microrheology and a stress model fitted to data under the constraints of frame indifference and non-negative dissipation, and closes with a project that uses the methods of all six parts.
Each lecture is an executed Jupyter notebook of about one hour. It states the model and its
equations, works through four short demonstrations, and then repeats by hand the calculation of a
function of the package that it has used. The notebooks share a small Python package,
engcomprheo, written to be read as much as to be used; its core needs NumPy alone. Each lecture
has numbered, captioned figures and ends with three exercises: one that verifies a result, one that
looks for a way in which the method fails, and one that asks the reader to write a solver. A worked
solution to every exercise is given in the Worked solutions part of the book.
The material parameters are assumed values of the order of those reported for fluids of each kind; they are not fitted to measurements. Data that stand for measurements are synthetic: they are generated in the notebooks from stated laws, so that the answer is known and a method can be judged against it.
The level is that of graduate students and final-year undergraduates in engineering or the physical sciences. The lectures assume continuum mechanics at the level of the Navier–Stokes equations, linear algebra, a little probability, and Python with NumPy. The 24 models and methods are listed in the list of models and methods, symbols in Notation and conventions, a plan for a semester in the syllabus, the checks of the package in the validation report, and original papers and books for further study in Suggested references.
Part I. Objectivity, the conformation tensor and the log-conformation formulation¶
| Lecture | Topics |
|---|---|
| 0. Frame indifference, convected derivatives and finite strain | frame indifference; upper-convected, corotational and Gordon–Schowalter derivatives; the Finger tensor; the Lodge integral |
| 1. The conformation tensor: positive definiteness, free energy and dissipation | the conformation tensor; positive definiteness; free energy and dissipation; Oldroyd-B, FENE-P and Giesekus in extension and shear |
| 2. The high Weissenberg number problem and the log-conformation formulation | why direct integration fails at high Weissenberg number; the log-conformation decomposition; its limit for equal eigenvalues |
Part II. Brownian dynamics of dumbbells and chains¶
| Lecture | Topics |
|---|---|
| 3. Stochastic differential equations and FENE dumbbells | stochastic differential equations of dumbbells; Hookean, FENE and wormlike-chain springs; the semi-implicit FENE step |
| 4. The Kramers stress and variance reduction with control variates | the Kramers expression for the stress; statistical error; a Hookean control variate driven by the same random numbers |
| 5. Rouse and Zimm chains with Rotne–Prager–Yamakawa hydrodynamic interactions | Rouse and Zimm relaxation times; the Rotne–Prager–Yamakawa mobility; Brownian dynamics of chains with hydrodynamic interaction |
Part III. Closures, tube models and shear banding¶
| Lecture | Topics |
|---|---|
| 6. Closure approximations: FENE-P, FENE-CR and coil–stretch hysteresis | the Peterlin closure; FENE-P and FENE-CR; the closure against Brownian dynamics; coil–stretch hysteresis |
| 7. Tube models: Rolie-Poly and Pom-Pom | the Rolie-Poly model with constraint release; the Pom-Pom model of branched melts |
| 8. Non-monotonic flow curves and shear banding in wormlike micelles | non-monotonic flow curves of the Johnson–Segalman model; stress diffusion and the selected stress; a two-species model of wormlike micelles |
Part IV. Yield-stress fluids and elastoviscoplasticity¶
| Lecture | Topics |
|---|---|
| 9. Yield-stress fluids: exact Bingham solutions and the error of regularization | exact Bingham and Herschel–Bulkley flow in channels and pipes; the Papanastasiou regularization and its creep below the yield stress |
| 10. The augmented Lagrangian method for Bingham flow in a square duct | the augmented Lagrangian method for Bingham flow; plug and dead corners in a square duct; the critical Bingham number |
| 11. Elastoviscoplasticity: the Saramito model, yielding and recoil | the Saramito model: elastic below the yield stress, viscoelastic above; start-up, oscillation and recoil |
Part V. Micro-macro methods and two-dimensional viscoelastic flow¶
| Lecture | Topics |
|---|---|
| 12. Start-up of viscoelastic channel flow: the Waters–King solution and Brownian configuration fields | start-up of plane Poiseuille flow of an Oldroyd-B fluid; Brownian configuration fields and independent ensembles |
| 13. DEVSS-G stabilization and a coupled two-dimensional log-conformation solver | projection and a cosine-transform Poisson solver; the two-dimensional log-conformation step; DEVSS-G; cavity flow |
| 14. Viscoelastic cavity flow, constricted channels and the Pakdel–McKinley criterion | vortex shift in cavity flow; regularized lid; a channel with wavy walls; the Pakdel–McKinley criterion |
Part VI. Suspensions, microrheology and data-driven stress models¶
| Lecture | Topics |
|---|---|
| 15. Lees–Edwards shear, dissipative particle dynamics and discontinuous shear thickening | Lees–Edwards boundaries; dissipative particle dynamics; the Wyart–Cates model; a frictional particle simulation |
| 16. Passive microrheology and a frame-invariant, thermodynamically consistent stress model | a probe in a viscoelastic medium; Mason’s form of the generalized Stokes–Einstein relation; a tensor-basis stress model with non-negative weights |
| 17. Project: screening a contraction and slit-die design across scales | a screening calculation for a feed duct and a wavy slit that uses the methods of all six parts (assumed parameters and limits) |
Where to start¶
| If you are… | Read |
|---|---|
| new to constitutive equations | Lectures 0 and 1 |
| writing a viscoelastic flow solver | Lectures 2, 12, 13 and 14 |
| simulating polymer molecules | Lectures 3 to 5 |
| choosing a model for a melt or a micellar solution | Lectures 6 to 8 |
| computing the flow of a paste or a gel | Lectures 9 to 11 |
| working with suspensions or microrheology | Lectures 15 and 16 |
| short of time | Lectures 0, 2, 3, 10 and 12 |
Companion books¶
engcfd: computational fluid dynamics and finite-volume transport for Newtonian fluids.
engsim: molecular dynamics and Monte Carlo simulation from scratch.
onsager
-variational -methods: variational methods in soft matter. engtransport: heat and mass transfer through worked problems.
engmaterials: computational materials science.
engthink: computational thinking for engineers.
engml-1-foundations, engml-2-applied and engml-3-frontier: machine learning and physics-informed modelling, in three volumes.
error-analysis: evaluating, propagating and reporting uncertainty.
from
-formulas -to -programs: a first course in programming for engineers.