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

Public Member Functions

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

Curve curve = curve
Public Attributes inherited from feedtwin.comps.base.HydraulicComponent
 instance = instance
 p = instance.si_params()
 opt = dict(instance.options)

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

Detailed Description

Pressure drop read from a measured curve, superseding every correlation.

The component-level counterpart of the property layer's tabulated backend,
and the same principle: inside the range you measured, your data wins.

Unlike the property layer this does **not** fall through to a correlation
outside its range. A property has a defensible fallback in an equation of
state; a component's measured curve has no equivalent, and quietly
switching to a correlation halfway up a flow sweep would produce a kink
nobody asked for and nobody would see.

Off its ends it is continued quadratically (:func:`_curve_dp`, the same
continuation a measured segment gets): ``dp ~ mdot^2`` is the law the curve
is a measurement of, and it runs through zero. It used to raise there, and
flow benches rarely sweep from zero: a solve starts every branch at 1 g/s,
so a curve over 0.05-0.2 kg/s that bracketed the answer could not be
solved at all, and a capped stub's zero-flow back-fill raised out of a
solve asked not to raise. :meth:`diagnostics` flags a flow that was not
measured (``extrapolated``), so the excursion is visible, not silent.

Definition at line 820 of file elements.py.

Constructor & Destructor Documentation

◆ __init__()

None feedtwin.comps.elements.MeasuredElement.__init__ ( self,
ComponentInstance instance )

Definition at line 844 of file elements.py.

References __init__().

Referenced by __init__().

Member Function Documentation

◆ diagnostics()

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

References curve, and feedtwin.comps.base.HydraulicComponent.pressure_drop().

◆ pressure_drop()

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

References feedtwin.comps.elements._curve_dp(), and curve.

Member Data Documentation

◆ curve

feedtwin.comps.elements.MeasuredElement.curve = curve

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