Commit Graph

99 Commits

Author SHA1 Message Date
Ian Bell
5e74610d0e Fix unexplained crashes with setting of reference state; See #524 2015-03-05 21:47:36 -07:00
Ian Bell
6b6f2dbb29 Removed pEOS and replaced it with EOS() function - reference state works properly; Closes #524 2015-03-05 20:59:46 -07:00
Ian Bell
7a9f98d187 Fix temperature used for ASHRAE reference state
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2015-03-05 18:14:25 -07:00
Ian Bell
d9e16a77f3 Merge branch 'master' into tabular
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2015-03-02 20:20:51 -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
65543cf26e Merge branch 'master' into tabular 2015-02-27 22:54:28 -07:00
Ian Bell
2e413d3de4 Allow the user to get the HOME directory through get_global_param_string()
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2015-02-27 22:16:45 -07:00
Ian Bell
52a123437c Merge branch 'master' into tabular 2015-02-26 10:02:31 -07:00
mikekaganski
869d1afc71 More ref args 2015-02-27 00:56:38 +10:00
Ian Bell
a43693de58 Single-phase HmolarP_INPUTS are working with TTSE 2015-02-22 21:08:32 -07:00
mikekaganski
2bcfdf824c Simplify exception handling 2015-02-22 15:10:08 +10:00
mikekaganski
0e3a9fe9af Fix static analyzer warnings "Local declaration hides local"
C6246 Local declaration hides local Local declaration of 'z' hides
declaration of the same name in outer scope. For additional information,
see previous declaration at line '187' of
'd:\documents\github\coolprop\src\coolprop.cpp'. CoolProp coolprop.cpp
230
C6246 Local declaration hides local Local declaration of 'fluid' hides
declaration of the same name in outer scope. For additional information,
see previous declaration at line '852' of
'd:\documents\github\coolprop\src\coolprop.cpp'. CoolProp coolprop.cpp
871
C6246 Local declaration hides local Local declaration of 'options' hides
declaration of the same name in outer scope. For additional information,
see previous declaration at line '743' of
'd:\documents\github\coolprop\src\backends\helmholtz\flashroutines.cpp'.
CoolProp flashroutines.cpp 778
C6246 Local declaration hides local Local declaration of 'h1' hides
declaration of the same name in outer scope. For additional information,
see previous declaration at line '1338' of
'd:\documents\github\coolprop\src\backends\helmholtz\flashroutines.cpp'.
CoolProp flashroutines.cpp 1367
C6246 Local declaration hides local Local declaration of 'el' hides
declaration of the same name in outer scope. For additional information,
see previous declaration at line '250' of
'd:\documents\github\coolprop\src\helmholtz.cpp'. CoolProp helmholtz.cpp
259
C6246 Local declaration hides local Local declaration of 'y' hides
declaration of the same name in outer scope. For additional information,
see previous declaration at line '1649' of
'd:\documents\github\coolprop\src\backends\helmholtz\helmholtzeosmixturebackend.cpp'.
CoolProp helmholtzeosmixturebackend.cpp 1756
C6246 Local declaration hides local Local declaration of 'iclosest'
hides declaration of the same name in outer scope. For additional
information, see previous declaration at line '415' of
'd:\documents\github\coolprop\src\backends\helmholtz\phaseenveloperoutines.cpp'.
CoolProp phaseenveloperoutines.cpp 467
C6246 Local declaration hides local Local declaration of 'crit' hides
declaration of the same name in outer scope. For additional information,
see previous declaration at line '181' of
'd:\documents\github\coolprop\src\backends\helmholtz\vleroutines.cpp'.
CoolProp vleroutines.cpp 284
C6246 Local declaration hides local Local declaration of 'crit' hides
declaration of the same name in outer scope. For additional information,
see previous declaration at line '925' of
'd:\documents\github\coolprop\src\backends\helmholtz\vleroutines.cpp'.
CoolProp vleroutines.cpp 950
2015-02-22 14:43:57 +10:00
mikekaganski
b576789870 More compact and performant way to avoid NULL in fractions_ptr
I suppose it is preferrable because:
1. It stops as soon as the problem is apparent;
2. It avoids extra checks (tiny speed-up)
3. It is more compact.
2015-02-22 13:50:06 +10:00
Ian Bell
aef97f9755 Lots of little changes to squelch warnings
Closes #484
Closes #483

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2015-02-21 14:39:25 -07:00
Ian Bell
6d2f52f230 Squashed bugs found by @mikekaganski; See #483
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2015-02-21 11:26:24 -07:00
Ian Bell
40a499b3cf Add check for invalid input pair caused by Props1SI
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2015-02-02 21:12:26 -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
f5739e3354 Fixed bug with 3 character long fluid names
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2015-01-28 19:34:04 -07:00
Ian Bell
575643938c Fix predefined mixtures in REFPROP; Closes #437
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2015-01-28 18:52:18 -07:00
Ian Bell
082f365416 If all outputs are trivial, never do a state update in internal routines; closes #395
Added Catch test for this configuration

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2015-01-07 13:28:21 -07:00
Ian Bell
2ea0bb020d Merge branch 'master' of https://github.com/coolprop/coolprop
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2015-01-07 13:09:33 -07:00
Ian Bell
fe48c7e403 Fixed bugs with bad departure function names and better error message; Closes #396
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2015-01-07 13:05:39 -07:00
Jorrit Wronski
5ff28fc302 Clears the cached transport properties and fixes #394 2015-01-07 12:16:00 +01:00
Ian Bell
ea3686abdb Changes to CoolProp.cpp were missed in prior commit
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-12-31 20:32:22 -05:00
Ian Bell
281704e5eb If one input and one output to PropsSI, bubble error cleanly; closes #375 2014-12-31 13:14:25 -05:00
Ian Bell
413078cf00 Throw an error if no successful outputs from _PropsSI_outputs
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-12-30 22:11:34 -05:00
Ian Bell
b99d868f36 Repaired failing incompressible tests - string parsing had to be repaired
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-12-30 21:42:57 -05:00
Ian Bell
f5de4d363f Fixed initialization to remove copy and remove allocation error
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-12-30 20:38:49 -05:00
Ian Bell
f8576b1d49 PropsSImulti is integrated into Python wrapper; extract_fractions is exported
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-12-30 20:08:35 -05:00
Ian Bell
04af215f52 Fix fraction formatting in PropsSI error message
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-12-30 17:20:29 -05:00
Ian Bell
f4a960abdc Undefine min and max macros. Thanks for nothing MS
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-12-30 17:05:12 -05:00
Ian Bell
6b601adb10 PropsSImulti takes vector of strings as inputs
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-12-30 16:07:19 -05:00
Ian Bell
2285e3b8c9 Removed some more functions
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-12-26 22:23:01 -05:00
Ian Bell
c9ad1f7e59 Removed unneeded overloads of PropsSI function, leaving only PropsSI and PropsSImulti
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-12-26 01:45:03 -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
0cb02a3e2f Predefined mixtures working in PropsSI now
Added Catch test

