From 91c97448d1127534c4d06bc68e2a769c9be4e7ff Mon Sep 17 00:00:00 2001 From: Robert Timms <43040151+rtimms@users.noreply.github.com> Date: Thu, 25 Jul 2024 15:30:19 -0700 Subject: [PATCH] fix bug in composite surface form model (#4293) --- .../composite_surface_form_conductivity.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pybamm/models/submodels/electrolyte_conductivity/surface_potential_form/composite_surface_form_conductivity.py b/pybamm/models/submodels/electrolyte_conductivity/surface_potential_form/composite_surface_form_conductivity.py index 73aa301011..3b701ab2ac 100644 --- a/pybamm/models/submodels/electrolyte_conductivity/surface_potential_form/composite_surface_form_conductivity.py +++ b/pybamm/models/submodels/electrolyte_conductivity/surface_potential_form/composite_surface_form_conductivity.py @@ -99,6 +99,10 @@ def __init__(self, param, domain, options=None): def set_rhs(self, variables): domain = self.domain + a = variables[ + f"X-averaged {domain} electrode surface area to volume ratio [m-1]" + ] + sum_a_j = variables[ f"Sum of x-averaged {domain} electrode volumetric " "interfacial current densities [A.m-3]" @@ -116,7 +120,7 @@ def set_rhs(self, variables): C_dl = self.domain_param.C_dl(T) - self.rhs[delta_phi] = 1 / C_dl * (sum_a_j_av - sum_a_j) + self.rhs[delta_phi] = 1 / (a * C_dl) * (sum_a_j_av - sum_a_j) class CompositeAlgebraic(BaseModel):