-
-
Notifications
You must be signed in to change notification settings - Fork 553
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
Polynomial concentration #1130
Merged
+1,549
−501
Merged
Polynomial concentration #1130
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
426c025
start adding polynomial particle models
rtimms e64ed47
#1128 two-parameter model
rtimms 0ee9ac4
#1128 order 0 and 2 working
rtimms c13bed4
#1128 quadratic and quartic concentration models
rtimms c3cd2f9
Merge branch 'develop' into polynomial-concentration
rtimms 9949966
#1128 changelog
rtimms dc31462
#1128 fix examples
rtimms 94db36a
Add notebook comparing models for particle diffusion
TomTranter 72e07c6
#1128 tino comments
rtimms fbb9af4
#1128 fix examples
rtimms File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
docs/source/models/submodels/particle/fast_many_particles.rst
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
docs/source/models/submodels/particle/fast_single_particle.rst
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
docs/source/models/submodels/particle/polynomial_many_particles.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Polynomial Many Particles | ||
========================= | ||
|
||
.. autoclass:: pybamm.particle.PolynomialManyParticles | ||
:members: |
5 changes: 5 additions & 0 deletions
5
docs/source/models/submodels/particle/polynomial_single_particle.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Polynomial Single Particle | ||
=========================== | ||
|
||
.. autoclass:: pybamm.particle.PolynomialSingleParticle | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# | ||
# Compare models for diffusion within the electrode particles | ||
# | ||
import pybamm | ||
|
||
# load models | ||
models = [ | ||
pybamm.lithium_ion.DFN( | ||
options={"particle": "Fickian diffusion"}, name="Fickian diffusion" | ||
), | ||
pybamm.lithium_ion.DFN( | ||
options={"particle": "uniform profile"}, name="uniform profile" | ||
), | ||
pybamm.lithium_ion.DFN( | ||
options={"particle": "quadratic profile"}, name="quadratic profile" | ||
), | ||
pybamm.lithium_ion.DFN( | ||
options={"particle": "quartic profile"}, name="quartic profile" | ||
), | ||
] | ||
|
||
# pick parameter values | ||
parameter_values = pybamm.ParameterValues(chemistry=pybamm.parameter_sets.Ecker2015) | ||
|
||
# create and solve simulations | ||
sims = [] | ||
for model in models: | ||
sim = pybamm.Simulation(model, parameter_values=parameter_values) | ||
sim.solve([0, 3600]) | ||
sims.append(sim) | ||
print("Particle model: {}".format(model.name)) | ||
print("Solve time: {}s".format(sim.solution.solve_time)) | ||
|
||
# plot results | ||
pybamm.dynamic_plot(sims) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
from .base_particle import BaseParticle | ||
from .fickian_many_particles import FickianManyParticles | ||
from .fickian_single_particle import FickianSingleParticle | ||
from .fast_many_particles import FastManyParticles | ||
from .fast_single_particle import FastSingleParticle | ||
from .polynomial_single_particle import PolynomialSingleParticle | ||
from .polynomial_many_particles import PolynomialManyParticles |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think here it makes more sense to pass the name of the option rather than the order. Otherwise one might naively wonder why there are no orders 1 and 3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree