拆解test_mql变容气室RHS
This commit is contained in:
1 parent
a6e1faa2d8
commit
2c2952cff1
4 files changed
+205
No files matched your search
@@ -684,6 +684,32 @@ class TestMqlPn3P4NodeChamberSegmentTests(unittest.TestCase):
|
||||
self.assertAlmostEqual(rhs[128], expected_contact_force / support_mass)
|
||||
self.assertAlmostEqual(rhs[129], 0.0)
|
||||
|
||||
def test_full_state_closure_diagnoses_variable_chamber_rhs_terms(self) -> None:
|
||||
closure = self.system.full_state_closure_from_spec(
|
||||
self.spec,
|
||||
inlet_node_pressure_pa=15.31e6,
|
||||
resistance_boundary_pressure_pa=15.29e6,
|
||||
)
|
||||
state = closure.initial_state_vector()
|
||||
|
||||
diagnostic = closure.variable_chamber_rhs_diagnostic(
|
||||
chamber_alias="pn_c1_8",
|
||||
state_vector=state,
|
||||
)
|
||||
rhs = closure.rhs(state)
|
||||
|
||||
self.assertEqual(diagnostic.piston_alias, "pn_brp2_8")
|
||||
self.assertAlmostEqual(diagnostic.chamber_volume_m3, 0.015)
|
||||
self.assertAlmostEqual(diagnostic.chamber_volume_rate_m3_s, 0.0)
|
||||
self.assertAlmostEqual(diagnostic.mass_derivative_kg_s, rhs[46])
|
||||
self.assertAlmostEqual(diagnostic.energy_derivative_w, rhs[47])
|
||||
self.assertAlmostEqual(
|
||||
diagnostic.energy_derivative_w,
|
||||
diagnostic.port_a_energy_flow_w
|
||||
+ diagnostic.port_b_energy_flow_w
|
||||
+ diagnostic.boundary_work_w,
|
||||
)
|
||||
|
||||
def test_simulates_full_state_key_data_paths_for_amesim_comparison(self) -> None:
|
||||
data_paths = (
|
||||
"press@pn_c1_8",
|
||||
|
||||
Reference in new issue
Block a user