More useful error message when conformal state solver fails for some reason; Closes #450

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
This commit is contained in:
Ian Bell
2015-02-09 18:28:25 -07:00
parent 4c901ac5a2
commit d7bb83d8ae

View File

@@ -1120,8 +1120,13 @@ long double TransportRoutines::conductivity_ECS(HelmholtzEOSMixtureBackend &HEOS
// **************************
// Solver for conformal state
// **************************
conformal_state_solver(HEOS, HEOS_Reference, T0, rhomolar0);
try{
conformal_state_solver(HEOS, HEOS_Reference, T0, rhomolar0);
}
catch(std::exception &e){
throw ValueError(format("Conformal state solver failed; error was %s",e.what()));
}
// Update the reference fluid with the conformal state
HEOS_Reference.update(DmolarT_INPUTS, rhomolar0*psi, T0);