Skip to content
This repository has been archived by the owner on Dec 14, 2017. It is now read-only.

ValueError: Calling PropSI or Props at (Tcrit,pcrit) #243

Open
lchenriksen2 opened this issue Oct 6, 2014 · 2 comments
Open

ValueError: Calling PropSI or Props at (Tcrit,pcrit) #243

lchenriksen2 opened this issue Oct 6, 2014 · 2 comments

Comments

@lchenriksen2
Copy link

First of all, great work guys!

I am not a thermodynamics expert, so please forgive me if I write something stupid in the lines below...

When calling the Props or Props functions, in Python, at the critical point (Tcrit,pcrit) for a substance I get the following error:
ValueError: CoolProp error: Number of steps in density_TP has exceeded 30 with inputs T=469.7,p=5.245e+006,rho_guess=194614 for fluid n-Pentane :: inputs were:"D","P",5.2450000000000000e+06,"T",4.6969999999999999e+02,"Pentane"

Could you possibly add a "safe guard" to see if the function is being called at the critical point and then use a more robust method of some sort. E.g. interpolate between "safe" points close the critical point..? Alternatively, hard code the properties at the critical point.

Furthermore, the specific heat constant 'C' seems to give "crazy high" results at the critical point, it looks like a division by zero issue or something similar. Whereas, the other properties seems to be behaving nice around the critical point. Can you confirm that 'C' is acting weird close to (Tcrit,pcrit) or is supposed to behave like that?

Best regards,
Lars

@jowr
Copy link
Collaborator

jowr commented Oct 6, 2014

Hi, interesting suggestions regarding the critical point. We'll discuss that.

Apart from the failing inputs, "crazy high" values for cp at the critical point make sense. Depending on how you look at it, the critical point could be regarded as part of the two-phase regime yielding a cp equal to infinity for pure fluids...

You'll hear more from us regarding the other suggestions.

@ibell
Copy link
Owner

ibell commented Oct 6, 2014

The specific heat at the critical point is infinite, thus the very large values that you are seeing :)

CoolProp is supposed to yield the right values right at the critical point (where possible), but there are many equations of state with inconsistencies between the stated critical point and the "actual" critical point. Pentane may be one of the fluids in this category. Basically, stay away from the critical point. We added splines to smooth out the behavior very close to the critical point, and in version 5 these splines should hopefully not be needed at all.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants