diff --git a/pybamm/models/submodels/current_collector/potential_pair.py b/pybamm/models/submodels/current_collector/potential_pair.py index f2fd3aee83..68a9066da3 100644 --- a/pybamm/models/submodels/current_collector/potential_pair.py +++ b/pybamm/models/submodels/current_collector/potential_pair.py @@ -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), } diff --git a/tests/unit/test_models/test_full_battery_models/test_lithium_ion/base_lithium_ion_tests.py b/tests/unit/test_models/test_full_battery_models/test_lithium_ion/base_lithium_ion_tests.py index f4e3c3cceb..de7d2bfe83 100644 --- a/tests/unit/test_models/test_full_battery_models/test_lithium_ion/base_lithium_ion_tests.py +++ b/tests/unit/test_models/test_full_battery_models/test_lithium_ion/base_lithium_ion_tests.py @@ -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)