Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 3221 spatial cooling #3257

Merged
merged 20 commits into from
Aug 15, 2023
Merged

Issue 3221 spatial cooling #3257

merged 20 commits into from
Aug 15, 2023

Conversation

rtimms
Copy link
Contributor

@rtimms rtimms commented Aug 8, 2023

Description

Features

Allow "Ambient temperature [K]" to be a function of y,z,t to allow a spatially and time-varying ambient temperature in pouch cell models. Also allow "Negative current collector surface heat transfer coefficient [W.m-2.K-1]", "Positive current collector surface heat transfer coefficient [W.m-2.K-1]" and "Edge heat transfer coefficient [W.m-2.K-1]" to be a function of (y,z) to allow for more complex cooling scenarios in pouch cell models (e.g. bottom cooling only).

Breaking changes

After this PR, the "lumped" thermal option always used the parameters "Cell cooling surface area [m2]", "Cell volume [m3]" and "Total heat transfer coefficient [W.m-2.K-1]" to compute the cell cooling regardless of the chosen "cell geometry" option. The user must now specify the correct values for these parameters instead of them being calculated based on e.g. a pouch cell. An OptionWarning is raised to let users know to update their parameters.

Moves OneDimensionalX submodel inside the pouch cell folder to reflect the fact it implicitly assumes a pouch geometry (pybamm.thermal.OneDimensionalX is now pybamm.thermal.pouch_cell.OneDimensionalX)

Bug fixes

Fixes a bug in the "pouch_cell_model" notebook where the z coordinate values used to evaluate the results were being scaled by the cell height (this was a hangover from when the PyBaMM model formulation used to be non-dimensional).

Fixes #3221

Key checklist:

  • No style issues: $ pre-commit run (or $ nox -s pre-commit) (see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)
  • All tests pass: $ python run-tests.py --all (or $ nox -s tests)
  • The documentation builds: $ python run-tests.py --doctest (or $ nox -s doctests)

You can run integration tests, unit tests, and doctests together at once, using $ python run-tests.py --quick (or $ nox -s quick).

Further checks:

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@rtimms rtimms changed the title Issue 3221 spatial cooling [WIP] Issue 3221 spatial cooling Aug 8, 2023
@codecov
Copy link

codecov bot commented Aug 8, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01% ⚠️

Comparison is base (f4dfbe7) 99.71% compared to head (f7c3e99) 99.70%.
Report is 3 commits behind head on develop.

❗ Current head f7c3e99 differs from pull request most recent head 2153209. Consider uploading reports for the commit 2153209 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3257      +/-   ##
===========================================
- Coverage    99.71%   99.70%   -0.01%     
===========================================
  Files          248      248              
  Lines        18871    18890      +19     
===========================================
+ Hits         18817    18835      +18     
- Misses          54       55       +1     
Files Changed Coverage Δ
pybamm/discretisations/discretisation.py 99.78% <ø> (ø)
...s/submodels/equivalent_circuit_elements/thermal.py 100.00% <ø> (ø)
pybamm/models/submodels/particle/base_particle.py 100.00% <ø> (ø)
pybamm/models/submodels/thermal/__init__.py 100.00% <ø> (ø)
pybamm/expression_tree/exceptions.py 100.00% <100.00%> (ø)
...m/models/full_battery_models/base_battery_model.py 99.54% <100.00%> (-0.23%) ⬇️
...s/full_battery_models/lithium_ion/electrode_soh.py 100.00% <100.00%> (ø)
pybamm/models/submodels/thermal/base_thermal.py 100.00% <100.00%> (ø)
pybamm/models/submodels/thermal/isothermal.py 100.00% <100.00%> (ø)
pybamm/models/submodels/thermal/lumped.py 100.00% <100.00%> (ø)
... and 7 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rtimms rtimms changed the title [WIP] Issue 3221 spatial cooling Issue 3221 spatial cooling Aug 10, 2023
Copy link
Member

@brosaplanella brosaplanella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

Comment on lines +12 to 15
- The `OneDimensionalX` thermal model has been updated to account for edge/tab cooling and account for the current collector volumetric heat capacity. It now gives the correct behaviour compared with a lumped model with the correct total heat transfer coefficient and surface area for cooling. ([#3042](https://github.com/pybamm-team/PyBaMM/pull/3042))
- Fixed a bug where the "basic" lithium-ion models gave incorrect results when using nonlinear particle diffusivity ([#3207](https://github.com/pybamm-team/PyBaMM/pull/3207))
- Particle size distributions now work with SPMe and NewmanTobias models ([#3207](https://github.com/pybamm-team/PyBaMM/pull/3207))
- Fix to simulate c_rate steps with drive cycles ([#3186](https://github.com/pybamm-team/PyBaMM/pull/3186))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- The `OneDimensionalX` thermal model has been updated to account for edge/tab cooling and account for the current collector volumetric heat capacity. It now gives the correct behaviour compared with a lumped model with the correct total heat transfer coefficient and surface area for cooling. ([#3042](https://github.com/pybamm-team/PyBaMM/pull/3042))
- Fixed a bug where the "basic" lithium-ion models gave incorrect results when using nonlinear particle diffusivity ([#3207](https://github.com/pybamm-team/PyBaMM/pull/3207))
- Particle size distributions now work with SPMe and NewmanTobias models ([#3207](https://github.com/pybamm-team/PyBaMM/pull/3207))
- Fix to simulate c_rate steps with drive cycles ([#3186](https://github.com/pybamm-team/PyBaMM/pull/3186))
- Fixed a bug where the "basic" lithium-ion models gave incorrect results when using nonlinear particle diffusivity ([#3207](https://github.com/pybamm-team/PyBaMM/pull/3207))
- Particle size distributions now work with SPMe and NewmanTobias models ([#3207](https://github.com/pybamm-team/PyBaMM/pull/3207))
- Fix to simulate c_rate steps with drive cycles ([#3186](https://github.com/pybamm-team/PyBaMM/pull/3186))
- The `OneDimensionalX` thermal model has been updated to account for edge/tab cooling and account for the current collector volumetric heat capacity. It now gives the correct behaviour compared with a lumped model with the correct total heat transfer coefficient and surface area for cooling. ([#3042](https://github.com/pybamm-team/PyBaMM/pull/3042))

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just changed the order

@rtimms rtimms merged commit 580d779 into develop Aug 15, 2023
16 of 18 checks passed
@rtimms rtimms deleted the issue-3321-spatial-cooling branch August 15, 2023 06:37
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.

Allow ambient temperature and heat transfer coefficient to depend on space
2 participants