Example #1
0
 def test_explicit_forward_order(self):
     if os.path.exists('explicit-forward-order.cti'):
         os.remove('explicit-forward-order.cti')
     ck2cti.convertMech('../data/explicit-forward-order.inp',
                        thermoFile='../data/dummy-thermo.dat',
                        outName='explicit-forward-order.cti', quiet=True)
     ref, gas = self.checkConversion('../data/explicit-forward-order.xml',
                                     'explicit-forward-order.cti')
     self.checkKinetics(ref, gas, [300, 800, 1450, 2800], [5e3, 1e5, 2e6])
Example #2
0
    def test_pdep(self):
        if os.path.exists('pdep_test.cti'):
            os.remove('pdep_test.cti')

        ck2cti.convertMech('../data/pdep-test.inp',
                           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], [5e3, 1e5, 2e6])
Example #3
0
    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])
Example #4
0
    def test_gri30(self):
        if os.path.exists('gri30_test.cti'):
            os.remove('gri30_test.cti')

        ck2cti.convertMech('../../data/inputs/gri30.inp',
                           transportFile='../../data/transport/gri30_tran.dat',
                           outName='gri30_test.cti', quiet=True)

        ref, gas = self.checkConversion('gri30.xml', 'gri30_test.cti')
        self.checkKinetics(ref, gas, [300, 1500], [5e3, 1e5, 2e6])
Example #5
0
 def test_explicit_forward_order(self):
     if os.path.exists('explicit-forward-order.cti'):
         os.remove('explicit-forward-order.cti')
     ck2cti.convertMech('../data/explicit-forward-order.inp',
                        thermoFile='../data/dummy-thermo.dat',
                        outName='explicit-forward-order.cti',
                        quiet=True)
     ref, gas = self.checkConversion('../data/explicit-forward-order.xml',
                                     'explicit-forward-order.cti')
     self.checkKinetics(ref, gas, [300, 800, 1450, 2800], [5e3, 1e5, 2e6])
Example #6
0
    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)

        ref, gas = self.checkConversion('../data/nasa9-test.xml',
                                        'nasa9_test.cti')
        self.checkThermo(ref, gas, [300, 500, 1200, 5000])
Example #7
0
    def test_gri30(self):
        if os.path.exists('gri30_test.cti'):
            os.remove('gri30_test.cti')

        ck2cti.convertMech('../../data/inputs/gri30.inp',
                           transportFile='../../data/transport/gri30_tran.dat',
                           outName='gri30_test.cti',
                           quiet=True)

        ref, gas = self.checkConversion('gri30.xml', 'gri30_test.cti')
        self.checkKinetics(ref, gas, [300, 1500], [5e3, 1e5, 2e6])
Example #8
0
    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)

        ref, gas = self.checkConversion('../data/nasa9-test.xml',
                                        'nasa9_test.cti')
        self.checkThermo(ref, gas, [300, 500, 1200, 5000])
Example #9
0
    def test_soot(self):
        if os.path.exists('soot_test.cti'):
            os.remove('soot_test.cti')

        ck2cti.convertMech('../data/soot.inp',
                           thermoFile='../data/soot-therm.dat',
                           outName='soot_test.cti', quiet=True)

        ref, gas = self.checkConversion('../data/soot.xml', 'soot_test.cti')
        self.checkThermo(ref, gas, [300, 1100])
        self.checkKinetics(ref, gas, [300, 1100], [5e3, 1e5, 2e6])
Example #10
0
    def test_transport_normal(self):
        if os.path.exists('h2o2_transport_normal.cti'):
            os.remove('h2o2_transport_normal.cti')

        ck2cti.convertMech('../../data/inputs/h2o2.inp',
                           transportFile='../../data/transport/gri30_tran.dat',
                           outName='h2o2_transport_normal.cti', quiet=True)

        gas = ct.IdealGasMix('h2o2_transport_normal.cti')
        gas.set(X='H2:1.0, O2:1.0', T=300, P=101325)
        self.assertAlmostEqual(gas.thermalConductivity(), 0.07663, 4)
Example #11
0
    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])
Example #12
0
    def test_pdep(self):
        if os.path.exists('pdep_test.cti'):
            os.remove('pdep_test.cti')

        ck2cti.convertMech('../data/pdep-test.inp',
                           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], [5e3, 1e5, 2e6])
Example #13
0
    def test_transport_normal(self):
        if os.path.exists('h2o2_transport_normal.cti'):
            os.remove('h2o2_transport_normal.cti')

        ck2cti.convertMech('../../data/inputs/h2o2.inp',
                           transportFile='../../data/transport/gri30_tran.dat',
                           outName='h2o2_transport_normal.cti',
                           quiet=True)

        gas = ct.IdealGasMix('h2o2_transport_normal.cti')
        gas.set(X='H2:1.0, O2:1.0', T=300, P=101325)
        self.assertAlmostEqual(gas.thermalConductivity(), 0.07663, 4)
Example #14
0
    def test_soot(self):
        if os.path.exists('soot_test.cti'):
            os.remove('soot_test.cti')

        ck2cti.convertMech('../data/soot.inp',
                           thermoFile='../data/soot-therm.dat',
                           outName='soot_test.cti',
                           quiet=True)

        ref, gas = self.checkConversion('../data/soot.xml', 'soot_test.cti')
        self.checkThermo(ref, gas, [300, 1100])
        self.checkKinetics(ref, gas, [300, 1100], [5e3, 1e5, 2e6])
Example #15
0
    def test_missingThermo(self):
        if os.path.exists('h2o2_missingThermo.cti'):
            os.remove('h2o2_missingThermo.cti')

        self.assertRaises(ck2cti.InputParseError,
                          lambda: ck2cti.convertMech('../data/h2o2_missingThermo.inp',
                                                    quiet=True))
Example #16
0
    def test_missingElement(self):
        if os.path.exists('h2o2_missingElement.cti'):
            os.remove('h2o2_missingElement.cti')

        self.assertRaises(
            ck2cti.InputParseError,
            lambda: ck2cti.convertMech('../data/h2o2_missingElement.inp',
                                       quiet=True))
Example #17
0
    def test_explicit_reverse_rate(self):
        if os.path.exists('explicit-reverse-rate.cti'):
            os.remove('explicit-reverse-rate.cti')
        ck2cti.convertMech('../data/explicit-reverse-rate.inp',
                           thermoFile='../data/dummy-thermo.dat',
                           outName='explicit-reverse-rate.cti', quiet=True)
        ref, gas = self.checkConversion('../data/explicit-reverse-rate.xml',
                                        'explicit-reverse-rate.cti')
        self.checkKinetics(ref, gas, [300, 800, 1450, 2800], [5e3, 1e5, 2e6])

        # Reactions with explicit reverse rate constants are transformed into
        # two irreversible reactions with reactants and products swapped.
        Rr = gas.revRateConstants()
        self.assertEqual(Rr[0], 0.0)
        self.assertEqual(Rr[1], 0.0)
        Rstoich = gas.reactantStoichCoeffs()
        Pstoich = gas.productStoichCoeffs()
        self.assertEqual(list(Rstoich[:,0]), list(Pstoich[:,1]))
        self.assertEqual(list(Rstoich[:,1]), list(Pstoich[:,0]))
Example #18
0
    def test_explicit_reverse_rate(self):
        if os.path.exists('explicit-reverse-rate.cti'):
            os.remove('explicit-reverse-rate.cti')
        ck2cti.convertMech('../data/explicit-reverse-rate.inp',
                           thermoFile='../data/dummy-thermo.dat',
                           outName='explicit-reverse-rate.cti',
                           quiet=True)
        ref, gas = self.checkConversion('../data/explicit-reverse-rate.xml',
                                        'explicit-reverse-rate.cti')
        self.checkKinetics(ref, gas, [300, 800, 1450, 2800], [5e3, 1e5, 2e6])

        # Reactions with explicit reverse rate constants are transformed into
        # two irreversible reactions with reactants and products swapped.
        Rr = gas.revRateConstants()
        self.assertEqual(Rr[0], 0.0)
        self.assertEqual(Rr[1], 0.0)
        Rstoich = gas.reactantStoichCoeffs()
        Pstoich = gas.productStoichCoeffs()
        self.assertEqual(list(Rstoich[:, 0]), list(Pstoich[:, 1]))
        self.assertEqual(list(Rstoich[:, 1]), list(Pstoich[:, 0]))
Example #19
0
 def convert():
     ck2cti.convertMech('../../data/inputs/h2o2.inp',
                        transportFile='../data/h2o2-bad-geometry-tran.dat',
                        outName='h2o2_transport_bad_geometry.cti',
                        quiet=True)
Example #20
0
 def convert():
     ck2cti.convertMech('../../data/inputs/h2o2.inp',
                        transportFile='../data/h2o2-duplicate-species-tran.dat',
                        outName='h2o2_transport_duplicate_species.cti',
                        quiet=True)
Example #21
0
 def convert():
     ck2cti.convertMech(
         '../../data/inputs/h2o2.inp',
         transportFile='../data/h2o2-duplicate-species-tran.dat',
         outName='h2o2_transport_duplicate_species.cti',
         quiet=True)
Example #22
0
 def convert():
     ck2cti.convertMech(
         '../../data/inputs/h2o2.inp',
         transportFile='../data/h2o2-bad-geometry-tran.dat',
         outName='h2o2_transport_bad_geometry.cti',
         quiet=True)