Two polyethylene melts with similar zero-shear viscosities can behave very differently in processing. A linear polymer thins in extension, while a polymer with long-chain branches, such as low-density polyethylene, hardens in extension and still thins in shear. Dumbbell models cannot describe the difference, which comes from entanglements and from branch points.
In tube models each molecule is confined by its neighbours to a tube. The original theory of Doi and Edwards predicts a shear stress that decreases with shear rate between the inverse reptation time and the inverse Rouse time, a decrease that experiments on linear melts do not generally show. The Rolie-Poly model of Likhtman and Graham (2003) adds chain stretch and convective constraint release, which removes the decrease. The Pom-Pom model of McLeish and Larson (1998) describes a molecule with arms at each end of a backbone, whose stretch cannot exceed . This lecture integrates both models in the log-conformation form. The parameter sets PS_MELT_RP and LDPE_IUPAC_A are assumed values and are not fitted to measurements.
Learning objectives¶
Distinguish the Weissenberg number of reptation, , from that of chain stretch, (), with
entangled_tubes.solve_rolie_poly.Show how convective constraint release () removes the decrease of the steady shear stress between and .
Compute strain hardening in uniaxial extension and thinning in shear with the Pom-Pom model (
entangled_tubes.solve_pom_pom_melt), in which the stretch is limited by .Find the effect of the number of arms on the extensional and the shear viscosity.
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. Reptation and chain stretch in the Rolie-Poly model¶
In an entangled melt each chain is confined to a tube of segments formed by its neighbours (for the assumed parameter set BENCHMARK_FLUIDS_DB["PS_MELT_RP"], ). The orientation of the tube relaxes slowly, by reptation of the chain along the tube, in the time . The stretch of the chain, , relaxes much faster, in the Rouse time ; here . Likhtman and Graham (2003) reduced the full tube theory to one equation for the conformation tensor, the Rolie-Poly equation:
The two times define three regimes of shear rate, in terms of and :
: the orientation is weak, , and the viscosity is .
and : the tubes orient in the flow while the chains remain almost unstretched.
: the flow stretches the chains faster than they retract, , and the shear and normal stresses overshoot strongly in start-up.
heading("Demonstration 1: start-up of shear of the Rolie-Poly model (PS_MELT_RP)")
ps_db = constants_benchmarks.BENCHMARK_FLUIDS_DB["PS_MELT_RP"]
G0_ps = ps_db["G0_Pa"]
tau_d_ps = ps_db["tau_d_s"]
tau_R_ps = ps_db["tau_R_s"]
# Three canonical shear rates spanning Wi_d < 1, Wi_d > 1 > Wi_R, and Wi_R > 1:
regimes = [
("Reptation (Wi_d=0.5, Wi_R=0.015)", 0.5 / tau_d_ps, "#2166AC"),
("Orientation/CCR (Wi_d=12, Wi_R=0.35)", 12.0 / tau_d_ps, "#E08214"),
("Rouse stretch (Wi_d=72, Wi_R=2.10)", 2.1 / tau_R_ps, "#C0392B"),
]
fig, axes = plt.subplots(1, 2, figsize=(10.2, 4.0))
peak_stretches = []
for label, gdot_val, col in regimes:
t_span = np.linspace(0.0, min(28.0, max(2.5, 10.0 / gdot_val)), 75)
L_fn = lambda _t, g=gdot_val: np.array([[0.0, g, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]])
rp = entangled_tubes.solve_rolie_poly(
L_fn, t_span, G0=G0_ps, tau_d=tau_d_ps, tau_R=tau_R_ps, beta_ccr=ps_db["beta_ccr"], delta_ccr=ps_db["delta_ccr"]
)
eta_plus = rp["tau_xy"] / gdot_val
lam_max = float(np.max(rp["stretch_lambda"]))
peak_stretches.append(lam_max)
strain_axis = gdot_val * t_span
print(f"{label:38s} | peak stretch lambda = {lam_max:5.3f} | steady eta = {eta_plus[-1]:9.1f} Pa*s")
axes[0].loglog(t_span[1:], eta_plus[1:], lw=2.0, color=col, label=label)
axes[1].plot(strain_axis, rp["stretch_lambda"], lw=2.0, color=col, label=label)
# Linear viscoelastic Maxwell envelope G0 * tau_d * (1 - exp(-t / tau_d)):
t_env = np.geomspace(1e-2, 28.0, 120)
axes[0].loglog(t_env, G0_ps * tau_d_ps * (1.0 - np.exp(-t_env / tau_d_ps)), "k--", lw=1.4, label=r"Linear viscoelastic $G_0\tau_d(1-e^{-t/\tau_d})$")
axes[0].set_xlabel("Time $t$ [s]")
axes[0].set_ylabel(r"Transient viscosity $\eta^+(t) = \tau_{xy}/\dot{\gamma}$ [Pa$\cdot$s]")
axes[0].set_title(r"Transient viscosity")
axes[0].legend(fontsize=7.5)
axes[1].set_xlim(0.0, 16.0)
axes[1].set_xlabel(r"Shear strain $\gamma = \dot{\gamma} t$")
axes[1].set_ylabel(r"Tube stretch ratio $\lambda = \sqrt{\operatorname{tr}\mathbf{C}/3}$")
axes[1].set_title(r"Chain stretch")
axes[1].legend(fontsize=7.5)
label_panels(fig)
plt.show()
assert peak_stretches[0] < 1.02
assert peak_stretches[2] > 1.35 * peak_stretches[1]
Demonstration 1: start-up of shear of the Rolie-Poly model (PS_MELT_RP)
=======================================================================
Reptation (Wi_d=0.5, Wi_R=0.015) | peak stretch lambda = 1.002 | steady eta = 1800397.7 Pa*s
Orientation/CCR (Wi_d=12, Wi_R=0.35) | peak stretch lambda = 1.088 | steady eta = 134204.2 Pa*s
Rouse stretch (Wi_d=72, Wi_R=2.10) | peak stretch lambda = 1.530 | steady eta = 27626.4 Pa*s

