From 8407dc172ff3345952fd40808a1c6326f04e2440 Mon Sep 17 00:00:00 2001 From: Ian Bell Date: Tue, 2 Dec 2014 10:44:00 -0500 Subject: [PATCH] Throw for PT being a two-phase state (or close to) Signed-off-by: Ian Bell --- src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp b/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp index 9e1242d0..73010985 100644 --- a/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp +++ b/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp @@ -1368,14 +1368,14 @@ void HelmholtzEOSMixtureBackend::T_phase_determination_pure_or_pseudopure(int ot if (other == iP) { - if (value > HEOS.SatL->p()*(100*DBL_EPSILON + 1)){ + if (value > HEOS.SatL->p()*(1e-6 + 1)){ this->_phase = iphase_liquid; _Q = -1000; return; } - else if (value < HEOS.SatV->p()*(1 - 100*DBL_EPSILON)){ + else if (value < HEOS.SatV->p()*(1 - 1e-6)){ this->_phase = iphase_gas; _Q = 1000; return; } else{ - throw ValueError(format("subcrit T, funny p")); + throw ValueError(format("Saturation pressure [%g Pa] corresponding to T [%g K] is within 1e-4 %% of given p [%Lg Pa]", HEOS.SatL->p(), _T, value)); } }