diff --git a/mycp/dev/fluids/n-Hexane.json b/mycp/dev/fluids/n-Hexane.json index 6d60ff2196937f3d6d669db84e83e17e51c06248..b389675c608abd8da717930245c0253120a43dee 100644 --- a/mycp/dev/fluids/n-Hexane.json +++ b/mycp/dev/fluids/n-Hexane.json @@ -96,7 +96,7 @@ "T_r": 507.82, "Tmax": 507.82, "Tmin": 177.83, - "description": "rho'' = rhoc*exp(Tc/T*sum(n_i*theta^t_i))", + "description": "rho'' = rhoc*exp(sum(n_i*theta^t_i))", "max_abserror_percentage": 1.0104195769602642, "n": [ -3.4056, @@ -116,7 +116,7 @@ 30.0 ], "type": "rhoV", - "using_tau_r": true + "using_tau_r": false }, "sL": { "A": [ @@ -762,4 +762,4 @@ "sigma_eta_units": "m" } } -} \ No newline at end of file +} diff --git a/src/tests/catch_test_multifluid.cxx b/src/tests/catch_test_multifluid.cxx index 9a72a7f96f554907d5a5c6cb26da9f2f9caffc01..a6ea82c8e9754d3a30ec666ff8f2f2f6f57b7782 100644 --- a/src/tests/catch_test_multifluid.cxx +++ b/src/tests/catch_test_multifluid.cxx @@ -153,13 +153,28 @@ TEST_CASE("Check that all ancillaries can be instantiated and work properly", "[ CAPTURE(path.string()); auto abspath = std::filesystem::absolute(path).string(); auto model = build_multifluid_model({ abspath }, root, root + "/dev/mixtures/mixture_binary_pairs.json"); - auto jancillaries = nlohmann::json::parse(model.get_meta()).at("pures")[0].at("ANCILLARIES"); + auto pure0 = nlohmann::json::parse(model.get_meta()).at("pures")[0]; + // Skip pseudo-pure fluids, where ancillary checking is irrelevant + if (pure0.at("EOS")[0].at("pseudo_pure")){ + counter += 1; + continue; + } + auto jancillaries = pure0.at("ANCILLARIES"); auto anc = teqp::MultiFluidVLEAncillaries(jancillaries); - double T = 0.9*anc.rhoL.T_r; + double T = 0.8*anc.rhoL.T_r; auto rhoV = anc.rhoV(T), rhoL = anc.rhoL(T); auto rhovec = teqp::pure_VLE_T(model, T, rhoL, rhoV, 10); + CAPTURE(rhoL); + CAPTURE(rhoV); + CAPTURE(rhovec); CHECK_THROWS(anc.rhoV(1.1*anc.rhoL.T_r)); CHECK_THROWS(anc.rhoL(1.1*anc.rhoL.T_r)); + + auto rhoLerr = std::abs(rhovec[0]/rhoL-1); + auto rhoVerr = std::abs(rhovec[1]/rhoV-1); + CHECK(rhoLerr < 0.02); + CHECK(rhoVerr < 0.02); + counter += 1; } CHECK(counter > 100);