PyBaMM icon indicating copy to clipboard operation
PyBaMM copied to clipboard

SEI + Composite j_sei undefined

Open kratman opened this issue 8 months ago • 3 comments

Report from @mpegis:

The PR (#4153) seemed to fix my issue (#4123) when I declared SEI on both Si/Gr phases in Chen2020, but now I am seeing a different error when defining a single SEI on one phase with "none" on the other/cathode.

import pybamm 
model = pybamm.lithium_ion.DFN(
    {
        "particle phases": ("2", "1"),
        "open-circuit potential": (("single", "current sigmoid"), "single"),
        "SEI": (("none","solvent-diffusion limited"),"none")
    }
)
parameters = pybamm.ParameterValues("Chen2020_composite")
experiment = pybamm.Experiment(["Rest for 10 minutes"])
sim = pybamm.Simulation(model, experiment=experiment, parameter_values=parameters)
sol = sim.solve(calc_esoh=False)

Is giving me this error


UnboundLocalError Traceback (most recent call last) )) --> 182 j_inner = inner_sei_proportion * Arrhenius * j_sei 183 j_outer = (1 - inner_sei_proportion) * Arrhenius * j_sei 185 variables.update(self._get_standard_concentration_variables(variables))

UnboundLocalError: cannot access local variable 'j_sei' where it is not associated with a value

Was curious if I missed another model option or if this is expected behavior?

Thanks!

Originally posted by @mpegis in https://github.com/pybamm-team/PyBaMM/issues/4123#issuecomment-2159264247

kratman avatar Jun 10 '24 21:06 kratman