Commit Graph

1907 Commits

Author SHA1 Message Date
henningjp
1864c03c07 Implement PropsSImulti in the Mathcad wrapper 2026-03-21 14:30:47 -04:00
Ian Bell
4c44353628 Fix HAPropsSI with T_dp+R or W+R inputs when T is unknown (issue #2670) (#2679)
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>
2026-02-28 07:36:09 -05:00
Ian Bell
a3c7430265 Add checks for melting line with PT inputs (#2648) 2025-11-10 18:00:56 -05:00
Ian Bell
d5761cb150 Use ninja for the examples (#2635)
* Use ninja for the examples

Should help a little bit with doc building

* FIx some templates

* Fix template deduction error in count_x_for_y_many functions

The count_x_for_y_many and count_x_for_y_manyC functions were using
a single template parameter for both input (double) and output (size_t)
arrays, causing template deduction failures in Cython bindings.

Changed to use separate template parameters YContainer and CountContainer
to properly support different types for input y values and output counts.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* Fix types in PXD header too

* Docs should get ninja too

* Changes from clang-format

* Fix git diff argument order in clang-format script

The script was comparing PR_BRANCH to TARGET_BRANCH, which shows changes from the PR branch to the target (what's in target that's NOT in PR). For PR validation, we need the opposite: changes from target to PR (what's in PR that's NOT in target).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* Fix Cython template deduction errors in solve_for_x_manyC and count_x_for_y_manyC

Add explicit template parameters [double, size_t] to both function calls
to resolve template type deduction errors when compiling with Cython.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* Fix wheel building by removing return from void Cython template calls

The functions solve_for_x_manyC and count_x_for_y_manyC return void in C++.
When Cython sees a return statement with a void function call containing
template arguments with commas (e.g., [double, size_t]), it wraps the call
in the __Pyx_void_to_None macro. This macro is a simple preprocessor macro
that cannot handle the commas in template arguments, treating them as macro
argument separators instead.

The fix is to remove the return statements, making these simple void function
calls. This prevents the __Pyx_void_to_None wrapping and allows the wheel to
build successfully.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-12 09:28:57 -04:00
Ian Bell
9eb3eb8db1 Run clang-format with claude code and fix VS warnings (#2629)
* Run clang-format with claude code and fix VS warnings

* More clang-format

* And the tests too

* Cleanup from clang-tidy

* More constness and modernization

* Cleanup and modernization
2025-10-05 11:02:51 -04:00
Ian Bell
eb9885e912 Add fallback method for density solver for bad EOS (#2627) 2025-10-04 16:04:15 -04:00
Ian Bell
896e85d129 Add Ideal gas methods (#2626)
* Add ability to get at the ideal-gas properties directly

Also through the python interface

* And python interface files

* Fixes the missing reference to ideal gas notebook
2025-10-04 16:00:30 -04:00
Josh Kelley
1b5096de6c Improvements to mixture pair management (#2579)
* Improvements to mixture pair management

Add C++ function declarations for functions that are exposed to Python but not C++.

Update apply_simple_mixing_rule to not break default rules.  This has caused confusion and bugs in the past; see, e.g., https://github.com/CoolProp/CoolProp/issues/1874, https://github.com/CoolProp/CoolProp/issues/2082.

* Delete no longer applicable docs

See #1875
2025-10-04 12:34:21 -04:00
Ian Bell
21c4a18f13 Use EOS directly when setting reference state, no full update 2025-10-04 12:23:55 -04:00
Ian Bell
2641f85f9b Faster alpha0 (#2625)
* Optimize the calling speed of IdealHelmholtzPlanckEinsteinGeneralized::all

Something like 2x faster; exp is the remainder

* Add function to get all alpha0 derivatives at once (they are all calculated every time anyhow)

* Add note about the weird naming

* Add profiling snippet

* Also implement properly for mixtures

* And also move to unchecked update function
2025-10-04 09:05:26 -04:00
Ian Bell
8310d0ec69 Fork based on whether pure 2025-09-14 11:59:19 -04:00
Ian Bell
92480146b7 Fix bug with DP inputs when singlephase liquid 2025-09-14 11:58:34 -04:00
Ian Bell
7a5f3efedd Try to fix crashes after refactor 2025-09-14 10:49:41 -04:00
Ian Bell
f8ac47af6b Unset some variables if inputs are single-phase and p is provided 2025-09-13 15:51:31 -04:00
Ian Bell
945fd6c334 Use the SA first if available for p-phase determination 2025-09-13 15:01:09 -04:00
Ian Bell
d1669ca239 Add link to TOMS algo 2025-09-13 14:50:20 -04:00
Ian Bell
4c76815933 In a few places use X_critical
See #2602
2025-09-13 14:50:06 -04:00
Ian Bell
b538711fe6 Improvements in the critical region for subcritical pressures for P+{H,S,U} (#2609)
* Make improvements in the critical region for subcritical pressures for P+{H,S,U}

See #2594

* Fix starting temperature for 2D Newton

* Switch to TOMS748 instead of Brent; resort the steps

* Enable TOMS748 properly

* boost fixes
2025-09-10 18:45:19 -04:00
Ian Bell
a2faf1b00c Update test for #2608 2025-09-06 13:50:00 -04:00
Ian Bell
bba8597f16 Add test for #2608 2025-09-06 13:16:46 -04:00
Ian Bell
ae8886ac1e Add test for #2582 2025-09-06 08:30:23 -04:00
Ian Bell
10ef4922d1 Always recalculate the critical point to be consistent with the use (… (#2601)
* Always recalculate the critical point to be consistent with the use (or not) of superancillaries. The _crit struct is loaded from file but not necessarily in agreement

* Don't recalculate phase - why does this make things work again?
2025-09-05 20:19:37 -04:00
Ian Bell
1c07b9b426 A more robust fix for #2587 (#2603) 2025-08-23 18:06:29 -04:00
Ian Bell
f01b78948c Another try with #2491 2025-08-21 19:39:58 -04:00
Ian Bell
53cf24c02b Use superancillaries to get even better guess values for P+{H,S,U}
Closes #2491
2025-08-20 18:51:51 -04:00
Ian Bell
f1233c228a FIx T+{X} superancillary copying
Closes #2592
2025-08-19 21:04:30 -04:00
Ian Bell
c2a9c3a9c8 Rolling back changes to T+{X}, need to test more before pushing
See #2592
2025-08-17 21:20:06 -04:00
Ian Bell
d1f75840e8 Fix handling of TD 2025-08-17 12:45:16 -04:00
Ian Bell
6149c46d94 Use superancillaries also for T+{S,H,U} phase determination 2025-08-17 11:09:39 -04:00
Ian Bell
bd39061b0a Superancillaries should be used for phase determination with PT inputs 2025-08-17 10:52:55 -04:00
Ian Bell
b758cb95d7 PT should not use the superancillaries in the conventional sense 2025-08-17 10:49:31 -04:00
Ian Bell
7eddbe8528 Migrate P, {H,S,U} to superancillaries for phase determination. Need to do the same for temperature now.
Closes #2591
2025-08-14 19:13:51 -04:00
Ian Bell
1c92841b48 Disable a failing electrolyte test 2025-08-07 19:25:02 -04:00
Ian Bell
b4f60955ef Try to relax a tolerance to get plots tests to pass 2025-08-07 18:40:09 -04:00
Josh Kelley
2b9287b2ea Export additional JavaScript functions (#2580) 2025-07-22 10:22:41 -04:00
Ian Bell
ae885b9d8d Time SA instantiation
See #2571
2025-07-04 19:16:34 -04:00
Ian Bell
012a0f944b Allow for env var to kill SA entirely
See #2568
Closes #2571
2025-07-04 19:14:36 -04:00
Ian Bell
a21f8eaccc Update plot test data with auto-generation script
Closes #2536
See #2484
2025-07-04 12:25:45 -04:00
Ian Bell
b6e04e1fa0 Fix the spline tests
Sort of: use old values from ancient CoolProp to check against, and only do the right check for enthalpy derivatives
2025-07-01 20:07:29 -04:00
Ian Bell
02162b3e47 Fix melting lines so they can be evaluated at pmax 2025-06-15 09:25:03 -04:00
Ian Bell
df23e1c568 Fix reference states to match REFPROP 10.0
Something weird with incbin not pulling in new version of file
2025-06-15 09:07:07 -04:00
Ian Bell
05b136b192 Fix mix derivs 2025-06-14 15:25:42 -04:00
Ian Bell
f3b9bff794 Check T >> Tmax for DP inputs (fix test) 2025-06-14 15:25:12 -04:00
Ian Bell
303683a0e0 Fix test conditions and thresholds for transport properties (passing) 2025-06-14 15:24:47 -04:00
Ian Bell
456d365428 Only initlalize the config if not already initialized 2025-06-14 09:38:30 -04:00
Ian Bell
710737db9e First initialization order fix from coverity 2025-06-14 09:37:20 -04:00
Ian Bell
bb4719ef2e Enable tau and delta outputs from AbstractState 2025-06-14 08:40:50 -04:00
Ian Bell
a6329afead It was a real memory leak in the test :( 2025-05-19 19:35:20 -04:00
Ian Bell
c3f77fdf7b Initialization is so much nicer now 2025-05-19 12:55:48 -04:00
Ian Bell
08d3465967 Move to more modern C++ [skip ci] 2025-05-19 08:26:50 -04:00