Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

4 Pages123>»
Options
Go to last post Go to first unread
Offline Davide Carpi  
#1 Posted : 29 March 2016 02:11:53(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,700
Man
Italy
Location: Italy

Was thanked: 1372 time(s) in 898 post(s)
CoolProp Wrapper

SMath Studio compatibility SMath Viewer compatibility mono compatibility Extension page Sources


Functions
Code:
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.

Edited by moderator 03 September 2021 13:04:06(UTC)  | Reason: Not specified

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
thanks 1 user thanked Davide Carpi for this useful post.
on 29/03/2016(UTC)

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Davide Carpi  
#2 Posted : 29 March 2016 02:15:24(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,700
Man
Italy
Location: Italy

Was thanked: 1372 time(s) in 898 post(s)
Originally Posted by: Davide Carpi Go to Quoted Post
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 consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
thanks 2 users thanked Davide Carpi for this useful post.
on 29/03/2016(UTC),  on 11/04/2016(UTC)
Offline mikekaganski  
#3 Posted : 11 April 2016 20:12:47(UTC)
mikekaganski


Rank: Advanced Member

Groups: Registered
Joined: 17/01/2013(UTC)
Posts: 296
Man
Russian Federation
Location: Khabarovsk, Russia

Was thanked: 151 time(s) in 107 post(s)
A sheet to see some of CoolProp functions.
CoolProp_demo.sm (118kb) downloaded 360 time(s).

EDIT: Updated the demo (using development version of library).

Edited by user 05 June 2016 23:07:43(UTC)  | Reason: Not specified

Best regards,
Mike Kaganski
thanks 3 users thanked mikekaganski for this useful post.
on 11/04/2016(UTC),  on 12/04/2016(UTC),  on 12/04/2016(UTC)
Offline Razonar  
#4 Posted : 06 May 2016 06:59:54(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,451
Uruguay

Was thanked: 900 time(s) in 574 post(s)
Very useful!
Thanks
Alvaro.
Offline Jean Giraud  
#5 Posted : 06 May 2016 15:38:56(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 983 time(s) in 811 post(s)

"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

Offline Razonar  
#6 Posted : 09 May 2016 10:05:13(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,451
Uruguay

Was thanked: 900 time(s) in 574 post(s)
Hi, Jean. Yes, it's "me" (and my personal english too). ¿How are you?
Offline Razonar  
#7 Posted : 02 June 2016 13:00:23(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,451
Uruguay

Was thanked: 900 time(s) in 574 post(s)
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 (119kb) downloaded 124 time(s).
Offline mikekaganski  
#8 Posted : 02 June 2016 16:41:17(UTC)
mikekaganski


Rank: Advanced Member

Groups: Registered
Joined: 17/01/2013(UTC)
Posts: 296
Man
Russian Federation
Location: Khabarovsk, Russia

Was thanked: 151 time(s) in 107 post(s)
Originally Posted by: Razonar Go to Quoted Post
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/CoolP...aster/include/CoolProp.h :
Code:

    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.

Edited by user 03 June 2016 02:35:30(UTC)  | Reason: Not specified

Best regards,
Mike Kaganski
Offline Razonar  
#9 Posted : 02 June 2016 19:55:47(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,451
Uruguay

Was thanked: 900 time(s) in 574 post(s)
Originally Posted by: mikekaganski Go to Quoted Post

Regarding CoolProp_set_reference_stateS, AFAICT, it works OK, following the definition given in https://github.com/CoolP...ster/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.

Edited by moderator 02 June 2016 21:40:06(UTC)  | Reason: fixed quote BBcode

Offline Razonar  
#10 Posted : 02 June 2016 22:11:35(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,451
Uruguay

Was thanked: 900 time(s) in 574 post(s)
CoolProp_set_reference_stateD.gif

Offline mikekaganski  
#11 Posted : 03 June 2016 00:03:44(UTC)
mikekaganski


Rank: Advanced Member

