Skip to content

Commit 29c07c0

Browse files
author
DrSOKane
committed
Changed current_sigmoid_ocp to be valid for both electrodes
1 parent 4f03df4 commit 29c07c0

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

pybamm/models/submodels/interface/open_circuit_potential/current_sigmoid_ocp.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,17 @@
77

88
class CurrentSigmoidOpenCircuitPotential(BaseOpenCircuitPotential):
99
def get_coupled_variables(self, variables):
10+
domain, Domain = self.domain_Domain
1011
current = variables["Total current density"]
1112
k = 100
12-
m_lith = pybamm.sigmoid(current, 0, k) # for lithation (current < 0)
13-
m_delith = 1 - m_lith # for delithiation (current > 0)
1413

15-
domain, Domain = self.domain_Domain
14+
if Domain == "Negative":
15+
m_lith = pybamm.sigmoid(current, 0, k) # for lithation (current < 0)
16+
m_delith = 1 - m_lith # for delithiation (current > 0)
17+
elif Domain == "Positive":
18+
m_delith = pybamm.sigmoid(current, 0, k) # for delithation (current < 0)
19+
m_lith = 1 - m_delith # for lithiation (current > 0)
20+
1621
phase_name = self.phase_name
1722

1823
if self.reaction == "lithium-ion main":

0 commit comments

Comments
 (0)