[ck2cti] Fix for mechanism files with in-line transport data

This commit is contained in:
Ray Speth 2013-07-08 01:35:23 +00:00
parent e8ab4dda28
commit 812ec6ef77
3 changed files with 42 additions and 0 deletions

View file

@ -1518,6 +1518,7 @@ class Parser(object):
transportLines.append('!'.join((line, comment)))
else:
transportLines.append(line)
line, comment = readline()
line, comment = readline()

View file

@ -0,0 +1,31 @@
Elements
H C
END
SPECIES
foo bar baz
END
thermo
300.000 1000.000 5000.000
foo C 1H 4 G 200.000 3500.000 1000.000 1
7.48514950E-02 1.33909467E-02-5.73285809E-06 1.22292535E-09-1.01815230E-13 2
-9.46834459E+03 1.84373180E+01 5.14987613E+00-1.36709788E-02 4.91800599E-05 3
-4.84743026E-08 1.66693956E-11-1.02466476E+04-4.64130376E+00 4
bar C 1H 4 G 200.000 3500.000 1000.000 1
7.48514950E-02 1.33909467E-02-5.73285809E-06 1.22292535E-09-1.01815230E-13 2
-9.46834459E+03 1.84373180E+01 5.14987613E+00-1.36709788E-02 4.91800599E-05 3
-4.84743026E-08 1.66693956E-11-1.02466476E+04-4.64130376E+00 4
baz C 1H 4 G 200.000 3500.000 1000.000 1
7.48514950E-02 1.33909467E-02-5.73285809E-06 1.22292535E-09-1.01815230E-13 2
-9.46834459E+03 1.84373180E+01 5.14987613E+00-1.36709788E-02 4.91800599E-05 3
-4.84743026E-08 1.66693956E-11-1.02466476E+04-4.64130376E+00 4
end
reactions
foo + bar = 2 baz 1.2345e12 1.0 200.0
2foo + baz = 3bar 5.4321e10 1.0 500.0
end
transport
foo 2 357.000 5.180 0.000 0.000 1.000
bar 2 266.800 4.982 0.000 0.000 1.000
baz 2 266.800 4.982 0.000 0.000 1.000
end

View file

@ -200,6 +200,16 @@ class chemkinConverterTest(utilities.CanteraTest):
gas.set(X='H2:1.0, O2:1.0', T=300, P=101325)
self.assertAlmostEqual(gas.thermalConductivity(), 0.07663, 4)
def test_transport_embedded(self):
convertMech('../data/with-transport.inp',
outName='with-transport.cti', quiet=True)
gas = ct.IdealGasMix('with-transport.cti')
gas.set(X=[0.2, 0.3, 0.5])
D = gas.mixDiffCoeffs()
for d in D:
self.assertTrue(d > 0.0)
def test_transport_missing_species(self):
def convert():
convertMech('../../data/inputs/h2o2.inp',