CoolProp Wrapper

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

#61 Posted: 2023/4/21 15:17:35
Вячеслав Мезенцев

Вячеслав Мезенцев

1,544 likes in 1,859 posts.

Group: Moderator

Wrote

How can I get properties of mixtures e.g

CoolProp_Props("Dmass","T",273+100,"P",101.3*10^3,"Helium[0.5]&Xenon[0.5]"
ref: http://www.coolprop.org/fluid_properties/Mixtures.html


This can't be done directly in the current version of the plugin. It is not clear how to call the apply_simple_mixing_rule() function from the library, it can't be imported as it is not in the export table.

Click to enlarge

Click to enlarge

maple-python-coolprop.sm (6.61 KiB) downloaded 1544 time(s).
maple-python-coolprop.pdf (19.18 KiB) downloaded 998 time(s).

Click to enlarge
maple-python-coolprop-2.sm (5.08 KiB) downloaded 1518 time(s).
Russia ☭ forever, Viacheslav N. Mezentsev
#62 Posted: 2023/4/22 05:00:09
Alvaro

Alvaro

1,106 likes in 1,784 posts.

Group: User

Wrote

How can I get properties of mixtures e.g

CoolProp_Props("Dmass","T",273+100,"P",101.3*10^3,"Helium[0.5]&Xenon[0.5]"
ref: http://www.coolprop.org/fluid_properties/Mixtures.html



Hi. Notice that Refprop from NIST can't handle He/Xe mixing either. At least version 9.

On the other hand, maple doesn't seem to implement the procedure that Viacheslav points out either, as can be seen in the online documentation for the latest version.

However, very good values can be obtained using Coolprop in SMath and some basic stoichiometry.

Mixing gases.sm (19.17 KiB) downloaded 1474 time(s).
Mixing gases.pdf (67.22 KiB) downloaded 921 time(s).

Best regards.
Alvaro.
#63 Posted: 2023/4/22 05:34:44
Вячеслав Мезенцев

Вячеслав Мезенцев

1,544 likes in 1,859 posts.

Group: Moderator

More simple

Click to enlarge Click to enlarge Click to enlarge

maple-python-coolprop-3.sm (10.97 KiB) downloaded 1499 time(s).
maple-python-coolprop-3.1.sm (10.82 KiB) downloaded 1494 time(s).
maple-python-coolprop-3.2.sm (10.89 KiB) downloaded 1421 time(s).
Russia ☭ forever, Viacheslav N. Mezentsev
1 users liked this post
Alvaro 2023/4/22 09:32:00
#64 Posted: 2023/4/27 03:09:34
Вячеслав Мезенцев

Вячеслав Мезенцев

1,544 likes in 1,859 posts.

Group: Moderator

Now you can write like this

Click to enlarge Click to enlarge Click to enlarge

maple-python-coolprop-3.3.sm (9.51 KiB) downloaded 1513 time(s).
Russia ☭ forever, Viacheslav N. Mezentsev
#65 Posted: 2023/4/28 07:39:13
Вячеслав Мезенцев

Вячеслав Мезенцев

1,544 likes in 1,859 posts.

Group: Moderator

Or like this

Click to enlarge Click to enlarge

maple-python-coolprop-3.4.sm (10.66 KiB) downloaded 1513 time(s).
maple-python-coolprop-3.5.sm (10.3 KiB) downloaded 1480 time(s).
Russia ☭ forever, Viacheslav N. Mezentsev
#66 Posted: 2023/4/29 15:33:10
Вячеслав Мезенцев

Вячеслав Мезенцев

1,544 likes in 1,859 posts.

Group: Moderator

Click to enlarge

maple-python-coolprop-3.6.sm (9.98 KiB) downloaded 1477 time(s).
Russia ☭ forever, Viacheslav N. Mezentsev
#67 Posted: 2023/4/29 22:07:03
churichuro

churichuro

29 likes in 79 posts.

Group: User

is fantastic!
this no work the first time but after I play with the another examples this work, very well
thank you!
#68 Posted: 2023/5/4 10:29:17
Вячеслав Мезенцев

Вячеслав Мезенцев

1,544 likes in 1,859 posts.

Group: Moderator

Without "pyfile" (inline multiline script). The script should be without comments.

Space padding is necessary here so that inside the script, when a large string is divided into parts, the line break character itself is not divided ( '\n' -> '\ n' ).

Click to enlarge Click to enlarge Click to enlarge

maple-python-coolprop-3.7.sm (9.9 KiB) downloaded 1493 time(s).
maple-python-coolprop-3.8.sm (6.84 KiB) downloaded 1505 time(s).
maple-python-coolprop-3.9.sm (8 KiB) downloaded 1457 time(s).
Russia ☭ forever, Viacheslav N. Mezentsev
#69 Posted: 2023/7/30 08:12:32
usamakhan

usamakhan

3 likes in 79 posts.

Group: User

Uni, can you please help me how to add python into SMATH, I have python already in system [WinPython 3.9] How I link it up with Smath?

I have working CoolProp

smath_s.png
#70 Posted: 2023/7/30 13:33:42
usamakhan

usamakhan

3 likes in 79 posts.

Group: User

Jean, can you help me how do integrate python in my Smath? I event tried environmental variables under Win10 but didn't work
#71 Posted: 2023/7/31 03:45:32
Вячеслав Мезенцев

Вячеслав Мезенцев

1,544 likes in 1,859 posts.

Group: Moderator

You should use a double slash for the full path.

maple-python-coolprop-3.9.png

Wrote

I event tried environmental variables under Win10 but didn't work


In this case, you need to check whether python is available from the command line. If not, it means that the paths are specified incorrectly.
Russia ☭ forever, Viacheslav N. Mezentsev
#72 Posted: 2023/8/2 19:17:11
usamakhan

usamakhan

3 likes in 79 posts.

Group: User

uni, thanks a lot
Can you tell me what is this block you used after python sub-section [i.e with the square bracket & holding script conetnts]

Additionally Razonar sample here is also very intuitive while calculating mixing values
https://en.smath.com/forum/yaf_postsm82120_Understanding-Redlich-Kwong-equation-of-state.aspx#post82120
#73 Posted: 2023/8/3 03:06:16
Вячеслав Мезенцев

Вячеслав Мезенцев

1,544 likes in 1,859 posts.

Group: Moderator

Wrote

uni, thanks a lot
Can you tell me what is this block you used after python sub-section [i.e with the square bracket & holding script conetnts]


Mathcad Block from the Mathcad Toolbox plugin and just Text inside it for the script.

mathcad-block-menuitem.png
Russia ☭ forever, Viacheslav N. Mezentsev
#74 Posted: 2023/8/4 15:23:07
usamakhan

usamakhan

3 likes in 79 posts.

Group: User

uni, so it means the text inside the block is not automatically generated. Can you please explain the construct

On second note you were correct, I fixed my environment variable under windows %python% now works
#75 Posted: 2023/8/8 02:01:18
Alvaro

Alvaro

1,106 likes in 1,784 posts.

Group: User

Phase diagrams with CoolProps.

Click to enlarge

PhaseDiagram.sm (39.17 KiB) downloaded 1488 time(s).

Best regards.
Alvaro.
1 users liked this post
Davide Carpi 2023/8/8 02:10:00
#76 Posted: 2023/8/9 03:47:50
Alvaro

Alvaro

1,106 likes in 1,784 posts.

Group: User

Psychrometric Chart with CoolProps. 'Simplified' version (more readable): Enthalpy lines overlap web bulb temperature lines.

Click to enlarge

PsychrometricChart.sm (125.39 KiB) downloaded 1454 time(s).

Best regards.
Alvaro.
#77 Posted: 2023/8/21 17:39:50
usamakhan

usamakhan

3 likes in 79 posts.

Group: User

I think I have found some problems while using plugin to get phase properties as discussed here: http://www.coolprop.org/coolprop/HighLevelAPI.html#imposing-the-phase-optional

First when using "P|phase_gas" it doesn't accept units & T,P values have to be directly written in SI equivalent


Second there is a value discrepancy when using "P" & "P|phase_gas" for a fluid that exists only in gas phase at that T,P

File not found.File not found.
#78 Posted: 2024/4/16 03:55:20
Martin Kraska

Martin Kraska

1,353 likes in 2,264 posts.

Group: Moderator

It seems that multiple instances of SMath can't use the plugin at the same time.

How to reproduce:
1. Open SMath and access any Coolprop function
2. Open another SMath instance: You get an error message

2024-04-15 21_51_53-Plug-ins failed to start.png
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
#79 Posted: 2025/12/19 01:10:36
Alvaro

Alvaro

1,106 likes in 1,784 posts.

Group: User

Wrote

Phase diagrams with CoolProps. ...


Now can show other thermo properties, and get animations.

PhaseDiagram.sm (46.88 KiB) downloaded 481 time(s).

image.png

Animating volume of water and enthalpy of O2.

V-WATER.gif H-O2.gif

Best regards.
Alvaro.
1 users liked this post
  • New Posts
  • No New Posts