Update project structure and configurations

This commit is contained in:
2026-05-23 10:19:55 +02:00
parent ab5dc7e568
commit 62efea0646
1832 changed files with 83568 additions and 51829 deletions

View File

@@ -91,7 +91,7 @@ impl<Model: HeatTransferModel + 'static> HeatExchangerBuilder<Model> {
///
/// let model = LmtdModel::new(5000.0, FlowConfiguration::CounterFlow);
/// let hx = HeatExchanger::new(model, "Condenser");
/// assert_eq!(hx.n_equations(), 3);
/// assert_eq!(hx.n_equations(), 2);
/// ```
/// Boundary conditions for one side of the heat exchanger.
///
@@ -448,8 +448,8 @@ impl<Model: HeatTransferModel + 'static> HeatExchanger<Model> {
/// Sets calibration factors.
pub fn set_calib(&mut self, calib: Calib) {
self.calib = calib;
self.model.set_ua_scale(calib.f_ua);
self.calib = calib;
}
/// Creates a fluid state from temperature, pressure, enthalpy, mass flow, and Cp.
@@ -741,6 +741,32 @@ impl<Model: HeatTransferModel + 'static> Component for HeatExchanger<Model> {
}
}
}
fn set_fluid_backend_from_builder(&mut self, backend: std::sync::Arc<dyn entropyk_fluids::FluidBackend>) {
if self.fluid_backend.is_none() {
self.fluid_backend = Some(backend);
}
}
fn signature(&self) -> String {
format!("{}(circuit={})", self.name, self.circuit_id.0)
}
fn to_params(&self) -> crate::ComponentParams {
crate::ComponentParams::new(&self.name)
.with_param("circuitId", self.circuit_id.0)
.with_param("calib", serde_json::to_value(&self.calib).unwrap_or(serde_json::Value::Null))
}
fn update_calib_factor(&mut self, factor: &str, value: f64) -> bool {
let mut c = self.calib().clone();
if c.set_factor(factor, value) {
self.set_calib(c);
true
} else {
false
}
}
}
impl<Model: HeatTransferModel + 'static> StateManageable for HeatExchanger<Model> {