接入test_mql pneumatic_69传输焓RHS

This commit is contained in:
huojiarong committed 2026-07-28 02:20:33 +00:00
1 parent f8af99ace1
commit 021ea63a2b
6 files changed
+96 -24

No files matched your search

@@ -343,10 +343,10 @@ class AmesimPnl0001Pipe(_DarcyPipeResistanceMixin, DynamicComponent):
connected_h_2: float,
) -> VolumeState:
internal = self.properties()
# PNL0001 is a fixed-volume distributed line store. Its transported
# energy variable therefore follows specific internal energy, not the
# chamber-style stagnation enthalpy contract. For this ideal gas,
# h = gamma * u. Outflow always carries the local u.
# Default first-pass PNL0001 behavior uses the historical internal-energy
# approximation. AMESim-specific transport-enthalpy corrections are kept
# behind derivatives_from_transport_enthalpy_connections so they can be
# applied only where validated against baseline data.
inlet_u_1 = (
connected_h_1 / self.gas.gamma
if port_1_m_flow > 0.0
@@ -367,6 +367,27 @@ class AmesimPnl0001Pipe(_DarcyPipeResistanceMixin, DynamicComponent):
U=port_1_m_flow * inlet_u_1 + port_2_m_flow * inlet_u_2 + heat_flow,
)
def derivatives_from_transport_enthalpy_connections(
self,
*,
port_1_m_flow: float,
connected_h_1: float,
port_2_m_flow: float,
connected_h_2: float,
) -> VolumeState:
internal = self.properties()
inlet_h_1 = connected_h_1 if port_1_m_flow > 0.0 else internal.h
inlet_h_2 = connected_h_2 if port_2_m_flow > 0.0 else internal.h
heat_flow = (
self.heat_transfer_coefficient
* self.heat_transfer_area
* (self.external_temperature - internal.T)
)
return VolumeState(
m=port_1_m_flow + port_2_m_flow,
U=port_1_m_flow * inlet_h_1 + port_2_m_flow * inlet_h_2 + heat_flow,
)
class AmesimPnl0003Pipe(_DarcyPipeResistanceMixin, DynamicComponent):
"""First-pass AMESim ``PNL0003`` (C-R-C) pipe.