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

#1957 return heat source in isothermal models #1958

Merged
merged 8 commits into from
Mar 9, 2022
Merged

Conversation

rtimms
Copy link
Contributor

@rtimms rtimms commented Mar 2, 2022

Description

Fixes a bug where the isothermal submodel doesn't calculate any heat source terms. There is a new option "calculate heat source for isothermal models" that is "false" by default and "true" otherwise. Default is "false" since this option may require additional parameters not needed by the electrochemical model (specifically current collector parameters).

Fixes #1957

Type of change

Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s. If necessary, also add to the list of breaking changes.

  • New feature (non-breaking change which adds functionality)
  • Optimization (back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)

Key checklist:

  • No style issues: $ flake8
  • All tests pass: $ python run-tests.py --unit
  • The documentation builds: $ cd docs and then $ make clean; make html

You can run all three at once, using $ python run-tests.py --quick.

Further checks:

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

@codecov
Copy link

codecov bot commented Mar 2, 2022

Codecov Report

Merging #1958 (9a1f455) into develop (fb76610) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 9a1f455 differs from pull request most recent head 2de921e. Consider uploading reports for the commit 2de921e to get more accurate results

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #1958   +/-   ##
========================================
  Coverage    99.32%   99.32%           
========================================
  Files          346      346           
  Lines        19058    19064    +6     
========================================
+ Hits         18930    18936    +6     
  Misses         128      128           
Impacted Files Coverage Δ
...m/models/full_battery_models/base_battery_model.py 99.76% <ø> (ø)
pybamm/models/submodels/thermal/isothermal.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fb76610...2de921e. Read the comment docs.

Copy link
Sponsor 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 good! I didn't review the last PR, so is there any tests that checks that the heat source terms are calculated correctly?

@rtimms
Copy link
Contributor Author

rtimms commented Mar 4, 2022

Do you mean to test if the variables have the correct expression (i.e. zero or not)? Or some numerical check on the actual values?

@brosaplanella
Copy link
Sponsor Member

Do you mean to test if the variables have the correct expression (i.e. zero or not)? Or some numerical check on the actual values?

I guess both, though just realised I don't know if we are testing this for the other variables anyway haha

@rtimms
Copy link
Contributor Author

rtimms commented Mar 7, 2022

I guess both, though just realised I don't know if we are testing this for the other variables anyway haha

We compare outputs across different models that should be the same and have some tests on variables for things like conservation or checking that things that should be increasing are increasing etc., but we don't test for correct values.

I'll merge this for now, but maybe we can revisit if there are any useful extra tests on variables.

@rtimms rtimms merged commit abba68e into develop Mar 9, 2022
@rtimms rtimms deleted the issue-1957-q-iso branch March 9, 2022 12:59
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.

[Bug]: isothermal model doesn't get heat source terms
2 participants