bloc.calc_note_kpi#
Calculation-Note KPI helpers for design reactor reporting.
These functions operate on physical quantities (mass flows, gas states, STONE
config dicts) and produce values suitable for the Calculation Note Excel or
for Simulation.scalars. They contain no solver logic and carry no
coupling to specific YAML node names.
All functions are pure (no side-effects on Cantera phases) or explicitly document mutation.
Functions#
|
Return actual volumetric flow [m³/h] at current gas conditions. |
|
Return normal volumetric flow [Nm³/h] at 0 °C, 101 325 Pa (DIN 1343). |
|
Return the STONE node config for the secondary injection reservoir. |
|
Compute quench and post-quench volumetric flows from an adiabatic mix. |
Module Contents#
- bloc.calc_note_kpi.actual_flow_m3h(mdot_kg_s, rho_kg_m3)#
Return actual volumetric flow [m³/h] at current gas conditions.
- Parameters:
mdot_kg_s – Mass flow rate [kg/s].
rho_kg_m3 – Gas density at actual (T, P) [kg/m³].
- bloc.calc_note_kpi.normal_flow_m3h(mdot_kg_s, gas)#
Return normal volumetric flow [Nm³/h] at 0 °C, 101 325 Pa (DIN 1343).
Uses
bloc.ctutils.get_DIN1343_properties()to evaluate density at normal conditions without mutating gas.- Parameters:
mdot_kg_s – Mass flow rate [kg/s].
gas – Cantera Solution carrying the gas composition. Only the species composition is used; (T, P) are overridden internally.
- bloc.calc_note_kpi.find_secondary_source(cfg, target_node_id, excluded_source_ids)#
Return the STONE node config for the secondary injection reservoir.
Walks STONE
connectionsto find anyMassFlowControllerthat feeds target_node_id from a source not in excluded_source_ids, then returns the matching node dict fromnodes.- Parameters:
cfg – Parsed STONE YAML dict (top-level, containing
connectionsandnodes).target_node_id – Node id of the reactor receiving secondary injection (e.g. the PSR).
excluded_source_ids – Set of node ids to exclude (e.g. the torch ids).
- Returns:
STONE node dict for the first matching secondary source, or
Noneif none is found.- Return type:
dictorNone
- bloc.calc_note_kpi.compute_quench_kpis(gas_hot, mdot_hot_kg_s, X_quench, T_cold_C, T_target_C, mech)#
Compute quench and post-quench volumetric flows from an adiabatic mix.
Calls
bloc.design_optim.find_quench_flow()to determine the quench mass flow needed to reach T_target_C, then evaluates actual and normal volumetric flows for the quench stream and the mixed post-quench stream.- Parameters:
gas_hot – Cantera Solution at the pre-quench state (T_out, P, Y of hot gas). Not mutated.
mdot_hot_kg_s – Hot-gas mass flow rate [kg/s].
X_quench – Mole-fraction array or dict for the quench gas composition.
T_cold_C – Quench gas temperature [°C].
T_target_C – Target post-quench temperature [°C].
mech – Cantera mechanism file path (used to create temporary gas objects).
- Returns:
Keys:
"qm_quench_kg_s","Q_quench_m3h","Q_quench_N_m3h","Q_post_quench_m3h","Q_post_quench_N_m3h". Values areNonewhen the quench calculation cannot be performed.- Return type:
dict