@@ -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.
221257This is a model of a many-to-many fluid connector with an
222258optional control volume, and an optional mixing port (common leg).
223259It is typically used to connect parallel pumps with parallel
224- chillers or boilers.
260+ chillers or boilers.
225261Selecting a mixing port allows modeling a headered pumping arrangement.
226262Without any mixing port, a dedicated pumping arrangement is modeled.
227263</p>
0 commit comments