优化端口传递物性参数方式,减少上下游元件重复计算量

This commit is contained in:
ljz committed 2026-09-11 14:42:19 +08:00
1 parent 91bd9fb252
commit 5d5a2e1843
12 files changed
+773 -65

No files matched your search

+7 -5
View File
@@ -12,11 +12,13 @@ from tests.native_reference import reference_data, reference_network
def has_revised_pipe_law(case):
"""The frozen Python flow laws predate the September 2026 corrections."""
return any(c['type'] in ('amesim_pnl0001', 'amesim_pnl0003') or
(c['type'].startswith('amesim_pnl') and
c['medium']['type'] == 'AmesimHeliumPengRobinsonMedium')
for c in case['components'])
"""The frozen flow values include capped pipe iterates, not checked roots.
All PNL media now share the residual-checked scalar solver. Keep the frozen
thermodynamic oracle; the pipe suite checks the actual resistance equation
against independent bisection as well as system-level Amesim curves.
"""
return any(c['type'].startswith('amesim_pnl') for c in case['components'])
class Circuit: