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

Python list inputs #394

Closed
jowr opened this issue Jan 7, 2015 · 2 comments
Closed

Python list inputs #394

jowr opened this issue Jan 7, 2015 · 2 comments
Milestone

Comments

@jowr
Copy link
Member

jowr commented Jan 7, 2015

There is a problem with Python lists, #390 is not a water problem, but a Python issue:

from __future__ import print_function, division
import CoolProp
from CoolProp.CoolProp import PropsSI

print(CoolProp.__version__)
print(CoolProp.__gitrevision__)

fluid='water'
pi = 700e5

l  = "V"
T = 500
print("{0}: {1} at {2} bar".format(l,PropsSI(l,"T",T,"P",pi,fluid),pi/1e5))
T = 700
print("{0}: {1} at {2} bar".format(l,PropsSI(l,"T",T,"P",pi,fluid),pi/1e5))

l  = "L"
T = 500
print("{0}: {1} at {2} bar".format(l,PropsSI(l,"T",T,"P",pi,fluid),pi/1e5))
T = 700
print("{0}: {1} at {2} bar".format(l,PropsSI(l,"T",T,"P",pi,fluid),pi/1e5))

T = [500,700]
l  = "V"
print("{0}: {1} at {2} bar".format(l,PropsSI(l,"T",T,"P",pi,fluid),pi/1e5))
l  = "L"
print("{0}: {1} at {2} bar".format(l,PropsSI(l,"T",T,"P",pi,fluid),pi/1e5))
5.0.6dev
83a670a4fa142416e13444f54c95e162bb55d26b
V: 0.000133532211873 at 700.0 bar
V: 6.96495292947e-05 at 700.0 bar
L: 0.697429695478 at 700.0 bar
L: 0.449613314229 at 700.0 bar
V: [ 0.00013353  0.00013353] at 700.0 bar
L: [ 0.6974297  0.6974297] at 700.0 bar
@jowr
Copy link
Member Author

jowr commented Jan 7, 2015

This is also not a Python problem, the problem lies deeper on the C++ level.

[500.0, 700.0] [70000000.0, 70000000.0]
../../src/CoolProp.cpp:102: backend extracted. backend: ?. fluid: water
../../src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp (880): update called with (7: (PT_INPUTS), 7e+07, 500)
AbstractState: keyed_output called for viscosity 
../../src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp (880): update called with (7: (PT_INPUTS), 7e+07, 700)
AbstractState: keyed_output called for viscosity 
V: [ 0.00013353  0.00013353] at 700.0 bar
[500.0, 700.0] [70000000.0, 70000000.0]
../../src/CoolProp.cpp:102: backend extracted. backend: ?. fluid: water
../../src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp (880): update called with (7: (PT_INPUTS), 7e+07, 500)
AbstractState: keyed_output called for conductivity 
AbstractState: keyed_output called for Dmass 
../../src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp (880): update called with (7: (PT_INPUTS), 7e+07, 700)
AbstractState: keyed_output called for conductivity 
L: [ 0.6974297  0.6974297] at 700.0 bar

@jowr
Copy link
Member Author

jowr commented Jan 7, 2015

It looks like it is the Helmholtz backend, do the transport properties get reset during update? Is the cahce cleared?

def printLine(l,T,pi):
    print("{0}: {1} at {2} bar".format(l,PropsSI(l,"T",T,"P",pi,fluid),pi/1e5))

T = [500,700]
pi = 700e5
printLine("V",T,pi)
printLine("L",T,pi)
printLine("D",T,pi)
V: [ 0.00013353  0.00013353] at 700.0 bar
L: [ 0.6974297  0.6974297] at 700.0 bar
D: [ 881.83897192  582.34028737] at 700.0 bar

@jowr jowr added this to the v5.0.6 milestone Jan 7, 2015
@jowr jowr closed this as completed in 5ff28fc Jan 7, 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

1 participant