Ian Bell 10c7ba2ac1 feat(cubics): add Chebyshev superancillaries for SRK and Peng-Robinson EOS (#2744)
* feat(cubics): add Chebyshev superancillaries for SRK and Peng-Robinson EOS (#2739)

Port piecewise Chebyshev superancillary expansions from teqp for SRK and PR
cubic EOS, providing fast and accurate saturation properties without iterative
flash. Adds `calc_saturation_ancillary`, `update_QT_pure_superanc`, and
`calc_superanc_Tmax` on `AbstractCubicBackend`; vdW data omitted as CoolProp
does not expose a vdW backend.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* refactor(cubics): address review feedback on cubic superancillary

- Fix stale comment on calc_superanc_Tmax (no Newton steps; closed-form)
- Move SRK_CODE/PR_CODE/P_CODE/RHOL_CODE/RHOV_CODE constants before
  supercubic() so switch cases use named constants instead of magic ints
- Add T > Tmax guard in calc_saturation_ancillary and update_QT_pure_superanc
  to throw CoolProp ValueError instead of propagating std::invalid_argument
- Add is_pure_or_pseudopure guard in calc_superanc_Tmax
- Near-Tc test now derives pc from the superancillary itself rather than
  AS->p_critical() (which reflects the real fluid, not the cubic model)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs(cubics): document SRK/PR superancillary APIs with timing and citation

Add a Superancillaries for SRK and PR subsection to the Cubic EoS docs
covering update_QT_pure_superanc and saturation_ancillary, their
constraints (pure-only, PR/SRK-only, T-input, T <= Tc, not used by
PropsSI), a %timeit comparison against the full cubic flash, and a
citation to Bell and Deiters, IECR 2021 (added to the bib library).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 15:00:56 -04:00
2018-03-06 07:51:58 -07:00
2023-06-19 13:42:09 -04:00
2018-04-17 09:46:37 +02:00
2025-10-11 16:32:58 -04:00
2018-08-14 23:06:49 -06:00

Welcome to CoolProp

CoolProp is a thermophysical property database and wrappers for a selection of programming environments. It offers similar functionality to REFPROP, but CoolProp is open-source and free. It was originally developed by Ian Bell, at the time a post-doc at the University of Liege, in Liege, Belgium.

  • CoolProp has flexible licensing terms: Commercial - ok! Academic? - ok! license

  • For Python, get the latest release via pip install coolprop PyPI downloads PyPI version

  • ... other binaries are available from SourceForge sourceforge downloads CoolProp version tag

  • There is also a bleeding edge nightly build of the development version.

  • The documentation is available for the latest release and the development version

  • For any kind of question regarding CoolProp and its usage, you can ask the CoolProp Discussions

  • ... you might also find answers in our FAQ

  • If you found a bug or have an issue that requires the developers to become active, please file an issue in our issue tracker

  • Contributions to this project are welcomed and encouraged! If you wish to contribute bug fixes, patches, or new features, wrappers, or material properties, please submit a Pull Request with your code.

  • If you are new to Git and Github, please see the CoolProp Wiki for guidance on becoming a contributor to the project.

  • Have a look at the coverity stats Coverity Scan Build Status

Description
No description provided
Readme MIT Cite this repository 58 MiB
Languages
C++ 59.2%
Python 24%
CMake 3.2%
TeX 2.4%
Cython 2.2%
Other 8.7%