Skip to content

Flux boundary conditions in 1D finite volume #5523

Description

@SarahRo

Description

Say we have a model with a governing equation of the following form:

N = some_expression(grad(c))
dcdt = -pybamm.div(N)
model.rhs = {c: dcdt}

To define a boundary condition given for the flux N, this currently has to be reformulated in terms of grad(c) as a Neumann boundary condition on c. We propose to add another type of boundary condition that allows to directly define a boundary condition for the flux N, possibly looking something like this:

model.boundary_conditions = {
    c: {
        "left": (pybamm.Scalar(0), "Neumann"),
        "right": (pybamm.Scalar(-2), ("Flux", N)),
    }
}

Motivation

This will simplify the implementation of models with more complex Fluxes and corresponding boundary conditions.

Possible Implementation

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions