|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Functions | |
| None | test_normal_boiling_point (str name, float T_sat, float rho_liquid) |
| None | test_critical_point (str name, float Tc, float Pc_MPa) |
| None | test_ethanol_density_at_room_temperature () |
| None | test_copv_is_not_an_ideal_gas (str name, float expected_Z) |
| None | test_compressibility_matches_the_equation_of_state () |
| None | test_tables_reproduce_the_equation_of_state (str name, str prop) |
| None | test_gamma_and_kinematic_viscosity_are_consistent () |
Variables | |
| list | NORMAL_BOILING |
| list | CRITICAL_POINTS |
| float | ATM = 101325.0 |
Does the property layer produce physically right numbers? Phase 01's exit criterion, and the only part of it that catches the failure that matters: a plumbing bug that returns *a* number rather than *the* number. Everything here is checked against values from outside this codebase. Three kinds of check, because each catches something the others cannot: * **Saturation and single-phase points** against standard reference values. Loose tolerances -- these are literature figures, not this package's output -- but they would catch a wrong species mapping, a unit error, or a molar/mass basis mix-up instantly. * **Critical points**, tightly. They are constants of the equation of state, so the only way they move is if a species now resolves to a different fluid. * **Cross-backend agreement.** Interpolated tables must reproduce the equation of state they were built from. This is the one that catches a corrupt or stale table cache, and it is the check with no external reference at all -- it asks only that the two paths agree. Note that these are *reference* points, not a validation campaign. Agreeing with CoolProp is not evidence that CoolProp is right; it is evidence that this package is asking it correctly. Physical validation against measured hardware data is Phase 12, and cannot start until there is measured hardware data.
| None test_props_reference.test_compressibility_matches_the_equation_of_state | ( | ) |
Derived Z agrees with CoolProp's own, on the backend that implements it. Z is computed here as p/(rho.R_specific.T) because the tabulated backend does not implement ``compressibility_factor``. Deriving it is only legitimate if it reproduces the real thing.
Definition at line 108 of file test_props_reference.py.
| None test_props_reference.test_copv_is_not_an_ideal_gas | ( | str | name, |
| float | expected_Z ) |
Z at a 4500 psi COPV, 293.15 K -- roughly 15% off ideal for both gases. This is the number that justifies a real-gas property layer existing at all. An ideal-gas COPV model over-predicts stored pressurant mass by about 15%, which propagates straight into how long the tanks stay pressurised.
Definition at line 96 of file test_props_reference.py.
| None test_props_reference.test_critical_point | ( | str | name, |
| float | Tc, | ||
| float | Pc_MPa ) |
The species resolves to the fluid we think it does. Read through CoolProp's trivial-property interface rather than a state query, because the critical point is a property of the substance and not of any state point.
Definition at line 69 of file test_props_reference.py.
| None test_props_reference.test_ethanol_density_at_room_temperature | ( | ) |
Liquid ethanol at 20 C, 1 atm: about 789 kg/m3. The one fluid here whose density most people can check by eye, which is exactly why it is worth pinning -- a mass/molar basis error would show up as roughly 46x, not as a subtle drift.
Definition at line 83 of file test_props_reference.py.
| None test_props_reference.test_gamma_and_kinematic_viscosity_are_consistent | ( | ) |
Derived quantities agree with the fields they are derived from.
Definition at line 148 of file test_props_reference.py.
References state.
| None test_props_reference.test_normal_boiling_point | ( | str | name, |
| float | T_sat, | ||
| float | rho_liquid ) |
Saturation temperature and liquid density at 1 atm.
Definition at line 57 of file test_props_reference.py.
| None test_props_reference.test_tables_reproduce_the_equation_of_state | ( | str | name, |
| str | prop ) |
Interpolated tables agree with the equation of state behind them. The check with no external reference: it does not ask whether either path is right, only that they are the same. That is what catches a stale table cache after a CoolProp upgrade -- a failure mode with no other symptom, because both paths keep returning confident numbers. 1e-3 relative: bicubic interpolation error, not agreement to machine precision, which tables cannot give.
Definition at line 126 of file test_props_reference.py.
| float test_props_reference.ATM = 101325.0 |
Definition at line 53 of file test_props_reference.py.
| list test_props_reference.CRITICAL_POINTS |
Definition at line 45 of file test_props_reference.py.
| list test_props_reference.NORMAL_BOILING |
Definition at line 35 of file test_props_reference.py.