I'm currently modeling an ideal hydraulic swap device. This means, that I have a Y-crossing possessing the ports port_a, port_b and port_c. They are all of type Port_SeaWater. Let n be the boolean control signal, then port_a should be connected either to port_b or (XOR) to port_c. The respective port that's not connected is therefore connected to a dead end called port_stop.
The hydraulic connector is:
++++++++++++++++++++++++++++++++++++++
connector Port_SeaWater "Interface for a streaming salty seawater (binary fluid with water and salt)
OUT OF or INTO a hydraulic device"
import waterLib = PV_RO_components.Hydraulics.Water;
replaceable package Water = waterLib.PartialSeaWater;
///////////////////////////////////////////////////////////////////
Water.StaticPressure p "Static non-gauge pressure";
flow Water.MassFlowRate dotM_flow "Total mass flow rate";
Water.SpecificEnthalpy h "Mass-specific enthalpy";
flow Water.EnthalpyFlowRate dotH_flow "Enthalpy flow rate";
Water.MassFraction X_s "Ratio: Mass of salt per total mass";
flow Water.MassFlowRate dotM_flow_s "Mass flow rate of salt";
end Port_SeaWater;
++++++++++++++++++++++++++++++++++++++
As to my original question, I try to realize my aim by the following construction:
++++++++++++++++++++++++++++++++++++++
if (n == false) then
connect(port_b, port_a);
connect(port_c, port_stop);
else
connect(port_b, port_stop);
connect(port_c, port_a);
end if;
++++++++++++++++++++++++++++++++++++++
But unfortunately, I get an error-message:
++++++++++++++++++++++++++++++++++++++
Check of PV_RO_components.Hydraulics.Devices.Mixture.WorkExchangers.ClarkPump.HydraulicSwap:
Error: Failed to expand block containing connect:
equation
if (n == false) then
connect(port_b, port_a);
connect(port_c, port_stop);
else
connect(port_b, port_stop);
connect(port_c, port_a);
end if;
The model contained invalid connect statements.
Check aborted.
ERROR: 1 error was found
++++++++++++++++++++++++++++++++++++++
Does anybody know, WHETHER my construction is forbidden
Thanks a lot,
Hannes