forked from pybamm-team/PyBaMM
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pybamm-team#573 setup of the files needed for parametrisation
- Loading branch information
1 parent
eb38dd8
commit 558f10e
Showing
7 changed files
with
256 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
input/parameters/lithium-ion/electrolyte_conductivity_Petibon2016.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,35 @@ | ||
import autograd.numpy as np | ||
|
||
|
||
def electrolyte_conductivity_Petibon2016(c_e, T, T_inf, E_k_e, R_g): | ||
""" | ||
Conductivity of LiPF6 in EC:EMC as a function of ion concentration. The original | ||
data and fit are from [1]. | ||
References | ||
---------- | ||
.. [1] R Petibon et al. Electrolyte System for High Voltage Li-Ion Cells. Journal | ||
of the Electrochemical Society 163 (2016): A2571-A2578. | ||
Parameters | ||
---------- | ||
c_e: :class: `numpy.Array` | ||
Dimensional electrolyte concentration | ||
T: :class: `numpy.Array` | ||
Dimensional temperature | ||
T_inf: double | ||
Reference temperature | ||
E_k_e: double | ||
Electrolyte conductivity activation energy | ||
R_g: double | ||
The ideal gas constant | ||
Returns | ||
------- | ||
:`numpy.Array` | ||
Electrolyte conductivity | ||
""" | ||
|
||
sigma_e = 0.95 * c_e / 1000 | ||
|
||
return sigma_e |
36 changes: 36 additions & 0 deletions
36
input/parameters/lithium-ion/electrolyte_diffusivity_Stewart2008.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,36 @@ | ||
import autograd.numpy as np | ||
|
||
|
||
def electrolyte_diffusivity_Stewart2008(c_e, T, T_inf, E_D_e, R_g): | ||
""" | ||
Diffusivity of LiPF6 in EC:DEC as a function of ion concentration. The original | ||
data and fit are from [1]. | ||
References | ||
---------- | ||
.. [1] S G Stewart and J Newman. The Use of UV/vis Absorption to Measure Diffusion | ||
Coefficients in LiPF6 Electrolytic Solutions. Journal of The Electrochemical | ||
Society 155 (2008): F13-F16. | ||
Parameters | ||
---------- | ||
c_e: :class: `numpy.Array` | ||
Dimensional electrolyte concentration | ||
T: :class: `numpy.Array` | ||
Dimensional temperature | ||
T_inf: double | ||
Reference temperature | ||
E_D_e: double | ||
Electrolyte diffusion activation energy | ||
R_g: double | ||
The ideal gas constant | ||
Returns | ||
------- | ||
:`numpy.Array` | ||
Electrolyte diffusivity | ||
""" | ||
|
||
D_c_e = 2.582E-9 * np.exp(-2.85E-3 * c_e) | ||
|
||
return D_c_e |
38 changes: 38 additions & 0 deletions
38
input/parameters/lithium-ion/graphite_LGM50_diffusivity_CC3.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,38 @@ | ||
import autograd.numpy as np | ||
|
||
|
||
def graphite_LGM50_diffusivity_CC3(sto, T, T_inf, E_D_s, R_g): | ||
""" | ||
Graphite MCMB 2528 diffusivity as a function of stochiometry, in this case the | ||
diffusivity is taken to be a constant. The value is taken from Dualfoil [1]. | ||
References | ||
---------- | ||
.. [1] http://www.cchem.berkeley.edu/jsngrp/fortran.html | ||
Parameters | ||
---------- | ||
sto: :class: `numpy.Array` | ||
Electrode stochiometry | ||
T: :class: `numpy.Array` | ||
Dimensional temperature | ||
T_inf: double | ||
Reference temperature | ||
E_D_s: double | ||
Solid diffusion activation energy | ||
R_g: double | ||
The ideal gas constant | ||
Returns | ||
------- | ||
: double | ||
Solid diffusivity | ||
""" | ||
|
||
D_ref = 3.9 * 10 ** (-14) | ||
arrhenius = np.exp(E_D_s / R_g * (1 / T_inf - 1 / T)) | ||
|
||
correct_shape = 0 * sto | ||
|
||
return D_ref * arrhenius + correct_shape | ||
|
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,29 @@ | ||
import autograd.numpy as np | ||
|
||
|
||
def graphite_LGM50_ocp_CC3(sto): | ||
""" | ||
Graphite MCMB 2528 Open Circuit Potential (OCP) as a function of the | ||
stochiometry. The fit is taken from Dualfoil [1]. Dualfoil states that the data | ||
was measured by Chris Bogatu at Telcordia and PolyStor materials, 2000. However, | ||
we could not find any other records of this measurment. | ||
References | ||
---------- | ||
.. [1] http://www.cchem.berkeley.edu/jsngrp/fortran.html | ||
""" | ||
|
||
u_eq = ( | ||
0.194 | ||
+ 1.5 * np.exp(-120.0 * sto) | ||
+ 0.0351 * np.tanh((sto - 0.286) / 0.083) | ||
- 0.0045 * np.tanh((sto - 0.849) / 0.119) | ||
- 0.035 * np.tanh((sto - 0.9233) / 0.05) | ||
- 0.0147 * np.tanh((sto - 0.5) / 0.034) | ||
- 0.102 * np.tanh((sto - 0.194) / 0.142) | ||
- 0.022 * np.tanh((sto - 0.9) / 0.0164) | ||
- 0.011 * np.tanh((sto - 0.124) / 0.0226) | ||
+ 0.0155 * np.tanh((sto - 0.105) / 0.029) | ||
) | ||
|
||
return u_eq |
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,37 @@ | ||
import autograd.numpy as np | ||
|
||
|
||
def nmc_LGM50_diffusivity_CC3(sto, T, T_inf, E_D_s, R_g): | ||
""" | ||
LiCo2 diffusivity as a function of stochiometry, in this case the | ||
diffusivity is taken to be a constant. The value is taken from Dualfoil [1]. | ||
References | ||
---------- | ||
.. [1] http://www.cchem.berkeley.edu/jsngrp/fortran.html | ||
Parameters | ||
---------- | ||
sto: :class: `numpy.Array` | ||
Electrode stochiometry | ||
T: :class: `numpy.Array` | ||
Dimensional temperature | ||
T_inf: double | ||
Reference temperature | ||
E_D_s: double | ||
Solid diffusion activation energy | ||
R_g: double | ||
The ideal gas constant | ||
Returns | ||
------- | ||
: double | ||
Solid diffusivity | ||
""" | ||
|
||
D_ref = 1 * 10 ** (-13) | ||
arrhenius = np.exp(E_D_s / R_g * (1 / T_inf - 1 / T)) | ||
|
||
correct_shape = 0 * sto | ||
|
||
return D_ref * arrhenius + correct_shape |
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,39 @@ | ||
import autograd.numpy as np | ||
|
||
|
||
def nmc_LGM50_ocp_CC3(sto): | ||
""" | ||
Lithium Cobalt Oxide (LiCO2) Open Circuit Potential (OCP) as a a function of the | ||
stochiometry. The fit is taken from Dualfoil [1]. Dualfoil states that the data | ||
was measured by Oscar Garcia 2001 using Quallion electrodes for 0.5 < sto < 0.99 | ||
and by Marc Doyle for sto<0.4 (for unstated electrodes). We could not find any | ||
other records of the Garcia measurements. Doyles fits can be found in his | ||
thesis [2] but we could not find any other record of his measurments. | ||
References | ||
---------- | ||
.. [1] http://www.cchem.berkeley.edu/jsngrp/fortran.html | ||
.. [2] CM Doyle. Design and simulation of lithium rechargeable batteries, | ||
1995. | ||
Parameters | ||
---------- | ||
sto: double | ||
Stochiometry of material (li-fraction) | ||
""" | ||
|
||
stretch = 1.062 | ||
sto = stretch * sto | ||
|
||
u_eq = ( | ||
2.16216 | ||
+ 0.07645 * np.tanh(30.834 - 54.4806 * sto) | ||
+ 2.1581 * np.tanh(52.294 - 50.294 * sto) | ||
- 0.14169 * np.tanh(11.0923 - 19.8543 * sto) | ||
+ 0.2051 * np.tanh(1.4684 - 5.4888 * sto) | ||
+ 0.2531 * np.tanh((-sto + 0.56478) / 0.1316) | ||
- 0.02167 * np.tanh((sto - 0.525) / 0.006) | ||
) | ||
|
||
return u_eq |
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,42 @@ | ||
import pybamm | ||
import numpy as np | ||
|
||
# load model | ||
model = pybamm.lithium_ion.DFN() | ||
|
||
# create geometry | ||
geometry = model.default_geometry | ||
|
||
# load parameter values and process model and geometry | ||
param = pybamm.ParameterValues("input/parameters/lithium-ion/LGM50_parameters.csv") | ||
param.update({ | ||
"Electrolyte conductivity": "electrolyte_conductivity_Petibon2016.py", | ||
"Electrolyte diffusivity": "electrolyte_diffusivity_Stewart2008.py", | ||
"Negative electrode OCV": "graphite_LGM50_ocp_CC3.py", | ||
"Positive electrode OCV": "nmc_LGM50_ocp_CC3.py", | ||
"Negative electrode diffusivity": "graphite_LGM50_diffusivity_CC3.py", | ||
"Positive electrode diffusivity": "nmc_LGM50_diffusivity_CC3.py", | ||
"Negative electrode OCV entropic change": "graphite_entropic_change_Moura.py", | ||
"Positive electrode OCV entropic change": "lico2_entropic_change_Moura.py", | ||
"Negative electrode reaction rate": "graphite_electrolyte_reaction_rate.py", | ||
"Positive electrode reaction rate": "lico2_electrolyte_reaction_rate.py", | ||
"Typical current [A]": 5, | ||
"Current function": pybamm.GetConstantCurrent(current=5) | ||
}) | ||
param.process_model(model) | ||
param.process_geometry(geometry) | ||
|
||
# set mesh | ||
mesh = pybamm.Mesh(geometry, model.default_submesh_types, model.default_var_pts) | ||
|
||
# discretise model | ||
disc = pybamm.Discretisation(mesh, model.default_spatial_methods) | ||
disc.process_model(model) | ||
|
||
# solve model | ||
t_eval = np.linspace(0, 0.2, 100) | ||
solution = model.default_solver.solve(model, t_eval) | ||
|
||
# plot | ||
plot = pybamm.QuickPlot(model, mesh, solution) | ||
plot.dynamic_plot() |