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

Method test_invasive_mdot_function

test/python/test_reactor.py:2552–2573  ·  view source on GitHub ↗
(self, test_data_path, setup_combustor_tests)

Source from the content-addressed store, hash-verified

2550 assert not bad, bad
2551
2552 def test_invasive_mdot_function(self, test_data_path, setup_combustor_tests):
2553 igniter = setup_combustor_tests['igniter']
2554 m3 = setup_combustor_tests['m3']
2555 sim = setup_combustor_tests['sim']
2556 combustor = setup_combustor_tests['combustor']
2557
2558 def igniter_mdot(t, t0=0.1, fwhm=0.05, amplitude=0.1):
2559 # Querying properties of the igniter changes the state of the
2560 # underlying ThermoPhase object, but shouldn't affect the
2561 # integration
2562 igniter.density
2563 return amplitude * math.exp(-(t-t0)**2 * 4 * math.log(2) / fwhm**2)
2564 m3.mass_flow_rate = igniter_mdot
2565
2566 data = []
2567 for t in np.linspace(0, 0.25, 101)[1:]:
2568 sim.advance(t)
2569 data.append([t, combustor.T] + list(combustor.thermo.X))
2570
2571 bad = compareProfiles(test_data_path / self.referenceFile, data,
2572 rtol=1e-6, atol=1e-12)
2573 assert not bad, bad
2574
2575
2576class TestWall:

Callers

nothing calls this directly

Calls 3

compareProfilesFunction · 0.85
advanceMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected