Hello,
I have some questions regarding the calculation of heat generation in the lumped thermal model. In PyBaMM, the heat generation is calculated using information such as the exchange current density and electrode potentials, while the commonly used Bernardi formula estimates heat generation based on battery current, terminal voltage, and open circuit voltage, i.e., Q=I(U-Uocv)
(neglecting the reversible heat term for now).
Theoretically, these two approaches differ primarily in their level of detail, and the results should be generally comparable. However, when I simulate using PyBaMM, I notice that the value of “Total heating [W]” output by the model differs significantly from the value calculated using the Bernardi formula based on simulated current and voltage.
import pybamm
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib import rcParams
DFN = pybamm.lithium_ion.DFN({"thermal": "lumped"})
VAR_PTS = {"x_n": 15, "x_s": 10, "x_p": 15, "r_n": 10, "r_p": 10}
SOLVER = pybamm.CasadiSolver(dt_max=100, atol=1e-6, rtol=1e-6, return_solution_if_failed_early=True)
PARAM = pybamm.ParameterValues('Chen2020')
experiment_1C = pybamm.Experiment(
[
("Charge at 1C until 4.2V",
"Rest for 10 min"),
],
period="1 seconds")
sim = pybamm.Simulation(DFN, solver=SOLVER, experiment=experiment_1C, parameter_values=PARAM, var_pts=VAR_PTS)
# 仿真
solution_ = sim.solve(initial_soc=0)
t_sim = solution_["Time [s]"].entries
V_sim = solution_["Terminal voltage [V]"].entries
ocv_sim = solution_["Battery open-circuit voltage [V]"].entries
I_sim = solution_["Current [A]"].entries
Total_heat_sim= solution_["Total heating [W]"].entries
def calculate_total_heat(I, Ut, Uocv):
P = np.zeros_like(I)
for i in range(len(I)):
P[i] = I[i]*(Ut[i]-Uocv[i])
return P
Total_heating_calculate = calculate_total_heat(-I_sim, V_sim, ocv_sim)
plt.rcParams['font.family'] = 'Times New Roman' ## 将图中字体设置为新罗马字体
fig, ax = plt.subplots(figsize=(7.5, 6))
ax.plot(t_sim, Total_heating_calculate, label='sim_self_cal')
ax.plot(t_sim, Total_heat_sim, label='sim_model_output')
ax.set_ylabel('I*(Ut-Uocv) [W]', fontsize=20)
ax.set_xlabel('Time [s]', fontsize=20)
ax.tick_params(labelsize=18)
ax.legend(fontsize=15)
ax.set_title('Total heating [W]', fontsize=20)
plt.show()
I would like to ask:
- Is there something I may have misunderstood about the way PyBaMM calculates heat generation?
- Or could there be an inconsistency in the heat generation calculation within PyBaMM?
- Additionally, is there an existing interface or recommended approach to directly calculate battery heat generation using the Bernardi formula within PyBaMM?
Thank you very much for your support!