Skip to content

Commit

Permalink
specify max pressure on CLine
Browse files Browse the repository at this point in the history
  • Loading branch information
fedebenelli committed Dec 5, 2024
1 parent 37ee949 commit 56a3a96
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions python/yaeos/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
Expand Down

0 comments on commit 56a3a96

Please sign in to comment.