diff --git a/test_problems/nasa9_reader/sampleData.inp b/test/data/nasa9-test-therm.dat
similarity index 100%
rename from test_problems/nasa9_reader/sampleData.inp
rename to test/data/nasa9-test-therm.dat
diff --git a/test_problems/nasa9_reader/sample.inp b/test/data/nasa9-test.inp
similarity index 100%
rename from test_problems/nasa9_reader/sample.inp
rename to test/data/nasa9-test.inp
diff --git a/test_problems/nasa9_reader/sample.xml b/test/data/nasa9-test.xml
similarity index 93%
rename from test_problems/nasa9_reader/sample.xml
rename to test/data/nasa9-test.xml
index 072355abc..d18ed4d62 100644
--- a/test_problems/nasa9_reader/sample.xml
+++ b/test/data/nasa9-test.xml
@@ -27,13 +27,13 @@
7.750600970E+04, -1.440779717E+03, 1.401744141E+01, -6.381631240E-03,
- 5.871674720E-06, -2.908872278E-09, 5.994050890E-13, -6.579343180E+04
+ 5.871674720E-06, -2.908872278E-09, 5.994050890E-13, -6.579343180E+04,
-4.494017799E+01
-1.378630916E+05, -5.579207290E+01, 1.004190387E+01, -1.682165339E-05,
- 3.724664660E-09, -4.275526780E-13, 1.982341329E-17, -7.343407470E+04
+ 3.724664660E-09, -4.275526780E-13, 1.982341329E-17, -7.343407470E+04,
-2.045130429E+01
@@ -45,22 +45,22 @@
Ref-Species. Chase, 1998 3/82.
-1
-
+
0.000000000E+00, 0.000000000E+00, 2.500000000E+00, 0.000000000E+00,
- 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, -7.453750000E+02
+ 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, -7.453750000E+02,
-1.172081224E+01
0.000000000E+00, 0.000000000E+00, 2.500000000E+00, 0.000000000E+00,
- 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, -7.453750000E+02
+ 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, -7.453750000E+02,
-1.172081224E+01
0.000000000E+00, 0.000000000E+00, 2.500000000E+00, 0.000000000E+00,
- 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, -7.453750000E+02
+ 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, -7.453750000E+02,
-1.172081224E+01
@@ -74,19 +74,19 @@
0.000000000E+00, 0.000000000E+00, 2.500000000E+00, 0.000000000E+00,
- 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, -7.453750000E+02
+ 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, -7.453750000E+02,
4.379674910E+00
2.010538475E+01, -5.992661070E-02, 2.500069401E+00, -3.992141160E-08,
- 1.205272140E-11, -1.819015576E-15, 1.078576636E-19, -7.449939610E+02
+ 1.205272140E-11, -1.819015576E-15, 1.078576636E-19, -7.449939610E+02,
4.379180110E+00
-9.951265080E+08, 6.458887260E+05, -1.675894697E+02, 2.319933363E-02,
- -1.721080911E-06, 6.531938460E-11, -9.740147729E-16, -5.078300340E+06
+ -1.721080911E-06, 6.531938460E-11, -9.740147729E-16, -5.078300340E+06,
1.465298484E+03
diff --git a/test/python/testConvert.py b/test/python/testConvert.py
index f84b69d40..964f4a0f1 100644
--- a/test/python/testConvert.py
+++ b/test/python/testConvert.py
@@ -3,9 +3,10 @@ import unittest
import numpy as np
import ck2cti
+import utilities
import Cantera as ct
-class chemkinConverterTest(unittest.TestCase):
+class chemkinConverterTest(utilities.CanteraTest):
def checkConversion(self, refFile, testFile):
ref = ct.IdealGasMix(refFile)
gas = ct.IdealGasMix(testFile)
@@ -55,3 +56,27 @@ class chemkinConverterTest(unittest.TestCase):
self.assertRaises(ck2cti.InputParseError,
lambda: ck2cti.convertMech('../data/h2o2_missingThermo.inp',
quiet=True))
+
+ def test_nasa9(self):
+ if os.path.exists('nasa9_test.cti'):
+ os.remove('nasa9_test.cti')
+ ck2cti.convertMech('../data/nasa9-test.inp',
+ thermoFile='../data/nasa9-test-therm.dat',
+ outName='nasa9_test.cti', quiet=True)
+
+ self.checkConversion('../data/nasa9-test.xml', 'nasa9_test.cti')
+
+ ref = ct.IdealGasMix('../data/nasa9-test.xml')
+ gas = ct.IdealGasMix('nasa9_test.cti')
+
+ for T in [300, 500, 1200, 5000]:
+ ref_cp = ref.cp_R()
+ gas_cp = gas.cp_R()
+ ref_h = ref.enthalpies_RT()
+ gas_h = gas.enthalpies_RT()
+ ref_s = ref.entropies_R()
+ gas_s = gas.entropies_R()
+ for i in range(gas.nSpecies()):
+ self.assertNear(ref_cp[i], gas_cp[i], 1e-7)
+ self.assertNear(ref_h[i], gas_h[i], 1e-7)
+ self.assertNear(ref_s[i], gas_s[i], 1e-7)
diff --git a/test_problems/SConscript b/test_problems/SConscript
index ae27f9057..21bb79500 100644
--- a/test_problems/SConscript
+++ b/test_problems/SConscript
@@ -249,11 +249,6 @@ CompileAndTest('mixGasTransport',
CompileAndTest('multiGasTransport',
'multiGasTransport', 'multiGasTransport', 'output_blessed.txt')
CompileAndTest('NASA9poly', 'NASA9poly_test', 'NASA9poly_test', 'output_blessed.txt')
-Test('nasa9_reader', 'nasa9_reader', '#build/bin/ck2cti$PROGSUFFIX', None,
- options='-i sample.inp -id sample -t sampleData.inp',
- comparisons=[('sample_blessed.cti', 'sample.cti')],
- ignoreLines=['#'],
- artifacts=['ck2cti.log'])
negA = localenv.Program('negATest/negATest',
mglob(env, 'negATest', 'cpp'),
diff --git a/test_problems/nasa9_reader/Makefile.am b/test_problems/nasa9_reader/Makefile.am
deleted file mode 100644
index 1773e7087..000000000
--- a/test_problems/nasa9_reader/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-TESTS = runtest
\ No newline at end of file
diff --git a/test_problems/nasa9_reader/runtest b/test_problems/nasa9_reader/runtest
deleted file mode 100755
index a563727d7..000000000
--- a/test_problems/nasa9_reader/runtest
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/sh
-
-echo " "
-echo "***************************************************"
-echo " Testing CK2CTI on NASA9 Thermodynamics : using the build/bin version of ck2cti"
-echo "***************************************************"
-echo " "
-BINDIR=@buildbin@
-CK2CTI=$BINDIR/ck2cti
-/bin/rm -f sample.cti
-echo "...Test 1: Converting file sample.inp..."
-$CK2CTI -i ./sample.inp -id sample -t sampleData.inp
-#
-# strip out variably dated stuff
-#
-cat sample.cti | sed '1,5s/^#.*$/#/' > samplea.cti
-#
-# Change all 3 character exponent expressions starting with 0
-# into 2 character exponent expressions
-# (MSVC++ defaults to 3, and I can't figure out how to change
-# this behavior).
-#
-../../bin/exp3to2.sh samplea.cti > sampleb.cti
-#
-#
-diff sampleb.cti sample_blessed.cti > diff_test.out
-retnStat=$?
-#
-if [ $retnStat = "0" ]
-then
- echo "Successful diff comparison on ck2cti test (nasa9_reader/sample.inp)"
- return 0
-else
- echo "########################################################"
- echo "Unsuccessful diff comparison on ck2cti test (nasa9_reader/sample.inp)"
- echo " For more information, see files:"
- echo " test_problems/nasa9_reader/diff_test.out"
- echo " test_problems/nasa9_reader/sampleb.cti"
- echo " test_problems/nasa9_reader/sample_blessed.cti"
- echo "########################################################"
- return 1
-fi
diff --git a/test_problems/nasa9_reader/sample_blessed.cti b/test_problems/nasa9_reader/sample_blessed.cti
deleted file mode 100644
index 406e8a3f0..000000000
--- a/test_problems/nasa9_reader/sample_blessed.cti
+++ /dev/null
@@ -1,70 +0,0 @@
-#
-#
-#
-#
-units(length = "cm", time = "s", quantity = "mol", act_energy = "cal/mol")
-
-
-ideal_gas(name = "sample",
- elements = " O H Al Cl E Ar ",
- species = """ ALCL3 e- AR """,
- reactions = "all",
- initial_state = state(temperature = 300.0,
- pressure = OneAtm) )
-
-
-
-#-------------------------------------------------------------------------------
-# Species data
-#-------------------------------------------------------------------------------
-
-species(name = "ALCL3",
- atoms = " Al:1 Cl:3 ",
- thermo = (
- NASA9( [ 200.00, 1000.00], [ 7.750600970E+04, -1.440779717E+03, 1.401744141E+01,
- -6.381631240E-03, 5.871674720E-06, -2.908872278E-09,
- 5.994050890E-13, -6.579343180E+04, -4.494017799E+01] ),
- NASA9( [ 1000.00, 6000.00], [ -1.378630916E+05, -5.579207290E+01, 1.004190387E+01,
- -1.682165339E-05, 3.724664660E-09, -4.275526780E-13,
- 1.982341329E-17, -7.343407470E+04, -2.045130429E+01] )
- ),
- note = " Gurvich,1996a pt1 p173 pt2 p134."
- )
-
-species(name = "e-",
- atoms = " E:1 ",
- thermo = (
- NASA9( [ 298.15, 1000.00], [ 0.000000000E+00, 0.000000000E+00, 2.500000000E+00,
- 0.000000000E+00, 0.000000000E+00, 0.000000000E+00,
- 0.000000000E+00, -7.453750000E+02, -1.172081224E+01] ),
- NASA9( [ 1000.00, 6000.00], [ 0.000000000E+00, 0.000000000E+00, 2.500000000E+00,
- 0.000000000E+00, 0.000000000E+00, 0.000000000E+00,
- 0.000000000E+00, -7.453750000E+02, -1.172081224E+01] ),
- NASA9( [ 6000.00, 20000.00], [ 0.000000000E+00, 0.000000000E+00, 2.500000000E+00,
- 0.000000000E+00, 0.000000000E+00, 0.000000000E+00,
- 0.000000000E+00, -7.453750000E+02, -1.172081224E+01] )
- ),
- note = " Ref-Species. Chase, 1998 3/82. "
- )
-
-species(name = "AR",
- atoms = " Ar:1 ",
- thermo = (
- NASA9( [ 200.00, 1000.00], [ 0.000000000E+00, 0.000000000E+00, 2.500000000E+00,
- 0.000000000E+00, 0.000000000E+00, 0.000000000E+00,
- 0.000000000E+00, -7.453750000E+02, 4.379674910E+00] ),
- NASA9( [ 1000.00, 6000.00], [ 2.010538475E+01, -5.992661070E-02, 2.500069401E+00,
- -3.992141160E-08, 1.205272140E-11, -1.819015576E-15,
- 1.078576636E-19, -7.449939610E+02, 4.379180110E+00] ),
- NASA9( [ 6000.00, 20000.00], [ -9.951265080E+08, 6.458887260E+05, -1.675894697E+02,
- 2.319933363E-02, -1.721080911E-06, 6.531938460E-11,
- -9.740147729E-16, -5.078300340E+06, 1.465298484E+03] )
- ),
- note = " Ref-Elm. Moore,1971. Gordon,1999.. "
- )
-
-
-
-#-------------------------------------------------------------------------------
-# Reaction data
-#-------------------------------------------------------------------------------