1. Doyle-Fuller-Newman (DFN) model电化学模型简单调用
import pybamm #在python中引入电池电化学模拟代码库
model = pybamm.lithium_ion.DFN()
#调用Doyle-Fuller-Newman (DFN) 锂离子电池模型
sim = pybamm.Simulation(model) # 仿真
sim.solve([0, 3600]) #求解
sim.plot() #绘制主要的参数曲线
以上简单语句是调用Doyle-Fuller-Newman (DFN) 锂离子电池模型,所有参数全部采用模型默认值,以1C电流放电过程的模拟,并且绘制主要的参数曲线。模拟过程与结果如下:
2. 模型变量以及参数值的查找
# 1. Doyle-Fuller-Newman (DFN) model电化学模型简单调用
import pybamm #在python中导入电池电化学模拟代码库
model = pybamm.lithium_ion.DFN() #调用Doyle-Fuller-Newman (DFN) 锂离子电池模型
# 模型变量列表查看
model.variable_names() #模型变量列表
#参数值可用search查找
parameter_values.search("electrolyte")#查看模型中包含指定单词electrolyte的参数值
前面采用模型默认参数运行了放电模拟,第二部分代码介绍模型中变量的查找,以及参数值查看,以上代码运行结果如下:
模型变量查找结果:
Electrolyte concentration
Electrolyte concentration [Molar]
Electrolyte concentration [mol.m-3]
Electrolyte current density
Electrolyte current density [A.m-2]
Electrolyte flux
Electrolyte flux [mol.m-2.s-1]
Electrolyte potential
Electrolyte potential [V]
Electrolyte tortuosity
Gradient of electrolyte potential
Gradient of negative electrolyte potential
Gradient of positive electrolyte potential
Gradient of separator electrolyte potential
Negative electrolyte concentration
Negative electrolyte concentration [Molar]
Negative electrolyte concentration [mol.m-3]
Negative electrolyte potential
Negative electrolyte potential [V]
Negative electrolyte tortuosity
Positive electrolyte concentration
Positive electrolyte concentration [Molar]
Positive electrolyte concentration [mol.m-3]
Positive electrolyte potential
Positive electrolyte potential [V]
Positive electrolyte tortuosity
Separator electrolyte concentration
Separator electrolyte concentration [Molar]
Separator electrolyte concentration [mol.m-3]
Separator electrolyte potential
Separator electrolyte potential [V]
Sum of electrolyte reaction source terms
Sum of negative electrode electrolyte reaction source terms
Sum of positive electrode electrolyte reaction source terms
Sum of x-averaged negative electrode electrolyte reaction source terms
Sum of x-averaged positive electrode electrolyte reaction source terms
X-averaged battery electrolyte ohmic losses [V]
X-averaged electrolyte concentration
X-averaged electrolyte concentration [Molar]
X-averaged electrolyte concentration [mol.m-3]
X-averaged electrolyte overpotential
X-averaged electrolyte overpotential [V]
X-averaged electrolyte potential
X-averaged electrolyte potential [V]
X-averaged negative electrolyte concentration
X-averaged negative electrolyte concentration [mol.m-3]
X-averaged negative electrolyte potential
X-averaged negative electrolyte potential [V]
X-averaged negative electrolyte tortuosity
X-averaged positive electrolyte concentration
X-averaged positive electrolyte concentration [mol.m-3]
X-averaged positive electrolyte potential
X-averaged positive electrolyte potential [V]
X-averaged positive electrolyte tortuosity
X-averaged separator electrolyte concentration
X-averaged separator electrolyte concentration [mol.m-3]
X-averaged separator electrolyte potential
X-averaged separator electrolyte potential [V]
参数值查看结果:
EC initial concentration in electrolyte [mol.m-3] 4541.0
Electrolyte conductivity [S.m-1]
Electrolyte diffusivity [m2.s-1]
Initial concentration in electrolyte [mol.m-3] 1000.0
Negative electrode Bruggeman coefficient (electrolyte) 1.5
Positive electrode Bruggeman coefficient (electrolyte) 1.5
Separator Bruggeman coefficient (electrolyte) 1.5
Typical electrolyte concentration [mol.m-3] 1000.0
3.可以对模型默认参数进行简单修改
# 1. Doyle-Fuller-Newman (DFN) model电化学模型简单调用
import pybamm #在python中导入电池电化学模拟代码库
model = pybamm.lithium_ion.DFN() #调用Doyle-Fuller-Newman (DFN) 锂离子电池模型
#查看默认参数值
parameter_values = model.default_parameter_values
parameter_values.search("Current function [A]") #用search查看默认参数值
#可以对默认参数进行简单修改:
parameter_values["Current function [A]"] = 3 #修改参数值
parameter_values.search("Current function [A]") #查看修改后参数值
以上代码运行结果如下:
Current function [A] 0.680616 默认参数值,放电电流
Current function [A] 3 修改后参数值