Replies: 1 comment 8 replies
-
I think there are two main issues here. First, that the order of the variables in the function should be x_p = pybamm.standard_spatial_vars.x_p |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Dear team,
I am trying to assign a positive particle concentration distribution as initial c_s_p field. The idea is to interpolant a 2D(x,r) initial c_s_p matrix(which is solution["Positive particle concentration [mol.m-3]"].entries[:,:,-1]) to spatial variables(x_p, r_var). Here x_p is spacial variable in domain"positive electrode" and r_var is spacial variable in domain "positive particle":
xxx = (x[40:,0], r[:,0])
x_p= pybamm.SpatialVariable("x", domain="positive electrode")
r_var = pybamm.SpatialVariable("r", domain="positive particle")
model.initial_conditions[c_s_p]=pybamm.Interpolant(xxx, solution["Positive particle concentration [mol.m-3]"].entries[:,:,0], (x_p, r_var), interpolator="linear")
One error was reported and said x_p and r_var should have the same domain. How should I set x_p? Or are there methods in pybamm to assign an initial distribution?
Thank you so much for your help!
Beta Was this translation helpful? Give feedback.
All reactions