[CTI] Allow CTI files containing only reaction definitions

The reactions in these files can be referenced by other CTI/XML files, or used
directly to create Reaction objects. The absence of a phase definition requires
that either (a) all reactions are in bulk phases, or (b) the rate constants are
given in kmol, meter, second units since it is impossible to determine the
dimensionality of the concentration for each species.
This commit is contained in:
Ray Speth 2015-04-27 16:08:01 -04:00
parent caf71b839c
commit b6ac3ce995

View file

@ -1188,21 +1188,27 @@ class reaction(object):
nm = -999
nl = -999
mindim = 4
for ph in _phases:
if ph.has_species(s):
nm, nl = ph.conc_dim()
if ph.is_ideal_gas():
self._igspecies.append(s)
if not ph in rxnph:
rxnph.append(ph)
self._dims[ph._dim] += 1
if ph._dim < mindim:
self._rxnphase = ph
mindim = ph._dim
break
if nm == -999:
raise CTI_Error("species "+s+" not found")
if _phases:
mindim = 4
for ph in _phases:
if ph.has_species(s):
nm, nl = ph.conc_dim()
if ph.is_ideal_gas():
self._igspecies.append(s)
if not ph in rxnph:
rxnph.append(ph)
self._dims[ph._dim] += 1
if ph._dim < mindim:
self._rxnphase = ph
mindim = ph._dim
break
if nm == -999:
raise CTI_Error("species "+s+" not found")
else:
# If no phases are defined, assume all reactants are in bulk
# phases
nm = 1
nl = -3
self.mdim += nm*ns
self.ldim += nl*ns