diff --git a/CHANGELOG.md b/CHANGELOG.md index 2bb541d449..c80036ca83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Bug fixes - `pybamm` now installs on Python 3.15. `pybammsolvers` 0.11.0 declared `requires-python <3.15` and shipped no cp315 wheels, so `pybamm`'s solver requirement could not be met there. Released `pybammsolvers` v0.11.1, which allows Python 3.15 and ships cp315 wheels. ([#5909](https://github.com/pybamm-team/PyBaMM/pull/5909)) +- `"SEI film resistance": "average"` now works with `"particle size": "distribution"` in SPMe, DFN and Newman-Tobias, which raised a `DomainError` when building the model. ([#5892](https://github.com/pybamm-team/PyBaMM/pull/5892)) # [v26.10.1.0](https://github.com/pybamm-team/PyBaMM/tree/pybamm-v26.10.1.0) - 2026-10-13 diff --git a/packages/pybamm/src/pybamm/models/submodels/interface/kinetics/base_kinetics.py b/packages/pybamm/src/pybamm/models/submodels/interface/kinetics/base_kinetics.py index 365daa1ca3..e3d12bb28b 100644 --- a/packages/pybamm/src/pybamm/models/submodels/interface/kinetics/base_kinetics.py +++ b/packages/pybamm/src/pybamm/models/submodels/interface/kinetics/base_kinetics.py @@ -132,6 +132,10 @@ def get_coupled_variables(self, variables): R_sei = self.phase_param.R_sei L_sei_av = variables[f"X-averaged {domain} {phase_name}SEI thickness [m]"] eta_sei = -j_tot_av * L_sei_av * R_sei + # With a size distribution resolved through the electrode, eta_r has the + # electrode as its secondary domain, which a current collector term skips + if eta_r.domains["secondary"] == [f"{domain} electrode"]: + eta_sei = pybamm.PrimaryBroadcast(eta_sei, f"{domain} electrode") elif self.options["SEI film resistance"] == "distributed": R_sei = self.phase_param.R_sei L_sei = variables[f"{Domain} {phase_name}SEI thickness [m]"] diff --git a/packages/pybamm/tests/unit/test_models/test_full_battery_models/test_lithium_ion/base_lithium_ion_tests.py b/packages/pybamm/tests/unit/test_models/test_full_battery_models/test_lithium_ion/base_lithium_ion_tests.py index 965f5b8949..e9011afb51 100644 --- a/packages/pybamm/tests/unit/test_models/test_full_battery_models/test_lithium_ion/base_lithium_ion_tests.py +++ b/packages/pybamm/tests/unit/test_models/test_full_battery_models/test_lithium_ion/base_lithium_ion_tests.py @@ -589,6 +589,17 @@ def test_well_posed_psd_swelling_only(self): } self.check_well_posedness(options) + def test_well_posed_psd_sei_film_resistance(self): + for film, j_tot_state in [("average", "false"), ("distributed", "true")]: + options = { + "particle size": "distribution", + "surface form": "algebraic", + "SEI": "constant", + "SEI film resistance": film, + "total interfacial current density as a state": j_tot_state, + } + self.check_well_posedness(options) + def test_well_posed_psd_hysteresis_thermal(self): # Regression test: hysteresis OCP + particle size distribution + a # non-isothermal thermal submodel previously raised a DomainError in