STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
test_gas_choking Namespace Reference

Functions

object valve (float Cv, float bore_mm, **params)
 gas (float mw, float gamma, float p_upstream, float temperature)
float library_mdot (Cv, mw, gamma, p1, temperature, bore, p2=101325.0)
None test_the_ceiling_matches_the_library (name, Cv, mw, gamma, p1, T, bore)
None test_a_gas_vent_to_atmosphere_reports_choked ()
None test_a_small_pressure_ratio_is_not_choked ()
None test_helium_and_nitrogen_choke_at_different_ratios ()
None test_a_liquid_valve_still_has_no_gas_ceiling ()
None test_a_liquid_priced_by_the_network_has_no_gas_ceiling (str species, float T)
None test_a_liquid_valve_to_atmosphere_is_the_iec_liquid_law (str species, float T, float p1_psia)
float _swept (float p1, float p2, float Cv=4.0)
None test_gas_flow_rises_continuously_to_the_choke_and_stays ()
None test_a_choked_gas_valve_meets_its_ceiling_continuously ()
None test_a_shut_valve_has_no_ceiling ()
None test_xT_moves_the_ceiling ()

Variables

float PSI = 6894.757293168361
float R_UNIVERSAL_J = 8.31446261815324 * 1000.0
float KV_PER_CV = 1.0 / 1.1560992283536566
tuple HELIUM = (4.0026, 1.667)
tuple NITROGEN = (28.014, 1.40)
int SCALE = 2e-3
list CASES
 R037_DEFERRED

Detailed Description

A valve on a gas line, at and past its critical pressure ratio.

Every vent and every press solenoid on a stand is a valve passing gas, and until
this existed none of them could choke: `Valve.choked_dp` is the IEC 60534 *liquid*
flashing model and returns None for a gas, so the base class reported no ceiling
and the incompressible Cv law ran unbounded. Measured on a 550 psi tank vented to
atmosphere, that was 2.5x to 5.5x the sonic mass flow depending on bore.

Below the choke a gas valve is IEC 60534-2-1 with its expansion factor too
(``feedtwin.comps.iec_gas.GasCv``): the incompressible law up to a separate
ceiling never met it, and the flow *fell* 36 % as the downstream did.

Function Documentation

◆ _swept()

float test_gas_choking._swept ( float p1,
float p2,
float Cv = 4.0 )
protected
A Cv 4 valve between two fixed nitrogen pressures, solved.

Definition at line 208 of file test_gas_choking.py.

References valve().

Referenced by test_a_choked_gas_valve_meets_its_ceiling_continuously(), and test_gas_flow_rises_continuously_to_the_choke_and_stays().

◆ gas()

◆ library_mdot()

float test_gas_choking.library_mdot ( Cv,
mw,
gamma,
p1,
temperature,
bore,
p2 = 101325.0 )
What `fluids` says the same valve passes at ``p2``. The reference.

``fluids`` takes Q as volume at **0 degC** and 1 atm (its docstring, and the
N9 it uses). This reference used to read it at 15 degC, exactly as the
valve's own calibration did -- so the two agreed to 1e-6 while both were
5.4 % low.

Definition at line 64 of file test_gas_choking.py.

Referenced by test_gas_flow_rises_continuously_to_the_choke_and_stays(), and test_the_ceiling_matches_the_library().

◆ test_a_choked_gas_valve_meets_its_ceiling_continuously()

None test_gas_choking.test_a_choked_gas_valve_meets_its_ceiling_continuously ( )
Just under the critical ratio the flow is within a hair of the ceiling;
the old law was 50 % above it there.

Definition at line 242 of file test_gas_choking.py.

References _swept(), and valve().

◆ test_a_gas_vent_to_atmosphere_reports_choked()

None test_gas_choking.test_a_gas_vent_to_atmosphere_reports_choked ( )

Definition at line 114 of file test_gas_choking.py.

References gas(), and valve().

◆ test_a_liquid_priced_by_the_network_has_no_gas_ceiling()

None test_gas_choking.test_a_liquid_priced_by_the_network_has_no_gas_ceiling ( str species,
float T )
The conditions a network builds for a liquid carry the saturated
liquid's cp/cv (LOX 1.83, ethanol 1.19), and the old gas test (gamma > 0)
read that as a gas: every liquid valve got a sonic ceiling at
x = gamma/1.4 * 0.7, and a LOX dump to atmosphere drained at 0.69x IEC.

Definition at line 154 of file test_gas_choking.py.

References valve().

◆ test_a_liquid_valve_still_has_no_gas_ceiling()

None test_gas_choking.test_a_liquid_valve_still_has_no_gas_ceiling ( )
LOX through a main valve must not acquire a sonic limit.

Definition at line 132 of file test_gas_choking.py.

References valve().

◆ test_a_liquid_valve_to_atmosphere_is_the_iec_liquid_law()

None test_gas_choking.test_a_liquid_valve_to_atmosphere_is_the_iec_liquid_law ( str species,
float T,
float p1_psia )
Solved through a network, a Cv 1 valve discharging liquid to atmosphere
passes what fluids' IEC 60534 liquid sizing gives for the same drop
(non-choked form: the incompressible law is the one the twin solves; the
IEC liquid choke is reported by ``choked_dp``, not imposed).

Definition at line 173 of file test_gas_choking.py.

References valve().

◆ test_a_shut_valve_has_no_ceiling()

None test_gas_choking.test_a_shut_valve_has_no_ceiling ( )
Nothing flows, so there is nothing to limit -- and a zero ceiling would
pin the branch at zero rather than let `isolates()` remove it.

Definition at line 255 of file test_gas_choking.py.

References gas(), and valve().

◆ test_a_small_pressure_ratio_is_not_choked()

None test_gas_choking.test_a_small_pressure_ratio_is_not_choked ( )
Choking starts at x = (gamma/1.40) * xT, not at any drop.

Definition at line 119 of file test_gas_choking.py.

References gas(), and valve().

◆ test_gas_flow_rises_continuously_to_the_choke_and_stays()

None test_gas_choking.test_gas_flow_rises_continuously_to_the_choke_and_stays ( )
IEC 60534-2-1: W = N6 C Y sqrt(x p1 rho1), Y = 1 - x/(3 F_gamma xT).

The plain valve used Y = 1 below a separately calibrated ceiling: at
500 psia, 140 psia downstream it passed 0.956 kg/s (IEC 0.628, 1.52x), and
at 130 psia 0.609 -- flow *falling* 36 % as the downstream fell 10 psi.

Definition at line 221 of file test_gas_choking.py.

References _swept(), and library_mdot().

◆ test_helium_and_nitrogen_choke_at_different_ratios()

None test_gas_choking.test_helium_and_nitrogen_choke_at_different_ratios ( )
F_gamma carries the specific-heat ratio; it is why the two gases differ.

Definition at line 125 of file test_gas_choking.py.

References gas(), and valve().

◆ test_the_ceiling_matches_the_library()

None test_gas_choking.test_the_ceiling_matches_the_library ( name,
Cv,
mw,
gamma,
p1,
T,
bore )
Against `fluids`' own IEC 60534 implementation, not against arithmetic.

The coefficient is calibrated from that library rather than transcribed,
because the published N6 depends on which unit set *and* which flow
coefficient the table is written for -- pairing N6 = 27.3 with Cv and kPa
over-predicts by 10.5x, which is how this was first written.

Definition at line 102 of file test_gas_choking.py.

References gas(), library_mdot(), and valve().

◆ test_xT_moves_the_ceiling()

None test_gas_choking.test_xT_moves_the_ceiling ( )
A butterfly (xT ~ 0.3) chokes lower and passes less than a globe.

Definition at line 264 of file test_gas_choking.py.

References gas(), and valve().

◆ valve()

Variable Documentation

◆ CASES

list test_gas_choking.CASES
Initial value:
1= [
2 ("helium 3/8in vent", 3.8, *HELIUM, 550 * PSI, 293.15, 0.00953),
3 ("helium regulator", 1.6, *HELIUM, 4500 * PSI, 293.15, 0.00775),
4 ("nitrogen 3/8in", 8.0, *NITROGEN, 1000 * PSI, 293.15, 0.00953),
5 ("nitrogen cold 1/4in", 1.7, *NITROGEN, 200 * PSI, 250.0, 0.00635),
6 ("helium 1in dump", 60.0, *HELIUM, 550 * PSI, 293.15, 0.0254),
7]

Definition at line 92 of file test_gas_choking.py.

◆ HELIUM

tuple test_gas_choking.HELIUM = (4.0026, 1.667)

Definition at line 30 of file test_gas_choking.py.

◆ KV_PER_CV

float test_gas_choking.KV_PER_CV = 1.0 / 1.1560992283536566

Definition at line 28 of file test_gas_choking.py.

◆ NITROGEN

tuple test_gas_choking.NITROGEN = (28.014, 1.40)

Definition at line 31 of file test_gas_choking.py.

◆ PSI

float test_gas_choking.PSI = 6894.757293168361

Definition at line 26 of file test_gas_choking.py.

◆ R037_DEFERRED

test_gas_choking.R037_DEFERRED
Initial value:
1= pytest.mark.xfail(
2 strict=True, reason="R037 deferred: liquids keep the old gas ceiling"
3)

Definition at line 145 of file test_gas_choking.py.

◆ R_UNIVERSAL_J

float test_gas_choking.R_UNIVERSAL_J = 8.31446261815324 * 1000.0

Definition at line 27 of file test_gas_choking.py.

◆ SCALE

int test_gas_choking.SCALE = 2e-3

Definition at line 61 of file test_gas_choking.py.