Skip to content

Commit

Permalink
pybamm-team#1349 fixed surface form
Browse files Browse the repository at this point in the history
  • Loading branch information
brosaplanella committed Feb 2, 2021
1 parent 1c4bf03 commit aeaa445
Showing 1 changed file with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ def _get_whole_cell_variables(self, variables):
The variables including the whole-cell electrolyte potentials
and currents.
"""
param = self.param

phi_e_n = variables["Negative electrolyte potential"]
phi_e_s = variables["Separator electrolyte potential"]
Expand All @@ -284,10 +285,51 @@ def _get_whole_cell_variables(self, variables):
i_e_p = variables["Positive electrolyte current density"]
i_e = pybamm.Concatenation(i_e_n, i_e_s, i_e_p)

c_e_n = variables["Negative electrolyte concentration"]
c_e_s = variables["Separator electrolyte concentration"]
c_e_p = variables["Positive electrolyte concentration"]

T = variables["Cell temperature"]
T_n, T_s, T_p = T.orphans

# concentration overpotential
indef_integral_n = pybamm.IndefiniteIntegral(
param.chi(c_e_n, T_n)
* (1 + param.Theta * T_n)
* pybamm.grad(c_e_n)
/ c_e_n,
pybamm.standard_spatial_vars.x_n,
)
indef_integral_s = pybamm.IndefiniteIntegral(
param.chi(c_e_s, T_s)
* (1 + param.Theta * T_s)
* pybamm.grad(c_e_s)
/ c_e_s,
pybamm.standard_spatial_vars.x_s,
)
indef_integral_p = pybamm.IndefiniteIntegral(
param.chi(c_e_p, T_p)
* (1 + param.Theta * T_p)
* pybamm.grad(c_e_p)
/ c_e_p,
pybamm.standard_spatial_vars.x_p,
)

integral_n = indef_integral_n
integral_s = indef_integral_s + pybamm.boundary_value(integral_n, "right")
integral_p = indef_integral_p + pybamm.boundary_value(integral_s, "right")

eta_c_av = pybamm.x_average(integral_p) - pybamm.x_average(integral_n)

delta_phi_e_av = (
pybamm.x_average(phi_e_p) - pybamm.x_average(phi_e_n) - eta_c_av
)

variables.update(
self._get_standard_potential_variables(phi_e_n, phi_e_s, phi_e_p)
)
variables.update(self._get_standard_current_variables(i_e))
variables.update(self._get_split_overpotential(eta_c_av, delta_phi_e_av))

return variables

Expand Down

0 comments on commit aeaa445

Please sign in to comment.