Commit Graph

662 Commits

Author SHA1 Message Date
Jorrit Wronski
136644d2cd Assume that Linux on PowerPC behaves like any other Linux 2022-12-07 09:21:26 +01:00
Jorrit Wronski
6b111a304c Handle the msgpack endianness 2022-12-07 09:18:08 +01:00
Jorrit Wronski
b20e71b7de Modifying some PPC code to make ppc64le work 2022-12-07 00:08:13 +01:00
msaitta-mpr
15720ab6cc Prevent crashes near critical density due to saturation calc (#2173)
* Add extrapolating secant solver

Sometimes, the backwards ancillary solver fails near the critical
point. This can happen if the ancillary function at its limit
(i.e., critical temperature) does not reach the desired seek value
(e.g., density). Because we are only usually using these to get a
guess value, we can extrapolate them without issue to avoid a crash
near the critical point.

This helps to resolve #2154.

* Stabilize saturation curve solution

Solving for the saturation curve near the critical point can be
unstable. This commit fixes that in a few ways.

1) Prevent the solver from overshooting and prevent a negative
temperature or density.

2) If it does fail, try again with a smaller omega value.

If the solver fails after all of this, we will still throw to allow
something downstream to handle it.

This helps to address issue #2154.

* Move saturation_D_pure max iterations to options
2022-10-28 18:08:13 -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
Friederike Boehm
c4cf52b671 AbstractState functions for CoolPropLib (#2135)
* Add AbstractState functions to CoolPropLib
AbstractState_get_mole_fractions_satState
AbstractState_keyed_output_satState
AbstractState_backend_name
add_fluids_as_JSON

* Overloaded AbstractState_get_phase_envelope_data and appended checkedMemory to function name
2022-06-07 08:26:10 -04:00
Friederike Boehm
44325d9e6a Add Props1SImulti and PropsSImulti to CoolPropLib (#2133)
Props1SImulti new function in CoolProp
2022-05-17 20:13:57 -04:00
Julien Marrec
6913fc41dc Format macros, they keep getting picked incrementally by clang format + Strip trailing whitespaces
```
find . -regextype posix-extended -regex '.*\.(cpp|hpp|c|h|cxx|hxx|py)$' | xargs -I@ sed -i 's/[ \t]*$//' "@"
```
2022-04-01 07:39:35 -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
381c8535e5 Update the Javascript tooling 2022-02-08 01:21:03 -05:00
friederikeboehm
5b8496f9da Add functions to CoolPropLib (#2084)
Add functions to CoolPropLib: AbstractState_get_mole_fractions and AbstractState_fluid_names
2022-02-02 19:04:51 -05:00
Ian Bell
77f3bdec7a Fix PHI0 delta derivatives for REFPROP backend. Closes #2073 2022-01-08 18:29:20 -05:00
Sébastien Raymond
c2bd2d9994 Fix cxx17 (#2005)
* fix cxx 17
2021-03-05 07:47:52 -05:00
Sébastien Raymond
21af8faa44 Fix cxx17 (#1990)
* fix cxx 17

* add legacy support

Co-authored-by: Ian Bell <ian.h.bell@gmail.com>
Co-authored-by: Jorrit Wronski <jowr@ipu.dk>
Co-authored-by: szebos <sebastien.newe@gmail.com>
2021-01-02 08:18:28 -05:00
Ian Bell
2e138f000c One more _HUGE
See #1988
2020-12-12 22:46:04 -05:00
Ian Bell
5a521c532f Apply prefactor also to values when caching 2020-12-09 11:11:32 -05:00
Ian Bell
e2acfce6e0 Fix HUGE -> _HUGE
See #1988

Only one character difference, but an important one!
2020-12-09 11:10:52 -05:00
Ian Bell
9cda7adc57 Allow for a prefactor multiplying alpha0
To deal with the ratio of gas constants from Jaeschke and Schley in GERG-2008
2020-12-07 08:45:20 -05:00
Ian Bell
0211813a0c Actually add the GERG-2004 contributions 2020-12-04 15:04:10 -05:00
Ian Bell
8ab810a560 Allow for the Cosh and Sinh terms of GERG-2004 in alpha0 2020-12-04 13:38:56 -05:00
Ian Bell
9b8f866e5e Remove from source control PC-SAFT data headers 2020-05-11 20:35:44 -04: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
ian
9a02b4564c Fix string for critical point stability key 2020-03-30 11:50:19 -04:00
ian
242105e76b Fix missing ; 2019-12-13 18:49:39 -07:00
ian
39f7f88eb0 Fix shared_ptr once and for all... ? 2019-12-13 18:43:21 -07:00
ian
86c01b8842 Seems like maybe we can remove all the references to std::tr1::shared_ptr 2019-12-12 23:22:22 -07:00
ian
1d7f6eeeff Fix header guard 2019-12-12 23:11:27 -07:00
ian
d84774d099 another try with shared_ptr 2019-12-12 23:01:53 -07:00
ian
029dffac8a Another try with shared_ptr header 2019-12-12 22:52:39 -07:00
ian
24425aea8e Fix PC-SAFT JSON files (remove trailing semicolons) 2019-12-12 21:15:41 -07: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
ian
c12ebbd6ea Add new EOS for ammonia 2019-11-06 20:18:05 -07:00
ian
1e5f31d773 More useful schema validation information 2019-10-06 00:04:32 -06:00
ian
38713b3c5c Return default delimiter to a , 2019-09-19 22:29:20 -06:00
ian
ebff29a7d2 Remove get_config_integer 2019-08-11 22:07:57 -06:00
ian
84dcbda935 Allow REFPROP error threshold to be changed; closes #1847 2019-08-11 21:43:29 -06:00
DGSEM
0c78491c6c fixes in doxygen docu for fundamental derivative (#1842) 2019-07-28 10:37:19 -06:00
Ian Bell
c5549822d2 Allow list delimiter to be changed, important for fluids like 1,1,2-trifluoroethane with commas in them (#1838) 2019-07-26 21:42:59 -06:00
Ian Bell
590cc7c817 Fix resetting of mole mass; closes #1815 2019-04-06 11:30:47 -06:00
Ian Bell
3c07cf89be Maybe fix shared_ptr for VS2008 2019-03-31 10:43:54 -06:00
Thomas Beutlich
936939b8ab Use std::shared_ptr if available in VS (#1810)
Fix compilation with VS2017, where std::tr1 is no longer enabled by default
2019-03-25 19:44:32 -06:00
Ian Bell
cb8cb0be62 Make ND solver capable of being relaxed 2019-02-21 10:17:02 -07:00
Jorrit Wronski
75c32a5153 Added isentropic expansion coefficient (#1791) 2019-01-15 10:09:06 -07:00
Ian Bell
5ce0b4ef97 Fix bug with name with incomp backend; closes #1707 2019-01-12 17:06:30 -07:00
Ian Bell
a73e447f92 Revert changes for FMT; should have been done in branch (sorry @jowr) 2019-01-11 21:27:56 -07:00
Ian Bell
7410947713 Fix some windows build failures 2019-01-11 20:27:46 -07:00
Ian Bell
b1fd926ef3 First attempt at moving FMTLIB away from header-only; speed up builds maybe? 2019-01-11 20:01:01 -07:00
Ian Bell
502bf0b506 Reduce the number of includes from DataStructures.h 2019-01-10 20:45:44 -07:00
Ian Bell
30b0aea348 Add some more pure-virtual destructors 2019-01-10 14:58:13 -07:00
Jeff Henning
4b1ace160e Throw sensible error message for single-phase surface tension (#1755) 2018-10-29 09:08:54 +01:00