bloc.reactors.stirred#
Perfectly stirred reactor (PSR) engine.
Classes#
Perfectly Stirred Reactor (PSR) engine — well-mixed, constant-pressure. |
|
IdealGasReactor with additional features for carbon quality calculations. |
|
IdealGasConstPressureReactor with additional features for carbon quality calculations. |
|
IdealGasMoleReactor with additional features for carbon quality calculations. |
Functions#
|
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.ExtensibleIdealGasConstPressureMoleReactorPerfectly 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 stageReactorNet.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; useadvance_to_steady_stateon the stage.Not intended for#
Plug-flow (axial gradients): use
PFRor 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 asContinuousMixingReactoradd industrial defaults and KPI helpers on top of this numerical base.- before_update_state(y)#
Inject a pending initial state into CVODE’s
ybefore the first eval.Cantera’s
Reactor::initialize()restoresm_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 callsupdateState(y)just before its firsteval, andyis writable.If
_pending_initis set, this method overwritesywith values derived from the HP-corrected gas state and clears the flag. All subsequentupdateStatecalls (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
PSRor a subclass — e.g. the SPRINGContinuousMixingReactor(TMR) andInstantaneousMixingReactorkinds. Resolved via Boulder’s schema registry (reactor_classpassed toregister_reactor_builder), the same mechanismis_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.ExtensibleIdealGasReactorIdealGasReactor with additional features for carbon quality calculations.
This class extends the
cantera.IdealGasReactorclass 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 isKirkOthmer2004SurfaceArea.
Examples
- class bloc.reactors.stirred.CarbonBlackIdealGasConstPressureReactor(*args, **kwargs)#
Bases:
cantera.ExtensibleIdealGasConstPressureReactorIdealGasConstPressureReactor with additional features for carbon quality calculations.
This class extends the
cantera.IdealGasReactorclass 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 isKirkOthmer2004SurfaceArea.
Examples
- class bloc.reactors.stirred.CarbonBlackIdealGasMoleReactor(*args, **kwargs)#
Bases:
cantera.ExtensibleIdealGasMoleReactorIdealGasMoleReactor with additional features for carbon quality calculations.
This class extends the
cantera.IdealGasMoleReactorclass 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 isKirkOthmer2004SurfaceArea.
Examples