Process acceptance¶
acceptance
¶
Process acceptance using the thermodynamic package's physical criteria.
Audit stream phase inventories and unit/plant boundaries after solving. This keeps stability searches out of recycle iterations while ensuring accepted process results carry equilibrium, material, energy, and applicability evidence.
Classes:
| Name | Description |
|---|---|
CheckedUnit |
Unit result, endpoint thermodynamic evidence, and an independent balance. |
BalanceBoundary |
Named process boundary with explicit heat and shaft work into the fluid. |
Functions:
| Name | Description |
|---|---|
audit_stream |
Verify a stream's preserved phase inventory, or resolve an unspecified PT state. |
audit_balance |
Check component and enthalpy flow closure at an explicit process boundary. |
heater_checked |
Run a heater, then verify both states and its component/energy balance. |
valve_checked |
Run an isenthalpic valve with independent endpoint and balance checks. |
audit_flowsheet |
Audit a solved flowsheet's streams and explicitly declared process boundaries. |
CheckedUnit
¶
Bases: NamedTuple
Unit result, endpoint thermodynamic evidence, and an independent balance.
Methods:
| Name | Description |
|---|---|
check |
Raise at a host boundary before a failed result is used downstream. |
to_dict |
Serialize acceptance evidence independently of the unit's output type. |
Attributes:
| Name | Type | Description |
|---|---|---|
accepted |
Array
|
Whether all endpoint states and the process boundary passed. |
BalanceBoundary
dataclass
¶
BalanceBoundary(
inputs: tuple[str, ...],
outputs: tuple[str, ...],
heat: float = 0.0,
work: float = 0.0,
)
Named process boundary with explicit heat and shaft work into the fluid.
audit_stream
¶
audit_stream(
stream: Stream,
model: PropertyPackage,
*,
policy: AcceptancePolicy = DEFAULT_POLICY,
) -> PhysicalReport
Verify a stream's preserved phase inventory, or resolve an unspecified PT state.
Empty streams have no meaningful equilibrium composition and are rejected by this physical audit. Their structural Stream.report remains available.
audit_balance
¶
audit_balance(
inputs: tuple[Stream, ...],
outputs: tuple[Stream, ...],
model: PropertyPackage,
*,
heat: Array | float = 0.0,
work: Array | float = 0.0,
component_generation: Array | None = None,
tolerance: float = 1e-07,
) -> SolveReport
Check component and enthalpy flow closure at an explicit process boundary.
Heat and shaft work are positive into the fluid (watts). Reactions must supply net component generation in mol/s and use a formation-consistent enthalpy package. All streams must share package component order.
heater_checked
¶
heater_checked(
feed: Stream,
*,
model: PropertyPackage,
policy: AcceptancePolicy = DEFAULT_POLICY,
**options: Any,
) -> CheckedUnit
Run a heater, then verify both states and its component/energy balance.
valve_checked
¶
valve_checked(
feed: Stream,
p_out: Array | float,
*,
model: PropertyPackage,
policy: AcceptancePolicy = DEFAULT_POLICY,
**options: Any,
) -> CheckedUnit
Run an isenthalpic valve with independent endpoint and balance checks.
audit_flowsheet
¶
audit_flowsheet(
result: Any,
model: PropertyPackage,
*,
boundaries: dict[str, BalanceBoundary],
policy: AcceptancePolicy = DEFAULT_POLICY,
) -> dict[str, Any]
Audit a solved flowsheet's streams and explicitly declared process boundaries.
Boundary heat/work must come from the solved unit specifications. A list of endpoints alone cannot establish energy conservation. Numerical failures are retained, and no missing boundary is advertised as checked.