|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Classes | |
| class | EngineSampler |
| class | _ExpansionScaling |
Functions | |
| Any | line_exit_config (Any config) |
| _rbf (np.ndarray points, np.ndarray values) | |
| _table (fn, np.ndarray x_axis, np.ndarray y_axis, Callable[[np.ndarray], np.ndarray] transform) | |
| Tuple[Tuple[float, float],...] | _hull (np.ndarray points) |
| np.ndarray | _axis (np.ndarray values, int n) |
| fit_card (Sequence[Dict[str, float]] samples, *, float throat_area, float exit_area, float ambient_pa, str name) | |
| Optional[Dict[str, float]] | solve_card (Any card, float p_O, float p_F, float ambient_pa) |
| Dict[str, float] | check_card (Any card, Sequence[Dict[str, float]] points, float ambient_pa) |
| List[Dict[str, float]] | _scan (EngineSampler sampler, float center_pa, Tuple[float, float, int] levels, Tuple[float, float, int] ratios) |
| List[Dict[str, float]] | _random (EngineSampler sampler, float center_pa, int n, Tuple[float, float] levels, Tuple[float, float] ratios, int seed) |
| Any | build_card (Any config, *, float center_pa, float ambient_pa, int holdout=40, int seed=7) |
| type | expansion_chamber_class () |
| Any | __getattr__ (str name) |
| Any | expansion_chamber (Any card, Any cea_cache, *, float ambient_pressure, float volume=0.0) |
| Any | card_for (Any config, *, float center_pa, float ambient_pa) |
| Dict[str, Any] | card_for_config_text (str text, *, Optional[float] center_psia=None) |
Variables | |
| float | PSI = 6894.757293168361 |
| float | TOLERANCE = 2.0e-3 |
| tuple | LEVELS = (0.40, 1.30, 21) |
| tuple | RATIOS = (0.75, 1.30, 13) |
| tuple | ENVELOPE_LEVELS = (0.70, 1.15) |
| tuple | ENVELOPE_RATIOS = (0.90, 1.12) |
| tuple | CHAMBER_GRID = (41, 41) |
| tuple | INJECTOR_GRID = (41, 21) |
| tuple | BOUNDARY |
| str | _CACHE = OrderedDict() |
| _CACHE_LOCK = threading.Lock() | |
| int | _CACHE_SIZE = 8 |
EngineDesign's engine as an engine card for the feed twin (Layer X, phase 2). A card (:mod:`feedtwin.engine.card`) is this engine downstream of its feed lines, tabulated so the twin can run it at every coupling step of a burn. This module builds one by sampling EngineDesign and fitting the tables, and measures how wrong the card is before anything uses it. The boundary: the line exit --------------------------- The twin's lines end at the injector face node, at line-end pressure in the lumped K-factor convention. EngineDesign's ``feed_system`` is a tank-to-manifold model: ``K_eff`` along the line, plus a Borda dump of the exit bore's velocity head into the manifold. The card samples a copy of the config with every line loss zeroed (``K0``, ``K1``, fittings, friction) and the exit dump kept. Its "tank" pressure is then exactly the line-exit pressure, and the card owns everything downstream: * the dump; * the ring manifold; * the plate passages and their Cd; * the spray, mixing and heat-loss efficiency; * the stagnation loss; * the nozzle. The drawing owns the lines. On the 6.8 kN engine the dump alone is ~26 psi on the LOX side, which is why it cannot be left on neither side or put on both. Sampling and fitting -------------------- EngineDesign is solved on a grid of line-exit pressures around the T-0 point. Each solve is ~5-20 ms on the numba chamber kernel, which has 1e-9 parity with the Python solve. The fitted quantities are each nearly constant over the burn, which is why they tabulate well: * injector flow capacity ``mdot/sqrt(dp)`` over ``(mdot, p_inlet)``; * ``c*_eff = Pc A_t/mdot`` over ``(O/F, mdot)``; * the vacuum exhaust velocity ``(F + p_a A_e)/mdot`` over ``(O/F, mdot)``. EngineDesign's thrust is exactly linear in ambient pressure for a full-flowing nozzle, so a card built at one ambient serves any. The fit is thin-plate RBF through the samples, resampled onto uniform grids, which the twin evaluates with Catmull-Rom. Limit, measured: EngineDesign's efficiency has slope kinks at its CEA table's O/F nodes (its own trilinear lookup). No smooth table reproduces those, which sets a floor of a few hundredths of a percent in chamber pressure. The card reports its measured error, and a card whose error on held-out solves exceeds :data:`TOLERANCE` is flagged, not used quietly.
| Any engine.layerx.card.__getattr__ | ( | str | name | ) |
Definition at line 488 of file card.py.
References expansion_chamber_class().
|
protected |
Definition at line 184 of file card.py.
Referenced by fit_card().
|
protected |
Definition at line 177 of file card.py.
Referenced by fit_card().
|
protected |
Definition at line 306 of file card.py.
Referenced by build_card().
|
protected |
Thin-plate RBF through ``values`` at ``points`` (columns normalised), as a callable.
Definition at line 156 of file card.py.
Referenced by fit_card().
|
protected |
Definition at line 294 of file card.py.
Referenced by build_card().
|
protected |
Definition at line 166 of file card.py.
Referenced by fit_card().
| Any engine.layerx.card.build_card | ( | Any | config, |
| * | , | ||
| float | center_pa, | ||
| float | ambient_pa, | ||
| int | holdout = 40, | ||
| int | seed = 7 ) |
Sample, fit, check. Returns an :class:`~feedtwin.engine.card.EngineCard` whose ``fit`` holds its measured errors (``envelope_*`` inside the operating envelope, ``box_*`` over the whole scan) and whose ``provenance`` says how it was made.
Definition at line 321 of file card.py.
References _random(), _scan(), check_card(), fit_card(), max, and time.time().
Referenced by card_for().
| Any engine.layerx.card.card_for | ( | Any | config, |
| * | , | ||
| float | center_pa, | ||
| float | ambient_pa ) |
:func:`build_card`, remembered per (config, T-0, ambient). Preflight and the run that follows it share one card; a changed config is a different key, so a stale card is never served.
Definition at line 512 of file card.py.
References build_card().
Referenced by card_for_config_text().
| Dict[str, Any] engine.layerx.card.card_for_config_text | ( | str | text, |
| * | , | ||
| Optional[float] | center_psia = None ) |
The engine card for an engine config given as YAML text: what the feed-twin cockpit asks for when it imports an engine, so the stand fires the engine EngineDesign designed rather than feedtwin's own simplified one. Centred on the config's tank pressure (``lox_tank.initial_pressure_psi``) unless told otherwise; the scan then covers 40-130 % of it, which is every dome the cockpit's regulator can be set to. Sampled at the site's ambient (``environment.elevation``), as Layer X does.
Definition at line 531 of file card.py.
References card_for().
| Dict[str, float] engine.layerx.card.check_card | ( | Any | card, |
| Sequence[Dict[str, float]] | points, | ||
| float | ambient_pa ) |
Largest relative errors of ``card`` against EngineDesign solves ``points`` (each with p_O, p_F). * ``chamber_*``: the chamber tables given EngineDesign's own flows. * ``dp_*``: each injector table given EngineDesign's flow and line pressure. * ``closed_*``: the card solved as a whole at the line pressures (:func:`solve_card`), against EngineDesign at the same pressures. This is what a burn sees.
Definition at line 260 of file card.py.
References max, and solve_card().
Referenced by build_card().
| Any engine.layerx.card.expansion_chamber | ( | Any | card, |
| Any | cea_cache, | ||
| * | , | ||
| float | ambient_pressure, | ||
| float | volume = 0.0 ) |
``ExpansionCardChamber`` on EngineDesign's CEA table (``cea_cache.eval_cf_vac``): the chamber to put in the twin in place of ``card.chamber_model(...)`` when the option is on.
Definition at line 494 of file card.py.
References expansion_chamber_class().
| type engine.layerx.card.expansion_chamber_class | ( | ) |
``ExpansionCardChamber``: :class:`_ExpansionScaling` over feedtwin's ``CardChamber``.
Definition at line 477 of file card.py.
Referenced by __getattr__(), and expansion_chamber().
| engine.layerx.card.fit_card | ( | Sequence[Dict[str, float]] | samples, |
| * | , | ||
| float | throat_area, | ||
| float | exit_area, | ||
| float | ambient_pa, | ||
| str | name ) |
| Any engine.layerx.card.line_exit_config | ( | Any | config | ) |
A copy of ``config`` whose feed lines lose nothing but the exit dump into the manifold. ``supply_K`` goes with ``K0``: it is the share of ``K0`` that is the pressurant supply sagging under flow (Layer X's feed fit writes it), and the chug loop subtracts it from the feed drop it takes as line resistance (stability/analysis.py ``_chug_feed_drop``). With ``K0`` zeroed the drop left is the exit dump alone, which holds no supply share; left in, a feed-fit write took the chug gate from 1.330 to 1.248 with nothing physical changed (audit D7, 5.3). A config with ``supply_K`` 0 (LE4) is unchanged by this.
| Optional[Dict[str, float]] engine.layerx.card.solve_card | ( | Any | card, |
| float | p_O, | ||
| float | p_F, | ||
| float | ambient_pa ) |
The card's own operating point at line-exit pressures ``p_O``, ``p_F``: Pc such that the flows each injector passes at that Pc are the flows that make that Pc. Independent of the twin's network, so it checks the card and nothing else.
Definition at line 228 of file card.py.
Referenced by check_card().
| tuple engine.layerx.card.BOUNDARY |