I utilized the standard Constant Current Constant Voltage (CCCV) method to conduct cycle charge and discharge tests, using the same parameters and setting as outlined in OKane 2022. The code is provided below. It is evident that the values of the two simulation results differ significantly. I would like to know if there are any errors in the settings.
import pybamm
from packaging import version
if version.parse(pybamm.__version__) > version.parse('24.9'):
pybamm.telemetry.disable()
# pybamm.set_logging_level("NOTICE")
option = {
"thermal": "lumped",
"SEI": "solvent-diffusion limited",
"SEI porosity change": "true",
"lithium plating": "partially reversible",
"lithium plating porosity change": "true",
"particle mechanics": ("swelling and cracking", "swelling only"),
"SEI on cracks": "true",
"loss of active material": "stress-driven",
"calculate discharge energy": "true",
}
SPMe = pybamm.lithium_ion.SPMe(options=option)
DFN = pybamm.lithium_ion.DFN(options=option)
param = pybamm.ParameterValues("OKane2022")
var_pts_values = {
"x_n": 5,
"x_s": 5,
"x_p": 5,
"r_n": 30,
"r_p": 30,
}
initial_soc = 0
experiment = pybamm.Experiment(
[
tuple(
[
"Charge at 0.7C until 4.2 V",
"Hold at 4.2 V until 50 mA",
"Discharge at 0.2C until 2.5 V",
]
)
] * 100,
termination="80% capacity",
)
sim_DFN = pybamm.Simulation(
DFN,
experiment=experiment,
parameter_values=param,
var_pts=var_pts_values,
)
sol_DFN = sim_DFN.solve(
initial_soc=initial_soc,
showprogress=True,
)
sim_SPMe = pybamm.Simulation(
SPMe,
experiment=experiment,
parameter_values=param,
var_pts=var_pts_values,
)
sol_SPMe = sim_SPMe.solve(
initial_soc=initial_soc,
showprogress=True,
)
print('\nDFN:')
print(f' {(sol_DFN.all_summary_variables[0]["Capacity [A.h]"])}')
print(f' {(sol_DFN.all_summary_variables[-1]["Capacity [A.h]"])}')
print(f' {((sol_DFN.all_summary_variables[0]["Capacity [A.h]"]) - (sol_DFN.all_summary_variables[-1]["Capacity [A.h]"]) )}')
print('\nSPMe:')
print(f' {(sol_SPMe.all_summary_variables[0]["Capacity [A.h]"])}')
print(f' {(sol_SPMe.all_summary_variables[-1]["Capacity [A.h]"])}')
print(f' {((sol_SPMe.all_summary_variables[0]["Capacity [A.h]"]) - (sol_SPMe.all_summary_variables[-1]["Capacity [A.h]"]) )}')
>> Cycling: 100%|██████████| 100/100 [21:39<00:00, 13.00s/it]
Cycling: 100%|██████████| 100/100 [00:59<00:00, 1.68it/s]
DFN:
5.106328298616319
5.06217694038829
0.04415135822802885
SPMe:
5.109480803993036
5.091366998818747
0.01811380517428951