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

Variables

dict BRANCH_KINDS
dict LINE_KINDS

Detailed Description

Turning a drawing into a network.

The two graphs are not the same shape, and that is the whole problem this
module solves.

A **P&ID** puts hardware on symbols *and* on lines: a ball valve is a symbol, a
tube run is a line, and both resist flow. A **feed-twin network** puts pressures
on nodes and hardware on branches, exclusively. So the transform is not a
relabelling, it is a rewrite:

.. code-block:: text

    P&ID                         network
    ----                         -------
    tank / K-bottle / dewar      a fixed-pressure node
    junction / manifold          a free node
    valve, regulator, check      a BRANCH, with a node spliced either side
    line between two symbols     a branch
    transducer, gauge, RTD       nothing -- an observer on the node it clips to
    text, section box            nothing

The interesting case is the third. An inline symbol has to become a branch, so
the two lines that met at it are cut and its own node pair takes their place.
Get that wrong and a drawing with six valves solves as a drawing with none,
which converges beautifully and means nothing.

Instruments are deliberately *not* dead-end stubs here. Phase 04 can peel a
stub exactly, but a transducer is not plumbing at all -- it is a label on a
place. Making it a node would put a fictitious branch in every mass balance and
report an anomaly on every run.

Variable Documentation

◆ BRANCH_KINDS

dict feedtwin.pid.network.BRANCH_KINDS
Initial value:
1= {
2 "MAN": ("valve", "cv"),
3 "ROT": ("valve", "cv"),
4 "SOL": ("valve", "cv"),
5 "MOV": ("valve", "cv"),
6 "PR": ("regulator", "droop"),
7 "RV": ("valve", "cv"),
8 "CV": ("check_valve", "cv"),
9 "QD": ("fitting", "K"),
10}

Definition at line 59 of file network.py.

◆ LINE_KINDS

dict feedtwin.pid.network.LINE_KINDS
Initial value:
1= {
2 "pipe": ("pipe", "darcy"),
3 "flex_hose": ("flex_hose", "darcy"),
4 # The geometry-aware hardline bend; "rounded" is its correlation model
5 # (there is no darcy bend, and asking for one could not be built).
6 "bend": ("bend", "rounded"),
7 "fitting": ("fitting", "K"),
8}

Definition at line 70 of file network.py.