From ca6d12c461f4b2bd6742c93404b244b292a0eb56 Mon Sep 17 00:00:00 2001 From: Valentin Sulzer Date: Wed, 26 Apr 2023 16:54:28 -0400 Subject: [PATCH 1/7] #2901 remove testing_only parameter set and (but not all) old functionality --- .../cells/Enertech_Ai2020/README.md | 9 - .../cells/Enertech_Ai2020/parameters.csv | 36 -- .../testing_only/cells/__init__.py | 0 .../testing_only/electrolytes/__init__.py | 0 .../README.md | 5 - .../__init__.py | 0 ...ctrolyte_TDF_EC_DMC_1_1_Landesfeind2019.py | 32 -- .../electrolyte_base_Landesfeind2019.py | 155 ------ ...conductivity_EC_DMC_1_1_Landesfeind2019.py | 32 -- ..._diffusivity_EC_DMC_1_1_Landesfeind2019.py | 32 -- ...rence_number_EC_DMC_1_1_Landesfeind2019.py | 44 -- .../parameters.csv | 9 - .../README.md | 5 - .../__init__.py | 0 ...ctrolyte_TDF_EC_EMC_3_7_Landesfeind2019.py | 32 -- .../electrolyte_base_Landesfeind2019.py | 155 ------ ...conductivity_EC_EMC_3_7_Landesfeind2019.py | 32 -- ..._diffusivity_EC_EMC_3_7_Landesfeind2019.py | 32 -- ...rence_number_EC_EMC_3_7_Landesfeind2019.py | 44 -- .../parameters.csv | 9 - .../README.md | 5 - .../__init__.py | 0 ...rolyte_TDF_EMC_FEC_19_1_Landesfeind2019.py | 32 -- .../electrolyte_base_Landesfeind2019.py | 155 ------ ...nductivity_EMC_FEC_19_1_Landesfeind2019.py | 32 -- ...iffusivity_EMC_FEC_19_1_Landesfeind2019.py | 32 -- ...nce_number_EMC_FEC_19_1_Landesfeind2019.py | 34 -- .../parameters.csv | 9 - .../lipf6_Enertech_Ai2020/README.md | 9 - .../lipf6_Enertech_Ai2020/__init__.py | 0 .../lipf6_Enertech_Ai2020/dlnf_dlnc_Ai2020.py | 34 -- .../electrolyte_conductivity_Ai2020.py | 40 -- .../electrolyte_diffusivity_Ai2020.py | 28 -- .../lipf6_Enertech_Ai2020/parameters.csv | 9 - .../1C_discharge_from_full_Ai2020/README.md | 9 - .../parameters.csv | 18 - .../testing_only/experiments/__init__.py | 0 .../negative_electrodes/__init__.py | 0 .../graphite_Ai2020/README.md | 9 - .../graphite_Ai2020/__init__.py | 0 .../graphite_cracking_rate_Ai2020.py | 35 -- .../graphite_diffusivity_Dualfoil1998.py | 34 -- ...e_exchange_current_density_Dualfoil1998.py | 39 -- .../graphite_entropy_Enertech_Ai2020.csv | 104 ---- ...aphite_entropy_Enertech_Ai2020_function.py | 52 -- .../graphite_ocp_Enertech_Ai2020.csv | 129 ----- .../graphite_ocp_Enertech_Ai2020_function.py | 49 -- .../graphite_volume_change_Ai2020.py | 50 -- .../graphite_Ai2020/parameters.csv | 50 -- .../positive_electrodes/__init__.py | 0 .../lico2_Ai2020/README.md | 9 - .../lico2_Ai2020/__init__.py | 0 .../lico2_cracking_rate_Ai2020.py | 35 -- .../lico2_diffusivity_Dualfoil1998.py | 29 -- ...e_exchange_current_density_Dualfoil1998.py | 36 -- .../lico2_entropic_change_Ai2020.csv | 12 - .../lico2_entropic_change_Ai2020_function.py | 48 -- .../lico2_Ai2020/lico2_ocp_Ai2020.csv | 448 ------------------ .../lico2_Ai2020/lico2_ocp_Ai2020_function.py | 47 -- .../lico2_volume_change_Ai2020.py | 33 -- .../testing_only/seis/example/README.md | 11 - .../testing_only/seis/example/parameters.csv | 28 -- .../testing_only/separators/__init__.py | 0 .../separators/separator_Ai2020/README.md | 9 - .../separator_Ai2020/parameters.csv | 8 - pybamm/parameters/parameter_values.py | 240 +--------- .../test_parameters/parameter_values_test.csv | 14 +- .../test_parameters/test_parameter_values.py | 101 +--- 68 files changed, 18 insertions(+), 2750 deletions(-) delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/cells/Enertech_Ai2020/README.md delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/cells/Enertech_Ai2020/parameters.csv delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/cells/__init__.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/__init__.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/README.md delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/__init__.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/electrolyte_TDF_EC_DMC_1_1_Landesfeind2019.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/electrolyte_base_Landesfeind2019.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/electrolyte_conductivity_EC_DMC_1_1_Landesfeind2019.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/electrolyte_diffusivity_EC_DMC_1_1_Landesfeind2019.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/electrolyte_transference_number_EC_DMC_1_1_Landesfeind2019.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/parameters.csv delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/README.md delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/__init__.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/electrolyte_TDF_EC_EMC_3_7_Landesfeind2019.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/electrolyte_base_Landesfeind2019.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/electrolyte_conductivity_EC_EMC_3_7_Landesfeind2019.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/electrolyte_diffusivity_EC_EMC_3_7_Landesfeind2019.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/electrolyte_transference_number_EC_EMC_3_7_Landesfeind2019.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/parameters.csv delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/README.md delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/__init__.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/electrolyte_TDF_EMC_FEC_19_1_Landesfeind2019.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/electrolyte_base_Landesfeind2019.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/electrolyte_conductivity_EMC_FEC_19_1_Landesfeind2019.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/electrolyte_diffusivity_EMC_FEC_19_1_Landesfeind2019.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/electrolyte_transference_number_EMC_FEC_19_1_Landesfeind2019.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/parameters.csv delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_Enertech_Ai2020/README.md delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_Enertech_Ai2020/__init__.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_Enertech_Ai2020/dlnf_dlnc_Ai2020.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_Enertech_Ai2020/electrolyte_conductivity_Ai2020.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_Enertech_Ai2020/electrolyte_diffusivity_Ai2020.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_Enertech_Ai2020/parameters.csv delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/experiments/1C_discharge_from_full_Ai2020/README.md delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/experiments/1C_discharge_from_full_Ai2020/parameters.csv delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/experiments/__init__.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/__init__.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/README.md delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/__init__.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_cracking_rate_Ai2020.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_diffusivity_Dualfoil1998.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_electrolyte_exchange_current_density_Dualfoil1998.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_entropy_Enertech_Ai2020.csv delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_entropy_Enertech_Ai2020_function.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_ocp_Enertech_Ai2020.csv delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_ocp_Enertech_Ai2020_function.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_volume_change_Ai2020.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/parameters.csv delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/__init__.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/README.md delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/__init__.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_cracking_rate_Ai2020.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_diffusivity_Dualfoil1998.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_electrolyte_exchange_current_density_Dualfoil1998.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_entropic_change_Ai2020.csv delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_entropic_change_Ai2020_function.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_ocp_Ai2020.csv delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_ocp_Ai2020_function.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_volume_change_Ai2020.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/seis/example/README.md delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/seis/example/parameters.csv delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/separators/__init__.py delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/separators/separator_Ai2020/README.md delete mode 100644 pybamm/input/parameters/lithium_ion/testing_only/separators/separator_Ai2020/parameters.csv rename pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/parameters.csv => tests/unit/test_parameters/parameter_values_test.csv (77%) diff --git a/pybamm/input/parameters/lithium_ion/testing_only/cells/Enertech_Ai2020/README.md b/pybamm/input/parameters/lithium_ion/testing_only/cells/Enertech_Ai2020/README.md deleted file mode 100644 index af5ffdd828..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/cells/Enertech_Ai2020/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Enertech cell parameters - -Parameters for the Enertech cell, from the paper - -> Ai, W., Kraft, L., Sturm, J., Jossen, A., & Wu, B. (2020). Electrochemical Thermal-Mechanical Modelling of Stress Inhomogeneity in Lithium-Ion Pouch Cells. Journal of The Electrochemical Society, 167(1), 013512. DOI: 10.1149/2.0122001JES. - -> Rieger, B., Erhard, S. V., Rumpf, K., & Jossen, A. (2016). A new method to model the thickness change of a commercial pouch cell during discharge. Journal of The Electrochemical Society, 163(8), A1566-A1575. - -and references therein. diff --git a/pybamm/input/parameters/lithium_ion/testing_only/cells/Enertech_Ai2020/parameters.csv b/pybamm/input/parameters/lithium_ion/testing_only/cells/Enertech_Ai2020/parameters.csv deleted file mode 100644 index 5f722665df..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/cells/Enertech_Ai2020/parameters.csv +++ /dev/null @@ -1,36 +0,0 @@ -Name [units],Value,Reference,Notes -# Empty rows and rows starting with ‘#’ will be ignored,,, -,,, -# Macroscale geometry,,, -Negative current collector thickness [m],10E-6,Ai 2020, -Negative electrode thickness [m],76.5E-6,Ai 2020, -Separator thickness [m],25E-6,Ai 2020, -Positive electrode thickness [m],68E-6,Ai 2020, -Positive current collector thickness [m],15E-6,Ai 2020, -Electrode height [m],51E-3,Ai 2020,Not needed for 1D -Electrode width [m],47E-3,Ai 2020,Not needed for 1D -Cell cooling surface area [m2],60.484E-4,Ai 2020, pouch -Cell volume [m3],1.5341E-5,Ai 2020, pouch -Cell emissivity,0.95,Ai 2020,estimation -Cell thermal expansion coefficient [m.K-1], 1.1E-6,Ai 2020, -,,, -# Current collector properties ,,, -Negative current collector conductivity [S.m-1],58411000,CRC Handbook,copper -Positive current collector conductivity [S.m-1],36914000,CRC Handbook,aluminium -,,, -# Density,,, -Negative current collector density [kg.m-3],8960,CRC Handbook,copper -Positive current collector density [kg.m-3],2700,CRC Handbook,aluminium -,,, -# Specific heat capacity,,, -Negative current collector specific heat capacity [J.kg-1.K-1],385,CRC Handbook,copper -Positive current collector specific heat capacity [J.kg-1.K-1],897,CRC Handbook,aluminium -,,, -# Thermal conductivity,,, -Negative current collector thermal conductivity [W.m-1.K-1],401,CRC Handbook,copper -Positive current collector thermal conductivity [W.m-1.K-1],237,CRC Handbook,aluminium -,,, -# Electrical,,, -Nominal cell capacity [A.h], 2.28,Ai 2020,2.28/34 -Current function [A], 2.28,default current function, -Contact resistance [Ohm], 0,, diff --git a/pybamm/input/parameters/lithium_ion/testing_only/cells/__init__.py b/pybamm/input/parameters/lithium_ion/testing_only/cells/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/__init__.py b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/README.md b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/README.md deleted file mode 100644 index 07aa16c3ab..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# LiPF6 in EC:DMC (1:1 w:w) electrolyte parameters - -Parameters for a LiPF6 in EC:DMC (1:1 w:w) electrolyte, from the paper - -> Johannes Landesfeind and Hubert A. Gasteiger, ["Temperature and Concentration Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes."](https://iopscience.iop.org/article/10.1149/2.0571912jes) Journal of the Electrochemical Society 166 (2019): A3079. diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/__init__.py b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/electrolyte_TDF_EC_DMC_1_1_Landesfeind2019.py b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/electrolyte_TDF_EC_DMC_1_1_Landesfeind2019.py deleted file mode 100644 index a9757c5526..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/electrolyte_TDF_EC_DMC_1_1_Landesfeind2019.py +++ /dev/null @@ -1,32 +0,0 @@ -from .electrolyte_base_Landesfeind2019 import electrolyte_TDF_base_Landesfeind2019 -import numpy as np - - -def electrolyte_TDF_EC_DMC_1_1_Landesfeind2019(c_e, T): - """ - Thermodynamic factor (TDF) of LiPF6 in EC:DMC (1:1 w:w) as a function of ion - concentration and temperature. The data comes from [1]. - - References - ---------- - .. [1] Landesfeind, J. and Gasteiger, H.A., 2019. Temperature and Concentration - Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes. - Journal of The Electrochemical Society, 166(14), pp.A3079-A3097. - - Parameters - ---------- - c_e: :class:`pybamm.Symbol` - Dimensional electrolyte concentration - T: :class:`pybamm.Symbol` - Dimensional temperature - - Returns - ------- - :class:`pybamm.Symbol` - Electrolyte thermodynamic factor - """ - coeffs = np.array( - [-5.58, 7.17, 3.80e-2, 1.91, -6.65e-2, -5.08e-5, 1.1e-1, -6.10e-3, 1.51e-4] - ) - - return electrolyte_TDF_base_Landesfeind2019(c_e, T, coeffs) diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/electrolyte_base_Landesfeind2019.py b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/electrolyte_base_Landesfeind2019.py deleted file mode 100644 index 3f67f6051e..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/electrolyte_base_Landesfeind2019.py +++ /dev/null @@ -1,155 +0,0 @@ -from pybamm import exp, sqrt - - -def electrolyte_conductivity_base_Landesfeind2019(c_e, T, coeffs): - """ - Conductivity of LiPF6 in solvent_X as a function of ion concentration and - temperature. The data comes from [1]. - - References - ---------- - .. [1] Landesfeind, J. and Gasteiger, H.A., 2019. Temperature and Concentration - Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes. - Journal of The Electrochemical Society, 166(14), pp.A3079-A3097. - - Parameters - ---------- - c_e: :class:`pybamm.Symbol` - Dimensional electrolyte concentration - T: :class:`pybamm.Symbol` - Dimensional temperature - coeffs: :class:`pybamm.Symbol` - Fitting parameter coefficients - - Returns - ------- - :class:`pybamm.Symbol` - Electrolyte conductivity - """ - c = c_e / 1000 # mol.m-3 -> mol.l - p1, p2, p3, p4, p5, p6 = coeffs - A = p1 * (1 + (T - p2)) - B = 1 + p3 * sqrt(c) + p4 * (1 + p5 * exp(1000 / T)) * c - C = 1 + c**4 * (p6 * exp(1000 / T)) - sigma_e = A * c * B / C # mS.cm-1 - - return sigma_e / 10 - - -def electrolyte_diffusivity_base_Landesfeind2019(c_e, T, coeffs): - """ - Diffusivity of LiPF6 in solvent_X as a function of ion concentration and - temperature. The data comes from [1]. - - References - ---------- - .. [1] Landesfeind, J. and Gasteiger, H.A., 2019. Temperature and Concentration - Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes. - Journal of The Electrochemical Society, 166(14), pp.A3079-A3097. - - Parameters - ---------- - c_e: :class:`pybamm.Symbol` - Dimensional electrolyte concentration - T: :class:`pybamm.Symbol` - Dimensional temperature - coeffs: :class:`pybamm.Symbol` - Fitting parameter coefficients - - Returns - ------- - :class:`pybamm.Symbol` - Electrolyte diffusivity - """ - c = c_e / 1000 # mol.m-3 -> mol.l - p1, p2, p3, p4 = coeffs - A = p1 * exp(p2 * c) - B = exp(p3 / T) - C = exp(p4 * c / T) - D_e = A * B * C * 1e-10 # m2/s - - return D_e - - -def electrolyte_TDF_base_Landesfeind2019(c_e, T, coeffs): - """ - Thermodynamic factor (TDF) of LiPF6 in solvent_X as a function of ion concentration - and temperature. The data comes from [1]. - - References - ---------- - .. [1] Landesfeind, J. and Gasteiger, H.A., 2019. Temperature and Concentration - Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes. - Journal of The Electrochemical Society, 166(14), pp.A3079-A3097. - - Parameters - ---------- - c_e: :class:`pybamm.Symbol` - Dimensional electrolyte concentration - T: :class:`pybamm.Symbol` - Dimensional temperature - coeffs: :class:`pybamm.Symbol` - Fitting parameter coefficients - - Returns - ------- - :class:`pybamm.Symbol` - Electrolyte thermodynamic factor - """ - c = c_e / 1000 # mol.m-3 -> mol.l - p1, p2, p3, p4, p5, p6, p7, p8, p9 = coeffs - tdf = ( - p1 - + p2 * c - + p3 * T - + p4 * c**2 - + p5 * c * T - + p6 * T**2 - + p7 * c**3 - + p8 * c**2 * T - + p9 * c * T**2 - ) - - return tdf - - -def electrolyte_transference_number_base_Landesfeind2019(c_e, T, coeffs): - """ - Transference number of LiPF6 in solvent_X as a function of ion concentration and - temperature. The data comes from [1]. - - References - ---------- - .. [1] Landesfeind, J. and Gasteiger, H.A., 2019. Temperature and Concentration - Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes. - Journal of The Electrochemical Society, 166(14), pp.A3079-A3097. - - Parameters - ---------- - c_e: :class:`pybamm.Symbol` - Dimensional electrolyte concentration - T: :class:`pybamm.Symbol` - Dimensional temperature - coeffs: :class:`pybamm.Symbol` - Fitting parameter coefficients - - Returns - ------- - :class:`pybamm.Symbol` - Electrolyte transference number - """ - c = c_e / 1000 # mol.m-3 -> mol.l - p1, p2, p3, p4, p5, p6, p7, p8, p9 = coeffs - tplus = ( - p1 - + p2 * c - + p3 * T - + p4 * c**2 - + p5 * c * T - + p6 * T**2 - + p7 * c**3 - + p8 * c**2 * T - + p9 * c * T**2 - ) - - return tplus diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/electrolyte_conductivity_EC_DMC_1_1_Landesfeind2019.py b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/electrolyte_conductivity_EC_DMC_1_1_Landesfeind2019.py deleted file mode 100644 index af69241f1c..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/electrolyte_conductivity_EC_DMC_1_1_Landesfeind2019.py +++ /dev/null @@ -1,32 +0,0 @@ -from .electrolyte_base_Landesfeind2019 import ( - electrolyte_conductivity_base_Landesfeind2019, -) -import numpy as np - - -def electrolyte_conductivity_EC_DMC_1_1_Landesfeind2019(c_e, T): - """ - Conductivity of LiPF6 in EC:DMC (1:1 w:w) as a function of ion concentration and - temperature. The data comes from [1]. - - References - ---------- - .. [1] Landesfeind, J. and Gasteiger, H.A., 2019. Temperature and Concentration - Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes. - Journal of The Electrochemical Society, 166(14), pp.A3079-A3097. - - Parameters - ---------- - c_e: :class:`pybamm.Symbol` - Dimensional electrolyte concentration - T: :class:`pybamm.Symbol` - Dimensional temperature - - Returns - ------- - :class:`pybamm.Symbol` - Electrolyte conductivity - """ - coeffs = np.array([7.98e-1, 2.28e2, -1.22, 5.09e-1, -4e-3, 3.79e-3]) - - return electrolyte_conductivity_base_Landesfeind2019(c_e, T, coeffs) diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/electrolyte_diffusivity_EC_DMC_1_1_Landesfeind2019.py b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/electrolyte_diffusivity_EC_DMC_1_1_Landesfeind2019.py deleted file mode 100644 index b8a655ef29..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/electrolyte_diffusivity_EC_DMC_1_1_Landesfeind2019.py +++ /dev/null @@ -1,32 +0,0 @@ -from .electrolyte_base_Landesfeind2019 import ( - electrolyte_diffusivity_base_Landesfeind2019, -) -import numpy as np - - -def electrolyte_diffusivity_EC_DMC_1_1_Landesfeind2019(c_e, T): - """ - Diffusivity of LiPF6 in EC:DMC (1:1 w:w) as a function of ion concentration and - temperature. The data comes from [1]. - - References - ---------- - .. [1] Landesfeind, J. and Gasteiger, H.A., 2019. Temperature and Concentration - Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes. - Journal of The Electrochemical Society, 166(14), pp.A3079-A3097. - - Parameters - ---------- - c_e: :class:`pybamm.Symbol` - Dimensional electrolyte concentration - T: :class:`pybamm.Symbol` - Dimensional temperature - - Returns - ------- - :class:`pybamm.Symbol` - Electrolyte diffusivity - """ - coeffs = np.array([1.47e3, 1.33, -1.69e3, -5.63e2]) - - return electrolyte_diffusivity_base_Landesfeind2019(c_e, T, coeffs) diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/electrolyte_transference_number_EC_DMC_1_1_Landesfeind2019.py b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/electrolyte_transference_number_EC_DMC_1_1_Landesfeind2019.py deleted file mode 100644 index 0a763b2aab..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/electrolyte_transference_number_EC_DMC_1_1_Landesfeind2019.py +++ /dev/null @@ -1,44 +0,0 @@ -from .electrolyte_base_Landesfeind2019 import ( - electrolyte_transference_number_base_Landesfeind2019, -) -import numpy as np - - -def electrolyte_transference_number_EC_DMC_1_1_Landesfeind2019(c_e, T): - """ - Transference number of LiPF6 in EC:DMC (1:1 w:w) as a function of ion - concentration and temperature. The data comes from [1]. - - References - ---------- - .. [1] Landesfeind, J. and Gasteiger, H.A., 2019. Temperature and Concentration - Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes. - Journal of The Electrochemical Society, 166(14), pp.A3079-A3097. - - Parameters - ---------- - c_e: :class:`pybamm.Symbol` - Dimensional electrolyte concentration - T: :class:`pybamm.Symbol` - Dimensional temperature - - Returns - ------- - :class:`pybamm.Symbol` - Electrolyte transference number - """ - coeffs = np.array( - [ - -7.91, - 2.45e-1, - 5.28e-2, - 6.98e-1, - -1.08e-2, - -8.21e-5, - 7.43e-4, - -2.22e-3, - 3.07e-5, - ] - ) - - return electrolyte_transference_number_base_Landesfeind2019(c_e, T, coeffs) diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/parameters.csv b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/parameters.csv deleted file mode 100644 index 64a34e9bb5..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_DMC_1_1_Landesfeind2019/parameters.csv +++ /dev/null @@ -1,9 +0,0 @@ -Name [units],Value,Reference,Notes -# Empty rows and rows starting with ‘#’ will be ignored,,, -,,, -# Electrolyte properties,,, -Initial concentration in electrolyte [mol.m-3],1000,default, -Cation transference number,[function]electrolyte_transference_number_EC_DMC_1_1_Landesfeind2019,Landesfeind 2019, -Thermodynamic factor,[function]electrolyte_TDF_EC_DMC_1_1_Landesfeind2019,Landesfeind 2019, -Electrolyte diffusivity [m2.s-1],[function]electrolyte_diffusivity_EC_DMC_1_1_Landesfeind2019,Landesfeind 2019," " -Electrolyte conductivity [S.m-1],[function]electrolyte_conductivity_EC_DMC_1_1_Landesfeind2019,Landesfeind 2019," " diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/README.md b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/README.md deleted file mode 100644 index 2406cfaf76..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# LiPF6 in EC:EMC (3:7 w:w) electrolyte parameters - -Parameters for a LiPF6 in EC:EMC (3:7 w:w) electrolyte, from the paper - -> Johannes Landesfeind and Hubert A. Gasteiger, ["Temperature and Concentration Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes."](https://iopscience.iop.org/article/10.1149/2.0571912jes) Journal of the Electrochemical Society 166 (2019): A3079. diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/__init__.py b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/electrolyte_TDF_EC_EMC_3_7_Landesfeind2019.py b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/electrolyte_TDF_EC_EMC_3_7_Landesfeind2019.py deleted file mode 100644 index 99a1b74c9d..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/electrolyte_TDF_EC_EMC_3_7_Landesfeind2019.py +++ /dev/null @@ -1,32 +0,0 @@ -from .electrolyte_base_Landesfeind2019 import electrolyte_TDF_base_Landesfeind2019 -import numpy as np - - -def electrolyte_TDF_EC_EMC_3_7_Landesfeind2019(c_e, T): - """ - Thermodynamic factor (TDF) of LiPF6 in EC:EMC (3:7 w:w) as a function of ion - concentration and temperature. The data comes from [1]. - - References - ---------- - .. [1] Landesfeind, J. and Gasteiger, H.A., 2019. Temperature and Concentration - Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes. - Journal of The Electrochemical Society, 166(14), pp.A3079-A3097. - - Parameters - ---------- - c_e: :class:`pybamm.Symbol` - Dimensional electrolyte concentration - T: :class:`pybamm.Symbol` - Dimensional temperature - - Returns - ------- - :class:`pybamm.Symbol` - Electrolyte thermodynamic factor - """ - coeffs = np.array( - [2.57e1, -4.51e1, -1.77e-1, 1.94, 2.95e-1, 3.08e-4, 2.59e-1, -9.46e-3, -4.54e-4] - ) - - return electrolyte_TDF_base_Landesfeind2019(c_e, T, coeffs) diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/electrolyte_base_Landesfeind2019.py b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/electrolyte_base_Landesfeind2019.py deleted file mode 100644 index 3f67f6051e..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/electrolyte_base_Landesfeind2019.py +++ /dev/null @@ -1,155 +0,0 @@ -from pybamm import exp, sqrt - - -def electrolyte_conductivity_base_Landesfeind2019(c_e, T, coeffs): - """ - Conductivity of LiPF6 in solvent_X as a function of ion concentration and - temperature. The data comes from [1]. - - References - ---------- - .. [1] Landesfeind, J. and Gasteiger, H.A., 2019. Temperature and Concentration - Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes. - Journal of The Electrochemical Society, 166(14), pp.A3079-A3097. - - Parameters - ---------- - c_e: :class:`pybamm.Symbol` - Dimensional electrolyte concentration - T: :class:`pybamm.Symbol` - Dimensional temperature - coeffs: :class:`pybamm.Symbol` - Fitting parameter coefficients - - Returns - ------- - :class:`pybamm.Symbol` - Electrolyte conductivity - """ - c = c_e / 1000 # mol.m-3 -> mol.l - p1, p2, p3, p4, p5, p6 = coeffs - A = p1 * (1 + (T - p2)) - B = 1 + p3 * sqrt(c) + p4 * (1 + p5 * exp(1000 / T)) * c - C = 1 + c**4 * (p6 * exp(1000 / T)) - sigma_e = A * c * B / C # mS.cm-1 - - return sigma_e / 10 - - -def electrolyte_diffusivity_base_Landesfeind2019(c_e, T, coeffs): - """ - Diffusivity of LiPF6 in solvent_X as a function of ion concentration and - temperature. The data comes from [1]. - - References - ---------- - .. [1] Landesfeind, J. and Gasteiger, H.A., 2019. Temperature and Concentration - Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes. - Journal of The Electrochemical Society, 166(14), pp.A3079-A3097. - - Parameters - ---------- - c_e: :class:`pybamm.Symbol` - Dimensional electrolyte concentration - T: :class:`pybamm.Symbol` - Dimensional temperature - coeffs: :class:`pybamm.Symbol` - Fitting parameter coefficients - - Returns - ------- - :class:`pybamm.Symbol` - Electrolyte diffusivity - """ - c = c_e / 1000 # mol.m-3 -> mol.l - p1, p2, p3, p4 = coeffs - A = p1 * exp(p2 * c) - B = exp(p3 / T) - C = exp(p4 * c / T) - D_e = A * B * C * 1e-10 # m2/s - - return D_e - - -def electrolyte_TDF_base_Landesfeind2019(c_e, T, coeffs): - """ - Thermodynamic factor (TDF) of LiPF6 in solvent_X as a function of ion concentration - and temperature. The data comes from [1]. - - References - ---------- - .. [1] Landesfeind, J. and Gasteiger, H.A., 2019. Temperature and Concentration - Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes. - Journal of The Electrochemical Society, 166(14), pp.A3079-A3097. - - Parameters - ---------- - c_e: :class:`pybamm.Symbol` - Dimensional electrolyte concentration - T: :class:`pybamm.Symbol` - Dimensional temperature - coeffs: :class:`pybamm.Symbol` - Fitting parameter coefficients - - Returns - ------- - :class:`pybamm.Symbol` - Electrolyte thermodynamic factor - """ - c = c_e / 1000 # mol.m-3 -> mol.l - p1, p2, p3, p4, p5, p6, p7, p8, p9 = coeffs - tdf = ( - p1 - + p2 * c - + p3 * T - + p4 * c**2 - + p5 * c * T - + p6 * T**2 - + p7 * c**3 - + p8 * c**2 * T - + p9 * c * T**2 - ) - - return tdf - - -def electrolyte_transference_number_base_Landesfeind2019(c_e, T, coeffs): - """ - Transference number of LiPF6 in solvent_X as a function of ion concentration and - temperature. The data comes from [1]. - - References - ---------- - .. [1] Landesfeind, J. and Gasteiger, H.A., 2019. Temperature and Concentration - Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes. - Journal of The Electrochemical Society, 166(14), pp.A3079-A3097. - - Parameters - ---------- - c_e: :class:`pybamm.Symbol` - Dimensional electrolyte concentration - T: :class:`pybamm.Symbol` - Dimensional temperature - coeffs: :class:`pybamm.Symbol` - Fitting parameter coefficients - - Returns - ------- - :class:`pybamm.Symbol` - Electrolyte transference number - """ - c = c_e / 1000 # mol.m-3 -> mol.l - p1, p2, p3, p4, p5, p6, p7, p8, p9 = coeffs - tplus = ( - p1 - + p2 * c - + p3 * T - + p4 * c**2 - + p5 * c * T - + p6 * T**2 - + p7 * c**3 - + p8 * c**2 * T - + p9 * c * T**2 - ) - - return tplus diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/electrolyte_conductivity_EC_EMC_3_7_Landesfeind2019.py b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/electrolyte_conductivity_EC_EMC_3_7_Landesfeind2019.py deleted file mode 100644 index 3d9c2db549..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/electrolyte_conductivity_EC_EMC_3_7_Landesfeind2019.py +++ /dev/null @@ -1,32 +0,0 @@ -from .electrolyte_base_Landesfeind2019 import ( - electrolyte_conductivity_base_Landesfeind2019, -) -import numpy as np - - -def electrolyte_conductivity_EC_EMC_3_7_Landesfeind2019(c_e, T): - """ - Conductivity of LiPF6 in EC:EMC (3:7 w:w) as a function of ion concentration and - temperature. The data comes from [1]. - - References - ---------- - .. [1] Landesfeind, J. and Gasteiger, H.A., 2019. Temperature and Concentration - Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes. - Journal of The Electrochemical Society, 166(14), pp.A3079-A3097. - - Parameters - ---------- - c_e: :class:`pybamm.Symbol` - Dimensional electrolyte concentration - T: :class:`pybamm.Symbol` - Dimensional temperature - - Returns - ------- - :class:`pybamm.Symbol` - Electrolyte conductivity - """ - coeffs = np.array([5.21e-1, 2.28e2, -1.06, 3.53e-1, -3.59e-3, 1.48e-3]) - - return electrolyte_conductivity_base_Landesfeind2019(c_e, T, coeffs) diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/electrolyte_diffusivity_EC_EMC_3_7_Landesfeind2019.py b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/electrolyte_diffusivity_EC_EMC_3_7_Landesfeind2019.py deleted file mode 100644 index 9a6d7a108f..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/electrolyte_diffusivity_EC_EMC_3_7_Landesfeind2019.py +++ /dev/null @@ -1,32 +0,0 @@ -from .electrolyte_base_Landesfeind2019 import ( - electrolyte_diffusivity_base_Landesfeind2019, -) -import numpy as np - - -def electrolyte_diffusivity_EC_EMC_3_7_Landesfeind2019(c_e, T): - """ - Diffusivity of LiPF6 in EC:EMC (3:7 w:w) as a function of ion concentration and - temperature. The data comes from [1]. - - References - ---------- - .. [1] Landesfeind, J. and Gasteiger, H.A., 2019. Temperature and Concentration - Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes. - Journal of The Electrochemical Society, 166(14), pp.A3079-A3097. - - Parameters - ---------- - c_e: :class:`pybamm.Symbol` - Dimensional electrolyte concentration - T: :class:`pybamm.Symbol` - Dimensional temperature - - Returns - ------- - :class:`pybamm.Symbol` - Electrolyte diffusivity - """ - coeffs = np.array([1.01e3, 1.01, -1.56e3, -4.87e2]) - - return electrolyte_diffusivity_base_Landesfeind2019(c_e, T, coeffs) diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/electrolyte_transference_number_EC_EMC_3_7_Landesfeind2019.py b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/electrolyte_transference_number_EC_EMC_3_7_Landesfeind2019.py deleted file mode 100644 index dc614d1e45..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/electrolyte_transference_number_EC_EMC_3_7_Landesfeind2019.py +++ /dev/null @@ -1,44 +0,0 @@ -from .electrolyte_base_Landesfeind2019 import ( - electrolyte_transference_number_base_Landesfeind2019, -) -import numpy as np - - -def electrolyte_transference_number_EC_EMC_3_7_Landesfeind2019(c_e, T): - """ - Transference number of LiPF6 in EC:EMC (3:7 w:w) as a function of ion - concentration and temperature. The data comes from [1]. - - References - ---------- - .. [1] Landesfeind, J. and Gasteiger, H.A., 2019. Temperature and Concentration - Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes. - Journal of The Electrochemical Society, 166(14), pp.A3079-A3097. - - Parameters - ---------- - c_e: :class:`pybamm.Symbol` - Dimensional electrolyte concentration - T: :class:`pybamm.Symbol` - Dimensional temperature - - Returns - ------- - :class:`pybamm.Symbol` - Electrolyte transference number - """ - coeffs = np.array( - [ - -1.28e1, - -6.12, - 8.21e-2, - 9.04e-1, - 3.18e-2, - -1.27e-4, - 1.75e-2, - -3.12e-3, - -3.96e-5, - ] - ) - - return electrolyte_transference_number_base_Landesfeind2019(c_e, T, coeffs) diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/parameters.csv b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/parameters.csv deleted file mode 100644 index 79d3e72853..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/parameters.csv +++ /dev/null @@ -1,9 +0,0 @@ -Name [units],Value,Reference,Notes -# Empty rows and rows starting with ‘#’ will be ignored,,, -,,, -# Electrolyte properties,,, -Initial concentration in electrolyte [mol.m-3],1000,default, -Cation transference number,[function]electrolyte_transference_number_EC_EMC_3_7_Landesfeind2019,Landesfeind 2019, -Thermodynamic factor,[function]electrolyte_TDF_EC_EMC_3_7_Landesfeind2019,Landesfeind 2019, -Electrolyte diffusivity [m2.s-1],[function]electrolyte_diffusivity_EC_EMC_3_7_Landesfeind2019,Landesfeind 2019," " -Electrolyte conductivity [S.m-1],[function]electrolyte_conductivity_EC_EMC_3_7_Landesfeind2019,Landesfeind 2019," " diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/README.md b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/README.md deleted file mode 100644 index 5fb2efc1ce..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# LiPF6 in EMC:FEC (19:1 w:w) electrolyte parameters - -Parameters for a LiPF6 in EMC:FEC (19:1 w:w) electrolyte, from the paper - -> Johannes Landesfeind and Hubert A. Gasteiger, ["Temperature and Concentration Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes."](https://iopscience.iop.org/article/10.1149/2.0571912jes) Journal of the Electrochemical Society 166 (2019): A3079. diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/__init__.py b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/electrolyte_TDF_EMC_FEC_19_1_Landesfeind2019.py b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/electrolyte_TDF_EMC_FEC_19_1_Landesfeind2019.py deleted file mode 100644 index 997b16d9f6..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/electrolyte_TDF_EMC_FEC_19_1_Landesfeind2019.py +++ /dev/null @@ -1,32 +0,0 @@ -from .electrolyte_base_Landesfeind2019 import electrolyte_TDF_base_Landesfeind2019 -import numpy as np - - -def electrolyte_TDF_EMC_FEC_19_1_Landesfeind2019(c_e, T): - """ - Thermodyamic factor (TDF) of LiPF6 in EMC:FEC (19:1 w:w) as a function of ion - concentration and temperature. The data comes from [1]. - - References - ---------- - .. [1] Landesfeind, J. and Gasteiger, H.A., 2019. Temperature and Concentration - Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes. - Journal of The Electrochemical Society, 166(14), pp.A3079-A3097. - - Parameters - ---------- - c_e: :class:`pybamm.Symbol` - Dimensional electrolyte concentration - T: :class:`pybamm.Symbol` - Dimensional temperature - - Returns - ------- - :class:`pybamm.Symbol` - Electrolyte thermodynamic factor - """ - coeffs = np.array( - [3.22, -1.01e1, -1.58e-2, 6.12, 2.96e-2, 2.42e-5, -2.22e-1, -1.57e-2, 6.30e-6] - ) - - return electrolyte_TDF_base_Landesfeind2019(c_e, T, coeffs) diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/electrolyte_base_Landesfeind2019.py b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/electrolyte_base_Landesfeind2019.py deleted file mode 100644 index 3f67f6051e..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/electrolyte_base_Landesfeind2019.py +++ /dev/null @@ -1,155 +0,0 @@ -from pybamm import exp, sqrt - - -def electrolyte_conductivity_base_Landesfeind2019(c_e, T, coeffs): - """ - Conductivity of LiPF6 in solvent_X as a function of ion concentration and - temperature. The data comes from [1]. - - References - ---------- - .. [1] Landesfeind, J. and Gasteiger, H.A., 2019. Temperature and Concentration - Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes. - Journal of The Electrochemical Society, 166(14), pp.A3079-A3097. - - Parameters - ---------- - c_e: :class:`pybamm.Symbol` - Dimensional electrolyte concentration - T: :class:`pybamm.Symbol` - Dimensional temperature - coeffs: :class:`pybamm.Symbol` - Fitting parameter coefficients - - Returns - ------- - :class:`pybamm.Symbol` - Electrolyte conductivity - """ - c = c_e / 1000 # mol.m-3 -> mol.l - p1, p2, p3, p4, p5, p6 = coeffs - A = p1 * (1 + (T - p2)) - B = 1 + p3 * sqrt(c) + p4 * (1 + p5 * exp(1000 / T)) * c - C = 1 + c**4 * (p6 * exp(1000 / T)) - sigma_e = A * c * B / C # mS.cm-1 - - return sigma_e / 10 - - -def electrolyte_diffusivity_base_Landesfeind2019(c_e, T, coeffs): - """ - Diffusivity of LiPF6 in solvent_X as a function of ion concentration and - temperature. The data comes from [1]. - - References - ---------- - .. [1] Landesfeind, J. and Gasteiger, H.A., 2019. Temperature and Concentration - Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes. - Journal of The Electrochemical Society, 166(14), pp.A3079-A3097. - - Parameters - ---------- - c_e: :class:`pybamm.Symbol` - Dimensional electrolyte concentration - T: :class:`pybamm.Symbol` - Dimensional temperature - coeffs: :class:`pybamm.Symbol` - Fitting parameter coefficients - - Returns - ------- - :class:`pybamm.Symbol` - Electrolyte diffusivity - """ - c = c_e / 1000 # mol.m-3 -> mol.l - p1, p2, p3, p4 = coeffs - A = p1 * exp(p2 * c) - B = exp(p3 / T) - C = exp(p4 * c / T) - D_e = A * B * C * 1e-10 # m2/s - - return D_e - - -def electrolyte_TDF_base_Landesfeind2019(c_e, T, coeffs): - """ - Thermodynamic factor (TDF) of LiPF6 in solvent_X as a function of ion concentration - and temperature. The data comes from [1]. - - References - ---------- - .. [1] Landesfeind, J. and Gasteiger, H.A., 2019. Temperature and Concentration - Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes. - Journal of The Electrochemical Society, 166(14), pp.A3079-A3097. - - Parameters - ---------- - c_e: :class:`pybamm.Symbol` - Dimensional electrolyte concentration - T: :class:`pybamm.Symbol` - Dimensional temperature - coeffs: :class:`pybamm.Symbol` - Fitting parameter coefficients - - Returns - ------- - :class:`pybamm.Symbol` - Electrolyte thermodynamic factor - """ - c = c_e / 1000 # mol.m-3 -> mol.l - p1, p2, p3, p4, p5, p6, p7, p8, p9 = coeffs - tdf = ( - p1 - + p2 * c - + p3 * T - + p4 * c**2 - + p5 * c * T - + p6 * T**2 - + p7 * c**3 - + p8 * c**2 * T - + p9 * c * T**2 - ) - - return tdf - - -def electrolyte_transference_number_base_Landesfeind2019(c_e, T, coeffs): - """ - Transference number of LiPF6 in solvent_X as a function of ion concentration and - temperature. The data comes from [1]. - - References - ---------- - .. [1] Landesfeind, J. and Gasteiger, H.A., 2019. Temperature and Concentration - Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes. - Journal of The Electrochemical Society, 166(14), pp.A3079-A3097. - - Parameters - ---------- - c_e: :class:`pybamm.Symbol` - Dimensional electrolyte concentration - T: :class:`pybamm.Symbol` - Dimensional temperature - coeffs: :class:`pybamm.Symbol` - Fitting parameter coefficients - - Returns - ------- - :class:`pybamm.Symbol` - Electrolyte transference number - """ - c = c_e / 1000 # mol.m-3 -> mol.l - p1, p2, p3, p4, p5, p6, p7, p8, p9 = coeffs - tplus = ( - p1 - + p2 * c - + p3 * T - + p4 * c**2 - + p5 * c * T - + p6 * T**2 - + p7 * c**3 - + p8 * c**2 * T - + p9 * c * T**2 - ) - - return tplus diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/electrolyte_conductivity_EMC_FEC_19_1_Landesfeind2019.py b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/electrolyte_conductivity_EMC_FEC_19_1_Landesfeind2019.py deleted file mode 100644 index 42e80ff9da..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/electrolyte_conductivity_EMC_FEC_19_1_Landesfeind2019.py +++ /dev/null @@ -1,32 +0,0 @@ -from .electrolyte_base_Landesfeind2019 import ( - electrolyte_conductivity_base_Landesfeind2019, -) -import numpy as np - - -def electrolyte_conductivity_EMC_FEC_19_1_Landesfeind2019(c_e, T): - """ - Conductivity of LiPF6 in EMC:FEC (19:1 w:w) as a function of ion concentration and - temperature. The data comes from [1]. - - References - ---------- - .. [1] Landesfeind, J. and Gasteiger, H.A., 2019. Temperature and Concentration - Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes. - Journal of The Electrochemical Society, 166(14), pp.A3079-A3097. - - Parameters - ---------- - c_e: :class:`pybamm.Symbol` - Dimensional electrolyte concentration - T: :class:`pybamm.Symbol` - Dimensional temperature - - Returns - ------- - :class:`pybamm.Symbol` - Electrolyte conductivity - """ - coeffs = np.array([2.51e-2, 1.75e2, 1.23, 2.05e-1, -8.81e-2, 2.83e-3]) - - return electrolyte_conductivity_base_Landesfeind2019(c_e, T, coeffs) diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/electrolyte_diffusivity_EMC_FEC_19_1_Landesfeind2019.py b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/electrolyte_diffusivity_EMC_FEC_19_1_Landesfeind2019.py deleted file mode 100644 index 8a90084357..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/electrolyte_diffusivity_EMC_FEC_19_1_Landesfeind2019.py +++ /dev/null @@ -1,32 +0,0 @@ -from .electrolyte_base_Landesfeind2019 import ( - electrolyte_diffusivity_base_Landesfeind2019, -) -import numpy as np - - -def electrolyte_diffusivity_EMC_FEC_19_1_Landesfeind2019(c_e, T): - """ - Diffusivity of LiPF6 in EMC:FEC (19:1 w:w) as a function of ion concentration and - temperature. The data comes from [1]. - - References - ---------- - .. [1] Landesfeind, J. and Gasteiger, H.A., 2019. Temperature and Concentration - Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes. - Journal of The Electrochemical Society, 166(14), pp.A3079-A3097. - - Parameters - ---------- - c_e: :class:`pybamm.Symbol` - Dimensional electrolyte concentration - T: :class:`pybamm.Symbol` - Dimensional temperature - - Returns - ------- - :class:`pybamm.Symbol` - Electrolyte diffusivity - """ - coeffs = np.array([5.86e2, 1.33, -1.38e3, -5.82e2]) - - return electrolyte_diffusivity_base_Landesfeind2019(c_e, T, coeffs) diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/electrolyte_transference_number_EMC_FEC_19_1_Landesfeind2019.py b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/electrolyte_transference_number_EMC_FEC_19_1_Landesfeind2019.py deleted file mode 100644 index 12e683fa8e..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/electrolyte_transference_number_EMC_FEC_19_1_Landesfeind2019.py +++ /dev/null @@ -1,34 +0,0 @@ -from .electrolyte_base_Landesfeind2019 import ( - electrolyte_transference_number_base_Landesfeind2019, -) -import numpy as np - - -def electrolyte_transference_number_EMC_FEC_19_1_Landesfeind2019(c_e, T): - """ - Transference number of LiPF6 in EMC:FEC (19:1 w:w) as a function of ion - concentration and temperature. The data comes from [1]. - - References - ---------- - .. [1] Landesfeind, J. and Gasteiger, H.A., 2019. Temperature and Concentration - Dependence of the Ionic Transport Properties of Lithium-Ion Battery Electrolytes. - Journal of The Electrochemical Society, 166(14), pp.A3079-A3097. - - Parameters - ---------- - c_e: :class:`pybamm.Symbol` - Dimensional electrolyte concentration - T: :class:`pybamm.Symbol` - Dimensional temperature - - Returns - ------- - :class:`pybamm.Symbol` - Electrolyte transference number - """ - coeffs = np.array( - [-1.22e1, -3.05, 8.38e-2, 1.78, 1.51e-3, -1.37e-4, -2.45e-2, -5.15e-3, 2.14e-5] - ) - - return electrolyte_transference_number_base_Landesfeind2019(c_e, T, coeffs) diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/parameters.csv b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/parameters.csv deleted file mode 100644 index 8d15f61270..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_EMC_FEC_19_1_Landesfeind2019/parameters.csv +++ /dev/null @@ -1,9 +0,0 @@ -Name [units],Value,Reference,Notes -# Empty rows and rows starting with ‘#’ will be ignored,,, -,,, -# Electrolyte properties,,, -Initial concentration in electrolyte [mol.m-3],1000,default, -Cation transference number,[function]electrolyte_transference_number_EMC_FEC_19_1_Landesfeind2019,Landesfeind 2019, -Thermodynamic factor,[function]electrolyte_TDF_EMC_FEC_19_1_Landesfeind2019,Landesfeind 2019, -Electrolyte diffusivity [m2.s-1],[function]electrolyte_diffusivity_EMC_FEC_19_1_Landesfeind2019,Landesfeind 2019," " -Electrolyte conductivity [S.m-1],[function]electrolyte_conductivity_EMC_FEC_19_1_Landesfeind2019,Landesfeind 2019," " diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_Enertech_Ai2020/README.md b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_Enertech_Ai2020/README.md deleted file mode 100644 index a81234481f..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_Enertech_Ai2020/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# LiPF6 electrolyte parameters - -Parameters for a LiPF6 electrolyte, from the paper - -> Ai, W., Kraft, L., Sturm, J., Jossen, A., & Wu, B. (2020). Electrochemical Thermal-Mechanical Modelling of Stress Inhomogeneity in Lithium-Ion Pouch Cells. Journal of The Electrochemical Society, 167(1), 013512. DOI: 10.1149/2.0122001JES. - -> Rieger, B., Erhard, S. V., Rumpf, K., & Jossen, A. (2016). A new method to model the thickness change of a commercial pouch cell during discharge. Journal of The Electrochemical Society, 163(8), A1566-A1575. - -and references therein. diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_Enertech_Ai2020/__init__.py b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_Enertech_Ai2020/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_Enertech_Ai2020/dlnf_dlnc_Ai2020.py b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_Enertech_Ai2020/dlnf_dlnc_Ai2020.py deleted file mode 100644 index 3f2bd2e806..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_Enertech_Ai2020/dlnf_dlnc_Ai2020.py +++ /dev/null @@ -1,34 +0,0 @@ -from pybamm import Parameter - - -def dlnf_dlnc_Ai2020(c_e, T, T_ref=298.3, t_plus=0.38): - """ - Activity dependence of LiPF6 in EC:DMC as a function of ion concentration. - - References - ---------- - .. [1] Ai, W., Kraft, L., Sturm, J., Jossen, A., & Wu, B. (2020). - Electrochemical Thermal-Mechanical Modelling of Stress Inhomogeneity - in Lithium-Ion Pouch Cells. Journal of The Electrochemical Society, - 167(1), 013512. DOI: 10.1149/2.0122001JES. - - Parameters - ---------- - c_e: :class:`pybamm.Symbol` - Dimensional electrolyte concentration, mol/m^3 - T: :class:`pybamm.Symbol` - Dimensional temperature, K - - Returns - ------- - :class:`pybamm.Symbol` - Thermodynamic factor - """ - T_ref = Parameter("Reference temperature [K]") - t_plus = Parameter("Cation transference number") - dlnf_dlnc = ( - 0.601 - - 0.24 * (c_e / 1000) ** 0.5 - + 0.982 * (1 - 0.0052 * (T - T_ref)) * (c_e / 1000) ** 1.5 - ) / (1 - t_plus) - return dlnf_dlnc diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_Enertech_Ai2020/electrolyte_conductivity_Ai2020.py b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_Enertech_Ai2020/electrolyte_conductivity_Ai2020.py deleted file mode 100644 index c71171e0be..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_Enertech_Ai2020/electrolyte_conductivity_Ai2020.py +++ /dev/null @@ -1,40 +0,0 @@ -def electrolyte_conductivity_Ai2020(c_e, T): - """ - Conductivity of LiPF6 in EC:DMC as a function of ion concentration. - Concentration should be in dm3 in the function. - - References - ---------- - .. [1] Ai, W., Kraft, L., Sturm, J., Jossen, A., & Wu, B. (2020). - Electrochemical Thermal-Mechanical Modelling of Stress Inhomogeneity - in Lithium-Ion Pouch Cells. Journal of The Electrochemical Society, - 167(1), 013512. DOI: 10.1149/2.0122001JES. - .. [2] Torchio, Marcello, et al. "Lionsimba: a matlab framework based - on a finite volume model suitable for li-ion battery design, simulation, - and control." Journal of The Electrochemical Society 163.7 (2016): A1192. - - Parameters - ---------- - c_e: :class:`pybamm.Symbol` - Dimensional electrolyte concentration - T: :class:`pybamm.Symbol` - Dimensional temperature - - Returns - ------- - :class:`pybamm.Symbol` - Solid diffusivity - """ - - sigma_e = ( - 1e-4 - * c_e - * ( - (-10.5 + 0.668 * 1e-3 * c_e + 0.494 * 1e-6 * c_e**2) - + (0.074 - 1.78 * 1e-5 * c_e - 8.86 * 1e-10 * c_e**2) * T - + (-6.96 * 1e-5 + 2.8 * 1e-8 * c_e) * T**2 - ) - ** 2 - ) - - return sigma_e diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_Enertech_Ai2020/electrolyte_diffusivity_Ai2020.py b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_Enertech_Ai2020/electrolyte_diffusivity_Ai2020.py deleted file mode 100644 index 3201839779..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_Enertech_Ai2020/electrolyte_diffusivity_Ai2020.py +++ /dev/null @@ -1,28 +0,0 @@ -def electrolyte_diffusivity_Ai2020(c_e, T): - """ - Diffusivity of LiPF6 in EC:DMC as a function of ion concentration. - - References - ---------- - .. [1] Ai, W., Kraft, L., Sturm, J., Jossen, A., & Wu, B. (2020). - Electrochemical Thermal-Mechanical Modelling of Stress Inhomogeneity - in Lithium-Ion Pouch Cells. Journal of The Electrochemical Society, - 167(1), 013512. DOI: 10.1149/2.0122001JES. - - Parameters - ---------- - c_e: :class:`pybamm.Symbol` - Dimensional electrolyte concentration, mol/m^3 - T: :class:`pybamm.Symbol` - Dimensional temperature, K - - - Returns - ------- - :class:`pybamm.Symbol` - Solid diffusivity - """ - - D_c_e = 10 ** (-8.43 - 54 / (T - 229 - 5e-3 * c_e) - 0.22e-3 * c_e) - - return D_c_e diff --git a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_Enertech_Ai2020/parameters.csv b/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_Enertech_Ai2020/parameters.csv deleted file mode 100644 index 2160c6e52c..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_Enertech_Ai2020/parameters.csv +++ /dev/null @@ -1,9 +0,0 @@ -Name [units],Value,Reference,Notes -# Empty rows and rows starting with ‘#’ will be ignored,,, -,,, -# Electrolyte properties,,, -Initial concentration in electrolyte [mol.m-3],1000,Ai 2020, -Cation transference number,0.38,Ai 2020, -Thermodynamic factor,[function]dlnf_dlnc_Ai2020,, -Electrolyte diffusivity [m2.s-1],[function]electrolyte_diffusivity_Ai2020,, -Electrolyte conductivity [S.m-1],[function]electrolyte_conductivity_Ai2020,, diff --git a/pybamm/input/parameters/lithium_ion/testing_only/experiments/1C_discharge_from_full_Ai2020/README.md b/pybamm/input/parameters/lithium_ion/testing_only/experiments/1C_discharge_from_full_Ai2020/README.md deleted file mode 100644 index 424ec94939..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/experiments/1C_discharge_from_full_Ai2020/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Enertech Graphite negative electrode parameters - -Parameters for a graphite negative electrode, from the paper - -> Ai, W., Kraft, L., Sturm, J., Jossen, A., & Wu, B. (2020). Electrochemical Thermal-Mechanical Modelling of Stress Inhomogeneity in Lithium-Ion Pouch Cells. Journal of The Electrochemical Society, 167(1), 013512. DOI: 10.1149/2.0122001JES. - -> Rieger, B., Erhard, S. V., Rumpf, K., & Jossen, A. (2016). A new method to model the thickness change of a commercial pouch cell during discharge. Journal of The Electrochemical Society, 163(8), A1566-A1575. - -and references therein. diff --git a/pybamm/input/parameters/lithium_ion/testing_only/experiments/1C_discharge_from_full_Ai2020/parameters.csv b/pybamm/input/parameters/lithium_ion/testing_only/experiments/1C_discharge_from_full_Ai2020/parameters.csv deleted file mode 100644 index 42a6665957..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/experiments/1C_discharge_from_full_Ai2020/parameters.csv +++ /dev/null @@ -1,18 +0,0 @@ -Name [units],Value,Reference,Notes -# Empty rows and rows starting with ‘#’ will be ignored,,, -,,, -# Temperature -Reference temperature [K],298.15,25C, -Total heat transfer coefficient [W.m-2.K-1],35,default, -Ambient temperature [K],298.15,, -,,, -# Electrical -Number of electrodes connected in parallel to make a cell,34,, -Number of cells connected in series to make a battery,1,, -Lower voltage cut-off [V],3,, -Upper voltage cut-off [V],4.2,, -,,, -# Initial conditions -Initial concentration in negative electrode [mol.m-3],24108,Ai 2020, -Initial concentration in positive electrode [mol.m-3],21725,Ai 2020, -Initial temperature [K],298.15,, \ No newline at end of file diff --git a/pybamm/input/parameters/lithium_ion/testing_only/experiments/__init__.py b/pybamm/input/parameters/lithium_ion/testing_only/experiments/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/__init__.py b/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/README.md b/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/README.md deleted file mode 100644 index 424ec94939..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Enertech Graphite negative electrode parameters - -Parameters for a graphite negative electrode, from the paper - -> Ai, W., Kraft, L., Sturm, J., Jossen, A., & Wu, B. (2020). Electrochemical Thermal-Mechanical Modelling of Stress Inhomogeneity in Lithium-Ion Pouch Cells. Journal of The Electrochemical Society, 167(1), 013512. DOI: 10.1149/2.0122001JES. - -> Rieger, B., Erhard, S. V., Rumpf, K., & Jossen, A. (2016). A new method to model the thickness change of a commercial pouch cell during discharge. Journal of The Electrochemical Society, 163(8), A1566-A1575. - -and references therein. diff --git a/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/__init__.py b/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_cracking_rate_Ai2020.py b/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_cracking_rate_Ai2020.py deleted file mode 100644 index 1bf7ce3e67..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_cracking_rate_Ai2020.py +++ /dev/null @@ -1,35 +0,0 @@ -from pybamm import Parameter, constants, exp - - -def graphite_cracking_rate_Ai2020(T_dim): - """ - graphite particle cracking rate as a function of temperature [1, 2]. - - References - ---------- - .. [1] Ai, W., Kraft, L., Sturm, J., Jossen, A., & Wu, B. (2020). - Electrochemical Thermal-Mechanical Modelling of Stress Inhomogeneity in - Lithium-Ion Pouch Cells. Journal of The Electrochemical Society, 167(1), 013512 - DOI: 10.1149/2.0122001JES. - .. [2] Deshpande, R., Verbrugge, M., Cheng, Y. T., Wang, J., & Liu, P. (2012). - Battery cycle life prediction with coupled chemical degradation and fatigue - mechanics. Journal of the Electrochemical Society, 159(10), A1730. - - Parameters - ---------- - T_dim: :class:`pybamm.Symbol` - temperature, [K] - - Returns - ------- - k_cr: :class:`pybamm.Symbol` - cracking rate, [m/(Pa.m0.5)^m_cr] - where m_cr is another Paris' law constant - """ - k_cr = 3.9e-20 - T_ref = Parameter("Reference temperature [K]") - Eac_cr = Parameter( - "Negative electrode activation energy for cracking rate [J.mol-1]" - ) - arrhenius = exp(Eac_cr / constants.R * (1 / T_dim - 1 / T_ref)) - return k_cr * arrhenius diff --git a/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_diffusivity_Dualfoil1998.py b/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_diffusivity_Dualfoil1998.py deleted file mode 100644 index 406f95f6a8..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_diffusivity_Dualfoil1998.py +++ /dev/null @@ -1,34 +0,0 @@ -from pybamm import exp, constants, Parameter - - -def graphite_diffusivity_Dualfoil1998(sto, T): - """ - Graphite diffusivity as a function of stochiometry [1, 2, 3]. - - References - ---------- - .. [1] Ai, W., Kraft, L., Sturm, J., Jossen, A., & Wu, B. (2020). - Electrochemical Thermal-Mechanical Modelling of Stress Inhomogeneity in - Lithium-Ion Pouch Cells. Journal of The Electrochemical Society, 167(1), 013512 - DOI: 10.1149/2.0122001JES. - .. [2] Rieger, B., Erhard, S. V., Rumpf, K., & Jossen, A. (2016). - A new method to model the thickness change of a commercial pouch cell - during discharge. Journal of The Electrochemical Society, 163(8), A1566-A1575. - - Parameters - ---------- - sto: :class:`pybamm.Symbol` - Electrode stochiometry - T: :class:`pybamm.Symbol` - Dimensional temperature, [K] - - Returns - ------- - :class:`pybamm.Symbol` - Solid diffusivity [m2.s-1] - """ - D_ref = 3.9 * 10 ** (-14) - E_D_s = 5000 - T_ref = Parameter("Reference temperature [K]") - arrhenius = exp(E_D_s / constants.R * (1 / T_ref - 1 / T)) - return D_ref * arrhenius diff --git a/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_electrolyte_exchange_current_density_Dualfoil1998.py b/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_electrolyte_exchange_current_density_Dualfoil1998.py deleted file mode 100644 index 21585c4ccd..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_electrolyte_exchange_current_density_Dualfoil1998.py +++ /dev/null @@ -1,39 +0,0 @@ -from pybamm import exp, constants - - -def graphite_electrolyte_exchange_current_density_Dualfoil1998( - c_e, c_s_surf, c_s_max, T -): - """ - Exchange-current density for Butler-Volmer reactions between graphite and LiPF6 in - EC:DMC. - - References - ---------- - .. [2] http://www.cchem.berkeley.edu/jsngrp/fortran.html - - Parameters - ---------- - c_e : :class:`pybamm.Symbol` - Electrolyte concentration [mol.m-3] - c_s_surf : :class:`pybamm.Symbol` - Particle concentration [mol.m-3] - c_s_max : :class:`pybamm.Symbol` - Maximum particle concentration [mol.m-3] - T : :class:`pybamm.Symbol` - Temperature [K] - - Returns - ------- - :class:`pybamm.Symbol` - Exchange-current density [A.m-2] - """ - m_ref = ( - 1 * 10 ** (-11) * constants.F - ) # (A/m2)(m3/mol)**1.5 - includes ref concentrations - E_r = 5000 # activation energy for Temperature Dependent Reaction Constant [J/mol] - arrhenius = exp(E_r / constants.R * (1 / 298.15 - 1 / T)) - - return ( - m_ref * arrhenius * c_e**0.5 * c_s_surf**0.5 * (c_s_max - c_s_surf) ** 0.5 - ) diff --git a/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_entropy_Enertech_Ai2020.csv b/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_entropy_Enertech_Ai2020.csv deleted file mode 100644 index 12c6231083..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_entropy_Enertech_Ai2020.csv +++ /dev/null @@ -1,104 +0,0 @@ -# Entropy for graphite from Ai2020 -# Just for reference against graphite_entropy_Enertech_Ai2020_function -# stoichiometry , entropic change [mV.K-1] -0.0000000e+00,5.2700000e-03 -1.0000000e-02,4.9161311e-02 -2.0000000e-02,1.1269475e-01 -3.0000000e-02,1.9070171e-01 -4.0000000e-02,2.4996395e-01 -5.0000000e-02,2.4670045e-01 -6.0000000e-02,1.9017663e-01 -7.0000000e-02,1.2383313e-01 -8.0000000e-02,7.0147138e-02 -9.0000000e-02,3.1338363e-02 -1.0000000e-01,3.7890420e-03 -1.1000000e-01,-1.6168816e-02 -1.2000000e-01,-3.1205820e-02 -1.3000000e-01,-4.3153828e-02 -1.4000000e-01,-5.3302760e-02 -1.5000000e-01,-6.2626427e-02 -1.6000000e-01,-7.1923436e-02 -1.7000000e-01,-8.1880316e-02 -1.8000000e-01,-9.3048410e-02 -1.9000000e-01,-1.0571601e-01 -2.0000000e-01,-1.1969020e-01 -2.1000000e-01,-1.3411266e-01 -2.2000000e-01,-1.4755409e-01 -2.3000000e-01,-1.5852853e-01 -2.4000000e-01,-1.6615492e-01 -2.5000000e-01,-1.7045348e-01 -2.6000000e-01,-1.7211739e-01 -2.7000000e-01,-1.7206991e-01 -2.8000000e-01,-1.7113903e-01 -2.9000000e-01,-1.6993421e-01 -3.0000000e-01,-1.6885282e-01 -3.1000000e-01,-1.6813185e-01 -3.2000000e-01,-1.6789813e-01 -3.3000000e-01,-1.6820053e-01 -3.4000000e-01,-1.6902097e-01 -3.5000000e-01,-1.7026507e-01 -3.6000000e-01,-1.7173534e-01 -3.7000000e-01,-1.7309697e-01 -3.8000000e-01,-1.7386338e-01 -3.9000000e-01,-1.7345079e-01 -4.0000000e-01,-1.7134817e-01 -4.1000000e-01,-1.6737103e-01 -4.2000000e-01,-1.6183723e-01 -4.3000000e-01,-1.5548923e-01 -4.4000000e-01,-1.4919003e-01 -4.5000000e-01,-1.4360695e-01 -4.6000000e-01,-1.3900773e-01 -4.7000000e-01,-1.3500887e-01 -4.8000000e-01,-1.2994318e-01 -4.9000000e-01,-1.2106473e-01 -5.0000000e-01,-1.1021528e-01 -5.1000000e-01,-1.0348811e-01 -5.2000000e-01,-1.0092885e-01 -5.3000000e-01,-1.0015801e-01 -5.4000000e-01,-9.9965693e-02 -5.5000000e-01,-9.9939815e-02 -5.6000000e-01,-9.9954176e-02 -5.7000000e-01,-9.9972658e-02 -5.8000000e-01,-9.9986619e-02 -5.9000000e-01,-9.9995371e-02 -6.0000000e-01,-1.0000014e-01 -6.1000000e-01,-1.0000230e-01 -6.2000000e-01,-1.0000291e-01 -6.3000000e-01,-1.0000268e-01 -6.4000000e-01,-1.0000209e-01 -6.5000000e-01,-1.0000141e-01 -6.6000000e-01,-1.0000078e-01 -6.7000000e-01,-1.0000027e-01 -6.8000000e-01,-9.9999912e-02 -6.9000000e-01,-9.9999691e-02 -7.0000000e-01,-9.9999591e-02 -7.1000000e-01,-9.9999585e-02 -7.2000000e-01,-9.9999646e-02 -7.3000000e-01,-9.9999746e-02 -7.4000000e-01,-9.9999862e-02 -7.5000000e-01,-9.9999972e-02 -7.6000000e-01,-1.0000006e-01 -7.7000000e-01,-1.0000011e-01 -7.8000000e-01,-1.0000011e-01 -7.9000000e-01,-1.0000006e-01 -8.0000000e-01,-9.9999942e-02 -8.1000000e-01,-9.9999758e-02 -8.2000000e-01,-9.9999503e-02 -8.3000000e-01,-9.9999176e-02 -8.4000000e-01,-9.9998778e-02 -8.5000000e-01,-9.9998308e-02 -8.6000000e-01,-9.9997769e-02 -8.7000000e-01,-9.9997162e-02 -8.8000000e-01,-9.9996490e-02 -8.9000000e-01,-9.9995755e-02 -9.0000000e-01,-9.9994959e-02 -9.1000000e-01,-9.9994107e-02 -9.2000000e-01,-9.9993200e-02 -9.3000000e-01,-9.9992243e-02 -9.4000000e-01,-9.9991237e-02 -9.5000000e-01,-9.9990187e-02 -9.6000000e-01,-9.9989096e-02 -9.7000000e-01,-9.9987965e-02 -9.8000000e-01,-9.9986799e-02 -9.9000000e-01,-9.9985599e-02 -1.0000000e+00,-9.9984369e-02 \ No newline at end of file diff --git a/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_entropy_Enertech_Ai2020_function.py b/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_entropy_Enertech_Ai2020_function.py deleted file mode 100644 index 94050af2a4..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_entropy_Enertech_Ai2020_function.py +++ /dev/null @@ -1,52 +0,0 @@ -def graphite_entropy_Enertech_Ai2020_function(sto, c_s_max): - """ - 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 - from Ref [1], which is only accurate - for 0.43 < sto < 0.9936. - - References - ---------- - .. [1] Ai, W., Kraft, L., Sturm, J., Jossen, A., & Wu, B. (2020). - Electrochemical Thermal-Mechanical Modelling of Stress Inhomogeneity in - Lithium-Ion Pouch Cells. - Journal of The Electrochemical Society, 167(1), 013512. DOI: 10.1149/2.0122001JES - - Parameters - ---------- - sto: double - Stochiometry of material (li-fraction) - - Returns - ------- - :class:`pybamm.Symbol` - Entropic change [V.K-1] - """ - - du_dT = ( - 0.001 - * ( - 0.005269056 - + 3.299265709 * sto - - 91.79325798 * sto**2 - + 1004.911008 * sto**3 - - 5812.278127 * sto**4 - + 19329.7549 * sto**5 - - 37147.8947 * sto**6 - + 38379.18127 * sto**7 - - 16515.05308 * sto**8 - ) - / ( - 1 - - 48.09287227 * sto - + 1017.234804 * sto**2 - - 10481.80419 * sto**3 - + 59431.3 * sto**4 - - 195881.6488 * sto**5 - + 374577.3152 * sto**6 - - 385821.1607 * sto**7 - + 165705.8597 * sto**8 - ) - ) - - return du_dT diff --git a/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_ocp_Enertech_Ai2020.csv b/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_ocp_Enertech_Ai2020.csv deleted file mode 100644 index 8a5bce2874..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_ocp_Enertech_Ai2020.csv +++ /dev/null @@ -1,129 +0,0 @@ -# OCP for graphite from Ai 2020 -# sto,ocp [V] -# extra point to avoid extrapolation -0,3.5 -# experimentally measured data -0.0005,3 -0.00127041,1.04 -0.00152479,1.01 -0.00190595,0.972653837 -0.002223558,0.94249055 -0.004060547,0.816240592 -0.004820151,0.780280928 -0.006463943,0.71896262 -0.00741337,0.691374757 -0.008616506,0.661391781 -0.009123417,0.649962232 -0.010768226,0.6165173 -0.012665046,0.583310858 -0.014118344,0.560830783 -0.017786752,0.512439476 -0.02069469,0.48025136 -0.023983799,0.448495867 -0.030502175,0.39598881 -0.036001135,0.359507681 -0.039606662,0.338477981 -0.059148083,0.256319558 -0.061297942,0.25117361 -0.071349833,0.236055324 -0.080265526,0.231009217 -0.119208079,0.2232966 -0.128120548,0.218284244 -0.134253707,0.213273859 -0.141584594,0.208228362 -0.150874177,0.203209739 -0.160609131,0.198620985 -0.170345957,0.193816376 -0.189747769,0.184166915 -0.209222253,0.176790532 -0.21901773,0.173830441 -0.228756579,0.170963261 -0.238552575,0.167903501 -0.248349231,0.164649979 -0.258084023,0.161491332 -0.267821184,0.15859383 -0.28741535,0.153399157 -0.297209811,0.151002319 -0.307004942,0.14886213 -0.316798396,0.146918911 -0.326534032,0.145328142 -0.336321558,0.144002109 -0.346061758,0.142902125 -0.355856392,0.142014262 -0.365593044,0.141316008 -0.375388012,0.140759105 -0.385120781,0.140314323 -0.394915577,0.139942322 -0.404717479,0.139617851 -0.414512102,0.139325406 -0.424244871,0.139051014 -0.434039331,0.138779297 -0.44377024,0.138517413 -0.453564862,0.138258897 -0.463298139,0.137981293 -0.473034456,0.137672226 -0.482766544,0.137329325 -0.492564552,0.136903224 -0.502302892,0.136390244 -0.512042595,0.135757581 -0.521833161,0.134947101 -0.531572182,0.133923235 -0.541369033,0.132621681 -0.551104831,0.130989474 -0.5608998,0.128964924 -0.570635608,0.126549987 -0.580434806,0.123742878 -0.590235692,0.120770834 -0.599977407,0.117929634 -0.609716266,0.115379983 -0.619517822,0.113205423 -0.629313635,0.111366477 -0.639049108,0.109855495 -0.648790152,0.108578952 -0.658584104,0.107520678 -0.668320248,0.106632536 -0.67805504,0.105893758 -0.687851869,0.105260613 -0.69764938,0.104713189 -0.707389072,0.104254365 -0.717188097,0.103845625 -0.726977148,0.103477119 -0.736776336,0.103153932 -0.746515866,0.102856541 -0.756259106,0.102587443 -0.766055091,0.102338279 -0.775789039,0.102101986 -0.785537861,0.101880905 -0.79532979,0.101676423 -0.805080646,0.101465878 -0.814827099,0.101264171 -0.824570003,0.101062635 -0.834370889,0.10087041 -0.844173289,0.10068096 -0.853913187,0.100489223 -0.86365051,0.100300437 -0.873392073,0.100099718 -0.883126865,0.099877104 -0.892918286,0.099628985 -0.902708516,0.099332616 -0.912443308,0.098958419 -0.922232533,0.098442542 -0.932019724,0.097683643 -0.941812832,0.096492 -0.951602392,0.094510791 -0.961392795,0.091136817 -0.970177652,0.086115186 -0.976051358,0.081078748 -0.980413449,0.07604037 -0.983887804,0.070991535 -0.986792703,0.065898328 -0.989255096,0.060844047 -0.991401407,0.055810118 -0.993359929,0.050670698 -0.995130154,0.045562401 -0.996776304,0.040392663 -0.99822944,0.035261272 -0.999241066,0.030242658 -0.999746961,0.024850768 -0.999936448,0.019251502 -1,0.004994678 \ No newline at end of file diff --git a/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_ocp_Enertech_Ai2020_function.py b/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_ocp_Enertech_Ai2020_function.py deleted file mode 100644 index ab510e8a11..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_ocp_Enertech_Ai2020_function.py +++ /dev/null @@ -1,49 +0,0 @@ -def graphite_ocp_Enertech_Ai2020_function(sto): - """ - Graphite Open-circuit Potential (OCP) as a a function of the - stochiometry. The fit is taken from the Enertech cell [1], which is only accurate - for 0.0065 < sto < 0.84. - - References - ---------- - .. [1] Ai, W., Kraft, L., Sturm, J., Jossen, A., & Wu, B. (2020). - Electrochemical Thermal-Mechanical Modelling of Stress Inhomogeneity in - Lithium-Ion Pouch Cells. Journal of The Electrochemical Society, 167(1), - 013512. DOI: 10.1149/2.0122001JES - - Parameters - ---------- - sto: double - Stochiometry of material (li-fraction) - - Returns - ------- - :class:`pybamm.Symbol` - OCP [V] - - """ - - p1 = -2058.29865 - p2 = 10040.08960 - p3 = -20824.86740 - p4 = 23911.86578 - p5 = -16576.3692 - p6 = 7098.09151 - p7 = -1845.43634 - p8 = 275.31114 - p9 = -21.20097 - p10 = 0.84498 - u_eq = ( - p1 * sto**9 - + p2 * sto**8 - + p3 * sto**7 - + p4 * sto**6 - + p5 * sto**5 - + p6 * sto**4 - + p7 * sto**3 - + p8 * sto**2 - + p9 * sto - + p10 - ) - - return u_eq diff --git a/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_volume_change_Ai2020.py b/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_volume_change_Ai2020.py deleted file mode 100644 index b5a059d894..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/graphite_volume_change_Ai2020.py +++ /dev/null @@ -1,50 +0,0 @@ -def graphite_volume_change_Ai2020(sto, c_s_max): - """ - Graphite particle volume change as a function of stochiometry [1, 2]. - - References - ---------- - .. [1] Ai, W., Kraft, L., Sturm, J., Jossen, A., & Wu, B. (2020). - Electrochemical Thermal-Mechanical Modelling of Stress Inhomogeneity in - Lithium-Ion Pouch Cells. Journal of The Electrochemical Society, 167(1), 013512 - DOI: 10.1149/2.0122001JES. - .. [2] Rieger, B., Erhard, S. V., Rumpf, K., & Jossen, A. (2016). - A new method to model the thickness change of a commercial pouch cell - during discharge. Journal of The Electrochemical Society, 163(8), A1566-A1575. - - Parameters - ---------- - sto: :class:`pybamm.Symbol` - Electrode stochiometry, 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 - """ - p1 = 145.907 - p2 = -681.229 - p3 = 1334.442 - p4 = -1415.710 - p5 = 873.906 - p6 = -312.528 - p7 = 60.641 - p8 = -5.706 - p9 = 0.386 - p10 = -4.966e-05 - t_change = ( - p1 * sto**9 - + p2 * sto**8 - + p3 * sto**7 - + p4 * sto**6 - + p5 * sto**5 - + p6 * sto**4 - + p7 * sto**3 - + p8 * sto**2 - + p9 * sto - + p10 - ) - return t_change diff --git a/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/parameters.csv b/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/parameters.csv deleted file mode 100644 index ad5f054a33..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/negative_electrodes/graphite_Ai2020/parameters.csv +++ /dev/null @@ -1,50 +0,0 @@ -Name [units],Value,Reference,Notes -# Empty rows and rows starting with ‘#’ will be ignored,,, -,,, -# Electrode properties,,, -Negative electrode conductivity [S.m-1],100,Ai 2020,graphite -Maximum concentration in negative electrode [mol.m-3],28700,Ai 2020,tuned for 1C -Negative electrode diffusivity [m2.s-1],[function]graphite_diffusivity_Dualfoil1998,Ai 2020,tuned for 1C -Negative electrode OCP [V],[data]graphite_ocp_Enertech_Ai2020,Ai 2020, -,,, -# Microstructure,,, -Negative electrode porosity,0.33,Ai 2020, -Negative electrode active material volume fraction,0.61,Ai 2020, -Negative particle radius [m],5E-6,Ai 2020, -Negative electrode Bruggeman coefficient (electrolyte),2.914,Ai 2020,theoretical -Negative electrode Bruggeman coefficient (electrode),0,default, -,,, -# Interfacial reactions,,, -Negative electrode charge transfer coefficient,0.5,Ai 2020, -Negative electrode double-layer capacity [F.m-2],0.2,,guess -Negative electrode exchange-current density [A.m-2],[function]graphite_electrolyte_exchange_current_density_Dualfoil1998,, -,,, -# Density,,, -Negative electrode density [kg.m-3],2470,, -,,, -# Thermal parameters,,, -Negative electrode specific heat capacity [J.kg-1.K-1],1080.2,, -Negative electrode thermal conductivity [W.m-1.K-1],1.04,, -Negative electrode OCP entropic change [V.K-1],[function]graphite_entropy_Enertech_Ai2020_function,, -# Negative electrode OCP entropic change [V.K-1],0,, -,,, -# Mechanical properties,,, -Negative electrode Poisson's ratio,0.3,, -Negative electrode Young's modulus [Pa],15e9,, -Negative electrode reference concentration for free of deformation [mol.m-3],0,, -Negative electrode partial molar volume [m3.mol-1],3.1e-6,, -Negative electrode volume change,[function]graphite_volume_change_Ai2020,Ai 2020, -,,, -# Crack model,,, -Negative electrode initial crack length [m],20e-9,, -Negative electrode initial crack width [m],15e-9,, -Negative electrode number of cracks per unit area [m-2],3.18e15,, -Negative electrode Paris' law constant b,1.12,, -Negative electrode Paris' law constant m,2.2,, -Negative electrode cracking rate,[function]graphite_cracking_rate_Ai2020,, -Negative electrode activation energy for cracking rate [J.mol-1],0,, -,,, -# Loss of active materials (LAM) model,,, -Negative electrode LAM constant proportional term [s-1],0,, -Negative electrode LAM constant exponential term,2,, -Negative electrode critical stress [Pa],60e6,, diff --git a/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/__init__.py b/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/README.md b/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/README.md deleted file mode 100644 index 2c16e86179..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Lithium Cobalt Oxide positive electrode parameters - -Parameters for a lithium Cobalt Oxide positive electrode, from the paper - -> Ai, W., Kraft, L., Sturm, J., Jossen, A., & Wu, B. (2020). Electrochemical Thermal-Mechanical Modelling of Stress Inhomogeneity in Lithium-Ion Pouch Cells. Journal of The Electrochemical Society, 167(1), 013512. DOI: 10.1149/2.0122001JES. - -> Rieger, B., Erhard, S. V., Rumpf, K., & Jossen, A. (2016). A new method to model the thickness change of a commercial pouch cell during discharge. Journal of The Electrochemical Society, 163(8), A1566-A1575. - -and references therein. diff --git a/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/__init__.py b/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_cracking_rate_Ai2020.py b/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_cracking_rate_Ai2020.py deleted file mode 100644 index bef52cc5be..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_cracking_rate_Ai2020.py +++ /dev/null @@ -1,35 +0,0 @@ -from pybamm import Parameter, constants, exp - - -def lico2_cracking_rate_Ai2020(T_dim): - """ - lico2 particle cracking rate as a function of temperature [1, 2]. - - References - ---------- - .. [1] Ai, W., Kraft, L., Sturm, J., Jossen, A., & Wu, B. (2020). - Electrochemical Thermal-Mechanical Modelling of Stress Inhomogeneity in - Lithium-Ion Pouch Cells. Journal of The Electrochemical Society, 167(1), 013512 - DOI: 10.1149/2.0122001JES. - .. [2] Deshpande, R., Verbrugge, M., Cheng, Y. T., Wang, J., & Liu, P. (2012). - Battery cycle life prediction with coupled chemical degradation and fatigue - mechanics. Journal of the Electrochemical Society, 159(10), A1730. - - Parameters - ---------- - T: :class:`pybamm.Symbol` - temperature, [K] - - Returns - ------- - k_cr: :class:`pybamm.Symbol` - cracking rate, [m/(Pa.m0.5)^m_cr] - where m_cr is another Paris' law constant - """ - k_cr = 3.9e-20 - T_ref = Parameter("Reference temperature [K]") - Eac_cr = Parameter( - "Positive electrode activation energy for cracking rate [J.mol-1]" - ) - arrhenius = exp(Eac_cr / constants.R * (1 / T_dim - 1 / T_ref)) - return k_cr * arrhenius diff --git a/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_diffusivity_Dualfoil1998.py b/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_diffusivity_Dualfoil1998.py deleted file mode 100644 index 7cd095336a..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_diffusivity_Dualfoil1998.py +++ /dev/null @@ -1,29 +0,0 @@ -from pybamm import exp, constants, Parameter - - -def lico2_diffusivity_Dualfoil1998(sto, T): - """ - 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:`pybamm.Symbol` - Electrode stochiometry - T: :class:`pybamm.Symbol` - Dimensional temperature, [K] - - Returns - ------- - :class:`pybamm.Symbol` - Solid diffusivity [m2.s-1] - """ - D_ref = 5.387 * 10 ** (-15) - E_D_s = 5000 - T_ref = Parameter("Reference temperature [K]") - arrhenius = exp(E_D_s / constants.R * (1 / T_ref - 1 / T)) - return D_ref * arrhenius diff --git a/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_electrolyte_exchange_current_density_Dualfoil1998.py b/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_electrolyte_exchange_current_density_Dualfoil1998.py deleted file mode 100644 index 71a6ff4bf0..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_electrolyte_exchange_current_density_Dualfoil1998.py +++ /dev/null @@ -1,36 +0,0 @@ -from pybamm import exp, constants - - -def lico2_electrolyte_exchange_current_density_Dualfoil1998(c_e, c_s_surf, c_s_max, T): - """ - Exchange-current density for Butler-Volmer reactions between lico2 and LiPF6 in - EC:DMC. - - References - ---------- - .. [2] http://www.cchem.berkeley.edu/jsngrp/fortran.html - - Parameters - ---------- - c_e : :class:`pybamm.Symbol` - Electrolyte concentration [mol.m-3] - c_s_surf : :class:`pybamm.Symbol` - Particle concentration [mol.m-3] - c_s_max : :class:`pybamm.Symbol` - Maximum particle concentration [mol.m-3] - T : :class:`pybamm.Symbol` - Temperature [K] - - Returns - ------- - :class:`pybamm.Symbol` - Exchange-current density [A.m-2] - """ - m_ref = 1 * 10 ** (-11) * constants.F # need to match the unit from m/s - # (A/m2)(m3/mol)**1.5 - includes ref concentrations - E_r = 5000 - arrhenius = exp(E_r / constants.R * (1 / 298.15 - 1 / T)) - - return ( - m_ref * arrhenius * c_e**0.5 * c_s_surf**0.5 * (c_s_max - c_s_surf) ** 0.5 - ) diff --git a/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_entropic_change_Ai2020.csv b/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_entropic_change_Ai2020.csv deleted file mode 100644 index e3484e6b4f..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_entropic_change_Ai2020.csv +++ /dev/null @@ -1,12 +0,0 @@ -# Entropy for lico2 from Ai 2020 -# Just for reference against lico2_entropic_change_Ai2020_function -# stoichiometry , entropic change [mV.K-1] -0.450912106, -0.165164656 -0.519320066, -0.235038471 -0.587728027, -0.299562966 -0.657960199, -0.369445652 -0.725456053, -0.433965712 -0.794776119, -0.538614535 -0.86318408, -0.56034448 -0.932504146, -0.464393844 -1, -0.507521064 \ No newline at end of file diff --git a/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_entropic_change_Ai2020_function.py b/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_entropic_change_Ai2020_function.py deleted file mode 100644 index 4973fc0538..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_entropic_change_Ai2020_function.py +++ /dev/null @@ -1,48 +0,0 @@ -def lico2_entropic_change_Ai2020_function(sto, c_s_max): - """ - 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 - from Ref [1], which is only accurate - for 0.43 < sto < 0.9936. - - References - ---------- - .. [1] Ai, W., Kraft, L., Sturm, J., Jossen, A., & Wu, B. (2020). - Electrochemical Thermal-Mechanical Modelling of Stress Inhomogeneity - in Lithium-Ion Pouch Cells. Journal of The Electrochemical Society, - 167(1), 013512. DOI: 10.1149/2.0122001JES - - Parameters - ---------- - sto: double - Stochiometry of material (li-fraction) - - Returns - ------- - :class:`pybamm.Symbol` - Entropic change [V.K-1] - """ - - # 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. - p1 = -3.20392657 - p2 = 14.5719049 - p3 = -27.9047599 - p4 = 29.1744564 - p5 = -17.992018 - p6 = 6.54799331 - p7 = -1.30382445 - p8 = 0.109667298 - - du_dT = ( - p1 * sto**7 - + p2 * sto**6 - + p3 * sto**5 - + p4 * sto**4 - + p5 * sto**3 - + p6 * sto**2 - + p7 * sto - + p8 - ) - - return du_dT diff --git a/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_ocp_Ai2020.csv b/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_ocp_Ai2020.csv deleted file mode 100644 index ffd7886e2b..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_ocp_Ai2020.csv +++ /dev/null @@ -1,448 +0,0 @@ -# OCP for lico2 from Rieger 2016 -# stoichiometry , OCP [V] -0.43,4.3 -0.436639784,4.279907753 -0.437906143,4.276472669 -0.439172502,4.273800938 -0.44043886,4.271129206 -0.441705219,4.268648313 -0.442971578,4.266167419 -0.444237937,4.263686526 -0.445504296,4.261205633 -0.446770655,4.258724739 -0.448037014,4.256243846 -0.449303373,4.253762952 -0.450569732,4.251282059 -0.45183609,4.248992003 -0.453102449,4.24651111 -0.454368808,4.244221054 -0.455635167,4.24174016 -0.456901526,4.239259267 -0.458167885,4.236969211 -0.459434244,4.234679156 -0.460700603,4.232198262 -0.461966961,4.229717369 -0.46323332,4.227236475 -0.464499679,4.225137258 -0.465766038,4.222656364 -0.467032397,4.220366309 -0.468298756,4.217885415 -0.469565115,4.21559536 -0.470831474,4.213305304 -0.472097833,4.211015249 -0.473364191,4.208534355 -0.47463055,4.2062443 -0.475896909,4.203954244 -0.477163268,4.201664189 -0.478429627,4.199374133 -0.479695986,4.197084078 -0.480962345,4.194794022 -0.482228704,4.192503967 -0.483495063,4.190213911 -0.484761421,4.187923856 -0.48602778,4.185824638 -0.487294139,4.183534582 -0.488560498,4.181053689 -0.489826857,4.178954471 -0.491093216,4.176855254 -0.492359575,4.174565198 -0.493625934,4.172275143 -0.494892292,4.169985087 -0.496158651,4.16788587 -0.49742501,4.165786652 -0.498691369,4.163687435 -0.499957728,4.161588217 -0.501224087,4.159298161 -0.502490446,4.157389782 -0.503756805,4.155290564 -0.505023163,4.153191347 -0.506289522,4.151092129 -0.507555881,4.148992912 -0.50882224,4.146893694 -0.510088599,4.144794476 -0.511354958,4.142504421 -0.512621317,4.140405203 -0.513887676,4.138305986 -0.515154035,4.136206768 -0.516420393,4.134107551 -0.517686752,4.131817495 -0.518953111,4.129718278 -0.52021947,4.12761906 -0.521485829,4.125519842 -0.522752188,4.123229787 -0.524018547,4.121130569 -0.525284906,4.11922219 -0.526551264,4.116932134 -0.527817622,4.115023755 -0.52908398,4.112733699 -0.530350338,4.110634481 -0.531616697,4.108726102 -0.532883056,4.106817722 -0.534149415,4.104718505 -0.535415774,4.102619287 -0.536682133,4.100901745 -0.537948492,4.09861169 -0.539214851,4.09670331 -0.54048121,4.094985769 -0.541747568,4.092886551 -0.543013927,4.090978171 -0.544280286,4.089069792 -0.545546645,4.08735225 -0.546813004,4.085443871 -0.548079363,4.083535491 -0.549345722,4.081817949 -0.550612081,4.07990957 -0.551878439,4.078192028 -0.553144798,4.076474486 -0.554411157,4.074566107 -0.555677516,4.072848565 -0.556943875,4.071131024 -0.558210234,4.069413482 -0.559476593,4.06769594 -0.560742952,4.065978399 -0.562009311,4.064451695 -0.563275669,4.062734153 -0.564542028,4.06120745 -0.565808387,4.05929907 -0.567074746,4.057772366 -0.568341105,4.056054825 -0.569607464,4.054528121 -0.570873823,4.052810579 -0.572140182,4.051283876 -0.573406541,4.049566334 -0.574672899,4.04803963 -0.575939258,4.046322089 -0.577205617,4.044795385 -0.578471976,4.043268681 -0.579738335,4.04155114 -0.581004694,4.040024436 -0.582271053,4.038306894 -0.583537412,4.036971029 -0.58480377,4.035253487 -0.586070129,4.033726783 -0.587336488,4.03220008 -0.588602847,4.030673376 -0.589869206,4.029146672 -0.591135565,4.027619968 -0.592401924,4.026093265 -0.593668283,4.024566561 -0.594934642,4.023039857 -0.596201,4.021703992 -0.597467359,4.020177288 -0.598733718,4.018841422 -0.600000077,4.017314719 -0.601266436,4.015788015 -0.602532795,4.014261311 -0.603799154,4.012925445 -0.605065513,4.01158958 -0.606331872,4.010253714 -0.60759823,4.00872701 -0.608864589,4.007391145 -0.610130948,4.006055279 -0.611397307,4.004719413 -0.612663666,4.003383547 -0.613930025,4.001856844 -0.615196384,4.000711816 -0.616462743,3.99937595 -0.617729101,3.997849247 -0.61899546,3.996704219 -0.620261819,3.995368353 -0.621528178,3.994032487 -0.622794537,3.99288746 -0.624060896,3.991551594 -0.625327255,3.990215728 -0.626593614,3.9890707 -0.627859973,3.987734835 -0.629126331,3.986398969 -0.63039269,3.985253941 -0.631659049,3.984108913 -0.632925408,3.982773048 -0.634191767,3.98162802 -0.635458126,3.980292154 -0.636724485,3.979147126 -0.637990844,3.978192937 -0.639257202,3.976857071 -0.640523561,3.975712043 -0.64178992,3.974567015 -0.643056279,3.973421988 -0.644322638,3.97227696 -0.645588997,3.970941094 -0.646855356,3.969986904 -0.648121715,3.968841877 -0.649388074,3.967696849 -0.650654432,3.966742659 -0.651920791,3.965597631 -0.65318715,3.964452603 -0.654453509,3.963498414 -0.655719868,3.962353386 -0.656986227,3.961208358 -0.658252586,3.960254168 -0.659518945,3.959109141 -0.660785304,3.958154951 -0.662051662,3.957200761 -0.663318021,3.956055733 -0.66458438,3.955101543 -0.665850739,3.954147354 -0.667117098,3.953002326 -0.668383457,3.952048136 -0.669649816,3.951284784 -0.670916175,3.950139756 -0.672182533,3.949185567 -0.673448892,3.948231377 -0.674715251,3.947277187 -0.67598161,3.946513835 -0.677247969,3.945368807 -0.678514328,3.944605456 -0.679780687,3.943651266 -0.681047046,3.942697076 -0.682313405,3.941933724 -0.683579763,3.940979534 -0.684846122,3.940025344 -0.686112481,3.939261993 -0.68737884,3.938307803 -0.688645199,3.937544451 -0.689911568,3.936590261 -0.691177927,3.935826909 -0.692444286,3.93487272 -0.693710645,3.934109368 -0.694977004,3.933346016 -0.696243363,3.932582664 -0.697509722,3.931819312 -0.698776081,3.930865122 -0.700042439,3.930292608 -0.701308798,3.929338419 -0.702575157,3.928575067 -0.703841516,3.927811715 -0.705107875,3.927048363 -0.706374234,3.926285011 -0.707640593,3.925521659 -0.708906952,3.924949146 -0.71017331,3.924185794 -0.711439669,3.92361328 -0.712706028,3.922849928 -0.713972387,3.922086576 -0.715238746,3.921323224 -0.716505105,3.92075071 -0.717771464,3.919987359 -0.719037823,3.919224007 -0.720304182,3.918651493 -0.72157054,3.918078979 -0.722836899,3.917506465 -0.724103258,3.916933951 -0.725369617,3.916361437 -0.726635976,3.915788923 -0.727902335,3.915025572 -0.729168694,3.914643896 -0.730435053,3.913880544 -0.731701411,3.91330803 -0.73296777,3.912735516 -0.734234129,3.912163002 -0.735500488,3.911781326 -0.736766847,3.911208812 -0.738033206,3.910636298 -0.739299565,3.910063785 -0.740565924,3.909491271 -0.741832283,3.908918757 -0.743098641,3.908537081 -0.744365,3.908155405 -0.745631359,3.907582891 -0.746897718,3.907010377 -0.748164077,3.906628701 -0.749430436,3.906056187 -0.750696795,3.905865349 -0.751963154,3.905292836 -0.753229513,3.90491116 -0.754495871,3.904529484 -0.75576223,3.90395697 -0.757028589,3.903575294 -0.758294948,3.903193618 -0.759561307,3.902811942 -0.760827666,3.902621104 -0.762094025,3.902239428 -0.763360384,3.901857752 -0.764626742,3.901476076 -0.765893101,3.9010944 -0.76715946,3.900903562 -0.768425819,3.900521887 -0.769692178,3.900140211 -0.770958537,3.899949373 -0.772224896,3.899758535 -0.773491255,3.899376859 -0.774757613,3.899186021 -0.776023972,3.898995183 -0.777290331,3.898613507 -0.77855669,3.898422669 -0.779823049,3.898040993 -0.781089408,3.897850155 -0.782355767,3.897659317 -0.783622126,3.897468479 -0.784888485,3.897277641 -0.786154843,3.897086803 -0.787421202,3.896705127 -0.788687561,3.896705127 -0.78995392,3.896514289 -0.791220279,3.896323451 -0.792486638,3.896323451 -0.793752997,3.896132613 -0.795019356,3.895750938 -0.796285715,3.895750938 -0.797552073,3.8955601 -0.798818432,3.895369262 -0.800084791,3.895178424 -0.80135115,3.894987586 -0.802617509,3.894796748 -0.803883868,3.89460591 -0.805150227,3.89460591 -0.806416586,3.894415072 -0.807682944,3.894224234 -0.808949303,3.894033396 -0.810215662,3.894033396 -0.811482021,3.893842558 -0.81274838,3.89365172 -0.814014739,3.89365172 -0.815281098,3.893460882 -0.816547457,3.893270044 -0.817813816,3.893270044 -0.819080174,3.893079206 -0.820346533,3.892888368 -0.821612892,3.89269753 -0.822879251,3.89269753 -0.82414561,3.892506692 -0.825411969,3.892315854 -0.826678328,3.892125016 -0.827944687,3.891934178 -0.829211045,3.891934178 -0.830477404,3.89174334 -0.831743763,3.891552502 -0.833010122,3.891361664 -0.834276481,3.891170826 -0.83554284,3.890979989 -0.836809199,3.890979989 -0.838075558,3.890789151 -0.839341917,3.890598313 -0.840608275,3.890407475 -0.841874634,3.890216637 -0.843140993,3.890025799 -0.844407352,3.889834961 -0.845673711,3.889834961 -0.84694007,3.889644123 -0.848206429,3.889262447 -0.849472788,3.889071609 -0.850739146,3.888880771 -0.852005505,3.888689933 -0.853271864,3.888499095 -0.854538223,3.888308257 -0.855804582,3.888117419 -0.857070941,3.887735743 -0.8583373,3.887544905 -0.859603659,3.887354067 -0.860870018,3.887163229 -0.862136376,3.886972391 -0.863402735,3.886590715 -0.864669094,3.88620904 -0.865935453,3.886018202 -0.867201812,3.885827364 -0.868468171,3.885445688 -0.86973453,3.885064012 -0.871000889,3.884873174 -0.872267247,3.884491498 -0.873533606,3.88430066 -0.874799965,3.883918984 -0.876066324,3.883728146 -0.877332683,3.88334647 -0.878599042,3.882773956 -0.879865401,3.882583118 -0.88113176,3.882201442 -0.882398119,3.881819766 -0.883664477,3.88143809 -0.884930836,3.881056415 -0.886197195,3.880674739 -0.887463554,3.880102225 -0.888729913,3.879529711 -0.889996272,3.879148035 -0.891262631,3.878575521 -0.89252899,3.878193845 -0.893795349,3.877812169 -0.895061707,3.877239655 -0.896328066,3.876667141 -0.897594425,3.876094628 -0.898860784,3.875522114 -0.900127143,3.8749496 -0.901393502,3.874377086 -0.902659861,3.873613734 -0.90392622,3.87304122 -0.905192579,3.872468706 -0.906458937,3.871705354 -0.907725296,3.871132841 -0.908991655,3.870369489 -0.910258014,3.869415299 -0.911524373,3.868842785 -0.912790732,3.868079433 -0.914057091,3.867125243 -0.915323449,3.866171054 -0.916589808,3.865407702 -0.917856167,3.864453512 -0.919122526,3.863499322 -0.920388885,3.862545132 -0.921655244,3.861400105 -0.922921603,3.860255077 -0.924187962,3.859300887 -0.92545432,3.858155859 -0.926720679,3.856819994 -0.927987038,3.855674966 -0.929253397,3.854148262 -0.930519756,3.853003234 -0.931786115,3.851476531 -0.933052474,3.849949827 -0.934318833,3.848423123 -0.935585192,3.84689642 -0.93685155,3.84498804 -0.938117909,3.843270498 -0.939384268,3.841362119 -0.940650627,3.839262901 -0.941916986,3.837163684 -0.943183345,3.835064466 -0.944449704,3.832583573 -0.945716063,3.830102679 -0.946982421,3.827430948 -0.94824878,3.824759216 -0.949515139,3.821896647 -0.950781498,3.818843239 -0.952047857,3.815598994 -0.953314216,3.812163911 -0.954580575,3.808537989 -0.955846934,3.804912068 -0.957113293,3.800904471 -0.958379651,3.796896874 -0.95964601,3.792698439 -0.960912369,3.788309166 -0.962178728,3.783919893 -0.963445087,3.779148944 -0.964711446,3.774568832 -0.965977805,3.769607045 -0.967244164,3.765026934 -0.968510523,3.760065147 -0.969776881,3.75510336 -0.97104324,3.750141573 -0.972309599,3.745179786 -0.973575958,3.740217999 -0.974842317,3.735065375 -0.976108676,3.72991275 -0.977375035,3.724760125 -0.978641394,3.719416662 -0.979907752,3.713882361 -0.981174111,3.708157222 -0.98244047,3.702241245 -0.983706829,3.696134431 -0.984973188,3.689455102 -0.986239547,3.682394097 -0.987505906,3.674760579 -0.988772265,3.666363709 -0.990038623,3.656630973 -0.991304982,3.645562371 -0.992571341,3.632203714 -0.9938377,3.615219135 -0.995104059,3.591936904 -0.996370418,3.557204395 -0.997636777,3.501098035 -0.998903136,3.4089233 diff --git a/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_ocp_Ai2020_function.py b/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_ocp_Ai2020_function.py deleted file mode 100644 index fd0d197dc9..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_ocp_Ai2020_function.py +++ /dev/null @@ -1,47 +0,0 @@ -def lico2_ocp_Ai2020_function(sto): - """ - Lithium Cobalt Oxide (LiCO2) Open-circuit Potential (OCP) as a a function of the - stochiometry. The fit is taken from the Enertech cell [1], which is only accurate - for 0.435 < sto < 0.9651. - - References - ---------- - .. [1] Ai, W., Kraft, L., Sturm, J., Jossen, A., & Wu, B. (2020). Electrochemical - Thermal-Mechanical Modelling of Stress Inhomogeneity in Lithium-Ion Pouch Cells. - Journal of The Electrochemical Society, 167(1), 013512. DOI: 10.1149/2.0122001JES - - Parameters - ---------- - sto: double - Stochiometry of material (li-fraction) - - Returns - ------- - :class:`pybamm.Symbol` - OCP [V] - - """ - - p1 = -107897.40 - p2 = 677406.28 - p3 = -1873803.91 - p4 = 2996535.44 - p5 = -3052331.36 - p6 = 2053377.31 - p7 = -912135.88 - p8 = 257964.35 - p9 = -42146.98 - p10 = 3035.67 - u_eq = ( - p1 * sto**9 - + p2 * sto**8 - + p3 * sto**7 - + p4 * sto**6 - + p5 * sto**5 - + p6 * sto**4 - + p7 * sto**3 - + p8 * sto**2 - + p9 * sto - + p10 - ) - return u_eq diff --git a/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_volume_change_Ai2020.py b/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_volume_change_Ai2020.py deleted file mode 100644 index 1f5504ec78..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/lico2_volume_change_Ai2020.py +++ /dev/null @@ -1,33 +0,0 @@ -from pybamm import Parameter - - -def lico2_volume_change_Ai2020(sto, c_s_max): - """ - lico2 particle volume change as a function of stochiometry [1, 2]. - - References - ---------- - .. [1] Ai, W., Kraft, L., Sturm, J., Jossen, A., & Wu, B. (2020). - Electrochemical Thermal-Mechanical Modelling of Stress Inhomogeneity in - Lithium-Ion Pouch Cells. Journal of The Electrochemical Society, 167(1), 013512 - DOI: 10.1149/2.0122001JES. - .. [2] Rieger, B., Erhard, S. V., Rumpf, K., & Jossen, A. (2016). - A new method to model the thickness change of a commercial pouch cell - during discharge. Journal of The Electrochemical Society, 163(8), A1566-A1575. - - Parameters - ---------- - sto: :class:`pybamm.Symbol` - Electrode stochiometry, 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 = Parameter("Positive electrode partial molar volume [m3.mol-1]") - t_change = omega * c_s_max * sto - return t_change diff --git a/pybamm/input/parameters/lithium_ion/testing_only/seis/example/README.md b/pybamm/input/parameters/lithium_ion/testing_only/seis/example/README.md deleted file mode 100644 index 4330a3d572..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/seis/example/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# SEI parameters - -Some example parameters for SEI growth from the papers: - -> Ramadass, P., Haran, B., Gomadam, P. M., White, R., & Popov, B. N. (2004). Development of first principles capacity fade model for Li-ion cells. Journal of the Electrochemical Society, 151(2), A196-A203. -> Ploehn, H. J., Ramadass, P., & White, R. E. (2004). Solvent diffusion model for aging of lithium-ion battery cells. Journal of The Electrochemical Society, 151(3), A456-A462. -> Single, F., Latz, A., & Horstmann, B. (2018). Identifying the mechanism of continued growth of the solid–electrolyte interphase. ChemSusChem, 11(12), 1950-1955. -> Safari, M., Morcrette, M., Teyssot, A., & Delacour, C. (2009). Multimodal Physics-Based Aging Model for Life Prediction of Li-Ion Batteries. Journal of The Electrochemical Society, 156(3), -> Yang, X., Leng, Y., Zhang, G., Ge, S., Wang, C. (2017). Modeling of lithium plating induced aging of lithium-ion batteries: Transition from linear to nonlinear aging. Journal of Power Sources, 360, 28-40. - -Note: this parameter set does not claim to be representative of the true parameter values. Instead these are parameter values that were used to fit SEI models to observed experimental data in the referenced papers. diff --git a/pybamm/input/parameters/lithium_ion/testing_only/seis/example/parameters.csv b/pybamm/input/parameters/lithium_ion/testing_only/seis/example/parameters.csv deleted file mode 100644 index 4608e3d6d8..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/seis/example/parameters.csv +++ /dev/null @@ -1,28 +0,0 @@ -Name [units],Value,Reference,Notes -# Empty rows and rows starting with ‘#’ will be ignored,,, -,,, -# SEI properties,,, -Ratio of lithium moles to SEI moles,2,,Assume SEI made of LEDC and/or Li2CO3 -Inner SEI reaction proportion,0.5,, -Inner SEI partial molar volume [m3.mol-1],9.585e-5, Safari paper, -Outer SEI partial molar volume [m3.mol-1],9.585e-5, Safari paper, -SEI reaction exchange current density [A.m-2],1.5E-7, Guess, -SEI resistivity [Ohm.m],2e5, Safari paper, -Outer SEI solvent diffusivity [m2.s-1],2.5E-22, Single paper, -Bulk solvent concentration [mol.m-3],2.636E3, Ploehn paper, -Inner SEI open-circuit potential [V],0.1,, -Outer SEI open-circuit potential [V],0.8,, -Inner SEI electron conductivity [S.m-1],8.95E-14, Single paper, -Inner SEI lithium interstitial diffusivity [m2.s-1],1E-20, Guess, -Lithium interstitial reference concentration [mol.m-3],15, Single paper, -Initial inner SEI thickness [m], 2.5E-9, 2.5E-9 1/2 of initial thickness in Safari paper, -Initial outer SEI thickness [m], 2.5E-9, 1/2 of initial thickness in Safari paper, -EC initial concentration in electrolyte [mol.m-3], 4.541E3, Safari paper, -EC diffusivity [m2.s-1], 2E-18, adjusted parameter in Yang paper, -SEI kinetic rate constant [m.s-1], 1e-12, adjusted parameter in Yang paper, -SEI open-circuit potential [V], 0.4, Safari paper, -SEI growth activation energy [J.mol-1], 0,, -,,, -# Reaction-driven LAM example,,, -Negative electrode reaction-driven LAM factor [m3.mol-1],0,, -Positive electrode reaction-driven LAM factor [m3.mol-1],0,, diff --git a/pybamm/input/parameters/lithium_ion/testing_only/separators/__init__.py b/pybamm/input/parameters/lithium_ion/testing_only/separators/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/pybamm/input/parameters/lithium_ion/testing_only/separators/separator_Ai2020/README.md b/pybamm/input/parameters/lithium_ion/testing_only/separators/separator_Ai2020/README.md deleted file mode 100644 index 424ec94939..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/separators/separator_Ai2020/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Enertech Graphite negative electrode parameters - -Parameters for a graphite negative electrode, from the paper - -> Ai, W., Kraft, L., Sturm, J., Jossen, A., & Wu, B. (2020). Electrochemical Thermal-Mechanical Modelling of Stress Inhomogeneity in Lithium-Ion Pouch Cells. Journal of The Electrochemical Society, 167(1), 013512. DOI: 10.1149/2.0122001JES. - -> Rieger, B., Erhard, S. V., Rumpf, K., & Jossen, A. (2016). A new method to model the thickness change of a commercial pouch cell during discharge. Journal of The Electrochemical Society, 163(8), A1566-A1575. - -and references therein. diff --git a/pybamm/input/parameters/lithium_ion/testing_only/separators/separator_Ai2020/parameters.csv b/pybamm/input/parameters/lithium_ion/testing_only/separators/separator_Ai2020/parameters.csv deleted file mode 100644 index 6f85f8ebe5..0000000000 --- a/pybamm/input/parameters/lithium_ion/testing_only/separators/separator_Ai2020/parameters.csv +++ /dev/null @@ -1,8 +0,0 @@ -Name [units],Value,Reference,Notes -# Empty rows and rows starting with ‘#’ will be ignored,,, -,,, -Separator porosity,0.5,Ai 2020, -Separator Bruggeman coefficient (electrolyte),1.5,Ai 2020,theoretical -Separator density [kg.m-3],2470,default,cell parameter -Separator specific heat capacity [J.kg-1.K-1],1080.2,default,cell parameter -Separator thermal conductivity [W.m-1.K-1],0.334,default,cell parameter \ No newline at end of file diff --git a/pybamm/parameters/parameter_values.py b/pybamm/parameters/parameter_values.py index d02f18787c..98e3b4377e 100644 --- a/pybamm/parameters/parameter_values.py +++ b/pybamm/parameters/parameter_values.py @@ -6,12 +6,8 @@ import pandas as pd import os import numbers -import warnings from pprint import pformat from collections import defaultdict -import inspect -from textwrap import fill -import shutil class ParameterValues: @@ -61,16 +57,9 @@ def __init__(self, values, chemistry=None): ) if isinstance(values, dict): - if "negative electrode" in values: - warnings.warn( - "Creating a parameter set from a dictionary of components has " - "been deprecated and will be removed in a future release. " - "Define the parameter set in a python script instead.", - DeprecationWarning, - ) - self.update_from_chemistry(values) - else: - self.update(values, check_already_exists=False) + # remove the "chemistry" key if it exists + values.pop("chemistry", None) + self.update(values, check_already_exists=False) else: # Check if values is a named parameter set if isinstance(values, str) and values in pybamm.parameter_sets: @@ -179,62 +168,6 @@ def search(self, key, print_values=True): """ return self._dict_items.search(key, print_values) - def update_from_chemistry(self, chemistry): - """ - Load standard set of components from a 'chemistry' dictionary - """ - self.chemistry = chemistry - - base_chemistry = chemistry["chemistry"] - - # Load each component name - - component_groups = [ - "cell", - "negative electrode", - "positive electrode", - "separator", - "electrolyte", - "experiment", - ] - - self.component_params_by_group = {} - - # add SEI parameters if provided - for extra_group in ["sei", "lithium plating"]: - if extra_group in chemistry: - component_groups = [extra_group] + component_groups - - for component_group in component_groups: - component = chemistry[component_group] - # Create path to component and load values - component_path = os.path.join( - base_chemistry, - "testing_only", - component_group.replace(" ", "_") + "s", - component, - ) - file_path = self.find_parameter( - os.path.join(component_path, "parameters.csv") - ) - component_params = self.read_parameters_csv(file_path) - - self.component_params_by_group[component_group] = component_params - - # Update parameters, making sure to check any conflicts - self.update( - component_params, - check_conflict=True, - check_already_exists=False, - path=os.path.dirname(file_path), - ) - - # register (list of) citations - if "citation" in chemistry: - self.citations = chemistry["citation"] - if not isinstance(self.citations, list): - self.citations = [self.citations] - def read_parameters_csv(self, filename): """Reads parameters from csv file into dict. @@ -941,170 +874,3 @@ def find_parameter(path): "re-installing pybamm (e.g. `pip install -e .`) to expose recently-added " "parameter entry points." ) - - def export_python_script( - self, name, old_parameters_path="", new_parameters_path="" - ): - """ - Print a python script that can be used to reproduce the parameter set - - Parameters - ---------- - name : string - The name to save the parameter set under - old_parameters_path : string, optional - Optional path for the location where to find the old parameters. - new_parameters_path : string, optional - Optional path for the location where to save the new parameters. - """ - # Initialize - preamble = "import pybamm\n" - function_output = "" - data_output = "" - dict_output = "" - - component_params_by_group = getattr( - self, "component_params_by_group", {"": self} - ) - - # Loop through each component group and add appropriate functions, data, and - # parameters to the relevant strings - for component_group, items in component_params_by_group.items(): - if component_group != "": - dict_output += f"\n # {component_group}" - for k in items.keys(): - v = self[k] - if callable(v): - # write the function body to the file - function_output += inspect.getsource(v) + "\n" - v = v.__name__ - elif isinstance(v, tuple): - # save the data to a separate csv file - # and load it in the parameter set - data_name = v[0] - data_file_old = os.path.join( - old_parameters_path, - component_group.replace(" ", "_") + "s", - self.chemistry[component_group], - f"{data_name}.csv", - ) - data_path = os.path.join(new_parameters_path, "data") - if not os.path.exists(data_path): - os.makedirs(data_path) - data_file_new = os.path.join(data_path, f"{data_name}.csv") - shutil.copyfile(data_file_old, data_file_new) - - # add data output - if data_output == "": - data_output = ( - "# Load data in the appropriate format\n" - "path, _ = os.path.split(os.path.abspath(__file__))\n" - ) - data_output += ( - f"{data_name} = pybamm.parameters.process_1D_data" - f"('{data_name}.csv', path)\n" - ) - v = f"pybamm.{data_name}" - - v = f"{data_name}" - - # add line to the parameter output in the appropriate section - line_output = f'\n "{k}": {v},' - if len(line_output) > 88: - # this will be split into multiple lines by black - line_output = f'\n "{k}""": {v},' - - dict_output += line_output - - # save citation info - if hasattr(self, "citations"): - dict_output += ( - "\n # citations" + f"\n 'citations': {self.citations}," - ) - - # read README.md if they exist and save info - docstring = self._create_docstring_from_readmes(name) - - # construct the output string - output = ( - function_output - + data_output - + "\n# Call dict via a function to avoid errors when editing in place" - + "\ndef get_parameter_values():" - + docstring - + "\n return {" - + dict_output - + "\n }" - ) - - # Add more packages to preamble if needed - if "os." in output: - preamble += "import os\n" - output = preamble + "\n\n" + output - - # Add pybamm. to functions that didn't have it in function body before - for funcname in [ - "Parameter", - "exp", - "tanh", - "cosh", - "log10", - "LeadAcidParameters", - ]: - # add space or ( before so it doesn't do this for middle-of-word matches - output = output.replace(f" {funcname}(", f" pybamm.{funcname}(") - output = output.replace(f"({funcname}(", f"(pybamm.{funcname}(") - output = output.replace("constants", "pybamm.constants") - - # Process file name - filename = name - if not filename.endswith(".py"): - filename = filename + ".py" - filename = os.path.join(new_parameters_path, filename) - - # save to file - with open(filename, "w") as f: - f.write(output) - - def _create_docstring_from_readmes(self, name): - docstring = "" - - if hasattr(self, "chemistry"): - chemistry = self.chemistry - lines = [] - for component_group, component in chemistry.items(): - if component_group in self.component_params_by_group: - readme = os.path.join( - "input", - "parameters", - self.chemistry["chemistry"], - "testing_only", - component_group.replace(" ", "_") + "s", - component, - "README.md", - ) - readme = pybamm.get_parameters_filepath(readme) - if os.path.isfile(readme): - with open(readme, "r") as f: - lines += f.readlines() - - # lines, ind = np.unique(lines, return_index=True) - # lines = lines[np.argsort(ind)] - lines = [ - fill( - line, - 88, - drop_whitespace=False, - initial_indent=" ", - subsequent_indent=" ", - ) - + "\n" - for line in lines - ] - docstring = ( - f'\n """\n # {name} parameter set\n' - + "".join(lines) - + ' """\n' - ) - - return docstring diff --git a/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/parameters.csv b/tests/unit/test_parameters/parameter_values_test.csv similarity index 77% rename from pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/parameters.csv rename to tests/unit/test_parameters/parameter_values_test.csv index 05759d0319..3ee7a84a50 100644 --- a/pybamm/input/parameters/lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/parameters.csv +++ b/tests/unit/test_parameters/parameter_values_test.csv @@ -4,8 +4,8 @@ Name [units],Value,Reference,Notes # Electrode properties,,, Positive electrode conductivity [S.m-1],10,Ai 2020,lithium cobalt oxide Maximum concentration in positive electrode [mol.m-3],49943,Ai 2020, -Positive electrode diffusivity [m2.s-1],[function]lico2_diffusivity_Dualfoil1998,, -Positive electrode OCP [V],[data]lico2_ocp_Ai2020,, +# Positive electrode diffusivity [m2.s-1],[function]lico2_diffusivity_Dualfoil1998,, +# Positive electrode OCP [V],[data]lico2_ocp_Ai2020,, ,,, # Microstructure,,, Positive electrode porosity,0.32,Ai 2020,electrolyte volume fraction @@ -18,7 +18,7 @@ Positive electrode Bruggeman coefficient (electrode),0,Ai 2020, # Interfacial reactions,,, Positive electrode charge transfer coefficient,0.5,Ai 2020, Positive electrode double-layer capacity [F.m-2],0.2,,guess -Positive electrode exchange-current density [A.m-2],[function]lico2_electrolyte_exchange_current_density_Dualfoil1998,, +# Positive electrode exchange-current density [A.m-2],[function]lico2_electrolyte_exchange_current_density_Dualfoil1998,, ,,, # Density,,, Positive electrode density [kg.m-3],2470,, @@ -26,7 +26,7 @@ Positive electrode density [kg.m-3],2470,, # Thermal parameters,,, Positive electrode specific heat capacity [J.kg-1.K-1],1080.2,, Positive electrode thermal conductivity [W.m-1.K-1],1.58,, -Positive electrode OCP entropic change [V.K-1],[function]lico2_entropic_change_Ai2020_function,, +# Positive electrode OCP entropic change [V.K-1],[function]lico2_entropic_change_Ai2020_function,, # Positive electrode OCP entropic change [V.K-1],0,, ,,, # mechanical properties,,, @@ -34,7 +34,7 @@ Positive electrode Poisson's ratio,0.2,, Positive electrode Young's modulus [Pa],375e9,, Positive electrode reference concentration for free of deformation [mol.m-3],0,, Positive electrode partial molar volume [m3.mol-1],-7.28e-7,, -Positive electrode volume change,[function]lico2_volume_change_Ai2020,Ai 2020, +# Positive electrode volume change,[function]lico2_volume_change_Ai2020,Ai 2020, ,,, # Crack model,,, Positive electrode initial crack length [m],20e-9,, @@ -42,10 +42,10 @@ Positive electrode initial crack width [m],15e-9,, Positive electrode number of cracks per unit area [m-2],3.18e15,, Positive electrode Paris' law constant b,1.12,, Positive electrode Paris' law constant m,2.2,, -Positive electrode cracking rate,[function]lico2_cracking_rate_Ai2020,, +# Positive electrode cracking rate,[function]lico2_cracking_rate_Ai2020,, Positive electrode activation energy for cracking rate [J.mol-1],0,, ,,, # Loss of active materials (LAM) model,,, Positive electrode LAM constant proportional term [s-1],2.78e-13,, Positive electrode LAM constant exponential term,2,, -Positive electrode critical stress [Pa],375e6,, +Positive electrode critical stress [Pa],375e6,, \ No newline at end of file diff --git a/tests/unit/test_parameters/test_parameter_values.py b/tests/unit/test_parameters/test_parameter_values.py index db9f8b303f..a33c9382e9 100644 --- a/tests/unit/test_parameters/test_parameter_values.py +++ b/tests/unit/test_parameters/test_parameter_values.py @@ -5,10 +5,7 @@ import os import tempfile -import shutil import unittest -import inspect -import importlib import numpy as np import pandas as pd @@ -36,15 +33,8 @@ def test_find_parameter(self): def test_read_parameters_csv(self): data = pybamm.ParameterValues({}).read_parameters_csv( os.path.join( - pybamm.root_dir(), - "pybamm", - "input", - "parameters", - "lithium_ion", - "testing_only", - "positive_electrodes", - "lico2_Ai2020", - "parameters.csv", + os.path.dirname(__file__), + "parameter_values_test.csv", ) ) self.assertEqual(data["Positive electrode porosity"], "0.32") @@ -58,22 +48,18 @@ def test_init(self): # from file param = pybamm.ParameterValues( - "lithium_ion/testing_only/positive_electrodes/lico2_Ai2020/parameters.csv" + os.path.join( + os.path.dirname(__file__), + "parameter_values_test.csv", + ) ) self.assertEqual(param["Positive electrode porosity"], 0.32) # from file, absolute path param = pybamm.ParameterValues( os.path.join( - pybamm.root_dir(), - "pybamm", - "input", - "parameters", - "lithium_ion", - "testing_only", - "positive_electrodes", - "lico2_Ai2020", - "parameters.csv", + os.path.dirname(__file__), + "parameter_values_test.csv", ) ) self.assertEqual(param["Positive electrode porosity"], 0.32) @@ -111,13 +97,6 @@ def test_eq(self): ) def test_update(self): - # converts to dict if not - param = pybamm.ParameterValues("Ai2020") - param_from_csv = pybamm.ParameterValues( - "lithium_ion/testing_only/" - "negative_electrodes/graphite_Ai2020/parameters.csv" - ) - param.update(param_from_csv) # equate values param = pybamm.ParameterValues({"a": 1}) self.assertEqual(param["a"], 1) @@ -1008,70 +987,6 @@ def some_function(self): self.assertEqual(df[1]["b"], "[function]some_function") self.assertEqual(df[1]["c"], "[data]some_data") - def test_export_python_script(self): - parameter_values = pybamm.ParameterValues( - { - "chemistry": "lithium_ion", - "cell": "Enertech_Ai2020", - "negative electrode": "graphite_Ai2020", - "separator": "separator_Ai2020", - "positive electrode": "lico2_Ai2020", - "electrolyte": "lipf6_Enertech_Ai2020", - "experiment": "1C_discharge_from_full_Ai2020", - "sei": "example", - "citation": "Ai2019", - } - ) - parameter_values.export_python_script( - "Ai2020_test", - old_parameters_path=os.path.join( - pybamm.root_dir(), - "pybamm", - "input", - "parameters", - "lithium_ion", - "testing_only", - ), - ) - - # test that loading the parameter set works - module = importlib.import_module("Ai2020_test") - function = getattr(module, "get_parameter_values") - new_parameter_values = pybamm.ParameterValues(function()) - - # Parameters should be the same - self.assertEqual( - new_parameter_values["Negative particle radius [m]"], - parameter_values["Negative particle radius [m]"], - ) - - # Functions should be the same, except without 'pybamm.' - self.assertEqual( - inspect.getsource( - new_parameter_values[ - "Negative electrode exchange-current density [A.m-2]" - ] - ).replace(" pybamm.", " "), - inspect.getsource( - parameter_values["Negative electrode exchange-current density [A.m-2]"] - ), - ) - # Data should be the same - np.testing.assert_array_equal( - new_parameter_values["Negative electrode OCP [V]"][1][0], - parameter_values["Negative electrode OCP [V]"][1][0], - ) - np.testing.assert_array_equal( - new_parameter_values["Negative electrode OCP [V]"][1][1], - parameter_values["Negative electrode OCP [V]"][1][1], - ) - - # remove the file - filename = os.path.join("Ai2020_test.py") - if os.path.exists(filename): - os.remove(filename) - shutil.rmtree("data") - if __name__ == "__main__": print("Add -v for more debug output") From d9e9c6cb9e68a18c3c52c9694ca54485811f6854 Mon Sep 17 00:00:00 2001 From: Valentin Sulzer Date: Tue, 16 May 2023 13:10:19 -0400 Subject: [PATCH 2/7] remove some outdated parameter functionality --- docs/source/api/util.rst | 4 - pybamm/__init__.py | 2 - pybamm/parameters/parameter_values.py | 103 +++--------------- pybamm/util.py | 61 ----------- .../test_parameters/parameter_values_test.csv | 51 --------- .../test_Landesfeind2019.py | 90 --------------- .../test_parameters/test_parameter_values.py | 47 -------- tests/unit/test_util.py | 21 ---- 8 files changed, 16 insertions(+), 363 deletions(-) delete mode 100644 tests/unit/test_parameters/parameter_values_test.csv delete mode 100644 tests/unit/test_parameters/test_parameter_sets/test_Landesfeind2019.py diff --git a/docs/source/api/util.rst b/docs/source/api/util.rst index 384cf759f3..03e7388e3e 100644 --- a/docs/source/api/util.rst +++ b/docs/source/api/util.rst @@ -16,12 +16,8 @@ Utility functions .. autoclass:: pybamm.FuzzyDict :members: -.. autofunction:: pybamm.load_function - .. autofunction:: pybamm.load -.. autofunction:: pybamm.get_parameters_filepath - .. autofunction:: pybamm.install_jax .. autofunction:: pybamm.have_jax diff --git a/pybamm/__init__.py b/pybamm/__init__.py index b796b4ff0a..ffaeeb036d 100644 --- a/pybamm/__init__.py +++ b/pybamm/__init__.py @@ -39,13 +39,11 @@ from .util import Timer, TimerTime, FuzzyDict from .util import ( root_dir, - load_function, rmse, load, is_constant_and_can_evaluate, ) from .util import ( - get_parameters_filepath, have_jax, install_jax, is_jax_compatible, diff --git a/pybamm/parameters/parameter_values.py b/pybamm/parameters/parameter_values.py index af8d528d63..df0856f49f 100644 --- a/pybamm/parameters/parameter_values.py +++ b/pybamm/parameters/parameter_values.py @@ -3,8 +3,6 @@ # import numpy as np import pybamm -import pandas as pd -import os import numbers from pprint import pformat from collections import defaultdict @@ -20,9 +18,9 @@ class ParameterValues: Parameters ---------- values : dict or string - Explicit set of parameters, or reference to a file of parameters + Explicit set of parameters, or reference to an inbuilt parameter set If string and matches one of the inbuilt parameter sets, returns that parameter - set. If non-matching string, gets passed to read_parameters_csv to read a file. + set. Examples -------- @@ -67,13 +65,6 @@ def __init__(self, values, chemistry=None): values.pop("chemistry", None) self.update(values, check_already_exists=False) - else: - # In this case it might be a filename, load from that filename - file_path = self.find_parameter(values) - path = os.path.split(file_path)[0] - values = self.read_parameters_csv(file_path) - self.update(values, check_already_exists=False, path=path) - # Initialise empty _processed_symbols dict (for caching) self._processed_symbols = {} @@ -168,25 +159,6 @@ def search(self, key, print_values=True): """ return self._dict_items.search(key, print_values) - def read_parameters_csv(self, filename): - """Reads parameters from csv file into dict. - - Parameters - ---------- - filename : str - The name of the csv file containing the parameters. - - Returns - ------- - dict - {name: value} pairs for the parameters. - - """ - df = pd.read_csv(filename, comment="#", skip_blank_lines=True) - # Drop rows that are all NaN (seems to not work with skip_blank_lines) - df.dropna(how="all", inplace=True) - return {k: v for (k, v) in zip(df["Name [units]"], df["Value"])} - def update(self, values, check_conflict=False, check_already_exists=True, path=""): """ Update parameter dictionary, while also performing some basic checks. @@ -237,29 +209,21 @@ def update(self, values, check_conflict=False, check_already_exists=True, path=" + "sure you want to update this parameter, use " + "param.update({{name: value}}, check_already_exists=False)" ) - # if no conflicts, update, loading functions and data if they are specified - # Functions are flagged with the string "[function]" + # if no conflicts, update if isinstance(value, str): - if value.startswith("[function]"): - loaded_value = pybamm.load_function(os.path.join(path, value[10:])) - self._dict_items[name] = loaded_value - # Data is flagged with the string "[data]" or "[current data]" - elif value.startswith("[current data]") or value.startswith("[data]"): - if value.startswith("[current data]"): - data_path = os.path.join( - pybamm.root_dir(), "pybamm", "input", "drive_cycles" - ) - filename = os.path.join(data_path, value[14:] + ".csv") - else: - filename = os.path.join(path, value[6:] + ".csv") - filename = pybamm.get_parameters_filepath(filename) - # Save name and data - self._dict_items[name] = pybamm.parameters.process_1D_data(filename) - # parse 2D parameter data - elif value.startswith("[2D data]"): - filename = os.path.join(path, value[9:] + ".json") - filename = pybamm.get_parameters_filepath(filename) - self._dict_items[name] = pybamm.parameters.process_2D_data(filename) + if ( + value.startswith("[function]") + or value.startswith("[current data]") + or value.startswith("[data]") + or value.startswith("[2D data]") + ): + raise ValueError( + "Specifying parameters via [function], [current data], [data] " + "or [2D data] is no longer supported. For functions, pass in a " + "python function object. For data, pass in a python function " + "that returns a pybamm Interpolant object. " + "See https://tinyurl.com/merv43ss for an example with both." + ) elif value == "[input]": self._dict_items[name] = pybamm.InputParameter(name) @@ -719,21 +683,6 @@ def evaluate(self, symbol): def _ipython_key_completions_(self): return list(self._dict_items.keys()) - def export_csv(self, filename): - # process functions and data to output - # like they appear in inputs csv files - parameter_output = {} - for key, val in self.items(): - if callable(val): - val = "[function]" + val.__name__ - elif isinstance(val, tuple): - val = "[data]" + val[0] - parameter_output[key] = [val] - - df = pd.DataFrame(parameter_output) - df = df.transpose() - df.to_csv(filename, header=["Value"], index_label="Name [units]") - def print_parameters(self, parameters, output_file=None): """ Return dictionary of evaluated parameters, and optionally print these evaluated @@ -854,23 +803,3 @@ def print_evaluated_parameters(self, evaluated_parameters, output_file): file.write((s + " : {:10.4g}\n").format(name, value)) else: file.write((s + " : {:10.3E}\n").format(name, value)) - - @staticmethod - def find_parameter(path): - """Look for parameter file in the different locations - in PARAMETER_PATH - """ - # Check for absolute path - if os.path.isfile(path) and os.path.isabs(path): - pybamm.logger.verbose(f"Using absolute path: '{path}'") - return path - for location in pybamm.PARAMETER_PATH: - trial_path = os.path.join(location, path) - if os.path.isfile(trial_path): - pybamm.logger.verbose(f"Using path: '{location}' + '{path}'") - return trial_path - raise FileNotFoundError( - f"Could not find parameter {path}. If you have a developer install, try " - "re-installing pybamm (e.g. `pip install -e .`) to expose recently-added " - "parameter entry points." - ) diff --git a/pybamm/util.py b/pybamm/util.py index c91e1d0707..4e541c3325 100644 --- a/pybamm/util.py +++ b/pybamm/util.py @@ -221,67 +221,6 @@ def __eq__(self, other): return self.value == other.value -def load_function(filename, funcname=None): - """ - Load a python function from an absolute or relative path using `importlib`. - Example - pybamm.load_function("pybamm/input/example.py") - - Arguments - --------- - filename : str - The path of the file containing the function. - funcname : str, optional - The name of the function in the file. If None, assumed to be the same as the - filename (ignoring the path) - - Returns - ------- - function - The python function loaded from the file. - """ - # Remove `.py` from the file name - if filename.endswith(".py"): - filename = filename.replace(".py", "") - - if funcname is None: - # Read funcname by splitting the file (assumes funcname is the same as filename) - _, funcname = os.path.split(filename) - - # Store the current working directory - orig_dir = os.getcwd() - - # Strip absolute path to pybamm/input/example.py - if "pybamm/input/parameters" in filename or "pybamm\\input\\parameters" in filename: - root_path = filename[filename.rfind("pybamm") :] - # If the function is in the current working directory - elif os.getcwd() in filename: # pragma: no cover - root_path = filename.replace(os.getcwd(), "") - # If the function is not in the current working directory and the path provided is - # absolute - elif os.path.isabs(filename) and os.getcwd() not in filename: # pragma: no cover - # Change directory to import the function - dir_path = os.path.split(filename)[0] - os.chdir(dir_path) - root_path = filename.replace(os.getcwd(), "") - else: # pragma: no cover - root_path = filename - - # getcwd() returns "C:\\" when in the root drive and "C:\\a\\b\\c" otherwise - if root_path[0] == "\\" or root_path[0] == "/": # pragma: no cover - root_path = root_path[1:] - - path = root_path.replace("/", ".") - path = path.replace("\\", ".") - pybamm.logger.debug( - f"Importing function '{funcname}' from file '{filename}' via path '{path}'" - ) - module_object = importlib.import_module(path) - - # Revert back current working directory if it was changed - os.chdir(orig_dir) - return getattr(module_object, funcname) - - def rmse(x, y): """ Calculate the root-mean-square-error between two vectors x and y, ignoring NaNs diff --git a/tests/unit/test_parameters/parameter_values_test.csv b/tests/unit/test_parameters/parameter_values_test.csv deleted file mode 100644 index 3ee7a84a50..0000000000 --- a/tests/unit/test_parameters/parameter_values_test.csv +++ /dev/null @@ -1,51 +0,0 @@ -Name [units],Value,Reference,Notes -# Empty rows and rows starting with ‘#’ will be ignored,,, -,,, -# Electrode properties,,, -Positive electrode conductivity [S.m-1],10,Ai 2020,lithium cobalt oxide -Maximum concentration in positive electrode [mol.m-3],49943,Ai 2020, -# Positive electrode diffusivity [m2.s-1],[function]lico2_diffusivity_Dualfoil1998,, -# Positive electrode OCP [V],[data]lico2_ocp_Ai2020,, -,,, -# Microstructure,,, -Positive electrode porosity,0.32,Ai 2020,electrolyte volume fraction -Positive electrode active material volume fraction,0.62,,assuming zero binder volume fraction -Positive particle radius [m],3E-06,Ai 2020, -Positive electrode surface area to volume ratio [m-1],620000,Ai 2020, -Positive electrode Bruggeman coefficient (electrolyte),1.83,Ai 2020, -Positive electrode Bruggeman coefficient (electrode),0,Ai 2020, -,,, -# Interfacial reactions,,, -Positive electrode charge transfer coefficient,0.5,Ai 2020, -Positive electrode double-layer capacity [F.m-2],0.2,,guess -# Positive electrode exchange-current density [A.m-2],[function]lico2_electrolyte_exchange_current_density_Dualfoil1998,, -,,, -# Density,,, -Positive electrode density [kg.m-3],2470,, -,,, -# Thermal parameters,,, -Positive electrode specific heat capacity [J.kg-1.K-1],1080.2,, -Positive electrode thermal conductivity [W.m-1.K-1],1.58,, -# Positive electrode OCP entropic change [V.K-1],[function]lico2_entropic_change_Ai2020_function,, -# Positive electrode OCP entropic change [V.K-1],0,, -,,, -# mechanical properties,,, -Positive electrode Poisson's ratio,0.2,, -Positive electrode Young's modulus [Pa],375e9,, -Positive electrode reference concentration for free of deformation [mol.m-3],0,, -Positive electrode partial molar volume [m3.mol-1],-7.28e-7,, -# Positive electrode volume change,[function]lico2_volume_change_Ai2020,Ai 2020, -,,, -# Crack model,,, -Positive electrode initial crack length [m],20e-9,, -Positive electrode initial crack width [m],15e-9,, -Positive electrode number of cracks per unit area [m-2],3.18e15,, -Positive electrode Paris' law constant b,1.12,, -Positive electrode Paris' law constant m,2.2,, -# Positive electrode cracking rate,[function]lico2_cracking_rate_Ai2020,, -Positive electrode activation energy for cracking rate [J.mol-1],0,, -,,, -# Loss of active materials (LAM) model,,, -Positive electrode LAM constant proportional term [s-1],2.78e-13,, -Positive electrode LAM constant exponential term,2,, -Positive electrode critical stress [Pa],375e6,, \ No newline at end of file diff --git a/tests/unit/test_parameters/test_parameter_sets/test_Landesfeind2019.py b/tests/unit/test_parameters/test_parameter_sets/test_Landesfeind2019.py deleted file mode 100644 index e85bc81b18..0000000000 --- a/tests/unit/test_parameters/test_parameter_sets/test_Landesfeind2019.py +++ /dev/null @@ -1,90 +0,0 @@ -# -# Tests for Landesfeind (2019) electrolytes parameter set loads -# -from tests import TestCase -import pybamm -import unittest -import os - - -class TestLandesfeind(TestCase): - def test_load_params(self): - data_D_e = { - "EC_DMC_1_1": [1.94664e-10, 1.94233e-10], - "EC_EMC_3_7": [2.01038e-10, 1.78391e-10], - "EMC_FEC_19_1": [2.16871e-10, 1.8992e-10], - } - data_sigma_e = { - "EC_DMC_1_1": [0.870352, 0.839076], - "EC_EMC_3_7": [0.695252, 0.668677], - "EMC_FEC_19_1": [0.454054, 0.632419], - } - data_TDF = { - "EC_DMC_1_1": [1.84644, 4.16915], - "EC_EMC_3_7": [1.82671, 3.9218], - "EMC_FEC_19_1": [0.92532, 3.22481], - } - data_tplus = { - "EC_DMC_1_1": [0.17651, 0.241924], - "EC_EMC_3_7": [0.0118815, 0.151879], - "EMC_FEC_19_1": [-0.0653014, 0.0416203], - } - - T = [273.15 + 10.0, 273.15 + 30.0] - c = [1000.0, 2000.0] - - for solvent in ["EC_DMC_1_1", "EC_EMC_3_7", "EMC_FEC_19_1"]: - root = pybamm.root_dir() - p = ( - "pybamm/input/parameters/lithium_ion/testing_only/electrolytes/lipf6_" - + solvent - + "_Landesfeind2019/" - ) - k_path = os.path.join(root, p) - - sigma_e = pybamm.load_function( - os.path.join( - k_path, - "electrolyte_conductivity_" + solvent + "_Landesfeind2019.py", - ) - ) - D_e = pybamm.load_function( - os.path.join( - k_path, "electrolyte_diffusivity_" + solvent + "_Landesfeind2019.py" - ) - ) - TDF = pybamm.load_function( - os.path.join( - k_path, "electrolyte_TDF_" + solvent + "_Landesfeind2019.py" - ) - ) - tplus = pybamm.load_function( - os.path.join( - k_path, - "electrolyte_transference_number_" - + solvent - + "_Landesfeind2019.py", - ) - ) - - for i, _ in enumerate(T): - self.assertAlmostEqual( - sigma_e(c[i], T[i]).value, data_sigma_e[solvent][i], places=5 - ) - self.assertAlmostEqual( - D_e(c[i], T[i]).value, data_D_e[solvent][i], places=5 - ) - self.assertAlmostEqual(TDF(c[i], T[i]), data_TDF[solvent][i], places=5) - self.assertAlmostEqual( - tplus(c[i], T[i]), data_tplus[solvent][i], places=5 - ) - - -if __name__ == "__main__": - print("Add -v for more debug output") - import sys - - if "-v" in sys.argv: - debug = True - pybamm.settings.debug_mode = True - unittest.main() diff --git a/tests/unit/test_parameters/test_parameter_values.py b/tests/unit/test_parameters/test_parameter_values.py index 347df95795..dff29ba19e 100644 --- a/tests/unit/test_parameters/test_parameter_values.py +++ b/tests/unit/test_parameters/test_parameter_values.py @@ -30,15 +30,6 @@ def test_find_parameter(self): with self.assertRaisesRegex(FileNotFoundError, "Could not find parameter"): pybamm.ParameterValues.find_parameter("not_a_file") - def test_read_parameters_csv(self): - data = pybamm.ParameterValues({}).read_parameters_csv( - os.path.join( - os.path.dirname(__file__), - "parameter_values_test.csv", - ) - ) - self.assertEqual(data["Positive electrode porosity"], "0.32") - def test_init(self): # from dict param = pybamm.ParameterValues({"a": 1}) @@ -50,24 +41,6 @@ def test_init(self): param = pybamm.ParameterValues({"a": 1, "chemistry": "lithium-ion"}) self.assertNotIn("chemistry", param.keys()) - # from file - param = pybamm.ParameterValues( - os.path.join( - os.path.dirname(__file__), - "parameter_values_test.csv", - ) - ) - self.assertEqual(param["Positive electrode porosity"], 0.32) - - # from file, absolute path - param = pybamm.ParameterValues( - os.path.join( - os.path.dirname(__file__), - "parameter_values_test.csv", - ) - ) - self.assertEqual(param["Positive electrode porosity"], 0.32) - # chemistry kwarg removed with self.assertRaisesRegex( ValueError, "'chemistry' keyword argument has been deprecated" @@ -971,26 +944,6 @@ def test_evaluate(self): with self.assertRaises(ValueError): parameter_values.evaluate(y) - def test_export_csv(self): - def some_function(self): - return None - - example_data = ("some_data", [0, 1, 2]) - - parameter_values = pybamm.ParameterValues( - {"a": 0.1, "b": some_function, "c": example_data} - ) - - filename = "parameter_values_test.csv" - - parameter_values.export_csv(filename) - - df = pd.read_csv(filename, index_col=0, header=None) - - self.assertEqual(df[1]["a"], "0.1") - self.assertEqual(df[1]["b"], "[function]some_function") - self.assertEqual(df[1]["c"], "[data]some_data") - if __name__ == "__main__": print("Add -v for more debug output") diff --git a/tests/unit/test_util.py b/tests/unit/test_util.py index 25585d759b..020f0dc1ef 100644 --- a/tests/unit/test_util.py +++ b/tests/unit/test_util.py @@ -17,27 +17,6 @@ class TestUtil(TestCase): Test the functionality in util.py """ - def test_load_function(self): - function = "graphite_LGM50_electrolyte_exchange_current_density_Chen2020" - - # Test function load with relative path - rel_test_path = os.path.join( - "pybamm", "input", "parameters", "lithium_ion", "Chen2020" - ) - func = pybamm.load_function(rel_test_path, function) - self.assertEqual( - func, - pybamm.input.parameters.lithium_ion.Chen2020.graphite_LGM50_electrolyte_exchange_current_density_Chen2020, # noqa - ) - - # Test function load with absolute path - abs_test_path = os.path.join(pybamm.root_dir(), rel_test_path) - func = pybamm.load_function(abs_test_path, function) - self.assertEqual( - func, - pybamm.input.parameters.lithium_ion.Chen2020.graphite_LGM50_electrolyte_exchange_current_density_Chen2020, # noqa - ) - def test_rmse(self): self.assertEqual(pybamm.rmse(np.ones(5), np.zeros(5)), 1) self.assertEqual(pybamm.rmse(2 * np.ones(5), np.zeros(5)), 2) From a8ecdd6ab2c528b88cd86c2bb69d9a0d828d5aaa Mon Sep 17 00:00:00 2001 From: Valentin Sulzer Date: Thu, 18 May 2023 19:56:42 -0400 Subject: [PATCH 3/7] #2901 fix unit tests --- pybamm/__init__.py | 1 + .../test_parameters/lico2_ocv_example.csv | 0 .../test_parameters/test_current_functions.py | 16 +++++-- .../test_parameter_sets/test_Ai2020.py | 19 -------- .../test_parameters/test_parameter_values.py | 47 +++++++++---------- 5 files changed, 35 insertions(+), 48 deletions(-) rename pybamm/input/parameters/lithium_ion/data/lico2_data_example.csv => tests/unit/test_parameters/lico2_ocv_example.csv (100%) diff --git a/pybamm/__init__.py b/pybamm/__init__.py index ffaeeb036d..31c69141f5 100644 --- a/pybamm/__init__.py +++ b/pybamm/__init__.py @@ -44,6 +44,7 @@ is_constant_and_can_evaluate, ) from .util import ( + get_parameters_filepath, have_jax, install_jax, is_jax_compatible, diff --git a/pybamm/input/parameters/lithium_ion/data/lico2_data_example.csv b/tests/unit/test_parameters/lico2_ocv_example.csv similarity index 100% rename from pybamm/input/parameters/lithium_ion/data/lico2_data_example.csv rename to tests/unit/test_parameters/lico2_ocv_example.csv diff --git a/tests/unit/test_parameters/test_current_functions.py b/tests/unit/test_parameters/test_current_functions.py index aba384b31b..d8bac9cc58 100644 --- a/tests/unit/test_parameters/test_current_functions.py +++ b/tests/unit/test_parameters/test_current_functions.py @@ -6,6 +6,8 @@ import numbers import unittest import numpy as np +import os +import pandas as pd class TestCurrentFunctions(TestCase): @@ -19,12 +21,18 @@ def test_constant_current(self): def test_get_current_data(self): # test process parameters - param = pybamm.electrical_parameters - current = param.current_with_time + current_data = pd.read_csv( + os.path.join(pybamm.__path__[0], "input", "drive_cycles", "US06.csv"), + comment="#", + names=["Time [s]", "Current [A]"], + ) + t, I = current_data["Time [s]"].values, current_data["Current [A]"].values parameter_values = pybamm.ParameterValues( - {"Current function [A]": "[current data]car_current"} + {"Current function [A]": pybamm.Interpolant(t, I, pybamm.t, "US06")} + ) + current_eval = parameter_values.process_symbol( + pybamm.electrical_parameters.current_with_time ) - current_eval = parameter_values.process_symbol(current) def current(t): return current_eval.evaluate(t=t) 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 a31d5ae909..43eee82175 100644 --- a/tests/unit/test_parameters/test_parameter_sets/test_Ai2020.py +++ b/tests/unit/test_parameters/test_parameter_sets/test_Ai2020.py @@ -46,25 +46,6 @@ def test_functions(self): param.evaluate(param[name](*value[0])), value[1], places=4 ) - def test_standard_lithium_parameters(self): - # test with chemistry dictionary format, for coverage - parameter_values = pybamm.ParameterValues( - { - "chemistry": "lithium_ion", - "cell": "Enertech_Ai2020", - "negative electrode": "graphite_Ai2020", - "separator": "separator_Ai2020", - "positive electrode": "lico2_Ai2020", - "electrolyte": "lipf6_Enertech_Ai2020", - "experiment": "1C_discharge_from_full_Ai2020", - "sei": "example", - "citation": "Ai2019", - } - ) - options = {"particle mechanics": "swelling and cracking"} - model = pybamm.lithium_ion.DFN(options) - parameter_values.process_model(model) - if __name__ == "__main__": print("Add -v for more debug output") diff --git a/tests/unit/test_parameters/test_parameter_values.py b/tests/unit/test_parameters/test_parameter_values.py index dff29ba19e..5ddfa34f08 100644 --- a/tests/unit/test_parameters/test_parameter_values.py +++ b/tests/unit/test_parameters/test_parameter_values.py @@ -4,7 +4,6 @@ from tests import TestCase import os -import tempfile import unittest import numpy as np @@ -20,16 +19,6 @@ class TestParameterValues(TestCase): - def test_find_parameter(self): - f = tempfile.NamedTemporaryFile() - pybamm.PARAMETER_PATH.append(tempfile.gettempdir()) - - tempfile_name = os.path.basename(f.name) - self.assertEqual(pybamm.ParameterValues.find_parameter(tempfile_name), f.name) - - with self.assertRaisesRegex(FileNotFoundError, "Could not find parameter"): - pybamm.ParameterValues.find_parameter("not_a_file") - def test_init(self): # from dict param = pybamm.ParameterValues({"a": 1}) @@ -532,17 +521,18 @@ def test_process_interpolant_2d(self): def test_interpolant_against_function(self): parameter_values = pybamm.ParameterValues({"function": lico2_ocp_Dualfoil1998}) + # path is parent dir of this file + path = os.path.abspath(os.path.dirname(__file__)) + lico2_ocv_example_data = pybamm.parameters.process_1D_data( + "lico2_ocv_example.csv", path=path + ) + + def lico2_ocv_example(sto): + name, (x, y) = lico2_ocv_example_data + return pybamm.Interpolant(x, y, [sto], name=name) + parameter_values.update( - {"interpolation": "[data]lico2_data_example"}, - path=os.path.join( - pybamm.root_dir(), - "pybamm", - "input", - "parameters", - "lithium_ion", - "data", - ), - check_already_exists=False, + {"interpolation": lico2_ocv_example}, check_already_exists=False ) a = pybamm.Scalar(0.6) @@ -559,11 +549,18 @@ def test_interpolant_2d_from_json(self): parameter_values = pybamm.ParameterValues( {"function": lico2_diffusivity_Dualfoil1998} ) + # path is parent dir of this file + path = os.path.abspath(os.path.dirname(__file__)) + lico2_diffusivity_Dualfoil1998_2D_data = pybamm.parameters.process_2D_data( + "lico2_diffusivity_Dualfoil1998_2D.json", path=path + ) + + def lico2_diffusivity_Dualfoil1998_2D(c_s, T): + name, (xs, y) = lico2_diffusivity_Dualfoil1998_2D_data + return pybamm.Interpolant(xs, y, [c_s, T], name=name) + parameter_values.update( - { - "interpolation": "[2D data]lico2_diffusivity_Dualfoil1998_2D", - }, - path=os.path.join(pybamm.root_dir(), "tests", "unit", "test_parameters"), + {"interpolation": lico2_diffusivity_Dualfoil1998_2D}, check_already_exists=False, ) From bd32668687e07ed5541f10f357982b2241bcb30e Mon Sep 17 00:00:00 2001 From: Valentin Sulzer Date: Fri, 19 May 2023 09:44:54 -0400 Subject: [PATCH 4/7] #2901 tests --- .../test_parameters/test_process_parameter_data.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/tests/unit/test_parameters/test_process_parameter_data.py b/tests/unit/test_parameters/test_process_parameter_data.py index 64676787df..22f83a6bdb 100644 --- a/tests/unit/test_parameters/test_process_parameter_data.py +++ b/tests/unit/test_parameters/test_process_parameter_data.py @@ -12,15 +12,8 @@ class TestProcessParameterData(TestCase): def test_process_1D_data(self): - name = "lico2_data_example" - path = os.path.join( - pybamm.root_dir(), - "pybamm", - "input", - "parameters", - "lithium_ion", - "data", - ) + name = "lico2_ocv_example" + path = os.path.join(pybamm.root_dir(), "tests", "unit", "test_parameters") processed = pybamm.parameters.process_1D_data(name, path) self.assertEqual(processed[0], name) self.assertIsInstance(processed[1], tuple) From 25ddb12b235b957d9f552f5e99a78058bce4a49b Mon Sep 17 00:00:00 2001 From: Valentin Sulzer Date: Fri, 19 May 2023 15:35:51 -0400 Subject: [PATCH 5/7] #2901 coverage --- pybamm/parameters/parameter_values.py | 15 +++++++-------- .../unit/test_parameters/test_parameter_values.py | 13 +++++++++++++ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/pybamm/parameters/parameter_values.py b/pybamm/parameters/parameter_values.py index df0856f49f..b3185d4af2 100644 --- a/pybamm/parameters/parameter_values.py +++ b/pybamm/parameters/parameter_values.py @@ -54,7 +54,7 @@ def __init__(self, values, chemistry=None): } ) - if isinstance(values, dict): + if isinstance(values, (dict, ParameterValues)): # remove the "chemistry" key if it exists values.pop("chemistry", None) self.update(values, check_already_exists=False) @@ -69,13 +69,9 @@ def __init__(self, values, chemistry=None): self._processed_symbols = {} # save citations - citations = [] - if hasattr(self, "citations"): - citations = self.citations - elif "citations" in self._dict_items: - citations = self._dict_items["citations"] - for citation in citations: - pybamm.citations.register(citation) + if "citations" in self._dict_items: + for citation in self._dict_items["citations"]: + pybamm.citations.register(citation) @staticmethod def create_from_bpx(filename, target_soc=1): @@ -145,6 +141,9 @@ def items(self): """Get the items of the dictionary""" return self._dict_items.items() + def pop(self, *args, **kwargs): + self._dict_items.pop(*args, **kwargs) + def copy(self): """Returns a copy of the parameter values. Makes sure to copy the internal dictionary.""" diff --git a/tests/unit/test_parameters/test_parameter_values.py b/tests/unit/test_parameters/test_parameter_values.py index 5ddfa34f08..edcc00abb9 100644 --- a/tests/unit/test_parameters/test_parameter_values.py +++ b/tests/unit/test_parameters/test_parameter_values.py @@ -25,6 +25,11 @@ def test_init(self): self.assertEqual(param["a"], 1) self.assertIn("a", param.keys()) self.assertIn(1, param.values()) + self.assertIn(("a", 1), param.items()) + + # from dict with strings + param = pybamm.ParameterValues({"a": "1"}) + self.assertEqual(param["a"], 1) # from dict "chemistry" key gets removed param = pybamm.ParameterValues({"a": 1, "chemistry": "lithium-ion"}) @@ -84,6 +89,10 @@ def test_update(self): with self.assertRaisesRegex(KeyError, "Cannot update parameter"): param.update({"b": 1}) + # udpate with a ParameterValues object + new_param = pybamm.ParameterValues(param) + self.assertEqual(new_param["a"], 2) + # test deleting a parameter del param["a"] self.assertNotIn("a", param.keys()) @@ -384,6 +393,10 @@ def my_func(x): self.assertEqual(func1.domains, func2.domains) self.assertEqual(func1.domains, func3.domains) + # [function] is deprecated + with self.assertRaisesRegex(ValueError, "[function]"): + pybamm.ParameterValues({"func": "[function]something"}) + def test_process_inline_function_parameters(self): def D(c): return c**2 From 2ef6376e7ab933f9b60cda36a34084412130a648 Mon Sep 17 00:00:00 2001 From: Valentin Sulzer Date: Mon, 22 May 2023 12:27:12 -0400 Subject: [PATCH 6/7] Update tests/unit/test_parameters/test_parameter_values.py Co-authored-by: Ferran Brosa Planella --- tests/unit/test_parameters/test_parameter_values.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/test_parameters/test_parameter_values.py b/tests/unit/test_parameters/test_parameter_values.py index edcc00abb9..ba2a548d0f 100644 --- a/tests/unit/test_parameters/test_parameter_values.py +++ b/tests/unit/test_parameters/test_parameter_values.py @@ -89,7 +89,7 @@ def test_update(self): with self.assertRaisesRegex(KeyError, "Cannot update parameter"): param.update({"b": 1}) - # udpate with a ParameterValues object + # update with a ParameterValues object new_param = pybamm.ParameterValues(param) self.assertEqual(new_param["a"], 2) From 4c1b08f650778f84addf4775252f93b20f2d8194 Mon Sep 17 00:00:00 2001 From: Valentin Sulzer Date: Mon, 22 May 2023 12:28:52 -0400 Subject: [PATCH 7/7] #2901 changelog --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37e41ed98d..7290323388 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ ## Optimizations -- Test `JaxSolver`'s compatibility with Python `3.8`, `3.9`, `3.10`, and `3.11` ([#2958](https://github.com/pybamm-team/PyBaMM/pull/2958)) +- Test `JaxSolver`'s compatibility with Python `3.8`, `3.9`, `3.10`, and `3.11` ([#2958](https://github.com/pybamm-team/PyBaMM/pull/2958)) - Update Jax (0.4.8) and JaxLib (0.4.7) compatibility ([#2927](https://github.com/pybamm-team/PyBaMM/pull/2927)) ## Bug fixes @@ -15,6 +15,10 @@ - Fix `pybamm_install_odes` and update the required SUNDIALS version ([#2958](https://github.com/pybamm-team/PyBaMM/pull/2958)) - Remove brew install for Mac from the recommended developer installation options for SUNDIALS ([#2925](https://github.com/pybamm-team/PyBaMM/pull/2925)) +## Breaking changes + +- Deprecate functionality to load parameter set from a csv file. Parameter sets must now be provided as python dictionaries ([#2959](https://github.com/pybamm-team/PyBaMM/pull/2959)) + # [v23.4.1](https://github.com/pybamm-team/PyBaMM/tree/v23.4) - 2023-05-01 ## Bug fixes