Skip to content

Commit

Permalink
#3828 fix pouch cell voltage control (#3829)
Browse files Browse the repository at this point in the history
* #3828 fix pouch cell voltage control

* #3828 changelog
  • Loading branch information
rtimms authored Feb 21, 2024
1 parent 84eb098 commit 2834399
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

## Bug Fixes

- Fixed a bug where 1+1D and 2+1D models would not work with voltage or power controlled experiments([#3829](https://github.com/pybamm-team/PyBaMM/pull/3829))
- Updated `_steps_util.py` to throw a specific exception when drive cycle starts at t>0 ([#3756](https://github.com/pybamm-team/PyBaMM/pull/3756))
- Updated `plot_voltage_components.py` to support both `Simulation` and `Solution` objects. Added new methods in both `Simulation` and `Solution` classes for allow the syntax `simulation.plot_voltage_components` and `solution.plot_voltage_components`. Updated `test_plot_voltage_components.py` to reflect these changes ([#3723](https://github.com/pybamm-team/PyBaMM/pull/3723)).
- The SEI thickness decreased at some intervals when the 'electron-migration limited' model was used. It has been corrected ([#3622](https://github.com/pybamm-team/PyBaMM/pull/3622))
Expand Down
3 changes: 1 addition & 2 deletions pybamm/models/submodels/current_collector/potential_pair.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,12 @@ def set_algebraic(self, variables):
}

def set_initial_conditions(self, variables):
applied_current = self.param.current_with_time
phi_s_cn = variables["Negative current collector potential [V]"]
i_boundary_cc = variables["Current collector current density [A.m-2]"]

self.initial_conditions = {
phi_s_cn: pybamm.Scalar(0),
i_boundary_cc: applied_current,
i_boundary_cc: pybamm.Scalar(0),
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,44 @@ def external_circuit_function(variables):
options = {"operating mode": external_circuit_function}
self.check_well_posedness(options)

def test_well_posed_external_circuit_function_1plus1D(self):
def external_circuit_function(variables):
I = variables["Current [A]"]
V = variables["Voltage [V]"]
return (
V
+ I
- pybamm.FunctionParameter(
"Function", {"Time [s]": pybamm.t}, print_name="test_fun"
)
)

options = {
"current collector": "potential pair",
"dimensionality": 1,
"operating mode": external_circuit_function,
}
self.check_well_posedness(options)

def test_well_posed_external_circuit_function_2plus1D(self):
def external_circuit_function(variables):
I = variables["Current [A]"]
V = variables["Voltage [V]"]
return (
V
+ I
- pybamm.FunctionParameter(
"Function", {"Time [s]": pybamm.t}, print_name="test_fun"
)
)

options = {
"current collector": "potential pair",
"dimensionality": 2,
"operating mode": external_circuit_function,
}
self.check_well_posedness(options)

def test_well_posed_particle_phases(self):
options = {"particle phases": "2"}
self.check_well_posedness(options)
Expand Down

0 comments on commit 2834399

Please sign in to comment.