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