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

set_reference_state does not create expected output #524

Closed
HerrBertS opened this issue Mar 5, 2015 · 23 comments
Closed

set_reference_state does not create expected output #524

HerrBertS opened this issue Mar 5, 2015 · 23 comments
Milestone

Comments

@HerrBertS
Copy link

Hello everyone,

I tried to change the reference state, but the results were not as expected. Sample Code:

import CoolProp
from CoolProp.CoolProp import PropsSI
from CoolProp.CoolProp import set_reference_state

print "CoolProp version",CoolProp.__version__

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

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!

@ibell
Copy link
Contributor

ibell commented Mar 5, 2015

Interesting. This is a definite bug, it should work exactly as you state.
What version of python? Not that it should matter though...

On Thu, Mar 5, 2015 at 2:22 AM, HerrBertS notifications@github.com wrote:

Hello everyone,

I tried to change the reference state, but the results were not as
expected. Sample Code:

import CoolProp
from CoolProp.CoolProp import PropsSI
from CoolProp.CoolProp import set_reference_state

print "CoolProp version",CoolProp.version

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

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!


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

@HerrBertS
Copy link
Author

I am using Python 2.7.8

@ibell
Copy link
Contributor

ibell commented Mar 6, 2015

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.

@ibell ibell closed this as completed in 6b6f2db Mar 6, 2015
@ibell ibell modified the milestones: 5.2, v 5.1 Mar 6, 2015
@HerrBertS
Copy link
Author

Hmm, ok I see. Can you estimate at all if there will be any work done on that bug in the near future?
Thanks again for your help and your work on CoolProp!

@jowr
Copy link
Member

jowr commented Mar 6, 2015 via email

@ibell
Copy link
Contributor

ibell commented Mar 6, 2015

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.

@HerrBertS
Copy link
Author

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
CoolProp gitrevision cd3e632
R134a default reference state
HMass at 0.0 C 199.999988526
SMass at 0.0 C 1.00000003696
R134a manual setting: IIR
HMass at 0.0 C
Traceback (most recent call last):
File "Test_python", line 19, in
print "HMass at",T0-273.15,"C",PropsSI('HMASS','T',T0,'Q',0,REF)/1000
File "CoolProp/CoolProp.pyx", line 210, in CoolProp.CoolProp.PropsSI (CoolProp/CoolProp.cpp:20437)
File "CoolProp/CoolProp.pyx", line 290, in CoolProp.CoolProp.PropsSI (CoolProp/CoolProp.cpp:20238)
File "CoolProp/CoolProp.pyx", line 179, in CoolProp.CoolProp.__Props_err2 (CoolProp/CoolProp.cpp:18593)
ValueError: calc_alpha0_deriv_nocache returned invalid number with inputs nTau: 0, nDelta: 0, tau: 1005885520, delta: 1005885568 : PropsSI("HMASS","T",273.15,"Q",0,"R134a")

Since "IIR" should be the default setting, I would expect the same values as a result. Has the syntax changed in the latest version?

@ibell
Copy link
Contributor

ibell commented Mar 6, 2015

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:

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 CoolPropfrom CoolProp.CoolProp import PropsSIfrom 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)/1000print "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)/1000print "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
CoolProp gitrevision cd3e632
cd3e632
R134a default reference state
HMass at 0.0 C 199.999988526
SMass at 0.0 C 1.00000003696
R134a manual setting: IIR
HMass at 0.0 C
Traceback (most recent call last):
File "Test_python", line 19, in
print "HMass at",T0-273.15,"C",PropsSI('HMASS','T',T0,'Q',0,REF)/1000
File "CoolProp/CoolProp.pyx", line 210, in CoolProp.CoolProp.PropsSI
(CoolProp/CoolProp.cpp:20437)
File "CoolProp/CoolProp.pyx", line 290, in CoolProp.CoolProp.PropsSI
(CoolProp/CoolProp.cpp:20238)
File "CoolProp/CoolProp.pyx", line 179, in CoolProp.CoolProp.__Props_err2
(CoolProp/CoolProp.cpp:18593)
ValueError: calc_alpha0_deriv_nocache returned invalid number with inputs
nTau: 0, nDelta: 0, tau: 1005885520, delta: 1005885568 :
PropsSI("HMASS","T",273.15,"Q",0,"R134a")

