This test is an (almost) exact equivalent of a clib test (clib::test_ctreactor.cpp::ctreactor::reactor_simple)
| 12 | // This test is an (almost) exact equivalent of a clib test |
| 13 | // (clib::test_ctreactor.cpp::ctreactor::reactor_simple) |
| 14 | TEST(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 |
| 37 | TEST(zerodim, test_guards) |
nothing calls this directly
no test coverage detected