Skip to content

Commit

Permalink
#936 remove some inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinsulzer committed Apr 5, 2020
1 parent 3934ad4 commit d878763
Show file tree
Hide file tree
Showing 59 changed files with 270 additions and 503 deletions.
1 change: 1 addition & 0 deletions pybamm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def version(formatted=False):
# Parameters class and methods
#
from .parameters.parameter_values import ParameterValues
from .parameters import constants
from .parameters import geometric_parameters
from .parameters import electrical_parameters
from .parameters import thermal_parameters
Expand Down
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
from pybamm import exp
from pybamm import exp, constants


def graphite_LGM50_diffusivity_Chen2020(sto, T, T_inf, E_D_s, R_g):
def graphite_LGM50_diffusivity_Chen2020(sto, T):
"""
LG M50 Graphite diffusivity as a function of stochiometry, in this case the
diffusivity is taken to be a constant. The value is taken from [1].
References
----------
.. [1] Chang-Hui Chen, Ferran Brosa Planella, Kieran O’Regan, Dominika Gastol, W.
Dhammika Widanage, and Emma Kendrick. "Development of Experimental Techniques for
Parameterization of Multi-scale Lithium-ion Battery Models." Submitted for
publication (2020).
Parameters
----------
sto: :class: `numpy.Array`
sto: :class:`pybamm.Symbol`
Electrode stochiometry
T: :class: `numpy.Array`
T: :class:`pybamm.Symbol`
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.3e-14
arrhenius = exp(E_D_s / R_g * (1 / T_inf - 1 / T))
arrhenius = exp(42770 / constants.R * (1 / 298.15 - 1 / T))

return D_ref * arrhenius
Original file line number Diff line number Diff line change
@@ -1,32 +1,29 @@
from pybamm import exp
from pybamm import exp, constants


def graphite_LGM50_electrolyte_reaction_rate_Chen2020(T, T_inf, E_r, R_g):
def graphite_LGM50_electrolyte_reaction_rate_Chen2020(T):
"""
Reaction rate for Butler-Volmer reactions between graphite and LiPF6 in EC:DMC.
References
----------
.. [1] Chang-Hui Chen, Ferran Brosa Planella, Kieran O’Regan, Dominika Gastol, W.
Dhammika Widanage, and Emma Kendrick. "Development of Experimental Techniques for
Parameterization of Multi-scale Lithium-ion Battery Models." Submitted for
publication (2020).
Parameters
----------
T: :class: `numpy.Array`
T: :class:`pybamm.Symbol`
Dimensional temperature
T_inf: double
Reference temperature
E_r: double
Reaction activation energy
R_g: double
The ideal gas constant
Returns
-------
:`numpy.Array`
:class:`pybamm.Symbol`
Reaction rate
"""

m_ref = 6.48e-7
arrhenius = exp(E_r / R_g * (1 / T_inf - 1 / T))
arrhenius = exp(3500 / constants.R * (1 / 298.15 - 1 / T))

return m_ref * arrhenius
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,4 @@ Negative electrode OCP entropic change [V.K-1],0,,
,,,
# Activation energies,,,
Reference temperature [K],298.15,25C,
Negative electrode reaction rate,[function]graphite_LGM50_electrolyte_reaction_rate_Chen2020,,
Negative reaction rate activation energy [J.mol-1],35000,Chen 2020,
Negative solid diffusion activation energy [J.mol-1],42770,default,
Negative electrode reaction rate,[function]graphite_LGM50_electrolyte_reaction_rate_Chen2020,,
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pybamm import exp
from pybamm import exp, constants


def graphite_diffusivity_Ecker2015(sto, T, T_inf, E_D_s, R_g):
def graphite_diffusivity_Ecker2015(sto, T):
"""
Graphite diffusivity as a function of stochiometry [1, 2, 3].
Expand All @@ -19,16 +19,10 @@ def graphite_diffusivity_Ecker2015(sto, T, T_inf, E_D_s, R_g):
Parameters
----------
sto: :class: `numpy.Array`
sto: :class:`pybamm.Symbol`
Electrode stochiometry
T: :class: `numpy.Array`
T: :class:`pybamm.Symbol`
Dimensional temperature
T_inf: double
Reference temperature
E_D_s: double
Solid diffusion activation energy
R_g: double
The ideal gas constant
Returns
-------
Expand All @@ -37,6 +31,7 @@ def graphite_diffusivity_Ecker2015(sto, T, T_inf, E_D_s, R_g):
"""

D_ref = 8.4e-13 * exp(-11.3 * sto) + 8.2e-15
arrhenius = exp(-E_D_s / (R_g * T)) * exp(E_D_s / (R_g * 296))
E_D_s = 3.03e4
arrhenius = exp(-E_D_s / (constants.R * T)) * exp(E_D_s / (constants.R * 296))

return D_ref * arrhenius
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from pybamm import exp
from scipy import constants
from pybamm import exp, constants


def graphite_electrolyte_reaction_rate_Ecker2015(T, T_inf, E_r, R_g):
def graphite_electrolyte_reaction_rate_Ecker2015(T):
"""
Reaction rate for Butler-Volmer reactions between graphite and LiPF6 in EC:DMC.
Expand All @@ -20,27 +19,21 @@ def graphite_electrolyte_reaction_rate_Ecker2015(T, T_inf, E_r, R_g):
Parameters
----------
T: :class: `numpy.Array`
T: :class:`pybamm.Symbol`
Dimensional temperature
T_inf: double
Reference temperature
E_r: double
Reaction activation energy
R_g: double
The ideal gas constant
Returns
-------
:`numpy.Array`
:class:`pybamm.Symbol`
Reaction rate
"""

k_ref = 1.995 * 1e-10

# multiply by Faraday's constant to get correct units
F = constants.physical_constants["Faraday constant"][0]
m_ref = F * k_ref
m_ref = constants.F * k_ref
E_r = 53400

arrhenius = exp(-E_r / (R_g * T)) * exp(E_r / (R_g * T_inf))
arrhenius = exp(-E_r / (constants.R * T)) * exp(E_r / (constants.R * 296.15))

return m_ref * arrhenius
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def graphite_ocp_Ecker2015_function(sto):
Parameters
----------
sto: :class: `numpy.Array`
sto: :class:`pybamm.Symbol`
Electrode stochiometry
Returns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ Negative electrode OCP entropic change [V.K-1],0,,
Reference temperature [K],296.15,23C,
Negative electrode reaction rate,[function]graphite_electrolyte_reaction_rate_Ecker2015,,
Negative reaction rate activation energy [J.mol-1],53400,,
Negative solid diffusion activation energy [J.mol-1],3.03E+04,,
Original file line number Diff line number Diff line change
@@ -1,37 +1,32 @@
from pybamm import exp
from pybamm import exp, constants


def graphite_diffusivity_Kim2011(sto, T, T_inf, E_D_s, R_g):
def graphite_diffusivity_Kim2011(sto, T):
"""
Graphite diffusivity [1].
Graphite diffusivity [1].
References
----------
.. [1] Kim, G. H., Smith, K., Lee, K. J., Santhanagopalan, S., & Pesaran, A.
(2011). Multi-domain modeling of lithium-ion batteries encompassing
multi-physics in varied length scales. Journal of The Electrochemical
Society, 158(8), A955-A969.
References
----------
.. [1] Kim, G. H., Smith, K., Lee, K. J., Santhanagopalan, S., & Pesaran, A.
(2011). Multi-domain modeling of lithium-ion batteries encompassing
multi-physics in varied length scales. Journal of The Electrochemical
Society, 158(8), A955-A969.
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
Parameters
----------
sto: :class:`pybamm.Symbol`
Electrode stochiometry
T: :class:`pybamm.Symbol`
Dimensional temperature
Returns
-------
: double
Solid diffusivity
Returns
-------
: double
Solid diffusivity
"""

D_ref = 9 * 10 ** (-14)
arrhenius = exp(E_D_s / R_g * (1 / T_inf - 1 / T))
E_D_s = 4e3
arrhenius = exp(E_D_s / constants.R * (1 / 298.15 - 1 / T))

return D_ref * arrhenius
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pybamm import exp
from pybamm import exp, constants


def graphite_electrolyte_reaction_rate_Kim2011(T, T_inf, E_r, R_g):
def graphite_electrolyte_reaction_rate_Kim2011(T):
"""
Reaction rate for Butler-Volmer reactions between graphite and LiPF6 in EC:DMC
[1].
Expand All @@ -15,18 +15,11 @@ def graphite_electrolyte_reaction_rate_Kim2011(T, T_inf, E_r, R_g):
Parameters
----------
T: :class: `numpy.Array`
T: :class:`pybamm.Symbol`
Dimensional temperature
T_inf: double
Reference temperature
E_r: double
Reaction activation energy
R_g: double
The ideal gas constant
Returns
-------
:`numpy.Array`
:class:`pybamm.Symbol`
Reaction rate
"""

Expand All @@ -43,6 +36,7 @@ def graphite_electrolyte_reaction_rate_Kim2011(T, T_inf, E_r, R_g):
/ (c_e_ref ** alpha * (c_s_n_max - c_s_n_ref) ** alpha * c_s_n_ref ** alpha)
)

arrhenius = exp(E_r / R_g * (1 / T_inf - 1 / T))
E_r = 3e4
arrhenius = exp(E_r / constants.R * (1 / 298.15 - 1 / T))

return m_ref * arrhenius
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,3 @@ Negative electrode OCP entropic change [V.K-1],0,,
# Activation energies,,,
Reference temperature [K],298.15,25C,
Negative electrode reaction rate,[function]graphite_electrolyte_reaction_rate_Kim2011,,
Negative reaction rate activation energy [J.mol-1],3E4,,
Negative solid diffusion activation energy [J.mol-1],4E3,,
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pybamm
from pybamm import exp, constants


def graphite_diffusivity_PeymanMPM(sto, T, T_inf, E_D_s, R_g):
def graphite_diffusivity_PeymanMPM(sto, T):
"""
Graphite diffusivity as a function of stochiometry, in this case the
diffusivity is taken to be a constant. The value is taken from Peyman MPM.
Expand All @@ -12,16 +12,10 @@ def graphite_diffusivity_PeymanMPM(sto, T, T_inf, E_D_s, R_g):
Parameters
----------
sto: :class: `numpy.Array`
sto: :class:`pybamm.Symbol`
Electrode stochiometry
T: :class: `numpy.Array`
T: :class:`pybamm.Symbol`
Dimensional temperature
T_inf: double
Reference temperature
E_D_s: double
Solid diffusion activation energy
R_g: double
The ideal gas constant
Returns
-------
Expand All @@ -30,7 +24,8 @@ def graphite_diffusivity_PeymanMPM(sto, T, T_inf, E_D_s, R_g):
"""

D_ref = 5.0 * 10 ** (-15)
arrhenius = pybamm.exp(E_D_s / R_g * (1 / T_inf - 1 / T))
E_D_s = 42770
arrhenius = exp(E_D_s / constants.R * (1 / 298.15 - 1 / T))

# Removing the fudge factor 0 * sto requires different handling of either
# either simplifications or how sto is passed into this function.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pybamm
from pybamm import exp, constants


def graphite_electrolyte_reaction_rate_PeymanMPM(T, T_inf, E_r, R_g):
def graphite_electrolyte_reaction_rate_PeymanMPM(T):
"""
Reaction rate for Butler-Volmer reactions between graphite and LiPF6 in EC:DMC.
Check the unit of Reaction rate constant k0 is from Peyman MPM.
Expand All @@ -12,21 +12,16 @@ def graphite_electrolyte_reaction_rate_PeymanMPM(T, T_inf, E_r, R_g):
Parameters
----------
T: :class: `numpy.Array`
T: :class:`pybamm.Symbol`
Dimensional temperature
T_inf: double
Reference temperature
E_r: double
Reaction activation energy
R_g: double
The ideal gas constant
Returns
-------
:`numpy.Array`
:class:`pybamm.Symbol`
Reaction rate
"""
m_ref = 1.061 * 10 ** (-6) # unit has been converted
arrhenius = pybamm.exp(E_r / R_g * (1 / T_inf - 1 / T))
E_r = 37480
arrhenius = exp(E_r / constants.R * (1 / 298.15 - 1 / T))

return m_ref * arrhenius
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,3 @@ Negative electrode OCP entropic change [V.K-1],[function]graphite_entropic_chang
# Activation energies,,,
Reference temperature [K],298.15,25C,
Negative electrode reaction rate,[function]graphite_electrolyte_reaction_rate_PeymanMPM,,
Negative reaction rate activation energy [J.mol-1],37480,,no info from Peyman MPM
Negative solid diffusion activation energy [J.mol-1],42770,,no info from Peyman MPM
Loading

0 comments on commit d878763

Please sign in to comment.