CoolProp

CoolProp - CoolProp is an open-source, cross-platform, free, thermo physical, fluid properties database. - Сообщения

#1 Опубликовано: 21.06.2014 16:52:14
Вячеслав Мезенцев

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

1402 сообщений из 1708 понравились пользователям.

Группа: Moderator

Dependences: [topic=755]Mathcad Custom Functions[/topic].

CoolProp for PTC Mathcad

Цитата

CoolProp is an open-source, cross-platform, free, thermo physical, fluid properties database that includes pure fluids, pseudo-pure fluids, and humid air properties. Nearly all the fluid models in CoolProp are based on Helmholtz energy formulations, and therefore the thermodynamic properties of interest can be obtained directly from partial derivatives of the Helmholtz energy.

Distributed with the most recent version of CoolProp (4.0.0) are PTC Mathcad “User Function” libraries, designed to wrap some of the primary CoolProp functions and make them available within PTC Mathcad worksheets. There are wrapper libraries defined for both PTC Mathcad 15.0 and PTC Mathcad Prime 3.0. The CoolProp wrapper source code for PTC Mathcad is also open-source and distributed freely on the CoolProp website.

In addition to the source code, there are pre-compiled libraries (.dll files) for both PTC Mathcad 15.0 and PTC Mathcad Prime 3.0. The provided PTC Mathcad 15.0 .dll was compiled/built in a 32-bit environment. The provided PTC Mathcad Prime 3.0 library was compiled/built in a 64-bit environment. If using a PTC Mathcad environment other than the two mentioned, there are build-scripts and instructions distributed with the source code, enabling users to build the CoolProp wrapper library specific to their environment.



Wrapper of CoolProp for MathCAD 15
==================================

copyright Scott Polak and Ian Bell, 2013

To Use
======

* Copy the CoolPropMathcadWrapper.dll file to C:\\Program Files (x86)\\Mathcad\\Mathcad 15\\userefi or equivalent for your version

* Open the CoolPropFluidProperties.xmcd file in MathCAD, fields should populate

To Build
========

* You will need to have Visual Studio 2008 installed (Express version is fine).  Alternatively newer versions of Microsoft Visual Studio C++ should be fine, you'll just have to update the path to the vcvarsall.bat in the BuildDLL.bat file

* Run the BuildDLL.bat file, it will generate the CoolPropMathcadWrapper.dll

* Follow the above instructions

Links:

1. CoolProp Website.
2. CoolProp for PTC Mathcad.
3. Download CoolProp-4.2.2-windows_superpack.zip ( 46.4 MB ).
CoolPropFluidProperties.sm (44 КиБ) скачан 503 раз(а).
Russia ☭ forever, Viacheslav N. Mezentsev
2 пользователям понравился этот пост
Martin Kraska 21.06.2014 18:29:00, Radovan Omorjan 22.06.2014 02:43:00
#2 Опубликовано: 21.06.2014 18:36:13
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Hello uni,

I'd like to include this in the portable distribution but so far I fail to do so. Putting coolprop.dll into the userefi directory does not seem to do the job.

efi.txt says

22.06.2014 00:28:26 [LoadLibraries] begin:
22.06.2014 00:28:26 [LoadLibraries] D:\FHB\Software\SMath\2014 06 21 SMath and Maxima\extensions\plugins\91a20d24-c30b-4774-9b1b-4d502a80420f\1.0.4977.35617\userefi\CoolProp.dll loaded.
22.06.2014 00:28:26 [CreateUserFunction] Psi - [DIGAMMA.DLL] [ z ] Digamma function for complex z
...

All functions in your example file are undefined.

Thanks for any hint.



Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#3 Опубликовано: 22.06.2014 00:20:53
Вячеслав Мезенцев

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

1402 сообщений из 1708 понравились пользователям.

Группа: Moderator

CoolPropMathcadWrapper.dll

To Use
======

* Copy the CoolPropMathcadWrapper.dll file to \\userefi or equivalent for your version

* Open the CoolPropFluidProperties.xmcd file in MathCAD, fields should populate

22.06.2014 10:18:04 [LoadLibraries] begin:
22.06.2014 10:18:04 [CreateUserFunction] FluidProp1 - [CoolPropMathcadWrapper.dll] [ Fluid, Property Name ] returns a fluid-specific parameter, where the parameter is not dependent on the fluid state
22.06.2014 10:18:04 [CreateUserFunction] FluidProp - [CoolPropMathcadWrapper.dll] [ Output Name, Input Name 1, Input Property 1, Input Name 2, Input Property 2, Fluid Name ] returns a fluid-specific parameter, where the parameter is dependent on the fluid state
22.06.2014 10:18:04 [CreateUserFunction] FluidPropI - [CoolPropMathcadWrapper.dll] [ Output Name, Input Name 1, Input Property 1, Input Name 2, Input Property 2, Fluid Name ] returns a fluid-specific parameter, where the parameter is dependent on the fluid state, using integer math for faster computation
22.06.2014 10:18:04 [CreateUserFunction] HAProp - [CoolPropMathcadWrapper.dll] [ Output Name, Input Name 1, Input Property 1, Input Name 2, Input Property 2, Input Name 3, Input Property 3 ] returns a parameter of humid air, where the parameter is dependent on the fluid state and humidity
22.06.2014 10:18:04 [CreateUserFunction] FluidPropsParams - [CoolPropMathcadWrapper.dll] [ string, name of the parameter to retrieve ] returns the value of the requested CoolProps parameter
22.06.2014 10:18:04 [LoadLibraries] C:\Users\User\AppData\Roaming\SMath\extensions\plugins\91a20d24-c30b-4774-9b1b-4d502a80420f\1.0.4977.35617\userefi\CoolPropMathcadWrapper.dll loaded.
22.06.2014 10:18:04 [CreateUserFunction] Psi - [DIGAMMA.DLL] [ z ] Digamma function for complex z
22.06.2014 10:18:04 [LoadLibraries] C:\Users\User\AppData\Roaming\SMath\extensions\plugins\91a20d24-c30b-4774-9b1b-4d502a80420f\1.0.4977.35617\userefi\DIGAMMA.DLL loaded.
22.06.2014 10:18:04 [CreateUserFunction] kronecker - [KRONECKR.DLL] [ M,N ] Kronecker product of a square matrix M and a square matrix N
22.06.2014 10:18:04 [LoadLibraries] C:\Users\User\AppData\Roaming\SMath\extensions\plugins\91a20d24-c30b-4774-9b1b-4d502a80420f\1.0.4977.35617\userefi\KRONECKR.DLL loaded.
22.06.2014 10:18:04 [LoadLibraries] end.
Russia ☭ forever, Viacheslav N. Mezentsev
1 пользователям понравился этот пост
Martin Kraska 22.06.2014 04:26:00
#4 Опубликовано: 22.06.2014 03:25:57
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: Moderator

