Importing species from different sources in YAML file

155 views
Skip to first unread message

Julian

unread,
Apr 10, 2024, 3:07:03 PM4/10/24
to Cantera Users' Group
Hi everyone,

I am trying to use a subset of a gas phase reaction mechanism that I defined in a yaml file ABF.yaml, but then add additional gas phase species that can be produced via heterogeneous reactions.

From the example file ptcombust.yaml, I know how to import a subset of a gas phase mechanism defined in another file and define a surface phase. However, when I try to include a second list of gas phase species, cantera throws and InputFileError. Of course I could just create a new file defining all species at once, but it would be nice to maintain the modularity and not having to repeat the species definitions again.

I have created a minimum not working example. Thank you for your help.

Best,
Julian
min_not_working_example.ipynb
OCM_on_Ideal.yaml
ABF.yaml

Ray Speth

unread,
Apr 18, 2024, 7:39:05 PM4/18/24
to Cantera Users' Group

Hi,

If you want to specify species from multiple sources, you need to specify the section name (or file and section name) for each one. So in this case, you just need to specify that the three locally-defined species are in the species section (changed line in bold):

phases: - name: gas thermo: ideal-gas elements: [O, H, C, N, Ar] species: - ABF.yaml/species: [H, OH, HO2, H2, H2O, H2O2, O, O2, C, CH, CH2, CH2*, CH3, CH4, CO, CO2, HCO, CH2O, CH2OH, CH3O, CH3OH, C2H, C2H2, C2H3, C2H4, C2H5, C2H6, C2O, HCCO, CH2CO, HCCOH, C2H3O, AR, N2, C3H2, C3H3, p-C3H4, a-C3H4, C4H, C4H2, H2C4O, n-C4H3, i-C4H3, C4H4, n-C4H5, i-C4H5, C4H613, C4H612] # Only consider species up to C4 - species: [C2H4O, C3H4, CH3OO] kinetics: gas transport: mixture-averaged state: T: 800.0 P: 1 atm X: {CH4: 4, O2: 1} reactions: - ABF.yaml/reactions: declared-species

Regards,
Ray

Julian

unread,
Apr 23, 2024, 4:15:35 PM4/23/24
to Cantera Users' Group
Great, thank you very much Ray!
Reply all
Reply to author
Forward
0 new messages