Repository navigation
Fix lumped thermal discretisation with 1+1D current collectors - #5891
Open
chenyi6758-source wants to merge 3 commits into
Open
chenyi6758-source wants to merge 3 commits into
chenyi6758-source wants to merge 3 commits into
Conversation
Contributor
|
Looks good, thanks. Please drop the two-line comment above |
rtimms
requested changes
Oct 12, 2026
rtimms
left a comment
Contributor
There was a problem hiding this comment.
Thanks @chenyi6758-source, the fix is right. In the Timms2021 lumped formulation the cell has a single temperature, and the heat source and heat capacity are already averaged over the current collector, so the only term varying in z was T_surf (= T_amb(y, z, t)). Since h_total and A_cooling are uniform, averaging it gives exactly the same total cooling. I checked that 0D lumped is bit-identical to main, that 2+1D now builds too, and that 1+1D/2+1D lumped agree with x-lumped to within 0.5% of the temperature rise under uniform cooling.
Before this goes into 26.10.0.1:
- Add a regression test.
test_well_posed_lumped_thermal_1plus1Donly checks the model symbolically, which is why this wasn't caught. Adding 1+1D and 2+1D"lumped"SPMe models totest_consistent_coolingintests/integration/test_models/test_full_battery_models/test_lithium_ion/test_thermal_models.py, and asserting they match the x-lumped ones (e.g.assert 1e-5 > err(solutions["SPMe 1+1D"], solutions["SPMe 1+1D lumped"]), same for 2+1D), fails onmainand passes here. - Drop the two-line comment above
T_surf_av(as mentioned earlier); the averaging is clear from the code. - Optional, same root cause:
"surface temperature": "lumped"with 1+1D/2+1D current collectors still fails, becausethermal/surface/lumped.pyuses the unaveraged"Ambient temperature [K]". Switching it to"Volume-averaged ambient temperature [K]"fixes both. Fine as a follow-up if you'd rather keep this PR minimal.
… in surface lumped - Add 1+1D/2+1D lumped SPMe models to test_consistent_cooling, asserting they match the x-lumped ones (fails on main, passes with the fix) - Drop the two-line comment above T_surf_av - thermal/surface/lumped.py now uses 'Volume-averaged ambient temperature [K]' so 'surface temperature': 'lumped' works with 1+1D/2+1D current collectors
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5878.
"Surface temperature [K]" carries the current-collector domain, so with 1+1D current collectors the lumped cooling term varied in z while the lumped temperature state is a scalar, and discretisation failed with a shape mismatch.
This averages the surface temperature over the current collector(s) for the cooling term. It is a no-op for 0D (z_average of a scalar returns it unchanged). The 1+1D lumped model now builds and solves, and its temperature trajectory matches the 0D lumped result as expected.