Commit Graph

47 Commits

Author SHA1 Message Date
Erik Postma
678db27dc6 Typos in parameter descriptions. 2015-04-22 13:47:52 -04: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
212182d95a Primitive structures simplification attempt 2 2015-03-01 16:39:29 +10:00
Ian Bell
11af811d45 Reverted some C++11 only code
@mikekaganski, if you could please try to compile with C++03, that would make my life a lot easier
2015-02-28 20:26:44 -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
Ian Bell
81db79758b Updated units for T_freeze
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2015-02-17 19:09:50 -05: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
6cc81601ac Fix tests for parameters
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-12-30 22:11:58 -05:00
Ian Bell
f3fe64b486 Make the datastructures test pass
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-12-30 18:55:26 -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
707ee4799a Brought back surface tension support
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-12-04 11:43:44 -05:00
Ian Bell
ca4c5b8706 Tidy docs for phase parameter
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-12-02 22:39:53 -05:00
Ian Bell
7a7a63f50a Gibbs is output only
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-12-02 22:17:04 -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
cb74fb9c25 phases tests call the correct function
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-11-24 20:31:49 -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
88472b861a Add molarmass backwards compatibility alias
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-11-20 18:59:20 -05:00
Ian Bell
be78b4b22f Fixed missing trivial parameters to Props1SI
Closes https://github.com/CoolProp/CoolProp/issues/223

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-11-20 14:19:48 -05:00
Ian Bell
9d6b5a1687 Add get_phase_index function back
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-11-19 13:21:47 -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
5ffe346327 Added info for some other input pairs
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-11-07 16:37:46 -05:00
Ian Bell
407d41d2fd Modified get_param_index to allow access to phase keys
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-10-29 15:38:09 -04:00
Ian Bell
da23717368 Fix problem with pmin
Closes https://github.com/CoolProp/CoolProp/issues/189

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-10-25 09:35:42 -04: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
3bc62f50a6 Added "A" backwards compatibility alias for speed of sound
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-09-18 19:32:39 +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
b066113a5f Add back the 'M' alias for molar mass
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-08-22 10:20:10 +02:00
Ian Bell
43fd0684ff Added uppercase aliases for all parameters to help with https://github.com/CoolProp/CoolProp/issues/103
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-08-20 16:48:14 +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
10b9060863 Fixed failing Catch errors due to humid air properties
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-08-15 20:28:15 +02:00
Ian Bell
21f18bf104 Added aliases for molemass and p_triple
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-08-12 21:16:11 +02:00
Ian Bell
e4c8d3f061 Python wrapper is more or less back in action completely. Additional testing is required.
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-08-12 16:25:33 +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
1fde42f562 Added missing parameters to DataStructures.cpp
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-07-07 21:02:13 +02:00
Ian Bell
a75dbefd7b Fixed bug with get_csv_parameter_list
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-07-07 20:25:16 +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
9093f636b1 speed of sound added back to high level wrapper
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-06-06 21:21:12 +02:00
Ian Bell
e98f3b6945 "V" and "L" are again supported in PropsSI as input
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-05-24 19:12:04 +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