|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Public Member Functions | |
| Node | add_node (self, str id, str fluid, float temperature, *, float|None pressure=None, float demand=0.0) |
| Branch | add_branch (self, str id, HydraulicComponent component, str upstream, str downstream) |
| list[str] | free_nodes (self) |
| list[str] | fixed_nodes (self) |
| list[tuple[Branch, int]] | branches_at (self, str node_id) |
| set[str] | isolated (self, Mapping[str, float]|None signals=None) |
| list[DeadEnd] | dead_ends (self, Iterable[str]|None exclude=None) |
| Fluid | fluid (self, str name) |
| FlowConditions | conditions (self, str node_id, float pressure, dict[str, float]|None signals=None) |
| None | validate (self) |
| list[Violation] | check (self) |
| str | __str__ (self) |
Public Attributes | |
| fixed_nodes | |
Static Public Attributes | |
| dict | nodes = field(default_factory=dict) |
| dict | branches = field(default_factory=dict) |
| bool | multiphase = False |
| float | gravity = 9.80665 |
Protected Member Functions | |
| list[DeadEnd] | _peel (self, set[str] removed) |
| DeadEnd|None | _island_exit (self, str node_id, list[DeadEnd] found, set[str] removed) |
Static Protected Attributes | |
| dict | _fluids = field(default_factory=dict, repr=False) |
| dict | _stubs |
A feed system: nodes, branches, and the fluids in them.
Definition at line 111 of file network.py.
| str feedtwin.solve.network.Network.__str__ | ( | self | ) |
Definition at line 448 of file network.py.
|
protected |
A stub entry for the last node of an island, or ``None``. Walks the branches already peeled, starting at ``node_id``, to the first node a removed branch (a shut valve) touches, and takes the live end across that branch -- the pressure the island would see if the valve opened, which is what a stub hung off a shut valve already reads. An island with no shut valve on it at all has no pressure to inherit; it is given its own peeled neighbour, and the back-fill reports it as undefined rather than the solve failing.
Definition at line 322 of file network.py.
References feedtwin.session.model.AssemblyReport.branches, feedtwin.session.network_trace.NetworkTrace.branches, and branches.
Referenced by _peel().
|
protected |
:meth:`dead_ends`, worked out.
Definition at line 246 of file network.py.
References _island_exit(), feedtwin.session.model.AssemblyReport.branches, feedtwin.session.network_trace.NetworkTrace.branches, branches, feedtwin.pid.document.Diagram.nodes, feedtwin.session.model.AssemblyReport.nodes, feedtwin.session.network_trace.NetworkTrace.nodes, and nodes.
Referenced by dead_ends().
| Branch feedtwin.solve.network.Network.add_branch | ( | self, | |
| str | id, | ||
| HydraulicComponent | component, | ||
| str | upstream, | ||
| str | downstream ) |
Definition at line 158 of file network.py.
References feedtwin.session.model.AssemblyReport.branches, feedtwin.session.network_trace.NetworkTrace.branches, branches, feedtwin.pid.document.Diagram.nodes, feedtwin.session.model.AssemblyReport.nodes, feedtwin.session.network_trace.NetworkTrace.nodes, and nodes.
| Node feedtwin.solve.network.Network.add_node | ( | self, | |
| str | id, | ||
| str | fluid, | ||
| float | temperature, | ||
| * | , | ||
| float | None | pressure = None, | ||
| float | demand = 0.0 ) |
Definition at line 143 of file network.py.
References feedtwin.pid.document.Diagram.nodes, feedtwin.session.model.AssemblyReport.nodes, feedtwin.session.network_trace.NetworkTrace.nodes, and nodes.
| list[tuple[Branch, int]] feedtwin.solve.network.Network.branches_at | ( | self, | |
| str | node_id ) |
Branches touching a node, with +1 for inflow and -1 for outflow.
Definition at line 186 of file network.py.
References feedtwin.session.model.AssemblyReport.branches, feedtwin.session.network_trace.NetworkTrace.branches, and branches.
| list[Violation] feedtwin.solve.network.Network.check | ( | self | ) |
Design limits broken by any component in the network. Configuration only, so it runs before a solve. A bend inside its minimum radius does not stop the network solving; it stops the hardware being right, which is a different and equally worth-knowing thing.
Definition at line 439 of file network.py.
References feedtwin.session.model.AssemblyReport.branches, feedtwin.session.network_trace.NetworkTrace.branches, and branches.
| FlowConditions feedtwin.solve.network.Network.conditions | ( | self, | |
| str | node_id, | ||
| float | pressure, | ||
| dict[str, float] | None | signals = None ) |
Fluid conditions at a node, for evaluating a branch leaving it.
Definition at line 374 of file network.py.
References feedtwin.pid.document.PidNode.fluid, feedtwin.props.errors.OutOfRange.fluid, fluid(), feedtwin.vessels.volume.GasVolume.fluid, feedtwin.comps.base.FlowConditions.gravity, feedtwin.session.core.TankSim.gravity, gravity, multiphase, feedtwin.pid.document.Diagram.nodes, feedtwin.session.model.AssemblyReport.nodes, feedtwin.session.network_trace.NetworkTrace.nodes, and nodes.
| list[DeadEnd] feedtwin.solve.network.Network.dead_ends | ( | self, | |
| Iterable[str] | None | exclude = None ) |
Stubs that can carry no flow, peeled outermost-first.
Args:
exclude: Branches already removed from the solve -- shut valves.
A node left with one live branch once those are gone is a stub
exactly as if nothing had ever been drawn on its other side,
which is why this takes them rather than being told twice.
Found iteratively, because stubs chain: a plenum port feeding a short
line into a capped quick-disconnect is two branches deep, and removing
the outer one is what makes the inner one a stub in turn.
The returned order is safe to back-fill in reverse -- each entry's live
end is either solved or an earlier entry.
Remembered per shut set, wiring and which nodes are boundaries: a live
session asks the same question every solve, and peeling a two-page
stand costs a millisecond each time.
Definition at line 209 of file network.py.
References _peel(), _stubs, feedtwin.session.model.AssemblyReport.branches, feedtwin.session.network_trace.NetworkTrace.branches, branches, feedtwin.pid.document.Diagram.nodes, feedtwin.session.model.AssemblyReport.nodes, feedtwin.session.network_trace.NetworkTrace.nodes, and nodes.
| list[str] feedtwin.solve.network.Network.fixed_nodes | ( | self | ) |
Definition at line 183 of file network.py.
References feedtwin.pid.document.Diagram.nodes, feedtwin.session.model.AssemblyReport.nodes, feedtwin.session.network_trace.NetworkTrace.nodes, and nodes.
| Fluid feedtwin.solve.network.Network.fluid | ( | self, | |
| str | name ) |
A cached :class:`~feedtwin.props.Fluid`, one per species.
Definition at line 366 of file network.py.
References _fluids.
Referenced by conditions().
| list[str] feedtwin.solve.network.Network.free_nodes | ( | self | ) |
Nodes whose pressure is solved, in a stable order.
Definition at line 178 of file network.py.
References feedtwin.pid.document.Diagram.nodes, feedtwin.session.model.AssemblyReport.nodes, feedtwin.session.network_trace.NetworkTrace.nodes, and nodes.
| set[str] feedtwin.solve.network.Network.isolated | ( | self, | |
| Mapping[str, float] | None | signals = None ) |
Branches commanded shut, which carry no flow and are not solved for. See :meth:`feedtwin.comps.base.HydraulicComponent.isolates`. Removing them is what turns "a shut valve" from a near-singular row into what it physically is -- no connection.
Definition at line 196 of file network.py.
References feedtwin.session.model.AssemblyReport.branches, feedtwin.session.network_trace.NetworkTrace.branches, and branches.
| None feedtwin.solve.network.Network.validate | ( | self | ) |
Every structural problem that can be found without solving.
Raises:
NetworkError: with all problems listed together, because fixing a
network six errors at a time beats six solve attempts.
Definition at line 393 of file network.py.
References feedtwin.session.model.AssemblyReport.branches, feedtwin.session.network_trace.NetworkTrace.branches, and branches.
|
staticprotected |
Definition at line 136 of file network.py.
Referenced by fluid().
|
staticprotected |
Definition at line 137 of file network.py.
Referenced by dead_ends().
|
static |
Definition at line 115 of file network.py.
Referenced by _island_exit(), _peel(), add_branch(), branches_at(), check(), dead_ends(), isolated(), and validate().
| feedtwin.solve.network.Network.fixed_nodes |
Definition at line 405 of file network.py.
|
static |
Definition at line 130 of file network.py.
Referenced by conditions().
|
static |
Definition at line 117 of file network.py.
Referenced by conditions().
|
static |
Definition at line 114 of file network.py.
Referenced by _peel(), add_branch(), add_node(), engine.stability_hifi.acoustics.mesh.MeridionalMesh.axis_nodes(), conditions(), dead_ends(), fixed_nodes(), free_nodes(), engine.stability_hifi.acoustics.mesh.MeridionalMesh.locate_point(), engine.stability_hifi.acoustics.mesh.MeridionalMesh.n_nodes(), engine.stability_hifi.acoustics.mesh.MeridionalMesh.nodes_at_x(), and feedtwin.session.burn.BurnTrace.recorder().