bloc.reactors.stirred#

Perfectly stirred reactor (PSR) engine.

Classes#

PSR

Perfectly Stirred Reactor (PSR) engine — well-mixed, constant-pressure.

CarbonBlackIdealGasReactor

IdealGasReactor with additional features for carbon quality calculations.

CarbonBlackIdealGasConstPressureReactor

IdealGasConstPressureReactor with additional features for carbon quality calculations.

CarbonBlackIdealGasMoleReactor

IdealGasMoleReactor with additional features for carbon quality calculations.

Functions#

is_psr_mixing_kind(kind)

Return True when kind is a registered STONE kind for any PSR-family mixer.

Module Contents#

class bloc.reactors.stirred.PSR(gas, *args, **kwargs)#

Bases: cantera.ExtensibleIdealGasConstPressureMoleReactor

Perfectly Stirred Reactor (PSR) engine — well-mixed, constant-pressure.

Physics#

The gas is assumed spatially uniform at every instant. The governing equations are the standard constant-pressure mole-balance ODEs:

\[\frac{dn_i}{dt} = V \dot{\omega}_i\]

where \(n_i\) is moles of species i, \(V\) is the reactor volume, and \(\dot{\omega}_i\) is the net molar production rate [mol/(m³·s)]. Energy is either solved (energy='on', the default) or held fixed (energy='off').

Use cases#

  • Torch Mixing Reactor (TMR): turbulent mixing of two streams at nearly constant residence time.

  • Any well-mixed stage where spatial gradients are negligible.

Network topology#

Stage YAML (SPRING ``ContinuousMixingReactor``): OPEN — inlet MassFlowController``(s), outlet ``PressureController / MassFlowController; continuous feed and discharge in the stage ReactorNet.

Inner physics: OPEN — CVODE integrates the stirred tank with inlet/outlet mass exchange. Volume is sized from t_res_s (\(V = \\tau \\dot m / \\rho\)) by Boulder at build time; use advance_to_steady_state on the stage.

Not intended for#

  • Plug-flow (axial gradients): use PFR or a subclass.

Why not ct.IdealGasConstPressureMoleReactor?#

This class inherits from the extensible variant so that subclasses can intercept Cantera’s ODE callbacks (before_update_state, after_eval, etc.) without modifying C++ code. Concrete subclasses such as ContinuousMixingReactor add industrial defaults and KPI helpers on top of this numerical base.

before_update_state(y)#

Inject a pending initial state into CVODE’s y before the first eval.

Cantera’s Reactor::initialize() restores m_state (the state snapshot taken at construction time) via a direct C++ call that bypasses all Python delegates. The only reliable interception point is here: CVODE calls updateState(y) just before its first eval, and y is writable.

If _pending_init is set, this method overwrites y with values derived from the HP-corrected gas state and clears the flag. All subsequent updateState calls (driven by CVODE’s own stepping) are unaffected.

bloc.reactors.stirred.is_psr_mixing_kind(kind)#

Return True when kind is a registered STONE kind for any PSR-family mixer.

“Any PSR-family mixer” means PSR or a subclass — e.g. the SPRING ContinuousMixingReactor (TMR) and InstantaneousMixingReactor kinds. Resolved via Boulder’s schema registry (reactor_class passed to register_reactor_builder), the same mechanism is_torch_reactor_kind() uses — so a new well-mixed-reactor subclass is recognized automatically; no hardcoded kind-name or node-id list to maintain.

class bloc.reactors.stirred.CarbonBlackIdealGasReactor(*args, **kwargs)#

Bases: cantera.ExtensibleIdealGasReactor

IdealGasReactor with additional features for carbon quality calculations.

This class extends the cantera.IdealGasReactor class to include additional features for carbon quality calculations. The class is intended to be used in Reactor Networks.

Examples

residence_time#

Residence time in (s). Residence time must be set by the user during simulation.

after_initialize(t0)#
guess_specific_surface(Model=KirkOthmer2004SurfaceArea)#

Evaluate the specific surface of the carbon based on temperature and residence time.

Note

The residence time must be calculated before calling this method; for instance with:

reactor.residence_time = reactor.volume / volumetric_flow_rate

Or:

for t in logspace(0.001, 1, 50):  # s
    sim.advance(t)
    reactor.residence_time = t
Parameters:

Model (class) – Surface area model to use. Default is KirkOthmer2004SurfaceArea.

Examples

class bloc.reactors.stirred.CarbonBlackIdealGasConstPressureReactor(*args, **kwargs)#

Bases: cantera.ExtensibleIdealGasConstPressureReactor

IdealGasConstPressureReactor with additional features for carbon quality calculations.

This class extends the cantera.IdealGasReactor class to include additional features for carbon quality calculations. The class is intended to be used in Reactor Networks.

Examples

Carbon Black Reactor.

Carbon Black Reactor.
residence_time#

Residence time in (s). Residence time must be set by the user during simulation.

after_initialize(t0)#
guess_specific_surface(Model=KirkOthmer2004SurfaceArea)#

Evaluate the specific surface of the carbon based on temperature and residence time.

Note

The residence time must be calculated before calling this method; for instance with:

reactor.residence_time = reactor.volume / flow_rate

Or:

for t in logspace(0.001, 1, 50):  # s
    sim.advance(t)
    reactor.residence_time = t
Parameters:

Model (class) – Surface area model to use. Default is KirkOthmer2004SurfaceArea.

Examples

Carbon Black Reactor.

Carbon Black Reactor.
class bloc.reactors.stirred.CarbonBlackIdealGasMoleReactor(*args, **kwargs)#

Bases: cantera.ExtensibleIdealGasMoleReactor

IdealGasMoleReactor with additional features for carbon quality calculations.

This class extends the cantera.IdealGasMoleReactor class to include additional features for carbon quality calculations. The class is intended to be used in Reactor Networks.

Examples

residence_time#

Residence time in (s). Residence time must be set by the user during simulation.

after_initialize(t0)#
guess_specific_surface(Model=KirkOthmer2004SurfaceArea)#

Evaluate the specific surface of the carbon based on temperature and residence time.

Note

The residence time must be calculated before calling this method; for instance with:

reactor.residence_time = reactor.volume / flow_rate

Or:

for t in logspace(0.001, 1, 50):  # s
    sim.advance(t)
    reactor.residence_time = t
Parameters:

Model (class) – Surface area model to use. Default is KirkOthmer2004SurfaceArea.

Examples