Error while running simulations with IDAKLU solver and "dimensionality: 2" on Windows using the latest PyBaMM version

Hello,

Find below a MWE of the problem I have. When I run this, I get the error shown!

import pybamm
options = {"dimensionality": 2, "current collector": "potential pair"}
model = pybamm.lithium_ion.DFN(options=options)
parameter_values = pybamm.ParameterValues("NCA_Kim2011")
experiment = pybamm.Experiment(
    [
        (
            "Discharge at C/100 for 1 hours or until 2.5 V"      # Discharge experiment
        )
    ]
)
solver = pybamm.IDAKLUSolver()
sim = pybamm.Simulation(model,parameter_values=parameter_values, solver=solver,experiment=experiment)
sim.solve()

MemoryError: Unable to allocate 13.8 GiB for an array with shape (43002, 43002) and data type float64

I was able to run this simulation with the prior 25.1 release on Windows and with the current release using WSL. How do I fix this?

Hey everyone,

Any suggestions on this?

Bumping it back up! Please provide some suggestions

@appana.3, you can reduce the memory footprint by decreasing the number of spatial points in the PDE mesh. For example,

var_pts = model.default_var_pts
var_pts['x'] = 5
var_pts['y'] = 5
var_pts['z'] = 5

sim = pybamm.Simulation(
    model,
    parameter_values=parameter_values,
    solver=solver,
    experiment=experiment,
    var_pts=var_pts,
)

reduced the number of equations by 3.6x.

Hello @Marc ,

Thank you for your response. I understand that I can reduce the number of equations by reducing the spatial points in the mesh.

Is there a major change in the latest 25.1 release that prevents me from running this simulation, while I was able to run it on a prior 25.1 release?