Replies: 1 comment 2 replies
-
all of those mesh sizes will be sufficient for graphical accuracy. you could choose a much coarser mesh to see a difference in the plot to convince yourself the mesh is actually changing. even better, calculate the error and plot that. |
Beta Was this translation helpful? Give feedback.
2 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.
-
I conducted tests using PyBaMM's P2D model with different mesh sizes, namely 100, 1000, and 5000. However, I observed that the results for all these mesh sizes were identical.

Given these observations, I'm concerned about a potential error in my code setup. However, the increasing computation time with finer mesh sizes suggests that PyBaMM is indeed recognizing and processing the mesh configurations.
Below is my code with 1000 mesh size:
import pybamm
import numpy as np
model = pybamm.lithium_ion.DFN()
var_pts = {
"x_n": 490, # negative electrode
"x_s": 73, # separator
"x_p": 437, # positive electrode
"r_n": 20, # negative particle
"r_p": 20, # positive particle
}
parameter_values = pybamm.ParameterValues("Chen2020")
solver = pybamm.CasadiSolver(mode="fast", atol=1e-10, rtol=1e-6)
sim = pybamm.Simulation(model,parameter_values=parameter_values,var_pts=var_pts,solver=solver)
sim.solve([0, 3600])
sim.plot()
If anyone has insights or suggestions on this issue, I'd greatly appreciate it. Thanks in advance for your time and assistance!
Beta Was this translation helpful? Give feedback.
All reactions