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

Pass R(x) directly for graded electrodes #1237

Merged
merged 7 commits into from
Nov 13, 2020
Merged

Pass R(x) directly for graded electrodes #1237

merged 7 commits into from
Nov 13, 2020

Conversation

rtimms
Copy link
Contributor

@rtimms rtimms commented Nov 9, 2020

Description

The parameters "Positive/Negative particle distribution in x" and "Positive/Negative surface area per unit volume distribution in x" have been deprecated. Instead, users can provide "Positive/Negative particle radius [m]" and "Positive/Negative surface area per unit volume [m-1]" directly as functions of through-cell position (x [m])

The parameters related to this (in LithiumIonParameters and LeadAcidParameters) are now defined as follows:

R_n_dimensional(x) the dimensional particle radius in the negative electrode as a function of dimensional through-cell position
R_p_dimensional(x) the dimensional particle radius in the positive electrode as a function of dimensional through-cell position
a_n_dimensional(x) the dimensional surface area per unit volume in the negative electrode as a function of dimensional through-cell position
a_p_dimensional(x) the dimensional surface area per unit volume in the positive electrode as a function of dimensional through-cell position
R_n_typ the typical radius in the negative electrode (taken to be the radius at the electrode/current collector interface)
R_p_typ the typical radius in the positive electrode (taken to be the radius at the electrode/current collector interface)
a_n_typ the typical surface area per unit volume in the negative electrode (taken to be the radius at the electrode/current collector interface)
a_p_typ the typical surface area per unit volume in the positive electrode (taken to be the radius at the electrode/current collector interface)
a_R_n the product of typical surface area per unit volume and typical radius in the negative electrode (dimensionless)
a_R_p the product of typical surface area per unit volume and typical radius in the positive electrode (dimensionless)
R_n(x) the dimensionless particle radius in the negative electrode as a function of dimensionless through-cell position
R_p(x) the dimensionless particle radius in the positive electrode as a function of dimensionless through-cell position
a_n(x) the dimensionless surface area per unit volume in the negative electrode as a function of dimensionless through-cell position
a_p(x) the dimensionless surface area per unit volume in the positive electrode as a function of dimensionless through-cell position

The last four are equal to unity for uniform radius/surface area per unit volume.

Fixes #1236

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 Nov 9, 2020

Codecov Report

Merging #1237 (9731e57) into develop (2d57749) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #1237   +/-   ##
========================================
  Coverage    97.95%   97.96%           
========================================
  Files          250      250           
  Lines        14397    14423   +26     
========================================
+ Hits         14103    14129   +26     
  Misses         294      294           
Impacted Files Coverage Δ
...ttery_models/lithium_ion/base_lithium_ion_model.py 100.00% <ø> (ø)
...odels/full_battery_models/lithium_ion/basic_dfn.py 100.00% <ø> (ø)
...odels/full_battery_models/lithium_ion/basic_spm.py 100.00% <ø> (ø)
...dels/submodels/particle/fickian_single_particle.py 100.00% <ø> (ø)
pybamm/parameters/geometric_parameters.py 100.00% <ø> (ø)
...m/models/full_battery_models/base_battery_model.py 99.67% <100.00%> (ø)
..._battery_models/lithium_ion/basic_dfn_half_cell.py 99.21% <100.00%> (ø)
pybamm/models/submodels/electrode/ohm/full_ohm.py 100.00% <100.00%> (ø)
...dels/electrolyte_conductivity/full_conductivity.py 100.00% <100.00%> (ø)
...e_potential_form/full_surface_form_conductivity.py 100.00% <100.00%> (ø)
... and 10 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 2d57749...2a35655. 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, thanks Rob!

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, thanks!

@rtimms rtimms changed the title #1236 update input strings Pass R(x) directly for graded electrodes Nov 12, 2020
@rtimms rtimms merged commit 828c31f into develop Nov 13, 2020
@rtimms rtimms deleted the issue-1236-r-of-x branch November 13, 2020 09:25
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.

R of x gets passed dimensionless x
3 participants