|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Public Member Functions | |
| None | __init__ (self, ComponentInstance instance) |
| float | pressure_drop (self, float mdot, FlowConditions flow) |
| float | static_head (self, FlowConditions flow) |
| tuple[tuple[float, float],...] | wetted_runs (self) |
| dict[str, float] | diagnostics (self, float mdot, FlowConditions flow) |
| Public Member Functions inherited from feedtwin.comps.base.HydraulicComponent | |
| None | __init__ (self, ComponentInstance instance) |
| str | id (self) |
| str | type (self) |
| float | total_dp (self, float mdot, FlowConditions flow) |
| float | signal (self, FlowConditions flow, str name, float default=1.0) |
| bool | isolates (self, Mapping[str, float]|None signals=None) |
| float|None | flow_ceiling (self, FlowConditions flow) |
| float|None | pinned_flow (self, float dp_available, FlowConditions flow) |
| bool | is_choked (self, float dp_available, FlowConditions flow) |
| list[Violation] | check (self) |
| int | n_residuals (self) |
| Sequence[float] | residuals (self, EvalContext ctx) |
| Mapping[str, float] | outputs (self, EvalContext ctx) |
| FlowConditions | conditions (self, PortState port, Mapping[str, float] signals) |
| str | __repr__ (self) |
Public Attributes | |
| segments = instance.segments | |
| Public Attributes inherited from feedtwin.comps.base.HydraulicComponent | |
| instance = instance | |
| p = instance.si_params() | |
| opt = dict(instance.options) | |
Protected Member Functions | |
| float | _segment_dp (self, LineSegment segment, float mdot, FlowConditions flow) |
| float | _fittings_K (self, LineSegment segment, float bore, float Re, float fd, float rough) |
| float | _transition_dp (self, int index, float mdot, FlowConditions flow) |
Protected Attributes | |
| _roughness = self.p.get("roughness", 1.5e-6) | |
| _method = self.opt.get("friction", DEFAULT_FRICTION_METHOD) | |
| float | _bore = min(bores) if bores else 0.0 |
| tuple | _elevation_m |
Additional Inherited Members | |
| Static Public Attributes inherited from feedtwin.comps.base.HydraulicComponent | |
| str | inlet_port = "inlet" |
| str | outlet_port = "outlet" |
| bool | symmetric = False |
| conditions_provider = None | |
A run the drawing itemised: several bores, several lengths, real fittings.
:class:`Pipe` is one bore of one length with its fittings lumped into
``K_minor``. A real line is not that. It is 400 mm of 1/2 in. tube, three
elbows, a reducer, 900 mm of 3/8 in., a tee. The drawing records exactly
that, and this evaluates it segment by segment::
dp = sum_i (f_i L_i / D_i + sum_j K_ij) . rho v_i^2 / 2
with ``v_i`` the velocity in *that* segment's bore. The bore is inside the
sum for a reason: it enters as the fifth power (``v^2 ~ D^-4``, and ``L/D``
one more), so a run that steps from 1/2 in. to 3/8 in. halfway is nowhere
near the average of the two. Lumping this run into one equivalent bore is
the error this class exists to stop.
Two things it does that a per-segment sum does not do by itself:
**The tube length, not the assembly length.** A fitting's K already prices
the flow through the fitting, so the friction term must use the tube only.
:meth:`~feedtwin.model.segments.LineSegment.tube_length` takes the fitting
bodies out when the drawing says the length was measured end to end.
**Bore changes are contractions.** Two adjacent segments of different bore
*are* a reducer, whether or not anybody drew one. Deriving it is the only
safe choice: a reducer somebody forgot to add is silent, and on a 1/2 in.
to 3/8 in. step at 10 m/s it is worth about 0.1 bar -- larger than most of
the elbows that did get drawn.
Segments are evaluated by their own method, so a run that has been flowed in
one place and estimated in another gets the measurement where the
measurement exists. See :mod:`feedtwin.model.segments` for the ladder.
Definition at line 872 of file elements.py.
| None feedtwin.comps.elements.SegmentedPipe.__init__ | ( | self, | |
| ComponentInstance | instance ) |
|
protected |
Every fitting on one segment, summed, referred to the segment bore. A fitting carrying its own measured K uses it: a number off a flow bench beats every correlation, which is the same rule the segment ladder applies one level up. One that carries its own bore is priced in that bore but referred back to the segment's, because the K a solver adds to ``f L / D`` has to multiply the same dynamic head as the friction does.
Definition at line 981 of file elements.py.
Referenced by _segment_dp().
|
protected |
Definition at line 948 of file elements.py.
References _bore, feedtwin.comps.elements._curve_dp(), feedtwin.comps.elements._dynamic_head(), _fittings_K(), _method, and _roughness.
Referenced by pressure_drop().
|
protected |
The reducer or expander implied by the next segment's bore. Derived rather than drawn. Two adjacent segments of different bore *are* the transition; making somebody add a row for it is a step they can forget, and then the run is quietly cheap.
Definition at line 1026 of file elements.py.
References _bore, feedtwin.comps.elements._dynamic_head(), _method, _roughness, min, and segments.
Referenced by pressure_drop().
| dict[str, float] feedtwin.comps.elements.SegmentedPipe.diagnostics | ( | self, | |
| float | mdot, | ||
| FlowConditions | flow ) |
Derived quantities worth reporting: velocity, Reynolds number, K. Never consumed by a solver. This is what a frame and a report show, and what makes a result inspectable rather than just a number.
Reimplemented from feedtwin.comps.base.HydraulicComponent.
Definition at line 1090 of file elements.py.
References _bore, feedtwin.comps.base.HydraulicComponent.pressure_drop(), segments, and feedtwin.comps.base.HydraulicComponent.static_head().
| float feedtwin.comps.elements.SegmentedPipe.pressure_drop | ( | self, | |
| float | mdot, | ||
| FlowConditions | flow ) |
Flow-dependent pressure loss [Pa]. Always non-negative. A *loss*: it opposes the flow, so it lowers the downstream pressure whichever way the fluid is going. Reverse flow is each component's own business -- symmetric for a pipe, very much not for a check valve. Anything that does **not** depend on the direction of flow belongs in :meth:`static_head`, not here. See that method for why the distinction is load-bearing rather than tidy.
Reimplemented from feedtwin.comps.base.HydraulicComponent.
Definition at line 938 of file elements.py.
References _segment_dp(), _transition_dp(), and segments.
| float feedtwin.comps.elements.SegmentedPipe.static_head | ( | self, | |
| FlowConditions | flow ) |
Flow-independent pressure change [Pa], signed. Zero for most things. Elevation is the case that matters: ``rho g dz`` is set by where the ends of a pipe are, and does not care which way the fluid is going. A loss reverses sign with the flow; a static head does not. Conflating the two is silently wrong exactly when it is hardest to notice -- a network where a branch reverses, which is any recirculation loop, any vent path, and most transients. Getting it wrong puts the answer out by ``2 rho g dz`` on that branch, with everything still converging and conserving mass.
Reimplemented from feedtwin.comps.base.HydraulicComponent.
Definition at line 945 of file elements.py.
References _elevation_m.
| tuple[tuple[float, float], ...] feedtwin.comps.elements.SegmentedPipe.wetted_runs | ( | self | ) |
``(bore, length)`` of each sized segment as installed, end to end [m]. What the line's metal is wrapped around, for the line wall (:class:`~feedtwin.comps.wall.LineWall`), and deliberately *not* :meth:`~feedtwin.model.segments.LineSegment.tube_length`: that takes the fitting bodies out because their loss is already priced as a K, but the gas touches the inside of a bend or a union as much as the tube. On a ``tube`` basis the bodies (less thread engagement) are added back; on an ``overall`` basis the stated length already runs end to end. A segment with no bore anywhere on the line cannot be sized and is left out, as :meth:`_segment_dp` leaves it out of the loss.
Definition at line 1061 of file elements.py.
|
protected |
Definition at line 923 of file elements.py.
Referenced by _segment_dp(), _transition_dp(), diagnostics(), and wetted_runs().
|
protected |
Definition at line 932 of file elements.py.
Referenced by static_head().
|
protected |
Definition at line 917 of file elements.py.
Referenced by _segment_dp(), and _transition_dp().
|
protected |
Definition at line 916 of file elements.py.
Referenced by _segment_dp(), and _transition_dp().
| feedtwin.comps.elements.SegmentedPipe.segments = instance.segments |
Definition at line 915 of file elements.py.
Referenced by feedtwin.model.segments.LineLoss.__bool__(), feedtwin.model.segments.LineLoss.__len__(), _transition_dp(), diagnostics(), feedtwin.model.segments.LineLoss.method(), pressure_drop(), feedtwin.model.segments.LineLoss.weakest_method(), and wetted_runs().