Skip to content

Commit

Permalink
#1100 merge
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinsulzer committed Dec 30, 2020
2 parents 41ded61 + 2ec82b6 commit 2407617
Show file tree
Hide file tree
Showing 15 changed files with 190 additions and 154 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Features

- Added new functionality for `Interpolant` ([#1312](https://github.com/pybamm-team/PyBaMM/pull/1312))
- Reformatted the `BasicDFNHalfCell` to be consistent with the other models ([#1282](https://github.com/pybamm-team/PyBaMM/pull/1282))
- Added option to make the total interfacial current density a state ([#1280](https://github.com/pybamm-team/PyBaMM/pull/1280))
- Added functionality to initialize a model using the solution from another model ([#1278](https://github.com/pybamm-team/PyBaMM/pull/1278))
Expand All @@ -18,6 +19,7 @@

## Breaking changes

- `Interpolant` now takes `x` and `y` instead of a single `data` entry ([#1312](https://github.com/pybamm-team/PyBaMM/pull/1312))
- Boolean model options ('sei porosity change', 'convection') must now be given in string format ('true' or 'false' instead of True or False) ([#1280](https://github.com/pybamm-team/PyBaMM/pull/1280))
- Operations such as `1*x` and `0+x` now directly return `x`. This can be bypassed by explicitly creating the binary operators, e.g. `pybamm.Multiplication(1, x)` ([#1252](https://github.com/pybamm-team/PyBaMM/pull/1252))

Expand Down
19 changes: 17 additions & 2 deletions examples/notebooks/compare-comsol-discharge-curve.ipynb

Large diffs are not rendered by default.

144 changes: 71 additions & 73 deletions examples/notebooks/models/pouch-cell-model.ipynb

Large diffs are not rendered by default.

46 changes: 35 additions & 11 deletions examples/notebooks/parameter-values.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pybamm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def version(formatted=False):

ABSOLUTE_PATH = root_dir()
PARAMETER_PATH = [
root_dir(),
os.getcwd(),
os.path.join(root_dir(), "pybamm", "input", "parameters"),
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
def graphite_entropy_Enertech_Ai2020_function(sto, T):
def graphite_entropy_Enertech_Ai2020_function(sto):
"""
Lithium Cobalt Oxide (LiCO2) entropic change in open circuit potential (OCP) at
a temperature of 298.15K as a function of the stochiometry. The fit is taken
from Ref [1], which is only accurate
for 0.43 < sto < 0.9936.
Lithium Cobalt Oxide (LiCO2) entropic change in open circuit potential (OCP) at
a temperature of 298.15K as a function of the stochiometry. The fit is taken
from Ref [1], which is only accurate
for 0.43 < sto < 0.9936.
References
----------
.. [1] Ai, W., Kraft, L., Sturm, J., Jossen, A., & Wu, B. (2020).
Electrochemical Thermal-Mechanical Modelling of Stress Inhomogeneity in Lithium-Ion Pouch Cells. # noqa
Journal of The Electrochemical Society, 167(1), 013512. DOI: 10.1149/2.0122001JES # noqa
References
----------
.. [1] Ai, W., Kraft, L., Sturm, J., Jossen, A., & Wu, B. (2020).
Electrochemical Thermal-Mechanical Modelling of Stress Inhomogeneity in Lithium-Ion Pouch Cells. # noqa
Journal of The Electrochemical Society, 167(1), 013512. DOI: 10.1149/2.0122001JES # noqa
Parameters
----------
sto: double
Stochiometry of material (li-fraction)
T : :class:`pybamm.Symbol`
Temperature [K]
Returns
-------
:class:`pybamm.Symbol`
Entropic change [v.K-1]
Entropic change [V.K-1]
"""

du_dT = (
Expand Down Expand Up @@ -48,5 +47,5 @@ def graphite_entropy_Enertech_Ai2020_function(sto, T):
+ 165705.8597 * sto ** 8
)
)
# show no temperature dependence

return du_dT
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pybamm import exp, cosh
from pybamm import exp, cosh, Parameter


def graphite_entropic_change_Moura2016(sto, c_n_max):
def graphite_entropic_change_Moura2016(sto):
"""
Graphite entropic change in open circuit potential (OCP) at a temperature of
298.15K as a function of the stochiometry taken from Scott Moura's FastDFN code
Expand All @@ -11,12 +11,13 @@ def graphite_entropic_change_Moura2016(sto, c_n_max):
----------
.. [1] https://github.com/scott-moura/fastDFN
Parameters
----------
sto : :class:`pybamm.Symbol`
Stochiometry of material (li-fraction)
Parameters
----------
sto : :class:`pybamm.Symbol`
Stochiometry of material (li-fraction)
"""
c_n_max = Parameter("Maximum concentration in negative electrode [mol.m-3]")

du_dT = (
-1.5 * (120.0 / c_n_max) * exp(-120 * sto)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
def graphite_entropic_change_PeymanMPM(sto, c_n_max):
def graphite_entropic_change_PeymanMPM(sto):
"""
Graphite entropic change in open circuit potential (OCP) at a temperature of
298.15K as a function of the stochiometry taken from [1]
Expand All @@ -8,10 +8,10 @@ def graphite_entropic_change_PeymanMPM(sto, c_n_max):
.. [1] K.E. Thomas, J. Newman, "Heats of mixing and entropy in porous insertion
electrode", J. of Power Sources 119 (2003) 844-849
Parameters
----------
sto : :class:`pybamm.Symbol`
Stochiometry of material (li-fraction)
Parameters
----------
sto : :class:`pybamm.Symbol`
Stochiometry of material (li-fraction)
"""

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pybamm import exp, cosh
from pybamm import exp, cosh, Parameter


def graphite_entropic_change_Moura2016(sto, c_n_max):
def graphite_entropic_change_Moura2016(sto):
"""
Graphite entropic change in open circuit potential (OCP) at a temperature of
298.15K as a function of the stochiometry taken from Scott Moura's FastDFN code
Expand All @@ -11,12 +11,13 @@ def graphite_entropic_change_Moura2016(sto, c_n_max):
----------
.. [1] https://github.com/scott-moura/fastDFN
Parameters
----------
sto : :class:`pybamm.Symbol`
Stochiometry of material (li-fraction)
Parameters
----------
sto : :class:`pybamm.Symbol`
Stochiometry of material (li-fraction)
"""
c_n_max = Parameter("Maximum concentration in negative electrode [mol.m-3]")

du_dT = (
-1.5 * (120.0 / c_n_max) * exp(-120 * sto)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pybamm


def NMC_entropic_change_PeymanMPM(sto, c_p_max):
def NMC_entropic_change_PeymanMPM(sto):
"""
Nickel Manganese Cobalt (NMC) entropic change in open circuit potential (OCP) at
a temperature of 298.15K as a function of the OCP. The fit is taken from [1].
Expand All @@ -13,10 +13,10 @@ def NMC_entropic_change_PeymanMPM(sto, c_p_max):
techniques",
J. of the Electrochemical Society 153 (11) (2006) A2147–A2151.
Parameters
----------
sto : :class:`pybamm.Symbol`
Stochiometry of material (li-fraction)
Parameters
----------
sto : :class:`pybamm.Symbol`
Stochiometry of material (li-fraction)
"""

Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
def lico2_entropic_change_Ai2020_function(sto, T):
def lico2_entropic_change_Ai2020_function(sto):
"""
Lithium Cobalt Oxide (LiCO2) entropic change in open circuit potential (OCP) at
a temperature of 298.15K as a function of the stochiometry. The fit is taken
from Ref [1], which is only accurate
for 0.43 < sto < 0.9936.
Lithium Cobalt Oxide (LiCO2) entropic change in open circuit potential (OCP) at
a temperature of 298.15K as a function of the stochiometry. The fit is taken
from Ref [1], which is only accurate
for 0.43 < sto < 0.9936.
References
----------
.. [1] Ai, W., Kraft, L., Sturm, J., Jossen, A., & Wu, B. (2020).
Electrochemical Thermal-Mechanical Modelling of Stress Inhomogeneity
in Lithium-Ion Pouch Cells. Journal of The Electrochemical Society,
167(1), 013512. DOI: 10.1149/2.0122001JES
References
----------
.. [1] Ai, W., Kraft, L., Sturm, J., Jossen, A., & Wu, B. (2020).
Electrochemical Thermal-Mechanical Modelling of Stress Inhomogeneity
in Lithium-Ion Pouch Cells. Journal of The Electrochemical Society,
167(1), 013512. DOI: 10.1149/2.0122001JES
Parameters
----------
sto: double
Stochiometry of material (li-fraction)
T : :class:`pybamm.Symbol`
Temperature [K]
Returns
-------
:class:`pybamm.Symbol`
Expand Down Expand Up @@ -45,5 +44,5 @@ def lico2_entropic_change_Ai2020_function(sto, T):
+ p7 * sto
+ p8
)
# show no temperature dependence

return du_dT
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pybamm import cosh
from pybamm import cosh, Parameter


def lico2_entropic_change_Moura2016(sto, c_p_max):
def lico2_entropic_change_Moura2016(sto):
"""
Lithium Cobalt Oxide (LiCO2) entropic change in open circuit potential (OCP) at
a temperature of 298.15K as a function of the stochiometry. The fit is taken
Expand All @@ -11,12 +11,13 @@ def lico2_entropic_change_Moura2016(sto, c_p_max):
----------
.. [1] https://github.com/scott-moura/fastDFN
Parameters
----------
sto : :class:`pybamm.Symbol`
Stochiometry of material (li-fraction)
Parameters
----------
sto : :class:`pybamm.Symbol`
Stochiometry of material (li-fraction)
"""
c_p_max = Parameter("Maximum concentration in positive electrode [mol.m-3]")

# Since the equation for LiCo2 from this ref. has the stretch factor,
# should this too? If not, the "bumps" in the OCV don't line up.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pybamm import cosh
from pybamm import cosh, Parameter


def lico2_entropic_change_Moura2016(sto, c_p_max):
def lico2_entropic_change_Moura2016(sto):
"""
Lithium Cobalt Oxide (LiCO2) entropic change in open circuit potential (OCP) at
a temperature of 298.15K as a function of the stochiometry. The fit is taken
Expand All @@ -17,6 +17,7 @@ def lico2_entropic_change_Moura2016(sto, c_p_max):
Stochiometry of material (li-fraction)
"""
c_p_max = Parameter("Maximum concentration in positive electrode [mol.m-3]")

# Since the equation for LiCo2 from this ref. has the stretch factor,
# should this too? If not, the "bumps" in the OCV don't line up.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,10 @@ def __init__(self):

self.algebraic = {
f_n: pybamm.laplacian(f_n) + pybamm.source(1, f_n),
c: pybamm.laplacian(f_p)
f_p: pybamm.laplacian(f_p)
- pybamm.source(1, f_p)
+ c * pybamm.DefiniteIntegralVector(f_p, vector_type="column"),
f_p: pybamm.yz_average(f_p) + 0 * c,
c: pybamm.yz_average(f_p) + pybamm.Multiplication(0, c),
}

# Boundary conditons
Expand Down
10 changes: 2 additions & 8 deletions pybamm/parameters/lithium_ion_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,7 @@ def dUdT_n_dimensional(self, sto):
Dimensional entropic change of the negative electrode open-circuit
potential [V.K-1]
"""
inputs = {
"Negative particle stoichiometry": sto,
"Max negative particle concentration [mol.m-3]": self.c_n_max,
}
inputs = {"Negative particle stoichiometry": sto}
return pybamm.FunctionParameter(
"Negative electrode OCP entropic change [V.K-1]", inputs
)
Expand All @@ -358,10 +355,7 @@ def dUdT_p_dimensional(self, sto):
Dimensional entropic change of the positive electrode open-circuit
potential [V.K-1]
"""
inputs = {
"Positive particle stoichiometry": sto,
"Max positive particle concentration [mol.m-3]": self.c_p_max,
}
inputs = {"Positive particle stoichiometry": sto}
return pybamm.FunctionParameter(
"Positive electrode OCP entropic change [V.K-1]", inputs
)
Expand Down

0 comments on commit 2407617

Please sign in to comment.