diff --git a/PythonModels/systems/test_mql_closure.py b/PythonModels/systems/test_mql_closure.py index a5c90ba..9818341 100644 --- a/PythonModels/systems/test_mql_closure.py +++ b/PythonModels/systems/test_mql_closure.py @@ -2110,13 +2110,14 @@ class TestMqlPn3P4NodeChamberSegmentClosure: p4_port1_next_orifice.port_b.m_flow = -snapshot.p4_port1_next_orifice_to_output_line_flow p4_port1_next_orifice.port_b.h_outflow = snapshot.p4_port1_next_orifice_output_line.h - p4_port1_next_orifice_output_line = self.components.p4_port1_next_orifice_output_line - p4_port1_next_orifice_output_line.port_1.p = snapshot.p4_port1_next_primary_line.p - p4_port1_next_orifice_output_line.port_1.m_flow = snapshot.p4_port1_next_orifice_p4_to_output_line_flow - p4_port1_next_orifice_output_line.port_1.h_outflow = snapshot.p4_port1_next_orifice_output_line.h - p4_port1_next_orifice_output_line.port_2.p = snapshot.p4_port1_next_orifice_output_line.p - p4_port1_next_orifice_output_line.port_2.m_flow = snapshot.p4_port1_next_orifice_to_output_line_flow - p4_port1_next_orifice_output_line.port_2.h_outflow = snapshot.p4_port1_next_orifice_output_line.h + self._write_connection_line( + line=self.components.p4_port1_next_orifice_output_line, + line_properties=snapshot.p4_port1_next_orifice_output_line, + port_1_properties=snapshot.p4_port1_next_primary_line, + port_1_flow=snapshot.p4_port1_next_orifice_p4_to_output_line_flow, + port_2_properties=snapshot.p4_port1_next_orifice_output_line, + port_2_flow=snapshot.p4_port1_next_orifice_to_output_line_flow, + ) p4_port1_next_orifice_resistance = self.components.p4_port1_next_orifice_resistance p4_port1_next_orifice_resistance.port_1.p = snapshot.p4_port1_next_orifice_resistance_line_port_1.p @@ -2284,13 +2285,14 @@ class TestMqlPn3P4NodeChamberSegmentClosure: p4_port3_next_orifice.port_b.m_flow = -snapshot.p4_port3_next_orifice_to_output_line_flow p4_port3_next_orifice.port_b.h_outflow = snapshot.p4_port3_next_orifice_output_line.h - p4_port3_next_orifice_output_line = self.components.p4_port3_next_orifice_output_line - p4_port3_next_orifice_output_line.port_1.p = snapshot.p4_port3_next_orifice_line_port_2.p - p4_port3_next_orifice_output_line.port_1.m_flow = snapshot.p4_port3_next_orifice_to_output_line_flow - p4_port3_next_orifice_output_line.port_1.h_outflow = snapshot.p4_port3_next_orifice_output_line.h - p4_port3_next_orifice_output_line.port_2.p = snapshot.p4_port3_next_orifice_output_line.p - p4_port3_next_orifice_output_line.port_2.m_flow = -snapshot.p4_port3_next_orifice_output_to_p4_flow - p4_port3_next_orifice_output_line.port_2.h_outflow = snapshot.p4_port3_next_orifice_output_line.h + self._write_connection_line( + line=self.components.p4_port3_next_orifice_output_line, + line_properties=snapshot.p4_port3_next_orifice_output_line, + port_1_properties=snapshot.p4_port3_next_orifice_line_port_2, + port_1_flow=snapshot.p4_port3_next_orifice_to_output_line_flow, + port_2_properties=snapshot.p4_port3_next_orifice_output_line, + port_2_flow=-snapshot.p4_port3_next_orifice_output_to_p4_flow, + ) self._write_fixed_chamber_segment( spec=self.components.p4_port3_next_chamber_spec, @@ -2342,13 +2344,14 @@ class TestMqlPn3P4NodeChamberSegmentClosure: p4_port3_next_resistance_orifice.port_b.m_flow = -snapshot.p4_port3_next_resistance_to_output_line_flow p4_port3_next_resistance_orifice.port_b.h_outflow = snapshot.p4_port3_next_resistance_output_line.h - p4_port3_next_resistance_output_line = self.components.p4_port3_next_resistance_output_line - p4_port3_next_resistance_output_line.port_1.p = snapshot.p4_port3_next_resistance_node_line_port_2.p - p4_port3_next_resistance_output_line.port_1.m_flow = snapshot.p4_port3_next_resistance_to_output_line_flow - p4_port3_next_resistance_output_line.port_1.h_outflow = snapshot.p4_port3_next_resistance_output_line.h - p4_port3_next_resistance_output_line.port_2.p = snapshot.p4_port3_next_resistance_output_line.p - p4_port3_next_resistance_output_line.port_2.m_flow = -snapshot.p4_port3_next_resistance_output_to_p4_flow - p4_port3_next_resistance_output_line.port_2.h_outflow = snapshot.p4_port3_next_resistance_output_line.h + self._write_connection_line( + line=self.components.p4_port3_next_resistance_output_line, + line_properties=snapshot.p4_port3_next_resistance_output_line, + port_1_properties=snapshot.p4_port3_next_resistance_node_line_port_2, + port_1_flow=snapshot.p4_port3_next_resistance_to_output_line_flow, + port_2_properties=snapshot.p4_port3_next_resistance_output_line, + port_2_flow=-snapshot.p4_port3_next_resistance_output_to_p4_flow, + ) self._write_fixed_chamber_segment( spec=self.components.p4_port3_next_resistance_chamber_spec, @@ -2416,13 +2419,14 @@ class TestMqlPn3P4NodeChamberSegmentClosure: p4_port3_remote_resistance_orifice.port_b.m_flow = -snapshot.p4_port3_remote_resistance_to_output_line_flow p4_port3_remote_resistance_orifice.port_b.h_outflow = snapshot.p4_port3_remote_resistance_output_line.h - p4_port3_remote_resistance_output_line = self.components.p4_port3_remote_resistance_output_line - p4_port3_remote_resistance_output_line.port_1.p = snapshot.p4_port3_remote_resistance_node_line_port_2.p - p4_port3_remote_resistance_output_line.port_1.m_flow = snapshot.p4_port3_remote_resistance_to_output_line_flow - p4_port3_remote_resistance_output_line.port_1.h_outflow = snapshot.p4_port3_remote_resistance_output_line.h - p4_port3_remote_resistance_output_line.port_2.p = snapshot.p4_port3_remote_resistance_output_line.p - p4_port3_remote_resistance_output_line.port_2.m_flow = -snapshot.p4_port3_remote_resistance_output_to_p4_flow - p4_port3_remote_resistance_output_line.port_2.h_outflow = snapshot.p4_port3_remote_resistance_output_line.h + self._write_connection_line( + line=self.components.p4_port3_remote_resistance_output_line, + line_properties=snapshot.p4_port3_remote_resistance_output_line, + port_1_properties=snapshot.p4_port3_remote_resistance_node_line_port_2, + port_1_flow=snapshot.p4_port3_remote_resistance_to_output_line_flow, + port_2_properties=snapshot.p4_port3_remote_resistance_output_line, + port_2_flow=-snapshot.p4_port3_remote_resistance_output_to_p4_flow, + ) p4_port3_remote_orifice = self.components.p4_port3_remote_orifice p4_port3_remote_orifice.port_a.p = snapshot.p4_port3_remote_orifice_line_port_2.p @@ -2637,13 +2641,12 @@ class TestMqlPn3P4NodeChamberSegmentClosure: port_2_connected_properties=snapshot.p4_port3_remote_resistance_output_line, port_2_flow=-snapshot.p4_port3_remote_resistance_to_output_line_flow, ) - p4_port3_remote_resistance_output_derivative = ( - self.components.p4_port3_remote_resistance_output_line.derivatives_from_connections( - port_1_m_flow=snapshot.p4_port3_remote_resistance_to_output_line_flow, - connected_h_1=snapshot.p4_port3_remote_resistance_node_line_port_2.h, - port_2_m_flow=-snapshot.p4_port3_remote_resistance_output_to_p4_flow, - connected_h_2=snapshot.p4_port3_far_primary_line.h, - ) + p4_port3_remote_resistance_output_derivative = self._connection_line_derivative( + line=self.components.p4_port3_remote_resistance_output_line, + port_1_properties=snapshot.p4_port3_remote_resistance_node_line_port_2, + port_1_flow=snapshot.p4_port3_remote_resistance_to_output_line_flow, + port_2_properties=snapshot.p4_port3_far_primary_line, + port_2_flow=-snapshot.p4_port3_remote_resistance_output_to_p4_flow, ) ( p4_port3_remote_orifice_derivative_1, @@ -2665,13 +2668,12 @@ class TestMqlPn3P4NodeChamberSegmentClosure: port_2_connected_properties=snapshot.p4_port3_next_orifice_output_line, port_2_flow=-snapshot.p4_port3_next_orifice_to_output_line_flow, ) - p4_port3_next_orifice_output_derivative = ( - self.components.p4_port3_next_orifice_output_line.derivatives_from_connections( - port_1_m_flow=snapshot.p4_port3_next_orifice_to_output_line_flow, - connected_h_1=snapshot.p4_port3_next_orifice_line_port_2.h, - port_2_m_flow=-snapshot.p4_port3_next_orifice_output_to_p4_flow, - connected_h_2=snapshot.p4_port3_next_primary_line.h, - ) + p4_port3_next_orifice_output_derivative = self._connection_line_derivative( + line=self.components.p4_port3_next_orifice_output_line, + port_1_properties=snapshot.p4_port3_next_orifice_line_port_2, + port_1_flow=snapshot.p4_port3_next_orifice_to_output_line_flow, + port_2_properties=snapshot.p4_port3_next_primary_line, + port_2_flow=-snapshot.p4_port3_next_orifice_output_to_p4_flow, ) ( p4_port3_next_chamber_inlet_derivative, @@ -2712,13 +2714,12 @@ class TestMqlPn3P4NodeChamberSegmentClosure: port_2_connected_properties=snapshot.p4_port3_next_resistance_output_line, port_2_flow=-snapshot.p4_port3_next_resistance_to_output_line_flow, ) - p4_port3_next_resistance_output_derivative = ( - self.components.p4_port3_next_resistance_output_line.derivatives_from_connections( - port_1_m_flow=snapshot.p4_port3_next_resistance_to_output_line_flow, - connected_h_1=snapshot.p4_port3_next_resistance_node_line_port_2.h, - port_2_m_flow=-snapshot.p4_port3_next_resistance_output_to_p4_flow, - connected_h_2=snapshot.p4_bridge_primary_line.h, - ) + p4_port3_next_resistance_output_derivative = self._connection_line_derivative( + line=self.components.p4_port3_next_resistance_output_line, + port_1_properties=snapshot.p4_port3_next_resistance_node_line_port_2, + port_1_flow=snapshot.p4_port3_next_resistance_to_output_line_flow, + port_2_properties=snapshot.p4_bridge_primary_line, + port_2_flow=-snapshot.p4_port3_next_resistance_output_to_p4_flow, ) ( p4_port3_next_resistance_chamber_inlet_derivative, @@ -2761,13 +2762,12 @@ class TestMqlPn3P4NodeChamberSegmentClosure: port_2_connected_properties=snapshot.p4_port1_next_orifice_output_line, port_2_flow=-snapshot.p4_port1_next_orifice_to_output_line_flow, ) - p4_port1_next_orifice_output_derivative = ( - self.components.p4_port1_next_orifice_output_line.derivatives_from_connections( - port_1_m_flow=snapshot.p4_port1_next_orifice_p4_to_output_line_flow, - connected_h_1=snapshot.p4_port1_next_primary_line.h, - port_2_m_flow=snapshot.p4_port1_next_orifice_to_output_line_flow, - connected_h_2=snapshot.p4_port1_next_orifice_line_port_2.h, - ) + p4_port1_next_orifice_output_derivative = self._connection_line_derivative( + line=self.components.p4_port1_next_orifice_output_line, + port_1_properties=snapshot.p4_port1_next_primary_line, + port_1_flow=snapshot.p4_port1_next_orifice_p4_to_output_line_flow, + port_2_properties=snapshot.p4_port1_next_orifice_line_port_2, + port_2_flow=snapshot.p4_port1_next_orifice_to_output_line_flow, ) ( p4_port1_next_orifice_resistance_derivative_1,