Thank you uni

Regards,
Radovan

CoolPropFluidProperties.png
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#5 Опубликовано: 22.06.2014 04:24:22
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Wrote


All functions in your example file are undefined.
Thanks for any hint.


I used the wrong dll (from excel and dll subfolder).
Now the library seems to work. Just strSplit() is undefined.

Maxima has a function split(string, delimiter), however, due to a translation bug only the default delimiter (space) works. Therefore, the kommas have to be replaced by spaces first.

dplit.PNG
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
2 пользователям понравился этот пост
Вячеслав Мезенцев 22.06.2014 04:44:00, Radovan Omorjan 22.06.2014 09:50:00
#6 Опубликовано: 01.09.2014 15:54:02
Robert

Robert

0 сообщений из 3 понравились пользователям.

Группа: User

Hello and thanks for the infos already given here.

I tried to follow the instuctions on my linux system :

- Portable SMath and Maxima is installed successfully
- The CoolPropMathcadWrapper.dll was already in the userefi directory
- Efi plugin installed

However so far the CoolProp functions are not recognized.

Maybe its not possible to use CoolProp with SMath on Linux? As MathCAD doesn't run under Linux the following line given by Uni makes me think so:

* Open the CoolPropFluidProperties.xmcd file in MathCAD, fields should populate

If anybody managed to run it under linux I would be very interested.

Thanks,
Robert
#7 Опубликовано: 01.09.2014 17:59:57
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Wrote

Hello and thanks for the infos already given here.

I tried to follow the instuctions on my linux system :

- Portable SMath and Maxima is installed successfully


Do I get it right, you really got to work the Maxima plugin under linux? Could you please explain, how that was done?

Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#8 Опубликовано: 02.09.2014 07:00:17
Вячеслав Мезенцев

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

1402 сообщений из 1708 понравились пользователям.

Группа: Moderator

Show me efi.txt.
Russia ☭ forever, Viacheslav N. Mezentsev
#9 Опубликовано: 08.09.2014 18:14:42
Robert

Robert

0 сообщений из 3 понравились пользователям.

Группа: User

Hi Mkraska,

Well, yes I am running the portable version (2014 08 24 SMath and Maxima) under Linux (Linux Mint 16 Petra). I so far did basic static calculations, that works but I don't know if the Maxima plugin is used... It couldn't have been easier to install it, I just followed the instructions. Sorry that I cant tell more but please just write me if you want more info or a kind of test.

Regards,
Robert
#10 Опубликовано: 08.09.2014 18:54:51
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Wrote


Well, yes I am running the portable version (2014 08 24 SMath and Maxima) under Linux (Linux Mint 16 Petra). I so far did basic static calculations, that works but I don't know if the Maxima plugin is used... It couldn't have been easier to install it, I just followed the instructions. Sorry that I cant tell more but please just write me if you want more info or a kind of test.


There are some examples in the interactive handbook. Open the handbook via [?] button in the toolbar. Navigate to Mathematics> Symbolic Math with Maxima
If you get a pop-up window "Start Maxima" with a progress bar (not more than 20sec) and no errors in the math regions, then Maxima is running.

A quick test would be to type Maxima TAB a+b and evaluate that symbolically (-> button in the arithmetics palette).

Yet I do not expect Maxima to run, as it has never been tested under Linux in the development. Under linux, Maxima can hardly be run by starting maxima.bat, as done by the plugin. There might be a chance in wine, but I haven't heard of any success.
maxima.PNG
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#11 Опубликовано: 09.09.2014 04:24:36
Вячеслав Мезенцев

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

1402 сообщений из 1708 понравились пользователям.

Группа: Moderator

CoolProp 4.2.5 also works: Wrapper of CoolProp for MathCAD 15.
Russia ☭ forever, Viacheslav N. Mezentsev
#12 Опубликовано: 10.09.2014 16:27:11
Robert

Robert

0 сообщений из 3 понравились пользователям.

Группа: User

Hi Uni and Mkraska,

I tried what you suggested, and yes, I did't manage to run Maxima on my linux system although I can use SMath. It seems to me that there is something with the file system, because :

- When I declare the Maxima installation path, the program aborts
- In the /userefi directory there is no efi.txt file

My solution is simply to install Windows so that I can use SMath for my calculations.

Thanks for your hints and for that great program,
Robert
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений