-
-
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
Newman tobias model #1423
Merged
Merged
Newman tobias model #1423
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
416d91a
add newman tobias
rtimms a33e790
debug tests
rtimms 548e1f1
add citations
rtimms 48a2b23
debug tests
rtimms 1ade8e9
Merge branch 'develop' into newman-tobias
rtimms c498bea
update model and add pouch example
rtimms 42b45a9
Merge branch 'develop' into newman-tobias
rtimms 238ed9f
Merge branch 'develop' into newman-tobias
rtimms 3392216
Merge branch 'develop' into newman-tobias
rtimms a24d904
update docstring
rtimms 0dc9bc3
style
rtimms 37ca771
remove example
rtimms c1a1d14
Merge branch 'develop' into newman-tobias
rtimms d14a041
changelog
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
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 |
---|---|---|
|
@@ -7,3 +7,4 @@ Lithium-ion Models | |
spm | ||
spme | ||
dfn | ||
newman_tobias |
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 @@ | ||
Newman-Tobias | ||
============= | ||
|
||
.. autoclass:: pybamm.lithium_ion.NewmanTobias | ||
: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
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
111 changes: 111 additions & 0 deletions
111
pybamm/models/full_battery_models/lithium_ion/newman_tobias.py
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,111 @@ | ||
# | ||
# Newman Tobias Model | ||
# | ||
import pybamm | ||
from .dfn import DFN | ||
|
||
|
||
class NewmanTobias(DFN): | ||
""" | ||
Newman-Tobias model of a lithium-ion battery based on the formulation in [1]_. | ||
This model assumes a uniform concentration profile in the electrolyte. | ||
Unlike the model posed in [1]_, this model accounts for nonlinear Butler-Volmer | ||
kinetics. It also tracks the average concentration in the solid phase in each | ||
electrode, which is equivalent to including an equation for the local state of | ||
charge as in [2]_. The user can pass the "particle" option to include mass | ||
transport in the particles. | ||
|
||
Parameters | ||
---------- | ||
options : dict, optional | ||
A dictionary of options to be passed to the model. | ||
name : str, optional | ||
The name of the model. | ||
build : bool, optional | ||
Whether to build the model on instantiation. Default is True. Setting this | ||
option to False allows users to change any number of the submodels before | ||
building the complete model (submodels cannot be changed after the model is | ||
built). | ||
|
||
References | ||
---------- | ||
.. [1] JS Newman and CW Tobias. "Theoretical Analysis of Current Distribution | ||
in Porous Electrodes". Journal of The Electrochemical Society, | ||
109(12):A1183-A1191, 1962 | ||
.. [2] HN Chu, SU Kim, SK Rahimian, JB Siegel and CW Monroe. "Parameterization | ||
of prismatic lithium–iron–phosphate cells through a streamlined | ||
thermal/electrochemical model". Journal of Power Sources, 453, p.227787, | ||
2020 | ||
|
||
|
||
**Extends:** :class:`pybamm.lithium_ion.DFN` | ||
""" | ||
|
||
def __init__(self, options=None, name="Newman-Tobias model", build=True): | ||
|
||
# Set default option "uniform profile" for particle submodel. Other | ||
# default options are those given in `pybamm.Options` defined in | ||
# `base_battery_model.py`. | ||
options = options or {} | ||
if "particle" not in options: | ||
options["particle"] = "uniform profile" | ||
|
||
super().__init__(options, name, build) | ||
|
||
pybamm.citations.register("Newman1962") | ||
pybamm.citations.register("Chu2020") | ||
|
||
def set_particle_submodel(self): | ||
|
||
if self.options["particle"] == "Fickian diffusion": | ||
self.submodels["negative particle"] = pybamm.particle.FickianSingleParticle( | ||
self.param, "Negative" | ||
) | ||
self.submodels["positive particle"] = pybamm.particle.FickianSingleParticle( | ||
self.param, "Positive" | ||
) | ||
elif self.options["particle"] in [ | ||
"uniform profile", | ||
"quadratic profile", | ||
"quartic profile", | ||
]: | ||
self.submodels[ | ||
"negative particle" | ||
] = pybamm.particle.PolynomialSingleParticle( | ||
self.param, "Negative", self.options["particle"] | ||
) | ||
self.submodels[ | ||
"positive particle" | ||
] = pybamm.particle.PolynomialSingleParticle( | ||
self.param, "Positive", self.options["particle"] | ||
) | ||
|
||
def set_electrolyte_submodel(self): | ||
|
||
surf_form = pybamm.electrolyte_conductivity.surface_potential_form | ||
|
||
self.submodels[ | ||
"electrolyte diffusion" | ||
] = pybamm.electrolyte_diffusion.ConstantConcentration(self.param) | ||
|
||
if self.options["electrolyte conductivity"] not in ["default", "full"]: | ||
raise pybamm.OptionError( | ||
"electrolyte conductivity '{}' not suitable for Newman-Tobias".format( | ||
self.options["electrolyte conductivity"] | ||
) | ||
) | ||
|
||
if self.options["surface form"] == "false": | ||
self.submodels[ | ||
"electrolyte conductivity" | ||
] = pybamm.electrolyte_conductivity.Full(self.param) | ||
elif self.options["surface form"] == "differential": | ||
for domain in ["Negative", "Separator", "Positive"]: | ||
self.submodels[ | ||
domain.lower() + " electrolyte conductivity" | ||
] = surf_form.FullDifferential(self.param, domain) | ||
elif self.options["surface form"] == "algebraic": | ||
for domain in ["Negative", "Separator", "Positive"]: | ||
self.submodels[ | ||
domain.lower() + " electrolyte conductivity" | ||
] = surf_form.FullAlgebraic(self.param, domain) |
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
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.
is this related to what @brosaplanella was seeing?
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.
looks like it. you can get 4dp of accuracy everywhere else.