Skip to content

Commit

Permalink
Check out components from issue1374_template_CHW_final
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineGautier committed Aug 31, 2023
1 parent c83ed4b commit 4efb7ed
Show file tree
Hide file tree
Showing 7 changed files with 198 additions and 63 deletions.
55 changes: 54 additions & 1 deletion Buildings/Templates/Components/Interfaces/PartialPumpMultiple.mo
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,59 @@ First implementation.
visible=typ<>Buildings.Templates.Components.Types.Pump.None and not have_var and nPum>=4,
extent={{-100, 3*icon_dy+60},{0, 3*icon_dy+160}},
rotation=text_rotation,
fileName="modelica://Buildings/Resources/Images/Templates/Components/Actuators/MotorStarter.svg")}));
fileName="modelica://Buildings/Resources/Images/Templates/Components/Actuators/MotorStarter.svg"),
Line(
visible=typ<>Buildings.Templates.Components.Types.Pump.None and nPum>=5,
points={{-100, 4*icon_dy},{100, 4*icon_dy}},
color={0,0,0},
thickness=5),
Line( visible=typ<>Buildings.Templates.Components.Types.Pump.None and nPum>=5,
points={{-50, 4*icon_dy+60},{-50, 4*icon_dy+22}},
color={0,0,0}),
Bitmap(
visible=typ<>Buildings.Templates.Components.Types.Pump.None and nPum>=5,
extent={{-100, 4*icon_dy-70},{0, 4*icon_dy+30}},
fileName="modelica://Buildings/Resources/Images/Templates/Components/Pumps/Single.svg"),
Bitmap(
visible=typ<>Buildings.Templates.Components.Types.Pump.None and have_valChe and nPum>=5,
extent={{20, 4*icon_dy-40},{100, 4*icon_dy+40}},
fileName="modelica://Buildings/Resources/Images/Templates/Components/Valves/Check.svg"),
Bitmap(
visible=typ<>Buildings.Templates.Components.Types.Pump.None and have_var and nPum>=5,
extent={{-100, 4*icon_dy+60},{0, 4*icon_dy+160}},
rotation=text_rotation,
fileName="modelica://Buildings/Resources/Images/Templates/Components/Actuators/VFD.svg"),
Bitmap(
visible=typ<>Buildings.Templates.Components.Types.Pump.None and not have_var and nPum>=5,
extent={{-100, 4*icon_dy+60},{0, 4*icon_dy+160}},
rotation=text_rotation,
fileName="modelica://Buildings/Resources/Images/Templates/Components/Actuators/MotorStarter.svg"),
Line(
visible=typ<>Buildings.Templates.Components.Types.Pump.None and nPum>=6,
points={{-100, 5*icon_dy},{100, 5*icon_dy}},
color={0,0,0},
thickness=5),
Line( visible=typ<>Buildings.Templates.Components.Types.Pump.None and nPum>=6,
points={{-50, 5*icon_dy+60},{-50, 5*icon_dy+22}},
color={0,0,0}),
Bitmap(
visible=typ<>Buildings.Templates.Components.Types.Pump.None and nPum>=6,
extent={{-100, 5*icon_dy-70},{0, 5*icon_dy+30}},
fileName="modelica://Buildings/Resources/Images/Templates/Components/Pumps/Single.svg"),
Bitmap(
visible=typ<>Buildings.Templates.Components.Types.Pump.None and have_valChe and nPum>=6,
extent={{20, 5*icon_dy-40},{100, 5*icon_dy+40}},
fileName="modelica://Buildings/Resources/Images/Templates/Components/Valves/Check.svg"),
Bitmap(
visible=typ<>Buildings.Templates.Components.Types.Pump.None and have_var and nPum>=6,
extent={{-100, 5*icon_dy+60},{0, 5*icon_dy+160}},
rotation=text_rotation,
fileName="modelica://Buildings/Resources/Images/Templates/Components/Actuators/VFD.svg"),
Bitmap(
visible=typ<>Buildings.Templates.Components.Types.Pump.None and not have_var and nPum>=6,
extent={{-100, 5*icon_dy+60},{0, 5*icon_dy+160}},
rotation=text_rotation,
fileName="modelica://Buildings/Resources/Images/Templates/Components/Actuators/MotorStarter.svg")
}));

end PartialPumpMultiple;
94 changes: 65 additions & 29 deletions Buildings/Templates/Components/Routing/MultipleToMultiple.mo
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,17 @@ model MultipleToMultiple
annotation (
Dialog(tab="Advanced", group="Diagnostics"), HideResult=true);

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

Modelica.Fluid.Interfaces.FluidPorts_a ports_a[nPorts_a](
redeclare each final package Medium = Medium,
Expand Down Expand Up @@ -160,49 +161,84 @@ equation
Text( extent={{-149,-114},{151,-154}},
textColor={0,0,255},
textString="%name"),
Line( points={{-100 + min(0,icon_extend), 0}, {100 + max(0, icon_extend),0}},
Line( points={{-100, 0}, {100, 0}},
color={0,127,255},
visible=icon_pipe==Buildings.Templates.Components.Types.IconPipe.None),
Line( points={{icon_xinl, 0}, {0,0}},
color={0,0,0},
thickness=5,
visible=icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
then LinePattern.Solid else LinePattern.Dash),
Line( visible=nPorts_a>=2,
points=if have_comLeg then
{{-100 + min(0,icon_extend), icon_dy}, {-40,icon_dy}, {-40, 0}}
else {{-100 + min(0,icon_extend),icon_dy}, {100 + max(0, icon_extend),icon_dy}},
Line( visible=nPorts_a>=2 and icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
points={{icon_xinl, icon_dy}, {0,icon_dy}},
color={0,0,0},
thickness=5,
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
then LinePattern.Solid else LinePattern.Dash),
Line( visible=nPorts_a>=3,
points=if have_comLeg then
{{-100 + min(0,icon_extend), 2*icon_dy}, {-40, 2*icon_dy}, {-40, icon_dy}}
else {{-100 + min(0,icon_extend),2*icon_dy}, {100 + max(0, icon_extend),2*icon_dy}},
Line( visible=nPorts_a>=3 and icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
points={{icon_xinl, 2*icon_dy}, {0, 2*icon_dy}},
color={0,0,0},
thickness=5,
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
then LinePattern.Solid else LinePattern.Dash),
Line( visible=nPorts_a>=4,
points=if have_comLeg then
{{-100 + min(0,icon_extend), 3*icon_dy}, {-40, 3*icon_dy}, {-40, 2*icon_dy}}
else {{-100 + min(0,icon_extend),3*icon_dy}, {100 + max(0, icon_extend),3*icon_dy}},
Line( visible=nPorts_a>=4 and icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
points={{icon_xinl, 3*icon_dy}, {0, 3*icon_dy}},
color={0,0,0},
thickness=5,
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
then LinePattern.Solid else LinePattern.Dash),
Line( visible=nPorts_b>=2 and have_comLeg,
points={{40, 0}, {40, icon_dy}, {100 + max(0, icon_extend), icon_dy}},
Line( visible=nPorts_a>=5 and icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
points={{icon_xinl, 4*icon_dy}, {0, 4*icon_dy}},
color={0,0,0},
thickness=5,
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
then LinePattern.Solid else LinePattern.Dash),
Line( visible=nPorts_b>=3 and have_comLeg,
points={{40, icon_dy}, {40, 2*icon_dy}, {100 + max(0, icon_extend), 2*icon_dy}},
Line( visible=nPorts_a>=6 and icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
points={{icon_xinl, 5*icon_dy}, {0, 5*icon_dy}},
color={0,0,0},
thickness=5,
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
then LinePattern.Solid else LinePattern.Dash),
Line( visible=nPorts_b>=4 and have_comLeg,
points={{40, 2*icon_dy}, {40, 3*icon_dy}, {100 + max(0, icon_extend), 3*icon_dy}},
Line( points={{0, icon_offset}, {icon_xout,icon_offset}},
color={0,0,0},
thickness=5,
visible=icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
then LinePattern.Solid else LinePattern.Dash),
Line( visible=nPorts_b>=2 and icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
points={{0, icon_offset + 1*icon_dy}, {icon_xout,icon_offset + 1*icon_dy}},
color={0,0,0},
thickness=5,
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
then LinePattern.Solid else LinePattern.Dash),
Line( visible=nPorts_b>=3 and icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
points={{0, icon_offset + 2*icon_dy}, {icon_xout,icon_offset + 2*icon_dy}},
color={0,0,0},
thickness=5,
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
then LinePattern.Solid else LinePattern.Dash),
Line( visible=nPorts_b>=4 and icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
points={{0, icon_offset + 3*icon_dy}, {icon_xout,icon_offset + 3*icon_dy}},
color={0,0,0},
thickness=5,
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
then LinePattern.Solid else LinePattern.Dash),
Line( visible=nPorts_b>=5 and icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
points={{0, icon_offset + 4*icon_dy}, {icon_xout,icon_offset + 4*icon_dy}},
color={0,0,0},
thickness=5,
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
then LinePattern.Solid else LinePattern.Dash),
Line( visible=nPorts_b>=6 and icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
points={{0, icon_offset + 5*icon_dy}, {icon_xout,icon_offset + 5*icon_dy}},
color={0,0,0},
thickness=5,
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
then LinePattern.Solid else LinePattern.Dash),
Line( visible=icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None and
max(nPorts_a, nPorts_b)>=2 and have_comLeg,
points={{0, 0}, {0, icon_offset + (max(nPorts_a, nPorts_b)-1)*icon_dy}},
color={0,0,0},
thickness=5,
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
Expand All @@ -221,7 +257,7 @@ First implementation.
This is a model of a many-to-many fluid connector with an
optional control volume, and an optional mixing port (common leg).
It is typically used to connect parallel pumps with parallel
chillers or boilers.
chillers or boilers.
Selecting a mixing port allows modeling a headered pumping arrangement.
Without any mixing port, a dedicated pumping arrangement is modeled.
</p>
Expand Down
50 changes: 35 additions & 15 deletions Buildings/Templates/Components/Routing/MultipleToSingle.mo
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,13 @@ model MultipleToSingle "Multiple inlet port, single outlet ports"
Dialog(tab="Advanced", group="Diagnostics"),
HideResult=true);

parameter Integer icon_offset = 0
"Offset in y-direction between inlet and outlet in icon layer"
annotation(Dialog(tab="Graphics", enable=false));
parameter Integer icon_dy = 100
"Distance in y-direction between each branch in icon layer"
annotation(Dialog(tab="Graphics", enable=false));
parameter Buildings.Templates.Components.Types.IconPipe icon_pipe =
Buildings.Templates.Components.Types.IconPipe.Supply
"Pipe symbol"
annotation(Dialog(tab="Graphics", enable=false));
constant Integer icon_offset = 0
"Offset in y-direction between inlet and outlet in icon layer";
constant Integer icon_dy = 100
"Distance in y-direction between each branch in icon layer";
constant Buildings.Templates.Components.Types.IconPipe icon_pipe =
Buildings.Templates.Components.Types.IconPipe.None
"Pipe symbol";

Modelica.Fluid.Interfaces.FluidPorts_a ports_a[nPorts](
redeclare each final package Medium = Medium,
Expand Down Expand Up @@ -100,8 +97,7 @@ equation
-20,20},{-10,20}}, color={0,127,255}));
end for;
connect(ports_a, del.ports[1:nPorts]) annotation (Line(points={{-100,0},{-20,0},
{-20,-20},{0,-20}},
color={0,127,255}));
{-20,-20},{0,-20}}, color={0,127,255}));
connect(del.ports[nPorts+1], port_b) annotation (Line(points={{0,-20},{20,-20},
{20,0},{100,0}}, color={0,127,255}));
connect(pasSte.port_b, port_b) annotation (Line(points={{10,20},{20,20},{20,0},
Expand All @@ -112,12 +108,16 @@ equation
Text( extent={{-149,-114},{151,-154}},
textColor={0,0,255},
textString="%name"),
Line( points={{-100, 0}, {100, 0}},
color={0,127,255},
visible=icon_pipe==Buildings.Templates.Components.Types.IconPipe.None),
Line( points={{-100, icon_offset}, {0, icon_offset}, {0,0}, {100,0}},
color={0,0,0},
thickness=5,
visible=icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
then LinePattern.Solid else LinePattern.Dash),
Line( visible=nPorts>=2,
Line( visible=nPorts>=2 and icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
points=if icon_offset*icon_dy>=0 then
{{0,icon_offset},{0,icon_offset+icon_dy},{-100,icon_offset+icon_dy}}
elseif icon_offset>0 and icon_offset+icon_dy<0 or icon_offset<0 and icon_offset+icon_dy>0 then
Expand All @@ -127,7 +127,7 @@ equation
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
then LinePattern.Solid else LinePattern.Dash,
thickness=5),
Line( visible=nPorts>=3,
Line( visible=nPorts>=3 and icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
points=if icon_offset*icon_dy>=0 then
{{0, icon_offset+icon_dy},{0, icon_offset+2*icon_dy},{-100, icon_offset+2*icon_dy}}
elseif icon_offset>0 and icon_offset+2*icon_dy<0 or icon_offset<0 and icon_offset+2*icon_dy>0 then
Expand All @@ -137,7 +137,7 @@ equation
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
then LinePattern.Solid else LinePattern.Dash,
thickness=5),
Line( visible=nPorts>=4,
Line( visible=nPorts>=4 and icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
points=if icon_offset*icon_dy>=0 then
{{0, icon_offset+2*icon_dy},{0, icon_offset+3*icon_dy},{-100, icon_offset+3*icon_dy}}
elseif icon_offset>0 and icon_offset+3*icon_dy<0 or icon_offset<0 and icon_offset+3*icon_dy>0 then
Expand All @@ -146,6 +146,26 @@ equation
color={0,0,0},
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
then LinePattern.Solid else LinePattern.Dash,
thickness=5),
Line( visible=nPorts>=5 and icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
points=if icon_offset*icon_dy>=0 then
{{0, icon_offset+3*icon_dy},{0, icon_offset+4*icon_dy},{-100, icon_offset+4*icon_dy}}
elseif icon_offset>0 and icon_offset+4*icon_dy<0 or icon_offset<0 and icon_offset+4*icon_dy>0 then
{{0, 0},{0, icon_offset+4*icon_dy},{-100, icon_offset+4*icon_dy}}
else {{0, icon_offset+4*icon_dy},{-100, icon_offset+4*icon_dy}},
color={0,0,0},
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
then LinePattern.Solid else LinePattern.Dash,
thickness=5),
Line( visible=nPorts>=6 and icon_pipe<>Buildings.Templates.Components.Types.IconPipe.None,
points=if icon_offset*icon_dy>=0 then
{{0, icon_offset+4*icon_dy},{0, icon_offset+5*icon_dy},{-100, icon_offset+5*icon_dy}}
elseif icon_offset>0 and icon_offset+5*icon_dy<0 or icon_offset<0 and icon_offset+5*icon_dy>0 then
{{0, 0},{0, icon_offset+5*icon_dy},{-100, icon_offset+5*icon_dy}}
else {{0, icon_offset+5*icon_dy},{-100, icon_offset+5*icon_dy}},
color={0,0,0},
pattern=if icon_pipe==Buildings.Templates.Components.Types.IconPipe.Supply
then LinePattern.Solid else LinePattern.Dash,
thickness=5)}),
Diagram(
coordinateSystem(preserveAspectRatio=false)),
Expand Down
Loading

0 comments on commit 4efb7ed

Please sign in to comment.