564 Commits

Author SHA1 Message Date
Ian Bell
4895d593f2 Fix spinodal functions 2016-10-23 22:08:06 -06:00
Ian Bell
42e74fab5d Remove void in build_spinodal definition 2016-10-23 20:42:34 -06:00
Ian Bell
bab5dc6f91 Fix fortran binding functions (needed VALUE in two places) 2016-10-23 18:11:28 -06:00
Ian Bell
8d6835ea30 Remove sheets from xlam to perhaps fix link errors on OSX 2016-10-23 17:12:45 -06:00
Ian Bell
70975e9706 Fix bug in VBA for mac and add 32-bit excel prototypes on mac 2016-10-23 12:48:03 -06:00
Ian Bell
0ec95177f1 Add ability to set ALTERNATIVE_REFPROP_PATH and read environment variables
The environment variable COOLPROP_REFPROP_PATH can be set to indicate to CoolProp what path should be used

Closes #1235
2016-10-23 12:37:52 -06:00
Ian Bell
6285e7c137 Add PtrSafe to all functions in VBA 2016-10-23 12:37:52 -06:00
Ian Bell
365bcb7e18 Update pybind11 wrapper code and build files 2016-10-22 17:22:17 -06:00
Ian Bell
49c6932fda Add preprocessor macro around pybind11 module instantiation to protect it 2016-10-21 18:51:42 -06:00
Ian Bell
94242e224b Add a pybind11 wrapper interface file for low-level interface 2016-10-21 18:46:59 -06:00
Ian Bell
6818e91dff Try to update FORTRAN examples - something funny going on 2016-10-20 08:47:33 -06:00
Jorrit Wronski
13625dc040 Merge branch 'integrate_excel_installer' 2016-10-18 17:16:41 +02:00
Jorrit Wronski
930debd741 Added some docs for #1237 and removed a duplicate rst for Excel 2016-10-14 15:07:28 +02:00
Ian Bell
7893a7f7d9 Make spinodal accessible to python
See plot:

```
import CoolProp, numpy as np, matplotlib.pyplot as plt
CP = CoolProp.CoolProp
AS = CP.AbstractState('HEOS','Methane&Ethane')
AS.set_mole_fractions([0.5,0.5])

# The spinodal
AS.build_spinodal()
sp = AS.get_spinodal_data()
plt.plot(sp.tau, sp.delta, label='spinodal')

# The phase envelope
AS.build_phase_envelope("none")
pe = AS.get_phase_envelope_data()
plt.plot(AS.T_reducing()/np.array(pe.T), np.array(pe.rhomolar_vap)/AS.rhomolar_reducing(), label='phase envelope')

plt.show()
```
2016-10-13 20:48:10 -06:00
Jorrit Wronski
1ca6bc57e1 Removed the double compilation of the cdecl dll, make Excel use the standard dlls, added the vba code to source control 2016-10-13 18:46:49 +02:00
Ian Bell
fd1fe626b2 Merge branch 'master' of https://github.com/CoolProp/coolprop 2016-09-30 00:42:24 -06:00
Ian Bell
f0b350e81b Add -fpermissive flag to VxWorks build 2016-09-30 00:37:19 -06:00
Ian Bell
7d5ad27f1b Couple of small typos in VxWorks docs 2016-09-29 22:23:50 -06:00
Ian Bell
138911523b Really turn off cppformat for VxWorks 2016-09-29 22:05:27 -06:00
Ian Bell
746e9bb730 Updating build system for vxWorks 2016-09-29 21:39:39 -06:00
Jorrit Wronski
3a72d8cf02 Might have fixed the CMake issues in #1247 2016-09-30 00:16:48 +02:00
Jorrit Wronski
f31e0a302d Removed the absolute path from the Excel example file 2016-09-23 10:30:41 +02:00
Jorrit Wronski
62fbcd2373 Modified the Excel files to match the new library names and included a new CMake target in the builbot configuration 2016-09-18 21:39:03 +02:00
Ian Bell
5fc1d9f51a Add the ability to set limits in Consistency plots (#1234) 2016-09-16 10:14:30 -06:00
Ian Bell
9a9e7ecc54 Fix path to which cppformat is copied 2016-08-30 18:38:55 -06:00
Ian Bell
fecff87a19 Another try at MathCAD 2016-08-28 16:44:46 -06:00
Ian Bell
6b18c4361e Try to fix MathCAD wrapper 2016-08-28 13:44:16 -06:00
Ian Bell
1d64b31fa0 Update setup.py for new location of cppformat 2016-08-28 00:51:02 -06:00
Ian Bell
f6b8467249 A few improvements to consistency plots 2016-08-23 22:54:44 -06:00
Ian Bell
47bd64343a Add some more debugging to consistency plots, disable psuedo-pure in two-phase region 2016-08-23 22:32:18 -06:00
Ian Bell
57584a7254 Merge VTPR (#1195)
* Added first working version of VTPR;

* Get VTPR building hopefully

* Remove more constant iterators

* Make VTPR accessible through factory

* One last const iterator

* Fix a_alpha bug and make sqrt(2) into sqrt(2.0)

* Added analytic first derivative for VTPR

* Fix another set of sqrt(2) -> sqrt(2.0)

* Add some info on the derivatives for VTPR

Looks less hopeless than I had feared

* gE/RT needs to be multiplied by RT; closes #1161

* Added first working version of VTPR;

* Get VTPR building hopefully

* Remove more constant iterators

* Make VTPR accessible through factory

* One last const iterator

* Fix a_alpha bug and make sqrt(2) into sqrt(2.0)

* Added analytic first derivative for VTPR

* Fix another set of sqrt(2) -> sqrt(2.0)

* Add some info on the derivatives for VTPR

Looks less hopeless than I had feared

* gE/RT needs to be multiplied by RT; closes #1161

* Add VTPR code from @JonWel (#1194)

* 1rst draft to implement a simple volume translation to cubics

* A bit more of VT

* Derivatives for volume translation

* Better cm initialisation

* Solves the cubic equation with volume translation

* Correct the volume translation analytic development
Looks good now

* Update VTPR to be able to use volume translation

* Unprotect cm_term
This allows it to be used from the VTPR backend

* Update CoolPropLib.def

* Better derrivative of PI_12

The expression is simpler this way

* Solves #1176
Thanks @ibell

* Change the way the volume translation parrameter is set

* Start the bm derivatives for VTPR

* Correct one derivative

* Small bug

* Better bm derivatives for VTPR

* Add am and bm component derivatives for VTPR
@ibell I did not check yet the component derivatives of this commit, bu I checked the other ones with your code.
I'll have to addapt your code to also check these ones.

I separate the `am_term` and `bm_term` as the `am_bm_term` function was called twice. This reduce the call to the am_term part as this part ends up being called only once, and this helped writing the component derivatives.

The tau derivative is done numerically untill we find time to develop the analytical one.

The `am_bm_term` function started with a `set_temperature()`. I did not checked yet why this is needed and put this set temperature at the beginning of each of the `am_term` component derivatives.

I'll try to addapt the checking code tomorow.

* tab to spaces

* Re-writing of cubic coefficients
Introducing 3 intermediary varriables that simplify the cubic's coefficient with the volume translation.

* 1rst draft to implement a simple volume translation to cubics

* A bit more of VT

* Derivatives for volume translation

* Better cm initialisation

* Solves the cubic equation with volume translation

* Correct the volume translation analytic development
Looks good now

* Update VTPR to be able to use volume translation

* Unprotect cm_term
This allows it to be used from the VTPR backend

* Update CoolPropLib.def

* Better derrivative of PI_12

The expression is simpler this way

* Solves #1176
Thanks @ibell

* Change the way the volume translation parrameter is set

* Start the bm derivatives for VTPR

* Correct one derivative

* Small bug

* Better bm derivatives for VTPR

* Add am and bm component derivatives for VTPR
@ibell I did not check yet the component derivatives of this commit, bu I checked the other ones with your code.
I'll have to addapt your code to also check these ones.

I separate the `am_term` and `bm_term` as the `am_bm_term` function was called twice. This reduce the call to the am_term part as this part ends up being called only once, and this helped writing the component derivatives.

The tau derivative is done numerically untill we find time to develop the analytical one.

The `am_bm_term` function started with a `set_temperature()`. I did not checked yet why this is needed and put this set temperature at the beginning of each of the `am_term` component derivatives.

I'll try to addapt the checking code tomorow.

* tab to spaces

* Re-writing of cubic coefficients
Introducing 3 intermediary varriables that simplify the cubic's coefficient with the volume translation.
2016-08-21 12:34:55 -06:00
Ian Bell
ee040062c7 Add 4th order alphar derivatives to python; closes #1184 2016-08-11 21:42:47 -06:00
Ian Bell
2c598fe33a Add mole fractions to phase envelopes in python and C++; closes #1164 2016-08-10 19:54:20 -06:00
Jeff Henning
97d536fcd9 Updates to the Excel Wrapper and Files (#1173)
* Updates to the Excel Wapper and Files

- Added README.rst with updated Installation and Build Instructions
- Fixed PhaseSI() function in CoolProp.xlam
- Removed Deprecated Props() function in CoolProp.xlam
- Added get_global_param_string() function in CoolProp.xlam
- General overhaul of the TestExcel.xlsx example file

* Minor edit to README.rst

* Unprotect Example wkbk and rename VBA to CoolProp
2016-08-02 08:00:51 -06:00
JonWel
75da119182 Export set_config_string, closes #1160 (#1163) 2016-07-19 08:08:38 -06:00
Ian Bell
ab744e1c0d Add evaluation of excess properties in python; closes #1071 2016-07-12 19:46:05 -06:00
Jorrit Wronski
89cac55f86 Removing a single unused import fixes #1094 2016-07-12 16:32:40 +02:00
Ian Bell
ccc4568cbd Re-implement fundamental derivative of gas dynamics; closes #1145 2016-07-09 17:13:44 -06:00
JonWel
61146d02bc Update CoolPropLib.def (#1135)
* Update CoolPropLib.def

* Update julia wrapper
Correct type specification for Array inputs.

* Update Julia wrapper
Improves type possibilities for Array functions.
It is interesting to notice that the wrapper makes use of the linear indexing feature. Matrices can be send, and will simply be processed as a vector.
2016-06-24 17:08:48 -06:00
JonWel
579bba98c4 Export specify_phase() to the library, closes #1133 (#1134)
* Cubic calc_molar_mass, closes #1124

* Add simplified update and output functions
This allows simpler use of the low level interface by using the strings name instead of the parameter number.
The parameter number version stays and will be faster for more than one call with the same parameter.

* Add AbstractState_update_and_1_out

* Export specify_phase() to the library

* small correction
Safer to only accept an array of real numbers here.

* Small correction
Specifying the type of the array to avoid any convertion
2016-06-22 21:57:13 -06:00
Mike Kaganski
1f1bf52f77 Change names of dlls copied to SMath wrapper: use underscore instead of dot (#1113)
This is required in order to remove ".dll" extension from the library
name in .NET DllImport. And that, in turn, is intended to enable
cross-platform use of SMath wrapper on other OSes, like Linux (that is
supported by both CoolProp and SMath).
As explained at
http://www.mono-project.com/docs/advanced/pinvoke/, it's recommended to
omit the library extension to allow mono to find native libraries.
2016-06-21 08:31:43 -06:00
Jorrit Wronski
3632f76e9a handling of the critical point for the plots seems to done, closes #1118 2016-06-09 16:45:51 +02:00
Jorrit Wronski
209474a7e2 Bug in the copy operation for mixtures 2016-06-09 16:18:39 +02:00
Jorrit Wronski
af5104a830 Bug in the copy operation for mixtures 2016-06-09 16:18:38 +02:00
Jorrit Wronski
1a0259a744 Change the factory method to accept more strings, closes #1120 2016-06-09 16:18:38 +02:00
Jorrit Wronski
7c0d3ebe37 Included a manual copy of the abstract state object and exposed the backend name to Python 2016-06-09 16:18:38 +02:00
Jorrit Wronski
809998aecb Added a real state object for the critical state 2016-06-09 16:18:38 +02:00
JonWel
87fd90af84 Correct AbstractState_set_binary_interaction_double in shared library (#1117)
* Correct AbstractState_set_binary_interaction_double

Convert `i` and `j` to `size_t` when calling `AbstractState_set_binary_interaction_double`

* Addapt Julia wrapper to c16a4b6

Now `AbstractState_set_binary_interaction_double` needs `long` for `i` and `j`
2016-06-09 07:51:49 -06:00
JonWel
afeca6a8b2 Export set_binary_interaction_double + Julia wrapper improvement (#1114)
* Precompiling of Julia Wrapper only for Julia 0.4+
Should allow to keep compatibility with Julia 0.3

* Export set_binary_interaction_double
to the shared library and add it to Julia Wrapper

* Correct comment in previous commit

* Change tab to spaces in precendent commit

* Add update_and_*_out functions

Add `AbstractState_update_and_common_out` and `AbstractState_update_and_5_out` to the wrapper

* Update .gitignore
2016-06-08 07:19:14 -06:00
Mike Kaganski
9a0851c5dd Improvements to SMath wrapper error handling and some small tweaks (#1111)
* Improve SMath wrapper error handling

1. Make CoolProp errors visible to SMath immediately, calling
get_global_param_string("errstring").
2. Use System.Exception with message instead of SMath own exceptions
where possible (to show the required message instead of irrelevant SMath
unconfigurable one); only retain SMath exceptions where it's necessary.

* Remove redundant text from release_readme.rst.txt; fixes #1105
2016-06-07 19:34:23 -06:00