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

Functions

Regulator make (str model="droop", **object overrides)
float outlet (Regulator reg, float mdot, float p_in)
float gauge (float psig)
None test_the_supply_effect_is_measured_from_zero_inlet ()
None test_outlet_rises_as_the_bottle_empties ()
None test_supply_effect_matches_the_datasheet_number ()
None test_the_datasheet_rate_can_be_written_three_ways ()
None test_a_drawn_inlet_reference_is_not_used_and_is_flagged ()
None test_flow_droop_is_a_separate_coefficient ()
None test_flow_droop_is_linear_in_rated_fraction ()
None test_droop_without_a_rated_flow_is_flagged ()
None test_the_two_effects_oppose_each_other ()
None test_a_regulator_never_raises_pressure ()
None test_lockup_sets_the_no_flow_outlet ()
None test_saturation_is_reported_not_hidden ()
None test_saturated_outlet_is_set_by_the_seat ()
None test_running_past_the_rated_flow_is_flagged_not_clamped ()
None test_an_assumed_rated_flow_is_flagged ()
None test_dropout_below_minimum_differential ()
None test_assumed_droop_is_flagged_as_a_missing_measurement ()
None test_ideal_model_is_flat_and_named ()
None test_droop_and_ideal_agree_with_no_supply_effect ()
None test_diagnostics_report_the_droop_from_setpoint ()
Regulator dome_loaded (**object overrides)
None test_a_dome_regulator_outlet_is_dome_plus_bias ()
None test_the_bias_is_not_folded_into_the_setpoint ()
None test_the_control_regulator_can_be_turned_during_a_run ()
None test_a_signal_beats_the_configured_dome ()
None test_droop_rides_on_the_dome_setting_not_on_the_configured_setpoint ()
None test_lockup_follows_the_dome ()
tuple[float, float, float] outlet_either_side (Regulator reg, float p_in)
None test_lockup_carries_the_supply_effect_so_the_outlet_is_continuous ()
None test_lockup_still_adds_the_seat_creep ()
None test_with_no_supply_effect_lockup_is_the_setpoint ()
None test_a_bias_with_no_dome_is_flagged ()
None test_an_ideal_regulator_still_honours_the_dome ()
None test_a_perfect_regulator_makes_its_branch_indeterminate ()

Variables

 PSI = get_unit("psi").factor
 GAS = FlowConditions(rho=39.0, mu=1.78e-5, p_upstream=4500 * PSI, temperature=293.15)
 M = Provenance.MANUFACTURER

Detailed Description

The regulator: spec-sheet droop, and the two effects it is made of.

Everything here is checked against numbers a datasheet actually prints. The
model has no geometry in it on purpose -- see
:mod:`feedtwin.comps.regulator` for why a diaphragm force balance was
abandoned rather than deferred out of laziness.

The team's dome regulator is the worked example throughout: the Aqua
Environment 1092-50, 500 psi setpoint, 17 psi of outlet rise per 1000 psi of
inlet decay -- declared in the datasheet's own units, not as a bare ratio.

Function Documentation

◆ dome_loaded()

◆ gauge()

◆ make()

◆ outlet()

◆ outlet_either_side()

tuple[float, float, float] test_regulator.outlet_either_side ( Regulator reg,
float p_in )
Outlet just backwards, at, and just forwards of zero flow [psi].

Definition at line 428 of file test_regulator.py.

Referenced by test_lockup_carries_the_supply_effect_so_the_outlet_is_continuous(), test_lockup_still_adds_the_seat_creep(), and test_with_no_supply_effect_lockup_is_the_setpoint().

◆ test_a_bias_with_no_dome_is_flagged()

None test_regulator.test_a_bias_with_no_dome_is_flagged ( )
A 50 psi offset that silently is not applied is worse than none.

Definition at line 465 of file test_regulator.py.

References make().

◆ test_a_dome_regulator_outlet_is_dome_plus_bias()

None test_regulator.test_a_dome_regulator_outlet_is_dome_plus_bias ( )
The 1092-50 delivers 50 psi above whatever its dome is loaded to.

Definition at line 341 of file test_regulator.py.

References dome_loaded(), gauge(), and outlet().

◆ test_a_drawn_inlet_reference_is_not_used_and_is_flagged()

None test_regulator.test_a_drawn_inlet_reference_is_not_used_and_is_flagged ( )
An old drawing's ``inlet_reference`` still loads, moves nothing, and
check() says to drop it.

Definition at line 124 of file test_regulator.py.

References gauge(), make(), and outlet().

◆ test_a_perfect_regulator_makes_its_branch_indeterminate()

None test_regulator.test_a_perfect_regulator_makes_its_branch_indeterminate ( )
With zero flow droop the branch equation ``(p_up - p_dn) - dp(mdot) = 0``
is satisfied for *every* mass flow, so its Jacobian row is identically zero
and the flow is genuinely undetermined. ``check()`` must say so before
anyone spends an afternoon on a solve that will not converge. (Found by the
old transient integrator, and kept when it went.)

Definition at line 480 of file test_regulator.py.

◆ test_a_regulator_never_raises_pressure()

None test_regulator.test_a_regulator_never_raises_pressure ( )
Inlet below setpoint: the outlet follows the inlet down.

It does not track the inlet *exactly*, and that is right rather than a
rounding error -- a wide-open regulator is still a restriction, so the
outlet sits one seat-loss below the inlet. What must never happen is an
outlet above the inlet, which is what a naive ``p_in - (p_in - setpoint)``
would produce the moment the bottle falls below setpoint.

Definition at line 190 of file test_regulator.py.

References make(), and outlet().

◆ test_a_signal_beats_the_configured_dome()

None test_regulator.test_a_signal_beats_the_configured_dome ( )

Definition at line 381 of file test_regulator.py.

References dome_loaded().

◆ test_an_assumed_rated_flow_is_flagged()

None test_regulator.test_an_assumed_rated_flow_is_flagged ( )
The droop scales with rated_flow; a fallback one is as unmeasured as a
fallback droop.

Definition at line 267 of file test_regulator.py.

References make().

◆ test_an_ideal_regulator_still_honours_the_dome()

None test_regulator.test_an_ideal_regulator_still_honours_the_dome ( )

Definition at line 471 of file test_regulator.py.

References make(), and outlet().

◆ test_assumed_droop_is_flagged_as_a_missing_measurement()

None test_regulator.test_assumed_droop_is_flagged_as_a_missing_measurement ( )
An unstated coefficient must not look like a perfect regulator.

Definition at line 294 of file test_regulator.py.

References make().

◆ test_diagnostics_report_the_droop_from_setpoint()

None test_regulator.test_diagnostics_report_the_droop_from_setpoint ( )

Definition at line 322 of file test_regulator.py.

References gauge(), and make().

◆ test_droop_and_ideal_agree_with_no_supply_effect()

None test_regulator.test_droop_and_ideal_agree_with_no_supply_effect ( )

Definition at line 315 of file test_regulator.py.

References make(), and outlet().

◆ test_droop_rides_on_the_dome_setting_not_on_the_configured_setpoint()

None test_regulator.test_droop_rides_on_the_dome_setting_not_on_the_configured_setpoint ( )
Both droop terms are relative to what the regulator was *told* to hold.

Definition at line 392 of file test_regulator.py.

References dome_loaded(), and gauge().

◆ test_droop_without_a_rated_flow_is_flagged()

None test_regulator.test_droop_without_a_rated_flow_is_flagged ( )

Definition at line 168 of file test_regulator.py.

References make().

◆ test_dropout_below_minimum_differential()

None test_regulator.test_dropout_below_minimum_differential ( )

Definition at line 283 of file test_regulator.py.

References make().

◆ test_flow_droop_is_a_separate_coefficient()

None test_regulator.test_flow_droop_is_a_separate_coefficient ( )
Cv does not produce it. This is the correction Rev D of the plan needed.

At a tenth of rated flow the wide-open seat loses a couple of psi while a
real unit has already drooped by ten. If Cv alone produced droop, these two
regulators -- identical but for ``flow_droop`` -- would agree.

Definition at line 138 of file test_regulator.py.

References make(), and outlet().

◆ test_flow_droop_is_linear_in_rated_fraction()

None test_regulator.test_flow_droop_is_linear_in_rated_fraction ( )

Definition at line 155 of file test_regulator.py.

References make(), and outlet().

◆ test_ideal_model_is_flat_and_named()

None test_regulator.test_ideal_model_is_flat_and_named ( )
Distinguishable from a droop model with zero coefficients, on purpose.

Definition at line 306 of file test_regulator.py.

References make(), and outlet().

◆ test_lockup_carries_the_supply_effect_so_the_outlet_is_continuous()

None test_regulator.test_lockup_carries_the_supply_effect_so_the_outlet_is_continuous ( )
The supply effect is the inlet pushing on the poppet; it does not stop when the
flow does. Leaving it out of lockup put a step of the whole supply term in the
branch at zero flow -- 76 psi with a full bottle, now that it is measured from
zero -- and a tank inside that step has no root.

Definition at line 436 of file test_regulator.py.

References gauge(), make(), and outlet_either_side().

◆ test_lockup_follows_the_dome()

None test_regulator.test_lockup_follows_the_dome ( )
What a downstream relief sees between firings moves with the knob.

Definition at line 413 of file test_regulator.py.

References dome_loaded(), and gauge().

◆ test_lockup_sets_the_no_flow_outlet()

