修复test_mql事件后积分步长控制
This commit is contained in:
1 parent
a0855018d5
commit
2120901909
12 files changed
+222
-27
No files matched your search
@@ -79,6 +79,31 @@ class AmesimPneumaticComponentsTest(unittest.TestCase):
|
||||
)
|
||||
self.assertAlmostEqual(volume.port_a.p, volume.port_b.p)
|
||||
|
||||
def test_volume_applies_amesim_heat_exchange_to_energy_derivative(self) -> None:
|
||||
volume = AmesimPneumaticVolume.from_liters(
|
||||
name="heated_chamber",
|
||||
volume_liters=15.0,
|
||||
p0=100000.0,
|
||||
T0=300.0,
|
||||
heat_transfer_coefficient=1500.0,
|
||||
heat_transfer_area=0.7,
|
||||
external_temperature_k=293.15,
|
||||
)
|
||||
props = volume.properties()
|
||||
|
||||
derivative = volume.derivatives_from_two_connections(
|
||||
port_a_m_flow=0.0,
|
||||
connected_h_a=props.h,
|
||||
port_b_m_flow=0.0,
|
||||
connected_h_b=props.h,
|
||||
internal_h=props.h,
|
||||
)
|
||||
|
||||
self.assertAlmostEqual(
|
||||
derivative.U,
|
||||
1500.0 * 0.7 * (293.15 - 300.0),
|
||||
)
|
||||
|
||||
def test_variable_volume_tracks_external_volume(self) -> None:
|
||||
volume = AmesimVariablePneumaticVolume.from_liters(
|
||||
name="pn_c1_8",
|
||||
|
||||
Reference in new issue
Block a user