CoolProp Wrapper

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

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

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

1.558 apprezzamenti in 1.868 post.

Gruppo: 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) scaricato 1963 volta(e).
maple-python-coolprop.pdf (19,18 KiB) scaricato 1388 volta(e).

Click to enlarge
maple-python-coolprop-2.sm (5,08 KiB) scaricato 1920 volta(e).
Russia ☭ forever, Viacheslav N. Mezentsev
#62 Pubblicato: 22/04/2023 05:00:09
Alvaro

Alvaro

1.139 apprezzamenti in 1.805 post.

Gruppo: 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) scaricato 1912 volta(e).
Mixing gases.pdf (67,22 KiB) scaricato 1298 volta(e).

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

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

1.558 apprezzamenti in 1.868 post.

Gruppo: Moderator

More simple

Click to enlarge Click to enlarge Click to enlarge

maple-python-coolprop-3.sm (10,97 KiB) scaricato 1925 volta(e).
maple-python-coolprop-3.1.sm (10,82 KiB) scaricato 1921 volta(e).
maple-python-coolprop-3.2.sm (10,89 KiB) scaricato 1830 volta(e).
Russia ☭ forever, Viacheslav N. Mezentsev
1 utenti hanno apprezzato questo post
Alvaro 22/04/2023 09:32:00
#64 Pubblicato: 27/04/2023 03:09:34
Вячеслав Мезенцев

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

1.558 apprezzamenti in 1.868 post.

Gruppo: 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) scaricato 1929 volta(e).
Russia ☭ forever, Viacheslav N. Mezentsev
#65 Pubblicato: 28/04/2023 07:39:13
Вячеслав Мезенцев

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

1.558 apprezzamenti in 1.868 post.

Gruppo: Moderator

Or like this

Click to enlarge Click to enlarge

maple-python-coolprop-3.4.sm (10,66 KiB) scaricato 1934 volta(e).
maple-python-coolprop-3.5.sm (10,3 KiB) scaricato 1894 volta(e).
Russia ☭ forever, Viacheslav N. Mezentsev
#66 Pubblicato: 29/04/2023 15:33:10
Вячеслав Мезенцев

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

1.558 apprezzamenti in 1.868 post.

Gruppo: Moderator

Click to enlarge

maple-python-coolprop-3.6.sm (9,98 KiB) scaricato 1875 volta(e).
Russia ☭ forever, Viacheslav N. Mezentsev
#67 Pubblicato: 29/04/2023 22:07:03
churichuro

churichuro

29 apprezzamenti in 79 post.

Gruppo: User

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

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

1.558 apprezzamenti in 1.868 post.

Gruppo: 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) scaricato 1922 volta(e).
maple-python-coolprop-3.8.sm (6,84 KiB) scaricato 1919 volta(e).
maple-python-coolprop-3.9.sm (8 KiB) scaricato 1884 volta(e).
Russia ☭ forever, Viacheslav N. Mezentsev
#69 Pubblicato: 30/07/2023 08:12:32
usamakhan

usamakhan

7 apprezzamenti in 97 post.

Gruppo: 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 Pubblicato: 30/07/2023 13:33:42
usamakhan

usamakhan

7 apprezzamenti in 97 post.

Gruppo: 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 Pubblicato: 31/07/2023 03:45:32
Вячеслав Мезенцев

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

1.558 apprezzamenti in 1.868 post.

Gruppo: 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 Pubblicato: 02/08/2023 19:17:11
usamakhan

usamakhan

7 apprezzamenti in 97 post.

Gruppo: 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 Pubblicato: 03/08/2023 03:06:16
Вячеслав Мезенцев

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

1.558 apprezzamenti in 1.868 post.

Gruppo: 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 Pubblicato: 04/08/2023 15:23:07
usamakhan

usamakhan

7 apprezzamenti in 97 post.

Gruppo: 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 Pubblicato: 08/08/2023 02:01:18
Alvaro

Alvaro

1.139 apprezzamenti in 1.805 post.

Gruppo: User

Phase diagrams with CoolProps.

Click to enlarge

PhaseDiagram.sm (39,17 KiB) scaricato 1924 volta(e).

Best regards.
Alvaro.
1 utenti hanno apprezzato questo post
Davide Carpi 08/08/2023 02:10:00
#76 Pubblicato: 09/08/2023 03:47:50
Alvaro

Alvaro

1.139 apprezzamenti in 1.805 post.

Gruppo: User

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

Click to enlarge

PsychrometricChart.sm (125,39 KiB) scaricato 1885 volta(e).

Best regards.
Alvaro.
#77 Pubblicato: 21/08/2023 17:39:50
usamakhan

usamakhan

7 apprezzamenti in 97 post.

Gruppo: 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 non trovato.File non trovato.
#78 Pubblicato: 16/04/2024 03:55:20
Martin Kraska

Martin Kraska

1.361 apprezzamenti in 2.275 post.

Gruppo: 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 Pubblicato: 19/12/2025 01:10:36
Alvaro

Alvaro

1.139 apprezzamenti in 1.805 post.

Gruppo: User

Wrote

Phase diagrams with CoolProps. ...


Now can show other thermo properties, and get animations.

PhaseDiagram.sm (46,88 KiB) scaricato 885 volta(e).

image.png

Animating volume of water and enthalpy of O2.

V-WATER.gif H-O2.gif

Best regards.
Alvaro.
2 utenti hanno apprezzato questo post
Вячеслав Мезенцев 19/12/2025 18:44:49, Valery Ochkov 23/06/2026 08:27:38
#80 Pubblicato: 12/08/2026 21:45:52
Nate Brown

Nate Brown

0 apprezzamenti in 1 post.

Gruppo: User

I have a small feature request that I may be in the wrong spot to make. Anyway, I love how the CoolProp Wrapper is able to keep track of units and it's way more convenient than Excel or Python. Today I noticed that the wrapper is currently unable to handle units for derivatives. For example, the syntax of CoolProp_Props("d(C)/d(T)|P", "T", 300 K, "P", 1 atm, "Water") results in -0.3248 unitless. By doing a central difference around the same temperature with constant pressure, SMath+CoolProp will respond with -0.3248 J/kg·K². Is there a way that we can get the units into the shorter syntax?
  • Nuovi post
  • Nessun nuovo post