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

Classes

class  PortKind
class  ManifoldPort
class  ManifoldBranch
class  Manifold

Functions

float turn_K_from_geometry (float port_bore, float plenum_bore)
list[str] expand_manifold (object network, Manifold manifold, str plenum_node, dict[str, str] port_nodes)

Variables

float DEFAULT_TURN_K = 1.3

Detailed Description

Manifolds: one inlet, several outlets, and a right-angle turn at each.

A manifold is a block with a bore through it and ports tapped into the side.
The team uses them everywhere -- a COPV manifold typically carries a pressure
transducer, a relief valve, a fill quick-disconnect and the regulator feed off
one inlet -- and modelling one as a bare node is the mistake worth avoiding.

What a manifold actually is
---------------------------
A **plenum** at one pressure, plus one **branch per port**. Flow entering the
plenum and leaving through a side port turns through ninety degrees into a bore
that is usually smaller than the plenum's; that turn is a real loss and it is
not the same as the fitting screwed into the port. So each port branch carries
two things in series: the turn out of the plenum, and whatever is threaded in.

The ports themselves carry no information. Every port on the team's manifolds is
female, so the port is just a hole -- **the fitting in it is the whole story**,
which is why :class:`ManifoldPort` takes a bore and a K and not a thread
designation.

Three kinds of port, and the difference matters
-----------------------------------------------
``flow``
    Carries mass. Turn loss plus fitting loss, solved normally.

``instrument``
    A transducer port. It is a dead end -- no flow, ever -- so it reads plenum
    pressure exactly and contributes nothing but a node. Phase 04's dead-end
    peeling already handles this correctly; declaring the port as an instrument
    is what tells a reader *why* the stub is there, and stops someone
    "fixing" it later.

``conditional``
    A relief valve or a burst disc: shut now, a flow path the moment it opens.
    Modelled as a dead end while shut, which is exactly what it is, and named so
    that a scenario can open it without restructuring the network.

The last case is why port type is declared rather than inferred from
connectivity. A shut relief and a capped port are topologically identical and
physically nothing alike, and only one of them belongs in a burst analysis.

Function Documentation

◆ expand_manifold()

list[str] feedtwin.comps.manifold.expand_manifold ( object network,
Manifold manifold,
str plenum_node,
dict[str, str] port_nodes )
Add a manifold's branches to a network. Returns the branch ids.

The plenum node must already exist and each port must be mapped to a node,
including the instrument and conditional ones -- those become dead-end
stubs, which Phase 04 peels and back-fills exactly.

Args:
    network: The :class:`~feedtwin.solve.network.Network` to add to. Typed
        loosely to keep this module free of a solver import; the solver
        already imports components and the reverse would be a cycle.
    manifold: The expanded body.
    plenum_node: Node id for the plenum interior.
    port_nodes: ``{port id: node id}`` for every port.

Definition at line 244 of file manifold.py.

◆ turn_K_from_geometry()

float feedtwin.comps.manifold.turn_K_from_geometry ( float port_bore,
float plenum_bore )
A turn loss derived from the two bores, for when nobody measured one.

The port sees the plenum as a large volume, so the entry is a contraction
from the plenum bore into the port bore plus the ninety-degree turn. Both
come from ``fluids``: the contraction from the area ratio, the turn from
the branch-tee correlation.

A derived number, and it says so. Rung 6 of the K ladder -- fine for a first
pass, worth replacing with a fitted value the moment a flow test exists.

Definition at line 225 of file manifold.py.

Variable Documentation

◆ DEFAULT_TURN_K

float feedtwin.comps.manifold.DEFAULT_TURN_K = 1.3

Definition at line 80 of file manifold.py.