From 10a2254a37e0b87cf860353de7c6cfaed5c4814d Mon Sep 17 00:00:00 2001 From: Robert Timms <43040151+rtimms@users.noreply.github.com> Date: Sun, 8 Sep 2024 17:31:55 -0700 Subject: [PATCH] #4405 make dUdT and volume change functions of sto only (#4427) * #4405 make dUdT and volume change functions of sto only * #4405 changelog --- CHANGELOG.md | 1 + .../parameterization/parameterization.ipynb | 2 +- .../input/parameters/lithium_ion/Ai2020.py | 35 +++++++++---------- .../input/parameters/lithium_ion/Chen2020.py | 8 ++--- .../lithium_ion/Chen2020_composite.py | 12 +++---- .../input/parameters/lithium_ion/Ecker2015.py | 16 ++++----- .../Ecker2015_graphite_halfcell.py | 8 ++--- .../parameters/lithium_ion/Marquis2019.py | 33 +++++++++-------- .../parameters/lithium_ion/Mohtat2020.py | 24 ++++++------- .../parameters/lithium_ion/NCA_Kim2011.py | 14 ++++---- .../input/parameters/lithium_ion/OKane2022.py | 23 ++++++------ .../OKane2022_graphite_SiOx_halfcell.py | 10 +++--- .../parameters/lithium_ion/ORegan2022.py | 24 ++++++------- .../input/parameters/lithium_ion/Prada2013.py | 6 ++-- .../parameters/lithium_ion/Ramadass2004.py | 33 +++++++++-------- .../input/parameters/lithium_ion/Xu2019.py | 4 +-- src/pybamm/parameters/bpx.py | 31 ++++------------ .../parameters/lithium_ion_parameters.py | 10 ++---- tests/unit/test_parameters/test_bpx.py | 6 ++-- .../test_parameter_sets/test_Ai2020.py | 8 ++--- .../test_LCO_Ramadass2004.py | 4 +-- .../test_LGM50_ORegan2022.py | 4 +-- .../test_parameter_sets/test_OKane2022.py | 4 +-- .../test_OKane2022_negative_halfcell.py | 2 +- 24 files changed, 155 insertions(+), 167 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7764a3b24a..0446b5125a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Removed the `start_step_offset` setting and disabled minimum `dt` warnings for drive cycles with the (`IDAKLUSolver`). ([#4416](https://github.com/pybamm-team/PyBaMM/pull/4416)) ## Breaking changes +- The parameters "... electrode OCP entropic change [V.K-1]" and "... electrode volume change" are now expected to be functions of stoichiometry only instead of functions of both stoichiometry and maximum concentration ([#4427](https://github.com/pybamm-team/PyBaMM/pull/4427)) - Renamed `set_events` function to `add_events_from` to better reflect its purpose. ([#4421](https://github.com/pybamm-team/PyBaMM/pull/4421)) # [v24.9.0](https://github.com/pybamm-team/PyBaMM/tree/v24.9.0) - 2024-09-03 diff --git a/docs/source/examples/notebooks/parameterization/parameterization.ipynb b/docs/source/examples/notebooks/parameterization/parameterization.ipynb index dabb5e5f76..a6ff34c772 100644 --- a/docs/source/examples/notebooks/parameterization/parameterization.ipynb +++ b/docs/source/examples/notebooks/parameterization/parameterization.ipynb @@ -586,7 +586,7 @@ "outputs": [ { "data": { - "text/plain": "{'Ideal gas constant [J.K-1.mol-1]': 8.314462618,\n 'Faraday constant [C.mol-1]': 96485.33212,\n 'Negative electrode thickness [m]': 0.0001,\n 'Separator thickness [m]': 2.5e-05,\n 'Positive electrode thickness [m]': 0.0001,\n 'Electrode height [m]': 0.137,\n 'Electrode width [m]': 0.207,\n 'Nominal cell capacity [A.h]': 0.680616,\n 'Current function [A]': 0.680616,\n 'Maximum concentration in negative electrode [mol.m-3]': 24983.2619938437,\n 'Negative particle diffusivity [m2.s-1]': ,\n 'Negative electrode OCP [V]': ,\n 'Negative electrode porosity': 0.3,\n 'Negative electrode active material volume fraction': 0.6,\n 'Negative particle radius [m]': 1e-05,\n 'Negative electrode Bruggeman coefficient (electrolyte)': 1.5,\n 'Negative electrode Bruggeman coefficient (electrode)': 1.5,\n 'Negative electrode exchange-current density [A.m-2]': ,\n 'Negative electrode OCP entropic change [V.K-1]': ,\n 'Maximum concentration in positive electrode [mol.m-3]': 51217.9257309275,\n 'Positive particle diffusivity [m2.s-1]': ,\n 'Positive electrode OCP [V]': ,\n 'Positive electrode porosity': 0.3,\n 'Positive electrode active material volume fraction': 0.5,\n 'Positive particle radius [m]': 1e-05,\n 'Positive electrode Bruggeman coefficient (electrolyte)': 1.5,\n 'Positive electrode Bruggeman coefficient (electrode)': 1.5,\n 'Positive electrode exchange-current density [A.m-2]': ,\n 'Positive electrode OCP entropic change [V.K-1]': ,\n 'Separator porosity': 1.0,\n 'Separator Bruggeman coefficient (electrolyte)': 1.5,\n 'Initial concentration in electrolyte [mol.m-3]': 1000.0,\n 'Reference temperature [K]': 298.15,\n 'Ambient temperature [K]': 298.15,\n 'Number of electrodes connected in parallel to make a cell': 1.0,\n 'Number of cells connected in series to make a battery': 1.0,\n 'Lower voltage cut-off [V]': 3.105,\n 'Upper voltage cut-off [V]': 4.1,\n 'Initial concentration in negative electrode [mol.m-3]': 19986.609595075,\n 'Initial concentration in positive electrode [mol.m-3]': 30730.7554385565}" + "text/plain": "{'Ideal gas constant [J.K-1.mol-1]': 8.314462618,\n 'Faraday constant [C.mol-1]': 96485.33212,\n 'Negative electrode thickness [m]': 0.0001,\n 'Separator thickness [m]': 2.5e-05,\n 'Positive electrode thickness [m]': 0.0001,\n 'Electrode height [m]': 0.137,\n 'Electrode width [m]': 0.207,\n 'Nominal cell capacity [A.h]': 0.680616,\n 'Current function [A]': 0.680616,\n 'Maximum concentration in negative electrode [mol.m-3]': 24983.2619938437,\n 'Negative particle diffusivity [m2.s-1]': ,\n 'Negative electrode OCP [V]': ,\n 'Negative electrode porosity': 0.3,\n 'Negative electrode active material volume fraction': 0.6,\n 'Negative particle radius [m]': 1e-05,\n 'Negative electrode Bruggeman coefficient (electrolyte)': 1.5,\n 'Negative electrode Bruggeman coefficient (electrode)': 1.5,\n 'Negative electrode exchange-current density [A.m-2]': ,\n 'Negative electrode OCP entropic change [V.K-1]': ,\n 'Maximum concentration in positive electrode [mol.m-3]': 51217.9257309275,\n 'Positive particle diffusivity [m2.s-1]': ,\n 'Positive electrode OCP [V]': ,\n 'Positive electrode porosity': 0.3,\n 'Positive electrode active material volume fraction': 0.5,\n 'Positive particle radius [m]': 1e-05,\n 'Positive electrode Bruggeman coefficient (electrolyte)': 1.5,\n 'Positive electrode Bruggeman coefficient (electrode)': 1.5,\n 'Positive electrode exchange-current density [A.m-2]': ,\n 'Positive electrode OCP entropic change [V.K-1]': ,\n 'Separator porosity': 1.0,\n 'Separator Bruggeman coefficient (electrolyte)': 1.5,\n 'Initial concentration in electrolyte [mol.m-3]': 1000.0,\n 'Reference temperature [K]': 298.15,\n 'Ambient temperature [K]': 298.15,\n 'Number of electrodes connected in parallel to make a cell': 1.0,\n 'Number of cells connected in series to make a battery': 1.0,\n 'Lower voltage cut-off [V]': 3.105,\n 'Upper voltage cut-off [V]': 4.1,\n 'Initial concentration in negative electrode [mol.m-3]': 19986.609595075,\n 'Initial concentration in positive electrode [mol.m-3]': 30730.7554385565}" }, "execution_count": 61, "metadata": {}, diff --git a/src/pybamm/input/parameters/lithium_ion/Ai2020.py b/src/pybamm/input/parameters/lithium_ion/Ai2020.py index b45c04fa7f..f578d59fa5 100644 --- a/src/pybamm/input/parameters/lithium_ion/Ai2020.py +++ b/src/pybamm/input/parameters/lithium_ion/Ai2020.py @@ -5,7 +5,7 @@ def graphite_diffusivity_Dualfoil1998(sto, T): """ - Graphite diffusivity as a function of stochiometry [1, 2, 3]. + Graphite diffusivity as a function of stoichiometry [1, 2, 3]. References ---------- @@ -20,7 +20,7 @@ def graphite_diffusivity_Dualfoil1998(sto, T): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry + Electrode stoichiometry T: :class:`pybamm.Symbol` Dimensional temperature, [K] @@ -72,10 +72,10 @@ def graphite_electrolyte_exchange_current_density_Dualfoil1998( return m_ref * arrhenius * c_e**0.5 * c_s_surf**0.5 * (c_s_max - c_s_surf) ** 0.5 -def graphite_entropy_Enertech_Ai2020_function(sto, c_s_max): +def graphite_entropy_Enertech_Ai2020_function(sto): """ Lithium Cobalt Oxide (LiCO2) entropic change in open-circuit potential (OCP) at - a temperature of 298.15K as a function of the stochiometry. The fit is taken + a temperature of 298.15K as a function of the stoichiometry. The fit is taken from Ref [1], which is only accurate for 0.43 < sto < 0.9936. @@ -89,7 +89,7 @@ def graphite_entropy_Enertech_Ai2020_function(sto, c_s_max): Parameters ---------- sto: double - Stochiometry of material (li-fraction) + stoichiometry of material (li-fraction) Returns ------- @@ -126,9 +126,9 @@ def graphite_entropy_Enertech_Ai2020_function(sto, c_s_max): return du_dT -def graphite_volume_change_Ai2020(sto, c_s_max): +def graphite_volume_change_Ai2020(sto): """ - Graphite particle volume change as a function of stochiometry [1, 2]. + Graphite particle volume change as a function of stoichiometry [1, 2]. References ---------- @@ -143,7 +143,7 @@ def graphite_volume_change_Ai2020(sto, c_s_max): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry, dimensionless + Electrode stoichiometry, dimensionless should be R-averaged particle concentration c_s_max : :class:`pybamm.Symbol` Maximum particle concentration [mol.m-3] @@ -214,7 +214,7 @@ def graphite_cracking_rate_Ai2020(T_dim): def lico2_diffusivity_Dualfoil1998(sto, T): """ - LiCo2 diffusivity as a function of stochiometry, in this case the + LiCo2 diffusivity as a function of stoichiometry, in this case the diffusivity is taken to be a constant. The value is taken from Dualfoil [1]. References @@ -224,7 +224,7 @@ def lico2_diffusivity_Dualfoil1998(sto, T): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry + Electrode stoichiometry T: :class:`pybamm.Symbol` Dimensional temperature, [K] @@ -273,10 +273,10 @@ def lico2_electrolyte_exchange_current_density_Dualfoil1998(c_e, c_s_surf, c_s_m return m_ref * arrhenius * c_e**0.5 * c_s_surf**0.5 * (c_s_max - c_s_surf) ** 0.5 -def lico2_entropic_change_Ai2020_function(sto, c_s_max): +def lico2_entropic_change_Ai2020_function(sto): """ Lithium Cobalt Oxide (LiCO2) entropic change in open-circuit potential (OCP) at - a temperature of 298.15K as a function of the stochiometry. The fit is taken + a temperature of 298.15K as a function of the stoichiometry. The fit is taken from Ref [1], which is only accurate for 0.43 < sto < 0.9936. @@ -290,7 +290,7 @@ def lico2_entropic_change_Ai2020_function(sto, c_s_max): Parameters ---------- sto: double - Stochiometry of material (li-fraction) + stoichiometry of material (li-fraction) Returns ------- @@ -323,9 +323,9 @@ def lico2_entropic_change_Ai2020_function(sto, c_s_max): return du_dT -def lico2_volume_change_Ai2020(sto, c_s_max): +def lico2_volume_change_Ai2020(sto): """ - lico2 particle volume change as a function of stochiometry [1, 2]. + lico2 particle volume change as a function of stoichiometry [1, 2]. References ---------- @@ -340,10 +340,8 @@ def lico2_volume_change_Ai2020(sto, c_s_max): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry, dimensionless + Electrode stoichiometry, dimensionless should be R-averaged particle concentration - c_s_max : :class:`pybamm.Symbol` - Maximum particle concentration [mol.m-3] Returns ------- @@ -351,6 +349,7 @@ def lico2_volume_change_Ai2020(sto, c_s_max): volume change, dimensionless, normalised by particle volume """ omega = pybamm.Parameter("Positive electrode partial molar volume [m3.mol-1]") + c_s_max = pybamm.Parameter("Maximum concentration in positive electrode [mol.m-3]") t_change = omega * c_s_max * sto return t_change diff --git a/src/pybamm/input/parameters/lithium_ion/Chen2020.py b/src/pybamm/input/parameters/lithium_ion/Chen2020.py index 5a7460871b..b3655513a1 100644 --- a/src/pybamm/input/parameters/lithium_ion/Chen2020.py +++ b/src/pybamm/input/parameters/lithium_ion/Chen2020.py @@ -4,7 +4,7 @@ def graphite_LGM50_ocp_Chen2020(sto): """ - LG M50 Graphite open-circuit potential as a function of stochiometry, fit taken + LG M50 Graphite open-circuit potential as a function of stoichiometry, fit taken from [1]. References @@ -17,7 +17,7 @@ def graphite_LGM50_ocp_Chen2020(sto): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry + Electrode stoichiometry Returns ------- @@ -75,7 +75,7 @@ def graphite_LGM50_electrolyte_exchange_current_density_Chen2020( def nmc_LGM50_ocp_Chen2020(sto): """ - LG M50 NMC open-circuit potential as a function of stochiometry, fit taken + LG M50 NMC open-circuit potential as a function of stoichiometry, fit taken from [1]. References @@ -88,7 +88,7 @@ def nmc_LGM50_ocp_Chen2020(sto): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry + Electrode stoichiometry Returns ------- diff --git a/src/pybamm/input/parameters/lithium_ion/Chen2020_composite.py b/src/pybamm/input/parameters/lithium_ion/Chen2020_composite.py index 58b6211072..69b622a7c5 100644 --- a/src/pybamm/input/parameters/lithium_ion/Chen2020_composite.py +++ b/src/pybamm/input/parameters/lithium_ion/Chen2020_composite.py @@ -43,7 +43,7 @@ def graphite_LGM50_electrolyte_exchange_current_density_Chen2020( def silicon_ocp_lithiation_Mark2016(sto): """ silicon Open-circuit Potential (OCP) as a a function of the - stochiometry. The fit is taken from the Enertech cell [1], which is only accurate + stoichiometry. The fit is taken from the Enertech cell [1], which is only accurate for 0 < sto < 1. References @@ -55,7 +55,7 @@ def silicon_ocp_lithiation_Mark2016(sto): Parameters ---------- sto: double - Stochiometry of material (li-fraction) + stoichiometry of material (li-fraction) Returns ------- @@ -87,7 +87,7 @@ def silicon_ocp_lithiation_Mark2016(sto): def silicon_ocp_delithiation_Mark2016(sto): """ silicon Open-circuit Potential (OCP) as a a function of the - stochiometry. The fit is taken from the Enertech cell [1], which is only accurate + stoichiometry. The fit is taken from the Enertech cell [1], which is only accurate for 0 < sto < 1. References @@ -99,7 +99,7 @@ def silicon_ocp_delithiation_Mark2016(sto): Parameters ---------- sto: double - Stochiometry of material (li-fraction) + stoichiometry of material (li-fraction) Returns ------- @@ -170,7 +170,7 @@ def silicon_LGM50_electrolyte_exchange_current_density_Chen2020( def nmc_LGM50_ocp_Chen2020(sto): """ - LG M50 NMC open-circuit potential as a function of stochiometry, fit taken + LG M50 NMC open-circuit potential as a function of stoichiometry, fit taken from [1]. References @@ -183,7 +183,7 @@ def nmc_LGM50_ocp_Chen2020(sto): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry + Electrode stoichiometry Returns ------- diff --git a/src/pybamm/input/parameters/lithium_ion/Ecker2015.py b/src/pybamm/input/parameters/lithium_ion/Ecker2015.py index 32cc631293..05fbbb2fd7 100644 --- a/src/pybamm/input/parameters/lithium_ion/Ecker2015.py +++ b/src/pybamm/input/parameters/lithium_ion/Ecker2015.py @@ -4,7 +4,7 @@ def graphite_diffusivity_Ecker2015(sto, T): """ - Graphite diffusivity as a function of stochiometry [1, 2, 3]. + Graphite diffusivity as a function of stoichiometry [1, 2, 3]. References ---------- @@ -21,7 +21,7 @@ def graphite_diffusivity_Ecker2015(sto, T): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry + Electrode stoichiometry T: :class:`pybamm.Symbol` Dimensional temperature @@ -42,7 +42,7 @@ def graphite_diffusivity_Ecker2015(sto, T): def graphite_ocp_Ecker2015(sto): """ - Graphite OCP as a function of stochiometry [1, 2, 3]. + Graphite OCP as a function of stoichiometry [1, 2, 3]. References ---------- @@ -59,7 +59,7 @@ def graphite_ocp_Ecker2015(sto): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry + Electrode stoichiometry Returns ------- @@ -152,7 +152,7 @@ def graphite_electrolyte_exchange_current_density_Ecker2015(c_e, c_s_surf, c_s_m def nco_diffusivity_Ecker2015(sto, T): """ - NCO diffusivity as a function of stochiometry [1, 2, 3]. + NCO diffusivity as a function of stoichiometry [1, 2, 3]. References ---------- @@ -169,7 +169,7 @@ def nco_diffusivity_Ecker2015(sto, T): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry + Electrode stoichiometry T: :class:`pybamm.Symbol` Dimensional temperature @@ -190,7 +190,7 @@ def nco_diffusivity_Ecker2015(sto, T): def nco_ocp_Ecker2015(sto): """ - NCO OCP as a function of stochiometry [1, 2, 3]. + NCO OCP as a function of stoichiometry [1, 2, 3]. References ---------- @@ -207,7 +207,7 @@ def nco_ocp_Ecker2015(sto): Parameters ---------- sto : :class:`pybamm.Symbol` - Stochiometry of material (li-fraction) + stoichiometry of material (li-fraction) """ diff --git a/src/pybamm/input/parameters/lithium_ion/Ecker2015_graphite_halfcell.py b/src/pybamm/input/parameters/lithium_ion/Ecker2015_graphite_halfcell.py index 365bb6386c..267f55e774 100644 --- a/src/pybamm/input/parameters/lithium_ion/Ecker2015_graphite_halfcell.py +++ b/src/pybamm/input/parameters/lithium_ion/Ecker2015_graphite_halfcell.py @@ -34,7 +34,7 @@ def li_metal_electrolyte_exchange_current_density_Xu2019(c_e, c_Li, T): def graphite_diffusivity_Ecker2015(sto, T): """ - Graphite diffusivity as a function of stochiometry [1, 2, 3]. + Graphite diffusivity as a function of stoichiometry [1, 2, 3]. References ---------- @@ -51,7 +51,7 @@ def graphite_diffusivity_Ecker2015(sto, T): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry + Electrode stoichiometry T: :class:`pybamm.Symbol` Dimensional temperature @@ -72,7 +72,7 @@ def graphite_diffusivity_Ecker2015(sto, T): def graphite_ocp_Ecker2015(sto): """ - Graphite OCP as a function of stochiometry [1, 2, 3]. + Graphite OCP as a function of stoichiometry [1, 2, 3]. References ---------- @@ -89,7 +89,7 @@ def graphite_ocp_Ecker2015(sto): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry + Electrode stoichiometry Returns ------- diff --git a/src/pybamm/input/parameters/lithium_ion/Marquis2019.py b/src/pybamm/input/parameters/lithium_ion/Marquis2019.py index b1f63e6ff7..16591eac2d 100644 --- a/src/pybamm/input/parameters/lithium_ion/Marquis2019.py +++ b/src/pybamm/input/parameters/lithium_ion/Marquis2019.py @@ -4,7 +4,7 @@ def graphite_mcmb2528_diffusivity_Dualfoil1998(sto, T): """ - Graphite MCMB 2528 diffusivity as a function of stochiometry, in this case the + Graphite MCMB 2528 diffusivity as a function of stoichiometry, in this case the diffusivity is taken to be a constant. The value is taken from Dualfoil [1]. References @@ -14,7 +14,7 @@ def graphite_mcmb2528_diffusivity_Dualfoil1998(sto, T): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry + Electrode stoichiometry T: :class:`pybamm.Symbol` Dimensional temperature @@ -34,7 +34,7 @@ def graphite_mcmb2528_diffusivity_Dualfoil1998(sto, T): def graphite_mcmb2528_ocp_Dualfoil1998(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 + stoichiometry. 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. @@ -93,10 +93,10 @@ def graphite_electrolyte_exchange_current_density_Dualfoil1998( return m_ref * arrhenius * c_e**0.5 * c_s_surf**0.5 * (c_s_max - c_s_surf) ** 0.5 -def graphite_entropic_change_Moura2016(sto, c_s_max): +def graphite_entropic_change_Moura2016(sto): """ Graphite entropic change in open-circuit potential (OCP) at a temperature of - 298.15K as a function of the stochiometry taken from Scott Moura's FastDFN code + 298.15K as a function of the stoichiometry taken from Scott Moura's FastDFN code [1]. References @@ -106,9 +106,12 @@ def graphite_entropic_change_Moura2016(sto, c_s_max): Parameters ---------- sto : :class:`pybamm.Symbol` - Stochiometry of material (li-fraction) + stoichiometry of material (li-fraction) """ + # Original parametrization was expressed in terms of c_s_max, but we want to + # express it in terms of stoichiometry only + c_s_max = 24983.2619938437 du_dT = ( -1.5 * (120.0 / c_s_max) * np.exp(-120 * sto) + (0.0351 / (0.083 * c_s_max)) * ((np.cosh((sto - 0.286) / 0.083)) ** (-2)) @@ -126,7 +129,7 @@ def graphite_entropic_change_Moura2016(sto, c_s_max): def lico2_diffusivity_Dualfoil1998(sto, T): """ - LiCo2 diffusivity as a function of stochiometry, in this case the + LiCo2 diffusivity as a function of stoichiometry, in this case the diffusivity is taken to be a constant. The value is taken from Dualfoil [1]. References @@ -136,7 +139,7 @@ def lico2_diffusivity_Dualfoil1998(sto, T): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry + Electrode stoichiometry T: :class:`pybamm.Symbol` Dimensional temperature @@ -155,7 +158,7 @@ def lico2_diffusivity_Dualfoil1998(sto, T): def lico2_ocp_Dualfoil1998(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 + stoichiometry. 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 @@ -170,7 +173,7 @@ def lico2_ocp_Dualfoil1998(sto): Parameters ---------- sto : :class:`pybamm.Symbol` - Stochiometry of material (li-fraction) + stoichiometry of material (li-fraction) """ @@ -222,10 +225,10 @@ def lico2_electrolyte_exchange_current_density_Dualfoil1998(c_e, c_s_surf, c_s_m return m_ref * arrhenius * c_e**0.5 * c_s_surf**0.5 * (c_s_max - c_s_surf) ** 0.5 -def lico2_entropic_change_Moura2016(sto, c_s_max): +def lico2_entropic_change_Moura2016(sto): """ Lithium Cobalt Oxide (LiCO2) entropic change in open-circuit potential (OCP) at - a temperature of 298.15K as a function of the stochiometry. The fit is taken + a temperature of 298.15K as a function of the stoichiometry. The fit is taken from Scott Moura's FastDFN code [1]. References @@ -235,13 +238,15 @@ def lico2_entropic_change_Moura2016(sto, c_s_max): Parameters ---------- sto : :class:`pybamm.Symbol` - Stochiometry of material (li-fraction) + stoichiometry of material (li-fraction) """ # Since the equation for LiCo2 from this ref. has the stretch factor, # should this too? If not, the "bumps" in the OCV don't line up. stretch = 1.062 sto = stretch * sto - + # Original parametrization was expressed in terms of c_s_max, but we want to + # express it in terms of stoichiometry only + c_s_max = 51217.9257309275 du_dT = ( 0.07645 * (-54.4806 / c_s_max) * ((1.0 / np.cosh(30.834 - 54.4806 * sto)) ** 2) + 2.1581 * (-50.294 / c_s_max) * ((np.cosh(52.294 - 50.294 * sto)) ** (-2)) diff --git a/src/pybamm/input/parameters/lithium_ion/Mohtat2020.py b/src/pybamm/input/parameters/lithium_ion/Mohtat2020.py index 9923d9d308..0176c3f6a0 100644 --- a/src/pybamm/input/parameters/lithium_ion/Mohtat2020.py +++ b/src/pybamm/input/parameters/lithium_ion/Mohtat2020.py @@ -4,7 +4,7 @@ def graphite_diffusivity_PeymanMPM(sto, T): """ - Graphite diffusivity as a function of stochiometry, in this case the + Graphite diffusivity as a function of stoichiometry, in this case the diffusivity is taken to be a constant. The value is taken from Peyman MPM. References @@ -14,7 +14,7 @@ def graphite_diffusivity_PeymanMPM(sto, T): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry + Electrode stoichiometry T: :class:`pybamm.Symbol` Dimensional temperature @@ -34,7 +34,7 @@ def graphite_diffusivity_PeymanMPM(sto, T): def graphite_ocp_PeymanMPM(sto): """ Graphite Open-circuit Potential (OCP) as a function of the - stochiometry. The fit is taken from Peyman MPM [1]. + stoichiometry. The fit is taken from Peyman MPM [1]. References ---------- @@ -89,10 +89,10 @@ def graphite_electrolyte_exchange_current_density_PeymanMPM(c_e, c_s_surf, c_s_m return m_ref * arrhenius * c_e**0.5 * c_s_surf**0.5 * (c_s_max - c_s_surf) ** 0.5 -def graphite_entropic_change_PeymanMPM(sto, c_s_max): +def graphite_entropic_change_PeymanMPM(sto): """ Graphite entropic change in open-circuit potential (OCP) at a temperature of - 298.15K as a function of the stochiometry taken from [1] + 298.15K as a function of the stoichiometry taken from [1] References ---------- @@ -102,7 +102,7 @@ def graphite_entropic_change_PeymanMPM(sto, c_s_max): Parameters ---------- sto : :class:`pybamm.Symbol` - Stochiometry of material (li-fraction) + stoichiometry of material (li-fraction) """ @@ -121,7 +121,7 @@ def graphite_entropic_change_PeymanMPM(sto, c_s_max): def NMC_diffusivity_PeymanMPM(sto, T): """ - NMC diffusivity as a function of stochiometry, in this case the + NMC diffusivity as a function of stoichiometry, in this case the diffusivity is taken to be a constant. The value is taken from Peyman MPM. References @@ -131,7 +131,7 @@ def NMC_diffusivity_PeymanMPM(sto, T): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry + Electrode stoichiometry T: :class:`pybamm.Symbol` Dimensional temperature @@ -151,7 +151,7 @@ def NMC_diffusivity_PeymanMPM(sto, T): def NMC_ocp_PeymanMPM(sto): """ Nickel Managanese Cobalt Oxide (NMC) Open-circuit Potential (OCP) as a - function of the stochiometry. The fit is taken from Peyman MPM. + function of the stoichiometry. The fit is taken from Peyman MPM. References ---------- @@ -160,7 +160,7 @@ def NMC_ocp_PeymanMPM(sto): Parameters ---------- sto : :class:`pybamm.Symbol` - Stochiometry of material (li-fraction) + stoichiometry of material (li-fraction) """ @@ -209,7 +209,7 @@ def NMC_electrolyte_exchange_current_density_PeymanMPM(c_e, c_s_surf, c_s_max, T return m_ref * arrhenius * c_e**0.5 * c_s_surf**0.5 * (c_s_max - c_s_surf) ** 0.5 -def NMC_entropic_change_PeymanMPM(sto, c_s_max): +def NMC_entropic_change_PeymanMPM(sto): """ Nickel Manganese Cobalt (NMC) entropic change in open-circuit potential (OCP) at a temperature of 298.15K as a function of the OCP. The fit is taken from [1]. @@ -224,7 +224,7 @@ def NMC_entropic_change_PeymanMPM(sto, c_s_max): Parameters ---------- sto : :class:`pybamm.Symbol` - Stochiometry of material (li-fraction) + stoichiometry of material (li-fraction) """ diff --git a/src/pybamm/input/parameters/lithium_ion/NCA_Kim2011.py b/src/pybamm/input/parameters/lithium_ion/NCA_Kim2011.py index 7d0478b6d0..1af610f58a 100644 --- a/src/pybamm/input/parameters/lithium_ion/NCA_Kim2011.py +++ b/src/pybamm/input/parameters/lithium_ion/NCA_Kim2011.py @@ -16,7 +16,7 @@ def graphite_diffusivity_Kim2011(sto, T): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry + Electrode stoichiometry T: :class:`pybamm.Symbol` Dimensional temperature @@ -35,7 +35,7 @@ def graphite_diffusivity_Kim2011(sto, T): def graphite_ocp_Kim2011(sto): """ - Graphite Open-circuit Potential (OCP) as a function of the stochiometry [1]. + Graphite Open-circuit Potential (OCP) as a function of the stoichiometry [1]. References ---------- @@ -92,7 +92,7 @@ def graphite_electrolyte_exchange_current_density_Kim2011(c_e, c_s_surf, c_s_max """ i0_ref = 36 # reference exchange current density at 100% SOC - sto = 0.36 # stochiometry at 100% SOC + sto = 0.36 # stoichiometry at 100% SOC c_s_n_ref = sto * c_s_max # reference electrode concentration c_e_ref = pybamm.Parameter("Initial concentration in electrolyte [mol.m-3]") alpha = 0.5 # charge transfer coefficient @@ -111,7 +111,7 @@ def graphite_electrolyte_exchange_current_density_Kim2011(c_e, c_s_surf, c_s_max def nca_diffusivity_Kim2011(sto, T): """ - NCA diffusivity as a function of stochiometry [1]. + NCA diffusivity as a function of stoichiometry [1]. References ---------- @@ -123,7 +123,7 @@ def nca_diffusivity_Kim2011(sto, T): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry + Electrode stoichiometry T: :class:`pybamm.Symbol` Dimensional temperature @@ -168,7 +168,7 @@ def nca_electrolyte_exchange_current_density_Kim2011(c_e, c_s_surf, c_s_max, T): Exchange-current density [A.m-2] """ i0_ref = 4 # reference exchange current density at 100% SOC - sto = 0.41 # stochiometry at 100% SOC + sto = 0.41 # stoichiometry at 100% SOC c_s_ref = sto * c_s_max # reference electrode concentration c_e_ref = pybamm.Parameter("Initial concentration in electrolyte [mol.m-3]") alpha = 0.5 # charge transfer coefficient @@ -252,7 +252,7 @@ def electrolyte_conductivity_Kim2011(c_e, T): def nca_ocp_Kim2011(sto): """ - Graphite Open Circuit Potential (OCP) as a function of the stochiometry [1]. + Graphite Open Circuit Potential (OCP) as a function of the stoichiometry [1]. References ---------- diff --git a/src/pybamm/input/parameters/lithium_ion/OKane2022.py b/src/pybamm/input/parameters/lithium_ion/OKane2022.py index b1e852dbdf..4ccb72bf62 100644 --- a/src/pybamm/input/parameters/lithium_ion/OKane2022.py +++ b/src/pybamm/input/parameters/lithium_ion/OKane2022.py @@ -96,7 +96,7 @@ def SEI_limited_dead_lithium_OKane2022(L_sei): def graphite_LGM50_diffusivity_Chen2020(sto, T): """ - LG M50 Graphite diffusivity as a function of stochiometry, in this case the + LG M50 Graphite diffusivity as a function of stoichiometry, in this case the diffusivity is taken to be a constant. The value is taken from [1]. References @@ -109,7 +109,7 @@ def graphite_LGM50_diffusivity_Chen2020(sto, T): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry + Electrode stoichiometry T: :class:`pybamm.Symbol` Dimensional temperature @@ -165,9 +165,9 @@ def graphite_LGM50_electrolyte_exchange_current_density_Chen2020( return m_ref * arrhenius * c_e**0.5 * c_s_surf**0.5 * (c_s_max - c_s_surf) ** 0.5 -def graphite_volume_change_Ai2020(sto, c_s_max): +def graphite_volume_change_Ai2020(sto): """ - Graphite particle volume change as a function of stochiometry [1, 2]. + Graphite particle volume change as a function of stoichiometry [1, 2]. References ---------- @@ -182,7 +182,7 @@ def graphite_volume_change_Ai2020(sto, c_s_max): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry, dimensionless + Electrode stoichiometry, dimensionless should be R-averaged particle concentration Returns ------- @@ -260,7 +260,7 @@ def nmc_LGM50_diffusivity_Chen2020(sto, T): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry + Electrode stoichiometry T: :class:`pybamm.Symbol` Dimensional temperature @@ -279,7 +279,7 @@ def nmc_LGM50_diffusivity_Chen2020(sto, T): def nmc_LGM50_ocp_Chen2020(sto): """ - LG M50 NMC open-circuit potential as a function of stochiometry, fit taken + LG M50 NMC open-circuit potential as a function of stoichiometry, fit taken from [1]. References @@ -292,7 +292,7 @@ def nmc_LGM50_ocp_Chen2020(sto): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry + Electrode stoichiometry Returns ------- @@ -344,9 +344,9 @@ def nmc_LGM50_electrolyte_exchange_current_density_Chen2020(c_e, c_s_surf, c_s_m return m_ref * arrhenius * c_e**0.5 * c_s_surf**0.5 * (c_s_max - c_s_surf) ** 0.5 -def volume_change_Ai2020(sto, c_s_max): +def volume_change_Ai2020(sto): """ - Particle volume change as a function of stochiometry [1, 2]. + Particle volume change as a function of stoichiometry [1, 2]. References ---------- @@ -361,7 +361,7 @@ def volume_change_Ai2020(sto, c_s_max): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry, dimensionless + Electrode stoichiometry, dimensionless should be R-averaged particle concentration Returns ------- @@ -369,6 +369,7 @@ def volume_change_Ai2020(sto, c_s_max): volume change, dimensionless, normalised by particle volume """ omega = pybamm.Parameter("Positive electrode partial molar volume [m3.mol-1]") + c_s_max = pybamm.Parameter("Maximum concentration in positive electrode [mol.m-3]") t_change = omega * c_s_max * sto return t_change diff --git a/src/pybamm/input/parameters/lithium_ion/OKane2022_graphite_SiOx_halfcell.py b/src/pybamm/input/parameters/lithium_ion/OKane2022_graphite_SiOx_halfcell.py index 35533ba80e..c343dd23f4 100644 --- a/src/pybamm/input/parameters/lithium_ion/OKane2022_graphite_SiOx_halfcell.py +++ b/src/pybamm/input/parameters/lithium_ion/OKane2022_graphite_SiOx_halfcell.py @@ -126,7 +126,7 @@ def SEI_limited_dead_lithium_OKane2022(L_sei): def graphite_LGM50_diffusivity_Chen2020(sto, T): """ - LG M50 Graphite diffusivity as a function of stochiometry, in this case the + LG M50 Graphite diffusivity as a function of stoichiometry, in this case the diffusivity is taken to be a constant. The value is taken from [1]. References @@ -139,7 +139,7 @@ def graphite_LGM50_diffusivity_Chen2020(sto, T): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry + Electrode stoichiometry T: :class:`pybamm.Symbol` Dimensional temperature @@ -195,9 +195,9 @@ def graphite_LGM50_electrolyte_exchange_current_density_Chen2020( return m_ref * arrhenius * c_e**0.5 * c_s_surf**0.5 * (c_s_max - c_s_surf) ** 0.5 -def graphite_volume_change_Ai2020(sto, c_s_max): +def graphite_volume_change_Ai2020(sto): """ - Graphite particle volume change as a function of stochiometry [1, 2]. + Graphite particle volume change as a function of stoichiometry [1, 2]. References ---------- @@ -212,7 +212,7 @@ def graphite_volume_change_Ai2020(sto, c_s_max): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry, dimensionless + Electrode stoichiometry, dimensionless should be R-averaged particle concentration Returns ------- diff --git a/src/pybamm/input/parameters/lithium_ion/ORegan2022.py b/src/pybamm/input/parameters/lithium_ion/ORegan2022.py index 3ca5f6824c..45c8cdbcbd 100644 --- a/src/pybamm/input/parameters/lithium_ion/ORegan2022.py +++ b/src/pybamm/input/parameters/lithium_ion/ORegan2022.py @@ -233,7 +233,7 @@ def copper_thermal_conductivity_CRC(T): def graphite_LGM50_diffusivity_ORegan2022(sto, T): """ - LG M50 Graphite diffusivity as a function of stochiometry, in this case the + LG M50 Graphite diffusivity as a function of stoichiometry, in this case the diffusivity is taken to be a constant. The value is taken from [1]. References @@ -245,7 +245,7 @@ def graphite_LGM50_diffusivity_ORegan2022(sto, T): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry + Electrode stoichiometry T: :class:`pybamm.Symbol` Dimensional temperature @@ -292,7 +292,7 @@ def graphite_LGM50_diffusivity_ORegan2022(sto, T): def graphite_LGM50_ocp_Chen2020(sto): """ - LG M50 Graphite open-circuit potential as a function of stochiometry, fit taken + LG M50 Graphite open-circuit potential as a function of stoichiometry, fit taken from [1]. References @@ -305,7 +305,7 @@ def graphite_LGM50_ocp_Chen2020(sto): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry + Electrode stoichiometry Returns ------- @@ -439,10 +439,10 @@ def graphite_LGM50_thermal_conductivity_ORegan2022(T): return lambda_wet -def graphite_LGM50_entropic_change_ORegan2022(sto, c_s_max): +def graphite_LGM50_entropic_change_ORegan2022(sto): """ LG M50 Graphite entropic change in open-circuit potential (OCP) at a temperature of - 298.15K as a function of the stochiometry. The fit is taken from [1]. + 298.15K as a function of the stoichiometry. The fit is taken from [1]. References ---------- @@ -453,7 +453,7 @@ def graphite_LGM50_entropic_change_ORegan2022(sto, c_s_max): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry + Electrode stoichiometry Returns ------- @@ -525,7 +525,7 @@ def nmc_LGM50_diffusivity_ORegan2022(sto, T): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry + Electrode stoichiometry T: :class:`pybamm.Symbol` Dimensional temperature @@ -579,7 +579,7 @@ def nmc_LGM50_ocp_Chen2020(sto): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry + Electrode stoichiometry Returns ------- @@ -712,10 +712,10 @@ def nmc_LGM50_thermal_conductivity_ORegan2022(T): return lambda_wet -def nmc_LGM50_entropic_change_ORegan2022(sto, c_s_max): +def nmc_LGM50_entropic_change_ORegan2022(sto): """ LG M50 NMC 811 entropic change in open-circuit potential (OCP) at a temperature of - 298.15K as a function of the stochiometry. The fit is taken from [1]. + 298.15K as a function of the stoichiometry. The fit is taken from [1]. References ---------- @@ -726,7 +726,7 @@ def nmc_LGM50_entropic_change_ORegan2022(sto, c_s_max): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry + Electrode stoichiometry Returns ------- diff --git a/src/pybamm/input/parameters/lithium_ion/Prada2013.py b/src/pybamm/input/parameters/lithium_ion/Prada2013.py index 0ba56516ab..f27ba23bdd 100644 --- a/src/pybamm/input/parameters/lithium_ion/Prada2013.py +++ b/src/pybamm/input/parameters/lithium_ion/Prada2013.py @@ -4,7 +4,7 @@ def graphite_LGM50_ocp_Chen2020(sto): """ - LG M50 Graphite open-circuit potential as a function of stochiometry, fit taken + LG M50 Graphite open-circuit potential as a function of stoichiometry, fit taken from [1]. Prada2013 doesn't give an OCP for graphite, so we use this instead. References @@ -17,7 +17,7 @@ def graphite_LGM50_ocp_Chen2020(sto): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry + Electrode stoichiometry Returns ------- @@ -86,7 +86,7 @@ def LFP_ocp_Afshar2017(sto): Parameters ---------- sto : :class:`pybamm.Symbol` - Stochiometry of material (li-fraction) + stoichiometry of material (li-fraction) """ diff --git a/src/pybamm/input/parameters/lithium_ion/Ramadass2004.py b/src/pybamm/input/parameters/lithium_ion/Ramadass2004.py index 879a5f55c6..a1e24da7e3 100644 --- a/src/pybamm/input/parameters/lithium_ion/Ramadass2004.py +++ b/src/pybamm/input/parameters/lithium_ion/Ramadass2004.py @@ -4,7 +4,7 @@ def graphite_mcmb2528_diffusivity_Dualfoil1998(sto, T): """ - Graphite MCMB 2528 diffusivity as a function of stochiometry, in this case the + Graphite MCMB 2528 diffusivity as a function of stoichiometry, in this case the diffusivity is taken to be a constant. The value is taken from Dualfoil [1]. References @@ -14,7 +14,7 @@ def graphite_mcmb2528_diffusivity_Dualfoil1998(sto, T): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry + Electrode stoichiometry T: :class:`pybamm.Symbol` Dimensional temperature @@ -34,7 +34,7 @@ def graphite_mcmb2528_diffusivity_Dualfoil1998(sto, T): def graphite_ocp_Ramadass2004(sto): """ Graphite Open-circuit Potential (OCP) as a function of the - stochiometry (theta?). The fit is taken from Ramadass 2004. + stoichiometry (theta?). The fit is taken from Ramadass 2004. References ---------- @@ -92,10 +92,10 @@ def graphite_electrolyte_exchange_current_density_Ramadass2004( return m_ref * arrhenius * c_e**0.5 * c_s_surf**0.5 * (c_s_max - c_s_surf) ** 0.5 -def graphite_entropic_change_Moura2016(sto, c_s_max): +def graphite_entropic_change_Moura2016(sto): """ Graphite entropic change in open-circuit potential (OCP) at a temperature of - 298.15K as a function of the stochiometry taken from Scott Moura's FastDFN code + 298.15K as a function of the stoichiometry taken from Scott Moura's FastDFN code [1]. References @@ -105,9 +105,12 @@ def graphite_entropic_change_Moura2016(sto, c_s_max): Parameters ---------- sto : :class:`pybamm.Symbol` - Stochiometry of material (li-fraction) + stoichiometry of material (li-fraction) """ + # Original parametrization was expressed in terms of c_s_max, but we want to + # express it in terms of stoichiometry only + c_s_max = 24983.2619938437 du_dT = ( -1.5 * (120.0 / c_s_max) * np.exp(-120 * sto) + (0.0351 / (0.083 * c_s_max)) * ((np.cosh((sto - 0.286) / 0.083)) ** (-2)) @@ -125,7 +128,7 @@ def graphite_entropic_change_Moura2016(sto, c_s_max): def lico2_diffusivity_Ramadass2004(sto, T): """ - LiCo2 diffusivity as a function of stochiometry, in this case the + LiCo2 diffusivity as a function of stoichiometry, in this case the diffusivity is taken to be a constant. The value is taken from Ramadass 2004. References @@ -137,7 +140,7 @@ def lico2_diffusivity_Ramadass2004(sto, T): Parameters ---------- sto: :class:`pybamm.Symbol` - Electrode stochiometry + Electrode stoichiometry T: :class:`pybamm.Symbol` Dimensional temperature @@ -156,7 +159,7 @@ def lico2_diffusivity_Ramadass2004(sto, T): def lico2_ocp_Ramadass2004(sto): """ Lithium Cobalt Oxide (LiCO2) Open-circuit Potential (OCP) as a a function of the - stochiometry. The fit is taken from Ramadass 2004. Stretch is considered the + stoichiometry. The fit is taken from Ramadass 2004. Stretch is considered the overhang area negative electrode / area positive electrode, in Ramadass 2002. References @@ -168,7 +171,7 @@ def lico2_ocp_Ramadass2004(sto): Parameters ---------- sto : :class:`pybamm.Symbol` - Stochiometry of material (li-fraction) + stoichiometry of material (li-fraction) """ @@ -228,10 +231,10 @@ def lico2_electrolyte_exchange_current_density_Ramadass2004(c_e, c_s_surf, c_s_m return m_ref * arrhenius * c_e**0.5 * c_s_surf**0.5 * (c_s_max - c_s_surf) ** 0.5 -def lico2_entropic_change_Moura2016(sto, c_s_max): +def lico2_entropic_change_Moura2016(sto): """ Lithium Cobalt Oxide (LiCO2) entropic change in open-circuit potential (OCP) at - a temperature of 298.15K as a function of the stochiometry. The fit is taken + a temperature of 298.15K as a function of the stoichiometry. The fit is taken from Scott Moura's FastDFN code [1]. References @@ -241,13 +244,15 @@ def lico2_entropic_change_Moura2016(sto, c_s_max): Parameters ---------- sto : :class:`pybamm.Symbol` - Stochiometry of material (li-fraction) + stoichiometry of material (li-fraction) """ # Since the equation for LiCo2 from this ref. has the stretch factor, # should this too? If not, the "bumps" in the OCV don't line up. stretch = 1.062 sto = stretch * sto - + # Original parametrization was expressed in terms of c_s_max, but we want to + # express it in terms of stoichiometry only + c_s_max = 51217.9257309275 du_dT = ( 0.07645 * (-54.4806 / c_s_max) * ((1.0 / np.cosh(30.834 - 54.4806 * sto)) ** 2) + 2.1581 * (-50.294 / c_s_max) * ((np.cosh(52.294 - 50.294 * sto)) ** (-2)) diff --git a/src/pybamm/input/parameters/lithium_ion/Xu2019.py b/src/pybamm/input/parameters/lithium_ion/Xu2019.py index edf3bd40b0..caee487339 100644 --- a/src/pybamm/input/parameters/lithium_ion/Xu2019.py +++ b/src/pybamm/input/parameters/lithium_ion/Xu2019.py @@ -36,7 +36,7 @@ def li_metal_electrolyte_exchange_current_density_Xu2019(c_e, c_Li, T): def nmc_ocp_Xu2019(sto): """ Nickel Managanese Cobalt Oxide (NMC) Open-circuit Potential (OCP) as a - function of the stochiometry, from [1]. + function of the stoichiometry, from [1]. References ---------- @@ -48,7 +48,7 @@ def nmc_ocp_Xu2019(sto): Parameters ---------- sto : :class:`pybamm.Symbol` - Stochiometry of material (li-fraction) + stoichiometry of material (li-fraction) """ diff --git a/src/pybamm/parameters/bpx.py b/src/pybamm/parameters/bpx.py index 7485e805b9..df380ad627 100644 --- a/src/pybamm/parameters/bpx.py +++ b/src/pybamm/parameters/bpx.py @@ -228,12 +228,6 @@ def _bpx_to_param_dict(bpx: BPX) -> dict: def _arrhenius(Ea, T): return exp(Ea / constants.R * (1 / T_ref - 1 / T)) - def _entropic_change(sto, c_s_max, dUdT, constant=False): - if constant: - return dUdT - else: - return dUdT(sto) - # reaction rates in pybamm exchange current is defined j0 = k * sqrt(ce * cs * # (cs-cs_max)) in BPX exchange current is defined j0 = F * k_norm * sqrt((ce/ce0) * # (cs/cs_max) * (1-cs/cs_max)) @@ -284,25 +278,10 @@ def _conductivity(c_e, T, Ea, sigma_ref, constant=False): ) # entropic change - dUdT = pybamm_dict[ - phase_domain_pre_name + "entropic change coefficient [V.K-1]" - ] - if callable(dUdT): + dUdT = pybamm_dict[phase_domain_pre_name + "OCP entropic change [V.K-1]"] + if isinstance(dUdT, tuple): pybamm_dict[phase_domain_pre_name + "OCP entropic change [V.K-1]"] = ( - partial(_entropic_change, dUdT=dUdT) - ) - elif isinstance(dUdT, tuple): - pybamm_dict[phase_domain_pre_name + "OCP entropic change [V.K-1]"] = ( - partial( - _entropic_change, - dUdT=partial( - _interpolant_func, name=dUdT[0], x=dUdT[1][0], y=dUdT[1][1] - ), - ) - ) - else: - pybamm_dict[phase_domain_pre_name + "OCP entropic change [V.K-1]"] = ( - partial(_entropic_change, dUdT=dUdT, constant=True) + partial(_interpolant_func, name=dUdT[0], x=dUdT[1][0], y=dUdT[1][1]) ) # reaction rate @@ -440,6 +419,10 @@ def _get_pybamm_name(pybamm_name, domain): pybamm_name = domain.short_pre_name + pybamm_name_lower elif pybamm_name.startswith("OCP"): pybamm_name = domain.pre_name + pybamm_name + elif pybamm_name.startswith("Entropic change"): + pybamm_name = domain.pre_name + pybamm_name.replace( + "Entropic change coefficient", "OCP entropic change" + ) elif pybamm_name.startswith("Cation transference number"): pybamm_name = pybamm_name elif domain.pre_name != "": diff --git a/src/pybamm/parameters/lithium_ion_parameters.py b/src/pybamm/parameters/lithium_ion_parameters.py index f5a76c6d48..e372cab4a4 100644 --- a/src/pybamm/parameters/lithium_ion_parameters.py +++ b/src/pybamm/parameters/lithium_ion_parameters.py @@ -669,11 +669,9 @@ def dUdT(self, sto): "MSMR" formulation, stoichiometry is explicitly defined as a function of U and T, and dUdT is only used to calculate the reversible heat generation term. """ - domain, Domain = self.domain_Domain + Domain = self.domain.capitalize() inputs = { f"{Domain} particle stoichiometry": sto, - f"{self.phase_prefactor}Maximum {domain} particle " - "surface concentration [mol.m-3]": self.c_max, } return pybamm.FunctionParameter( f"{self.phase_prefactor}{Domain} electrode OCP entropic change [V.K-1]", @@ -794,12 +792,10 @@ def t_change(self, sto): """ Volume change for the electrode; sto should be R-averaged """ - domain, Domain = self.domain_Domain + Domain = self.domain.capitalize() return pybamm.FunctionParameter( f"{Domain} electrode volume change", { - "Particle stoichiometry": sto, - f"{self.phase_prefactor}Maximum {domain} particle " - "surface concentration [mol.m-3]": self.c_max, + f"{Domain} particle stoichiometry": sto, }, ) diff --git a/tests/unit/test_parameters/test_bpx.py b/tests/unit/test_parameters/test_bpx.py index ab4c25f97a..3cc7cfebf1 100644 --- a/tests/unit/test_parameters/test_bpx.py +++ b/tests/unit/test_parameters/test_bpx.py @@ -203,7 +203,7 @@ def check_constant_output(func): D = param[f"{electrode} particle diffusivity [m2.s-1]"] dUdT = param[f"{electrode} electrode OCP entropic change [V.K-1]"] check_constant_output(D) - check_constant_output(dUdT) + self.assertEqual(dUdT, 1) kappa = param["Electrolyte conductivity [S.m-1]"] De = param["Electrolyte diffusivity [m2.s-1]"] @@ -260,9 +260,7 @@ def test_table_data(self): self.assertIsInstance(D, pybamm.Interpolant) OCP = param[f"{electrode} electrode OCP [V]"](c) self.assertIsInstance(OCP, pybamm.Interpolant) - dUdT = param[f"{electrode} electrode OCP entropic change [V.K-1]"]( - c, 10000 - ) + dUdT = param[f"{electrode} electrode OCP entropic change [V.K-1]"](c) self.assertIsInstance(dUdT, pybamm.Interpolant) def test_bpx_soc_error(self): diff --git a/tests/unit/test_parameters/test_parameter_sets/test_Ai2020.py b/tests/unit/test_parameters/test_parameter_sets/test_Ai2020.py index f7302330bf..05fe8f68fa 100644 --- a/tests/unit/test_parameters/test_parameter_sets/test_Ai2020.py +++ b/tests/unit/test_parameters/test_parameter_sets/test_Ai2020.py @@ -22,10 +22,10 @@ def test_functions(self): 0.6098, ), "Positive electrode OCP entropic change [V.K-1]": ( - [sto, c_p_max], + [sto], -2.1373e-4, ), - "Positive electrode volume change": ([sto, c_p_max], -1.8179e-2), + "Positive electrode volume change": ([sto], -1.8179e-2), # Negative electrode "Negative electrode cracking rate": ([T], 3.9e-20), "Negative particle diffusivity [m2.s-1]": ([sto, T], 3.9e-14), @@ -34,10 +34,10 @@ def test_functions(self): 0.4172, ), "Negative electrode OCP entropic change [V.K-1]": ( - [sto, c_n_max], + [sto], -1.1033e-4, ), - "Negative electrode volume change": ([sto, c_n_max], 5.1921e-2), + "Negative electrode volume change": ([sto], 5.1921e-2), } for name, value in fun_test.items(): diff --git a/tests/unit/test_parameters/test_parameter_sets/test_LCO_Ramadass2004.py b/tests/unit/test_parameters/test_parameter_sets/test_LCO_Ramadass2004.py index e6c4b04fdf..287c4e97d8 100644 --- a/tests/unit/test_parameters/test_parameter_sets/test_LCO_Ramadass2004.py +++ b/tests/unit/test_parameters/test_parameter_sets/test_LCO_Ramadass2004.py @@ -21,7 +21,7 @@ def test_functions(self): 1.4517, ), "Positive electrode OCP entropic change [V.K-1]": ( - [sto, c_p_max], + [sto], -3.4664e-5, ), "Positive electrode OCP [V]": ([sto], 4.1249), @@ -32,7 +32,7 @@ def test_functions(self): 2.2007, ), "Negative electrode OCP entropic change [V.K-1]": ( - [sto, c_n_max], + [sto], -1.5079e-5, ), "Negative electrode OCP [V]": ([sto], 0.1215), diff --git a/tests/unit/test_parameters/test_parameter_sets/test_LGM50_ORegan2022.py b/tests/unit/test_parameters/test_parameter_sets/test_LGM50_ORegan2022.py index 05a38b6245..8a7e401d66 100644 --- a/tests/unit/test_parameters/test_parameter_sets/test_LGM50_ORegan2022.py +++ b/tests/unit/test_parameters/test_parameter_sets/test_LGM50_ORegan2022.py @@ -15,7 +15,7 @@ def test_functions(self): fun_test = { # Positive electrode "Positive electrode OCP entropic change [V.K-1]": ( - [0.5, c_p_max], + [0.5], -9.7940e-07, ), "Positive electrode specific heat capacity [J.kg-1.K-1]": ( @@ -32,7 +32,7 @@ def test_functions(self): "Positive electrode thermal conductivity [W.m-1.K-1]": ([T], 0.8047), # Negative electrode "Negative electrode OCP entropic change [V.K-1]": ( - [0.5, c_n_max], + [0.5], -2.6460e-07, ), "Negative electrode specific heat capacity [J.kg-1.K-1]": ( diff --git a/tests/unit/test_parameters/test_parameter_sets/test_OKane2022.py b/tests/unit/test_parameters/test_parameter_sets/test_OKane2022.py index e34f837b38..014b467715 100644 --- a/tests/unit/test_parameters/test_parameter_sets/test_OKane2022.py +++ b/tests/unit/test_parameters/test_parameter_sets/test_OKane2022.py @@ -27,7 +27,7 @@ def test_functions(self): 0.33947, ), "Negative electrode cracking rate": ([T], 3.9e-20), - "Negative electrode volume change": ([sto, 33133], 0.0897), + "Negative electrode volume change": ([sto], 0.0897), # Positive electrode "Positive particle diffusivity [m2.s-1]": ([sto, T], 4e-15), "Positive electrode exchange-current density [A.m-2]": ( @@ -36,7 +36,7 @@ def test_functions(self): ), "Positive electrode OCP [V]": ([sto], 3.5682), "Positive electrode cracking rate": ([T], 3.9e-20), - "Positive electrode volume change": ([sto, 63104], 0.70992), + "Positive electrode volume change": ([sto], 0.70992), } for name, value in fun_test.items(): diff --git a/tests/unit/test_parameters/test_parameter_sets/test_OKane2022_negative_halfcell.py b/tests/unit/test_parameters/test_parameter_sets/test_OKane2022_negative_halfcell.py index bf39457dc4..beebeb35e3 100644 --- a/tests/unit/test_parameters/test_parameter_sets/test_OKane2022_negative_halfcell.py +++ b/tests/unit/test_parameters/test_parameter_sets/test_OKane2022_negative_halfcell.py @@ -26,7 +26,7 @@ def test_functions(self): 0.33947, ), "Positive electrode cracking rate": ([T], 3.9e-20), - "Positive electrode volume change": ([sto, 33133], 0.0897), + "Positive electrode volume change": ([sto], 0.0897), } for name, value in fun_test.items():