Skip to content

Commit

Permalink
#3828 fix pouch cell voltage control
Browse files Browse the repository at this point in the history
  • Loading branch information
rtimms committed Feb 19, 2024
1 parent 4597143 commit 172570e
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
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 172570e

Please sign in to comment.