Figure 7.1. Rolie-Poly model with the parameters of PS_MELT_RP (assumed) in start-up of shear at three rates. (a) Transient viscosity with the linear viscoelastic envelope (dashed). (b) Stretch ratio against strain: it exceeds 1.1 only when .
What Demonstration 1 shows. The three start-up curves follow the linear viscoelastic curve at short times and fall below it once the strain exceeds . A chain stretch appears only when .
2. Convective constraint release and the steady flow curve¶
Without convective constraint release () the tubes orient so strongly at rates between and that decreases with shear rate faster than , and the steady shear stress decreases, . Marrucci (1996) pointed out that when the neighbouring chains retract, at the rate , they remove some of the constraints that form the tube, which relaxes its orientation. In the Rolie-Poly equation this contribution is proportional to , and it makes the flow curve monotonic.
heading("Demonstration 2: steady flow curve with and without convective constraint release")
rates_rp = np.geomspace(0.03, 7.0, 6)
curves_rp = {}
for beta_val in [0.0, 0.5, 1.0]:
txy_list = []
for g in rates_rp:
t_g = np.linspace(0.0, min(30.0, max(3.5, 10.5 / g)), 48)
L_g = lambda _t, gv=g: np.array([[0.0, gv, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]])
out = entangled_tubes.solve_rolie_poly(
L_g, t_g, G0=G0_ps, tau_d=tau_d_ps, tau_R=tau_R_ps, beta_ccr=beta_val, delta_ccr=-0.5
)
txy_list.append(float(out["tau_xy"][-1]))
curves_rp[beta_val] = np.array(txy_list)
min_increment = float(np.min(np.diff(curves_rp[beta_val])))
print(f"beta_CCR = {beta_val:3.1f} | min(delta tau_xy) across rate sweep = {min_increment:+10.1f} Pa | monotonic? {min_increment > 0.0}")
assert np.min(np.diff(curves_rp[0.0])) < -5.0e3
assert np.min(np.diff(curves_rp[0.5])) > 0.0
assert np.min(np.diff(curves_rp[1.0])) > 0.0
fig, ax = plt.subplots(figsize=(7.4, 4.1))
ax.loglog(rates_rp * tau_d_ps, curves_rp[0.0] / 1e3, "s--", color="#C0392B", lw=2.0, label=r"$\beta_{\mathrm{CCR}} = 0.0$ (stress decreases)")
ax.loglog(rates_rp * tau_d_ps, curves_rp[0.5] / 1e3, "o-", color="#2166AC", lw=2.2, label=r"$\beta_{\mathrm{CCR}} = 0.5$ (monotonic)")
ax.loglog(rates_rp * tau_d_ps, curves_rp[1.0] / 1e3, "^-", color="#2E8B57", lw=2.0, label=r"$\beta_{\mathrm{CCR}} = 1.0$ (strong CCR)")
ax.axvspan(1.0, tau_d_ps / tau_R_ps, color="#fdebd0", alpha=0.45, label=r"Window $1 < \mathrm{Wi}_d < \tau_d/\tau_R$")
ax.set_xlabel(r"Reptation Weissenberg number $\mathrm{Wi}_d = \dot{\gamma}\tau_d$")
ax.set_ylabel(r"Steady shear stress $\tau_{xy}$ [kPa]")
ax.set_title(r"Steady shear stress")
ax.legend(fontsize=8)
log_ticks(ax, "y", [60, 100, 200])
plt.show()
Demonstration 2: steady flow curve with and without convective constraint release
=================================================================================
beta_CCR = 0.0 | min(delta tau_xy) across rate sweep = -18462.0 Pa | monotonic? False
beta_CCR = 0.5 | min(delta tau_xy) across rate sweep = +6160.0 Pa | monotonic? True
beta_CCR = 1.0 | min(delta tau_xy) across rate sweep = +12998.7 Pa | monotonic? True

