Skip to content

[Bug]: Chen2020_composite cannot run a thermal model (per-phase electrode density) #5877

Open

Description

@rtimms

PyBaMM Version

26.9.0.1.dev22+gf669fd8d9 (main)

Describe the bug

Chen2020_composite cannot be used with any thermal model. It gives the negative electrode density per phase ("Primary: Negative electrode density [kg.m-3]" = 1657, "Secondary: Negative electrode density [kg.m-3]" = 2650), but ThermalParameters.rho (parameters/thermal_parameters.py) looks up a single electrode-level "Negative electrode density [kg.m-3]", so parameter processing raises a KeyError.

The same applies to any composite parameter set that gives per-phase densities. Heat capacity and thermal conductivity are also read per electrode, not per phase.

We need to decide which is right:

  • the parameter set gives an electrode-level (effective) density, or
  • the thermal parameters combine the per-phase values, e.g. weighted by each phase's active material volume fraction.

Found while working on #5769, whose tests had to supply an electrode density by hand.

Steps to Reproduce

import pybamm

model = pybamm.lithium_ion.SPM({"particle phases": ("2", "1"), "thermal": "lumped"})
pybamm.Simulation(
    model, parameter_values=pybamm.ParameterValues("Chen2020_composite")
).build()

Relevant log output

KeyError: "Parameter 'Negative electrode density [kg.m-3]' not found. 'Negative electrode density [kg.m-3]' not found. If you are using a composite model, you may need to use Primary: Negative electrode density [kg.m-3] instead. ..."

Activity

  1. rtimms commented on Oct 8, 2026

    @rtimms
    ContributorAuthor

    Workaround for the lumped model: use "use lumped thermal capacity": "true" and give a cell-level "Cell heat capacity [J.K-1.m-3]" (volumetric). The lumped model then never reads the electrode or phase densities, so Chen2020_composite builds. The parameter set doesn't include a cell heat capacity, so you need to add one:

    import pybamm
    
    parameter_values = pybamm.ParameterValues("Chen2020_composite")
    parameter_values.update(
        {"Cell heat capacity [J.K-1.m-3]": 2.5e6}, check_already_exists=False
    )
    model = pybamm.lithium_ion.SPM(
        {
            "particle phases": ("2", "1"),
            "thermal": "lumped",
            "use lumped thermal capacity": "true",
        }
    )
    pybamm.Simulation(model, parameter_values=parameter_values).build()  # builds

    (2.5e6 is a placeholder; use the cell's measured volumetric heat capacity.)

    So the bug remains for:

    • "thermal": "x-full" and the pouch-cell thermal models, which resolve temperature in space, need the per-domain densities, and reject "use lumped thermal capacity".
    • "thermal": "lumped" without the option (the default). It still builds the effective heat capacity from the per-domain densities and fails with the KeyError above.
  2. Fstarnb commented on Oct 13, 2026

    @Fstarnb

    Could a maintainer clarify the intended contract for composite-electrode thermal properties in #5877? Should a composite parameter set provide effective electrode-level density, heat capacity, and conductivity, or should PyBaMM derive them from per-phase properties? If deriving them, which volume fractions and constituents should the mixture include—for example, active materials only, or also binder, conductive additive, and pore electrolyte? The issue’s active-phase weighting option may not define the whole-electrode thermal properties needed by the thermal model.

  3. rtimms commented on Oct 20, 2026

    @rtimms
    ContributorAuthor

    Good question, @Fstarnb. The contract is that thermal properties are electrode-level effective properties. The thermal models treat each electrode as one homogenised layer, and "Negative electrode density [kg.m-3]", "... specific heat capacity [J.kg-1.K-1]" and "... thermal conductivity [W.m-1.K-1]" describe that whole layer, whatever it contains. That means active material(s), binder, conductive additive and the pore electrolyte, if the source measured or estimated it that way. PyBaMM doesn't derive them from per-phase values. A mixture rule over the active phases alone would leave out binder, carbon and electrolyte. A full rule would need volume fractions and properties PyBaMM doesn't model. So a composite parameter set should supply the electrode-level values, as it does for any other electrode, and anyone who wants a mixture rule can compute it and pass the result (optionally as a function of temperature).

    The per-phase "Primary: / Secondary: Negative electrode density" entries in Chen2020_composite and Bonkile2024 are a mistake: no model reads them. #5934 gives both sets an electrode-level "Negative electrode density [kg.m-3]" (1657, the graphite electrode value from Chen2020; the silicon is 1.5% by volume) and removes the per-phase ones, so these sets run with any thermal option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions