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_reactorexpands theThreeSegmentsReactornode into child segments, mixers, internal connections, and one shared ambient heat-sinkcgr_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 aport_mapsoexpand_composite_kindsrewrites them to the correct internal nodes before the solver sees the config.Single owning network.
ThreeSegmentsReactorNet(subclass ofct.ReactorNet) orchestrates the internal tube→mix→tube chain. The stage-levelnetwork_classis set on the groups config so_select_network_class_for_stageuses it at top precedence.Energy outlet. One shared
cgr_ambientheat-sink accumulates wall heat loss from all segments;scalars["heat_loss_kW"]is the total.Composite children are skipped by
_post_build_design_volumes(taggedcomposite_child: True) so the net’sadvance()orchestrates physics.
Classes#
Placeholder reactor for the CGR composite unit operation. |
|
Composite stage network for the CGR unit operation. |
Module Contents#
- class bloc.reactors.cgr_net.ThreeSegmentsReactor#
Bases:
cantera.ReactorPlaceholder reactor for the CGR composite unit operation.
This reactor is the logical outer node that holds the
_outletstream point and the aggregated outlet phase state. All physics are delegated toThreeSegmentsReactorNet; this object carries only bookkeeping metadata.It is not integrated directly by CVODE.
ThreeSegmentsReactorNetinitialises with an empty reactor list (super().__init__([])) and drives the child reactors explicitly.The
NETWORK_CLASSis intentionallyNonebecause the stage-levelnetwork_classfield in the group config takes precedence over per-reactorNETWORK_CLASSattributes.- NETWORK_CLASS = None#
- class bloc.reactors.cgr_net.ThreeSegmentsReactorNet(reactors, meta=None)#
Bases:
cantera.ReactorNetComposite stage network for the CGR unit operation.
Solves a tube → mix → tube → … chain by composing individual
PFRHomogeneousShellNet(FBS) andInstantaneousMixing.solve_premixedcalls. Aggregates spatial profiles, heat loss, and residence time across all segments.Implements the
boulder.stage_network.CustomStageNetworkprotocol so that Boulder’s trajectory collector storesstatesandscalarsrather than re-sampling the internal CSTR chain.- Parameters:
reactors – All Cantera reactor objects that Boulder built for this stage. This includes the placeholder
ThreeSegmentsReactorparent, allRefractoryReactorsegments, and allInstantaneousMixingReactormixers.meta (
dict, optional) – Composite metadata stored on the stage by the unfolder; keys includecgr_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_steadyentry 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):
Read the main inlet state from the first segment’s
_inlet_reservoir(bound at post-build time).FBS-solve segment 1.
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).
HP-mix segment i outlet with injection feed.
FBS-solve segment i+1 from the mixed state.
Write the last segment outlet to the CGR placeholder reactor’s phase so the stream-point reservoir sees the correct outlet.
Collect aggregated
states(concatenated T(x) with offset x) andscalars(summed heat loss, total L, total t_res).
segmentsandmixersordering are read from the placeholderThreeSegmentsReactorreactor’s_metadict, 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.