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

Classes

class  NodeInfo
class  BranchInfo
class  NetworkTrace

Functions

str _normal (object name)
str _side_from_drawing (object symbol)
str _chamber_node ("Session" session)
set[str] _walk (str start, Mapping[str, list[tuple[str, str, bool]]] adjacency, Any passable)
list[tuple[str, bool]]|None _shortest (Iterable[str] starts, str goal, Mapping[str, list[tuple[str, str, bool]]] adjacency, Any passable)
str _branch_kind (str symbol_type, object component)
tuple[str,...] _state_keys (object component)
float _opening (Mapping[str, float] signals, tuple[str,...] keys)
str _node_label (str node_id, Mapping[str, Any] symbols, Mapping[str, str] ullages, Mapping[str, str] outlets, str chamber, Mapping[str, str] inlets)
str _node_kind (str node_id, Mapping[str, Any] symbols, set[str] bottles, Mapping[str, str] ullages, Mapping[str, str] outlets, str chamber, Mapping[str, str] inlets, set[str] fixed)

Variables

 OXIDISERS
dict SYMBOL_KINDS
dict COMPONENT_KINDS
str HEAD = ".head"

Detailed Description

Every node and branch of a burn, every step: the opt-in network recorder.

A burn's ordinary trace (:class:`~feedtwin.session.burn.BurnTrace`) keeps its
probes -- the tank ullages and outlets, the regulator outlets, the injector
face, the chamber. That is what a summary needs and what the COPV study always
read. A pressure *ladder* -- bottle to chamber, element by element -- needs all
of it: every node's pressure and temperature, every branch's flow, its own drop
and (valves) how far open it is, and the two paths a propellant's pressure
travels. :class:`NetworkTrace` records that when
:attr:`~feedtwin.session.burn.Probes.network` asks for it. It reads the
:class:`~feedtwin.session.core.Sample` a step already produced and changes no
physics; off (the default) the trace is exactly what it always was.

Node values, not vessel states
------------------------------
Everything here is read off the sample: the pressures of the step's last network
solve. A vessel node in there (the bottle, a tank ullage, a tank outlet) is the
*boundary value that solve started from*, not the vessel's state after the step
-- on the LE4 helium burn the bottle node read 1651.4 psia against the bottle
state's 1645.6 at burnout (``EngineDesign/docs/layerx/AUDIT.md`` 5.5). The
ladder is built from node values only, so its rungs telescope exactly to the
first node minus the last of one solve. Mixing in the post-step vessel states
(``BurnTrace.tank``, ``BurnTrace.bottle``) would put a step's worth of blowdown
into one rung.

What a rung's ``dp`` is
-----------------------
``p(from) - p(to)`` of the same solve: the element's own drop, positive
downstream. Liquid nodes carry the lumped-K convention's pressures (total, not
wall-static; see AUDIT.md 9.6 B4). A tank's liquid column is its own element,
``<tank>.head``, from the ullage node to the outlet node: its ``dp`` is negative,
a gain. A branch a path runs against its drawn direction is reported along the
path (``from``/``to`` swapped, ``mdot`` and ``dp`` negated) so that "positive
downstream" means downstream in the feed.

Function Documentation

◆ _branch_kind()

str feedtwin.session.network_trace._branch_kind ( str symbol_type,
object component )
protected

Definition at line 554 of file network_trace.py.

Referenced by feedtwin.session.network_trace.NetworkTrace.of().

◆ _chamber_node()

str feedtwin.session.network_trace._chamber_node ( "Session" session)
protected
The chamber node with an engine attached, else the ENGINE symbol's node.

Definition at line 477 of file network_trace.py.

Referenced by feedtwin.session.network_trace.NetworkTrace.of().

◆ _node_kind()

str feedtwin.session.network_trace._node_kind ( str node_id,
Mapping[str, Any] symbols,
set[str] bottles,
Mapping[str, str] ullages,
Mapping[str, str] outlets,
str chamber,
Mapping[str, str] inlets,
set[str] fixed )
protected

