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

Classes

class  ReconcileRequest

Functions

Dict[str, Any] _forward (Any config, Any p_tank, float ambient)
Any _with_feed (Any config, Dict[str, Any] fit)
Optional[float] _passage_length (Any config, str side)
Any _with_holes (Any config, Dict[str, float] d, Dict[str, Optional[float]] lengths, Optional[Dict[str, float]] angles=None)
Tuple[Dict[str, float], Dict[str, Any], int] _solve_holes (Any config, Dict[str, Optional[float]] lengths, Tuple[float, float] target, Any p_tank, float ambient, Optional[Dict[str, float]] angles=None, float tol=2.0e-5, int max_iter=12)
Tuple[Dict[str, float], float] _angles_for_tilt (Any config, float target_tilt, Any p_tank, float ambient, Dict[str, Any] point)
Dict[str, Any] drills (float d_mm)
List[Dict[str, Any]] drill_candidates (float d_mm, int n=4)
List[Dict[str, Any]] drill_grid (Any fed, Dict[str, Optional[float]] lengths, Any p_tank, float ambient, Dict[str, List[Dict[str, Any]]] options, Optional[Dict[str, float]] angles)
List[Dict[str, Any]] _changes (Any config, Any final, Dict[str, Optional[float]] lengths)
Dict[str, Any] design_update (Any final, Dict[str, Any] fit_update, Dict[str, Optional[float]] lengths)
Dict[str, Any] _burn_figures (Dict[str, Any] res)
Dict[str, Any] run_reconcile (Any config, Any drawing, Any settings, List[Any] overrides, ReconcileRequest request, Optional[Progress] progress=None, Callable[[], bool] cancelled=lambda:False)

Variables

 Progress = Callable[[str, float], None]
dict NUMBER_DRILLS_IN
float METRIC_STEP_MM = 0.05
tuple SIDES = (("oxidizer", "O", "LOX"), ("fuel", "F", "Fuel"))

Detailed Description

Resize the injector so the design point holds under the drawing's feed system.

EngineDesign sizes the injector at the tank pressure less one loss per side (``feed_system.K0``).
The drawing's feed delivers something else: the tank sags below lockup while it flows, the lines
have their own valves and bends, and in flight every liquid column carries the vehicle's
acceleration. On the 6.8 kN stand the injector sees ~15 psi less LOX and ~13 psi less fuel than it
was sized for, so it under-flows and the chamber runs below its design point.

The reconciler holds everything that is built (chamber, throat, plate rings, channels, tank
pressure) and changes only what the plate's holes set:

* **hole diameters** (both rings), solved so the engine makes the target thrust at the target
  O/F through the drawing's feed. That restores the design flows, so chamber pressure and Isp come
  back with them. Each passage keeps its drilled length, so its L/d (and with it Cd) moves with the
  diameter;
* **jet angles** (optional, whole degrees, included angle held): the spray resultant's tilt depends
  on the two streams' momenta, which change with the hole areas. The angles bring it back.

The momentum-flux ratio R = (Cd_O/Cd_F) sqrt(dp_O/dp_F) is reported but not targeted: at fixed
flows through a fixed feed, the two injector drops are set, and hole size cannot move them apart.

The feed is the drawing's, as Layer X measures it (``engine.layerx.feedfit``): K0 per side fitted to
a burn. Because the fit depends on the flow (the regulator droops more at higher flow), the
reconciler burns, fits, resizes and burns again until the holes stop moving. The last burn is the
reconciled injector on the drawing, and its numbers are the ones reported.

Forward mode is the inner model: ``PintleEngineRunner.evaluate`` at the lockup, with the fitted K0.

Function Documentation

◆ _angles_for_tilt()

Tuple[Dict[str, float], float] engine.layerx.reconcile._angles_for_tilt ( Any config,
float target_tilt,
Any p_tank,
float ambient,
Dict[str, Any] point )
protected
Whole-degree jet angles, the included angle held, that bring the resultant tilt nearest
``target_tilt`` at this point's flows. Returns the angles and the tilt they give.

Definition at line 185 of file reconcile.py.

Referenced by run_reconcile().

◆ _burn_figures()

Dict[str, Any] engine.layerx.reconcile._burn_figures ( Dict[str, Any] res)
protected

Definition at line 306 of file reconcile.py.

Referenced by run_reconcile().

◆ _changes()

List[Dict[str, Any]] engine.layerx.reconcile._changes ( Any config,
Any final,
Dict[str, Optional[float]] lengths )
protected

Definition at line 265 of file reconcile.py.

References drills().

Referenced by run_reconcile().

◆ _forward()

Dict[str, Any] engine.layerx.reconcile._forward ( Any config,
Any p_tank,
float ambient )
protected
Forward mode at the lockup: performance, the injector's split, and the spray tilt.
``p_tank`` is one pressure for both tanks or ``(p_O, p_F)`` [Pa].

Definition at line 71 of file reconcile.py.

Referenced by _solve_holes(), drill_grid(), and run_reconcile().

◆ _passage_length()

Optional[float] engine.layerx.reconcile._passage_length ( Any config,
str side )
protected
The drilled passage length [m] (declared L/d x d), which a resized hole keeps.

Definition at line 118 of file reconcile.py.

Referenced by run_reconcile().

◆ _solve_holes()

Tuple[Dict[str, float], Dict[str, Any], int] engine.layerx.reconcile._solve_holes ( Any config,
Dict[str, Optional[float]] lengths,
Tuple[float, float] target,
Any p_tank,
float ambient,
Optional[Dict[str, float]] angles = None,
float tol = 2.0e-5,
int max_iter = 12 )
protected
Hole diameters that make (thrust, O/F) = ``target`` through ``config``'s feed: Newton on
(ln d_O, ln d_F) with a finite-difference Jacobian, steps capped at 5 % per iteration.

Definition at line 144 of file reconcile.py.

References _forward(), _with_holes(), and max.

Referenced by run_reconcile().

◆ _with_feed()

Any engine.layerx.reconcile._with_feed ( Any config,
Dict[str, Any] fit )
protected
``config`` with each side's feed_system replaced by the fitted K0 (feedfit.design_update).

Definition at line 108 of file reconcile.py.

References design_update().

Referenced by run_reconcile().

◆ _with_holes()

Any engine.layerx.reconcile._with_holes ( Any config,
Dict[str, float] d,
Dict[str, Optional[float]] lengths,
Optional[Dict[str, float]] angles = None )
protected

Definition at line 127 of file reconcile.py.

Referenced by _solve_holes(), drill_grid(), and run_reconcile().

◆ design_update()

Dict[str, Any] engine.layerx.reconcile.design_update ( Any final,
Dict[str, Any] fit_update,
Dict[str, Optional[float]] lengths )
What 'write into the design' sends: holes, angles, passage L/d, and the fitted feed that
makes Forward mode agree with the burn.

Definition at line 287 of file reconcile.py.

Referenced by _with_feed(), and run_reconcile().

◆ drill_candidates()

List[Dict[str, Any]] engine.layerx.reconcile.drill_candidates ( float d_mm,
int n = 4 )
The drills nearest ``d_mm``: number drills (ASME B94.11M #40-#70) and 0.05 mm metric, each
with the flow-area error it gives, nearest first.

Definition at line 232 of file reconcile.py.

Referenced by run_reconcile().

◆ drill_grid()

List[Dict[str, Any]] engine.layerx.reconcile.drill_grid ( Any fed,
Dict[str, Optional[float]] lengths,
Any p_tank,
float ambient,
Dict[str, List[Dict[str, Any]]] options,
Optional[Dict[str, float]] angles )
Forward mode through the fitted feed for every pairing of the drill options: what each pair
of drills makes, before it is burned.

Definition at line 250 of file reconcile.py.

References _forward(), and _with_holes().

Referenced by run_reconcile().

◆ drills()

Dict[str, Any] engine.layerx.reconcile.drills ( float d_mm)
Nearest number drill (ASME B94.11M, #40-#70) and nearest 0.05 mm metric drill, with the
flow-area error each gives against ``d_mm``.

Definition at line 220 of file reconcile.py.

References min.

Referenced by _changes().

◆ run_reconcile()

Dict[str, Any] engine.layerx.reconcile.run_reconcile ( Any config,
Any drawing,
Any settings,
List[Any] overrides,
ReconcileRequest request,
Optional[Progress] progress = None,
Callable[[], bool] cancelled = lambda: False )

Variable Documentation

◆ METRIC_STEP_MM

float engine.layerx.reconcile.METRIC_STEP_MM = 0.05

Definition at line 50 of file reconcile.py.

◆ NUMBER_DRILLS_IN

dict engine.layerx.reconcile.NUMBER_DRILLS_IN
Initial value:
1= {
2 40: 0.0980, 41: 0.0960, 42: 0.0935, 43: 0.0890, 44: 0.0860, 45: 0.0820, 46: 0.0810, 47: 0.0785,
3 48: 0.0760, 49: 0.0730, 50: 0.0700, 51: 0.0670, 52: 0.0635, 53: 0.0595, 54: 0.0550, 55: 0.0520,
4 56: 0.0465, 57: 0.0430, 58: 0.0420, 59: 0.0410, 60: 0.0400, 61: 0.0390, 62: 0.0380, 63: 0.0370,
5 64: 0.0360, 65: 0.0350, 66: 0.0330, 67: 0.0320, 68: 0.0310, 69: 0.0292, 70: 0.0280,
6}

Definition at line 43 of file reconcile.py.

◆ Progress

engine.layerx.reconcile.Progress = Callable[[str, float], None]

Definition at line 40 of file reconcile.py.

◆ SIDES

tuple engine.layerx.reconcile.SIDES = (("oxidizer", "O", "LOX"), ("fuel", "F", "Fuel"))

Definition at line 52 of file reconcile.py.