我正在尝试使用具有生物质热解动力学方案的 Cantera 来观察间歇反应器中浓度随时间的变化。下面显示了动力学的概述以及对论文的参考。请注意,物种浓度是基于质量的,例如kg/m^3
。
- 木材 = 生物质,通常是松木
- 气体 = 包含轻质不凝性气体的集总物质
- 焦油 = 可冷凝热解蒸气的集总物质
- char = 完全热解的木材,基本上是碳
参考:Colomba Di Blasi。多孔固体燃料热解过程中的对流和二次反应效应分析。燃烧科学与技术,卷。90,第 315-340 页,1993 年。
假设初始木材浓度为1.0
,我可以使用 Python 求解反应速率方程组,并绘制随时间的转换,如下所示。
不幸的是,我在 Cantera 中使用动力学方案的尝试给出了关于不兼容相类型的错误。我的blasi.cti
文件包含以下内容:
#-------------------------------------------------------------------------------
# Phases data
#-------------------------------------------------------------------------------
stoichiometric_solid(
name = "wood",
species = "wood",
density = (700, "kg/m3")
)
ideal_gas(
name = "gas",
species = "gas"
)
ideal_gas(
name = "tar",
species = "tar"
)
stoichiometric_solid(
name = "char",
species = "char",
density = (110, "kg/m3")
)
#-------------------------------------------------------------------------------
# Species data
#-------------------------------------------------------------------------------
species(
name="wood"
)
species(
name = "gas"
)
species(
name = "tar"
)
species(
name = "char"
)
#-------------------------------------------------------------------------------
# Reaction data
#-------------------------------------------------------------------------------
# Reaction 1
reaction("wood => gas", [1.4345e4, 0, 88.6])
# Reaction 2
reaction("wood => tar", [4.125e6, 0, 112.7])
# Reaction 3
reaction("wood => char", [7.3766e5, 0, 106.5])
# Reaction 4
reaction("tar => gas", [4.28e6, 0, 108])
# Reaction 5
reaction("tar => char", [1.0e6, 0, 108])
blasi_reactor.py
使用上述文件的 Python 文件cti
是:
import cantera as ct
import matplotlib.pyplot as plt
tk = 773.15 # temperature [K]
p = 101325.0 # pressure [Pa]
gas = ct.Solution('blasi.cti')
gas.TP = tk, p
r = ct.IdealGasConstPressureReactor(gas)
sim = ct.ReactorNet([r])
time = 0.0
states = ct.SolutionArray(gas, extra=['t'])
for n in range(50):
time += 1.0
sim.advance(time)
states.append(r.thermo.state, t=time)
plt.figure()
plt.plot(states.t, states.X[:, gas.species_index('wood')])
plt.plot(states.t, states.X[:, gas.species_index('gas')])
plt.plot(states.t, states.X[:, gas.species_index('tar')])
plt.plot(states.t, states.X[:, gas.species_index('char')])
plt.xlabel('Time [s]')
plt.ylabel('Concentration [kg/m^3]')
plt.show()
Cantera 的错误信息是:
Traceback (most recent call last):
File "blasi_cantera.py", line 9, in <module>
r = ct.IdealGasConstPressureReactor(gas)
File "interfaces/cython/cantera/reactor.pyx", line 191, in cantera._cantera.Reactor.__init__
File "interfaces/cython/cantera/reactor.pyx", line 28, in cantera._cantera.ReactorBase.__init__
File "interfaces/cython/cantera/reactor.pyx", line 199, in cantera._cantera.Reactor.insert
File "interfaces/cython/cantera/reactor.pyx", line 50, in cantera._cantera.ReactorBase.insert
cantera._cantera.CanteraError:
***********************************************************************
CanteraError thrown by IdealGasReactor::setThermoMgr:
Incompatible phase type provided
***********************************************************************
如何使用 Cantera 定义集中的物种,例如木材、天然气、焦油和炭?甚至有可能在 Cantera 中使用这样的动力学方案吗?我通常使用 Python 创建自己的热解模型,但我想使用 Cantera 中的反应器功能。这也可以让我比较 Cantera 和我的个人 Python 模型之间的结果。
注意 - 我查看了 Cantera 文档网站上的示例,但所有内容都是针对明确定义的气相物种,您知道元素组成和 NASA 系数。