A simulation of a sheared fluid between walls is disturbed by the layering of particles at the walls, and a thermostat that applies a drag to the velocity of each particle damps the flow itself. Lees and Edwards (1972) removed the walls with periodic boundaries that move with the shear. In dissipative particle dynamics, in the form given by Español and Warren (1995), the thermostat acts on the relative velocities of pairs of particles, so that momentum is conserved.
The second subject is shear thickening. A dense suspension such as cornstarch in water flows easily at low stress and becomes very viscous above a characteristic stress . In the model of Wyart and Cates (2014) the stress pushes particles into frictional contact, which lowers the volume fraction at which the suspension jams. Depending on the volume fraction, the viscosity rises continuously, jumps, or diverges.
Learning objectives¶
Implement Lees–Edwards boundary conditions, which shift the position and the velocity of a particle that crosses the boundary in the gradient direction.
Check the relation between the random and the dissipative forces of dissipative particle dynamics, and the conservation of momentum.
Compute the flow curves of the Wyart–Cates model and distinguish continuous shear thickening, discontinuous shear thickening () and jamming.
Simulate a two-dimensional suspension of particles with lubrication forces and frictional contacts, with and without friction.
Time: about 60 min
try: # use the installed package, or the copy in this repository
import engcomprheo
except ImportError:
import pathlib, subprocess, sys
for _root in [pathlib.Path.cwd(), *pathlib.Path.cwd().parents]:
if (_root / "engcomprheo" / "__init__.py").exists():
sys.path.insert(0, str(_root))
break
else: # on Google Colab: install from GitHub
subprocess.run([sys.executable, "-m", "pip", "install", "-q",
"git+https://github.com/ktwyw/engcomprheo.git"], check=True)
import engcomprheo
import inspect
import math
import numpy as np
import matplotlib.pyplot as plt
from engcomprheo import (brownian_chains, constants_benchmarks, entangled_tubes, mesoscopic_suspensions_dpd,
microrheology_rheoml, shear_banding_instabilities, tensors_kinematics,
viscoelastic_fvm_2d, viscoplastic_admm)
from engcomprheo.plotting import label_panels, log_ticks, panel_label, use_style
use_style()
trapezoid = getattr(np, "trapezoid", None) or np.trapz # NumPy 2 renamed trapz to trapezoid
def show_source(obj):
"""Return the source code of a function or class of the package."""
return inspect.getsource(obj)
def heading(text):
print(f"\n{text}\n" + "=" * len(text))1. Lees–Edwards boundaries and dissipative particle dynamics¶
Homogeneous shear, with the mean velocity , can be simulated in a periodic box of size without walls. Lees and Edwards (1972) let the periodic images of the box above and below it move with the velocities , so that after the time they are displaced by the strain times :
The work of shearing heats the fluid, and a thermostat has to remove the heat without changing the momentum. In dissipative particle dynamics, in the form given by Español and Warren (1995), all forces act between pairs of particles closer than a cut-off and are equal and opposite, :
where . The relation between the amplitudes of the random and the dissipative forces makes the equilibrium distribution that of the temperature .
heading("Demonstration 1: Lees-Edwards boundaries and dissipative particle dynamics in shear")
# 1. Exact check of Lees-Edwards cross-boundary displacement & velocity jump:
r_le, v_le = mesoscopic_suspensions_dpd.lees_edwards_minimum_image(
pos_i=np.array([1.2, 6.8]), pos_j=np.array([1.2, 0.3]),
vel_i=np.array([4.2, 0.0]), vel_j=np.array([0.0, 0.0]),
box_L=7.0, shear_rate=0.6, strain_gamma=0.25
)
print(f"Cross-boundary LE minimum image: r_ij = {np.round(r_le, 4)}, v_ij = {np.round(v_le, 4)}")
# 2. Simulate 2-D DPD fluid under steady Lees-Edwards simple shear:
dpd_res = mesoscopic_suspensions_dpd.simulate_dpd_shear_2d(
n_particles=72, box_L=6.2, shear_rate=0.65, a_rep=15.0, gamma_diss=4.5, kT_target=1.0, dt=0.02, n_steps=180, seed=42
)
corr_vx = float(np.corrcoef(dpd_res["y_bins"], dpd_res["velocity_profile_x"])[0, 1])
print(f"Mean kinetic temperature <kT_kin> (target 1.00) : {dpd_res['kinetic_temperature_mean']:.4f}")
print(f"Total peculiar momentum drift ||sum p_pec|| : {dpd_res['momentum_drift_norm']:.3e}")
print(f"Linear shear profile correlation r(y, vx) : {corr_vx:.4f}")
print(f"Irving-Kirkwood DPD shear viscosity eta : {dpd_res['shear_viscosity']:.4f}")
assert np.allclose(r_le, np.array([-1.75, -0.5]), atol=1e-12)
assert np.allclose(v_le, np.array([0.0, 0.0]), atol=1e-12)
assert dpd_res["momentum_drift_norm"] < 1e-11
assert 0.80 <= dpd_res["kinetic_temperature_mean"] <= 1.25
assert corr_vx > 0.92
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(10.6, 3.9))
ax1.plot(dpd_res["expected_linear_vx"], dpd_res["y_bins"], "k--", lw=1.9, label="Exact, $\\dot{\\gamma}(y - L/2)$")
ax1.plot(dpd_res["velocity_profile_x"], dpd_res["y_bins"], "o-", color="#2166AC", lw=2.2, ms=6, label="Lees-Edwards DPD streaming velocity")
ax1.set_xlabel("Mean velocity $\\langle v_x\\rangle(y)$")
ax1.set_ylabel("Vertical coordinate y")
ax1.set_title(r"Mean velocity profile")
ax1.legend(fontsize=8.0)
# Illustrate sliding-brick image shifts across strain gamma in [0, 1):
gammas = np.linspace(0.0, 0.95, 30)
dx_shifts = [mesoscopic_suspensions_dpd.lees_edwards_minimum_image([1.0, 6.9], [1.0, 0.1], [0.0, 0.0], [0.0, 0.0], 7.0, 0.65, float(g))[0][0] for g in gammas]
ax2.plot(gammas, dx_shifts, "s-", color="#0F766E", ms=4.2, lw=2.0)
ax2.axhline(0.0, color="k", ls=":", lw=1.1)
ax2.set_xlabel("Shear strain $\\gamma = \\dot{\\gamma}t$")
ax2.set_ylabel("Minimum-image horizontal shift $r_{ij,x}$")
ax2.set_title(r"Horizontal separation of a pair across the boundary")
label_panels(fig)
plt.show()
Demonstration 1: Lees-Edwards boundaries and dissipative particle dynamics in shear
===================================================================================
Cross-boundary LE minimum image: r_ij = [-1.75 -0.5 ], v_ij = [0. 0.]
Mean kinetic temperature <kT_kin> (target 1.00) : 1.0722
Total peculiar momentum drift ||sum p_pec|| : 4.420e-15
Linear shear profile correlation r(y, vx) : 0.9798
Irving-Kirkwood DPD shear viscosity eta : 0.3589

