Skip to content

Commit b1eb67b

Browse files
committed
#729 made a number of corrections
1 parent 04da9c7 commit b1eb67b

File tree

12 files changed

+115
-36
lines changed

12 files changed

+115
-36
lines changed

examples/scripts/ecker_set.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import pybamm as pb
2-
import numpy as np
32

43
pb.set_logging_level("INFO")
54

@@ -10,9 +9,8 @@
109
# chemistry = pb.parameter_sets.Marquis2019
1110
parameter_values = pb.ParameterValues(chemistry=chemistry)
1211

13-
sim = pb.Simulation(model, parameter_values=parameter_values)
12+
sim = pb.Simulation(model, parameter_values=parameter_values, C_rate=0.01)
1413

15-
solver = pb.IDAKLUSolver() # mode="fast")
16-
t_eval = np.linspace(0, 1, 100)
17-
sim.solve(t_eval=t_eval, solver=solver)
18-
sim.plot()
14+
solver = pb.CasadiSolver(mode="safe")
15+
sim.solve(solver=solver)
16+
sim.plot(["Discharge capacity [A.h]", "Terminal voltage [V]"])

input/parameters/lithium-ion/anodes/graphite_Ecker2015/graphite_diffusivity_Ecker2015.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from pybamm import exp
2-
from pybamm import FunctionParameter
32

43

54
def graphite_diffusivity_Ecker2015(sto, T, T_inf, E_D_s, R_g):
@@ -34,7 +33,8 @@ def graphite_diffusivity_Ecker2015(sto, T, T_inf, E_D_s, R_g):
3433
Solid diffusivity
3534
"""
3635

37-
D_ref = FunctionParameter("Measured negative electrode diffusivity [m2.s-1]", sto)
36+
# D_ref = FunctionParameter("Measured negative electrode diffusivity [m2.s-1]", sto)
37+
D_ref = 8.4e-13 * exp(-11.3 * sto) + 8.2e-15
3838
arrhenius = exp(E_D_s / R_g * (1 / T_inf - 1 / T))
3939

4040
return D_ref * arrhenius

input/parameters/lithium-ion/anodes/graphite_Ecker2015/graphite_ocp_Ecker2015.csv

+1-16
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
0.07878787878787874, 0.24846625766871155
1313
0.08939393939393936, 0.2239263803680982
1414
0.10151515151515145, 0.22085889570552153
15-
0.11515151515151523, 0.22085889570552153
1615
0.12727272727272732, 0.21165644171779152
1716
0.14242424242424245, 0.2024539877300613
1817
0.15909090909090917, 0.19938650306748462
@@ -27,12 +26,6 @@
2726
0.35151515151515156, 0.13496932515337412
2827
0.3712121212121211, 0.13190184049079745
2928
0.39242424242424234, 0.128834355828221
30-
0.4196969696969697, 0.128834355828221
31-
0.4439393939393941, 0.128834355828221
32-
0.46818181818181825, 0.128834355828221
33-
0.4939393939393939, 0.128834355828221
34-
0.5166666666666666, 0.128834355828221
35-
0.5424242424242425, 0.128834355828221
3629
0.5681818181818183, 0.1257668711656441
3730
0.5878787878787879, 0.12269938650306744
3831
0.6060606060606062, 0.1165644171779141
@@ -42,15 +35,7 @@
4235
0.6939393939393939, 0.08895705521472386
4336
0.7181818181818183, 0.08895705521472386
4437
0.7393939393939393, 0.08588957055214719
45-
0.7621212121212122, 0.08588957055214719
46-
0.7833333333333332, 0.08588957055214719
47-
0.803030303030303, 0.08588957055214719
48-
0.8257575757575757, 0.08588957055214719
49-
0.8469696969696969, 0.08588957055214719
50-
0.8696969696969699, 0.08588957055214719
5138
0.8909090909090911, 0.08282208588957074
52-
0.9121212121212123, 0.08588957055214719
53-
0.9333333333333333, 0.08282208588957074
54-
0.956060606060606, 0.08282208588957074
39+
0.956060606060606, 0.08272208588957074
5540
0.9772727272727273, 0.07975460122699385
5641
1, 0.07055214723926384
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
from pybamm import exp, tanh
2+
3+
4+
def graphite_ocp_Ecker2015_function(sto):
5+
"""
6+
Graphite OCP as a function of stochiometry [1, 2].
7+
8+
References
9+
----------
10+
.. [1] Ecker, Madeleine, et al. "Parameterization of a physico-chemical model of
11+
a lithium-ion battery i. determination of parameters." Journal of the
12+
Electrochemical Society 162.9 (2015): A1836-A1848.
13+
.. [2] Ecker, Madeleine, et al. "Parameterization of a physico-chemical model of
14+
a lithium-ion battery ii. model validation." Journal of The Electrochemical
15+
Society 162.9 (2015): A1849-A1857.
16+
----------
17+
.. [1] http://www.cchem.berkeley.edu/jsngrp/fortran.html
18+
"""
19+
a = 0.716502
20+
b = 369.028
21+
c = 0.12193
22+
d = 35.6478
23+
e = 0.0530947
24+
g = 0.0169644
25+
h = 27.1365
26+
i = 0.312832
27+
j = 0.0199313
28+
k = 28.5697
29+
m = 0.614221
30+
n = 0.931153
31+
o = 36.328
32+
p = 1.10743
33+
q = 0.140031
34+
r = 0.0189193
35+
s = 21.1967
36+
t = 0.196176
37+
38+
u_eq = (
39+
a * exp(-b * sto)
40+
+ c * exp(-d * (sto - e))
41+
- r * tanh(s * (sto - t))
42+
- g * tanh(h * (sto - i))
43+
- j * tanh(k * (sto - m))
44+
- n * exp(o * (sto - p))
45+
+ q
46+
)
47+
48+
return u_eq

input/parameters/lithium-ion/anodes/graphite_Ecker2015/parameters.csv

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Negative electrode conductivity [S.m-1],14,,
66
Maximum concentration in negative electrode [mol.m-3],31920,,
77
Measured negative electrode diffusivity [m2.s-1],[data]measured_graphite_diffusivity_Ecker2015,,
88
Negative electrode diffusivity [m2.s-1],[function]graphite_diffusivity_Ecker2015,,
9-
Negative electrode OCP [V],[data]graphite_ocp_Ecker2015,,
9+
Negative electrode OCP [V],[function]graphite_ocp_Ecker2015_function,,
1010
,,,
1111
# Microstructure,,,
1212
Negative electrode porosity,0.329,,

input/parameters/lithium-ion/cathodes/LiNiCoO2_Ecker2015/nco_diffusivity_Ecker2015.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ def nco_diffusivity_Ecker2015(sto, T, T_inf, E_D_s, R_g):
3434
Solid diffusivity
3535
"""
3636

37-
D_ref = FunctionParameter("Measured positive electrode diffusivity [m2.s-1]", sto)
37+
# D_ref = FunctionParameter("Measured positive electrode diffusivity [m2.s-1]", sto)
38+
D_ref = 3.7e-13 - 3.4e-13 * exp(-12 * (sto - 0.62) * (sto - 0.62))
3839
arrhenius = exp(E_D_s / R_g * (1 / T_inf - 1 / T))
3940

4041
return D_ref * arrhenius

