Skip to content

Wycisk OCP Restructure - Add Initial Hysteresis State Parameter #4374

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

Merged
merged 8 commits into from
Jan 2, 2025
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 @@ -16,6 +16,7 @@
package to install PyBaMM with only the required dependencies. ([conda-forge/pybamm-feedstock#70](https://github.com/conda-forge/pybamm-feedstock/pull/70))
- Separated extrapolation options for `pybamm.BoundaryValue` and `pybamm.BoundaryGradient`, and updated the default to be "linear" for the value and "quadratic" for the gradient. ([#4614](https://github.com/pybamm-team/PyBaMM/pull/4614))
- Double-layer SEI models have been removed (with the corresponding parameters). All models assume now a single SEI layer. ([#4470](https://github.com/pybamm-team/PyBaMM/pull/4470))
- Wycisk OCP model now requires an parameter to set the initial condition. ([#4374](https://github.com/pybamm-team/PyBaMM/pull/4374))

## Bug fixes

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def set_rhs(self, variables):
domain, Domain = self.domain_Domain
phase_name = self.phase_name

current = variables[
i_surf = variables[
f"{Domain} electrode {phase_name}interfacial current density [A.m-2]"
]
# check if composite or not
Expand All @@ -165,12 +165,12 @@ def set_rhs(self, variables):
h = variables[f"{Domain} electrode {phase_name}hysteresis state"]

dhdt = (
K * (current / (Q_cell * (dQdU**K_x))) * (1 - pybamm.sign(current) * h)
K * (i_surf / (Q_cell * (dQdU**K_x))) * (1 - pybamm.sign(i_surf) * h)
) #! current is backwards for a halfcell
self.rhs[h] = dhdt

def set_initial_conditions(self, variables):
domain, Domain = self.domain_Domain
phase_name = self.phase_name
h = variables[f"{Domain} electrode {phase_name}hysteresis state"]
self.initial_conditions[h] = pybamm.Scalar(0)
self.initial_conditions[h] = self.phase_param.h_init
4 changes: 3 additions & 1 deletion src/pybamm/parameters/lithium_ion_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,9 @@ def _set_parameters(self):
self.hysteresis_switch = pybamm.Parameter(
f"{pref}{Domain} particle hysteresis switching factor"
)
self.h_init = pybamm.Scalar(0)
self.h_init = pybamm.Parameter(
f"{pref}Initial hysteresis state in {domain} electrode"
)

if self.options["open-circuit potential"] != "MSMR":
self.U_init = self.U(self.sto_init_av, main.T_init)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def test_wycisk_ocp(self):
+ 0.1,
"Negative particle hysteresis decay rate": 1,
"Negative particle hysteresis switching factor": 1,
# "Negative electrode OCP hysteresis [V]": lambda sto: 1,
"Initial hysteresis state in negative electrode": -0.5,
},
check_already_exists=False,
)
Expand Down
Loading