@@ -24,9 +24,9 @@ def test_implicit_three_body(self):
24
24
rate-constant: {A: 2.08e+19, b: -1.24, Ea: 0.0}
25
25
"""
26
26
rxn1 = ct .Reaction .from_yaml (yaml1 , self .gas )
27
- self . assertEqual ( rxn1 .reaction_type , "three-body" )
28
- self . assertEqual ( rxn1 .default_efficiency , 0. )
29
- self . assertEqual ( rxn1 .efficiencies , {"O2" : 1 })
27
+ assert rxn1 .rate . type == "three-body-Arrhenius"
28
+ assert rxn1 .rate . default_efficiency == 0.
29
+ assert rxn1 .rate . efficiencies == {"O2" : 1 }
30
30
31
31
yaml2 = """
32
32
equation: H + O2 + M <=> HO2 + M
@@ -36,8 +36,9 @@ def test_implicit_three_body(self):
36
36
efficiencies: {O2: 1.0}
37
37
"""
38
38
rxn2 = ct .Reaction .from_yaml (yaml2 , self .gas )
39
- self .assertEqual (rxn1 .efficiencies , rxn2 .efficiencies )
40
- self .assertEqual (rxn1 .default_efficiency , rxn2 .default_efficiency )
39
+ assert rxn2 .rate .type == "three-body-Arrhenius"
40
+ assert rxn1 .rate .efficiencies == rxn2 .rate .efficiencies
41
+ assert rxn1 .rate .default_efficiency == rxn2 .rate .default_efficiency
41
42
42
43
def test_duplicate (self ):
43
44
# @todo simplify this test
@@ -46,25 +47,27 @@ def test_duplicate(self):
46
47
species = self .gas .species (), reactions = [])
47
48
48
49
yaml1 = """
49
- equation: H + O2 + H2O <=> HO2 + H2O
50
+ equation: H + O2 + M <=> HO2 + M
50
51
rate-constant: {A: 1.126e+19, b: -0.76, Ea: 0.0}
52
+ type: three-body
53
+ default-efficiency: 0
54
+ efficiencies: {H2O: 1}
51
55
"""
52
56
rxn1 = ct .Reaction .from_yaml (yaml1 , gas1 )
57
+ print (rxn1 .reaction_type , rxn1 .rate .type )
58
+ assert rxn1 .rate .type == "three-body-Arrhenius"
53
59
54
60
yaml2 = """
55
- equation: H + O2 + M <=> HO2 + M
61
+ equation: H + O2 + H2O <=> HO2 + H2O
56
62
rate-constant: {A: 1.126e+19, b: -0.76, Ea: 0.0}
57
- type: three-body
58
- default-efficiency: 0
59
- efficiencies: {H2O: 1}
60
63
"""
61
64
rxn2 = ct .Reaction .from_yaml (yaml2 , gas1 )
65
+ assert rxn2 .rate .type == "three-body-Arrhenius"
62
66
63
- self .assertEqual (rxn1 .reaction_type , rxn2 .reaction_type )
64
67
self .assertEqual (rxn1 .reactants , rxn2 .reactants )
65
68
self .assertEqual (rxn1 .products , rxn2 .products )
66
- self . assertEqual ( rxn1 .efficiencies , rxn2 .efficiencies )
67
- self . assertEqual ( rxn1 .default_efficiency , rxn2 .default_efficiency )
69
+ assert rxn1 .rate . efficiencies == rxn2 .rate . efficiencies
70
+ assert rxn1 .rate . default_efficiency == rxn2 .rate . default_efficiency
68
71
69
72
gas1 .add_reaction (rxn1 )
70
73
gas1 .add_reaction (rxn2 )
@@ -1290,11 +1293,12 @@ class TestThreeBody(TestThreeBody2):
1290
1293
# test updated version of three-body reaction
1291
1294
1292
1295
_legacy = False
1293
- _rxn_type = "three-body"
1294
- _rate_type = "Arrhenius"
1296
+ _rxn_type = "reaction"
1297
+ _rate_type = "three-body-Arrhenius"
1298
+ _rate_cls = ct .ThreeBodyArrheniusRate
1295
1299
_yaml = """
1296
1300
equation: 2 O + M <=> O2 + M
1297
- type: three-body
1301
+ type: three-body-Arrhenius
1298
1302
rate-constant: {A: 1.2e+11, b: -1.0, Ea: 0.0 cal/mol}
1299
1303
efficiencies: {H2: 2.4, H2O: 15.4, AR: 0.83}
1300
1304
"""
0 commit comments