diff --git a/include/teqp/algorithms/critical_tracing.hpp b/include/teqp/algorithms/critical_tracing.hpp index e776d55961443a996b0a007a1f36274537cc96f9..5825aa50593f3879400745d8d9604f02f5ded99e 100644 --- a/include/teqp/algorithms/critical_tracing.hpp +++ b/include/teqp/algorithms/critical_tracing.hpp @@ -34,7 +34,7 @@ struct TCABOptions { double stability_rel_drho = 0.001; ///< The relative size of the step (relative to the sum of the molar concentration vector) to be used when taking the step in the direction of \f$\sigma_1\f$ when assessing local stability int verbosity = 0; ///< The greater the verbosity, the more output you will get, especially about polishing failures bool polish_exception_on_fail = false; ///< If true, when polishing fails, throw an exception, otherwise, terminate tracing - bool pure_endpoint_polish = true; ///< If true, if the last step crossed into negative concentrations, try to interpolate to find the pure fluid endpoint hiding in the data + bool pure_endpoint_polish = false; ///< If true, if the last step crossed into negative concentrations, try to interpolate to find the pure fluid endpoint hiding in the data }; template<typename Model, typename Scalar = double, typename VecType = Eigen::ArrayXd> diff --git a/src/tests/catch_test_ammonia_water.cxx b/src/tests/catch_test_ammonia_water.cxx index 26a35a5155dd68215d014fc890863b468fbd91a1..56fd8e3ad36930d0761d943a19cbb25635e59513 100644 --- a/src/tests/catch_test_ammonia_water.cxx +++ b/src/tests/catch_test_ammonia_water.cxx @@ -9,7 +9,7 @@ using Catch::Approx; using namespace teqp; -TEST_CASE("Trace critical curve w/ Tillner-Roth", "[NHfty3H2O]") { +TEST_CASE("Trace critical curve w/ Tillner-Roth", "[NH3H2O]") { auto model = AmmoniaWaterTillnerRoth(); auto z = (Eigen::ArrayXd(2) << 0.7, 0.3).finished(); auto Ar01 = teqp::TDXDerivatives<decltype(model)>::get_Ar01(model, 300, 300, z); @@ -20,7 +20,8 @@ TEST_CASE("Trace critical curve w/ Tillner-Roth", "[NHfty3H2O]") { auto pig0 = rhovec0.sum() * model.R(rhovec0/rhovec0.sum())*T0; REQUIRE(prc0 + pig0 == Approx(11.33e6).margin(0.01e6)); - TCABOptions opt; opt.polish = true; opt.integration_order = 1; opt.init_dt = 100; + TCABOptions opt; opt.polish = true; opt.integration_order = 1; opt.init_dt = 100; + opt.pure_endpoint_polish = false; // Doesn't work for pure water CriticalTracing<decltype(model)>::trace_critical_arclength_binary(model, T0, rhovec0, "TillnerRoth_crit.csv", opt); } @@ -62,6 +63,6 @@ TEST_CASE("Bell et al. REFPROP 10", "[NH3H2O]") { auto pig0 = rhovec0.sum() * mutant.R(rhovec0 / rhovec0.sum()) * T0; TCABOptions opt; opt.polish = true; opt.integration_order = 1; opt.init_dt = 100; opt.verbosity = 1000; - + opt.pure_endpoint_polish = false; // Doesn't work for pure water CriticalTracing<decltype(mutant)>::trace_critical_arclength_binary(mutant, T0, rhovec0, "BellREFPROP10_NH3.csv", opt); } \ No newline at end of file diff --git a/src/tests/catch_tests.cxx b/src/tests/catch_tests.cxx index 672b48626ce5cee8c34a2992d47df2366f54cfb4..e8426499a581e4708309e780e3100180a129f869 100644 --- a/src/tests/catch_tests.cxx +++ b/src/tests/catch_tests.cxx @@ -265,6 +265,7 @@ TEST_CASE("Trace critical locus for vdW", "[vdW][crit]") using ct = CriticalTracing<decltype(vdW), double, Eigen::ArrayXd>; TCABOptions opt; opt.polish = true; + opt.pure_endpoint_polish = true; auto trace = ct::trace_critical_arclength_binary(vdW, T0, rhovec0, filename, opt); auto tic1 = std::chrono::steady_clock::now(); double max_splus = 0;