修正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

+21 -1
View File
@@ -1913,6 +1913,17 @@ class TestMqlPn3P4NodeChamberSegmentClosure:
port_3_mass_flow_g_s=port_3.port_mass_flow_kg_s * 1.0e3,
)
@staticmethod
def _pn3_node_port_2_connected_h(
*,
balance: TestMqlPneumaticNode3Balance,
fallback_h: float,
) -> float:
mass_flow_kg_s = balance.port_2_mass_flow_g_s * 1.0e-3
if abs(mass_flow_kg_s) <= 1.0e-12:
return fallback_h
return balance.port_2_enthalpy_flow_w / mass_flow_kg_s
@staticmethod
def _p4_node_port_2_connected_h(
*,
@@ -2197,10 +2208,15 @@ class TestMqlPn3P4NodeChamberSegmentClosure:
port_1_flow: float,
port_2_connected_properties: ThermodynamicProperties,
port_2_flow: float,
port_1_connected_h: float | None = None,
) -> tuple[VolumeState, VolumeState]:
return line.derivatives_from_connections(
port_1_m_flow=port_1_flow,
connected_h_1=port_1_properties.h,
connected_h_1=(
port_1_properties.h
if port_1_connected_h is None
else port_1_connected_h
),
port_2_m_flow=port_2_flow,
connected_h_2=port_2_connected_properties.h,
)
@@ -2884,6 +2900,10 @@ class TestMqlPn3P4NodeChamberSegmentClosure:
port_1_flow=snapshot.p4_port3_remote_node_to_orifice_line_flow,
port_2_connected_properties=snapshot.p4_port3_remote_primary_line,
port_2_flow=-snapshot.p4_port3_remote_orifice_to_node_flow,
port_1_connected_h=self._pn3_node_port_2_connected_h(
balance=snapshot.p4_port3_remote_orifice_node_balance,
fallback_h=snapshot.p4_port3_remote_orifice_line_port_1.h,
),
)
(
p4_port3_next_orifice_derivative_1,