Skip to content

Commit 4efb7ed

Browse files
Check out components from issue1374_template_CHW_final
1 parent c83ed4b commit 4efb7ed

7 files changed

Lines changed: 198 additions & 63 deletions

File tree

Buildings/Templates/Components/Interfaces/PartialPumpMultiple.mo

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,59 @@ First implementation.
153153
visible=typ<>Buildings.Templates.Components.Types.Pump.None and not have_var and nPum>=4,
154154
extent={{-100, 3*icon_dy+60},{0, 3*icon_dy+160}},
155155
rotation=text_rotation,
156-
fileName="modelica://Buildings/Resources/Images/Templates/Components/Actuators/MotorStarter.svg")}));
156+
fileName="modelica://Buildings/Resources/Images/Templates/Components/Actuators/MotorStarter.svg"),
157+
Line(
158+
visible=typ<>Buildings.Templates.Components.Types.Pump.None and nPum>=5,
159+
points={{-100, 4*icon_dy},{100, 4*icon_dy}},
160+
color={0,0,0},
161+
thickness=5),
162+
Line( visible=typ<>Buildings.Templates.Components.Types.Pump.None and nPum>=5,
163+
points={{-50, 4*icon_dy+60},{-50, 4*icon_dy+22}},
164+
color={0,0,0}),
165+
Bitmap(
166+
visible=typ<>Buildings.Templates.Components.Types.Pump.None and nPum>=5,
167+
extent={{-100, 4*icon_dy-70},{0, 4*icon_dy+30}},
168+
fileName="modelica://Buildings/Resources/Images/Templates/Components/Pumps/Single.svg"),
169+
Bitmap(
170+
visible=typ<>Buildings.Templates.Components.Types.Pump.None and have_valChe and nPum>=5,
171+
extent={{20, 4*icon_dy-40},{100, 4*icon_dy+40}},
172+
fileName="modelica://Buildings/Resources/Images/Templates/Components/Valves/Check.svg"),
173+
Bitmap(
174+
visible=typ<>Buildings.Templates.Components.Types.Pump.None and have_var and nPum>=5,
175+
extent={{-100, 4*icon_dy+60},{0, 4*icon_dy+160}},
176+
rotation=text_rotation,
177+
fileName="modelica://Buildings/Resources/Images/Templates/Components/Actuators/VFD.svg"),
178+
Bitmap(
179+
visible=typ<>Buildings.Templates.Components.Types.Pump.None and not have_var and nPum>=5,
180+
extent={{-100, 4*icon_dy+60},{0, 4*icon_dy+160}},
181+
rotation=text_rotation,
182+
fileName="modelica://Buildings/Resources/Images/Templates/Components/Actuators/MotorStarter.svg"),
183+
Line(
184+
visible=typ<>Buildings.Templates.Components.Types.Pump.None and nPum>=6,
185+
points={{-100, 5*icon_dy},{100, 5*icon_dy}},
186+
color={0,0,0},
187+
thickness=5),
188+
Line( visible=typ<>Buildings.Templates.Components.Types.Pump.None and nPum>=6,
189+
points={{-50, 5*icon_dy+60},{-50, 5*icon_dy+22}},
190+
color={0,0,0}),
191+
Bitmap(
192+
visible=typ<>Buildings.Templates.Components.Types.Pump.None and nPum>=6,
193+
extent={{-100, 5*icon_dy-70},{0, 5*icon_dy+30}},
194+
fileName="modelica://Buildings/Resources/Images/Templates/Components/Pumps/Single.svg"),
195+
Bitmap(
196+
visible=typ<>Buildings.Templates.Components.Types.Pump.None and have_valChe and nPum>=6,
197+
extent={{20, 5*icon_dy-40},{100, 5*icon_dy+40}},
198+
fileName="modelica://Buildings/Resources/Images/Templates/Components/Valves/Check.svg"),
199+
Bitmap(
200+
visible=typ<>Buildings.Templates.Components.Types.Pump.None and have_var and nPum>=6,
201+
extent={{-100, 5*icon_dy+60},{0, 5*icon_dy+160}},
202+
rotation=text_rotation,
203+
fileName="modelica://Buildings/Resources/Images/Templates/Components/Actuators/VFD.svg"),
204+
Bitmap(
205+
visible=typ<>Buildings.Templates.Components.Types.Pump.None and not have_var and nPum>=6,
206+
extent={{-100, 5*icon_dy+60},{0, 5*icon_dy+160}},
207+
rotation=text_rotation,
208+
fileName="modelica://Buildings/Resources/Images/Templates/Components/Actuators/MotorStarter.svg")
209+
}));
157210

158211
end PartialPumpMultiple;

Buildings/Templates/Components/Routing/MultipleToMultiple.mo

Lines changed: 65 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,17 @@ model MultipleToMultiple
4242
annotation (
4343
Dialog(tab="Advanced", group="Diagnostics"), HideResult=true);
4444

45-
parameter Integer icon_extend = 0
46-
"Extend lines by this amount in x-direction in icon layer: >0 at outlet, <0 at inlet"
47-
annotation(Dialog(tab="Graphics", enable=false));
48-
parameter Integer icon_dy = 100
49-
"Distance in y-direction between each branch in icon layer"
50-
annotation(Dialog(tab="Graphics", enable=false));
51-
parameter Buildings.Templates.Components.Types.IconPipe icon_pipe =
45+
constant Integer icon_xinl = -100
46+
"Minimum x-coordinate of inlet connection lines";
47+
constant Integer icon_xout = 100
48+
"Maximum x-coordinate of outlet connection lines";
49+
constant Integer icon_offset = 0
50+
"Offset in y-direction between inlet and outlet in icon layer";
51+
constant Integer icon_dy = 100
52+
"Distance in y-direction between each branch in icon layer";
53+
constant Buildings.Templates.Components.Types.IconPipe icon_pipe =
5254
Buildings.Templates.Components.Types.IconPipe.Supply
53-
"Pipe symbol"
54-
annotation(Dialog(tab="Graphics", enable=false));
55+
"Pipe symbol";
5556

5657
Modelica.Fluid.Interfaces.FluidPorts_a ports_a[nPorts_a](
5758
redeclare each final package Medium = Medium,
@@ -160,49 +161,84 @@ equation
160161
Text( extent={{-149,-114},{151,-154}},
161162
textColor={0,0,255},
162163
textString="%name"),
163-
Line( points={{-100 + min(0,icon_extend), 0}, {100 + max(0, icon_extend),0}},
164+
Line( points={{-100, 0}, {100, 0}},
165+
color={0,127,255},
166+
visible=icon_pipe==Buildings.Templates.Components.Types.IconPipe.None),
167+
Line( points={{icon_xinl, 0}, {0,0}},
164168
color={0,0,0},
165169
thickness=5,
170+
visible=icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
166171
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
167172
then LinePattern.Solid else LinePattern.Dash),
168-
Line( visible=nPorts_a>=2,
169-
points=if have_comLeg then
170-
{{-100 + min(0,icon_extend), icon_dy}, {-40,icon_dy}, {-40, 0}}
171-
else {{-100 + min(0,icon_extend),icon_dy}, {100 + max(0, icon_extend),icon_dy}},
173+
Line( visible=nPorts_a>=2 and icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
174+
points={{icon_xinl, icon_dy}, {0,icon_dy}},
172175
color={0,0,0},
173176
thickness=5,
174177
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
175178
then LinePattern.Solid else LinePattern.Dash),
176-
Line( visible=nPorts_a>=3,
177-
points=if have_comLeg then
178-
{{-100 + min(0,icon_extend), 2*icon_dy}, {-40, 2*icon_dy}, {-40, icon_dy}}
179-
else {{-100 + min(0,icon_extend),2*icon_dy}, {100 + max(0, icon_extend),2*icon_dy}},
179+
Line( visible=nPorts_a>=3 and icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
180+
points={{icon_xinl, 2*icon_dy}, {0, 2*icon_dy}},
180181
color={0,0,0},
181182
thickness=5,
182183
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
183184
then LinePattern.Solid else LinePattern.Dash),
184-
Line( visible=nPorts_a>=4,
185-
points=if have_comLeg then
186-
{{-100 + min(0,icon_extend), 3*icon_dy}, {-40, 3*icon_dy}, {-40, 2*icon_dy}}
187-
else {{-100 + min(0,icon_extend),3*icon_dy}, {100 + max(0, icon_extend),3*icon_dy}},
185+
Line( visible=nPorts_a>=4 and icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
186+
points={{icon_xinl, 3*icon_dy}, {0, 3*icon_dy}},
188187
color={0,0,0},
189188
thickness=5,
190189
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
191190
then LinePattern.Solid else LinePattern.Dash),
192-
Line( visible=nPorts_b>=2 and have_comLeg,
193-
points={{40, 0}, {40, icon_dy}, {100 + max(0, icon_extend), icon_dy}},
191+
Line( visible=nPorts_a>=5 and icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
192+
points={{icon_xinl, 4*icon_dy}, {0, 4*icon_dy}},
194193
color={0,0,0},
195194
thickness=5,
196195
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
197196
then LinePattern.Solid else LinePattern.Dash),
198-
Line( visible=nPorts_b>=3 and have_comLeg,
199-
points={{40, icon_dy}, {40, 2*icon_dy}, {100 + max(0, icon_extend), 2*icon_dy}},
197+
Line( visible=nPorts_a>=6 and icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
198+
points={{icon_xinl, 5*icon_dy}, {0, 5*icon_dy}},
200199
color={0,0,0},
201200
thickness=5,
202201
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
203202
then LinePattern.Solid else LinePattern.Dash),
204-
Line( visible=nPorts_b>=4 and have_comLeg,
205-
points={{40, 2*icon_dy}, {40, 3*icon_dy}, {100 + max(0, icon_extend), 3*icon_dy}},
203+
Line( points={{0, icon_offset}, {icon_xout,icon_offset}},
204+
color={0,0,0},
205+
thickness=5,
206+
visible=icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
207+
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
208+
then LinePattern.Solid else LinePattern.Dash),
209+
Line( visible=nPorts_b>=2 and icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
210+
points={{0, icon_offset + 1*icon_dy}, {icon_xout,icon_offset + 1*icon_dy}},
211+
color={0,0,0},
212+
thickness=5,
213+
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
214+
then LinePattern.Solid else LinePattern.Dash),
215+
Line( visible=nPorts_b>=3 and icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
216+
points={{0, icon_offset + 2*icon_dy}, {icon_xout,icon_offset + 2*icon_dy}},
217+
color={0,0,0},
218+
thickness=5,
219+
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
220+
then LinePattern.Solid else LinePattern.Dash),
221+
Line( visible=nPorts_b>=4 and icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
222+
points={{0, icon_offset + 3*icon_dy}, {icon_xout,icon_offset + 3*icon_dy}},
223+
color={0,0,0},
224+
thickness=5,
225+
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
226+
then LinePattern.Solid else LinePattern.Dash),
227+
Line( visible=nPorts_b>=5 and icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
228+
points={{0, icon_offset + 4*icon_dy}, {icon_xout,icon_offset + 4*icon_dy}},
229+
color={0,0,0},
230+
thickness=5,
231+
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
232+
then LinePattern.Solid else LinePattern.Dash),
233+
Line( visible=nPorts_b>=6 and icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
234+
points={{0, icon_offset + 5*icon_dy}, {icon_xout,icon_offset + 5*icon_dy}},
235+
color={0,0,0},
236+
thickness=5,
237+
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
238+
then LinePattern.Solid else LinePattern.Dash),
239+
Line( visible=icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None and
240+
max(nPorts_a, nPorts_b)>=2 and have_comLeg,
241+
points={{0, 0}, {0, icon_offset + (max(nPorts_a, nPorts_b)-1)*icon_dy}},
206242
color={0,0,0},
207243
thickness=5,
208244
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
@@ -221,7 +257,7 @@ First implementation.
221257
This is a model of a many-to-many fluid connector with an
222258
optional control volume, and an optional mixing port (common leg).
223259
It is typically used to connect parallel pumps with parallel
224-
chillers or boilers.
260+
chillers or boilers.
225261
Selecting a mixing port allows modeling a headered pumping arrangement.
226262
Without any mixing port, a dedicated pumping arrangement is modeled.
227263
</p>

Buildings/Templates/Components/Routing/MultipleToSingle.mo

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,13 @@ model MultipleToSingle "Multiple inlet port, single outlet ports"
3535
Dialog(tab="Advanced", group="Diagnostics"),
3636
HideResult=true);
3737

38-
parameter Integer icon_offset = 0
39-
"Offset in y-direction between inlet and outlet in icon layer"
40-
annotation(Dialog(tab="Graphics", enable=false));
41-
parameter Integer icon_dy = 100
42-
"Distance in y-direction between each branch in icon layer"
43-
annotation(Dialog(tab="Graphics", enable=false));
44-
parameter Buildings.Templates.Components.Types.IconPipe icon_pipe =
45-
Buildings.Templates.Components.Types.IconPipe.Supply
46-
"Pipe symbol"
47-
annotation(Dialog(tab="Graphics", enable=false));
38+
constant Integer icon_offset = 0
39+
"Offset in y-direction between inlet and outlet in icon layer";
40+
constant Integer icon_dy = 100
41+
"Distance in y-direction between each branch in icon layer";
42+
constant Buildings.Templates.Components.Types.IconPipe icon_pipe =
43+
Buildings.Templates.Components.Types.IconPipe.None
44+
"Pipe symbol";
4845

4946
Modelica.Fluid.Interfaces.FluidPorts_a ports_a[nPorts](
5047
redeclare each final package Medium = Medium,
@@ -100,8 +97,7 @@ equation
10097
-20,20},{-10,20}}, color={0,127,255}));
10198
end for;
10299
connect(ports_a, del.ports[1:nPorts]) annotation (Line(points={{-100,0},{-20,0},
103-
{-20,-20},{0,-20}},
104-
color={0,127,255}));
100+
{-20,-20},{0,-20}}, color={0,127,255}));
105101
connect(del.ports[nPorts+1], port_b) annotation (Line(points={{0,-20},{20,-20},
106102
{20,0},{100,0}}, color={0,127,255}));
107103
connect(pasSte.port_b, port_b) annotation (Line(points={{10,20},{20,20},{20,0},
@@ -112,12 +108,16 @@ equation
112108
Text( extent={{-149,-114},{151,-154}},
113109
textColor={0,0,255},
114110
textString="%name"),
111+
Line( points={{-100, 0}, {100, 0}},
112+
color={0,127,255},
113+
visible=icon_pipe==Buildings.Templates.Components.Types.IconPipe.None),
115114
Line( points={{-100, icon_offset}, {0, icon_offset}, {0,0}, {100,0}},
116115
color={0,0,0},
117116
thickness=5,
117+
visible=icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
118118
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
119119
then LinePattern.Solid else LinePattern.Dash),
120-
Line( visible=nPorts>=2,
120+
Line( visible=nPorts>=2 and icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
121121
points=if icon_offset*icon_dy>=0 then
122122
{{0,icon_offset},{0,icon_offset+icon_dy},{-100,icon_offset+icon_dy}}
123123
elseif icon_offset>0 and icon_offset+icon_dy<0 or icon_offset<0 and icon_offset+icon_dy>0 then
@@ -127,7 +127,7 @@ equation
127127
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
128128
then LinePattern.Solid else LinePattern.Dash,
129129
thickness=5),
130-
Line( visible=nPorts>=3,
130+
Line( visible=nPorts>=3 and icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
131131
points=if icon_offset*icon_dy>=0 then
132132
{{0, icon_offset+icon_dy},{0, icon_offset+2*icon_dy},{-100, icon_offset+2*icon_dy}}
133133
elseif icon_offset>0 and icon_offset+2*icon_dy<0 or icon_offset<0 and icon_offset+2*icon_dy>0 then
@@ -137,7 +137,7 @@ equation
137137
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
138138
then LinePattern.Solid else LinePattern.Dash,
139139
thickness=5),
140-
Line( visible=nPorts>=4,
140+
Line( visible=nPorts>=4 and icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
141141
points=if icon_offset*icon_dy>=0 then
142142
{{0, icon_offset+2*icon_dy},{0, icon_offset+3*icon_dy},{-100, icon_offset+3*icon_dy}}
143143
elseif icon_offset>0 and icon_offset+3*icon_dy<0 or icon_offset<0 and icon_offset+3*icon_dy>0 then
@@ -146,6 +146,26 @@ equation
146146
color={0,0,0},
147147
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
148148
then LinePattern.Solid else LinePattern.Dash,
149+
thickness=5),
150+
Line( visible=nPorts>=5 and icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
151+
points=if icon_offset*icon_dy>=0 then
152+
{{0, icon_offset+3*icon_dy},{0, icon_offset+4*icon_dy},{-100, icon_offset+4*icon_dy}}
153+
elseif icon_offset>0 and icon_offset+4*icon_dy<0 or icon_offset<0 and icon_offset+4*icon_dy>0 then
154+
{{0, 0},{0, icon_offset+4*icon_dy},{-100, icon_offset+4*icon_dy}}
155+
else {{0, icon_offset+4*icon_dy},{-100, icon_offset+4*icon_dy}},
156+
color={0,0,0},
157+
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
158+
then LinePattern.Solid else LinePattern.Dash,
159+
thickness=5),
160+
Line( visible=nPorts>=6 and icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
161+
points=if icon_offset*icon_dy>=0 then
162+
{{0, icon_offset+4*icon_dy},{0, icon_offset+5*icon_dy},{-100, icon_offset+5*icon_dy}}
163+
elseif icon_offset>0 and icon_offset+5*icon_dy<0 or icon_offset<0 and icon_offset+5*icon_dy>0 then
164+
{{0, 0},{0, icon_offset+5*icon_dy},{-100, icon_offset+5*icon_dy}}
165+
else {{0, icon_offset+5*icon_dy},{-100, icon_offset+5*icon_dy}},
166+
color={0,0,0},
167+
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
168+
then LinePattern.Solid else LinePattern.Dash,
149169
thickness=5)}),
150170
Diagram(
151171
coordinateSystem(preserveAspectRatio=false)),

0 commit comments

Comments
 (0)