Error while running thermal x-lumped model with specific settings

Hello, I am using a custom data set to simulate thermal 1C discharge. Below is the MWE. I was able to run this simulation with default var_pts. But when I change the default, I get the following error: How can I resolve this?

I am running the latest PyBaMM version on Windows (No WSL).

  • I was able to run this simulation using PyBaMM 24.1 installed on WSL.
import pybamm

options = {"dimensionality":2, "thermal":"x-lumped", "current collector": "potential pair"}
model = pybamm.lithium_ion.DFN(options=options)

parameter_values = pybamm.ParameterValues("Custom_data")
parameter_values["Ambient temperature [K]"] = 308.15

var = pybamm.standard_spatial_vars
var_pts = {
        var.x_n: 40,  # negative electrode 
        var.x_s: 10,  # separator
        var.x_p: 40,  # positive electrode
        var.r_n: 10,  # negative particle
        var.r_p: 10,   # positive particle
        var.y: 10,
        var.z: 10
        }

solver = pybamm.IDAKLUSolver(root_method="casadi")
sim = pybamm.Simulation(model,parameter_values=parameter_values, var_pts=var_pts, solver=solver)
sim.solve([0,3600])
RuntimeError: C:\vcpkg\buildtrees\casadi\src\3.6.7-3e2b7fb881.clean\casadi\core\serializing_stream.cpp:49: Assertion "in_s.good()" failed:
Invalid input stream. If you specified an input file, make sure it exists relative to the current directory.

Thanks for the help!

Hi everyone,

Any suggestions on this?

Hi @appana.3, can you please try running this on WSL with the latest version of pybamm? Additionally, can you please share your custom parameters?

Hi @Marc ,

My apologies for not being able to respond till now. I was digging further into this.

I cannot share the custom parameters. I was also verifying the implementation on WSL. I realized that I was running my earlier simulations with default mesh. So I don’t have this running on any version with any setup!

Can you help me figure out why this error is occurring and how I can resolve it?

I have not been able to reproduce this bug using the default parameter set. Can you please verify if this issue is due to your parameter set, and if so, produce a minimum working example of the issue?