Quasi-steady drivers¶
The low-Mach driver for aftertreatment networks (solver = "quasi_steady").
Acoustics are dropped: each macro step solves a steady flow field, then
advances the slow states (gas energy, species, soot, cake, catalyst and
wall temperatures, surface chemistry) over a step set by the heat-release
rate, the advective CFL and the boundary schedules. The contracts of every
function below are in their docstrings (the standard is
Function contracts and flow charts).
One run¶
What enters: the built pipes, junctions and far boundary conditions (each
far BC carries a qs_kind tag from its factory), t_end, and the
QSTransientConfig the case runner assembles from [case].
flowchart TD
IN["pipes, junctions, tagged far BCs, t_end, QSTransientConfig"] --> RJ{"_refuse_unsupported_junctions"}
RJ -- "cylinder, EHR junction, neck port" --> X1["ValueError naming the component"]
RJ --> RC{"refuse_condensation"}
RC -- "a pipe with [pipe.condensation]" --> X0["NotImplementedError naming this driver and the pipe"]
RC --> WL["_warn_if_qs_loop_without_loop_flow: warns on a looped network without loop-flow"]
WL --> ST{"_QSTransientRun.start"}
ST -- "real-gas or per-cell-gamma pipe (_qs_refuse_non_scalar_gas)" --> X2["NotImplementedError naming the pipe"]
ST -- "open pipe end, far BC without a QS tag (_resolve_pipes)" --> X3["NotImplementedError"]
ST --> T{"t < t_end?"}
T -- "no, or a live-control stop" --> OUT["final time; pipes, junction volumes, walls and coolant advanced in place"]
T -- "max_steps spent" --> X4["RuntimeError"]
T -- yes --> MS["_qs_macro_step: one macro step, the steps below"]
MS --> NET["advance_network_quasi_steady: steady flow at the current T and soot"]
NET --> DT{"_qs_macro_dt: min of HRR cap, dt_max, advective CFL, the substrate relaxation time (_qs_solid_dt); clamp to t_end and the next BC knot"}
DT -- "non-finite velocity, non-advancing step" --> X5["RuntimeError naming the pipe"]
DT --> CHEM{"_qs_chemistry_due: does the chemistry fire this step?"}
CHEM -- "every n-th step, last step, interval, or a settle gate open: chem" --> SLOW
CHEM -- "not yet" --> SLOW["_qs_advance_slow_states: ghosts, urea spray, then per pipe in flow order (_qs_flow_order)"]
SLOW --> FEED["_qs_refresh_feed: its junction re-set from its feeders as they now stand (_qs_set_plenum), ports refilled"]
FEED --> ADV["_qs_advance_pipe"]
ADV -- chem --> SURF["_qs_surface_chem_step over the accumulated dt, gas T frozen"]
SURF -- "coverage over-drawn outside [0, 1]" --> X6["RuntimeError naming the coverage"]
SURF --> NEXT{"another pipe?"}
ADV -- "no chem" --> NEXT
NEXT -- yes --> FEED
NEXT -- no --> HRR["lagged HRR cap for the next step; thermal couplings; return dt"]
HRR --> TT["t += dt, on_step"]
TT --> T
The macro step is a function of its own, _qs_macro_step, since 2026-10-20:
the multi-rate driver (Multi-rate circuits) steps a
quasi-steady circuit with it, one macro step at a time between its explicit
circuit's sub-steps. The loop around it (the step cap, the clock, live control,
on_step) stays with each caller.
The steady flow field¶
advance_network_quasi_steady couples one SIMPLE solve per pipe through the
junction pressures, then writes the result back.
flowchart TD
A["pipes, junctions, far BCs, t_now, cached pqs and Picard state"] --> R["_refresh_pipes: schedules, T, p0, cake drag, gamma, Sutherland mu"]
R --> ANC{"junctions but no far-pressure anchor?"}
ANC -- yes --> Y1["NotImplementedError: the plenum pressures float"]
ANC -- no --> S{"junction solver"}
S -- "no junction" --> E["_qs_evaluate: each pipe once"]
S -- "qs_junction_loop_flow" --> LF["_qs_solve_loop_flow -> loop_flow_core"]
S -- "qs_junction_coupled_newton" --> CN["_qs_solve_coupled_newton"]
S -- default --> SC["_qs_solve_secant"]
LF -- "distinct references, mass-flow outlet" --> Y2["NotImplementedError"]
LF -- "continuity inconsistent, junction unreachable, not converged" --> Y3["RuntimeError"]
CN -- "not converged in picard_max_iter" --> Y3
SC -- "not converged in picard_max_iter" --> Y3
E --> P["_solve_one_pipe"]
CN --> P
SC --> P
P -- "mass-flow inlet" --> M["solve_quasi_steady_single_pipe"]
P -- "pressure at both ends" --> PD["solve_quasi_steady_pressure_driven: root on mdot, zero flow when p_in <= p_out"]
P -- "mass-flow BC on a RIGHT end (_p_out_of)" --> Y4["ValueError"]
M -- "empty pipe, K_extra or A_face of the wrong length, negative end face" --> Y5["ValueError"]
LF --> WB{"_write_back"}
M --> WB
PD --> WB
WB -- "a pipe with a reverse steady flow" --> Y6["NotImplementedError naming the pipe"]
WB --> OUT["pipe U rebuilt at the frozen T, _qs_mdot_face published, junction volumes set to (p, mixed T) and a plenum to its feeders' species (_qs_set_plenum)"]
Two things this chart does not show, both recorded in the contracts: the
SIMPLE and root-finder converged flags are not read by _solve_one_pipe
(the junction solver's own convergence test is the only gate), and a
real-gas pipe reaches the flow solve only through a direct call, since the
transient driver refuses it first.
Functions¶
src/aeolus1d/solver/quasi_steady_network.py::advance_network_quasi_steady_transientsrc/aeolus1d/solver/quasi_steady_network.py::_refuse_unsupported_junctionssrc/aeolus1d/solver/solver_ops.py::refuse_condensationsrc/aeolus1d/solver/quasi_steady_network.py::_warn_if_qs_loop_without_loop_flowsrc/aeolus1d/solver/quasi_steady_network.py::_QSTransientRun.startsrc/aeolus1d/solver/quasi_steady_network.py::_qs_refuse_non_scalar_gassrc/aeolus1d/solver/quasi_steady_network.py::_resolve_pipessrc/aeolus1d/solver/quasi_steady_network.py::_qs_macro_stepsrc/aeolus1d/solver/quasi_steady_network.py::_qs_macro_dtsrc/aeolus1d/solver/quasi_steady_network.py::_qs_advance_slow_statessrc/aeolus1d/solver/quasi_steady_network.py::_qs_advance_pipesrc/aeolus1d/solver/quasi_steady_network.py::_qs_chemistry_duesrc/aeolus1d/solver/quasi_steady_network.py::_qs_solid_dtsrc/aeolus1d/solver/quasi_steady_network.py::_qs_record_solid_ratesrc/aeolus1d/solver/quasi_steady_network.py::_qs_flow_ordersrc/aeolus1d/solver/quasi_steady_network.py::_qs_refresh_feedsrc/aeolus1d/solver/quasi_steady_network.py::_qs_set_plenumsrc/aeolus1d/solver/quasi_steady_network.py::_qs_surface_chem_stepsrc/aeolus1d/solver/quasi_steady_network.py::advance_network_quasi_steadysrc/aeolus1d/solver/quasi_steady_network.py::_refresh_pipessrc/aeolus1d/solver/quasi_steady_network.py::_qs_evaluatesrc/aeolus1d/solver/quasi_steady_network.py::_qs_solve_loop_flowsrc/aeolus1d/solver/quasi_steady_network.py::_qs_solve_coupled_newtonsrc/aeolus1d/solver/quasi_steady_network.py::_qs_solve_secantsrc/aeolus1d/solver/quasi_steady_network.py::_solve_one_pipesrc/aeolus1d/solver/quasi_steady_network.py::_p_out_ofsrc/aeolus1d/solver/quasi_steady_network.py::_write_backsrc/aeolus1d/solver/loop_flow_steady.py::loop_flow_coresrc/aeolus1d/solver/quasi_steady.py::solve_quasi_steady_single_pipesrc/aeolus1d/solver/quasi_steady.py::solve_quasi_steady_pressure_driven