From 7182f929e8708f8cb14495594e4b976bc5f8e8ec Mon Sep 17 00:00:00 2001 From: huojiarong Date: Tue, 28 Jul 2026 02:49:02 +0000 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85test=5Fmql=20PNL0003=E5=82=A8?= =?UTF-8?q?=E8=83=BD=E8=AF=8A=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../run_test_mql_full_state_comparison.py | 32 +++++++++++++++++++ ...test_run_test_mql_full_state_comparison.py | 10 ++++++ 2 files changed, 42 insertions(+) diff --git a/PythonModels/scripts/run_test_mql_full_state_comparison.py b/PythonModels/scripts/run_test_mql_full_state_comparison.py index 93bef13..2dbd964 100644 --- a/PythonModels/scripts/run_test_mql_full_state_comparison.py +++ b/PythonModels/scripts/run_test_mql_full_state_comparison.py @@ -439,6 +439,14 @@ class TestMqlPnl0003EnergyDiagnostic: amesim_center_flow_python_sign_error_g_s: float python_center_mass_flow_g_s: float python_total_mass_derivative_kg_s: float + python_port_1_reference_external_enthalpy_flow_w: float + python_port_1_reference_center_enthalpy_flow_w: float + python_port_1_reference_storage_enthalpy_sum_w: float + python_port_1_reference_storage_enthalpy_error_w: float + python_port_2_reference_external_enthalpy_flow_w: float + python_port_2_reference_center_enthalpy_flow_w: float + python_port_2_reference_storage_enthalpy_sum_w: float + python_port_2_reference_storage_enthalpy_error_w: float amesim_port_1_temperature_derivative_fd_k_s: float amesim_port_1_temperature_derivative_backward_k_s: float amesim_port_1_temperature_derivative_forward_k_s: float @@ -1756,6 +1764,22 @@ def _pnl0003_energy_diagnostic( python_total_mass_derivative_kg_s=( current_derivative_1.m + current_derivative_2.m ), + python_port_1_reference_external_enthalpy_flow_w=python_port_1_dh, + python_port_1_reference_center_enthalpy_flow_w=python_center_dh_1, + python_port_1_reference_storage_enthalpy_sum_w=( + python_port_1_dh + python_center_dh_1 + ), + python_port_1_reference_storage_enthalpy_error_w=( + python_port_1_dh + python_center_dh_1 - amesim_sdh1 + ), + python_port_2_reference_external_enthalpy_flow_w=python_port_2_dh, + python_port_2_reference_center_enthalpy_flow_w=python_center_dh_2, + python_port_2_reference_storage_enthalpy_sum_w=( + python_port_2_dh + python_center_dh_2 + ), + python_port_2_reference_storage_enthalpy_error_w=( + python_port_2_dh + python_center_dh_2 - amesim_sdh2 + ), amesim_port_1_temperature_derivative_fd_k_s=amesim_fd_dtemp_1, amesim_port_1_temperature_derivative_backward_k_s=amesim_backward_dtemp_1, amesim_port_1_temperature_derivative_forward_k_s=amesim_forward_dtemp_1, @@ -2423,6 +2447,14 @@ def format_test_mql_pnvo_event_window_summary( f"python_center_dm={pnl0003_energy.python_center_mass_flow_g_s}, " f"python_center_dm_error={pnl0003_energy.amesim_center_flow_python_sign_error_g_s}, " f"python_dmgas_dt={pnl0003_energy.python_total_mass_derivative_kg_s}, " + f"python_ref_ext1={pnl0003_energy.python_port_1_reference_external_enthalpy_flow_w}, " + f"python_ref_ctr1={pnl0003_energy.python_port_1_reference_center_enthalpy_flow_w}, " + f"python_ref_sdh1={pnl0003_energy.python_port_1_reference_storage_enthalpy_sum_w}, " + f"python_ref_sdh1_error={pnl0003_energy.python_port_1_reference_storage_enthalpy_error_w}, " + f"python_ref_ext2={pnl0003_energy.python_port_2_reference_external_enthalpy_flow_w}, " + f"python_ref_ctr2={pnl0003_energy.python_port_2_reference_center_enthalpy_flow_w}, " + f"python_ref_sdh2={pnl0003_energy.python_port_2_reference_storage_enthalpy_sum_w}, " + f"python_ref_sdh2_error={pnl0003_energy.python_port_2_reference_storage_enthalpy_error_w}, " f"amesim_fd_dT1={pnl0003_energy.amesim_port_1_temperature_derivative_fd_k_s}, " f"amesim_back_dT1={pnl0003_energy.amesim_port_1_temperature_derivative_backward_k_s}, " f"amesim_fwd_dT1={pnl0003_energy.amesim_port_1_temperature_derivative_forward_k_s}, " diff --git a/tests/test_run_test_mql_full_state_comparison.py b/tests/test_run_test_mql_full_state_comparison.py index 0a05a58..71e2e2c 100644 --- a/tests/test_run_test_mql_full_state_comparison.py +++ b/tests/test_run_test_mql_full_state_comparison.py @@ -389,6 +389,14 @@ class RunTestMqlFullStateComparisonScriptTests(unittest.TestCase): amesim_center_flow_python_sign_error_g_s=-0.2, python_center_mass_flow_g_s=454.0, python_total_mass_derivative_kg_s=-0.47, + python_port_1_reference_external_enthalpy_flow_w=80.0, + python_port_1_reference_center_enthalpy_flow_w=15800.0, + python_port_1_reference_storage_enthalpy_sum_w=15880.0, + python_port_1_reference_storage_enthalpy_error_w=-28.7, + python_port_2_reference_external_enthalpy_flow_w=19000.0, + python_port_2_reference_center_enthalpy_flow_w=-15800.0, + python_port_2_reference_storage_enthalpy_sum_w=3200.0, + python_port_2_reference_storage_enthalpy_error_w=172.0, amesim_port_1_temperature_derivative_fd_k_s=-210.0, amesim_port_1_temperature_derivative_backward_k_s=-420.0, amesim_port_1_temperature_derivative_forward_k_s=100.0, @@ -581,6 +589,8 @@ class RunTestMqlFullStateComparisonScriptTests(unittest.TestCase): self.assertIn("python_center_dm=454.0", summary) self.assertIn("python_center_dm_error=-0.2", summary) self.assertIn("python_dmgas_dt=-0.47", summary) + self.assertIn("python_ref_sdh1=15880.0", summary) + self.assertIn("python_ref_sdh2_error=172.0", summary) self.assertIn("amesim_back_dT2=-600.0", summary) self.assertIn("amesim_fwd_dT2=120.0", summary) self.assertIn("amesim_pn2vol_dT2=-530.0", summary)