MCPcopy Create free account
hub / github.com/Cantera/cantera / test_reacting

Method test_reacting

test/python/test_reactor.py:1688–1709  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1686 assert v0 == approx(r.speed)
1687
1688 def test_reacting(self):
1689 g = ct.Solution(yaml=self.gas_def)
1690 g.TPX = 1400, 20*101325, 'CO:1.0, H2O:1.0'
1691
1692 r = ct.FlowReactor(g)
1693 r.mass_flow_rate = 10
1694 net = ct.ReactorNet([r])
1695
1696 i = 0
1697 while net.distance < 1.0:
1698 net.step()
1699 i += 1
1700 assert r.speed * r.density * r.area == approx(10)
1701
1702 stats = net.solver_stats
1703 assert stats['steps'] == i
1704 assert 'err_tests_fails' in stats
1705
1706 # advancing to the current distance should be a no-op
1707 x_now = net.distance
1708 net.advance(x_now)
1709 assert net.solver_stats['steps'] == i
1710
1711 def test_catalytic_surface(self):
1712 # Regression test based roughly on surf_pfr.py

Callers

nothing calls this directly

Calls 4

stepMethod · 0.95
advanceMethod · 0.95
SolutionMethod · 0.80
ReactorNetMethod · 0.45

Tested by

no test coverage detected