input/parameters/lithium-ion/cathodes/LiNiCoO2_Ecker2015/nco_ocp_Ecker2015.csv

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
0.5566982201390807, 3.923972898265999
2525
0.5782380602273078, 3.919624967236581
2626
0.598182356605296, 3.913016558585964
27-
0.6189244248384036, 3.91091236089907
2827
0.6484419834778261, 3.911118873669402
2928
0.6723751391314119, 3.9112863164561573
3029
0.6971060666401172, 3.897963452056645
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
from pybamm import tanh
2+
3+
4+
def nco_ocp_Ecker2015_function(sto):
5+
"""
6+
NCO OCP as a function of stochiometry [1, 2].
7+
8+
References
9+
----------
10+
.. [1] Ecker, Madeleine, et al. "Parameterization of a physico-chemical model of
11+
a lithium-ion battery i. determination of parameters." Journal of the
12+
Electrochemical Society 162.9 (2015): A1836-A1848.
13+
.. [2] Ecker, Madeleine, et al. "Parameterization of a physico-chemical model of
14+
a lithium-ion battery ii. model validation." Journal of The Electrochemical
15+
Society 162.9 (2015): A1849-A1857.
16+
17+
Parameters
18+
----------
19+
sto: double
20+
Stochiometry of material (li-fraction)
21+
22+
"""
23+
a = -2.35211
24+
c = 0.0747061
25+
d = 31.886
26+
e = 0.0219921
27+
g = 0.640243
28+
h = 5.48623
29+
i = 0.439245
30+
j = 3.82383
31+
k = 4.12167
32+
m = 0.176187
33+
n = 0.0542123
34+
o = 18.2919
35+
p = 0.762272
36+
q = 4.23285
37+
r = -6.34984
38+
s = 2.66395
39+
t = 0.174352
40+
41+
u_eq = (
42+
a * sto
43+
- c * tanh(d * (sto - e))
44+
- r * tanh(s * (sto - t))
45+
- g * tanh(h * (sto - i))
46+
- j * tanh(k * (sto - m))
47+
- n * tanh(o * (sto - p))
48+
+ q
49+
)
50+
return u_eq

input/parameters/lithium-ion/cathodes/LiNiCoO2_Ecker2015/parameters.csv

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Positive electrode conductivity [S.m-1],68.1,,
66
Maximum concentration in positive electrode [mol.m-3],48580,,
77
Measured positive electrode diffusivity [m2.s-1],[data]measured_nco_diffusivity_Ecker2015,,
88
Positive electrode diffusivity [m2.s-1],[function]nco_diffusivity_Ecker2015,,
9-
Positive electrode OCP [V],[data]nco_ocp_Ecker2015,,
9+
Positive electrode OCP [V],[function]nco_ocp_Ecker2015_function,,
1010
,,,
1111
# Microstructure,,,
1212
Positive electrode porosity,0.296,,

input/parameters/lithium-ion/experiments/1C_discharge_from_full_Ecker2015/parameters.csv

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ Heat transfer coefficient [W.m-2.K-1],1, dummy value,
88
# Electrical
99
Number of electrodes connected in parallel to make a cell,1,,
1010
Number of cells connected in series to make a battery,1,,
11-
Lower voltage cut-off [V],0,,
12-
Upper voltage cut-off [V],10,,
13-
C-rate,0.1,,
11+
Lower voltage cut-off [V],3,,
12+
Upper voltage cut-off [V],4.2,,
13+
C-rate,1,,
1414
,,,
1515
# Initial conditions
16-
Initial concentration in negative electrode [mol.m-3], 26356,
17-
Initial concentration in positive electrode [mol.m-3], 2197,,
16+
Initial concentration in negative electrode [mol.m-3], 29148,(util-C_SEI)cpmax,
17+
Initial concentration in positive electrode [mol.m-3], 21630,(1-util)cpmax,
1818
Initial concentration in electrolyte [mol.m-3],1000,,
1919
Initial temperature [K],296.15,,
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Name [units],Value,Reference,Notes
22
# Empty rows and rows starting with ‘#’ will be ignored,,,
33
,,,
4-
Separator porosity,50.8,,
4+
Separator porosity,0.508,,
55
Separator Bruggeman coefficient (electrolyte),1.5,Ecker set uses measured tortuosity,
66
Separator Bruggeman coefficient (electrode),1.5,,

pybamm/parameters/standard_parameters_lithium_ion.py

-2
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,6 @@ def chi(c_e):
329329

330330
# Initial conditions
331331
c_e_init = c_e_init_dimensional / c_e_typ
332-
c_n_init = c_n_init_dimensional / c_n_max
333-
c_p_init = c_p_init_dimensional / c_p_max
334332
T_init = pybamm.thermal_parameters.T_init
335333

336334
U_n_ref = U_n_dimensional(pybamm.Scalar(0.7), T_ref)

0 commit comments

Comments
 (0)