From 0ea40f61eac148baaa0be98f9beab7f7ad9a4e29 Mon Sep 17 00:00:00 2001 From: AntoineGautier Date: Sat, 2 Sep 2023 11:06:49 +0200 Subject: [PATCH 1/6] Add constants for port coordinates --- IBPSA/Fluid/Interfaces/PartialFourPort.mo | 30 ++++++++++++++++--- IBPSA/Fluid/Interfaces/PartialTwoPort.mo | 18 +++++++++-- .../Fluid/Interfaces/PartialTwoPortVector.mo | 19 ++++++++++-- 3 files changed, 59 insertions(+), 8 deletions(-) diff --git a/IBPSA/Fluid/Interfaces/PartialFourPort.mo b/IBPSA/Fluid/Interfaces/PartialFourPort.mo index 1d5cb458ca..18ca9a2499 100644 --- a/IBPSA/Fluid/Interfaces/PartialFourPort.mo +++ b/IBPSA/Fluid/Interfaces/PartialFourPort.mo @@ -22,6 +22,23 @@ partial model PartialFourPort "Partial model with four ports" X_a=0.40) "Propylene glycol water, 40% mass fraction"))); + constant Integer port_a1_x = -100 + "x-coordinate of port_a1 center"; + constant Integer port_a1_y = 60 + "y-coordinate of port_a1 center"; + constant Integer port_b1_x = 100 + "x-coordinate of port_b1 center"; + constant Integer port_b1_y = 60 + "y-coordinate of port_b1 center"; + constant Integer port_a2_x = 100 + "x-coordinate of port_a2 center"; + constant Integer port_a2_y = -60 + "y-coordinate of port_a2 center"; + constant Integer port_b2_x = -100 + "x-coordinate of port_b2 center"; + constant Integer port_b2_y = -60 + "y-coordinate of port_b2 center"; + parameter Boolean allowFlowReversal1 = true "= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1" annotation(Dialog(tab="Assumptions"), Evaluate=true); @@ -34,26 +51,26 @@ partial model PartialFourPort "Partial model with four ports" m_flow(min=if allowFlowReversal1 then -Modelica.Constants.inf else 0), h_outflow(start = Medium1.h_default, nominal = Medium1.h_default)) "Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)" - annotation (Placement(transformation(extent={{-110,50},{-90,70}}))); + annotation (Placement(transformation(extent={{port_a1_x-10,port_a1_y-10},{port_a1_x+10,port_a1_y+10}}))); Modelica.Fluid.Interfaces.FluidPort_b port_b1( redeclare final package Medium = Medium1, m_flow(max=if allowFlowReversal1 then +Modelica.Constants.inf else 0), h_outflow(start = Medium1.h_default, nominal = Medium1.h_default)) "Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)" - annotation (Placement(transformation(extent={{110,50},{90,70}}))); + annotation (Placement(transformation(extent={{port_b1_x-10,port_b1_y-10},{port_b1_x+10,port_b1_y+10}}))); Modelica.Fluid.Interfaces.FluidPort_a port_a2( redeclare final package Medium = Medium2, m_flow(min=if allowFlowReversal2 then -Modelica.Constants.inf else 0), h_outflow(start = Medium2.h_default, nominal = Medium2.h_default)) "Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)" - annotation (Placement(transformation(extent={{90,-70},{110,-50}}))); + annotation (Placement(transformation(extent={{port_a2_x-10,port_a2_y-10},{port_a2_x+10,port_a2_y+10}}))); Modelica.Fluid.Interfaces.FluidPort_b port_b2( redeclare final package Medium = Medium2, m_flow(max=if allowFlowReversal2 then +Modelica.Constants.inf else 0), h_outflow(start = Medium2.h_default, nominal = Medium2.h_default)) "Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)" - annotation (Placement(transformation(extent={{-90,-70},{-110,-50}}))); + annotation (Placement(transformation(extent={{port_b2_x-10,port_b2_y-10},{port_b2_x+10,port_b2_y+10}}))); annotation ( preferredView="info", @@ -83,6 +100,11 @@ are not implemented. ", revisions="