Many-Particle Models - #1529
Conversation
valentinsulzer
left a comment
There was a problem hiding this comment.
Thanks, looks great now!
|
You can merge develop and push again to trigger the tests with the fix to new_copy |
| N_s_xav_distribution = -self.param.D_p( | ||
| c_s_xav_distribution, T_k_xav | ||
| ) * pybamm.grad(c_s_xav_distribution) / R | ||
| ) * pybamm.grad(c_s_xav_distribution) |
There was a problem hiding this comment.
This is just to make the definition of the nondimensional flux consistent with FickianManyParticles (where you can have a size distribution in x), and also the scaling used for the MP-DFN in our recent JES paper. The rhs is unchanged, as the factor of / R is just moved to lines 166 and 172, turning an / R into / R ** 2. Should make it easier to combine the "distribution" and "no distribution" submodels later on.
Meant to make this change much earlier, but seems I forgot. Sorry for the confusion here!
Codecov Report
@@ Coverage Diff @@
## develop #1529 +/- ##
===========================================
+ Coverage 97.78% 97.84% +0.05%
===========================================
Files 323 329 +6
Lines 17552 17987 +435
===========================================
+ Hits 17164 17599 +435
Misses 388 388
Continue to review full report at Codecov.
|
|
To describe the last few commits: I've added a few more tests to increase the coverage, particularly for For the |
|
Yeah we could definitely reduce some duplication in the processed variable tests |
Had a go at reducing the duplication by moving code into a method |
|
@all-contributors add @tobykirk for ideas, code, tests |
|
@tinosulzer I've put up a pull request to add @tobykirk! 🎉 |
Description
This branch adds the Many-Particle Model or MPM, a full lithium-ion battery model including a distribution of particle sizes in each electrode. The particle size is implemented as an additional "dimension", where the user specifies the continuous particle-size distribution which is then discretized. The model, it's features and how to use it are detailed in the notebook
examples/notebooks/MPM.ipynb.Included is a new submodel module
particle.size_distributionwith 2 submodelsFickianSingleSizeDistributionandFastSingleSizeDistribution(and a base distribution model) used by the MPM. These are the "X-averaged" ones, with submodels incorporating x-variation (FickianManySizeDistributions, etc.) to be merged later (pending the ability to have 4 domains). Changes to the existing code are currently quite minimal (probably to a fault!), mainly adding functionality where possible.The branch includes all the base functionality for the new "particle size" domain/dimension, including additions to
R_nandR_p)f_a_dist_n,f_a_dist_p)BaseInterfaceandBaseKinetics(where special treatment of variables that depend on "particle size" is needed)ProcessedVariableQuickPlotR_average()operator, for convenient particle-size averagingNot currently compatible with the degradation models, i.e., SEI, particle cracking/swelling, lithium plating - they are not allowed as options.
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.
Key checklist:
$ flake8$ python run-tests.py --unit$ cd docsand then$ make clean; make htmlYou can run all three at once, using
$ python run-tests.py --quick.Further checks: