Skip to content

Fix recuperator effectiveness for real-gas fluids#71

Merged
dyreby merged 1 commit into
mainfrom
fix-effectiveness-sign
Mar 5, 2026
Merged

Fix recuperator effectiveness for real-gas fluids#71
dyreby merged 1 commit into
mainfrom
fix-effectiveness-sign

Conversation

@dyreby

@dyreby dyreby commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

Fix recuperator effectiveness returning 1.0 for real-gas fluids (CoolProp) even when min ΔT is well above zero.

The bug

The bisection observer in effectiveness::compute assumed positive residual on model failure, telling the solver "min ΔT is still above zero, keep pushing." For real-gas fluids near the critical point, model failures at high cold outlet temperatures mean the second law has been violated — the solver should treat that as negative (past the pinch). The inverted sign collapsed the bracket toward q_actual instead of q_max, giving q_actual / q_max ≈ 1.0.

Visible on the dashboard with default sCO₂ conditions: effectiveness showed 1.000 while min ΔT was 7.8 K.

The fix

One-line change: assume_positive()assume_negative() in the bisection observer.

Test

Added effectiveness_consistent_with_min_delta_t covering both PerfectGas and CoolProp. Asserts that effectiveness < 1.0 whenever min ΔT > 1 K.

With the fix, CoolProp returns effectiveness ≈ 0.97 for the dashboard defaults — consistent with the 7.8 K min ΔT.

The bisection observer assumed positive residual on model failure,
telling the solver the pinch point hadn't been reached yet. For
real-gas fluids (CoolProp), model failures near the upper bracket
mean the cold outlet temperature violates the second law — the
solver should treat that as negative (past the pinch). The inverted
sign collapsed the bracket toward q_actual, producing effectiveness
of 1.0 regardless of the actual min ΔT.
@dyreby dyreby merged commit 9c5de68 into main Mar 5, 2026
1 check passed
@dyreby dyreby deleted the fix-effectiveness-sign branch March 5, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant