bloc.reactors.base#
Design-oriented constant-pressure mole reactor base class.
Classes#
Design-oriented constant-pressure mole reactor with helper APIs. |
Module Contents#
- class bloc.reactors.base.DesignIdealGasConstPressureMoleReactor(gas, *args, **kwargs)#
Bases:
cantera.ExtensibleIdealGasConstPressureMoleReactorDesign-oriented constant-pressure mole reactor with helper APIs.
Inherits from
ExtensibleIdealGasConstPressureMoleReactorso that subclasses can intercept Cantera’s ODE callbacks without modifying C++ code.The key hook used here is
before_update_state(): CVODE callsupdateState(y)before its very firsteval, at which pointyis still writable. By storing a pending initial condition in_pending_initand writing it intoyon the first call, any subclass can override CVODE’s starting point — even thoughm_state(the C++ snapshot taken at construction) cannot be changed from Python.- Parameters:
gas – Cantera
Solutionobject used to initialise the reactor.
- before_update_state(y)#
Inject a pending initial state into CVODE’s y before 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.
- solve_adiabatic(mdot, power_kW, t_res_s, verbose=False)#
Solve an adiabatic constant-pressure reactor segment.
Uses this reactor as the ODE owner: applies an enthalpy jump from
power_kW / mdotand integrates with a freshtype(self)(gas, clone=False)carrier fort_res_s.
- switch_mechanism(gas, mechanism_path, htol, Xtol)#
Switch the active mechanism while conserving chemical enthalpy.
See
switch_mechanism()for details.
- external_coeffs(D_ext, L_reac, eps_wall, T_wall_hyp_C, T_amb_C)#
Return convective and radiative heat transfer coefficients at the wall.
- heat_losses_linear(T_mean_C, T_amb_C, R_list)#
Compute linearized heat losses across a thermal resistance stack.
- thermal_resistance(d_reac, L_reac, e_insul_list, cond_list, h_tot, S_ext)#
Build a radial-conduction plus external heat transfer resistance list.
- mass_and_power(qm_torch, T_torch_input_C, X_torch, qm_2nd_inj, T_2nd_inj_C, X_2nd_inj, P_bar, T_amb_C, gas)#
Compute preheat recovery and residual heat based on reactor states.
- mass_reactor(L_reac, d_reac, e_insul_list, density_list, verbose=False)#
Estimate reactor mass and volume from geometry and insulation layers.