Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

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

LectureTopics
0. Frame indifference, convected derivatives and finite strainframe indifference; upper-convected, corotational and Gordon–Schowalter derivatives; the Finger tensor; the Lodge integral
1. The conformation tensor: positive definiteness, free energy and dissipationthe 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 formulationwhy direct integration fails at high Weissenberg number; the log-conformation decomposition; its limit for equal eigenvalues

Part II. Brownian dynamics of dumbbells and chains

LectureTopics
3. Stochastic differential equations and FENE dumbbellsstochastic differential equations of dumbbells; Hookean, FENE and wormlike-chain springs; the semi-implicit FENE step
4. The Kramers stress and variance reduction with control variatesthe 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 interactionsRouse and Zimm relaxation times; the Rotne–Prager–Yamakawa mobility; Brownian dynamics of chains with hydrodynamic interaction

Part III. Closures, tube models and shear banding

LectureTopics
6. Closure approximations: FENE-P, FENE-CR and coil–stretch hysteresisthe Peterlin closure; FENE-P and FENE-CR; the closure against Brownian dynamics; coil–stretch hysteresis
7. Tube models: Rolie-Poly and Pom-Pomthe Rolie-Poly model with constraint release; the Pom-Pom model of branched melts
8. Non-monotonic flow curves and shear banding in wormlike micellesnon-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

LectureTopics
9. Yield-stress fluids: exact Bingham solutions and the error of regularizationexact 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 ductthe 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 recoilthe Saramito model: elastic below the yield stress, viscoelastic above; start-up, oscillation and recoil

Part V. Micro-macro methods and two-dimensional viscoelastic flow

LectureTopics
12. Start-up of viscoelastic channel flow: the Waters–King solution and Brownian configuration fieldsstart-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 solverprojection 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 criterionvortex shift in cavity flow; regularized lid; a channel with wavy walls; the Pakdel–McKinley criterion

Part VI. Suspensions, microrheology and data-driven stress models

LectureTopics
15. Lees–Edwards shear, dissipative particle dynamics and discontinuous shear thickeningLees–Edwards boundaries; dissipative particle dynamics; the Wyart–Cates model; a frictional particle simulation
16. Passive microrheology and a frame-invariant, thermodynamically consistent stress modela 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 scalesa 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 equationsLectures 0 and 1
writing a viscoelastic flow solverLectures 2, 12, 13 and 14
simulating polymer moleculesLectures 3 to 5
choosing a model for a melt or a micellar solutionLectures 6 to 8
computing the flow of a paste or a gelLectures 9 to 11
working with suspensions or microrheologyLectures 15 and 16
short of timeLectures 0, 2, 3, 10 and 12

Companion books