Skip to content

Commit

Permalink
fix bug in leading surface form conductivity (pybamm-team#4139)
Browse files Browse the repository at this point in the history
* fix bug in leading surface form conductivity

* update changelog

---------

Co-authored-by: Eric G. Kratz <kratman@users.noreply.github.com>
Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com>
  • Loading branch information
3 people authored and js1tr3 committed Aug 12, 2024
1 parent b61a1c4 commit 52b20c9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,13 +272,11 @@ def set_rhs(self, variables):
domain, Domain = self.domain_Domain

T = variables[f"{Domain} electrode temperature [K]"]

C_dl = self.domain_param.C_dl(T)

delta_phi = variables[f"{Domain} electrode surface potential difference [V]"]
i_e = variables[f"{Domain} electrolyte current density [A.m-2]"]

# Variable summing all of the interfacial current densities
sum_a_j = variables[
f"Sum of {domain} electrode volumetric "
"interfacial current densities [A.m-3]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,24 +86,26 @@ def __init__(self, param, domain, options=None):

def set_rhs(self, variables):
domain = self.domain
T = variables[f"X-averaged {domain} electrode temperature [K]"]
C_dl = self.domain_param.C_dl(T)

delta_phi = variables[
f"X-averaged {domain} electrode surface potential difference [V]"
]

sum_a_j = variables[
f"Sum of x-averaged {domain} electrode volumetric "
"interfacial current densities [A.m-3]"
]

sum_a_j_av = variables[
f"X-averaged {domain} electrode total volumetric "
"interfacial current density [A.m-3]"
]
delta_phi = variables[
f"X-averaged {domain} electrode surface potential difference [V]"
a = variables[
f"X-averaged {domain} electrode surface area to volume ratio [m-1]"
]

T = variables[f"X-averaged {domain} electrode temperature [K]"]

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 LeadingOrderAlgebraic(BaseLeadingOrderSurfaceForm):
Expand Down

0 comments on commit 52b20c9

Please sign in to comment.