Use of CoolProp in developing a GUI program

113 views
Skip to first unread message

Sino-Atrial Node

unread,
Jul 15, 2021, 3:56:36 PM7/15/21
to coolprop-users

Hello There,
I am writing a program with graphical user interface that let user select two input combination for water. Once given two input, other state properties are calculated and show in table. The program currently uses IAPWS module in the background.

Now I want to use CoolProp to calculate state properties for water and other pure substances as well. I am new to CoolProp

What's the best way of calculating other state properties given two independent properties?

Should I use AbstractState Class?
  • AS = AbstractState("HEOS", "Water")
  • AS.update(CoolProp.PQ_INPUTS, 101325, 1)
Then, accessing all other properties from the object

or, use the PropsSI Function?

This is the program that i am writing:
2021-07-11 20.46.20.png

Ian Bell

unread,
Jul 15, 2021, 8:18:10 PM7/15/21
to coolpro...@googlegroups.com
If you have access to the low-level interface, that is certainly recommended over the high-level interface, in almost all cases, except maybe in terms of verbosity of the code you have to right.  Certainly the speed will be better with low-level interface.

Ian

--
You received this message because you are subscribed to the Google Groups "coolprop-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coolprop-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/coolprop-users/e0f11347-2997-4041-9793-9e79136cc061n%40googlegroups.com.

Sino-Atrial Node

unread,
Jul 16, 2021, 11:44:54 AM7/16/21
to coolprop-users
You seem to be one the developers of the CoolProp and Thanks for taking the time to reply. Please help me regarding following matters if you have some time to spare.
  • How do i get the input range for certain input parameter for certain pure substance? I can get min and max for T, P. But what about other inputs. For example, user chooses input P and h. How do i get the valid range of h, so that i could restrict user input to that range.
  • is input pairs defined in CoolProp { QT_INPUTS, PQ_INPUTS, QSmolar_INPUTS etc..} for the update function valid for all substance? I mean, can all pure substance accept all those pairs? (or, there are exception for certain substance like, suppose, air can't take PQ_INPUTS. if so, How do I retrieve available input for certain substance. (and ranges as stated previously))
  • is all the outputs available for all substance. or, Can i access object.T (and for P, u, h, s, rho as well) where object could represent any fluid from CoolProp.FluidsList()
  • Do i need to care about back-end? can i get away with this ? object = AbstractState("HEOS", "Any substance in CoolProp.FluidsList()")

I am not from Computer Science. (ME student). So, I may not be good at exploring documentation. I could not find answers for above questions from the docs and source files. The reason for asking those question is to avoid writing if-else codes specific to substances.
object = AbstractState("HEOS", "Any substance in CoolProp.FluidsList()");
object.update("User provided combination", value1, value2);
object.T (and other properties)
Reply all
Reply to author
Forward
0 new messages