Dimension error when setting variable domains for custom model #2886
-
I am trying to model a coupled electrochemical reaction using the BaseModel class. The reaction contains two surface-confined species (denoted by *) and two species in solution: Ox* + e- <-> Red* Currently, I have an issue with getting the equations simulating the surface-confined species and the species in solution to interact with each other. These are the model variables: c_Ox = pybamm.Variable("O(surf) [non-dim]") and the PDEs:
And here is what is setting up the boundary and initial conditions as well as the spatial variables and domain geometry:
}) I believe my issue might be with the domains. However, when I tried adding a domain to the c_Ox state variables or even just putting them in the same domain as c_s and c_p I got a dimension error: test_shape ShapeError: Cannot find shape (original error: dimension mismatch) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
Hi Can you share a minimum working example we can run at our end? At the moment some components of the equations (like |
Beta Was this translation helpful? Give feedback.
Ok, I managed to remove the error I was getting on my end but, weirdly, then it runs fine with no errors. I suspect that the two errors might be related actually. Can you try defining
Eapp = pybamm.Scalar(0)
(and commenting out the current definition ofEapp
) and see if the error disappears? If so, then we can focus on fixing it.