@@ -3,9 +3,9 @@ model PressureDropsParallel
33 "Test with multiple resistances in parallel"
44 extends Modelica.Icons.Example;
55
6- package Medium = IBPSA.Media.Water "Medium model" ;
6+ package Medium = IBPSA.Media.Water "Medium model" ;
77
8- Modelica.Blocks.Sources.Ramp P(
8+ Modelica.Blocks.Sources.Ramp P(
99 duration= 1 ,
1010 height= 20 ,
1111 offset= 101315 ) "Signal source"
@@ -22,19 +22,18 @@ model PressureDropsParallel
2222
2323 IBPSA.Fluid.Sources.Boundary_pT sou1(
2424 redeclare package Medium = Medium,
25- nPorts= 2 ,
25+ nPorts= 3 ,
2626 use_p_in= true ,
2727 T= 293.15 ) "Pressure boundary condition"
2828 annotation (Placement(transformation(extent={{-60,28},
2929 {-40,48}})));
3030
3131 IBPSA.Fluid.Sources.Boundary_pT sin1(
3232 redeclare package Medium = Medium,
33- nPorts= 2 ,
33+ nPorts= 3 ,
3434 p(displayUnit= "Pa" ) = 101325 ,
3535 T= 283.15 ) "Pressure boundary condition"
36- annotation (Placement(transformation(extent={{80,28},
37- {60,48}})));
36+ annotation (Placement(transformation(extent={{80,30},{60,50}})));
3837
3938 IBPSA.Fluid.FixedResistances.PressureDrop res2(
4039 redeclare package Medium = Medium,
@@ -52,12 +51,40 @@ model PressureDropsParallel
5251 message= "Inputs differ, check that lossless pipe is correctly implemented." ,
5352 threShold= 1E-4 )
5453 "Assert equality of the two mass flow rates"
55- annotation (Placement(transformation(extent={{40 ,60},{60 ,80}})));
54+ annotation (Placement(transformation(extent={{70 ,60},{90 ,80}})));
5655
5756 IBPSA.Fluid.Sensors.MassFlowRate masFlo1(redeclare package Medium = Medium)
5857 "Mass flow rate sensor" annotation (Placement(transformation(extent={{20,30},
5958 {40,50}})));
6059
60+ IBPSA.Fluid.FixedResistances.PressureDrop res3(
61+ redeclare package Medium = Medium,
62+ m_flow_nominal= 5 ,
63+ dp_nominal= 10 ,
64+ deltaM= 0.3 ,
65+ linearized= false ,
66+ from_dp= true ) "Flow resistance"
67+ annotation (Placement(transformation(extent={{-28,-90},{-8,-70}})));
68+ IBPSA.Fluid.Sensors.MassFlowRate masFlo3(redeclare package Medium = Medium)
69+ "Mass flow rate sensor" annotation (Placement(transformation(extent={{0,-90},
70+ {20,-70}})));
71+ IBPSA.Utilities.Diagnostics.AssertEquality assEqu1(
72+ message= "Inputs differ, check that lossless pipe is correctly implemented." ,
73+ threShold= 1E-4 )
74+ "Assert equality of the two mass flow rates"
75+ annotation (Placement(transformation(extent={{70,-40},{90,-20}})));
76+ IBPSA.Fluid.FixedResistances.HydraulicDiameter noRes(
77+ redeclare package Medium = Medium,
78+ m_flow_nominal= 5 ,
79+ linearized= false ,
80+ from_dp= true ,
81+ length= 10 ,
82+ disableComputeFlowResistance= true )
83+ "Flow resistance with computeFlowResistance set to false" annotation (
84+ Placement(transformation(
85+ extent={{-10,-10},{10,10}},
86+ rotation=90,
87+ origin={-32,-42})));
6188equation
6289 connect (P.y, sou1.p_in) annotation (Line(points={{-71,46},{-62,46}},
6390 color={0,0,127}));
@@ -67,33 +94,54 @@ equation
6794 connect (res1.port_b, masFlo1.port_a)
6895 annotation (Line(points={{-8,40},{20,40}},color={0,127,255}));
6996 connect (sou1.ports[1 ], res1.port_a) annotation (Line(
70- points={{-40,40},{-28,40}},
97+ points={{-40,36.6667},{-34,36.6667},{-34, 40},{-28,40}},
7198 color={0,127,255}));
7299 connect (sou1.ports[2 ], res2.port_a) annotation (Line(
73- points={{-40,36 },{-34,36 },{-34,6.10623e-16 },{-28,6.10623e-16 }},
100+ points={{-40,38 },{-34,38 },{-34,0 },{-28,0 }},
74101 color={0,127,255}));
75102 connect (sin1.ports[1 ], masFlo1.port_b) annotation (Line(
76- points={{60,40},{40,40}},
103+ points={{60,38.6667},{50,38.6667},{50, 40},{40,40}},
77104 color={0,127,255}));
78105 connect (sin1.ports[2 ], masFlo2.port_b) annotation (Line(
79- points={{60,36 },{52,36 },{52,6.10623e-16 },{20,6.10623e-16 }},
106+ points={{60,40 },{52,40 },{52,0 },{20,0 }},
80107 color={0,127,255}));
81108 connect (masFlo2.m_flow, assEqu.u1) annotation (Line(
82- points={{10,11},{10,76},{38 ,76}},
109+ points={{10,11},{10,20},{46,20},{46, 76},{68 ,76}},
83110 color={0,0,127}));
84111 connect (masFlo1.m_flow, assEqu.u2) annotation (Line(
85- points={{30,51},{30,64},{38 ,64}},
112+ points={{30,51},{30,64},{68 ,64}},
86113 color={0,0,127}));
87114
115+ connect (sou1.ports[3 ], noRes.port_b) annotation (Line(points={{-40,39.3333},{
116+ -40,38},{-32,38},{-32,-32}},
117+ color={0,127,255}));
118+ connect (noRes.port_a, res3.port_a) annotation (Line(points={{-32,-52},{-32,-80},
119+ {-28,-80}}, color={0,127,255}));
120+ connect (res3.port_b, masFlo3.port_a)
121+ annotation (Line(points={{-8,-80},{0,-80}}, color={0,127,255}));
122+ connect (masFlo3.port_b, sin1.ports[3 ]) annotation (Line(points={{20,-80},{56,
123+ -80},{56,41.3333},{60,41.3333}},
124+ color={0,127,255}));
125+ connect (masFlo2.m_flow, assEqu1.u1) annotation (Line(points={{10,11},{10,20},
126+ {46,20},{46,-24},{68,-24}},color={0,0,127}));
127+ connect (masFlo3.m_flow, assEqu1.u2)
128+ annotation (Line(points={{10,-69},{10,-36},{68,-36}}, color={0,0,127}));
88129annotation (experiment(Tolerance=1e-6, StopTime=1.0),
89130__Dymola_Commands(file="modelica://IBPSA/Resources/Scripts/Dymola/Fluid/FixedResistances/Validation/PressureDropsParallel.mos" "Simulate and plot" ),
90131 Documentation(info="<html>
91132<p>
92133This model tests two resistances in parallel.
134+ The flow path at the bottom of the model also has one additional hydraulic diameter
135+ model, but it has <code>noRes.disableComputeFlowResistance=true</code>, thereby
136+ removing the calculation of the flow resistance in that model.
93137</p>
94138</html>" , revisions="<html>
95139<ul>
96140<li>
141+ April 25, 2025, by Michael Wetter and Fabian Wuellhorst:<br/>
142+ Expanded model to include a component with <code>disableComputeFlowResistance=true</code>.
143+ </li>
144+ <li>
97145July 20, 2007 by Michael Wetter:<br/>
98146First implementation.
99147</li>
0 commit comments