Since "IIR" should be the default setting, I would expect the same values
as a result. Has the syntax changed in the latest version?


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

@ibell
Copy link
Contributor

ibell commented Mar 9, 2015

Yeah, this should definitely work! For me:

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

CoolProp version 5.1.0dev
CoolProp revision 5832505ffca9b75853ddd93194e924e7c5acf94b
R134a IIR
HMass at 0.0 C 200.0
SMass at 0.0 C 1.0
R134a ASHRAE
HMass at -40.0 C -1.0546634054e-13
SMass at -40.0 C 2.89506574934e-16
R134a NBP
HMass at 101325 Pa -6.70595394547e-15
SMass at 101325 Pa -2.89506574934e-16
R134a IIR
HMass at 0.0 C 200.0
SMass at 0.0 C 1.0
R134a DEF
HMass at 0.0 C 200.0
SMass at 0.0 C 1.0

@ibell
Copy link
Contributor

ibell commented Mar 9, 2015

How are you compiling? What platform are you on?

@LahmacunLove
Copy link

Hi! HerrBertS and me tested 3 ways to install and use the actual dev-version of Coolprop.

System information:
Linux de203 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt4-3 (2015-02-03) x86_64 GNU/Linux
Debian 8.0 Jessie
system-gcc 4.9.1
sys-python 2.7.8
sys-cython 0.21.1
sys-pip 1.5.6

install via
pip install --find-links http://www.coolprop.dreamhosters.com:8010/binaries/Python/ -U --force-reinstall CoolProp
works fine, returns wrong output like HerrBertS mentioned in his first post.

% -------------------------------------------------------------------------------------------------

manual build of the python-wrapper via the script in .../wrappers/Python/install-linux.sh works fine, except with some warnings, no errors.
but usage together with the SampleCode returns following error:

CoolProp version 5.1.0dev
CoolProp gitrevision ea21408
R134a IIR
HMass at 0.0 C
Traceback (most recent call last):
File "ReferenceStateCoolPropTest.py", line 15, in
print "HMass at",T0-273.15,"C",PropsSI('HMASS','T',T0,'Q',0,REF)/1000
File "CoolProp/CoolProp.pyx", line 210, in CoolProp.CoolProp.PropsSI (CoolProp/CoolProp.cpp:21486)
File "CoolProp/CoolProp.pyx", line 290, in CoolProp.CoolProp.PropsSI (CoolProp/CoolProp.cpp:21287)
File "CoolProp/CoolProp.pyx", line 179, in CoolProp.CoolProp.__Props_err2 (CoolProp/CoolProp.cpp:19642)
ValueError: calc_alpha0_deriv_nocache returned invalid number with inputs nTau: 0, nDelta: 0, tau: -1894828080, delta: -1894828032 : PropsSI("HMASS","T",273.15,"Q",0,"R134a")

% -------------------------------------------------------------------------------------------------

Custom Build with non-gobal python distribution and own pythonpath:
custom-python 2.7.8
custom-cython 0.22

custom build via "python setup.py install" returns following error (created by cython):

git version 2.1.4
git is accessible at the command line
git revision is ea21408
gitrevision.h is up to date
all_fluids_JSON.h is up to date
all_incompressibles_JSON.h is up to date
mixture_departure_functions_JSON.h is up to date
mixture_binary_pairs_JSON.h is up to date
predefined_mixtures_JSON.h is up to date
****** Writing the constants module ******
Cython will be used; cy_ext is pyx
files copied.
Compiling CoolProp/CoolProp.pyx because it depends on ./CoolProp/constants_header.pxd.
Compiling CoolProp/_constants.pyx because it changed.
Cythonizing CoolProp/_constants.pyx
Cythonizing CoolProp/CoolProp.pyx