None test_regulator.test_lockup_sets_the_no_flow_outlet ( )
What a downstream relief valve actually sees between firings.

Definition at line 215 of file test_regulator.py.

References gauge(), make(), and outlet().

◆ test_lockup_still_adds_the_seat_creep()

None test_regulator.test_lockup_still_adds_the_seat_creep ( )

Definition at line 451 of file test_regulator.py.

References gauge(), make(), and outlet_either_side().

◆ test_outlet_rises_as_the_bottle_empties()

None test_regulator.test_outlet_rises_as_the_bottle_empties ( )
The sign people guess wrong: outlet goes UP as inlet goes DOWN.

Definition at line 88 of file test_regulator.py.

References make(), and outlet().

◆ test_running_past_the_rated_flow_is_flagged_not_clamped()

None test_regulator.test_running_past_the_rated_flow_is_flagged_not_clamped ( )
A datasheet droop is quoted at its rated flow. LE4's regulator ran at
2.7-3.2x its (default) 0.05 kg/s for the whole burn, extrapolating 54-64 psi
of droop, and nothing said so. The physics stays linear; the envelope says
how far past the characterisation it is.

Definition at line 245 of file test_regulator.py.

References make().

◆ test_saturated_outlet_is_set_by_the_seat()

None test_regulator.test_saturated_outlet_is_set_by_the_seat ( )

Definition at line 236 of file test_regulator.py.

References make().

◆ test_saturation_is_reported_not_hidden()

None test_regulator.test_saturation_is_reported_not_hidden ( )
Past its capacity a regulator is a hole, and should say so.

Definition at line 225 of file test_regulator.py.

References make().

◆ test_supply_effect_matches_the_datasheet_number()

None test_regulator.test_supply_effect_matches_the_datasheet_number ( )
17 psi per 1000 psi, checked as the quoted rate and over a full decay.

Definition at line 94 of file test_regulator.py.

References gauge(), make(), and outlet().

◆ test_the_bias_is_not_folded_into_the_setpoint()

None test_regulator.test_the_bias_is_not_folded_into_the_setpoint ( )
Two regulators, same dome, different bias. They must differ by the bias.

Folding the bias into the dome setting would make every scenario responsible
for remembering to add 50 psi, and one day one of them would not.

Definition at line 350 of file test_regulator.py.

References dome_loaded(), and make().

◆ test_the_control_regulator_can_be_turned_during_a_run()

None test_regulator.test_the_control_regulator_can_be_turned_during_a_run ( )
The dome is a signal, because on the stand it is a hand on a knob.

Definition at line 362 of file test_regulator.py.

References dome_loaded().

◆ test_the_datasheet_rate_can_be_written_three_ways()

None test_regulator.test_the_datasheet_rate_can_be_written_three_ways ( )
psi/1000psi, psi/100psi and psi/psi are the same number, and `-` is not.

The whole point of giving this parameter its own dimension: a bare ratio
reads the same whether the author meant 17 per thousand or 17 per hundred,
and the solver cannot tell. Spelling the unit out makes the three agree and
makes the fourth an error at load.

Definition at line 106 of file test_regulator.py.

References at(), make(), and outlet().

◆ test_the_supply_effect_is_measured_from_zero_inlet()

None test_regulator.test_the_supply_effect_is_measured_from_zero_inlet ( )
dome + bias - S x inlet, the inlet in gauge: a 1092-50 loaded to 500 with
4000 psi of COPV behind it holds 500 + 50 - 4 x 14.7 = 491.2 psi. Not the
setpoint at some charge pressure and the effect only beyond it (the team,
2026-10-07).

Definition at line 70 of file test_regulator.py.

References gauge(), make(), and outlet().

◆ test_the_two_effects_oppose_each_other()

None test_regulator.test_the_two_effects_oppose_each_other ( )
Inlet decay lifts the outlet; flow pulls it down. Both, at once.

Definition at line 173 of file test_regulator.py.

References gauge(), make(), and outlet().

◆ test_with_no_supply_effect_lockup_is_the_setpoint()

None test_regulator.test_with_no_supply_effect_lockup_is_the_setpoint ( )
A zero coefficient or the ideal model: nothing comes off for the inlet.

Definition at line 457 of file test_regulator.py.

References gauge(), make(), and outlet_either_side().

Variable Documentation

◆ GAS

test_regulator.GAS = FlowConditions(rho=39.0, mu=1.78e-5, p_upstream=4500 * PSI, temperature=293.15)

Definition at line 31 of file test_regulator.py.

◆ M

test_regulator.M = Provenance.MANUFACTURER

Definition at line 33 of file test_regulator.py.

◆ PSI

test_regulator.PSI = get_unit("psi").factor

Definition at line 28 of file test_regulator.py.