| 1459 | gas = ct.Solution("pdep-test.yaml", "plog-invalid") |
| 1460 | |
| 1461 | def test_modify_plog(self): |
| 1462 | gas = ct.Solution('pdep-test.yaml') |
| 1463 | gas.TPX = 1010, 0.12 * ct.one_atm, 'R1A:0.3, R1B:0.2, H:0.1, R2:0.4' |
| 1464 | |
| 1465 | r0 = gas.reaction(0) |
| 1466 | r1 = gas.reaction(1) |
| 1467 | r0.rate = ct.PlogRate(r1.rate.rates) |
| 1468 | gas.modify_reaction(0, r0) |
| 1469 | kf = gas.forward_rate_constants |
| 1470 | assert kf[0] == approx(kf[1]) |
| 1471 | |
| 1472 | # Removing the high-pressure rates should have no effect at low P... |
| 1473 | r1.rate = ct.PlogRate(rates=r1.rate.rates[:-4]) |
| 1474 | gas.modify_reaction(1, r1) |
| 1475 | assert kf[1] == approx(gas.forward_rate_constants[1]) |
| 1476 | |
| 1477 | # ... but should change the rate at higher pressures |
| 1478 | gas.TP = 1010, 12.0 * ct.one_atm |
| 1479 | kf = gas.forward_rates_of_progress |
| 1480 | assert kf[0] != approx(kf[1]) |
| 1481 | |
| 1482 | class TestLinearBurkeReaction: |
| 1483 | @pytest.fixture(scope='class') |