Repository navigation
fix: include SEI film resistive loss in irreversible heating - #5841
shaurya20335 wants to merge 9 commits into
Conversation
With "SEI film resistance" on, the voltage drop across the film is added to the reaction overpotential eta_r, which lowers the terminal voltage. The thermal model computed irreversible heating as a*j*eta_r, so the energy lost across the film never appeared in "Total heating [W]" or the cell temperature. Use a*j*(eta_r - eta_sei), i.e. the full departure from the open-circuit potential, for both electrodes, every particle phase, and the planar lithium metal electrode. Add an energy-balance test: at fixed temperature, the extra heat from switching on the film resistance equals the extra electrical loss. Fixes pybamm-team#5820 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
rtimms
left a comment
There was a problem hiding this comment.
Thanks, the physics and signs check out: forward and inverse kinetics both give eta_r − eta_sei = delta_phi − U, and I confirmed the energy balance for composite (DFN, Chen2020_composite), half-cell and SPM inverse-kinetics paths.
One regression to fix before merge: with "particle size": "distribution" (MPM, or DFN with that option), a non-isothermal model and "SEI film resistance": "distributed", building the model now raises DomainError: children must have same or empty domains, not ['positive particle size'] and ['positive electrode']. eta_sei keeps its particle-size domain there. Size-averaging it in BaseInterface._get_standard_sei_film_overpotential_variables, as _get_standard_overpotential_variables already does for eta_r, fixes it:
if eta_sei.domain and eta_sei.domain[0].endswith("particle size"):
eta_sei = pybamm.size_average(eta_sei)Could you add an MPM case to test_sei_film_heating too? Minor: the "which eta_r excludes" comment reads oddly, since eta_r contains eta_sei. Maybe "eta_r is the kinetic overpotential net of the film drop".
Side-reaction heat (SEI growth, plating) will follow in a separate PR.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for checking the signs and the energy balance across all those paths, @rtimms. I have pushed the changes:
The regression was a bit wider than the MPM case: it also hit SPMe and DFN with a size distribution, and isothermal models with Side note, not touched here: |
# Conflicts: # CHANGELOG.md
|
Thanks, all three changes look good. I checked this together with #5892 and #5875: every size-distribution model builds (SPMe, DFN and MPM, with no, average or distributed film, constant or growing SEI). With #5892's fix, the energy balance also closes for the Heads-up on #5818, which deprecates relying on options set from other options (the test suite turns that warning into an error): |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@shaurya20335 heads-up on how this fits with #5875. #5875 was built on top of this PR, so its Plan: this lands first, then I'll rebase #5875 on it so that PR only adds the side-reaction heat (SEI growth and lithium plating) on top. Nothing to change here for that. Please merge |
# Conflicts: # CHANGELOG.md
Description
Fixes #5820.
With
"SEI film resistance"set to"distributed"or"average",BaseKineticsadds the film dropeta_sei = -j * L_sei * R_seito the reaction overpotential, soeta_r = delta_phi - U + eta_sei. This lowers the terminal voltage, butBaseThermalcomputed irreversible heating asa_j * eta_r, which leaves the film drop out. The energy lost across the film therefore never appeared inTotal heating [W]or in the cell temperature.Irreversible heating now uses
a_j * (eta_r - eta_sei), the full departure ofdelta_phifrom the open-circuit potential, for both electrodes, every particle phase, and the planar lithium metal electrode in half cells.eta_seiis read from the existing"... SEI film overpotential [V]"variables, which are zero when the film resistance is off, so nothing changes for models without it.Energy check (OKane2022, 5 A for 1800 s, lumped thermal with the temperature held at ambient by a large heat transfer coefficient, 50 nm film, extra quantities relative to
"SEI film resistance": "none"):In the DFN the film also changes the current distribution, which shifts the other heat terms slightly (the 1.35 J on main and the 0.2 J residual with this PR).
With a particle-size distribution (MPM, or SPMe and DFN with
"particle size": "distribution"),eta_seihas a particle-size domain. It is now size-averaged inBaseInterface._get_standard_sei_film_overpotential_variables, aseta_ralready is, so these models build with a thermal model. There the balance closes to 0.16% for MPM and 0.7% for DFN with a size distribution; models without a distribution are unchanged by the size average.Side reactions (SEI growth, plating) carry their own share of the interfacial current through the film. Their heat is not included in
BaseThermaltoday, so I have left that out of scope here.Type of change
Bug fix, with an entry under
## Bug fixesin CHANGELOG.md.Important checks:
TestThermal.test_sei_film_heating(integration) checks that the extra heat equals the extra electrical loss for SPMe (distributed and average), DFN, MPM and an SPMe half cell. The non-MPM cases fail on main; the MPM case fails without the size average, with theDomainErrorfrom the review.