Skip to content

Can't compute densities at the triple point #1009

Closed

Description

@dinojr

Consider the following:

import numpy as np
import CoolProp.CoolProp as CP
import matplotlib.pyplot as plt

fluide="Water"
Ptriple = CP.PropsSI(fluide,'ptriple')
Ttriple = CP.PropsSI(fluide,'Ttriple')

vtripleL = 1/CP.PropsSI('D','P',Ptriple,'Q',0,fluide)
vtripleG = 1/CP.PropsSI('D','P',Ptriple,'Q',1,fluide)

It fails with:
Pressure to PQ_flash [611.655 Pa] must be in range [ 611.658 Pa, 2.2064e+07 Pa] : PropsSI("D","P",611.654667,"Q",0,"Water")

It seems the test for the pressure in PQ_flash is too conservative. This problem didn't occur in CoolProp4.

Activity

  1. ibell commented on Apr 1, 2016

    @ibell
    Contributor

    I confirm:

    import CoolProp
    print CoolProp.__version__
    print CoolProp.__gitrevision__
    CP = CoolProp.CoolProp
    fluide = "Water"
    Ptriple = CP.PropsSI(fluide,'ptriple')
    vtripleL = 1/CP.PropsSI('D','P',Ptriple,'Q',0,fluide)
    vtripleG = 1/CP.PropsSI('D','P',Ptriple,'Q',1,fluide)
    

    yields

    5.1.3dev
    50ab96fcd3f43b31c5e446284d453a75638d2c71
    Traceback (most recent call last):
      File "C:\Users\Belli\Desktop\tttttt.py", line 7, in <module>
        vtripleL = 1/CP.PropsSI('D','P',Ptriple,'Q',0,fluide)
      File "CoolProp\CoolProp.pyx", line 321, in CoolProp.CoolProp.PropsSI (CoolProp\CoolProp.cpp:38094)
      File "CoolProp\CoolProp.pyx", line 401, in CoolProp.CoolProp.PropsSI (CoolProp\CoolProp.cpp:37876)
      File "CoolProp\CoolProp.pyx", line 290, in CoolProp.CoolProp.__Props_err2 (CoolProp\CoolProp.cpp:36063)
    ValueError: Pressure to PQ_flash [611.655 Pa] must be in range [ 611.658 Pa, 2.2064e+007 Pa] : PropsSI("D","P",611.654667,"Q",0,"Water")
    
  2. dinojr commented on Apr 2, 2016

    @dinojr
    Author

    There is also a similar problem with the critical point:

    import numpy as np
    import CoolProp.CoolProp as CP
    import matplotlib.pyplot as plt
    
    fluide="Water"
    Pcritique = CP.PropsSI(fluide,'pcrit')
    Tcritique = CP.PropsSI(fluide,'Tcrit')
    
    vcritique= 1/CP.PropsSI('D','P',Pcritique,'T',Tcritique,fluide)
    

    yields:
    T=Tcrit; invalid input for other to T_phase_determination_pure_or_pseudopure : PropsSI("D","P",22064000,"T",647.096,"Water")

  3. jowr commented on Apr 4, 2016

    @jowr
    Member

    Hi, why not try this

    import numpy as np
    import CoolProp.CoolProp as CP
    fluide="Water"
    Pcritique = CP.PropsSI(fluide,'pcrit')
    Tcritique = CP.PropsSI(fluide,'Tcrit')
    vcritique= 1.0/CP.PropsSI('D','P',Pcritique,'T',Tcritique+0.1,fluide)
  4. dinojr commented on Apr 4, 2016

    @dinojr
    Author

    That's exactly what I'm doing at the moment but I thought this behaviour should be reported since their seems to be some inconsistency between, for instance, the value of Tcritique used in CP.PropsSI(fluid,'Tcrit') and the ones used in some internal checks by CP.PropsSI('D').

  5. modified the milestone: v6 on Apr 22, 2016
  6. dinojr commented on Apr 25, 2016

    @dinojr
    Author

    Thanks. When can we expect this fix to make its way to the pip repository ?

  7. ibell commented on Apr 25, 2016

    @ibell
    Contributor

    Development binaries automatically generated. See
    http://www.coolprop.org/dev/coolprop/wrappers/Python/index.html#automatic-installation
    (second one)
    On Apr 25, 2016 7:14 AM, "Julien Cubizolles" notifications@github.com
    wrote:

    Thanks. When can we expect this fix to make its way to the pip repository ?

    —
    You are receiving this because you modified the open/close state.
    Reply to this email directly or view it on GitHub
    #1009 (comment)

  8. dinojr commented on Apr 25, 2016

    @dinojr
    Author

    Thanks, I could install it, and the critical pressure doens't thrown any errors. However, the critical temperature does... See for instance the following:
    CP.PropsSI("D","P",CP.PropsSI("carbondioxide",'pcrit'),"T",CP.PropsSI("carbondioxide",'Tcrit'),"carbondioxide")
    Sorry for not mentioning earlier that the same problem was occuring with both pressure and temperature.

  9. ibell commented on Apr 25, 2016

    @ibell
    Contributor

    Can you please file a new issue with regards to critical point?
    On Apr 25, 2016 8:07 AM, "Julien Cubizolles" notifications@github.com
    wrote:

    Thanks, I could install it, and the critical pressure doens't thrown any
    errors. However, the critical temperature does... See for instance the
    following:

    CP.PropsSI("D","P",CP.PropsSI("carbondioxide",'pcrit'),"T",CP.PropsSI("carbondioxide",'Tcrit'),"carbondioxide")
    Sorry for not mentioning earlier that the same problem was occuring with
    both pressure and temperature.

    —
    You are receiving this because you modified the open/close state.
    Reply to this email directly or view it on GitHub
    #1009 (comment)

  10. dinojr commented on Apr 25, 2016

    @dinojr
    Author

    done: #1034

  11. added a commit that references this issue on May 11, 2016
    4542f9d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions