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
set_reference_state does not create expected output #524
Comments
Interesting. This is a definite bug, it should work exactly as you state. On Thu, Mar 5, 2015 at 2:22 AM, HerrBertS notifications@github.com wrote:
|
I am using Python 2.7.8 |
Hmm I thought the change was supposed to propagate back to all subsequent instances of HelmholtzEOSMixtureBackend backends, but it seems like it doesn't. I was a bit afraid of that, and I am going to have to think about this issue and how best to address it. This is not a trivial fix unfortunately. |
Hmm, ok I see. Can you estimate at all if there will be any work done on that bug in the near future? |
To me it looks like @ibell fixed this already...
|
Yup, it is fixed - @jowr if you check out the commit you see that I had to break the pEOS pointer everywhere which was pointing back to the JSON library. I think it is best that changing the reference state has no impact on states that have already been created. I added tests to that effect as well. There are one or two things to be fixed still, but they have failing tests, so we won't forget. |
Sorry, I just read the message earlier, but wasn't paying attention to what was below. I updated CoolProp to version: 5.1.0dev but now the following sample code: import CoolProp
from CoolProp.CoolProp import PropsSI
from CoolProp.CoolProp import set_reference_state
print "CoolProp version",CoolProp.__version__
print "CoolProp gitrevision",CoolProp.__gitrevision__
REF = 'R134a'
T0 = 273.15
print REF, "default reference state"
print "HMass at",T0-273.15,"C",PropsSI('HMASS','T',T0,'Q',0,REF)/1000
print "SMass at",T0-273.15,"C",PropsSI('SMASS','T',T0,'Q',0,REF)/1000
RefState = 'IIR'
set_reference_state(REF,RefState)
print REF, "manual setting:", RefState
print "HMass at",T0-273.15,"C",PropsSI('HMASS','T',T0,'Q',0,REF)/1000
print "SMass at",T0-273.15,"C",PropsSI('SMASS','T',T0,'Q',0,REF)/1000 leads to an error caused by the attempt to set the reference state: CoolProp version 5.1.0dev Since "IIR" should be the default setting, I would expect the same values as a result. Has the syntax changed in the latest version? |
Hmm this was working last night, Ill have another go this weekend. On Fri, Mar 6, 2015 at 9:10 AM, HerrBertS notifications@github.com wrote:
|
Yeah, this should definitely work! For me:
yields
|
How are you compiling? What platform are you on? |
Hi! HerrBertS and me tested 3 ways to install and use the actual dev-version of Coolprop. System information: install via % ------------------------------------------------------------------------------------------------- manual build of the python-wrapper via the script in .../wrappers/Python/install-linux.sh works fine, except with some warnings, no errors. CoolProp version 5.1.0dev % ------------------------------------------------------------------------------------------------- Custom Build with non-gobal python distribution and own pythonpath: custom build via "python setup.py install" returns following error (created by cython): git version 2.1.4 Error compiling Cython file:...
CoolProp/AbstractState.pyx:26:10: Signature not compatible with previous declaration Error compiling Cython file:...
CoolProp/AbstractState.pxd:29:39: Previous declaration is here % ------------------------------------------------------------------------------------------------- I dont really know what to do, nor what we are doing wrong. thanks a lot! Greets, |
Hi, |
This is really weird - what is seems like is that for some reason, a On Mon, Mar 9, 2015 at 6:12 AM, Jorrit Wronski notifications@github.com
|
This is a tricky one - I'm still working on it - it has something to do with a copy where we want a reference in the fluid library, or something like that. That more or less has to be the problem. I am almost at the error |
This import CoolProp
from CoolProp.CoolProp import PropsSI
from CoolProp.CoolProp import set_reference_state
print "CoolProp version",CoolProp.__version__
print "CoolProp revision",CoolProp.__gitrevision__
REF = 'R134a'
T0 = 273.15
RefState = 'IIR'
set_reference_state(REF,RefState)
print REF, RefState
print "HMass at",T0-273.15,"C",PropsSI('HMASS','T',T0,'Q',0,REF)/1000
print "SMass at",T0-273.15,"C",PropsSI('SMASS','T',T0,'Q',0,REF)/1000
T0 = 273.15-40
RefState = 'ASHRAE'
set_reference_state(REF,RefState)
print REF, RefState
print "HMass at",T0-273.15,"C",PropsSI('HMASS','T',T0,'Q',0,REF)/1000
print "SMass at",T0-273.15,"C",PropsSI('SMASS','T',T0,'Q',0,REF)/1000
P0 = 101325
RefState = 'NBP'
set_reference_state(REF,RefState)
print REF, RefState
print "HMass at",P0,"Pa",PropsSI('HMASS','P',P0,'Q',0,REF)/1000
print "SMass at",P0,"Pa",PropsSI('SMASS','P',P0,'Q',0,REF)/1000
T0 = 273.15
RefState = 'IIR'
set_reference_state(REF,RefState)
print REF, RefState
print "HMass at",T0-273.15,"C",PropsSI('HMASS','T',T0,'Q',0,REF)/1000
print "SMass at",T0-273.15,"C",PropsSI('SMASS','T',T0,'Q',0,REF)/1000
T0 = 273.15
RefState = 'DEF'
set_reference_state(REF,RefState)
print REF, RefState
print "HMass at",T0-273.15,"C",PropsSI('HMASS','T',T0,'Q',0,REF)/1000
print "SMass at",T0-273.15,"C",PropsSI('SMASS','T',T0,'Q',0,REF)/1000 yields
Please confirm that I have fixed this bug, but I think I have |
hi ibel, seems like it is fixed. hope you were not awake all night long. the output differs on my system, but it sall more or less zero, so i think this should work: CoolProp version 5.1.0dev Thank you very much! |
Same for me, this one is fixed. |
Finally.
|
Thanks a lot for your effort! |
Hey everyone, import CoolProp
from CoolProp.CoolProp import PropsSI
from CoolProp.CoolProp import set_reference_state
print "CoolProp version",CoolProp.__version__
print "CoolProp gitrevision",CoolProp.__gitrevision__
REF = 'R134a'
T0 = 273.15
TestEnthalpie = 260000.0
TestDruck = 300000.0
RefState = 'IIR'
set_reference_state(REF,RefState)
print REF, RefState
print "DMass at p=",TestDruck,"Pa and h=",TestEnthalpie/1000,"kJ/kg",PropsSI('DMASS','P',TestDruck,'HMASS',TestEnthalpie,REF)
h0 = PropsSI('HMASS','T',T0,'Q',0,REF)/1000
RefState = 'ASHRAE'
set_reference_state(REF,RefState)
print REF, RefState
h1 = PropsSI('HMASS','T',T0,'Q',0,REF)/1000
Delta = h0-h1
print "DMass at p=",TestDruck,"Pa and h=",TestEnthalpie/1000-Delta,"kJ/kg",PropsSI('DMASS','P',TestDruck,'HMASS',TestEnthalpie-Delta*1000,REF) leads to the following error message: CoolProp version 5.1.0dev So it seems, that the problem is switching to the two phase region. It should work there, too, since it does so for IIR, shouldn't it? I mean returning density values in the two phase region. It is not that important for my application right now, but I was wondering if the fault is on my side or if there is still an unsolved issue with CoolProp!? Thanks a lot again and greetings! |
Just a guess, but we might have forgotten to update the limits for enthalpy... |
Hmm, I thought that I had updated the critical point enthalpy, ah, but Thanks for the report. On Thu, Mar 12, 2015 at 4:24 AM, Jorrit Wronski notifications@github.com
|
For me I get
Can you try again with up-to-date code? |
Hello everyone,
I tried to change the reference state, but the results were not as expected. Sample Code:
Using Python2.7 creates the following output:
CoolProp version 5.0.8
R134a IIR
HMass at 0.0 C 200.0
SMass at 0.0 C 1.0
R134a ASHRAE
HMass at -40.0 C -12.6479436275
SMass at -40.0 C -0.0530149275819
R134a NBP
HMass at 101325 Pa 160.791989427
SMass at 101325 Pa 0.848625422044
So, for IIR, it seems to work correctly, but the values for ASHRAE and NBP should be 0. I tried the same code with Propane and R123 as well. What am I doing wrong? Thanks a lot for your help!
The text was updated successfully, but these errors were encountered: