Scilab wrapper¶
There are at least three different ways of interfacing with CoolProp from scilab:
Call the default CoolProp shared library directly from CoolProp
Call CoolProp using the PIMS module which calls CoolProp through Python
SWIG wrapper for CoolProp (no longer actively supported)
Calling the shared library directly from scilab is the most straightforward to configure and get working, and requires no other scilab modules, but the only two functions that can be called are the high-level functions PropsSI
and HAPropsSI
For more complete coverage of CoolProp functionality, you can use the PIMS interface (see below)
Calling through PIMS¶
PIMS is an interface layer that allows you to call functions/modules/packages in Python. It can be installed with the command at a scilab prompt:
atomsInstall('PIMS')
Warning
Only python 2.7 is supported. The default python on your system must be python 2.7 and not python 3.4. I have no idea if you can switch which python it uses, it doesn’t seem so.
Also, numpy is required, but you should be using anaconda anyway, which includes numpy
Once it is installed, make sure that it can find python, and that the python it finds is a 2.7.x version of python:
pyEvalStr('import sys; print sys.version')
which should yield something like (OS-dependent):
2.7.11 |Continuum Analytics, Inc.| (default, Dec 7 2015, 14:10:42) [MSC v.1500 64 bit (AMD64)]
Then, you can use CoolProp just like in Python. Here is an example of calling the low-level interface to get the normal-boiling-point temperature of water:
pyImport CoolProp.CoolProp
AS = CoolProp.AbstractState('HEOS','Water')
AS.update(CoolProp.CoolProp.PQ_INPUTS, 101325, 1)
AS.T()
Or the same thing from the high-level interface:
pyImport CoolProp.CoolProp
CoolProp.CoolProp.PropsSI('T','P',101325,'Q',0,'Water')