CoolProp Wrapper

CoolProp Wrapper - Pure and pseudo-pure fluid equations of state and transport properties for 122 components - Messages

#1 Posted: 3/28/2016 8:11:53 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

CoolProp Wrapper

SMath Studio compatibility SMath Viewer compatibility mono compatibility Extension page Sources


Functions
CoolProp_get_fluid_param_string
CoolProp_get_global_param_string
CoolProp_get_param_index
CoolProp_get_parameter_information_string
CoolProp_HAProps
CoolProp_Phase
CoolProp_Props
CoolProp_Props1
CoolProp_saturation_ancillary
CoolProp_set_reference_stateD
CoolProp_set_reference_stateS


This plugin (clone of the official SMath wrapper linked below, adapted to have it available through the Extensions Manager)


CoolProp


Official SMath wrapper (you have to build it by yourself, instructions in his documentation)


NOTE: you should be able to run worksheets made with a plugin using the other and vice-versa.
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 users liked this post
Mike Kaganski 3/28/2016 9:29:00 PM
#2 Posted: 3/28/2016 8:15:24 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

Wrote

Code uploaded in the SVN repository (CoolPropWrapper), to make it easily available for further changes.



UPDATED
- CoolProp 5.1.2
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
2 users liked this post
ElSid 4/11/2016 3:44:00 PM, Mike Kaganski 3/28/2016 9:29:00 PM
#3 Posted: 4/11/2016 2:12:47 PM
Mike Kaganski

Mike Kaganski

184 likes in 434 posts.

Group: User

A sheet to see some of CoolProp functions.
CoolProp_demo.sm (117 KiB) downloaded 442 time(s).

EDIT: Updated the demo (using development version of library).
С уважением, Михаил Каганский
3 users liked this post
Davide Carpi 4/12/2016 2:04:00 PM, ElSid 4/11/2016 3:44:00 PM, frapuano 4/12/2016 1:55:00 AM
#4 Posted: 5/6/2016 12:59:54 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

Very useful!
Thanks
Alvaro.
#5 Posted: 5/6/2016 9:38:56 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User


"Alvaro" was great collab from the former Mathsoft Collaboratory.
At that time of the Mathsoft Collaboratory, I signed "jmG".
Here is a hint: your great Mathcad 11 "Dichotomy" module.

Jean

#6 Posted: 5/9/2016 4:05:13 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

Hi, Jean. Yes, it's "me" (and my personal english too). ¿How are you?
#7 Posted: 6/2/2016 7:00:23 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

Hi. I don't know how to call the functions CoolProp_set_reference_stateD nor
CoolProp_set_reference_stateS. See the yellow in the attached.
Best regards.
Alvaro.
P3.sm (118 KiB) downloaded 204 time(s).
#8 Posted: 6/2/2016 10:41:17 AM
Mike Kaganski

Mike Kaganski

184 likes in 434 posts.

Group: User

Wrote

Hi. I don't know how to call the functions CoolProp_set_reference_stateD nor
CoolProp_set_reference_stateS. See the yellow in the attached.



https://github.com/CoolProp/CoolProp/issues/1091

Regarding CoolProp_set_reference_stateS, AFAICT, it works OK, following the definition given in https://github.com/CoolProp/CoolProp/blob/master/include/CoolProp.h :

    Set the reference state based on a string representation
    
    @param FluidName The name of the fluid (Backend can be provided like "REFPROP::Water", or if no backend is provided, "HEOS" is the assumed backend)
    @param reference_state The reference state to use, one of 
    
    Reference State | Description
    -------------   | -------------------
    "IIR"           | h = 200 kJ/kg, s=1 kJ/kg/K at 0C saturated liquid
    "ASHRAE"        | h = 0, s = 0 @ -40C saturated liquid
    "NBP"           | h = 0, s = 0 @ 1.0 bar saturated liquid
    "DEF"           | Reset to the default reference state for the fluid
    "RESET"         | Remove the offset
    
    The offset in the ideal gas Helmholtz energy can be obtained from
    {Δs}/{R_u/M}+{Δh}/{(R_u/M)T}τ
    where Δs = s-s_{spec} and Δh = h-h_{spec}

    void set_reference_stateS(const std::string &FluidName, const std::string &reference_state);

with the only exception that "RESET" doesn't remove any offset.
С уважением, Михаил Каганский
#9 Posted: 6/2/2016 1:55:47 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

Wrote


Regarding CoolProp_set_reference_stateS, AFAICT, it works OK, following the definition given in https://github.com/CoolProp/CoolProp/blob/master/include/CoolProp.h:



In the attached there are a similar information, from github too, but referent to the wrapper. Can provide a smath example changing the refstate and showing h or s values changing? I can't do that inside smath.

Thanks in advance

Alvaro.
#10 Posted: 6/2/2016 4:11:35 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

CoolProp_set_reference_stateD.gif

#11 Posted: 6/2/2016 6:03:44 PM
Mike Kaganski

Mike Kaganski

184 likes in 434 posts.

Group: User

Wrote


In the attached there are a similar information, from github too, but referent to the wrapper. Can provide a smath example changing the refstate and showing h or s values changing? I can't do that inside smath.



refstate.sm (48 KiB) downloaded 202 time(s).

WRT CoolProp_set_reference_stateD, I do agree it doesn't work for now, which is why I filed a bug upstream.
С уважением, Михаил Каганский
#12 Posted: 6/5/2016 5:28:43 PM
Mike Kaganski

Mike Kaganski

184 likes in 434 posts.

Group: User

@Davide,

Is it worth it to turn the plugin to newer interface, I mean Entry instead of Term[]? Which oldest SMath will be supported then?
С уважением, Михаил Каганский
#13 Posted: 6/5/2016 7:03:36 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

Wrote

@Davide,

Is it worth it to turn the plugin to newer interface, I mean Entry instead of Term[]? Which oldest SMath will be supported then?


Maybe yes, however soon or later should be done. Entry class is since 0.98, therefore supported versions as for now they would be only 0.98.5935 Stable and further nightly builds.

BTW in NonlinearSolvers refactoring I've switched all the functions to that interface (with different degrees of changes; some are just linked to Entry in the input/output points, in some other cases I've take advantage of the Entry features to make deep changes)
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#14 Posted: 6/6/2016 12:22:10 PM
Mike Kaganski

Mike Kaganski

184 likes in 434 posts.

Group: User

@Davide,

is there a documentation available (aside the source code itself)?
Thank you for your help.
С уважением, Михаил Каганский
#15 Posted: 6/6/2016 12:49:55 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

I've asked Andrey to publish the updated core documentation, I guess we have to wait the next Stable build...

If you want to try by examples: https://smath.info/svn/public/plugins/NonlinearSolvers/NIGHTLY BUILD/; in Tools you may found the most simpler examples (Taylor is an easy example of conversion in the input/output nodes using Terms; Unknowns makes use of Entry to do the job, Terms are used to build the output)
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#16 Posted: 6/8/2016 10:05:09 AM
Mike Kaganski

Mike Kaganski

184 likes in 434 posts.

Group: User

Making it run on mono under Ubuntu:

scrH54.png

Hope it will be available in next version of plugin.
С уважением, Михаил Каганский
1 users liked this post
Davide Carpi 6/8/2016 10:16:00 AM
#17 Posted: 10/25/2016 2:17:52 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

UPDATED Stable: SMath Studio 0.98.6128

- CoolProp 6.1.0;
- refactored to new SS fast interface (please test it a little so I can see if make it stable or I have to fix/change something);
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 users liked this post
Mike Kaganski 10/25/2016 4:54:00 PM
#18 Posted: 10/25/2016 5:05:43 PM
Mike Kaganski

Mike Kaganski

184 likes in 434 posts.

Group: User

Thanks, Davide!

Here's what I see:
CoolProp61.png

Also, no dynamic assistance is available. Though disabling the plugin doesn't help.
С уважением, Михаил Каганский
#19 Posted: 10/25/2016 10:21:34 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Though I don't use Smath unit system, two questions come to evidence:

1. 'Q' does not not belong to WASP [WaterSteamProperties].
2. '1' is what ? ... maybe '1' is atm in the 2nd line ?

If "Units don't match": how could the dynamic assistance help ?

The coulomb (unit symbol: C) is the International System of Units (SI) unit of electric charge.
It is the charge (symbol: Q or q) transported by a constant current of one ampere in one second:
1 C = 1 A * 1 s

1 ((Pa * m * s^2) / kg) * bar = 100 000 pascals
#20 Posted: 10/26/2016 4:27:20 AM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

Hello Mike,

Wrote

CoolProp61.png


Reproduced, thank you. I'll fix it ASAP

Wrote

Also, no dynamic assistance is available. Though disabling the plugin doesn't help.


This is really strange, I have the dynamic assistant both in install and portable versions and using different localizations (languages/symbols) o_o

Wrote

1. 'Q' does not not belong to WASP [WaterSteamProperties].
2. '1' is what ? ... maybe '1' is atm in the 2nd line ?


Hello Jean, according with CoolProp documentation "Q" stands for "Mass vapor quality", thus 1 is 1 mol/mol

Wrote

If "Units don't match": how could the dynamic assistance help ?


I guess it is a separate bug
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
  • New Posts New Posts
  • No New Posts No New Posts