Skip to content

Commit

Permalink
pybamm-team#573 setup of the files needed for parametrisation
Browse files Browse the repository at this point in the history
  • Loading branch information
brosaplanella committed Aug 5, 2019
1 parent eb38dd8 commit 558f10e
Show file tree
Hide file tree
Showing 7 changed files with 256 additions and 0 deletions.
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
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 input/parameters/lithium-ion/graphite_LGM50_diffusivity_CC3.py
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

29 changes: 29 additions & 0 deletions input/parameters/lithium-ion/graphite_LGM50_ocp_CC3.py
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
37 changes: 37 additions & 0 deletions input/parameters/lithium-ion/nmc_LGM50_diffusivity_CC3.py
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
39 changes: 39 additions & 0 deletions input/parameters/lithium-ion/nmc_LGM50_ocp_CC3.py
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
42 changes: 42 additions & 0 deletions results/LGM50/DFN.py
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()

0 comments on commit 558f10e

Please sign in to comment.