修正动态管与阀门诊断输出

This commit is contained in:
huojiarong committed 2026-08-18 10:24:29 +00:00
1 parent f725f038b6
commit 53f8601fec
6 files changed
+219 -16

No files matched your search

@@ -35,6 +35,7 @@ _FLOWSET_USES_CV = (ParameterCondition("flowset", (2.0,)),)
_FLOWSET_USES_KV = (ParameterCondition("flowset", (3.0,)),)
_PN_PRESSURE_RATIO_ACCURACY = 0.9999
_PN_LAMINAR_SMOOTHING_GAIN = 12.0
_PNVO001_CLOSED_OPENING_ABS_TOL = 1.0e-12
_PNOR001_FLOW_COEFFICIENT_GROUP = ParameterGroupDisplaySpec(
id="flow_coefficient",
label="流量系数",
@@ -835,6 +836,16 @@ class AmesimPnvo001FixedOpening(AlgebraicComponent):
downstream_pressure=downstream_pressure,
upstream_temperature=upstream_temperature,
)
# AMESim reports no vena-contracta velocity while the valve is closed.
# Signal propagation around a step can leave a round-off-sized opening,
# so apply the same numerical-zero convention to this diagnostic only.
if isclose(
self.opening,
0.0,
rel_tol=0.0,
abs_tol=_PNVO001_CLOSED_OPENING_ABS_TOL,
):
gas_velocity = 0.0
return {
"xv": self.opening,
"cm": mass_flow_parameter,