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

Method test_tolerances

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

Source from the content-addressed store, hash-verified

1910 assert tNow - tPrev <= 1.0001 * dx_limit
1911
1912 def test_tolerances(self):
1913 surf, gas = self.import_phases()
1914 gas.TPX = 1500, 4000, 'NH3:1.0, SiF4:0.4'
1915 surf.TP = gas.TP
1916
1917 r0, rsurf0, sim0 = self.make_reactors(gas, surf)
1918 r1, rsurf1, sim1 = self.make_reactors(gas, surf)
1919 r2, rsurf2, sim2 = self.make_reactors(gas, surf)
1920
1921 sim0.advance(0.05)
1922 baseline = sim0.solver_stats
1923
1924 # Expect that satisfying tighter tolerances will require more time steps
1925 sim1.atol = 0.001 * sim0.atol
1926 sim1.advance(0.05)
1927 tight_atol = sim1.solver_stats
1928 assert tight_atol['steps'] > baseline['steps']
1929
1930 sim2.rtol = 0.001 * sim0.rtol
1931 sim2.advance(0.05)
1932 tight_rtol = sim2.solver_stats
1933 assert tight_rtol['steps'] > baseline['steps']
1934
1935 def test_iteration_limits(self):
1936 surf, gas = self.import_phases()

Callers

nothing calls this directly

Calls 3

import_phasesMethod · 0.95
make_reactorsMethod · 0.95
advanceMethod · 0.80

Tested by

no test coverage detected