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

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

Detailed Description

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.

Function Documentation

◆ test_compressibility_matches_the_equation_of_state()

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.

◆ test_copv_is_not_an_ideal_gas()

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.

◆ test_critical_point()

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.

◆ test_ethanol_density_at_room_temperature()

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.

◆ test_gamma_and_kinematic_viscosity_are_consistent()

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.

◆ test_normal_boiling_point()

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.

◆ test_tables_reproduce_the_equation_of_state()

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.

Variable Documentation

◆ ATM

float test_props_reference.ATM = 101325.0

Definition at line 53 of file test_props_reference.py.

◆ CRITICAL_POINTS

list test_props_reference.CRITICAL_POINTS
Initial value:
1= [
2 ("nitrogen", 126.192, 3.3958),
3 ("oxygen", 154.599, 5.0464),
4 ("ethanol", 514.71, 6.268),
5 ("helium", 5.195, 0.2283),
6 ("methane", 190.564, 4.5992),
7]

Definition at line 45 of file test_props_reference.py.

◆ NORMAL_BOILING

list test_props_reference.NORMAL_BOILING
Initial value:
1= [
2 ("nitrogen", 77.355, 806.1),
3 ("oxygen", 90.188, 1141.2),
4 ("ethanol", 351.57, 736.4),
5 ("helium", 4.224, 124.7),
6]

Definition at line 35 of file test_props_reference.py.