补充test_mql PNL0003储气质量诊断

This commit is contained in:
huojiarong committed 2026-07-28 10:35:14 +00:00
1 parent fc46c4272a
commit 920ee336e9
2 files changed
+31

No files matched your search

@@ -435,6 +435,12 @@ class TestMqlPnl0003EnergyDiagnostic:
amesim_port_1_storage_enthalpy_sum_w: float
amesim_port_2_storage_mass_derivative_g_s: float
amesim_port_2_storage_enthalpy_sum_w: float
amesim_port_1_mass_estimate_g: float
amesim_port_2_mass_estimate_g: float
python_port_1_mass_g: float
python_port_2_mass_g: float
python_port_1_mass_error_to_amesim_g: float
python_port_2_mass_error_to_amesim_g: float
amesim_total_mass_derivative_fd_g_s: float
amesim_total_mass_derivative_backward_g_s: float
amesim_total_mass_derivative_forward_g_s: float
@@ -1946,6 +1952,16 @@ def _pnl0003_energy_diagnostic(
amesim_port_1_storage_enthalpy_sum_w=amesim_sdh1,
amesim_port_2_storage_mass_derivative_g_s=amesim_sdm2_kg_s * 1.0e3,
amesim_port_2_storage_enthalpy_sum_w=amesim_sdh2,
amesim_port_1_mass_estimate_g=amesim_mass_1 * 1.0e3,
amesim_port_2_mass_estimate_g=amesim_mass_2 * 1.0e3,
python_port_1_mass_g=line.state_1.m * 1.0e3,
python_port_2_mass_g=line.state_2.m * 1.0e3,
python_port_1_mass_error_to_amesim_g=(
line.state_1.m * 1.0e3 - amesim_mass_1 * 1.0e3
),
python_port_2_mass_error_to_amesim_g=(
line.state_2.m * 1.0e3 - amesim_mass_2 * 1.0e3
),
amesim_total_mass_derivative_fd_g_s=amesim_total_mass_derivative_fd,
amesim_total_mass_derivative_backward_g_s=(
amesim_total_mass_derivative_backward
@@ -2686,6 +2702,12 @@ def format_test_mql_pnvo_event_window_summary(
f"amesim_sdh1={pnl0003_energy.amesim_port_1_storage_enthalpy_sum_w}, "
f"amesim_sdm2={pnl0003_energy.amesim_port_2_storage_mass_derivative_g_s}, "
f"amesim_sdh2={pnl0003_energy.amesim_port_2_storage_enthalpy_sum_w}, "
f"amesim_m1={pnl0003_energy.amesim_port_1_mass_estimate_g}, "
f"amesim_m2={pnl0003_energy.amesim_port_2_mass_estimate_g}, "
f"python_m1={pnl0003_energy.python_port_1_mass_g}, "
f"python_m2={pnl0003_energy.python_port_2_mass_g}, "
f"python_m1_error={pnl0003_energy.python_port_1_mass_error_to_amesim_g}, "
f"python_m2_error={pnl0003_energy.python_port_2_mass_error_to_amesim_g}, "
f"amesim_fd_dmgas={pnl0003_energy.amesim_total_mass_derivative_fd_g_s}, "
f"amesim_back_dmgas={pnl0003_energy.amesim_total_mass_derivative_backward_g_s}, "
f"amesim_fwd_dmgas={pnl0003_energy.amesim_total_mass_derivative_forward_g_s}, "
@@ -380,6 +380,12 @@ class RunTestMqlFullStateComparisonScriptTests(unittest.TestCase):
amesim_port_1_storage_enthalpy_sum_w=15908.7,
amesim_port_2_storage_mass_derivative_g_s=-2.6,
amesim_port_2_storage_enthalpy_sum_w=3028.0,
amesim_port_1_mass_estimate_g=1.12,
amesim_port_2_mass_estimate_g=1.05,
python_port_1_mass_g=1.11,
python_port_2_mass_g=1.04,
python_port_1_mass_error_to_amesim_g=-0.01,
python_port_2_mass_error_to_amesim_g=-0.01,
amesim_total_mass_derivative_fd_g_s=-470.0,
amesim_total_mass_derivative_backward_g_s=-540.0,
amesim_total_mass_derivative_forward_g_s=-400.0,
@@ -602,6 +608,9 @@ class RunTestMqlFullStateComparisonScriptTests(unittest.TestCase):
self.assertIn("pnl0003_energy@pneumatic_87", summary)
self.assertIn("amesim_sdm1=-462.7", summary)
self.assertIn("amesim_sdh2=3028.0", summary)
self.assertIn("amesim_m2=1.05", summary)
self.assertIn("python_m2=1.04", summary)
self.assertIn("python_m2_error=-0.01", summary)
self.assertIn("amesim_fd_dmgas=-470.0", summary)
self.assertIn("amesim_back_dmgas=-540.0", summary)
self.assertIn("amesim_fwd_dmgas=-400.0", summary)