bloc.spring_kpi#
SPRING engineering KPI extraction from solved STONE simulations.
Bridges the STONE/Boulder reactor network to the SPRING Calculation Note
output keys, mirroring the res_dic produced by the legacy
simulation_non_isothermal_reactors.py. This module is coupled by design to
the SPRING YAML node conventions and to the design reactor classes; the generic,
node-name-agnostic primitives (volumetric flows, quench solve, secondary-source
lookup) live in bloc.calc_note_kpi.
Public entry points#
compute_spring_kpis()– full SPRING KPI dict (pass askpi_fntobloc.calc_note.generate_calculation_note_stone()).compute_spring_quench_nodes()– synthetic quench/post-quench calc-note nodes derived purely in post-processing.
Functions#
Return post-processing node specs for quench_gas and post_quench. |
|
|
Compute SPRING engineering KPIs from a solved STONE Simulation. |
Module Contents#
- bloc.spring_kpi.compute_spring_quench_nodes(sim)#
Return post-processing node specs for quench_gas and post_quench.
These nodes are not part of the Cantera network; they are derived from the adiabatic quench mix computed in
bloc.calc_note_kpi.compute_quench_kpis()and injected into calc-note CSVs bybloc.calc_note._extract_node_data().- Returns:
Each dict has
name,thermo(Solution),mass_flow_kg_s, andflow_role("source"for the quench feed,"sink"for the terminal post-quench product).- Return type:
list[dict]
- bloc.spring_kpi.compute_spring_kpis(sim)#
Compute SPRING engineering KPIs from a solved STONE Simulation.
This function bridges the STONE/Boulder path to produce the same outputs as
simulation_non_isothermal_reactors.py(res_dic), so that bothrun_scenarios.pyandrun_yaml_scenarios.pygenerate the same Calculation Note Excel.Reactors are located by walking
sim.config['nodes'](the STONE declaration) and pulling the first node of each expected type by id, then resolving it viasim.network.reactors(matched on.name). This is deterministic even when multiple reactors of the same Python class are present, unlike isinstance-based ordering. Input parameters are read fromsim.config(nodes+connections).- Parameters:
sim (
bloc.simulation_builder.Simulation) – Solved STONE simulation returned bybloc.simulation_builder.build_simulation_from_yaml().- Returns:
KPI dict with the same keys as the
res_dicproduced bysimulation_non_isothermal_reactors.py. Unavailable values are omitted. Pass askpi_fntobloc.calc_note.generate_calculation_note_stone().- Return type:
dict
Notes
KPIs that depend on SPRING-specific YAML structure (e.g. node naming conventions, insulation parameters) are resolved by reactor type rather than by hard-coded node ID, making this function portable across STONE YAML variants that use the PlasmaTorchInstantaneousHeating/ContinuousMixingReactor/RefractoryReactor components.