Figure 15.1. (a) Mean velocity of the particles against height in a sheared box with Lees–Edwards boundaries, with the imposed linear profile. (b) Horizontal component of the minimum-image separation of a pair across the moving boundary against strain.
2. The thermostat and the viscosity¶
The friction coefficient and the noise amplitude affect two quantities differently:
The kinetic temperature, , computed from the velocities relative to the mean flow, stays at the target value whatever .
The viscosity, computed from the stress with the Irving–Kirkwood expression, increases with through the contribution of the dissipative forces. The total momentum relative to the mean flow stays below 10-11 for all parameter values.
heading("Demonstration 2: temperature and viscosity of the dissipative particle dynamics fluid")
gam_vals = [2.0, 4.5, 8.5]
kt_meas, visc_meas, drift_meas = [], [], []
for gd in gam_vals:
r_g = mesoscopic_suspensions_dpd.simulate_dpd_shear_2d(
n_particles=64, box_L=6.0, shear_rate=0.60, a_rep=15.0, gamma_diss=gd, kT_target=1.20, dt=0.018, n_steps=160, seed=17
)
kt_meas.append(r_g["kinetic_temperature_mean"])
visc_meas.append(r_g["shear_viscosity"])
drift_meas.append(r_g["momentum_drift_norm"])
print(f"gamma_diss = {gd:4.1f} | <kT_kin> = {kt_meas[-1]:.4f} (target 1.20) | eta = {visc_meas[-1]:.4f} | mom_drift = {drift_meas[-1]:.2e}")
assert all(d < 1e-11 for d in drift_meas)
assert all(0.95 <= kt <= 1.45 for kt in kt_meas)
assert visc_meas[2] > visc_meas[0]
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(10.5, 3.9))
ax1.plot(gam_vals, kt_meas, "o-", color="#2166AC", lw=2.2, ms=6.5, label="Measured from peculiar velocities")
ax1.axhline(1.20, color="#C0392B", ls="--", lw=1.8, label="Target $k_BT = 1.20$ ($\\sigma^2 = 2\\gamma k_BT$)")
ax1.set_ylim(0.7, 1.6)
ax1.set_xlabel("Dissipative coupling $\\gamma_{\\mathrm{DPD}}$")
ax1.set_ylabel("Kinetic temperature $k_B T$")
ax1.set_title(r"Kinetic temperature")
ax1.legend(fontsize=8.1)
ax2.bar([f"$\\gamma$ = {g}" for g in gam_vals], visc_meas, color=["#A9C9E8", "#A9C9E8", "#1F2933"], width=0.50)
ax2.set_ylabel("Irving-Kirkwood shear viscosity $\\eta$")
ax2.set_title(r"Shear viscosity")
label_panels(fig)
plt.show()
Demonstration 2: temperature and viscosity of the dissipative particle dynamics fluid
=====================================================================================
gamma_diss = 2.0 | <kT_kin> = 1.1904 (target 1.20) | eta = 0.3661 | mom_drift = 2.05e-14
gamma_diss = 4.5 | <kT_kin> = 1.1275 (target 1.20) | eta = 0.3455 | mom_drift = 2.59e-14
gamma_diss = 8.5 | <kT_kin> = 1.2797 (target 1.20) | eta = 0.4532 | mom_drift = 1.43e-14

