From f8045d83c64de122ff3ed310fa84cfbaede2423f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20G=C3=B3mez=20Romera?= Date: Thu, 21 Nov 2024 22:09:32 +0100 Subject: [PATCH] Fix bug #76, bad vapor quality definition in region_3 below the critical point --- iapws/iapws97.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/iapws/iapws97.py b/iapws/iapws97.py index eff5f99..c6b1dba 100644 --- a/iapws/iapws97.py +++ b/iapws/iapws97.py @@ -1685,10 +1685,13 @@ def _Region3(rho, T): propiedades["alfav"] = (gd - Tr * gdt) / (2 * gd + d * gdd) / T propiedades["kt"] = 1 / (2 * d * gd + d ** 2 * gdd) / rho / R / T * 1000 propiedades["region"] = 3 + + propiedades["x"] = 1 if T < Tc and propiedades["P"] < Pc: - propiedades["x"] = 0 - else: - propiedades["x"] = 1 + t_sat = _TSat_P(propiedades["P"]) + if T < t_sat: + propiedades["x"] = 0 + return propiedades