Skip to content

Fix heat-of-mixing builds with polynomial particle profiles - #5902

Closed
Fstarnb wants to merge 2 commits into
pybamm-team:mainfrom
Fstarnb:fix/5876-analytic-heat-of-mixing
Closed

Fstarnb wants to merge 2 commits into
pybamm-team:mainfrom
Fstarnb:fix/5876-analytic-heat-of-mixing

Conversation

@Fstarnb

@Fstarnb Fstarnb commented Oct 13, 2026

Copy link
Copy Markdown

Fixes #5876

When heat of mixing is enabled, quadratic and quartic particle profiles reconstruct concentration from average and surface states. Applying the finite-volume gradient to those expressions uses incompatible radial discretizations and raises a ShapeError during model build.

Use the symbolic radial derivative when the concentration expression contains a spherical spatial variable. Keep the existing grad/inner calculation for Fickian profiles, which have no explicit radial variable.

This complements #5769: that PR adds phase summation, effective diffusivity, and the zero heat shortcut for uniform profiles. Its phase heat expression still applies grad(c), so the polynomial-profile build failure remains.

Validation

  • Added build regressions for SPM and DFN with Fickian, quadratic, and quartic profiles; all six focused cases pass.
  • Ruff check/format and all applicable changed-file pre-commit hooks pass.
  • The full thermal test file also ran: the six new cases pass; six other solve tests fail locally at IDAKLU result extraction because this isolated environment installed pybammsolvers 0.10.0 while current main expects its 0.11.0 API. The full nox unit and documentation sessions were not run.

@Fstarnb
Fstarnb requested a review from a team as a code owner October 13, 2026 06:25
@Fstarnb
Fstarnb force-pushed the fix/5876-analytic-heat-of-mixing branch from 88d80a0 to 30b6499 Compare October 13, 2026 21:56
@Fstarnb
Fstarnb force-pushed the fix/5876-analytic-heat-of-mixing branch from 30b6499 to 562a9d9 Compare October 14, 2026 05:03
@Fstarnb Fstarnb closed this Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Heat of mixing fails to discretise with a quadratic or quartic particle profile

1 participant