TEST_F(TransportFromScratch, viscosity) { Transport* trRef = newTransportMgr("Mix", ref.get()); MixTransport trTest; trTest.init(test.get()); for (int i = 0; i < 10; i++) { double T = 300 + 111*i; ref->setState_TPX(T, 5e5, "H2:0.5, O2:0.3, H2O:0.2"); test->setState_TPX(T, 5e5, "H2:0.5, O2:0.3, H2O:0.2"); EXPECT_DOUBLE_EQ(trRef->viscosity(), trTest.viscosity()) << "T = " << T; } }
TEST_F(TransportFromScratch, mixDiffCoeffs) { Transport* trRef = newTransportMgr("Mix", ref.get()); MixTransport trTest; trTest.init(test.get()); size_t K = ref->nSpecies(); vector_fp Dref(3); vector_fp Dtest(3); ref->setState_TPX(400, 5e5, "H2:0.5, O2:0.3, H2O:0.2"); test->setState_TPX(400, 5e5, "H2:0.5, O2:0.3, H2O:0.2"); trRef->getMixDiffCoeffs(&Dref[0]); trTest.getMixDiffCoeffs(&Dtest[0]); for (size_t k=0; k < K; k++) { EXPECT_DOUBLE_EQ(Dref[k], Dtest[k]) << "k = " << k; } }
TEST_F(TransportFromScratch, binaryDiffCoeffs) { Transport* trRef = newTransportMgr("Mix", ref.get()); MixTransport trTest; trTest.init(test.get()); size_t K = ref->nSpecies(); Array2D bdiffRef(3,3); Array2D bdiffTest(3,3); ref->setState_TPX(400, 5e5, "H2:0.5, O2:0.3, H2O:0.2"); test->setState_TPX(400, 5e5, "H2:0.5, O2:0.3, H2O:0.2"); trRef->getBinaryDiffCoeffs(K, &bdiffRef(0,0)); trTest.getBinaryDiffCoeffs(K, &bdiffTest(0,0)); for (size_t i=0; i < K; i++) { for (size_t j=0; j < K; j++) { EXPECT_DOUBLE_EQ(bdiffRef(i,j), bdiffTest(i,j)) << "i = " << i << ", j = " << j; } } }