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

[Bug]: Lumped thermal model conflates cell volume with electrode volume #3611

Closed
ejfdickinson opened this issue Dec 12, 2023 · 2 comments · Fixed by #3707
Closed

[Bug]: Lumped thermal model conflates cell volume with electrode volume #3611

ejfdickinson opened this issue Dec 12, 2023 · 2 comments · Fixed by #3707
Labels
bug Something isn't working

Comments

@ejfdickinson
Copy link

PyBaMM Version

23.9

Python Version

3.9.13

Describe the bug

The lumped thermal model (class Lumped) utilises the "Volume-averaged total heating [W.m-3]" variable for the cell heat equation, in conjunction with cell volume "Cell volume [m3]".

However, the volume-averaged total heating variable does not respect the cell volume when computed. Instead it uses a successive averaging approach which causes the resulting value to reflect only the apparent volume of the electrodes (as electrode pairs with separator and current collector), as the product of total electrode thickness * height * width. Consequently, the resulting applied total heat source on the cell is in error by the ratio of cell volume to electrode volume.

A safer computation route for total cell heating would be the product height * width with the integrated heat source per unit simulated electrode-pair area (unit: W/m2).

Spotters: Darryl Doyle (@darryl-ad ), Ivan Korotkin

Steps to Reproduce

Although the specified cell volume exceeds the product of modelled 1D thickness with electrode area (as expected due to inactive dead space in the cell), the lumped thermal model utilises a volumetric heat source (vs cell volume) that is identical to the X-averaged volumetric heat source at 1D simulation scale.

import pybamm

model = pybamm.lithium_ion.DFN(
    options={
        "thermal": "lumped"
    }
)

experiment = pybamm.Experiment(
    [
        "Rest for 1 s",
        "Discharge at 1C until 3.6 V"
    ]
)

parameter_values = pybamm.ParameterValues("ORegan2022")
parameter_values["Cell volume [m3]"] = 70e-3 * ((21e-3/2) ** 2) * 3.14159

sim = pybamm.Simulation(
    model=model,
    experiment=experiment,
    parameter_values=parameter_values
)

sol = sim.solve()

contributing_layers = [
    "Negative current collector",
    "Negative electrode",
    "Separator",
    "Positive electrode",
    "Positive current collector"
]

thickness = sum([
    parameter_values[layer + " thickness [m]"] for layer in contributing_layers
])
electrode_volume = thickness * parameter_values["Electrode height [m]"] * parameter_values["Electrode width [m]"]

print("Difference of local and global volumetric heat source:", sol["X-averaged total heating [W.m-3]"].entries - sol["Volume-averaged total heating [W.m-3]"].entries)
print("Global (cell) volume:", parameter_values["Cell volume [m3]"])
print("Local (modelled) volume:", electrode_volume)

Relevant log output

No response

@ejfdickinson ejfdickinson added the bug Something isn't working label Dec 12, 2023
@ejfdickinson
Copy link
Author

On further thinking, it could be argued that this is really a bug in create_from_bpx, which ought to correct for the difference between Cell volume [m3] and electrode volume before applying the cell density and specific heat capacities uniformly to the electrodes.

However, the appearance of the true cell_volume in the heat transfer coefficient term in Lumped still suggests that it would really be better if Lumped addressed the total cell volume in all cases, not just the implied volume of electrochemically simulated active material.

@rtimms
Copy link
Contributor

rtimms commented Dec 18, 2023

Thanks for pointing this out. I think we should add variables for "integrated heat source per unit simulated electrode-pair area (unit: W/m2)" and "... heating [W]" as part of doing this, and make distinctions between "Volume-averaged" i.e. the actual cell volume and "Apparent volume-averaged" over the "actually battery stuff". What are your suggestions for good, informative names for these?

rtimms added a commit that referenced this issue Jan 10, 2024
rtimms added a commit that referenced this issue Jan 16, 2024
rtimms added a commit that referenced this issue Jan 16, 2024
kratman pushed a commit that referenced this issue Jan 16, 2024
* #3611 use actual cell volume for average total heating

* #3611 changelog

* #3611 account for number of electrode pairs