Figure 15.2. Dissipative particle dynamics at three friction coefficients, with . (a) Kinetic temperature against the target 1.2. (b) Shear viscosity from the stress.
3. The Wyart–Cates model of shear thickening¶
In a dense suspension, with a volume fraction above about 0.45 (as in the assumed parameter set BENCHMARK_FLUIDS_DB["SILICA_DST"]), a short-range repulsion between the particles keeps them apart at low stress; is the stress needed to overcome it. At low stress the particles are lubricated, and the viscosity diverges only at the jamming fraction of frictionless particles, . When the stress exceeds , particles come into frictional contact, and the jamming fraction decreases towards that of frictional particles, (Wyart and Cates, 2014):
The flow curve has three forms, depending on :
Continuous shear thickening, at moderate : everywhere, and the viscosity rises smoothly from a low to a high plateau.
Discontinuous shear thickening, for : the curve is S-shaped, with over a range of stress, and the stress jumps when the shear rate is controlled.
Shear jamming, for : the suspension flows at low stress, and at a finite stress the jamming fraction falls to ; the viscosity diverges and the flow stops.
heading("Demonstration 3: Wyart-Cates flow curves: continuous thickening, discontinuous thickening and jamming")
dst_db = constants_benchmarks.BENCHMARK_FLUIDS_DB["SILICA_DST"]
taus = np.logspace(-0.5, 3.0, 180)
phi_cases = [0.46, 0.51, dst_db["phi"], 0.565] # 0.54 == SILICA_DST
wc_runs = {}
for ph in phi_cases:
wc_runs[ph] = mesoscopic_suspensions_dpd.wyart_cates_dst_flow_curve(
taus, phi=ph, phi_0=dst_db["phi_0_frictionless"], phi_m=dst_db["phi_m_frictional"],
tau_star=dst_db["tau_star_Pa"], eta_f=dst_db["eta_f_Pas"]
)
finite_eta = wc_runs[ph]["viscosity"][np.isfinite(wc_runs[ph]["viscosity"])]
jam_str = "shear jamming (eta = inf)" if not np.all(np.isfinite(wc_runs[ph]["viscosity"])) else f"max eta = {np.max(finite_eta):.2f} Pa*s"
print(f"phi = {ph:.3f} | S-shaped DST = {str(wc_runs[ph]['is_s_shaped_dst']):5s} | {jam_str}")
assert not wc_runs[0.46]["is_s_shaped_dst"]
assert wc_runs[dst_db["phi"]]["is_s_shaped_dst"]
assert math.isinf(float(wc_runs[0.565]["viscosity"][-1]))
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(10.8, 4.1))
cols_w = ["#A9C9E8", "#0F766E", "#E08214", "#C0392B"]
for ph, col in zip(phi_cases, cols_w):
gd = wc_runs[ph]["shear_rate"]
et = wc_runs[ph]["viscosity"]
mask = np.isfinite(et) & (gd > 1e-3)
tag = "CST" if ph < 0.52 else ("S-curve DST" if ph < 0.55 else "Shear jamming")
ax1.loglog(gd[mask], taus[mask], color=col, lw=2.3, label=f"$\\phi$ = {ph:.3f} ({tag})")
ax2.loglog(gd[mask], et[mask], color=col, lw=2.3, label=f"$\\phi$ = {ph:.3f}")
ax1.axhline(dst_db["tau_star_Pa"], color="k", ls=":", lw=1.3, label=f"Stress $\\tau^*$ = {dst_db['tau_star_Pa']} Pa")
ax1.set_xlabel("Shear rate $\\dot{\\gamma}$ [1/s]")
ax1.set_ylabel("Shear stress $\\tau$ [Pa]")
ax1.set_title(r"Shear stress against shear rate")
ax1.legend(fontsize=7.8, loc="upper center", bbox_to_anchor=(0.5, -0.2), ncol=2, frameon=False)
ax2.set_xlabel("Shear rate $\\dot{\\gamma}$ [1/s]")
ax2.set_ylabel("Apparent viscosity $\\eta$ [Pa s]")
ax2.set_title(r"Viscosity against shear rate")
ax2.legend(fontsize=8.0, loc="upper center", bbox_to_anchor=(0.5, -0.2), ncol=2, frameon=False)
label_panels(fig)
plt.show()
Demonstration 3: Wyart-Cates flow curves: continuous thickening, discontinuous thickening and jamming
=====================================================================================================
phi = 0.460 | S-shaped DST = False | max eta = 0.36 Pa*s
phi = 0.510 | S-shaped DST = False | max eta = 1.76 Pa*s
phi = 0.540 | S-shaped DST = True | max eta = 22.59 Pa*s
phi = 0.565 | S-shaped DST = True | shear jamming (eta = inf)

Figure 15.3. Wyart–Cates model with the parameters of SILICA_DST (assumed) at four volume fractions. (a) Shear stress against shear rate; the curve bends back for , and for the rate returns to zero at high stress. (b) Viscosity against shear rate.
4. A particle simulation with lubrication and friction¶
A particle simulation can test the Wyart–Cates model without assuming a constitutive law. The function mesoscopic_suspensions_dpd.simulate_frictional_suspension_2d follows, in two dimensions and in simplified form, the simulations of Seto, Mari, Morris and Denn (2013). Discs of two radii, 1.0 and 1.4, which do not crystallize, move in a box with Lees–Edwards boundaries and interact through three forces:
a lubrication force that resists the approach of two particles, ;
an elastic contact force , which acts when the normal load exceeds the repulsive force ;
a tangential spring limited by Coulomb friction, .
The demonstration compares with frictionless particles, , from the same initial configuration and the same random numbers, so that the difference between the two runs is due to friction.
heading("Demonstration 4: a two-dimensional suspension with and without friction")
rates_dem = np.array([0.20, 1.0, 4.5, 20.0])
susp_rough = mesoscopic_suspensions_dpd.simulate_frictional_suspension_2d(
rates_dem, phi=0.53, mu_friction=1.0, tau_repulsive=8.0, n_particles=28, n_steps=135, seed=10
)
susp_smooth = mesoscopic_suspensions_dpd.simulate_frictional_suspension_2d(
rates_dem, phi=0.53, mu_friction=0.0, tau_repulsive=8.0, n_particles=28, n_steps=135, seed=10
)
print(f"Frictional (mu = 1.0) relative viscosity : {np.round(susp_rough['viscosity_rel'], 2)} -> jump = {susp_rough['dst_jump_ratio']:.2f}x")
print(f"Smooth (mu = 0.0) relative viscosity : {np.round(susp_smooth['viscosity_rel'], 2)} -> jump = {susp_smooth['dst_jump_ratio']:.2f}x")
print(f"Frictional contact fraction f_fric : {np.round(susp_rough['frictional_contact_fraction'], 3)}")
assert susp_rough["dst_jump_ratio"] > 1.35
assert susp_rough["dst_jump_ratio"] > susp_smooth["dst_jump_ratio"]
assert float(susp_rough["frictional_contact_fraction"][-1]) > float(susp_rough["frictional_contact_fraction"][0])
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(10.8, 4.0))
ax1.semilogx(rates_dem, susp_rough["viscosity_rel"], "o-", color="#C0392B", lw=2.3, ms=6.5, label=f"Rough Coulomb contacts ($\\mu$ = 1.0, {susp_rough['dst_jump_ratio']:.2f}x)")
ax1.semilogx(rates_dem, susp_smooth["viscosity_rel"], "s--", color="#2166AC", lw=2.1, ms=6.0, label=f"Frictionless lubrication only ($\\mu$ = 0.0, {susp_smooth['dst_jump_ratio']:.2f}x)")
ax1.set_xlabel("Dimensionless shear rate $\\dot{\\gamma}$")
ax1.set_ylabel("Relative suspension viscosity $\\eta$ / $\\eta_0$")
ax1.set_title(r"Relative viscosity")
ax1.legend(fontsize=8.0)
ax2.semilogx(rates_dem, susp_rough["frictional_contact_fraction"], "^-", color="#0F766E", lw=2.3, ms=6.5, label="Activated frictional contacts ($F_n$ > $F_{\\mathrm{rep}}$)")
ax2.set_ylim(-0.05, 1.05)
ax2.set_xlabel("Dimensionless shear rate $\\dot{\\gamma}$")
ax2.set_ylabel("Frictional contact network fraction $f_{\\mathrm{fric}}$")
ax2.set_title(r"Fraction of frictional contacts")
ax2.legend(fontsize=8.1)
label_panels(fig)
plt.show()
Demonstration 4: a two-dimensional suspension with and without friction
=======================================================================
Frictional (mu = 1.0) relative viscosity : [ 4.02 10.7 16.44 19.26] -> jump = 4.79x
Smooth (mu = 0.0) relative viscosity : [4.02 3.97 3.91 3.91] -> jump = 1.03x
Frictional contact fraction f_fric : [0. 0.326 0.726 0.915]

Figure 15.4. Two-dimensional particle simulation at four shear rates. (a) Relative viscosity with friction (), which rises by a factor 4.8, and without (). (b) Fraction of contacts that carry friction.
Inside the algorithm: minimum image under shear and pairwise forces¶
The cell below prints the source of mesoscopic_suspensions_dpd.lees_edwards_minimum_image and checks in NumPy that Lees–Edwards boundaries combined with symmetric random numbers give pair forces that obey Newton’s third law, so that also for pairs that interact across the sheared boundary.
Check against the package¶
Consider two particles near the upper and the lower boundary, and , which interact through the image shifted by . Exchanging and changes the sign of , and with it the signs of the displacement and of the relative velocity: and , to rounding error (< 1e-15).
heading("Inside the algorithm: minimum image under shear and conservation of momentum")
print(show_source(mesoscopic_suspensions_dpd.lees_edwards_minimum_image))
rng_le = np.random.default_rng(99)
n_p = 32
L_box, gdot_le, strain_le = 5.0, 1.2, 0.37
pos_le = rng_le.uniform(0.0, L_box, size=(n_p, 2))
vel_le = rng_le.normal(0.0, 1.0, size=(n_p, 2))
# Vectorized standalone Lees-Edwards minimum image for all N x N pairs:
dp = pos_le[:, None, :] - pos_le[None, :, :]
dv = vel_le[:, None, :] - vel_le[None, :, :]
cy = np.round(dp[:, :, 1] / L_box)
dp[:, :, 1] -= cy * L_box
dp[:, :, 0] -= cy * ((strain_le * L_box) % L_box)
dp[:, :, 0] -= np.round(dp[:, :, 0] / L_box) * L_box
dv[:, :, 0] -= cy * gdot_le * L_box
# Cross-check pair (0, 1) against library function and check skew-symmetry dp_ij == -dp_ji:
r01, v01 = mesoscopic_suspensions_dpd.lees_edwards_minimum_image(pos_le[0], pos_le[1], vel_le[0], vel_le[1], L_box, gdot_le, strain_le)
r10, v10 = mesoscopic_suspensions_dpd.lees_edwards_minimum_image(pos_le[1], pos_le[0], vel_le[1], vel_le[0], L_box, gdot_le, strain_le)
dist = np.linalg.norm(dp, axis=2)
mask = (dist > 1e-12) & (dist < 1.2)
ehat = np.where(mask[:, :, None], dp / np.maximum(dist[:, :, None], 1e-12), 0.0)
w = np.where(mask, 1.0 - dist / 1.2, 0.0)
z = np.triu(rng_le.normal(0.0, 1.0, size=(n_p, n_p)), 1)
zeta = z + z.T
F_pair = (15.0 * w[:, :, None] - 4.5 * (w**2)[:, :, None] * np.sum(ehat * dv, axis=2, keepdims=True) + 3.0 * w[:, :, None] * zeta[:, :, None]) * ehat
net_force_norm = float(np.linalg.norm(np.sum(F_pair, axis=(0, 1))))
print(f"Pairwise skew-symmetry ||r_01 + r_10|| + ||v_01 + v_10|| : {np.linalg.norm(r01 + r10) + np.linalg.norm(v01 + v10):.3e}")
print(f"Total net DPD force norm ||sum_i F_i|| across LE box : {net_force_norm:.3e}")
assert np.allclose(dp[0, 1], r01, atol=1e-14)
assert np.allclose(r01, -r10, atol=1e-14)
assert net_force_norm < 1e-13
Inside the algorithm: minimum image under shear and conservation of momentum
============================================================================
def lees_edwards_minimum_image(
pos_i: np.ndarray,
pos_j: np.ndarray,
vel_i: np.ndarray,
vel_j: np.ndarray,
box_L: float,
shear_rate: float,
strain_gamma: float,
) -> tuple[np.ndarray, np.ndarray]:
"""Minimum-image displacement r_ij and relative velocity v_ij with the boundary conditions of Lees and Edwards (1972)."""
if box_L <= 0.0:
raise ValueError("Simulation box_L must be > 0.")
L = float(box_L)
rij = np.asarray(pos_i, dtype=float) - np.asarray(pos_j, dtype=float)
vij = np.asarray(vel_i, dtype=float) - np.asarray(vel_j, dtype=float)
# Number of vertical periodic box crossings cy = round(dy / L):
cy = np.round(rij[..., 1] / L)
rij_le = rij.copy()
vij_le = vij.copy()
rij_le[..., 1] -= cy * L
# Top/bottom image bricks are shifted horizontally by strain_gamma * L and move at shear_rate * L
dx_shift = (float(strain_gamma) * L) % L
rij_le[..., 0] -= cy * dx_shift
rij_le[..., 0] -= np.round(rij_le[..., 0] / L) * L
vij_le[..., 0] -= cy * float(shear_rate) * L
return rij_le, vij_le
Pairwise skew-symmetry ||r_01 + r_10|| + ||v_01 + v_10|| : 0.000e+00
Total net DPD force norm ||sum_i F_i|| across LE box : 2.589e-14
Exercises¶
Worked solutions are in 15_solutions.ipynb. The cell below the list is a short self-check to start from.
Verify a result. In the Wyart–Cates model with and , find the volume fraction above which the flow curve is S-shaped (discontinuous shear thickening) and below which the thickening is continuous. Compute the minimum over the stress of for from the analytical derivative, and check the change of sign with
wyart_cates_dst_flow_curve.Find how it fails. Run
simulate_dpd_shear_2dwithn_particles=100, box_L=7.0, shear_rate=0.85, n_steps=260, once with the pairwise thermostat of dissipative particle dynamics and once withunshifted_langevin_bug=True, which applies a drag proportional to the velocity of each particle in the laboratory frame. Compare the conservation of momentum and the deviation of the velocity profile from the imposed linear profile.Implement it yourself. Write a function in NumPy that follows the Wyart–Cates flow curve at () while the shear rate is increased and then decreased, and compute the jump of the viscosity and the area of the hysteresis loop.
heading("Self-check for the exercises")
assert dpd_res["momentum_drift_norm"] < 1e-11
assert wc_runs[dst_db["phi"]]["is_s_shaped_dst"]
assert susp_rough["dst_jump_ratio"] > susp_smooth["dst_jump_ratio"]
assert net_force_norm < 1e-13
print("All checks passed.")
Self-check for the exercises
============================
All checks passed.