修正test_mql PNL0003节点混合焓

This commit is contained in:
huojiarong committed 2026-07-28 03:33:10 +00:00
1 parent 7182f929e8
commit 8a2d2ae190
3 files changed
+73 -11

No files matched your search

+27
View File
@@ -792,6 +792,33 @@ class TestMqlPn3P4NodeChamberSegmentTests(unittest.TestCase):
].opening,
1.0,
)
remote_orifice_line = (
closure.pneumatic_closure.components.p4_port3_remote_orifice_line
)
custom_port_1_h = open_snapshot.p4_port3_remote_orifice_line_port_1.h + 1234.0
custom_d1, _ = closure.pneumatic_closure._two_state_connection_line_derivatives(
line=remote_orifice_line,
port_1_properties=open_snapshot.p4_port3_remote_orifice_line_port_1,
port_1_flow=0.01,
port_2_connected_properties=open_snapshot.p4_port3_remote_primary_line,
port_2_flow=-open_snapshot.p4_port3_remote_orifice_to_node_flow,
port_1_connected_h=custom_port_1_h,
)
expected_custom_d1, _ = remote_orifice_line.derivatives_from_connections(
port_1_m_flow=0.01,
connected_h_1=custom_port_1_h,
port_2_m_flow=-open_snapshot.p4_port3_remote_orifice_to_node_flow,
connected_h_2=open_snapshot.p4_port3_remote_primary_line.h,
)
default_d1, _ = closure.pneumatic_closure._two_state_connection_line_derivatives(
line=remote_orifice_line,
port_1_properties=open_snapshot.p4_port3_remote_orifice_line_port_1,
port_1_flow=0.01,
port_2_connected_properties=open_snapshot.p4_port3_remote_primary_line,
port_2_flow=-open_snapshot.p4_port3_remote_orifice_to_node_flow,
)
self.assertAlmostEqual(custom_d1.U, expected_custom_d1.U)
self.assertNotAlmostEqual(custom_d1.U, default_d1.U)
closure.snapshot_at(0.0, state)
self.assertAlmostEqual(
self.system.pneumatic_assembly.variable_orifices[