Closed jcsutherland closed 5 years ago
Hmm, this one is a little tricky. Right now pyMARS assumes a single ideal_gas
object, but you're right that some files will have multiple.
What it should do is modify the lists of species and reactions in each object.
Where things get tricky is if the ideal_gas
objects include different sets of species and/or reactions. I'll need to look into this a bit more.
@jcsutherland so, this seems to be an issue with the methane-gri30.cti
file you are using; if I just try to create a cantera.Solution
object with it, Cantera throws the error above:
gas = ct.Solution('methane-gri30.cti')
---------------------------------------------------------------------------
CanteraError Traceback (most recent call last)
<ipython-input-2-3045edfef451> in <module>
----> 1 gas = ct.Solution('methane-gri30.cti')
interfaces/cython/cantera/base.pyx in cantera._cantera._SolutionBase.__cinit__()
interfaces/cython/cantera/base.pyx in cantera._cantera._SolutionBase._init_cti_xml()
CanteraError:
***********************************************************************
CanteraError thrown by Factory::create:
No such type: 'gri30'
***********************************************************************
I think the issue is the kinetics = "GRI30",
line that appears in each ideal_gas
object. If I remove that, the file loads without error; in fact, the GRI Mech 3.0 included with Cantera does not have that line, and this is the model we use for a bunch of unit tests.
However, regarding the presence of multiple ideal_gas
objects: the current behavior of pyMARS is to reduce whichever is loaded by default when creating a Cantera.Solution
object from the CTI file. In the case of gri30.cti
, this is the first one, without the transport field specified. The retained species
objects contain their transport data, though.
In the situation that the CTI file contains multiple ideal_gas
objects, I don't think we want to try reducing each of them (in case they contain varying numbers/sets of species or reactions).
Instead, I think the best solution is to include the name of the object to be reduced as an optional reduction input (now contained in a single YAML file, per e6ec139).
Background
Cantera allows specification of various
ideal_gas
objects to include different species/elements/reactions from the input file. It doesn't appear thatpyMARS
supports this, and it isn't clear if it is looking for a magic string somewhere.It appears that this does not play well with
pyMARS
Error description
When running against a
cti
file including the above examples, the following exception occurs:Steps to reproduce
Unzip the attached file and then run the following:
methanefiles.zip