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

Functions

 _ns (**kw)
 _discharge (c)
 _feed_fittings_K (c)
 _feed (c)
 _cav (config)
 _fluid (f)
 _comb (eff)
 _cooling (cfg)
 _geom (cg)
 _pintle (geom)
 _imp (b)
 _net (config, side)
 build_state (config)

Variables

dict _PHI = {"none": 0, "sqrtP": 1, "logP": 2}
dict _INJ = {"pintle": 0, "impinging": 1, "coaxial": 2}
dict _EFF_MODEL = {"constant": 0, "linear": 1, "exponential": 2}
 _PIN_ZERO
 _NET_ZERO

Detailed Description

Config -> flat scalar state, in pure Python (no C dependency).

WHY THIS EXISTS
    The Numba kernels used to read their inputs out of the C `EdEngineState`
    struct (numba_eval.extract_params called native_injector.build_state), so
    Numba could not run without the C library loaded. That made the C port
    impossible to delete. This module reproduces that reconciliation with no
    ctypes involved.

WHY IT IS A TRANSCRIPTION, NOT A REWRITE
    `native_injector.build_state` encodes decisions that are NOT recoverable by
    reading the config schema -- see the inline notes on smd_model and
    we_corr_max below. Re-deriving "what the config means" from the YAML would
    silently produce different numbers on some configs. So each field here is a
    line-for-line transcription of the corresponding `_fill_*` helper, and
    tests/test_accel_params_match_native_state.py asserts exact equality against
    the real EdEngineState for every committed config while the C port still
    exists to compare against.

The returned object mirrors EdEngineState's attribute paths exactly
(`st.fluid_O.density`, `st.injector.imp_O.d_jet`, ...) so the existing
param-vector mapping reads from either interchangeably.

Function Documentation

◆ _cav()

engine.accel.params._cav ( config)
protected
Vena-contracta Cc per stream for the Nurick cavitation limit (discharge.contraction_coefficient).

Definition at line 95 of file params.py.

References _ns().

Referenced by build_state().

◆ _comb()

engine.accel.params._comb ( eff)
protected
Mirrors native_injector._fill_comb.

Definition at line 123 of file params.py.

References _ns().

Referenced by build_state().

◆ _cooling()

engine.accel.params._cooling ( cfg)
protected
Mirrors native_injector._fill_cooling.

The C struct is zero-initialised, so fields guarded by `if rg is not None` /
`if ab is not None` stay 0.0 when that config block is absent. The defaults
below reproduce that -- do not "improve" them into schema defaults.

Definition at line 144 of file params.py.

References _ns().

Referenced by build_state().

◆ _discharge()

engine.accel.params._discharge ( c)
protected
Mirrors native_injector._fill_discharge.

When the config declares an orifice INLET geometry, resolve it here and hand the kernel
the finished Cd_inf with the diameter scaling switched OFF. The kernel has no notion of
inlet treatment, so passing the raw Cd_inf would leave it on the old diameter path while
Python used the inlet value -- a fresh Python/kernel divergence of exactly the kind that
the x_star evaporation split already cost this codebase 9.7% of thrust.

Definition at line 42 of file params.py.

References _ns().

Referenced by build_state().

◆ _feed()

engine.accel.params._feed ( c)
protected
Mirrors native_injector._fill_feed.

Definition at line 79 of file params.py.

References _feed_fittings_K(), and _ns().

Referenced by build_state().

◆ _feed_fittings_K()

engine.accel.params._feed_fittings_K ( c)
protected

Definition at line 74 of file params.py.

Referenced by _feed().

◆ _fluid()

engine.accel.params._fluid ( f)
protected
Mirrors native_injector._fill_fluid.

Note the `or` defaults: a missing OR zero temperature becomes 0.0, and a
missing OR zero latent_heat becomes 300e3. Falsy checks, not `is None`.

Definition at line 103 of file params.py.

References _ns().

Referenced by build_state().

◆ _geom()

engine.accel.params._geom ( cg)
protected
Mirrors native_injector._fill_geom. `cg` must come from ensure_chamber_geometry.

Definition at line 209 of file params.py.

References _ns().

Referenced by build_state().

◆ _imp()

engine.accel.params._imp ( b)
protected
Mirrors native_injector._fill_imp.

Definition at line 247 of file params.py.

References _ns().

Referenced by build_state().

◆ _net()

engine.accel.params._net ( config,
side )
protected
The stream's back-channel ring (impinging._RingManifold), read off the very object the
Python injector builds, so the kernel marches the same branch; zeros for a plenum.

Definition at line 260 of file params.py.

References _ns().

Referenced by build_state().

◆ _ns()

engine.accel.params._ns ( ** kw)
protected

Definition at line 38 of file params.py.

Referenced by _cav(), _comb(), _cooling(), _discharge(), _feed(), _fluid(), _geom(), _imp(), _net(), _pintle(), and build_state().

◆ _pintle()

engine.accel.params._pintle ( geom)
protected
Pintle geometry, flattened.

The area/hydraulic-diameter maths lives in engine.core.geometry and is called
HERE, at the boundary, so the kernel sees scalars and the two implementations
cannot drift on geometry.

Definition at line 226 of file params.py.

References _ns().

Referenced by build_state().

◆ build_state()

engine.accel.params.build_state ( config)
Pure-Python equivalent of native_injector.build_state.

Returns a namespace with EdEngineState's attribute paths. Raises the same way
build_state does on a config it cannot map (e.g. a pintle config, whose
injector geometry has no .oxidizer/.fuel impinging branches).

Definition at line 276 of file params.py.

References _cav(), _comb(), _cooling(), _discharge(), _feed(), _fluid(), _geom(), _imp(), _net(), _ns(), _pintle(), and build_state().

Referenced by build_state().

Variable Documentation

◆ _EFF_MODEL

dict engine.accel.params._EFF_MODEL = {"constant": 0, "linear": 1, "exponential": 2}
protected

Definition at line 35 of file params.py.

◆ _INJ

dict engine.accel.params._INJ = {"pintle": 0, "impinging": 1, "coaxial": 2}
protected

Definition at line 34 of file params.py.

◆ _NET_ZERO

engine.accel.params._NET_ZERO
protected
Initial value:
1= _ns(enabled=0, n_ports=0, h=0, A_ch=0.0, D_h=0.0, s=0.0, eps=0.0, scale=0.0,
2 A_hole=0.0, d_hole=0.0, K_ent=0.0, C_R=0.0)

Definition at line 256 of file params.py.

◆ _PHI

dict engine.accel.params._PHI = {"none": 0, "sqrtP": 1, "logP": 2}
protected

Definition at line 33 of file params.py.

◆ _PIN_ZERO

engine.accel.params._PIN_ZERO
protected
Initial value:
1= _ns(A_O=0.0, A_F=0.0, d_hyd_O=0.0, d_hyd_F=0.0, d_orifice=0.0, h_gap=0.0,
2 d_pintle_tip=0.0)

Definition at line 243 of file params.py.