接入test_mql pneumatic_69传输焓RHS

This commit is contained in:
huojiarong committed 2026-07-28 02:20:33 +00:00
1 parent f8af99ace1
commit 021ea63a2b
6 files changed
+96 -24

No files matched your search

+15 -12
View File
@@ -4190,21 +4190,24 @@ class TestMqlFullStateClosure:
chamber_properties = getattr(snapshot.pneumatic, chamber_field)
chamber_to_line_flow = getattr(snapshot.pneumatic, chamber_flow_field)
node_to_line_flow = getattr(snapshot.pneumatic, node_flow_field)
line_derivative = line.derivatives_from_connections(
p4_balance = snapshot.pneumatic.p4_port3_remote_balance
p4_port_2_mass_flow_kg_s = p4_balance.port_2_mass_flow_g_s * 1.0e-3
node_connected_h = (
line_properties.h
if abs(p4_port_2_mass_flow_kg_s) <= 1.0e-12
else p4_balance.port_2_enthalpy_flow_w / p4_port_2_mass_flow_kg_s
)
line_derivative = line.derivatives_from_transport_enthalpy_connections(
port_1_m_flow=chamber_to_line_flow,
connected_h_1=chamber_properties.h,
port_2_m_flow=node_to_line_flow,
connected_h_2=line_properties.h,
connected_h_2=node_connected_h,
)
port_1_inlet_u = (
chamber_properties.h / line.gas.gamma
if chamber_to_line_flow > 0.0
else line_properties.u
port_1_inlet_h = (
chamber_properties.h if chamber_to_line_flow > 0.0 else line_properties.h
)
port_2_inlet_u = (
line_properties.h / line.gas.gamma
if node_to_line_flow > 0.0
else line_properties.u
port_2_inlet_h = (
node_connected_h if node_to_line_flow > 0.0 else line_properties.h
)
thermal_energy_flow = (
line.heat_transfer_coefficient
@@ -4221,8 +4224,8 @@ class TestMqlFullStateClosure:
chamber_to_line_flow_kg_s=chamber_to_line_flow,
node_to_line_flow_kg_s=node_to_line_flow,
mass_derivative_kg_s=line_derivative.m,
port_1_energy_flow_w=chamber_to_line_flow * port_1_inlet_u,
port_2_energy_flow_w=node_to_line_flow * port_2_inlet_u,
port_1_energy_flow_w=chamber_to_line_flow * port_1_inlet_h,
port_2_energy_flow_w=node_to_line_flow * port_2_inlet_h,
thermal_energy_flow_w=thermal_energy_flow,
energy_derivative_w=line_derivative.U,
)
+25 -2
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 _p4_node_port_2_connected_h(
*,
balance: TestMqlPneumaticNode4Balance,
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
def _p4_node_balance(
self,
*,
@@ -2073,12 +2084,20 @@ class TestMqlPn3P4NodeChamberSegmentClosure:
chamber_properties: ThermodynamicProperties,
chamber_to_line_flow: float,
node_to_line_flow: float,
node_connected_h: float | None = None,
) -> tuple[VolumeState, VolumeState]:
line_derivative = line.derivatives_from_connections(
derivative_method = (
line.derivatives_from_connections
if node_connected_h is None
else line.derivatives_from_transport_enthalpy_connections
)
line_derivative = derivative_method(
port_1_m_flow=chamber_to_line_flow,
connected_h_1=chamber_properties.h,
port_2_m_flow=node_to_line_flow,
connected_h_2=line_properties.h,
connected_h_2=(
line_properties.h if node_connected_h is None else node_connected_h
),
)
chamber_derivative = chamber.derivatives_from_two_connections(
port_a_m_flow=-chamber_to_line_flow,
@@ -2791,6 +2810,10 @@ class TestMqlPn3P4NodeChamberSegmentClosure:
chamber_properties=snapshot.p4_port3_remote_primary_chamber,
chamber_to_line_flow=snapshot.p4_port3_remote_chamber_to_line_flow,
node_to_line_flow=snapshot.p4_port3_remote_node_to_primary_line_flow,
node_connected_h=self._p4_node_port_2_connected_h(
balance=snapshot.p4_port3_remote_balance,
fallback_h=snapshot.p4_port3_remote_primary_line.h,
),
)
p4_port3_remote_port3_derivative = self._connection_line_derivative(
line=self.components.p4_port3_remote_port3_line,