Update a few tests

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
This commit is contained in:
Ian Bell
2014-12-02 01:36:43 -05:00
parent e46d33689d
commit 37bfd34d23
2 changed files with 11 additions and 8 deletions

View File

@@ -1295,12 +1295,12 @@ TEST_CASE_METHOD(HelmholtzConsistencyFixture, "Helmholtz energy derivatives", "[
term = get(terms[i]);
for (std::size_t j = 0; j < sizeof(derivs)/sizeof(derivs[0]); ++j)
{
call(derivs[j], term, 1.3, 0.7, 1e-7);
call(derivs[j], term, 1.3, 0.7, 1e-6);
CAPTURE(derivs[j]);
CAPTURE(numerical);
CAPTURE(analytic);
CAPTURE(terms[i]);
CHECK(err(analytic, numerical) < 1e-5);
CHECK(err(analytic, numerical) < 1e-7);
}
}
}

View File

@@ -607,7 +607,7 @@ public:
// Make sure we end up back at the same temperature and pressure we started out with
if(std::abs(T-State.T()) > 1e-2) throw CoolProp::ValueError(format("Error on T [%Lg K] is greater than 1e-2",std::abs(State.T()-T)));
if(std::abs(p-State.p())/p*100 > 1e-2) throw CoolProp::ValueError(format("Error on p [%Lg %%] is greater than 1e-2 %%",std::abs(p-State.p())/p ));
if(std::abs(p-State.p())/p*100 > 1e-2) throw CoolProp::ValueError(format("Error on p [%Lg %%] is greater than 1e-2 %%",std::abs(p-State.p())/p*100));
}
};
@@ -623,7 +623,7 @@ TEST_CASE_METHOD(ConsistencyFixture, "Test all input pairs for Water using all v
{
double Ts = PropsSI("T","P",p,"Q",0,"Water");
double Tmelt = pState->melting_line(CoolProp::iT, CoolProp::iP, p);
for (double T = Tmelt; T < Ts; T += 0.1)
for (double T = Tmelt; T < Ts-0.1; T += 0.1)
{
CHECK_NOTHROW(set_TP(T, p));
@@ -638,10 +638,13 @@ TEST_CASE_METHOD(ConsistencyFixture, "Test all input pairs for Water using all v
get_variables();
CAPTURE(x1);
CAPTURE(x2);
double rho_RP = PropsSI("Dmolar","P",p,"T",T,"REFPROP::Water");
if (ValidNumber(rho_RP)){
CHECK_NOTHROW(single_phase_consistency_check());
CHECK(std::abs((rho_RP-rhomolar)/rhomolar) < 1e-3);
CAPTURE(Ts);
CHECK_NOTHROW(single_phase_consistency_check());
double rhomolar_RP = PropsSI("Dmolar","P",p,"T",T,"REFPROP::Water");
if (ValidNumber(rhomolar_RP)){
CAPTURE(rhomolar_RP);
CAPTURE(rhomolar);
CHECK(std::abs((rhomolar_RP-rhomolar)/rhomolar) < 1e-3);
}
}
}