STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
engine.core.closure Namespace Reference

Functions

Optional[Tuple[float, float, Dict[str, Any]]] _try_native_flows (float P_tank_O, float P_tank_F, float Pc, PintleEngineConfig config)
Tuple[float, float, Dict[str, Any]] flows (float P_tank_O, float P_tank_F, float Pc, PintleEngineConfig config)

Detailed Description

Closure logic: solve branch flows with spray constraints.

The impinging branch routes through the accelerator (engine/accel) when enabled
(the default). The Python injector models below run for everything it doesn't
cover — pintle, coaxial, a missing numba, or ``ED_ACCEL=off``. Dispatch is pure
capability routing: ``accel.solve`` returns ``None`` for any config it can't
handle and the Python model runs.

This native fast-path matters for performance even with the Layer-1 single-call
``ed_evaluate`` seam: ~30% of CMA candidates don't converge in the single-call native
path and fall back to ``runner.evaluate`` → ``chamber_solver`` → here, whose Brent
residual solves the injector many times. Keeping that native keeps the fallback fast.

Accelerator↔Python parity is enforced by tests/test_numba_ab_parity.py, which
diffs both live on the same inputs — there is no runtime self-check.

Function Documentation

◆ _try_native_flows()

Optional[Tuple[float, float, Dict[str, Any]]] engine.core.closure._try_native_flows ( float P_tank_O,
float P_tank_F,
float Pc,
PintleEngineConfig config )
protected
Accelerated (mdot_O, mdot_F, diagnostics), or None if the accelerator is
disabled or can't handle this config (caller falls back to the Python model).

Parity is enforced by the A/B suite, not a runtime self-check (capability
dispatch). Strict mode (``ED_REQUIRE_ACCEL=1``, the CI
parity job) makes a *genuine* accelerator failure raise instead of silently
falling back to Python, which would report a false green. A config the kernel
simply doesn't handle (``solve`` returns None) still falls back quietly.

Definition at line 33 of file closure.py.

Referenced by flows().

◆ flows()

Tuple[float, float, Dict[str, Any]] engine.core.closure.flows ( float P_tank_O,
float P_tank_F,
float Pc,
PintleEngineConfig config )
Solve injector branch flows: returns (mdot_O, mdot_F, diagnostics).

Definition at line 56 of file closure.py.

References _try_native_flows().