``` python
In [1]: import CoolProp

In [2]: CoolProp.CoolProp.PropsSI('D','P',101325,'T',300,'Air.mix')
Out[2]: 1.1766975266680577
```

Closes https://github.com/CoolProp/CoolProp/issues/287

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-12-05 11:24:29 -05:00
Ian Bell
32ccb78250 Disable internal error catching and allow swig to do the error catching itself
See https://github.com/CoolProp/CoolProp/issues/282

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-12-04 17:00:54 -05:00
Ian Bell
8e6b5a7f2b Change the logic of DEF and RESET for set_reference_stateS; RESET removes entirely all the offset terms
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-11-29 22:18:01 -05:00
Ian Bell
93e5275100 Fixed bug with derivative not being handled properly to _PropsSI
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-11-28 22:57:58 -05:00
Ian Bell
fab9811c5c Can get long name from the incompressible fluid
Something like

rr = get_fluid_param_string("INCOMP::MEG","long_name");

Closes https://github.com/CoolProp/CoolProp/issues/244

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-11-26 16:41:00 -05:00
Ian Bell
a12b944a22 Melting line bibtex can be obtained again
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-11-24 14:40:59 -05:00
Ian Bell
ec06d7c2cc clean up CoolProp.cpp
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-11-24 13:20:28 -05:00
Ian Bell
41fc9b1144 saturation ancillaries are now exposed through the high-level API
Closes https://github.com/CoolProp/CoolProp/issues/225

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-11-24 13:06:37 -05:00
Ian Bell
71a5944f51 Added tests for global and fluid params
Closes https://github.com/CoolProp/CoolProp/issues/239

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-11-24 12:28:29 -05:00
Ian Bell
7963560858 Throw an error if input sizes are not the same for PropsSI
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-11-24 00:27:34 -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
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
5c3d31d011 Add function to check if fluid name is valid
Closes https://github.com/CoolProp/CoolProp/issues/204

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
2014-11-20 13:31:47 -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