From 56a3a9611e566d1df7857577f98426d0fc943910 Mon Sep 17 00:00:00 2001 From: "Federico E. Benelli" Date: Thu, 5 Dec 2024 18:18:25 -0300 Subject: [PATCH] specify max pressure on CLine --- python/yaeos/core.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/python/yaeos/core.py b/python/yaeos/core.py index 19c0264a..404245f0 100644 --- a/python/yaeos/core.py +++ b/python/yaeos/core.py @@ -1166,7 +1166,10 @@ def critical_point(self, z, max_iters=100) -> dict: return {"x": x, "Tc": t, "Pc": p, "Vc": v} - def critical_line(self, z0, zi, a0=1e-5, da0=1e-2, max_points=1000): + def critical_line( + self, z0, zi, + a0=1e-5, da0=1e-2, max_points=1000, stop_pressure=2500 + ): """Critical Line calculation. Calculate the critical line between two compositions @@ -1181,11 +1184,14 @@ def critical_line(self, z0, zi, a0=1e-5, da0=1e-2, max_points=1000): Initial molar fraction of composition `i` da0: float, optional Step for molar fraction of composition `i` - max_poitns: int, optional + max_points: int, optional Maximum number of points to calculate + stop_pressure: float, optional + Stop when reaching this pressure value """ alphas, vs, ts, ps = yaeos_c.critical_line( - self.id, a0=a0, da0=da0, z0=z0, zi=zi, max_points=max_points + self.id, a0=a0, da0=da0, z0=z0, zi=zi, + max_points=max_points, stop_pressure=stop_pressure ) return {"a": alphas, "T": ts, "P": ps, "V": vs}