diff --git a/test/data/dummy-thermo.dat b/test/data/dummy-thermo.dat new file mode 100644 index 000000000..07bf26334 --- /dev/null +++ b/test/data/dummy-thermo.dat @@ -0,0 +1,82 @@ +THERMO ALL + 300.000 1000.000 5000.000 +! NOTE: All of this thermo data is bogus +H H 1 G 200.000 3500.000 1000.000 1 + 2.50000001E+00-2.30842973E-11 1.61561948E-14-4.73515235E-18 4.98197357E-22 2 + 2.54736599E+04-4.46682914E-01 2.50000000E+00 7.05332819E-13-1.99591964E-15 3 + 2.30081632E-18-9.27732332E-22 2.54736599E+04-4.46682853E-01 4 + +R1A 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 +R1B 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 +P1 C 2H 7 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 + +R2 C 2H 7 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 +P2A 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 +P2B 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 + +R3 C 2H 7 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 +P3A 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 +P3B 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 + +R4 C 1H 3 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 +P4 C 1H 3 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 + +R5 C 2H 7 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 +P5A 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 +P5B 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 + +R6 C 2H 8 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 +P6A 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 +P6B 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 diff --git a/test/data/sri-falloff.inp b/test/data/sri-falloff.inp new file mode 100644 index 000000000..bc21e5e46 --- /dev/null +++ b/test/data/sri-falloff.inp @@ -0,0 +1,25 @@ +ELEMENTS +H C AR +END + +SPECIES +H +R1A R1B P1 +R2 P2A P2B +R3 +END + +REACTIONS + +! SRI Falloff reaction (3 parameter) +R1A+R1B(+M) = P1+H(+M) 1.0E18 -2.0 1000 + LOW/4.0E25 -3.0 0/ + SRI/0.54 201.0 1024.0/ + R3/2/ P2A/5/ + +! SRI Falloff reaction (5 parameter) +H+R2(+M) = P2A+P2B(+M) 4.0E18 -0.5 100 + LOW/7.0E26 -1.0 0/ + SRI/1.1 700.0 1234.0 56 0.7/ + R3/3/ P1/0.4/ R1A/0.0/ +END diff --git a/test/data/sri-falloff.xml b/test/data/sri-falloff.xml new file mode 100644 index 000000000..97cd5c975 --- /dev/null +++ b/test/data/sri-falloff.xml @@ -0,0 +1,204 @@ + + + + + + + H C Ar + + H R1A R1B P1 R2 + P2A P2B R3 + + + 300.0 + 101325.0 + + + + + + + + + + + + H:1 + + + + 2.500000000E+00, 7.053328190E-13, -1.995919640E-15, 2.300816320E-18, + -9.277323320E-22, 2.547365990E+04, -4.466828530E-01 + + + + 2.500000010E+00, -2.308429730E-11, 1.615619480E-14, -4.735152350E-18, + 4.981973570E-22, 2.547365990E+04, -4.466829140E-01 + + + + + + + H:4 C:1 + + + + 5.149876130E+00, -1.367097880E-02, 4.918005990E-05, -4.847430260E-08, + 1.666939560E-11, -1.024664760E+04, -4.641303760E+00 + + + + 7.485149500E-02, 1.339094670E-02, -5.732858090E-06, 1.222925350E-09, + -1.018152300E-13, -9.468344590E+03, 1.843731800E+01 + + + + + + + H:4 C:1 + + + + 5.149876130E+00, -1.367097880E-02, 4.918005990E-05, -4.847430260E-08, + 1.666939560E-11, -1.024664760E+04, -4.641303760E+00 + + + + 7.485149500E-02, 1.339094670E-02, -5.732858090E-06, 1.222925350E-09, + -1.018152300E-13, -9.468344590E+03, 1.843731800E+01 + + + + + + + H:7 C:2 + + + + 5.149876130E+00, -1.367097880E-02, 4.918005990E-05, -4.847430260E-08, + 1.666939560E-11, -1.024664760E+04, -4.641303760E+00 + + + + 7.485149500E-02, 1.339094670E-02, -5.732858090E-06, 1.222925350E-09, + -1.018152300E-13, -9.468344590E+03, 1.843731800E+01 + + + + + + + H:7 C:2 + + + + 5.149876130E+00, -1.367097880E-02, 4.918005990E-05, -4.847430260E-08, + 1.666939560E-11, -1.024664760E+04, -4.641303760E+00 + + + + 7.485149500E-02, 1.339094670E-02, -5.732858090E-06, 1.222925350E-09, + -1.018152300E-13, -9.468344590E+03, 1.843731800E+01 + + + + + + + H:4 C:1 + + + + 5.149876130E+00, -1.367097880E-02, 4.918005990E-05, -4.847430260E-08, + 1.666939560E-11, -1.024664760E+04, -4.641303760E+00 + + + + 7.485149500E-02, 1.339094670E-02, -5.732858090E-06, 1.222925350E-09, + -1.018152300E-13, -9.468344590E+03, 1.843731800E+01 + + + + + + + H:4 C:1 + + + + 5.149876130E+00, -1.367097880E-02, 4.918005990E-05, -4.847430260E-08, + 1.666939560E-11, -1.024664760E+04, -4.641303760E+00 + + + + 7.485149500E-02, 1.339094670E-02, -5.732858090E-06, 1.222925350E-09, + -1.018152300E-13, -9.468344590E+03, 1.843731800E+01 + + + + + + + H:7 C:2 + + + + 5.149876130E+00, -1.367097880E-02, 4.918005990E-05, -4.847430260E-08, + 1.666939560E-11, -1.024664760E+04, -4.641303760E+00 + + + + 7.485149500E-02, 1.339094670E-02, -5.732858090E-06, 1.222925350E-09, + -1.018152300E-13, -9.468344590E+03, 1.843731800E+01 + + + + + + + + + R1A + R1B (+ M) [=] P1 + H (+ M) + + + 1.000000E+15 + -2.0 + 1000.000000 + + + 4.000000E+19 + -3.0 + 0.000000 + + P2A:5.0 R3:2.0 + 0.54 201 1024 + + R1B:1 R1A:1.0 + H:1 P1:1.0 + + + + + H + R2 (+ M) [=] P2A + P2B (+ M) + + + 4.000000E+15 + -0.5 + 100.000000 + + + 7.000000E+20 + -1.0 + 0.000000 + + P1:0.4 R1A:0.0 R3:3.0 + 1.1 700 1234 56 0.7 + + H:1.0 R2:1 + P2A:1.0 P2B:1 + + + diff --git a/test/python/testConvert.py b/test/python/testConvert.py index b0c336f45..cee6e5412 100644 --- a/test/python/testConvert.py +++ b/test/python/testConvert.py @@ -1,6 +1,7 @@ import os import unittest import numpy as np +import itertools import ck2cti import utilities @@ -38,10 +39,10 @@ class chemkinConverterTest(utilities.CanteraTest): self.assertNear(ref_h[i], gas_h[i], 1e-7) self.assertNear(ref_s[i], gas_s[i], 1e-7) - def checkKinetics(self, ref, gas, temperatures): - for T in temperatures: - ref.set(T=T, P=ct.OneAtm) - gas.set(T=T, P=ct.OneAtm) + def checkKinetics(self, ref, gas, temperatures, pressures): + for T,P in itertools.product(temperatures, pressures): + ref.set(T=T, P=P) + gas.set(T=T, P=P) ref_kf = ref.fwdRateConstants() ref_kr = ref.revRateConstants() gas_kf = gas.fwdRateConstants() @@ -60,7 +61,7 @@ class chemkinConverterTest(utilities.CanteraTest): outName='gri30_test.cti', quiet=True) ref, gas = self.checkConversion('gri30.xml', 'gri30_test.cti') - self.checkKinetics(ref, gas, [300, 1500]) + self.checkKinetics(ref, gas, [300, 1500], [5e3, 1e5, 2e6]) def test_soot(self): if os.path.exists('soot_test.cti'): @@ -72,7 +73,7 @@ class chemkinConverterTest(utilities.CanteraTest): ref, gas = self.checkConversion('../data/soot.xml', 'soot_test.cti') self.checkThermo(ref, gas, [300, 1100]) - self.checkKinetics(ref, gas, [300, 1100]) + self.checkKinetics(ref, gas, [300, 1100], [5e3, 1e5, 2e6]) def test_pdep(self): if os.path.exists('pdep_test.cti'): @@ -82,7 +83,7 @@ class chemkinConverterTest(utilities.CanteraTest): outName='pdep_test.cti', quiet=True) ref, gas = self.checkConversion('../data/pdep-test.xml', 'pdep_test.cti') - self.checkKinetics(ref, gas, [300, 800, 1450, 2800]) + self.checkKinetics(ref, gas, [300, 800, 1450, 2800], [5e3, 1e5, 2e6]) def test_missingElement(self): @@ -111,3 +112,14 @@ class chemkinConverterTest(utilities.CanteraTest): ref, gas = self.checkConversion('../data/nasa9-test.xml', 'nasa9_test.cti') self.checkThermo(ref, gas, [300, 500, 1200, 5000]) + + def test_sri_falloff(self): + if os.path.exists('sri-falloff.cti'): + os.remove('sri-falloff.cti') + ck2cti.convertMech('../data/sri-falloff.inp', + thermoFile='../data/dummy-thermo.dat', + outName='sri-falloff.cti', quiet=True) + + ref, gas = self.checkConversion('../data/sri-falloff.xml', + 'sri-falloff.cti') + self.checkKinetics(ref, gas, [300, 800, 1450, 2800], [5e3, 1e5, 2e6])