接入test_mql高密度事件窗口诊断
This commit is contained in:
1 parent
01b606df30
commit
f8af99ace1
4 files changed
+246
-33
No files matched your search
@@ -26,6 +26,7 @@ from PythonModels.scripts.run_test_mql_full_state_comparison import (
|
||||
format_test_mql_pnvo_event_boundary_summary,
|
||||
format_test_mql_pnvo_event_window_summary,
|
||||
run_test_mql_full_state_comparison,
|
||||
_ideal_pn2vol_reference_dtemp,
|
||||
_series_sample_bracket,
|
||||
)
|
||||
|
||||
@@ -35,6 +36,28 @@ TEST_MQL_AME = REPO_ROOT / "AmesimModels" / "test_mql.ame"
|
||||
|
||||
|
||||
class RunTestMqlFullStateComparisonScriptTests(unittest.TestCase):
|
||||
def test_ideal_pn2vol_reference_dtemp_uses_internal_energy_mass_offset(
|
||||
self,
|
||||
) -> None:
|
||||
from PythonModels.components.amesim_pneumatic import HELIUM_PNEUMATIC_GAS
|
||||
|
||||
gas = HELIUM_PNEUMATIC_GAS
|
||||
result = _ideal_pn2vol_reference_dtemp(
|
||||
gas=gas,
|
||||
mass_kg=0.002,
|
||||
temperature_k=320.0,
|
||||
mass_derivative_kg_s=0.1,
|
||||
enthalpy_flow_w=-100.0,
|
||||
heat_flow_w=5.0,
|
||||
)
|
||||
|
||||
expected = (
|
||||
-100.0
|
||||
+ (gas.cp * 298.15 - gas.cv * 320.0) * 0.1
|
||||
+ 5.0
|
||||
) / (0.002 * gas.cv)
|
||||
self.assertAlmostEqual(result, expected)
|
||||
|
||||
def test_series_sample_bracket_distinguishes_exact_and_interpolated_times(self) -> None:
|
||||
times = (0.04000000000000009, 0.050000000000000114)
|
||||
|
||||
|
||||
Reference in new issue
Block a user