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

simplify nondimensionalisation of kinetics #2236

Merged
merged 7 commits into from
Aug 22, 2022

Conversation

valentinsulzer
Copy link
Member

Description

Simplifies non-dimensionalisation of the kinetics, which I think was making things overly complicated.

Previously, j0 was calculated as =

j0 = gamma * j0(...) / C_r

but
Screen Shot 2022-08-16 at 5 24 10 PM

and we are currently scaling j0(...) as j0(...) = j0_dim(...) / j0_ref, so

j0 = gamma * j0_dim(...) / j0_ref / C_r = j0_dim(...) / j_scale

and if instead we scale j0(...) = j0_dim(...) / j_scale then

j0 = j0(...)

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 requested review from rtimms and brosaplanella and removed request for rtimms August 17, 2022 10:43
@codecov
Copy link

codecov bot commented Aug 17, 2022

Codecov Report

Merging #2236 (6f56220) into develop (a1bc678) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff            @@
##           develop    #2236   +/-   ##
========================================
  Coverage    99.36%   99.36%           
========================================
  Files          357      357           
  Lines        19514    19514           
========================================
+ Hits         19390    19391    +1     
+ Misses         124      123    -1     
Impacted Files Coverage Δ
...odels/full_battery_models/lithium_ion/basic_dfn.py 100.00% <100.00%> (ø)
..._battery_models/lithium_ion/basic_dfn_half_cell.py 99.01% <100.00%> (ø)
...odels/full_battery_models/lithium_ion/basic_spm.py 100.00% <100.00%> (ø)
...ybamm/models/submodels/interface/base_interface.py 100.00% <100.00%> (ø)
pybamm/parameters/lithium_ion_parameters.py 100.00% <100.00%> (ø)
pybamm/expression_tree/symbol.py 98.79% <0.00%> (+0.24%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@valentinsulzer
Copy link
Member Author

just sanity checking

Screen Shot 2022-08-17 at 5 40 21 PM

Copy link
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 @tinosulzer!

@brosaplanella
Copy link
Member

BTW, should we set a deprecation warning for the unused constants with the deprecated package?

@valentinsulzer
Copy link
Member Author

BTW, should we set a deprecation warning for the unused constants with the deprecated package?

the parameters are still there, so where were you thinking of adding the warning?

Also I have no idea why that test is failing, and only on python 3.7

@brosaplanella
Copy link
Member

Yes, not too fussed about the test.

I mean that, if the dimensionless numbers are not used, we might want to get rid of them eventually. If so, we can use deprecated to fail at a given release so we remove it.

@valentinsulzer valentinsulzer merged commit 1472d97 into develop Aug 22, 2022
@valentinsulzer valentinsulzer deleted the simplify-reaction-scaling branch August 22, 2022 13:38
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.

2 participants