From 86641af6704371ec416084e508dc431806dd601c Mon Sep 17 00:00:00 2001 From: Ian Bell Date: Sun, 10 Aug 2014 20:38:59 +0200 Subject: [PATCH] Fixed some errors with two-phase Trho inputs Signed-off-by: Ian Bell --- src/Backends/Helmholtz/FlashRoutines.cpp | 1 - src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Backends/Helmholtz/FlashRoutines.cpp b/src/Backends/Helmholtz/FlashRoutines.cpp index 77845df6..b6f205ae 100644 --- a/src/Backends/Helmholtz/FlashRoutines.cpp +++ b/src/Backends/Helmholtz/FlashRoutines.cpp @@ -609,7 +609,6 @@ void FlashRoutines::HSU_P_flash(HelmholtzEOSMixtureBackend &HEOS, int other) HSU_P_flash_singlephase_Brent(HEOS, other, value, Tmin, Tmax); HEOS._Q = -1; } - else{throw ValueError("Can't be non homogeneous phase at this point");} } else { diff --git a/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp b/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp index 43bffd30..43506226 100644 --- a/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp +++ b/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp @@ -1017,6 +1017,10 @@ void HelmholtzEOSMixtureBackend::T_phase_determination_pure_or_pseudopure(int ot default: throw ValueError(format("bad input for other")); } + + // Update the states + this->SatL->update(DmolarT_INPUTS, HEOS.SatL->rhomolar(), HEOS.SatL->T()); + this->SatV->update(DmolarT_INPUTS, HEOS.SatV->rhomolar(), HEOS.SatV->T()); if (Q < -100*DBL_EPSILON){ this->_phase = iphase_liquid; _Q = -1000; return;