diff --git a/degradation_model/try_spme_deg.ipynb b/degradation_model/try_spme_deg.ipynb new file mode 100644 index 0000000000..0de1b68c67 --- /dev/null +++ b/degradation_model/try_spme_deg.ipynb @@ -0,0 +1,79 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "import pybamm\n", + "import matplotlib.pyplot as plt\n", + "import numpy as np\n", + "import pandas as pd\n", + "import math\n", + "import dfols\n", + "import signal\n", + "from scipy.integrate import solve_ivp\n", + "from scipy.fft import fft, fftfreq, fftshift\n", + "from scipy.signal import savgol_filter\n", + "from scipy.signal import find_peaks\n", + "from scipy.io import savemat\n", + "from scipy import interpolate\n", + "import os, sys\n", + "import pickle\n", + "sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(\"__file__\"))))\n", + "from batfuns import *\n", + "plt.rcParams = set_rc_params(plt.rcParams)\n", + "\n", + "eSOH_DIR = \"./data/esoh/\"\n", + "oCV_DIR = \"./data/ocv/\"\n", + "cyc_DIR = \"./data/cycling/\"\n", + "fig_DIR = \"./figures/\"\n", + "res_DIR = \"./results/\"\n", + "resistance_DIR = \"./data/resistance/\"\n", + "%matplotlib widget" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "# loading parameter values without aging model parameters, just battery parameters\n", + "parameter_values = get_parameter_values()\n", + "# we are defing the model\n", + "spme = pybamm.lithium_ion.SPMe(\n", + " {\n", + " \"SEI\": \"ec reaction limited\",\n", + " \"loss of active material\": \"stress-driven\",\n", + " \"lithium plating\": \"irreversible\",\n", + " \"stress-induced diffusion\": \"false\",\n", + " }\n", + ")\n", + "param=spme.param" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "windows-dev", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.7" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/degradation_model/try_spme_deg.py b/degradation_model/try_spme_deg.py new file mode 100644 index 0000000000..6be383c1f0 --- /dev/null +++ b/degradation_model/try_spme_deg.py @@ -0,0 +1,10 @@ +import pybamm + +spme = pybamm.lithium_ion.SPMe( + { + "SEI": "ec reaction limited", + "loss of active material": "stress-driven", + "lithium plating": "irreversible", + "stress-induced diffusion": "false", + } +) \ No newline at end of file diff --git a/pybamm/input/parameters/lithium_ion/negative_electrodes/graphite_UMBL_Siegel2022/graphite_electrolyte_exchange_current_density_Siegel.py b/pybamm/input/parameters/lithium_ion/negative_electrodes/graphite_UMBL_Siegel2022/graphite_electrolyte_exchange_current_density_Siegel.py index fc625d0d95..d563b80597 100644 --- a/pybamm/input/parameters/lithium_ion/negative_electrodes/graphite_UMBL_Siegel2022/graphite_electrolyte_exchange_current_density_Siegel.py +++ b/pybamm/input/parameters/lithium_ion/negative_electrodes/graphite_UMBL_Siegel2022/graphite_electrolyte_exchange_current_density_Siegel.py @@ -1,7 +1,7 @@ from pybamm import exp, constants -def graphite_electrolyte_exchange_current_density_Siegel(c_e, c_s_surf, c_s_max, T, N_nick): +def graphite_electrolyte_exchange_current_density_Siegel(c_e, c_s_surf, c_s_max, T): """ Exchange-current density for Butler-Volmer reactions between graphite and LiPF6 in EC:DMC. diff --git a/pybamm/input/parameters/lithium_ion/positive_electrodes/NMC_UMBL_Siegel2022/NMC_electrolyte_exchange_current_density_Siegel.py b/pybamm/input/parameters/lithium_ion/positive_electrodes/NMC_UMBL_Siegel2022/NMC_electrolyte_exchange_current_density_Siegel.py index 555fce829e..3f8862c545 100644 --- a/pybamm/input/parameters/lithium_ion/positive_electrodes/NMC_UMBL_Siegel2022/NMC_electrolyte_exchange_current_density_Siegel.py +++ b/pybamm/input/parameters/lithium_ion/positive_electrodes/NMC_UMBL_Siegel2022/NMC_electrolyte_exchange_current_density_Siegel.py @@ -1,7 +1,7 @@ from pybamm import exp, constants -def NMC_electrolyte_exchange_current_density_Siegel(c_e, c_s_surf, c_s_max, T, N_nick): +def NMC_electrolyte_exchange_current_density_Siegel(c_e, c_s_surf, c_s_max, T): """ Exchange-current density for Butler-Volmer reactions between NMC and LiPF6 in EC:DMC. diff --git a/pybamm/models/submodels/interface/base_interface.py b/pybamm/models/submodels/interface/base_interface.py index 7e73db41e0..c3c5abe473 100644 --- a/pybamm/models/submodels/interface/base_interface.py +++ b/pybamm/models/submodels/interface/base_interface.py @@ -71,7 +71,9 @@ def _get_exchange_current_density(self, variables): c_e = variables[f"{Domain} electrolyte concentration"] T = variables[f"{Domain} electrode temperature"] - N_nick= variables["X-averaged positive electrode loss nickel dissolution"] + #N_nick= variables["X-averaged positive electrode loss nickel dissolution"] + + # N_nick= variables[f"{Domain} loss nickel dissolution"] if self.reaction == "lithium-ion main": # For "particle-size distribution" submodels, take distribution version @@ -114,7 +116,7 @@ def _get_exchange_current_density(self, variables): c_e = c_e.orphans[0] T = T.orphans[0] - j0 = phase_param.j0(c_e, c_s_surf, T, N_nick) + j0 = phase_param.j0(c_e, c_s_surf, T) elif self.reaction == "lithium metal plating": j0 = param.j0_plating(c_e, 1, T) diff --git a/pybamm/parameters/lithium_ion_parameters.py b/pybamm/parameters/lithium_ion_parameters.py index 0a9eeb08a1..d339db2e51 100644 --- a/pybamm/parameters/lithium_ion_parameters.py +++ b/pybamm/parameters/lithium_ion_parameters.py @@ -824,7 +824,7 @@ def D_dimensional(self, sto, T): inputs, ) - def j0_dimensional(self, c_e, c_s_surf, T, N_nick): + def j0_dimensional(self, c_e, c_s_surf, T): """Dimensional exchange-current density [A.m-2]""" inputs = { "Electrolyte concentration [mol.m-3]": c_e, @@ -833,8 +833,7 @@ def j0_dimensional(self, c_e, c_s_surf, T, N_nick): "surface concentration [mol.m-3]": self.c_max, "Temperature [K]": T, f"{self.phase_prefactor}Maximum {self.domain.lower()} particle " - "surface concentration [mol.m-3]": self.c_max, - f"{self.domain} dissolution nickel intercalation coefficient": N_nick, + "surface concentration [mol.m-3]": self.c_max, } return pybamm.FunctionParameter( @@ -906,7 +905,7 @@ def _set_scales(self): # Reference exchange-current density self.j0_ref_dimensional = ( - self.j0_dimensional(main.c_e_typ, self.c_max / 2, main.T_ref, 0) * 2 + self.j0_dimensional(main.c_e_typ, self.c_max / 2, main.T_ref) * 2 ) # Reaction timescales @@ -1052,7 +1051,7 @@ def D(self, c_s, T): T_dim = self.main_param.Delta_T * T + self.main_param.T_ref return self.D_dimensional(sto, T_dim) / self.D_typ_dim - def j0(self, c_e, c_s_surf, T, N_nick): + def j0(self, c_e, c_s_surf, T): """Dimensionless exchange-current density""" tol = pybamm.settings.tolerances["j0__c_e"] c_e = pybamm.maximum(c_e, tol) @@ -1062,7 +1061,7 @@ def j0(self, c_e, c_s_surf, T, N_nick): c_s_surf_dim = c_s_surf * self.c_max T_dim = self.main_param.Delta_T * T + self.main_param.T_ref - return self.j0_dimensional(c_e_dim, c_s_surf_dim, T_dim,N_nick) / self.j_scale + return self.j0_dimensional(c_e_dim, c_s_surf_dim, T_dim) / self.j_scale def U(self, c_s, T, lithiation=None): """Dimensionless open-circuit potential in the electrode"""