1 Introduction

Suspensions of micron-sized particles with solid and liquid mixed in roughly equal proportion present intriguing flow properties that challenge physicists and engineers of all kinds [1]. A useful starting point for characterising their rheology is to understand the rate-independent behaviour (relevant for solid particles of \(\approx \) 10–1000 \(\upmu \)m size), demonstrated experimentally by Boyer et al. [2] and later reviewed by many others (e.g. [3]). A number of particle-based simulations reproduce the rate-independent rheology (e.g. [4, 5]), providing (i) corroboration of the experimental result; (ii) a source of particle-resolved data inaccessible experimentally; and (iii) a platform for examining systematically more complex microphysics, for instance particle inertia [6] (accepting that the forces as written below apply strictly only in the viscous limit), stress-induced friction [7] and adhesion [8]. Many simulation techniques and codes are available, and we do not review these here. In what follows, we describe how to generate numerical rheology data consistent with the rate-independent result using LAMMPS [9, 10].

The simulation technique shares many details with traditional molecular dynamics, and the reader is expected to be familiar with basic concepts including contact detection, neighbour listing, timestepping and so on. Our specific model is more commonly labelled as a ‘discrete element method’ owing to its similarity to approaches used in granular physics, specifically the absence of thermal forces and the inclusion of particle–particle friction (both appropriate for the size range mentioned above). The basic approach for obtaining a numerical rheology measurement is to (i) initialise the system with a packing of non-overlapping spherical particles of desired size distribution at a desired volume fraction \(\phi \); (ii) evaluate the trajectory of each particle i by numerically solving “\(F=ma\)” in the presence of a prescribed background fluid velocity gradient \(\nabla \varvec{u}^\infty \) and a set of pairwise hydrodynamic and contact interactions. (We assume \(\phi \gtrsim 0.4\) throughout, otherwise a more detailed account of the hydrodynamics is required.) When desired, a bulk stress tensor is calculated from the interaction forces and particle positions, thus generating rheology data, viz. the stress as a function of deformation rate \(\mathbb {E}\) (with \(\mathbb {E}\equiv \frac{1}{2}(\nabla \varvec{u}^\infty + {\nabla \varvec{u}^\infty }^\textrm{T}\))) and volume fraction \(\phi \).

2 Dimensional analysis for rate-independent suspensions

It is instructive to consider first a dimensional analysis. This introduces the quantities (and their units) that we will define when setting up a simulation. We consider a dense, granular (so we omit \(k_bT\) from the following) suspension of stiff spheres under a flow with imposed deformation rate. The principle particle properties (these set the length, mass and time scales) are the characteristic particle radius a [length], the particle density \(\rho \) [mass/length\(^3\)] (taken throughout to be equal to the fluid density so that the particles are neutrally buoyant), and the particle normal stiffness \(k_n\) [mass/time\(^2\)] (this has a tangential counterpart \(k_t\)). With respect to these quantities, 1 time unit corresponds to the inverse frequency of a mass \(\rho a^3=1\) on a linear spring with stiffness \(k_n=1\). The remaining material properties to be defined are the fluid viscosity \(\eta _\textrm{f}\) [mass/(length\(\times \)time)] and the particle–particle friction coefficient \(\mu \) [dimensionless], relevant for micron-sized (and larger) particles. The relevant macroscopic quantities are the size of the simulation box L [length] and the volume fraction \(\phi \) [dimensionless] therein. The background fluid flow is characterised by a velocity field \(\varvec{u}^\infty \) [length/time] and its gradient (a tensor) \(\nabla {\varvec{u}}^\infty \) [1/time] (that we specify, and take to be spatially uniform), the time t for which the flow was applied, and a stress tensor [mass/(time\(^2\times \)length)] (that we measure). We write a scalar velocity gradient as \(\dot{\gamma }\) (\(\equiv \partial u_x/\partial y\)) and a scalar stress as \(\Sigma _{xy}\) (the xy component of ). A list (others are possible) of non-dimensional parameters necessary to fully define a given suspension under given flow conditions is then:

