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

plotting of 2D current collector variables #1051

Closed
rtimms opened this issue Jun 12, 2020 · 0 comments · Fixed by #1055
Closed

plotting of 2D current collector variables #1051

rtimms opened this issue Jun 12, 2020 · 0 comments · Fixed by #1055
Assignees
Labels
bug Something isn't working

Comments

@rtimms
Copy link
Contributor

rtimms commented Jun 12, 2020

Doing sim.plot with a 2D current collector variable doesn't give the correct plot, but also doesn't raise an error. We should either fix it or raise an error.

e.g. doing

options = {
    "current collector": "potential pair",
    "dimensionality": 2,  # 2D current collectors
    "thermal": "x-lumped",
}
model = pybamm.lithium_ion.SPM(options)
sim = pybamm.Simulation(model)
solution = sim.solve()

sim.plot(["Negative current collector potential [V]"])

gives the wrong plot. But

phi_s_cn = solution["Negative current collector potential [V]"]

param = model.default_parameter_values
L_z = param.evaluate(pybamm.standard_parameters_lithium_ion.L_z)
l_y = phi_s_cp.y_sol[-1]  # dimensionless width
l_z = phi_s_cp.z_sol[-1]  # dimensionless height
y_plot = np.linspace(0, l_y, 21) * L_z
z_plot = np.linspace(0, l_z, 21) * L_z
t_plot = 1000

phi_s_cn_plot = plt.pcolormesh(
    y_plot, z_plot, phi_s_cn(y=y_plot, z=z_plot, t=t_plot), shading="gouraud"
)

gives the correct result. The result from sim.plot is transposed, so we just need to catch/fix this in quickplot.

@rtimms rtimms added the bug Something isn't working label Jun 12, 2020
@rtimms rtimms self-assigned this Jun 14, 2020
rtimms added a commit that referenced this issue Jun 14, 2020
@rtimms rtimms mentioned this issue Jun 14, 2020
8 tasks
rtimms added a commit that referenced this issue Jun 15, 2020
rtimms added a commit that referenced this issue Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant