接入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

+23
View File
@@ -115,6 +115,29 @@ class AmesimPnl0001PipeTests(unittest.TestCase):
- 0.1 * internal.u,
)
def test_transport_enthalpy_derivative_preserves_pn2vol_energy_basis(self) -> None:
internal = self.pipe.properties()
derivative = self.pipe.derivatives_from_transport_enthalpy_connections(
port_1_m_flow=0.2,
connected_h_1=internal.h + 1000.0,
port_2_m_flow=-0.1,
connected_h_2=internal.h - 1000.0,
)
self.assertAlmostEqual(derivative.m, 0.1)
self.assertAlmostEqual(
derivative.U,
0.2 * (internal.h + 1000.0) - 0.1 * internal.h,
)
temperature_derivative = (
derivative.U - internal.u * derivative.m
) / (self.pipe.state.m * self.pipe.gas.cv)
expected_temperature_derivative = (
0.2 * (internal.h + 1000.0 - internal.u)
- 0.1 * (internal.h - internal.u)
) / (self.pipe.state.m * self.pipe.gas.cv)
self.assertAlmostEqual(temperature_derivative, expected_temperature_derivative)
if __name__ == "__main__":
unittest.main()