Hmass upper and low limits

13 views
Skip to first unread message

Adam McCartney

unread,
Apr 23, 2026, 9:25:20 PM (5 days ago) Apr 23
to coolprop-users
Hello all,

I have been looking for the upper and lower limits for the enthalpy inputs into the PropsSI function. I usually update my AbstractState with AS.update(CP.HmassP_INPUTS, h, P). I would like to know before hand if I am going to get an error before I update my h, and ask for props. I know CP knows the limits because when I get an error is tells it to me, which inspired this monstrosity:

def get_h_min_mol(P: float, fld: str) -> float:

    # get min h from exception message
    try:
        CP.PropsSI('T', 'P', P, 'H', -1e6, fld)
    except Exception as e:
        # strip the execption message to get min h in J/mol
        h_min = str(e).split("minimum value of")[1].split("J/mol")[0].strip()

        # convert to float
        try:
            return float(h_min)
        except ValueError:
            raise ValueError(f"Could not extract h_min from CoolProp error message for P={P} Pa, fluid='{fld}'")

But there must be a better way.

Regards
Adam

Ian Bell

unread,
Apr 23, 2026, 9:28:42 PM (5 days ago) Apr 23
to coolpro...@googlegroups.com
Discussions on GitHub are a better place to ask questions now.

In general limts are based on temperature and/or pressure, rather than enthalpy or entropy (also enthalpy and entropy are tricky ones due to their reference states)

--
You received this message because you are subscribed to the Google Groups "coolprop-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coolprop-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/coolprop-users/1d823fc5-22b9-4aa8-bef1-310b69c59ff8n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages