Skip to content

Commit e00c3c4

Browse files
author
DrSOKane
committed
Added new temporary variable lithiation_current for current sigmoid
1 parent e3ea4c7 commit e00c3c4

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

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: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ def get_coupled_variables(self, variables):
1111
current = variables["Total current density"]
1212
k = 100
1313

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)
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
2021

2122
phase_name = self.phase_name
2223

0 commit comments

Comments
 (0)