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

Temperature with HmassP_INPUTS with twophase fluid and tabular #762

Closed
JonWel opened this issue Aug 3, 2015 · 8 comments
Closed

Temperature with HmassP_INPUTS with twophase fluid and tabular #762

JonWel opened this issue Aug 3, 2015 · 8 comments
Milestone

Comments

@JonWel
Copy link
Contributor

JonWel commented Aug 3, 2015

This input pair works to compute temperature with HEOS backend, but not with the tabular ones:

import CoolProp

fluid = "R245fa"
input1 = 4e5 # Hmass
input2 = 8e5 # P
output = CoolProp.get_param_index("T")
input_pair = CoolProp.get_input_pair_index("HmassP_INPUTS")

handle = CoolProp.AbstractState_factory("HEOS", fluid)
CoolProp.AbstractState_update(handle,input_pair,input1,input2)
println("HEOS    gives: ", CoolProp.AbstractState_keyed_output(handle,output))
CoolProp.AbstractState_free(handle)

handle = CoolProp.AbstractState_factory("TTSE&HEOS", fluid)
CoolProp.AbstractState_update(handle,input_pair,input1,input2)
println("TTSE    gives: ", CoolProp.AbstractState_keyed_output(handle,output))
CoolProp.AbstractState_free(handle)

Output:

HEOS    gives: 353.7035584315394
ERROR: CoolProp: no correct state has been set with AbstractState_update
 in AbstractState_keyed_output

Asking for other properties with the same update works (tested with density and entropy).
I think it may be related to the fact that the searched point is in two state area, so with a constant temperature.

@Astrinus
Copy link

Astrinus commented Aug 3, 2015

Which version are you using? With the latest stable (5.1.1) for me works well either with BICUBIC and TTSE.

>> tmp = CoolProp.AbstractState.factory('BICUBIC&HEOS','R245fa');
>> tmp.update(CoolProp.HmassP_INPUTS,4e5,8e5)
>> tmp.T()
    ans = 353.703558431357
>> tmp = CoolProp.AbstractState.factory('TTSE&HEOS','R245fa');
>> tmp.update(CoolProp.HmassP_INPUTS,4e5,8e5)
>> tmp.T()
    ans = 353.703558431357

@JonWel
Copy link
Contributor Author

JonWel commented Aug 3, 2015

I used a build from latest GitHub sources.
Neither generating new tables nor a new source build did help.

@ibell
Copy link
Contributor

ibell commented Aug 11, 2015

I wonder if there is something funny in the high-level wrapper of the low-level interface. Maybe its a bug.

@ibell
Copy link
Contributor

ibell commented Aug 19, 2015

Given #777, I bet this is related to something curious on your side. Anyone else on linux that can confirm this behavior? @jowr?

@jowr
Copy link
Member

jowr commented Aug 19, 2015

I am out of office until September and have only limited internet access, feel free to remind me again later.

My immediate guess would be to make sure that there is no broken library file lurking anywhere in the search path.

@JonWel
Copy link
Contributor Author

JonWel commented Aug 19, 2015

I was experiencing this firstly on Windows XP (My testing code for ExternalMedia set state with p and h and calculate most of the outputs but was stuck on temperature).
I did test this code again with the latest source code on Linux and still have the same error (even with the latest nightly build for Linux 64: libCoolProp.so.5.1.2dev).
If I remembered well, the same code searching for temperature in monophasic area worked.

@ibell ibell added this to the v5.1.2 milestone Aug 20, 2015
@ibell ibell closed this as completed in 44ab82b Aug 23, 2015
@ibell
Copy link
Contributor

ibell commented Aug 23, 2015

Should be fixed now - tested on linux in C++

@JonWel
Copy link
Contributor Author

JonWel commented Aug 23, 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