Skip to content

Commit

Permalink
#4405 make dUdT and volume change functions of sto only (#4427)
Browse files Browse the repository at this point in the history
* #4405 make dUdT and volume change functions of sto only

* #4405 changelog
  • Loading branch information
rtimms authored Sep 9, 2024
1 parent 6c1815b commit 10a2254
Show file tree
Hide file tree
Showing 24 changed files with 155 additions and 167 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]': <function pybamm.input.parameters.lithium_ion.Marquis2019.graphite_mcmb2528_diffusivity_Dualfoil1998(sto, T)>,\n 'Negative electrode OCP [V]': <function pybamm.input.parameters.lithium_ion.Marquis2019.graphite_mcmb2528_ocp_Dualfoil1998(sto)>,\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]': <function pybamm.input.parameters.lithium_ion.Marquis2019.graphite_electrolyte_exchange_current_density_Dualfoil1998(c_e, c_s_surf, c_s_max, T)>,\n 'Negative electrode OCP entropic change [V.K-1]': <function pybamm.input.parameters.lithium_ion.Marquis2019.graphite_entropic_change_Moura2016(sto, c_s_max)>,\n 'Maximum concentration in positive electrode [mol.m-3]': 51217.9257309275,\n 'Positive particle diffusivity [m2.s-1]': <function pybamm.input.parameters.lithium_ion.Marquis2019.lico2_diffusivity_Dualfoil1998(sto, T)>,\n 'Positive electrode OCP [V]': <function pybamm.input.parameters.lithium_ion.Marquis2019.lico2_ocp_Dualfoil1998(sto)>,\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]': <function pybamm.input.parameters.lithium_ion.Marquis2019.lico2_electrolyte_exchange_current_density_Dualfoil1998(c_e, c_s_surf, c_s_max, T)>,\n 'Positive electrode OCP entropic change [V.K-1]': <function pybamm.input.parameters.lithium_ion.Marquis2019.lico2_entropic_change_Moura2016(sto, c_s_max)>,\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]': <function pybamm.input.parameters.lithium_ion.Marquis2019.graphite_mcmb2528_diffusivity_Dualfoil1998(sto, T)>,\n 'Negative electrode OCP [V]': <function pybamm.input.parameters.lithium_ion.Marquis2019.graphite_mcmb2528_ocp_Dualfoil1998(sto)>,\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]': <function pybamm.input.parameters.lithium_ion.Marquis2019.graphite_electrolyte_exchange_current_density_Dualfoil1998(c_e, c_s_surf, c_s_max, T)>,\n 'Negative electrode OCP entropic change [V.K-1]': <function pybamm.input.parameters.lithium_ion.Marquis2019.graphite_entropic_change_Moura2016(sto)>,\n 'Maximum concentration in positive electrode [mol.m-3]': 51217.9257309275,\n 'Positive particle diffusivity [m2.s-1]': <function pybamm.input.parameters.lithium_ion.Marquis2019.lico2_diffusivity_Dualfoil1998(sto, T)>,\n 'Positive electrode OCP [V]': <function pybamm.input.parameters.lithium_ion.Marquis2019.lico2_ocp_Dualfoil1998(sto)>,\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]': <function pybamm.input.parameters.lithium_ion.Marquis2019.lico2_electrolyte_exchange_current_density_Dualfoil1998(c_e, c_s_surf, c_s_max, T)>,\n 'Positive electrode OCP entropic change [V.K-1]': <function pybamm.input.parameters.lithium_ion.Marquis2019.lico2_entropic_change_Moura2016(sto)>,\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": {},
Expand Down
35 changes: 17 additions & 18 deletions src/pybamm/input/parameters/lithium_ion/Ai2020.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------
Expand All @@ -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]
Expand Down Expand Up @@ -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.
Expand All @@ -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
-------
Expand Down Expand Up @@ -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
----------
Expand All @@ -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]
Expand Down Expand Up @@ -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
Expand All @@ -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]
Expand Down Expand Up @@ -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.
Expand All @@ -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
-------
Expand Down Expand Up @@ -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
----------
Expand All @@ -340,17 +340,16 @@ 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
-------
t_change:class:`pybamm.Symbol`
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

Expand Down
8 changes: 4 additions & 4 deletions src/pybamm/input/parameters/lithium_ion/Chen2020.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -17,7 +17,7 @@ def graphite_LGM50_ocp_Chen2020(sto):
Parameters
----------
sto: :class:`pybamm.Symbol`
Electrode stochiometry
Electrode stoichiometry
Returns
-------
Expand Down Expand Up @@ -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
Expand All @@ -88,7 +88,7 @@ def nmc_LGM50_ocp_Chen2020(sto):
Parameters
----------
sto: :class:`pybamm.Symbol`
Electrode stochiometry
Electrode stoichiometry
Returns
-------
Expand Down
12 changes: 6 additions & 6 deletions src/pybamm/input/parameters/lithium_ion/Chen2020_composite.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -55,7 +55,7 @@ def silicon_ocp_lithiation_Mark2016(sto):
Parameters
----------
sto: double
Stochiometry of material (li-fraction)
stoichiometry of material (li-fraction)
Returns
-------
Expand Down Expand Up @@ -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
Expand All @@ -99,7 +99,7 @@ def silicon_ocp_delithiation_Mark2016(sto):
Parameters
----------
sto: double
Stochiometry of material (li-fraction)
stoichiometry of material (li-fraction)
Returns
-------
Expand Down Expand Up @@ -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
Expand All @@ -183,7 +183,7 @@ def nmc_LGM50_ocp_Chen2020(sto):
Parameters
----------
sto: :class:`pybamm.Symbol`
Electrode stochiometry
Electrode stoichiometry
Returns
-------
Expand Down
16 changes: 8 additions & 8 deletions src/pybamm/input/parameters/lithium_ion/Ecker2015.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------
Expand All @@ -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
Expand All @@ -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
----------
Expand All @@ -59,7 +59,7 @@ def graphite_ocp_Ecker2015(sto):
Parameters
----------
sto: :class:`pybamm.Symbol`
Electrode stochiometry
Electrode stoichiometry
Returns
-------
Expand Down Expand Up @@ -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
----------
Expand All @@ -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
Expand All @@ -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
----------
Expand All @@ -207,7 +207,7 @@ def nco_ocp_Ecker2015(sto):
Parameters
----------
sto : :class:`pybamm.Symbol`
Stochiometry of material (li-fraction)
stoichiometry of material (li-fraction)
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------
Expand All @@ -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
Expand All @@ -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
----------
Expand All @@ -89,7 +89,7 @@ def graphite_ocp_Ecker2015(sto):
Parameters
----------
sto: :class:`pybamm.Symbol`
Electrode stochiometry
Electrode stoichiometry
Returns
-------
Expand Down
Loading

0 comments on commit 10a2254

Please sign in to comment.