Exemple #1
0
def test_rate_type_exists():
    reaction_properties = {
        'equation': 'H + O2  [=] OH + O',
        'id': 'reaction01',
        'products': {
            'O': '1',
            'OH': '1'
        },
        'rate_params': {
            'A': 3520000.0,
            'E': 71400.0,
            'b': -0.7
        },
        'rate_type': '',
        'reactants': {
            'H': '1',
            'O2': '1'
        },
        'reversible': 'no',
        'type': ' Elementary'
    }

    try:
        elementary_reaction = chemkin.ElementaryReaction(reaction_properties)
    except ValueError as err:
        assert (type(err) == ValueError)
Exemple #2
0
def test_for_reversible():
    reaction_properties = {
        'equation': 'H + O2  [=] OH + O',
        'id': 'reaction01',
        'products': {
            'O': '1',
            'OH': '1'
        },
        'rate_params': {
            'A': 3520000.0,
            'E': 71400.0,
            'b': -0.7
        },
        'rate_type': 'Arrhenius',
        'reactants': {
            'H': '1',
            'O2': '1'
        },
        'reversible': 'yes',
        'type': ' Elementary'
    }
    try:
        elementary_reaction = chemkin.ElementaryReaction(reaction_properties)
    except NotImplementedError as err:
        assert (type(err) == NotImplementedError)
Exemple #3
0
def test_calculate_arr_coeff():
    reaction_properties = {
        'equation': 'H + O2  [=] OH + O',
        'id': 'reaction01',
        'products': {
            'O': '1',
            'OH': '1'
        },
        'rate_params': {
            'A': 3520000.0,
            'E': 71400.0,
            'b': -0.7
        },
        'rate_type': 'Arrhenius',
        'reactants': {
            'H': '1',
            'O2': '1'
        },
        'reversible': 'no',
        'type': ' Elementary'
    }

    elementary_reaction = chemkin.ElementaryReaction(reaction_properties)
    assert elementary_reaction.calculate_rate_coefficient(
        1000) == 5.2102032610668552
Exemple #4
0
def test_get_products():
    reaction_properties = {
        'equation': 'H + O2  [=] OH + O',
        'id': 'reaction01',
        'products': {
            'O': '1',
            'OH': '1'
        },
        'rate_params': {
            'A': 3520000.0,
            'E': 71400.0,
            'b': -0.7
        },
        'rate_type': 'Arrhenius',
        'reactants': {
            'H': '1',
            'O2': '1'
        },
        'reversible': 'no',
        'type': ' Elementary'
    }
    elementary_reaction = chemkin.ElementaryReaction(reaction_properties)
    assert elementary_reaction.get_products() == {'O': '1', 'OH': '1'}