Definition at line 609 of file network_trace.py.

Referenced by feedtwin.session.network_trace.NetworkTrace.of().

◆ _node_label()

str feedtwin.session.network_trace._node_label ( str node_id,
Mapping[str, Any] symbols,
Mapping[str, str] ullages,
Mapping[str, str] outlets,
str chamber,
Mapping[str, str] inlets )
protected

Definition at line 581 of file network_trace.py.

Referenced by feedtwin.session.network_trace.NetworkTrace.of().

◆ _normal()

str feedtwin.session.network_trace._normal ( object name)
protected

◆ _opening()

float feedtwin.session.network_trace._opening ( Mapping[str, float] signals,
tuple[str, ...] keys )
protected
What the component itself reads: the qualified key, the bare one, else
fully open -- :meth:`HydraulicComponent.signal`'s own precedence.

Definition at line 572 of file network_trace.py.

References max, and min.

Referenced by feedtwin.session.network_trace.NetworkTrace.append().

◆ _shortest()

list[tuple[str, bool]] | None feedtwin.session.network_trace._shortest ( Iterable[str] starts,
str goal,
Mapping[str, list[tuple[str, str, bool]]] adjacency,
Any passable )
protected
Fewest-branch path from any of ``starts`` to ``goal``, as
``(branch id, forward)`` pairs; ``None`` if there is none.

Intermediate nodes must be ``passable``; the goal need not be (it is a
vessel or the chamber, both fixed pressures).

Definition at line 514 of file network_trace.py.

Referenced by feedtwin.session.network_trace.NetworkTrace.of().

◆ _side_from_drawing()

str feedtwin.session.network_trace._side_from_drawing ( object symbol)
protected
``ox`` / ``fuel`` from pid-designer's colour tag on a tank, or ''.

Definition at line 467 of file network_trace.py.

References _normal().

Referenced by feedtwin.session.network_trace.NetworkTrace.of().

◆ _state_keys()

tuple[str, ...] feedtwin.session.network_trace._state_keys ( object component)
protected
The signal names a component's open fraction is read from, or ().

Definition at line 560 of file network_trace.py.

◆ _walk()

set[str] feedtwin.session.network_trace._walk ( str start,
Mapping[str, list[tuple[str, str, bool]]] adjacency,
Any passable )
protected
Nodes reachable from ``start`` through nodes ``passable`` accepts.

``start`` itself is always in; a node that is not passable is a wall and is
not entered.

Definition at line 492 of file network_trace.py.

Referenced by feedtwin.session.network_trace.NetworkTrace.of().

Variable Documentation

◆ COMPONENT_KINDS

dict feedtwin.session.network_trace.COMPONENT_KINDS
Initial value:
1= {
2 "pipe": "line",
3 "flex_hose": "line",
4 "fitting": "fitting",
5 "bend": "fitting",
6 "orifice": "orifice",
7 "valve": "valve",
8 "check_valve": "check",
9 "regulator": "regulator",
10 "relief_valve": "relief",
11}

Definition at line 78 of file network_trace.py.

◆ HEAD

str feedtwin.session.network_trace.HEAD = ".head"

Definition at line 91 of file network_trace.py.

◆ OXIDISERS

feedtwin.session.network_trace.OXIDISERS
Initial value:
1= frozenset(
2 {
3 "oxygen",
4 "o2",
5 "lox",
6 "nitrousoxide",
7 "n2o",
8 "hydrogenperoxide",
9 "h2o2",
10 "nitrogentetroxide",
11 "n2o4",
12 }
13)

Definition at line 51 of file network_trace.py.

◆ SYMBOL_KINDS

dict feedtwin.session.network_trace.SYMBOL_KINDS
Initial value:
1= {
2 "PR": "regulator",
3 "SOL": "solenoid",
4 "ROT": "valve",
5 "MOV": "valve",
6 "MAN": "valve",
7 "RV": "valve", # "relief" when it was built as one; see _branch_kind
8 "CV": "check",
9 "QD": "fitting",
10}

Definition at line 66 of file network_trace.py.