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

Functions

TankSim _sim ()
list[int] _refuse (TankSim sim, int times, pytest.MonkeyPatch monkeypatch)
None test_a_retried_step_moves_all_of_its_mass (int times, pytest.MonkeyPatch monkeypatch)
None test_no_retry_is_one_explicit_step ()

Detailed Description

A vessel step that halves itself still integrates the whole step.

``TankSim._one_step`` halves a piece the equation of state refuses and tries
again. It used to return on the first piece that landed, so a step that
retried once integrated half its ``dt`` and dropped the rest of the liquid
outflow and gas exchange on the floor -- during vents and near-empty ullages,
exactly where mass matters. Checked against the arithmetic of the inputs: the
ullage's mass rate is the net gas flow, and the liquid's is the outflow.

Function Documentation

◆ _refuse()

list[int] test_vessel_step_retry._refuse ( TankSim sim,
int times,
pytest.MonkeyPatch monkeypatch )
protected
Make the tank refuse the first ``times`` candidates a step proposes.

Only candidates: the rates evaluation prices the state the sim is at,
which the equation of state has already accepted.

Definition at line 45 of file test_vessel_step_retry.py.

Referenced by test_a_retried_step_moves_all_of_its_mass().

◆ _sim()

TankSim test_vessel_step_retry._sim ( )
protected

◆ test_a_retried_step_moves_all_of_its_mass()

None test_vessel_step_retry.test_a_retried_step_moves_all_of_its_mass ( int times,
pytest.MonkeyPatch monkeypatch )

Definition at line 65 of file test_vessel_step_retry.py.

References _refuse(), and _sim().

◆ test_no_retry_is_one_explicit_step()

None test_vessel_step_retry.test_no_retry_is_one_explicit_step ( )
The common case is unchanged bit for bit: one Euler step of ``dt``.

Definition at line 84 of file test_vessel_step_retry.py.

References _sim().