65 Commits

Author SHA1 Message Date
Ian Bell
3cab04a678 format_as should be inline, not static 2023-08-28 20:54:05 -04:00
Pierre Wendling
d248c75a43 Update fmt submodule to 10.0.0 (#2252)
* Update fmt submodule to 10.0.0.

* Update format wrapper, add format_as overloads.

- Every enum that is formatted needs to define a format_as overload in
the same namespace.
- Add a wrapper for sprintf for fmt versions without ArgList.
2023-05-13 07:14:01 -04:00
Zach Baird
e52c26c8e8 improve PC-SAFT flash (#2161)
* improve PC-SAFT flash

* fix error in PC-SAFT JSON file

* change C type to string
2022-08-27 18:59:31 -04:00
Julien Marrec
05c8cf503b Lint: use automated tooling to reformat C++ and CMakeLists files (#2103)
* Add initial clang tidy / clang format config files

* Clang format the entire codebase

```
find ./src -regextype posix-extended -regex '.*\.(cpp|hpp|c|h|cxx|hxx)$' | xargs clang-format-12 -style=file -i -fallback-style=none
find ./include -regextype posix-extended -regex '.*\.(cpp|hpp|c|h|cxx|hxx)$' | xargs clang-format-12 -style=file -i -fallback-style=none
find ./Web -regextype posix-extended -regex '.*\.(cpp|hpp|c|h|cxx|hxx)$' | xargs clang-format-12 -style=file -i -fallback-style=none
find ./dev -regextype posix-extended -regex '.*\.(cpp|hpp|c|h|cxx|hxx)$' | xargs clang-format-12 -style=file -i -fallback-style=none
find ./wrappers -regextype posix-extended -regex '.*\.(cpp|hpp|c|h|cxx|hxx)$' | xargs clang-format-12 -style=file -i -fallback-style=none
```

* Add a .cmake-format file and reformat CmakeLists.txt with it

https://github.com/cheshirekow/cmake_format

* Add a clang-format workflow


only runs on PRs, only on touched files
2022-03-31 10:51:48 -04:00
Ian Bell
77f3bdec7a Fix PHI0 delta derivatives for REFPROP backend. Closes #2073 2022-01-08 18:29:20 -05:00
Zach Baird
feec37f2d8 Fix pcsaft flash (#1913)
* fixing PC-SAFT flashes

* minor fixes from review

* corrections requested in review
2020-04-09 12:14:15 -04:00
Zach Baird
8108b4b80b Adding PC-SAFT EOS (#1877)
* initial commit

* got pressure unit tests working

* Added density solver and tests

* Added enthalpy function

* Added unit tests for S and G

* partial addition of flash

* PCSAFT backend implemented

* added missing semicolon

* added missing semicolon
2019-12-12 20:49:22 -07:00
Jorrit Wronski
75c32a5153 Added isentropic expansion coefficient (#1791) 2019-01-15 10:09:06 -07:00
Ian Bell
502bf0b506 Reduce the number of includes from DataStructures.h 2019-01-10 20:45:44 -07:00
Jeff Henning
abcd91a9a7 Update PropsSI() to Parse Imposed Phase Strings on Input Keys (#1660)
* PropsSI enhancement to allow imposed phase on Input key string

* Update PropsSI documentation for imposing phase [skip ci]
2018-03-07 21:51:41 -07: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
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
8c9b1a5e9b Added Helmholtz energy throughout the API as output parameter; closes #1086 2016-06-05 15:56:37 -06:00
Ian Bell
4542f9d093 Merge into release (#1057)
* Bump revision on msgpack-c

* Remove warnings when using Julia 0.4 realease

Some change in Julia 0.4 have occurred since the last update of this wrapper.
This update should now ensure better behaviour with Julia 0.4 which is now in release state.
https://raw.githubusercontent.com/JuliaLang/julia/0ff703b40afddf9b705bd6a06d3a59cb4c089ea5/NEWS.md

* Added PT flash for cubic EOS

* Added PQ and QT inputs for pure fluids with cubic backend

* Added derivation for relationship between saturation pressure and acentric factor

* Fixed T_critical and p_critical for pure fluids with cubic backends

* Bump revision for msgpack-c; everything should work now

* Correct get_parameter_information_string, fixes #974

Put the catch in a more useful way and solves the call to CoolProp::get_parameter_information.

* Relax convergence criterion for TS inputs; closes #956

* Update the updating of the TPD state class

* Fix initial delta value in critical point search routine

* Make CMake+Python integration work on OSX (finally)

* Fix some bugs with cubics and critical point evaluation

* Added conda builds again to please #905 and #956

* Added conda to the release cycle with directory cleaning. Should solve the problems discussed in #956, #905 and #707, but we have to wait for the next nightly build to see if it really works. Remember that the upload token on the server expires in June and uploads will fail silently.

* Added cppformat as external library, see #952 and #907. Does https://github.com/CoolProp/CoolProp/blob/master/dev/codelite/coolprop.project need updating?

* Add ability to get/set kij for cubics by overloading set/set_binary_interaction_double

* Pull in the correct include path for linking with other applications (PDSim, etc.)

* Don't package _JSON.h binary files when distributing CoolProp

* Fixed the docker docs

* Moved the binstar upload into a loop, if a single upload fails, we continue with the next one as mentioned in #905

* Update critical point evaluation routines and remove some double-calculations of critical matrices

* Move search radii into the cpp file

* Bump revision for Eigen to fix annoying warnings in MSVC9 2008

* Added info about Props1SI and other options to docs; closes #970

* Bump number of fluids

* Update CoolProp.jl

Other update due to `Julia 0.4` changes
+ added `CoolProp` functions

* Just a minor fix of the docker docs

* Also add the msgpack headers to CoolProp installation - more annoying than you would imagine...

* Break up tools headers into pieces that make more sense, allowing for potentially smaller binaries and faster compilation

* Fix some header issues

* Update DBL_EPSILON

* Fix _HUGE and accumulate errors

* Add missing fstream include

* One more try with header refactor

* Add header to get thread_local for ftw

* Added the cahced saturation densities to the keyed outputs for REFPROP and Helmholtz, see #977

* Add 'G' as alias for mass-based Gibbs energy

* Eliminated some more warnings regarding missing return values

* Fixed the white-space issues in the header files

* Add IWYU integration to main module; see #983

* Fix order of getting/setting parameters

* Fix order of parameter getting/setting for real this time

* For REFPROP, get/set BIP for mixture with indices

* Fix some edge cases in critical point calculation

* Switch back to the PDF generator for the fitting reports

* Massive improvements to stability of flash routines.  Nitrogen now has 0 failures.

* Added Syltherm800 for @adesideri

* Fixes #990 Javascript works again.

* Clarified the docs for #990

* Fix R123ze(E) reference; closes #992

* Some help with #986

* Added the generated cubic header to the ignore files

* Add example showing how to get REFPROP version

* Added two headers that might help with #995

* More sensible error message when using inappropriate version of REFPROP for phase envelope construction

* Add comment about MinGW generator for Android build

* Add example for calling DLL from C; closes #993

* Maybe this fixes multiple papers in the same category from #987

* Introducing limits for build logs to save disk space

* Clean up Android docs

* Kill min and max macros to close #995

* Bump REFPROP header file revision

* Small updates to docs

closes #996
closes #997

* Significant improvements to phase envelope construction

Thanks to the critical point evaluation routines

* Also add the configuration key

* Refactor phase envelope packaging with msgpack to remove external msgpack-c include

Also, don't package msgpack or rapidjson with CoolProp.  Doesn't seem necessary now

* Refine the phase envelopes in the liquid side based on difference in pressure

Closes #998

* Allow ability to adjust the fineness of the refinement of the phase envelope from the high-level

* Improvement in stability of refinement of phase envelopes

* Cubics library should use all uppercase names for matching

* Got QT inputs working for cubic mixtures

Also implemented the explicit solution for p from Wilson

* Progress with PQ inputs for cubics; some bugs remain still

* Still not obvious why SRK PQ fails.... Updated tests for derivatives of fugacity_coefficient

* Mostly a false alarm.  Seems PQ works ok, not at very low pressure though

* Implement 95% of the BIP setting/getting

See #1000

* Fix journal abbreviations; closes #999

* Update mixtures setting/getting BIP docs

* Where possible, remove include paths

Can't do so for Eigen.

closes #994

* Fix include for msgpack-c; see #994

* Fix path for IF97 in HumidAirProp.cpp

* Move error string into solver class; see #985

* Add docs for explicit solution for p from T for Wilson K-factor relationship

* Fix include paths for OSX; see #994

* First attempt at adding python 3.5 wheels; see #1002

* Upgrade cython as part of python build

* Fix typo in coolprop cp 3.5 build in buildbot

* Install cython into the appropriate environment this time

* Fix order of initialization for solver wrapper class

* Wrap all configuration variables into enumerations and a python module

* Added docs for new config strings

* Upgrade cython for sphinx builder

* Fix configuration sample in docs

* Fix constant in Chung method for estimation of e/k and sigma

* Added the Python 3.5 docs for #1002

* Added Python 3.5 to the Linux slaves, this won't work until CoolProp/Dockerfiles#1 is resolved

* Removed unused variables

* Better deal with inputs for tabular backends that are two-phase

* Fix stupid bug with tabular backends trying to evaluate pure_saturation tables when two-phase in first_partial_deriv

* Rename cubics schema file

* Cubics now are validated and new cubic fluids can be added

Lots of changes:
* Cubics are validated against schema
* Schema can be returned as string
* Added preliminary docs for cubics
* Cubic fluids can be added programmatically

* Add cair_sat to DLL/SO; closes #1005

* Add link to cubics page to main dos page

* Actually commit the docs for the cubic EOS this time.

* Fix Android docs formatting

* Add Ar alias for Argon; closes #1007

* Once more addressing #979 thanks to @shrx .

* I am constantly running out of disk space on the Windows machine.

* Add chemical potential as abstract state method

For example:

```
auto fluids = strsplit("Methane&Ethane", '&');
auto x = { 0.6,0.4 };

shared_ptr<CoolProp::AbstractState> RP(CoolProp::AbstractState::factory("HEOS", fluids));
RP->set_mole_fractions(x);
RP->update(PT_INPUTS, 101325, 300);
auto mu1 = RP->chemical_potential(0);

RP.reset(CoolProp::AbstractState::factory("REFPROP", fluids));
RP->set_mole_fractions(x);
RP->update(PT_INPUTS, 101325, 300);
auto mu2 = RP->chemical_potential(0);
```

* Abbreviate JCT properly

* Removed the cython upgrades to get more errors from the builders

* Update references; closes #1011

* Give access to dalphar_ddelta_consttau and dalphar_ddtau_constdelta in high-level api; closes #1010

* Implement stability analysis based on TPD analysis; partly working

* The Windows builder has been upgraded to 4 cores

* Typo in master.cfg

* It is more difficult than I though to have parallel builds

* Add ability to use GERG in REFPROP; closes #923

* Give access to alphar in high-level API; closes #1012

* Add a few more spaces

* And remove the condition on the additional spaces

* Allow beta to be outside (0,1) in stability analysis in first SS part

* Add REFPROP version output to the examples

* Fix typo in use of GERG in docs

* Secant behaves properly now when y1 approx. y2; closes #1015

* target_link_libraries

* clear molar mass in clear function; closes #1021

* Fix docs for tangent_plane_distance; closes #1019

* Typo in TPD fix; see #1019

* Make the gas constant an adjustable parameter and update to CODATA 2014 value

* Skip volume translation for cubics; closes #1018

* Fix typo in R_u update

* Fix copying of kij in cubic backend get_copy function

* Disable some optional checks in specialized low-level update functions

* Finish stability calculations for critical point calculations!

* Remove check of eigenvalues of L* matrix to determine stability (or not)

* Add access to h_Ice, s_Ice, etc. through HAProps_Aux; closes #1017

* Add script to do mingw static library building for python; closes #1016

* Use cmake to build sphinx docs on OSX

* Pad fluid string all the way to 10k characters

* Run R example with Rscript rather than R

* Fix call to Rscript

* Add Rscript to CMake test as well

* Update the Rscript calling stuff

* Fix Rscript calling in example_generator.py

* Fix typo in debugging printing for stability calcs

* Add some info to the Help section

* Describe how to make coolprop static library a clean cmake dependency; closes #1014

* Fix typo in CMake integration

* Fix call to Rscript in CMakeLists.txt?

* Another try with Rscript

* Yet another try with R

* Add new OSX slave for OSX 10.10+

* Try to fix the install path for OSX

* python static library builds should be release builds

* Another try with MATLAB on OSX 10.10

* Another attempt with MATLAB path

* Allow MATLAB tests to be disabled

* Add link to binaries for MATLAB for OSX 10.10; see #1013

* Add coefficients from JCED paper; closes #854

* Fix interaction parameters for new mixtures

* Fix docs for new BIP from JCED paper

* Fix REFPROP version for older version of REFPROP.

* Add updated docs for cubics (WIP)

* Small modifications to finish (?) critical point calculations

* Small bug fixes

* Guard against multiple definitions of "_CRT_SECURE_NO_WARNINGS" macro on Windows

* More macro definitions

* Refactor HMX.BNC path handling for REFPROP

Closes #1028
See #1023

* Add pass-throughs for testing derivatives; closes #1030

* Fix(?) issues with loading multiple predefined mixtures in REFPROP; see #1023

* Fix failures for PQ at triple-point pressure; closes #1009

* Switch python 3.5 windows builds to use vc14 cmake compiler; see #1002

* Remove static library linkage when building pythonn 3.5 wheels; see #1002

* Updates to docs for cubics and VLE tolerances

closes #1024
closes #1025

* Fixes STRING conflict between Mathcad library and cppformat

The Mathcad library header, mcadincl.h, defines a STRING constant.  This
should be MC_STRING, as STRING is too dangerous and conflicts with
STRING enumeration value in format.h from external/cppformat.

* Move a lot of mixture derivatives to the new formulation; see #1032

* First attempt at fixing logo size in cloud theme. See #1029

* Another try at resizing logo for firefox; see #1029

* a quick fix that might work with #1029

* forgot the match the aspect ratio, see #1029

* Disabled the conda builds again, closes #1033

* Removed scipy references or changed them to be imported locally, fixes #1036

* Circumvent Cython issues from #1039, not sure this is a fix

* Changed the string handling to tackle #979

* manylinux builds for 64-bit linux wheels are up-and-running

Run the ./build_images.sh script, builds docker image, and uses docker image to build the linux wheels

* Small logo instead of big one; see #1029

* Fixed #1040 thanks to the comments by @LORENZOTOCCI

* Pushing the new viscosities to the JSON files, getting ready for an intermediate nightly release

* Removed the conda builds from the docs, they are abandoned for now

* Make the logo smaller

* Disable the python linux builds in preparation of changeover to manylinux1 builds

* More changes for manylinux

* manylinux wheels fully working now

* Copy cppformat to the appropriate location

* Fix typo in OSX build flags

* Fixed Minor MSVC Compiler Warnings (#1041)

* Fixed Minor Warnings from MSVC

Minor type mis-matches, etc.

* Replace int(...) with static_cast<int>(...)

* First attempt at #1044

* Fix PT inputs along critical isobar and critical isotherm; closes #1034

* Add REFPROP version to REFPROP comparison script; closes #1026

* Added a number of new predefined mixtures; see #719

* Tidy up sphinx docs; closes #1029

* Moved more mixture derivatives tests to use new format; see #1032

* Fixed typo in fugacity wrapper function; see #1032

* Add acentric factor for Air; closes #1001

* Fixed units in RP1485 validation tables

* Disable image resizing

Could be done by setting DPI in savefig

* Copy PlatformDetermination.h into the top of CoolPropLib.h; see #946

* Try to resize the font a little bit in the sphinx output

* Mathcad Wrapper Updates for CoolProp 5.x and 6 (#1047)


Minor type mis-matches, etc.



* Update CMakeLists.txt for both Mathcad Prime and Mathad 15

Copied original MATHCAD module and modified for a PRIME module and a
MATHCAD15 module.

* Updated Mathcad Wrapper for version 5 & 6

Changes to CoolPropMathad.cpp:
* Uses PropsSI(), Props1SI(), and HAPropsSI()
* One source for both Prime and Mathcad 15
* Replaced Mathcad error #defines with enumerated values
* Replaced STRING const with MC_STRING enum
* Uses LP* and LPC* types from MCADINCL.h instead of * const
* Implemented get_global_param_string & get_fluid_param_string
* Cleaned up comments
GENERAL:
* Removed batch files (they don't work anymore)
* Updated README.rst in both directories with compile instruct.
* Removed cpp file from Prime directory (no longer needed)
* Removed MCADINCL headers (better to use from install directory)

* Fixed Typo on Props1SI function name

* Add function documentation XML file for Mathcad 15

Puts the functions in the Insert Function panel off the main menu of
Mathcad

* Modify Mathcad 15 README.rst

* Update Prime README.rst

* Update Prime README.rst (again)

* Fixed CmakeLists path and updated README files.

More robust CMake file and updated README info for clarity.

* Fixed RST syntax in README

* Update install commands for cmake, update doc index

* Commit the RST files for MathCAD15 and Prime

* Add MathCAD builders to buildbot

* Finished conversion of derivatives to new formulation; closes #1032

* Fix MathCAD build?

* Fix REFPROP comparison string

* Another try at MathCAD buildbot

* Add apply_simple_mixing_rule to AbstractState; fix bug with SatL and SatV and setting interaction parameters

closes #1048
closes #1049

* One more go for MathCAD+buildbot

* Touch the time-stamped file for expensive builds only after success

* Yet another try with MathCAD

* Align Tmax with REFPROP values (#1053)

* Remove non-operative gitignore rule.

This rule matches the /dev/fluids folder and all its
contents, but those were already in the repo, so the
rule is not in effect.

* Align Tmax with REFPROP values. Fixes #257.

I used the list given in #257.
DME, C12, Neon, SF6 values went down.
R11, R123, R152A had two occurences in EOS, I changed both.

* Added "set_reference_state" wrapper for Mathcad and Updated Example Worksheets (#1056)


- Added Mathcad wrapper for set_reference_stateS(), designated
set_reference_state in Mathcad.
- Added to the funcdoc interface (CoolProp_EN.xml)
- Tidy up some formatting in the README files

* Updated Mathcad 15 and Prime Example Sheets + PDFs of Each

@ibell I know we don't like binaries in the rep, but I feel these are
critical.  They are updates to the Mathcad worksheets that were already
there and PDF versions for anyone who doesn't have Mathcad (i.e.
@ibell).  The files are only about 250 KB each or 1MB total.  I don't
expect we'll need to add to them or add more.  We might consider how to
put these out with the DLL binaries as well.  They are the only
documentation on how to use the wrappers correctly.

* Fixed CMakeList.txt confict and modified M15 worksheet from .xmcd to .xmcdz (compressed file type)

* Install the smaller compressed worksheet for MathCAD 15; see #1056

* Add rho*sr scaling methodology for viscosity from Bell paper in Purdue conference

closes #816
closes #665

* Add reference to Purdue paper

* Prep for version 6 release

* Added contributors
2016-05-10 22:20:22 -06:00
Ian Bell
37f75ddc23 Added DQ as input pair; closes #822 2015-10-23 13:36:01 +02:00
Ian Bell
da015ffb68 Add the ability to access all the critical points in C++ and python; closes #807 2015-09-03 22:28:46 -06:00
Ian Bell
eec3e1a0d3 Add a SimpleState fill() function and use it
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2015-08-20 13:30:45 -05:00
Ian Bell
0bd20b8798 Implement access to dipole moment from REFPROP; closes #725 2015-07-26 12:05:08 -06:00
Ian Bell
b6b73192f9 Expose saturation derivatives through PropsSI; closes #712 2015-07-07 22:37:36 -06:00
Ian Bell
ce6d55596f Add PIP as string parameter; closes #659 2015-05-10 16:41:20 -06:00
Ian Bell
15a7d63d54 Updated docs in DataStructures.h 2015-03-27 19:24:23 -06:00
mikekaganski
5bc139847e Fix Coverity CID 38547 2015-03-09 17:37:13 +10:00
Ian Bell
cd3e6323d2 Enable the ability to set mixture binary pair data from python (I think)
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2015-03-05 23:46:22 -07:00
Ian Bell
c063a40183 Implement a wrapper of AbstractState that can be called through the shared library
Closes #508
Closes #497

Sample code:

```
    #include "CoolPropLib.h"

    const long buffer_length = 255;
    char message_buffer[buffer_length];
    long errcode = 0;
    const long N = 2;
    double fractions[N] = {0.5, 0.5};
    long T_param = get_param_index("T");
    long PQ = get_input_pair_index("PQ_INPUTS");

    long handle = AbstractState_factory("HEOS", "Water&Ethanol", &errcode, message_buffer, buffer_length);
    AbstractState_set_fractions(handle, fractions, N, &errcode, message_buffer, buffer_length);
    AbstractState_update(handle, PQ, 101325, 0,  &errcode, message_buffer, buffer_length);
    double Tc = AbstractState_keyed_output(handle, T_param, &errcode, message_buffer, buffer_length);
    AbstractState_free(handle, &errcode, message_buffer, buffer_length);
```
2015-03-01 15:30:31 -07:00
mikekaganski
28691e8e75 const, ref and iterator optimization
1. Another set of arguments optimized:
* args-by-val converted to args-by-ref
* in some cases, reverse has been done, if that is better: if the
object's copy is modified in the func, it's better to avoid extra copy
from arg to local var
2. some const functions marked as such (this is just a beginning)
3. iterators were replaced with const_iterators where applicable
4. catches that catch std::exception& changed to catch (...) - that is
safer; if exception handling is restructured, this will have to be
reconsidered anyway
5. removed some basic structures' constructors; changed them to hold
const char*s to avoid unnecessary string constructions;
6. in some places, moved variable declarations to their definitions, to
avoid calling default constructors and then assigning
7. removed some unnecessary shared_pointers in favor of local objects;
8. in FORTRAN-style functions, added const specifiers to input doubles;
9. fixed a place where values were inserted into a map while iterating
through it
10. fixed is_valid_*_derivative: they could accept incorrect values and
throw when upper index is less than lower
2015-03-01 10:51:01 +10:00
mikekaganski
1068b724c3 CoolPropDbl
Introduce CoolPropDbl to replace long doubles. This may help to overcome
possible portability problems, and test for efficiency and precision.
2015-02-24 13:24:51 +10:00
mikekaganski
f8bb1c0044 Avoid copying parameters 2015-02-24 09:26:11 +10:00
Ian Bell
183868dee2 Implement acentric factor through AbstractState and Props1SI; closes #448
Fix all instances of accentric->acentric in fluid files and codebase.

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2015-02-03 17:37:53 -05:00
Ian Bell
b2018a4abc Do not evaluate flash call if inputs are all in outputs; see #409
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2015-02-02 20:20:43 -05:00
Ian Bell
a40fee3bbe Add PropsSImulti which allows for vectorization of input values and output keys
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-12-26 00:28:21 -05:00
Ian Bell
c2047e4162 Define get_mixture_binary_pair_data as extern in DataStructures.h in order to allow linking CoolProp and PDSim
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-12-24 11:17:14 -05:00
Ian Bell
1310af00bd Allow access to gas constant through PropsSI/Props1SI; Closes #366
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-12-22 15:30:17 -05:00
Ian Bell
febe1b5bb6 Expose p_reducing
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-12-02 12:19:20 -05:00
Ian Bell
cf6f2f0c22 Add T_freeze as an output for incompressibles
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-11-23 20:43:50 -05:00
Ian Bell
383b045bb1 Exposes values for minimum and maximum fractions for incompressibles
Closes https://github.com/CoolProp/CoolProp/issues/233

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-11-23 20:18:39 -05:00
Ian Bell
09bdf671c7 Added generate_update_pair function to python
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-11-19 13:21:08 -05:00
Ian Bell
8327d54ea2 Replaced all tabs with spaces (finally) in C++ files
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-11-19 12:16:14 -05:00
Ian Bell
ff23d85271 HS works now, for most fluids over the entire single-phase part aside for pseudo-pures which have issues
Closes https://github.com/CoolProp/CoolProp/issues/172
Closes https://github.com/CoolProp/CoolProp/issues/121

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-11-11 20:47:16 -05:00
Ian Bell
8032b85605 Implemented new input pairs and other variables in DataStructures.h
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-11-07 16:33:44 -05:00
Ian Bell
1d729db6f0 Updated physical hazard docs
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-10-30 00:23:22 -04:00
Ian Bell
cfcd50bffc Fixed evaluation AT the critical point
Closes https://github.com/CoolProp/CoolProp/issues/178

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-10-16 00:12:46 +02:00
Ian Bell
199ced3f86 Implemented Phase output again
Added PhaseSI function which will return phase for given input - exposed to DLL
PropsSI can also return phase as double if "Phase" is the input

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-10-14 11:21:07 +02:00
Ian Bell
34f318d903 Added Q to SimpleState for use in phase envelope
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-09-12 20:58:18 +02:00
Ian Bell
73c90b4b01 Gas constants are now all set to CODATA 2010 value and terms n_i in residual terms are multiplied by R_u_old/R_u_new
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-09-06 18:09:01 +02:00
Ian Bell
05e29c85ae Added value for ideal gas constant from CODATA 2010 for use with normalization of ideal gas constants with mixtures
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-09-06 18:01:55 +02:00
Ian Bell
799422fe40 Implemented generalized second derivative, seems to work, implemented at PropsSI level too
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-08-24 17:26:46 +02:00
Ian Bell
0dcdf7ef5d Implemented PQ for pseudo-pure to close https://github.com/CoolProp/CoolProp/issues/92
* As a consequence, made update function take CoolProp::input_pairs enum as first input (thanks @jowr for the idea)
* Decoupled the pre_update and post_update functions in order to allow for more creative update functions using guess values, etc.

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-08-20 21:44:13 +02:00
Ian Bell
881a6c4616 Added handling for first partial derivative as a string - added tests - they pass
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-08-19 00:34:26 +02:00
Ian Bell
68d3725ffd Added tests for undefined parameters; documented undocumented parameters
Closes https://github.com/CoolProp/CoolProp/issues/97

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-08-16 12:40:35 +02:00