Error compiling Cython file:

...

cpdef name(self):
    """ Get the backend name - wrapper of c++ function :cpapi:`CoolProp::AbstractState::name` """
    return self.thisptr.name()

cpdef constants_header.phases phase(self):
     ^

CoolProp/AbstractState.pyx:26:10: Signature not compatible with previous declaration

Error compiling Cython file:

...
cpdef set_mass_fractions(self, vector[double] z)
cpdef set_volu_fractions(self, vector[double] z)

cpdef name(self)

cpdef constants_header.phases phase(self) except *  
                                  ^

CoolProp/AbstractState.pxd:29:39: Previous declaration is here
Traceback (most recent call last):
File "setup.py", line 253, in
ext_modules = cythonize(ext_modules)
File "/opt/OpenFOAM/ThirdParty-2.3.x/platforms/linux64Gcc/python-2.7.8/lib/python2.7/site-packages/Cython-0.22-py2.7-linux-x86_64.egg/Cython/Build/Dependencies.py", line 865, in cythonize
cythonize_one(*args[1:])
File "/opt/OpenFOAM/ThirdParty-2.3.x/platforms/linux64Gcc/python-2.7.8/lib/python2.7/site-packages/Cython-0.22-py2.7-linux-x86_64.egg/Cython/Build/Dependencies.py", line 985, in cythonize_one
raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: CoolProp/CoolProp.pyx

% -------------------------------------------------------------------------------------------------

I dont really know what to do, nor what we are doing wrong.
If you have some tips or hints, we would be pleasant to hear from you!

thanks a lot!

Greets,
Ferdi

@jowr
Copy link
Member

jowr commented Mar 9, 2015

Hi,
the install scripts are some remainders from CoolProp4. You should not need them anymore. I just made a fresh install with python setup.py install --user on a 32bit Debian machine since I saw that you are using Linux, too. There were a few warnings, but no errors. Afterwards, I ran the script from https://github.com/CoolProp/CoolProp/blob/master/dev/Tickets/524.py and got the same error as you: ValueError: calc_alpha0_deriv_nocache returned invalid number with inputs nTau: 0, nDelta: 0, tau: -5811923100799720527, delta: 6986890785592393727 : PropsSI("HMASS","T",273.15,"Q",0,"R134a"). This one is not fixed.

@jowr jowr reopened this Mar 9, 2015
@ibell
Copy link
Contributor

ibell commented Mar 10, 2015

This is really weird - what is seems like is that for some reason, a
variable is initialized on windows in a different fashion than in linux.
Entirely possible but annoying. @jowr, you have any idea?

On Mon, Mar 9, 2015 at 6:12 AM, Jorrit Wronski notifications@github.com
wrote:

Reopened #524 #524.


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

@ibell
Copy link
Contributor

ibell commented Mar 10, 2015

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

@ibell ibell closed this as completed in 275adbb Mar 10, 2015
@ibell
Copy link
Contributor

ibell commented Mar 10, 2015

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

CoolProp version 5.1.0dev
CoolProp revision 275adbbb6fda2e00ad949c8c4558e2ffd910c454
R134a IIR
HMass at 0.0 C 200.0
SMass at 0.0 C 1.0
R134a ASHRAE
HMass at -40.0 C -1.0546634054e-13
SMass at -40.0 C 2.89506574934e-16
R134a NBP
HMass at 101325 Pa -6.70595394547e-15
SMass at 101325 Pa -2.89506574934e-16
R134a IIR
HMass at 0.0 C 200.0
SMass at 0.0 C 1.0
R134a DEF
HMass at 0.0 C 199.999988526
SMass at 0.0 C 1.00000003696

Please confirm that I have fixed this bug, but I think I have

@LahmacunLove
Copy link

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
CoolProp revision 275adbb
R134a IIR
HMass at 0.0 C 200.0
SMass at 0.0 C 1.0
R134a ASHRAE
HMass at -40.0 C 9.83288235488e-15
SMass at -40.0 C -2.95479061649e-16
R134a NBP
HMass at 101325 Pa -2.15869721897e-14
SMass at 101325 Pa -2.62223972902e-17
R134a IIR
HMass at 0.0 C 200.0
SMass at 0.0 C 1.0
R134a DEF
HMass at 0.0 C 199.999988526
SMass at 0.0 C 1.00000003696

Thank you very much!

@jowr
Copy link
Member

jowr commented Mar 10, 2015

Same for me, this one is fixed.

@ibell
Copy link
Contributor

ibell commented Mar 10, 2015

Finally.
On Mar 10, 2015 3:05 AM, "Jorrit Wronski" notifications@github.com wrote:

Same for me, this one is fixed.


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

@HerrBertS
Copy link
Author

Thanks a lot for your effort!

@HerrBertS
Copy link
Author

Hey everyone,
changing the reference states with the code examples in the earlier posts works fine. I am still having trouble with PropsSI in the two phase area, though. For the liquid region there is no problem, but ASHREA returns an error in the two phase-area. I enclosed an example that should return the same DMASS-values for IIR and ASHRAE. If you change the enthalpy-value to the liquid-phase (IIR, e. g. 180000) it works just fine for both reference states, returning the same value. But for the given example enthalpy it won't work, but giving out an error.

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
CoolProp gitrevision 275adbb
R134a IIR
DMass at p= 300000.0 Pa and h= 260.0 kJ/kg 48.213831712
R134a ASHRAE
DMass at p= 300000.0 Pa and h= 111.855942727 kJ/kg
Traceback (most recent call last):
File "ReferenceStateCoolPropTest", line 32, in
print "DMass at p=",TestDruck,"Pa and h=",TestEnthalpie/1000-Delta,"kJ/kg",PropsSI('DMASS','P',TestDruck,'HMASS',TestEnthalpie-Delta*1000,REF)
File "CoolProp/CoolProp.pyx", line 210, in CoolProp.CoolProp.PropsSI (CoolProp/CoolProp.cpp:21486)
File "CoolProp/CoolProp.pyx", line 290, in CoolProp.CoolProp.PropsSI (CoolProp/CoolProp.cpp:21287)
File "CoolProp/CoolProp.pyx", line 179, in CoolProp.CoolProp.__Props_err2 (CoolProp/CoolProp.cpp:19642)
ValueError: unable to solve 1phase PY flash with Tmin=169.849, Tmax=273.819 due to error: HSU_P_flash_singlephase_Brent could not find a solution because Hmolar [11412.9 J/mol] is above the maximum value of 5382.79233895 J/mol : PropsSI("DMASS","P",300000,"HMASS",111855.9427,"R134a")

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!

@jowr
Copy link
Member

jowr commented Mar 12, 2015

Just a guess, but we might have forgotten to update the limits for enthalpy...

@ibell
Copy link
Contributor

ibell commented Mar 12, 2015

Hmm, I thought that I had updated the critical point enthalpy, ah, but
maybe I hadn't updated the triple point density - I bet that's it. I
didn't include that in my tests.

Thanks for the report.

On Thu, Mar 12, 2015 at 4:24 AM, Jorrit Wronski notifications@github.com
wrote:

Just a guess, but we might have forgotten to update the limits for
enthalpy...


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

@ibell ibell reopened this Mar 15, 2015
@ibell
Copy link
Contributor

ibell commented Mar 23, 2015

For me I get

CoolProp version 5.1.0dev
CoolProp gitrevision 55aade4776e331e5e8be8e5fe58b18b7bd711cad
R134a IIR
DMass at p= 300000.0 Pa and h= 260.0 kJ/kg 48.213831712
R134a ASHRAE
DMass at p= 300000.0 Pa and h= 111.855942727 kJ/kg 48.213831712

Can you try again with up-to-date code?

@ibell ibell closed this as completed Mar 25, 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

4 participants