Groups: Registered
Joined: 17/01/2013(UTC)
Posts: 296
Man
Russian Federation
Location: Khabarovsk, Russia

Was thanked: 151 time(s) in 107 post(s)
Originally Posted by: Razonar Go to Quoted Post

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 (49kb) downloaded 123 time(s).

WRT CoolProp_set_reference_stateD, I do agree it doesn't work for now, which is why I filed a bug upstream.
Best regards,
Mike Kaganski
Offline mikekaganski  
#12 Posted : 05 June 2016 23:28:43(UTC)
mikekaganski


Rank: Advanced Member

Groups: Registered
Joined: 17/01/2013(UTC)
Posts: 296
Man
Russian Federation
Location: Khabarovsk, Russia

Was thanked: 151 time(s) in 107 post(s)
@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?
Best regards,
Mike Kaganski
Offline Davide Carpi  
#13 Posted : 06 June 2016 01:03:36(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,700
Man
Italy
Location: Italy

Was thanked: 1372 time(s) in 898 post(s)
Originally Posted by: mikekaganski Go to Quoted Post
@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 consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline mikekaganski  
#14 Posted : 06 June 2016 18:22:10(UTC)
mikekaganski


Rank: Advanced Member

Groups: Registered
Joined: 17/01/2013(UTC)
Posts: 296
Man
Russian Federation
Location: Khabarovsk, Russia

Was thanked: 151 time(s) in 107 post(s)
@Davide,

is there a documentation available (aside the source code itself)?
Thank you for your help.
Best regards,
Mike Kaganski
Offline Davide Carpi  
#15 Posted : 06 June 2016 18:49:55(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,700
Man
Italy
Location: Italy

Was thanked: 1372 time(s) in 898 post(s)
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 consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline mikekaganski  
#16 Posted : 08 June 2016 16:05:09(UTC)
mikekaganski


Rank: Advanced Member

Groups: Registered
Joined: 17/01/2013(UTC)
Posts: 296
Man
Russian Federation
Location: Khabarovsk, Russia

Was thanked: 151 time(s) in 107 post(s)
Making it run on mono under Ubuntu:

scrH54.png

Hope it will be available in next version of plugin.
Best regards,
Mike Kaganski
thanks 1 user thanked mikekaganski for this useful post.
on 08/06/2016(UTC)
Offline Davide Carpi  
#17 Posted : 25 October 2016 20:17:52(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,700
Man
Italy
Location: Italy

Was thanked: 1372 time(s) in 898 post(s)
Beta 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 consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
thanks 1 user thanked Davide Carpi for this useful post.
on 25/10/2016(UTC)
Offline mikekaganski  
#18 Posted : 25 October 2016 23:05:43(UTC)
mikekaganski


Rank: Advanced Member

Groups: Registered
Joined: 17/01/2013(UTC)
Posts: 296
Man
Russian Federation
Location: Khabarovsk, Russia

Was thanked: 151 time(s) in 107 post(s)
Thanks, Davide!

Here's what I see:
CoolProp61.png

Also, no dynamic assistance is available. Though disabling the plugin doesn't help.
Best regards,
Mike Kaganski
Offline Jean Giraud  
#19 Posted : 26 October 2016 04:21:34(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 983 time(s) in 811 post(s)
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
Offline Davide Carpi  
#20 Posted : 26 October 2016 10:27:20(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,700
Man
Italy
Location: Italy

Was thanked: 1372 time(s) in 898 post(s)
Hello Mike,

Originally Posted by: mikekaganski Go to Quoted Post
CoolProp61.png

Reproduced, thank you. I'll fix it ASAP Good

Originally Posted by: mikekaganski Go to Quoted Post
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) Wonder

Originally Posted by: Jean Giraud Go to Quoted Post
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

Originally Posted by: Jean Giraud Go to Quoted Post
If "Units don't match": how could the dynamic assistance help ?

I guess it is a separate bug Good

Edited by user 26 October 2016 10:29:26(UTC)  | Reason: Not specified

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Users browsing this topic
4 Pages123>»
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.