Commit Graph

44 Commits

Author SHA1 Message Date
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
Ian Bell
61bc24e7b1 phases is now an enum, added (non-working) critical region VLE solver
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-08-15 17:13:00 +02:00
Ian Bell
b7bd58d986 More work on flash routines, number of failures is rapidly decreasing - still have problems for low pressure sat_p calcs
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-08-12 11:21:12 +02:00
Ian Bell
c3cc696080 P,Y now works if P > pc
Add supercritical_gas and supercritical_liquid phase flags for a bit finer granularity

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-08-09 15:10:09 +02:00
Ian Bell
2c844597c9 Calculate pressure and temperature limits for HEOS and REPFPROP backends
Closes https://github.com/CoolProp/CoolProp/issues/83

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-08-06 10:23:10 +02:00
Ian Bell
138135f5b7 Added Tmin and Tmax
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-08-04 18:58:13 +02:00
Ian Bell
79d7a4965a Added triple point temperature
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-08-03 23:58:16 +02:00
Ian Bell
17458261b5 Modifications to saturation routines (work great now)
Including:
adding critical pressure parameter
Adding relaxation parameter for NR sat_T
Only evaluate correction step if not near critical temp
Fixed bug with fluids like "n-Propane" that was getting interpreted as an incompressible fluid

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-08-03 23:36:22 +02:00
Ian Bell
a2f45e29da Added functionality for trivial outputs
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-08-03 18:55:52 +02:00
Ian Bell
d9fcb2eb00 Merge branch 'master' of https://github.com/coolprop/coolprop 2014-08-01 16:38:47 +02:00
jowr
165298d41e Renamed the enumeration and still no luck 2014-08-01 15:44:02 +02:00
jowr
eddeee54e0 Added more fitting stuff, still some problems with the enumerations in C++ 2014-08-01 15:15:35 +02:00
Ian Bell
195bf6bb97 SimpleState values init to _HUGE
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-08-01 10:00:23 +02:00
jowr
6360e84a54 Added some new functions to handle volume fractions, hope this does not cause any trouble other places 2014-07-22 17:29:01 +02:00
Ian Bell
67d85f72e1 Added csv parameter listing to get_global_parameter
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-07-07 20:08:51 +02:00
Ian bell
b3847c7522 Initial commit for v5, but this time with the right line endings
Signed-off-by: Ian bell <ian.h.bell@gmail.com>
2014-05-14 12:46:24 +02:00