Exemplo n.º 1
0
def test_read_rxn_ktp_dct():
    """ Test the rxn_ktp_dct reader
    """
    rxn_ktp_dct = {
        (('N2O', ), ('N2', 'O'), ('+M', )): {
            'high': (np.array([1000., 1500.,
                               2000.]), np.array([10.0, 100.0, 1000.0]))
        }
    }
    calc_rates = rates.read_rxn_ktp_dct(rxn_ktp_dct, LOW_P_RXN, 'high',
                                        'rates')
    temps = rates.read_rxn_ktp_dct(rxn_ktp_dct, LOW_P_RXN, 'high', 'temps')
    assert np.allclose(calc_rates, np.array([10.0, 100.0, 1000.0]))
    assert np.allclose(temps, np.array([1000., 1500., 2000.]))
Exemplo n.º 2
0
def test_arr():
    """ Test the Arrhenius calculator
    """
    rxn_ktp_dct = rates.eval_rxn_param_dct(ARR_RXN_PARAM_DCT, TEMPS, PRESSURES)
    calc_rates = rates.read_rxn_ktp_dct(rxn_ktp_dct, LOW_P_RXN, 'high',
                                        'rates')
    assert np.allclose(calc_rates, ARRHENIUS_KTS, rtol=1e-3)
Exemplo n.º 3
0
def test_lind():
    """ Test the Lindemann calculator
    """
    rxn_ktp_dct = rates.eval_rxn_param_dct(LIND_RXN_PARAM_DCT, TEMPS,
                                           PRESSURES)
    calc_rates = rates.read_rxn_ktp_dct(rxn_ktp_dct, HIGH_P_RXN, 10.0, 'rates')
    assert np.allclose(calc_rates, LIND_10ATM_KTS, rtol=1e-3)
Exemplo n.º 4
0
def test_troe():
    """ Test the Troe calculator
    """
    rxn_ktp_dct = rates.eval_rxn_param_dct(TROE_RXN_PARAM_DCT, TEMPS,
                                           PRESSURES)
    calc_rates = rates.read_rxn_ktp_dct(rxn_ktp_dct, HIGH_P_RXN, 10.0, 'rates')
    assert np.allclose(calc_rates, TROE_10ATM_KTS, rtol=1e-3)
Exemplo n.º 5
0
def test_dup_plog():
    """ Test the PLOG calculator for a duplicate reaction
    """
    rxn_ktp_dct = rates.eval_rxn_param_dct(DUP_PLOG_RXN_PARAM_DCT, TEMPS,
                                           PRESSURES)
    calc_rates = rates.read_rxn_ktp_dct(rxn_ktp_dct, HIGH_P_RXN, 0.316,
                                        'rates')
    assert np.allclose(calc_rates, 2 * PLOG_0_3ATM_KTS, rtol=1e-3)
Exemplo n.º 6
0
def test_dup_arrhenius():
    """ Test the Arrhenius calculator for a duplicate reaction
    """
    rxn_ktp_dct = rates.eval_rxn_param_dct(DUP_ARR_RXN_PARAM_DCT, TEMPS,
                                           PRESSURES)
    calc_rates = rates.read_rxn_ktp_dct(rxn_ktp_dct, LOW_P_RXN, 'high',
                                        'rates')
    assert np.allclose(calc_rates, 2 * ARRHENIUS_KTS, rtol=1e-3)
Exemplo n.º 7
0
def test_cheb():
    """ Test the Chebyshev calculator
    """
    rxn_ktp_dct = rates.eval_rxn_param_dct(CHEB_RXN_PARAM_DCT, TEMPS2,
                                           PRESSURES)
    calc_rates = rates.read_rxn_ktp_dct(rxn_ktp_dct, HIGH_P_RXN, 100.0,
                                        'rates')
    assert np.allclose(calc_rates, CHEB_100ATM_KTS, rtol=1e-3)
Exemplo n.º 8
0
def test_plog():
    """ Test the PLOG calculator
    """
    rxn_ktp_dct = rates.eval_rxn_param_dct(PLOG_RXN_PARAM_DCT, TEMPS3,
                                           PRESSURES)
    calc_rates = rates.read_rxn_ktp_dct(rxn_ktp_dct, HIGH_P_RXN, 0.316,
                                        'rates')
    assert np.allclose(calc_rates, PLOG_0_3ATM_KTS, rtol=1e-3)