mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-23 03:00:17 -04:00
* 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>