接入test_mql PNVO上游PN3子网
This commit is contained in:
1 parent
62c8aabeab
commit
8c8b4f26e9
3 files changed
+389
-92
No files matched your search
@@ -4564,17 +4564,14 @@ 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.
|
||||
The next P4 nodes contribute their primary PNL0001/chamber states;
|
||||
PNVO upstream endpoints remain prescribed boundaries in this local closure.
|
||||
The next P4 nodes contribute their primary PNL0001/chamber states, and
|
||||
PNVO upstream endpoints are closed through their adjacent PN3/PNL0003
|
||||
subnets.
|
||||
"""
|
||||
from PythonModels.components.amesim_pneumatic import (
|
||||
AmesimPneumaticOrifice,
|
||||
@@ -4586,6 +4583,28 @@ class TestMqlSystem:
|
||||
TestMqlPn3P4NodeChamberSegmentComponents,
|
||||
)
|
||||
|
||||
def pnl0003_line_and_node_for_orifice(orifice_alias: str):
|
||||
for line_spec in self.pnl0003_assembly.specs:
|
||||
if (
|
||||
line_spec.target_component == orifice_alias
|
||||
and line_spec.target_port == "port_3"
|
||||
and line_spec.source_component in self.node3_assembly
|
||||
):
|
||||
return (
|
||||
self.pnl0003_assembly.lines[line_spec.alias],
|
||||
self.node3_assembly[line_spec.source_component],
|
||||
)
|
||||
if (
|
||||
line_spec.source_component == orifice_alias
|
||||
and line_spec.source_port == "port_3"
|
||||
and line_spec.target_component in self.node3_assembly
|
||||
):
|
||||
return (
|
||||
self.pnl0003_assembly.lines[line_spec.alias],
|
||||
self.node3_assembly[line_spec.target_component],
|
||||
)
|
||||
raise KeyError(f"No PN3/PNL0003 line attached to {orifice_alias}.port_3")
|
||||
|
||||
inlet_line = self.pnl0001_assembly.lines[spec.inlet_line_alias]
|
||||
outlet_line = self.pnl0001_assembly.lines[spec.outlet_line_alias]
|
||||
node_line_spec = self._pnl0003_spec_for_node_port(
|
||||
@@ -4658,6 +4677,12 @@ class TestMqlSystem:
|
||||
p4_port1_remote_orifice = self.pneumatic_assembly.variable_orifices[
|
||||
p4_port1_remote_neighborhood.port_4.orifice_alias
|
||||
]
|
||||
(
|
||||
p4_port1_remote_orifice_line,
|
||||
p4_port1_remote_orifice_node,
|
||||
) = pnl0003_line_and_node_for_orifice(
|
||||
p4_port1_remote_neighborhood.port_4.orifice_alias
|
||||
)
|
||||
p4_port3_remote_neighborhood = self.p4_node_neighborhood(
|
||||
p4_neighborhood.port_3.remote_node_alias
|
||||
)
|
||||
@@ -4691,6 +4716,16 @@ class TestMqlSystem:
|
||||
p4_port3_remote_orifice = self.pneumatic_assembly.variable_orifices[
|
||||
p4_port3_remote_neighborhood.port_4.orifice_alias
|
||||
]
|
||||
(
|
||||
p4_port3_remote_orifice_line,
|
||||
p4_port3_remote_orifice_node,
|
||||
) = pnl0003_line_and_node_for_orifice(
|
||||
p4_port3_remote_neighborhood.port_4.orifice_alias
|
||||
)
|
||||
p4_port3_remote_orifice_resistance = self._pnl00r_line_for_node_port(
|
||||
p4_port3_remote_orifice_node.alias,
|
||||
"port_3",
|
||||
)
|
||||
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]
|
||||
@@ -4744,6 +4779,8 @@ class TestMqlSystem:
|
||||
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_port1_remote_orifice_line=p4_port1_remote_orifice_line,
|
||||
p4_port1_remote_orifice_node=p4_port1_remote_orifice_node,
|
||||
p4_port3_line=p4_port3_line,
|
||||
p4_port3_remote_node=p4_port3_remote_node,
|
||||
p4_port3_remote_primary_line=p4_port3_remote_primary_line,
|
||||
@@ -4753,6 +4790,9 @@ class TestMqlSystem:
|
||||
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,
|
||||
p4_port3_remote_orifice_line=p4_port3_remote_orifice_line,
|
||||
p4_port3_remote_orifice_node=p4_port3_remote_orifice_node,
|
||||
p4_port3_remote_orifice_resistance=p4_port3_remote_orifice_resistance,
|
||||
volume=volume,
|
||||
inlet_orifice=inlet_orifice,
|
||||
outlet_orifice=outlet_orifice,
|
||||
@@ -4766,14 +4806,6 @@ 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(
|
||||
@@ -4784,10 +4816,6 @@ 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,
|
||||
):
|
||||
@@ -4797,18 +4825,6 @@ 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(
|
||||
|
||||
Reference in new issue
Block a user