Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block Tabular backend use with PropsSI somehow #617

Closed
jowr opened this issue Apr 24, 2015 · 5 comments
Closed

Block Tabular backend use with PropsSI somehow #617

jowr opened this issue Apr 24, 2015 · 5 comments
Milestone

Comments

@jowr
Copy link
Member

jowr commented Apr 24, 2015

A simple call to PropsSI("Tcrit","",0,"",0,"TTSE&HEOS::R134a") returns

Loading table: C:\Users\jowr/.CoolProp/Tables/HelmholtzEOSBackend(R134a[1.0000000000])/single_phase_logph.bin.z
Loaded table: C:\Users\jowr/.CoolProp/Tables/HelmholtzEOSBackend(R134a[1.0000000000])/single_phase_logph.bin.z in 0.157 sec.
Loading table: C:\Users\jowr/.CoolProp/Tables/HelmholtzEOSBackend(R134a[1.0000000000])/single_phase_logpT.bin.z
Loaded table: C:\Users\jowr/.CoolProp/Tables/HelmholtzEOSBackend(R134a[1.0000000000])/single_phase_logpT.bin.z in 0.194 sec.
Loading table: C:\Users\jowr/.CoolProp/Tables/HelmholtzEOSBackend(R134a[1.0000000000])/pure_saturation.bin.z
Loaded table: C:\Users\jowr/.CoolProp/Tables/HelmholtzEOSBackend(R134a[1.0000000000])/pure_saturation.bin.z in 0.01 sec.
Loading table: C:\Users\jowr/.CoolProp/Tables/HelmholtzEOSBackend(R134a[1.0000000000])/phase_envelope.bin.z
Loaded table: C:\Users\jowr/.CoolProp/Tables/HelmholtzEOSBackend(R134a[1.0000000000])/phase_envelope.bin.z in 0.007 sec.
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-7-17924934246c> in <module>()
----> 1 PropsSI("Tcrit","",0,"",0,"TTSE&HEOS::R134a")
CoolProp\CoolProp.pyx in CoolProp.CoolProp.PropsSI (CoolProp\CoolProp.cpp:24352)()
CoolProp\CoolProp.pyx in CoolProp.CoolProp.PropsSI (CoolProp\CoolProp.cpp:24153)()
CoolProp\CoolProp.pyx in CoolProp.CoolProp.__Props_err2 (CoolProp\CoolProp.cpp:22478)()
ValueError: No outputs were able to be calculated : PropsSI("Tcrit","",0,"",0,"TTSE&HEOS::R134a")
@ibell
Copy link
Contributor

ibell commented Apr 24, 2015

Actually the tabular backends should not be used in PropsSI because every
time it has to load the tables when creating the AbstractState. As is
noted in the tabular docs, and as you see here. Use the low-level
interface. Although now that I think about it, likely keyed_output doesn't
delegate to the AbstractState pointer it is holding onto.

On Fri, Apr 24, 2015 at 3:46 AM, Jorrit Wronski notifications@github.com
wrote:

A simple call to PropsSI("Tcrit","",0,"",0,"TTSE&HEOS::R134a") returns

Loading table: C:\Users\jowr/.CoolProp/Tables/HelmholtzEOSBackend(R134a[1.0000000000])/single_phase_logph.bin.z
Loaded table: C:\Users\jowr/.CoolProp/Tables/HelmholtzEOSBackend(R134a[1.0000000000])/single_phase_logph.bin.z in 0.157 sec.
Loading table: C:\Users\jowr/.CoolProp/Tables/HelmholtzEOSBackend(R134a[1.0000000000])/single_phase_logpT.bin.z
Loaded table: C:\Users\jowr/.CoolProp/Tables/HelmholtzEOSBackend(R134a[1.0000000000])/single_phase_logpT.bin.z in 0.194 sec.
Loading table: C:\Users\jowr/.CoolProp/Tables/HelmholtzEOSBackend(R134a[1.0000000000])/pure_saturation.bin.z
Loaded table: C:\Users\jowr/.CoolProp/Tables/HelmholtzEOSBackend(R134a[1.0000000000])/pure_saturation.bin.z in 0.01 sec.
Loading table: C:\Users\jowr/.CoolProp/Tables/HelmholtzEOSBackend(R134a[1.0000000000])/phase_envelope.bin.z

Loaded table: C:\Users\jowr/.CoolProp/Tables/HelmholtzEOSBackend(R134a[1.0000000000])/phase_envelope.bin.z in 0.007 sec.

ValueError Traceback (most recent call last)
in ()
----> 1 PropsSI("Tcrit","",0,"",0,"TTSE&HEOS::R134a")
CoolProp\CoolProp.pyx in CoolProp.CoolProp.PropsSI (CoolProp\CoolProp.cpp:24352)()
CoolProp\CoolProp.pyx in CoolProp.CoolProp.PropsSI (CoolProp\CoolProp.cpp:24153)()
CoolProp\CoolProp.pyx in CoolProp.CoolProp.__Props_err2 (CoolProp\CoolProp.cpp:22478)()
ValueError: No outputs were able to be calculated : PropsSI("Tcrit","",0,"",0,"TTSE&HEOS::R134a")


Reply to this email directly or view it on GitHub
#617.

@jowr
Copy link
Member Author

jowr commented Apr 24, 2015

Yes, I know I shouldn't do this 😉 ... but the error message could be more helpful though. We might even want to kill the whole thing saying something like "Do not use PropsSI with tabular backends, go read the docs." or a similar message.

@ibell
Copy link
Contributor

ibell commented Apr 24, 2015

Yeah I thought about that, but I can't come up with a good way of
determining whether the backend is allowed to be used with PropsSI. Any
ideas?

On Fri, Apr 24, 2015 at 11:44 AM, Jorrit Wronski notifications@github.com
wrote:

Yes, I know I shouldn't do this [image: 😉] ... but the error message
could be more helpful though. We might even want to kill the whole thing
saying something like "Do not use PropsSI with tabular backends, go read
the docs."
or a similar message.


Reply to this email directly or view it on GitHub
#617 (comment).

@jowr
Copy link
Member Author

jowr commented Apr 24, 2015

Well, thinking about it, what do you think about a wrapper for the tables that is similar to the one we have for REFPROP? Some stateful object parses the inputs and only reloads the tables if necessary.

But sorry, no better idea about the backend so far.

@ibell ibell changed the title TTSE throws exception for fluid constants Block Tabular backend use with PropsSI somehow Apr 25, 2015
@ibell ibell added this to the v5.1.1 milestone May 8, 2015
@ibell
Copy link
Contributor

ibell commented May 9, 2015

Now this code

import CoolProp.CoolProp as CP
CP.PropsSI("Tcrit","TTSE&HEOS::R134a")

yields

Traceback (most recent call last):
  File "trash001.py", line 8, in <module>
    CP.PropsSI("Tcrit","TTSE&HEOS::R134a")
  File "CoolProp\CoolProp.pyx", line 216, in CoolProp.CoolProp.PropsSI (CoolProp\CoolProp.cpp:25123)
  File "CoolProp\CoolProp.pyx", line 230, in CoolProp.CoolProp.PropsSI (CoolProp\CoolProp.cpp:24141)
  File "CoolProp\CoolProp.pyx", line 178, in CoolProp.CoolProp.__Props_err1 (CoolProp\CoolProp.cpp:23013)
ValueError: Unable to use input parameter [Tcrit] in Props1SI for fluid TTSE&HEOS::R134a; error was Initialize failed for backend: "TTSE&HEOS", fluid: "R134a" fractions "[ 1.0000000000 ]"; error: This AbstractState derived class cannot be used in the high-level interface; see www.coolprop.org/dev/coolprop/LowLevelAPI.html : PropsSI("Tcrit","",0,"",0,"TTSE&HEOS::R134a") :: inputs were :"Tcrit","TTSE&HEOS::R134a"

Unfortunately the error is nested a few levels deep, but at least it is there.

@ibell ibell closed this as completed in 0987a11 May 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants