4331 Commits

Author SHA1 Message Date
Ian Bell
c40e9f5fdc Bump REFPROP-headers 2016-08-27 23:51:34 -06:00
Ian Bell
4a2067bef2 Bump REFPROP-headers; see #1065 2016-08-27 23:41:37 -06:00
Ian Bell
d88752a82c Avoid UNIFAQ calls if set_mole_fractions gets the same input again 2016-08-27 22:44:05 -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
4e9b9b301f Also add components in backward order for UNIFAQ 2016-08-27 21:50:49 -06:00
Ian Bell
2ee26aef5d Add tests for Poling example with UNIFAQ code; closes #1213 2016-08-27 20:58:18 -06:00
JonWel
c813eb1ace Refactor exceptions in CoolPropLib.cpp close #1200 (#1214)
There are also some exceptions that do not use this new `HandleException` function yet as they don't use the errcode and message buffer (they just set the error string):
```C++
catch (std::exception &e){ CoolProp::set_error_string(e.what()); }
    catch (...){ CoolProp::set_error_string("Undefined error"); }
```

Some functions like `AbstractState_update_and_common_out` do not have the `CoolPropBaseError` in the previous code. This will be also tested now, but should not be a problem (the `HandleError` is triggered first).
2016-08-27 19:25:26 -06:00
JonWel
e4c80c4b55 Use aii_term and b0_ii from cubic (#1211)
Making use of their feature (aii_term has tau derivative), and only do numeric derivatives for the gE_R term.
2016-08-26 22:34:48 -06:00
Ian Bell
7807f24ab7 Get all psi=rho*a derivatives working and 100% tested
Magical, but all good now it seems
2016-08-26 22:32:32 -06:00
Ian Bell
8c62840a36 Add alpha function to mixture derivatives and a few derivatives 2016-08-26 21:28:30 -06:00
JonWel
c75947a6c6 Add tau derivatives to components derivatives (#1209) 2016-08-26 08:31:40 -06:00
Ian Bell
952ec9486e Added additional derivatives of alpha0 (xi,tau; xi,delta; xi,xj) 2016-08-25 23:23:26 -06:00
JonWel
36787f9d8e Correct derivatives of am and test for VTPR (#1208)
* Correct test derivative

* Correct mistake in am derivative
2016-08-25 21:33:40 -06:00
Ian Bell
5c1850b66b Fix stdcall 32-bit windows DLL 2016-08-24 23:05:39 -06:00
Ian Bell
d0ee80af5f Update MixtureDerivatives.cpp for VTPR; closes #1201 2016-08-24 22:53:45 -06:00
Ian Bell
cea38434fc Fix get_mass_fractions() with SRK and PR; closes #1206 2016-08-24 22:27:25 -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
98c6a47034 Remove some unused variables 2016-08-23 21:36:42 -06:00
Ian Bell
e311d3da38 Make all functions in reducing function const; closes #1204 2016-08-23 21:33:05 -06:00
Ian Bell
2aee1afa99 Don't package Example.[cs/java] files; see #1190 2016-08-23 21:24:58 -06:00
Ian Bell
05947657b1 Add (passing) tests for stability code, tests for critical point calcs for paper 2016-08-23 20:57:43 -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
bf3a674363 Better warning for alpha0 model being missing; closes #1198 2016-08-23 20:06:06 -06:00
Ian Bell
779ef0e8c3 First tests for derivatives of am for VTPR
@JonWel, looks like there is some more debugging to be done here :(
2016-08-23 20:01:49 -06:00
Ian Bell
e21a27d5df Update PHP docs; closes #1174 2016-08-23 19:46:38 -06:00
Ian Bell
1552d14453 Do mixture derivative tests on PR and SRK; see #1201 2016-08-23 19:44:55 -06:00
Ian Bell
5a920022c5 Fix dalpha0_dxi; closes #1199 2016-08-23 19:28:59 -06:00
Ian Bell
5273f21f8b Fix QT_INPUTS (don't calc chemical potential); closes #1197 2016-08-23 19:24:00 -06:00
Ian Bell
1f3e698966 Allow VTPR to pass only names by setting default R_u value; closes #1203 2016-08-23 19:22:00 -06:00
Ian Bell
36d749007b Better error message when UNIFAQ component cannot be found; closes #1202 2016-08-23 19:19:53 -06:00
JonWel
970796f6a8 Update CoolPropLib.def (#1196) 2016-08-23 08:25:46 -06:00
Ian Bell
de455acf10 Add some logic for mixtures to use "normal" TP solver when phase is imposed (not the global search) 2016-08-22 22:18:49 -06:00
Ian Bell
43ba3b9071 Fixed some bugs in dalpha0_dxi, almost works (problem with R?) 2016-08-22 22:16:47 -06:00
Ian Bell
02afc39782 Add dalpha0_dxi derivative 2016-08-22 21:53:00 -06:00
Ian Bell
d5f22e0152 Some updates to PT flash in the liquid region and stationary point searching 2016-08-22 20:57:08 -06:00
Ian Bell
ef25595205 Relax "sameness" criteria in stability calcs
Be less conservative about whether a phase is "the same" as the bulk composition in stability calculations
2016-08-22 08:46:26 -06:00
Ian Bell
9cc973c603 A fix to the internal caching; that was tricky to track down 2016-08-21 22:25:12 -06:00
Ian Bell
6d6c96ef0c Repair the non-cached calculations 2016-08-21 18:54:36 -06:00
Ian Bell
ac2ca5c72a Stable if either phase gives bulk composition 2016-08-21 15:01:19 -06:00
Ian Bell
7358a38fd4 Bump up maximum density 2016-08-21 14:48:48 -06:00
Ian Bell
abb1c23753 More checking of parameters in stability evaluation routines; different stability evaluation now.. 2016-08-21 14:44:28 -06:00
Ian Bell
bb15763f60 Copy k_ij matrix in one shot 2016-08-21 13:15:44 -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
d43585bcc0 Add formulas for HFO 2016-08-20 12:59:01 -06:00
Ian Bell
c5c0515a4d Add acentric factor accessor for REFPROP; closes #1193 2016-08-20 12:49:59 -06:00
Ian Bell
a0997ab875 Fix setting of parameters for linked states; closes #1191 2016-08-20 12:44:49 -06:00
Ian Bell
2024c37916 Bump revisions of IF97 and REFPROP-headers 2016-08-17 00:54:13 -06:00
Ian Bell
4e5a97aeac Removed nested enumeration warnings 2016-08-17 00:43:04 -06:00