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

Function TEST

test/zeroD/test_zeroD.cpp:14–34  ·  view source on GitHub ↗

This test is an (almost) exact equivalent of a clib test (clib::test_ctreactor.cpp::ctreactor::reactor_simple)

Source from the content-addressed store, hash-verified

12// This test is an (almost) exact equivalent of a clib test
13// (clib::test_ctreactor.cpp::ctreactor::reactor_simple)
14TEST(zerodim, simple)
15{
16 double T = 1050;
17 double P = 5 * 101325;
18 string X = "CH4:1.0, O2:2.0, N2:7.52";
19
20 auto sol = newSolution("gri30.yaml", "gri30", "none");
21 sol->thermo()->setState_TPX(T, P, X);
22 auto reactor = newReactor4("IdealGasReactor", sol, "simple");
23 ASSERT_EQ(reactor->name(), "simple");
24 reactor->initialize();
25 ReactorNet network(reactor);
26 network.initialize();
27
28 double t = 0.0;
29 while (t < 0.1) {
30 ASSERT_GE(reactor->temperature(), T);
31 t = network.time() + 5e-3;
32 network.advance(t);
33 }
34}
35
36// Test guards preventing segfaults for uninitialized zerodim objects
37TEST(zerodim, test_guards)

Callers

nothing calls this directly

Calls 15

newSolutionFunction · 0.85
newReactor4Function · 0.85
MassFlowControllerClass · 0.85
PressureControllerClass · 0.85
ValveClass · 0.85
newReservoirFunction · 0.85
newFlowDeviceFunction · 0.85
newWallFunction · 0.85
newReactorNetFunction · 0.85
newSystemJacobianFunction · 0.85
setState_TPXMethod · 0.80
timeMethod · 0.80

Tested by

no test coverage detected