566 Commits

Author SHA1 Message Date
Ian Bell
0701ca2e4a Try to fix problem with SpinodalData for swig 2016-10-23 11:14:51 -06:00
Ian Bell
2bbb6d068c Also add high-level interface to pybind11 interface 2016-10-21 19:42:23 -06:00
Ian Bell
156b3e5cb9 Export spinodal curves in DLL; closes #1273 2016-10-17 20:06:08 -06:00
Ian Bell
ffbba512da Fix indent 2016-10-17 19:56:08 -06:00
Ian Bell
91704a450b Export critical points in DLL; closes #1274 2016-10-17 19:55:25 -06:00
Ian Bell
797f500307 Use powInt instead of pow(double,int) - seems to save about 30% in speed 2016-10-16 13:13:22 -06:00
Ian Bell
a4a8eaa5ae Rename SpinodalValues to SpinodalData to mirror phase envelope 2016-10-13 20:30:25 -06:00
Ian Bell
b948f44dd8 Implement in C++ the calculation of the spinodal 2016-10-13 20:18:28 -06:00
Ian Bell
c929e92b3d Build/retrieve phase envelope through high-level DLL; closes #1158 2016-10-13 19:35:36 -06:00
Ian Bell
c3184a67f5 Implement set_double_array2D; closes #1252 2016-10-05 21:33:04 -06:00
Ian Bell
84a00830b1 Slightly nicer error message 2016-09-30 00:54:28 -06:00
Ian Bell
5b9e66c2c1 lots of small updates to get VxWorks to build properly 2016-09-30 00:41:24 -06:00
Ian Bell
953e77856a Missing semicolon ... 2016-09-29 22:09:27 -06:00
Ian Bell
51575cd2dd Add inline modifier to old format function 2016-09-29 22:07:15 -06:00
Ian Bell
317e37504c Disable cppformat for VxWorks 2016-09-29 22:03:45 -06:00
Ian Bell
ac8e6df11d Add ability to use Peng-Robinson in REFPROP; closes #1233 2016-09-15 21:01:36 -06:00
Jorrit Wronski
3f3a63f8be Minor compatibility fix for cppformat 2016-09-11 19:41:42 +02:00
Ian Bell
9b129ce950 First cut at adding ODE integrators; closes #1220 2016-09-01 13:24:14 -06:00
Ian Bell
bbcbbf1384 Update cppformat; see #1065 2016-08-28 00:33:00 -06:00
Ian Bell
0dcc97210b Avoid crazy number of calls to set_temperature if possible. 2016-08-27 22:39:05 -06:00
Ian Bell
8f0aa03650 Updates to solvers to store the number of iterations and allow for damped methods; see #985 2016-08-23 20:55:31 -06:00
Ian Bell
6d6c96ef0c Repair the non-cached calculations 2016-08-21 18:54:36 -06:00
Ian Bell
3e9ca1fbf4 Remove non-c types from CoolPropLib.[cpp/h]
@JonWel - watch out for the use of C++ types in C header
2016-08-21 12:45:35 -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
e7fc3eb096 Add 4th order solver (Householder method) with three analytic derivatives ; closes #1185 2016-08-12 18:49:21 -06:00
Ian Bell
95a3cc8892 Add function to generate rapidjson instance from JSON string; closes #1182 2016-08-11 21:54:24 -06:00
Ian Bell
046b5b1037 REFPROP can impose phase and call TPRHO; see #1175 2016-08-07 15:39:29 -06:00
Ian Bell
9bd37e7d64 Add InChI keys and string, SMILES, etc; closes #1069
See also #115
2016-07-27 19:42:31 -06:00
JonWel
75da119182 Export set_config_string, closes #1160 (#1163) 2016-07-19 08:08:38 -06:00
Jorrit Wronski
458ee9469e Added a check for the inputs to calc_Tfreeze, solves #1137 2016-07-17 01:21:41 +02:00
Ian Bell
e2a16a300b Implemented excess properties in C++; see #1071 2016-07-12 19:31:35 -06:00
Ian Bell
ccc4568cbd Re-implement fundamental derivative of gas dynamics; closes #1145 2016-07-09 17:13:44 -06:00
Ian Bell
f5e4e3faea Add viscosity for the xylenes; closes #1068 2016-07-04 00:09:03 -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
Ian Bell
84f7eff363 Drastically improve stability of QT for cubics through the use of spinodal pressures 2016-06-15 23:34:26 -06:00
Jorrit Wronski
63c6c184e5 Solved #1120 with C++11 constructors, moving back to C++98 2016-06-10 12:58:01 +02:00
Jorrit Wronski
94bcee472f introduced backend enumerations, I hope this fixes #1120 reliably 2016-06-10 12:19:18 +02:00
Ian Bell
c16a4b64f5 Fix integer types in #1114 2016-06-08 07:30:28 -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
Ian Bell
8c9b1a5e9b Added Helmholtz energy throughout the API as output parameter; closes #1086 2016-06-05 15:56:37 -06:00
Ian Bell
154de451fe Fix set_reference_stateD(); closes #1091
Now all inputs are molar, and the function actually works!
2016-06-05 15:16:02 -06:00
JonWel
a5c7886e47 Export first_partial_deriv to DLL wrapper of AbstractState, see #946 (#1062) 2016-05-11 07:10:51 -06:00
Ian Bell
4dd6a9860e Add rho*sr scaling methodology for viscosity from Bell paper in Purdue conference
closes #816
closes #665
2016-05-10 21:32:20 -06:00
Ian Bell
5fcb5dd2a9 Add apply_simple_mixing_rule to AbstractState; fix bug with SatL and SatV and setting interaction parameters
closes #1048
closes #1049
2016-05-07 19:51:25 -06:00
Ian Bell
3c24e94a28 Copy PlatformDetermination.h into the top of CoolPropLib.h; see #946 2016-05-06 18:21:01 -06:00
Jorrit Wronski
7a8eb7c21e Guard against multiple definitions of "_CRT_SECURE_NO_WARNINGS" macro on Windows 2016-04-21 15:33:38 +02:00
Ian Bell
cd996fb1ff Make the gas constant an adjustable parameter and update to CODATA 2014 value 2016-04-07 20:14:39 -06:00
Ian Bell
616d775aa9 Typo in TPD fix; see #1019 2016-04-07 20:09:19 -06:00
Ian Bell
3f50ba07ee Fix docs for tangent_plane_distance; closes #1019 2016-04-07 20:03:58 -06:00
Ian Bell
130c6ed456 Add ability to use GERG in REFPROP; closes #923 2016-04-04 20:06:01 -06:00