A spring-loaded pressure relief valve: shut until the pressure says otherwise.
Until this existed a drawn ``RV`` became a plain Cv valve with no actuator, so it
was *open* -- a permanent vent hung off whatever it was drawn on -- and the only
overpressure protection the twin had was tripping the stand at a vessel's MAWP
(EngineDesign/docs/layerx/AUDIT.md 5.2, 9.6 E). A drawn RV that declares a
``set_pressure`` now builds as this; one that does not keeps the old behaviour and
the build says it is not a relief model (:func:`feedtwin.pid.network.build_network`).
What it does
------------
Terms are ISO 4126-1 (*Safety devices for protection against excessive pressure
-- Part 1: Safety valves*): **set pressure** (the valve begins to open),
**overpressure** (the rise above set at which it reaches its rated lift, as a
fraction of set), **blowdown** (set less the **reseating pressure**, as a
fraction of set).
.. code-block:: text
shut: opens once dp_act >= p_set
open: lift = (dp_act - p_reseat) / (p_full - p_reseat), clipped to [0, 1]
shuts once dp_act < p_reseat
p_reseat = p_set (1 - blowdown), p_full = p_set (1 + overpressure)
``dp_act`` is the pressure **across** the valve, inlet over outlet: a
conventional (unbalanced) spring valve's set pressure is referenced to its
outlet, so a superimposed back pressure raises the inlet pressure it opens at.
Discharging to atmosphere, it is the gauge pressure the valve is stamped with.
The loop between opening at ``p_set`` and shutting at ``p_reseat`` is the
hysteresis; inside it the lift follows the pressure, so a valve that has popped
throttles down continuously to its seat rather than chattering between shut and
wide open.
The lift is a state, decided by the session once per coupling step from the
pressures of the last solve (:meth:`ReliefValve.lift_for`; the session's
``_relief_signals``), and handed to the component as the ``<id>.lift`` signal --
the same way a solenoid's position is. A component evaluated without a session
(a steady solve) reads no signal and is **shut**, which is a relief valve's
normal state.
The flow
--------
Through ``Cv x lift`` (linear), and for a gas by IEC 60534-2-1 with its expansion
factor and choke (:mod:`feedtwin.comps.iec_gas`): the rated capacity is the
choked flow at full lift, ``W = N6 C (2/3) sqrt(F_gamma xT p1 rho1)`` at the
relieving pressure ``p1 = p_set (1 + overpressure) + p_out``. A liquid relief
takes the plain valve's incompressible Cv law and its IEC liquid choke.
Sizing basis
------------
API 520 Part I (*Sizing, Selection, and Installation of Pressure-relieving
Devices -- Sizing and Selection*) sizes a gas relief at critical flow as
``W = C(k) Kd A p1 sqrt(M / (Z T))``, by orifice area and certified discharge
coefficient; ISO 4126-1 rates the same way. This valve is sized by the Cv a
datasheet gives instead, so ``Kd A`` is not an input. The choked capacity above
has API 520's form in ``p1``, ``M``, ``Z`` and ``T`` (``rho1 = p1 M / (Z R T)``);
only the dependence on ``k`` differs -- IEC's ``sqrt(F_gamma)`` against API's
``C(k)``, which puts helium 2.9 % higher relative to nitrogen here
(``sqrt(1.667/1.40)`` = 1.091 against ``C(1.667)/C(1.40)`` = 1.061). A relief
whose datasheet gives ``Kd`` and an orifice area, not a Cv, needs an area model.