feat: implement mass balance validation for Story 7.1

- Added port_mass_flows to Component trait and implements for core components.
- Added System::check_mass_balance and integrated it into the solver.
- Restored connect methods for ExpansionValve, Compressor, and Pipe to fix integration tests.
- Updated Python and C bindings for validation errors.
- Updated sprint status and story documentation.
This commit is contained in:
Sepehr
2026-02-21 23:21:34 +01:00
parent 4440132b0a
commit fa480ed303
55 changed files with 5987 additions and 31 deletions

View File

@@ -63,6 +63,15 @@ pub enum ThermoError {
/// System was not finalized before an operation.
#[error("System must be finalized before this operation")]
NotFinalized,
/// Simulation validation error (e.g., mass/energy balance constraints violated)
#[error("Validation failed: mass error = {mass_error:.3e} kg/s, energy error = {energy_error:.3e} W")]
Validation {
/// Mass balance error in kg/s
mass_error: f64,
/// Energy balance error in W
energy_error: f64,
},
}
impl ThermoError {