$$\begin{aligned}{} & {} (i) \,\, a/L \quad (ii) \,\,\dot{\gamma } \sqrt{\rho a^3/k_n} \quad (iii) \,\,\rho \dot{\gamma }a^2/\eta _\textrm{f} \\{} & {} (iv) \,\,\mu \quad (v) \,\,\phi \quad (vi) \,\,\eta _r \equiv \Sigma _{xy}/\eta _\textrm{f}\dot{\gamma } \quad (vii) \,\,\dot{\gamma }t \end{aligned}$$

Setting (i)–(iii) to be \(\ll 1\) ensures, respectively, bulk conditions, stiff particles and no particle inertia. Under these conditions, and assuming \(\mu \) is constant (i.e. particle friction is Coulombic) and we shear to steady state (\(\dot{\gamma }t\rightarrow \infty \)), we have simply that \(\eta _r=\eta _r(\phi )\), hence the label ‘rate-independent’. This is consistent with the result of Boyer et al. [2] and will be the focus of our example below.

3 Particle-level forces and shearing

Fig. 1
figure 1

Particle-level physics in a simplified dense suspension. a A particle (radius \(a_i\), position \(\varvec{x}_i\), velocity \(\varvec{u}_i\)) in a fluid with streaming velocity \(\varvec{u}^\infty \); b pairwise lubrication interaction showing [i] particle velocities \(\varvec{u}_i\), \(\varvec{u}_j\), centre-to-centre vector \(\varvec{r}_{ij}\) and surface separation h; [ii] relative velocity \((\varvec{u}_j-\varvec{u}_i)\) and its components normal \((\varvec{u}_j-\varvec{u}_i)_n\) and tangential \((\varvec{u}_j-\varvec{u}_i)_t\) to \(\varvec{r}_{ij}\); c contact force showing [i] particles approaching; [ii] particles entering contact with overlap \(\delta \) and initiation of sliding with \(\varvec{\xi }=0\); [iii] contact with overlap \(\delta \) and accumulated, nonzero, tangential stretch \(\varvec{\xi }\). d Subjecting the suspension to a steady simple shear. Shown are increments of the strain (\(\dot{\gamma }t=0\) [i], 0.45 [ii], 0.55 [iii], 1 [iv]) illustrating the remapping procedure used by LAMMPS. e Reduced viscosity \(\Sigma _{xy}/\eta _\textrm{f}\dot{\gamma }\) as a function of the accumulated strain \(\dot{\gamma }t\) for three volume fractions. f and g Stress ratio \(\Sigma _{xy}/\Sigma _{yy}\) and volume fraction \(\phi \) as functions of the viscous number [2] for four parameter sets (see legends of f and g)

Rate-independent rheology is obtained by subjecting particles to three types of force and torque: Stokes drag, pairwise lubrication and pairwise contact. The full form of these is reported by several authors [5, 11,12,13] and need not be repeated here. Instead, we describe the forces in simplified terms.

The Stokes drag (Fig. 1a) on particle i (radius \(a_i\)) is proportional to the difference between its velocity \(\varvec{u}_i\) and the fluid streaming velocity at its centre \(\varvec{u}^\infty (\varvec{x}_i)\):

$$\begin{aligned} \varvec{F}^{d}_i = -6\pi \eta _\textrm{f}a_i(\varvec{u}_i - \varvec{u}^\infty (\varvec{x}_i)) \text {.} \end{aligned}$$
(1)

This force is essentially what induces flow in the simulation, causing particles to conform to the streaming velocity set by \(\varvec{u}^\infty \). Similarly, a torque acts to cause the particles to rotate with angular velocity \((\varvec{\Omega }_i)\), set by \((\varvec{\Omega }^\infty =\frac{1}{2}(\nabla \times \textbf{u}^\infty ))\), as \((\varvec{\Gamma }^d_i=-8\pi \eta _\textrm{f}a_i^3(\varvec{\Omega }_i-{\varvec{\Omega }}^\infty ))\). Neighbouring particles i and j with centre-to-centre vector \(\varvec{r}_{i,j}\) (Fig. 1(b)[i]) experience lubrication forces (see [14, 15]) dependent on the gap h between them and their relative velocity (Fig. 1(b)[ii]). The leading term of the force on particle i (assuming it has equal radius to particle j) scales with 1/h and the normal component of the pairwise velocity difference:

$$\begin{aligned} \varvec{F}^l_{i,j} = \frac{3}{2}\pi a_i^2 \eta _\textrm{f}\frac{1}{h}(\varvec{u}_j - \varvec{u}_i)_n \text {,} \end{aligned}$$
(2)

while the leading term of the torque is:

$$\begin{aligned} \varvec{\Gamma }^l_{i,j} = -\pi a_i^2 \eta _\textrm{f}\ln \left( \frac{a_i}{h}\right) (\varvec{u}_j - \varvec{u}_i) \times \varvec{r}_{i,j}/|\varvec{r}_{i,j}| \text {.} \end{aligned}$$
(3)

The lubrication forces oppose relative motion between particle pairs. They are prevented from diverging at contact by setting a lower limit on the allowed value of h (typically \(\mathcal {O}(10^{-3}a_i)\)) and are cut off at an outer distance of \(0.05a_i\). At the volume fractions of interest, all particles have multiple neighbours within this range, so that setting a larger cut-off does not significantly affect the result. Overlapping particle pairs i and j (Fig. 1(c)[i]) experience repulsive contact forces dependent upon the scalar overlap \(\delta \) (Fig. 1(c)[ii]) and the tangential displacement accumulated over the duration of the contact \(\varvec{\xi }\) (Fig. 1(c)[iii]):

$$\begin{aligned} \varvec{F}^c_{i,j} = k_n\delta \varvec{r}_{i,j}/|\varvec{r}_{i,j}| - k_t\varvec{\xi } \text {,} \end{aligned}$$
(4)

with the torque given by

$$\begin{aligned} \varvec{\Gamma }^c_{i,j} = a_ik_t(\varvec{r}_{i,j}/|\varvec{r}_{i,j}| \times \varvec{\xi }) \text {.} \end{aligned}$$
(5)

The friction coefficient \(\mu \) sets an upper bound on \(\varvec{\xi }\) through \(|\varvec{\xi }|\le \mu k_n\delta /k_t\).

The stress contribution from drag forces is proportional to \(\mathbb {E}\). The \(\alpha ,\beta \) component of the stress due to lubrication and contact is found, respectively, by summing \((F^{l,\alpha }_{i,j}r^\beta _{i,j} + F^{l,\beta }_{i,j}r^\alpha _{i,j})/2\) and \(F^{c,\alpha }_{i,j}r^\beta _{i,j}\) over all pairs. The forces are summed on each particle, and the trajectories are then updated according to Newtonian dynamics, using a numerical scheme with timestep chosen to be small compared to \(\sqrt{\rho a^3/k_n}\) and \(\rho a^2/\eta _\textrm{f}\).

In LAMMPS, the simulation box deforms according to the specified \(\nabla {\varvec{u}}^\infty \). For instance, when the only nonzero element of \(\nabla {\varvec{u}}^\infty \) is an off-diagonal, shearing is applied by tilting the triclinic box (at fixed volume) according to \(L_\text {xy}(t) = L_\text {xy}(t_0) + L_y\dot{\gamma }t\), Fig. 1(d). When the strain (\(\gamma =\dot{\gamma }t\)) reaches 0.5 in this example, the system is remapped to a strain of \(-\)0.5. This has no effect on the particle–particle forces or on the stress and is simply a numerical tool to permit unbounded shear deformation while preventing the domain from becoming elongated in one axis.

4 LAMMPS inputs and outputs

