fix: resolve CLI solver state dimension mismatch

Removed mathematical singularity in HeatExchanger models (q_hot - q_cold = 0 was redundant) causing them to incorrectly request 3 equations without internal variables. Fixed ScrewEconomizerCompressor internal_state_len to perfectly align with the solver dimensions.
This commit is contained in:
Sepehr
2026-02-28 22:45:51 +01:00
parent c5a51d82dc
commit fdd124eefd
35 changed files with 10969 additions and 123 deletions

View File

@@ -89,6 +89,7 @@ impl BphxExchanger {
///
/// ```
/// use entropyk_components::heat_exchanger::{BphxExchanger, BphxGeometry};
/// use entropyk_components::Component;
///
/// let geo = BphxGeometry::from_dh_area(0.003, 0.5, 20);
/// let hx = BphxExchanger::new(geo);
@@ -171,6 +172,11 @@ impl BphxExchanger {
&self.geometry
}
/// Returns the name of the configured heat transfer correlation.
pub fn correlation_name(&self) -> &'static str {
self.correlation_selector.correlation.name()
}
/// Returns the effective UA value (W/K).
pub fn ua(&self) -> f64 {
self.inner.ua()
@@ -401,7 +407,7 @@ mod tests {
fn test_bphx_exchanger_creation() {
let geo = test_geometry();
let hx = BphxExchanger::new(geo);
assert_eq!(hx.n_equations(), 3);
assert_eq!(hx.n_equations(), 2);
assert!(hx.ua() > 0.0);
}