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

Add new electrolyte functions from Landesfeind 2019 #860

Merged
merged 4 commits into from
Mar 10, 2020

Conversation

TomTranter
Copy link
Contributor

@TomTranter TomTranter commented Feb 26, 2020

Description

Add new electrolyte functions for conductivity and diffusivity from Landesfeind 2019

Fixes # 859

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

@valentinsulzer valentinsulzer changed the base branch from master to develop February 26, 2020 18:50
import numpy as np


def electrolyte_conductivity_Landesfeind2019_EC_DMC_1_1(c_e, T, T_inf, E_k_e, R_g):
Copy link
Member

Choose a reason for hiding this comment

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

should we get rid of T_inf, E_k_E and R_g as inputs to these functions in general? When they are needed, they can easily be called from within the function as pybamm.standard_parameters_lithium_ion.T_inf, etc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For R_g I would say yes. For T_inf could there be a situation where the reference temperature for different functions is different? We could also use **kwargs potentially although I don't know if that would work with the expression tree. But yeah if you see fewer problems I'm happy to make the changes

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should definitely be open to the idea of different functional dependencies of these things, so being less prescriptive in terms of inputs is probably good

Copy link
Member

Choose a reason for hiding this comment

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

if it's specific to a function then maybe it should be hard-coded into the function itself (same with E_k_e)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah maybe you are right, If there were a specific reference temperature it would probably be hardcoded into the function if there were other parameters dependent on that.

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, but can you double check the units in the diffusion coefficient are right?

Copy link
Contributor

@rtimms rtimms left a comment

Choose a reason for hiding this comment

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

thanks @TomTranter ! looks good, pending checking the units

@codecov
Copy link

codecov bot commented Feb 28, 2020

Codecov Report

Merging #860 into develop will increase coverage by 0.06%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #860      +/-   ##
===========================================
+ Coverage    97.68%   97.74%   +0.06%     
===========================================
  Files          209      217       +8     
  Lines        10587    10888     +301     
===========================================
+ Hits         10342    10643     +301     
  Misses         245      245
Impacted Files Coverage Δ
...9/electrolyte_conductivity_Landesfeind2019_base.py 100% <100%> (ø)
...olyte_conductivity_Landesfeind2019_EMC_FEC_19_1.py 100% <100%> (ø)
...trolyte_conductivity_Landesfeind2019_EC_EMC_3_7.py 100% <100%> (ø)
...19/electrolyte_diffusivity_Landesfeind2019_base.py 100% <100%> (ø)
...ctrolyte_diffusivity_Landesfeind2019_EC_EMC_3_7.py 100% <100%> (ø)
...trolyte_conductivity_Landesfeind2019_EC_DMC_1_1.py 100% <100%> (ø)
...rolyte_diffusivity_Landesfeind2019_EMC_FEC_19_1.py 100% <100%> (ø)
...ctrolyte_diffusivity_Landesfeind2019_EC_DMC_1_1.py 100% <100%> (ø)
...m/models/full_battery_models/base_battery_model.py 100% <0%> (ø) ⬆️
... and 8 more

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 4bf5990...23cbc5f. 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 to me. Thanks Tom!

@valentinsulzer valentinsulzer merged commit 6b9b505 into develop Mar 10, 2020
@valentinsulzer valentinsulzer deleted the issue-859-landesfeind-electrolyte-functions branch March 10, 2020 14:50
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.

4 participants