def test_ArrheniusParamWithUnits(): _2 = _get_ref2_units() ap = ArrheniusParamWithUnits(_2.A, _2.Ea) k = ap(_2.T) assert abs((k - _2.k)/_2.k) < 1e-4 r = Reaction({'H2O2': 1}, {'OH': 2}, ap) ratc = r.rate_expr().rate_coeff({'temperature': _2.T}) assert allclose(ratc, _2.k, rtol=1e-4)
def test_ArrheniusParamWithUnits(): s = u.second mol = u.mol J = u.joule K = u.kelvin act_J__mol = 42e3 ap = ArrheniusParamWithUnits(1e10 / s, act_J__mol * J / mol) freezing_K = 273.15 k = ap(freezing_K * K) ref = 1e10 / s * math.exp(-act_J__mol / (8.3145 * freezing_K)) assert abs((k - ref) / ref) < 1e-4 r = Reaction({'H2O2': 1}, {'OH': 2}, ap) ratc = r.rate_expr().rate_coeff({'temperature': freezing_K * u.K}) assert allclose(ratc, ref, rtol=1e-4)