s-amouyal12 / cantera

Automatically exported from code.google.com/p/cantera
0 stars 0 forks source link

enable converting cti files to xml with molecules with non-integer values of the atomic composition #223

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When using ctmethods it is not allowed to use molecules in the definition of 
the species within the cti-file with an atomic composition which is not an 
integer. E.g. C12.5H33.22 would not work, but C12H33 would work. But when using 
sum-formulas of multi-component mixtures this might be necessary.

The problem is due to the definition "def getAtomicComp(Atoms)" (~line 367) in 
ctml_writer.py:
d[b[0]] = int(b[1]) and can easily be solved when this line is changed to
d[b[0]] = float(b[1])

it worked with my cantera-version. 

The changed version is enclosed.

Original issue reported on code.google.com by Mort...@gmx.de on 5 Jun 2014 at 8:55

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed in r2989.

I'm not aware of any cases where this capability has been exercised in Cantera, 
so proceed with caution, as there may be other places where it is assumed that 
the atomicity of each element in a species is an integer. 

Original comment by yarmond on 6 Jun 2014 at 2:12