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

Public Member Functions

float set_pressure (self)
float reseat_pressure (self)
float full_lift_pressure (self)
tuple[float, bool] lift_for (self, float dp_actuating, bool was_open)
bool isolates (self, Mapping[str, float]|None signals=None)
float pressure_drop (self, float mdot, FlowConditions flow)
float|None flow_ceiling (self, FlowConditions flow)
float|None rated_capacity (self, FlowConditions flow)
dict[str, float] diagnostics (self, float mdot, FlowConditions flow)
list[Violation] check (self)
dict[str, Any] model (self)
Public Member Functions inherited from feedtwin.comps.elements.Valve
float effective_cv (self, float position)
bool is_choked (self, float dp_available, FlowConditions flow)
float|None choked_dp (self, 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)
float|None pinned_flow (self, float dp_available, FlowConditions flow)
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

float _lift (self, Mapping[str, float] signals)
GasCv|None _gas (self, FlowConditions flow)
tuple[float, float]|None _gas_choke (self, FlowConditions flow)
Protected Member Functions inherited from feedtwin.comps.elements.Valve
float|None _legacy_liquid_ceiling (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

Definition at line 89 of file relief.py.

Member Function Documentation

◆ _gas()

GasCv | None feedtwin.comps.relief.ReliefValve._gas ( self,
FlowConditions flow )
protected
This valve as IEC 60534 sees a gas, or None on a liquid.

Reimplemented from feedtwin.comps.elements.Valve.

Definition at line 140 of file relief.py.

References _lift(), feedtwin.comps.elements.Valve.effective_cv(), p, and feedtwin.comps.base.HydraulicComponent.p.

◆ _gas_choke()

tuple[float, float] | None feedtwin.comps.relief.ReliefValve._gas_choke ( self,
FlowConditions flow )
protected
``(x_critical, F_gamma)`` for this fluid, or None if it is not a gas.

``x`` is IEC 60534's pressure-drop ratio ``dp/p1``; choking begins at
``F_gamma * xT``. ``F_gamma = gamma / 1.40`` carries the ideal-gas
specific-heat ratio relative to air, which is what makes helium (1.667)
choke at a different ratio from nitrogen (1.40).

Reimplemented from feedtwin.comps.elements.Valve.

Definition at line 154 of file relief.py.

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

◆ _lift()

float feedtwin.comps.relief.ReliefValve._lift ( self,
Mapping[str, float] signals )
protected

Definition at line 131 of file relief.py.

References max, and min.

Referenced by _gas(), diagnostics(), isolates(), and pressure_drop().

◆ check()

list[Violation] feedtwin.comps.relief.ReliefValve.check ( self)
Design limits this component's configuration breaks.

Configuration only -- nothing here depends on the operating point, so it
can be run the moment a network is loaded and long before it is solved.
Bend radius is the case that motivated it: a line bent tighter than its
tube allows is a fabrication problem, and finding out at the bender is
expensive.

Reimplemented from feedtwin.comps.base.HydraulicComponent.

Definition at line 197 of file relief.py.

References set_pressure().

◆ diagnostics()

dict[str, float] feedtwin.comps.relief.ReliefValve.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.elements.Valve.

Definition at line 182 of file relief.py.

References _lift(), feedtwin.comps.elements.Valve.effective_cv(), feedtwin.comps.base.HydraulicComponent.flow_ceiling(), full_lift_pressure(), feedtwin.comps.base.HydraulicComponent.pressure_drop(), reseat_pressure(), and set_pressure().

◆ flow_ceiling()

float | None feedtwin.comps.relief.ReliefValve.flow_ceiling ( self,
FlowConditions flow )
Choked mass flow through the valve [kg/s], or None for a liquid.

IEC 60534-2-1 at the critical ratio ``x = F_gamma . xT``, where the
expansion factor is exactly ``2/3`` and the flow stops responding to
downstream pressure. A liquid should have no such ceiling, and still
has the old one (:func:`_legacy_liquid_ceiling`; deferred, R037).

Reimplemented from feedtwin.comps.elements.Valve.

Definition at line 161 of file relief.py.

References feedtwin.comps.elements.Valve._gas().

◆ full_lift_pressure()

float feedtwin.comps.relief.ReliefValve.full_lift_pressure ( self)
Differential at which it reaches rated lift [Pa].

Definition at line 106 of file relief.py.

References p, feedtwin.comps.base.HydraulicComponent.p, and set_pressure().

Referenced by diagnostics(), and lift_for().

◆ isolates()

bool feedtwin.comps.relief.ReliefValve.isolates ( self,
Mapping[str, float] | None signals = None )
Commanded shut, so the branch is an open circuit this solve.

The threshold is on *travel*, not on the resulting Cv: a valve at 0.5%
open is shut as far as any stand is concerned, and leaving it in the
network buys a row Newton cannot move.

Reimplemented from feedtwin.comps.elements.Valve.

Definition at line 137 of file relief.py.

References _lift().

◆ lift_for()

tuple[float, bool] feedtwin.comps.relief.ReliefValve.lift_for ( self,
float dp_actuating,
bool was_open )
``(lift, open)`` for the pressure across the valve, given its history.

Shut, it opens once ``dp_actuating`` reaches the set pressure; open, it
stays open until ``dp_actuating`` falls below the reseating pressure. The
lift is proportional between the reseating pressure and full lift.

Definition at line 110 of file relief.py.

References full_lift_pressure(), max, min, reseat_pressure(), and set_pressure().

◆ model()

dict[str, Any] feedtwin.comps.relief.ReliefValve.model ( self)
The run record's ``model`` block for this valve.

Definition at line 229 of file relief.py.

References feedtwin.comps.base.HydraulicComponent.instance.

Referenced by feedtwin.model.component.ComponentInstance.to_dict().

◆ pressure_drop()

float feedtwin.comps.relief.ReliefValve.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.elements.Valve.

Definition at line 146 of file relief.py.

References feedtwin.comps.elements.Valve._gas(), _lift(), feedtwin.comps.elements.Valve.effective_cv(), p, and feedtwin.comps.base.HydraulicComponent.p.

◆ rated_capacity()

float | None feedtwin.comps.relief.ReliefValve.rated_capacity ( self,
FlowConditions flow )
Choked gas flow at full lift [kg/s] for the inlet state ``flow``.

Pass the conditions at the relieving pressure, ``full_lift_pressure``
plus the outlet's, for the valve's rated capacity. ``None`` for a liquid.

Definition at line 167 of file relief.py.

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

◆ reseat_pressure()

float feedtwin.comps.relief.ReliefValve.reseat_pressure ( self)
Differential below which an open valve shuts [Pa].

Definition at line 101 of file relief.py.

References p, feedtwin.comps.base.HydraulicComponent.p, and set_pressure().

Referenced by diagnostics(), and lift_for().

◆ set_pressure()

float feedtwin.comps.relief.ReliefValve.set_pressure ( self)
Differential at which it begins to open [Pa].

Definition at line 96 of file relief.py.

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

Referenced by check(), diagnostics(), full_lift_pressure(), lift_for(), and reseat_pressure().


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