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

Classes

class  UnknownPropellant
class  DischargeModel
class  InjectorSide
class  EngineDesign

Functions

None register_propellant_alias (str name, str species)
str species_for (str name)
None register_injector_type (str name, AreaExtractor extractor)
list[str] registered_injector_types ()
tuple[float, float, int] injector_areas (str injector_type, Mapping[str, object] geometry, str side)
float _as_float (Mapping[str, object] block, str key, str where)
tuple[float, float, int] _impinging (Mapping[str, object] geometry, str side)
tuple[float, float, int] _pintle (Mapping[str, object] geometry, str side)
tuple[float, float, int] _coaxial (Mapping[str, object] geometry, str side)

Variables

dict PROPELLANT_ALIASES
 AreaExtractor = Callable[[Mapping[str, object], str], tuple[float, float, int]]
dict _EXTRACTORS = {}

Detailed Description

What feed-twin needs from an engine design, and nothing more.

An EngineDesign Layer-1 config is a large document -- ablative cooling, spray
SMD correlations, optimizer weights, CEA cache paths, structural margins. Almost
none of that is a feed-system boundary condition. What a feed system needs to
know about the engine at its end is small and specific:

* the **effective flow area** each propellant sees at the injector face,
* the **discharge coefficient** on each side and how it moves with Reynolds,
* which **propellants** those are, so the property layer can be asked,
* the **throat area**, which converts total flow into chamber pressure,
* and the **design point** -- thrust, mixture ratio, chamber pressure -- so the
  import can be checked against what Layer 1 thought it had designed.

:class:`EngineDesign` is that subset, and it is deliberately a plain record
rather than a live handle on an EngineDesign object. Two reasons. It can be
serialised into a feed-twin scenario, so a run is reproducible without the other
repo present. And it makes the coupling *explicit*: every quantity crossing the
boundary is named in one place, so nobody has to read two codebases to find out
what the engine is being told.

Injector types are not interchangeable
--------------------------------------
The area calculation is the one genuinely type-specific piece, and getting it
from the wrong formula is silent -- a wrong area is a wrong flow is a wrong
chamber pressure, and every number downstream stays plausible. So each type has
its own extractor, registered by name, and an unrecognised type is refused
rather than guessed at:

``impinging``
    ``n_elements`` round jets per side. ``A = n . pi d_jet^2 / 4``.

``pintle``
    Oxidiser through discrete orifices, fuel through the annulus between the
    pintle tip and the reservoir wall. The two sides use *different formulae*,
    which is exactly the trap.

``coaxial``
    Core ports and an outer annulus, same asymmetry.

Function Documentation

◆ _as_float()

float feedtwin.engine.design._as_float ( Mapping[str, object] block,
str key,
str where )
protected

Definition at line 342 of file design.py.

Referenced by _coaxial(), _impinging(), and _pintle().

◆ _coaxial()

tuple[float, float, int] feedtwin.engine.design._coaxial ( Mapping[str, object] geometry,
str side )
protected
Core ports for one propellant, an outer annulus for the other.

Convention follows EngineDesign's schema: the *core* carries the oxidiser
and the annulus the fuel, which is the usual shear-coaxial arrangement.

Definition at line 391 of file design.py.

References _as_float(), and register_injector_type().

◆ _impinging()

tuple[float, float, int] feedtwin.engine.design._impinging ( Mapping[str, object] geometry,
str side )
protected
Round jets, ``n`` of them per side.

Definition at line 349 of file design.py.

References _as_float().

◆ _pintle()

tuple[float, float, int] feedtwin.engine.design._pintle ( Mapping[str, object] geometry,
str side )
protected
Discrete orifices on the ox side, an annulus on the fuel side.

The asymmetry is the whole point, and it is where an injector-type-blind
importer goes wrong: applying the orifice formula to a fuel annulus produces
a number with the right units and the wrong value.

Definition at line 362 of file design.py.

References _as_float().

◆ injector_areas()

tuple[float, float, int] feedtwin.engine.design.injector_areas ( str injector_type,
Mapping[str, object] geometry,
str side )
Effective area, hydraulic diameter and element count for one side.

Raises:
    KeyError: unrecognised injector type. Refused rather than guessed:
        a wrong area is a wrong mass flow is a wrong chamber pressure, and
        every number downstream of it stays perfectly plausible.

Definition at line 323 of file design.py.

◆ register_injector_type()

None feedtwin.engine.design.register_injector_type ( str name,
AreaExtractor extractor )

Definition at line 315 of file design.py.

Referenced by _coaxial().

◆ register_propellant_alias()

None feedtwin.engine.design.register_propellant_alias ( str name,
str species )
Map an engine-config propellant name onto a feed-twin species.

Definition at line 89 of file design.py.

◆ registered_injector_types()

list[str] feedtwin.engine.design.registered_injector_types ( )

Definition at line 319 of file design.py.

◆ species_for()

str feedtwin.engine.design.species_for ( str name)

Definition at line 94 of file design.py.

Variable Documentation

◆ _EXTRACTORS

dict feedtwin.engine.design._EXTRACTORS = {}
protected

Definition at line 312 of file design.py.

◆ AreaExtractor

feedtwin.engine.design.AreaExtractor = Callable[[Mapping[str, object], str], tuple[float, float, int]]

Definition at line 310 of file design.py.

◆ PROPELLANT_ALIASES

dict feedtwin.engine.design.PROPELLANT_ALIASES
Initial value:
1= {
2 "lox": "oxygen",
3 "o2": "oxygen",
4 "oxygen": "oxygen",
5 "liquid oxygen": "oxygen",
6 "ethanol": "ethanol",
7 "etoh": "ethanol",
8 "c2h5oh": "ethanol",
9 "methane": "methane",
10 "ch4": "methane",
11 "lch4": "methane",
12 "lng": "methane",
13}

Definition at line 57 of file design.py.