添加test_mql pneumatic_96局部参考RHS候选

This commit is contained in:
huojiarong committed 2026-07-29 08:38:37 +00:00
1 parent 71da73ef70
commit a8a68f6dd4
5 files changed
+162 -2

No files matched your search

+34
View File
@@ -744,6 +744,40 @@ class TestMqlPn3P4NodeChamberSegmentTests(unittest.TestCase):
+ diagnostic.thermal_energy_flow_w,
)
def test_full_state_closure_can_enable_pneumatic_96_reference_rhs_candidate(
self,
) -> None:
default_closure = self.system.full_state_closure_from_spec(
self.spec,
inlet_node_pressure_pa=15.31e6,
resistance_boundary_pressure_pa=15.29e6,
)
candidate_closure = self.system.full_state_closure_from_spec(
self.spec,
inlet_node_pressure_pa=15.31e6,
resistance_boundary_pressure_pa=15.29e6,
use_pneumatic_96_reference_rhs=True,
)
state = default_closure.initial_state_vector()
default_rhs = default_closure.rhs_at(0.04, state)
candidate_rhs = candidate_closure.rhs_at(0.04, state)
snapshot = candidate_closure.snapshot_at(0.04, state).pneumatic
line = candidate_closure.pneumatic_closure.components.inlet_line
expected = candidate_closure.pneumatic_closure._pnl0001_reference_enthalpy_derivative(
line=line,
line_properties=snapshot.inlet_line,
port_1_properties=snapshot.p4_port3_remote_orifice_line_port_1,
port_1_flow=snapshot.inlet_node_to_line_flow,
port_2_properties=snapshot.chamber,
port_2_flow=-snapshot.inlet_line_to_chamber_flow,
)
self.assertAlmostEqual(candidate_rhs[0], default_rhs[0])
self.assertAlmostEqual(candidate_rhs[0], expected.m)
self.assertAlmostEqual(candidate_rhs[1], expected.U)
self.assertNotAlmostEqual(candidate_rhs[1], default_rhs[1])
def test_full_state_closure_applies_step_controls_to_variable_orifices(self) -> None:
closure = self.system.full_state_closure_from_spec(
self.spec,