Skip to content

Allow variables to have more than 3 domains #1580

Description

@tobykirk

Summary
Currently variables can have a maximum of 3 domains, i.e. a "primary" domain and two auxiliary domains, "secondary" and "tertiary". This could be extended to allow "quaternary" etc. domains (or changed to allow any number of domains).

Also, a TertiaryBroadcast() (or a generalization) could be defined, similar to PrimaryBroadcast() and SecondaryBroadcast().

Motivation
Necessary in order to add particle-size distributions to the DFN framework, where some variables live on 4 different domains , e.g.

 c_s_distribution = pybamm.Variable(
    "Negative particle concentration distribution",
    domain="negative particle",
    auxiliary_domains={
        "secondary": "negative particle size",
        "tertiary": "negative electrode",
        "quaternary": "current collector",
    },
    bounds=(0, 1),
)

(Even if some domains are 0D in practice, they can push others off the domain list before the domains are discretized.)

A TertiaryBroadcast() would then be used for e.g. broadcasting the "X-averaged" concentration distribution to the "electrode" domains (which would be added in the "tertiary" position).

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions