At the critical point dP/drho -> 0, so solver_rho_Tp is ill-conditioned and
a tight pressure residual does not imply a tight density. PropsSI('Dmass',
'T', Tcrit, 'P', Pcrit, 'CO2') returned 466.207 kg/m^3 instead of the true
467.600 kg/m^3. Add a short-circuit at the top of PT_flash (mirroring the
existing guard in PQ_flash) that detects exact-critical inputs within 1e-10
relative on both T and p and returns the tabulated critical density.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* 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>
PR #2745 replaced the rounded SRK/PR Omega coefficients with their exact
analytical values. Even though the Plot tests use the Helmholtz EOS for
R134a, SRK enters as the initial density guess in
HelmholtzEOSMixtureBackend::solver_rho_Tp(), so the sub-ppm change in the
SRK covolume slightly perturbs the critical-point pressure (~1.5e-3 Pa),
which cascades through p_small, psat_max, and P_max into every isoline
value and exceeds the 1e-10 / 1e-7 WithinAbs tolerances.
Regenerated via dev/scripts/generate_Plot_test_data.py against a build
with the new constants and re-ran clang-format. All 503 assertions in
the three [Plot] test cases now pass.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Add refrigerant mixture models (Bell-JPCRD-2022/2023) and update R-1234yf EOS
Pure fluid:
- Replace Richter-JCED-2011 with Lemmon-Akasaka 2022 (Int. J. Thermophys. 43:119)
as EOS[0] for R-1234yf; retain Richter as EOS[1]
- Ttriple updated from 220.0 K to 121.6 K; pc=3384400 Pa; rhoc=4180 mol/m3
- All 16 Table 7 check values pass to 5+ significant figures
- ASHRAE enthalpy reference state correct: h_L(0C)=200 kJ/kg
- Saturation consistent from 150 K to 360 K (L/V pressure equality)
- SUPERANCILLARY omitted pending fastchebpure fix; CoolProp uses the
Table 2 ancillary equations (pS, rhoL, rhoV) as initial guesses
Mixture departure functions (8 new, type=Exponential):
- Bell-JPCRD-2022: R1234yf-R134a, R1234yf-R1234ze(E), R134a-R1234ze(E)
- Bell-JPCRD-2023: R32-R1234yf, R32-R1234ze(E), R1234yf-R152a,
R125-R1234yf, R1234ze(E)-R227ea
Binary pair parameters (5 updated, 3 new):
- Updated R1234yf/R134a, R32/R1234yf, R32/R1234ze(E),
R125/R1234yf, R1234yf/R152a (replacing Akasaka-FPE-2013
and Bell-JCED-2016 interim models with final fits)
- Added R1234yf/R1234ze(E), R134a/R1234ze(E), R1234ze(E)/R227ea
BibTeX entries added: Bell-JPCRD-2022, Bell-JPCRD-2023, Lemmon-IJT-2022
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Add C++ check value tests for Lemmon-IJT-2022 and Bell-JPCRD-2022/2023
- Table 7 from Lemmon & Akasaka (2022): 6 state points for R1234yf
covering ideal-gas, gas, compressed liquid, and near-critical
- Fixed-point constants: Tc, pc, rhoc, Ttriple
- Table XI from Bell (2022): alphar check values for three R1234yf-based
binary pairs (R1234yf/R1234zeE, R1234yf/R134a, R134a/R1234zeE)
- Table XIII from Bell (2023): alphar check values for five mixture pairs
(R32/R1234yf, R32/R1234zeE, R125/R1234yf, R1234yf/R152a, R1234zeE/R227ea)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Add mixture departure functions and binary pair parameters
Bell-JPCRD-2022 (DOI 10.1063/5.0083545):
- 3 new departure functions: R1234yf-R134a, R1234yf-R1234ze(E), R134a-R1234ze(E)
- 3 new/updated binary pairs
Bell-JPCRD-2023 (DOI 10.1063/5.0124188):
- 5 new departure functions: R32-R1234yf, R32-R1234ze(E), R1234yf-R152a,
R125-R1234yf, R1234ze(E)-R227ea
- 5 new/updated binary pairs (supersedes Bell-JCED-2016 interim models)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add superancillary equations to R1234yf EOS
Builds Chebyshev superancillary for R1234yf covering the full
saturation curve from Ttriple (121.6 K) to near-critical (66
intervals). Also adds missing 'description' fields to the ANCILLARIES
block (required by the teqp ancillary loader).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(mixtures): correct betaT ordering for R1234zeE pairs; add inverted-order tests
The Bell-JPCRD-2022 JSON entries for R1234yf+R1234zeE and R134a+R1234zeE
had CAS1=R1234zeE (alphabetically first), causing no swap on load. When
the mixture was constructed with the other component first CoolProp's
MixtureParameters swap logic inverted betaT a second time, yielding the
wrong reducing temperature.
Fix: swap CAS1/CAS2 so that CAS1 is alphabetically later for both pairs,
triggering a swap-on-load that pre-inverts betaT at full double precision.
The swap-on-use then recovers the exact paper value with no rounding error.
The original paper betaT/betaV values are restored in the JSON.
Also enable DmolarT_INPUTS on mixture backends in DHSU_T_flash so the
alphar check-value tests can call update(DmolarT_INPUTS, ...) on a mixture
AbstractState without throwing.
Test updates:
- Bell-JPCRD-2022 Table XI check values for R1234yf-containing pairs
updated to the final Lemmon-IJT-2022 EOS (pre-pub EOS used in paper
differs by ~0.4%); tolerance tightened from 1e-6 to 1e-10 throughout.
- Three new inverted-component-order sections check the same tabulated
alphar values as the forward-order tests, verifying that the GERG
reducing function symmetry (swap components + reciprocal beta = same
result) is preserved by the CAS-ordering fix.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* docs(tests): clarify that R1234yf EOS change drives the Table XI value updates
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* chore: bump fastchebpure pin to 2026.04.18 for R1234yf superancillary data
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(tests): specify phase in mixture DmolarT tests; revert FlashRoutines workaround
Mixture tests that call update(DmolarT_INPUTS, ...) must call specify_phase()
first so DHSU_T_flash uses the imposed-phase path rather than hitting the
NotImplementedError. Reverts the iDmolar special-case added to the mixture
else-branch of DHSU_T_flash.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Without a stable CPM_SOURCE_CACHE, FetchContent_Populate runs on every cmake
configure (new session), triggering ExternalProject's git fetch/checkout and
touching header timestamps in _deps/<name>-src/. This causes a complete C++
rebuild on every `uv build` even with no source changes.
Defaulting CPM_SOURCE_CACHE to .cpm_cache/ in the repo root ensures CPM skips
FetchContent_Populate for already-downloaded packages, keeping header timestamps
stable. Users can still override via the CPM_SOURCE_CACHE env var.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
CMake does not have a LIST cache type; it was silently coercing to STRING
and emitting a warning on every configure. Fixes the longstanding CMake
warning reported in PR #2728.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
The vendored file was fetched from CPM master rather than the v0.40.7
release tag, causing a CMake warning about an unstable development
version on every configure.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* perf(humid_air): cache virial coefficients per temperature to eliminate redundant EOS calls
Adds `calc_all_virials()` to `HelmholtzEOSMixtureBackend` which computes B,
dB/dT, C, dC/dT in a single `residual_helmholtz->all()` call instead of four
separate `keyed_output()` calls (each of which invoked `all()` independently).
Adds a T-keyed static cache in `HumidAirProp.cpp` so that Air and Water virials
are computed once per unique temperature across all callers in the same
HAPropsSI evaluation. This eliminates ~12 redundant full EOS evaluations per
T+W→H call (6 Air + 6 Water: B_m and C_m each called twice across
MolarVolume+MolarEnthalpy, plus dB_m_dT and dC_m_dT).
Benchmark results on Apple M-series (ns/call, warm cache):
T+W→H: 23 µs → 5.2 µs (4.5×)
T+R→H: 32 µs → 7.6 µs (4.0×)
T+Twb→W: 3.8 ms → 0.9 ms (4.2×)
T+V→W: 33 µs → 1.6 µs (21× — dominated by cache warmth)
Adds [virial_cache] Catch2 tests verifying calc_all_virials() matches the
original keyed_output() path for Air and Water across 10 temperatures, and
that the HAPropsSI cache invalidates correctly across temperature changes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* perf(humid_air): eliminate all update() calls from ideal-gas enthalpy/entropy functions
Adds two new per-temperature caches to HumidAirProp and two direct EOS methods
to HelmholtzEOSMixtureBackend, removing every backend update() call from the hot
path of HAPropsSI property evaluations.
Changes
-------
HelmholtzEOSMixtureBackend::calc_all_virials (previous commit):
Single residual_helmholtz->all() call yields B, dB/dT, C, dC/dT at once.
HelmholtzEOSMixtureBackend::calc_alpha0_and_dTau (new):
Single alpha0.all() call yields f(tau) and dalpha0/dtau at delta=1 without
any update() call. Pure/pseudopure path (Air, Water) uses tau directly since
Tc = Tr for these fluids; mixture fallback uses calc_alpha0_deriv_nocache.
HumidAirProp — two independent T-keyed caches:
s_virial_cache: B, dB/dT, C, dC/dT for Air and Water (filled only when
FlagUseVirialCorrelations=0, matching the original access pattern).
s_alpha0_cache: f(tau) and dalpha0/dtau for Air and Water (always filled;
separated from virial cache so virial EOS calls are not triggered when
FlagUseVirialCorrelations=1).
s_ref: one-time reference-state offsets (hoffset, soffset, T_red, rho_red,
ln_delta_air) computed via update() with specify_phase(iphase_gas) guards.
IdealGasMolarEnthalpy_Water/Air and IdealGasMolarEntropy_Water/Air all rewritten
to use s_alpha0_cache + s_ref — zero update() calls on the hot path.
Benchmark (Apple M-series, warm cache):
T+W→H: 23 µs → 5.2 µs (virial cache) → 0.88 µs (alpha0 cache) 26×
T+R→H: 32 µs → 7.6 µs → 3.2 µs 10×
T+R→S: N/A → N/A → 3.4 µs
Tests
-----
Adds [virial_cache] and [alpha0_cache] Catch2 test cases that verify the new
direct-EOS methods are bit-identical to the original update()+keyed_output()
paths for Air and Water across 10 temperatures.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* refactor(humid_air): move virial/alpha0 helpers out of HEMB class
Address reviewer comments on PR #2716:
- calc_all_virials and calc_alpha0_and_dTau are removed from
HelmholtzEOSMixtureBackend. They are evaluated at delta→0 and
delta=1 respectively, assumptions that only make sense in the
humid-air context, so they now live as static free functions in
HumidAirProp.cpp with clearer names and explicit doc comments
explaining the delta choice.
- fill_virial_cache and fill_alpha0_cache updated to call the new
static helpers (calc_all_virials, calc_ideal_gas_alpha0).
- Tests that previously called the class methods directly are replaced
with end-to-end HAPropsSI checks that exercise the same code paths
through the public API.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(humid_air): three test failures from alpha0 refactor
- CMakeLists: use local _MY_MAIN_SOURCES so COOLPROP_MY_MAIN doesn't
pollute APP_SOURCES and override Catch2's main in CatchTestRunner
- HumidAirProp: calc_ideal_gas_alpha0 incorrectly rejected Air
(pseudo_pure=true); guard now only blocks true multi-component fluids
- CoolProp-Tests: fix Z tolerance (1e-3 → margin 2e-3); fix h-s
round-trip to use (H,W=0)→T instead of unsupported (H,S)→T
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* build: replace git submodules with CPM.cmake
All 11 submodules (Eigen, fmtlib, msgpack-c, rapidjson, IF97,
REFPROP-headers, multicomplex, Catch2, pybind11, ExcelAddinInstaller,
FindMathematica) are now fetched by CPM.cmake at configure time.
Set CPM_SOURCE_CACHE (e.g. ~/.cache/CPM) to share the download cache
across git worktrees and build directories — no more per-worktree
`git submodule update --init --recursive`.
Vendored deps that have no upstream release cycle (miniz, nlohmann-json,
incbin) remain in externals/ as before.
Source-level changes: angle-bracket includes for rapidjson, IF97, and
REFPROP-headers now that their directories are on the include path via
CPM-provided source dirs rather than relative paths from the repo root.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(python): wire up CPM.cmake in Python wrapper, fix include paths
The Python wrapper CMakeLists.txt was still referencing submodule paths
(externals/Eigen, externals/fmtlib, externals/msgpack-c) removed by the
CPM migration. Include CPM.cmake + dependencies.cmake from the root and
use the ${Pkg_SOURCE_DIR} variables instead. Also adds missing
rapidjson, IF97, and REFPROP_headers include dirs required by CoolProp
sources.
CI workflows drop the now-meaningless `submodules: recursive` checkout
option and add a CPM source-cache step to avoid re-downloading on each
macOS/Windows runner.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* docs: remove git submodule references after CPM.cmake migration
Dependencies are now managed by CPM.cmake (fetched automatically at
CMake configure time), so git submodules no longer exist.
- Drop `--recursive` from all `git clone` commands in Web docs and
wrapper READMEs (26 .rst/.md files)
- Remove `submodules: recursive` from all CI workflow checkout steps
(13 workflow files)
- Remove `git submodule foreach/update` calls from release.bsh and
delete the now-dead pybind11 security-workaround lines
- Drop `--recursive` from build_swigged_matlab.sh and gitMirror.bsh
- Update CONTRIBUTING.md: drop "and its submodules" phrasing
Changelog entries referencing old submodule PRs are left intact as
historical records. The --recursive in buildbot.rst is for the
Dockerfiles repo (unrelated) and is also left unchanged.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(ci): remove empty 'with:' blocks after submodule removal, apply clang-format
After removing 'submodules: recursive' from checkout steps, some workflow
files were left with dangling empty 'with:' blocks that GitHub Actions
rejects as workflow file errors. Remove the empty 'with:' in 9 workflows.
Also apply clang-format to fix spacing in REFPROPMixtureBackend.cpp,
HumidAirProp.cpp, and Helmholtz.cpp.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add Chlorine (Cl2) fundamental equation of state
Implements the EOS from Thol, Herrig, Span, Lemmon (AIChE J. 67, e17326,
2021, DOI: 10.1002/aic.17326) for chlorine (CAS 7782-50-5).
- 10-term polynomial/exponential residual + 5-term Gaussian bell-shaped
- Ideal gas: diatomic (2.5) + 3 Planck-Einstein terms (800/3000/8200 K)
- NBP reference state (h=0, s=0 at saturated liquid, 101325 Pa)
- Saturation ancillaries: pS, rhoL, rhoV from REFPROP coefficients
- Valid range: 172.17 K to 525 K, up to 20 MPa
- Adds BibTeX entry Thol-AICHE-2021
Closes#2714
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add superancillary equations to Chlorine EOS
Builds Chebyshev superancillary for Cl2 covering the full saturation
curve from Ttriple (172.17 K) to near-critical (416.865 K, 61
intervals). Errors away from the critical region are at machine-
precision level (~1e-13 %).
The fastchebpure builder was also patched to prune near-critical
intervals where the pressure Chebyshev expansion becomes non-monotone
due to ill-conditioned VLE convergence at very small Theta; 3 such
intervals were removed for Chlorine (Theta ~ 2.3e-7).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Bump fastchebpure release to 2026.04.16 to fix docs CI failures
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces urllib with requests + HTTPAdapter/Retry to get automatic
retries (up to 3) with exponential backoff on 429/5xx and network
errors; 404 is treated as a definitive miss and skips to 2D without
retrying.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* Try loading REFPROP backend and only warn on failure
* Skip REFPROP related tests when not available using a single helper routine in CoolProp:: namespace
* docs: add predefined mixtures table to Mixtures documentation
Adds a new section "Predefined mixtures" to Web/fluid_properties/Mixtures.rst
listing all 154 predefined mixtures with their components and mole fractions.
Each mixture is tested at build time; those that fail (missing binary interaction
parameters or not present in the compiled library) are flagged in a Notes column.
Also updates the code examples in the new section to use the required .mix suffix,
and registers the generation script in the doc build task list.
Closes#2711
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* docs: improve predefined mixtures table error messages and auto-count
- Replace CAS numbers with fluid names in binary interaction parameter errors
- Detect and report missing pure fluids by name
- Distinguish 'not registered as predefined mixture' from missing BIP
- Write PredefinedMixturesCount.rst so the mixture count in Mixtures.rst
is generated automatically rather than hardcoded
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* Fix superancillary performance: store as shared_ptr instead of optional
Every call to AbstractState::factory("HEOS", fluid) was deep-copying the
SuperAncillary_t object (multiple large Chebyshev coefficient vectors) as
part of the CoolPropFluid value copy from the fluid library. Since the
superancillary is immutable once built, switch storage from
std::optional<SuperAncillary_t> to std::shared_ptr<SuperAncillary_t>.
All copies of CoolPropFluid for the same fluid now share a single
SuperAncillary_t in memory; copying the shared_ptr is O(1) (atomic
ref-count increment only).
Also fix a latent bug in get_fluid_parameter_double where optsuperanc.value()
was called before the if(optsuperanc) guard (would have crashed on fluids
without superancillaries when SUPERANC:: parameters were queried).
Changes:
- CoolPropFluid.h: storage type optional -> shared_ptr; rename internal
accessor get_superanc_optional -> get_superanc
- HelmholtzEOSMixtureBackend.h: update declaration (return shared_ptr)
- HelmholtzEOSMixtureBackend.cpp: update impl + 6 call sites (.value() -> *)
- FlashRoutines.cpp: update 4 call sites (.value() -> *)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* PR review fixes: rename get_superanc, simplify melting line logic, test cleanup
- Rename HelmholtzEOSMixtureBackend::get_superanc_optional() to get_superanc()
to match EquationOfState::get_superanc() and reflect the shared_ptr return type
- Remove redundant `if (other == iT &&` guard inside case iT: (always true)
- Simplify melting line if/else in subcritical superanc branch: collapse redundant
has_melting_line()/else branches into a single _phase assignment
- Fix get_fluid_parameter_double: note that .value() before null check was a
pre-existing bug that the optional->shared_ptr migration implicitly fixed
- Use std::shared_ptr in [2639] test case for consistency
- Add comment explaining [2608] CO2 temperature change (218.048->218.050)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(docs): add interactive 3D molecule viewers to fluid pages
Use py3Dmol + PubChem SDF data to embed a rotate-and-drag 3D (or 2D
fallback) molecule viewer on each pure fluid documentation page.
- fetch_pubchem_sdf(): downloads 3D conformer SDF from PubChem REST API
(falls back to 2D), caching results in molecule_sdf/ to avoid repeated
network calls on doc rebuilds
- generate_3dmol_rst(): inlines the SDF as a JS template literal inside a
.. raw:: html block — no extra static files needed at Sphinx build time
- FluidGenerator.write(): validates InChIKey with regex before fetching;
pseudo-pure fluids (Air, R404A, etc.) without InChIKeys are silently skipped
- conf.py: loads 3Dmol.js from CDN via html_js_files
- .gitignore: excludes the generated molecule_sdf/ cache directory
Restores molecule visualisation that was removed in April 2025 (the old
approach tried to embed an image directive inside a CSV table, which is
invalid RST; this implementation places the viewer in the RST template).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(docs): serve 3Dmol.js locally to eliminate CORS errors
Download 3Dmol-min.js to _static/ at Sphinx build time (same pattern
as MathJax) instead of loading it from the CDN via html_js_files.
Serving the script same-origin removes the cross-origin restriction
that caused CORS errors when docs were opened from file:// or a local
dev server.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(docs): correct 3Dmol viewer positioning and initialization timing
3Dmol.js sets its canvas to position:absolute;top:0;left:0 and only
auto-sets the container to position:relative when the container's
inline style.position === "static". An unstyled div has style.position
=== "" so the check fails, and the canvas escapes the container and
anchors to the nearest positioned ancestor in the Sphinx page layout.
Fix: add position:relative explicitly to the viewer container div.
Also defer viewer init via DOMContentLoaded so layout is finalized
before createViewer reads the container dimensions, and call v.resize()
before v.render() to sync the WebGL canvas to the container size.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(docs): disable MathJax SRE to prevent CORS errors on file:// URLs
MathJax 4.0's Speech Rule Engine fetches sre/mathmaps/base.json at
runtime via fetch(). Chrome blocks this when docs are opened from a
local file:// URL (null origin). Disabling enableExplorer and
enableAssistiveMml prevents SRE from initialising entirely.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(docs): load 3Dmol before require.js to fix AMD conflict
sphinx.ext.mathjax injects require.js at priority 500. When 3Dmol
loads after it, AMD detection fires and calls define([], factory)
instead of setting window.$3Dmol directly. Since nothing ever calls
require(['3Dmol-min']), the factory never runs and the viewer silently
fails (infinite setTimeout retry, no console errors).
Setting priority 450 ensures 3Dmol loads before require.js.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(docs): add retry logic to downloads in conf.py using requests
Replace urllib.request.urlretrieve with a requests-based _download()
helper that retries up to 5 times (exponential backoff, factor=2) on
transient HTTP errors and timeouts. Fixes CI build failures when
the MathJax or 3Dmol.js downloads time out.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers ASHRAE RP-1485 scenarios from HAValidation.py as C++ Catch2
tests so they run in CI instead of only during Python doc builds:
- [ashrae_a61]: saturated air T=-60..0°C (ice regime, R=1)
- [ashrae_a62]: saturated air T=0..90°C (liquid regime, R=1)
- [ashrae_a8/a9]: hot humid air T=200/320°C across multiple pressures
- [humid_air_physics]: T_dp <= T_wb <= T_db ordering, W/R invariants
- [humid_air_roundtrip]: W, H, T_dp, T_wb round-trips
- [humid_air_aux]: f_factor, p_ws, beta_H, kT, vbar_ws, virial checks
Also documents two current behaviors as known baselines:
- W_sat > 1 kg/kg is physically correct above ~60 degC (not a bug)
- beta_H returns inf below 273.16 K (no liquid water)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* chore(deps): update miniz from 3.0.2 to 3.1.1
Adds the miniz-3.1.1 source directory and updates all CMakeLists.txt
references. Notable fixes in 3.1.0/3.1.1: integer promotion warnings,
tinfl_decompress bug that broke mem-to-heap decompression, MinGW Unicode
path support, and inline static wrappers to silence warnings.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* chore(deps): remove old miniz-3.0.2 source tree
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Three fixes to src/HumidAirProp.cpp:
1. WetbulbTemperature inner Brent upper bound: changed Brent(WBS, Tmax+1, 100)
to Brent(WBS, Tmax, 100). The old Tmax+1 evaluated WBS at T_sat(P) where
P_s == P, causing division-by-zero (W_s_wb infinite) and an exception that
cascaded into the outer solver returning _HUGE for certain pressures.
2. _HAPropsSI_inputs T_max extension for T_wb / enthalpy secondary inputs: when
MainInput is RelHum (>= 1e-10) and the secondary input is T_wb or enthalpy,
use T_max = 640 K instead of T_sat(P) - 1. For very dry air at sub-atmospheric
pressures the solution T_db can legitimately exceed T_sat(P); WetbulbTemperature
already handles T_db > T_sat correctly via its fallback solver.
3. Replace CoolProp::PropsSI("T","P",p,"Q",0,"Water") with the already-instantiated
Water singleton (Water->update(PQ_INPUTS,...); T_max = Water->T() - 1), consistent
with the rest of HumidAirProp.cpp.
Also added a Catch regression test [humid_air][2690] covering 10 pressures
(including the previously-failing 90190–91160 Pa band) with round-trip
verification to < 1e-6 K.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* Remove unused heavy headers to improve compile times
- Exceptions.h: replace unused <iostream> with <string> (needed for std::string)
- CPnumerics.h: add explicit <iostream> (was relying on transitive include via Exceptions.h for std::cerr)
- superancillary/superancillary.h: replace <iostream> with <cstdio>; use fprintf for debug output
- TabularBackends.h: remove unused <sstream>
<iostream> is one of the heaviest stdlib headers; removing it from widely-included
headers (Exceptions.h: ~32 dependents, superancillary.h: pulled in by AbstractState.h,
CoolPropFluid.h, Configuration.h) reduces cold build times.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Add missing <iostream> to ODEIntegrators.cpp
ODEIntegrators.cpp uses std::cout but was relying on transitive inclusion
via Exceptions.h. After removing <iostream> from Exceptions.h, this broke
compilation. Add the include directly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* make _binary arrays constexpr and use string_view instead of string
By making _binary arrays constexpr and using string_view instead of string, startup speed of the library is improved.
* fixed interfaces for string_view
added /bigobj /MP to MSVC CXX-flags
* empty commit to trigger CI
* empty commit to force CI build
---------
Co-authored-by: Löw, Tobias <Tobias.Loew@iqony.energy>
GitHub does not pass repository secrets to workflows triggered by PRs
from forks, causing the gpg decrypt step to fail. Add a condition so
the Build REFPROP step is skipped for fork PRs; the rest of the build
and non-REFPROP tests still run.
Fixes#2694
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Only the REFPROP checks not passing because of permissions but ran fine locally. All regression testing passed and limited to the single Mathcad wrapper file.
Both combinations uniquely determine dry-bulb temperature: T_dp and W
each fix psi_w independently of T, while relative humidity R provides
the T-dependent equation R = psi_w*P / (f(T,P)*p_ws(T)) to solve.
Changes:
- Reorder priority chain to prefer T_dp over R as main key when both
are present (T_dp gives psi_w directly, yielding correct T_min bound)
- Relax the two-water-content guard to allow T_dp+R and W+R combinations
while still rejecting W+T_dp (both fix psi_w; T remains unconstrained)
- Add Catch2 test covering all three cases, including the W+T_dp invalid
case which correctly returns _HUGE
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>