补充test_mql PNL0003温度反事实诊断
This commit is contained in:
1 parent
918952f130
commit
8b9f229b80
2 files changed
+57
No files matched your search
@@ -482,6 +482,9 @@ class TestMqlPnl0003EnergyDiagnostic:
|
|||||||
python_port_2_current_dtemp_k_s: float
|
python_port_2_current_dtemp_k_s: float
|
||||||
python_port_1_real_gas_reference_dtemp_k_s: float
|
python_port_1_real_gas_reference_dtemp_k_s: float
|
||||||
python_port_2_real_gas_reference_dtemp_k_s: float
|
python_port_2_real_gas_reference_dtemp_k_s: float
|
||||||
|
python_port_2_amesim_center_counterfactual_dtemp_k_s: float
|
||||||
|
python_port_2_amesim_external_counterfactual_dtemp_k_s: float
|
||||||
|
python_port_2_amesim_external_center_counterfactual_dtemp_k_s: float
|
||||||
python_port_2_temperature_error_to_amesim_k: float
|
python_port_2_temperature_error_to_amesim_k: float
|
||||||
|
|
||||||
|
|
||||||
@@ -1852,6 +1855,39 @@ def _pnl0003_energy_diagnostic(
|
|||||||
heat_flow_w=python_heat_flow_2,
|
heat_flow_w=python_heat_flow_2,
|
||||||
reference_temperature_k=reference_temperature_k,
|
reference_temperature_k=reference_temperature_k,
|
||||||
)
|
)
|
||||||
|
amesim_center_flow_python_sign_kg_s = (
|
||||||
|
amesim_center_python_sign_equivalent_g_s * 1.0e-3
|
||||||
|
)
|
||||||
|
amesim_external_flow_kg_s = amesim_dm2 * 1.0e-3
|
||||||
|
python_dtemp_2_amesim_center = _pn2vol_reference_dtemp(
|
||||||
|
gas=line.gas,
|
||||||
|
temperature_k=port_2.T,
|
||||||
|
mass_kg=line.state_2.m,
|
||||||
|
mass_derivative_kg_s=port_2_flow + amesim_center_flow_python_sign_kg_s,
|
||||||
|
enthalpy_flow_w=python_port_2_dh - amesim_dhctr,
|
||||||
|
heat_flow_w=python_heat_flow_2,
|
||||||
|
reference_temperature_k=reference_temperature_k,
|
||||||
|
)
|
||||||
|
python_dtemp_2_amesim_external = _pn2vol_reference_dtemp(
|
||||||
|
gas=line.gas,
|
||||||
|
temperature_k=port_2.T,
|
||||||
|
mass_kg=line.state_2.m,
|
||||||
|
mass_derivative_kg_s=amesim_external_flow_kg_s + center_flow,
|
||||||
|
enthalpy_flow_w=amesim_dh2 + python_center_dh_2,
|
||||||
|
heat_flow_w=python_heat_flow_2,
|
||||||
|
reference_temperature_k=reference_temperature_k,
|
||||||
|
)
|
||||||
|
python_dtemp_2_amesim_external_center = _pn2vol_reference_dtemp(
|
||||||
|
gas=line.gas,
|
||||||
|
temperature_k=port_2.T,
|
||||||
|
mass_kg=line.state_2.m,
|
||||||
|
mass_derivative_kg_s=(
|
||||||
|
amesim_external_flow_kg_s + amesim_center_flow_python_sign_kg_s
|
||||||
|
),
|
||||||
|
enthalpy_flow_w=amesim_dh2 - amesim_dhctr,
|
||||||
|
heat_flow_w=python_heat_flow_2,
|
||||||
|
reference_temperature_k=reference_temperature_k,
|
||||||
|
)
|
||||||
|
|
||||||
return TestMqlPnl0003EnergyDiagnostic(
|
return TestMqlPnl0003EnergyDiagnostic(
|
||||||
line_alias=line_alias,
|
line_alias=line_alias,
|
||||||
@@ -1953,6 +1989,15 @@ def _pnl0003_energy_diagnostic(
|
|||||||
python_port_2_current_dtemp_k_s=python_current_dtemp_2,
|
python_port_2_current_dtemp_k_s=python_current_dtemp_2,
|
||||||
python_port_1_real_gas_reference_dtemp_k_s=python_ref_dtemp_1,
|
python_port_1_real_gas_reference_dtemp_k_s=python_ref_dtemp_1,
|
||||||
python_port_2_real_gas_reference_dtemp_k_s=python_ref_dtemp_2,
|
python_port_2_real_gas_reference_dtemp_k_s=python_ref_dtemp_2,
|
||||||
|
python_port_2_amesim_center_counterfactual_dtemp_k_s=(
|
||||||
|
python_dtemp_2_amesim_center
|
||||||
|
),
|
||||||
|
python_port_2_amesim_external_counterfactual_dtemp_k_s=(
|
||||||
|
python_dtemp_2_amesim_external
|
||||||
|
),
|
||||||
|
python_port_2_amesim_external_center_counterfactual_dtemp_k_s=(
|
||||||
|
python_dtemp_2_amesim_external_center
|
||||||
|
),
|
||||||
python_port_2_temperature_error_to_amesim_k=port_2.T - amesim_t2,
|
python_port_2_temperature_error_to_amesim_k=port_2.T - amesim_t2,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -2644,6 +2689,12 @@ def format_test_mql_pnvo_event_window_summary(
|
|||||||
f"python_current_dT2={pnl0003_energy.python_port_2_current_dtemp_k_s}, "
|
f"python_current_dT2={pnl0003_energy.python_port_2_current_dtemp_k_s}, "
|
||||||
f"python_real_ref_dT1={pnl0003_energy.python_port_1_real_gas_reference_dtemp_k_s}, "
|
f"python_real_ref_dT1={pnl0003_energy.python_port_1_real_gas_reference_dtemp_k_s}, "
|
||||||
f"python_real_ref_dT2={pnl0003_energy.python_port_2_real_gas_reference_dtemp_k_s}, "
|
f"python_real_ref_dT2={pnl0003_energy.python_port_2_real_gas_reference_dtemp_k_s}, "
|
||||||
|
f"python_amesim_center_dT2="
|
||||||
|
f"{pnl0003_energy.python_port_2_amesim_center_counterfactual_dtemp_k_s}, "
|
||||||
|
f"python_amesim_ext_dT2="
|
||||||
|
f"{pnl0003_energy.python_port_2_amesim_external_counterfactual_dtemp_k_s}, "
|
||||||
|
f"python_amesim_ext_ctr_dT2="
|
||||||
|
f"{pnl0003_energy.python_port_2_amesim_external_center_counterfactual_dtemp_k_s}, "
|
||||||
f"python_t2_error={pnl0003_energy.python_port_2_temperature_error_to_amesim_k}"
|
f"python_t2_error={pnl0003_energy.python_port_2_temperature_error_to_amesim_k}"
|
||||||
)
|
)
|
||||||
for energy_flow in sample.pnl0001_energy_flow_diagnostics:
|
for energy_flow in sample.pnl0001_energy_flow_diagnostics:
|
||||||
|
|||||||
@@ -427,6 +427,9 @@ class RunTestMqlFullStateComparisonScriptTests(unittest.TestCase):
|
|||||||
python_port_2_current_dtemp_k_s=-1200.0,
|
python_port_2_current_dtemp_k_s=-1200.0,
|
||||||
python_port_1_real_gas_reference_dtemp_k_s=-100.0,
|
python_port_1_real_gas_reference_dtemp_k_s=-100.0,
|
||||||
python_port_2_real_gas_reference_dtemp_k_s=-650.0,
|
python_port_2_real_gas_reference_dtemp_k_s=-650.0,
|
||||||
|
python_port_2_amesim_center_counterfactual_dtemp_k_s=-610.0,
|
||||||
|
python_port_2_amesim_external_counterfactual_dtemp_k_s=-620.0,
|
||||||
|
python_port_2_amesim_external_center_counterfactual_dtemp_k_s=-630.0,
|
||||||
python_port_2_temperature_error_to_amesim_k=-5.5,
|
python_port_2_temperature_error_to_amesim_k=-5.5,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -612,6 +615,9 @@ class RunTestMqlFullStateComparisonScriptTests(unittest.TestCase):
|
|||||||
self.assertIn("amesim_fwd_dT2=120.0", summary)
|
self.assertIn("amesim_fwd_dT2=120.0", summary)
|
||||||
self.assertIn("amesim_pn2vol_dT2=-530.0", summary)
|
self.assertIn("amesim_pn2vol_dT2=-530.0", summary)
|
||||||
self.assertIn("python_real_ref_dT2=-650.0", summary)
|
self.assertIn("python_real_ref_dT2=-650.0", summary)
|
||||||
|
self.assertIn("python_amesim_center_dT2=-610.0", summary)
|
||||||
|
self.assertIn("python_amesim_ext_dT2=-620.0", summary)
|
||||||
|
self.assertIn("python_amesim_ext_ctr_dT2=-630.0", summary)
|
||||||
self.assertIn("python_t2_error=-5.5", summary)
|
self.assertIn("python_t2_error=-5.5", summary)
|
||||||
self.assertIn("energy_flow@pneumatic_69", summary)
|
self.assertIn("energy_flow@pneumatic_69", summary)
|
||||||
self.assertIn("amesim_dh1=-4248.6", summary)
|
self.assertIn("amesim_dh1=-4248.6", summary)
|
||||||
|
|||||||
Reference in new issue
Block a user