Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed current_sigmoid_ocp to be valid for both electrodes #2719

Merged
merged 3 commits into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

## Bug fixes

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

# [v23.1](https://github.com/pybamm-team/PyBaMM/tree/v23.1) - 2023-01-31
Expand Down
8 changes: 2 additions & 6 deletions examples/notebooks/models/composite_particle.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "10339d40",
"metadata": {},
Expand Down Expand Up @@ -594,7 +593,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "dbc0edb2",
"metadata": {},
Expand Down Expand Up @@ -639,7 +637,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "40467b70",
"metadata": {},
Expand Down Expand Up @@ -849,7 +846,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "977b4c09",
"metadata": {},
Expand Down Expand Up @@ -935,7 +931,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "dev",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -949,7 +945,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.6"
"version": "3.8.10"
},
"toc": {
"base_numbering": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@

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

domain, Domain = self.domain_Domain
if Domain == "Positive":
lithiation_current = current
elif Domain == "Negative":
lithiation_current = -current

m_lith = pybamm.sigmoid(0, lithiation_current, k) # lithiation_current > 0
m_delith = 1 - m_lith # lithiation_current < 0

phase_name = self.phase_name

if self.reaction == "lithium-ion main":
Expand Down