15 """Verify Layer1OptimizerConfig validates bounds correctly."""
19 config = Layer1OptimizerConfig()
22 assert config.min_d_pintle_m < config.max_d_pintle_m, \
23 f
"Pintle bounds swapped: min={config.min_d_pintle_m} >= max={config.max_d_pintle_m}"
25 assert config.min_d_orifice_m < config.max_d_orifice_m, \
26 f
"Orifice bounds swapped: min={config.min_d_orifice_m} >= max={config.max_d_orifice_m}"
28 assert config.min_h_gap_m < config.max_h_gap_m, \
29 f
"Gap bounds swapped: min={config.min_h_gap_m} >= max={config.max_h_gap_m}"
31 assert config.min_n_orifices <= config.max_n_orifices, \
32 f
"Orifice count bounds swapped: min={config.min_n_orifices} > max={config.max_n_orifices}"
35 assert 0.020 <= config.min_d_pintle_m <= 0.030, \
36 f
"Min pintle diameter should be ~25mm, got {config.min_d_pintle_m*1000:.1f}mm"
37 assert 0.070 <= config.max_d_pintle_m <= 0.090, \
38 f
"Max pintle diameter should be ~80mm, got {config.max_d_pintle_m*1000:.1f}mm"
40 print(
"✓ All bounds are correctly ordered")
41 print(f
" Pintle diameter: {config.min_d_pintle_m*1000:.1f}mm to {config.max_d_pintle_m*1000:.1f}mm")
42 print(f
" Orifice diameter: {config.min_d_orifice_m*1000:.1f}mm to {config.max_d_orifice_m*1000:.1f}mm")
43 print(f
" Gap height: {config.min_h_gap_m*1000:.1f}mm to {config.max_h_gap_m*1000:.1f}mm")
44 print(f
" Orifice count: {config.min_n_orifices} to {config.max_n_orifices}")
69 """Verify bounds array used by optimizer has correct order."""
72 config = Layer1OptimizerConfig()
80 (config.min_d_pintle_m, config.max_d_pintle_m),
81 (config.min_h_gap_m, config.max_h_gap_m),
82 (config.min_n_orifices, config.max_n_orifices),
83 (config.min_d_orifice_m, config.max_d_orifice_m),
89 for i, (lower, upper)
in enumerate(bounds):
90 assert lower <= upper, \
91 f
"Bound {i} has lower ({lower}) > upper ({upper})"
95 assert span >= 0, f
"Bound {i} has negative span: {span}"
98 pintle_lower, pintle_upper = bounds[4]
99 assert pintle_lower == 0.025, f
"Pintle lower bound should be 0.025, got {pintle_lower}"
100 assert pintle_upper == 0.080, f
"Pintle upper bound should be 0.080, got {pintle_upper}"
102 print(
"✓ Bounds array is correctly ordered")
103 print(f
" Pintle bounds [4]: [{pintle_lower*1000:.1f}mm, {pintle_upper*1000:.1f}mm] (span: {(pintle_upper-pintle_lower)*1000:.1f}mm)")