Figure 7.2. Steady shear stress of the Rolie-Poly model against for three values of the constraint-release parameter. With the stress decreases over part of the range (shaded window ); with 0.5 and 1 it increases throughout.
What Demonstration 2 shows. For and the steady shear stress decreases with shear rate, by more than 10 kPa. With the value of PS_MELT_RP the flow curve increases at all rates.
3. Branched molecules: the Pom-Pom model¶
A Pom-Pom molecule consists of a backbone between two branch points, each of which carries arms (assumed parameter set LDPE_IUPAC_A: ). McLeish and Larson (1998) described it with two variables: the orientation tensor of the backbone tube, , which relaxes in the time , and the stretch of the backbone, , which relaxes in the time . The stretch has an upper limit. When the tension in the backbone equals the combined tension of the arms, the arms are drawn into the tube of the backbone, and the stretch cannot exceed :
heading("Demonstration 3: the Pom-Pom model in extension and in shear (LDPE_IUPAC_A)")
ldpe = constants_benchmarks.BENCHMARK_FLUIDS_DB["LDPE_IUPAC_A"]
G0_pp, tb_pp, ts_pp, q_pp = ldpe["G0_Pa"], ldpe["tau_b_s"], ldpe["tau_s_s"], ldpe["q_arms"]
eta0_pp = G0_pp * tb_pp
t_pp = np.linspace(0.0, 8.0, 120)
rate_test = 2.0 # Wi_b = 8.0, Wi_s = 1.2 > 1
L_uni_pp = lambda _t: np.diag([rate_test, -0.5 * rate_test, -0.5 * rate_test])
L_shr_pp = lambda _t: np.array([[0.0, rate_test, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]])
sol_uni = entangled_tubes.solve_pom_pom_melt(L_uni_pp, t_pp, G0=G0_pp, tau_b=tb_pp, tau_s=ts_pp, q_arms=q_pp)
sol_shr = entangled_tubes.solve_pom_pom_melt(L_shr_pp, t_pp, G0=G0_pp, tau_b=tb_pp, tau_s=ts_pp, q_arms=q_pp)
eta_E_t = (sol_uni["tau_p"][:, 0, 0] - sol_uni["tau_p"][:, 1, 1]) / rate_test
eta_S_t = sol_shr["tau_xy"] / rate_test
hardening_factor = float(eta_E_t[-1] / (3.0 * eta0_pp))
thinning_ratio = float(eta_S_t[-1] / eta0_pp)
print(f"Zero-shear viscosity eta_0 = G0*tau_b : {eta0_pp:8.1f} Pa*s (3*eta_0 Trouton = {3*eta0_pp:9.1f} Pa*s)")
print(f"Uniaxial extensional eta_E^+ plateau : {eta_E_t[-1]:8.1f} Pa*s (hardening factor = {hardening_factor:.2f}x over 3*eta_0; lambda = {sol_uni['lambda_stretch'][-1]:.2f} <= q={q_pp})")
print(f"Simple-shear steady viscosity eta : {eta_S_t[-1]:8.1f} Pa*s (thinning ratio = {thinning_ratio:.3f}x of eta_0; lambda = {sol_shr['lambda_stretch'][-1]:.2f})")
assert np.isclose(sol_uni["lambda_stretch"][-1], float(q_pp), rtol=1e-3)
assert hardening_factor > 2.5
assert thinning_ratio < 0.40
fig, axes = plt.subplots(1, 2, figsize=(10.2, 4.0))
axes[0].loglog(t_pp[1:], eta_E_t[1:], color="#C0392B", lw=2.2, label=r"Pom-Pom uniaxial $\eta_E^+(t)$")
axes[0].loglog(t_pp[1:], 3.0 * eta0_pp * (1.0 - np.exp(-t_pp[1:] / tb_pp)), "k--", lw=1.4, label=r"Linear $3\eta_0(1-e^{-t/\tau_b})$")
axes[0].loglog(t_pp[1:], eta_S_t[1:], color="#2166AC", lw=2.2, label=r"Pom-Pom shear $\eta^+(t)$")
axes[0].set_xlabel("Time $t$ [s]")
axes[0].set_ylabel(r"Transient viscosity [Pa$\cdot$s]")
axes[0].set_title(r"Transient viscosities")
axes[0].legend(fontsize=8)
axes[1].plot(t_pp, sol_uni["lambda_stretch"], color="#C0392B", lw=2.2, label="Uniaxial backbone stretch $\\bar{\\lambda}(t)$")
axes[1].plot(t_pp, sol_shr["lambda_stretch"], color="#2166AC", lw=2.2, label="Simple-shear backbone stretch $\\bar{\\lambda}(t)$")
axes[1].axhline(q_pp, color="black", ls=":", lw=1.4, label=f"Limit $q = {q_pp}$")
axes[1].set_xlabel("Time $t$ [s]")
axes[1].set_ylabel(r"Backbone stretch $\bar{\lambda}$")
axes[1].set_title(r"Backbone stretch")
axes[1].legend(fontsize=8)
label_panels(fig)
plt.show()
Demonstration 3: the Pom-Pom model in extension and in shear (LDPE_IUPAC_A)
===========================================================================
Zero-shear viscosity eta_0 = G0*tau_b : 60000.0 Pa*s (3*eta_0 Trouton = 180000.0 Pa*s)
Uniaxial extensional eta_E^+ plateau : 562500.0 Pa*s (hardening factor = 3.12x over 3*eta_0; lambda = 5.00 <= q=5)
Simple-shear steady viscosity eta : 2495.0 Pa*s (thinning ratio = 0.042x of eta_0; lambda = 1.13)

Figure 7.3. Pom-Pom model with the parameters of LDPE_IUPAC_A (assumed) at a rate of . (a) Uniaxial extensional viscosity, which rises above the linear envelope , and shear viscosity, which falls below it. (b) Backbone stretch: it reaches the limit in extension and stays near 1 in shear.
What Demonstration 3 shows. At the same rate the Pom-Pom model hardens by a factor of more than 2.5 in extension and thins to less than 0.40 of the zero-shear viscosity in shear. In uniaxial extension the orientation aligns with the direction of stretching, , and the stretch reaches its limit , so that . In simple shear the rotation of the flow turns away from the axis of extension at ; the stretching term stays small, and decreases as .
4. The effect of the number of arms ¶
The demonstration varies the number of arms, , 3, 5 and 8, and compares the hardening in extension, , with the shear viscosity over a range of rates.
heading("Demonstration 4: the effect of the number of arms q")
q_list = [1, 3, 5, 8]
edot_sweep = np.geomspace(0.20, 4.5, 4)
t_d4 = np.linspace(0.0, 8.0, 44)
fig, axes = plt.subplots(1, 2, figsize=(10.2, 4.0))
max_trouton_by_q = []
for q_v in q_list:
eta_e_curve, eta_s_curve = [], []
for r_val in edot_sweep:
su = entangled_tubes.solve_pom_pom_melt(
lambda _t, rv=r_val: np.diag([rv, -0.5 * rv, -0.5 * rv]),
t_d4, G0=G0_pp, tau_b=tb_pp, tau_s=ts_pp, q_arms=q_v
)
ss = entangled_tubes.solve_pom_pom_melt(
lambda _t, rv=r_val: np.array([[0.0, rv, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]),
t_d4, G0=G0_pp, tau_b=tb_pp, tau_s=ts_pp, q_arms=q_v
)
eta_e_curve.append(float((su["tau_p"][-1, 0, 0] - su["tau_p"][-1, 1, 1]) / (r_val * 3.0 * eta0_pp)))
eta_s_curve.append(float(ss["tau_xy"][-1] / (r_val * eta0_pp)))
max_trouton_by_q.append(max(eta_e_curve))
print(f"q = {q_v} arms | peak normalized extensional hardening eta_E/(3*eta_0) = {max(eta_e_curve):6.2f} | shear eta/eta_0 at 5 s^-1 = {eta_s_curve[-1]:.3f}")
axes[0].semilogx(edot_sweep * ts_pp, eta_e_curve, "o-", lw=2.0, label=f"$q = {q_v}$ arms")
axes[1].loglog(edot_sweep * tb_pp, eta_s_curve, "s-", lw=2.0, label=f"$q = {q_v}$ arms")
assert max_trouton_by_q[0] < max_trouton_by_q[1] < max_trouton_by_q[2] < max_trouton_by_q[3]
assert max_trouton_by_q[0] < 1.25 and max_trouton_by_q[-1] > 6.5 # q = 1 stays near 3*eta_0 while q = 8 hardens > 6.5x
axes[0].axvline(1.0, color="gray", ls=":", lw=1.2, label=r"Stretch threshold $\mathrm{Wi}_s = 1$")
axes[0].set_xlabel(r"Stretch Weissenberg number $\mathrm{Wi}_s = \dot{\varepsilon}\tau_s$")
axes[0].set_ylabel(r"Strain-hardening index $\eta_E / (3\eta_0)$")
axes[0].set_title(r"Extensional viscosity against the number of arms")
axes[0].legend(fontsize=8)
axes[1].set_xlabel(r"Backbone Weissenberg number $\mathrm{Wi}_b = \dot{\gamma}\tau_b$")
axes[1].set_ylabel(r"Normalized shear viscosity $\eta(\dot{\gamma}) / \eta_0$")
axes[1].set_title(r"Shear viscosity")
axes[1].legend(fontsize=8)
log_ticks(axes[0], "x", [0.15, 0.3, 0.6, 1, 3])
label_panels(fig)
plt.show()
Demonstration 4: the effect of the number of arms q
===================================================
q = 1 arms | peak normalized extensional hardening eta_E/(3*eta_0) = 0.99 | shear eta/eta_0 at 5 s^-1 = 0.007
q = 3 arms | peak normalized extensional hardening eta_E/(3*eta_0) = 1.41 | shear eta/eta_0 at 5 s^-1 = 0.009
q = 5 arms | peak normalized extensional hardening eta_E/(3*eta_0) = 3.92 | shear eta/eta_0 at 5 s^-1 = 0.009
q = 8 arms | peak normalized extensional hardening eta_E/(3*eta_0) = 10.04 | shear eta/eta_0 at 5 s^-1 = 0.009

Figure 7.4. Pom-Pom model for arms. (a) Peak extensional viscosity divided by against . (b) Steady shear viscosity divided by , which hardly depends on .
Inside the algorithm¶
The function entangled_tubes.solve_pom_pom_melt keeps the orientation tensor positive definite (, ) and the stretch within its limits () as follows:
The auxiliary tensor obeys an equation of the Oldroyd-B form, which is integrated for . The trace of and the eigenvalues of are then positive at any .
The stretch is advanced with a midpoint scheme, with evaluated at the midpoint, and is limited to the interval after the predictor and after the corrector.
Check against the package¶
The cell below prints the source of solve_pom_pom_melt and compares it with an implementation written in NumPy; the two agree to rounding error (< 1e-12), with and at every step.
heading("Inside the algorithm: orientation and stretch in the Pom-Pom solver")
print(show_source(entangled_tubes.solve_pom_pom_melt))
def standalone_pom_pom(L_mat: np.ndarray, t_grid: np.ndarray, G0: float, tau_b: float, tau_s: float, q: int) -> dict:
"""NumPy re-implementation of McLeish-Larson differential Pom-Pom in log(A) + capped lambda."""
I3 = np.eye(3)
Psi_A = np.zeros((3, 3))
lam_v = 1.0
tau_out = np.zeros((t_grid.size, 3, 3))
trS_err = 0.0
def rhs_A(P: np.ndarray) -> np.ndarray:
A_m = tensors_kinematics.exp_conformation(P)
dec = tensors_kinematics.log_conformation_decompose(A_m, L_mat)
rel = -(A_m - I3) / tau_b
R, ev = dec["eigenvectors"], dec["eigenvalues"]
r_psi = R @ ((1.0 / ev)[:, None] * (R.T @ rel @ R)) @ R.T
res = dec["dPsi_dt_kinematic"] + 0.5 * (r_psi + r_psi.T)
return 0.5 * (res + res.T)
for k in range(t_grid.size - 1):
dt = float(t_grid[k + 1] - t_grid[k])
A_c = tensors_kinematics.exp_conformation(Psi_A)
S_c = A_c / float(np.trace(A_c))
k1 = rhs_A(Psi_A)
k2 = rhs_A(Psi_A + 0.5 * dt * k1)
Psi_A = Psi_A + dt * k2
A_n = tensors_kinematics.exp_conformation(Psi_A)
S_n = A_n / float(np.trace(A_n))
trS_err = max(trS_err, abs(float(np.trace(S_n)) - 1.0))
drive = float(np.sum(L_mat * (0.5 * (S_c + S_n))))
l_mid = min(float(q), max(1.0, lam_v + 0.5 * dt * (lam_v * drive - (lam_v - 1.0) / tau_s)))
lam_v = min(float(q), max(1.0, lam_v + dt * (l_mid * drive - (l_mid - 1.0) / tau_s)))
tau_out[k + 1] = 3.0 * G0 * (lam_v**2) * (S_n - I3 / 3.0)
return {"tau_p": tau_out, "trS_err": trS_err, "lam_final": lam_v}
L_bi = np.diag([1.8, 0.6, -2.4])
t_bi = np.linspace(0.0, 3.0, 121)
ref_pp = entangled_tubes.solve_pom_pom_melt(lambda _t: L_bi, t_bi, G0=1.5e4, tau_b=4.0, tau_s=0.6, q_arms=5)
chk_pp = standalone_pom_pom(L_bi, t_bi, G0=1.5e4, tau_b=4.0, tau_s=0.6, q=5)
print(f"Max |this solver - solve_pom_pom_melt| = {np.max(np.abs(chk_pp['tau_p'] - ref_pp['tau_p'])):.3e} Pa | max |tr(S)-1| = {chk_pp['trS_err']:.3e}")
assert np.allclose(chk_pp["tau_p"], ref_pp["tau_p"], rtol=1e-13, atol=1e-9)
assert chk_pp["trS_err"] < 1e-15
assert 1.0 <= chk_pp["lam_final"] <= 5.0
Inside the algorithm: orientation and stretch in the Pom-Pom solver
===================================================================
def solve_pom_pom_melt(
L_fn: Callable[[float], np.ndarray],
t_grid: np.ndarray,
G0: float = 1.5e4,
tau_b: float = 4.0,
tau_s: float = 0.60,
q_arms: int = 5,
enforce_arm_cap: bool = True,
) -> dict:
"""The differential Pom-Pom model of McLeish and Larson (1998) for branched polymer melts."""
t = np.asarray(t_grid, dtype=float).ravel()
if t.size < 2 or np.any(np.diff(t) <= 0.0) or G0 <= 0.0 or tau_b <= 0.0 or tau_s <= 0.0 or q_arms < 1:
raise ValueError("Require increasing t_grid, positive G0/tau_b/tau_s, and q_arms >= 1.")
I3 = np.eye(3, dtype=float)
q = float(q_arms)
def _rhs_A_psi(Psi_A: np.ndarray, tk: float) -> np.ndarray:
A_cur = exp_conformation(Psi_A)
L_cur = np.asarray(L_fn(tk), dtype=float)
dec = log_conformation_decompose(A_cur, L_cur)
rel_A = -(A_cur - I3) / float(tau_b)
ev = dec["eigenvalues"]
R = dec["eigenvectors"]
rel_psi = R @ ((1.0 / ev)[:, None] * (R.T @ rel_A @ R)) @ R.T
out = dec["dPsi_dt_kinematic"] + 0.5 * (rel_psi + rel_psi.T)
return 0.5 * (out + out.T)
Psi_A = np.zeros((3, 3), dtype=float)
lam_cur = 1.0
S_hist = np.zeros((t.size, 3, 3), dtype=float)
lam_hist = np.ones(t.size, dtype=float)
tau_hist = np.zeros((t.size, 3, 3), dtype=float)
S_hist[0] = I3 / 3.0
for k in range(t.size - 1):
dt = float(t[k + 1] - t[k])
tk = float(t[k])
A_cur = exp_conformation(Psi_A)
S_cur = A_cur / float(np.trace(A_cur))
L_cur = np.asarray(L_fn(tk), dtype=float)
# Advance auxiliary orientation tensor A via RK2 in log-space:
k1_A = _rhs_A_psi(Psi_A, tk)
k2_A = _rhs_A_psi(Psi_A + 0.5 * dt * k1_A, tk + 0.5 * dt)
Psi_A = Psi_A + dt * k2_A
A_next = exp_conformation(Psi_A)
S_next = A_next / float(np.trace(A_next))
# Advance backbone stretch lambda with branch-point withdrawal priority cap lambda <= q:
L_mid = 0.5 * (L_cur + np.asarray(L_fn(float(t[k + 1])), dtype=float))
S_mid = 0.5 * (S_cur + S_next)
stretch_drive = float(np.sum(L_mid * S_mid))
def _dlam(lv: float) -> float:
# McLeish & Larson (1998) backbone stretch rate prior to q-arm branch-point withdrawal:
return lv * stretch_drive - (lv - 1.0) / float(tau_s)
l_mid = max(1.0, lam_cur + 0.5 * dt * _dlam(lam_cur))
if enforce_arm_cap:
l_mid = min(l_mid, q)
lam_cur = max(1.0, lam_cur + dt * _dlam(l_mid))
if enforce_arm_cap:
lam_cur = min(lam_cur, q)
S_hist[k + 1] = S_next
lam_hist[k + 1] = lam_cur
tau_hist[k + 1] = 3.0 * float(G0) * (lam_cur**2) * (S_next - I3 / 3.0)
return {
"t": t,
"S_orientation": S_hist,
"lambda_stretch": lam_hist,
"tau_p": tau_hist,
"tau_xy": tau_hist[:, 0, 1],
"N1": tau_hist[:, 0, 0] - tau_hist[:, 1, 1],
}
Max |this solver - solve_pom_pom_melt| = 0.000e+00 Pa | max |tr(S)-1| = 2.220e-16
Exercises¶
Worked solutions are in 07_solutions.ipynb. The cell below the list is a short self-check to start from.
Verify a result. Check that
solve_pom_pom_meltat follows the linear viscoelastic start-up . Then check, in uniaxial extension with an orientation time much longer than the stretch time (, , ), that the steady stretch is for and equals above this value.Find how it fails. Show two ways in which a tube model fails when one of its terms is left out. (1) Run
solve_pom_pom_meltwith the parametersLDPE_IUPAC_Ain uniaxial extension at for 6 s withenforce_arm_cap=Falseand withTrue, and compare the stretch and the tensile stress. (2) Runsolve_rolie_polywith the parametersPS_MELT_RPwith and with 0.5, and find whether the steady shear stress decreases with shear rate.Implement it yourself. Write
solve_multimode_pom_pom(L_fn, t_grid, modes)for three modes that stand for the levels of a branched molecule: outer arms (), an intermediate level () and the innermost segments (). Check that start-up of shear at a very low rate follows , and find how the stretch of each mode depends on the extension rate relative to .
heading("Self-check for the exercises")
assert peak_stretches[0] < 1.02 and peak_stretches[2] > 1.35 * peak_stretches[1]
assert np.min(np.diff(curves_rp[0.0])) < -5.0e3 and np.min(np.diff(curves_rp[0.5])) > 0.0
assert np.isclose(sol_uni["lambda_stretch"][-1], float(q_pp), rtol=1e-3)
assert hardening_factor > 2.5 and thinning_ratio < 0.40
assert np.allclose(chk_pp["tau_p"], ref_pp["tau_p"], rtol=1e-13, atol=1e-9)
print("All checks passed.")
Self-check for the exercises
============================
All checks passed.