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.

2. The high Weissenberg number problem and the log-conformation formulation

For many years calculations of viscoelastic flow failed to converge above a Weissenberg number of order 1, whatever the constitutive model and however fine the grid. This is known as the high Weissenberg number problem. Near stagnation points and corners the conformation tensor grows exponentially in space and in time; a polynomial discretization cannot follow this growth, and a time step or an interpolation produces a tensor that is not positive definite.

Fattal and Kupferman (2004) proposed to evolve the logarithm Ψ=log⁡C\boldsymbol{\Psi} = \log\mathbf{C} instead. An exponential profile of C\mathbf{C} is a linear profile of Ψ\boldsymbol{\Psi}, and exp⁡Ψ\exp\boldsymbol{\Psi} is positive definite whatever the numerical error. This lecture derives the equation for Ψ\boldsymbol{\Psi}, treats the case of equal eigenvalues, and compares the two formulations.

Learning objectives

  1. Explain the two causes of the high Weissenberg number problem: exponential growth of the conformation tensor, and discretizations that produce det⁡C≤0\det\mathbf{C} \leq 0.

  2. Derive the decomposition L=Ω+B+NC−1\mathbf{L} = \boldsymbol{\Omega} + \mathbf{B} + \mathbf{N}\mathbf{C}^{-1} of the velocity gradient and apply it with tensors_kinematics.log_conformation_decompose and exp_conformation.

  3. Show that the factor (λj−λi)−1(\lambda_j - \lambda_i)^{-1} of the rotation term has a finite limit inside the commutator [Ω,Ψ][\boldsymbol{\Omega}, \boldsymbol{\Psi}] when two eigenvalues coincide.

  4. Map the stability of the direct update and of the logarithmic update in the plane (Wi,Δt/λ)(\mathrm{Wi}, \Delta t / \lambda), and check second-order convergence.

Time: about 60 min

1. Why direct integration fails: exponential profiles and polynomial approximations

Near a stagnation point or a re-entrant corner, where the local rate of extension is ε˙\dot{\varepsilon}, the conformation tensor grows exponentially along a streamline, C(x)∝exp⁡[(2ε˙−1/λ)x/U]\mathbf{C}(x) \propto \exp[(2\dot{\varepsilon} - 1/\lambda)x/U]. Finite-volume and finite-element schemes and explicit time steps approximate fields by polynomials. When a polynomial represents an exponential profile on a step Δx\Delta x or Δt\Delta t that is not small, it undershoots. The undershoot is largest relative to the smallest eigenvalue, which decays as λmin⁡(C)∼e−ε˙t\lambda_{\min}(\mathbf{C}) \sim e^{-\dot{\varepsilon}t}, and it can make this eigenvalue zero or negative (det C <= 0); the calculation then diverges.

Fattal and Kupferman (2004) removed both difficulties with the one-to-one map between positive definite matrices and symmetric matrices:

C=RΛR⊤  ⟺  Ψ=log⁡C≡R(log⁡Λ)R⊤,C=exp⁡Ψ≡R(exp⁡diag⁡Ψeig)R⊤≻0.\mathbf{C} = \mathbf{R}\boldsymbol{\Lambda}\mathbf{R}^\top \iff \boldsymbol{\Psi} = \log\mathbf{C} \equiv \mathbf{R}(\log\boldsymbol{\Lambda})\mathbf{R}^\top, \qquad \mathbf{C} = \exp\boldsymbol{\Psi} \equiv \mathbf{R}(\exp\operatorname{diag}\boldsymbol{\Psi}_{\mathrm{eig}})\mathbf{R}^\top \succ \mathbf{0}.

The map has two consequences:

  1. An exponential profile becomes a linear one: if C(t)∼eαt\mathbf{C}(t) \sim e^{\alpha t} then Ψ(t)∼αt\boldsymbol{\Psi}(t) \sim \alpha t, which a scheme of first or second order represents accurately.

  2. Positive definiteness cannot be lost: for every finite symmetric Ψ\boldsymbol{\Psi} the eigenvalues exp⁡(ψi)\exp(\psi_i) of exp⁡Ψ\exp\boldsymbol{\Psi} are positive, and det⁡(exp⁡Ψ)=exp⁡(tr⁡Ψ)>0\det(\exp\boldsymbol{\Psi}) = \exp(\operatorname{tr}\boldsymbol{\Psi}) > 0.


Demonstration 1: exponential stretch, its logarithm, and a reversal of the flow
===============================================================================
Exponential range at t=2.2: C_xx = 81.02, C_yy = 0.4197 | log-space Psi_xx = 4.39, Psi_yy = -0.87
Coarse reversal (dt=0.5): direct_euler diverged: True (min det C = -9.308e+02)
Coarse reversal (dt=0.5): log_psi      diverged: False (min det C = 1.000e+00 > 0)
<Figure size 1155x418 with 2 Axes>

Figure 2.1. (a) In a stretching flow CxxC_{xx} grows exponentially while Ψxx=ln⁡Cxx\Psi_{xx} = \ln C_{xx} grows linearly. (b) A flow that reverses at t=1t = 1 s, integrated with the step Δt=0.5\Delta t = 0.5 s for λ=0.22\lambda = 0.22 s: the smallest eigenvalue of C\mathbf{C} from the direct Euler update becomes negative, that of the log-conformation update stays positive (symmetric logarithmic axis).

2. The log-conformation decomposition and the limit of equal eigenvalues

The equation for Ψ\boldsymbol{\Psi} cannot be obtained from C˙=LC+CL⊤+frel(C)\dot{\mathbf{C}} = \mathbf{L}\mathbf{C} + \mathbf{C}\mathbf{L}^\top + \mathbf{f}_{\mathrm{rel}}(\mathbf{C}) by writing Ψ˙=C−1C˙\dot{\boldsymbol{\Psi}} = \mathbf{C}^{-1}\dot{\mathbf{C}}, because matrices do not commute (LC≠CL\mathbf{L}\mathbf{C} \neq \mathbf{C}\mathbf{L}). Fattal and Kupferman (2004) showed that for any positive definite tensor C=RΛR⊤\mathbf{C} = \mathbf{R}\boldsymbol{\Lambda}\mathbf{R}^\top and any velocity gradient L\mathbf{L} there is a unique decomposition

L=Ω+B+NC−1,Ω⊤=−Ω,N⊤=−N,B⊤=B,[B,C]=0.\mathbf{L} = \boldsymbol{\Omega} + \mathbf{B} + \mathbf{N}\mathbf{C}^{-1}, \qquad \boldsymbol{\Omega}^\top = -\boldsymbol{\Omega}, \qquad \mathbf{N}^\top = -\mathbf{N}, \qquad \mathbf{B}^\top = \mathbf{B}, \quad [\mathbf{B}, \mathbf{C}] = \mathbf{0}.

When this is substituted into LC+CL⊤\mathbf{L}\mathbf{C} + \mathbf{C}\mathbf{L}^\top, the terms with N\mathbf{N} cancel, NC−1C+C(−C−1N)=0\mathbf{N}\mathbf{C}^{-1}\mathbf{C} + \mathbf{C}(-\mathbf{C}^{-1}\mathbf{N}) = \mathbf{0}. What remains is a rotation of the principal axes, [Ω,C][\boldsymbol{\Omega}, \mathbf{C}], and a stretch along them, 2BC2\mathbf{B}\mathbf{C}, in which B\mathbf{B} commutes with C\mathbf{C}. In the principal axes, with M~=R⊤LR\tilde{\mathbf{M}} = \mathbf{R}^\top\mathbf{L}\mathbf{R},

B~ii=M~ii,Ω~ij=λjM~ij+λiM~jiλj−λi(i≠j),DΨDt=[Ω,Ψ]+2B+RΛ−1R⊤frel(C).\tilde{B}_{ii} = \tilde{M}_{ii}, \qquad \tilde{\Omega}_{ij} = \frac{\lambda_j\tilde{M}_{ij} + \lambda_i\tilde{M}_{ji}}{\lambda_j - \lambda_i} \quad (i \neq j), \qquad \frac{D\boldsymbol{\Psi}}{Dt} = [\boldsymbol{\Omega}, \boldsymbol{\Psi}] + 2\mathbf{B} + \mathbf{R}\boldsymbol{\Lambda}^{-1}\mathbf{R}^\top\mathbf{f}_{\mathrm{rel}}(\mathbf{C}).

At equilibrium, C=I\mathbf{C} = \mathbf{I}, the eigenvalues are equal, λj=λi\lambda_j = \lambda_i, and the rotation term contains a division by zero. The commutator in which it appears nevertheless has a finite limit:

[Ω~,log⁡Λ]ij=Ω~ij(ln⁡λj−ln⁡λi)=(λjM~ij+λiM~ji)ln⁡λj−ln⁡λiλj−λi→λj→λiλi(M~ij+M~ji)1λi=M~ij+M~ji.[\tilde{\boldsymbol{\Omega}}, \log\boldsymbol{\Lambda}]_{ij} = \tilde{\Omega}_{ij}(\ln\lambda_j - \ln\lambda_i) = (\lambda_j\tilde{M}_{ij} + \lambda_i\tilde{M}_{ji})\frac{\ln\lambda_j - \ln\lambda_i}{\lambda_j - \lambda_i} \xrightarrow{\lambda_j \to \lambda_i} \lambda_i(\tilde{M}_{ij} + \tilde{M}_{ji})\frac{1}{\lambda_i} = \tilde{M}_{ij} + \tilde{M}_{ji}.

Together with the diagonal part, 2B~ii=2M~ii2\tilde{B}_{ii} = 2\tilde{M}_{ii}, this gives [Ω,Ψ]+2B→L+L⊤=2D[\boldsymbol{\Omega}, \boldsymbol{\Psi}] + 2\mathbf{B} \to \mathbf{L} + \mathbf{L}^\top = 2\mathbf{D} in the limit, without a singularity.


Demonstration 2: the logarithm and its inverse, and the limit of equal eigenvalues
==================================================================================
Exact C = I kinematic rate error ||dPsi/dt - (L + L^T)||_F: 0.000e+00
At gap 1e-13: dPsi_kin diff from 2D = 1.492e-15, and |Omega_12| = 6.394e+12
<Figure size 1155x418 with 2 Axes>

Figure 2.2. The decomposition as the two eigenvalues of C\mathbf{C} approach each other. (a) The formula for Ω~12\tilde\Omega_{12} diverges as 1/(λ1−λ2)1/(\lambda_1 - \lambda_2); the package switches to the limiting form below a gap of about 10-7. (b) The kinematic part of Ψ˙\dot{\boldsymbol{\Psi}} tends to 2D2\mathbf{D} in proportion to the gap.

3. Stability in the plane (Wi,Δt/λ)(\mathrm{Wi}, \Delta t/\lambda) and second-order convergence

Two numerical experiments compare log_psi with direct_euler:

  1. Stability. The Weissenberg number is varied between 0.5 and 9.5 and the time step Δt/λ\Delta t / \lambda between 0.10 and 1.50, ten values of each, in a flow that combines extension with a reversal. For each pair the experiment records whether det⁡C(t)\det\mathbf{C}(t) stays positive during the whole run.

  2. Order of convergence. The error of log_psi, which uses a midpoint scheme, is measured in start-up of shear of the Oldroyd-B model at Wi=3\mathrm{Wi} = 3 against the exact solution τxy(t)=ηpγ˙(1−e−t/λ)\tau_{xy}(t) = \eta_p\dot{\gamma}(1 - e^{-t/\lambda}), N1(t)=2ηpλγ˙2[1−(1+t/λ)e−t/λ]N_1(t) = 2\eta_p\lambda\dot{\gamma}^2[1 - (1 + t/\lambda)e^{-t/\lambda}], for decreasing Δt\Delta t. The expected order is 2.


Demonstration 3: stability map and order of convergence
=======================================================
Stability survival fraction across 100 (Wi, dt) cells -> direct_euler: 10.0%, log_psi: 100.0%
Measured log_psi global convergence order on N1(t): p = 1.941 (theoretical RK2 = 2.00)
<Figure size 1155x418 with 3 Axes>

Figure 2.3. (a) Map over the Weissenberg number and the time step: the direct Euler update keeps C\mathbf{C} positive definite in the green cells only (10 of 100); the log-conformation update does so in all 100. (b) Error of N1N_1 for the second-order log-conformation scheme against the time step; the fitted order is 1.94.

4. A mixed flow at high Weissenberg number

In contraction dies and in microfluidic cross-slots at high Weissenberg number a fluid element is sheared and extended at the same time. Flow birefringence measures two quantities in the xyxy plane of such a flow:

  1. the principal stress difference Δτ=(τxx−τyy)2+4τxy2\Delta\tau = \sqrt{(\tau_{xx} - \tau_{yy})^2 + 4\tau_{xy}^2}, which is proportional to the optical retardation by the stress-optical rule, and

  2. the extinction angle χ=12arctan⁡ ⁣(2τxyτxx−τyy)\chi = \frac{1}{2}\arctan\!\left(\frac{2\tau_{xy}}{\tau_{xx} - \tau_{yy}}\right), the angle between the principal axis of the stress and the streamline.

The demonstration integrates the FENE-P model with b=60b = 60 through a pulse of shear and extension that reaches Wi=24\mathrm{Wi} = 24, with the method log_psi, and checks that the trace stays below b+3b + 3 and the determinant positive.


Demonstration 4: a pulse of mixed flow at Wi = 24
=================================================
Wi=24 FENE-P pulse -> peak tr(C) = 59.44 (< b+3 = 63.0), min det(C) = 1.069e-01 > 0
Peak birefringence anisotropy Delta_tau = 999.7, min alignment angle chi = 0.00 deg
<Figure size 1155x418 with 3 Axes>

Figure 2.4. FENE-P model (b=60b = 60) in a pulse of mixed shear and planar extension with a peak rate of 24/λ24/\lambda. (a) The trace of C\mathbf{C} stays below b+3=63b + 3 = 63. (b) Principal stress difference (left axis) and extinction angle (right axis).

Inside the algorithm

The cell below prints the source of tensors_kinematics.log_conformation_decompose and tensors_kinematics.exp_conformation. The function log_conformation_decompose computes comm_tilde[i, j] = om_ij * (log_lam[j] - log_lam[i]) when the relative difference of two eigenvalues exceeds 1e-7, and uses the limit m_ij + m_ji when the eigenvalues are closer.

Check against the package

The evolution of Ψ\boldsymbol{\Psi} does not need the tensor N\mathbf{N}, because its contributions cancel, NC−1C+C(NC−1)⊤=0\mathbf{N}\mathbf{C}^{-1}\mathbf{C} + \mathbf{C}(\mathbf{N}\mathbf{C}^{-1})^\top = \mathbf{0}. The check below constructs it nevertheless, N~ij=M~ij+M~jiλj−1−λi−1\tilde{N}_{ij} = \frac{\tilde{M}_{ij} + \tilde{M}_{ji}}{\lambda_j^{-1} - \lambda_i^{-1}}, in NumPy, and verifies that L=Ω+B+NC−1\mathbf{L} = \boldsymbol{\Omega} + \mathbf{B} + \mathbf{N}\mathbf{C}^{-1} holds to 10-13 and that [Ω,C]+2BC=LC+CL⊤[\boldsymbol{\Omega}, \mathbf{C}] + 2\mathbf{B}\mathbf{C} = \mathbf{L}\mathbf{C} + \mathbf{C}\mathbf{L}^\top.


Inside the algorithm: the decomposition of the velocity gradient
================================================================
def log_conformation_decompose(C: np.ndarray, L_grad_u: np.ndarray) -> dict:
    """The decomposition L = Omega + B + N C^-1 of Fattal and Kupferman (2004), in two or three dimensions."""
    C_sym = 0.5 * (np.asarray(C, dtype=float) + np.asarray(C, dtype=float).T)
    L = np.asarray(L_grad_u, dtype=float)
    if C_sym.shape != L.shape or C_sym.ndim != 2 or C_sym.shape[0] not in (2, 3):
        raise ValueError("Require matching 2x2 or 3x3 conformation C and velocity gradient L.")
    evals, R = np.linalg.eigh(C_sym)
    if np.any(evals <= 0.0):
        raise ValueError(
            "log_conformation_decompose requires strictly SPD conformation tensor C (all eigenvalues > 0)."
        )

    log_lam = np.log(evals)
    Psi = (R * log_lam[None, :]) @ R.T
    Psi = 0.5 * (Psi + Psi.T)

    M_tilde = R.T @ L @ R
    d = C_sym.shape[0]
    B_tilde = np.diag(np.diag(M_tilde))
    Omega_tilde = np.zeros((d, d), dtype=float)

    # Advectless logarithmic kinematics: dPsi/dt_kin = [Omega, Psi] + 2 B.
    # Notice [Omega_tilde, diag(log_lam)]_ij = Omega_tilde_ij * (log_lam_j - log_lam_i).
    # For lam_i -> lam_j, (log_lam_j - log_lam_i)/(lam_j - lam_i) -> 1/lam_i, so the commutator
    # smoothly approaches (M_tilde_ij + M_tilde_ji) = 2 D_tilde_ij with zero division-by-zero singularity
    comm_tilde = np.zeros((d, d), dtype=float)
    for i in range(d):
        for j in range(i + 1, d):
            li, lj = float(evals[i]), float(evals[j])
            m_ij, m_ji = float(M_tilde[i, j]), float(M_tilde[j, i])
            rel_gap = abs(lj - li) / (0.5 * (li + lj))
            if rel_gap > 1e-7:
                om_ij = (lj * m_ij + li * m_ji) / (lj - li)
                Omega_tilde[i, j] = om_ij
                Omega_tilde[j, i] = -om_ij
                c_ij = om_ij * (log_lam[j] - log_lam[i])
                comm_tilde[i, j] = c_ij
                comm_tilde[j, i] = c_ij
            else:
                # Exact analytical isotropic limit:
                om_ij = 0.5 * (m_ij - m_ji)
                Omega_tilde[i, j] = om_ij
                Omega_tilde[j, i] = -om_ij
                c_ij = m_ij + m_ji
                comm_tilde[i, j] = c_ij
                comm_tilde[j, i] = c_ij

    B_stretch = R @ B_tilde @ R.T
    Omega = R @ Omega_tilde @ R.T
    dPsi_kin = R @ (comm_tilde + 2.0 * B_tilde) @ R.T
    dPsi_kin = 0.5 * (dPsi_kin + dPsi_kin.T)
    return {
        "Psi": Psi,
        "Omega": Omega,
        "B_stretch": 0.5 * (B_stretch + B_stretch.T),
        "dPsi_dt_kinematic": dPsi_kin,
        "eigenvalues": evals,
        "eigenvectors": R,
    }

def exp_conformation(Psi: np.ndarray) -> np.ndarray:
    """Matrix exponential C = exp(Psi) of a symmetric matrix; C is positive definite for every finite Psi."""
    Psi_sym = 0.5 * (np.asarray(Psi, dtype=float) + np.asarray(Psi, dtype=float).T)
    evals, R = np.linalg.eigh(Psi_sym)
    C = (R * np.exp(np.clip(evals, -80.0, 80.0))[None, :]) @ R.T
    return 0.5 * (C + C.T)

Exact decomposition residual ||(Omega + B + N C^-1) - L||_F : 3.791e-15
Upper-convected identity ||([Omega, C] + 2BC) - (LC+CL^T)||_F: 4.023e-15
Commutativity check ||[B, C]||_F                             : 4.003e-16

Exercises

Worked solutions are in 02_solutions.ipynb. The cell below the list is a short self-check to start from.

  1. Verify a result. Check numerically that the time derivative of exp⁡Ψ(t)\exp\boldsymbol{\Psi}(t), approximated by the central difference exp⁡(Ψ+ϵΨ˙)−exp⁡(Ψ−ϵΨ˙)2ϵ\frac{\exp(\boldsymbol{\Psi} + \epsilon\dot{\boldsymbol{\Psi}}) - \exp(\boldsymbol{\Psi} - \epsilon\dot{\boldsymbol{\Psi}})}{2\epsilon} with Ψ˙=Ψ˙kin+C−1frel(C)\dot{\boldsymbol{\Psi}} = \dot{\boldsymbol{\Psi}}_{\mathrm{kin}} + \mathbf{C}^{-1}\mathbf{f}_{\mathrm{rel}}(\mathbf{C}) from the log-conformation equation, equals the right-hand side LC+CL⊤+frel(C)\mathbf{L}\mathbf{C} + \mathbf{C}\mathbf{L}^\top + \mathbf{f}_{\mathrm{rel}}(\mathbf{C}) of the conformation equation, for the Oldroyd-B, FENE-P and Giesekus models.

  2. Find how it fails. Compare the methods direct_euler and log_psi in a uniaxial extension that reverses: lam = 0.22, L=diag⁡(2.5,−1.25,−1.25)\mathbf{L} = \operatorname{diag}(2.5, -1.25, -1.25) for t<1t < 1 and -1.8 times this tensor for t≥1t \ge 1, on the grid np.linspace(0.0, 3.0, 7), which has a step of 0.50. Record the smallest and the largest eigenvalue and the determinant of C\mathbf{C} at each step, and then reduce the step to find where direct_euler becomes stable.

  3. Implement it yourself. Write a second-order Runge–Kutta solver of the log-conformation equation in NumPy for the FENE-P model (λ=0.75 s\lambda = 0.75\ \mathrm{s}, ηp=1.5 Pa⋅s\eta_p = 1.5\ \mathrm{Pa\cdot s}, b=45b = 45) in a three-dimensional flow with Lxy(t)=6sin⁡(πt/2)L_{xy}(t) = 6\sin(\pi t/2), Lxx=−0.8L_{xx} = -0.8, Lyy=0.3L_{yy} = 0.3, Lzz=0.5L_{zz} = 0.5 for 0≤t≤2.0 s0 \le t \le 2.0\ \mathrm{s}, and compare the conformation tensors with those of tensors_kinematics.integrate_homogeneous_constitutive.


Self-check for the exercises
============================
All checks passed.