我试图从现有的详细机制中提取一些骨架机制。在这里你可以看到从GRI3.0机制中提取子机制。有没有办法在CANTERA中导出子机制。更具体地说,我能以某种方式将以下示例中的gas2导出到.cti或.xml文件中吗?
from cantera import *
import numpy as np
reaction_mech = 'gri30.cti'
all_species = Species.listFromFile(reaction_mech)
species = []
# Filter species
for S in all_species:
comp = S.composition
if 'C' in comp and comp.get('C') >= 2:
# Exclude all C compounds with more than 2 C atoms
continue
species.append(S)
species_names = {S.name for S in species}
print('Species: {0}'.format(', '.join(S.name for S in species)))
all_reactions = Reaction.listFromFile(reaction_mech)
reactions = []
for R in all_reactions:
if not all(reactant in species_names for reactant in R.reactants):
continue
if not all(product in species_names for product in R.products):
continue
reactions.append(R)
gas1 = Solution('gri30.xml')
gas2 = Solution(thermo='IdealGas', kinetics='GasKinetics',
species=species, reactions=reactions)发布于 2016-11-17 14:56:56
在Cantera用户论坛中解决:Cantera Froum
https://stackoverflow.com/questions/40609645
复制相似问题