Skip to content

Commit beb8cdf

Browse files
Merge pull request #2719 from DrSOKane/current-sigmoid
Changed current_sigmoid_ocp to be valid for both electrodes
2 parents 4f03df4 + e00c3c4 commit beb8cdf

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
## Bug fixes
1010

11+
- Fixed current_sigmoid_ocp to be valid for both electrodes ([#2719](https://github.com/pybamm-team/PyBaMM/pull/2719)).
1112
- Fixed the length scaling for the first dimension of r-R plots ([#2663](https://github.com/pybamm-team/PyBaMM/pull/2663)).
1213

1314
# [v23.1](https://github.com/pybamm-team/PyBaMM/tree/v23.1) - 2023-01-31

examples/notebooks/models/composite_particle.ipynb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@
9191
]
9292
},
9393
{
94-
"attachments": {},
9594
"cell_type": "markdown",
9695
"id": "10339d40",
9796
"metadata": {},
@@ -594,7 +593,6 @@
594593
]
595594
},
596595
{
597-
"attachments": {},
598596
"cell_type": "markdown",
599597
"id": "dbc0edb2",
600598
"metadata": {},
@@ -639,7 +637,6 @@
639637
]
640638
},
641639
{
642-
"attachments": {},
643640
"cell_type": "markdown",
644641
"id": "40467b70",
645642
"metadata": {},
@@ -849,7 +846,6 @@
849846
]
850847
},
851848
{
852-
"attachments": {},
853849
"cell_type": "markdown",
854850
"id": "977b4c09",
855851
"metadata": {},
@@ -935,7 +931,7 @@
935931
],
936932
"metadata": {
937933
"kernelspec": {
938-
"display_name": "dev",
934+
"display_name": "Python 3 (ipykernel)",
939935
"language": "python",
940936
"name": "python3"
941937
},
@@ -949,7 +945,7 @@
949945
"name": "python",
950946
"nbconvert_exporter": "python",
951947
"pygments_lexer": "ipython3",
952-
"version": "3.9.6"
948+
"version": "3.8.10"
953949
},
954950
"toc": {
955951
"base_numbering": 1,

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,18 @@
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 == "Positive":
15+
lithiation_current = current
16+
elif Domain == "Negative":
17+
lithiation_current = -current
18+
19+
m_lith = pybamm.sigmoid(0, lithiation_current, k) # lithiation_current > 0
20+
m_delith = 1 - m_lith # lithiation_current < 0
21+
1622
phase_name = self.phase_name
1723

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

0 commit comments

Comments
 (0)