* #3611 update variable names
Saransh-cpp pushed a commit that referenced this issue Jan 16, 2024
* #3611 changelog

* #3611 account for number of electrode pairs

* #3611 update variable names
Saransh-cpp pushed a commit that referenced this issue Jan 16, 2024
* #3611 use actual cell volume for average total heating

* #3611 changelog

* #3611 account for number of electrode pairs

* #3611 update variable names
rtimms added a commit that referenced this issue May 16, 2024
* Bump to v23.9rc0

* Merge pull request #3412 from agriyakhetarpal/drop-i686-manylinux2014-support

Drop support for i686 manylinux

* Merge pull request #3413 from Saransh-cpp/improve-release-workflow

Improve release workflow, add a note, bump version manually

* Merge pull request #3436 from Saransh-cpp/fortnightly-wheels

Build wheels on the 1st and 15th of every month

* Merge pull request #3445 from pybamm-team/issue-3428-rename-exchange

#3428 exchange-current density error

* Merge pull request #3449 from pybamm-team/i3431-windows-wheels

Fix failing windows wheel builds

* Merge pull request #3456 from abillscmu/issue-3224-initial_soc

make initial soc work with half cell models

* Merge pull request #3467 from abillscmu/bugfix/initial_soh

* Merge pull request #3423 from jsbrittain/jax_gpu

JaxSolver fails when using GPU support with no input parameters

* Fix changelog

* Merge pull request #3475 from arjxn-py/fix-default-imports

Resolve default imports for optional dependencies

* Bump - `v23.9rc1`

* Fix date in CHANGELOG

* Bump version to v23.9

* Fix docs about Jax solver compatibility with Python versions (#3702)

* Ensure correct Python versions for Jax solver compatibility

* Simplify array of Python versions

Co-authored-by: Eric G. Kratz <[email protected]>

* Use different conjunction

Co-authored-by: Eric G. Kratz <[email protected]>

---------

Co-authored-by: Eric G. Kratz <[email protected]>

* Merge pull request #3706 from agriyakhetarpal/fix-pybamm-install-odes

Make `pybamm_install_odes` a bit more robust

* #3690 fix issue with skipped steps (#3708)

* #3690 fix issue with skipped steps

* #3690 changelog

* #3690 add test

* #3611 use actual cell volume for average total heating (#3707)

* #3611 use actual cell volume for average total heating

* #3611 changelog

* #3611 account for number of electrode pairs

* #3611 update variable names

* Improve the release workflow (#3737)

* Try fixing the release workflow

* Turn off safety

* Fix CHANGELOG

* Add OS

* Use regex for better matches

* Update instructions, add safety checks

* checkout to the version branch for the final release

* Bump to v24.1rc1

* #3630 fix interpolant shape error (#3761)

* #3630 fix interpolant shape error

* #3630 changelog

* Bump to v24.1rc2

* Bump to v24.1

* Fix doctests failures in scheduled tests (#3784)

Closes #3781

* Resolve broken `scikits.odes` installation on self-hosted M-series runner (#3785)

* Try fixing M-series runner tests

This is being done by adding SuiteSparse and SUNDIALS installations which might have been missing on the runner, which broke `scikits.odes`.

* Don't use Homebrew SUNDIALS, use LD_LIBRARY_PATH

* Don't use Homebrew to install SUNDIALS

* Force remove pip cache for `scikits.odes`

---------

Co-authored-by: Eric G. Kratz <[email protected]>

* add temperature dependence to MSMR model

* changelog

* fix tests

* fix example

* rob comments

* update notebook

---------

Co-authored-by: Ferran Brosa Planella <[email protected]>
Co-authored-by: Saransh Chopra <[email protected]>
Co-authored-by: Martin Robinson <[email protected]>
Co-authored-by: Agriya Khetarpal <[email protected]>
Co-authored-by: Eric G. Kratz <[email protected]>
Co-authored-by: Robert Timms <[email protected]>
Co-authored-by: Saransh-cpp <[email protected]>
js1tr3 pushed a commit to js1tr3/PyBaMM that referenced this issue Aug 12, 2024
…bamm-team#3707)

* pybamm-team#3611 use actual cell volume for average total heating

* pybamm-team#3611 changelog

* pybamm-team#3611 account for number of electrode pairs

* pybamm-team#3611 update variable names
js1tr3 pushed a commit to js1tr3/PyBaMM that referenced this issue Aug 12, 2024
* Bump to v23.9rc0

* Merge pull request pybamm-team#3412 from agriyakhetarpal/drop-i686-manylinux2014-support

Drop support for i686 manylinux

* Merge pull request pybamm-team#3413 from Saransh-cpp/improve-release-workflow

Improve release workflow, add a note, bump version manually

* Merge pull request pybamm-team#3436 from Saransh-cpp/fortnightly-wheels

Build wheels on the 1st and 15th of every month

* Merge pull request pybamm-team#3445 from pybamm-team/issue-3428-rename-exchange

pybamm-team#3428 exchange-current density error

* Merge pull request pybamm-team#3449 from pybamm-team/i3431-windows-wheels

Fix failing windows wheel builds

* Merge pull request pybamm-team#3456 from abillscmu/issue-3224-initial_soc

make initial soc work with half cell models

* Merge pull request pybamm-team#3467 from abillscmu/bugfix/initial_soh

* Merge pull request pybamm-team#3423 from jsbrittain/jax_gpu

JaxSolver fails when using GPU support with no input parameters

* Fix changelog

* Merge pull request pybamm-team#3475 from arjxn-py/fix-default-imports

Resolve default imports for optional dependencies

* Bump - `v23.9rc1`

* Fix date in CHANGELOG

* Bump version to v23.9

* Fix docs about Jax solver compatibility with Python versions (pybamm-team#3702)

* Ensure correct Python versions for Jax solver compatibility

* Simplify array of Python versions

Co-authored-by: Eric G. Kratz <[email protected]>

* Use different conjunction

Co-authored-by: Eric G. Kratz <[email protected]>

---------

Co-authored-by: Eric G. Kratz <[email protected]>

* Merge pull request pybamm-team#3706 from agriyakhetarpal/fix-pybamm-install-odes

Make `pybamm_install_odes` a bit more robust

* pybamm-team#3690 fix issue with skipped steps (pybamm-team#3708)

* pybamm-team#3690 fix issue with skipped steps

* pybamm-team#3690 changelog

* pybamm-team#3690 add test

* pybamm-team#3611 use actual cell volume for average total heating (pybamm-team#3707)

* pybamm-team#3611 use actual cell volume for average total heating

* pybamm-team#3611 changelog

* pybamm-team#3611 account for number of electrode pairs

* pybamm-team#3611 update variable names

* Improve the release workflow (pybamm-team#3737)

* Try fixing the release workflow

* Turn off safety

* Fix CHANGELOG

* Add OS

* Use regex for better matches

* Update instructions, add safety checks

* checkout to the version branch for the final release

* Bump to v24.1rc1

* pybamm-team#3630 fix interpolant shape error (pybamm-team#3761)

* pybamm-team#3630 fix interpolant shape error

* pybamm-team#3630 changelog

* Bump to v24.1rc2

* Bump to v24.1

* Fix doctests failures in scheduled tests (pybamm-team#3784)

Closes pybamm-team#3781

* Resolve broken `scikits.odes` installation on self-hosted M-series runner (pybamm-team#3785)

* Try fixing M-series runner tests

This is being done by adding SuiteSparse and SUNDIALS installations which might have been missing on the runner, which broke `scikits.odes`.

* Don't use Homebrew SUNDIALS, use LD_LIBRARY_PATH

* Don't use Homebrew to install SUNDIALS

* Force remove pip cache for `scikits.odes`

---------

Co-authored-by: Eric G. Kratz <[email protected]>

* add temperature dependence to MSMR model

* changelog

* fix tests

* fix example

* rob comments

* update notebook

---------

Co-authored-by: Ferran Brosa Planella <[email protected]>
Co-authored-by: Saransh Chopra <[email protected]>
Co-authored-by: Martin Robinson <[email protected]>
Co-authored-by: Agriya Khetarpal <[email protected]>
Co-authored-by: Eric G. Kratz <[email protected]>
Co-authored-by: Robert Timms <[email protected]>
Co-authored-by: Saransh-cpp <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants