bloc.reactors.cgr_net#

Carbon Growth Reactor (CGR) composite reactor kind.

The ThreeSegmentsReactor is an ASPEN/DWSIM-style unit operation that composes multiple RefractoryReactor tube segments and InstantaneousMixingReactor injection tees inside a single staged-solver stage (one Cytoscape box).

Architecture#

  • One stage, many children. The unfolder _unfold_carbon_growth_reactor expands the ThreeSegmentsReactor node into child segments, mixers, internal connections, and one shared ambient heat-sink cgr_ambient, all assigned to the same stage/group.

  • Port-based wiring. External material inlet connections reference the CGR node via a port: field (main, inj_1, inj_2). The unfolder returns a port_map so expand_composite_kinds rewrites them to the correct internal nodes before the solver sees the config.

  • Single owning network. ThreeSegmentsReactorNet (subclass of ct.ReactorNet) orchestrates the internal tube→mix→tube chain. The stage-level network_class is set on the groups config so _select_network_class_for_stage uses it at top precedence.

  • Energy outlet. One shared cgr_ambient heat-sink accumulates wall heat loss from all segments; scalars["heat_loss_kW"] is the total.

  • Composite children are skipped by _post_build_design_volumes (tagged composite_child: True) so the net’s advance() orchestrates physics.

Classes#

ThreeSegmentsReactor

Placeholder reactor for the CGR composite unit operation.

ThreeSegmentsReactorNet

Composite stage network for the CGR unit operation.

Module Contents#

class bloc.reactors.cgr_net.ThreeSegmentsReactor#

Bases: cantera.Reactor

Placeholder reactor for the CGR composite unit operation.

This reactor is the logical outer node that holds the _outlet stream point and the aggregated outlet phase state. All physics are delegated to ThreeSegmentsReactorNet; this object carries only bookkeeping metadata.

It is not integrated directly by CVODE. ThreeSegmentsReactorNet initialises with an empty reactor list (super().__init__([])) and drives the child reactors explicitly.

The NETWORK_CLASS is intentionally None because the stage-level network_class field in the group config takes precedence over per-reactor NETWORK_CLASS attributes.

NETWORK_CLASS = None#
class bloc.reactors.cgr_net.ThreeSegmentsReactorNet(reactors, meta=None)#

Bases: cantera.ReactorNet

Composite stage network for the CGR unit operation.

Solves a tube → mix → tube → … chain by composing individual PFRHomogeneousShellNet (FBS) and InstantaneousMixing.solve_premixed calls. Aggregates spatial profiles, heat loss, and residence time across all segments.

Implements the boulder.stage_network.CustomStageNetwork protocol so that Boulder’s trajectory collector stores states and scalars rather than re-sampling the internal CSTR chain.

Parameters:
  • reactors – All Cantera reactor objects that Boulder built for this stage. This includes the placeholder ThreeSegmentsReactor parent, all RefractoryReactor segments, and all InstantaneousMixingReactor mixers.

  • meta (dict, optional) – Composite metadata stored on the stage by the unfolder; keys include cgr_id, segments (ordered list of segment ids), mixers (list of {segment_idx, mixer_id} entries), ambient_id.

advance_to_steady_state()#

Advance to the outlet state (one nominal advance).

solve_steady()#

Boulder solve_steady entry point — delegates to advance.

advance(time)#

Solve the tube→mix→tube chain and write aggregated results.

Sequence for N segments and M injection points (M = N - 1):

  1. Read the main inlet state from the first segment’s _inlet_reservoir (bound at post-build time).

  2. FBS-solve segment 1.

  3. For each injection point i (after segment i): a. Read injection feed mdot and gas state from the injection

    MFC + reservoir (bound at post-build time on the mixer).

    1. HP-mix segment i outlet with injection feed.

    2. FBS-solve segment i+1 from the mixed state.

  4. Write the last segment outlet to the CGR placeholder reactor’s phase so the stream-point reservoir sees the correct outlet.

  5. Collect aggregated states (concatenated T(x) with offset x) and scalars (summed heat loss, total L, total t_res).

segments and mixers ordering are read from the placeholder ThreeSegmentsReactor reactor’s _meta dict, populated at post-build time by _post_build_cgr_net.

property states: cantera.SolutionArray | None#

Concatenated spatial profile across all segments, built on demand.

property scalars: Dict[str, Any]#

Aggregated scalar outputs for KPI extraction and Boulder trajectory.