修复test_mql事件后积分步长控制
This commit is contained in:
1 parent
a0855018d5
commit
2120901909
12 files changed
+222
-27
No files matched your search
@@ -48,7 +48,7 @@ class _DarcyPipeResistanceMixin:
|
||||
if upper > 1.0e3:
|
||||
raise ValueError("unable to bracket pneumatic pipe resistance flow")
|
||||
lower = 0.0
|
||||
for _ in range(80):
|
||||
for _ in range(48):
|
||||
middle = 0.5 * (lower + upper)
|
||||
if self._darcy_pressure_drop(
|
||||
middle,
|
||||
@@ -255,15 +255,19 @@ class AmesimPnl0001Pipe(_DarcyPipeResistanceMixin, DynamicComponent):
|
||||
connected_h_2: float,
|
||||
) -> VolumeState:
|
||||
internal = self.properties()
|
||||
inlet_h_1 = self.connection_inlet_enthalpy(
|
||||
port_m_flow=port_1_m_flow,
|
||||
connected_h=connected_h_1,
|
||||
internal_h=internal.h,
|
||||
# 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.
|
||||
inlet_u_1 = (
|
||||
connected_h_1 / self.gas.gamma
|
||||
if port_1_m_flow > 0.0
|
||||
else internal.u
|
||||
)
|
||||
inlet_h_2 = self.connection_inlet_enthalpy(
|
||||
port_m_flow=port_2_m_flow,
|
||||
connected_h=connected_h_2,
|
||||
internal_h=internal.h,
|
||||
inlet_u_2 = (
|
||||
connected_h_2 / self.gas.gamma
|
||||
if port_2_m_flow > 0.0
|
||||
else internal.u
|
||||
)
|
||||
heat_flow = (
|
||||
self.heat_transfer_coefficient
|
||||
@@ -272,7 +276,7 @@ class AmesimPnl0001Pipe(_DarcyPipeResistanceMixin, DynamicComponent):
|
||||
)
|
||||
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,
|
||||
U=port_1_m_flow * inlet_u_1 + port_2_m_flow * inlet_u_2 + heat_flow,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user