(self, gas, rxn_idx, mode=None, const_p=False, rtol=1e-6)
| 304 | return |
| 305 | |
| 306 | def rop_ddT(self, gas, rxn_idx, mode=None, const_p=False, rtol=1e-6): |
| 307 | # numerical derivative for rates-of-progress at constant pressure |
| 308 | def calc(): |
| 309 | if mode == "forward": |
| 310 | return gas.forward_rates_of_progress |
| 311 | if mode == "reverse": |
| 312 | return gas.reverse_rates_of_progress |
| 313 | if mode == "net": |
| 314 | return gas.net_rates_of_progress |
| 315 | |
| 316 | tpx = gas.TPX |
| 317 | dt = tpx[0] * rtol |
| 318 | dp = 0 if const_p else tpx[1] * rtol |
| 319 | gas.TP = tpx[0] + dt, tpx[1] + dp |
| 320 | rop1 = calc() |
| 321 | gas.TP = tpx[:2] |
| 322 | rop0 = calc() |
| 323 | gas.TPX = tpx |
| 324 | return (rop1[rxn_idx] - rop0[rxn_idx]) / dt |
| 325 | |
| 326 | def test_forward_rop_ddT(self, gas, rxn_idx, rxn): |
| 327 | # check derivatives of forward rop with respect to temperature |
no test coverage detected