-
-
Notifications
You must be signed in to change notification settings - Fork 623
Automate source terms in FEM #1410
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
Comments
This was the cause of the problem in #1399 where we had an ODE for the concentration at each point (y,z) |
Is the problem that the mass matrix always assumes everything is a laplacian unless you wrap it in |
It’s because you expect to end up with discretised equations of the form It’s not a huge deal to do this manually at the moment, but it is confusing. If/when we add more spatial methods we’ll have to think a bit more carefully about issues like this. |
Hi! Seems interestihng. Should I take this up? |
Hii, I'd love to take my attempt at solving this issue. I've defined a
I ran the example you had sent, but I'm not able to test with it. Would love some guidance on how to proceed from here
wrap function seems to work though :) ps: still working on it, have made some progress |
I have fixed the function. Am getting correct output now and all except one of the integration tests are passing
Can someone please review this? the only integration test that failed was
|
When you solve an ODE (pointwise) using the FEM the variable on the lhs is multiplied by the mass matrix upon discretisation. If you wrap the rhs in
pybamm.source
then it also gets multiplied by the mass matrix so everything is fine. However, it would be easy to miss this. We should either NOT multiply the lhs by the mass matrix OR automate addingpybamm.source
where it is needed.See this example
a
gives the wrong result, butb
andc
are correct (becauseb
has domain negative electrode it is discretised by FVM and becausec
usessource
)The text was updated successfully, but these errors were encountered: