STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
feedtwin.comps.elements.Pipe Class Reference
Inheritance diagram for feedtwin.comps.elements.Pipe:
[legend]
Collaboration diagram for feedtwin.comps.elements.Pipe:
[legend]

Public Member Functions

float pressure_drop (self, float mdot, FlowConditions flow)
float static_head (self, FlowConditions flow)
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)

Protected Member Functions

tuple[float, float] _friction (self, float mdot, FlowConditions flow)
float _elevation (self, FlowConditions flow)

Additional Inherited Members

Public Attributes inherited from feedtwin.comps.base.HydraulicComponent
 instance = instance
 p = instance.si_params()
 opt = dict(instance.options)
Static Public Attributes inherited from feedtwin.comps.base.HydraulicComponent
str inlet_port = "inlet"
str outlet_port = "outlet"
bool symmetric = False
 conditions_provider = None

Detailed Description

A straight run: Darcy friction, lumped minor losses, and elevation.

``dp = (f L / D + K_minor) . rho v^2 / 2``, plus ``rho g dz`` of static head.

The two are reported separately because they behave differently: friction
reverses with the flow, elevation does not. Omitting elevation is a real
error in a tall vehicle with a dense cryogen -- ten metres of LOX is about
1.6 bar -- and conflating it with the loss is a subtler one that only shows
up when a branch reverses.

``K_minor`` is a deliberate shortcut for lumping fittings into a run. It
costs the per-fitting provenance that a :class:`Fitting` component keeps, so
it defaults to zero and is worth avoiding where the fittings are known.

Definition at line 132 of file elements.py.

Member Function Documentation

◆ _elevation()

float feedtwin.comps.elements.Pipe._elevation ( self,
FlowConditions flow )
protected

Definition at line 170 of file elements.py.

References p, and feedtwin.comps.base.HydraulicComponent.p.

Referenced by diagnostics(), and static_head().

◆ _friction()

tuple[float, float] feedtwin.comps.elements.Pipe._friction ( self,
float mdot,
FlowConditions flow )
protected

◆ diagnostics()

dict[str, float] feedtwin.comps.elements.Pipe.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 173 of file elements.py.

References _elevation(), _friction(), feedtwin.comps.base.HydraulicComponent.opt, p, and feedtwin.comps.base.HydraulicComponent.p.

◆ pressure_drop()

float feedtwin.comps.elements.Pipe.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 150 of file elements.py.

References _friction().

◆ static_head()

float feedtwin.comps.elements.Pipe.static_head ( self,
FlowConditions flow )
``rho g dz``. Not a loss -- it is recovered coming back down, and it
keeps its sign when the flow reverses.

Reimplemented from feedtwin.comps.base.HydraulicComponent.

Definition at line 154 of file elements.py.

References _elevation().


The documentation for this class was generated from the following file: