Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R average operator not recognising custom particle domains #4576

Open
isaacbasil opened this issue Nov 12, 2024 · 0 comments
Open

R average operator not recognising custom particle domains #4576

isaacbasil opened this issue Nov 12, 2024 · 0 comments

Comments

@isaacbasil
Copy link

Hi,

I am keen to start contributing to Pybamm, but I have never contributed to any open-source project before, so I am looking for an easy entry point so that I can understand the process. I came across something in my work which might be a good start:

I am using Pybamm to solve a custom model, which is a DFN variant with several particle domains. Thus, the particle domain name is now something like 'positive particle 1' rather than just 'positive particle'. However, when using the pybamm.r_average() operator, it does not recognise this domain as a particle domain, due to the following line,

has_particle_domain = symbol.domain != [] and symbol.domain[0].endswith("particle")

I know I could just change my domain name to something like 'ID 1 positive particle' and it would bypass this problem. But to me it makes more sense to fix the problem as follows:

has_particle_domain = symbol.domain != [] and "particle" in symbol.domain[0]

Can anyone think of any problems with this? If not I will go ahead and try make a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant