You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Heat of mixing fails to discretise with a quadratic or quartic particle profile #5876
"heat of mixing": "true" with a polynomial particle profile ("quadratic profile" or "quartic profile") fails to discretise with a ShapeError. The same models without the heat of mixing build fine. This happens on main and is not changed by #5769, which only special-cases "uniform profile" (its heat of mixing is zero).
BaseThermal._heat_of_mixing integrates D |grad c|^2 dU/dc over the particle's r domain, using the particle concentration variable. For the polynomial profiles that concentration is reconstructed from the average and surface values instead of being a finite-volume state. Its grad and its r mesh do not match, so the matmul fails (21 vs 19 rows for the SPM, 420 vs 380 for the DFN).
Possible fixes: evaluate the heat of mixing analytically from the polynomial profile, whose dc/dr is known in closed form, or raise a clear OptionError for this combination until that is done.
Activity