The above physics are implemented in LAMMPS (Large-scale Atomic/Molecular Massively Parallel Simulator) [9], a classical molecular dynamics code written in C++. The LAMMPS documentation should be referred to at all times [10]. A skeletal set of instructions for downloading and compiling LAMMPS and running the scripts below is provided at Ref [16]. Our strategy is to separate the generation and shearing of suspensions into two distinct simulations. The first defines dimensionless numbers (i) and (v) above, producing non-overlapping particle packings in a cuboidal, periodic domain of fixed \(\phi \); the second defines (ii), (iii), (iv) and (vii) then applies the deformation allowing us to measure (vi). This decomposition allows one to build a library of configurations at different \(\phi \) that can be reused many times for different deformation protocols. LAMMPS takes as its input a text file containing a list of commands and their arguments. In the following, we don’t describe each of these in detail, but instead provide minimal scripts, indicating where the physics above enters. Each of the commands is fully described in the LAMMPS documentation [10].

figure a

Creating particle packings.– For the time being, it isn’t necessary to specify the ‘full’ physics described above, nor do we need to output the stresses. Rather, we need just enough detail to create assemblies of non-overlapping particles. We therefore omit lubrication forces at this stage for simplicity. We first generate particles (of two types, each having a different radius) with random coordinates in a box of set dimensions. Their overlaps generate contact forces (following Eq. 4) that lead to motion; damping against a stationary background fluid (i.e. \(\varvec{u}^\infty =0\) in Eq. 1) extracts energy until the system comes to rest. The properties of the configuration of particles produced by this script don’t really matter: we are not trying to sample an ‘equilibrium’ configuration (this is not relevant for granular systems) but simply create a packing with no (or minimal) overlaps. Shown in the in.create panel is an example input script (‘#’ indicates comments) to generate a suspension with \(\phi =0.5\).

Highlighted in red from top to bottom are (with units as stated earlier): (i) the size of the cubic simulation box \(L = 14.6381\); (ii) the numbers and radii of particles of types 1 and 2: \(N_1=N_2=100\), \(2a_1 = 2\) and \(2a_2=2.8\), thus setting the volume fraction as \(\phi ={4/3}\pi (N_1 a_1^3 + N_2 a_2^3)/L^3=0.5\); (iii) the particle density \(\rho \); (iv) the particle stiffness \(k_n=10000\) (with \(k_t=7k_n/10\)); (v) the particle–particle friction coefficient \(\mu =0.1\); (vi) the timestep; (vii) the fluid viscosity \(\eta _\textrm{f}=0.1\) (the number we put in the script is \(6\pi \eta _\textrm{f}a\)); (viii) the number of timesteps to run. Highlighted in blue are the seeds used to generate the initial particle positions. New realisations can be generated by rerunning the simulation with different numbers here. This script produces data.file, containing a snapshot of the system after the final timestep, to be read in by future scripts. The file contains a list of the particle ID, diameter, density, coordinates (x, y, z) and velocity components. It also produces a dump file (create.dump) that can be visualised using, for example, Ovito [17].

Shearing particle packings.– The second script (in.run, see panel below) takes data.file as an input and applies a deformation to the sample. The key inputs to this script are the parameters related to the particle–particle interaction (\(k_n\), \(k_t\), \(\mu \) and \(\eta _\textrm{f}\)) and the shear rate, set by specifying the components of \(\nabla \varvec{u}^\infty \). Through these, we set the values of dimensionless control parameters (ii), (iii), (iv) and (vii) listed above.

figure b

The remaining content of the input script is concerned with specifying the bulk stress calculation and requesting it as an output, necessary for obtaining (vi).

Highlighted from top to bottom (units as before) are the fluid viscosity \(\eta _\textrm{f} = 0.1\), the particle stiffness \(k_n=10000\) (\(k_t=7000\)) and friction coefficient \(\mu =0.1\) and the shear rate \(\dot{\gamma }=0.001\). Using the command fix deform we have specified just the xy component of \(\nabla \varvec{u}^\infty \), \(\dot{\gamma }\) as defined above. The other components are 0 by default, so this leads to a simple shear with flow in x and gradient in y i.e. \(\varvec{u}^\infty = (\dot{\gamma }y,0,0)\). The script runs at this \(\dot{\gamma }\) for 30000000 timesteps, each of duration 0.0001. Thus, the total shear strain is \(\dot{\gamma }t = 0.001\times 30000000\times 0.0001 = 3\). Note that the fix viscous command is not required here because the drag force is applied within the lubrication pair style.

Outputs from shearing simulation.– There are two different types of output produced by LAMMPS during a simulation run, log files and dump files. Log files are typically described as containing thermodynamic data, but for our purposes we can interpret this as bulk suspension or derived properties, usually the components of the stress tensor , but also e.g. the average particle contact number. As specified in in.run above, the log file (run.log) contains the accumulated simulation time t, followed by the 6 unique components of the stress tensor in order (xx, yy, zz, xy, xz, yz), output every 10000 timesteps (specified by the thermo command):

figure c

These stress components have units [mass/(time\(^2\times \)length)]. In order to express in dimensionless units (the “reduced viscosity” as it is conventionally represented) for comparison to experimental data, one must divide by \(\eta _\textrm{f}\dot{\gamma }\) (and off-diagonals must be multiplied by \(-1\)). Shown in Fig. 1(e) is a plot of the reduced viscosity as a function of the accumulated strain. The reduced viscosity is in this instance taken simply as the xy component of the stress (\(\Sigma _{xy}\), the 4th column of the stress outputs in the log file) divided by \(\eta _\textrm{f}\dot{\gamma }\). whereas the strain is the accumulated time t multiplied by \(\dot{\gamma }\). From the content of the log file, one might also compute, e.g. the viscous number \(\eta _\textrm{f}\dot{\gamma }/P\) (with P the mean of the diagonal components of (\(\Sigma _{xx}\), \(\Sigma _{yy}\), \(\Sigma _{zz}\)), the normal stress differences \(\Sigma _{xx}-\Sigma _{yy}\), \(\Sigma _{yy}-\Sigma _{zz}\) and so on.

Dump files contain particle-level information (positions, velocities, radii) or contact-level information (forces, relative positions), usually output at fixed intervals. In the script above this is specified (by the \(\texttt {dump}\) command) to be every 10000 timesteps. This example script produces run.dump, which lists the particle IDs, positions and radii at specified time intervals. This file might be used for post-processing, for instance, to compute structural properties, to follow particle trajectories or to be read directly into various visualisation packages (Fig. 1(d) was generated using Ovito [17], for instance).

figure d

By repeating this pair of simulations at a range of \(\phi \) (achieved by changing the value of L in in.create) and taking time (and ensemble) averages of the components of , one can reproduce the rate-independent rheology of Boyer et al. [2], as demonstrated in Fig. 1(f)-(g). Moreover, one may relax the conditions specified in the dimensional analysis to explore additional physics: (i) introducing particle inertia by increasing the value of \(\rho \dot{\gamma }a^2/\eta _\textrm{f}\); (ii) introducing particle softness by increasing the value of \(\dot{\gamma } \sqrt{\rho a^3/k_n}\), and so on.

5 Closing remarks

We have provided a brief description of how to use the molecular dynamics code LAMMPS to generate dense, granular suspension rheology data. Examples of the use of this approach to study the physics of dense suspensions can be found in Refs [18,19,20,21,22,23]. Moreover, the flexibility of the code allows one to simulate more complex geometries (such as extrusion [24]), both within LAMMPS [25, 26] and within derivative codes such as LIGGGHTS [27]. Suspensions of broad polydispersity might be simulated using more complex pairwise hydrodynamics such as those described by [28], while rate-dependence can be introduced via the introduction of appropriate microscopic physics such as Brownian motion, adhesion or stress-dependent friction.

C.N. acknowledges support from the Royal Academy of Engineering under the Research Fellowship scheme, and useful discussions with many collaborators and students. The author declares that they have no conflict of interest. Contact: chris.ness@ed.ac.uk.