diff --git a/pybamm/models/submodels/electrolyte_diffusion/base_electrolyte_diffusion.py b/pybamm/models/submodels/electrolyte_diffusion/base_electrolyte_diffusion.py index 7748cde679..3a3a75d4fb 100644 --- a/pybamm/models/submodels/electrolyte_diffusion/base_electrolyte_diffusion.py +++ b/pybamm/models/submodels/electrolyte_diffusion/base_electrolyte_diffusion.py @@ -42,6 +42,7 @@ def _get_standard_concentration_variables(self, c_e_n, c_e_s, c_e_p): """ c_e_typ = self.param.c_e_typ + L_x = self.param.L_x c_e = pybamm.Concatenation(c_e_n, c_e_s, c_e_p) c_e_av = pybamm.x_average(c_e) @@ -49,6 +50,13 @@ def _get_standard_concentration_variables(self, c_e_n, c_e_s, c_e_p): c_e_s_av = pybamm.x_average(c_e_s) c_e_p_av = pybamm.x_average(c_e_p) + eps_n = self.param.epsilon_n + eps_s = self.param.epsilon_s + eps_p = self.param.epsilon_p + eps = pybamm.Concatenation(eps_n, eps_s, eps_p) + + c_e_total = pybamm.Integral(eps * c_e, pybamm.standard_spatial_vars.x) + variables = { "Electrolyte concentration": c_e, "Electrolyte concentration [mol.m-3]": c_e_typ * c_e, @@ -74,6 +82,9 @@ def _get_standard_concentration_variables(self, c_e_n, c_e_s, c_e_p): "X-averaged positive electrolyte concentration": c_e_p_av, "X-averaged positive electrolyte concentration [mol.m-3]": c_e_typ * c_e_p_av, + "Total lithium concentration in electrolyte [mol.m-2]": c_e_typ + * L_x + * c_e_total, } return variables diff --git a/pybamm/models/submodels/particle/base_particle.py b/pybamm/models/submodels/particle/base_particle.py index 28a696f3c6..c9a925d7b3 100644 --- a/pybamm/models/submodels/particle/base_particle.py +++ b/pybamm/models/submodels/particle/base_particle.py @@ -24,18 +24,19 @@ def __init__(self, param, domain): def _get_standard_concentration_variables(self, c_s, c_s_xav): c_s_surf = pybamm.surf(c_s) - c_s_surf_av = pybamm.x_average(c_s_surf) - geo_param = pybamm.geometric_parameters if self.domain == "Negative": c_scale = self.param.c_n_max - active_volume = geo_param.a_n_dim * geo_param.R_n / 3 + eps_s = self.param.epsilon_s_n + L = self.param.L_n elif self.domain == "Positive": c_scale = self.param.c_p_max - active_volume = geo_param.a_p_dim * geo_param.R_p / 3 - c_s_av = pybamm.r_average(c_s_xav) - c_s_av_vol = active_volume * c_s_av + eps_s = self.param.epsilon_s_p + L = self.param.L_p + + c_s_rav = pybamm.r_average(c_s) + c_s_vol_av = pybamm.x_average(eps_s * c_s_rav) variables = { self.domain + " particle concentration": c_s, self.domain + " particle concentration [mol.m-3]": c_s * c_scale, @@ -52,12 +53,13 @@ def _get_standard_concentration_variables(self, c_s, c_s_xav): "X-averaged " + self.domain.lower() + " particle surface concentration [mol.m-3]": c_scale * c_s_surf_av, - self.domain + " electrode active volume fraction": active_volume, - self.domain + " electrode volume-averaged concentration": c_s_av_vol, + self.domain + " electrode active volume fraction": eps_s, + self.domain + " electrode volume-averaged concentration": c_s_vol_av, self.domain + " electrode " - + "volume-averaged concentration [mol.m-3]": c_s_av_vol * c_scale, - self.domain + " electrode average extent of lithiation": c_s_av, + + "volume-averaged concentration [mol.m-3]": c_s_vol_av * c_scale, + self.domain + " electrode average extent of lithiation": c_s_rav, + "Total lithium concentration in " + self.domain.lower() + " electrode [mol.m-2]": c_s_vol_av * c_scale * L, } return variables