Skip to content

Commit 2407617

Browse files
#1100 merge
2 parents 41ded61 + 2ec82b6 commit 2407617

File tree

15 files changed

+190
-154
lines changed

15 files changed

+190
-154
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Features
44

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

1920
## Breaking changes
2021

22+
- `Interpolant` now takes `x` and `y` instead of a single `data` entry ([#1312](https://github.com/pybamm-team/PyBaMM/pull/1312))
2123
- 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))
2224
- 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))
2325

examples/notebooks/compare-comsol-discharge-curve.ipynb

+17-2
Large diffs are not rendered by default.

examples/notebooks/models/pouch-cell-model.ipynb

+71-73
Large diffs are not rendered by default.

examples/notebooks/parameter-values.ipynb

+35-11
Large diffs are not rendered by default.

pybamm/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def version(formatted=False):
5656

5757
ABSOLUTE_PATH = root_dir()
5858
PARAMETER_PATH = [
59+
root_dir(),
5960
os.getcwd(),
6061
os.path.join(root_dir(), "pybamm", "input", "parameters"),
6162
]

pybamm/input/parameters/lithium-ion/anodes/graphite_Ai2020/graphite_entropy_Enertech_Ai2020_function.py

+13-14
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
1-
def graphite_entropy_Enertech_Ai2020_function(sto, T):
1+
def graphite_entropy_Enertech_Ai2020_function(sto):
22
"""
3-
Lithium Cobalt Oxide (LiCO2) entropic change in open circuit potential (OCP) at
4-
a temperature of 298.15K as a function of the stochiometry. The fit is taken
5-
from Ref [1], which is only accurate
6-
for 0.43 < sto < 0.9936.
3+
Lithium Cobalt Oxide (LiCO2) entropic change in open circuit potential (OCP) at
4+
a temperature of 298.15K as a function of the stochiometry. The fit is taken
5+
from Ref [1], which is only accurate
6+
for 0.43 < sto < 0.9936.
77
8-
References
9-
----------
10-
.. [1] Ai, W., Kraft, L., Sturm, J., Jossen, A., & Wu, B. (2020).
11-
Electrochemical Thermal-Mechanical Modelling of Stress Inhomogeneity in Lithium-Ion Pouch Cells. # noqa
12-
Journal of The Electrochemical Society, 167(1), 013512. DOI: 10.1149/2.0122001JES # noqa
8+
References
9+
----------
10+
.. [1] Ai, W., Kraft, L., Sturm, J., Jossen, A., & Wu, B. (2020).
11+
Electrochemical Thermal-Mechanical Modelling of Stress Inhomogeneity in Lithium-Ion Pouch Cells. # noqa
12+
Journal of The Electrochemical Society, 167(1), 013512. DOI: 10.1149/2.0122001JES # noqa
1313
1414
Parameters
1515
----------
1616
sto: double
1717
Stochiometry of material (li-fraction)
18-
T : :class:`pybamm.Symbol`
19-
Temperature [K]
18+
2019
Returns
2120
-------
2221
:class:`pybamm.Symbol`
23-
Entropic change [v.K-1]
22+
Entropic change [V.K-1]
2423
"""
2524

2625
du_dT = (
@@ -48,5 +47,5 @@ def graphite_entropy_Enertech_Ai2020_function(sto, T):
4847
+ 165705.8597 * sto ** 8
4948
)
5049
)
51-
# show no temperature dependence
50+
5251
return du_dT

pybamm/input/parameters/lithium-ion/anodes/graphite_Ramadass2004/graphite_entropic_change_Moura2016.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
from pybamm import exp, cosh
1+
from pybamm import exp, cosh, Parameter
22

33

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

2122
du_dT = (
2223
-1.5 * (120.0 / c_n_max) * exp(-120 * sto)

pybamm/input/parameters/lithium-ion/anodes/graphite_UMBL_Mohtat2020/graphite_entropic_change_PeymanMPM.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
def graphite_entropic_change_PeymanMPM(sto, c_n_max):
1+
def graphite_entropic_change_PeymanMPM(sto):
22
"""
33
Graphite entropic change in open circuit potential (OCP) at a temperature of
44
298.15K as a function of the stochiometry taken from [1]
@@ -8,10 +8,10 @@ def graphite_entropic_change_PeymanMPM(sto, c_n_max):
88
.. [1] K.E. Thomas, J. Newman, "Heats of mixing and entropy in porous insertion
99
electrode", J. of Power Sources 119 (2003) 844-849
1010
11-
Parameters
12-
----------
13-
sto : :class:`pybamm.Symbol`
14-
Stochiometry of material (li-fraction)
11+
Parameters
12+
----------
13+
sto : :class:`pybamm.Symbol`
14+
Stochiometry of material (li-fraction)
1515
1616
"""
1717

pybamm/input/parameters/lithium-ion/anodes/graphite_mcmb2528_Marquis2019/graphite_entropic_change_Moura2016.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
from pybamm import exp, cosh
1+
from pybamm import exp, cosh, Parameter
22

33

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

2122
du_dT = (
2223
-1.5 * (120.0 / c_n_max) * exp(-120 * sto)

pybamm/input/parameters/lithium-ion/cathodes/NMC_UMBL_Mohtat2020/NMC_entropic_change_PeymanMPM.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import pybamm
22

33

4-
def NMC_entropic_change_PeymanMPM(sto, c_p_max):
4+
def NMC_entropic_change_PeymanMPM(sto):
55
"""
66
Nickel Manganese Cobalt (NMC) entropic change in open circuit potential (OCP) at
77
a temperature of 298.15K as a function of the OCP. The fit is taken from [1].
@@ -13,10 +13,10 @@ def NMC_entropic_change_PeymanMPM(sto, c_p_max):
1313
techniques",
1414
J. of the Electrochemical Society 153 (11) (2006) A2147–A2151.
1515
16-
Parameters
17-
----------
18-
sto : :class:`pybamm.Symbol`
19-
Stochiometry of material (li-fraction)
16+
Parameters
17+
----------
18+
sto : :class:`pybamm.Symbol`
19+
Stochiometry of material (li-fraction)
2020
2121
"""
2222

pybamm/input/parameters/lithium-ion/cathodes/lico2_Ai2020/lico2_entropic_change_Ai2020_function.py

+13-14
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
1-
def lico2_entropic_change_Ai2020_function(sto, T):
1+
def lico2_entropic_change_Ai2020_function(sto):
22
"""
3-
Lithium Cobalt Oxide (LiCO2) entropic change in open circuit potential (OCP) at
4-
a temperature of 298.15K as a function of the stochiometry. The fit is taken
5-
from Ref [1], which is only accurate
6-
for 0.43 < sto < 0.9936.
3+
Lithium Cobalt Oxide (LiCO2) entropic change in open circuit potential (OCP) at
4+
a temperature of 298.15K as a function of the stochiometry. The fit is taken
5+
from Ref [1], which is only accurate
6+
for 0.43 < sto < 0.9936.
77
8-
References
9-
----------
10-
.. [1] Ai, W., Kraft, L., Sturm, J., Jossen, A., & Wu, B. (2020).
11-
Electrochemical Thermal-Mechanical Modelling of Stress Inhomogeneity
12-
in Lithium-Ion Pouch Cells. Journal of The Electrochemical Society,
13-
167(1), 013512. DOI: 10.1149/2.0122001JES
8+
References
9+
----------
10+
.. [1] Ai, W., Kraft, L., Sturm, J., Jossen, A., & Wu, B. (2020).
11+
Electrochemical Thermal-Mechanical Modelling of Stress Inhomogeneity
12+
in Lithium-Ion Pouch Cells. Journal of The Electrochemical Society,
13+
167(1), 013512. DOI: 10.1149/2.0122001JES
1414
1515
Parameters
1616
----------
1717
sto: double
1818
Stochiometry of material (li-fraction)
19-
T : :class:`pybamm.Symbol`
20-
Temperature [K]
19+
2120
Returns
2221
-------
2322
:class:`pybamm.Symbol`
@@ -45,5 +44,5 @@ def lico2_entropic_change_Ai2020_function(sto, T):
4544
+ p7 * sto
4645
+ p8
4746
)
48-
# show no temperature dependence
47+
4948
return du_dT

pybamm/input/parameters/lithium-ion/cathodes/lico2_Marquis2019/lico2_entropic_change_Moura2016.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
from pybamm import cosh
1+
from pybamm import cosh, Parameter
22

33

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

2122
# Since the equation for LiCo2 from this ref. has the stretch factor,
2223
# should this too? If not, the "bumps" in the OCV don't line up.

pybamm/input/parameters/lithium-ion/cathodes/lico2_Ramadass2004/lico2_entropic_change_Moura2016.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
from pybamm import cosh
1+
from pybamm import cosh, Parameter
22

33

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

2122
# Since the equation for LiCo2 from this ref. has the stretch factor,
2223
# should this too? If not, the "bumps" in the OCV don't line up.

pybamm/models/submodels/current_collector/effective_resistance_current_collector.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,10 @@ def __init__(self):
347347

348348
self.algebraic = {
349349
f_n: pybamm.laplacian(f_n) + pybamm.source(1, f_n),
350-
c: pybamm.laplacian(f_p)
350+
f_p: pybamm.laplacian(f_p)
351351
- pybamm.source(1, f_p)
352352
+ c * pybamm.DefiniteIntegralVector(f_p, vector_type="column"),
353-
f_p: pybamm.yz_average(f_p) + 0 * c,
353+
c: pybamm.yz_average(f_p) + pybamm.Multiplication(0, c),
354354
}
355355

356356
# Boundary conditons

pybamm/parameters/lithium_ion_parameters.py

+2-8
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,7 @@ def dUdT_n_dimensional(self, sto):
345345
Dimensional entropic change of the negative electrode open-circuit
346346
potential [V.K-1]
347347
"""
348-
inputs = {
349-
"Negative particle stoichiometry": sto,
350-
"Max negative particle concentration [mol.m-3]": self.c_n_max,
351-
}
348+
inputs = {"Negative particle stoichiometry": sto}
352349
return pybamm.FunctionParameter(
353350
"Negative electrode OCP entropic change [V.K-1]", inputs
354351
)
@@ -358,10 +355,7 @@ def dUdT_p_dimensional(self, sto):
358355
Dimensional entropic change of the positive electrode open-circuit
359356
potential [V.K-1]
360357
"""
361-
inputs = {
362-
"Positive particle stoichiometry": sto,
363-
"Max positive particle concentration [mol.m-3]": self.c_p_max,
364-
}
358+
inputs = {"Positive particle stoichiometry": sto}
365359
return pybamm.FunctionParameter(
366360
"Positive electrode OCP entropic change [V.K-1]", inputs
367361
)

0 commit comments

Comments
 (0)