Hi Mathieu,
In the XML format, pre-exponential factors were always expressed in mks+kmol units. In the YAML format, we preserve the unit system from the source input file (whether that’s CK or CTI) and do the conversion to mks+kmol when loading the mechanism. The units applying to the file are contained in the units section at the top of the file. Anything not appearing here is assumed to follow the mks+kmol default. For example, here is the units section for Varga2016_from_CK.yaml:
units: {length: cm, time: s, quantity: mol, activation-energy: K}In contrast, Varga2016_from_XML.yaml doesn’t contain a units section, but does specify units for some quantities—namely, activation energies—on the individual values. In addition to the high-level test that the flame speed is identical when using either input file, you can also see this by examining the reaction parameters directly from the Python interface, which always uses mks+kmol units:
>>> from_ck = ct.Solution('Varga2016_from_CK.yaml') >>> from_xml = ct.Solution('Varga2016_from_XML.yaml') >>> from_ck.reaction(0) Out[4]: H + O2 <=> O + OH <Arrhenius> >>> from_ck.reaction(0).rate.pre_exponential_factor 5071200000000.001 >>> from_xml.reaction(0).rate.pre_exponential_factor 5071200000000.0 >>> from_ck.reaction(0).rate.activation_energy 67481010.05519351 >>> from_xml.reaction(0).rate.activation_energy 67481010.05519351Finally, if you want to create a YAML file with all the values converted to a particular unit system for use in an external application, you can load the file in Python and then write a new YAML file where certain units have been specified using the write_yaml method:
fromck.write_yaml('outfile.yaml', units={'quantity': 'kmol', 'activation-energy': 'eV'})Regards,
Ray