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 983 half cell #1121

Merged
merged 46 commits into from
Aug 11, 2020

Conversation

brosaplanella
Copy link
Sponsor Member

Description

Basic DFN model for a half-cell. This is an experimental functionality which doesn't support all PyBaMM features (e.g. experiments) and which will be integrated into the submodel structure in the future.

Fixes #983

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)

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 Aug 3, 2020

Codecov Report

Merging #1121 into develop will increase coverage by 0.02%.
The diff coverage is 99.48%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1121      +/-   ##
===========================================
+ Coverage    97.87%   97.90%   +0.02%     
===========================================
  Files          245      246       +1     
  Lines        13382    13572     +190     
===========================================
+ Hits         13098    13287     +189     
- Misses         284      285       +1     
Impacted Files Coverage Δ
...m/models/full_battery_models/base_battery_model.py 99.65% <ø> (ø)
..._battery_models/lithium_ion/basic_dfn_half_cell.py 99.20% <99.20%> (ø)
pybamm/expression_tree/binary_operators.py 95.51% <100.00%> (+0.27%) ⬆️
...mm/expression_tree/operations/convert_to_casadi.py 95.09% <100.00%> (+0.30%) ⬆️
pybamm/expression_tree/symbol.py 97.46% <100.00%> (+0.01%) ⬆️
pybamm/expression_tree/unary_operators.py 100.00% <100.00%> (ø)
...models/full_battery_models/lithium_ion/__init__.py 100.00% <100.00%> (ø)
pybamm/simulation.py 96.80% <100.00%> (+0.02%) ⬆️
pybamm/solvers/base_solver.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 dd37a7f...e296965. Read the comment docs.

Copy link
Member

@valentinsulzer valentinsulzer left a comment

Choose a reason for hiding this comment

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

Thanks @ferranbrosa , the model looks good. There should be a test that the half-cell DFN can be solved (without Simulation)

Copy link
Contributor

@TomTranter TomTranter left a comment

Choose a reason for hiding this comment

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

Hi Ferran, I've run the code and checked the plots for positive and negative and seems fine. I think as this is a work in progress we should merge - it would be nice to have this fully integrated into the modelling framework so we can add thermal models etc and look at changes in entropy on the half cells. I think actually a lot of microstructure models are just done on half cells so it would be a really useful feature and we should think about how to do it by just flexibly specifying what each electrode is. I don't know if that would cause too many headaches

Copy link
Member

@valentinsulzer valentinsulzer 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 to me once the tests are fixed!

pybamm/solvers/base_solver.py Outdated Show resolved Hide resolved
@valentinsulzer valentinsulzer merged commit c229326 into pybamm-team:develop Aug 11, 2020
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.

Half-cell model for Li-ion battery
3 participants