Hi
when I am trying to calculate an equilibrium involving surface reaction I get the following fault:
Traceback (most recent call last):
File "C:\Users\rml\PycharmProjects\ThermoChemistry\calc-thermochemistry.py", line 21, in <module>
mix.equilibrate('TP')
File "build\\python\\cantera\\mixture.pyx", line 336, in cantera.mixture.Mixture.equilibrate
cantera._utils.CanteraError:
*******************************************************************************
CanteraError thrown by Phase::assignDensity:
density must be positive. density = -nan
*******************************************************************************
Source code:
import cantera as ct
p = 1e0*ct.one_atm # pressure
T = 1073.0 # surface temperature
gas = ct.Solution("CaCO3-calcination-surface.yaml", "gas")
CaCO3_phase = ct.Solution("CaCO3-calcination-surface.yaml","CaCO3_s")
CaO_phase = ct.Solution("CaCO3-calcination-surface.yaml", "CaO_s")
surf_phase = ct.Interface("CaCO3-calcination-surface.yaml", "CaO_surf", adjacent=[gas, CaCO3_phase, CaO_phase])
surf_phase.TPX = T, p, 'CaO(S): 1e8, CO2(S):1 '
gas.TPX = T, p, 'N2:1, CO2:0'
CaCO3_phase.TP = T, p
CaO_phase.TP = T, p
mix = ct.Mixture([(gas, 11.357), (CaCO3_phase, 10), (CaO_phase, 0.01), (surf_phase, 2.7063e-5)])
mix.T = T
mix.P = p
mix.equilibrate('TP')
print(mix.report())
If I omit (surf_phase, 2.7063e-5) from the Mixture then Cantera calculates the right equilibrium for the mixture - however; the surface is omitted. It seems like Cantera is missing density data for the surface?! I have set the moles for the gasphase as the amount of moles in 1 m³ and for the surface as moles on 1 m².
Creating a reactor network with the involved phases and surface seems to work fine - except it is not possible to calculate an equilibrium for a reactor network as far as I know.
So, am I doing something wrong or ...?
Thanks in advance
Mikael