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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user