接入test_mql相邻P4远端主线

This commit is contained in:
huojiarong committed 2026-07-18 08:35:42 +00:00
1 parent 95ba5a5e81
commit 62c8aabeab
3 files changed
+524 -21

No files matched your search

+85 -2
View File
@@ -4564,12 +4564,17 @@ class TestMqlSystem:
resistance_boundary_pressure_pa: float,
inlet_node_temperature_k: float = 293.15,
resistance_boundary_temperature_k: float = 293.15,
p4_port1_remote_orifice_boundary_pressure_pa: float = 15.3e6,
p4_port1_remote_orifice_boundary_temperature_k: float = 293.15,
p4_port3_remote_orifice_boundary_pressure_pa: float = 15.3e6,
p4_port3_remote_orifice_boundary_temperature_k: float = 293.15,
):
"""Close a PN3 chamber segment through the adjacent real P4 node.
The P4 primary pressure/temperature is supplied by the PNL0001 line on
P4 port 2. Ports 1 and 3 use the adjacent PNL0002 center compliances;
their far P4 nodes remain prescribed boundaries in this local closure.
P4 port 2. Ports 1 and 3 use the adjacent PNL0002 center compliances.
The next P4 nodes contribute their primary PNL0001/chamber states;
PNVO upstream endpoints remain prescribed boundaries in this local closure.
"""
from PythonModels.components.amesim_pneumatic import (
AmesimPneumaticOrifice,
@@ -4635,6 +4640,24 @@ class TestMqlSystem:
p4_port1_remote_primary_chamber = self.network.components[
p4_port1_remote_primary_chamber_alias
]
p4_port1_remote_port1_line = self.pnl0002_assembly.lines[
p4_port1_remote_neighborhood.port_1.line_alias
]
p4_port1_far_node_alias = p4_port1_remote_neighborhood.port_1.remote_node_alias
p4_port1_far_node = self.node4_assembly[p4_port1_far_node_alias]
p4_port1_far_primary = self._p4_primary_connection_for_node(
p4_port1_far_node_alias
)
p4_port1_far_primary_line = self.pnl0001_assembly.lines[
p4_port1_far_primary.line_alias
]
p4_port1_far_primary_chamber_alias = p4_port1_far_primary.chamber_alias
p4_port1_far_primary_chamber = self.network.components[
p4_port1_far_primary_chamber_alias
]
p4_port1_remote_orifice = self.pneumatic_assembly.variable_orifices[
p4_port1_remote_neighborhood.port_4.orifice_alias
]
p4_port3_remote_neighborhood = self.p4_node_neighborhood(
p4_neighborhood.port_3.remote_node_alias
)
@@ -4650,6 +4673,24 @@ class TestMqlSystem:
p4_port3_remote_primary_chamber = self.network.components[
p4_port3_remote_primary_chamber_alias
]
p4_port3_remote_port3_line = self.pnl0002_assembly.lines[
p4_port3_remote_neighborhood.port_3.line_alias
]
p4_port3_far_node_alias = p4_port3_remote_neighborhood.port_3.remote_node_alias
p4_port3_far_node = self.node4_assembly[p4_port3_far_node_alias]
p4_port3_far_primary = self._p4_primary_connection_for_node(
p4_port3_far_node_alias
)
p4_port3_far_primary_line = self.pnl0001_assembly.lines[
p4_port3_far_primary.line_alias
]
p4_port3_far_primary_chamber_alias = p4_port3_far_primary.chamber_alias
p4_port3_far_primary_chamber = self.network.components[
p4_port3_far_primary_chamber_alias
]
p4_port3_remote_orifice = self.pneumatic_assembly.variable_orifices[
p4_port3_remote_neighborhood.port_4.orifice_alias
]
volume = self.network.components[spec.volume_alias]
inlet_orifice = self.network.components[spec.inlet_orifice_alias]
outlet_orifice = self.network.components[spec.outlet_orifice_alias]
@@ -4667,6 +4708,14 @@ class TestMqlSystem:
raise TypeError(
f"{p4_port3_remote_primary_chamber_alias} is not an AMESim pneumatic volume"
)
if not isinstance(p4_port1_far_primary_chamber, AmesimPneumaticVolume):
raise TypeError(
f"{p4_port1_far_primary_chamber_alias} is not an AMESim pneumatic volume"
)
if not isinstance(p4_port3_far_primary_chamber, AmesimPneumaticVolume):
raise TypeError(
f"{p4_port3_far_primary_chamber_alias} is not an AMESim pneumatic volume"
)
if not isinstance(inlet_orifice, AmesimPneumaticOrifice):
raise TypeError(
f"{spec.inlet_orifice_alias} is not an AMESim pneumatic orifice"
@@ -4690,10 +4739,20 @@ class TestMqlSystem:
p4_port1_remote_node=p4_port1_remote_node,
p4_port1_remote_primary_line=p4_port1_remote_primary_line,
p4_port1_remote_primary_chamber=p4_port1_remote_primary_chamber,
p4_port1_remote_port1_line=p4_port1_remote_port1_line,
p4_port1_far_node=p4_port1_far_node,
p4_port1_far_primary_line=p4_port1_far_primary_line,
p4_port1_far_primary_chamber=p4_port1_far_primary_chamber,
p4_port1_remote_orifice=p4_port1_remote_orifice,
p4_port3_line=p4_port3_line,
p4_port3_remote_node=p4_port3_remote_node,
p4_port3_remote_primary_line=p4_port3_remote_primary_line,
p4_port3_remote_primary_chamber=p4_port3_remote_primary_chamber,
p4_port3_remote_port3_line=p4_port3_remote_port3_line,
p4_port3_far_node=p4_port3_far_node,
p4_port3_far_primary_line=p4_port3_far_primary_line,
p4_port3_far_primary_chamber=p4_port3_far_primary_chamber,
p4_port3_remote_orifice=p4_port3_remote_orifice,
volume=volume,
inlet_orifice=inlet_orifice,
outlet_orifice=outlet_orifice,
@@ -4707,6 +4766,14 @@ class TestMqlSystem:
pressure_pa=resistance_boundary_pressure_pa,
temperature_k=resistance_boundary_temperature_k,
),
p4_port1_remote_orifice_boundary=TestMqlPneumaticBoundaryCondition(
pressure_pa=p4_port1_remote_orifice_boundary_pressure_pa,
temperature_k=p4_port1_remote_orifice_boundary_temperature_k,
),
p4_port3_remote_orifice_boundary=TestMqlPneumaticBoundaryCondition(
pressure_pa=p4_port3_remote_orifice_boundary_pressure_pa,
temperature_k=p4_port3_remote_orifice_boundary_temperature_k,
),
)
def simulate_pn3_p4_node_chamber_segment_from_spec(
@@ -4717,6 +4784,10 @@ class TestMqlSystem:
resistance_boundary_pressure_pa: float,
inlet_node_temperature_k: float = 293.15,
resistance_boundary_temperature_k: float = 293.15,
p4_port1_remote_orifice_boundary_pressure_pa: float = 15.3e6,
p4_port1_remote_orifice_boundary_temperature_k: float = 293.15,
p4_port3_remote_orifice_boundary_pressure_pa: float = 15.3e6,
p4_port3_remote_orifice_boundary_temperature_k: float = 293.15,
config: SolveIVPConfig | None = None,
t_eval: list[float] | None = None,
):
@@ -4726,6 +4797,18 @@ class TestMqlSystem:
resistance_boundary_pressure_pa=resistance_boundary_pressure_pa,
inlet_node_temperature_k=inlet_node_temperature_k,
resistance_boundary_temperature_k=resistance_boundary_temperature_k,
p4_port1_remote_orifice_boundary_pressure_pa=(
p4_port1_remote_orifice_boundary_pressure_pa
),
p4_port1_remote_orifice_boundary_temperature_k=(
p4_port1_remote_orifice_boundary_temperature_k
),
p4_port3_remote_orifice_boundary_pressure_pa=(
p4_port3_remote_orifice_boundary_pressure_pa
),
p4_port3_remote_orifice_boundary_temperature_k=(
p4_port3_remote_orifice_boundary_temperature_k
),
)
run_config = config or SolveIVPConfig(t_stop=1.0e-4, max_step=1.0e-5)
return integrate_ode(