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

@@ -1544,6 +1544,16 @@ def _pnl0003_energy_diagnostic(
port_1_flow = snapshot.p4_port3_remote_node_to_orifice_line_flow
port_2_flow = -snapshot.p4_port3_remote_orifice_to_node_flow
reference_temperature_k = 298.15
pn3_port_2_mass_flow_kg_s = (
snapshot.p4_port3_remote_orifice_node_balance.port_2_mass_flow_g_s * 1.0e-3
)
if abs(pn3_port_2_mass_flow_kg_s) <= 1.0e-12:
port_1_connected_h = port_1.h
else:
port_1_connected_h = (
snapshot.p4_port3_remote_orifice_node_balance.port_2_enthalpy_flow_w
/ pn3_port_2_mass_flow_kg_s
)
def amesim_value(data_path: str) -> float:
return interpolate_series_value(
@@ -1646,7 +1656,7 @@ def _pnl0003_energy_diagnostic(
current_derivative_1, current_derivative_2 = line.derivatives_from_connections(
port_1_m_flow=port_1_flow,
connected_h_1=port_1.h,
connected_h_1=port_1_connected_h,
port_2_m_flow=port_2_flow,
connected_h_2=connected_port_2.h,
)
@@ -1675,15 +1685,20 @@ def _pnl0003_energy_diagnostic(
internal_temperature_k=port_2.T,
reference_temperature_k=reference_temperature_k,
)
python_port_1_dh = _actual_reference_enthalpy_flow(
gas=line.gas,
port_m_flow=port_1_flow,
connected_pressure_pa=port_1.p,
connected_temperature_k=port_1.T,
internal_pressure_pa=port_1.p,
internal_temperature_k=port_1.T,
reference_temperature_k=reference_temperature_k,
)
if port_1_flow > 0.0:
python_port_1_dh = port_1_flow * (
port_1_connected_h - line.gas.cp * reference_temperature_k
)
else:
python_port_1_dh = _actual_reference_enthalpy_flow(
gas=line.gas,
port_m_flow=port_1_flow,
connected_pressure_pa=port_1.p,
connected_temperature_k=port_1.T,
internal_pressure_pa=port_1.p,
internal_temperature_k=port_1.T,
reference_temperature_k=reference_temperature_k,
)
python_port_2_dh = _actual_reference_enthalpy_flow(
gas=line.gas,
port_m_flow=port_2_flow,