From f85791dff90b5bd2221da8bced45a57fb702060e Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Wed, 2 Feb 2022 09:06:35 -0800 Subject: [PATCH 001/463] first commit --- .../Plant/BaseClasses/ChillerAndTank.mo | 236 ++++++++++++++++++ .../Storage/Plant/BaseClasses/package.mo | 4 + .../Storage/Plant/BaseClasses/package.order | 1 + .../Plant/ChillerAndTankNoRemoteCharging.mo | 51 ++++ .../ChillerAndTankNoRemoteCharging.mo | 47 ++++ .../Fluid/Storage/Plant/Examples/package.mo | 4 + .../Storage/Plant/Examples/package.order | 1 + Buildings/Fluid/Storage/Plant/package.mo | 4 + Buildings/Fluid/Storage/Plant/package.order | 3 + Buildings/Fluid/Storage/package.order | 1 + 10 files changed, 352 insertions(+) create mode 100644 Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo create mode 100644 Buildings/Fluid/Storage/Plant/BaseClasses/package.mo create mode 100644 Buildings/Fluid/Storage/Plant/BaseClasses/package.order create mode 100644 Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo create mode 100644 Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo create mode 100644 Buildings/Fluid/Storage/Plant/Examples/package.mo create mode 100644 Buildings/Fluid/Storage/Plant/Examples/package.order create mode 100644 Buildings/Fluid/Storage/Plant/package.mo create mode 100644 Buildings/Fluid/Storage/Plant/package.order diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo new file mode 100644 index 00000000000..c66df0cef89 --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo @@ -0,0 +1,236 @@ +within Buildings.Fluid.Storage.Plant.BaseClasses; +partial model ChillerAndTank + "(Draft) A plant with a chiller and a stratified CHW tank" + + package Medium = Buildings.Media.Water "Medium model"; +// replaceable package Medium = +// Modelica.Media.Interfaces.PartialMedium "Medium in the component"; + + parameter Modelica.Units.SI.MassFlowRate m_flow_nominal1=1 + "Nominal mass flow rate for the chiller branch"; + parameter Modelica.Units.SI.MassFlowRate m_flow_nominal2=1 + "Nominal mass flow rate for the tank branch"; + parameter Modelica.Units.SI.PressureDifference dp_nominal= + p_CHWS_nominal-p_CHWR_nominal + "Nominal pressure difference"; + parameter Modelica.Units.SI.AbsolutePressure p_CHWS_nominal=800000 + "Nominal pressure of the CHW supply line"; + parameter Modelica.Units.SI.AbsolutePressure p_CHWR_nominal=300000 + "Nominal pressure of the CHW return line"; + parameter Modelica.Units.SI.Temperature T_CHWS_nominal=7+273.15 + "Nominal temperature of CHW supply"; + parameter Modelica.Units.SI.Temperature T_CHWR_nominal=12+273.15 + "Nominal temperature of CHW return"; + parameter Boolean allowFlowReversal1=false + "Flow reversal setting on chiller branch"; + parameter Boolean allowFlowReversal2=true + "Flow reversal setting on tank branch"; + + Buildings.Fluid.MixingVolumes.MixingVolume vol1( + nPorts=2, + final prescribedHeatFlowRate=true, + redeclare final package Medium = Medium, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + m_flow_nominal=m_flow_nominal1, + allowFlowReversal=allowFlowReversal1, + V=1E-3, + p_start = p_CHWS_nominal, + T_start = T_CHWS_nominal) + "Volume representing a chiller" + annotation (Placement(transformation( + origin={0,60}, + extent={{-10,10},{10,-10}}, + rotation=180))); + Buildings.Fluid.FixedResistances.PressureDrop preDro1( + redeclare package Medium = Medium, + final allowFlowReversal=allowFlowReversal1, + final dp_nominal=dp_nominal, + final m_flow_nominal=m_flow_nominal1) "Flow resistance on chiller branch" + annotation (Placement(transformation(extent={{40,30},{60,50}}))); + Modelica.Blocks.Sources.Constant setFloPum1(k=m_flow_nominal1) "Placeholder" + annotation (Placement(transformation(extent={{-100,60},{-80,80}}))); + Buildings.Fluid.Sensors.TemperatureTwoPort TChiEnt( + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal1, + T_start=T_CHWR_nominal, + tauHeaTra=1) "Chiller entering" + annotation (Placement(transformation(extent={{-40,30},{-20,50}}))); + Buildings.Fluid.Sensors.TemperatureTwoPort TChiLea( + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal1, + T_start=T_CHWS_nominal, + tauHeaTra=1) "Chiller leaving" + annotation (Placement(transformation(extent={{12,30},{32,50}}))); + Buildings.Fluid.Movers.BaseClasses.IdealSource pum1( + redeclare final package Medium = Medium, + final dp_start=dp_nominal, + final m_flow_start=m_flow_nominal1, + final show_T=false, + final show_V_flow=false, + final control_m_flow=true, + final control_dp=false, + final allowFlowReversal=allowFlowReversal1, + final m_flow_small=m_flow_nominal1*1E-5) + "Primary CHW pump" + annotation (Placement(transformation(extent={{-70,30},{-50,50}}))); + Buildings.Fluid.MixingVolumes.MixingVolume vol2( + nPorts=2, + final prescribedHeatFlowRate=true, + redeclare final package Medium = Medium, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + m_flow_nominal=m_flow_nominal2, + allowFlowReversal=allowFlowReversal2, + V=1E-3, + p_start=p_CHWS_nominal, + T_start=T_CHWS_nominal) + "Volume representing a tank" + annotation (Placement(transformation( + origin={0,-40}, + extent={{-10,10},{10,-10}}, + rotation=180))); + Buildings.Fluid.FixedResistances.Junction jun1( + redeclare package Medium = Medium, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + m_flow_nominal={m_flow_nominal1+m_flow_nominal2, + -m_flow_nominal1,-m_flow_nominal2}, + dp_nominal={0,0,0}, + T_start=T_CHWR_nominal) + "Junction near the return line" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-90,0}))); + Buildings.Fluid.FixedResistances.Junction jun2( + redeclare package Medium = Medium, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + m_flow_nominal={m_flow_nominal1,m_flow_nominal2, + -m_flow_nominal1-m_flow_nominal2}, + dp_nominal={0,0,0}, + T_start=T_CHWS_nominal) + "Junction near the supply line" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={100,0}))); + Buildings.Fluid.Sensors.TemperatureTwoPort TTanHot( + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal2, + T_start=T_CHWR_nominal, + tauHeaTra=1) "Tank hot side" + annotation (Placement(transformation(extent={{-40,-70},{-20,-50}}))); + Buildings.Fluid.Sensors.TemperatureTwoPort TTanCol( + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal2, + T_start=T_CHWS_nominal, + tauHeaTra=1) "Tank cold side" + annotation (Placement(transformation(extent={{10,-70},{30,-50}}))); + Buildings.Fluid.FixedResistances.PressureDrop preDro2( + redeclare package Medium = Medium, + final allowFlowReversal=allowFlowReversal2, + final dp_nominal=dp_nominal, + final m_flow_nominal=m_flow_nominal2) "Flow resistance on tank branch" + annotation (Placement(transformation(extent={{40,-70},{60,-50}}))); + Buildings.Fluid.Sensors.MassFlowRate floSenTan( + redeclare package Medium=Medium, + allowFlowReversal=allowFlowReversal2) + "Flow rate sensor on the tank branch" + annotation (Placement(transformation(extent={{-70,-70},{-50,-50}}))); + Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow heaChi + "Prescribed heat flow for chiller" + annotation (Placement(transformation(extent={{40,70},{20,90}}))); + + Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow heaTan + "Prescribed heat flow for tank" + annotation (Placement(transformation(extent={{-6,-20},{14,0}}))); + Modelica.Blocks.Sources.RealExpression QTan( + y=if floSenTan.m_flow>0 then + floSenTan.m_flow*(port_b.h_outflow - TTanHot.port_b.h_outflow) + else + floSenTan.m_flow*(TTanCol.port_a.h_outflow - port_a.h_outflow)) + "Heat flow of the tank" + annotation (Placement(transformation(extent={{-48,-20},{-28,0}}))); + Modelica.Blocks.Math.Gain gain1(k=2*4200*5*m_flow_nominal1) + annotation (Placement(transformation(extent={{10,-10},{-10,10}}, + rotation=0, + origin={70,80}))); + Buildings.Controls.Continuous.LimPID conPID1( + Td=1, + k=5, + Ti=50, + yMin=-1) + annotation (Placement(transformation(extent={{-10,10},{10,-10}}, + rotation=180, + origin={110,40}))); + Modelica.Blocks.Sources.Constant setTChiLea(k=T_CHWS_nominal) + "Chiller water leaving temperature setpoint" + annotation (Placement(transformation(extent={{100,70},{120,90}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a( + p(start=p_CHWR_nominal), + redeclare final package Medium = Medium, + m_flow(min=if allowFlowReversal2 then -Modelica.Constants.inf else 0), + h_outflow(start=Medium.h_default, nominal=Medium.h_default)) + "Fluid connector a (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{-190,-10},{-170,10}}), + iconTransformation(extent={{-190,-10},{-170,10}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b( + p(start=p_CHWS_nominal), + redeclare final package Medium = Medium, + m_flow(max=if allowFlowReversal2 then +Modelica.Constants.inf else 0), + h_outflow(start=Medium.h_default, nominal=Medium.h_default)) + "Fluid connector b (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{150,-10},{130,10}}), + iconTransformation(extent={{150,-10},{130,10}}))); +equation + + connect(TChiEnt.port_b, vol1.ports[1]) + annotation (Line(points={{-20,40},{1,40},{1,50}}, color={0,127,255})); + connect(preDro1.port_a,TChiLea. port_b) + annotation (Line(points={{40,40},{32,40}}, color={0,127,255})); + connect(TChiLea.port_a, vol1.ports[2]) + annotation (Line(points={{12,40},{-1,40},{-1,50}}, color={0,127,255})); + connect(pum1.port_b,TChiEnt. port_a) + annotation (Line(points={{-50,40},{-40,40}}, color={0,127,255})); + connect(setFloPum1.y, pum1.m_flow_in) + annotation (Line(points={{-79,70},{-66,70},{-66,48}}, color={0,0,127})); + connect(pum1.port_a, jun1.port_2) annotation (Line(points={{-70,40},{-74,40},{ + -74,0},{-80,0}}, + color={0,127,255})); + connect(TTanHot.port_b, vol2.ports[1]) + annotation (Line(points={{-20,-60},{1,-60},{1,-50}}, color={0,127,255})); + connect(vol2.ports[2], TTanCol.port_a) + annotation (Line(points={{-1,-50},{-1,-60},{10,-60}}, color={0,127,255})); + connect(TTanCol.port_b, preDro2.port_a) + annotation (Line(points={{30,-60},{40,-60}}, color={0,127,255})); + connect(preDro2.port_b, jun2.port_3) + annotation (Line(points={{60,-60},{100,-60},{100,-10}}, + color={0,127,255})); + connect(jun1.port_3, floSenTan.port_a) + annotation (Line(points={{-90,-10},{-90,-60},{-70,-60}}, + color={0,127,255})); + connect(floSenTan.port_b, TTanHot.port_a) + annotation (Line(points={{-50,-60},{-40,-60}}, color={0,127,255})); + connect(preDro1.port_b, jun2.port_1) + annotation (Line(points={{60,40},{84,40},{84,0},{90,0}}, + color={0,127,255})); + connect(heaChi.port, vol1.heatPort) annotation (Line(points={{20,80},{10,80},{ + 10,60}}, color={191,0,0})); + connect(QTan.y, heaTan.Q_flow) + annotation (Line(points={{-27,-10},{-6,-10}}, + color={0,0,127})); + connect(heaTan.port, vol2.heatPort) annotation (Line(points={{14,-10},{20,-10}, + {20,-40},{10,-40}},color={191,0,0})); + connect(gain1.y, heaChi.Q_flow) + annotation (Line(points={{59,80},{40,80}}, color={0,0,127})); + connect(conPID1.y,gain1. u) + annotation (Line(points={{99,40},{88,40},{88,80},{82,80}}, + color={0,0,127})); + connect(TChiLea.T, conPID1.u_m) annotation (Line(points={{22,51},{22,56},{80,56}, + {80,20},{110,20},{110,28}}, + color={0,0,127})); + connect(setTChiLea.y, conPID1.u_s) annotation (Line(points={{121,80},{130,80}, + {130,40},{122,40}}, color={0,0,127})); + connect(jun2.port_2, port_b) + annotation (Line(points={{110,0},{140,0}}, color={0,127,255})); + annotation ( + experiment(Tolerance=1e-06, StopTime=3600), + Diagram(coordinateSystem(extent={{-180,-100},{140,100}})), + Icon(coordinateSystem(extent={{-180,-100},{140,100}}))); +end ChillerAndTank; diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/package.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/package.mo new file mode 100644 index 00000000000..b9efa93ff87 --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/package.mo @@ -0,0 +1,4 @@ +within Buildings.Fluid.Storage.Plant; +package BaseClasses "Package with base classes for Buildings.Fluid.Storage.Plant" +extends Modelica.Icons.BasesPackage; +end BaseClasses; diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/package.order b/Buildings/Fluid/Storage/Plant/BaseClasses/package.order new file mode 100644 index 00000000000..09836aaef9c --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/package.order @@ -0,0 +1 @@ +ChillerAndTank diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo new file mode 100644 index 00000000000..f61ad917765 --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo @@ -0,0 +1,51 @@ +within Buildings.Fluid.Storage.Plant; +model ChillerAndTankNoRemoteCharging + "Model of a plant with a chiller and a tank where the tank cannot be charged remotely" + extends Buildings.Fluid.Storage.Plant.BaseClasses.ChillerAndTank; + + Movers.SpeedControlled_y pum2( + redeclare package Medium = Medium, + per(pressure(dp=dp_nominal*{2,1.2,0}, V_flow=(m_flow_nominal1 + + m_flow_nominal2)/1.2*{0,1.2,2})), + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + allowFlowReversal=true, + addPowerToMedium=false, + y_start=0, + T_start=T_CHWR_nominal) "Secondary pump" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-130,0}))); + Controls.Continuous.LimPID conPIDPum2( + Td=1, + k=1, + Ti=15) "PI controller for the secondary pump" + annotation (Placement(transformation(extent={{10,10},{-10,-10}}, + rotation=-90, + origin={-150,-30}))); + Modelica.Blocks.Math.Gain gain2(k=1/m_flow_nominal2) "Gain" + annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={-110,-30}))); + Modelica.Blocks.Sources.TimeTable setFloPum2(table=[0*3600,1; 0.25*3600,1; 0.25 + *3600,-1; 0.5*3600,-1; 0.5*3600,0; 0.75*3600,0; 0.75*3600,1; 1*3600,1]) + "Placeholder" + annotation (Placement(transformation(extent={{-180,-80},{-160,-60}}))); +equation + connect(port_a, pum2.port_a) + annotation (Line(points={{-180,0},{-140,0}}, color={0,127,255})); + connect(pum2.port_b, jun1.port_1) + annotation (Line(points={{-120,0},{-100,0}}, color={0,127,255})); + connect(floSenTan.m_flow, gain2.u) + annotation (Line(points={{-60,-49},{-60,-30},{-98,-30}}, color={0,0,127})); + connect(gain2.y, conPIDPum2.u_m) + annotation (Line(points={{-121,-30},{-138,-30}}, color={0,0,127})); + connect(setFloPum2.y,conPIDPum2. u_s) + annotation (Line(points={{-159,-70},{-150,-70},{-150,-42}}, + color={0,0,127})); + connect(conPIDPum2.y, pum2.y) annotation (Line(points={{-150,-19},{-150,18},{-130, + 18},{-130,12}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end ChillerAndTankNoRemoteCharging; diff --git a/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo new file mode 100644 index 00000000000..aca03d85cd1 --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo @@ -0,0 +1,47 @@ +within Buildings.Fluid.Storage.Plant.Examples; +model ChillerAndTankNoRemoteCharging "(Draft)" + extends Modelica.Icons.Example; + + package Medium = Buildings.Media.Water "Medium model"; + + Buildings.Fluid.Storage.Plant.ChillerAndTankNoRemoteCharging cat( + dp_nominal=sin.p-sou.p, + vol1(p_start=sin.p, + T_start=sin.T), + vol2(p_start=sin.p, + T_start=sin.T), + TChiEnt(T_start=sou.T), + TChiLea(T_start=sin.T)) + "Plant with chiller and tank" + annotation (Placement(transformation(extent={{-16,-10},{16,10}}))); + Buildings.Fluid.Sources.Boundary_pT sou( + redeclare package Medium = Medium, + p=300000, + T=285.15, + nPorts=1) + "Source, CHW return line" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-60,0}))); + Buildings.Fluid.Sources.Boundary_pT sin( + redeclare package Medium = Medium, + p=800000, + T=280.15, + nPorts=1) + "Sink, CHW supply line" + annotation (Placement(transformation( + extent={{-10,10},{10,-10}}, + rotation=180, + origin={60,0}))); +equation + connect(sou.ports[1], cat.port_a) + annotation (Line(points={{-50,0},{-16,0}}, color={0,127,255})); + connect(cat.port_b, sin.ports[1]) annotation (Line(points={{16,0},{33,0},{33,4.44089e-16}, + {50,4.44089e-16}}, color={0,127,255})); + + annotation ( + experiment(Tolerance=1e-06, StopTime=3600), + Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), + Icon(coordinateSystem(extent={{-100,-100},{100,120}}))); +end ChillerAndTankNoRemoteCharging; diff --git a/Buildings/Fluid/Storage/Plant/Examples/package.mo b/Buildings/Fluid/Storage/Plant/Examples/package.mo new file mode 100644 index 00000000000..8e21f5bfedd --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/Examples/package.mo @@ -0,0 +1,4 @@ +within Buildings.Fluid.Storage.Plant; +package Examples "Collection of models that illustrate model use and test models" +extends Modelica.Icons.ExamplesPackage; +end Examples; diff --git a/Buildings/Fluid/Storage/Plant/Examples/package.order b/Buildings/Fluid/Storage/Plant/Examples/package.order new file mode 100644 index 00000000000..b47f2186e89 --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/Examples/package.order @@ -0,0 +1 @@ +ChillerAndTankNoRemoteCharging diff --git a/Buildings/Fluid/Storage/Plant/package.mo b/Buildings/Fluid/Storage/Plant/package.mo new file mode 100644 index 00000000000..e6b47d118f8 --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/package.mo @@ -0,0 +1,4 @@ +within Buildings.Fluid.Storage; +package Plant "(Draft) Package with plant models that have both chillers and storage tanks" +extends Modelica.Icons.VariantsPackage; +end Plant; diff --git a/Buildings/Fluid/Storage/Plant/package.order b/Buildings/Fluid/Storage/Plant/package.order new file mode 100644 index 00000000000..064fe52b76a --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/package.order @@ -0,0 +1,3 @@ +ChillerAndTankNoRemoteCharging +Examples +BaseClasses diff --git a/Buildings/Fluid/Storage/package.order b/Buildings/Fluid/Storage/package.order index 60f1492b86d..19b039d804b 100644 --- a/Buildings/Fluid/Storage/package.order +++ b/Buildings/Fluid/Storage/package.order @@ -4,6 +4,7 @@ Stratified StratifiedEnhanced StratifiedEnhancedInternalHex Ice +Plant Examples Validation BaseClasses From 324520898e0bff75e0b98dad1fd5db133e2b884a Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Wed, 2 Feb 2022 14:29:55 -0800 Subject: [PATCH 002/463] moved secondary pump stpt outside of the model --- .../Plant/ChillerAndTankNoRemoteCharging.mo | 30 +++++++++---------- .../ChillerAndTankNoRemoteCharging.mo | 7 +++++ 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo index f61ad917765..9c00b892a80 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo @@ -20,32 +20,32 @@ model ChillerAndTankNoRemoteCharging k=1, Ti=15) "PI controller for the secondary pump" annotation (Placement(transformation(extent={{10,10},{-10,-10}}, - rotation=-90, - origin={-150,-30}))); + rotation=180, + origin={-150,70}))); Modelica.Blocks.Math.Gain gain2(k=1/m_flow_nominal2) "Gain" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, - rotation=180, - origin={-110,-30}))); - Modelica.Blocks.Sources.TimeTable setFloPum2(table=[0*3600,1; 0.25*3600,1; 0.25 - *3600,-1; 0.5*3600,-1; 0.5*3600,0; 0.75*3600,0; 0.75*3600,1; 1*3600,1]) - "Placeholder" - annotation (Placement(transformation(extent={{-180,-80},{-160,-60}}))); + rotation=90, + origin={-150,30}))); + Modelica.Blocks.Interfaces.RealInput usMasFloPum2 + "Secondary pump mass flow rate setpoint" annotation (Placement( + transformation(extent={{-204,58},{-180,82}}), iconTransformation(extent + ={{-200,50},{-180,70}}))); equation connect(port_a, pum2.port_a) annotation (Line(points={{-180,0},{-140,0}}, color={0,127,255})); connect(pum2.port_b, jun1.port_1) annotation (Line(points={{-120,0},{-100,0}}, color={0,127,255})); connect(floSenTan.m_flow, gain2.u) - annotation (Line(points={{-60,-49},{-60,-30},{-98,-30}}, color={0,0,127})); + annotation (Line(points={{-60,-49},{-60,-46},{-150,-46},{-150,18}}, + color={0,0,127})); connect(gain2.y, conPIDPum2.u_m) - annotation (Line(points={{-121,-30},{-138,-30}}, color={0,0,127})); - connect(setFloPum2.y,conPIDPum2. u_s) - annotation (Line(points={{-159,-70},{-150,-70},{-150,-42}}, - color={0,0,127})); - connect(conPIDPum2.y, pum2.y) annotation (Line(points={{-150,-19},{-150,18},{-130, - 18},{-130,12}}, color={0,0,127})); + annotation (Line(points={{-150,41},{-150,58}}, color={0,0,127})); + connect(conPIDPum2.y, pum2.y) annotation (Line(points={{-139,70},{-130,70},{ + -130,12}}, color={0,0,127})); + connect(usMasFloPum2, conPIDPum2.u_s) + annotation (Line(points={{-192,70},{-162,70}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( coordinateSystem(preserveAspectRatio=false))); end ChillerAndTankNoRemoteCharging; diff --git a/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo index aca03d85cd1..fc622c58984 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo @@ -34,12 +34,19 @@ model ChillerAndTankNoRemoteCharging "(Draft)" extent={{-10,10},{10,-10}}, rotation=180, origin={60,0}))); + Modelica.Blocks.Sources.TimeTable setFloPum2(table=[0*3600,1; 0.25*3600,1; + 0.25*3600,-1; 0.5*3600,-1; 0.5*3600,0; 0.75*3600,0; 0.75*3600,1; 1*3600, + 1]) + "Placeholder" + annotation (Placement(transformation(extent={{-70,20},{-50,40}}))); equation connect(sou.ports[1], cat.port_a) annotation (Line(points={{-50,0},{-16,0}}, color={0,127,255})); connect(cat.port_b, sin.ports[1]) annotation (Line(points={{16,0},{33,0},{33,4.44089e-16}, {50,4.44089e-16}}, color={0,127,255})); + connect(setFloPum2.y, cat.usMasFloPum2) annotation (Line(points={{-49,30},{ + -22,30},{-22,6},{-17,6}}, color={0,0,127})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), From 88fe519a53416f7e22d3182e49f154297e8dcedf Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Fri, 4 Feb 2022 14:14:47 -0800 Subject: [PATCH 003/463] draft reversible plant model --- .../Plant/BaseClasses/ChillerAndTank.mo | 58 +++--- .../BaseClasses/ReversiblePumpValveControl.mo | 181 ++++++++++++++++++ .../Storage/Plant/BaseClasses/package.order | 1 + .../Plant/ChillerAndTankNoRemoteCharging.mo | 25 +-- .../Plant/ChillerAndTankWithRemoteCharging.mo | 88 +++++++++ .../ChillerAndTankNoRemoteCharging.mo | 24 +-- .../ChillerAndTankWithRemoteCharging.mo | 64 +++++++ .../Storage/Plant/Examples/package.order | 1 + Buildings/Fluid/Storage/Plant/package.order | 1 + 9 files changed, 389 insertions(+), 54 deletions(-) create mode 100644 Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo create mode 100644 Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo create mode 100644 Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankWithRemoteCharging.mo diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo index c66df0cef89..b90652db900 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo @@ -2,9 +2,8 @@ within Buildings.Fluid.Storage.Plant.BaseClasses; partial model ChillerAndTank "(Draft) A plant with a chiller and a stratified CHW tank" - package Medium = Buildings.Media.Water "Medium model"; -// replaceable package Medium = -// Modelica.Media.Interfaces.PartialMedium "Medium in the component"; + replaceable package Medium = + Modelica.Media.Interfaces.PartialMedium "Medium in the component"; parameter Modelica.Units.SI.MassFlowRate m_flow_nominal1=1 "Nominal mass flow rate for the chiller branch"; @@ -23,13 +22,11 @@ partial model ChillerAndTank "Nominal temperature of CHW return"; parameter Boolean allowFlowReversal1=false "Flow reversal setting on chiller branch"; - parameter Boolean allowFlowReversal2=true - "Flow reversal setting on tank branch"; Buildings.Fluid.MixingVolumes.MixingVolume vol1( nPorts=2, final prescribedHeatFlowRate=true, - redeclare final package Medium = Medium, + redeclare package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, m_flow_nominal=m_flow_nominal1, allowFlowReversal=allowFlowReversal1, @@ -48,13 +45,13 @@ partial model ChillerAndTank final m_flow_nominal=m_flow_nominal1) "Flow resistance on chiller branch" annotation (Placement(transformation(extent={{40,30},{60,50}}))); Modelica.Blocks.Sources.Constant setFloPum1(k=m_flow_nominal1) "Placeholder" - annotation (Placement(transformation(extent={{-100,60},{-80,80}}))); + annotation (Placement(transformation(extent={{-80,60},{-60,80}}))); Buildings.Fluid.Sensors.TemperatureTwoPort TChiEnt( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal1, T_start=T_CHWR_nominal, tauHeaTra=1) "Chiller entering" - annotation (Placement(transformation(extent={{-40,30},{-20,50}}))); + annotation (Placement(transformation(extent={{-30,30},{-10,50}}))); Buildings.Fluid.Sensors.TemperatureTwoPort TChiLea( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal1, @@ -62,7 +59,7 @@ partial model ChillerAndTank tauHeaTra=1) "Chiller leaving" annotation (Placement(transformation(extent={{12,30},{32,50}}))); Buildings.Fluid.Movers.BaseClasses.IdealSource pum1( - redeclare final package Medium = Medium, + redeclare package Medium = Medium, final dp_start=dp_nominal, final m_flow_start=m_flow_nominal1, final show_T=false, @@ -72,14 +69,14 @@ partial model ChillerAndTank final allowFlowReversal=allowFlowReversal1, final m_flow_small=m_flow_nominal1*1E-5) "Primary CHW pump" - annotation (Placement(transformation(extent={{-70,30},{-50,50}}))); + annotation (Placement(transformation(extent={{-60,30},{-40,50}}))); Buildings.Fluid.MixingVolumes.MixingVolume vol2( + redeclare package Medium = Medium, nPorts=2, final prescribedHeatFlowRate=true, - redeclare final package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, m_flow_nominal=m_flow_nominal2, - allowFlowReversal=allowFlowReversal2, + final allowFlowReversal=true, V=1E-3, p_start=p_CHWS_nominal, T_start=T_CHWS_nominal) @@ -98,7 +95,7 @@ partial model ChillerAndTank "Junction near the return line" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-90,0}))); + origin={-80,0}))); Buildings.Fluid.FixedResistances.Junction jun2( redeclare package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, @@ -115,7 +112,7 @@ partial model ChillerAndTank m_flow_nominal=m_flow_nominal2, T_start=T_CHWR_nominal, tauHeaTra=1) "Tank hot side" - annotation (Placement(transformation(extent={{-40,-70},{-20,-50}}))); + annotation (Placement(transformation(extent={{-30,-70},{-10,-50}}))); Buildings.Fluid.Sensors.TemperatureTwoPort TTanCol( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal2, @@ -124,15 +121,15 @@ partial model ChillerAndTank annotation (Placement(transformation(extent={{10,-70},{30,-50}}))); Buildings.Fluid.FixedResistances.PressureDrop preDro2( redeclare package Medium = Medium, - final allowFlowReversal=allowFlowReversal2, + final allowFlowReversal=true, final dp_nominal=dp_nominal, final m_flow_nominal=m_flow_nominal2) "Flow resistance on tank branch" annotation (Placement(transformation(extent={{40,-70},{60,-50}}))); Buildings.Fluid.Sensors.MassFlowRate floSenTan( redeclare package Medium=Medium, - allowFlowReversal=allowFlowReversal2) + final allowFlowReversal=true) "Flow rate sensor on the tank branch" - annotation (Placement(transformation(extent={{-70,-70},{-50,-50}}))); + annotation (Placement(transformation(extent={{-60,-70},{-40,-50}}))); Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow heaChi "Prescribed heat flow for chiller" annotation (Placement(transformation(extent={{40,70},{20,90}}))); @@ -164,37 +161,36 @@ partial model ChillerAndTank annotation (Placement(transformation(extent={{100,70},{120,90}}))); Modelica.Fluid.Interfaces.FluidPort_a port_a( p(start=p_CHWR_nominal), - redeclare final package Medium = Medium, - m_flow(min=if allowFlowReversal2 then -Modelica.Constants.inf else 0), + redeclare package Medium = Medium, h_outflow(start=Medium.h_default, nominal=Medium.h_default)) "Fluid connector a (positive design flow direction is from port_a to port_b)" annotation (Placement(transformation(extent={{-190,-10},{-170,10}}), - iconTransformation(extent={{-190,-10},{-170,10}}))); + iconTransformation(extent={{-110,-10},{-90,10}}))); Modelica.Fluid.Interfaces.FluidPort_b port_b( p(start=p_CHWS_nominal), redeclare final package Medium = Medium, - m_flow(max=if allowFlowReversal2 then +Modelica.Constants.inf else 0), h_outflow(start=Medium.h_default, nominal=Medium.h_default)) "Fluid connector b (positive design flow direction is from port_a to port_b)" annotation (Placement(transformation(extent={{150,-10},{130,10}}), - iconTransformation(extent={{150,-10},{130,10}}))); + iconTransformation(extent={{110,-10},{90,10}}))); equation connect(TChiEnt.port_b, vol1.ports[1]) - annotation (Line(points={{-20,40},{1,40},{1,50}}, color={0,127,255})); + annotation (Line(points={{-10,40},{0,40},{0,50},{1,50}}, + color={0,127,255})); connect(preDro1.port_a,TChiLea. port_b) annotation (Line(points={{40,40},{32,40}}, color={0,127,255})); connect(TChiLea.port_a, vol1.ports[2]) annotation (Line(points={{12,40},{-1,40},{-1,50}}, color={0,127,255})); connect(pum1.port_b,TChiEnt. port_a) - annotation (Line(points={{-50,40},{-40,40}}, color={0,127,255})); + annotation (Line(points={{-40,40},{-30,40}}, color={0,127,255})); connect(setFloPum1.y, pum1.m_flow_in) - annotation (Line(points={{-79,70},{-66,70},{-66,48}}, color={0,0,127})); - connect(pum1.port_a, jun1.port_2) annotation (Line(points={{-70,40},{-74,40},{ - -74,0},{-80,0}}, + annotation (Line(points={{-59,70},{-56,70},{-56,48}}, color={0,0,127})); + connect(pum1.port_a, jun1.port_2) annotation (Line(points={{-60,40},{-66,40},{ + -66,0},{-70,0}}, color={0,127,255})); connect(TTanHot.port_b, vol2.ports[1]) - annotation (Line(points={{-20,-60},{1,-60},{1,-50}}, color={0,127,255})); + annotation (Line(points={{-10,-60},{1,-60},{1,-50}}, color={0,127,255})); connect(vol2.ports[2], TTanCol.port_a) annotation (Line(points={{-1,-50},{-1,-60},{10,-60}}, color={0,127,255})); connect(TTanCol.port_b, preDro2.port_a) @@ -203,10 +199,10 @@ equation annotation (Line(points={{60,-60},{100,-60},{100,-10}}, color={0,127,255})); connect(jun1.port_3, floSenTan.port_a) - annotation (Line(points={{-90,-10},{-90,-60},{-70,-60}}, + annotation (Line(points={{-80,-10},{-80,-60},{-60,-60}}, color={0,127,255})); connect(floSenTan.port_b, TTanHot.port_a) - annotation (Line(points={{-50,-60},{-40,-60}}, color={0,127,255})); + annotation (Line(points={{-40,-60},{-30,-60}}, color={0,127,255})); connect(preDro1.port_b, jun2.port_1) annotation (Line(points={{60,40},{84,40},{84,0},{90,0}}, color={0,127,255})); @@ -232,5 +228,5 @@ equation annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-180,-100},{140,100}})), - Icon(coordinateSystem(extent={{-180,-100},{140,100}}))); + Icon(coordinateSystem(extent={{-100,-100},{100,100}}))); end ChillerAndTank; diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo new file mode 100644 index 00000000000..dbba1ad5057 --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo @@ -0,0 +1,181 @@ +within Buildings.Fluid.Storage.Plant.BaseClasses; +block ReversiblePumpValveControl + "Control block for the secondary pump-valve group" + extends Modelica.Blocks.Icons.Block; + + Modelica.Blocks.Sources.Constant conOne(k=1) "Constant y = 1" + annotation (Placement(transformation(extent={{-100,-20},{-80,0}}))); + Controls.OBC.CDL.Continuous.Switch swiOnOff "Online/offline switch" + annotation (Placement(transformation(extent={{-60,-90},{-40,-70}}))); + Modelica.Blocks.Sources.Constant conZero(k=0) "Constant y = 0" + annotation (Placement(transformation(extent={{-100,-60},{-80,-40}}))); + Controls.OBC.CDL.Continuous.Switch swiFloDirPum2 "Flow direction of pum2" + annotation (Placement(transformation(extent={{-50,-40},{-30,-20}}))); + Controls.OBC.CDL.Continuous.Switch swiFloDirVal2 "Flow direction of val2" + annotation (Placement(transformation(extent={{0,-40},{20,-20}}))); + Controls.OBC.CDL.Continuous.Switch swiFloDirVal1 "Flow direction of val2" + annotation (Placement(transformation(extent={{50,-40},{70,-20}}))); + Controls.Continuous.LimPID conPI_pum2( + controllerType=Modelica.Blocks.Types.SimpleController.PI, + Td=1, + k=5, + Ti=50, + yMin=-1) "PI controller for pum2" annotation (Placement(transformation( + extent={{-10,10},{10,-10}}, + rotation=270, + origin={-70,60}))); + Modelica.Blocks.Math.Gain gaiPum2(k=1) "Gain" annotation (Placement( + transformation( + extent={{10,-10},{-10,10}}, + rotation=90, + origin={-70,30}))); + Controls.Continuous.LimPID conPI_val2( + controllerType=Modelica.Blocks.Types.SimpleController.PI, + Td=1, + k=5, + Ti=50, + yMin=-1) "PI controller for val2" annotation (Placement(transformation( + extent={{-10,10},{10,-10}}, + rotation=270, + origin={-20,60}))); + Modelica.Blocks.Math.Gain gaiVal2(k=1) "Gain" annotation (Placement( + transformation( + extent={{10,-10},{-10,10}}, + rotation=90, + origin={-20,30}))); + Controls.OBC.CDL.Interfaces.BooleanInput booFloDir + "Flow direction, true = normal, false = reverse" annotation (Placement( + transformation(extent={{-140,-10},{-100,30}}), iconTransformation( + extent={{-140,-50},{-100,-10}}))); + Modelica.Blocks.Interfaces.RealInput us_mTan_flow + "Tank mass flow rate setpoint" annotation (Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=-90, + origin={-70,120}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-110,30}))); + Modelica.Blocks.Interfaces.RealInput um_mTan_flow + "Measured tank mass flow rate" annotation (Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=-90, + origin={-10,120}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-110,70}))); + Controls.OBC.CDL.Continuous.Min minPum2 "Offline signal overrides all" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-10,-80}))); + Controls.OBC.CDL.Continuous.Min minVal2 "Offline signal overrides all" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={30,-80}))); + Controls.OBC.CDL.Continuous.Min minVal1 "Offline signal overrides all" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={70,-80}))); + Controls.OBC.CDL.Interfaces.BooleanInput onOffLin + "Plant online/offline signal, true = online, false = offline" annotation ( + Placement(transformation(extent={{-140,-100},{-100,-60}}), + iconTransformation(extent={{-140,-90},{-100,-50}}))); + Modelica.Blocks.Interfaces.RealOutput yPum2 "Normalised speed" annotation ( + Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=-90, + origin={-10,-120}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-10,-110}))); + Modelica.Blocks.Interfaces.RealOutput yVal2 "Valve position" annotation ( + Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=-90, + origin={30,-120}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={30,-110}))); + Modelica.Blocks.Interfaces.RealOutput yVal1 "Valve position" annotation ( + Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=-90, + origin={70,-120}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={70,-110}))); +equation + + connect(conOne.y,swiOnOff. u1) annotation (Line(points={{-79,-10},{-66,-10},{-66, + -72},{-62,-72}}, + color={0,0,127})); + connect(conZero.y,swiOnOff. u3) annotation (Line(points={{-79,-50},{-72,-50},{ + -72,-88},{-62,-88}}, + color={0,0,127})); + connect(conZero.y,swiFloDirPum2. u3) annotation (Line(points={{-79,-50},{-60,-50}, + {-60,-38},{-52,-38}}, + color={0,0,127})); + connect(swiFloDirPum2.y, minPum2.u1) + annotation (Line(points={{-28,-30},{-22,-30},{-22,-62},{-4,-62},{-4,-68}}, + color={0,0,127})); + connect(swiFloDirVal2.y, minVal2.u1) + annotation (Line(points={{22,-30},{36,-30},{36,-68}}, + color={0,0,127})); + connect(swiFloDirVal1.y, minVal1.u1) + annotation (Line(points={{72,-30},{76,-30},{76,-68}}, + color={0,0,127})); + connect(conOne.y,swiFloDirVal1. u1) annotation (Line(points={{-79,-10},{40,-10}, + {40,-22},{48,-22}}, + color={0,0,127})); + connect(conZero.y,swiFloDirVal1. u3) annotation (Line(points={{-79,-50},{40,-50}, + {40,-38},{48,-38}}, + color={0,0,127})); + connect(conZero.y,swiFloDirVal2. u1) annotation (Line(points={{-79,-50},{-10,-50}, + {-10,-22},{-2,-22}}, + color={0,0,127})); + connect(booFloDir,swiFloDirPum2. u2) annotation (Line(points={{-120,10},{-56,10}, + {-56,-30},{-52,-30}}, + color={255,0,255})); + connect(booFloDir,swiFloDirVal2. u2) annotation (Line(points={{-120,10},{-6,10}, + {-6,-30},{-2,-30}}, + color={255,0,255})); + connect(booFloDir,swiFloDirVal1. u2) annotation (Line(points={{-120,10},{46,10}, + {46,-30},{48,-30}}, + color={255,0,255})); + connect(conPI_pum2.y,gaiPum2. u) + annotation (Line(points={{-70,49},{-70,42}}, color={0,0,127})); + connect(gaiPum2.y,swiFloDirPum2. u1) + annotation (Line(points={{-70,19},{-70,-22},{-52,-22}}, + color={0,0,127})); + connect(conPI_val2.y,gaiVal2. u) annotation (Line(points={{-20,49},{-20,42}}, + color={0,0,127})); + connect(gaiVal2.y,swiFloDirVal2. u3) + annotation (Line(points={{-20,19},{-20,-38},{-2,-38}}, + color={0,0,127})); + connect(conPI_pum2.u_s, us_mTan_flow) + annotation (Line(points={{-70,72},{-70,120}}, color={0,0,127})); + connect(conPI_val2.u_s, us_mTan_flow) annotation (Line(points={{-20,72},{-20, + 94},{-70,94},{-70,120}}, color={0,0,127})); + connect(conPI_val2.u_m, um_mTan_flow) annotation (Line(points={{-8,60},{-2, + 60},{-2,96},{-10,96},{-10,120}}, color={0,0,127})); + connect(conPI_pum2.u_m, um_mTan_flow) annotation (Line(points={{-58,60},{-52, + 60},{-52,96},{-10,96},{-10,120}}, color={0,0,127})); + connect(swiOnOff.u2, onOffLin) + annotation (Line(points={{-62,-80},{-120,-80}}, color={255,0,255})); + connect(swiOnOff.y, minPum2.u2) annotation (Line(points={{-38,-80},{-34,-80},{ + -34,-56},{-16,-56},{-16,-68}}, color={0,0,127})); + connect(swiOnOff.y, minVal2.u2) annotation (Line(points={{-38,-80},{-34,-80},{ + -34,-56},{24,-56},{24,-68}}, color={0,0,127})); + connect(swiOnOff.y, minVal1.u2) annotation (Line(points={{-38,-80},{-34,-80},{ + -34,-56},{64,-56},{64,-68}}, color={0,0,127})); + connect(minPum2.y, yPum2) annotation (Line(points={{-10,-92},{-10,-106},{-10,-106}, + {-10,-120}}, color={0,0,127})); + connect(minVal2.y, yVal2) + annotation (Line(points={{30,-92},{30,-120}}, color={0,0,127})); + connect(minVal1.y, yVal1) + annotation (Line(points={{70,-92},{70,-120}}, color={0,0,127})); + annotation (Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), Icon( + coordinateSystem(extent={{-100,-100},{100,100}}))); +end ReversiblePumpValveControl; diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/package.order b/Buildings/Fluid/Storage/Plant/BaseClasses/package.order index 09836aaef9c..00685fd5157 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/package.order +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/package.order @@ -1 +1,2 @@ ChillerAndTank +ReversiblePumpValveControl diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo index 9c00b892a80..453a6d6925b 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo @@ -1,12 +1,13 @@ within Buildings.Fluid.Storage.Plant; model ChillerAndTankNoRemoteCharging - "Model of a plant with a chiller and a tank where the tank cannot be charged remotely" + "(Draft) Model of a plant with a chiller and a tank where the tank cannot be charged remotely" extends Buildings.Fluid.Storage.Plant.BaseClasses.ChillerAndTank; - Movers.SpeedControlled_y pum2( + Buildings.Fluid.Movers.SpeedControlled_y pum2( redeclare package Medium = Medium, - per(pressure(dp=dp_nominal*{2,1.2,0}, V_flow=(m_flow_nominal1 + - m_flow_nominal2)/1.2*{0,1.2,2})), + per(pressure( + dp=dp_nominal*{2,1.2,0}, + V_flow=(m_flow_nominal1+m_flow_nominal2)/1.2*{0,1.2,2})), energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, allowFlowReversal=true, addPowerToMedium=false, @@ -15,7 +16,7 @@ model ChillerAndTankNoRemoteCharging extent={{-10,-10},{10,10}}, rotation=0, origin={-130,0}))); - Controls.Continuous.LimPID conPIDPum2( + Buildings.Controls.Continuous.LimPID conPIDPum2( Td=1, k=1, Ti=15) "PI controller for the secondary pump" @@ -30,15 +31,15 @@ model ChillerAndTankNoRemoteCharging origin={-150,30}))); Modelica.Blocks.Interfaces.RealInput usMasFloPum2 "Secondary pump mass flow rate setpoint" annotation (Placement( - transformation(extent={{-204,58},{-180,82}}), iconTransformation(extent - ={{-200,50},{-180,70}}))); + transformation(extent={{-204,58},{-180,82}}), iconTransformation(extent={{-120,50}, + {-100,70}}))); equation connect(port_a, pum2.port_a) annotation (Line(points={{-180,0},{-140,0}}, color={0,127,255})); connect(pum2.port_b, jun1.port_1) - annotation (Line(points={{-120,0},{-100,0}}, color={0,127,255})); + annotation (Line(points={{-120,0},{-90,0}}, color={0,127,255})); connect(floSenTan.m_flow, gain2.u) - annotation (Line(points={{-60,-49},{-60,-46},{-150,-46},{-150,18}}, + annotation (Line(points={{-50,-49},{-50,-46},{-150,-46},{-150,18}}, color={0,0,127})); connect(gain2.y, conPIDPum2.u_m) annotation (Line(points={{-150,41},{-150,58}}, color={0,0,127})); @@ -46,6 +47,8 @@ equation -130,12}}, color={0,0,127})); connect(usMasFloPum2, conPIDPum2.u_s) annotation (Line(points={{-192,70},{-162,70}}, color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( - coordinateSystem(preserveAspectRatio=false))); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}})), Diagram( + coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100, + 100}}))); end ChillerAndTankNoRemoteCharging; diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo new file mode 100644 index 00000000000..79a050afc8d --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo @@ -0,0 +1,88 @@ +within Buildings.Fluid.Storage.Plant; +model ChillerAndTankWithRemoteCharging + "(Draft) Model of a plant with a chiller and a tank where the tank can be charged remotely" + extends Buildings.Fluid.Storage.Plant.BaseClasses.ChillerAndTank; + + Buildings.Fluid.Storage.Plant.BaseClasses.ReversiblePumpValveControl pum2Con + "Control block for secondary pump-valve group" + annotation (Placement(transformation(extent={{-140,58},{-120,80}}))); + Buildings.Controls.OBC.CDL.Interfaces.BooleanInput onOffLin + "Plant online/offline signal, true = online, false = offline" annotation ( + Placement(transformation(extent={{-220,30},{-180,70}}), + iconTransformation(extent={{-140,-90},{-100,-50}}))); + Buildings.Controls.OBC.CDL.Interfaces.BooleanInput booFloDir + "Flow direction, true = normal, false = reverse" annotation (Placement( + transformation(extent={{-220,70},{-180,110}}), iconTransformation( + extent={{-140,50},{-100,90}}))); + Modelica.Blocks.Interfaces.RealInput us_mTan_flow + "Tank mass flow rate setpoint" annotation (Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=-90, + origin={-130,160}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-70,110}))); + + Buildings.Fluid.Movers.SpeedControlled_y pum2( + redeclare package Medium = Medium, + per(pressure( + dp=dp_nominal*{2,1.2,0}, + V_flow=(m_flow_nominal1+m_flow_nominal2)/1.2*{0,1.2,2})), + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + allowFlowReversal=true, + addPowerToMedium=false, + y_start=0, + T_start=T_CHWR_nominal) + "Secondary pump" + annotation (Placement(transformation( + extent={{-160,10},{-140,30}}, + rotation=0))); + Actuators.Valves.TwoWayEqualPercentage val1( + redeclare package Medium = Medium, + l=0.05, + R=10, + delta0=0.1, + use_inputFilter=false, + dpValve_nominal=6000, + m_flow_nominal=m_flow_nominal1+m_flow_nominal2) "Valve in series to the pump (normal direction)" + annotation (Placement(transformation(extent={{-120,10},{-100,30}}))); + Actuators.Valves.TwoWayEqualPercentage val2( + redeclare package Medium = Medium, + l=0.05, + R=10, + delta0=0.1, + use_inputFilter=false, + dpValve_nominal=6000, + m_flow_nominal=m_flow_nominal2) "Valve in parallel to the pump (reverse direction)" + annotation (Placement(transformation(extent={{-120,-30},{-140,-10}}))); +equation + connect(booFloDir, pum2Con.booFloDir) annotation (Line(points={{-200,90},{-160, + 90},{-160,65.7},{-142,65.7}}, color={255,0,255})); + connect(pum2Con.onOffLin, onOffLin) annotation (Line(points={{-142,61.3},{-142, + 50},{-200,50}}, color={255,0,255})); + connect(pum2Con.us_mTan_flow, us_mTan_flow) annotation (Line(points={{-141, + 72.3},{-146,72.3},{-146,136},{-130,136},{-130,160}}, color={0,0,127})); + connect(pum2Con.um_mTan_flow, floSenTan.m_flow) annotation (Line(points={{-141, + 76.7},{-170,76.7},{-170,-40},{-50,-40},{-50,-49}}, + color={0,0,127})); + connect(jun1.port_1, val2.port_a) annotation (Line(points={{-90,0},{-94,0},{-94, + -20},{-120,-20}}, color={0,127,255})); + connect(val2.port_b, port_a) annotation (Line(points={{-140,-20},{-164,-20},{-164, + 0},{-180,0}}, color={0,127,255})); + connect(val1.port_b, jun1.port_1) annotation (Line(points={{-100,20},{-94,20}, + {-94,0},{-90,0}}, color={0,127,255})); + connect(val1.port_a, pum2.port_b) + annotation (Line(points={{-120,20},{-140,20}}, color={0,127,255})); + connect(pum2.port_a, port_a) annotation (Line(points={{-160,20},{-164,20},{-164, + 0},{-180,0}}, color={0,127,255})); + connect(pum2Con.yPum2, pum2.y) annotation (Line(points={{-131,56.9},{-131,38}, + {-150,38},{-150,32}}, color={0,0,127})); + connect(pum2Con.yVal2, val2.y) annotation (Line(points={{-127,56.9},{-127,-2}, + {-130,-2},{-130,-8}}, color={0,0,127})); + connect(pum2Con.yVal1, val1.y) annotation (Line(points={{-123,56.9},{-110,56.9}, + {-110,32}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}})), Diagram( + coordinateSystem(preserveAspectRatio=false, extent={{-180,-100},{140, + 140}}))); +end ChillerAndTankWithRemoteCharging; diff --git a/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo index fc622c58984..18a110754ac 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo @@ -5,17 +5,17 @@ model ChillerAndTankNoRemoteCharging "(Draft)" package Medium = Buildings.Media.Water "Medium model"; Buildings.Fluid.Storage.Plant.ChillerAndTankNoRemoteCharging cat( - dp_nominal=sin.p-sou.p, - vol1(p_start=sin.p, - T_start=sin.T), - vol2(p_start=sin.p, - T_start=sin.T), - TChiEnt(T_start=sou.T), - TChiLea(T_start=sin.T)) + redeclare final package Medium=Medium, + final m_flow_nominal1=1, + final m_flow_nominal2=1, + final p_CHWS_nominal=sin.p, + final p_CHWR_nominal=sou.p, + final T_CHWS_nominal=sin.T, + final T_CHWR_nominal=sou.T) "Plant with chiller and tank" annotation (Placement(transformation(extent={{-16,-10},{16,10}}))); Buildings.Fluid.Sources.Boundary_pT sou( - redeclare package Medium = Medium, + redeclare final package Medium = Medium, p=300000, T=285.15, nPorts=1) @@ -25,7 +25,7 @@ model ChillerAndTankNoRemoteCharging "(Draft)" rotation=0, origin={-60,0}))); Buildings.Fluid.Sources.Boundary_pT sin( - redeclare package Medium = Medium, + redeclare final package Medium = Medium, p=800000, T=280.15, nPorts=1) @@ -36,8 +36,7 @@ model ChillerAndTankNoRemoteCharging "(Draft)" origin={60,0}))); Modelica.Blocks.Sources.TimeTable setFloPum2(table=[0*3600,1; 0.25*3600,1; 0.25*3600,-1; 0.5*3600,-1; 0.5*3600,0; 0.75*3600,0; 0.75*3600,1; 1*3600, - 1]) - "Placeholder" + 1]) "Placeholder" annotation (Placement(transformation(extent={{-70,20},{-50,40}}))); equation connect(sou.ports[1], cat.port_a) @@ -46,7 +45,8 @@ equation {50,4.44089e-16}}, color={0,127,255})); connect(setFloPum2.y, cat.usMasFloPum2) annotation (Line(points={{-49,30},{ - -22,30},{-22,6},{-17,6}}, color={0,0,127})); + -22,30},{-22,6},{-17.6,6}}, + color={0,0,127})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), diff --git a/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankWithRemoteCharging.mo new file mode 100644 index 00000000000..3a1176d565b --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankWithRemoteCharging.mo @@ -0,0 +1,64 @@ +within Buildings.Fluid.Storage.Plant.Examples; +model ChillerAndTankWithRemoteCharging "(Draft)" + extends Modelica.Icons.Example; + + package Medium = Buildings.Media.Water "Medium model"; + + Buildings.Fluid.Storage.Plant.ChillerAndTankWithRemoteCharging cat( + redeclare final package Medium=Medium, + final m_flow_nominal1=1, + final m_flow_nominal2=1, + final p_CHWS_nominal=sin.p, + final p_CHWR_nominal=sou.p, + final T_CHWS_nominal=sin.T, + final T_CHWR_nominal=sou.T) + "Plant with chiller and tank" + annotation (Placement(transformation(extent={{-16,-10},{16,10}}))); + Buildings.Fluid.Sources.Boundary_pT sou( + redeclare final package Medium = Medium, + p=300000, + T=285.15, + nPorts=1) + "Source, CHW return line" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-60,0}))); + Buildings.Fluid.Sources.Boundary_pT sin( + redeclare final package Medium = Medium, + p=800000, + T=280.15, + nPorts=1) + "Sink, CHW supply line" + annotation (Placement(transformation( + extent={{-10,10},{10,-10}}, + rotation=180, + origin={60,0}))); + Modelica.Blocks.Sources.TimeTable set_mTan_flow(table=[0*3600,1; 0.25*3600,1; + 0.25*3600,-1; 0.5*3600,-1; 0.5*3600,0; 0.75*3600,0; 0.75*3600,1; 1*3600, + 1]) "Tank flow rate setpoint" + annotation (Placement(transformation(extent={{-40,60},{-20,80}}))); + Modelica.Blocks.Sources.BooleanTable booFloDir(table={0,3600/6*5}) + "Flow direction" + annotation (Placement(transformation(extent={{-80,20},{-60,40}}))); + Modelica.Blocks.Sources.BooleanTable booOnOffLin(table={0,1200,3600}) + "Plant online/offline" + annotation (Placement(transformation(extent={{-80,-40},{-60,-20}}))); +equation + connect(sou.ports[1], cat.port_a) + annotation (Line(points={{-50,0},{-30,0},{-30,0},{-16,0}}, + color={0,127,255})); + connect(cat.port_b, sin.ports[1]) annotation (Line(points={{16,0},{33,0},{33,4.44089e-16}, + {50,4.44089e-16}}, color={0,127,255})); + + connect(set_mTan_flow.y, cat.us_mTan_flow) annotation (Line(points={{-19,70},{ + -11.2,70},{-11.2,11}}, color={0,0,127})); + connect(booOnOffLin.y, cat.onOffLin) annotation (Line(points={{-59,-30},{-19.2, + -30},{-19.2,-7}}, color={255,0,255})); + connect(booFloDir.y,cat.booFloDir) annotation (Line(points={{-59,30},{-19.2,30}, + {-19.2,7}}, color={255,0,255})); + annotation ( + experiment(Tolerance=1e-06, StopTime=3600), + Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), + Icon(coordinateSystem(extent={{-100,-100},{100,120}}))); +end ChillerAndTankWithRemoteCharging; diff --git a/Buildings/Fluid/Storage/Plant/Examples/package.order b/Buildings/Fluid/Storage/Plant/Examples/package.order index b47f2186e89..0541e3545f4 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/package.order +++ b/Buildings/Fluid/Storage/Plant/Examples/package.order @@ -1 +1,2 @@ ChillerAndTankNoRemoteCharging +ChillerAndTankWithRemoteCharging diff --git a/Buildings/Fluid/Storage/Plant/package.order b/Buildings/Fluid/Storage/Plant/package.order index 064fe52b76a..158f1c11b76 100644 --- a/Buildings/Fluid/Storage/Plant/package.order +++ b/Buildings/Fluid/Storage/Plant/package.order @@ -1,3 +1,4 @@ ChillerAndTankNoRemoteCharging +ChillerAndTankWithRemoteCharging Examples BaseClasses From fed79265f3f17ae83cf095fd34ef66f1864d7d19 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Fri, 4 Feb 2022 16:10:49 -0800 Subject: [PATCH 004/463] improved var naming --- .../Plant/BaseClasses/ChillerAndTank.mo | 114 +++++++++++------- .../Plant/ChillerAndTankNoRemoteCharging.mo | 4 +- .../Plant/ChillerAndTankWithRemoteCharging.mo | 19 ++- .../ChillerAndTankNoRemoteCharging.mo | 9 +- .../ChillerAndTankWithRemoteCharging.mo | 38 ++++-- 5 files changed, 122 insertions(+), 62 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo index b90652db900..6ce67016bb3 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo @@ -1,13 +1,14 @@ within Buildings.Fluid.Storage.Plant.BaseClasses; partial model ChillerAndTank "(Draft) A plant with a chiller and a stratified CHW tank" + // Condenser loop not considered yet. replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium in the component"; - parameter Modelica.Units.SI.MassFlowRate m_flow_nominal1=1 + parameter Modelica.Units.SI.MassFlowRate m1_flow_nominal=1 "Nominal mass flow rate for the chiller branch"; - parameter Modelica.Units.SI.MassFlowRate m_flow_nominal2=1 + parameter Modelica.Units.SI.MassFlowRate m2_flow_nominal=1 "Nominal mass flow rate for the tank branch"; parameter Modelica.Units.SI.PressureDifference dp_nominal= p_CHWS_nominal-p_CHWR_nominal @@ -23,18 +24,17 @@ partial model ChillerAndTank parameter Boolean allowFlowReversal1=false "Flow reversal setting on chiller branch"; - Buildings.Fluid.MixingVolumes.MixingVolume vol1( + Buildings.Fluid.MixingVolumes.MixingVolume chi( nPorts=2, final prescribedHeatFlowRate=true, redeclare package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - m_flow_nominal=m_flow_nominal1, + m_flow_nominal=m1_flow_nominal, allowFlowReversal=allowFlowReversal1, V=1E-3, - p_start = p_CHWS_nominal, - T_start = T_CHWS_nominal) - "Volume representing a chiller" - annotation (Placement(transformation( + p_start=p_CHWS_nominal, + T_start=T_CHWS_nominal) "Volume representing a chiller" annotation ( + Placement(transformation( origin={0,60}, extent={{-10,10},{10,-10}}, rotation=180))); @@ -42,54 +42,51 @@ partial model ChillerAndTank redeclare package Medium = Medium, final allowFlowReversal=allowFlowReversal1, final dp_nominal=dp_nominal, - final m_flow_nominal=m_flow_nominal1) "Flow resistance on chiller branch" + final m_flow_nominal=m1_flow_nominal) "Flow resistance on chiller branch" annotation (Placement(transformation(extent={{40,30},{60,50}}))); - Modelica.Blocks.Sources.Constant setFloPum1(k=m_flow_nominal1) "Placeholder" - annotation (Placement(transformation(extent={{-80,60},{-60,80}}))); Buildings.Fluid.Sensors.TemperatureTwoPort TChiEnt( redeclare package Medium = Medium, - m_flow_nominal=m_flow_nominal1, + m_flow_nominal=m1_flow_nominal, T_start=T_CHWR_nominal, tauHeaTra=1) "Chiller entering" annotation (Placement(transformation(extent={{-30,30},{-10,50}}))); Buildings.Fluid.Sensors.TemperatureTwoPort TChiLea( redeclare package Medium = Medium, - m_flow_nominal=m_flow_nominal1, + m_flow_nominal=m1_flow_nominal, T_start=T_CHWS_nominal, tauHeaTra=1) "Chiller leaving" annotation (Placement(transformation(extent={{12,30},{32,50}}))); Buildings.Fluid.Movers.BaseClasses.IdealSource pum1( redeclare package Medium = Medium, final dp_start=dp_nominal, - final m_flow_start=m_flow_nominal1, + final m_flow_start=m1_flow_nominal, final show_T=false, final show_V_flow=false, final control_m_flow=true, final control_dp=false, final allowFlowReversal=allowFlowReversal1, - final m_flow_small=m_flow_nominal1*1E-5) + final m_flow_small=m1_flow_nominal*1E-5) "Primary CHW pump" annotation (Placement(transformation(extent={{-60,30},{-40,50}}))); - Buildings.Fluid.MixingVolumes.MixingVolume vol2( + Buildings.Fluid.MixingVolumes.MixingVolume tan( redeclare package Medium = Medium, nPorts=2, final prescribedHeatFlowRate=true, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - m_flow_nominal=m_flow_nominal2, + m_flow_nominal=m2_flow_nominal, final allowFlowReversal=true, V=1E-3, p_start=p_CHWS_nominal, - T_start=T_CHWS_nominal) - "Volume representing a tank" - annotation (Placement(transformation( + T_start=T_CHWS_nominal) "Volume representing a tank" annotation (Placement( + transformation( origin={0,-40}, extent={{-10,10},{10,-10}}, rotation=180))); Buildings.Fluid.FixedResistances.Junction jun1( redeclare package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - m_flow_nominal={m_flow_nominal1+m_flow_nominal2, - -m_flow_nominal1,-m_flow_nominal2}, + m_flow_nominal={m1_flow_nominal+m2_flow_nominal, + -m1_flow_nominal,-m2_flow_nominal}, dp_nominal={0,0,0}, T_start=T_CHWR_nominal) "Junction near the return line" annotation (Placement(transformation( @@ -99,8 +96,8 @@ partial model ChillerAndTank Buildings.Fluid.FixedResistances.Junction jun2( redeclare package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - m_flow_nominal={m_flow_nominal1,m_flow_nominal2, - -m_flow_nominal1-m_flow_nominal2}, + m_flow_nominal={m1_flow_nominal,m2_flow_nominal, + -m1_flow_nominal-m2_flow_nominal}, dp_nominal={0,0,0}, T_start=T_CHWS_nominal) "Junction near the supply line" annotation (Placement(transformation( @@ -109,13 +106,13 @@ partial model ChillerAndTank origin={100,0}))); Buildings.Fluid.Sensors.TemperatureTwoPort TTanHot( redeclare package Medium = Medium, - m_flow_nominal=m_flow_nominal2, + m_flow_nominal=m2_flow_nominal, T_start=T_CHWR_nominal, tauHeaTra=1) "Tank hot side" annotation (Placement(transformation(extent={{-30,-70},{-10,-50}}))); Buildings.Fluid.Sensors.TemperatureTwoPort TTanCol( redeclare package Medium = Medium, - m_flow_nominal=m_flow_nominal2, + m_flow_nominal=m2_flow_nominal, T_start=T_CHWS_nominal, tauHeaTra=1) "Tank cold side" annotation (Placement(transformation(extent={{10,-70},{30,-50}}))); @@ -123,7 +120,7 @@ partial model ChillerAndTank redeclare package Medium = Medium, final allowFlowReversal=true, final dp_nominal=dp_nominal, - final m_flow_nominal=m_flow_nominal2) "Flow resistance on tank branch" + final m_flow_nominal=m2_flow_nominal) "Flow resistance on tank branch" annotation (Placement(transformation(extent={{40,-70},{60,-50}}))); Buildings.Fluid.Sensors.MassFlowRate floSenTan( redeclare package Medium=Medium, @@ -144,7 +141,7 @@ partial model ChillerAndTank floSenTan.m_flow*(TTanCol.port_a.h_outflow - port_a.h_outflow)) "Heat flow of the tank" annotation (Placement(transformation(extent={{-48,-20},{-28,0}}))); - Modelica.Blocks.Math.Gain gain1(k=2*4200*5*m_flow_nominal1) + Modelica.Blocks.Math.Gain gain1(k=2*4200*5*m1_flow_nominal) annotation (Placement(transformation(extent={{10,-10},{-10,10}}, rotation=0, origin={70,80}))); @@ -173,25 +170,31 @@ partial model ChillerAndTank "Fluid connector b (positive design flow direction is from port_a to port_b)" annotation (Placement(transformation(extent={{150,-10},{130,10}}), iconTransformation(extent={{110,-10},{90,10}}))); + Modelica.Blocks.Interfaces.RealInput us_mChi_flow + "Chiller mass flow rate setpoint" + annotation (Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=-90, + origin={-50,120}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-30,110}))); equation - connect(TChiEnt.port_b, vol1.ports[1]) - annotation (Line(points={{-10,40},{0,40},{0,50},{1,50}}, - color={0,127,255})); + connect(TChiEnt.port_b, chi.ports[1]) annotation (Line(points={{-10,40},{0,40}, + {0,50},{1,50}}, color={0,127,255})); connect(preDro1.port_a,TChiLea. port_b) annotation (Line(points={{40,40},{32,40}}, color={0,127,255})); - connect(TChiLea.port_a, vol1.ports[2]) + connect(TChiLea.port_a, chi.ports[2]) annotation (Line(points={{12,40},{-1,40},{-1,50}}, color={0,127,255})); connect(pum1.port_b,TChiEnt. port_a) annotation (Line(points={{-40,40},{-30,40}}, color={0,127,255})); - connect(setFloPum1.y, pum1.m_flow_in) - annotation (Line(points={{-59,70},{-56,70},{-56,48}}, color={0,0,127})); connect(pum1.port_a, jun1.port_2) annotation (Line(points={{-60,40},{-66,40},{ -66,0},{-70,0}}, color={0,127,255})); - connect(TTanHot.port_b, vol2.ports[1]) + connect(TTanHot.port_b, tan.ports[1]) annotation (Line(points={{-10,-60},{1,-60},{1,-50}}, color={0,127,255})); - connect(vol2.ports[2], TTanCol.port_a) + connect(tan.ports[2], TTanCol.port_a) annotation (Line(points={{-1,-50},{-1,-60},{10,-60}}, color={0,127,255})); connect(TTanCol.port_b, preDro2.port_a) annotation (Line(points={{30,-60},{40,-60}}, color={0,127,255})); @@ -206,13 +209,13 @@ equation connect(preDro1.port_b, jun2.port_1) annotation (Line(points={{60,40},{84,40},{84,0},{90,0}}, color={0,127,255})); - connect(heaChi.port, vol1.heatPort) annotation (Line(points={{20,80},{10,80},{ - 10,60}}, color={191,0,0})); + connect(heaChi.port, chi.heatPort) + annotation (Line(points={{20,80},{10,80},{10,60}}, color={191,0,0})); connect(QTan.y, heaTan.Q_flow) annotation (Line(points={{-27,-10},{-6,-10}}, color={0,0,127})); - connect(heaTan.port, vol2.heatPort) annotation (Line(points={{14,-10},{20,-10}, - {20,-40},{10,-40}},color={191,0,0})); + connect(heaTan.port, tan.heatPort) annotation (Line(points={{14,-10},{20,-10}, + {20,-40},{10,-40}}, color={191,0,0})); connect(gain1.y, heaChi.Q_flow) annotation (Line(points={{59,80},{40,80}}, color={0,0,127})); connect(conPID1.y,gain1. u) @@ -225,8 +228,37 @@ equation {130,40},{122,40}}, color={0,0,127})); connect(jun2.port_2, port_b) annotation (Line(points={{110,0},{140,0}}, color={0,127,255})); + connect(pum1.m_flow_in, us_mChi_flow) annotation (Line(points={{-56,48},{-56,60}, + {-50,60},{-50,120}}, color={0,0,127})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-180,-100},{140,100}})), - Icon(coordinateSystem(extent={{-100,-100},{100,100}}))); + Icon(coordinateSystem(extent={{-100,-100},{100,100}}), graphics={ + Line(points={{0,0},{0,-20},{30,-20},{30,-60},{60,-60},{60,0}}, color={0, + 0,0}), + Line(points={{-90,0},{0,0},{0,60},{60,60},{60,0},{90,0}}, color={0,0,0}), + Ellipse( + extent={{10,82},{54,40}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{0,16},{-18,-16},{18,-16},{0,16}}, + lineColor={0,0,0}, + smooth=Smooth.None, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + origin={38,60}, + rotation=-90), + Rectangle( + extent={{10,-10},{50,-72}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line(points={{-80,20},{-20,20}}, color={28,108,200}), + Polygon( + points={{-20,20},{-40,26},{-40,14},{-20,20}}, + fillColor={28,108,200}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None)})); end ChillerAndTank; diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo index 453a6d6925b..5e5d1bb587f 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo @@ -7,7 +7,7 @@ model ChillerAndTankNoRemoteCharging redeclare package Medium = Medium, per(pressure( dp=dp_nominal*{2,1.2,0}, - V_flow=(m_flow_nominal1+m_flow_nominal2)/1.2*{0,1.2,2})), + V_flow=(m1_flow_nominal+m2_flow_nominal)/1.2*{0,1.2,2})), energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, allowFlowReversal=true, addPowerToMedium=false, @@ -23,7 +23,7 @@ model ChillerAndTankNoRemoteCharging annotation (Placement(transformation(extent={{10,10},{-10,-10}}, rotation=180, origin={-150,70}))); - Modelica.Blocks.Math.Gain gain2(k=1/m_flow_nominal2) "Gain" + Modelica.Blocks.Math.Gain gain2(k=1/m2_flow_nominal) "Gain" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo index 79a050afc8d..5af2f74fce3 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo @@ -27,7 +27,7 @@ model ChillerAndTankWithRemoteCharging redeclare package Medium = Medium, per(pressure( dp=dp_nominal*{2,1.2,0}, - V_flow=(m_flow_nominal1+m_flow_nominal2)/1.2*{0,1.2,2})), + V_flow=(m1_flow_nominal+m2_flow_nominal)/1.2*{0,1.2,2})), energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, allowFlowReversal=true, addPowerToMedium=false, @@ -44,7 +44,7 @@ model ChillerAndTankWithRemoteCharging delta0=0.1, use_inputFilter=false, dpValve_nominal=6000, - m_flow_nominal=m_flow_nominal1+m_flow_nominal2) "Valve in series to the pump (normal direction)" + m_flow_nominal=m1_flow_nominal+m2_flow_nominal) "Valve in series to the pump (normal direction)" annotation (Placement(transformation(extent={{-120,10},{-100,30}}))); Actuators.Valves.TwoWayEqualPercentage val2( redeclare package Medium = Medium, @@ -53,15 +53,15 @@ model ChillerAndTankWithRemoteCharging delta0=0.1, use_inputFilter=false, dpValve_nominal=6000, - m_flow_nominal=m_flow_nominal2) "Valve in parallel to the pump (reverse direction)" + m_flow_nominal=m2_flow_nominal) "Valve in parallel to the pump (reverse direction)" annotation (Placement(transformation(extent={{-120,-30},{-140,-10}}))); equation connect(booFloDir, pum2Con.booFloDir) annotation (Line(points={{-200,90},{-160, 90},{-160,65.7},{-142,65.7}}, color={255,0,255})); connect(pum2Con.onOffLin, onOffLin) annotation (Line(points={{-142,61.3},{-142, 50},{-200,50}}, color={255,0,255})); - connect(pum2Con.us_mTan_flow, us_mTan_flow) annotation (Line(points={{-141, - 72.3},{-146,72.3},{-146,136},{-130,136},{-130,160}}, color={0,0,127})); + connect(pum2Con.us_mTan_flow,us_mChi_flow) annotation (Line(points={{-141,72.3}, + {-146,72.3},{-146,136},{-50,136},{-50,120}}, color={0,0,127})); connect(pum2Con.um_mTan_flow, floSenTan.m_flow) annotation (Line(points={{-141, 76.7},{-170,76.7},{-170,-40},{-50,-40},{-50,-49}}, color={0,0,127})); @@ -82,7 +82,14 @@ equation connect(pum2Con.yVal1, val1.y) annotation (Line(points={{-123,56.9},{-110,56.9}, {-110,32}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, - -100},{100,100}})), Diagram( + -100},{100,100}}), graphics={Line( + points={{-80,-20},{-20,-20}}, + color={28,108,200}, + pattern=LinePattern.Dash), Polygon( + points={{-80,-20},{-60,-14},{-60,-26},{-80,-20}}, + fillColor={28,108,200}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None)}), Diagram( coordinateSystem(preserveAspectRatio=false, extent={{-180,-100},{140, 140}}))); end ChillerAndTankWithRemoteCharging; diff --git a/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo index 18a110754ac..b108ac09daa 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo @@ -6,8 +6,8 @@ model ChillerAndTankNoRemoteCharging "(Draft)" Buildings.Fluid.Storage.Plant.ChillerAndTankNoRemoteCharging cat( redeclare final package Medium=Medium, - final m_flow_nominal1=1, - final m_flow_nominal2=1, + final m1_flow_nominal=1, + final m2_flow_nominal=1, final p_CHWS_nominal=sin.p, final p_CHWR_nominal=sou.p, final T_CHWS_nominal=sin.T, @@ -38,6 +38,9 @@ model ChillerAndTankNoRemoteCharging "(Draft)" 0.25*3600,-1; 0.5*3600,-1; 0.5*3600,0; 0.75*3600,0; 0.75*3600,1; 1*3600, 1]) "Placeholder" annotation (Placement(transformation(extent={{-70,20},{-50,40}}))); + Modelica.Blocks.Sources.Constant set_mChi_flow(k=cat.m1_flow_nominal) + "Prescribed chiller branch flow rate" + annotation (Placement(transformation(extent={{-70,60},{-50,80}}))); equation connect(sou.ports[1], cat.port_a) annotation (Line(points={{-50,0},{-16,0}}, color={0,127,255})); @@ -47,6 +50,8 @@ equation connect(setFloPum2.y, cat.usMasFloPum2) annotation (Line(points={{-49,30},{ -22,30},{-22,6},{-17.6,6}}, color={0,0,127})); + connect(set_mChi_flow.y, cat.us_mChi_flow) annotation (Line(points={{-49,70}, + {-4.8,70},{-4.8,11}}, color={0,0,127})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), diff --git a/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankWithRemoteCharging.mo index 3a1176d565b..4e25dbdeba4 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankWithRemoteCharging.mo @@ -1,13 +1,24 @@ within Buildings.Fluid.Storage.Plant.Examples; -model ChillerAndTankWithRemoteCharging "(Draft)" +model ChillerAndTankWithRemoteCharging + "(Draft)" + //Operation modes implemented in time tables: + // plant | chiller | tank | flow direction | tank flow rate + // 1. offline off off N/A 0 + // 2. offline on charging N/A -1 + // 3. online on charging normal -1 + // 4. online on off normal 0 + // 5. online on discharging normal 1 + // 6. online off discharging normal 1 + // 7. online off charging reverse -1 + extends Modelica.Icons.Example; package Medium = Buildings.Media.Water "Medium model"; Buildings.Fluid.Storage.Plant.ChillerAndTankWithRemoteCharging cat( redeclare final package Medium=Medium, - final m_flow_nominal1=1, - final m_flow_nominal2=1, + final m1_flow_nominal=1, + final m2_flow_nominal=1, final p_CHWS_nominal=sin.p, final p_CHWR_nominal=sou.p, final T_CHWS_nominal=sin.T, @@ -34,16 +45,19 @@ model ChillerAndTankWithRemoteCharging "(Draft)" extent={{-10,10},{10,-10}}, rotation=180, origin={60,0}))); - Modelica.Blocks.Sources.TimeTable set_mTan_flow(table=[0*3600,1; 0.25*3600,1; - 0.25*3600,-1; 0.5*3600,-1; 0.5*3600,0; 0.75*3600,0; 0.75*3600,1; 1*3600, - 1]) "Tank flow rate setpoint" - annotation (Placement(transformation(extent={{-40,60},{-20,80}}))); - Modelica.Blocks.Sources.BooleanTable booFloDir(table={0,3600/6*5}) + Modelica.Blocks.Sources.TimeTable set_mTan_flow(table=[0,0; 3600/7,0; 3600/7,-1; + 3600/7*3,-1; 3600/7*4,0; 3600/7*4,1; 3600/7*6,1; 3600/7*6,-1]) + "Tank flow rate setpoint" + annotation (Placement(transformation(extent={{-80,60},{-60,80}}))); + Modelica.Blocks.Sources.BooleanTable booFloDir(table={0,3600/7*6}) "Flow direction" annotation (Placement(transformation(extent={{-80,20},{-60,40}}))); - Modelica.Blocks.Sources.BooleanTable booOnOffLin(table={0,1200,3600}) + Modelica.Blocks.Sources.BooleanTable booOnOffLin(table={0,3600/7*2}) "Plant online/offline" annotation (Placement(transformation(extent={{-80,-40},{-60,-20}}))); + Modelica.Blocks.Sources.TimeTable set_mChi_flow1(table=[0,0; 3600/7,0; 3600/7, + 1; 3600/7*5,1; 3600/7*5,0]) "Chiller flow rate setpoint" + annotation (Placement(transformation(extent={{-40,80},{-20,100}}))); equation connect(sou.ports[1], cat.port_a) annotation (Line(points={{-50,0},{-30,0},{-30,0},{-16,0}}, @@ -51,12 +65,14 @@ equation connect(cat.port_b, sin.ports[1]) annotation (Line(points={{16,0},{33,0},{33,4.44089e-16}, {50,4.44089e-16}}, color={0,127,255})); - connect(set_mTan_flow.y, cat.us_mTan_flow) annotation (Line(points={{-19,70},{ - -11.2,70},{-11.2,11}}, color={0,0,127})); connect(booOnOffLin.y, cat.onOffLin) annotation (Line(points={{-59,-30},{-19.2, -30},{-19.2,-7}}, color={255,0,255})); connect(booFloDir.y,cat.booFloDir) annotation (Line(points={{-59,30},{-19.2,30}, {-19.2,7}}, color={255,0,255})); + connect(set_mTan_flow.y, cat.us_mTan_flow) annotation (Line(points={{-59,70},{ + -11.2,70},{-11.2,11}}, color={0,0,127})); + connect(set_mChi_flow1.y, cat.us_mChi_flow) + annotation (Line(points={{-19,90},{-4.8,90},{-4.8,11}}, color={0,0,127})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), From 11932ca337dff2afd8ad06ae1cb685a09825cde0 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Mon, 7 Feb 2022 12:56:24 -0800 Subject: [PATCH 005/463] adjusted the placeholder chiller and tank --- .../Plant/BaseClasses/ChillerAndTank.mo | 60 ++++++++----------- .../ChillerAndTankNoRemoteCharging.mo | 4 +- 2 files changed, 26 insertions(+), 38 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo index 6ce67016bb3..b80904bc9ea 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo @@ -129,33 +129,28 @@ partial model ChillerAndTank annotation (Placement(transformation(extent={{-60,-70},{-40,-50}}))); Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow heaChi "Prescribed heat flow for chiller" - annotation (Placement(transformation(extent={{40,70},{20,90}}))); - + annotation (Placement(transformation(extent={{2,78},{22,98}}))); + Modelica.Blocks.Sources.RealExpression QChi( + y=pum1.m_flow*( + Medium.specificEnthalpy(state=Medium.setState_pTX( + p=p_CHWS_nominal, T=T_CHWS_nominal, X={1.})) + - TChiEnt.port_b.h_outflow)) "Heat flow of the chiller" + annotation (Placement(transformation(extent={{-30,78},{-10,98}}))); Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow heaTan "Prescribed heat flow for tank" - annotation (Placement(transformation(extent={{-6,-20},{14,0}}))); + annotation (Placement(transformation(extent={{0,-20},{20,0}}))); Modelica.Blocks.Sources.RealExpression QTan( y=if floSenTan.m_flow>0 then - floSenTan.m_flow*(port_b.h_outflow - TTanHot.port_b.h_outflow) + floSenTan.m_flow*( + Medium.specificEnthalpy(state=Medium.setState_pTX( + p=p_CHWS_nominal, T=T_CHWS_nominal, X={1.})) + - TTanHot.port_b.h_outflow) else - floSenTan.m_flow*(TTanCol.port_a.h_outflow - port_a.h_outflow)) + floSenTan.m_flow*(TTanCol.port_a.h_outflow + - Medium.specificEnthalpy(state=Medium.setState_pTX( + p=p_CHWR_nominal, T=T_CHWR_nominal, X={1.})))) "Heat flow of the tank" - annotation (Placement(transformation(extent={{-48,-20},{-28,0}}))); - Modelica.Blocks.Math.Gain gain1(k=2*4200*5*m1_flow_nominal) - annotation (Placement(transformation(extent={{10,-10},{-10,10}}, - rotation=0, - origin={70,80}))); - Buildings.Controls.Continuous.LimPID conPID1( - Td=1, - k=5, - Ti=50, - yMin=-1) - annotation (Placement(transformation(extent={{-10,10},{10,-10}}, - rotation=180, - origin={110,40}))); - Modelica.Blocks.Sources.Constant setTChiLea(k=T_CHWS_nominal) - "Chiller water leaving temperature setpoint" - annotation (Placement(transformation(extent={{100,70},{120,90}}))); + annotation (Placement(transformation(extent={{-30,-20},{-10,0}}))); Modelica.Fluid.Interfaces.FluidPort_a port_a( p(start=p_CHWR_nominal), redeclare package Medium = Medium, @@ -179,6 +174,7 @@ partial model ChillerAndTank extent={{-10,-10},{10,10}}, rotation=-90, origin={-30,110}))); + equation connect(TChiEnt.port_b, chi.ports[1]) annotation (Line(points={{-10,40},{0,40}, @@ -210,26 +206,18 @@ equation annotation (Line(points={{60,40},{84,40},{84,0},{90,0}}, color={0,127,255})); connect(heaChi.port, chi.heatPort) - annotation (Line(points={{20,80},{10,80},{10,60}}, color={191,0,0})); + annotation (Line(points={{22,88},{28,88},{28,60},{10,60}}, + color={191,0,0})); connect(QTan.y, heaTan.Q_flow) - annotation (Line(points={{-27,-10},{-6,-10}}, - color={0,0,127})); - connect(heaTan.port, tan.heatPort) annotation (Line(points={{14,-10},{20,-10}, - {20,-40},{10,-40}}, color={191,0,0})); - connect(gain1.y, heaChi.Q_flow) - annotation (Line(points={{59,80},{40,80}}, color={0,0,127})); - connect(conPID1.y,gain1. u) - annotation (Line(points={{99,40},{88,40},{88,80},{82,80}}, - color={0,0,127})); - connect(TChiLea.T, conPID1.u_m) annotation (Line(points={{22,51},{22,56},{80,56}, - {80,20},{110,20},{110,28}}, - color={0,0,127})); - connect(setTChiLea.y, conPID1.u_s) annotation (Line(points={{121,80},{130,80}, - {130,40},{122,40}}, color={0,0,127})); + annotation (Line(points={{-9,-10},{0,-10}}, color={0,0,127})); + connect(heaTan.port, tan.heatPort) annotation (Line(points={{20,-10},{28,-10}, + {28,-40},{10,-40}}, color={191,0,0})); connect(jun2.port_2, port_b) annotation (Line(points={{110,0},{140,0}}, color={0,127,255})); connect(pum1.m_flow_in, us_mChi_flow) annotation (Line(points={{-56,48},{-56,60}, {-50,60},{-50,120}}, color={0,0,127})); + connect(QChi.y, heaChi.Q_flow) + annotation (Line(points={{-9,88},{2,88}}, color={0,0,127})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-180,-100},{140,100}})), diff --git a/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo index b108ac09daa..1f5e29e1095 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo @@ -19,7 +19,7 @@ model ChillerAndTankNoRemoteCharging "(Draft)" p=300000, T=285.15, nPorts=1) - "Source, CHW return line" + "Source representing CHW return line" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, @@ -29,7 +29,7 @@ model ChillerAndTankNoRemoteCharging "(Draft)" p=800000, T=280.15, nPorts=1) - "Sink, CHW supply line" + "Sink representing CHW supply line" annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=180, From 5af2aa1390ea74552bde56ee69a3722644cc2739 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Mon, 7 Feb 2022 13:35:14 -0800 Subject: [PATCH 006/463] improved parameterisation --- .../Plant/ChillerAndTankWithRemoteCharging.mo | 12 ++++-------- .../Examples/ChillerAndTankWithRemoteCharging.mo | 9 +++++---- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo index 5af2f74fce3..93c2ed92d50 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo @@ -39,20 +39,16 @@ model ChillerAndTankWithRemoteCharging rotation=0))); Actuators.Valves.TwoWayEqualPercentage val1( redeclare package Medium = Medium, - l=0.05, - R=10, - delta0=0.1, use_inputFilter=false, - dpValve_nominal=6000, + l=1E-10, + dpValve_nominal=1, m_flow_nominal=m1_flow_nominal+m2_flow_nominal) "Valve in series to the pump (normal direction)" annotation (Placement(transformation(extent={{-120,10},{-100,30}}))); Actuators.Valves.TwoWayEqualPercentage val2( redeclare package Medium = Medium, - l=0.05, - R=10, - delta0=0.1, use_inputFilter=false, - dpValve_nominal=6000, + l=1E-10, + dpValve_nominal=1, m_flow_nominal=m2_flow_nominal) "Valve in parallel to the pump (reverse direction)" annotation (Placement(transformation(extent={{-120,-30},{-140,-10}}))); equation diff --git a/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankWithRemoteCharging.mo index 4e25dbdeba4..1246afc5a15 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankWithRemoteCharging.mo @@ -45,8 +45,9 @@ model ChillerAndTankWithRemoteCharging extent={{-10,10},{10,-10}}, rotation=180, origin={60,0}))); - Modelica.Blocks.Sources.TimeTable set_mTan_flow(table=[0,0; 3600/7,0; 3600/7,-1; - 3600/7*3,-1; 3600/7*4,0; 3600/7*4,1; 3600/7*6,1; 3600/7*6,-1]) + Modelica.Blocks.Sources.TimeTable set_mTan_flow(table=[0,0; 3600/7,0; 3600/7, + -1; 3600/7*3,-1; 3600/7*3,0; 3600/7*4,0; 3600/7*4,1; 3600/7*6,1; 3600/7 + *6,-1]) "Tank flow rate setpoint" annotation (Placement(transformation(extent={{-80,60},{-60,80}}))); Modelica.Blocks.Sources.BooleanTable booFloDir(table={0,3600/7*6}) @@ -55,7 +56,7 @@ model ChillerAndTankWithRemoteCharging Modelica.Blocks.Sources.BooleanTable booOnOffLin(table={0,3600/7*2}) "Plant online/offline" annotation (Placement(transformation(extent={{-80,-40},{-60,-20}}))); - Modelica.Blocks.Sources.TimeTable set_mChi_flow1(table=[0,0; 3600/7,0; 3600/7, + Modelica.Blocks.Sources.TimeTable set_mChi_flow(table=[0,0; 3600/7,0; 3600/7, 1; 3600/7*5,1; 3600/7*5,0]) "Chiller flow rate setpoint" annotation (Placement(transformation(extent={{-40,80},{-20,100}}))); equation @@ -71,7 +72,7 @@ equation {-19.2,7}}, color={255,0,255})); connect(set_mTan_flow.y, cat.us_mTan_flow) annotation (Line(points={{-59,70},{ -11.2,70},{-11.2,11}}, color={0,0,127})); - connect(set_mChi_flow1.y, cat.us_mChi_flow) + connect(set_mChi_flow.y, cat.us_mChi_flow) annotation (Line(points={{-19,90},{-4.8,90},{-4.8,11}}, color={0,0,127})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), From 448aa0d965571c76cf1ae7e0f98bcf3a54dac8d5 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Mon, 7 Feb 2022 15:54:35 -0800 Subject: [PATCH 007/463] graphic adjustments --- .../ChillerAndTankNoRemoteCharging.mo | 14 +++++----- .../ChillerAndTankWithRemoteCharging.mo | 26 ++++++++++--------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo index 1f5e29e1095..bcd5a683563 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo @@ -13,7 +13,7 @@ model ChillerAndTankNoRemoteCharging "(Draft)" final T_CHWS_nominal=sin.T, final T_CHWR_nominal=sou.T) "Plant with chiller and tank" - annotation (Placement(transformation(extent={{-16,-10},{16,10}}))); + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); Buildings.Fluid.Sources.Boundary_pT sou( redeclare final package Medium = Medium, p=300000, @@ -43,15 +43,15 @@ model ChillerAndTankNoRemoteCharging "(Draft)" annotation (Placement(transformation(extent={{-70,60},{-50,80}}))); equation connect(sou.ports[1], cat.port_a) - annotation (Line(points={{-50,0},{-16,0}}, color={0,127,255})); - connect(cat.port_b, sin.ports[1]) annotation (Line(points={{16,0},{33,0},{33,4.44089e-16}, - {50,4.44089e-16}}, color={0,127,255})); + annotation (Line(points={{-50,0},{-10,0}}, color={0,127,255})); + connect(cat.port_b, sin.ports[1]) annotation (Line(points={{10,0},{30,0},{30, + 4.44089e-16},{50,4.44089e-16}}, + color={0,127,255})); connect(setFloPum2.y, cat.usMasFloPum2) annotation (Line(points={{-49,30},{ - -22,30},{-22,6},{-17.6,6}}, - color={0,0,127})); + -16,30},{-16,6},{-11,6}}, color={0,0,127})); connect(set_mChi_flow.y, cat.us_mChi_flow) annotation (Line(points={{-49,70}, - {-4.8,70},{-4.8,11}}, color={0,0,127})); + {-3,70},{-3,11}}, color={0,0,127})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), diff --git a/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankWithRemoteCharging.mo index 1246afc5a15..ddaeb5b5bac 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankWithRemoteCharging.mo @@ -24,7 +24,7 @@ model ChillerAndTankWithRemoteCharging final T_CHWS_nominal=sin.T, final T_CHWR_nominal=sou.T) "Plant with chiller and tank" - annotation (Placement(transformation(extent={{-16,-10},{16,10}}))); + annotation (Placement(transformation(extent={{-8,-10},{12,10}}))); Buildings.Fluid.Sources.Boundary_pT sou( redeclare final package Medium = Medium, p=300000, @@ -61,19 +61,21 @@ model ChillerAndTankWithRemoteCharging annotation (Placement(transformation(extent={{-40,80},{-20,100}}))); equation connect(sou.ports[1], cat.port_a) - annotation (Line(points={{-50,0},{-30,0},{-30,0},{-16,0}}, - color={0,127,255})); - connect(cat.port_b, sin.ports[1]) annotation (Line(points={{16,0},{33,0},{33,4.44089e-16}, - {50,4.44089e-16}}, color={0,127,255})); + annotation (Line(points={{-50,0},{-8,0}}, color={0,127,255})); + connect(cat.port_b, sin.ports[1]) annotation (Line(points={{12,0},{35,0},{35, + 4.44089e-16},{50,4.44089e-16}}, + color={0,127,255})); - connect(booOnOffLin.y, cat.onOffLin) annotation (Line(points={{-59,-30},{-19.2, - -30},{-19.2,-7}}, color={255,0,255})); - connect(booFloDir.y,cat.booFloDir) annotation (Line(points={{-59,30},{-19.2,30}, - {-19.2,7}}, color={255,0,255})); - connect(set_mTan_flow.y, cat.us_mTan_flow) annotation (Line(points={{-59,70},{ - -11.2,70},{-11.2,11}}, color={0,0,127})); + connect(booOnOffLin.y, cat.onOffLin) annotation (Line(points={{-59,-30},{-20, + -30},{-20,-7},{-10,-7}}, + color={255,0,255})); + connect(booFloDir.y,cat.booFloDir) annotation (Line(points={{-59,30},{-20,30}, + {-20,6},{-10,6},{-10,7}}, + color={255,0,255})); + connect(set_mTan_flow.y, cat.us_mTan_flow) annotation (Line(points={{-59,70}, + {-5,70},{-5,11}}, color={0,0,127})); connect(set_mChi_flow.y, cat.us_mChi_flow) - annotation (Line(points={{-19,90},{-4.8,90},{-4.8,11}}, color={0,0,127})); + annotation (Line(points={{-19,90},{-1,90},{-1,11}}, color={0,0,127})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), From 63676d1307ad6fa6647d6223c8f0ee8f193be07b Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Tue, 8 Feb 2022 09:25:10 -0800 Subject: [PATCH 008/463] made model for ideal chiller --- .../Plant/BaseClasses/ChillerAndTank.mo | 92 +++++---------- .../Plant/ChillerAndTankNoRemoteCharging.mo | 2 +- .../Plant/ChillerAndTankWithRemoteCharging.mo | 5 +- .../Fluid/Storage/Plant/VolumeSetState.mo | 110 ++++++++++++++++++ Buildings/Fluid/Storage/Plant/package.order | 1 + 5 files changed, 143 insertions(+), 67 deletions(-) create mode 100644 Buildings/Fluid/Storage/Plant/VolumeSetState.mo diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo index b80904bc9ea..f28b0c6e921 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo @@ -24,38 +24,12 @@ partial model ChillerAndTank parameter Boolean allowFlowReversal1=false "Flow reversal setting on chiller branch"; - Buildings.Fluid.MixingVolumes.MixingVolume chi( - nPorts=2, - final prescribedHeatFlowRate=true, - redeclare package Medium = Medium, - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - m_flow_nominal=m1_flow_nominal, - allowFlowReversal=allowFlowReversal1, - V=1E-3, - p_start=p_CHWS_nominal, - T_start=T_CHWS_nominal) "Volume representing a chiller" annotation ( - Placement(transformation( - origin={0,60}, - extent={{-10,10},{10,-10}}, - rotation=180))); Buildings.Fluid.FixedResistances.PressureDrop preDro1( redeclare package Medium = Medium, final allowFlowReversal=allowFlowReversal1, final dp_nominal=dp_nominal, final m_flow_nominal=m1_flow_nominal) "Flow resistance on chiller branch" annotation (Placement(transformation(extent={{40,30},{60,50}}))); - Buildings.Fluid.Sensors.TemperatureTwoPort TChiEnt( - redeclare package Medium = Medium, - m_flow_nominal=m1_flow_nominal, - T_start=T_CHWR_nominal, - tauHeaTra=1) "Chiller entering" - annotation (Placement(transformation(extent={{-30,30},{-10,50}}))); - Buildings.Fluid.Sensors.TemperatureTwoPort TChiLea( - redeclare package Medium = Medium, - m_flow_nominal=m1_flow_nominal, - T_start=T_CHWS_nominal, - tauHeaTra=1) "Chiller leaving" - annotation (Placement(transformation(extent={{12,30},{32,50}}))); Buildings.Fluid.Movers.BaseClasses.IdealSource pum1( redeclare package Medium = Medium, final dp_start=dp_nominal, @@ -122,31 +96,22 @@ partial model ChillerAndTank final dp_nominal=dp_nominal, final m_flow_nominal=m2_flow_nominal) "Flow resistance on tank branch" annotation (Placement(transformation(extent={{40,-70},{60,-50}}))); - Buildings.Fluid.Sensors.MassFlowRate floSenTan( + Buildings.Fluid.Sensors.MassFlowRate mTan_flow( redeclare package Medium=Medium, final allowFlowReversal=true) "Flow rate sensor on the tank branch" annotation (Placement(transformation(extent={{-60,-70},{-40,-50}}))); - Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow heaChi - "Prescribed heat flow for chiller" - annotation (Placement(transformation(extent={{2,78},{22,98}}))); - Modelica.Blocks.Sources.RealExpression QChi( - y=pum1.m_flow*( - Medium.specificEnthalpy(state=Medium.setState_pTX( - p=p_CHWS_nominal, T=T_CHWS_nominal, X={1.})) - - TChiEnt.port_b.h_outflow)) "Heat flow of the chiller" - annotation (Placement(transformation(extent={{-30,78},{-10,98}}))); Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow heaTan "Prescribed heat flow for tank" annotation (Placement(transformation(extent={{0,-20},{20,0}}))); Modelica.Blocks.Sources.RealExpression QTan( - y=if floSenTan.m_flow>0 then - floSenTan.m_flow*( + y=if mTan_flow.m_flow>0 then mTan_flow.m_flow + *( Medium.specificEnthalpy(state=Medium.setState_pTX( p=p_CHWS_nominal, T=T_CHWS_nominal, X={1.})) - TTanHot.port_b.h_outflow) - else - floSenTan.m_flow*(TTanCol.port_a.h_outflow + else mTan_flow.m_flow + *(TTanCol.port_a.h_outflow - Medium.specificEnthalpy(state=Medium.setState_pTX( p=p_CHWR_nominal, T=T_CHWR_nominal, X={1.})))) "Heat flow of the tank" @@ -175,16 +140,16 @@ partial model ChillerAndTank rotation=-90, origin={-30,110}))); + Buildings.Fluid.Storage.Plant.VolumeSetState ideChi( + redeclare package Medium = Medium, + allowFlowReversal=allowFlowReversal1, + m_flow_nominal=m1_flow_nominal, + p_nominal=p_CHWS_nominal, + T_a_nominal=T_CHWR_nominal, + T_b_nominal=T_CHWS_nominal) "Ideal chiller" + annotation (Placement(transformation(extent={{-10,30},{10,50}}))); equation - connect(TChiEnt.port_b, chi.ports[1]) annotation (Line(points={{-10,40},{0,40}, - {0,50},{1,50}}, color={0,127,255})); - connect(preDro1.port_a,TChiLea. port_b) - annotation (Line(points={{40,40},{32,40}}, color={0,127,255})); - connect(TChiLea.port_a, chi.ports[2]) - annotation (Line(points={{12,40},{-1,40},{-1,50}}, color={0,127,255})); - connect(pum1.port_b,TChiEnt. port_a) - annotation (Line(points={{-40,40},{-30,40}}, color={0,127,255})); connect(pum1.port_a, jun1.port_2) annotation (Line(points={{-60,40},{-66,40},{ -66,0},{-70,0}}, color={0,127,255})); @@ -197,17 +162,14 @@ equation connect(preDro2.port_b, jun2.port_3) annotation (Line(points={{60,-60},{100,-60},{100,-10}}, color={0,127,255})); - connect(jun1.port_3, floSenTan.port_a) + connect(jun1.port_3,mTan_flow. port_a) annotation (Line(points={{-80,-10},{-80,-60},{-60,-60}}, color={0,127,255})); - connect(floSenTan.port_b, TTanHot.port_a) + connect(mTan_flow.port_b, TTanHot.port_a) annotation (Line(points={{-40,-60},{-30,-60}}, color={0,127,255})); connect(preDro1.port_b, jun2.port_1) annotation (Line(points={{60,40},{84,40},{84,0},{90,0}}, color={0,127,255})); - connect(heaChi.port, chi.heatPort) - annotation (Line(points={{22,88},{28,88},{28,60},{10,60}}, - color={191,0,0})); connect(QTan.y, heaTan.Q_flow) annotation (Line(points={{-9,-10},{0,-10}}, color={0,0,127})); connect(heaTan.port, tan.heatPort) annotation (Line(points={{20,-10},{28,-10}, @@ -216,8 +178,10 @@ equation annotation (Line(points={{110,0},{140,0}}, color={0,127,255})); connect(pum1.m_flow_in, us_mChi_flow) annotation (Line(points={{-56,48},{-56,60}, {-50,60},{-50,120}}, color={0,0,127})); - connect(QChi.y, heaChi.Q_flow) - annotation (Line(points={{-9,88},{2,88}}, color={0,0,127})); + connect(pum1.port_b, ideChi.port_a) annotation (Line(points={{-40,40},{-28,40}, + {-28,40},{-10.2,40}}, color={0,127,255})); + connect(ideChi.port_b, preDro1.port_a) annotation (Line(points={{10,40},{10,40}, + {10,40},{40,40}}, color={0,127,255})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-180,-100},{140,100}})), @@ -230,14 +194,6 @@ equation lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), - Polygon( - points={{0,16},{-18,-16},{18,-16},{0,16}}, - lineColor={0,0,0}, - smooth=Smooth.None, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid, - origin={38,60}, - rotation=-90), Rectangle( extent={{10,-10},{50,-72}}, lineColor={0,0,0}, @@ -248,5 +204,13 @@ equation points={{-20,20},{-40,26},{-40,14},{-20,20}}, fillColor={28,108,200}, fillPattern=FillPattern.Solid, - pattern=LinePattern.None)})); + pattern=LinePattern.None), + Line(points={{16,76},{52,68}}, color={0,0,0}), + Line(points={{52,56},{18,46}}, color={0,0,0})}), + Documentation(info=" +Draft model of a plant with a chiller and a storage tank. +Both the chiller and the tank are volumes as placeholders. +The volumes are setup in a way that they turn the fluid that passes through to the +desired temperature when they exit, thus performing as idea thermal sources. +")); end ChillerAndTank; diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo index 5e5d1bb587f..6a7ac0263fb 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo @@ -38,7 +38,7 @@ equation annotation (Line(points={{-180,0},{-140,0}}, color={0,127,255})); connect(pum2.port_b, jun1.port_1) annotation (Line(points={{-120,0},{-90,0}}, color={0,127,255})); - connect(floSenTan.m_flow, gain2.u) + connect(mTan_flow.m_flow, gain2.u) annotation (Line(points={{-50,-49},{-50,-46},{-150,-46},{-150,18}}, color={0,0,127})); connect(gain2.y, conPIDPum2.u_m) diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo index 93c2ed92d50..1962b6cd5b7 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo @@ -42,7 +42,8 @@ model ChillerAndTankWithRemoteCharging use_inputFilter=false, l=1E-10, dpValve_nominal=1, - m_flow_nominal=m1_flow_nominal+m2_flow_nominal) "Valve in series to the pump (normal direction)" + m_flow_nominal=m1_flow_nominal+m2_flow_nominal) + "Valve in series to the pump (normal direction)" annotation (Placement(transformation(extent={{-120,10},{-100,30}}))); Actuators.Valves.TwoWayEqualPercentage val2( redeclare package Medium = Medium, @@ -58,7 +59,7 @@ equation 50},{-200,50}}, color={255,0,255})); connect(pum2Con.us_mTan_flow,us_mChi_flow) annotation (Line(points={{-141,72.3}, {-146,72.3},{-146,136},{-50,136},{-50,120}}, color={0,0,127})); - connect(pum2Con.um_mTan_flow, floSenTan.m_flow) annotation (Line(points={{-141, + connect(pum2Con.um_mTan_flow,mTan_flow.m_flow) annotation (Line(points={{-141, 76.7},{-170,76.7},{-170,-40},{-50,-40},{-50,-49}}, color={0,0,127})); connect(jun1.port_1, val2.port_a) annotation (Line(points={{-90,0},{-94,0},{-94, diff --git a/Buildings/Fluid/Storage/Plant/VolumeSetState.mo b/Buildings/Fluid/Storage/Plant/VolumeSetState.mo new file mode 100644 index 00000000000..1723e245fd8 --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/VolumeSetState.mo @@ -0,0 +1,110 @@ +within Buildings.Fluid.Storage.Plant; +model VolumeSetState + "The fluid passes through the volume turns into the prescribed state" + + replaceable package Medium = + Modelica.Media.Interfaces.PartialMedium "Medium in the component"; + + parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=1 + "Nominal mass flow rate"; + parameter Modelica.Units.SI.AbsolutePressure p_nominal=800000 + "Nominal pressure"; + parameter Modelica.Units.SI.Temperature T_a_nominal=12+273.15 + "Nominal temperature at port_a"; + parameter Modelica.Units.SI.Temperature T_b_nominal=7+273.15 + "Nominal temperature at port_b"; + parameter Boolean allowFlowReversal=false + "Flow reversal setting"; + + MixingVolumes.MixingVolume vol( + nPorts=2, + final prescribedHeatFlowRate=true, + redeclare package Medium = Medium, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + m_flow_nominal=m_flow_nominal, + allowFlowReversal=allowFlowReversal, + V=1E-3, + p_start=p_nominal, + T_start=T_b_nominal) "Volume" + annotation ( + Placement(transformation( + origin={0,20}, + extent={{-10,10},{10,-10}}, + rotation=180))); + Sensors.TemperatureTwoPort T_a( + redeclare package Medium = Medium, + allowFlowReversal=allowFlowReversal, + m_flow_nominal=m_flow_nominal, + T_start=T_a_nominal, + tauHeaTra=1) "Temperature sensor to port_a" + annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); + Sensors.TemperatureTwoPort T_b( + redeclare package Medium = Medium, + allowFlowReversal=allowFlowReversal, + m_flow_nominal=m_flow_nominal, + T_start=T_b_nominal, + tauHeaTra=1) "Temperature sensor to port_b" + annotation (Placement(transformation(extent={{40,-10},{60,10}}))); + Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow heaChi + "Prescribed heat flow" + annotation (Placement(transformation(extent={{2,38},{22,58}}))); + Modelica.Blocks.Sources.RealExpression QVol(y=port_a.m_flow*( + Medium.specificEnthalpy(state=Medium.setState_pTX( + p=p_nominal, + T=T_b_nominal, + X={1.})) - T_a.port_b.h_outflow)) + "Heat flow that sets the flow to the desired state" + annotation (Placement(transformation(extent={{-30,38},{-10,58}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a( + p(start=p_nominal), + redeclare package Medium = Medium, + h_outflow(start=Medium.h_default, nominal=Medium.h_default)) + "Fluid connector a (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{-110,-10},{-90,10}}), + iconTransformation(extent={{-112,-10},{-92,10}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b( + p(start=p_nominal), + redeclare package Medium = Medium, + h_outflow(start=Medium.h_default, nominal=Medium.h_default)) + "Fluid connector b (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{110,-10},{90,10}}), + iconTransformation(extent={{110,-10},{90,10}}))); +equation + connect(T_a.port_b, vol.ports[1]) + annotation (Line(points={{-40,0},{1,0},{1,10}}, color={0,127,255})); + connect(T_b.port_a, vol.ports[2]) + annotation (Line(points={{40,0},{-1,0},{-1,10}}, color={0,127,255})); + connect(heaChi.port,vol. heatPort) + annotation (Line(points={{22,48},{28,48},{28,20},{10,20}}, + color={191,0,0})); + connect(QVol.y,heaChi. Q_flow) + annotation (Line(points={{-9,48},{2,48}}, color={0,0,127})); + connect(T_b.port_b, port_b) + annotation (Line(points={{60,0},{100,0}}, color={0,127,255})); + connect(T_a.port_a, port_a) + annotation (Line(points={{-60,0},{-100,0}}, color={0,127,255})); +annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={Ellipse( + extent={{-100,100},{100,-100}}, + lineColor={28,108,200}, + fillPattern=FillPattern.Sphere, + fillColor={28,108,200}), Text( + extent={{-80,80},{80,-80}}, + textColor={255,255,255}, + textString="T", + textStyle={TextStyle.Bold}), + Polygon( + points={{20,-104},{60,-119},{20,-134},{20,-104}}, + lineColor={0,128,255}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid, + visible=not allowFlowReversal), + Line( + points={{55,-119},{-60,-119}}, + color={0,128,255}, + visible=not allowFlowReversal), + Text( + extent={{-74,144},{80,102}}, + textColor={0,0,255}, + textString="%name")}), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end VolumeSetState; diff --git a/Buildings/Fluid/Storage/Plant/package.order b/Buildings/Fluid/Storage/Plant/package.order index 158f1c11b76..860d650b068 100644 --- a/Buildings/Fluid/Storage/Plant/package.order +++ b/Buildings/Fluid/Storage/Plant/package.order @@ -1,4 +1,5 @@ ChillerAndTankNoRemoteCharging ChillerAndTankWithRemoteCharging +VolumeSetState Examples BaseClasses From 43897efbd5f98b18869c732124737314f34cbab0 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Tue, 8 Feb 2022 09:49:49 -0800 Subject: [PATCH 009/463] generalised ideal volume for tank --- .../Plant/BaseClasses/ChillerAndTank.mo | 73 +++---------------- .../Plant/ChillerAndTankNoRemoteCharging.mo | 12 ++- .../Plant/ChillerAndTankWithRemoteCharging.mo | 6 +- .../Fluid/Storage/Plant/VolumeSetState.mo | 41 ++++++++--- 4 files changed, 52 insertions(+), 80 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo index f28b0c6e921..0598ce7597b 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo @@ -42,20 +42,6 @@ partial model ChillerAndTank final m_flow_small=m1_flow_nominal*1E-5) "Primary CHW pump" annotation (Placement(transformation(extent={{-60,30},{-40,50}}))); - Buildings.Fluid.MixingVolumes.MixingVolume tan( - redeclare package Medium = Medium, - nPorts=2, - final prescribedHeatFlowRate=true, - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - m_flow_nominal=m2_flow_nominal, - final allowFlowReversal=true, - V=1E-3, - p_start=p_CHWS_nominal, - T_start=T_CHWS_nominal) "Volume representing a tank" annotation (Placement( - transformation( - origin={0,-40}, - extent={{-10,10},{10,-10}}, - rotation=180))); Buildings.Fluid.FixedResistances.Junction jun1( redeclare package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, @@ -78,44 +64,12 @@ partial model ChillerAndTank extent={{-10,-10},{10,10}}, rotation=0, origin={100,0}))); - Buildings.Fluid.Sensors.TemperatureTwoPort TTanHot( - redeclare package Medium = Medium, - m_flow_nominal=m2_flow_nominal, - T_start=T_CHWR_nominal, - tauHeaTra=1) "Tank hot side" - annotation (Placement(transformation(extent={{-30,-70},{-10,-50}}))); - Buildings.Fluid.Sensors.TemperatureTwoPort TTanCol( - redeclare package Medium = Medium, - m_flow_nominal=m2_flow_nominal, - T_start=T_CHWS_nominal, - tauHeaTra=1) "Tank cold side" - annotation (Placement(transformation(extent={{10,-70},{30,-50}}))); Buildings.Fluid.FixedResistances.PressureDrop preDro2( redeclare package Medium = Medium, final allowFlowReversal=true, final dp_nominal=dp_nominal, final m_flow_nominal=m2_flow_nominal) "Flow resistance on tank branch" annotation (Placement(transformation(extent={{40,-70},{60,-50}}))); - Buildings.Fluid.Sensors.MassFlowRate mTan_flow( - redeclare package Medium=Medium, - final allowFlowReversal=true) - "Flow rate sensor on the tank branch" - annotation (Placement(transformation(extent={{-60,-70},{-40,-50}}))); - Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow heaTan - "Prescribed heat flow for tank" - annotation (Placement(transformation(extent={{0,-20},{20,0}}))); - Modelica.Blocks.Sources.RealExpression QTan( - y=if mTan_flow.m_flow>0 then mTan_flow.m_flow - *( - Medium.specificEnthalpy(state=Medium.setState_pTX( - p=p_CHWS_nominal, T=T_CHWS_nominal, X={1.})) - - TTanHot.port_b.h_outflow) - else mTan_flow.m_flow - *(TTanCol.port_a.h_outflow - - Medium.specificEnthalpy(state=Medium.setState_pTX( - p=p_CHWR_nominal, T=T_CHWR_nominal, X={1.})))) - "Heat flow of the tank" - annotation (Placement(transformation(extent={{-30,-20},{-10,0}}))); Modelica.Fluid.Interfaces.FluidPort_a port_a( p(start=p_CHWR_nominal), redeclare package Medium = Medium, @@ -148,32 +102,25 @@ partial model ChillerAndTank T_a_nominal=T_CHWR_nominal, T_b_nominal=T_CHWS_nominal) "Ideal chiller" annotation (Placement(transformation(extent={{-10,30},{10,50}}))); + VolumeSetState ideTan( + redeclare package Medium = Medium, + final allowFlowReversal=true, + m_flow_nominal=m2_flow_nominal, + p_nominal=p_CHWS_nominal, + T_a_nominal=T_CHWR_nominal, + T_b_nominal=T_CHWS_nominal) "Ideal tank" + annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); equation connect(pum1.port_a, jun1.port_2) annotation (Line(points={{-60,40},{-66,40},{ -66,0},{-70,0}}, color={0,127,255})); - connect(TTanHot.port_b, tan.ports[1]) - annotation (Line(points={{-10,-60},{1,-60},{1,-50}}, color={0,127,255})); - connect(tan.ports[2], TTanCol.port_a) - annotation (Line(points={{-1,-50},{-1,-60},{10,-60}}, color={0,127,255})); - connect(TTanCol.port_b, preDro2.port_a) - annotation (Line(points={{30,-60},{40,-60}}, color={0,127,255})); connect(preDro2.port_b, jun2.port_3) annotation (Line(points={{60,-60},{100,-60},{100,-10}}, color={0,127,255})); - connect(jun1.port_3,mTan_flow. port_a) - annotation (Line(points={{-80,-10},{-80,-60},{-60,-60}}, - color={0,127,255})); - connect(mTan_flow.port_b, TTanHot.port_a) - annotation (Line(points={{-40,-60},{-30,-60}}, color={0,127,255})); connect(preDro1.port_b, jun2.port_1) annotation (Line(points={{60,40},{84,40},{84,0},{90,0}}, color={0,127,255})); - connect(QTan.y, heaTan.Q_flow) - annotation (Line(points={{-9,-10},{0,-10}}, color={0,0,127})); - connect(heaTan.port, tan.heatPort) annotation (Line(points={{20,-10},{28,-10}, - {28,-40},{10,-40}}, color={191,0,0})); connect(jun2.port_2, port_b) annotation (Line(points={{110,0},{140,0}}, color={0,127,255})); connect(pum1.m_flow_in, us_mChi_flow) annotation (Line(points={{-56,48},{-56,60}, @@ -182,6 +129,10 @@ equation {-28,40},{-10.2,40}}, color={0,127,255})); connect(ideChi.port_b, preDro1.port_a) annotation (Line(points={{10,40},{10,40}, {10,40},{40,40}}, color={0,127,255})); + connect(ideTan.port_b, preDro2.port_a) + annotation (Line(points={{10,-60},{40,-60}}, color={0,127,255})); + connect(jun1.port_3, ideTan.port_a) annotation (Line(points={{-80,-10},{-80, + -60},{-10.2,-60}}, color={0,127,255})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-180,-100},{140,100}})), diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo index 6a7ac0263fb..4ff12a664a0 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo @@ -38,17 +38,15 @@ equation annotation (Line(points={{-180,0},{-140,0}}, color={0,127,255})); connect(pum2.port_b, jun1.port_1) annotation (Line(points={{-120,0},{-90,0}}, color={0,127,255})); - connect(mTan_flow.m_flow, gain2.u) - annotation (Line(points={{-50,-49},{-50,-46},{-150,-46},{-150,18}}, - color={0,0,127})); connect(gain2.y, conPIDPum2.u_m) annotation (Line(points={{-150,41},{-150,58}}, color={0,0,127})); connect(conPIDPum2.y, pum2.y) annotation (Line(points={{-139,70},{-130,70},{ -130,12}}, color={0,0,127})); connect(usMasFloPum2, conPIDPum2.u_s) annotation (Line(points={{-192,70},{-162,70}}, color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, - -100},{100,100}})), Diagram( - coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100, - 100}}))); + connect(ideTan.m_flow, gain2.u) annotation (Line(points={{-7,-49},{-8,-49},{-8, + -40},{-150,-40},{-150,18}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, + {100,100}})), Diagram( + coordinateSystem(preserveAspectRatio=false, extent={{-180,-100},{100,100}}))); end ChillerAndTankNoRemoteCharging; diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo index 1962b6cd5b7..3d6d27e8f08 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo @@ -59,9 +59,6 @@ equation 50},{-200,50}}, color={255,0,255})); connect(pum2Con.us_mTan_flow,us_mChi_flow) annotation (Line(points={{-141,72.3}, {-146,72.3},{-146,136},{-50,136},{-50,120}}, color={0,0,127})); - connect(pum2Con.um_mTan_flow,mTan_flow.m_flow) annotation (Line(points={{-141, - 76.7},{-170,76.7},{-170,-40},{-50,-40},{-50,-49}}, - color={0,0,127})); connect(jun1.port_1, val2.port_a) annotation (Line(points={{-90,0},{-94,0},{-94, -20},{-120,-20}}, color={0,127,255})); connect(val2.port_b, port_a) annotation (Line(points={{-140,-20},{-164,-20},{-164, @@ -78,6 +75,9 @@ equation {-130,-2},{-130,-8}}, color={0,0,127})); connect(pum2Con.yVal1, val1.y) annotation (Line(points={{-123,56.9},{-110,56.9}, {-110,32}}, color={0,0,127})); + connect(pum2Con.um_mTan_flow, ideTan.m_flow) annotation (Line(points={{-141, + 76.7},{-142,76.7},{-142,78},{-170,78},{-170,-42},{-7,-42},{-7,-49}}, + color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, -100},{100,100}}), graphics={Line( points={{-80,-20},{-20,-20}}, diff --git a/Buildings/Fluid/Storage/Plant/VolumeSetState.mo b/Buildings/Fluid/Storage/Plant/VolumeSetState.mo index 1723e245fd8..dc1ccb32c28 100644 --- a/Buildings/Fluid/Storage/Plant/VolumeSetState.mo +++ b/Buildings/Fluid/Storage/Plant/VolumeSetState.mo @@ -37,20 +37,25 @@ model VolumeSetState m_flow_nominal=m_flow_nominal, T_start=T_a_nominal, tauHeaTra=1) "Temperature sensor to port_a" - annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); + annotation (Placement(transformation(extent={{-40,-10},{-20,10}}))); Sensors.TemperatureTwoPort T_b( redeclare package Medium = Medium, allowFlowReversal=allowFlowReversal, m_flow_nominal=m_flow_nominal, T_start=T_b_nominal, tauHeaTra=1) "Temperature sensor to port_b" - annotation (Placement(transformation(extent={{40,-10},{60,10}}))); + annotation (Placement(transformation(extent={{20,-10},{40,10}}))); Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow heaChi "Prescribed heat flow" annotation (Placement(transformation(extent={{2,38},{22,58}}))); - Modelica.Blocks.Sources.RealExpression QVol(y=port_a.m_flow*( + Modelica.Blocks.Sources.RealExpression QVol(y=if allowFlowReversal and + mVol_flow.m_flow < 0 then mVol_flow.m_flow*(T_b.port_a.h_outflow - Medium.specificEnthalpy(state=Medium.setState_pTX( p=p_nominal, + T=T_a_nominal, + X={1.}))) else mVol_flow.m_flow*(Medium.specificEnthalpy(state= + Medium.setState_pTX( + p=p_nominal, T=T_b_nominal, X={1.})) - T_a.port_b.h_outflow)) "Heat flow that sets the flow to the desired state" @@ -69,20 +74,38 @@ model VolumeSetState "Fluid connector b (positive design flow direction is from port_a to port_b)" annotation (Placement(transformation(extent={{110,-10},{90,10}}), iconTransformation(extent={{110,-10},{90,10}}))); + Sensors.MassFlowRate mVol_flow( + redeclare package Medium = Medium, + final allowFlowReversal=true) "Flow rate sensor" + annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); + Modelica.Blocks.Interfaces.RealOutput m_flow "Mass flow rate" annotation ( + Dialog(group="Time varying output signal"), Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={-70,110}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={-70,110}))); equation connect(T_a.port_b, vol.ports[1]) - annotation (Line(points={{-40,0},{1,0},{1,10}}, color={0,127,255})); + annotation (Line(points={{-20,0},{1,0},{1,10}}, color={0,127,255})); connect(T_b.port_a, vol.ports[2]) - annotation (Line(points={{40,0},{-1,0},{-1,10}}, color={0,127,255})); + annotation (Line(points={{20,0},{-1,0},{-1,10}}, color={0,127,255})); connect(heaChi.port,vol. heatPort) annotation (Line(points={{22,48},{28,48},{28,20},{10,20}}, color={191,0,0})); connect(QVol.y,heaChi. Q_flow) annotation (Line(points={{-9,48},{2,48}}, color={0,0,127})); connect(T_b.port_b, port_b) - annotation (Line(points={{60,0},{100,0}}, color={0,127,255})); - connect(T_a.port_a, port_a) - annotation (Line(points={{-60,0},{-100,0}}, color={0,127,255})); + annotation (Line(points={{40,0},{100,0}}, color={0,127,255})); + connect(T_a.port_a, mVol_flow.port_b) + annotation (Line(points={{-40,0},{-60,0}}, color={0,127,255})); + connect(mVol_flow.port_a, port_a) + annotation (Line(points={{-80,0},{-100,0}}, color={0,127,255})); + connect(m_flow, m_flow) + annotation (Line(points={{-70,110},{-70,110}}, color={0,0,127})); + connect(mVol_flow.m_flow, m_flow) + annotation (Line(points={{-70,11},{-70,110}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={Ellipse( extent={{-100,100},{100,-100}}, lineColor={28,108,200}, @@ -103,7 +126,7 @@ annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={Ellipse( color={0,128,255}, visible=not allowFlowReversal), Text( - extent={{-74,144},{80,102}}, + extent={{-74,-124},{80,-166}}, textColor={0,0,255}, textString="%name")}), Diagram( coordinateSystem(preserveAspectRatio=false))); From 1a886747355d5fd6c8f1088c0820ed96f3046133 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Wed, 9 Feb 2022 09:43:17 -0800 Subject: [PATCH 010/463] dummy consumer --- .../Plant/BaseClasses/ChillerAndTank.mo | 18 +-- .../Plant/ChillerAndTankNoRemoteCharging.mo | 8 +- .../Plant/ChillerAndTankWithRemoteCharging.mo | 14 +- ...{VolumeSetState.mo => DummyChillSource.mo} | 8 +- .../Fluid/Storage/Plant/DummyConsumer.mo | 144 ++++++++++++++++++ .../ChillerAndTankNoRemoteCharging.mo | 19 ++- .../ChillerAndTankWithRemoteCharging.mo | 8 +- .../Storage/Plant/Examples/DummyConsumer.mo | 72 +++++++++ .../Storage/Plant/Examples/package.order | 1 + Buildings/Fluid/Storage/Plant/package.order | 3 +- 10 files changed, 255 insertions(+), 40 deletions(-) rename Buildings/Fluid/Storage/Plant/{VolumeSetState.mo => DummyChillSource.mo} (96%) create mode 100644 Buildings/Fluid/Storage/Plant/DummyConsumer.mo create mode 100644 Buildings/Fluid/Storage/Plant/Examples/DummyConsumer.mo diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo index 0598ce7597b..267b9f96555 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo @@ -39,8 +39,7 @@ partial model ChillerAndTank final control_m_flow=true, final control_dp=false, final allowFlowReversal=allowFlowReversal1, - final m_flow_small=m1_flow_nominal*1E-5) - "Primary CHW pump" + final m_flow_small=m1_flow_nominal*1E-5) "Primary CHW pump" annotation (Placement(transformation(extent={{-60,30},{-40,50}}))); Buildings.Fluid.FixedResistances.Junction jun1( redeclare package Medium = Medium, @@ -84,17 +83,16 @@ partial model ChillerAndTank "Fluid connector b (positive design flow direction is from port_a to port_b)" annotation (Placement(transformation(extent={{150,-10},{130,10}}), iconTransformation(extent={{110,-10},{90,10}}))); - Modelica.Blocks.Interfaces.RealInput us_mChi_flow - "Chiller mass flow rate setpoint" - annotation (Placement(transformation( + Modelica.Blocks.Interfaces.RealInput set_mPum1_flow + "Primary pump mass flow rate setpoint" annotation (Placement(transformation( extent={{-20,-20},{20,20}}, rotation=-90, - origin={-50,120}), iconTransformation( + origin={-50,120}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={-30,110}))); - Buildings.Fluid.Storage.Plant.VolumeSetState ideChi( + Buildings.Fluid.Storage.Plant.DummyChillSource ideChi( redeclare package Medium = Medium, allowFlowReversal=allowFlowReversal1, m_flow_nominal=m1_flow_nominal, @@ -102,7 +100,7 @@ partial model ChillerAndTank T_a_nominal=T_CHWR_nominal, T_b_nominal=T_CHWS_nominal) "Ideal chiller" annotation (Placement(transformation(extent={{-10,30},{10,50}}))); - VolumeSetState ideTan( + DummyChillSource ideTan( redeclare package Medium = Medium, final allowFlowReversal=true, m_flow_nominal=m2_flow_nominal, @@ -123,8 +121,8 @@ equation color={0,127,255})); connect(jun2.port_2, port_b) annotation (Line(points={{110,0},{140,0}}, color={0,127,255})); - connect(pum1.m_flow_in, us_mChi_flow) annotation (Line(points={{-56,48},{-56,60}, - {-50,60},{-50,120}}, color={0,0,127})); + connect(pum1.m_flow_in, set_mPum1_flow) annotation (Line(points={{-56,48},{-56, + 60},{-50,60},{-50,120}}, color={0,0,127})); connect(pum1.port_b, ideChi.port_a) annotation (Line(points={{-40,40},{-28,40}, {-28,40},{-10.2,40}}, color={0,127,255})); connect(ideChi.port_b, preDro1.port_a) annotation (Line(points={{10,40},{10,40}, diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo index 4ff12a664a0..8af38ba61c1 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo @@ -29,10 +29,10 @@ model ChillerAndTankNoRemoteCharging extent={{-10,-10},{10,10}}, rotation=90, origin={-150,30}))); - Modelica.Blocks.Interfaces.RealInput usMasFloPum2 + Modelica.Blocks.Interfaces.RealInput set_mPum2_flow "Secondary pump mass flow rate setpoint" annotation (Placement( - transformation(extent={{-204,58},{-180,82}}), iconTransformation(extent={{-120,50}, - {-100,70}}))); + transformation(extent={{-204,58},{-180,82}}), iconTransformation(extent + ={{-120,50},{-100,70}}))); equation connect(port_a, pum2.port_a) annotation (Line(points={{-180,0},{-140,0}}, color={0,127,255})); @@ -42,7 +42,7 @@ equation annotation (Line(points={{-150,41},{-150,58}}, color={0,0,127})); connect(conPIDPum2.y, pum2.y) annotation (Line(points={{-139,70},{-130,70},{ -130,12}}, color={0,0,127})); - connect(usMasFloPum2, conPIDPum2.u_s) + connect(set_mPum2_flow, conPIDPum2.u_s) annotation (Line(points={{-192,70},{-162,70}}, color={0,0,127})); connect(ideTan.m_flow, gain2.u) annotation (Line(points={{-7,-49},{-8,-49},{-8, -40},{-150,-40},{-150,18}}, color={0,0,127})); diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo index 3d6d27e8f08..004a562e353 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo @@ -14,11 +14,11 @@ model ChillerAndTankWithRemoteCharging "Flow direction, true = normal, false = reverse" annotation (Placement( transformation(extent={{-220,70},{-180,110}}), iconTransformation( extent={{-140,50},{-100,90}}))); - Modelica.Blocks.Interfaces.RealInput us_mTan_flow + Modelica.Blocks.Interfaces.RealInput set_mTan_flow "Tank mass flow rate setpoint" annotation (Placement(transformation( extent={{-20,-20},{20,20}}, rotation=-90, - origin={-130,160}), iconTransformation( + origin={-150,120}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={-70,110}))); @@ -57,8 +57,6 @@ equation 90},{-160,65.7},{-142,65.7}}, color={255,0,255})); connect(pum2Con.onOffLin, onOffLin) annotation (Line(points={{-142,61.3},{-142, 50},{-200,50}}, color={255,0,255})); - connect(pum2Con.us_mTan_flow,us_mChi_flow) annotation (Line(points={{-141,72.3}, - {-146,72.3},{-146,136},{-50,136},{-50,120}}, color={0,0,127})); connect(jun1.port_1, val2.port_a) annotation (Line(points={{-90,0},{-94,0},{-94, -20},{-120,-20}}, color={0,127,255})); connect(val2.port_b, port_a) annotation (Line(points={{-140,-20},{-164,-20},{-164, @@ -78,8 +76,10 @@ equation connect(pum2Con.um_mTan_flow, ideTan.m_flow) annotation (Line(points={{-141, 76.7},{-142,76.7},{-142,78},{-170,78},{-170,-42},{-7,-42},{-7,-49}}, color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, - -100},{100,100}}), graphics={Line( + connect(pum2Con.us_mTan_flow, set_mTan_flow) annotation (Line(points={{-141, + 72.3},{-150,72.3},{-150,120}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-180, + -100},{140,100}}), graphics={Line( points={{-80,-20},{-20,-20}}, color={28,108,200}, pattern=LinePattern.Dash), Polygon( @@ -88,5 +88,5 @@ equation fillPattern=FillPattern.Solid, pattern=LinePattern.None)}), Diagram( coordinateSystem(preserveAspectRatio=false, extent={{-180,-100},{140, - 140}}))); + 100}}))); end ChillerAndTankWithRemoteCharging; diff --git a/Buildings/Fluid/Storage/Plant/VolumeSetState.mo b/Buildings/Fluid/Storage/Plant/DummyChillSource.mo similarity index 96% rename from Buildings/Fluid/Storage/Plant/VolumeSetState.mo rename to Buildings/Fluid/Storage/Plant/DummyChillSource.mo index dc1ccb32c28..b4492e2d98c 100644 --- a/Buildings/Fluid/Storage/Plant/VolumeSetState.mo +++ b/Buildings/Fluid/Storage/Plant/DummyChillSource.mo @@ -1,6 +1,6 @@ within Buildings.Fluid.Storage.Plant; -model VolumeSetState - "The fluid passes through the volume turns into the prescribed state" +model DummyChillSource + "An ideal chill (or heat) source that always turns the fluid passing through to the prescribed state" replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium in the component"; @@ -126,8 +126,8 @@ annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={Ellipse( color={0,128,255}, visible=not allowFlowReversal), Text( - extent={{-74,-124},{80,-166}}, + extent={{-74,-130},{80,-172}}, textColor={0,0,255}, textString="%name")}), Diagram( coordinateSystem(preserveAspectRatio=false))); -end VolumeSetState; +end DummyChillSource; diff --git a/Buildings/Fluid/Storage/Plant/DummyConsumer.mo b/Buildings/Fluid/Storage/Plant/DummyConsumer.mo new file mode 100644 index 00000000000..179c3d15d7f --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/DummyConsumer.mo @@ -0,0 +1,144 @@ +within Buildings.Fluid.Storage.Plant; +model DummyConsumer "Dummy consumer model" + + replaceable package Medium = + Modelica.Media.Interfaces.PartialMedium "Medium in the component"; + + parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=1 + "Nominal mass flow rate"; + parameter Modelica.Units.SI.PressureDifference dp_nominal= + p_a_nominal-p_b_nominal + "Nominal pressure difference"; + parameter Modelica.Units.SI.AbsolutePressure p_a_nominal=800000 + "Nominal pressure of the CHW supply line"; + parameter Modelica.Units.SI.AbsolutePressure p_b_nominal=300000 + "Nominal pressure of the CHW return line"; + parameter Modelica.Units.SI.Temperature T_a_nominal=7+273.15 + "Nominal temperature of CHW supply"; + parameter Modelica.Units.SI.Temperature T_b_nominal=12+273.15 + "Nominal temperature of CHW return"; + parameter Boolean allowFlowReversal=false + "Flow reversal setting on chiller branch"; + + Actuators.Valves.TwoWayEqualPercentage valCon( + redeclare package Medium = Medium, + use_inputFilter=false, + l=1E-10, + dpValve_nominal=1, + m_flow_nominal=m_flow_nominal) "Consumer control valve" + annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); + Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow heaCon + "Prescribed heat flow" + annotation (Placement(transformation(extent={{22,80},{42,100}}))); + MixingVolumes.MixingVolume vol( + nPorts=2, + final prescribedHeatFlowRate=true, + redeclare package Medium = Medium, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + m_flow_nominal=m_flow_nominal, + allowFlowReversal=allowFlowReversal, + V=1, + p_start=p_a_nominal, + T_start=T_b_nominal) "Volume representing the consumer" + annotation ( + Placement(transformation( + origin={0,-10}, + extent={{10,10},{-10,-10}}, + rotation=0))); + Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor TCon + "Temperature of the consumer" + annotation (Placement(transformation(extent={{40,-60},{20,-40}}))); + FixedResistances.PressureDrop preDro( + redeclare package Medium = Medium, + final allowFlowReversal=true, + final dp_nominal=dp_nominal, + final m_flow_nominal=m_flow_nominal) "Flow resistance of the consumer" + annotation (Placement(transformation(extent={{60,-10},{80,10}}))); + Controls.Continuous.LimPID conPI_valCon( + controllerType=Modelica.Blocks.Types.SimpleController.PI, + Td=1, + k=5, + Ti=50, + yMin=-1) "PI controller for consumer control valve" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-50,50}))); + Modelica.Blocks.Math.Gain gain(k=-1) "Gain" annotation (Placement( + transformation( + extent={{10,-10},{-10,10}}, + rotation=180, + origin={-10,50}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a( + p(start=p_a_nominal), + redeclare package Medium = Medium, + h_outflow(start=Medium.h_default, nominal=Medium.h_default)) + "Fluid connector a (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{-110,-10},{-90,10}}), + iconTransformation(extent={{-112,-10},{-92,10}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b( + p(start=p_b_nominal), + redeclare package Medium = Medium, + h_outflow(start=Medium.h_default, nominal=Medium.h_default)) + "Fluid connector b (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{110,-10},{90,10}}), + iconTransformation(extent={{110,-10},{90,10}}))); + Modelica.Blocks.Interfaces.RealInput QCooLoa_flow + "Cooling load of the consumer" annotation (Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=0, + origin={-120,90}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-110,90}))); + Modelica.Blocks.Interfaces.RealInput TSet "CHW return setpoint" annotation ( + Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=0, + origin={-120,50}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-110,50}))); + Modelica.Blocks.Interfaces.RealOutput yVal_actual + "Consumer control valve actuator position" annotation (Placement( + transformation( + extent={{-20,-20},{20,20}}, + rotation=0, + origin={120,50}), iconTransformation( + extent={{10,-10},{-10,10}}, + rotation=-90, + origin={-70,110}))); +equation + connect(valCon.port_b, vol.ports[1]) annotation (Line(points={{-60,0},{1,0}}, + color={0,127,255})); + connect(heaCon.port, vol.heatPort) + annotation (Line(points={{42,90},{54,90},{54,-10},{10,-10}}, + color={191,0,0})); + connect(vol.heatPort, TCon.port) + annotation (Line(points={{10,-10},{54,-10},{54,-50},{40,-50}}, + color={191,0,0})); + connect(preDro.port_a, vol.ports[2]) annotation (Line(points={{60,0},{-1,0}}, + color={0,127,255})); + connect(conPI_valCon.y, gain.u) + annotation (Line(points={{-39,50},{-22,50}}, color={0,0,127})); + connect(gain.y, valCon.y) + annotation (Line(points={{1,50},{6,50},{6,18},{-70,18},{-70,12}}, + color={0,0,127})); + connect(TCon.T, conPI_valCon.u_m) annotation (Line(points={{19,-50},{-50,-50}, + {-50,38}}, color={0,0,127})); + connect(valCon.port_a, port_a) + annotation (Line(points={{-80,0},{-100,0}}, color={0,127,255})); + connect(preDro.port_b, port_b) + annotation (Line(points={{80,0},{100,0}}, color={0,127,255})); + connect(heaCon.Q_flow, QCooLoa_flow) + annotation (Line(points={{22,90},{-120,90}}, color={0,0,127})); + connect(conPI_valCon.u_s, TSet) + annotation (Line(points={{-62,50},{-120,50}}, color={0,0,127})); + connect(valCon.y_actual, yVal_actual) annotation (Line(points={{-65,7},{80,7}, + {80,50},{120,50}}, color={0,0,127})); + annotation (Icon(graphics={Ellipse( + extent={{-100,100},{100,-100}}, + lineColor={28,108,200}, + fillColor={244,125,35}, + fillPattern=FillPattern.Sphere)})); +end DummyConsumer; diff --git a/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo index bcd5a683563..580d2000585 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo @@ -28,18 +28,17 @@ model ChillerAndTankNoRemoteCharging "(Draft)" redeclare final package Medium = Medium, p=800000, T=280.15, - nPorts=1) - "Sink representing CHW supply line" + nPorts=1) "Sink representing CHW supply line" annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=180, origin={60,0}))); - Modelica.Blocks.Sources.TimeTable setFloPum2(table=[0*3600,1; 0.25*3600,1; + Modelica.Blocks.Sources.TimeTable set_mPum2_flow(table=[0*3600,1; 0.25*3600,1; 0.25*3600,-1; 0.5*3600,-1; 0.5*3600,0; 0.75*3600,0; 0.75*3600,1; 1*3600, - 1]) "Placeholder" + 1]) "Secondary mass flow rate setpoint" annotation (Placement(transformation(extent={{-70,20},{-50,40}}))); - Modelica.Blocks.Sources.Constant set_mChi_flow(k=cat.m1_flow_nominal) - "Prescribed chiller branch flow rate" + Modelica.Blocks.Sources.Constant set_mPum1_flow(k=cat.m1_flow_nominal) + "Primary pump mass flow rate setpoint" annotation (Placement(transformation(extent={{-70,60},{-50,80}}))); equation connect(sou.ports[1], cat.port_a) @@ -48,10 +47,10 @@ equation 4.44089e-16},{50,4.44089e-16}}, color={0,127,255})); - connect(setFloPum2.y, cat.usMasFloPum2) annotation (Line(points={{-49,30},{ - -16,30},{-16,6},{-11,6}}, color={0,0,127})); - connect(set_mChi_flow.y, cat.us_mChi_flow) annotation (Line(points={{-49,70}, - {-3,70},{-3,11}}, color={0,0,127})); + connect(set_mPum2_flow.y, cat.set_mPum2_flow) annotation (Line(points={{-49, + 30},{-16,30},{-16,6},{-11,6}}, color={0,0,127})); + connect(set_mPum1_flow.y, cat.set_mPum1_flow) + annotation (Line(points={{-49,70},{-3,70},{-3,11}}, color={0,0,127})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), diff --git a/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankWithRemoteCharging.mo index ddaeb5b5bac..092fc825e20 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankWithRemoteCharging.mo @@ -72,10 +72,10 @@ equation connect(booFloDir.y,cat.booFloDir) annotation (Line(points={{-59,30},{-20,30}, {-20,6},{-10,6},{-10,7}}, color={255,0,255})); - connect(set_mTan_flow.y, cat.us_mTan_flow) annotation (Line(points={{-59,70}, - {-5,70},{-5,11}}, color={0,0,127})); - connect(set_mChi_flow.y, cat.us_mChi_flow) - annotation (Line(points={{-19,90},{-1,90},{-1,11}}, color={0,0,127})); + connect(set_mTan_flow.y, cat.set_mTan_flow) + annotation (Line(points={{-59,70},{-5,70},{-5,11}}, color={0,0,127})); + connect(set_mChi_flow.y, cat.set_mPum1_flow) + annotation (Line(points={{-19,90},{-1,90},{-1,11}}, color={0,0,127})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), diff --git a/Buildings/Fluid/Storage/Plant/Examples/DummyConsumer.mo b/Buildings/Fluid/Storage/Plant/Examples/DummyConsumer.mo new file mode 100644 index 00000000000..9b628bfe2d5 --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/Examples/DummyConsumer.mo @@ -0,0 +1,72 @@ +within Buildings.Fluid.Storage.Plant.Examples; +model DummyConsumer "Test model for the dummy consumer" + extends Modelica.Icons.Example; + + package Medium = Buildings.Media.Water "Medium model"; + + parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=1 + "Nominal mass flow rate"; + parameter Modelica.Units.SI.PressureDifference dp_nominal= + p_CHWS_nominal-p_CHWR_nominal + "Nominal pressure difference"; + parameter Modelica.Units.SI.AbsolutePressure p_CHWS_nominal=800000 + "Nominal pressure at CHW supply line"; + parameter Modelica.Units.SI.AbsolutePressure p_CHWR_nominal=300000 + "Nominal pressure at CHW return line"; + parameter Modelica.Units.SI.Temperature T_CHWR_nominal=12+273.15 + "Nominal temperature of CHW return"; + parameter Modelica.Units.SI.Temperature T_CHWS_nominal=7+273.15 + "Nominal temperature of CHW supply"; + parameter Boolean allowFlowReversal=false + "Flow reversal setting"; + + Buildings.Fluid.Storage.Plant.DummyConsumer ideCon( + redeclare package Medium = Medium, + vol(T_start=20+273.15), + m_flow_nominal=m_flow_nominal, + dp_nominal=p_CHWS_nominal - p_CHWR_nominal, + p_a_nominal=p_CHWS_nominal, + p_b_nominal=p_CHWR_nominal, + T_a_nominal=T_CHWS_nominal, + T_b_nominal=T_CHWR_nominal) + "Ideal consumer" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0))); + Modelica.Blocks.Sources.Constant set_TRet(k=12 + 273.15) + "CHW return setpoint" + annotation (Placement(transformation(extent={{-80,40},{-60,60}}))); + Modelica.Blocks.Sources.Constant preQCooLoa_flow(k=5*4200*0.65) + "Placeholder, prescribed cooling load" + annotation (Placement(transformation(extent={{-60,80},{-40,100}}))); + Sources.Boundary_pT sin( + redeclare final package Medium = Medium, + p=p_CHWR_nominal, + T=T_CHWR_nominal, + nPorts=1) "Sink representing CHW return line" + annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=0, + origin={70,0}))); + Sources.Boundary_pT sou( + redeclare final package Medium = Medium, + p=p_CHWS_nominal, + T=T_CHWS_nominal, + nPorts=1) "Source representing CHW supply line" annotation (Placement( + transformation( + extent={{10,10},{-10,-10}}, + rotation=180, + origin={-70,0}))); +equation + connect(set_TRet.y, ideCon.TSet) + annotation (Line(points={{-59,50},{-30,50},{-30,5},{-11,5}}, + color={0,0,127})); + connect(preQCooLoa_flow.y, ideCon.QCooLoa_flow) + annotation (Line(points={{-39,90},{-20,90},{-20,9},{-11,9}}, + color={0,0,127})); + connect(sou.ports[1], ideCon.port_a) annotation (Line(points={{-60,-6.66134e-16}, + {-35.1,-6.66134e-16},{-35.1,0},{-10.2,0}}, color={0,127,255})); + connect(ideCon.port_b, sin.ports[1]) + annotation (Line(points={{10,0},{60,0}}, color={0,127,255})); +annotation(experiment(Tolerance=1e-06, StopTime=3600)); +end DummyConsumer; diff --git a/Buildings/Fluid/Storage/Plant/Examples/package.order b/Buildings/Fluid/Storage/Plant/Examples/package.order index 0541e3545f4..cb018233fd7 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/package.order +++ b/Buildings/Fluid/Storage/Plant/Examples/package.order @@ -1,2 +1,3 @@ ChillerAndTankNoRemoteCharging ChillerAndTankWithRemoteCharging +DummyConsumer diff --git a/Buildings/Fluid/Storage/Plant/package.order b/Buildings/Fluid/Storage/Plant/package.order index 860d650b068..a5fba913c00 100644 --- a/Buildings/Fluid/Storage/Plant/package.order +++ b/Buildings/Fluid/Storage/Plant/package.order @@ -1,5 +1,6 @@ ChillerAndTankNoRemoteCharging ChillerAndTankWithRemoteCharging -VolumeSetState +DummyChillSource +DummyConsumer Examples BaseClasses From 1d99b9660cfbb3cd771779dbf78c9a3590b8b1ea Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Wed, 9 Feb 2022 10:35:09 -0800 Subject: [PATCH 011/463] corrected PI controller settings --- .../BaseClasses/ReversiblePumpValveControl.mo | 6 ++++-- Buildings/Fluid/Storage/Plant/DummyConsumer.mo | 13 +++++++------ .../Fluid/Storage/Plant/Examples/DummyConsumer.mo | 14 +++++++------- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo index dbba1ad5057..5294e70f9e5 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo @@ -20,7 +20,8 @@ block ReversiblePumpValveControl Td=1, k=5, Ti=50, - yMin=-1) "PI controller for pum2" annotation (Placement(transformation( + reverseActing=false) + "PI controller for pum2" annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=270, origin={-70,60}))); @@ -34,7 +35,8 @@ block ReversiblePumpValveControl Td=1, k=5, Ti=50, - yMin=-1) "PI controller for val2" annotation (Placement(transformation( + reverseActing=false) + "PI controller for val2" annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=270, origin={-20,60}))); diff --git a/Buildings/Fluid/Storage/Plant/DummyConsumer.mo b/Buildings/Fluid/Storage/Plant/DummyConsumer.mo index 179c3d15d7f..4c424f73339 100644 --- a/Buildings/Fluid/Storage/Plant/DummyConsumer.mo +++ b/Buildings/Fluid/Storage/Plant/DummyConsumer.mo @@ -20,7 +20,7 @@ model DummyConsumer "Dummy consumer model" parameter Boolean allowFlowReversal=false "Flow reversal setting on chiller branch"; - Actuators.Valves.TwoWayEqualPercentage valCon( + Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valCon( redeclare package Medium = Medium, use_inputFilter=false, l=1E-10, @@ -30,7 +30,7 @@ model DummyConsumer "Dummy consumer model" Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow heaCon "Prescribed heat flow" annotation (Placement(transformation(extent={{22,80},{42,100}}))); - MixingVolumes.MixingVolume vol( + Buildings.Fluid.MixingVolumes.MixingVolume vol( nPorts=2, final prescribedHeatFlowRate=true, redeclare package Medium = Medium, @@ -48,23 +48,24 @@ model DummyConsumer "Dummy consumer model" Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor TCon "Temperature of the consumer" annotation (Placement(transformation(extent={{40,-60},{20,-40}}))); - FixedResistances.PressureDrop preDro( + Buildings.Fluid.FixedResistances.PressureDrop preDro( redeclare package Medium = Medium, final allowFlowReversal=true, final dp_nominal=dp_nominal, final m_flow_nominal=m_flow_nominal) "Flow resistance of the consumer" annotation (Placement(transformation(extent={{60,-10},{80,10}}))); - Controls.Continuous.LimPID conPI_valCon( + Buildings.Controls.Continuous.LimPID conPI_valCon( controllerType=Modelica.Blocks.Types.SimpleController.PI, Td=1, k=5, Ti=50, - yMin=-1) "PI controller for consumer control valve" annotation (Placement( + reverseActing=false) + "PI controller for consumer control valve" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-50,50}))); - Modelica.Blocks.Math.Gain gain(k=-1) "Gain" annotation (Placement( + Modelica.Blocks.Math.Gain gain(k=1) "Gain" annotation (Placement( transformation( extent={{10,-10},{-10,10}}, rotation=180, diff --git a/Buildings/Fluid/Storage/Plant/Examples/DummyConsumer.mo b/Buildings/Fluid/Storage/Plant/Examples/DummyConsumer.mo index 9b628bfe2d5..36b2c4c5d64 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/DummyConsumer.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/DummyConsumer.mo @@ -22,7 +22,7 @@ model DummyConsumer "Test model for the dummy consumer" Buildings.Fluid.Storage.Plant.DummyConsumer ideCon( redeclare package Medium = Medium, - vol(T_start=20+273.15), + vol(T_start=15+273.15), m_flow_nominal=m_flow_nominal, dp_nominal=p_CHWS_nominal - p_CHWR_nominal, p_a_nominal=p_CHWS_nominal, @@ -36,9 +36,6 @@ model DummyConsumer "Test model for the dummy consumer" Modelica.Blocks.Sources.Constant set_TRet(k=12 + 273.15) "CHW return setpoint" annotation (Placement(transformation(extent={{-80,40},{-60,60}}))); - Modelica.Blocks.Sources.Constant preQCooLoa_flow(k=5*4200*0.65) - "Placeholder, prescribed cooling load" - annotation (Placement(transformation(extent={{-60,80},{-40,100}}))); Sources.Boundary_pT sin( redeclare final package Medium = Medium, p=p_CHWR_nominal, @@ -57,16 +54,19 @@ model DummyConsumer "Test model for the dummy consumer" extent={{10,10},{-10,-10}}, rotation=180, origin={-70,0}))); + Modelica.Blocks.Sources.TimeTable preQCooLoa_flow(table=[0*3600,0; 0.25*3600, + 0; 0.25*3600,5*4200*2; 0.5*3600,5*4200*2; 0.5*3600,0; 1*3600,0]) + "Placeholder, prescribed cooling load" + annotation (Placement(transformation(extent={{-60,80},{-40,100}}))); equation connect(set_TRet.y, ideCon.TSet) annotation (Line(points={{-59,50},{-30,50},{-30,5},{-11,5}}, color={0,0,127})); - connect(preQCooLoa_flow.y, ideCon.QCooLoa_flow) - annotation (Line(points={{-39,90},{-20,90},{-20,9},{-11,9}}, - color={0,0,127})); connect(sou.ports[1], ideCon.port_a) annotation (Line(points={{-60,-6.66134e-16}, {-35.1,-6.66134e-16},{-35.1,0},{-10.2,0}}, color={0,127,255})); connect(ideCon.port_b, sin.ports[1]) annotation (Line(points={{10,0},{60,0}}, color={0,127,255})); + connect(preQCooLoa_flow.y, ideCon.QCooLoa_flow) annotation (Line(points={{-39, + 90},{-18,90},{-18,9},{-11,9}}, color={0,0,127})); annotation(experiment(Tolerance=1e-06, StopTime=3600)); end DummyConsumer; From be5c4dc11df9f35b59d792af9cadc55e809b02b7 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Wed, 9 Feb 2022 11:07:09 -0800 Subject: [PATCH 012/463] adjusted controller gains --- Buildings/Fluid/Storage/Plant/DummyConsumer.mo | 4 ++-- Buildings/Fluid/Storage/Plant/Examples/DummyConsumer.mo | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/DummyConsumer.mo b/Buildings/Fluid/Storage/Plant/DummyConsumer.mo index 4c424f73339..9f85d5f94e2 100644 --- a/Buildings/Fluid/Storage/Plant/DummyConsumer.mo +++ b/Buildings/Fluid/Storage/Plant/DummyConsumer.mo @@ -57,8 +57,8 @@ model DummyConsumer "Dummy consumer model" Buildings.Controls.Continuous.LimPID conPI_valCon( controllerType=Modelica.Blocks.Types.SimpleController.PI, Td=1, - k=5, - Ti=50, + k=10, + Ti=1000, reverseActing=false) "PI controller for consumer control valve" annotation (Placement( transformation( diff --git a/Buildings/Fluid/Storage/Plant/Examples/DummyConsumer.mo b/Buildings/Fluid/Storage/Plant/Examples/DummyConsumer.mo index 36b2c4c5d64..a3774187ea5 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/DummyConsumer.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/DummyConsumer.mo @@ -36,7 +36,7 @@ model DummyConsumer "Test model for the dummy consumer" Modelica.Blocks.Sources.Constant set_TRet(k=12 + 273.15) "CHW return setpoint" annotation (Placement(transformation(extent={{-80,40},{-60,60}}))); - Sources.Boundary_pT sin( + Buildings.Fluid.Sources.Boundary_pT sin( redeclare final package Medium = Medium, p=p_CHWR_nominal, T=T_CHWR_nominal, @@ -45,7 +45,7 @@ model DummyConsumer "Test model for the dummy consumer" extent={{10,-10},{-10,10}}, rotation=0, origin={70,0}))); - Sources.Boundary_pT sou( + Buildings.Fluid.Sources.Boundary_pT sou( redeclare final package Medium = Medium, p=p_CHWS_nominal, T=T_CHWS_nominal, @@ -54,8 +54,8 @@ model DummyConsumer "Test model for the dummy consumer" extent={{10,10},{-10,-10}}, rotation=180, origin={-70,0}))); - Modelica.Blocks.Sources.TimeTable preQCooLoa_flow(table=[0*3600,0; 0.25*3600, - 0; 0.25*3600,5*4200*2; 0.5*3600,5*4200*2; 0.5*3600,0; 1*3600,0]) + Modelica.Blocks.Sources.TimeTable preQCooLoa_flow(table=[0*3600,0; 0.5*3600,0; + 0.5*3600,5*4200*1.01; 0.75*3600,5*4200*1.01; 0.75*3600,0; 1*3600,0]) "Placeholder, prescribed cooling load" annotation (Placement(transformation(extent={{-60,80},{-40,100}}))); equation From 4aacf1019c8a9da6d0bab226ba339e4574ff7ec7 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Wed, 9 Feb 2022 13:40:00 -0800 Subject: [PATCH 013/463] adjusted package structure, corrected timetable --- .../Plant/BaseClasses/ChillerAndTank.mo | 37 +++++++++---------- .../Plant/ChillerAndTankNoRemoteCharging.mo | 4 +- .../Plant/ChillerAndTankWithRemoteCharging.mo | 7 ++-- .../Fluid/Storage/Plant/Examples/package.mo | 2 +- .../Storage/Plant/Examples/package.order | 3 -- .../ChillerAndTankNoRemoteCharging.mo | 2 +- .../ChillerAndTankWithRemoteCharging.mo | 18 ++++----- .../{Examples => Validation}/DummyConsumer.mo | 6 +-- .../Fluid/Storage/Plant/Validation/package.mo | 4 ++ .../Storage/Plant/Validation/package.order | 3 ++ Buildings/Fluid/Storage/Plant/package.order | 1 + 11 files changed, 45 insertions(+), 42 deletions(-) rename Buildings/Fluid/Storage/Plant/{Examples => Validation}/ChillerAndTankNoRemoteCharging.mo (97%) rename Buildings/Fluid/Storage/Plant/{Examples => Validation}/ChillerAndTankWithRemoteCharging.mo (89%) rename Buildings/Fluid/Storage/Plant/{Examples => Validation}/DummyConsumer.mo (95%) create mode 100644 Buildings/Fluid/Storage/Plant/Validation/package.mo create mode 100644 Buildings/Fluid/Storage/Plant/Validation/package.order diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo index 267b9f96555..227764bca49 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo @@ -30,17 +30,6 @@ partial model ChillerAndTank final dp_nominal=dp_nominal, final m_flow_nominal=m1_flow_nominal) "Flow resistance on chiller branch" annotation (Placement(transformation(extent={{40,30},{60,50}}))); - Buildings.Fluid.Movers.BaseClasses.IdealSource pum1( - redeclare package Medium = Medium, - final dp_start=dp_nominal, - final m_flow_start=m1_flow_nominal, - final show_T=false, - final show_V_flow=false, - final control_m_flow=true, - final control_dp=false, - final allowFlowReversal=allowFlowReversal1, - final m_flow_small=m1_flow_nominal*1E-5) "Primary CHW pump" - annotation (Placement(transformation(extent={{-60,30},{-40,50}}))); Buildings.Fluid.FixedResistances.Junction jun1( redeclare package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, @@ -100,7 +89,7 @@ partial model ChillerAndTank T_a_nominal=T_CHWR_nominal, T_b_nominal=T_CHWS_nominal) "Ideal chiller" annotation (Placement(transformation(extent={{-10,30},{10,50}}))); - DummyChillSource ideTan( + Buildings.Fluid.Storage.Plant.DummyChillSource ideTan( redeclare package Medium = Medium, final allowFlowReversal=true, m_flow_nominal=m2_flow_nominal, @@ -108,11 +97,19 @@ partial model ChillerAndTank T_a_nominal=T_CHWR_nominal, T_b_nominal=T_CHWS_nominal) "Ideal tank" annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); + Buildings.Fluid.Movers.FlowControlled_m_flow pum1( + redeclare package Medium = Medium, + per(pressure(dp=dp_nominal*{2,1.2,0}, V_flow=m1_flow_nominal/1.2*{0,1.2,2})), + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + allowFlowReversal=true, + addPowerToMedium=false, + m_flow_nominal=m1_flow_nominal, + m_flow_start=m1_flow_nominal, + T_start=T_CHWR_nominal) "Primary CHW pump" + annotation (Placement(transformation(extent={{-60,30},{-40,50}}))); + equation - connect(pum1.port_a, jun1.port_2) annotation (Line(points={{-60,40},{-66,40},{ - -66,0},{-70,0}}, - color={0,127,255})); connect(preDro2.port_b, jun2.port_3) annotation (Line(points={{60,-60},{100,-60},{100,-10}}, color={0,127,255})); @@ -121,16 +118,18 @@ equation color={0,127,255})); connect(jun2.port_2, port_b) annotation (Line(points={{110,0},{140,0}}, color={0,127,255})); - connect(pum1.m_flow_in, set_mPum1_flow) annotation (Line(points={{-56,48},{-56, - 60},{-50,60},{-50,120}}, color={0,0,127})); - connect(pum1.port_b, ideChi.port_a) annotation (Line(points={{-40,40},{-28,40}, - {-28,40},{-10.2,40}}, color={0,127,255})); connect(ideChi.port_b, preDro1.port_a) annotation (Line(points={{10,40},{10,40}, {10,40},{40,40}}, color={0,127,255})); connect(ideTan.port_b, preDro2.port_a) annotation (Line(points={{10,-60},{40,-60}}, color={0,127,255})); connect(jun1.port_3, ideTan.port_a) annotation (Line(points={{-80,-10},{-80, -60},{-10.2,-60}}, color={0,127,255})); + connect(pum1.port_b, ideChi.port_a) + annotation (Line(points={{-40,40},{-10.2,40}}, color={0,127,255})); + connect(jun1.port_2, pum1.port_a) annotation (Line(points={{-70,0},{-64,0},{-64, + 40},{-60,40}}, color={0,127,255})); + connect(pum1.m_flow_in, set_mPum1_flow) + annotation (Line(points={{-50,52},{-50,120},{-50,120}}, color={0,0,127})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-180,-100},{140,100}})), diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo index 8af38ba61c1..a70bdf6c564 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo @@ -31,8 +31,8 @@ model ChillerAndTankNoRemoteCharging origin={-150,30}))); Modelica.Blocks.Interfaces.RealInput set_mPum2_flow "Secondary pump mass flow rate setpoint" annotation (Placement( - transformation(extent={{-204,58},{-180,82}}), iconTransformation(extent - ={{-120,50},{-100,70}}))); + transformation(extent={{-204,58},{-180,82}}), iconTransformation(extent= + {{-120,50},{-100,70}}))); equation connect(port_a, pum2.port_a) annotation (Line(points={{-180,0},{-140,0}}, color={0,127,255})); diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo index 004a562e353..e7724805aae 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo @@ -78,8 +78,8 @@ equation color={0,0,127})); connect(pum2Con.us_mTan_flow, set_mTan_flow) annotation (Line(points={{-141, 72.3},{-150,72.3},{-150,120}}, color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-180, - -100},{140,100}}), graphics={Line( + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, + {100,100}}), graphics={Line( points={{-80,-20},{-20,-20}}, color={28,108,200}, pattern=LinePattern.Dash), Polygon( @@ -87,6 +87,5 @@ equation fillColor={28,108,200}, fillPattern=FillPattern.Solid, pattern=LinePattern.None)}), Diagram( - coordinateSystem(preserveAspectRatio=false, extent={{-180,-100},{140, - 100}}))); + coordinateSystem(preserveAspectRatio=false, extent={{-180,-100},{140,100}}))); end ChillerAndTankWithRemoteCharging; diff --git a/Buildings/Fluid/Storage/Plant/Examples/package.mo b/Buildings/Fluid/Storage/Plant/Examples/package.mo index 8e21f5bfedd..27902f7ca63 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/package.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/package.mo @@ -1,4 +1,4 @@ within Buildings.Fluid.Storage.Plant; -package Examples "Collection of models that illustrate model use and test models" +package Examples "Package of example models" extends Modelica.Icons.ExamplesPackage; end Examples; diff --git a/Buildings/Fluid/Storage/Plant/Examples/package.order b/Buildings/Fluid/Storage/Plant/Examples/package.order index cb018233fd7..e69de29bb2d 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/package.order +++ b/Buildings/Fluid/Storage/Plant/Examples/package.order @@ -1,3 +0,0 @@ -ChillerAndTankNoRemoteCharging -ChillerAndTankWithRemoteCharging -DummyConsumer diff --git a/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo similarity index 97% rename from Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo rename to Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo index 580d2000585..85733620a4d 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo @@ -1,4 +1,4 @@ -within Buildings.Fluid.Storage.Plant.Examples; +within Buildings.Fluid.Storage.Plant.Validation; model ChillerAndTankNoRemoteCharging "(Draft)" extends Modelica.Icons.Example; diff --git a/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo similarity index 89% rename from Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankWithRemoteCharging.mo rename to Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo index 092fc825e20..606c804c344 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo @@ -1,4 +1,4 @@ -within Buildings.Fluid.Storage.Plant.Examples; +within Buildings.Fluid.Storage.Plant.Validation; model ChillerAndTankWithRemoteCharging "(Draft)" //Operation modes implemented in time tables: @@ -17,6 +17,7 @@ model ChillerAndTankWithRemoteCharging Buildings.Fluid.Storage.Plant.ChillerAndTankWithRemoteCharging cat( redeclare final package Medium=Medium, + pum1(m_flow_start=0), final m1_flow_nominal=1, final m2_flow_nominal=1, final p_CHWS_nominal=sin.p, @@ -51,10 +52,10 @@ model ChillerAndTankWithRemoteCharging "Tank flow rate setpoint" annotation (Placement(transformation(extent={{-80,60},{-60,80}}))); Modelica.Blocks.Sources.BooleanTable booFloDir(table={0,3600/7*6}) - "Flow direction" + "Flow direction (true = normal, false = reverse)" annotation (Placement(transformation(extent={{-80,20},{-60,40}}))); - Modelica.Blocks.Sources.BooleanTable booOnOffLin(table={0,3600/7*2}) - "Plant online/offline" + Modelica.Blocks.Sources.BooleanTable booOnOffLin(table={3600/7*2}) + "Plant online/offline (true = online, false = offline)" annotation (Placement(transformation(extent={{-80,-40},{-60,-20}}))); Modelica.Blocks.Sources.TimeTable set_mChi_flow(table=[0,0; 3600/7,0; 3600/7, 1; 3600/7*5,1; 3600/7*5,0]) "Chiller flow rate setpoint" @@ -62,12 +63,11 @@ model ChillerAndTankWithRemoteCharging equation connect(sou.ports[1], cat.port_a) annotation (Line(points={{-50,0},{-8,0}}, color={0,127,255})); - connect(cat.port_b, sin.ports[1]) annotation (Line(points={{12,0},{35,0},{35, - 4.44089e-16},{50,4.44089e-16}}, - color={0,127,255})); + connect(cat.port_b, sin.ports[1]) annotation (Line(points={{12,0},{35,0},{35,4.44089e-16}, + {50,4.44089e-16}}, color={0,127,255})); - connect(booOnOffLin.y, cat.onOffLin) annotation (Line(points={{-59,-30},{-20, - -30},{-20,-7},{-10,-7}}, + connect(booOnOffLin.y, cat.onOffLin) annotation (Line(points={{-59,-30},{-20,-30}, + {-20,-7},{-10,-7}}, color={255,0,255})); connect(booFloDir.y,cat.booFloDir) annotation (Line(points={{-59,30},{-20,30}, {-20,6},{-10,6},{-10,7}}, diff --git a/Buildings/Fluid/Storage/Plant/Examples/DummyConsumer.mo b/Buildings/Fluid/Storage/Plant/Validation/DummyConsumer.mo similarity index 95% rename from Buildings/Fluid/Storage/Plant/Examples/DummyConsumer.mo rename to Buildings/Fluid/Storage/Plant/Validation/DummyConsumer.mo index a3774187ea5..bf8b6163ee3 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/DummyConsumer.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/DummyConsumer.mo @@ -1,4 +1,4 @@ -within Buildings.Fluid.Storage.Plant.Examples; +within Buildings.Fluid.Storage.Plant.Validation; model DummyConsumer "Test model for the dummy consumer" extends Modelica.Icons.Example; @@ -54,8 +54,8 @@ model DummyConsumer "Test model for the dummy consumer" extent={{10,10},{-10,-10}}, rotation=180, origin={-70,0}))); - Modelica.Blocks.Sources.TimeTable preQCooLoa_flow(table=[0*3600,0; 0.5*3600,0; - 0.5*3600,5*4200*1.01; 0.75*3600,5*4200*1.01; 0.75*3600,0; 1*3600,0]) + Modelica.Blocks.Sources.TimeTable preQCooLoa_flow(table=[0*3600,0; 0.5*3600, + 0; 0.5*3600,5*4200*1.01; 0.75*3600,5*4200*1.01; 0.75*3600,0; 1*3600,0]) "Placeholder, prescribed cooling load" annotation (Placement(transformation(extent={{-60,80},{-40,100}}))); equation diff --git a/Buildings/Fluid/Storage/Plant/Validation/package.mo b/Buildings/Fluid/Storage/Plant/Validation/package.mo new file mode 100644 index 00000000000..063c31e80ca --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/Validation/package.mo @@ -0,0 +1,4 @@ +within Buildings.Fluid.Storage.Plant; +package Validation "Package of validation models" +extends Modelica.Icons.ExamplesPackage; +end Validation; diff --git a/Buildings/Fluid/Storage/Plant/Validation/package.order b/Buildings/Fluid/Storage/Plant/Validation/package.order new file mode 100644 index 00000000000..cb018233fd7 --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/Validation/package.order @@ -0,0 +1,3 @@ +ChillerAndTankNoRemoteCharging +ChillerAndTankWithRemoteCharging +DummyConsumer diff --git a/Buildings/Fluid/Storage/Plant/package.order b/Buildings/Fluid/Storage/Plant/package.order index a5fba913c00..de201a7e71a 100644 --- a/Buildings/Fluid/Storage/Plant/package.order +++ b/Buildings/Fluid/Storage/Plant/package.order @@ -3,4 +3,5 @@ ChillerAndTankWithRemoteCharging DummyChillSource DummyConsumer Examples +Validation BaseClasses From e3ff82a5052cd34ce10e29d5252e4aa1b8a75f0c Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Wed, 9 Feb 2022 16:02:45 -0800 Subject: [PATCH 014/463] reorganised nominal value declarations --- .../Fluid/Storage/Plant/DummyConsumer.mo | 28 +++++++++++++++++-- .../ChillerAndTankNoRemoteCharging.mo | 25 +++++++++++------ .../ChillerAndTankWithRemoteCharging.mo | 25 +++++++++++------ .../Storage/Plant/Validation/DummyConsumer.mo | 8 ++++-- 4 files changed, 65 insertions(+), 21 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/DummyConsumer.mo b/Buildings/Fluid/Storage/Plant/DummyConsumer.mo index 9f85d5f94e2..d0e5d173777 100644 --- a/Buildings/Fluid/Storage/Plant/DummyConsumer.mo +++ b/Buildings/Fluid/Storage/Plant/DummyConsumer.mo @@ -47,7 +47,7 @@ model DummyConsumer "Dummy consumer model" rotation=0))); Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor TCon "Temperature of the consumer" - annotation (Placement(transformation(extent={{40,-60},{20,-40}}))); + annotation (Placement(transformation(extent={{40,-40},{20,-20}}))); Buildings.Fluid.FixedResistances.PressureDrop preDro( redeclare package Medium = Medium, final allowFlowReversal=true, @@ -109,6 +109,18 @@ model DummyConsumer "Dummy consumer model" extent={{10,-10},{-10,10}}, rotation=-90, origin={-70,110}))); + Buildings.Fluid.Sensors.RelativePressure dpSen(redeclare package Medium = Medium) + "Differential pressure sensor" + annotation (Placement(transformation(extent={{-10,-60},{10,-40}}))); + Modelica.Blocks.Interfaces.RealOutput dp + "Differential pressure of the consumer" annotation (Placement( + transformation( + extent={{-20,-20},{20,20}}, + rotation=0, + origin={120,-70}), iconTransformation( + extent={{10,-10},{-10,10}}, + rotation=-90, + origin={-30,110}))); equation connect(valCon.port_b, vol.ports[1]) annotation (Line(points={{-60,0},{1,0}}, color={0,127,255})); @@ -116,7 +128,7 @@ equation annotation (Line(points={{42,90},{54,90},{54,-10},{10,-10}}, color={191,0,0})); connect(vol.heatPort, TCon.port) - annotation (Line(points={{10,-10},{54,-10},{54,-50},{40,-50}}, + annotation (Line(points={{10,-10},{54,-10},{54,-30},{40,-30}}, color={191,0,0})); connect(preDro.port_a, vol.ports[2]) annotation (Line(points={{60,0},{-1,0}}, color={0,127,255})); @@ -125,7 +137,7 @@ equation connect(gain.y, valCon.y) annotation (Line(points={{1,50},{6,50},{6,18},{-70,18},{-70,12}}, color={0,0,127})); - connect(TCon.T, conPI_valCon.u_m) annotation (Line(points={{19,-50},{-50,-50}, + connect(TCon.T, conPI_valCon.u_m) annotation (Line(points={{19,-30},{-50,-30}, {-50,38}}, color={0,0,127})); connect(valCon.port_a, port_a) annotation (Line(points={{-80,0},{-100,0}}, color={0,127,255})); @@ -137,6 +149,16 @@ equation annotation (Line(points={{-62,50},{-120,50}}, color={0,0,127})); connect(valCon.y_actual, yVal_actual) annotation (Line(points={{-65,7},{80,7}, {80,50},{120,50}}, color={0,0,127})); + connect(port_a, dpSen.port_a) annotation (Line( + points={{-100,0},{-100,-50},{-10,-50}}, + color={0,127,255}, + pattern=LinePattern.Dash)); + connect(dpSen.port_b, port_b) annotation (Line( + points={{10,-50},{100,-50},{100,0}}, + color={0,127,255}, + pattern=LinePattern.Dash)); + connect(dpSen.p_rel, dp) + annotation (Line(points={{0,-59},{0,-70},{120,-70}}, color={0,0,127})); annotation (Icon(graphics={Ellipse( extent={{-100,100},{100,-100}}, lineColor={28,108,200}, diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo index 85733620a4d..5b735e3401e 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo @@ -4,20 +4,29 @@ model ChillerAndTankNoRemoteCharging "(Draft)" package Medium = Buildings.Media.Water "Medium model"; + parameter Modelica.Units.SI.AbsolutePressure p_CHWS_nominal=800000 + "Nominal pressure of the CHW supply line"; + parameter Modelica.Units.SI.AbsolutePressure p_CHWR_nominal=300000 + "Nominal pressure of the CHW return line"; + parameter Modelica.Units.SI.Temperature T_CHWS_nominal=7+273.15 + "Nominal temperature of CHW supply"; + parameter Modelica.Units.SI.Temperature T_CHWR_nominal=12+273.15 + "Nominal temperature of CHW return"; + Buildings.Fluid.Storage.Plant.ChillerAndTankNoRemoteCharging cat( redeclare final package Medium=Medium, final m1_flow_nominal=1, final m2_flow_nominal=1, - final p_CHWS_nominal=sin.p, - final p_CHWR_nominal=sou.p, - final T_CHWS_nominal=sin.T, - final T_CHWR_nominal=sou.T) + final p_CHWS_nominal=p_CHWS_nominal, + final p_CHWR_nominal=p_CHWR_nominal, + final T_CHWS_nominal=T_CHWS_nominal, + final T_CHWR_nominal=T_CHWR_nominal) "Plant with chiller and tank" annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); Buildings.Fluid.Sources.Boundary_pT sou( redeclare final package Medium = Medium, - p=300000, - T=285.15, + final p=p_CHWR_nominal, + final T=T_CHWR_nominal, nPorts=1) "Source representing CHW return line" annotation (Placement(transformation( @@ -26,8 +35,8 @@ model ChillerAndTankNoRemoteCharging "(Draft)" origin={-60,0}))); Buildings.Fluid.Sources.Boundary_pT sin( redeclare final package Medium = Medium, - p=800000, - T=280.15, + final p=p_CHWS_nominal, + final T=T_CHWS_nominal, nPorts=1) "Sink representing CHW supply line" annotation (Placement(transformation( extent={{-10,10},{10,-10}}, diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo index 606c804c344..c2e4a100015 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo @@ -15,21 +15,30 @@ model ChillerAndTankWithRemoteCharging package Medium = Buildings.Media.Water "Medium model"; + parameter Modelica.Units.SI.AbsolutePressure p_CHWS_nominal=800000 + "Nominal pressure of the CHW supply line"; + parameter Modelica.Units.SI.AbsolutePressure p_CHWR_nominal=300000 + "Nominal pressure of the CHW return line"; + parameter Modelica.Units.SI.Temperature T_CHWS_nominal=7+273.15 + "Nominal temperature of CHW supply"; + parameter Modelica.Units.SI.Temperature T_CHWR_nominal=12+273.15 + "Nominal temperature of CHW return"; + Buildings.Fluid.Storage.Plant.ChillerAndTankWithRemoteCharging cat( redeclare final package Medium=Medium, pum1(m_flow_start=0), final m1_flow_nominal=1, final m2_flow_nominal=1, - final p_CHWS_nominal=sin.p, - final p_CHWR_nominal=sou.p, - final T_CHWS_nominal=sin.T, - final T_CHWR_nominal=sou.T) + final p_CHWS_nominal=p_CHWS_nominal, + final p_CHWR_nominal=p_CHWR_nominal, + final T_CHWS_nominal=T_CHWS_nominal, + final T_CHWR_nominal=T_CHWR_nominal) "Plant with chiller and tank" annotation (Placement(transformation(extent={{-8,-10},{12,10}}))); Buildings.Fluid.Sources.Boundary_pT sou( redeclare final package Medium = Medium, - p=300000, - T=285.15, + p=p_CHWR_nominal, + T=T_CHWR_nominal, nPorts=1) "Source, CHW return line" annotation (Placement(transformation( @@ -38,8 +47,8 @@ model ChillerAndTankWithRemoteCharging origin={-60,0}))); Buildings.Fluid.Sources.Boundary_pT sin( redeclare final package Medium = Medium, - p=800000, - T=280.15, + p=p_CHWS_nominal, + T=T_CHWS_nominal, nPorts=1) "Sink, CHW supply line" annotation (Placement(transformation( diff --git a/Buildings/Fluid/Storage/Plant/Validation/DummyConsumer.mo b/Buildings/Fluid/Storage/Plant/Validation/DummyConsumer.mo index bf8b6163ee3..658687f5edd 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/DummyConsumer.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/DummyConsumer.mo @@ -13,9 +13,13 @@ model DummyConsumer "Test model for the dummy consumer" "Nominal pressure at CHW supply line"; parameter Modelica.Units.SI.AbsolutePressure p_CHWR_nominal=300000 "Nominal pressure at CHW return line"; - parameter Modelica.Units.SI.Temperature T_CHWR_nominal=12+273.15 + parameter Modelica.Units.SI.Temperature T_CHWR_nominal( + final displayUnit="degC")= + 12+273.15 "Nominal temperature of CHW return"; - parameter Modelica.Units.SI.Temperature T_CHWS_nominal=7+273.15 + parameter Modelica.Units.SI.Temperature T_CHWS_nominal( + final displayUnit="degC")= + 7+273.15 "Nominal temperature of CHW supply"; parameter Boolean allowFlowReversal=false "Flow reversal setting"; From 4abd689fa510de67c40d34077c5f8fbedc268551 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Thu, 10 Feb 2022 08:30:02 -0800 Subject: [PATCH 015/463] moved no-reverse control block outside --- .../Plant/BaseClasses/ChillerAndTank.mo | 14 +++---- .../Plant/ChillerAndTankNoRemoteCharging.mo | 38 +++++++----------- .../Plant/ChillerAndTankWithRemoteCharging.mo | 27 +++++++------ .../Fluid/Storage/Plant/DummyConsumer.mo | 40 +++++++++---------- .../ChillerAndTankNoRemoteCharging.mo | 29 ++++++++++++-- .../ChillerAndTankWithRemoteCharging.mo | 13 +++--- 6 files changed, 87 insertions(+), 74 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo index 227764bca49..b2b126b541a 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo @@ -27,7 +27,7 @@ partial model ChillerAndTank Buildings.Fluid.FixedResistances.PressureDrop preDro1( redeclare package Medium = Medium, final allowFlowReversal=allowFlowReversal1, - final dp_nominal=dp_nominal, + final dp_nominal=dp_nominal/10, final m_flow_nominal=m1_flow_nominal) "Flow resistance on chiller branch" annotation (Placement(transformation(extent={{40,30},{60,50}}))); Buildings.Fluid.FixedResistances.Junction jun1( @@ -55,7 +55,7 @@ partial model ChillerAndTank Buildings.Fluid.FixedResistances.PressureDrop preDro2( redeclare package Medium = Medium, final allowFlowReversal=true, - final dp_nominal=dp_nominal, + final dp_nominal=dp_nominal/10, final m_flow_nominal=m2_flow_nominal) "Flow resistance on tank branch" annotation (Placement(transformation(extent={{40,-70},{60,-50}}))); Modelica.Fluid.Interfaces.FluidPort_a port_a( @@ -74,12 +74,12 @@ partial model ChillerAndTank iconTransformation(extent={{110,-10},{90,10}}))); Modelica.Blocks.Interfaces.RealInput set_mPum1_flow "Primary pump mass flow rate setpoint" annotation (Placement(transformation( - extent={{-20,-20},{20,20}}, - rotation=-90, - origin={-50,120}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={-30,110}))); + origin={-50,110}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-110,90}))); Buildings.Fluid.Storage.Plant.DummyChillSource ideChi( redeclare package Medium = Medium, @@ -129,7 +129,7 @@ equation connect(jun1.port_2, pum1.port_a) annotation (Line(points={{-70,0},{-64,0},{-64, 40},{-60,40}}, color={0,127,255})); connect(pum1.m_flow_in, set_mPum1_flow) - annotation (Line(points={{-50,52},{-50,120},{-50,120}}, color={0,0,127})); + annotation (Line(points={{-50,52},{-50,110}}, color={0,0,127})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-180,-100},{140,100}})), diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo index a70bdf6c564..7a002e618e4 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo @@ -16,36 +16,26 @@ model ChillerAndTankNoRemoteCharging extent={{-10,-10},{10,10}}, rotation=0, origin={-130,0}))); - Buildings.Controls.Continuous.LimPID conPIDPum2( - Td=1, - k=1, - Ti=15) "PI controller for the secondary pump" - annotation (Placement(transformation(extent={{10,10},{-10,-10}}, - rotation=180, - origin={-150,70}))); - Modelica.Blocks.Math.Gain gain2(k=1/m2_flow_nominal) "Gain" - annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, + Modelica.Blocks.Interfaces.RealInput yPum2 "Secondary pump speed input" + annotation (Placement(transformation(extent={{-204,58},{-180,82}}), + iconTransformation(extent={{-120,40},{-100,60}}))); + Modelica.Blocks.Interfaces.RealOutput m_flow "Mass flow rate" annotation ( + Dialog(group="Time varying output signal"), Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=90, + origin={-40,-110}),iconTransformation( + extent={{10,-10},{-10,10}}, rotation=90, - origin={-150,30}))); - Modelica.Blocks.Interfaces.RealInput set_mPum2_flow - "Secondary pump mass flow rate setpoint" annotation (Placement( - transformation(extent={{-204,58},{-180,82}}), iconTransformation(extent= - {{-120,50},{-100,70}}))); + origin={90,-110}))); equation connect(port_a, pum2.port_a) annotation (Line(points={{-180,0},{-140,0}}, color={0,127,255})); connect(pum2.port_b, jun1.port_1) annotation (Line(points={{-120,0},{-90,0}}, color={0,127,255})); - connect(gain2.y, conPIDPum2.u_m) - annotation (Line(points={{-150,41},{-150,58}}, color={0,0,127})); - connect(conPIDPum2.y, pum2.y) annotation (Line(points={{-139,70},{-130,70},{ - -130,12}}, color={0,0,127})); - connect(set_mPum2_flow, conPIDPum2.u_s) - annotation (Line(points={{-192,70},{-162,70}}, color={0,0,127})); - connect(ideTan.m_flow, gain2.u) annotation (Line(points={{-7,-49},{-8,-49},{-8, - -40},{-150,-40},{-150,18}}, color={0,0,127})); + connect(ideTan.m_flow, m_flow) annotation (Line(points={{-7,-49},{-7,-46},{ + -40,-46},{-40,-110}}, color={0,0,127})); + connect(pum2.y, yPum2) + annotation (Line(points={{-130,12},{-130,70},{-192,70}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,100}})), Diagram( coordinateSystem(preserveAspectRatio=false, extent={{-180,-100},{100,100}}))); diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo index e7724805aae..88297a3d66a 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo @@ -8,20 +8,20 @@ model ChillerAndTankWithRemoteCharging annotation (Placement(transformation(extent={{-140,58},{-120,80}}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanInput onOffLin "Plant online/offline signal, true = online, false = offline" annotation ( - Placement(transformation(extent={{-220,30},{-180,70}}), - iconTransformation(extent={{-140,-90},{-100,-50}}))); + Placement(transformation(extent={{-202,28},{-180,50}}), + iconTransformation(extent={{-140,-110},{-100,-70}}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanInput booFloDir "Flow direction, true = normal, false = reverse" annotation (Placement( - transformation(extent={{-220,70},{-180,110}}), iconTransformation( - extent={{-140,50},{-100,90}}))); + transformation(extent={{-202,68},{-180,90}}), iconTransformation( + extent={{-140,-70},{-100,-30}}))); Modelica.Blocks.Interfaces.RealInput set_mTan_flow "Tank mass flow rate setpoint" annotation (Placement(transformation( - extent={{-20,-20},{20,20}}, - rotation=-90, - origin={-150,120}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={-70,110}))); + origin={-160,110}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-110,50}))); Buildings.Fluid.Movers.SpeedControlled_y pum2( redeclare package Medium = Medium, @@ -53,10 +53,11 @@ model ChillerAndTankWithRemoteCharging m_flow_nominal=m2_flow_nominal) "Valve in parallel to the pump (reverse direction)" annotation (Placement(transformation(extent={{-120,-30},{-140,-10}}))); equation - connect(booFloDir, pum2Con.booFloDir) annotation (Line(points={{-200,90},{-160, - 90},{-160,65.7},{-142,65.7}}, color={255,0,255})); - connect(pum2Con.onOffLin, onOffLin) annotation (Line(points={{-142,61.3},{-142, - 50},{-200,50}}, color={255,0,255})); + connect(booFloDir, pum2Con.booFloDir) annotation (Line(points={{-191,79},{ + -172,79},{-172,65.7},{-142,65.7}}, color={255,0,255})); + connect(pum2Con.onOffLin, onOffLin) annotation (Line(points={{-142,61.3},{ + -142,62},{-160,62},{-160,39},{-191,39}}, + color={255,0,255})); connect(jun1.port_1, val2.port_a) annotation (Line(points={{-90,0},{-94,0},{-94, -20},{-120,-20}}, color={0,127,255})); connect(val2.port_b, port_a) annotation (Line(points={{-140,-20},{-164,-20},{-164, @@ -77,7 +78,7 @@ equation 76.7},{-142,76.7},{-142,78},{-170,78},{-170,-42},{-7,-42},{-7,-49}}, color={0,0,127})); connect(pum2Con.us_mTan_flow, set_mTan_flow) annotation (Line(points={{-141, - 72.3},{-150,72.3},{-150,120}}, color={0,0,127})); + 72.3},{-160,72.3},{-160,110}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,100}}), graphics={Line( points={{-80,-20},{-20,-20}}, diff --git a/Buildings/Fluid/Storage/Plant/DummyConsumer.mo b/Buildings/Fluid/Storage/Plant/DummyConsumer.mo index d0e5d173777..db85872fb91 100644 --- a/Buildings/Fluid/Storage/Plant/DummyConsumer.mo +++ b/Buildings/Fluid/Storage/Plant/DummyConsumer.mo @@ -29,7 +29,7 @@ model DummyConsumer "Dummy consumer model" annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow heaCon "Prescribed heat flow" - annotation (Placement(transformation(extent={{22,80},{42,100}}))); + annotation (Placement(transformation(extent={{22,70},{42,90}}))); Buildings.Fluid.MixingVolumes.MixingVolume vol( nPorts=2, final prescribedHeatFlowRate=true, @@ -64,12 +64,12 @@ model DummyConsumer "Dummy consumer model" transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-50,50}))); + origin={-50,60}))); Modelica.Blocks.Math.Gain gain(k=1) "Gain" annotation (Placement( transformation( extent={{10,-10},{-10,10}}, rotation=180, - origin={-10,50}))); + origin={-10,60}))); Modelica.Fluid.Interfaces.FluidPort_a port_a( p(start=p_a_nominal), redeclare package Medium = Medium, @@ -86,26 +86,26 @@ model DummyConsumer "Dummy consumer model" iconTransformation(extent={{110,-10},{90,10}}))); Modelica.Blocks.Interfaces.RealInput QCooLoa_flow "Cooling load of the consumer" annotation (Placement(transformation( - extent={{-20,-20},{20,20}}, + extent={{-10,-10},{10,10}}, rotation=0, - origin={-120,90}), iconTransformation( + origin={-110,80}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-110,90}))); Modelica.Blocks.Interfaces.RealInput TSet "CHW return setpoint" annotation ( Placement(transformation( - extent={{-20,-20},{20,20}}, + extent={{-10,-10},{10,10}}, rotation=0, - origin={-120,50}), iconTransformation( + origin={-110,60}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-110,50}))); Modelica.Blocks.Interfaces.RealOutput yVal_actual "Consumer control valve actuator position" annotation (Placement( transformation( - extent={{-20,-20},{20,20}}, + extent={{-10,-10},{10,10}}, rotation=0, - origin={120,50}), iconTransformation( + origin={110,40}), iconTransformation( extent={{10,-10},{-10,10}}, rotation=-90, origin={-70,110}))); @@ -115,9 +115,9 @@ model DummyConsumer "Dummy consumer model" Modelica.Blocks.Interfaces.RealOutput dp "Differential pressure of the consumer" annotation (Placement( transformation( - extent={{-20,-20},{20,20}}, + extent={{-10,-10},{10,10}}, rotation=0, - origin={120,-70}), iconTransformation( + origin={110,-80}), iconTransformation( extent={{10,-10},{-10,10}}, rotation=-90, origin={-30,110}))); @@ -125,7 +125,7 @@ equation connect(valCon.port_b, vol.ports[1]) annotation (Line(points={{-60,0},{1,0}}, color={0,127,255})); connect(heaCon.port, vol.heatPort) - annotation (Line(points={{42,90},{54,90},{54,-10},{10,-10}}, + annotation (Line(points={{42,80},{54,80},{54,-10},{10,-10}}, color={191,0,0})); connect(vol.heatPort, TCon.port) annotation (Line(points={{10,-10},{54,-10},{54,-30},{40,-30}}, @@ -133,22 +133,20 @@ equation connect(preDro.port_a, vol.ports[2]) annotation (Line(points={{60,0},{-1,0}}, color={0,127,255})); connect(conPI_valCon.y, gain.u) - annotation (Line(points={{-39,50},{-22,50}}, color={0,0,127})); + annotation (Line(points={{-39,60},{-22,60}}, color={0,0,127})); connect(gain.y, valCon.y) - annotation (Line(points={{1,50},{6,50},{6,18},{-70,18},{-70,12}}, + annotation (Line(points={{1,60},{6,60},{6,18},{-70,18},{-70,12}}, color={0,0,127})); connect(TCon.T, conPI_valCon.u_m) annotation (Line(points={{19,-30},{-50,-30}, - {-50,38}}, color={0,0,127})); + {-50,48}}, color={0,0,127})); connect(valCon.port_a, port_a) annotation (Line(points={{-80,0},{-100,0}}, color={0,127,255})); connect(preDro.port_b, port_b) annotation (Line(points={{80,0},{100,0}}, color={0,127,255})); connect(heaCon.Q_flow, QCooLoa_flow) - annotation (Line(points={{22,90},{-120,90}}, color={0,0,127})); + annotation (Line(points={{22,80},{-110,80}}, color={0,0,127})); connect(conPI_valCon.u_s, TSet) - annotation (Line(points={{-62,50},{-120,50}}, color={0,0,127})); - connect(valCon.y_actual, yVal_actual) annotation (Line(points={{-65,7},{80,7}, - {80,50},{120,50}}, color={0,0,127})); + annotation (Line(points={{-62,60},{-110,60}}, color={0,0,127})); connect(port_a, dpSen.port_a) annotation (Line( points={{-100,0},{-100,-50},{-10,-50}}, color={0,127,255}, @@ -158,7 +156,9 @@ equation color={0,127,255}, pattern=LinePattern.Dash)); connect(dpSen.p_rel, dp) - annotation (Line(points={{0,-59},{0,-70},{120,-70}}, color={0,0,127})); + annotation (Line(points={{0,-59},{0,-80},{110,-80}}, color={0,0,127})); + connect(valCon.y_actual, yVal_actual) + annotation (Line(points={{-65,7},{-65,40},{110,40}}, color={0,0,127})); annotation (Icon(graphics={Ellipse( extent={{-100,100},{100,-100}}, lineColor={28,108,200}, diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo index 5b735e3401e..404d319c55e 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo @@ -45,10 +45,25 @@ model ChillerAndTankNoRemoteCharging "(Draft)" Modelica.Blocks.Sources.TimeTable set_mPum2_flow(table=[0*3600,1; 0.25*3600,1; 0.25*3600,-1; 0.5*3600,-1; 0.5*3600,0; 0.75*3600,0; 0.75*3600,1; 1*3600, 1]) "Secondary mass flow rate setpoint" - annotation (Placement(transformation(extent={{-70,20},{-50,40}}))); + annotation (Placement(transformation(extent={{-70,-80},{-50,-60}}))); Modelica.Blocks.Sources.Constant set_mPum1_flow(k=cat.m1_flow_nominal) "Primary pump mass flow rate setpoint" annotation (Placement(transformation(extent={{-70,60},{-50,80}}))); + Buildings.Controls.Continuous.LimPID conPID_Pum2( + Td=1, + k=1, + Ti=15) "PI controller for the secondary pump" annotation (Placement( + transformation( + extent={{10,10},{-10,-10}}, + rotation=270, + origin={-40,-30}))); + Modelica.Blocks.Math.Gain gain2(k=1/cat.m2_flow_nominal) + "Gain" + annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={-10,-30}))); equation connect(sou.ports[1], cat.port_a) annotation (Line(points={{-50,0},{-10,0}}, color={0,127,255})); @@ -56,10 +71,16 @@ equation 4.44089e-16},{50,4.44089e-16}}, color={0,127,255})); - connect(set_mPum2_flow.y, cat.set_mPum2_flow) annotation (Line(points={{-49, - 30},{-16,30},{-16,6},{-11,6}}, color={0,0,127})); connect(set_mPum1_flow.y, cat.set_mPum1_flow) - annotation (Line(points={{-49,70},{-3,70},{-3,11}}, color={0,0,127})); + annotation (Line(points={{-49,70},{-11,70},{-11,9}},color={0,0,127})); + connect(gain2.y, conPID_Pum2.u_m) + annotation (Line(points={{-21,-30},{-28,-30}}, color={0,0,127})); + connect(cat.m_flow, gain2.u) annotation (Line(points={{9,-11},{8,-11},{8,-30}, + {2,-30}}, color={0,0,127})); + connect(set_mPum2_flow.y, conPID_Pum2.u_s) + annotation (Line(points={{-49,-70},{-40,-70},{-40,-42}}, color={0,0,127})); + connect(conPID_Pum2.y, cat.yPum2) + annotation (Line(points={{-40,-19},{-40,5},{-11,5}}, color={0,0,127})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo index c2e4a100015..8b4bf7a2137 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo @@ -75,16 +75,17 @@ equation connect(cat.port_b, sin.ports[1]) annotation (Line(points={{12,0},{35,0},{35,4.44089e-16}, {50,4.44089e-16}}, color={0,127,255})); - connect(booOnOffLin.y, cat.onOffLin) annotation (Line(points={{-59,-30},{-20,-30}, - {-20,-7},{-10,-7}}, + connect(booOnOffLin.y, cat.onOffLin) annotation (Line(points={{-59,-30},{-20, + -30},{-20,-9},{-10,-9}}, color={255,0,255})); - connect(booFloDir.y,cat.booFloDir) annotation (Line(points={{-59,30},{-20,30}, - {-20,6},{-10,6},{-10,7}}, + connect(booFloDir.y,cat.booFloDir) annotation (Line(points={{-59,30},{-40,30}, + {-40,-4},{-10,-4},{-10,-5}}, color={255,0,255})); connect(set_mTan_flow.y, cat.set_mTan_flow) - annotation (Line(points={{-59,70},{-5,70},{-5,11}}, color={0,0,127})); + annotation (Line(points={{-59,70},{-32,70},{-32,4},{-10,4},{-10,5},{-9,5}}, + color={0,0,127})); connect(set_mChi_flow.y, cat.set_mPum1_flow) - annotation (Line(points={{-19,90},{-1,90},{-1,11}}, color={0,0,127})); + annotation (Line(points={{-19,90},{-9,90},{-9,9}}, color={0,0,127})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), From 156527443d6673a8aa2f0a9756b35abe1179cb96 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Thu, 10 Feb 2022 10:01:20 -0800 Subject: [PATCH 016/463] one source one user example model --- .../Plant/ChillerAndTankNoRemoteCharging.mo | 11 +- .../Plant/Examples/OneSourceOneUser.mo | 117 ++++++++++++++++++ .../Storage/Plant/Examples/package.order | 1 + .../ChillerAndTankNoRemoteCharging.mo | 5 +- 4 files changed, 126 insertions(+), 8 deletions(-) create mode 100644 Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo index 7a002e618e4..56fd14ebf4e 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo @@ -19,11 +19,12 @@ model ChillerAndTankNoRemoteCharging Modelica.Blocks.Interfaces.RealInput yPum2 "Secondary pump speed input" annotation (Placement(transformation(extent={{-204,58},{-180,82}}), iconTransformation(extent={{-120,40},{-100,60}}))); - Modelica.Blocks.Interfaces.RealOutput m_flow "Mass flow rate" annotation ( - Dialog(group="Time varying output signal"), Placement(transformation( + Modelica.Blocks.Interfaces.RealOutput mTan_flow + "Mass flow rate through the tank" annotation (Dialog(group= + "Time varying output signal"), Placement(transformation( extent={{10,-10},{-10,10}}, rotation=90, - origin={-40,-110}),iconTransformation( + origin={-40,-110}), iconTransformation( extent={{10,-10},{-10,10}}, rotation=90, origin={90,-110}))); @@ -32,8 +33,8 @@ equation annotation (Line(points={{-180,0},{-140,0}}, color={0,127,255})); connect(pum2.port_b, jun1.port_1) annotation (Line(points={{-120,0},{-90,0}}, color={0,127,255})); - connect(ideTan.m_flow, m_flow) annotation (Line(points={{-7,-49},{-7,-46},{ - -40,-46},{-40,-110}}, color={0,0,127})); + connect(ideTan.m_flow, mTan_flow) annotation (Line(points={{-7,-49},{-7,-46}, + {-40,-46},{-40,-110}}, color={0,0,127})); connect(pum2.y, yPum2) annotation (Line(points={{-130,12},{-130,70},{-192,70}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo new file mode 100644 index 00000000000..a60a498f3a9 --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo @@ -0,0 +1,117 @@ +within Buildings.Fluid.Storage.Plant.Examples; +model OneSourceOneUser "District system with one source and one user" + extends Modelica.Icons.Example; + + package Medium = Buildings.Media.Water "Medium model"; + + parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=1 + "Nominal mass flow rate"; + parameter Modelica.Units.SI.PressureDifference dp_nominal= + p_CHWS_nominal-p_CHWR_nominal + "Nominal pressure difference"; + parameter Modelica.Units.SI.AbsolutePressure p_CHWS_nominal=800000 + "Nominal pressure at CHW supply line"; + parameter Modelica.Units.SI.AbsolutePressure p_CHWR_nominal=300000 + "Nominal pressure at CHW return line"; + parameter Modelica.Units.SI.Temperature T_CHWR_nominal=12+273.15 + "Nominal temperature of CHW return"; + parameter Modelica.Units.SI.Temperature T_CHWS_nominal=7+273.15 + "Nominal temperature of CHW supply"; + parameter Boolean allowFlowReversal=false + "Flow reversal setting"; + + Buildings.Fluid.Storage.Plant.ChillerAndTankNoRemoteCharging cat( + redeclare final package Medium=Medium, + final m1_flow_nominal=m_flow_nominal/2, + final m2_flow_nominal=m_flow_nominal/2, + final p_CHWS_nominal=p_CHWS_nominal, + final p_CHWR_nominal=p_CHWR_nominal, + final T_CHWS_nominal=T_CHWS_nominal, + final T_CHWR_nominal=T_CHWR_nominal) + "Chiller and tank" + annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); + Buildings.Fluid.Storage.Plant.DummyConsumer con( + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal, + dp_nominal=dp_nominal*0.3, + p_a_nominal=p_CHWS_nominal-dp_nominal*0.35, + p_b_nominal=p_CHWR_nominal+dp_nominal*0.35, + T_a_nominal=T_CHWS_nominal, + T_b_nominal=T_CHWR_nominal) + "Consumer" + annotation (Placement(transformation(extent={{40,-10},{60,10}}))); + Modelica.Blocks.Sources.Constant set_TRet(k=12 + 273.15) + "CHW return setpoint" + annotation (Placement(transformation(extent={{-20,40},{0,60}}))); + Modelica.Blocks.Sources.TimeTable preQCooLoa_flow(table=[0*3600,0; 0.5*3600,0; + 0.5*3600,5*4200*1.01; 0.75*3600,5*4200*1.01; 0.75*3600,0; 1*3600,0]) + "Placeholder, prescribed cooling load" + annotation (Placement(transformation(extent={{0,80},{20,100}}))); + Modelica.Blocks.Sources.Constant set_mPum1_flow(k=m_flow_nominal/2) + "Primary pump mass flow rate setpoint" + annotation (Placement(transformation(extent={{-100,80},{-80,100}}))); + Controls.Continuous.LimPID conPI_pum2( + controllerType=Modelica.Blocks.Types.SimpleController.PI, + Td=1, + k=1, + Ti=100, + reverseActing=true) + "PI controller for pum2" annotation (Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=270, + origin={-90,-60}))); + FixedResistances.PressureDrop preDro1( + redeclare package Medium = Medium, + final allowFlowReversal=true, + final dp_nominal=dp_nominal*0.3, + final m_flow_nominal=m_flow_nominal) "Flow resistance of the consumer" + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + FixedResistances.PressureDrop preDro2( + redeclare package Medium = Medium, + final allowFlowReversal=true, + final dp_nominal=dp_nominal*0.3, + final m_flow_nominal=m_flow_nominal) "Flow resistance of the consumer" + annotation (Placement(transformation(extent={{10,-50},{-10,-30}}))); + Modelica.Blocks.Sources.Constant set_dpCon(k=1) + "Normalised consumer differential pressure setpoint" + annotation (Placement(transformation(extent={{-60,-100},{-80,-80}}))); + Buildings.Fluid.Sources.Boundary_pT sou_p( + redeclare final package Medium = Medium, + final p=p_CHWR_nominal, + final T=T_CHWR_nominal, + nPorts=1) "Pressurisation point" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-90,30}))); + Modelica.Blocks.Math.Gain gaiPum2(k=1/con.dp_nominal) "Gain" annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={-50,-60}))); +equation + connect(set_TRet.y, con.TSet) + annotation (Line(points={{1,50},{32,50},{32,5},{39,5}}, color={0,0,127})); + connect(preQCooLoa_flow.y, con.QCooLoa_flow) + annotation (Line(points={{21,90},{34,90},{34,9},{39,9}}, color={0,0,127})); + connect(set_mPum1_flow.y, cat.set_mPum1_flow) + annotation (Line(points={{-79,90},{-61,90},{-61,9}}, color={0,0,127})); + connect(cat.port_b, preDro1.port_a) + annotation (Line(points={{-40,0},{-10,0}}, color={0,127,255})); + connect(preDro1.port_b, con.port_a) + annotation (Line(points={{10,0},{39.8,0}}, color={0,127,255})); + connect(con.port_b, preDro2.port_a) + annotation (Line(points={{60,0},{60,-40},{10,-40}}, color={0,127,255})); + connect(preDro2.port_b, cat.port_a) + annotation (Line(points={{-10,-40},{-60,-40},{-60,0}}, color={0,127,255})); + connect(set_dpCon.y, conPI_pum2.u_s) + annotation (Line(points={{-81,-90},{-90,-90},{-90,-72}}, color={0,0,127})); + connect(sou_p.ports[1], cat.port_a) annotation (Line(points={{-80,30},{-74,30}, + {-74,0},{-60,0}}, color={0,127,255})); + connect(con.dp, gaiPum2.u) annotation (Line(points={{47,11},{46,11},{46,16},{64, + 16},{64,-60},{-38,-60}}, color={0,0,127})); + connect(gaiPum2.y, conPI_pum2.u_m) + annotation (Line(points={{-61,-60},{-78,-60}}, color={0,0,127})); + connect(conPI_pum2.y, cat.yPum2) + annotation (Line(points={{-90,-49},{-90,5},{-61,5}}, color={0,0,127})); + annotation(experiment(Tolerance=1e-06, StopTime=3600)); +end OneSourceOneUser; diff --git a/Buildings/Fluid/Storage/Plant/Examples/package.order b/Buildings/Fluid/Storage/Plant/Examples/package.order index e69de29bb2d..b3d2db285c9 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/package.order +++ b/Buildings/Fluid/Storage/Plant/Examples/package.order @@ -0,0 +1 @@ +OneSourceOneUser diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo index 404d319c55e..409d54cb1dd 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo @@ -57,8 +57,7 @@ model ChillerAndTankNoRemoteCharging "(Draft)" extent={{10,10},{-10,-10}}, rotation=270, origin={-40,-30}))); - Modelica.Blocks.Math.Gain gain2(k=1/cat.m2_flow_nominal) - "Gain" + Modelica.Blocks.Math.Gain gain2(k=1/cat.m2_flow_nominal) "Gain" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, @@ -75,7 +74,7 @@ equation annotation (Line(points={{-49,70},{-11,70},{-11,9}},color={0,0,127})); connect(gain2.y, conPID_Pum2.u_m) annotation (Line(points={{-21,-30},{-28,-30}}, color={0,0,127})); - connect(cat.m_flow, gain2.u) annotation (Line(points={{9,-11},{8,-11},{8,-30}, + connect(cat.mTan_flow, gain2.u) annotation (Line(points={{9,-11},{8,-11},{8,-30}, {2,-30}}, color={0,0,127})); connect(set_mPum2_flow.y, conPID_Pum2.u_s) annotation (Line(points={{-49,-70},{-40,-70},{-40,-42}}, color={0,0,127})); From 90e2260ca39eb2ea1774a6938433126e44a0416f Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Thu, 10 Feb 2022 10:50:24 -0800 Subject: [PATCH 017/463] primary pump hysteresis --- .../Plant/BaseClasses/ChillerAndTank.mo | 2 +- .../Fluid/Storage/Plant/DummyChillSource.mo | 2 +- .../Fluid/Storage/Plant/DummyConsumer.mo | 5 +- .../Plant/Examples/OneSourceOneUser.mo | 66 +++++++++++++------ .../ChillerAndTankWithRemoteCharging.mo | 20 +++--- 5 files changed, 62 insertions(+), 33 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo index b2b126b541a..65279b8c96a 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo @@ -104,7 +104,7 @@ partial model ChillerAndTank allowFlowReversal=true, addPowerToMedium=false, m_flow_nominal=m1_flow_nominal, - m_flow_start=m1_flow_nominal, + m_flow_start=0, T_start=T_CHWR_nominal) "Primary CHW pump" annotation (Placement(transformation(extent={{-60,30},{-40,50}}))); diff --git a/Buildings/Fluid/Storage/Plant/DummyChillSource.mo b/Buildings/Fluid/Storage/Plant/DummyChillSource.mo index b4492e2d98c..b4ed1904e80 100644 --- a/Buildings/Fluid/Storage/Plant/DummyChillSource.mo +++ b/Buildings/Fluid/Storage/Plant/DummyChillSource.mo @@ -1,6 +1,6 @@ within Buildings.Fluid.Storage.Plant; model DummyChillSource - "An ideal chill (or heat) source that always turns the fluid passing through to the prescribed state" + "An ideal chill (or heat if flow direction reversed) source that always sets the fluid passing through to the prescribed enthalpy" replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium in the component"; diff --git a/Buildings/Fluid/Storage/Plant/DummyConsumer.mo b/Buildings/Fluid/Storage/Plant/DummyConsumer.mo index db85872fb91..6b29e906e68 100644 --- a/Buildings/Fluid/Storage/Plant/DummyConsumer.mo +++ b/Buildings/Fluid/Storage/Plant/DummyConsumer.mo @@ -1,6 +1,9 @@ within Buildings.Fluid.Storage.Plant; model DummyConsumer "Dummy consumer model" - +/* +For simplification, instead of setting up a heat exchanger to a room model, +the consumer control valve simply tracks the return CHW temperature. +*/ replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium in the component"; diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo index a60a498f3a9..0604d208abb 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo @@ -1,5 +1,14 @@ within Buildings.Fluid.Storage.Plant.Examples; -model OneSourceOneUser "District system with one source and one user" +model OneSourceOneUser "(Draft) District system with one source and one user" +/* +- Controls - + Primary pump: + Tracks consumer control valve position con.yVal, + closes at y.Val < 0.05, + reopens at y.Val > 0.5. + Secondary pump: + Maintains constant consumer pressure head con.dp. +*/ extends Modelica.Icons.Example; package Medium = Buildings.Media.Water "Medium model"; @@ -42,14 +51,11 @@ model OneSourceOneUser "District system with one source and one user" annotation (Placement(transformation(extent={{40,-10},{60,10}}))); Modelica.Blocks.Sources.Constant set_TRet(k=12 + 273.15) "CHW return setpoint" - annotation (Placement(transformation(extent={{-20,40},{0,60}}))); + annotation (Placement(transformation(extent={{0,20},{20,40}}))); Modelica.Blocks.Sources.TimeTable preQCooLoa_flow(table=[0*3600,0; 0.5*3600,0; 0.5*3600,5*4200*1.01; 0.75*3600,5*4200*1.01; 0.75*3600,0; 1*3600,0]) "Placeholder, prescribed cooling load" - annotation (Placement(transformation(extent={{0,80},{20,100}}))); - Modelica.Blocks.Sources.Constant set_mPum1_flow(k=m_flow_nominal/2) - "Primary pump mass flow rate setpoint" - annotation (Placement(transformation(extent={{-100,80},{-80,100}}))); + annotation (Placement(transformation(extent={{0,50},{20,70}}))); Controls.Continuous.LimPID conPI_pum2( controllerType=Modelica.Blocks.Types.SimpleController.PI, Td=1, @@ -59,7 +65,7 @@ model OneSourceOneUser "District system with one source and one user" "PI controller for pum2" annotation (Placement(transformation( extent={{10,10},{-10,-10}}, rotation=270, - origin={-90,-60}))); + origin={-70,-60}))); FixedResistances.PressureDrop preDro1( redeclare package Medium = Medium, final allowFlowReversal=true, @@ -74,7 +80,9 @@ model OneSourceOneUser "District system with one source and one user" annotation (Placement(transformation(extent={{10,-50},{-10,-30}}))); Modelica.Blocks.Sources.Constant set_dpCon(k=1) "Normalised consumer differential pressure setpoint" - annotation (Placement(transformation(extent={{-60,-100},{-80,-80}}))); + annotation (Placement(transformation(extent={{10,-10},{-10,10}}, + rotation=-90, + origin={-70,-90}))); Buildings.Fluid.Sources.Boundary_pT sou_p( redeclare final package Medium = Medium, final p=p_CHWR_nominal, @@ -82,19 +90,29 @@ model OneSourceOneUser "District system with one source and one user" nPorts=1) "Pressurisation point" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-90,30}))); + origin={-90,0}))); Modelica.Blocks.Math.Gain gaiPum2(k=1/con.dp_nominal) "Gain" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, - origin={-50,-60}))); + origin={-40,-60}))); + Controls.OBC.CDL.Continuous.Hysteresis hysPum1(uLow=0.05, uHigh=0.5) + "Primary pump shuts off at con.yVal = 0.05 and restarts at 0.5" annotation ( + Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=90, + origin={-70,62}))); + Controls.OBC.CDL.Conversions.BooleanToReal booToReaPum1(realTrue= + m_flow_nominal/2) "Primary pump signal" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-70,30}))); equation connect(set_TRet.y, con.TSet) - annotation (Line(points={{1,50},{32,50},{32,5},{39,5}}, color={0,0,127})); + annotation (Line(points={{21,30},{32,30},{32,5},{39,5}},color={0,0,127})); connect(preQCooLoa_flow.y, con.QCooLoa_flow) - annotation (Line(points={{21,90},{34,90},{34,9},{39,9}}, color={0,0,127})); - connect(set_mPum1_flow.y, cat.set_mPum1_flow) - annotation (Line(points={{-79,90},{-61,90},{-61,9}}, color={0,0,127})); + annotation (Line(points={{21,60},{34,60},{34,9},{39,9}}, color={0,0,127})); connect(cat.port_b, preDro1.port_a) annotation (Line(points={{-40,0},{-10,0}}, color={0,127,255})); connect(preDro1.port_b, con.port_a) @@ -104,14 +122,20 @@ equation connect(preDro2.port_b, cat.port_a) annotation (Line(points={{-10,-40},{-60,-40},{-60,0}}, color={0,127,255})); connect(set_dpCon.y, conPI_pum2.u_s) - annotation (Line(points={{-81,-90},{-90,-90},{-90,-72}}, color={0,0,127})); - connect(sou_p.ports[1], cat.port_a) annotation (Line(points={{-80,30},{-74,30}, - {-74,0},{-60,0}}, color={0,127,255})); - connect(con.dp, gaiPum2.u) annotation (Line(points={{47,11},{46,11},{46,16},{64, - 16},{64,-60},{-38,-60}}, color={0,0,127})); + annotation (Line(points={{-70,-79},{-70,-72}}, color={0,0,127})); + connect(sou_p.ports[1], cat.port_a) annotation (Line(points={{-80,0},{-60,0}}, + color={0,127,255})); + connect(con.dp, gaiPum2.u) annotation (Line(points={{47,11},{46,11},{46,20},{70, + 20},{70,-60},{-28,-60}}, color={0,0,127})); connect(gaiPum2.y, conPI_pum2.u_m) - annotation (Line(points={{-61,-60},{-78,-60}}, color={0,0,127})); + annotation (Line(points={{-51,-60},{-58,-60}}, color={0,0,127})); connect(conPI_pum2.y, cat.yPum2) - annotation (Line(points={{-90,-49},{-90,5},{-61,5}}, color={0,0,127})); + annotation (Line(points={{-70,-49},{-70,5},{-61,5}}, color={0,0,127})); + connect(hysPum1.y, booToReaPum1.u) + annotation (Line(points={{-70,50},{-70,42}}, color={255,0,255})); + connect(booToReaPum1.y, cat.set_mPum1_flow) + annotation (Line(points={{-70,18},{-70,9},{-61,9}}, color={0,0,127})); + connect(hysPum1.u, con.yVal_actual) annotation (Line(points={{-70,74},{-70,80}, + {43,80},{43,11}}, color={0,0,127})); annotation(experiment(Tolerance=1e-06, StopTime=3600)); end OneSourceOneUser; diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo index 8b4bf7a2137..3dc7815d8fa 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo @@ -1,15 +1,17 @@ within Buildings.Fluid.Storage.Plant.Validation; model ChillerAndTankWithRemoteCharging "(Draft)" - //Operation modes implemented in time tables: - // plant | chiller | tank | flow direction | tank flow rate - // 1. offline off off N/A 0 - // 2. offline on charging N/A -1 - // 3. online on charging normal -1 - // 4. online on off normal 0 - // 5. online on discharging normal 1 - // 6. online off discharging normal 1 - // 7. online off charging reverse -1 +/* + Operation modes implemented in time tables: + plant | chiller | tank | flow direction | tank flow rate + 1. offline off off N/A 0 + 2. offline on charging N/A -1 + 3. online on charging normal -1 + 4. online on off normal 0 + 5. online on discharging normal 1 + 6. online off discharging normal 1 + 7. online off charging reverse -1 +*/ extends Modelica.Icons.Example; From 5ee58fb09b01104bbd69d1a2dbe4ca1004569b49 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Thu, 10 Feb 2022 13:52:43 -0800 Subject: [PATCH 018/463] parameterisation adjustments --- .../Plant/BaseClasses/ChillerAndTank.mo | 15 +++++++++++++-- .../Plant/ChillerAndTankNoRemoteCharging.mo | 11 ----------- .../Fluid/Storage/Plant/DummyConsumer.mo | 14 +++++++++----- .../Plant/Examples/OneSourceOneUser.mo | 19 +++++++++++-------- .../ChillerAndTankWithRemoteCharging.mo | 1 - .../Storage/Plant/Validation/DummyConsumer.mo | 1 - 6 files changed, 33 insertions(+), 28 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo index 65279b8c96a..193b382a129 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo @@ -36,8 +36,8 @@ partial model ChillerAndTank m_flow_nominal={m1_flow_nominal+m2_flow_nominal, -m1_flow_nominal,-m2_flow_nominal}, dp_nominal={0,0,0}, - T_start=T_CHWR_nominal) - "Junction near the return line" annotation (Placement(transformation( + T_start=T_CHWR_nominal) "Junction near the return line" + annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-80,0}))); @@ -108,6 +108,15 @@ partial model ChillerAndTank T_start=T_CHWR_nominal) "Primary CHW pump" annotation (Placement(transformation(extent={{-60,30},{-40,50}}))); + Modelica.Blocks.Interfaces.RealOutput mTan_flow + "Mass flow rate through the tank" annotation (Dialog(group= + "Time varying output signal"), Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=90, + origin={-40,-110}), iconTransformation( + extent={{10,-10},{-10,10}}, + rotation=90, + origin={90,-110}))); equation connect(preDro2.port_b, jun2.port_3) @@ -130,6 +139,8 @@ equation 40},{-60,40}}, color={0,127,255})); connect(pum1.m_flow_in, set_mPum1_flow) annotation (Line(points={{-50,52},{-50,110}}, color={0,0,127})); + connect(ideTan.m_flow,mTan_flow) annotation (Line(points={{-7,-49},{-7,-46}, + {-40,-46},{-40,-110}}, color={0,0,127})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-180,-100},{140,100}})), diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo index 56fd14ebf4e..47203391ce2 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo @@ -19,22 +19,11 @@ model ChillerAndTankNoRemoteCharging Modelica.Blocks.Interfaces.RealInput yPum2 "Secondary pump speed input" annotation (Placement(transformation(extent={{-204,58},{-180,82}}), iconTransformation(extent={{-120,40},{-100,60}}))); - Modelica.Blocks.Interfaces.RealOutput mTan_flow - "Mass flow rate through the tank" annotation (Dialog(group= - "Time varying output signal"), Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=90, - origin={-40,-110}), iconTransformation( - extent={{10,-10},{-10,10}}, - rotation=90, - origin={90,-110}))); equation connect(port_a, pum2.port_a) annotation (Line(points={{-180,0},{-140,0}}, color={0,127,255})); connect(pum2.port_b, jun1.port_1) annotation (Line(points={{-120,0},{-90,0}}, color={0,127,255})); - connect(ideTan.m_flow, mTan_flow) annotation (Line(points={{-7,-49},{-7,-46}, - {-40,-46},{-40,-110}}, color={0,0,127})); connect(pum2.y, yPum2) annotation (Line(points={{-130,12},{-130,70},{-192,70}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, diff --git a/Buildings/Fluid/Storage/Plant/DummyConsumer.mo b/Buildings/Fluid/Storage/Plant/DummyConsumer.mo index 6b29e906e68..2dd31e2ca8a 100644 --- a/Buildings/Fluid/Storage/Plant/DummyConsumer.mo +++ b/Buildings/Fluid/Storage/Plant/DummyConsumer.mo @@ -9,9 +9,6 @@ the consumer control valve simply tracks the return CHW temperature. parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=1 "Nominal mass flow rate"; - parameter Modelica.Units.SI.PressureDifference dp_nominal= - p_a_nominal-p_b_nominal - "Nominal pressure difference"; parameter Modelica.Units.SI.AbsolutePressure p_a_nominal=800000 "Nominal pressure of the CHW supply line"; parameter Modelica.Units.SI.AbsolutePressure p_b_nominal=300000 @@ -22,13 +19,17 @@ the consumer control valve simply tracks the return CHW temperature. "Nominal temperature of CHW return"; parameter Boolean allowFlowReversal=false "Flow reversal setting on chiller branch"; + final parameter Modelica.Units.SI.PressureDifference dp_nominal= + p_a_nominal-p_b_nominal + "Nominal pressure difference"; Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valCon( redeclare package Medium = Medium, use_inputFilter=false, l=1E-10, dpValve_nominal=1, - m_flow_nominal=m_flow_nominal) "Consumer control valve" + m_flow_nominal=m_flow_nominal, + y_start=0) "Consumer control valve" annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow heaCon "Prescribed heat flow" @@ -166,5 +167,8 @@ equation extent={{-100,100},{100,-100}}, lineColor={28,108,200}, fillColor={244,125,35}, - fillPattern=FillPattern.Sphere)})); + fillPattern=FillPattern.Sphere), Text( + extent={{-58,-104},{62,-132}}, + textColor={0,0,127}, + textString="%name")})); end DummyConsumer; diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo index 0604d208abb..d53c6887fe3 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo @@ -1,13 +1,17 @@ within Buildings.Fluid.Storage.Plant.Examples; model OneSourceOneUser "(Draft) District system with one source and one user" -/* -- Controls - +/* +- Controls - Primary pump: Tracks consumer control valve position con.yVal, closes at y.Val < 0.05, reopens at y.Val > 0.5. Secondary pump: Maintains constant consumer pressure head con.dp. +- Pressure - + Assuming the plant takes 10% of total pressure head, + supply and return pipes 30% each, + consumer 30%. */ extends Modelica.Icons.Example; @@ -42,7 +46,6 @@ model OneSourceOneUser "(Draft) District system with one source and one user" Buildings.Fluid.Storage.Plant.DummyConsumer con( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, - dp_nominal=dp_nominal*0.3, p_a_nominal=p_CHWS_nominal-dp_nominal*0.35, p_b_nominal=p_CHWR_nominal+dp_nominal*0.35, T_a_nominal=T_CHWS_nominal, @@ -56,7 +59,7 @@ model OneSourceOneUser "(Draft) District system with one source and one user" 0.5*3600,5*4200*1.01; 0.75*3600,5*4200*1.01; 0.75*3600,0; 1*3600,0]) "Placeholder, prescribed cooling load" annotation (Placement(transformation(extent={{0,50},{20,70}}))); - Controls.Continuous.LimPID conPI_pum2( + Buildings.Controls.Continuous.LimPID conPI_pum2( controllerType=Modelica.Blocks.Types.SimpleController.PI, Td=1, k=1, @@ -66,13 +69,13 @@ model OneSourceOneUser "(Draft) District system with one source and one user" extent={{10,10},{-10,-10}}, rotation=270, origin={-70,-60}))); - FixedResistances.PressureDrop preDro1( + Buildings.Fluid.FixedResistances.PressureDrop preDro1( redeclare package Medium = Medium, final allowFlowReversal=true, final dp_nominal=dp_nominal*0.3, final m_flow_nominal=m_flow_nominal) "Flow resistance of the consumer" annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - FixedResistances.PressureDrop preDro2( + Buildings.Fluid.FixedResistances.PressureDrop preDro2( redeclare package Medium = Medium, final allowFlowReversal=true, final dp_nominal=dp_nominal*0.3, @@ -96,13 +99,13 @@ model OneSourceOneUser "(Draft) District system with one source and one user" extent={{-10,-10},{10,10}}, rotation=180, origin={-40,-60}))); - Controls.OBC.CDL.Continuous.Hysteresis hysPum1(uLow=0.05, uHigh=0.5) + Buildings.Controls.OBC.CDL.Continuous.Hysteresis hysPum1(uLow=0.05, uHigh=0.5) "Primary pump shuts off at con.yVal = 0.05 and restarts at 0.5" annotation ( Placement(transformation( extent={{10,-10},{-10,10}}, rotation=90, origin={-70,62}))); - Controls.OBC.CDL.Conversions.BooleanToReal booToReaPum1(realTrue= + Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToReaPum1(realTrue= m_flow_nominal/2) "Primary pump signal" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo index 3dc7815d8fa..67cf5a255e6 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo @@ -28,7 +28,6 @@ model ChillerAndTankWithRemoteCharging Buildings.Fluid.Storage.Plant.ChillerAndTankWithRemoteCharging cat( redeclare final package Medium=Medium, - pum1(m_flow_start=0), final m1_flow_nominal=1, final m2_flow_nominal=1, final p_CHWS_nominal=p_CHWS_nominal, diff --git a/Buildings/Fluid/Storage/Plant/Validation/DummyConsumer.mo b/Buildings/Fluid/Storage/Plant/Validation/DummyConsumer.mo index 658687f5edd..e8d9657933b 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/DummyConsumer.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/DummyConsumer.mo @@ -28,7 +28,6 @@ model DummyConsumer "Test model for the dummy consumer" redeclare package Medium = Medium, vol(T_start=15+273.15), m_flow_nominal=m_flow_nominal, - dp_nominal=p_CHWS_nominal - p_CHWR_nominal, p_a_nominal=p_CHWS_nominal, p_b_nominal=p_CHWR_nominal, T_a_nominal=T_CHWS_nominal, From 73f5b5a664a66762b827b8749ba5c58aac4ccf39 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Thu, 10 Feb 2022 16:04:17 -0800 Subject: [PATCH 019/463] draft two-source-three-user model --- .../BaseClasses/ReversiblePumpValveControl.mo | 65 ++-- .../Fluid/Storage/Plant/DummyChillSource.mo | 2 +- .../Fluid/Storage/Plant/DummyConsumer.mo | 2 +- .../Examples/BaseClasses/PumChi1Control.mo | 79 +++++ .../Plant/Examples/BaseClasses/package.mo | 4 + .../Plant/Examples/BaseClasses/package.order | 1 + .../Plant/Examples/OneSourceOneUser.mo | 2 +- .../Plant/Examples/TwoSourcesThreeUsers.mo | 298 ++++++++++++++++++ .../Storage/Plant/Examples/package.order | 2 + 9 files changed, 420 insertions(+), 35 deletions(-) create mode 100644 Buildings/Fluid/Storage/Plant/Examples/BaseClasses/PumChi1Control.mo create mode 100644 Buildings/Fluid/Storage/Plant/Examples/BaseClasses/package.mo create mode 100644 Buildings/Fluid/Storage/Plant/Examples/BaseClasses/package.order create mode 100644 Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo index 5294e70f9e5..ddbc836662d 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo @@ -47,21 +47,21 @@ block ReversiblePumpValveControl origin={-20,30}))); Controls.OBC.CDL.Interfaces.BooleanInput booFloDir "Flow direction, true = normal, false = reverse" annotation (Placement( - transformation(extent={{-140,-10},{-100,30}}), iconTransformation( + transformation(extent={{-120,0},{-100,20}}), iconTransformation( extent={{-140,-50},{-100,-10}}))); Modelica.Blocks.Interfaces.RealInput us_mTan_flow "Tank mass flow rate setpoint" annotation (Placement(transformation( - extent={{-20,-20},{20,20}}, + extent={{-10,-10},{10,10}}, rotation=-90, - origin={-70,120}), iconTransformation( + origin={-70,110}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-110,30}))); Modelica.Blocks.Interfaces.RealInput um_mTan_flow "Measured tank mass flow rate" annotation (Placement(transformation( - extent={{-20,-20},{20,20}}, + extent={{-10,-10},{10,10}}, rotation=-90, - origin={-10,120}), iconTransformation( + origin={0,110}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-110,70}))); @@ -82,29 +82,29 @@ block ReversiblePumpValveControl origin={70,-80}))); Controls.OBC.CDL.Interfaces.BooleanInput onOffLin "Plant online/offline signal, true = online, false = offline" annotation ( - Placement(transformation(extent={{-140,-100},{-100,-60}}), + Placement(transformation(extent={{-120,-90},{-100,-70}}), iconTransformation(extent={{-140,-90},{-100,-50}}))); Modelica.Blocks.Interfaces.RealOutput yPum2 "Normalised speed" annotation ( Placement(transformation( - extent={{-20,-20},{20,20}}, + extent={{-10,-10},{10,10}}, rotation=-90, - origin={-10,-120}), iconTransformation( + origin={-10,-110}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={-10,-110}))); Modelica.Blocks.Interfaces.RealOutput yVal2 "Valve position" annotation ( Placement(transformation( - extent={{-20,-20},{20,20}}, + extent={{-10,-10},{10,10}}, rotation=-90, - origin={30,-120}), iconTransformation( + origin={30,-110}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={30,-110}))); Modelica.Blocks.Interfaces.RealOutput yVal1 "Valve position" annotation ( Placement(transformation( - extent={{-20,-20},{20,20}}, + extent={{-10,-10},{10,10}}, rotation=-90, - origin={70,-120}), iconTransformation( + origin={70,-110}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={70,-110}))); @@ -137,15 +137,9 @@ equation connect(conZero.y,swiFloDirVal2. u1) annotation (Line(points={{-79,-50},{-10,-50}, {-10,-22},{-2,-22}}, color={0,0,127})); - connect(booFloDir,swiFloDirPum2. u2) annotation (Line(points={{-120,10},{-56,10}, - {-56,-30},{-52,-30}}, + connect(booFloDir,swiFloDirPum2. u2) annotation (Line(points={{-110,10},{-62, + 10},{-62,-30},{-52,-30}}, color={255,0,255})); - connect(booFloDir,swiFloDirVal2. u2) annotation (Line(points={{-120,10},{-6,10}, - {-6,-30},{-2,-30}}, - color={255,0,255})); - connect(booFloDir,swiFloDirVal1. u2) annotation (Line(points={{-120,10},{46,10}, - {46,-30},{48,-30}}, - color={255,0,255})); connect(conPI_pum2.y,gaiPum2. u) annotation (Line(points={{-70,49},{-70,42}}, color={0,0,127})); connect(gaiPum2.y,swiFloDirPum2. u1) @@ -157,27 +151,34 @@ equation annotation (Line(points={{-20,19},{-20,-38},{-2,-38}}, color={0,0,127})); connect(conPI_pum2.u_s, us_mTan_flow) - annotation (Line(points={{-70,72},{-70,120}}, color={0,0,127})); - connect(conPI_val2.u_s, us_mTan_flow) annotation (Line(points={{-20,72},{-20, - 94},{-70,94},{-70,120}}, color={0,0,127})); - connect(conPI_val2.u_m, um_mTan_flow) annotation (Line(points={{-8,60},{-2, - 60},{-2,96},{-10,96},{-10,120}}, color={0,0,127})); - connect(conPI_pum2.u_m, um_mTan_flow) annotation (Line(points={{-58,60},{-52, - 60},{-52,96},{-10,96},{-10,120}}, color={0,0,127})); + annotation (Line(points={{-70,72},{-70,110}}, color={0,0,127})); + connect(conPI_val2.u_s, us_mTan_flow) annotation (Line(points={{-20,72},{ + -20,80},{-70,80},{-70,110}}, + color={0,0,127})); + connect(conPI_val2.u_m, um_mTan_flow) annotation (Line(points={{-8,60},{0, + 60},{0,110}}, color={0,0,127})); + connect(conPI_pum2.u_m, um_mTan_flow) annotation (Line(points={{-58,60},{ + -50,60},{-50,90},{0,90},{0,110}}, color={0,0,127})); connect(swiOnOff.u2, onOffLin) - annotation (Line(points={{-62,-80},{-120,-80}}, color={255,0,255})); + annotation (Line(points={{-62,-80},{-110,-80}}, color={255,0,255})); connect(swiOnOff.y, minPum2.u2) annotation (Line(points={{-38,-80},{-34,-80},{ -34,-56},{-16,-56},{-16,-68}}, color={0,0,127})); connect(swiOnOff.y, minVal2.u2) annotation (Line(points={{-38,-80},{-34,-80},{ -34,-56},{24,-56},{24,-68}}, color={0,0,127})); connect(swiOnOff.y, minVal1.u2) annotation (Line(points={{-38,-80},{-34,-80},{ -34,-56},{64,-56},{64,-68}}, color={0,0,127})); - connect(minPum2.y, yPum2) annotation (Line(points={{-10,-92},{-10,-106},{-10,-106}, - {-10,-120}}, color={0,0,127})); + connect(minPum2.y, yPum2) annotation (Line(points={{-10,-92},{-10,-110}}, + color={0,0,127})); connect(minVal2.y, yVal2) - annotation (Line(points={{30,-92},{30,-120}}, color={0,0,127})); + annotation (Line(points={{30,-92},{30,-110}}, color={0,0,127})); connect(minVal1.y, yVal1) - annotation (Line(points={{70,-92},{70,-120}}, color={0,0,127})); + annotation (Line(points={{70,-92},{70,-110}}, color={0,0,127})); + connect(swiFloDirVal2.u2, booFloDir) annotation (Line(points={{-2,-30},{-6, + -30},{-6,10},{-110,10}}, color={255,0,255})); + connect(swiFloDirVal1.u2, booFloDir) annotation (Line(points={{48,-30},{44, + -30},{44,10},{-110,10}}, color={255,0,255})); + connect(yVal1, yVal1) + annotation (Line(points={{70,-110},{70,-110}}, color={0,0,127})); annotation (Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), Icon( coordinateSystem(extent={{-100,-100},{100,100}}))); end ReversiblePumpValveControl; diff --git a/Buildings/Fluid/Storage/Plant/DummyChillSource.mo b/Buildings/Fluid/Storage/Plant/DummyChillSource.mo index b4ed1904e80..75863c62409 100644 --- a/Buildings/Fluid/Storage/Plant/DummyChillSource.mo +++ b/Buildings/Fluid/Storage/Plant/DummyChillSource.mo @@ -66,7 +66,7 @@ model DummyChillSource h_outflow(start=Medium.h_default, nominal=Medium.h_default)) "Fluid connector a (positive design flow direction is from port_a to port_b)" annotation (Placement(transformation(extent={{-110,-10},{-90,10}}), - iconTransformation(extent={{-112,-10},{-92,10}}))); + iconTransformation(extent={{-110,-10},{-90,10}}))); Modelica.Fluid.Interfaces.FluidPort_b port_b( p(start=p_nominal), redeclare package Medium = Medium, diff --git a/Buildings/Fluid/Storage/Plant/DummyConsumer.mo b/Buildings/Fluid/Storage/Plant/DummyConsumer.mo index 2dd31e2ca8a..f2bcbbc39d9 100644 --- a/Buildings/Fluid/Storage/Plant/DummyConsumer.mo +++ b/Buildings/Fluid/Storage/Plant/DummyConsumer.mo @@ -80,7 +80,7 @@ the consumer control valve simply tracks the return CHW temperature. h_outflow(start=Medium.h_default, nominal=Medium.h_default)) "Fluid connector a (positive design flow direction is from port_a to port_b)" annotation (Placement(transformation(extent={{-110,-10},{-90,10}}), - iconTransformation(extent={{-112,-10},{-92,10}}))); + iconTransformation(extent={{-110,-10},{-90,10}}))); Modelica.Fluid.Interfaces.FluidPort_b port_b( p(start=p_b_nominal), redeclare package Medium = Medium, diff --git a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/PumChi1Control.mo b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/PumChi1Control.mo new file mode 100644 index 00000000000..d4df4bc9ac9 --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/PumChi1Control.mo @@ -0,0 +1,79 @@ +within Buildings.Fluid.Storage.Plant.Examples.BaseClasses; +block PumChi1Control + "Control block" + extends Modelica.Blocks.Icons.Block; + + Buildings.Controls.Continuous.LimPID conPI( + controllerType=Modelica.Blocks.Types.SimpleController.PI, + Td=1, + k=1, + Ti=100, + reverseActing=true) "PI controller" annotation (Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=180, + origin={-30,40}))); + Buildings.Controls.OBC.CDL.Continuous.Hysteresis hysPum1(uLow=0.05, + uHigh=0.5) + "Primary pump shuts off at con.yVal = 0.05 and restarts at 0.5" annotation ( + Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=180, + origin={-70,-40}))); + Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToReaPum1(realTrue= + 1) "Primary pump signal" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-30,-40}))); + Modelica.Blocks.Interfaces.RealInput us_dpCon + "Consumer pressure head setpoint" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-110,40}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-110,60}))); + Modelica.Blocks.Interfaces.RealInput um_dpCon + "Measured consumer pressure head" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-110,0}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-110,0}))); + Modelica.Blocks.Interfaces.RealInput yVal "Valve position" annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-110,-40}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-110,-60}))); + Buildings.Controls.OBC.CDL.Continuous.Min min "Turn-off signal overrides" annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={50,0}))); + Modelica.Blocks.Interfaces.RealOutput y "Normalised pump speed" annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={110,0}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={110,0}))); +equation + connect(conPI.u_s, us_dpCon) + annotation (Line(points={{-42,40},{-110,40}}, color={0,0,127})); + connect(hysPum1.u, yVal) + annotation (Line(points={{-82,-40},{-110,-40}}, color={0,0,127})); + connect(hysPum1.y, booToReaPum1.u) + annotation (Line(points={{-58,-40},{-42,-40}}, color={255,0,255})); + connect(conPI.y, min.u1) annotation (Line(points={{-19,40},{32,40},{32,6},{38, + 6}}, color={0,0,127})); + connect(booToReaPum1.y, min.u2) annotation (Line(points={{-18,-40},{32,-40},{32, + -6},{38,-6}}, color={0,0,127})); + connect(min.y, y) annotation (Line(points={{62,0},{110,0}}, color={0,0,127})); + connect(conPI.u_m, um_dpCon) + annotation (Line(points={{-30,28},{-30,0},{-110,0}}, color={0,0,127})); +end PumChi1Control; diff --git a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/package.mo b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/package.mo new file mode 100644 index 00000000000..0c66df2af12 --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/package.mo @@ -0,0 +1,4 @@ +within Buildings.Fluid.Storage.Plant.Examples; +package BaseClasses "Package with base classes" +extends Modelica.Icons.BasesPackage; +end BaseClasses; diff --git a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/package.order b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/package.order new file mode 100644 index 00000000000..41ba515620b --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/package.order @@ -0,0 +1 @@ +PumChi1Control diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo index d53c6887fe3..06b41139ab0 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo @@ -119,7 +119,7 @@ equation connect(cat.port_b, preDro1.port_a) annotation (Line(points={{-40,0},{-10,0}}, color={0,127,255})); connect(preDro1.port_b, con.port_a) - annotation (Line(points={{10,0},{39.8,0}}, color={0,127,255})); + annotation (Line(points={{10,0},{40,0}}, color={0,127,255})); connect(con.port_b, preDro2.port_a) annotation (Line(points={{60,0},{60,-40},{10,-40}}, color={0,127,255})); connect(preDro2.port_b, cat.port_a) diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo new file mode 100644 index 00000000000..e124c3f9b96 --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -0,0 +1,298 @@ +within Buildings.Fluid.Storage.Plant.Examples; +model TwoSourcesThreeUsers + "(Draft) District model with two sources and three users" + extends Modelica.Icons.Example; + + package Medium = Buildings.Media.Water "Medium model"; + + parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=1 + "Nominal mass flow rate"; + parameter Modelica.Units.SI.PressureDifference dp_nominal= + p_CHWS_nominal-p_CHWR_nominal + "Nominal pressure difference"; + parameter Modelica.Units.SI.AbsolutePressure p_CHWS_nominal=800000 + "Nominal pressure at CHW supply line"; + parameter Modelica.Units.SI.AbsolutePressure p_CHWR_nominal=300000 + "Nominal pressure at CHW return line"; + parameter Modelica.Units.SI.Temperature T_CHWR_nominal=12+273.15 + "Nominal temperature of CHW return"; + parameter Modelica.Units.SI.Temperature T_CHWS_nominal=7+273.15 + "Nominal temperature of CHW supply"; + parameter Boolean allowFlowReversal=false + "Flow reversal setting"; + + + Buildings.Fluid.Storage.Plant.DummyChillSource chi1( + redeclare final package Medium = Medium, + allowFlowReversal=true, + m_flow_nominal=m_flow_nominal, + p_nominal=p_CHWR_nominal, + T_a_nominal=T_CHWR_nominal, + T_b_nominal=T_CHWS_nominal) "Dummy chill source as chiller 1" annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={-60,40}))); + Buildings.Fluid.Storage.Plant.ChillerAndTankWithRemoteCharging cat( + redeclare final package Medium=Medium, + final m1_flow_nominal=1, + final m2_flow_nominal=1, + final p_CHWS_nominal=p_CHWS_nominal, + final p_CHWR_nominal=p_CHWR_nominal, + final T_CHWS_nominal=T_CHWS_nominal, + final T_CHWR_nominal=T_CHWR_nominal) + "Chiller and tank, tank can be charged remotely" + annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + rotation=90, + origin={-60,-60}))); + Buildings.Fluid.Storage.Plant.DummyConsumer con1( + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal, + p_a_nominal=p_CHWS_nominal-dp_nominal*0.35, + p_b_nominal=p_CHWR_nominal+dp_nominal*0.35, + T_a_nominal=T_CHWS_nominal, + T_b_nominal=T_CHWR_nominal) + "Dummy consumer 1" + annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + rotation=-90, + origin={60,60}))); + Buildings.Fluid.Storage.Plant.DummyConsumer con2( + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal, + p_a_nominal=p_CHWS_nominal - dp_nominal*0.35, + p_b_nominal=p_CHWR_nominal + dp_nominal*0.35, + T_a_nominal=T_CHWS_nominal, + T_b_nominal=T_CHWR_nominal) + "Dummy consumer 1" + annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + rotation=-90, + origin={60,0}))); + Buildings.Fluid.Storage.Plant.DummyConsumer con3( + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal, + p_a_nominal=p_CHWS_nominal - dp_nominal*0.35, + p_b_nominal=p_CHWR_nominal + dp_nominal*0.35, + T_a_nominal=T_CHWS_nominal, + T_b_nominal=T_CHWR_nominal) + "Dummy consumer 1" + annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + rotation=-90, + origin={60,-60}))); + Buildings.Fluid.FixedResistances.Junction junCHWS1( + redeclare package Medium = Medium, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + m_flow_nominal=m_flow_nominal*{1.5,-1,-0.5}, + dp_nominal=dp_nominal*{0,-0.3,-0.3}, + T_start=T_CHWR_nominal) "Junction one supply line" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-20,80}))); + Buildings.Fluid.FixedResistances.Junction junCHWS3( + redeclare package Medium = Medium, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + m_flow_nominal=m_flow_nominal*{1.5,-1,-0.5}, + dp_nominal=dp_nominal*{0,-0.3,-0.3}, + T_start=T_CHWR_nominal) "Junction on supply line" annotation (Placement( + transformation( + extent={{-10,10},{10,-10}}, + rotation=0, + origin={-20,-40}))); + Buildings.Fluid.FixedResistances.Junction junCHWS2( + redeclare package Medium = Medium, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + m_flow_nominal=m_flow_nominal*{0.5,-1,0.5}, + dp_nominal={0,0,0}, + T_start=T_CHWR_nominal) "Junction on supply line" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-20,20}))); + Buildings.Fluid.FixedResistances.Junction junCHWR1( + redeclare package Medium = Medium, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + m_flow_nominal=m_flow_nominal*{1,-1.5,-0.5}, + dp_nominal=dp_nominal*{0.3,0,-0.3}, + T_start=T_CHWR_nominal) "Junction on return line" annotation (Placement( + transformation( + extent={{10,-10},{-10,10}}, + rotation=0, + origin={20,40}))); + Buildings.Fluid.FixedResistances.Junction junCHWR2( + redeclare package Medium = Medium, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + m_flow_nominal=m_flow_nominal*{1,-0.5,-0.5}, + dp_nominal=dp_nominal*{0,0,0}, + T_start=T_CHWR_nominal) "Junction on return line" annotation (Placement( + transformation( + extent={{10,10},{-10,-10}}, + rotation=0, + origin={20,-20}))); + Buildings.Fluid.FixedResistances.Junction junCHWR3( + redeclare package Medium = Medium, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + m_flow_nominal=m_flow_nominal*{1,-1.5,0.5}, + dp_nominal=dp_nominal*{0.3,0,0.3}, + T_start=T_CHWR_nominal) "Junction on return line" annotation (Placement( + transformation( + extent={{10,10},{-10,-10}}, + rotation=0, + origin={20,-80}))); + Buildings.Fluid.Movers.SpeedControlled_y pumChi1( + redeclare package Medium = Medium, + per(pressure(dp=dp_nominal*{2,1.2,0}, V_flow=(m_flow_nominal)/1.2*{0,1.2,2})), + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + allowFlowReversal=true, + addPowerToMedium=false, + y_start=0, + T_start=T_CHWR_nominal) "Supply pump for chiller 1" annotation (Placement( + transformation(extent={{-70,70},{-50,90}}, rotation=0))); + Buildings.Controls.OBC.CDL.Continuous.MultiMin mulMin_dpCon(nin=3) + "Min of pressure head measured from all consumers" + annotation (Placement(transformation(extent={{-10,160},{-30,180}}))); + Modelica.Blocks.Sources.Constant set_dpCon(k=1) + "Normalised consumer differential pressure setpoint" + annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-90,150}))); + Buildings.Fluid.Storage.Plant.Examples.BaseClasses.PumChi1Control conPumChi1 + "Control block" annotation (Placement( + transformation( + extent={{-10,10},{10,-10}}, + rotation=-90, + origin={-60,110}))); + Buildings.Controls.OBC.CDL.Continuous.MultiMax mulMax_yVal12(nin=2) + "Max of valve position measured from consumers 1 and 2" + annotation (Placement(transformation(extent={{-20,120},{-40,140}}))); + Modelica.Blocks.Sources.Constant set_TRet(k=12 + 273.15) + "CHW return setpoint" + annotation (Placement(transformation(extent={{10,110},{30,130}}))); + Modelica.Blocks.Sources.TimeTable preQ1CooLoa_flow(table=[0*3600,0; 0.25*3600, + 0; 0.25*3600,5*4200*1.01; 0.75*3600,5*4200*1.01; 0.75*3600,0; 1*3600,0]) + "Placeholder, prescribed cooling load" + annotation (Placement(transformation(extent={{120,80},{100,100}}))); + Modelica.Blocks.Sources.TimeTable preQ2CooLoa_flow(table=[0*3600,0; 0.25*3600, + 0; 0.25*3600,5*4200*1.01; 0.5*3600,5*4200*1.01; 0.5*3600,0; 1*3600,0]) + "Placeholder, prescribed cooling load" + annotation (Placement(transformation(extent={{120,20},{100,40}}))); + Modelica.Blocks.Sources.TimeTable preQ3CooLoa_flow(table=[0*3600,0; 0.75*3600, + 0; 0.75*3600,5*4200*1.01; 1*3600,5*4200*1.01]) + "Placeholder, prescribed cooling load" + annotation (Placement(transformation(extent={{120,-40},{100,-20}}))); + Controls.OBC.CDL.Continuous.Hysteresis hysCat(uLow=0.05, uHigh=0.5) + "Shut off at con.yVal = 0.05 and restarts at 0.5" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={10,-110}))); + Controls.OBC.CDL.Continuous.MultiMax mulMax_yVal23(nin=2) + "Max of valve position measured from consumers 2 and 3" + annotation (Placement(transformation(extent={{60,-120},{40,-100}}))); + Modelica.Blocks.Sources.BooleanConstant booFloDir + "Placeholder, constant normal direction" + annotation (Placement(transformation(extent={{-20,-140},{-40,-120}}))); + Modelica.Blocks.Sources.Constant set_mTan_flow(k=0) + "Placeholder, tank flow rate setpoint" + annotation (Placement(transformation(extent={{-100,-140},{-80,-120}}))); + Modelica.Blocks.Sources.Constant set_mChi2_flow(k=m_flow_nominal) + "Placeholder, chiller 2 flow rate setpoint" + annotation (Placement(transformation(extent={{-100,-100},{-80,-80}}))); + Modelica.Blocks.Math.Gain gai(k=1/con1.dp_nominal) "Gain" annotation ( + Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=90, + origin={-60,150}))); + Sources.Boundary_pT sou_p( + redeclare final package Medium = Medium, + final p=p_CHWR_nominal, + final T=T_CHWR_nominal, + nPorts=1) "Pressurisation point" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-70,0}))); +equation + connect(junCHWS1.port_2, con1.port_a) + annotation (Line(points={{-10,80},{60,80},{60,70}}, color={0,127,255})); + connect(cat.port_b, junCHWS3.port_1) annotation (Line(points={{-60,-50},{-60,-40}, + {-30,-40}}, color={0,127,255})); + connect(junCHWS3.port_3, junCHWS2.port_3) + annotation (Line(points={{-20,-30},{-20,10}}, color={0,127,255})); + connect(junCHWS1.port_3, junCHWS2.port_1) annotation (Line(points={{-20,70},{-20, + 56},{-34,56},{-34,20},{-30,20}}, color={0,127,255})); + connect(junCHWS2.port_2, con2.port_a) + annotation (Line(points={{-10,20},{60,20},{60,10}}, color={0,127,255})); + connect(junCHWS3.port_2, con3.port_a) annotation (Line(points={{-10,-40},{60,-40}, + {60,-50}}, color={0,127,255})); + connect(con1.port_b, junCHWR1.port_1) + annotation (Line(points={{60,50},{60,40},{30,40}}, color={0,127,255})); + connect(junCHWR1.port_2, chi1.port_a) + annotation (Line(points={{10,40},{-50,40}}, color={0,127,255})); + connect(con3.port_b, junCHWR3.port_1) + annotation (Line(points={{60,-70},{60,-80},{30,-80}}, color={0,127,255})); + connect(junCHWR3.port_2, cat.port_a) annotation (Line(points={{10,-80},{-60,-80}, + {-60,-70}}, color={0,127,255})); + connect(con2.port_b, junCHWR2.port_1) + annotation (Line(points={{60,-10},{60,-20},{30,-20}}, color={0,127,255})); + connect(junCHWR3.port_3, junCHWR2.port_2) annotation (Line(points={{20,-70},{20, + -50},{2,-50},{2,-20},{10,-20}}, color={0,127,255})); + connect(junCHWR2.port_3, junCHWR1.port_3) + annotation (Line(points={{20,-10},{20,30}}, color={0,127,255})); + connect(chi1.port_b, pumChi1.port_a) + annotation (Line(points={{-70,40},{-80,40},{-80,80},{-70,80}}, + color={0,127,255})); + connect(pumChi1.port_b, junCHWS1.port_1) + annotation (Line(points={{-50,80},{-30,80}}, color={0,127,255})); + connect(con1.dp, mulMin_dpCon.u[1]) annotation (Line(points={{71,63},{80,63}, + {80,100},{0,100},{0,169.333},{-8,169.333}}, + color={0,0,127})); + connect(con2.dp, mulMin_dpCon.u[2]) annotation (Line(points={{71,3},{80,3},{80, + 100},{0,100},{0,170},{-8,170}}, + color={0,0,127})); + connect(set_dpCon.y, conPumChi1.us_dpCon) annotation (Line(points={{-90,139},{ + -90,126},{-66,126},{-66,121}}, color={0,0,127})); + connect(mulMax_yVal12.y, conPumChi1.yVal) + annotation (Line(points={{-42,130},{-54,130},{-54,121}}, color={0,0,127})); + connect(conPumChi1.y, pumChi1.y) + annotation (Line(points={{-60,99},{-60,92}}, color={0,0,127})); + connect(con1.yVal_actual, mulMax_yVal12.u[1]) annotation (Line(points={{71,67}, + {76,67},{76,94},{-10,94},{-10,129.5},{-18,129.5}}, color={0,0,127})); + connect(con2.yVal_actual, mulMax_yVal12.u[2]) annotation (Line(points={{71,7}, + {76,7},{76,94},{-10,94},{-10,130.5},{-18,130.5}}, color={0,0,127})); + connect(con3.dp, mulMin_dpCon.u[3]) annotation (Line(points={{71,-57},{80,-57}, + {80,100},{0,100},{0,170.667},{-8,170.667}}, color={0,0,127})); + connect(set_TRet.y, con1.TSet) annotation (Line(points={{31,120},{36,120},{36, + 76},{65,76},{65,71}}, color={0,0,127})); + connect(set_TRet.y, con2.TSet) annotation (Line(points={{31,120},{36,120},{36, + 16},{65,16},{65,11}}, color={0,0,127})); + connect(set_TRet.y, con3.TSet) annotation (Line(points={{31,120},{36,120},{36, + -44},{65,-44},{65,-49}}, color={0,0,127})); + connect(preQ1CooLoa_flow.y, con1.QCooLoa_flow) + annotation (Line(points={{99,90},{69,90},{69,71}}, color={0,0,127})); + connect(preQ2CooLoa_flow.y, con2.QCooLoa_flow) + annotation (Line(points={{99,30},{69,30},{69,11}}, color={0,0,127})); + connect(preQ3CooLoa_flow.y, con3.QCooLoa_flow) + annotation (Line(points={{99,-30},{69,-30},{69,-49}}, color={0,0,127})); + connect(con3.yVal_actual, mulMax_yVal23.u[1]) annotation (Line(points={{71,-53}, + {86,-53},{86,-110},{74,-110},{74,-110.5},{62,-110.5}}, color={0,0,127})); + connect(con2.yVal_actual, mulMax_yVal23.u[2]) annotation (Line(points={{71,7}, + {86,7},{86,-109.5},{62,-109.5}}, color={0,0,127})); + connect(mulMax_yVal23.y, hysCat.u) + annotation (Line(points={{38,-110},{22,-110}}, color={0,0,127})); + connect(hysCat.y, cat.onOffLin) annotation (Line(points={{-2,-110},{-50,-110}, + {-50,-72},{-51,-72}}, color={255,0,255})); + connect(booFloDir.y, cat.booFloDir) annotation (Line(points={{-41,-130},{-55,-130}, + {-55,-72}}, color={255,0,255})); + connect(set_mTan_flow.y, cat.set_mTan_flow) annotation (Line(points={{-79,-130}, + {-65,-130},{-65,-71}}, color={0,0,127})); + connect(set_mChi2_flow.y, cat.set_mPum1_flow) annotation (Line(points={{-79,-90}, + {-70,-90},{-70,-71},{-69,-71}}, color={0,0,127})); + connect(mulMin_dpCon.y, gai.u) + annotation (Line(points={{-32,170},{-60,170},{-60,162}}, color={0,0,127})); + connect(gai.y, conPumChi1.um_dpCon) + annotation (Line(points={{-60,139},{-60,121}}, color={0,0,127})); + connect(sou_p.ports[1], chi1.port_a) annotation (Line(points={{-60,0},{-44,0}, + {-44,40},{-50,40}}, color={0,127,255})); + annotation (experiment(Tolerance=1e-06, StopTime=3600), + Diagram(coordinateSystem(extent={{-100,-140},{120,180}})), Icon( + coordinateSystem(extent={{-100,-100},{100,100}}))); +end TwoSourcesThreeUsers; diff --git a/Buildings/Fluid/Storage/Plant/Examples/package.order b/Buildings/Fluid/Storage/Plant/Examples/package.order index b3d2db285c9..da0cd7227d2 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/package.order +++ b/Buildings/Fluid/Storage/Plant/Examples/package.order @@ -1 +1,3 @@ OneSourceOneUser +TwoSourcesThreeUsers +BaseClasses From 16cf2ba2ece51f680e67a5106fd8844e0342c4a5 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Fri, 11 Feb 2022 08:37:49 -0800 Subject: [PATCH 020/463] adjusted the ideal source --- .../Plant/BaseClasses/ChillerAndTank.mo | 8 +-- .../BaseClasses/ReversiblePumpValveControl.mo | 4 +- .../Plant/Examples/TwoSourcesThreeUsers.mo | 2 +- ...mmyChillSource.mo => TemperatureSource.mo} | 70 ++++++------------- Buildings/Fluid/Storage/Plant/package.order | 2 +- 5 files changed, 30 insertions(+), 56 deletions(-) rename Buildings/Fluid/Storage/Plant/{DummyChillSource.mo => TemperatureSource.mo} (65%) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo index 193b382a129..7cf4223c5b2 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo @@ -81,7 +81,7 @@ partial model ChillerAndTank rotation=0, origin={-110,90}))); - Buildings.Fluid.Storage.Plant.DummyChillSource ideChi( + Buildings.Fluid.Storage.Plant.TemperatureSource ideChi( redeclare package Medium = Medium, allowFlowReversal=allowFlowReversal1, m_flow_nominal=m1_flow_nominal, @@ -89,7 +89,7 @@ partial model ChillerAndTank T_a_nominal=T_CHWR_nominal, T_b_nominal=T_CHWS_nominal) "Ideal chiller" annotation (Placement(transformation(extent={{-10,30},{10,50}}))); - Buildings.Fluid.Storage.Plant.DummyChillSource ideTan( + Buildings.Fluid.Storage.Plant.TemperatureSource ideTan( redeclare package Medium = Medium, final allowFlowReversal=true, m_flow_nominal=m2_flow_nominal, @@ -132,9 +132,9 @@ equation connect(ideTan.port_b, preDro2.port_a) annotation (Line(points={{10,-60},{40,-60}}, color={0,127,255})); connect(jun1.port_3, ideTan.port_a) annotation (Line(points={{-80,-10},{-80, - -60},{-10.2,-60}}, color={0,127,255})); + -60},{-10,-60}}, color={0,127,255})); connect(pum1.port_b, ideChi.port_a) - annotation (Line(points={{-40,40},{-10.2,40}}, color={0,127,255})); + annotation (Line(points={{-40,40},{-10,40}}, color={0,127,255})); connect(jun1.port_2, pum1.port_a) annotation (Line(points={{-70,0},{-64,0},{-64, 40},{-60,40}}, color={0,127,255})); connect(pum1.m_flow_in, set_mPum1_flow) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo index ddbc836662d..ac35d908b5e 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo @@ -19,9 +19,7 @@ block ReversiblePumpValveControl controllerType=Modelica.Blocks.Types.SimpleController.PI, Td=1, k=5, - Ti=50, - reverseActing=false) - "PI controller for pum2" annotation (Placement(transformation( + Ti=50) "PI controller for pum2" annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=270, origin={-70,60}))); diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index e124c3f9b96..dcb5dc75dcc 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -22,7 +22,7 @@ model TwoSourcesThreeUsers "Flow reversal setting"; - Buildings.Fluid.Storage.Plant.DummyChillSource chi1( + Buildings.Fluid.Storage.Plant.TemperatureSource chi1( redeclare final package Medium = Medium, allowFlowReversal=true, m_flow_nominal=m_flow_nominal, diff --git a/Buildings/Fluid/Storage/Plant/DummyChillSource.mo b/Buildings/Fluid/Storage/Plant/TemperatureSource.mo similarity index 65% rename from Buildings/Fluid/Storage/Plant/DummyChillSource.mo rename to Buildings/Fluid/Storage/Plant/TemperatureSource.mo index 75863c62409..04d8ec79599 100644 --- a/Buildings/Fluid/Storage/Plant/DummyChillSource.mo +++ b/Buildings/Fluid/Storage/Plant/TemperatureSource.mo @@ -1,6 +1,6 @@ within Buildings.Fluid.Storage.Plant; -model DummyChillSource - "An ideal chill (or heat if flow direction reversed) source that always sets the fluid passing through to the prescribed enthalpy" +model TemperatureSource + "An ideal source that sets fluid temperature to the prescribed value" replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium in the component"; @@ -16,50 +16,20 @@ model DummyChillSource parameter Boolean allowFlowReversal=false "Flow reversal setting"; - MixingVolumes.MixingVolume vol( - nPorts=2, - final prescribedHeatFlowRate=true, - redeclare package Medium = Medium, - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - m_flow_nominal=m_flow_nominal, - allowFlowReversal=allowFlowReversal, - V=1E-3, - p_start=p_nominal, - T_start=T_b_nominal) "Volume" - annotation ( - Placement(transformation( - origin={0,20}, - extent={{-10,10},{10,-10}}, - rotation=180))); - Sensors.TemperatureTwoPort T_a( + Buildings.Fluid.Sensors.TemperatureTwoPort T_a( redeclare package Medium = Medium, allowFlowReversal=allowFlowReversal, m_flow_nominal=m_flow_nominal, T_start=T_a_nominal, tauHeaTra=1) "Temperature sensor to port_a" annotation (Placement(transformation(extent={{-40,-10},{-20,10}}))); - Sensors.TemperatureTwoPort T_b( + Buildings.Fluid.Sensors.TemperatureTwoPort T_b( redeclare package Medium = Medium, allowFlowReversal=allowFlowReversal, m_flow_nominal=m_flow_nominal, T_start=T_b_nominal, tauHeaTra=1) "Temperature sensor to port_b" annotation (Placement(transformation(extent={{20,-10},{40,10}}))); - Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow heaChi - "Prescribed heat flow" - annotation (Placement(transformation(extent={{2,38},{22,58}}))); - Modelica.Blocks.Sources.RealExpression QVol(y=if allowFlowReversal and - mVol_flow.m_flow < 0 then mVol_flow.m_flow*(T_b.port_a.h_outflow - - Medium.specificEnthalpy(state=Medium.setState_pTX( - p=p_nominal, - T=T_a_nominal, - X={1.}))) else mVol_flow.m_flow*(Medium.specificEnthalpy(state= - Medium.setState_pTX( - p=p_nominal, - T=T_b_nominal, - X={1.})) - T_a.port_b.h_outflow)) - "Heat flow that sets the flow to the desired state" - annotation (Placement(transformation(extent={{-30,38},{-10,58}}))); Modelica.Fluid.Interfaces.FluidPort_a port_a( p(start=p_nominal), redeclare package Medium = Medium, @@ -74,7 +44,7 @@ model DummyChillSource "Fluid connector b (positive design flow direction is from port_a to port_b)" annotation (Placement(transformation(extent={{110,-10},{90,10}}), iconTransformation(extent={{110,-10},{90,10}}))); - Sensors.MassFlowRate mVol_flow( + Buildings.Fluid.Sensors.MassFlowRate mVol_flow( redeclare package Medium = Medium, final allowFlowReversal=true) "Flow rate sensor" annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); @@ -86,26 +56,32 @@ model DummyChillSource extent={{-10,-10},{10,10}}, rotation=90, origin={-70,110}))); + Buildings.Fluid.Sources.PropertySource_T proSouT( + redeclare package Medium = Medium, + use_T_in=true) + "Property source that prescribes the temperature" + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + Modelica.Blocks.Sources.RealExpression setT(y(unit="K", displayUnit="degC")= + if m_flow<0 and allowFlowReversal then + 12+273.15 + else + 7+273.15) "Set temperature" + annotation (Placement(transformation(extent={{-40,30},{-20,50}}))); equation - connect(T_a.port_b, vol.ports[1]) - annotation (Line(points={{-20,0},{1,0},{1,10}}, color={0,127,255})); - connect(T_b.port_a, vol.ports[2]) - annotation (Line(points={{20,0},{-1,0},{-1,10}}, color={0,127,255})); - connect(heaChi.port,vol. heatPort) - annotation (Line(points={{22,48},{28,48},{28,20},{10,20}}, - color={191,0,0})); - connect(QVol.y,heaChi. Q_flow) - annotation (Line(points={{-9,48},{2,48}}, color={0,0,127})); connect(T_b.port_b, port_b) annotation (Line(points={{40,0},{100,0}}, color={0,127,255})); connect(T_a.port_a, mVol_flow.port_b) annotation (Line(points={{-40,0},{-60,0}}, color={0,127,255})); connect(mVol_flow.port_a, port_a) annotation (Line(points={{-80,0},{-100,0}}, color={0,127,255})); - connect(m_flow, m_flow) - annotation (Line(points={{-70,110},{-70,110}}, color={0,0,127})); connect(mVol_flow.m_flow, m_flow) annotation (Line(points={{-70,11},{-70,110}}, color={0,0,127})); + connect(T_a.port_b, proSouT.port_a) + annotation (Line(points={{-20,0},{-10,0}}, color={0,127,255})); + connect(proSouT.port_b, T_b.port_a) + annotation (Line(points={{10,0},{20,0}}, color={0,127,255})); + connect(setT.y, proSouT.T_in) + annotation (Line(points={{-19,40},{-4,40},{-4,12}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={Ellipse( extent={{-100,100},{100,-100}}, lineColor={28,108,200}, @@ -130,4 +106,4 @@ annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={Ellipse( textColor={0,0,255}, textString="%name")}), Diagram( coordinateSystem(preserveAspectRatio=false))); -end DummyChillSource; +end TemperatureSource; diff --git a/Buildings/Fluid/Storage/Plant/package.order b/Buildings/Fluid/Storage/Plant/package.order index de201a7e71a..e123057f03a 100644 --- a/Buildings/Fluid/Storage/Plant/package.order +++ b/Buildings/Fluid/Storage/Plant/package.order @@ -1,6 +1,6 @@ ChillerAndTankNoRemoteCharging ChillerAndTankWithRemoteCharging -DummyChillSource +TemperatureSource DummyConsumer Examples Validation From 6b98bb13fe516ae447222aff7d5becfda772d34a Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Fri, 11 Feb 2022 08:54:47 -0800 Subject: [PATCH 021/463] adjusted inheritance structure --- .../Plant/BaseClasses/ChillerAndTank.mo | 13 +++++++- .../Plant/ChillerAndTankNoRemoteCharging.mo | 23 ++++---------- .../Plant/ChillerAndTankWithRemoteCharging.mo | 30 +++++-------------- .../Fluid/Storage/Plant/TemperatureSource.mo | 14 +++++---- 4 files changed, 33 insertions(+), 47 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo index 7cf4223c5b2..8f14bafaeac 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo @@ -117,8 +117,19 @@ partial model ChillerAndTank extent={{10,-10},{-10,10}}, rotation=90, origin={90,-110}))); + Buildings.Fluid.Movers.SpeedControlled_y pum2( + redeclare package Medium = Medium, + per(pressure(dp=dp_nominal*{2,1.2,0}, V_flow=(m1_flow_nominal + + m2_flow_nominal)/1.2*{0,1.2,2})), + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + allowFlowReversal=true, + addPowerToMedium=false, + y_start=0, + T_start=T_CHWR_nominal) "Secondary pump" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-150,20}))); equation - connect(preDro2.port_b, jun2.port_3) annotation (Line(points={{60,-60},{100,-60},{100,-10}}, color={0,127,255})); diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo index 47203391ce2..76c089d0d33 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo @@ -3,29 +3,16 @@ model ChillerAndTankNoRemoteCharging "(Draft) Model of a plant with a chiller and a tank where the tank cannot be charged remotely" extends Buildings.Fluid.Storage.Plant.BaseClasses.ChillerAndTank; - Buildings.Fluid.Movers.SpeedControlled_y pum2( - redeclare package Medium = Medium, - per(pressure( - dp=dp_nominal*{2,1.2,0}, - V_flow=(m1_flow_nominal+m2_flow_nominal)/1.2*{0,1.2,2})), - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - allowFlowReversal=true, - addPowerToMedium=false, - y_start=0, - T_start=T_CHWR_nominal) "Secondary pump" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-130,0}))); Modelica.Blocks.Interfaces.RealInput yPum2 "Secondary pump speed input" annotation (Placement(transformation(extent={{-204,58},{-180,82}}), iconTransformation(extent={{-120,40},{-100,60}}))); equation - connect(port_a, pum2.port_a) - annotation (Line(points={{-180,0},{-140,0}}, color={0,127,255})); - connect(pum2.port_b, jun1.port_1) - annotation (Line(points={{-120,0},{-90,0}}, color={0,127,255})); connect(pum2.y, yPum2) - annotation (Line(points={{-130,12},{-130,70},{-192,70}}, color={0,0,127})); + annotation (Line(points={{-150,32},{-150,70},{-192,70}}, color={0,0,127})); + connect(pum2.port_a, port_a) annotation (Line(points={{-160,20},{-166,20},{ + -166,0},{-180,0}}, color={0,127,255})); + connect(pum2.port_b, jun1.port_1) annotation (Line(points={{-140,20},{-96,20}, + {-96,0},{-90,0}}, color={0,127,255})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,100}})), Diagram( coordinateSystem(preserveAspectRatio=false, extent={{-180,-100},{100,100}}))); diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo index 88297a3d66a..593870c19ec 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo @@ -23,21 +23,7 @@ model ChillerAndTankWithRemoteCharging rotation=0, origin={-110,50}))); - Buildings.Fluid.Movers.SpeedControlled_y pum2( - redeclare package Medium = Medium, - per(pressure( - dp=dp_nominal*{2,1.2,0}, - V_flow=(m1_flow_nominal+m2_flow_nominal)/1.2*{0,1.2,2})), - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - allowFlowReversal=true, - addPowerToMedium=false, - y_start=0, - T_start=T_CHWR_nominal) - "Secondary pump" - annotation (Placement(transformation( - extent={{-160,10},{-140,30}}, - rotation=0))); - Actuators.Valves.TwoWayEqualPercentage val1( + Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage val1( redeclare package Medium = Medium, use_inputFilter=false, l=1E-10, @@ -45,7 +31,7 @@ model ChillerAndTankWithRemoteCharging m_flow_nominal=m1_flow_nominal+m2_flow_nominal) "Valve in series to the pump (normal direction)" annotation (Placement(transformation(extent={{-120,10},{-100,30}}))); - Actuators.Valves.TwoWayEqualPercentage val2( + Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage val2( redeclare package Medium = Medium, use_inputFilter=false, l=1E-10, @@ -64,12 +50,6 @@ equation 0},{-180,0}}, color={0,127,255})); connect(val1.port_b, jun1.port_1) annotation (Line(points={{-100,20},{-94,20}, {-94,0},{-90,0}}, color={0,127,255})); - connect(val1.port_a, pum2.port_b) - annotation (Line(points={{-120,20},{-140,20}}, color={0,127,255})); - connect(pum2.port_a, port_a) annotation (Line(points={{-160,20},{-164,20},{-164, - 0},{-180,0}}, color={0,127,255})); - connect(pum2Con.yPum2, pum2.y) annotation (Line(points={{-131,56.9},{-131,38}, - {-150,38},{-150,32}}, color={0,0,127})); connect(pum2Con.yVal2, val2.y) annotation (Line(points={{-127,56.9},{-127,-2}, {-130,-2},{-130,-8}}, color={0,0,127})); connect(pum2Con.yVal1, val1.y) annotation (Line(points={{-123,56.9},{-110,56.9}, @@ -79,6 +59,12 @@ equation color={0,0,127})); connect(pum2Con.us_mTan_flow, set_mTan_flow) annotation (Line(points={{-141, 72.3},{-160,72.3},{-160,110}}, color={0,0,127})); + connect(pum2.port_a, port_a) annotation (Line(points={{-160,20},{-164,20},{ + -164,0},{-180,0}}, color={0,127,255})); + connect(pum2.port_b, val1.port_a) + annotation (Line(points={{-140,20},{-120,20}}, color={0,127,255})); + connect(pum2.y, pum2Con.yPum2) annotation (Line(points={{-150,32},{-150,50},{ + -131,50},{-131,56.9}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,100}}), graphics={Line( points={{-80,-20},{-20,-20}}, diff --git a/Buildings/Fluid/Storage/Plant/TemperatureSource.mo b/Buildings/Fluid/Storage/Plant/TemperatureSource.mo index 04d8ec79599..61cba42d56d 100644 --- a/Buildings/Fluid/Storage/Plant/TemperatureSource.mo +++ b/Buildings/Fluid/Storage/Plant/TemperatureSource.mo @@ -58,14 +58,16 @@ model TemperatureSource origin={-70,110}))); Buildings.Fluid.Sources.PropertySource_T proSouT( redeclare package Medium = Medium, - use_T_in=true) + final use_T_in=true, + final allowFlowReversal=allowFlowReversal) "Property source that prescribes the temperature" annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - Modelica.Blocks.Sources.RealExpression setT(y(unit="K", displayUnit="degC")= - if m_flow<0 and allowFlowReversal then - 12+273.15 - else - 7+273.15) "Set temperature" + Modelica.Blocks.Sources.RealExpression setT( + y(final unit="K", final displayUnit="degC")= + if m_flow<0 and allowFlowReversal then + 12+273.15 + else + 7+273.15) "Set temperature" annotation (Placement(transformation(extent={{-40,30},{-20,50}}))); equation connect(T_b.port_b, port_b) From a3c16e39549caf82a51cb5a0ed2a0fd5b187f9de Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Mon, 14 Feb 2022 08:52:35 -0800 Subject: [PATCH 022/463] improved parameterisation --- .../Fluid/Storage/Plant/DummyConsumer.mo | 4 +- .../Plant/Examples/BaseClasses/package.mo | 4 - .../Plant/Examples/OneSourceOneUser.mo | 6 +- .../Plant/Examples/TwoSourcesThreeUsers.mo | 373 ++++++++++-------- .../Storage/Plant/Examples/package.order | 1 - 5 files changed, 203 insertions(+), 185 deletions(-) delete mode 100644 Buildings/Fluid/Storage/Plant/Examples/BaseClasses/package.mo diff --git a/Buildings/Fluid/Storage/Plant/DummyConsumer.mo b/Buildings/Fluid/Storage/Plant/DummyConsumer.mo index f2bcbbc39d9..c3636f42c1e 100644 --- a/Buildings/Fluid/Storage/Plant/DummyConsumer.mo +++ b/Buildings/Fluid/Storage/Plant/DummyConsumer.mo @@ -17,8 +17,6 @@ the consumer control valve simply tracks the return CHW temperature. "Nominal temperature of CHW supply"; parameter Modelica.Units.SI.Temperature T_b_nominal=12+273.15 "Nominal temperature of CHW return"; - parameter Boolean allowFlowReversal=false - "Flow reversal setting on chiller branch"; final parameter Modelica.Units.SI.PressureDifference dp_nominal= p_a_nominal-p_b_nominal "Nominal pressure difference"; @@ -40,7 +38,7 @@ the consumer control valve simply tracks the return CHW temperature. redeclare package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, m_flow_nominal=m_flow_nominal, - allowFlowReversal=allowFlowReversal, + allowFlowReversal=true, V=1, p_start=p_a_nominal, T_start=T_b_nominal) "Volume representing the consumer" diff --git a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/package.mo b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/package.mo deleted file mode 100644 index 0c66df2af12..00000000000 --- a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/package.mo +++ /dev/null @@ -1,4 +0,0 @@ -within Buildings.Fluid.Storage.Plant.Examples; -package BaseClasses "Package with base classes" -extends Modelica.Icons.BasesPackage; -end BaseClasses; diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo index 06b41139ab0..d3b131ef6ba 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo @@ -32,6 +32,8 @@ model OneSourceOneUser "(Draft) District system with one source and one user" "Nominal temperature of CHW supply"; parameter Boolean allowFlowReversal=false "Flow reversal setting"; + parameter Modelica.Units.SI.Power QCooLoa_flow_nominal=5*4200*1.01 + "Nominal cooling load of one consumer"; Buildings.Fluid.Storage.Plant.ChillerAndTankNoRemoteCharging cat( redeclare final package Medium=Medium, @@ -55,8 +57,8 @@ model OneSourceOneUser "(Draft) District system with one source and one user" Modelica.Blocks.Sources.Constant set_TRet(k=12 + 273.15) "CHW return setpoint" annotation (Placement(transformation(extent={{0,20},{20,40}}))); - Modelica.Blocks.Sources.TimeTable preQCooLoa_flow(table=[0*3600,0; 0.5*3600,0; - 0.5*3600,5*4200*1.01; 0.75*3600,5*4200*1.01; 0.75*3600,0; 1*3600,0]) + Modelica.Blocks.Sources.TimeTable preQCooLoa_flow(table=[0*3600,0; 1200,0; + 1200,QCooLoa_flow_nominal; 2400,QCooLoa_flow_nominal; 2400,0; 1*3600,0]) "Placeholder, prescribed cooling load" annotation (Placement(transformation(extent={{0,50},{20,70}}))); Buildings.Controls.Continuous.LimPID conPI_pum2( diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index dcb5dc75dcc..4697f05fdf3 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -7,12 +7,12 @@ model TwoSourcesThreeUsers parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=1 "Nominal mass flow rate"; - parameter Modelica.Units.SI.PressureDifference dp_nominal= - p_CHWS_nominal-p_CHWR_nominal + parameter Modelica.Units.SI.PressureDifference dp_nominal=500000 "Nominal pressure difference"; - parameter Modelica.Units.SI.AbsolutePressure p_CHWS_nominal=800000 + parameter Modelica.Units.SI.AbsolutePressure p_CHWS_nominal= + p_CHWR_nominal+dp_nominal "Nominal pressure at CHW supply line"; - parameter Modelica.Units.SI.AbsolutePressure p_CHWR_nominal=300000 + parameter Modelica.Units.SI.AbsolutePressure p_CHWR_nominal=500000 "Nominal pressure at CHW return line"; parameter Modelica.Units.SI.Temperature T_CHWR_nominal=12+273.15 "Nominal temperature of CHW return"; @@ -20,23 +20,24 @@ model TwoSourcesThreeUsers "Nominal temperature of CHW supply"; parameter Boolean allowFlowReversal=false "Flow reversal setting"; - + parameter Modelica.Units.SI.Power QCooLoa_flow_nominal=5*4200*1.01 + "Nominal cooling load of one consumer"; Buildings.Fluid.Storage.Plant.TemperatureSource chi1( redeclare final package Medium = Medium, allowFlowReversal=true, - m_flow_nominal=m_flow_nominal, + m_flow_nominal=1.5*m_flow_nominal, p_nominal=p_CHWR_nominal, T_a_nominal=T_CHWR_nominal, T_b_nominal=T_CHWS_nominal) "Dummy chill source as chiller 1" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, - rotation=180, - origin={-60,40}))); + rotation=90, + origin={-80,60}))); Buildings.Fluid.Storage.Plant.ChillerAndTankWithRemoteCharging cat( redeclare final package Medium=Medium, - final m1_flow_nominal=1, - final m2_flow_nominal=1, + final m1_flow_nominal=0.75*m_flow_nominal, + final m2_flow_nominal=0.75*m_flow_nominal, final p_CHWS_nominal=p_CHWS_nominal, final p_CHWR_nominal=p_CHWR_nominal, final T_CHWS_nominal=T_CHWS_nominal, @@ -78,205 +79,168 @@ model TwoSourcesThreeUsers annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=-90, origin={60,-60}))); - Buildings.Fluid.FixedResistances.Junction junCHWS1( - redeclare package Medium = Medium, - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - m_flow_nominal=m_flow_nominal*{1.5,-1,-0.5}, - dp_nominal=dp_nominal*{0,-0.3,-0.3}, - T_start=T_CHWR_nominal) "Junction one supply line" annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-20,80}))); - Buildings.Fluid.FixedResistances.Junction junCHWS3( - redeclare package Medium = Medium, - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - m_flow_nominal=m_flow_nominal*{1.5,-1,-0.5}, - dp_nominal=dp_nominal*{0,-0.3,-0.3}, - T_start=T_CHWR_nominal) "Junction on supply line" annotation (Placement( - transformation( - extent={{-10,10},{10,-10}}, - rotation=0, - origin={-20,-40}))); - Buildings.Fluid.FixedResistances.Junction junCHWS2( - redeclare package Medium = Medium, - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - m_flow_nominal=m_flow_nominal*{0.5,-1,0.5}, - dp_nominal={0,0,0}, - T_start=T_CHWR_nominal) "Junction on supply line" annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-20,20}))); - Buildings.Fluid.FixedResistances.Junction junCHWR1( - redeclare package Medium = Medium, - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - m_flow_nominal=m_flow_nominal*{1,-1.5,-0.5}, - dp_nominal=dp_nominal*{0.3,0,-0.3}, - T_start=T_CHWR_nominal) "Junction on return line" annotation (Placement( - transformation( - extent={{10,-10},{-10,10}}, - rotation=0, - origin={20,40}))); - Buildings.Fluid.FixedResistances.Junction junCHWR2( - redeclare package Medium = Medium, - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - m_flow_nominal=m_flow_nominal*{1,-0.5,-0.5}, - dp_nominal=dp_nominal*{0,0,0}, - T_start=T_CHWR_nominal) "Junction on return line" annotation (Placement( - transformation( - extent={{10,10},{-10,-10}}, - rotation=0, - origin={20,-20}))); - Buildings.Fluid.FixedResistances.Junction junCHWR3( - redeclare package Medium = Medium, - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - m_flow_nominal=m_flow_nominal*{1,-1.5,0.5}, - dp_nominal=dp_nominal*{0.3,0,0.3}, - T_start=T_CHWR_nominal) "Junction on return line" annotation (Placement( - transformation( - extent={{10,10},{-10,-10}}, - rotation=0, - origin={20,-80}))); Buildings.Fluid.Movers.SpeedControlled_y pumChi1( redeclare package Medium = Medium, - per(pressure(dp=dp_nominal*{2,1.2,0}, V_flow=(m_flow_nominal)/1.2*{0,1.2,2})), + per(pressure(dp=dp_nominal*{2,1.2,0}, V_flow=(m_flow_nominal*1.5)/1.2*{0,1.2,2})), energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, allowFlowReversal=true, addPowerToMedium=false, - y_start=0, + final y_start=1, T_start=T_CHWR_nominal) "Supply pump for chiller 1" annotation (Placement( transformation(extent={{-70,70},{-50,90}}, rotation=0))); Buildings.Controls.OBC.CDL.Continuous.MultiMin mulMin_dpCon(nin=3) "Min of pressure head measured from all consumers" - annotation (Placement(transformation(extent={{-10,160},{-30,180}}))); + annotation (Placement(transformation(extent={{10,-10},{-10,10}}, + rotation=90, + origin={-90,150}))); Modelica.Blocks.Sources.Constant set_dpCon(k=1) "Normalised consumer differential pressure setpoint" annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=-90, - origin={-90,150}))); - Buildings.Fluid.Storage.Plant.Examples.BaseClasses.PumChi1Control conPumChi1 - "Control block" annotation (Placement( - transformation( - extent={{-10,10},{10,-10}}, - rotation=-90, - origin={-60,110}))); - Buildings.Controls.OBC.CDL.Continuous.MultiMax mulMax_yVal12(nin=2) - "Max of valve position measured from consumers 1 and 2" - annotation (Placement(transformation(extent={{-20,120},{-40,140}}))); + origin={-60,150}))); Modelica.Blocks.Sources.Constant set_TRet(k=12 + 273.15) "CHW return setpoint" annotation (Placement(transformation(extent={{10,110},{30,130}}))); - Modelica.Blocks.Sources.TimeTable preQ1CooLoa_flow(table=[0*3600,0; 0.25*3600, - 0; 0.25*3600,5*4200*1.01; 0.75*3600,5*4200*1.01; 0.75*3600,0; 1*3600,0]) - "Placeholder, prescribed cooling load" - annotation (Placement(transformation(extent={{120,80},{100,100}}))); - Modelica.Blocks.Sources.TimeTable preQ2CooLoa_flow(table=[0*3600,0; 0.25*3600, - 0; 0.25*3600,5*4200*1.01; 0.5*3600,5*4200*1.01; 0.5*3600,0; 1*3600,0]) - "Placeholder, prescribed cooling load" - annotation (Placement(transformation(extent={{120,20},{100,40}}))); - Modelica.Blocks.Sources.TimeTable preQ3CooLoa_flow(table=[0*3600,0; 0.75*3600, - 0; 0.75*3600,5*4200*1.01; 1*3600,5*4200*1.01]) - "Placeholder, prescribed cooling load" - annotation (Placement(transformation(extent={{120,-40},{100,-20}}))); - Controls.OBC.CDL.Continuous.Hysteresis hysCat(uLow=0.05, uHigh=0.5) + Buildings.Controls.OBC.CDL.Continuous.Hysteresis hysCat(uLow=0.05, uHigh=0.5) "Shut off at con.yVal = 0.05 and restarts at 0.5" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=180, origin={10,-110}))); - Controls.OBC.CDL.Continuous.MultiMax mulMax_yVal23(nin=2) - "Max of valve position measured from consumers 2 and 3" + Buildings.Controls.OBC.CDL.Continuous.MultiMax mulMax_yVal(nin=3) + "Max of valve positions" annotation (Placement(transformation(extent={{60,-120},{40,-100}}))); Modelica.Blocks.Sources.BooleanConstant booFloDir "Placeholder, constant normal direction" annotation (Placement(transformation(extent={{-20,-140},{-40,-120}}))); - Modelica.Blocks.Sources.Constant set_mTan_flow(k=0) + Modelica.Blocks.Sources.Constant set_mTan_flow(k=0.75*m_flow_nominal) "Placeholder, tank flow rate setpoint" annotation (Placement(transformation(extent={{-100,-140},{-80,-120}}))); - Modelica.Blocks.Sources.Constant set_mChi2_flow(k=m_flow_nominal) + Modelica.Blocks.Sources.Constant set_mChi2_flow(k=0.75*m_flow_nominal) "Placeholder, chiller 2 flow rate setpoint" annotation (Placement(transformation(extent={{-100,-100},{-80,-80}}))); - Modelica.Blocks.Math.Gain gai(k=1/con1.dp_nominal) "Gain" annotation ( - Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=90, - origin={-60,150}))); - Sources.Boundary_pT sou_p( + Buildings.Fluid.Sources.Boundary_pT sou_p( redeclare final package Medium = Medium, final p=p_CHWR_nominal, final T=T_CHWR_nominal, nPorts=1) "Pressurisation point" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-70,0}))); + origin={-90,0}))); + Buildings.Fluid.FixedResistances.PressureDrop preDroChi1( + redeclare package Medium = Medium, + final allowFlowReversal=allowFlowReversal, + final dp_nominal=dp_nominal/10, + final m_flow_nominal=1.5*m_flow_nominal) + "Flow resistance" annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={-60,40}))); + Buildings.Controls.Continuous.LimPID conPI_PumChi1( + controllerType=Modelica.Blocks.Types.SimpleController.PI, + Td=1, + k=1, + Ti=100, + reverseActing=true) "PI controller" annotation (Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=90, + origin={-60,120}))); + Buildings.Fluid.FixedResistances.PressureDrop preDroS2C3( + redeclare package Medium = Medium, + final allowFlowReversal=true, + final dp_nominal=0.3*dp_nominal, + final m_flow_nominal=m_flow_nominal) + "Flow resistance source 2 to consumer 3" + annotation (Placement(transformation(extent={{-30,-50},{-10,-30}}))); + Buildings.Fluid.FixedResistances.PressureDrop preDroC3S2( + redeclare package Medium = Medium, + final allowFlowReversal=true, + final dp_nominal=0.3*dp_nominal, + final m_flow_nominal=m_flow_nominal) + "Flow resistance consumer 3 to source 2" + annotation (Placement(transformation(extent={{30,-90},{10,-70}}))); + Buildings.Fluid.FixedResistances.PressureDrop preDroS2C2( + redeclare package Medium = Medium, + final allowFlowReversal=true, + final dp_nominal=0.3*dp_nominal, + final m_flow_nominal=m_flow_nominal) + "Flow resistance source 2 to consumer 2" + annotation (Placement(transformation(extent={{-30,-10},{-10,10}}))); + Buildings.Fluid.FixedResistances.PressureDrop preDroC2S2( + redeclare package Medium = Medium, + final allowFlowReversal=true, + final dp_nominal=0.3*dp_nominal, + final m_flow_nominal=m_flow_nominal) + "Flow resistance consumer 2 to source 2" + annotation (Placement(transformation(extent={{30,-30},{10,-10}}))); + Buildings.Fluid.FixedResistances.PressureDrop preDroS1C2( + redeclare package Medium = Medium, + final allowFlowReversal=true, + final dp_nominal=0.3*dp_nominal, + final m_flow_nominal=m_flow_nominal) + "Flow resistance source 1 to consumer 2" + annotation (Placement(transformation(extent={{-30,10},{-10,30}}))); + Buildings.Fluid.FixedResistances.PressureDrop preDroC2S1( + redeclare package Medium = Medium, + final allowFlowReversal=true, + final dp_nominal=0.3*dp_nominal, + final m_flow_nominal=m_flow_nominal) + "Flow resistance consumer 2 to source 1" + annotation (Placement(transformation(extent={{30,-10},{10,10}}))); + Buildings.Fluid.FixedResistances.PressureDrop preDroS1C1( + redeclare package Medium = Medium, + final allowFlowReversal=true, + final dp_nominal=0.3*dp_nominal, + final m_flow_nominal=m_flow_nominal) + "Flow resistance source 1 to consumer 3" + annotation (Placement(transformation(extent={{-30,70},{-10,90}}))); + Buildings.Fluid.FixedResistances.PressureDrop preDroC1S1( + redeclare package Medium = Medium, + final allowFlowReversal=true, + final dp_nominal=0.3*dp_nominal, + final m_flow_nominal=m_flow_nominal) + "Flow resistance consumer 1 to source 1" + annotation (Placement(transformation(extent={{30,30},{10,50}}))); + Modelica.Blocks.Sources.TimeTable set_QCooLoa1_flow(table=[0,0; 600,0; 600, + QCooLoa_flow_nominal; 2400,QCooLoa_flow_nominal; 2400,0; 3600,0]) + "Cooling load" + annotation (Placement(transformation(extent={{120,80},{100,100}}))); + Modelica.Blocks.Sources.TimeTable set_QCooLoa2_flow(table=[0,0; 1200,0; 1200, + QCooLoa_flow_nominal; 3000,QCooLoa_flow_nominal; 3000,0; 3600,0]) + "Cooling load" + annotation (Placement(transformation(extent={{120,20},{100,40}}))); + Modelica.Blocks.Sources.TimeTable set_QCooLoa3_flow(table=[0,0; 1800,0; 1800, + QCooLoa_flow_nominal; 3600,QCooLoa_flow_nominal]) "Cooling load" + annotation (Placement(transformation(extent={{120,-40},{100,-20}}))); + Modelica.Blocks.Math.Gain gaiCon1(k=1/con1.dp_nominal) + "Gain to normalise dp measurement" annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=180, + origin={110,60}))); + Modelica.Blocks.Math.Gain gaiCon2(k=1/con2.dp_nominal) + "Gain to normalise dp measurement" annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=180, + origin={110,0}))); + Modelica.Blocks.Math.Gain gaiCon3(k=1/con3.dp_nominal) + "Gain to normalise dp measurement" annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=180, + origin={110,-60}))); equation - connect(junCHWS1.port_2, con1.port_a) - annotation (Line(points={{-10,80},{60,80},{60,70}}, color={0,127,255})); - connect(cat.port_b, junCHWS3.port_1) annotation (Line(points={{-60,-50},{-60,-40}, - {-30,-40}}, color={0,127,255})); - connect(junCHWS3.port_3, junCHWS2.port_3) - annotation (Line(points={{-20,-30},{-20,10}}, color={0,127,255})); - connect(junCHWS1.port_3, junCHWS2.port_1) annotation (Line(points={{-20,70},{-20, - 56},{-34,56},{-34,20},{-30,20}}, color={0,127,255})); - connect(junCHWS2.port_2, con2.port_a) - annotation (Line(points={{-10,20},{60,20},{60,10}}, color={0,127,255})); - connect(junCHWS3.port_2, con3.port_a) annotation (Line(points={{-10,-40},{60,-40}, - {60,-50}}, color={0,127,255})); - connect(con1.port_b, junCHWR1.port_1) - annotation (Line(points={{60,50},{60,40},{30,40}}, color={0,127,255})); - connect(junCHWR1.port_2, chi1.port_a) - annotation (Line(points={{10,40},{-50,40}}, color={0,127,255})); - connect(con3.port_b, junCHWR3.port_1) - annotation (Line(points={{60,-70},{60,-80},{30,-80}}, color={0,127,255})); - connect(junCHWR3.port_2, cat.port_a) annotation (Line(points={{10,-80},{-60,-80}, - {-60,-70}}, color={0,127,255})); - connect(con2.port_b, junCHWR2.port_1) - annotation (Line(points={{60,-10},{60,-20},{30,-20}}, color={0,127,255})); - connect(junCHWR3.port_3, junCHWR2.port_2) annotation (Line(points={{20,-70},{20, - -50},{2,-50},{2,-20},{10,-20}}, color={0,127,255})); - connect(junCHWR2.port_3, junCHWR1.port_3) - annotation (Line(points={{20,-10},{20,30}}, color={0,127,255})); - connect(chi1.port_b, pumChi1.port_a) - annotation (Line(points={{-70,40},{-80,40},{-80,80},{-70,80}}, - color={0,127,255})); - connect(pumChi1.port_b, junCHWS1.port_1) - annotation (Line(points={{-50,80},{-30,80}}, color={0,127,255})); - connect(con1.dp, mulMin_dpCon.u[1]) annotation (Line(points={{71,63},{80,63}, - {80,100},{0,100},{0,169.333},{-8,169.333}}, - color={0,0,127})); - connect(con2.dp, mulMin_dpCon.u[2]) annotation (Line(points={{71,3},{80,3},{80, - 100},{0,100},{0,170},{-8,170}}, - color={0,0,127})); - connect(set_dpCon.y, conPumChi1.us_dpCon) annotation (Line(points={{-90,139},{ - -90,126},{-66,126},{-66,121}}, color={0,0,127})); - connect(mulMax_yVal12.y, conPumChi1.yVal) - annotation (Line(points={{-42,130},{-54,130},{-54,121}}, color={0,0,127})); - connect(conPumChi1.y, pumChi1.y) - annotation (Line(points={{-60,99},{-60,92}}, color={0,0,127})); - connect(con1.yVal_actual, mulMax_yVal12.u[1]) annotation (Line(points={{71,67}, - {76,67},{76,94},{-10,94},{-10,129.5},{-18,129.5}}, color={0,0,127})); - connect(con2.yVal_actual, mulMax_yVal12.u[2]) annotation (Line(points={{71,7}, - {76,7},{76,94},{-10,94},{-10,130.5},{-18,130.5}}, color={0,0,127})); - connect(con3.dp, mulMin_dpCon.u[3]) annotation (Line(points={{71,-57},{80,-57}, - {80,100},{0,100},{0,170.667},{-8,170.667}}, color={0,0,127})); connect(set_TRet.y, con1.TSet) annotation (Line(points={{31,120},{36,120},{36, 76},{65,76},{65,71}}, color={0,0,127})); connect(set_TRet.y, con2.TSet) annotation (Line(points={{31,120},{36,120},{36, 16},{65,16},{65,11}}, color={0,0,127})); connect(set_TRet.y, con3.TSet) annotation (Line(points={{31,120},{36,120},{36, -44},{65,-44},{65,-49}}, color={0,0,127})); - connect(preQ1CooLoa_flow.y, con1.QCooLoa_flow) - annotation (Line(points={{99,90},{69,90},{69,71}}, color={0,0,127})); - connect(preQ2CooLoa_flow.y, con2.QCooLoa_flow) - annotation (Line(points={{99,30},{69,30},{69,11}}, color={0,0,127})); - connect(preQ3CooLoa_flow.y, con3.QCooLoa_flow) - annotation (Line(points={{99,-30},{69,-30},{69,-49}}, color={0,0,127})); - connect(con3.yVal_actual, mulMax_yVal23.u[1]) annotation (Line(points={{71,-53}, - {86,-53},{86,-110},{74,-110},{74,-110.5},{62,-110.5}}, color={0,0,127})); - connect(con2.yVal_actual, mulMax_yVal23.u[2]) annotation (Line(points={{71,7}, - {86,7},{86,-109.5},{62,-109.5}}, color={0,0,127})); - connect(mulMax_yVal23.y, hysCat.u) + connect(con3.yVal_actual, mulMax_yVal.u[1]) annotation (Line(points={{71,-53}, + {86,-53},{86,-110},{74,-110},{74,-110.667},{62,-110.667}}, color={0,0, + 127})); + connect(con2.yVal_actual, mulMax_yVal.u[2]) annotation (Line(points={{71,7},{86, + 7},{86,-110},{62,-110}}, color={0,0,127})); + connect(mulMax_yVal.y, hysCat.u) annotation (Line(points={{38,-110},{22,-110}}, color={0,0,127})); connect(hysCat.y, cat.onOffLin) annotation (Line(points={{-2,-110},{-50,-110}, {-50,-72},{-51,-72}}, color={255,0,255})); @@ -286,13 +250,72 @@ equation {-65,-130},{-65,-71}}, color={0,0,127})); connect(set_mChi2_flow.y, cat.set_mPum1_flow) annotation (Line(points={{-79,-90}, {-70,-90},{-70,-71},{-69,-71}}, color={0,0,127})); - connect(mulMin_dpCon.y, gai.u) - annotation (Line(points={{-32,170},{-60,170},{-60,162}}, color={0,0,127})); - connect(gai.y, conPumChi1.um_dpCon) - annotation (Line(points={{-60,139},{-60,121}}, color={0,0,127})); - connect(sou_p.ports[1], chi1.port_a) annotation (Line(points={{-60,0},{-44,0}, - {-44,40},{-50,40}}, color={0,127,255})); - annotation (experiment(Tolerance=1e-06, StopTime=3600), - Diagram(coordinateSystem(extent={{-100,-140},{120,180}})), Icon( + connect(preDroChi1.port_b, chi1.port_a) + annotation (Line(points={{-70,40},{-80,40},{-80,50}}, color={0,127,255})); + connect(chi1.port_b, pumChi1.port_a) + annotation (Line(points={{-80,70},{-80,80},{-70,80}}, color={0,127,255})); + connect(sou_p.ports[1], preDroChi1.port_b) + annotation (Line(points={{-80,0},{-80,40},{-70,40}}, color={0,127,255})); + connect(set_dpCon.y, conPI_PumChi1.u_s) + annotation (Line(points={{-60,139},{-60,132}}, color={0,0,127})); + connect(conPI_PumChi1.y, pumChi1.y) + annotation (Line(points={{-60,109},{-60,92}}, color={0,0,127})); + connect(con1.yVal_actual, mulMax_yVal.u[3]) annotation (Line(points={{71,67}, + {86,67},{86,-110},{62,-110},{62,-109.333}},color={0,0,127})); + connect(cat.port_b, preDroS2C3.port_a) annotation (Line(points={{-60,-50},{-60, + -40},{-30,-40}}, color={0,127,255})); + connect(preDroS2C3.port_b, con3.port_a) + annotation (Line(points={{-10,-40},{60,-40},{60,-50}}, color={0,127,255})); + connect(con3.port_b, preDroC3S2.port_a) + annotation (Line(points={{60,-70},{60,-80},{30,-80}}, color={0,127,255})); + connect(preDroC3S2.port_b, cat.port_a) annotation (Line(points={{10,-80},{-60, + -80},{-60,-70}}, color={0,127,255})); + connect(cat.port_b, preDroS2C2.port_a) annotation (Line(points={{-60,-50},{-60, + -40},{-36,-40},{-36,0},{-30,0}}, color={0,127,255})); + connect(preDroS2C2.port_b, con2.port_a) annotation (Line(points={{-10,0},{-4,0}, + {-4,10},{60,10}}, color={0,127,255})); + connect(con2.port_b, preDroC2S2.port_a) + annotation (Line(points={{60,-10},{60,-20},{30,-20}}, color={0,127,255})); + connect(preDroC2S2.port_b, cat.port_a) annotation (Line(points={{10,-20},{4,-20}, + {4,-80},{-60,-80},{-60,-70}}, color={0,127,255})); + connect(pumChi1.port_b, preDroS1C2.port_a) annotation (Line(points={{-50,80},{ + -36,80},{-36,20},{-30,20}}, color={0,127,255})); + connect(preDroS1C2.port_b, con2.port_a) annotation (Line(points={{-10,20},{-4, + 20},{-4,10},{60,10}}, color={0,127,255})); + connect(con2.port_b, preDroC2S1.port_a) annotation (Line(points={{60,-10},{60, + -20},{34,-20},{34,0},{30,0}}, color={0,127,255})); + connect(preDroC2S1.port_b, preDroChi1.port_a) annotation (Line(points={{10,0}, + {4,0},{4,40},{-50,40}}, color={0,127,255})); + connect(pumChi1.port_b, preDroS1C1.port_a) + annotation (Line(points={{-50,80},{-30,80}}, color={0,127,255})); + connect(preDroS1C1.port_b, con1.port_a) + annotation (Line(points={{-10,80},{60,80},{60,70}}, color={0,127,255})); + connect(con1.port_b, preDroC1S1.port_a) + annotation (Line(points={{60,50},{60,40},{30,40}}, color={0,127,255})); + connect(preDroC1S1.port_b, preDroChi1.port_a) + annotation (Line(points={{10,40},{-50,40}}, color={0,127,255})); + connect(set_QCooLoa1_flow.y, con1.QCooLoa_flow) + annotation (Line(points={{99,90},{69,90},{69,71}}, color={0,0,127})); + connect(set_QCooLoa2_flow.y, con2.QCooLoa_flow) + annotation (Line(points={{99,30},{69,30},{69,11}}, color={0,0,127})); + connect(set_QCooLoa3_flow.y, con3.QCooLoa_flow) + annotation (Line(points={{99,-30},{69,-30},{69,-49}}, color={0,0,127})); + connect(con1.dp, gaiCon1.u) + annotation (Line(points={{71,63},{71,60},{98,60}}, color={0,0,127})); + connect(con2.dp, gaiCon2.u) annotation (Line(points={{71,3},{71,1.55431e-15},{ + 98,1.55431e-15}}, color={0,0,127})); + connect(con3.dp, gaiCon3.u) annotation (Line(points={{71,-57},{92,-57},{92,-60}, + {98,-60}}, color={0,0,127})); + connect(gaiCon1.y, mulMin_dpCon.u[1]) annotation (Line(points={{121,60},{126, + 60},{126,162},{-89.3333,162}}, + color={0,0,127})); + connect(gaiCon2.y, mulMin_dpCon.u[2]) annotation (Line(points={{121,-1.38778e-15}, + {126,-1.38778e-15},{126,162},{-90,162}}, color={0,0,127})); + connect(gaiCon3.y, mulMin_dpCon.u[3]) annotation (Line(points={{121,-60},{126, + -60},{126,162},{-90.6667,162}}, color={0,0,127})); + connect(mulMin_dpCon.y, conPI_PumChi1.u_m) + annotation (Line(points={{-90,138},{-90,120},{-72,120}}, color={0,0,127})); + annotation (experiment(Tolerance=1e-06, StopTime=3600,__Dymola_Algorithm="Cvode"), + Diagram(coordinateSystem(extent={{-100,-140},{140,180}})), Icon( coordinateSystem(extent={{-100,-100},{100,100}}))); end TwoSourcesThreeUsers; diff --git a/Buildings/Fluid/Storage/Plant/Examples/package.order b/Buildings/Fluid/Storage/Plant/Examples/package.order index da0cd7227d2..c182e825891 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/package.order +++ b/Buildings/Fluid/Storage/Plant/Examples/package.order @@ -1,3 +1,2 @@ OneSourceOneUser TwoSourcesThreeUsers -BaseClasses From f318dfc7f7dd9a65403090a277a205aed804d4a9 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Mon, 14 Feb 2022 10:35:24 -0800 Subject: [PATCH 023/463] renamed 'consumer' (con) to 'user' (usr) --- .../Plant/{DummyConsumer.mo => DummyUser.mo} | 41 ++--- .../Plant/Examples/OneSourceOneUser.mo | 26 +-- .../Plant/Examples/TwoSourcesThreeUsers.mo | 162 +++++++++--------- .../{DummyConsumer.mo => DummyUser.mo} | 26 ++- .../Storage/Plant/Validation/package.order | 2 +- Buildings/Fluid/Storage/Plant/package.order | 2 +- 6 files changed, 124 insertions(+), 135 deletions(-) rename Buildings/Fluid/Storage/Plant/{DummyConsumer.mo => DummyUser.mo} (86%) rename Buildings/Fluid/Storage/Plant/Validation/{DummyConsumer.mo => DummyUser.mo} (80%) diff --git a/Buildings/Fluid/Storage/Plant/DummyConsumer.mo b/Buildings/Fluid/Storage/Plant/DummyUser.mo similarity index 86% rename from Buildings/Fluid/Storage/Plant/DummyConsumer.mo rename to Buildings/Fluid/Storage/Plant/DummyUser.mo index c3636f42c1e..28b141d0098 100644 --- a/Buildings/Fluid/Storage/Plant/DummyConsumer.mo +++ b/Buildings/Fluid/Storage/Plant/DummyUser.mo @@ -1,5 +1,5 @@ within Buildings.Fluid.Storage.Plant; -model DummyConsumer "Dummy consumer model" +model DummyUser "Dummy user model" /* For simplification, instead of setting up a heat exchanger to a room model, the consumer control valve simply tracks the return CHW temperature. @@ -21,13 +21,13 @@ the consumer control valve simply tracks the return CHW temperature. p_a_nominal-p_b_nominal "Nominal pressure difference"; - Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valCon( + Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage val( redeclare package Medium = Medium, use_inputFilter=false, l=1E-10, dpValve_nominal=1, m_flow_nominal=m_flow_nominal, - y_start=0) "Consumer control valve" + y_start=0) "User control valve" annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow heaCon "Prescribed heat flow" @@ -47,8 +47,8 @@ the consumer control valve simply tracks the return CHW temperature. origin={0,-10}, extent={{10,10},{-10,-10}}, rotation=0))); - Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor TCon - "Temperature of the consumer" + Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor TUsr + "Temperature of the user" annotation (Placement(transformation(extent={{40,-40},{20,-20}}))); Buildings.Fluid.FixedResistances.PressureDrop preDro( redeclare package Medium = Medium, @@ -56,14 +56,12 @@ the consumer control valve simply tracks the return CHW temperature. final dp_nominal=dp_nominal, final m_flow_nominal=m_flow_nominal) "Flow resistance of the consumer" annotation (Placement(transformation(extent={{60,-10},{80,10}}))); - Buildings.Controls.Continuous.LimPID conPI_valCon( + Buildings.Controls.Continuous.LimPID conPI( controllerType=Modelica.Blocks.Types.SimpleController.PI, Td=1, k=10, Ti=1000, - reverseActing=false) - "PI controller for consumer control valve" annotation (Placement( - transformation( + reverseActing=false) "PI controller" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-50,60}))); @@ -124,30 +122,29 @@ the consumer control valve simply tracks the return CHW temperature. rotation=-90, origin={-30,110}))); equation - connect(valCon.port_b, vol.ports[1]) annotation (Line(points={{-60,0},{1,0}}, - color={0,127,255})); + connect(val.port_b, vol.ports[1]) + annotation (Line(points={{-60,0},{1,0}}, color={0,127,255})); connect(heaCon.port, vol.heatPort) annotation (Line(points={{42,80},{54,80},{54,-10},{10,-10}}, color={191,0,0})); - connect(vol.heatPort, TCon.port) + connect(vol.heatPort,TUsr. port) annotation (Line(points={{10,-10},{54,-10},{54,-30},{40,-30}}, color={191,0,0})); connect(preDro.port_a, vol.ports[2]) annotation (Line(points={{60,0},{-1,0}}, color={0,127,255})); - connect(conPI_valCon.y, gain.u) + connect(conPI.y, gain.u) annotation (Line(points={{-39,60},{-22,60}}, color={0,0,127})); - connect(gain.y, valCon.y) - annotation (Line(points={{1,60},{6,60},{6,18},{-70,18},{-70,12}}, - color={0,0,127})); - connect(TCon.T, conPI_valCon.u_m) annotation (Line(points={{19,-30},{-50,-30}, - {-50,48}}, color={0,0,127})); - connect(valCon.port_a, port_a) + connect(gain.y, val.y) annotation (Line(points={{1,60},{6,60},{6,18},{-70,18}, + {-70,12}}, color={0,0,127})); + connect(TUsr.T, conPI.u_m) + annotation (Line(points={{19,-30},{-50,-30},{-50,48}}, color={0,0,127})); + connect(val.port_a, port_a) annotation (Line(points={{-80,0},{-100,0}}, color={0,127,255})); connect(preDro.port_b, port_b) annotation (Line(points={{80,0},{100,0}}, color={0,127,255})); connect(heaCon.Q_flow, QCooLoa_flow) annotation (Line(points={{22,80},{-110,80}}, color={0,0,127})); - connect(conPI_valCon.u_s, TSet) + connect(conPI.u_s, TSet) annotation (Line(points={{-62,60},{-110,60}}, color={0,0,127})); connect(port_a, dpSen.port_a) annotation (Line( points={{-100,0},{-100,-50},{-10,-50}}, @@ -159,7 +156,7 @@ equation pattern=LinePattern.Dash)); connect(dpSen.p_rel, dp) annotation (Line(points={{0,-59},{0,-80},{110,-80}}, color={0,0,127})); - connect(valCon.y_actual, yVal_actual) + connect(val.y_actual, yVal_actual) annotation (Line(points={{-65,7},{-65,40},{110,40}}, color={0,0,127})); annotation (Icon(graphics={Ellipse( extent={{-100,100},{100,-100}}, @@ -169,4 +166,4 @@ equation extent={{-58,-104},{62,-132}}, textColor={0,0,127}, textString="%name")})); -end DummyConsumer; +end DummyUser; diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo index d3b131ef6ba..a5fdeac4471 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo @@ -45,14 +45,13 @@ model OneSourceOneUser "(Draft) District system with one source and one user" final T_CHWR_nominal=T_CHWR_nominal) "Chiller and tank" annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); - Buildings.Fluid.Storage.Plant.DummyConsumer con( + Buildings.Fluid.Storage.Plant.DummyUser usr( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, - p_a_nominal=p_CHWS_nominal-dp_nominal*0.35, - p_b_nominal=p_CHWR_nominal+dp_nominal*0.35, + p_a_nominal=p_CHWS_nominal - dp_nominal*0.35, + p_b_nominal=p_CHWR_nominal + dp_nominal*0.35, T_a_nominal=T_CHWS_nominal, - T_b_nominal=T_CHWR_nominal) - "Consumer" + T_b_nominal=T_CHWR_nominal) "User" annotation (Placement(transformation(extent={{40,-10},{60,10}}))); Modelica.Blocks.Sources.Constant set_TRet(k=12 + 273.15) "CHW return setpoint" @@ -96,7 +95,7 @@ model OneSourceOneUser "(Draft) District system with one source and one user" extent={{-10,-10},{10,10}}, rotation=0, origin={-90,0}))); - Modelica.Blocks.Math.Gain gaiPum2(k=1/con.dp_nominal) "Gain" annotation ( + Modelica.Blocks.Math.Gain gaiPum2(k=1/usr.dp_nominal) "Gain" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, @@ -114,15 +113,15 @@ model OneSourceOneUser "(Draft) District system with one source and one user" rotation=-90, origin={-70,30}))); equation - connect(set_TRet.y, con.TSet) + connect(set_TRet.y,usr. TSet) annotation (Line(points={{21,30},{32,30},{32,5},{39,5}},color={0,0,127})); - connect(preQCooLoa_flow.y, con.QCooLoa_flow) + connect(preQCooLoa_flow.y,usr. QCooLoa_flow) annotation (Line(points={{21,60},{34,60},{34,9},{39,9}}, color={0,0,127})); connect(cat.port_b, preDro1.port_a) annotation (Line(points={{-40,0},{-10,0}}, color={0,127,255})); - connect(preDro1.port_b, con.port_a) + connect(preDro1.port_b,usr. port_a) annotation (Line(points={{10,0},{40,0}}, color={0,127,255})); - connect(con.port_b, preDro2.port_a) + connect(usr.port_b, preDro2.port_a) annotation (Line(points={{60,0},{60,-40},{10,-40}}, color={0,127,255})); connect(preDro2.port_b, cat.port_a) annotation (Line(points={{-10,-40},{-60,-40},{-60,0}}, color={0,127,255})); @@ -130,8 +129,9 @@ equation annotation (Line(points={{-70,-79},{-70,-72}}, color={0,0,127})); connect(sou_p.ports[1], cat.port_a) annotation (Line(points={{-80,0},{-60,0}}, color={0,127,255})); - connect(con.dp, gaiPum2.u) annotation (Line(points={{47,11},{46,11},{46,20},{70, - 20},{70,-60},{-28,-60}}, color={0,0,127})); + connect(usr.dp, gaiPum2.u) annotation (Line(points={{47,11},{46,11},{46,20},{ + 70,20},{70,-60},{-28,-60}}, + color={0,0,127})); connect(gaiPum2.y, conPI_pum2.u_m) annotation (Line(points={{-51,-60},{-58,-60}}, color={0,0,127})); connect(conPI_pum2.y, cat.yPum2) @@ -140,7 +140,7 @@ equation annotation (Line(points={{-70,50},{-70,42}}, color={255,0,255})); connect(booToReaPum1.y, cat.set_mPum1_flow) annotation (Line(points={{-70,18},{-70,9},{-61,9}}, color={0,0,127})); - connect(hysPum1.u, con.yVal_actual) annotation (Line(points={{-70,74},{-70,80}, + connect(hysPum1.u,usr. yVal_actual) annotation (Line(points={{-70,74},{-70,80}, {43,80},{43,11}}, color={0,0,127})); annotation(experiment(Tolerance=1e-06, StopTime=3600)); end OneSourceOneUser; diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index 4697f05fdf3..f73c276916b 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -46,37 +46,37 @@ model TwoSourcesThreeUsers annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=90, origin={-60,-60}))); - Buildings.Fluid.Storage.Plant.DummyConsumer con1( + Buildings.Fluid.Storage.Plant.DummyUser usr1( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, - p_a_nominal=p_CHWS_nominal-dp_nominal*0.35, - p_b_nominal=p_CHWR_nominal+dp_nominal*0.35, + p_a_nominal=p_CHWS_nominal - dp_nominal*0.35, + p_b_nominal=p_CHWR_nominal + dp_nominal*0.35, T_a_nominal=T_CHWS_nominal, - T_b_nominal=T_CHWR_nominal) - "Dummy consumer 1" - annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + T_b_nominal=T_CHWR_nominal) "Dummy user 1" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, rotation=-90, origin={60,60}))); - Buildings.Fluid.Storage.Plant.DummyConsumer con2( + Buildings.Fluid.Storage.Plant.DummyUser usr2( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, p_a_nominal=p_CHWS_nominal - dp_nominal*0.35, p_b_nominal=p_CHWR_nominal + dp_nominal*0.35, T_a_nominal=T_CHWS_nominal, - T_b_nominal=T_CHWR_nominal) - "Dummy consumer 1" - annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + T_b_nominal=T_CHWR_nominal) "Dummy usr 2" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, rotation=-90, origin={60,0}))); - Buildings.Fluid.Storage.Plant.DummyConsumer con3( + Buildings.Fluid.Storage.Plant.DummyUser usr3( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, p_a_nominal=p_CHWS_nominal - dp_nominal*0.35, p_b_nominal=p_CHWR_nominal + dp_nominal*0.35, T_a_nominal=T_CHWS_nominal, - T_b_nominal=T_CHWR_nominal) - "Dummy consumer 1" - annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + T_b_nominal=T_CHWR_nominal) "Dummy user 3" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, rotation=-90, origin={60,-60}))); Buildings.Fluid.Movers.SpeedControlled_y pumChi1( @@ -88,19 +88,19 @@ model TwoSourcesThreeUsers final y_start=1, T_start=T_CHWR_nominal) "Supply pump for chiller 1" annotation (Placement( transformation(extent={{-70,70},{-50,90}}, rotation=0))); - Buildings.Controls.OBC.CDL.Continuous.MultiMin mulMin_dpCon(nin=3) - "Min of pressure head measured from all consumers" + Buildings.Controls.OBC.CDL.Continuous.MultiMin mulMin_dpUsr(nin=3) + "Min of pressure head measured from all users" annotation (Placement(transformation(extent={{10,-10},{-10,10}}, rotation=90, origin={-90,150}))); - Modelica.Blocks.Sources.Constant set_dpCon(k=1) + Modelica.Blocks.Sources.Constant set_dpUsr(k=1) "Normalised consumer differential pressure setpoint" annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=-90, origin={-60,150}))); Modelica.Blocks.Sources.Constant set_TRet(k=12 + 273.15) "CHW return setpoint" - annotation (Placement(transformation(extent={{10,110},{30,130}}))); + annotation (Placement(transformation(extent={{20,100},{40,120}}))); Buildings.Controls.OBC.CDL.Continuous.Hysteresis hysCat(uLow=0.05, uHigh=0.5) "Shut off at con.yVal = 0.05 and restarts at 0.5" annotation (Placement( transformation( @@ -146,61 +146,53 @@ model TwoSourcesThreeUsers extent={{10,10},{-10,-10}}, rotation=90, origin={-60,120}))); - Buildings.Fluid.FixedResistances.PressureDrop preDroS2C3( + Buildings.Fluid.FixedResistances.PressureDrop preDroS2U3( redeclare package Medium = Medium, final allowFlowReversal=true, final dp_nominal=0.3*dp_nominal, - final m_flow_nominal=m_flow_nominal) - "Flow resistance source 2 to consumer 3" + final m_flow_nominal=m_flow_nominal) "Flow resistance source 2 to user 3" annotation (Placement(transformation(extent={{-30,-50},{-10,-30}}))); - Buildings.Fluid.FixedResistances.PressureDrop preDroC3S2( + Buildings.Fluid.FixedResistances.PressureDrop preDroU3S2( redeclare package Medium = Medium, final allowFlowReversal=true, final dp_nominal=0.3*dp_nominal, - final m_flow_nominal=m_flow_nominal) - "Flow resistance consumer 3 to source 2" + final m_flow_nominal=m_flow_nominal) "Flow resistance user 3 to source 2" annotation (Placement(transformation(extent={{30,-90},{10,-70}}))); - Buildings.Fluid.FixedResistances.PressureDrop preDroS2C2( + Buildings.Fluid.FixedResistances.PressureDrop preDroS2U2( redeclare package Medium = Medium, final allowFlowReversal=true, final dp_nominal=0.3*dp_nominal, - final m_flow_nominal=m_flow_nominal) - "Flow resistance source 2 to consumer 2" + final m_flow_nominal=m_flow_nominal) "Flow resistance source 2 to user 2" annotation (Placement(transformation(extent={{-30,-10},{-10,10}}))); - Buildings.Fluid.FixedResistances.PressureDrop preDroC2S2( + Buildings.Fluid.FixedResistances.PressureDrop preDroU2S2( redeclare package Medium = Medium, final allowFlowReversal=true, final dp_nominal=0.3*dp_nominal, - final m_flow_nominal=m_flow_nominal) - "Flow resistance consumer 2 to source 2" + final m_flow_nominal=m_flow_nominal) "Flow resistance user 2 to source 2" annotation (Placement(transformation(extent={{30,-30},{10,-10}}))); - Buildings.Fluid.FixedResistances.PressureDrop preDroS1C2( + Buildings.Fluid.FixedResistances.PressureDrop preDroS1U2( redeclare package Medium = Medium, final allowFlowReversal=true, final dp_nominal=0.3*dp_nominal, - final m_flow_nominal=m_flow_nominal) - "Flow resistance source 1 to consumer 2" + final m_flow_nominal=m_flow_nominal) "Flow resistance source 1 to user 2" annotation (Placement(transformation(extent={{-30,10},{-10,30}}))); - Buildings.Fluid.FixedResistances.PressureDrop preDroC2S1( + Buildings.Fluid.FixedResistances.PressureDrop preDroU2S1( redeclare package Medium = Medium, final allowFlowReversal=true, final dp_nominal=0.3*dp_nominal, - final m_flow_nominal=m_flow_nominal) - "Flow resistance consumer 2 to source 1" + final m_flow_nominal=m_flow_nominal) "Flow resistance user 2 to source 1" annotation (Placement(transformation(extent={{30,-10},{10,10}}))); - Buildings.Fluid.FixedResistances.PressureDrop preDroS1C1( + Buildings.Fluid.FixedResistances.PressureDrop preDroS1U1( redeclare package Medium = Medium, final allowFlowReversal=true, final dp_nominal=0.3*dp_nominal, - final m_flow_nominal=m_flow_nominal) - "Flow resistance source 1 to consumer 3" + final m_flow_nominal=m_flow_nominal) "Flow resistance source 1 to user 3" annotation (Placement(transformation(extent={{-30,70},{-10,90}}))); - Buildings.Fluid.FixedResistances.PressureDrop preDroC1S1( + Buildings.Fluid.FixedResistances.PressureDrop preDroU1S1( redeclare package Medium = Medium, final allowFlowReversal=true, final dp_nominal=0.3*dp_nominal, - final m_flow_nominal=m_flow_nominal) - "Flow resistance consumer 1 to source 1" + final m_flow_nominal=m_flow_nominal) "Flow resistance user 1 to source 1" annotation (Placement(transformation(extent={{30,30},{10,50}}))); Modelica.Blocks.Sources.TimeTable set_QCooLoa1_flow(table=[0,0; 600,0; 600, QCooLoa_flow_nominal; 2400,QCooLoa_flow_nominal; 2400,0; 3600,0]) @@ -213,32 +205,32 @@ model TwoSourcesThreeUsers Modelica.Blocks.Sources.TimeTable set_QCooLoa3_flow(table=[0,0; 1800,0; 1800, QCooLoa_flow_nominal; 3600,QCooLoa_flow_nominal]) "Cooling load" annotation (Placement(transformation(extent={{120,-40},{100,-20}}))); - Modelica.Blocks.Math.Gain gaiCon1(k=1/con1.dp_nominal) + Modelica.Blocks.Math.Gain gaiUsr1(k=1/usr1.dp_nominal) "Gain to normalise dp measurement" annotation (Placement(transformation( extent={{10,-10},{-10,10}}, rotation=180, origin={110,60}))); - Modelica.Blocks.Math.Gain gaiCon2(k=1/con2.dp_nominal) + Modelica.Blocks.Math.Gain gaiUsr2(k=1/usr2.dp_nominal) "Gain to normalise dp measurement" annotation (Placement(transformation( extent={{10,-10},{-10,10}}, rotation=180, origin={110,0}))); - Modelica.Blocks.Math.Gain gaiCon3(k=1/con3.dp_nominal) + Modelica.Blocks.Math.Gain gaiUsr3(k=1/usr3.dp_nominal) "Gain to normalise dp measurement" annotation (Placement(transformation( extent={{10,-10},{-10,10}}, rotation=180, origin={110,-60}))); equation - connect(set_TRet.y, con1.TSet) annotation (Line(points={{31,120},{36,120},{36, - 76},{65,76},{65,71}}, color={0,0,127})); - connect(set_TRet.y, con2.TSet) annotation (Line(points={{31,120},{36,120},{36, - 16},{65,16},{65,11}}, color={0,0,127})); - connect(set_TRet.y, con3.TSet) annotation (Line(points={{31,120},{36,120},{36, - -44},{65,-44},{65,-49}}, color={0,0,127})); - connect(con3.yVal_actual, mulMax_yVal.u[1]) annotation (Line(points={{71,-53}, + connect(set_TRet.y,usr1. TSet) annotation (Line(points={{41,110},{44,110},{44, + 82},{65,82},{65,71}}, color={0,0,127})); + connect(set_TRet.y,usr2. TSet) annotation (Line(points={{41,110},{44,110},{44, + 22},{65,22},{65,11}}, color={0,0,127})); + connect(set_TRet.y,usr3. TSet) annotation (Line(points={{41,110},{44,110},{44, + -38},{65,-38},{65,-49}}, color={0,0,127})); + connect(usr3.yVal_actual, mulMax_yVal.u[1]) annotation (Line(points={{71,-53}, {86,-53},{86,-110},{74,-110},{74,-110.667},{62,-110.667}}, color={0,0, 127})); - connect(con2.yVal_actual, mulMax_yVal.u[2]) annotation (Line(points={{71,7},{86, + connect(usr2.yVal_actual, mulMax_yVal.u[2]) annotation (Line(points={{71,7},{86, 7},{86,-110},{62,-110}}, color={0,0,127})); connect(mulMax_yVal.y, hysCat.u) annotation (Line(points={{38,-110},{22,-110}}, color={0,0,127})); @@ -256,64 +248,66 @@ equation annotation (Line(points={{-80,70},{-80,80},{-70,80}}, color={0,127,255})); connect(sou_p.ports[1], preDroChi1.port_b) annotation (Line(points={{-80,0},{-80,40},{-70,40}}, color={0,127,255})); - connect(set_dpCon.y, conPI_PumChi1.u_s) + connect(set_dpUsr.y, conPI_PumChi1.u_s) annotation (Line(points={{-60,139},{-60,132}}, color={0,0,127})); connect(conPI_PumChi1.y, pumChi1.y) annotation (Line(points={{-60,109},{-60,92}}, color={0,0,127})); - connect(con1.yVal_actual, mulMax_yVal.u[3]) annotation (Line(points={{71,67}, + connect(usr1.yVal_actual, mulMax_yVal.u[3]) annotation (Line(points={{71,67}, {86,67},{86,-110},{62,-110},{62,-109.333}},color={0,0,127})); - connect(cat.port_b, preDroS2C3.port_a) annotation (Line(points={{-60,-50},{-60, + connect(cat.port_b,preDroS2U3. port_a) annotation (Line(points={{-60,-50},{-60, -40},{-30,-40}}, color={0,127,255})); - connect(preDroS2C3.port_b, con3.port_a) + connect(preDroS2U3.port_b,usr3. port_a) annotation (Line(points={{-10,-40},{60,-40},{60,-50}}, color={0,127,255})); - connect(con3.port_b, preDroC3S2.port_a) + connect(usr3.port_b,preDroU3S2. port_a) annotation (Line(points={{60,-70},{60,-80},{30,-80}}, color={0,127,255})); - connect(preDroC3S2.port_b, cat.port_a) annotation (Line(points={{10,-80},{-60, + connect(preDroU3S2.port_b, cat.port_a) annotation (Line(points={{10,-80},{-60, -80},{-60,-70}}, color={0,127,255})); - connect(cat.port_b, preDroS2C2.port_a) annotation (Line(points={{-60,-50},{-60, + connect(cat.port_b,preDroS2U2. port_a) annotation (Line(points={{-60,-50},{-60, -40},{-36,-40},{-36,0},{-30,0}}, color={0,127,255})); - connect(preDroS2C2.port_b, con2.port_a) annotation (Line(points={{-10,0},{-4,0}, - {-4,10},{60,10}}, color={0,127,255})); - connect(con2.port_b, preDroC2S2.port_a) + connect(preDroS2U2.port_b,usr2. port_a) annotation (Line(points={{-10,0},{-4, + 0},{-4,20},{60,20},{60,10}}, + color={0,127,255})); + connect(usr2.port_b,preDroU2S2. port_a) annotation (Line(points={{60,-10},{60,-20},{30,-20}}, color={0,127,255})); - connect(preDroC2S2.port_b, cat.port_a) annotation (Line(points={{10,-20},{4,-20}, + connect(preDroU2S2.port_b, cat.port_a) annotation (Line(points={{10,-20},{4,-20}, {4,-80},{-60,-80},{-60,-70}}, color={0,127,255})); - connect(pumChi1.port_b, preDroS1C2.port_a) annotation (Line(points={{-50,80},{ + connect(pumChi1.port_b,preDroS1U2. port_a) annotation (Line(points={{-50,80},{ -36,80},{-36,20},{-30,20}}, color={0,127,255})); - connect(preDroS1C2.port_b, con2.port_a) annotation (Line(points={{-10,20},{-4, - 20},{-4,10},{60,10}}, color={0,127,255})); - connect(con2.port_b, preDroC2S1.port_a) annotation (Line(points={{60,-10},{60, + connect(preDroS1U2.port_b,usr2. port_a) annotation (Line(points={{-10,20},{60, + 20},{60,10}}, color={0,127,255})); + connect(usr2.port_b,preDroU2S1. port_a) annotation (Line(points={{60,-10},{60, -20},{34,-20},{34,0},{30,0}}, color={0,127,255})); - connect(preDroC2S1.port_b, preDroChi1.port_a) annotation (Line(points={{10,0}, + connect(preDroU2S1.port_b, preDroChi1.port_a) annotation (Line(points={{10,0}, {4,0},{4,40},{-50,40}}, color={0,127,255})); - connect(pumChi1.port_b, preDroS1C1.port_a) + connect(pumChi1.port_b,preDroS1U1. port_a) annotation (Line(points={{-50,80},{-30,80}}, color={0,127,255})); - connect(preDroS1C1.port_b, con1.port_a) + connect(preDroS1U1.port_b,usr1. port_a) annotation (Line(points={{-10,80},{60,80},{60,70}}, color={0,127,255})); - connect(con1.port_b, preDroC1S1.port_a) + connect(usr1.port_b,preDroU1S1. port_a) annotation (Line(points={{60,50},{60,40},{30,40}}, color={0,127,255})); - connect(preDroC1S1.port_b, preDroChi1.port_a) + connect(preDroU1S1.port_b, preDroChi1.port_a) annotation (Line(points={{10,40},{-50,40}}, color={0,127,255})); - connect(set_QCooLoa1_flow.y, con1.QCooLoa_flow) + connect(set_QCooLoa1_flow.y,usr1. QCooLoa_flow) annotation (Line(points={{99,90},{69,90},{69,71}}, color={0,0,127})); - connect(set_QCooLoa2_flow.y, con2.QCooLoa_flow) + connect(set_QCooLoa2_flow.y,usr2. QCooLoa_flow) annotation (Line(points={{99,30},{69,30},{69,11}}, color={0,0,127})); - connect(set_QCooLoa3_flow.y, con3.QCooLoa_flow) + connect(set_QCooLoa3_flow.y,usr3. QCooLoa_flow) annotation (Line(points={{99,-30},{69,-30},{69,-49}}, color={0,0,127})); - connect(con1.dp, gaiCon1.u) + connect(usr1.dp,gaiUsr1. u) annotation (Line(points={{71,63},{71,60},{98,60}}, color={0,0,127})); - connect(con2.dp, gaiCon2.u) annotation (Line(points={{71,3},{71,1.55431e-15},{ + connect(usr2.dp,gaiUsr2. u) annotation (Line(points={{71,3},{71,1.55431e-15},{ 98,1.55431e-15}}, color={0,0,127})); - connect(con3.dp, gaiCon3.u) annotation (Line(points={{71,-57},{92,-57},{92,-60}, - {98,-60}}, color={0,0,127})); - connect(gaiCon1.y, mulMin_dpCon.u[1]) annotation (Line(points={{121,60},{126, + connect(usr3.dp,gaiUsr3. u) annotation (Line(points={{71,-57},{72,-57},{72, + -60},{98,-60}}, + color={0,0,127})); + connect(gaiUsr1.y,mulMin_dpUsr. u[1]) annotation (Line(points={{121,60},{126, 60},{126,162},{-89.3333,162}}, color={0,0,127})); - connect(gaiCon2.y, mulMin_dpCon.u[2]) annotation (Line(points={{121,-1.38778e-15}, + connect(gaiUsr2.y,mulMin_dpUsr. u[2]) annotation (Line(points={{121,-1.38778e-15}, {126,-1.38778e-15},{126,162},{-90,162}}, color={0,0,127})); - connect(gaiCon3.y, mulMin_dpCon.u[3]) annotation (Line(points={{121,-60},{126, + connect(gaiUsr3.y,mulMin_dpUsr. u[3]) annotation (Line(points={{121,-60},{126, -60},{126,162},{-90.6667,162}}, color={0,0,127})); - connect(mulMin_dpCon.y, conPI_PumChi1.u_m) + connect(mulMin_dpUsr.y, conPI_PumChi1.u_m) annotation (Line(points={{-90,138},{-90,120},{-72,120}}, color={0,0,127})); annotation (experiment(Tolerance=1e-06, StopTime=3600,__Dymola_Algorithm="Cvode"), Diagram(coordinateSystem(extent={{-100,-140},{140,180}})), Icon( diff --git a/Buildings/Fluid/Storage/Plant/Validation/DummyConsumer.mo b/Buildings/Fluid/Storage/Plant/Validation/DummyUser.mo similarity index 80% rename from Buildings/Fluid/Storage/Plant/Validation/DummyConsumer.mo rename to Buildings/Fluid/Storage/Plant/Validation/DummyUser.mo index e8d9657933b..ec9838678e3 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/DummyConsumer.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/DummyUser.mo @@ -1,5 +1,5 @@ within Buildings.Fluid.Storage.Plant.Validation; -model DummyConsumer "Test model for the dummy consumer" +model DummyUser "Test model for the dummy user" extends Modelica.Icons.Example; package Medium = Buildings.Media.Water "Medium model"; @@ -24,18 +24,15 @@ model DummyConsumer "Test model for the dummy consumer" parameter Boolean allowFlowReversal=false "Flow reversal setting"; - Buildings.Fluid.Storage.Plant.DummyConsumer ideCon( + Buildings.Fluid.Storage.Plant.DummyUser ideUsr( redeclare package Medium = Medium, - vol(T_start=15+273.15), + vol(T_start=15 + 273.15), m_flow_nominal=m_flow_nominal, p_a_nominal=p_CHWS_nominal, p_b_nominal=p_CHWR_nominal, T_a_nominal=T_CHWS_nominal, - T_b_nominal=T_CHWR_nominal) - "Ideal consumer" - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0))); + T_b_nominal=T_CHWR_nominal) "Ideal user" annotation (Placement( + transformation(extent={{-10,-10},{10,10}}, rotation=0))); Modelica.Blocks.Sources.Constant set_TRet(k=12 + 273.15) "CHW return setpoint" annotation (Placement(transformation(extent={{-80,40},{-60,60}}))); @@ -62,14 +59,15 @@ model DummyConsumer "Test model for the dummy consumer" "Placeholder, prescribed cooling load" annotation (Placement(transformation(extent={{-60,80},{-40,100}}))); equation - connect(set_TRet.y, ideCon.TSet) + connect(set_TRet.y,ideUsr. TSet) annotation (Line(points={{-59,50},{-30,50},{-30,5},{-11,5}}, color={0,0,127})); - connect(sou.ports[1], ideCon.port_a) annotation (Line(points={{-60,-6.66134e-16}, - {-35.1,-6.66134e-16},{-35.1,0},{-10.2,0}}, color={0,127,255})); - connect(ideCon.port_b, sin.ports[1]) + connect(sou.ports[1],ideUsr. port_a) annotation (Line(points={{-60, + -6.66134e-16},{-35.1,-6.66134e-16},{-35.1,0},{-10,0}}, + color={0,127,255})); + connect(ideUsr.port_b, sin.ports[1]) annotation (Line(points={{10,0},{60,0}}, color={0,127,255})); - connect(preQCooLoa_flow.y, ideCon.QCooLoa_flow) annotation (Line(points={{-39, + connect(preQCooLoa_flow.y,ideUsr. QCooLoa_flow) annotation (Line(points={{-39, 90},{-18,90},{-18,9},{-11,9}}, color={0,0,127})); annotation(experiment(Tolerance=1e-06, StopTime=3600)); -end DummyConsumer; +end DummyUser; diff --git a/Buildings/Fluid/Storage/Plant/Validation/package.order b/Buildings/Fluid/Storage/Plant/Validation/package.order index cb018233fd7..ad74b08aa47 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/package.order +++ b/Buildings/Fluid/Storage/Plant/Validation/package.order @@ -1,3 +1,3 @@ ChillerAndTankNoRemoteCharging ChillerAndTankWithRemoteCharging -DummyConsumer +DummyUser diff --git a/Buildings/Fluid/Storage/Plant/package.order b/Buildings/Fluid/Storage/Plant/package.order index e123057f03a..9e095ba0338 100644 --- a/Buildings/Fluid/Storage/Plant/package.order +++ b/Buildings/Fluid/Storage/Plant/package.order @@ -1,7 +1,7 @@ ChillerAndTankNoRemoteCharging ChillerAndTankWithRemoteCharging TemperatureSource -DummyConsumer +DummyUser Examples Validation BaseClasses From 2058f70bb60ac93ddf5fd80d50e62d641c82fe7b Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Mon, 14 Feb 2022 16:03:17 -0800 Subject: [PATCH 024/463] improved var names and descriptions --- .../Plant/BaseClasses/ChillerAndTank.mo | 2 -- .../BaseClasses/ReversiblePumpValveControl.mo | 10 +++--- .../Plant/ChillerAndTankNoRemoteCharging.mo | 2 ++ .../Plant/ChillerAndTankWithRemoteCharging.mo | 35 +++++++++++++------ .../ChillerAndTankWithRemoteCharging.mo | 11 +++--- 5 files changed, 37 insertions(+), 23 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo index 8f14bafaeac..0fc11e6339e 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo @@ -148,8 +148,6 @@ equation annotation (Line(points={{-40,40},{-10,40}}, color={0,127,255})); connect(jun1.port_2, pum1.port_a) annotation (Line(points={{-70,0},{-64,0},{-64, 40},{-60,40}}, color={0,127,255})); - connect(pum1.m_flow_in, set_mPum1_flow) - annotation (Line(points={{-50,52},{-50,110}}, color={0,0,127})); connect(ideTan.m_flow,mTan_flow) annotation (Line(points={{-7,-49},{-7,-46}, {-40,-46},{-40,-110}}, color={0,0,127})); annotation ( diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo index ac35d908b5e..b1424f3ba96 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo @@ -78,10 +78,10 @@ block ReversiblePumpValveControl extent={{-10,-10},{10,10}}, rotation=-90, origin={70,-80}))); - Controls.OBC.CDL.Interfaces.BooleanInput onOffLin - "Plant online/offline signal, true = online, false = offline" annotation ( - Placement(transformation(extent={{-120,-90},{-100,-70}}), - iconTransformation(extent={{-140,-90},{-100,-50}}))); + Controls.OBC.CDL.Interfaces.BooleanInput booOnOff + "True = plant online, False = plant offline" annotation (Placement( + transformation(extent={{-120,-90},{-100,-70}}), iconTransformation( + extent={{-140,-90},{-100,-50}}))); Modelica.Blocks.Interfaces.RealOutput yPum2 "Normalised speed" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, @@ -157,7 +157,7 @@ equation 60},{0,110}}, color={0,0,127})); connect(conPI_pum2.u_m, um_mTan_flow) annotation (Line(points={{-58,60},{ -50,60},{-50,90},{0,90},{0,110}}, color={0,0,127})); - connect(swiOnOff.u2, onOffLin) + connect(swiOnOff.u2, booOnOff) annotation (Line(points={{-62,-80},{-110,-80}}, color={255,0,255})); connect(swiOnOff.y, minPum2.u2) annotation (Line(points={{-38,-80},{-34,-80},{ -34,-56},{-16,-56},{-16,-68}}, color={0,0,127})); diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo index 76c089d0d33..43aee2b1b3c 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo @@ -13,6 +13,8 @@ equation -166,0},{-180,0}}, color={0,127,255})); connect(pum2.port_b, jun1.port_1) annotation (Line(points={{-140,20},{-96,20}, {-96,0},{-90,0}}, color={0,127,255})); + connect(pum1.m_flow_in, set_mPum1_flow) + annotation (Line(points={{-50,52},{-50,110}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,100}})), Diagram( coordinateSystem(preserveAspectRatio=false, extent={{-180,-100},{100,100}}))); diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo index 593870c19ec..e871d678432 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo @@ -6,12 +6,12 @@ model ChillerAndTankWithRemoteCharging Buildings.Fluid.Storage.Plant.BaseClasses.ReversiblePumpValveControl pum2Con "Control block for secondary pump-valve group" annotation (Placement(transformation(extent={{-140,58},{-120,80}}))); - Buildings.Controls.OBC.CDL.Interfaces.BooleanInput onOffLin - "Plant online/offline signal, true = online, false = offline" annotation ( - Placement(transformation(extent={{-202,28},{-180,50}}), - iconTransformation(extent={{-140,-110},{-100,-70}}))); + Buildings.Controls.OBC.CDL.Interfaces.BooleanInput booOnOff + "Plant status: true = online; false = offline" annotation (Placement( + transformation(extent={{-202,28},{-180,50}}), iconTransformation(extent= + {{-140,-110},{-100,-70}}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanInput booFloDir - "Flow direction, true = normal, false = reverse" annotation (Placement( + "Flow direction: true = normal; false = reverse" annotation (Placement( transformation(extent={{-202,68},{-180,90}}), iconTransformation( extent={{-140,-70},{-100,-30}}))); Modelica.Blocks.Interfaces.RealInput set_mTan_flow @@ -38,12 +38,19 @@ model ChillerAndTankWithRemoteCharging dpValve_nominal=1, m_flow_nominal=m2_flow_nominal) "Valve in parallel to the pump (reverse direction)" annotation (Placement(transformation(extent={{-120,-30},{-140,-10}}))); + Buildings.Controls.OBC.CDL.Continuous.Switch swiFloDirPum2 "Flow direction of pum2" + annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-50,70}))); + Modelica.Blocks.Sources.Constant conZero(k=0) "Constant y = 0" + annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + rotation=90, + origin={-90,70}))); equation connect(booFloDir, pum2Con.booFloDir) annotation (Line(points={{-191,79},{ -172,79},{-172,65.7},{-142,65.7}}, color={255,0,255})); - connect(pum2Con.onOffLin, onOffLin) annotation (Line(points={{-142,61.3},{ - -142,62},{-160,62},{-160,39},{-191,39}}, - color={255,0,255})); + connect(pum2Con.booOnOff, booOnOff) annotation (Line(points={{-142,61.3},{-142, + 62},{-160,62},{-160,39},{-191,39}}, color={255,0,255})); connect(jun1.port_1, val2.port_a) annotation (Line(points={{-90,0},{-94,0},{-94, -20},{-120,-20}}, color={0,127,255})); connect(val2.port_b, port_a) annotation (Line(points={{-140,-20},{-164,-20},{-164, @@ -54,8 +61,8 @@ equation {-130,-2},{-130,-8}}, color={0,0,127})); connect(pum2Con.yVal1, val1.y) annotation (Line(points={{-123,56.9},{-110,56.9}, {-110,32}}, color={0,0,127})); - connect(pum2Con.um_mTan_flow, ideTan.m_flow) annotation (Line(points={{-141, - 76.7},{-142,76.7},{-142,78},{-170,78},{-170,-42},{-7,-42},{-7,-49}}, + connect(pum2Con.um_mTan_flow, ideTan.m_flow) annotation (Line(points={{-141,76.7}, + {-142,76.7},{-142,78},{-170,78},{-170,-46},{-7,-46},{-7,-49}}, color={0,0,127})); connect(pum2Con.us_mTan_flow, set_mTan_flow) annotation (Line(points={{-141, 72.3},{-160,72.3},{-160,110}}, color={0,0,127})); @@ -65,6 +72,14 @@ equation annotation (Line(points={{-140,20},{-120,20}}, color={0,127,255})); connect(pum2.y, pum2Con.yPum2) annotation (Line(points={{-150,32},{-150,50},{ -131,50},{-131,56.9}}, color={0,0,127})); + connect(swiFloDirPum2.u2, booFloDir) annotation (Line(points={{-50,82},{-50,88}, + {-174,88},{-174,79},{-191,79}}, color={255,0,255})); + connect(swiFloDirPum2.u1, set_mPum1_flow) annotation (Line(points={{-42,82},{-42, + 96},{-50,96},{-50,110}}, color={0,0,127})); + connect(pum1.m_flow_in, swiFloDirPum2.y) + annotation (Line(points={{-50,52},{-50,58}}, color={0,0,127})); + connect(conZero.y, swiFloDirPum2.u3) annotation (Line(points={{-90,81},{-90,86}, + {-58,86},{-58,82}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,100}}), graphics={Line( points={{-80,-20},{-20,-20}}, diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo index 67cf5a255e6..e826d7d158d 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo @@ -62,10 +62,10 @@ model ChillerAndTankWithRemoteCharging "Tank flow rate setpoint" annotation (Placement(transformation(extent={{-80,60},{-60,80}}))); Modelica.Blocks.Sources.BooleanTable booFloDir(table={0,3600/7*6}) - "Flow direction (true = normal, false = reverse)" + "Flow direction: True = normal; False = reverse" annotation (Placement(transformation(extent={{-80,20},{-60,40}}))); - Modelica.Blocks.Sources.BooleanTable booOnOffLin(table={3600/7*2}) - "Plant online/offline (true = online, false = offline)" + Modelica.Blocks.Sources.BooleanTable booOnOff(table={3600/7*2}) + "True = online; False = offline" annotation (Placement(transformation(extent={{-80,-40},{-60,-20}}))); Modelica.Blocks.Sources.TimeTable set_mChi_flow(table=[0,0; 3600/7,0; 3600/7, 1; 3600/7*5,1; 3600/7*5,0]) "Chiller flow rate setpoint" @@ -76,9 +76,8 @@ equation connect(cat.port_b, sin.ports[1]) annotation (Line(points={{12,0},{35,0},{35,4.44089e-16}, {50,4.44089e-16}}, color={0,127,255})); - connect(booOnOffLin.y, cat.onOffLin) annotation (Line(points={{-59,-30},{-20, - -30},{-20,-9},{-10,-9}}, - color={255,0,255})); + connect(booOnOff.y, cat.booOnOff) annotation (Line(points={{-59,-30},{-20,-30}, + {-20,-9},{-10,-9}}, color={255,0,255})); connect(booFloDir.y,cat.booFloDir) annotation (Line(points={{-59,30},{-40,30}, {-40,-4},{-10,-4},{-10,-5}}, color={255,0,255})); From 9fcbfca209ed26291044bbbad3d10c15932faf00 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Tue, 15 Feb 2022 07:20:28 -0800 Subject: [PATCH 025/463] improved parameterisation --- .../Plant/ChillerAndTankWithRemoteCharging.mo | 6 +- .../Plant/Examples/TwoSourcesThreeUsers.mo | 83 +++++++++++++------ 2 files changed, 63 insertions(+), 26 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo index e871d678432..465687a7660 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo @@ -36,9 +36,11 @@ model ChillerAndTankWithRemoteCharging use_inputFilter=false, l=1E-10, dpValve_nominal=1, - m_flow_nominal=m2_flow_nominal) "Valve in parallel to the pump (reverse direction)" + m_flow_nominal=m2_flow_nominal) + "Valve in parallel to the secondary pump (reverse direction)" annotation (Placement(transformation(extent={{-120,-30},{-140,-10}}))); - Buildings.Controls.OBC.CDL.Continuous.Switch swiFloDirPum2 "Flow direction of pum2" + Buildings.Controls.OBC.CDL.Continuous.Switch swiFloDirPum2 + "Flow direction of secondary pump-valve group" annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=-90, origin={-50,70}))); diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index f73c276916b..b4d89112f05 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -110,14 +110,8 @@ model TwoSourcesThreeUsers Buildings.Controls.OBC.CDL.Continuous.MultiMax mulMax_yVal(nin=3) "Max of valve positions" annotation (Placement(transformation(extent={{60,-120},{40,-100}}))); - Modelica.Blocks.Sources.BooleanConstant booFloDir - "Placeholder, constant normal direction" - annotation (Placement(transformation(extent={{-20,-140},{-40,-120}}))); - Modelica.Blocks.Sources.Constant set_mTan_flow(k=0.75*m_flow_nominal) - "Placeholder, tank flow rate setpoint" - annotation (Placement(transformation(extent={{-100,-140},{-80,-120}}))); - Modelica.Blocks.Sources.Constant set_mChi2_flow(k=0.75*m_flow_nominal) - "Placeholder, chiller 2 flow rate setpoint" + Modelica.Blocks.Sources.Constant set_mChi2Pum1_flow(k=0.75*m_flow_nominal) + "Placeholder, primary flow rate setpoint" annotation (Placement(transformation(extent={{-100,-100},{-80,-80}}))); Buildings.Fluid.Sources.Boundary_pT sou_p( redeclare final package Medium = Medium, @@ -194,16 +188,19 @@ model TwoSourcesThreeUsers final dp_nominal=0.3*dp_nominal, final m_flow_nominal=m_flow_nominal) "Flow resistance user 1 to source 1" annotation (Placement(transformation(extent={{30,30},{10,50}}))); - Modelica.Blocks.Sources.TimeTable set_QCooLoa1_flow(table=[0,0; 600,0; 600, - QCooLoa_flow_nominal; 2400,QCooLoa_flow_nominal; 2400,0; 3600,0]) + Modelica.Blocks.Sources.TimeTable set_QCooLoa1_flow(table=[0,0; 3600/9*1,0; + 3600/9*1,QCooLoa_flow_nominal; 3600/9*4,QCooLoa_flow_nominal; 3600/9*4, + 0; 3600,0]) "Cooling load" annotation (Placement(transformation(extent={{120,80},{100,100}}))); - Modelica.Blocks.Sources.TimeTable set_QCooLoa2_flow(table=[0,0; 1200,0; 1200, - QCooLoa_flow_nominal; 3000,QCooLoa_flow_nominal; 3000,0; 3600,0]) + Modelica.Blocks.Sources.TimeTable set_QCooLoa2_flow(table=[0,0; 3600/9*2,0; + 3600/9*2,QCooLoa_flow_nominal; 3600/9*5,QCooLoa_flow_nominal; 3600/9*5, + 0; 3600,0]) "Cooling load" annotation (Placement(transformation(extent={{120,20},{100,40}}))); - Modelica.Blocks.Sources.TimeTable set_QCooLoa3_flow(table=[0,0; 1800,0; 1800, - QCooLoa_flow_nominal; 3600,QCooLoa_flow_nominal]) "Cooling load" + Modelica.Blocks.Sources.TimeTable set_QCooLoa3_flow(table=[0,0; 3600/9*3,0; + 3600/9*3,QCooLoa_flow_nominal; 3600/9*7,QCooLoa_flow_nominal; 3600/9*7, + 0; 3600,0]) "Cooling load" annotation (Placement(transformation(extent={{120,-40},{100,-20}}))); Modelica.Blocks.Math.Gain gaiUsr1(k=1/usr1.dp_nominal) "Gain to normalise dp measurement" annotation (Placement(transformation( @@ -220,6 +217,37 @@ model TwoSourcesThreeUsers extent={{10,-10},{-10,10}}, rotation=180, origin={110,-60}))); + Modelica.Blocks.Sources.BooleanTable booFloDir(table={3600/9*6,3600/9*8}, + startValue=true) "Flow direction: True = normal; False = reverse" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={10,-210}))); + Buildings.Controls.OBC.CDL.Continuous.Switch swiTanCha + "Tank setpoint: True = positive (discharging); False = negative (charging)" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={-50,-130}))); + Modelica.Blocks.Sources.Constant set_mTan_flow_discharge(k=0.75* + m_flow_nominal) "Placeholder, tank flow rate setpoint when discharging" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={-70,-170}))); + Modelica.Blocks.Sources.Constant set_mTan_flow_charge(k=-0.75*m_flow_nominal) + "Placeholder, tank flow rate setpoint when charging" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={-30,-170}))); + Modelica.Blocks.Sources.BooleanTable booTanCha(table={3600/9*1,3600/9*6,3600/9 + *8}, startValue=false) + "Tank charging status (local or remote): True = discharging; False = charging" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={-50,-210}))); equation connect(set_TRet.y,usr1. TSet) annotation (Line(points={{41,110},{44,110},{44, 82},{65,82},{65,71}}, color={0,0,127})); @@ -234,14 +262,11 @@ equation 7},{86,-110},{62,-110}}, color={0,0,127})); connect(mulMax_yVal.y, hysCat.u) annotation (Line(points={{38,-110},{22,-110}}, color={0,0,127})); - connect(hysCat.y, cat.onOffLin) annotation (Line(points={{-2,-110},{-50,-110}, - {-50,-72},{-51,-72}}, color={255,0,255})); - connect(booFloDir.y, cat.booFloDir) annotation (Line(points={{-41,-130},{-55,-130}, - {-55,-72}}, color={255,0,255})); - connect(set_mTan_flow.y, cat.set_mTan_flow) annotation (Line(points={{-79,-130}, - {-65,-130},{-65,-71}}, color={0,0,127})); - connect(set_mChi2_flow.y, cat.set_mPum1_flow) annotation (Line(points={{-79,-90}, - {-70,-90},{-70,-71},{-69,-71}}, color={0,0,127})); + connect(hysCat.y, cat.booOnOff) annotation (Line(points={{-2,-110},{-26,-110}, + {-26,-92},{-50,-92},{-50,-72},{-51,-72}}, + color={255,0,255})); + connect(set_mChi2Pum1_flow.y, cat.set_mPum1_flow) annotation (Line(points={{-79, + -90},{-70,-90},{-70,-71},{-69,-71}}, color={0,0,127})); connect(preDroChi1.port_b, chi1.port_a) annotation (Line(points={{-70,40},{-80,40},{-80,50}}, color={0,127,255})); connect(chi1.port_b, pumChi1.port_a) @@ -309,7 +334,17 @@ equation -60},{126,162},{-90.6667,162}}, color={0,0,127})); connect(mulMin_dpUsr.y, conPI_PumChi1.u_m) annotation (Line(points={{-90,138},{-90,120},{-72,120}}, color={0,0,127})); - annotation (experiment(Tolerance=1e-06, StopTime=3600,__Dymola_Algorithm="Cvode"), - Diagram(coordinateSystem(extent={{-100,-140},{140,180}})), Icon( + connect(booFloDir.y, cat.booFloDir) annotation (Line(points={{10,-199},{10,-132}, + {-34,-132},{-34,-100},{-55,-100},{-55,-72}}, color={255,0,255})); + connect(set_mTan_flow_discharge.y, swiTanCha.u1) annotation (Line(points={{-70, + -159},{-70,-150},{-58,-150},{-58,-142}}, color={0,0,127})); + connect(set_mTan_flow_charge.y, swiTanCha.u3) annotation (Line(points={{-30,-159}, + {-30,-150},{-42,-150},{-42,-142}}, color={0,0,127})); + connect(booTanCha.y, swiTanCha.u2) + annotation (Line(points={{-50,-199},{-50,-142}}, color={255,0,255})); + connect(swiTanCha.y, cat.set_mTan_flow) annotation (Line(points={{-50,-118},{-50, + -112},{-65,-112},{-65,-71}}, color={0,0,127})); + annotation (experiment(Tolerance=1e-06, StopTime=3600,__Dymola_Algorithm="Dassl"), + Diagram(coordinateSystem(extent={{-100,-220},{140,180}})), Icon( coordinateSystem(extent={{-100,-100},{100,100}}))); end TwoSourcesThreeUsers; From fc1db6e32416f4563907aaf807592597b83040d8 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Tue, 15 Feb 2022 15:40:32 -0800 Subject: [PATCH 026/463] combined different configs of cat models into one --- .../Storage/Plant/BaseClasses/FluidThrough.mo | 18 +++ .../BaseClasses/ReversiblePumpValveControl.mo | 2 +- .../Plant/BaseClasses/SignalThrough.mo | 27 ++++ .../Storage/Plant/BaseClasses/package.order | 3 +- .../Plant/{BaseClasses => }/ChillerAndTank.mo | 153 +++++++++++++++--- .../Plant/ChillerAndTankNoRemoteCharging.mo | 21 --- .../Plant/ChillerAndTankWithRemoteCharging.mo | 95 ----------- .../Plant/Examples/OneSourceOneUser.mo | 51 +++--- .../Plant/Examples/TwoSourcesThreeUsers.mo | 9 +- .../Storage/Plant/Examples/package.order | 1 + .../ChillerAndTankNoRemoteCharging.mo | 39 ++--- .../ChillerAndTankWithRemoteCharging.mo | 13 +- Buildings/Fluid/Storage/Plant/package.order | 5 +- 13 files changed, 243 insertions(+), 194 deletions(-) create mode 100644 Buildings/Fluid/Storage/Plant/BaseClasses/FluidThrough.mo create mode 100644 Buildings/Fluid/Storage/Plant/BaseClasses/SignalThrough.mo rename Buildings/Fluid/Storage/Plant/{BaseClasses => }/ChillerAndTank.mo (51%) delete mode 100644 Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo delete mode 100644 Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/FluidThrough.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/FluidThrough.mo new file mode 100644 index 00000000000..b7d0b8e6abe --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/FluidThrough.mo @@ -0,0 +1,18 @@ +within Buildings.Fluid.Storage.Plant.BaseClasses; +model FluidThrough "Fluid passes through" + extends Interfaces.PartialTwoPort; +equation + connect(port_a, port_b) annotation (Line(points={{-100,0},{0,0},{0,0},{100,0}}, + color={0,127,255})); + annotation ( + defaultComponentName="pas", + Icon(coordinateSystem(preserveAspectRatio=false), + graphics={Line( + points={{-100,0},{100,0}}, + color={28,108,200}, + thickness=1)}), Diagram(coordinateSystem(preserveAspectRatio=false)), + Documentation(info=" +Fluid directly passes through the two ports. +This is used to replace conditionally-enabled components with a connection. +")); +end FluidThrough; diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo index b1424f3ba96..54f01106c4f 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo @@ -48,7 +48,7 @@ block ReversiblePumpValveControl transformation(extent={{-120,0},{-100,20}}), iconTransformation( extent={{-140,-50},{-100,-10}}))); Modelica.Blocks.Interfaces.RealInput us_mTan_flow - "Tank mass flow rate setpoint" annotation (Placement(transformation( + "Tank mass flow rate setpoint" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={-70,110}), iconTransformation( diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/SignalThrough.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/SignalThrough.mo new file mode 100644 index 00000000000..71cae8696f9 --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/SignalThrough.mo @@ -0,0 +1,27 @@ +within Buildings.Fluid.Storage.Plant.BaseClasses; +block SignalThrough "Signal passes through" + extends Modelica.Blocks.Icons.Block; + Modelica.Blocks.Interfaces.RealInput u "Signal in" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-110,0}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-110,0}))); + Modelica.Blocks.Interfaces.RealOutput y "Signal out" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={110,0}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={110,0}))); +equation + connect(u, y) annotation (Line(points={{-110,0},{110,0}}, color={0,0,127})); + annotation (Icon(graphics={Line(points={{-100,0},{100,0}}, color={28,108,200})}), + Documentation(info=" +Signal directly passes through from the input to the output. +This is used to replace conditionally-enabled blocks with a connection. +")); +end SignalThrough; diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/package.order b/Buildings/Fluid/Storage/Plant/BaseClasses/package.order index 00685fd5157..fa58381dc71 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/package.order +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/package.order @@ -1,2 +1,3 @@ -ChillerAndTank +FluidThrough ReversiblePumpValveControl +SignalThrough diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo similarity index 51% rename from Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo rename to Buildings/Fluid/Storage/Plant/ChillerAndTank.mo index 0fc11e6339e..fc6addd9968 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo @@ -1,11 +1,12 @@ -within Buildings.Fluid.Storage.Plant.BaseClasses; -partial model ChillerAndTank - "(Draft) A plant with a chiller and a stratified CHW tank" - // Condenser loop not considered yet. - +within Buildings.Fluid.Storage.Plant; +model ChillerAndTank + "(Draft) Model of a plant with a chiller and a tank where the tank can potentially be charged remotely" replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium in the component"; + parameter Boolean allowRemoteCharging = true + "Turns the plant to a prosumer"; + parameter Modelica.Units.SI.MassFlowRate m1_flow_nominal=1 "Nominal mass flow rate for the chiller branch"; parameter Modelica.Units.SI.MassFlowRate m2_flow_nominal=1 @@ -21,12 +22,9 @@ partial model ChillerAndTank "Nominal temperature of CHW supply"; parameter Modelica.Units.SI.Temperature T_CHWR_nominal=12+273.15 "Nominal temperature of CHW return"; - parameter Boolean allowFlowReversal1=false - "Flow reversal setting on chiller branch"; Buildings.Fluid.FixedResistances.PressureDrop preDro1( redeclare package Medium = Medium, - final allowFlowReversal=allowFlowReversal1, final dp_nominal=dp_nominal/10, final m_flow_nominal=m1_flow_nominal) "Flow resistance on chiller branch" annotation (Placement(transformation(extent={{40,30},{60,50}}))); @@ -76,14 +74,13 @@ partial model ChillerAndTank "Primary pump mass flow rate setpoint" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={-50,110}), iconTransformation( + origin={-40,130}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-110,90}))); Buildings.Fluid.Storage.Plant.TemperatureSource ideChi( redeclare package Medium = Medium, - allowFlowReversal=allowFlowReversal1, m_flow_nominal=m1_flow_nominal, p_nominal=p_CHWS_nominal, T_a_nominal=T_CHWR_nominal, @@ -129,6 +126,71 @@ partial model ChillerAndTank extent={{-10,-10},{10,10}}, rotation=0, origin={-150,20}))); + + Buildings.Fluid.Storage.Plant.BaseClasses.ReversiblePumpValveControl pum2Con + if allowRemoteCharging + "Control block for secondary pump-valve group" + annotation (Placement(transformation(extent={{-140,78},{-120,100}}))); + Buildings.Controls.OBC.CDL.Interfaces.BooleanInput booOnOff + if allowRemoteCharging + "Plant status: true = online; false = offline" annotation (Placement( + transformation(extent={{-200,70},{-180,90}}), iconTransformation(extent= + {{-140,-110},{-100,-70}}))); + Buildings.Controls.OBC.CDL.Interfaces.BooleanInput booFloDir + if allowRemoteCharging + "Flow direction: true = normal; false = reverse" annotation (Placement( + transformation(extent={{-200,90},{-180,110}}), iconTransformation( + extent={{-140,-70},{-100,-30}}))); + Modelica.Blocks.Interfaces.RealInput set_mTan_flow if allowRemoteCharging + "Tank mass flow rate setpoint" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-160,130}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-110,50}))); + + Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage val1( + redeclare package Medium = Medium, + use_inputFilter=false, + l=1E-10, + dpValve_nominal=1, + m_flow_nominal=m1_flow_nominal+m2_flow_nominal) if allowRemoteCharging + "Valve in series to the pump (normal direction)" + annotation (Placement(transformation(extent={{-120,22},{-100,42}}))); + Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage val2( + redeclare package Medium = Medium, + use_inputFilter=false, + l=1E-10, + dpValve_nominal=1, + m_flow_nominal=m2_flow_nominal) if allowRemoteCharging + "Valve in parallel to the secondary pump (reverse direction)" + annotation (Placement(transformation(extent={{-120,-30},{-140,-10}}))); + Buildings.Controls.OBC.CDL.Continuous.Switch swiFloDirPum1 + if allowRemoteCharging "Switches off pum1 when tank charged remotely" + annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-50,90}))); + Modelica.Blocks.Sources.Constant conZero(k=0) if allowRemoteCharging + "Constant y = 0" + annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + rotation=90, + origin={-90,90}))); + BaseClasses.FluidThrough pasVal1(redeclare package Medium = Medium) + if not allowRemoteCharging "Replaces val1 when remote charging not allowed" + annotation (Placement(transformation(extent={{-120,0},{-100,20}}))); + BaseClasses.SignalThrough pasSwiFloDirPum1 if not allowRemoteCharging + "Replaces swiFloDirPum1 when remote charging not allowed" annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-10,90}))); + Modelica.Blocks.Interfaces.RealInput yPum2 if not allowRemoteCharging + "Secondary pump speed input" + annotation (Placement(transformation(extent={{-200,50},{-180,70}}), + iconTransformation(extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-70,110}))); equation connect(preDro2.port_b, jun2.port_3) annotation (Line(points={{60,-60},{100,-60},{100,-10}}, @@ -150,10 +212,64 @@ equation 40},{-60,40}}, color={0,127,255})); connect(ideTan.m_flow,mTan_flow) annotation (Line(points={{-7,-49},{-7,-46}, {-40,-46},{-40,-110}}, color={0,0,127})); - annotation ( - experiment(Tolerance=1e-06, StopTime=3600), - Diagram(coordinateSystem(extent={{-180,-100},{140,100}})), - Icon(coordinateSystem(extent={{-100,-100},{100,100}}), graphics={ + connect(booFloDir, pum2Con.booFloDir) annotation (Line(points={{-190,100},{-174, + 100},{-174,85.7},{-142,85.7}}, color={255,0,255})); + connect(jun1.port_1, val2.port_a) annotation (Line(points={{-90,0},{-94,0},{-94, + -20},{-120,-20}}, color={0,127,255})); + connect(val2.port_b, port_a) annotation (Line(points={{-140,-20},{-164,-20},{-164, + 0},{-180,0}}, color={0,127,255})); + connect(val1.port_b, jun1.port_1) annotation (Line(points={{-100,32},{-94,32}, + {-94,0},{-90,0}}, color={0,127,255})); + connect(pum2Con.yVal2, val2.y) annotation (Line(points={{-127,76.9},{-127,40}, + {-130,40},{-130,-8}}, color={0,0,127})); + connect(pum2Con.yVal1, val1.y) annotation (Line(points={{-123,76.9},{-110,76.9}, + {-110,44}}, color={0,0,127})); + connect(pum2Con.um_mTan_flow, ideTan.m_flow) annotation (Line(points={{-141, + 96.7},{-170,96.7},{-170,-46},{-8,-46},{-8,-49},{-7,-49}}, + color={0,0,127})); + connect(pum2Con.us_mTan_flow, set_mTan_flow) annotation (Line(points={{-141,92.3}, + {-160,92.3},{-160,130}}, color={0,0,127})); + connect(pum2.port_a, port_a) annotation (Line(points={{-160,20},{-164,20},{ + -164,0},{-180,0}}, color={0,127,255})); + connect(pum2.port_b, val1.port_a) + annotation (Line(points={{-140,20},{-124,20},{-124,32},{-120,32}}, + color={0,127,255})); + connect(pum2.y, pum2Con.yPum2) annotation (Line(points={{-150,32},{-150,70},{-131, + 70},{-131,76.9}}, color={0,0,127})); + connect(swiFloDirPum1.u2, booFloDir) annotation (Line(points={{-50,102},{-50,108}, + {-174,108},{-174,100},{-190,100}}, + color={255,0,255})); + connect(swiFloDirPum1.u1, set_mPum1_flow) annotation (Line(points={{-42,102},{ + -42,116},{-40,116},{-40,130}}, + color={0,0,127})); + connect(pum1.m_flow_in,swiFloDirPum1. y) + annotation (Line(points={{-50,52},{-50,78}}, color={0,0,127})); + connect(conZero.y,swiFloDirPum1. u3) annotation (Line(points={{-90,101},{-90,106}, + {-58,106},{-58,102}}, + color={0,0,127})); + connect(pum2Con.booOnOff, booOnOff) annotation (Line(points={{-142,81.3},{-142, + 80},{-190,80}}, color={255,0,255})); + connect(pum2.port_b, pasVal1.port_a) annotation (Line(points={{-140,20},{-124, + 20},{-124,10},{-120,10}}, color={0,127,255})); + connect(pasSwiFloDirPum1.u, set_mPum1_flow) annotation (Line(points={{-10,101}, + {-10,116},{-40,116},{-40,130}}, color={0,0,127})); + connect(pasSwiFloDirPum1.y, pum1.m_flow_in) annotation (Line(points={{-10,79}, + {-10,60},{-50,60},{-50,52}}, color={0,0,127})); + connect(pum2.y, yPum2) + annotation (Line(points={{-150,32},{-150,60},{-190,60}}, color={0,0,127})); + connect(pasVal1.port_b, jun1.port_1) annotation (Line(points={{-100,10},{-94, + 10},{-94,0},{-90,0}}, color={0,127,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, + {100,100}}), graphics={Line( + points={{-80,-20},{-20,-20}}, + color={28,108,200}, + pattern=LinePattern.Dash, + visible=allowRemoteCharging), Polygon( + points={{-80,-20},{-60,-14},{-60,-26},{-80,-20}}, + fillColor={28,108,200}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None, + visible=allowRemoteCharging), Line(points={{0,0},{0,-20},{30,-20},{30,-60},{60,-60},{60,0}}, color={0, 0,0}), Line(points={{-90,0},{0,0},{0,60},{60,60},{60,0},{90,0}}, color={0,0,0}), @@ -174,11 +290,6 @@ equation fillPattern=FillPattern.Solid, pattern=LinePattern.None), Line(points={{16,76},{52,68}}, color={0,0,0}), - Line(points={{52,56},{18,46}}, color={0,0,0})}), - Documentation(info=" -Draft model of a plant with a chiller and a storage tank. -Both the chiller and the tank are volumes as placeholders. -The volumes are setup in a way that they turn the fluid that passes through to the -desired temperature when they exit, thus performing as idea thermal sources. -")); + Line(points={{52,56},{18,46}}, color={0,0,0})}), Diagram( + coordinateSystem(preserveAspectRatio=false, extent={{-180,-100},{140,120}}))); end ChillerAndTank; diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo deleted file mode 100644 index 43aee2b1b3c..00000000000 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTankNoRemoteCharging.mo +++ /dev/null @@ -1,21 +0,0 @@ -within Buildings.Fluid.Storage.Plant; -model ChillerAndTankNoRemoteCharging - "(Draft) Model of a plant with a chiller and a tank where the tank cannot be charged remotely" - extends Buildings.Fluid.Storage.Plant.BaseClasses.ChillerAndTank; - - Modelica.Blocks.Interfaces.RealInput yPum2 "Secondary pump speed input" - annotation (Placement(transformation(extent={{-204,58},{-180,82}}), - iconTransformation(extent={{-120,40},{-100,60}}))); -equation - connect(pum2.y, yPum2) - annotation (Line(points={{-150,32},{-150,70},{-192,70}}, color={0,0,127})); - connect(pum2.port_a, port_a) annotation (Line(points={{-160,20},{-166,20},{ - -166,0},{-180,0}}, color={0,127,255})); - connect(pum2.port_b, jun1.port_1) annotation (Line(points={{-140,20},{-96,20}, - {-96,0},{-90,0}}, color={0,127,255})); - connect(pum1.m_flow_in, set_mPum1_flow) - annotation (Line(points={{-50,52},{-50,110}}, color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, - {100,100}})), Diagram( - coordinateSystem(preserveAspectRatio=false, extent={{-180,-100},{100,100}}))); -end ChillerAndTankNoRemoteCharging; diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo deleted file mode 100644 index 465687a7660..00000000000 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTankWithRemoteCharging.mo +++ /dev/null @@ -1,95 +0,0 @@ -within Buildings.Fluid.Storage.Plant; -model ChillerAndTankWithRemoteCharging - "(Draft) Model of a plant with a chiller and a tank where the tank can be charged remotely" - extends Buildings.Fluid.Storage.Plant.BaseClasses.ChillerAndTank; - - Buildings.Fluid.Storage.Plant.BaseClasses.ReversiblePumpValveControl pum2Con - "Control block for secondary pump-valve group" - annotation (Placement(transformation(extent={{-140,58},{-120,80}}))); - Buildings.Controls.OBC.CDL.Interfaces.BooleanInput booOnOff - "Plant status: true = online; false = offline" annotation (Placement( - transformation(extent={{-202,28},{-180,50}}), iconTransformation(extent= - {{-140,-110},{-100,-70}}))); - Buildings.Controls.OBC.CDL.Interfaces.BooleanInput booFloDir - "Flow direction: true = normal; false = reverse" annotation (Placement( - transformation(extent={{-202,68},{-180,90}}), iconTransformation( - extent={{-140,-70},{-100,-30}}))); - Modelica.Blocks.Interfaces.RealInput set_mTan_flow - "Tank mass flow rate setpoint" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={-160,110}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-110,50}))); - - Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage val1( - redeclare package Medium = Medium, - use_inputFilter=false, - l=1E-10, - dpValve_nominal=1, - m_flow_nominal=m1_flow_nominal+m2_flow_nominal) - "Valve in series to the pump (normal direction)" - annotation (Placement(transformation(extent={{-120,10},{-100,30}}))); - Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage val2( - redeclare package Medium = Medium, - use_inputFilter=false, - l=1E-10, - dpValve_nominal=1, - m_flow_nominal=m2_flow_nominal) - "Valve in parallel to the secondary pump (reverse direction)" - annotation (Placement(transformation(extent={{-120,-30},{-140,-10}}))); - Buildings.Controls.OBC.CDL.Continuous.Switch swiFloDirPum2 - "Flow direction of secondary pump-valve group" - annotation (Placement(transformation(extent={{-10,-10},{10,10}}, - rotation=-90, - origin={-50,70}))); - Modelica.Blocks.Sources.Constant conZero(k=0) "Constant y = 0" - annotation (Placement(transformation(extent={{-10,-10},{10,10}}, - rotation=90, - origin={-90,70}))); -equation - connect(booFloDir, pum2Con.booFloDir) annotation (Line(points={{-191,79},{ - -172,79},{-172,65.7},{-142,65.7}}, color={255,0,255})); - connect(pum2Con.booOnOff, booOnOff) annotation (Line(points={{-142,61.3},{-142, - 62},{-160,62},{-160,39},{-191,39}}, color={255,0,255})); - connect(jun1.port_1, val2.port_a) annotation (Line(points={{-90,0},{-94,0},{-94, - -20},{-120,-20}}, color={0,127,255})); - connect(val2.port_b, port_a) annotation (Line(points={{-140,-20},{-164,-20},{-164, - 0},{-180,0}}, color={0,127,255})); - connect(val1.port_b, jun1.port_1) annotation (Line(points={{-100,20},{-94,20}, - {-94,0},{-90,0}}, color={0,127,255})); - connect(pum2Con.yVal2, val2.y) annotation (Line(points={{-127,56.9},{-127,-2}, - {-130,-2},{-130,-8}}, color={0,0,127})); - connect(pum2Con.yVal1, val1.y) annotation (Line(points={{-123,56.9},{-110,56.9}, - {-110,32}}, color={0,0,127})); - connect(pum2Con.um_mTan_flow, ideTan.m_flow) annotation (Line(points={{-141,76.7}, - {-142,76.7},{-142,78},{-170,78},{-170,-46},{-7,-46},{-7,-49}}, - color={0,0,127})); - connect(pum2Con.us_mTan_flow, set_mTan_flow) annotation (Line(points={{-141, - 72.3},{-160,72.3},{-160,110}}, color={0,0,127})); - connect(pum2.port_a, port_a) annotation (Line(points={{-160,20},{-164,20},{ - -164,0},{-180,0}}, color={0,127,255})); - connect(pum2.port_b, val1.port_a) - annotation (Line(points={{-140,20},{-120,20}}, color={0,127,255})); - connect(pum2.y, pum2Con.yPum2) annotation (Line(points={{-150,32},{-150,50},{ - -131,50},{-131,56.9}}, color={0,0,127})); - connect(swiFloDirPum2.u2, booFloDir) annotation (Line(points={{-50,82},{-50,88}, - {-174,88},{-174,79},{-191,79}}, color={255,0,255})); - connect(swiFloDirPum2.u1, set_mPum1_flow) annotation (Line(points={{-42,82},{-42, - 96},{-50,96},{-50,110}}, color={0,0,127})); - connect(pum1.m_flow_in, swiFloDirPum2.y) - annotation (Line(points={{-50,52},{-50,58}}, color={0,0,127})); - connect(conZero.y, swiFloDirPum2.u3) annotation (Line(points={{-90,81},{-90,86}, - {-58,86},{-58,82}}, color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, - {100,100}}), graphics={Line( - points={{-80,-20},{-20,-20}}, - color={28,108,200}, - pattern=LinePattern.Dash), Polygon( - points={{-80,-20},{-60,-14},{-60,-26},{-80,-20}}, - fillColor={28,108,200}, - fillPattern=FillPattern.Solid, - pattern=LinePattern.None)}), Diagram( - coordinateSystem(preserveAspectRatio=false, extent={{-180,-100},{140,100}}))); -end ChillerAndTankWithRemoteCharging; diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo index a5fdeac4471..42146ea4a06 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo @@ -35,8 +35,9 @@ model OneSourceOneUser "(Draft) District system with one source and one user" parameter Modelica.Units.SI.Power QCooLoa_flow_nominal=5*4200*1.01 "Nominal cooling load of one consumer"; - Buildings.Fluid.Storage.Plant.ChillerAndTankNoRemoteCharging cat( + Buildings.Fluid.Storage.Plant.ChillerAndTank cat( redeclare final package Medium=Medium, + final allowRemoteCharging=false, final m1_flow_nominal=m_flow_nominal/2, final m2_flow_nominal=m_flow_nominal/2, final p_CHWS_nominal=p_CHWS_nominal, @@ -67,9 +68,9 @@ model OneSourceOneUser "(Draft) District system with one source and one user" Ti=100, reverseActing=true) "PI controller for pum2" annotation (Placement(transformation( - extent={{10,10},{-10,-10}}, + extent={{-10,10},{10,-10}}, rotation=270, - origin={-70,-60}))); + origin={-70,30}))); Buildings.Fluid.FixedResistances.PressureDrop preDro1( redeclare package Medium = Medium, final allowFlowReversal=true, @@ -84,9 +85,9 @@ model OneSourceOneUser "(Draft) District system with one source and one user" annotation (Placement(transformation(extent={{10,-50},{-10,-30}}))); Modelica.Blocks.Sources.Constant set_dpCon(k=1) "Normalised consumer differential pressure setpoint" - annotation (Placement(transformation(extent={{10,-10},{-10,10}}, + annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=-90, - origin={-70,-90}))); + origin={-70,70}))); Buildings.Fluid.Sources.Boundary_pT sou_p( redeclare final package Medium = Medium, final p=p_CHWR_nominal, @@ -98,20 +99,20 @@ model OneSourceOneUser "(Draft) District system with one source and one user" Modelica.Blocks.Math.Gain gaiPum2(k=1/usr.dp_nominal) "Gain" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, - rotation=180, - origin={-40,-60}))); + rotation=270, + origin={-30,70}))); Buildings.Controls.OBC.CDL.Continuous.Hysteresis hysPum1(uLow=0.05, uHigh=0.5) "Primary pump shuts off at con.yVal = 0.05 and restarts at 0.5" annotation ( Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=90, - origin={-70,62}))); + extent={{-10,-10},{10,10}}, + rotation=180, + origin={-10,-70}))); Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToReaPum1(realTrue= m_flow_nominal/2) "Primary pump signal" annotation (Placement( transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={-70,30}))); + extent={{10,-10},{-10,10}}, + rotation=0, + origin={-50,-70}))); equation connect(set_TRet.y,usr. TSet) annotation (Line(points={{21,30},{32,30},{32,5},{39,5}},color={0,0,127})); @@ -126,21 +127,23 @@ equation connect(preDro2.port_b, cat.port_a) annotation (Line(points={{-10,-40},{-60,-40},{-60,0}}, color={0,127,255})); connect(set_dpCon.y, conPI_pum2.u_s) - annotation (Line(points={{-70,-79},{-70,-72}}, color={0,0,127})); + annotation (Line(points={{-70,59},{-70,42}}, color={0,0,127})); connect(sou_p.ports[1], cat.port_a) annotation (Line(points={{-80,0},{-60,0}}, color={0,127,255})); - connect(usr.dp, gaiPum2.u) annotation (Line(points={{47,11},{46,11},{46,20},{ - 70,20},{70,-60},{-28,-60}}, - color={0,0,127})); - connect(gaiPum2.y, conPI_pum2.u_m) - annotation (Line(points={{-51,-60},{-58,-60}}, color={0,0,127})); + connect(usr.dp, gaiPum2.u) annotation (Line(points={{47,11},{46,11},{46,82},{ + -30,82}}, color={0,0,127})); connect(conPI_pum2.y, cat.yPum2) - annotation (Line(points={{-70,-49},{-70,5},{-61,5}}, color={0,0,127})); + annotation (Line(points={{-70,19},{-70,16},{-57,16},{-57,11}}, + color={0,0,127})); connect(hysPum1.y, booToReaPum1.u) - annotation (Line(points={{-70,50},{-70,42}}, color={255,0,255})); + annotation (Line(points={{-22,-70},{-38,-70}}, + color={255,0,255})); connect(booToReaPum1.y, cat.set_mPum1_flow) - annotation (Line(points={{-70,18},{-70,9},{-61,9}}, color={0,0,127})); - connect(hysPum1.u,usr. yVal_actual) annotation (Line(points={{-70,74},{-70,80}, - {43,80},{43,11}}, color={0,0,127})); + annotation (Line(points={{-62,-70},{-68,-70},{-68,9},{-61,9}}, + color={0,0,127})); + connect(hysPum1.u,usr. yVal_actual) annotation (Line(points={{2,-70},{22,-70}, + {22,11},{43,11}}, color={0,0,127})); + connect(gaiPum2.y, conPI_pum2.u_m) + annotation (Line(points={{-30,59},{-30,30},{-58,30}}, color={0,0,127})); annotation(experiment(Tolerance=1e-06, StopTime=3600)); end OneSourceOneUser; diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index b4d89112f05..659714a29d6 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -34,16 +34,17 @@ model TwoSourcesThreeUsers extent={{-10,-10},{10,10}}, rotation=90, origin={-80,60}))); - Buildings.Fluid.Storage.Plant.ChillerAndTankWithRemoteCharging cat( - redeclare final package Medium=Medium, + Buildings.Fluid.Storage.Plant.ChillerAndTank cat( + redeclare final package Medium = Medium, final m1_flow_nominal=0.75*m_flow_nominal, final m2_flow_nominal=0.75*m_flow_nominal, final p_CHWS_nominal=p_CHWS_nominal, final p_CHWR_nominal=p_CHWR_nominal, final T_CHWS_nominal=T_CHWS_nominal, final T_CHWR_nominal=T_CHWR_nominal) - "Chiller and tank, tank can be charged remotely" - annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + "Chiller and tank, tank can be charged remotely" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, rotation=90, origin={-60,-60}))); Buildings.Fluid.Storage.Plant.DummyUser usr1( diff --git a/Buildings/Fluid/Storage/Plant/Examples/package.order b/Buildings/Fluid/Storage/Plant/Examples/package.order index c182e825891..da0cd7227d2 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/package.order +++ b/Buildings/Fluid/Storage/Plant/Examples/package.order @@ -1,2 +1,3 @@ OneSourceOneUser TwoSourcesThreeUsers +BaseClasses diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo index 409d54cb1dd..411ea4a1909 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo @@ -13,8 +13,9 @@ model ChillerAndTankNoRemoteCharging "(Draft)" parameter Modelica.Units.SI.Temperature T_CHWR_nominal=12+273.15 "Nominal temperature of CHW return"; - Buildings.Fluid.Storage.Plant.ChillerAndTankNoRemoteCharging cat( + Buildings.Fluid.Storage.Plant.ChillerAndTank cat( redeclare final package Medium=Medium, + final allowRemoteCharging=false, final m1_flow_nominal=1, final m2_flow_nominal=1, final p_CHWS_nominal=p_CHWS_nominal, @@ -42,27 +43,27 @@ model ChillerAndTankNoRemoteCharging "(Draft)" extent={{-10,10},{10,-10}}, rotation=180, origin={60,0}))); - Modelica.Blocks.Sources.TimeTable set_mPum2_flow(table=[0*3600,1; 0.25*3600,1; - 0.25*3600,-1; 0.5*3600,-1; 0.5*3600,0; 0.75*3600,0; 0.75*3600,1; 1*3600, - 1]) "Secondary mass flow rate setpoint" - annotation (Placement(transformation(extent={{-70,-80},{-50,-60}}))); + Modelica.Blocks.Sources.TimeTable set_mPum2_flow(table=[0,1; 900,1; 900,-1; + 1800,-1; 1800,0; 2700,0; 2700,1; 3600,1]) + "Secondary mass flow rate setpoint" + annotation (Placement(transformation(extent={{-100,60},{-80,80}}))); Modelica.Blocks.Sources.Constant set_mPum1_flow(k=cat.m1_flow_nominal) "Primary pump mass flow rate setpoint" - annotation (Placement(transformation(extent={{-70,60},{-50,80}}))); + annotation (Placement(transformation(extent={{-60,20},{-40,40}}))); Buildings.Controls.Continuous.LimPID conPID_Pum2( Td=1, k=1, Ti=15) "PI controller for the secondary pump" annotation (Placement( transformation( - extent={{10,10},{-10,-10}}, - rotation=270, - origin={-40,-30}))); + extent={{10,-10},{-10,10}}, + rotation=180, + origin={-50,70}))); Modelica.Blocks.Math.Gain gain2(k=1/cat.m2_flow_nominal) "Gain" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=180, - origin={-10,-30}))); + origin={-10,90}))); equation connect(sou.ports[1], cat.port_a) annotation (Line(points={{-50,0},{-10,0}}, color={0,127,255})); @@ -70,18 +71,20 @@ equation 4.44089e-16},{50,4.44089e-16}}, color={0,127,255})); - connect(set_mPum1_flow.y, cat.set_mPum1_flow) - annotation (Line(points={{-49,70},{-11,70},{-11,9}},color={0,0,127})); connect(gain2.y, conPID_Pum2.u_m) - annotation (Line(points={{-21,-30},{-28,-30}}, color={0,0,127})); - connect(cat.mTan_flow, gain2.u) annotation (Line(points={{9,-11},{8,-11},{8,-30}, - {2,-30}}, color={0,0,127})); + annotation (Line(points={{-21,90},{-50,90},{-50,82}}, + color={0,0,127})); + connect(cat.mTan_flow, gain2.u) annotation (Line(points={{9,-11},{14,-11},{14, + 90},{2,90}}, + color={0,0,127})); connect(set_mPum2_flow.y, conPID_Pum2.u_s) - annotation (Line(points={{-49,-70},{-40,-70},{-40,-42}}, color={0,0,127})); + annotation (Line(points={{-79,70},{-62,70}}, color={0,0,127})); + connect(set_mPum1_flow.y, cat.set_mPum1_flow) annotation (Line(points={{-39, + 30},{-18,30},{-18,9},{-11,9}}, color={0,0,127})); connect(conPID_Pum2.y, cat.yPum2) - annotation (Line(points={{-40,-19},{-40,5},{-11,5}}, color={0,0,127})); + annotation (Line(points={{-39,70},{-7,70},{-7,11}}, color={0,0,127})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), - Icon(coordinateSystem(extent={{-100,-100},{100,120}}))); + Icon(coordinateSystem(extent={{-100,-100},{100,100}}))); end ChillerAndTankNoRemoteCharging; diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo index e826d7d158d..31f7de392f1 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo @@ -26,15 +26,15 @@ model ChillerAndTankWithRemoteCharging parameter Modelica.Units.SI.Temperature T_CHWR_nominal=12+273.15 "Nominal temperature of CHW return"; - Buildings.Fluid.Storage.Plant.ChillerAndTankWithRemoteCharging cat( - redeclare final package Medium=Medium, + Buildings.Fluid.Storage.Plant.ChillerAndTank cat( + redeclare final package Medium = Medium, + final allowRemoteCharging=true, final m1_flow_nominal=1, final m2_flow_nominal=1, final p_CHWS_nominal=p_CHWS_nominal, final p_CHWR_nominal=p_CHWR_nominal, final T_CHWS_nominal=T_CHWS_nominal, - final T_CHWR_nominal=T_CHWR_nominal) - "Plant with chiller and tank" + final T_CHWR_nominal=T_CHWR_nominal) "Plant with chiller and tank" annotation (Placement(transformation(extent={{-8,-10},{12,10}}))); Buildings.Fluid.Sources.Boundary_pT sou( redeclare final package Medium = Medium, @@ -72,7 +72,8 @@ model ChillerAndTankWithRemoteCharging annotation (Placement(transformation(extent={{-40,80},{-20,100}}))); equation connect(sou.ports[1], cat.port_a) - annotation (Line(points={{-50,0},{-8,0}}, color={0,127,255})); + annotation (Line(points={{-50,0},{-26,0},{-26,0},{-8,0}}, + color={0,127,255})); connect(cat.port_b, sin.ports[1]) annotation (Line(points={{12,0},{35,0},{35,4.44089e-16}, {50,4.44089e-16}}, color={0,127,255})); @@ -89,5 +90,5 @@ equation annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), - Icon(coordinateSystem(extent={{-100,-100},{100,120}}))); + Icon(coordinateSystem(extent={{-100,-100},{100,100}}))); end ChillerAndTankWithRemoteCharging; diff --git a/Buildings/Fluid/Storage/Plant/package.order b/Buildings/Fluid/Storage/Plant/package.order index 9e095ba0338..489815ad645 100644 --- a/Buildings/Fluid/Storage/Plant/package.order +++ b/Buildings/Fluid/Storage/Plant/package.order @@ -1,7 +1,6 @@ -ChillerAndTankNoRemoteCharging -ChillerAndTankWithRemoteCharging -TemperatureSource +ChillerAndTank DummyUser +TemperatureSource Examples Validation BaseClasses From b7c5d325155fd97feaec1379cd2203200c608a76 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Tue, 15 Feb 2022 15:42:27 -0800 Subject: [PATCH 027/463] fixed package.order --- Buildings/Fluid/Storage/Plant/Examples/package.order | 1 - 1 file changed, 1 deletion(-) diff --git a/Buildings/Fluid/Storage/Plant/Examples/package.order b/Buildings/Fluid/Storage/Plant/Examples/package.order index da0cd7227d2..c182e825891 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/package.order +++ b/Buildings/Fluid/Storage/Plant/Examples/package.order @@ -1,3 +1,2 @@ OneSourceOneUser TwoSourcesThreeUsers -BaseClasses From 1675ae0b679e1335a13b8b55d861fd79781c6ed1 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Wed, 16 Feb 2022 10:44:29 -0800 Subject: [PATCH 028/463] now uses inheritance from multi port interfaces --- .../BaseClasses/ReversiblePumpValveControl.mo | 80 ++--- .../Fluid/Storage/Plant/CDWPlaceholder.mo | 55 ++++ .../Fluid/Storage/Plant/ChillerAndTank.mo | 273 ++++++++---------- .../Plant/Examples/OneSourceOneUser.mo | 77 +++-- .../Plant/Examples/TwoSourcesThreeUsers.mo | 80 ++--- .../ChillerAndTankNoRemoteCharging.mo | 48 +-- .../ChillerAndTankWithRemoteCharging.mo | 57 ++-- Buildings/Fluid/Storage/Plant/package.order | 1 + 8 files changed, 372 insertions(+), 299 deletions(-) create mode 100644 Buildings/Fluid/Storage/Plant/CDWPlaceholder.mo diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo index 54f01106c4f..ff9b80c98f2 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo @@ -12,9 +12,9 @@ block ReversiblePumpValveControl Controls.OBC.CDL.Continuous.Switch swiFloDirPum2 "Flow direction of pum2" annotation (Placement(transformation(extent={{-50,-40},{-30,-20}}))); Controls.OBC.CDL.Continuous.Switch swiFloDirVal2 "Flow direction of val2" - annotation (Placement(transformation(extent={{0,-40},{20,-20}}))); - Controls.OBC.CDL.Continuous.Switch swiFloDirVal1 "Flow direction of val2" annotation (Placement(transformation(extent={{50,-40},{70,-20}}))); + Controls.OBC.CDL.Continuous.Switch swiFloDirVal1 "Flow direction of val2" + annotation (Placement(transformation(extent={{0,-40},{20,-20}}))); Controls.Continuous.LimPID conPI_pum2( controllerType=Modelica.Blocks.Types.SimpleController.PI, Td=1, @@ -37,12 +37,12 @@ block ReversiblePumpValveControl "PI controller for val2" annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=270, - origin={-20,60}))); + origin={-10,60}))); Modelica.Blocks.Math.Gain gaiVal2(k=1) "Gain" annotation (Placement( transformation( extent={{10,-10},{-10,10}}, rotation=90, - origin={-20,30}))); + origin={-10,30}))); Controls.OBC.CDL.Interfaces.BooleanInput booFloDir "Flow direction, true = normal, false = reverse" annotation (Placement( transformation(extent={{-120,0},{-100,20}}), iconTransformation( @@ -59,7 +59,7 @@ block ReversiblePumpValveControl "Measured tank mass flow rate" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={0,110}), iconTransformation( + origin={10,110}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-110,70}))); @@ -72,12 +72,12 @@ block ReversiblePumpValveControl annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={30,-80}))); + origin={90,-80}))); Controls.OBC.CDL.Continuous.Min minVal1 "Offline signal overrides all" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={70,-80}))); + origin={40,-80}))); Controls.OBC.CDL.Interfaces.BooleanInput booOnOff "True = plant online, False = plant offline" annotation (Placement( transformation(extent={{-120,-90},{-100,-70}}), iconTransformation( @@ -94,18 +94,18 @@ block ReversiblePumpValveControl Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={30,-110}), iconTransformation( + origin={90,-110}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={30,-110}))); + origin={70,-110}))); Modelica.Blocks.Interfaces.RealOutput yVal1 "Valve position" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={70,-110}), iconTransformation( + origin={40,-110}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={70,-110}))); + origin={30,-110}))); equation connect(conOne.y,swiOnOff. u1) annotation (Line(points={{-79,-10},{-66,-10},{-66, @@ -114,26 +114,26 @@ equation connect(conZero.y,swiOnOff. u3) annotation (Line(points={{-79,-50},{-72,-50},{ -72,-88},{-62,-88}}, color={0,0,127})); - connect(conZero.y,swiFloDirPum2. u3) annotation (Line(points={{-79,-50},{-60,-50}, - {-60,-38},{-52,-38}}, + connect(conZero.y,swiFloDirPum2. u3) annotation (Line(points={{-79,-50},{-60, + -50},{-60,-38},{-52,-38}}, color={0,0,127})); connect(swiFloDirPum2.y, minPum2.u1) annotation (Line(points={{-28,-30},{-22,-30},{-22,-62},{-4,-62},{-4,-68}}, color={0,0,127})); connect(swiFloDirVal2.y, minVal2.u1) - annotation (Line(points={{22,-30},{36,-30},{36,-68}}, + annotation (Line(points={{72,-30},{96,-30},{96,-68}}, color={0,0,127})); connect(swiFloDirVal1.y, minVal1.u1) - annotation (Line(points={{72,-30},{76,-30},{76,-68}}, + annotation (Line(points={{22,-30},{22,-60},{46,-60},{46,-68}}, color={0,0,127})); - connect(conOne.y,swiFloDirVal1. u1) annotation (Line(points={{-79,-10},{40,-10}, - {40,-22},{48,-22}}, + connect(conOne.y,swiFloDirVal1. u1) annotation (Line(points={{-79,-10},{-10, + -10},{-10,-22},{-2,-22}}, color={0,0,127})); - connect(conZero.y,swiFloDirVal1. u3) annotation (Line(points={{-79,-50},{40,-50}, - {40,-38},{48,-38}}, + connect(conZero.y,swiFloDirVal1. u3) annotation (Line(points={{-79,-50},{-10, + -50},{-10,-38},{-2,-38}}, color={0,0,127})); - connect(conZero.y,swiFloDirVal2. u1) annotation (Line(points={{-79,-50},{-10,-50}, - {-10,-22},{-2,-22}}, + connect(conZero.y,swiFloDirVal2. u1) annotation (Line(points={{-79,-50},{42, + -50},{42,-22},{48,-22}}, color={0,0,127})); connect(booFloDir,swiFloDirPum2. u2) annotation (Line(points={{-110,10},{-62, 10},{-62,-30},{-52,-30}}, @@ -143,40 +143,40 @@ equation connect(gaiPum2.y,swiFloDirPum2. u1) annotation (Line(points={{-70,19},{-70,-22},{-52,-22}}, color={0,0,127})); - connect(conPI_val2.y,gaiVal2. u) annotation (Line(points={{-20,49},{-20,42}}, - color={0,0,127})); + connect(conPI_val2.y,gaiVal2. u) annotation (Line(points={{-10,49},{-10,45.5}, + {-10,45.5},{-10,42}}, color={0,0,127})); connect(gaiVal2.y,swiFloDirVal2. u3) - annotation (Line(points={{-20,19},{-20,-38},{-2,-38}}, + annotation (Line(points={{-10,19},{-10,0},{30,0},{30,-38},{48,-38}}, color={0,0,127})); connect(conPI_pum2.u_s, us_mTan_flow) annotation (Line(points={{-70,72},{-70,110}}, color={0,0,127})); - connect(conPI_val2.u_s, us_mTan_flow) annotation (Line(points={{-20,72},{ - -20,80},{-70,80},{-70,110}}, + connect(conPI_val2.u_s, us_mTan_flow) annotation (Line(points={{-10,72},{ + -10,96},{-70,96},{-70,110}}, color={0,0,127})); - connect(conPI_val2.u_m, um_mTan_flow) annotation (Line(points={{-8,60},{0, - 60},{0,110}}, color={0,0,127})); + connect(conPI_val2.u_m, um_mTan_flow) annotation (Line(points={{2,60},{10, + 60},{10,110}}, color={0,0,127})); connect(conPI_pum2.u_m, um_mTan_flow) annotation (Line(points={{-58,60},{ - -50,60},{-50,90},{0,90},{0,110}}, color={0,0,127})); + -50,60},{-50,90},{10,90},{10,110}}, color={0,0,127})); connect(swiOnOff.u2, booOnOff) annotation (Line(points={{-62,-80},{-110,-80}}, color={255,0,255})); connect(swiOnOff.y, minPum2.u2) annotation (Line(points={{-38,-80},{-34,-80},{ -34,-56},{-16,-56},{-16,-68}}, color={0,0,127})); - connect(swiOnOff.y, minVal2.u2) annotation (Line(points={{-38,-80},{-34,-80},{ - -34,-56},{24,-56},{24,-68}}, color={0,0,127})); - connect(swiOnOff.y, minVal1.u2) annotation (Line(points={{-38,-80},{-34,-80},{ - -34,-56},{64,-56},{64,-68}}, color={0,0,127})); + connect(swiOnOff.y, minVal2.u2) annotation (Line(points={{-38,-80},{-34,-80}, + {-34,-56},{84,-56},{84,-68}},color={0,0,127})); + connect(swiOnOff.y, minVal1.u2) annotation (Line(points={{-38,-80},{-34,-80}, + {-34,-56},{34,-56},{34,-68}},color={0,0,127})); connect(minPum2.y, yPum2) annotation (Line(points={{-10,-92},{-10,-110}}, color={0,0,127})); connect(minVal2.y, yVal2) - annotation (Line(points={{30,-92},{30,-110}}, color={0,0,127})); + annotation (Line(points={{90,-92},{90,-110}}, color={0,0,127})); connect(minVal1.y, yVal1) - annotation (Line(points={{70,-92},{70,-110}}, color={0,0,127})); - connect(swiFloDirVal2.u2, booFloDir) annotation (Line(points={{-2,-30},{-6, - -30},{-6,10},{-110,10}}, color={255,0,255})); - connect(swiFloDirVal1.u2, booFloDir) annotation (Line(points={{48,-30},{44, - -30},{44,10},{-110,10}}, color={255,0,255})); + annotation (Line(points={{40,-92},{40,-110}}, color={0,0,127})); + connect(swiFloDirVal2.u2, booFloDir) annotation (Line(points={{48,-30},{40, + -30},{40,10},{-110,10}}, color={255,0,255})); + connect(swiFloDirVal1.u2, booFloDir) annotation (Line(points={{-2,-30},{-20, + -30},{-20,10},{-110,10}},color={255,0,255})); connect(yVal1, yVal1) - annotation (Line(points={{70,-110},{70,-110}}, color={0,0,127})); + annotation (Line(points={{40,-110},{40,-110}}, color={0,0,127})); annotation (Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), Icon( coordinateSystem(extent={{-100,-100},{100,100}}))); end ReversiblePumpValveControl; diff --git a/Buildings/Fluid/Storage/Plant/CDWPlaceholder.mo b/Buildings/Fluid/Storage/Plant/CDWPlaceholder.mo new file mode 100644 index 00000000000..6bc7d0df249 --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/CDWPlaceholder.mo @@ -0,0 +1,55 @@ +within Buildings.Fluid.Storage.Plant; +model CDWPlaceholder "Placeholder model for the CDW loop" + extends Interfaces.PartialTwoPortInterface( + final m_flow_nominal=1); + + Buildings.Fluid.Sources.Boundary_pT souCDW( + redeclare final package Medium = Medium, + final p=800000, + final T=32 + 273.15, + nPorts=1) "Source representing CDW supply line" annotation ( + Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=90, + origin={-50,70}))); + Modelica.Blocks.Sources.Constant set_mCDW_flow(k=m_flow_nominal) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + rotation=0, + origin={-90,30}))); + Buildings.Fluid.Movers.BaseClasses.IdealSource ideSouCDW( + redeclare package Medium = Medium, + control_m_flow=true, + control_dp=false, + m_flow_small=1E-3) + "Flow source for the CDW loop" + annotation (Placement(transformation(extent={{10,-10},{-10,10}}, + rotation=0, + origin={-70,0}))); + Buildings.Fluid.Sources.Boundary_pT sinCDW( + redeclare final package Medium = Medium, + final p=300000, + final T=37 + 273.15, + nPorts=1) "Sink representing CDW return line" annotation ( + Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=90, + origin={50,70}))); +equation + connect(souCDW.ports[1],ideSouCDW. port_a) + annotation (Line(points={{-50,60},{-50,0},{-60,0}}, + color={0,127,255})); + connect(set_mCDW_flow.y,ideSouCDW. m_flow_in) annotation (Line(points={{-79,30}, + {-64,30},{-64,8}}, color={0,0,127})); + connect(ideSouCDW.port_b, port_a) + annotation (Line(points={{-80,0},{-100,0}}, color={0,127,255})); + connect(sinCDW.ports[1], port_b) + annotation (Line(points={{50,60},{50,0},{100,0}}, color={0,127,255})); + annotation (Icon(graphics={Rectangle(extent={{-100,98},{-60,-100}}, + lineColor={28, + 108,200}), Text( + extent={{-80,40},{80,-20}}, + textColor={28,108,200}, + textString="CDW"), Rectangle(extent={{60,100},{100,-100}}, + lineColor={28, + 108,200})})); +end CDWPlaceholder; diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo index fc6addd9968..14901c7f548 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo @@ -1,15 +1,16 @@ within Buildings.Fluid.Storage.Plant; model ChillerAndTank "(Draft) Model of a plant with a chiller and a tank where the tank can potentially be charged remotely" - replaceable package Medium = - Modelica.Media.Interfaces.PartialMedium "Medium in the component"; + extends Buildings.Fluid.Interfaces.PartialFourPortInterface( + final m1_flow_nominal = m2_flow_nominal, + final m2_flow_nominal = mChi_flow_nominal + mTan_flow_nominal); parameter Boolean allowRemoteCharging = true "Turns the plant to a prosumer"; - parameter Modelica.Units.SI.MassFlowRate m1_flow_nominal=1 + parameter Modelica.Units.SI.MassFlowRate mChi_flow_nominal=1 "Nominal mass flow rate for the chiller branch"; - parameter Modelica.Units.SI.MassFlowRate m2_flow_nominal=1 + parameter Modelica.Units.SI.MassFlowRate mTan_flow_nominal=1 "Nominal mass flow rate for the tank branch"; parameter Modelica.Units.SI.PressureDifference dp_nominal= p_CHWS_nominal-p_CHWR_nominal @@ -24,100 +25,68 @@ model ChillerAndTank "Nominal temperature of CHW return"; Buildings.Fluid.FixedResistances.PressureDrop preDro1( - redeclare package Medium = Medium, + redeclare package Medium = Medium2, final dp_nominal=dp_nominal/10, - final m_flow_nominal=m1_flow_nominal) "Flow resistance on chiller branch" - annotation (Placement(transformation(extent={{40,30},{60,50}}))); - Buildings.Fluid.FixedResistances.Junction jun1( - redeclare package Medium = Medium, - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - m_flow_nominal={m1_flow_nominal+m2_flow_nominal, - -m1_flow_nominal,-m2_flow_nominal}, - dp_nominal={0,0,0}, - T_start=T_CHWR_nominal) "Junction near the return line" - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-80,0}))); - Buildings.Fluid.FixedResistances.Junction jun2( - redeclare package Medium = Medium, - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - m_flow_nominal={m1_flow_nominal,m2_flow_nominal, - -m1_flow_nominal-m2_flow_nominal}, - dp_nominal={0,0,0}, - T_start=T_CHWS_nominal) - "Junction near the supply line" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, + final m_flow_nominal=mChi_flow_nominal) "Flow resistance on chiller branch" + annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0, - origin={100,0}))); + origin={70,-10}))); Buildings.Fluid.FixedResistances.PressureDrop preDro2( - redeclare package Medium = Medium, + redeclare package Medium = Medium2, final allowFlowReversal=true, final dp_nominal=dp_nominal/10, - final m_flow_nominal=m2_flow_nominal) "Flow resistance on tank branch" - annotation (Placement(transformation(extent={{40,-70},{60,-50}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_a( - p(start=p_CHWR_nominal), - redeclare package Medium = Medium, - h_outflow(start=Medium.h_default, nominal=Medium.h_default)) - "Fluid connector a (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{-190,-10},{-170,10}}), - iconTransformation(extent={{-110,-10},{-90,10}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b( - p(start=p_CHWS_nominal), - redeclare final package Medium = Medium, - h_outflow(start=Medium.h_default, nominal=Medium.h_default)) - "Fluid connector b (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{150,-10},{130,10}}), - iconTransformation(extent={{110,-10},{90,10}}))); + final m_flow_nominal=mTan_flow_nominal) "Flow resistance on tank branch" + annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + rotation=0, + origin={72,-70}))); Modelica.Blocks.Interfaces.RealInput set_mPum1_flow "Primary pump mass flow rate setpoint" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={-40,130}), iconTransformation( + origin={40,130}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-110,90}))); Buildings.Fluid.Storage.Plant.TemperatureSource ideChi( - redeclare package Medium = Medium, - m_flow_nominal=m1_flow_nominal, + redeclare package Medium = Medium2, + m_flow_nominal=mChi_flow_nominal, p_nominal=p_CHWS_nominal, T_a_nominal=T_CHWR_nominal, T_b_nominal=T_CHWS_nominal) "Ideal chiller" - annotation (Placement(transformation(extent={{-10,30},{10,50}}))); + annotation (Placement(transformation(extent={{20,-20},{40,0}}))); Buildings.Fluid.Storage.Plant.TemperatureSource ideTan( - redeclare package Medium = Medium, + redeclare package Medium = Medium2, final allowFlowReversal=true, - m_flow_nominal=m2_flow_nominal, + m_flow_nominal=mTan_flow_nominal, p_nominal=p_CHWS_nominal, T_a_nominal=T_CHWR_nominal, T_b_nominal=T_CHWS_nominal) "Ideal tank" - annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); + annotation (Placement(transformation(extent={{18,-80},{38,-60}}))); Buildings.Fluid.Movers.FlowControlled_m_flow pum1( - redeclare package Medium = Medium, - per(pressure(dp=dp_nominal*{2,1.2,0}, V_flow=m1_flow_nominal/1.2*{0,1.2,2})), + redeclare package Medium = Medium2, + per(pressure(dp=dp_nominal*{2,1.2,0}, V_flow=mChi_flow_nominal/1.2*{0,1.2,2})), energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, allowFlowReversal=true, addPowerToMedium=false, - m_flow_nominal=m1_flow_nominal, + m_flow_nominal=mChi_flow_nominal, m_flow_start=0, T_start=T_CHWR_nominal) "Primary CHW pump" - annotation (Placement(transformation(extent={{-60,30},{-40,50}}))); + annotation (Placement(transformation(extent={{-20,-20},{0,0}}))); Modelica.Blocks.Interfaces.RealOutput mTan_flow "Mass flow rate through the tank" annotation (Dialog(group= "Time varying output signal"), Placement(transformation( extent={{10,-10},{-10,10}}, rotation=90, - origin={-40,-110}), iconTransformation( + origin={10,-110}), iconTransformation( extent={{10,-10},{-10,10}}, - rotation=90, - origin={90,-110}))); + rotation=180, + origin={110,-20}))); Buildings.Fluid.Movers.SpeedControlled_y pum2( - redeclare package Medium = Medium, - per(pressure(dp=dp_nominal*{2,1.2,0}, V_flow=(m1_flow_nominal + - m2_flow_nominal)/1.2*{0,1.2,2})), + redeclare package Medium = Medium2, + per(pressure(dp=dp_nominal*{2,1.2,0}, V_flow=(mChi_flow_nominal + + mTan_flow_nominal)/1.2*{0,1.2,2})), energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, allowFlowReversal=true, addPowerToMedium=false, @@ -125,171 +94,169 @@ model ChillerAndTank T_start=T_CHWR_nominal) "Secondary pump" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-150,20}))); + origin={-78,-20}))); Buildings.Fluid.Storage.Plant.BaseClasses.ReversiblePumpValveControl pum2Con if allowRemoteCharging "Control block for secondary pump-valve group" - annotation (Placement(transformation(extent={{-140,78},{-120,100}}))); + annotation (Placement(transformation(extent={{-58,80},{-38,102}}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanInput booOnOff if allowRemoteCharging "Plant status: true = online; false = offline" annotation (Placement( - transformation(extent={{-200,70},{-180,90}}), iconTransformation(extent= + transformation(extent={{-120,70},{-100,90}}), iconTransformation(extent= {{-140,-110},{-100,-70}}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanInput booFloDir if allowRemoteCharging "Flow direction: true = normal; false = reverse" annotation (Placement( - transformation(extent={{-200,90},{-180,110}}), iconTransformation( - extent={{-140,-70},{-100,-30}}))); + transformation(extent={{-120,90},{-100,110}}), iconTransformation( + extent={{-140,-40},{-100,0}}))); Modelica.Blocks.Interfaces.RealInput set_mTan_flow if allowRemoteCharging "Tank mass flow rate setpoint" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={-160,130}), iconTransformation( + origin={-80,130}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-110,50}))); + origin={-110,20}))); Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage val1( - redeclare package Medium = Medium, + redeclare package Medium = Medium2, use_inputFilter=false, l=1E-10, dpValve_nominal=1, - m_flow_nominal=m1_flow_nominal+m2_flow_nominal) if allowRemoteCharging + m_flow_nominal=mChi_flow_nominal+mTan_flow_nominal) if allowRemoteCharging "Valve in series to the pump (normal direction)" - annotation (Placement(transformation(extent={{-120,22},{-100,42}}))); + annotation (Placement(transformation(extent={{-60,-20},{-40,0}}))); Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage val2( - redeclare package Medium = Medium, + redeclare package Medium = Medium2, use_inputFilter=false, l=1E-10, dpValve_nominal=1, - m_flow_nominal=m2_flow_nominal) if allowRemoteCharging + m_flow_nominal=mTan_flow_nominal) if allowRemoteCharging "Valve in parallel to the secondary pump (reverse direction)" - annotation (Placement(transformation(extent={{-120,-30},{-140,-10}}))); + annotation (Placement(transformation(extent={{-40,-80},{-60,-60}}))); Buildings.Controls.OBC.CDL.Continuous.Switch swiFloDirPum1 if allowRemoteCharging "Switches off pum1 when tank charged remotely" annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=-90, - origin={-50,90}))); + origin={30,90}))); Modelica.Blocks.Sources.Constant conZero(k=0) if allowRemoteCharging "Constant y = 0" annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=90, - origin={-90,90}))); - BaseClasses.FluidThrough pasVal1(redeclare package Medium = Medium) + origin={-10,90}))); + BaseClasses.FluidThrough pasVal1(redeclare package Medium = Medium2) if not allowRemoteCharging "Replaces val1 when remote charging not allowed" - annotation (Placement(transformation(extent={{-120,0},{-100,20}}))); + annotation (Placement(transformation(extent={{-60,-42},{-40,-22}}))); BaseClasses.SignalThrough pasSwiFloDirPum1 if not allowRemoteCharging "Replaces swiFloDirPum1 when remote charging not allowed" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={-10,90}))); + origin={70,90}))); Modelica.Blocks.Interfaces.RealInput yPum2 if not allowRemoteCharging "Secondary pump speed input" - annotation (Placement(transformation(extent={{-200,50},{-180,70}}), + annotation (Placement(transformation(extent={{-120,10},{-100,30}}), iconTransformation(extent={{-10,-10},{10,10}}, rotation=-90, - origin={-70,110}))); + origin={-80,110}))); equation - connect(preDro2.port_b, jun2.port_3) - annotation (Line(points={{60,-60},{100,-60},{100,-10}}, - color={0,127,255})); - connect(preDro1.port_b, jun2.port_1) - annotation (Line(points={{60,40},{84,40},{84,0},{90,0}}, - color={0,127,255})); - connect(jun2.port_2, port_b) - annotation (Line(points={{110,0},{140,0}}, color={0,127,255})); - connect(ideChi.port_b, preDro1.port_a) annotation (Line(points={{10,40},{10,40}, - {10,40},{40,40}}, color={0,127,255})); + connect(ideChi.port_b, preDro1.port_a) annotation (Line(points={{40,-10},{60,-10}}, + color={0,127,255})); connect(ideTan.port_b, preDro2.port_a) - annotation (Line(points={{10,-60},{40,-60}}, color={0,127,255})); - connect(jun1.port_3, ideTan.port_a) annotation (Line(points={{-80,-10},{-80, - -60},{-10,-60}}, color={0,127,255})); + annotation (Line(points={{38,-70},{62,-70}}, color={0,127,255})); connect(pum1.port_b, ideChi.port_a) - annotation (Line(points={{-40,40},{-10,40}}, color={0,127,255})); - connect(jun1.port_2, pum1.port_a) annotation (Line(points={{-70,0},{-64,0},{-64, - 40},{-60,40}}, color={0,127,255})); - connect(ideTan.m_flow,mTan_flow) annotation (Line(points={{-7,-49},{-7,-46}, - {-40,-46},{-40,-110}}, color={0,0,127})); - connect(booFloDir, pum2Con.booFloDir) annotation (Line(points={{-190,100},{-174, - 100},{-174,85.7},{-142,85.7}}, color={255,0,255})); - connect(jun1.port_1, val2.port_a) annotation (Line(points={{-90,0},{-94,0},{-94, - -20},{-120,-20}}, color={0,127,255})); - connect(val2.port_b, port_a) annotation (Line(points={{-140,-20},{-164,-20},{-164, - 0},{-180,0}}, color={0,127,255})); - connect(val1.port_b, jun1.port_1) annotation (Line(points={{-100,32},{-94,32}, - {-94,0},{-90,0}}, color={0,127,255})); - connect(pum2Con.yVal2, val2.y) annotation (Line(points={{-127,76.9},{-127,40}, - {-130,40},{-130,-8}}, color={0,0,127})); - connect(pum2Con.yVal1, val1.y) annotation (Line(points={{-123,76.9},{-110,76.9}, - {-110,44}}, color={0,0,127})); - connect(pum2Con.um_mTan_flow, ideTan.m_flow) annotation (Line(points={{-141, - 96.7},{-170,96.7},{-170,-46},{-8,-46},{-8,-49},{-7,-49}}, + annotation (Line(points={{0,-10},{20,-10}}, color={0,127,255})); + connect(ideTan.m_flow,mTan_flow) annotation (Line(points={{21,-59},{10,-59},{ + 10,-110}}, color={0,0,127})); + connect(booFloDir, pum2Con.booFloDir) annotation (Line(points={{-110,100},{-90, + 100},{-90,87.7},{-60,87.7}}, color={255,0,255})); + connect(pum2Con.yVal2, val2.y) annotation (Line(points={{-41,78.9},{-41,8},{-32, + 8},{-32,-52},{-50,-52},{-50,-58}}, + color={0,0,127})); + connect(pum2Con.yVal1, val1.y) annotation (Line(points={{-45,78.9},{-46,78.9}, + {-46,8},{-50,8},{-50,2}}, + color={0,0,127})); + connect(pum2Con.um_mTan_flow, ideTan.m_flow) annotation (Line(points={{-59,98.7}, + {-62,98.7},{-62,106},{-26,106},{-26,22},{10,22},{10,-59},{21,-59}}, color={0,0,127})); - connect(pum2Con.us_mTan_flow, set_mTan_flow) annotation (Line(points={{-141,92.3}, - {-160,92.3},{-160,130}}, color={0,0,127})); - connect(pum2.port_a, port_a) annotation (Line(points={{-160,20},{-164,20},{ - -164,0},{-180,0}}, color={0,127,255})); + connect(pum2Con.us_mTan_flow, set_mTan_flow) annotation (Line(points={{-59,94.3}, + {-80,94.3},{-80,130}}, color={0,0,127})); connect(pum2.port_b, val1.port_a) - annotation (Line(points={{-140,20},{-124,20},{-124,32},{-120,32}}, + annotation (Line(points={{-68,-20},{-64,-20},{-64,-10},{-60,-10}}, color={0,127,255})); - connect(pum2.y, pum2Con.yPum2) annotation (Line(points={{-150,32},{-150,70},{-131, - 70},{-131,76.9}}, color={0,0,127})); - connect(swiFloDirPum1.u2, booFloDir) annotation (Line(points={{-50,102},{-50,108}, - {-174,108},{-174,100},{-190,100}}, - color={255,0,255})); - connect(swiFloDirPum1.u1, set_mPum1_flow) annotation (Line(points={{-42,102},{ - -42,116},{-40,116},{-40,130}}, - color={0,0,127})); + connect(pum2.y, pum2Con.yPum2) annotation (Line(points={{-78,-8},{-78,20},{-49, + 20},{-49,78.9}}, color={0,0,127})); + connect(swiFloDirPum1.u2, booFloDir) annotation (Line(points={{30,102},{30,110}, + {-90,110},{-90,100},{-110,100}},color={255,0,255})); + connect(swiFloDirPum1.u1, set_mPum1_flow) annotation (Line(points={{38,102},{38, + 110},{40,110},{40,130}}, color={0,0,127})); connect(pum1.m_flow_in,swiFloDirPum1. y) - annotation (Line(points={{-50,52},{-50,78}}, color={0,0,127})); - connect(conZero.y,swiFloDirPum1. u3) annotation (Line(points={{-90,101},{-90,106}, - {-58,106},{-58,102}}, - color={0,0,127})); - connect(pum2Con.booOnOff, booOnOff) annotation (Line(points={{-142,81.3},{-142, - 80},{-190,80}}, color={255,0,255})); - connect(pum2.port_b, pasVal1.port_a) annotation (Line(points={{-140,20},{-124, - 20},{-124,10},{-120,10}}, color={0,127,255})); - connect(pasSwiFloDirPum1.u, set_mPum1_flow) annotation (Line(points={{-10,101}, - {-10,116},{-40,116},{-40,130}}, color={0,0,127})); - connect(pasSwiFloDirPum1.y, pum1.m_flow_in) annotation (Line(points={{-10,79}, - {-10,60},{-50,60},{-50,52}}, color={0,0,127})); + annotation (Line(points={{-10,2},{-10,70},{30,70},{30,78}}, + color={0,0,127})); + connect(conZero.y,swiFloDirPum1. u3) annotation (Line(points={{-10,101},{-10,106}, + {22,106},{22,102}}, color={0,0,127})); + connect(pum2Con.booOnOff, booOnOff) annotation (Line(points={{-60,83.3},{-60,84}, + {-80,84},{-80,80},{-110,80}},color={255,0,255})); + connect(pum2.port_b, pasVal1.port_a) annotation (Line(points={{-68,-20},{-64,-20}, + {-64,-32},{-60,-32}}, color={0,127,255})); + connect(pasSwiFloDirPum1.u, set_mPum1_flow) annotation (Line(points={{70,101}, + {70,110},{40,110},{40,130}}, color={0,0,127})); + connect(pasSwiFloDirPum1.y, pum1.m_flow_in) annotation (Line(points={{70,79},{ + 70,70},{-10,70},{-10,2}}, color={0,0,127})); connect(pum2.y, yPum2) - annotation (Line(points={{-150,32},{-150,60},{-190,60}}, color={0,0,127})); - connect(pasVal1.port_b, jun1.port_1) annotation (Line(points={{-100,10},{-94, - 10},{-94,0},{-90,0}}, color={0,127,255})); + annotation (Line(points={{-78,-8},{-78,20},{-110,20}}, color={0,0,127})); + connect(preDro1.port_b, port_a2) annotation (Line(points={{80,-10},{86,-10},{86, + -60},{100,-60}}, color={0,127,255})); + connect(preDro2.port_b, port_a2) annotation (Line(points={{82,-70},{86,-70},{86, + -60},{100,-60}}, color={0,127,255})); + connect(pasVal1.port_b, pum1.port_a) annotation (Line(points={{-40,-32},{-26,-32}, + {-26,-10},{-20,-10}}, color={0,127,255})); + connect(val1.port_b, pum1.port_a) + annotation (Line(points={{-40,-10},{-20,-10}}, color={0,127,255})); + connect(val2.port_a, pum1.port_a) annotation (Line(points={{-40,-70},{-26,-70}, + {-26,-10},{-20,-10}}, color={0,127,255})); + connect(ideTan.port_a, pum1.port_a) annotation (Line(points={{18,-70},{-26,-70}, + {-26,-10},{-20,-10}}, color={0,127,255})); + connect(pum2.port_a, port_b2) annotation (Line(points={{-88,-20},{-88,-60},{-100, + -60}}, color={0,127,255})); + connect(val2.port_b, port_b2) annotation (Line(points={{-60,-70},{-88,-70},{-88, + -60},{-100,-60}}, color={0,127,255})); + connect(port_b1, port_a1) + annotation (Line(points={{100,60},{-100,60}}, color={0,127,255})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,100}}), graphics={Line( - points={{-80,-20},{-20,-20}}, + points={{-30,-110},{30,-110}}, color={28,108,200}, pattern=LinePattern.Dash, visible=allowRemoteCharging), Polygon( - points={{-80,-20},{-60,-14},{-60,-26},{-80,-20}}, + points={{-30,-110},{-10,-104},{-10,-116},{-30,-110}}, fillColor={28,108,200}, fillPattern=FillPattern.Solid, pattern=LinePattern.None, visible=allowRemoteCharging), - Line(points={{0,0},{0,-20},{30,-20},{30,-60},{60,-60},{60,0}}, color={0, + Line(points={{-60,0},{-60,-20},{0,-20},{0,-60},{60,-60},{60,0}}, + color={0, 0,0}), - Line(points={{-90,0},{0,0},{0,60},{60,60},{60,0},{90,0}}, color={0,0,0}), + Line(points={{-100,0},{-60,0},{-60,60},{60,60},{60,0},{100,0}}, + color={0,0,0}), Ellipse( - extent={{10,82},{54,40}}, + extent={{-22,80},{22,38}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), Rectangle( - extent={{10,-10},{50,-72}}, + extent={{-20,-8},{20,-70}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), - Line(points={{-80,20},{-20,20}}, color={28,108,200}), + Line(points={{-30,-90},{30,-90}},color={28,108,200}), Polygon( - points={{-20,20},{-40,26},{-40,14},{-20,20}}, + points={{30,-90},{10,-84},{10,-96},{30,-90}}, fillColor={28,108,200}, fillPattern=FillPattern.Solid, pattern=LinePattern.None), - Line(points={{16,76},{52,68}}, color={0,0,0}), - Line(points={{52,56},{18,46}}, color={0,0,0})}), Diagram( - coordinateSystem(preserveAspectRatio=false, extent={{-180,-100},{140,120}}))); + Line(points={{-16,74},{20,66}},color={0,0,0}), + Line(points={{20,54},{-14,44}},color={0,0,0})}), Diagram( + coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,120}}))); end ChillerAndTank; diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo index 42146ea4a06..b2ec658119c 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo @@ -15,7 +15,8 @@ model OneSourceOneUser "(Draft) District system with one source and one user" */ extends Modelica.Icons.Example; - package Medium = Buildings.Media.Water "Medium model"; + package Medium1 = Buildings.Media.Water "Medium model for CDW"; + package Medium2 = Buildings.Media.Water "Medium model for CHW"; parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=1 "Nominal mass flow rate"; @@ -36,10 +37,11 @@ model OneSourceOneUser "(Draft) District system with one source and one user" "Nominal cooling load of one consumer"; Buildings.Fluid.Storage.Plant.ChillerAndTank cat( - redeclare final package Medium=Medium, + redeclare final package Medium1=Medium1, + redeclare final package Medium2=Medium2, final allowRemoteCharging=false, - final m1_flow_nominal=m_flow_nominal/2, - final m2_flow_nominal=m_flow_nominal/2, + final mChi_flow_nominal=m_flow_nominal/2, + final mTan_flow_nominal=m_flow_nominal/2, final p_CHWS_nominal=p_CHWS_nominal, final p_CHWR_nominal=p_CHWR_nominal, final T_CHWS_nominal=T_CHWS_nominal, @@ -47,13 +49,13 @@ model OneSourceOneUser "(Draft) District system with one source and one user" "Chiller and tank" annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); Buildings.Fluid.Storage.Plant.DummyUser usr( - redeclare package Medium = Medium, + redeclare package Medium = Medium2, m_flow_nominal=m_flow_nominal, p_a_nominal=p_CHWS_nominal - dp_nominal*0.35, p_b_nominal=p_CHWR_nominal + dp_nominal*0.35, T_a_nominal=T_CHWS_nominal, T_b_nominal=T_CHWR_nominal) "User" - annotation (Placement(transformation(extent={{40,-10},{60,10}}))); + annotation (Placement(transformation(extent={{40,-30},{60,-10}}))); Modelica.Blocks.Sources.Constant set_TRet(k=12 + 273.15) "CHW return setpoint" annotation (Placement(transformation(extent={{0,20},{20,40}}))); @@ -70,15 +72,15 @@ model OneSourceOneUser "(Draft) District system with one source and one user" "PI controller for pum2" annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=270, - origin={-70,30}))); + origin={-50,40}))); Buildings.Fluid.FixedResistances.PressureDrop preDro1( - redeclare package Medium = Medium, + redeclare package Medium = Medium2, final allowFlowReversal=true, final dp_nominal=dp_nominal*0.3, final m_flow_nominal=m_flow_nominal) "Flow resistance of the consumer" - annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + annotation (Placement(transformation(extent={{-10,-30},{10,-10}}))); Buildings.Fluid.FixedResistances.PressureDrop preDro2( - redeclare package Medium = Medium, + redeclare package Medium = Medium2, final allowFlowReversal=true, final dp_nominal=dp_nominal*0.3, final m_flow_nominal=m_flow_nominal) "Flow resistance of the consumer" @@ -87,20 +89,20 @@ model OneSourceOneUser "(Draft) District system with one source and one user" "Normalised consumer differential pressure setpoint" annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=-90, - origin={-70,70}))); + origin={-50,70}))); Buildings.Fluid.Sources.Boundary_pT sou_p( - redeclare final package Medium = Medium, + redeclare final package Medium = Medium2, final p=p_CHWR_nominal, final T=T_CHWR_nominal, nPorts=1) "Pressurisation point" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-90,0}))); + origin={-90,-20}))); Modelica.Blocks.Math.Gain gaiPum2(k=1/usr.dp_nominal) "Gain" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=270, - origin={-30,70}))); + origin={-20,70}))); Buildings.Controls.OBC.CDL.Continuous.Hysteresis hysPum1(uLow=0.05, uHigh=0.5) "Primary pump shuts off at con.yVal = 0.05 and restarts at 0.5" annotation ( Placement(transformation( @@ -113,27 +115,32 @@ model OneSourceOneUser "(Draft) District system with one source and one user" extent={{10,-10},{-10,10}}, rotation=0, origin={-50,-70}))); + Buildings.Fluid.Storage.Plant.CDWPlaceholder CDW( + redeclare final package Medium = Medium1) + "Placeholder for CHW loop" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-88,30}))); equation connect(set_TRet.y,usr. TSet) - annotation (Line(points={{21,30},{32,30},{32,5},{39,5}},color={0,0,127})); + annotation (Line(points={{21,30},{32,30},{32,-15},{39,-15}}, + color={0,0,127})); connect(preQCooLoa_flow.y,usr. QCooLoa_flow) - annotation (Line(points={{21,60},{34,60},{34,9},{39,9}}, color={0,0,127})); - connect(cat.port_b, preDro1.port_a) - annotation (Line(points={{-40,0},{-10,0}}, color={0,127,255})); + annotation (Line(points={{21,60},{34,60},{34,-11},{39,-11}}, + color={0,0,127})); connect(preDro1.port_b,usr. port_a) - annotation (Line(points={{10,0},{40,0}}, color={0,127,255})); + annotation (Line(points={{10,-20},{40,-20}}, + color={0,127,255})); connect(usr.port_b, preDro2.port_a) - annotation (Line(points={{60,0},{60,-40},{10,-40}}, color={0,127,255})); - connect(preDro2.port_b, cat.port_a) - annotation (Line(points={{-10,-40},{-60,-40},{-60,0}}, color={0,127,255})); + annotation (Line(points={{60,-20},{60,-40},{10,-40}}, + color={0,127,255})); connect(set_dpCon.y, conPI_pum2.u_s) - annotation (Line(points={{-70,59},{-70,42}}, color={0,0,127})); - connect(sou_p.ports[1], cat.port_a) annotation (Line(points={{-80,0},{-60,0}}, - color={0,127,255})); - connect(usr.dp, gaiPum2.u) annotation (Line(points={{47,11},{46,11},{46,82},{ - -30,82}}, color={0,0,127})); + annotation (Line(points={{-50,59},{-50,52}}, color={0,0,127})); + connect(usr.dp, gaiPum2.u) annotation (Line(points={{47,-9},{46,-9},{46,88},{-20, + 88},{-20,82}}, color={0,0,127})); connect(conPI_pum2.y, cat.yPum2) - annotation (Line(points={{-70,19},{-70,16},{-57,16},{-57,11}}, + annotation (Line(points={{-50,29},{-50,20},{-58,20},{-58,11}}, color={0,0,127})); connect(hysPum1.y, booToReaPum1.u) annotation (Line(points={{-22,-70},{-38,-70}}, @@ -142,8 +149,18 @@ equation annotation (Line(points={{-62,-70},{-68,-70},{-68,9},{-61,9}}, color={0,0,127})); connect(hysPum1.u,usr. yVal_actual) annotation (Line(points={{2,-70},{22,-70}, - {22,11},{43,11}}, color={0,0,127})); + {22,-9},{43,-9}}, color={0,0,127})); connect(gaiPum2.y, conPI_pum2.u_m) - annotation (Line(points={{-30,59},{-30,30},{-58,30}}, color={0,0,127})); + annotation (Line(points={{-20,59},{-20,40},{-38,40}}, color={0,0,127})); + connect(cat.port_b2, preDro2.port_b) annotation (Line(points={{-60,-6},{-64,-6}, + {-64,-40},{-10,-40}}, color={0,127,255})); + connect(cat.port_b2, sou_p.ports[1]) annotation (Line(points={{-60,-6},{-64,-6}, + {-64,-20},{-80,-20}}, color={0,127,255})); + connect(cat.port_a2, preDro1.port_a) annotation (Line(points={{-40,-6},{-18,-6}, + {-18,-20},{-10,-20}}, color={0,127,255})); + connect(CDW.port_b, cat.port_a1) + annotation (Line(points={{-88,20},{-88,6},{-60,6}}, color={0,127,255})); + connect(CDW.port_a, cat.port_b1) annotation (Line(points={{-88,40},{-88,42},{ + -74,42},{-74,18},{-32,18},{-32,6},{-40,6}}, color={0,127,255})); annotation(experiment(Tolerance=1e-06, StopTime=3600)); end OneSourceOneUser; diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index 659714a29d6..561bcd2991b 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -3,7 +3,8 @@ model TwoSourcesThreeUsers "(Draft) District model with two sources and three users" extends Modelica.Icons.Example; - package Medium = Buildings.Media.Water "Medium model"; + package Medium1 = Buildings.Media.Water "Medium model for CDW"; + package Medium2 = Buildings.Media.Water "Medium model for CHW"; parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=1 "Nominal mass flow rate"; @@ -24,7 +25,7 @@ model TwoSourcesThreeUsers "Nominal cooling load of one consumer"; Buildings.Fluid.Storage.Plant.TemperatureSource chi1( - redeclare final package Medium = Medium, + redeclare final package Medium = Medium2, allowFlowReversal=true, m_flow_nominal=1.5*m_flow_nominal, p_nominal=p_CHWR_nominal, @@ -35,9 +36,10 @@ model TwoSourcesThreeUsers rotation=90, origin={-80,60}))); Buildings.Fluid.Storage.Plant.ChillerAndTank cat( - redeclare final package Medium = Medium, - final m1_flow_nominal=0.75*m_flow_nominal, - final m2_flow_nominal=0.75*m_flow_nominal, + redeclare final package Medium1 = Medium1, + redeclare final package Medium2 = Medium2, + final mChi_flow_nominal=0.75*m_flow_nominal, + final mTan_flow_nominal=0.75*m_flow_nominal, final p_CHWS_nominal=p_CHWS_nominal, final p_CHWR_nominal=p_CHWR_nominal, final T_CHWS_nominal=T_CHWS_nominal, @@ -48,7 +50,7 @@ model TwoSourcesThreeUsers rotation=90, origin={-60,-60}))); Buildings.Fluid.Storage.Plant.DummyUser usr1( - redeclare package Medium = Medium, + redeclare package Medium = Medium2, m_flow_nominal=m_flow_nominal, p_a_nominal=p_CHWS_nominal - dp_nominal*0.35, p_b_nominal=p_CHWR_nominal + dp_nominal*0.35, @@ -59,7 +61,7 @@ model TwoSourcesThreeUsers rotation=-90, origin={60,60}))); Buildings.Fluid.Storage.Plant.DummyUser usr2( - redeclare package Medium = Medium, + redeclare package Medium = Medium2, m_flow_nominal=m_flow_nominal, p_a_nominal=p_CHWS_nominal - dp_nominal*0.35, p_b_nominal=p_CHWR_nominal + dp_nominal*0.35, @@ -70,7 +72,7 @@ model TwoSourcesThreeUsers rotation=-90, origin={60,0}))); Buildings.Fluid.Storage.Plant.DummyUser usr3( - redeclare package Medium = Medium, + redeclare package Medium = Medium2, m_flow_nominal=m_flow_nominal, p_a_nominal=p_CHWS_nominal - dp_nominal*0.35, p_b_nominal=p_CHWR_nominal + dp_nominal*0.35, @@ -81,7 +83,7 @@ model TwoSourcesThreeUsers rotation=-90, origin={60,-60}))); Buildings.Fluid.Movers.SpeedControlled_y pumChi1( - redeclare package Medium = Medium, + redeclare package Medium = Medium2, per(pressure(dp=dp_nominal*{2,1.2,0}, V_flow=(m_flow_nominal*1.5)/1.2*{0,1.2,2})), energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, allowFlowReversal=true, @@ -113,17 +115,17 @@ model TwoSourcesThreeUsers annotation (Placement(transformation(extent={{60,-120},{40,-100}}))); Modelica.Blocks.Sources.Constant set_mChi2Pum1_flow(k=0.75*m_flow_nominal) "Placeholder, primary flow rate setpoint" - annotation (Placement(transformation(extent={{-100,-100},{-80,-80}}))); + annotation (Placement(transformation(extent={{-100,-140},{-80,-120}}))); Buildings.Fluid.Sources.Boundary_pT sou_p( - redeclare final package Medium = Medium, + redeclare final package Medium = Medium2, final p=p_CHWR_nominal, final T=T_CHWR_nominal, nPorts=1) "Pressurisation point" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-90,0}))); + origin={-110,40}))); Buildings.Fluid.FixedResistances.PressureDrop preDroChi1( - redeclare package Medium = Medium, + redeclare package Medium = Medium2, final allowFlowReversal=allowFlowReversal, final dp_nominal=dp_nominal/10, final m_flow_nominal=1.5*m_flow_nominal) @@ -142,49 +144,49 @@ model TwoSourcesThreeUsers rotation=90, origin={-60,120}))); Buildings.Fluid.FixedResistances.PressureDrop preDroS2U3( - redeclare package Medium = Medium, + redeclare package Medium = Medium2, final allowFlowReversal=true, final dp_nominal=0.3*dp_nominal, final m_flow_nominal=m_flow_nominal) "Flow resistance source 2 to user 3" annotation (Placement(transformation(extent={{-30,-50},{-10,-30}}))); Buildings.Fluid.FixedResistances.PressureDrop preDroU3S2( - redeclare package Medium = Medium, + redeclare package Medium = Medium2, final allowFlowReversal=true, final dp_nominal=0.3*dp_nominal, final m_flow_nominal=m_flow_nominal) "Flow resistance user 3 to source 2" annotation (Placement(transformation(extent={{30,-90},{10,-70}}))); Buildings.Fluid.FixedResistances.PressureDrop preDroS2U2( - redeclare package Medium = Medium, + redeclare package Medium = Medium2, final allowFlowReversal=true, final dp_nominal=0.3*dp_nominal, final m_flow_nominal=m_flow_nominal) "Flow resistance source 2 to user 2" annotation (Placement(transformation(extent={{-30,-10},{-10,10}}))); Buildings.Fluid.FixedResistances.PressureDrop preDroU2S2( - redeclare package Medium = Medium, + redeclare package Medium = Medium2, final allowFlowReversal=true, final dp_nominal=0.3*dp_nominal, final m_flow_nominal=m_flow_nominal) "Flow resistance user 2 to source 2" annotation (Placement(transformation(extent={{30,-30},{10,-10}}))); Buildings.Fluid.FixedResistances.PressureDrop preDroS1U2( - redeclare package Medium = Medium, + redeclare package Medium = Medium2, final allowFlowReversal=true, final dp_nominal=0.3*dp_nominal, final m_flow_nominal=m_flow_nominal) "Flow resistance source 1 to user 2" annotation (Placement(transformation(extent={{-30,10},{-10,30}}))); Buildings.Fluid.FixedResistances.PressureDrop preDroU2S1( - redeclare package Medium = Medium, + redeclare package Medium = Medium2, final allowFlowReversal=true, final dp_nominal=0.3*dp_nominal, final m_flow_nominal=m_flow_nominal) "Flow resistance user 2 to source 1" annotation (Placement(transformation(extent={{30,-10},{10,10}}))); Buildings.Fluid.FixedResistances.PressureDrop preDroS1U1( - redeclare package Medium = Medium, + redeclare package Medium = Medium2, final allowFlowReversal=true, final dp_nominal=0.3*dp_nominal, final m_flow_nominal=m_flow_nominal) "Flow resistance source 1 to user 3" annotation (Placement(transformation(extent={{-30,70},{-10,90}}))); Buildings.Fluid.FixedResistances.PressureDrop preDroU1S1( - redeclare package Medium = Medium, + redeclare package Medium = Medium2, final allowFlowReversal=true, final dp_nominal=0.3*dp_nominal, final m_flow_nominal=m_flow_nominal) "Flow resistance user 1 to source 1" @@ -249,6 +251,12 @@ model TwoSourcesThreeUsers extent={{-10,-10},{10,10}}, rotation=90, origin={-50,-210}))); + Buildings.Fluid.Storage.Plant.CDWPlaceholder CDW( + redeclare final package Medium = Medium1) + "Placeholder for CHW loop" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-90,-60}))); equation connect(set_TRet.y,usr1. TSet) annotation (Line(points={{41,110},{44,110},{44, 82},{65,82},{65,71}}, color={0,0,127})); @@ -267,36 +275,28 @@ equation {-26,-92},{-50,-92},{-50,-72},{-51,-72}}, color={255,0,255})); connect(set_mChi2Pum1_flow.y, cat.set_mPum1_flow) annotation (Line(points={{-79, - -90},{-70,-90},{-70,-71},{-69,-71}}, color={0,0,127})); + -130},{-69,-130},{-69,-71}}, color={0,0,127})); connect(preDroChi1.port_b, chi1.port_a) annotation (Line(points={{-70,40},{-80,40},{-80,50}}, color={0,127,255})); connect(chi1.port_b, pumChi1.port_a) annotation (Line(points={{-80,70},{-80,80},{-70,80}}, color={0,127,255})); connect(sou_p.ports[1], preDroChi1.port_b) - annotation (Line(points={{-80,0},{-80,40},{-70,40}}, color={0,127,255})); + annotation (Line(points={{-100,40},{-70,40}}, color={0,127,255})); connect(set_dpUsr.y, conPI_PumChi1.u_s) annotation (Line(points={{-60,139},{-60,132}}, color={0,0,127})); connect(conPI_PumChi1.y, pumChi1.y) annotation (Line(points={{-60,109},{-60,92}}, color={0,0,127})); connect(usr1.yVal_actual, mulMax_yVal.u[3]) annotation (Line(points={{71,67}, {86,67},{86,-110},{62,-110},{62,-109.333}},color={0,0,127})); - connect(cat.port_b,preDroS2U3. port_a) annotation (Line(points={{-60,-50},{-60, - -40},{-30,-40}}, color={0,127,255})); connect(preDroS2U3.port_b,usr3. port_a) annotation (Line(points={{-10,-40},{60,-40},{60,-50}}, color={0,127,255})); connect(usr3.port_b,preDroU3S2. port_a) annotation (Line(points={{60,-70},{60,-80},{30,-80}}, color={0,127,255})); - connect(preDroU3S2.port_b, cat.port_a) annotation (Line(points={{10,-80},{-60, - -80},{-60,-70}}, color={0,127,255})); - connect(cat.port_b,preDroS2U2. port_a) annotation (Line(points={{-60,-50},{-60, - -40},{-36,-40},{-36,0},{-30,0}}, color={0,127,255})); connect(preDroS2U2.port_b,usr2. port_a) annotation (Line(points={{-10,0},{-4, 0},{-4,20},{60,20},{60,10}}, color={0,127,255})); connect(usr2.port_b,preDroU2S2. port_a) annotation (Line(points={{60,-10},{60,-20},{30,-20}}, color={0,127,255})); - connect(preDroU2S2.port_b, cat.port_a) annotation (Line(points={{10,-20},{4,-20}, - {4,-80},{-60,-80},{-60,-70}}, color={0,127,255})); connect(pumChi1.port_b,preDroS1U2. port_a) annotation (Line(points={{-50,80},{ -36,80},{-36,20},{-30,20}}, color={0,127,255})); connect(preDroS1U2.port_b,usr2. port_a) annotation (Line(points={{-10,20},{60, @@ -336,7 +336,7 @@ equation connect(mulMin_dpUsr.y, conPI_PumChi1.u_m) annotation (Line(points={{-90,138},{-90,120},{-72,120}}, color={0,0,127})); connect(booFloDir.y, cat.booFloDir) annotation (Line(points={{10,-199},{10,-132}, - {-34,-132},{-34,-100},{-55,-100},{-55,-72}}, color={255,0,255})); + {-34,-132},{-34,-100},{-58,-100},{-58,-72}}, color={255,0,255})); connect(set_mTan_flow_discharge.y, swiTanCha.u1) annotation (Line(points={{-70, -159},{-70,-150},{-58,-150},{-58,-142}}, color={0,0,127})); connect(set_mTan_flow_charge.y, swiTanCha.u3) annotation (Line(points={{-30,-159}, @@ -344,8 +344,20 @@ equation connect(booTanCha.y, swiTanCha.u2) annotation (Line(points={{-50,-199},{-50,-142}}, color={255,0,255})); connect(swiTanCha.y, cat.set_mTan_flow) annotation (Line(points={{-50,-118},{-50, - -112},{-65,-112},{-65,-71}}, color={0,0,127})); + -112},{-62,-112},{-62,-71}}, color={0,0,127})); + connect(preDroU3S2.port_b, cat.port_b2) annotation (Line(points={{10,-80},{-54, + -80},{-54,-70}}, color={0,127,255})); + connect(cat.port_b2, preDroU2S2.port_b) annotation (Line(points={{-54,-70},{-54, + -80},{4,-80},{4,-20},{10,-20}}, color={0,127,255})); + connect(preDroS2U3.port_a, cat.port_a2) annotation (Line(points={{-30,-40},{-54, + -40},{-54,-50}}, color={0,127,255})); + connect(preDroS2U2.port_a, cat.port_a2) + annotation (Line(points={{-30,0},{-54,0},{-54,-50}}, color={0,127,255})); + connect(CDW.port_a, cat.port_b1) annotation (Line(points={{-90,-50},{-90,-44}, + {-66,-44},{-66,-50}}, color={0,127,255})); + connect(CDW.port_b, cat.port_a1) annotation (Line(points={{-90,-70},{-90,-76}, + {-66,-76},{-66,-70}}, color={0,127,255})); annotation (experiment(Tolerance=1e-06, StopTime=3600,__Dymola_Algorithm="Dassl"), - Diagram(coordinateSystem(extent={{-100,-220},{140,180}})), Icon( + Diagram(coordinateSystem(extent={{-120,-220},{140,180}})), Icon( coordinateSystem(extent={{-100,-100},{100,100}}))); end TwoSourcesThreeUsers; diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo index 411ea4a1909..8bd4e61dda3 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo @@ -2,7 +2,8 @@ within Buildings.Fluid.Storage.Plant.Validation; model ChillerAndTankNoRemoteCharging "(Draft)" extends Modelica.Icons.Example; - package Medium = Buildings.Media.Water "Medium model"; + package Medium1 = Buildings.Media.Water "Medium model"; + package Medium2 = Buildings.Media.Water "Medium model"; parameter Modelica.Units.SI.AbsolutePressure p_CHWS_nominal=800000 "Nominal pressure of the CHW supply line"; @@ -14,10 +15,11 @@ model ChillerAndTankNoRemoteCharging "(Draft)" "Nominal temperature of CHW return"; Buildings.Fluid.Storage.Plant.ChillerAndTank cat( - redeclare final package Medium=Medium, + redeclare final package Medium1=Medium1, + redeclare final package Medium2=Medium2, final allowRemoteCharging=false, - final m1_flow_nominal=1, - final m2_flow_nominal=1, + final mChi_flow_nominal=1, + final mTan_flow_nominal=1, final p_CHWS_nominal=p_CHWS_nominal, final p_CHWR_nominal=p_CHWR_nominal, final T_CHWS_nominal=T_CHWS_nominal, @@ -25,7 +27,7 @@ model ChillerAndTankNoRemoteCharging "(Draft)" "Plant with chiller and tank" annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); Buildings.Fluid.Sources.Boundary_pT sou( - redeclare final package Medium = Medium, + redeclare final package Medium = Medium2, final p=p_CHWR_nominal, final T=T_CHWR_nominal, nPorts=1) @@ -33,16 +35,16 @@ model ChillerAndTankNoRemoteCharging "(Draft)" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-60,0}))); + origin={-70,-30}))); Buildings.Fluid.Sources.Boundary_pT sin( - redeclare final package Medium = Medium, + redeclare final package Medium = Medium2, final p=p_CHWS_nominal, final T=T_CHWS_nominal, nPorts=1) "Sink representing CHW supply line" annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=180, - origin={60,0}))); + origin={70,-30}))); Modelica.Blocks.Sources.TimeTable set_mPum2_flow(table=[0,1; 900,1; 900,-1; 1800,-1; 1800,0; 2700,0; 2700,1; 3600,1]) "Secondary mass flow rate setpoint" @@ -64,25 +66,33 @@ model ChillerAndTankNoRemoteCharging "(Draft)" extent={{-10,-10},{10,10}}, rotation=180, origin={-10,90}))); + Buildings.Fluid.Storage.Plant.CDWPlaceholder CDW( + redeclare final package Medium = Medium1) + "Placeholder for CHW loop" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={50,30}))); equation - connect(sou.ports[1], cat.port_a) - annotation (Line(points={{-50,0},{-10,0}}, color={0,127,255})); - connect(cat.port_b, sin.ports[1]) annotation (Line(points={{10,0},{30,0},{30, - 4.44089e-16},{50,4.44089e-16}}, - color={0,127,255})); connect(gain2.y, conPID_Pum2.u_m) annotation (Line(points={{-21,90},{-50,90},{-50,82}}, color={0,0,127})); - connect(cat.mTan_flow, gain2.u) annotation (Line(points={{9,-11},{14,-11},{14, - 90},{2,90}}, - color={0,0,127})); + connect(cat.mTan_flow, gain2.u) annotation (Line(points={{11,-2},{14,-2},{14,90}, + {2,90}}, color={0,0,127})); connect(set_mPum2_flow.y, conPID_Pum2.u_s) annotation (Line(points={{-79,70},{-62,70}}, color={0,0,127})); - connect(set_mPum1_flow.y, cat.set_mPum1_flow) annotation (Line(points={{-39, - 30},{-18,30},{-18,9},{-11,9}}, color={0,0,127})); + connect(set_mPum1_flow.y, cat.set_mPum1_flow) annotation (Line(points={{-39,30}, + {-16,30},{-16,9},{-11,9}}, color={0,0,127})); connect(conPID_Pum2.y, cat.yPum2) - annotation (Line(points={{-39,70},{-7,70},{-7,11}}, color={0,0,127})); + annotation (Line(points={{-39,70},{-8,70},{-8,11}}, color={0,0,127})); + connect(sou.ports[1], cat.port_b2) annotation (Line(points={{-60,-30},{-16,-30}, + {-16,-6},{-10,-6}}, color={0,127,255})); + connect(cat.port_a2, sin.ports[1]) annotation (Line(points={{10,-6},{54,-6},{54, + -30},{60,-30}}, color={0,127,255})); + connect(cat.port_a1, CDW.port_b) annotation (Line(points={{-10,6},{-14,6},{-14, + 30},{40,30}}, color={0,127,255})); + connect(CDW.port_a, cat.port_b1) annotation (Line(points={{60,30},{64,30},{64, + 6},{10,6}}, color={0,127,255})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo index 31f7de392f1..c3eaf2e409b 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo @@ -15,7 +15,8 @@ model ChillerAndTankWithRemoteCharging extends Modelica.Icons.Example; - package Medium = Buildings.Media.Water "Medium model"; + package Medium1 = Buildings.Media.Water "Medium model"; + package Medium2 = Buildings.Media.Water "Medium model"; parameter Modelica.Units.SI.AbsolutePressure p_CHWS_nominal=800000 "Nominal pressure of the CHW supply line"; @@ -27,17 +28,18 @@ model ChillerAndTankWithRemoteCharging "Nominal temperature of CHW return"; Buildings.Fluid.Storage.Plant.ChillerAndTank cat( - redeclare final package Medium = Medium, + redeclare final package Medium1 = Medium1, + redeclare final package Medium2 = Medium2, final allowRemoteCharging=true, - final m1_flow_nominal=1, - final m2_flow_nominal=1, + final mChi_flow_nominal=1, + final mTan_flow_nominal=1, final p_CHWS_nominal=p_CHWS_nominal, final p_CHWR_nominal=p_CHWR_nominal, final T_CHWS_nominal=T_CHWS_nominal, final T_CHWR_nominal=T_CHWR_nominal) "Plant with chiller and tank" annotation (Placement(transformation(extent={{-8,-10},{12,10}}))); Buildings.Fluid.Sources.Boundary_pT sou( - redeclare final package Medium = Medium, + redeclare final package Medium = Medium2, p=p_CHWR_nominal, T=T_CHWR_nominal, nPorts=1) @@ -45,9 +47,9 @@ model ChillerAndTankWithRemoteCharging annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-60,0}))); + origin={-70,-30}))); Buildings.Fluid.Sources.Boundary_pT sin( - redeclare final package Medium = Medium, + redeclare final package Medium = Medium2, p=p_CHWS_nominal, T=T_CHWS_nominal, nPorts=1) @@ -55,38 +57,47 @@ model ChillerAndTankWithRemoteCharging annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=180, - origin={60,0}))); + origin={70,-30}))); Modelica.Blocks.Sources.TimeTable set_mTan_flow(table=[0,0; 3600/7,0; 3600/7, -1; 3600/7*3,-1; 3600/7*3,0; 3600/7*4,0; 3600/7*4,1; 3600/7*6,1; 3600/7 *6,-1]) "Tank flow rate setpoint" - annotation (Placement(transformation(extent={{-80,60},{-60,80}}))); + annotation (Placement(transformation(extent={{-80,40},{-60,60}}))); Modelica.Blocks.Sources.BooleanTable booFloDir(table={0,3600/7*6}) "Flow direction: True = normal; False = reverse" - annotation (Placement(transformation(extent={{-80,20},{-60,40}}))); + annotation (Placement(transformation(extent={{-80,0},{-60,20}}))); Modelica.Blocks.Sources.BooleanTable booOnOff(table={3600/7*2}) "True = online; False = offline" - annotation (Placement(transformation(extent={{-80,-40},{-60,-20}}))); + annotation (Placement(transformation(extent={{-80,-80},{-60,-60}}))); Modelica.Blocks.Sources.TimeTable set_mChi_flow(table=[0,0; 3600/7,0; 3600/7, 1; 3600/7*5,1; 3600/7*5,0]) "Chiller flow rate setpoint" - annotation (Placement(transformation(extent={{-40,80},{-20,100}}))); + annotation (Placement(transformation(extent={{-80,80},{-60,100}}))); + Buildings.Fluid.Storage.Plant.CDWPlaceholder CDW( + redeclare final package Medium = Medium1) + "Placeholder for CHW loop" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={10,30}))); equation - connect(sou.ports[1], cat.port_a) - annotation (Line(points={{-50,0},{-26,0},{-26,0},{-8,0}}, - color={0,127,255})); - connect(cat.port_b, sin.ports[1]) annotation (Line(points={{12,0},{35,0},{35,4.44089e-16}, - {50,4.44089e-16}}, color={0,127,255})); - connect(booOnOff.y, cat.booOnOff) annotation (Line(points={{-59,-30},{-20,-30}, - {-20,-9},{-10,-9}}, color={255,0,255})); - connect(booFloDir.y,cat.booFloDir) annotation (Line(points={{-59,30},{-40,30}, - {-40,-4},{-10,-4},{-10,-5}}, + connect(booOnOff.y, cat.booOnOff) annotation (Line(points={{-59,-70},{-10,-70}, + {-10,-9}}, color={255,0,255})); + connect(booFloDir.y,cat.booFloDir) annotation (Line(points={{-59,10},{-34,10}, + {-34,-2},{-10,-2}}, color={255,0,255})); connect(set_mTan_flow.y, cat.set_mTan_flow) - annotation (Line(points={{-59,70},{-32,70},{-32,4},{-10,4},{-10,5},{-9,5}}, + annotation (Line(points={{-59,50},{-14,50},{-14,2},{-9,2}}, color={0,0,127})); connect(set_mChi_flow.y, cat.set_mPum1_flow) - annotation (Line(points={{-19,90},{-9,90},{-9,9}}, color={0,0,127})); + annotation (Line(points={{-59,90},{-9,90},{-9,9}}, color={0,0,127})); + connect(cat.port_b2, sou.ports[1]) annotation (Line(points={{-8,-6},{-54,-6},{ + -54,-30},{-60,-30}}, color={0,127,255})); + connect(cat.port_a2, sin.ports[1]) annotation (Line(points={{12,-6},{54,-6},{54, + -30},{60,-30}}, color={0,127,255})); + connect(CDW.port_b, cat.port_a1) annotation (Line(points={{-1.77636e-15,30},{-16, + 30},{-16,6},{-8,6}}, color={0,127,255})); + connect(CDW.port_a, cat.port_b1) annotation (Line(points={{20,30},{24,30},{24, + 6},{12,6}}, color={0,127,255})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), diff --git a/Buildings/Fluid/Storage/Plant/package.order b/Buildings/Fluid/Storage/Plant/package.order index 489815ad645..e2ee53986eb 100644 --- a/Buildings/Fluid/Storage/Plant/package.order +++ b/Buildings/Fluid/Storage/Plant/package.order @@ -1,3 +1,4 @@ +CDWPlaceholder ChillerAndTank DummyUser TemperatureSource From 27f04f8ce9e42b5ff44fb80a544253a6be1491f1 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Wed, 16 Feb 2022 12:14:29 -0800 Subject: [PATCH 029/463] simplified CDW placeholders --- .../Fluid/Storage/Plant/CDWPlaceholder.mo | 55 ------------------- .../Plant/Examples/OneSourceOneUser.mo | 30 ++++++---- .../Plant/Examples/TwoSourcesThreeUsers.mo | 29 ++++++---- .../ChillerAndTankNoRemoteCharging.mo | 33 +++++++---- .../ChillerAndTankWithRemoteCharging.mo | 37 ++++++++----- Buildings/Fluid/Storage/Plant/package.order | 1 - 6 files changed, 82 insertions(+), 103 deletions(-) delete mode 100644 Buildings/Fluid/Storage/Plant/CDWPlaceholder.mo diff --git a/Buildings/Fluid/Storage/Plant/CDWPlaceholder.mo b/Buildings/Fluid/Storage/Plant/CDWPlaceholder.mo deleted file mode 100644 index 6bc7d0df249..00000000000 --- a/Buildings/Fluid/Storage/Plant/CDWPlaceholder.mo +++ /dev/null @@ -1,55 +0,0 @@ -within Buildings.Fluid.Storage.Plant; -model CDWPlaceholder "Placeholder model for the CDW loop" - extends Interfaces.PartialTwoPortInterface( - final m_flow_nominal=1); - - Buildings.Fluid.Sources.Boundary_pT souCDW( - redeclare final package Medium = Medium, - final p=800000, - final T=32 + 273.15, - nPorts=1) "Source representing CDW supply line" annotation ( - Placement(transformation( - extent={{10,10},{-10,-10}}, - rotation=90, - origin={-50,70}))); - Modelica.Blocks.Sources.Constant set_mCDW_flow(k=m_flow_nominal) - annotation (Placement(transformation(extent={{-10,-10},{10,10}}, - rotation=0, - origin={-90,30}))); - Buildings.Fluid.Movers.BaseClasses.IdealSource ideSouCDW( - redeclare package Medium = Medium, - control_m_flow=true, - control_dp=false, - m_flow_small=1E-3) - "Flow source for the CDW loop" - annotation (Placement(transformation(extent={{10,-10},{-10,10}}, - rotation=0, - origin={-70,0}))); - Buildings.Fluid.Sources.Boundary_pT sinCDW( - redeclare final package Medium = Medium, - final p=300000, - final T=37 + 273.15, - nPorts=1) "Sink representing CDW return line" annotation ( - Placement(transformation( - extent={{10,10},{-10,-10}}, - rotation=90, - origin={50,70}))); -equation - connect(souCDW.ports[1],ideSouCDW. port_a) - annotation (Line(points={{-50,60},{-50,0},{-60,0}}, - color={0,127,255})); - connect(set_mCDW_flow.y,ideSouCDW. m_flow_in) annotation (Line(points={{-79,30}, - {-64,30},{-64,8}}, color={0,0,127})); - connect(ideSouCDW.port_b, port_a) - annotation (Line(points={{-80,0},{-100,0}}, color={0,127,255})); - connect(sinCDW.ports[1], port_b) - annotation (Line(points={{50,60},{50,0},{100,0}}, color={0,127,255})); - annotation (Icon(graphics={Rectangle(extent={{-100,98},{-60,-100}}, - lineColor={28, - 108,200}), Text( - extent={{-80,40},{80,-20}}, - textColor={28,108,200}, - textString="CDW"), Rectangle(extent={{60,100},{100,-100}}, - lineColor={28, - 108,200})})); -end CDWPlaceholder; diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo index b2ec658119c..fdfba29ca5b 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo @@ -115,13 +115,21 @@ model OneSourceOneUser "(Draft) District system with one source and one user" extent={{10,-10},{-10,10}}, rotation=0, origin={-50,-70}))); - Buildings.Fluid.Storage.Plant.CDWPlaceholder CDW( - redeclare final package Medium = Medium1) - "Placeholder for CHW loop" annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={-88,30}))); + Buildings.Fluid.Sources.MassFlowSource_T souCDW( + nPorts=1, + redeclare package Medium = Medium1, + m_flow=1, + T=305.15) "Source representing CDW supply line" + annotation (Placement(transformation(extent={{-10,10},{-30,30}}))); + Buildings.Fluid.Sources.Boundary_pT sinCDW( + redeclare final package Medium = Medium1, + final p=300000, + final T=310.15, + nPorts=1) "Sink representing CDW return line" annotation ( + Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=180, + origin={-90,20}))); equation connect(set_TRet.y,usr. TSet) annotation (Line(points={{21,30},{32,30},{32,-15},{39,-15}}, @@ -158,9 +166,9 @@ equation {-64,-20},{-80,-20}}, color={0,127,255})); connect(cat.port_a2, preDro1.port_a) annotation (Line(points={{-40,-6},{-18,-6}, {-18,-20},{-10,-20}}, color={0,127,255})); - connect(CDW.port_b, cat.port_a1) - annotation (Line(points={{-88,20},{-88,6},{-60,6}}, color={0,127,255})); - connect(CDW.port_a, cat.port_b1) annotation (Line(points={{-88,40},{-88,42},{ - -74,42},{-74,18},{-32,18},{-32,6},{-40,6}}, color={0,127,255})); + connect(souCDW.ports[1], cat.port_b1) annotation (Line(points={{-30,20},{-34, + 20},{-34,6},{-40,6}}, color={0,127,255})); + connect(sinCDW.ports[1], cat.port_a1) annotation (Line(points={{-80,20},{-66, + 20},{-66,6},{-60,6}}, color={0,127,255})); annotation(experiment(Tolerance=1e-06, StopTime=3600)); end OneSourceOneUser; diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index 561bcd2991b..d6f74029493 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -251,12 +251,21 @@ model TwoSourcesThreeUsers extent={{-10,-10},{10,10}}, rotation=90, origin={-50,-210}))); - Buildings.Fluid.Storage.Plant.CDWPlaceholder CDW( - redeclare final package Medium = Medium1) - "Placeholder for CHW loop" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={-90,-60}))); + Buildings.Fluid.Sources.MassFlowSource_T souCDW( + nPorts=1, + redeclare package Medium = Medium1, + m_flow=1, + T=305.15) "Source representing CDW supply line" + annotation (Placement(transformation(extent={{-100,-40},{-80,-20}}))); + Buildings.Fluid.Sources.Boundary_pT sinCDW( + redeclare final package Medium = Medium1, + final p=300000, + final T=310.15, + nPorts=1) "Sink representing CDW return line" annotation ( + Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=180, + origin={-90,-90}))); equation connect(set_TRet.y,usr1. TSet) annotation (Line(points={{41,110},{44,110},{44, 82},{65,82},{65,71}}, color={0,0,127})); @@ -353,10 +362,10 @@ equation -40},{-54,-50}}, color={0,127,255})); connect(preDroS2U2.port_a, cat.port_a2) annotation (Line(points={{-30,0},{-54,0},{-54,-50}}, color={0,127,255})); - connect(CDW.port_a, cat.port_b1) annotation (Line(points={{-90,-50},{-90,-44}, - {-66,-44},{-66,-50}}, color={0,127,255})); - connect(CDW.port_b, cat.port_a1) annotation (Line(points={{-90,-70},{-90,-76}, - {-66,-76},{-66,-70}}, color={0,127,255})); + connect(souCDW.ports[1], cat.port_b1) annotation (Line(points={{-80,-30},{-66, + -30},{-66,-50}}, color={0,127,255})); + connect(cat.port_a1, sinCDW.ports[1]) annotation (Line(points={{-66,-70},{-66, + -90},{-80,-90}}, color={0,127,255})); annotation (experiment(Tolerance=1e-06, StopTime=3600,__Dymola_Algorithm="Dassl"), Diagram(coordinateSystem(extent={{-120,-220},{140,180}})), Icon( coordinateSystem(extent={{-100,-100},{100,100}}))); diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo index 8bd4e61dda3..962a52bcc44 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo @@ -51,7 +51,7 @@ model ChillerAndTankNoRemoteCharging "(Draft)" annotation (Placement(transformation(extent={{-100,60},{-80,80}}))); Modelica.Blocks.Sources.Constant set_mPum1_flow(k=cat.m1_flow_nominal) "Primary pump mass flow rate setpoint" - annotation (Placement(transformation(extent={{-60,20},{-40,40}}))); + annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); Buildings.Controls.Continuous.LimPID conPID_Pum2( Td=1, k=1, @@ -66,12 +66,21 @@ model ChillerAndTankNoRemoteCharging "(Draft)" extent={{-10,-10},{10,10}}, rotation=180, origin={-10,90}))); - Buildings.Fluid.Storage.Plant.CDWPlaceholder CDW( - redeclare final package Medium = Medium1) - "Placeholder for CHW loop" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, + Buildings.Fluid.Sources.MassFlowSource_T souCDW( + nPorts=1, + redeclare package Medium = Medium1, + m_flow=1, + T=305.15) "Source representing CDW supply line" + annotation (Placement(transformation(extent={{80,20},{60,40}}))); + Buildings.Fluid.Sources.Boundary_pT sinCDW( + redeclare final package Medium = Medium1, + final p=300000, + final T=310.15, + nPorts=1) "Sink representing CDW return line" annotation ( + Placement(transformation( + extent={{10,10},{-10,-10}}, rotation=180, - origin={50,30}))); + origin={-70,30}))); equation connect(gain2.y, conPID_Pum2.u_m) @@ -81,18 +90,18 @@ equation {2,90}}, color={0,0,127})); connect(set_mPum2_flow.y, conPID_Pum2.u_s) annotation (Line(points={{-79,70},{-62,70}}, color={0,0,127})); - connect(set_mPum1_flow.y, cat.set_mPum1_flow) annotation (Line(points={{-39,30}, - {-16,30},{-16,9},{-11,9}}, color={0,0,127})); + connect(set_mPum1_flow.y, cat.set_mPum1_flow) annotation (Line(points={{-59,0}, + {-16,0},{-16,9},{-11,9}}, color={0,0,127})); connect(conPID_Pum2.y, cat.yPum2) annotation (Line(points={{-39,70},{-8,70},{-8,11}}, color={0,0,127})); connect(sou.ports[1], cat.port_b2) annotation (Line(points={{-60,-30},{-16,-30}, {-16,-6},{-10,-6}}, color={0,127,255})); connect(cat.port_a2, sin.ports[1]) annotation (Line(points={{10,-6},{54,-6},{54, -30},{60,-30}}, color={0,127,255})); - connect(cat.port_a1, CDW.port_b) annotation (Line(points={{-10,6},{-14,6},{-14, - 30},{40,30}}, color={0,127,255})); - connect(CDW.port_a, cat.port_b1) annotation (Line(points={{60,30},{64,30},{64, - 6},{10,6}}, color={0,127,255})); + connect(souCDW.ports[1], cat.port_b1) annotation (Line(points={{60,30},{16,30}, + {16,6},{10,6}}, color={0,127,255})); + connect(cat.port_a1, sinCDW.ports[1]) annotation (Line(points={{-10,6},{-54,6}, + {-54,30},{-60,30}}, color={0,127,255})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo index c3eaf2e409b..34de70a8b25 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo @@ -62,31 +62,40 @@ model ChillerAndTankWithRemoteCharging -1; 3600/7*3,-1; 3600/7*3,0; 3600/7*4,0; 3600/7*4,1; 3600/7*6,1; 3600/7 *6,-1]) "Tank flow rate setpoint" - annotation (Placement(transformation(extent={{-80,40},{-60,60}}))); + annotation (Placement(transformation(extent={{-80,50},{-60,70}}))); Modelica.Blocks.Sources.BooleanTable booFloDir(table={0,3600/7*6}) "Flow direction: True = normal; False = reverse" - annotation (Placement(transformation(extent={{-80,0},{-60,20}}))); + annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); Modelica.Blocks.Sources.BooleanTable booOnOff(table={3600/7*2}) "True = online; False = offline" annotation (Placement(transformation(extent={{-80,-80},{-60,-60}}))); Modelica.Blocks.Sources.TimeTable set_mChi_flow(table=[0,0; 3600/7,0; 3600/7, 1; 3600/7*5,1; 3600/7*5,0]) "Chiller flow rate setpoint" annotation (Placement(transformation(extent={{-80,80},{-60,100}}))); - Buildings.Fluid.Storage.Plant.CDWPlaceholder CDW( - redeclare final package Medium = Medium1) - "Placeholder for CHW loop" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, + Buildings.Fluid.Sources.Boundary_pT sinCDW( + redeclare final package Medium = Medium1, + final p=300000, + final T=310.15, + nPorts=1) "Sink representing CDW return line" annotation ( + Placement(transformation( + extent={{10,10},{-10,-10}}, rotation=180, - origin={10,30}))); + origin={-70,30}))); + Buildings.Fluid.Sources.MassFlowSource_T souCDW( + nPorts=1, + redeclare package Medium = Medium1, + m_flow=1, + T=305.15) "Source representing CDW supply line" + annotation (Placement(transformation(extent={{80,20},{60,40}}))); equation connect(booOnOff.y, cat.booOnOff) annotation (Line(points={{-59,-70},{-10,-70}, {-10,-9}}, color={255,0,255})); - connect(booFloDir.y,cat.booFloDir) annotation (Line(points={{-59,10},{-34,10}, - {-34,-2},{-10,-2}}, + connect(booFloDir.y,cat.booFloDir) annotation (Line(points={{-59,0},{-56,0}, + {-56,-2},{-10,-2}}, color={255,0,255})); connect(set_mTan_flow.y, cat.set_mTan_flow) - annotation (Line(points={{-59,50},{-14,50},{-14,2},{-9,2}}, + annotation (Line(points={{-59,60},{-14,60},{-14,2},{-9,2}}, color={0,0,127})); connect(set_mChi_flow.y, cat.set_mPum1_flow) annotation (Line(points={{-59,90},{-9,90},{-9,9}}, color={0,0,127})); @@ -94,10 +103,10 @@ equation -54,-30},{-60,-30}}, color={0,127,255})); connect(cat.port_a2, sin.ports[1]) annotation (Line(points={{12,-6},{54,-6},{54, -30},{60,-30}}, color={0,127,255})); - connect(CDW.port_b, cat.port_a1) annotation (Line(points={{-1.77636e-15,30},{-16, - 30},{-16,6},{-8,6}}, color={0,127,255})); - connect(CDW.port_a, cat.port_b1) annotation (Line(points={{20,30},{24,30},{24, - 6},{12,6}}, color={0,127,255})); + connect(souCDW.ports[1], cat.port_b1) annotation (Line(points={{60,30},{18,30}, + {18,6},{12,6}}, color={0,127,255})); + connect(cat.port_a1, sinCDW.ports[1]) annotation (Line(points={{-8,6},{-54,6}, + {-54,30},{-60,30}}, color={0,127,255})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), diff --git a/Buildings/Fluid/Storage/Plant/package.order b/Buildings/Fluid/Storage/Plant/package.order index e2ee53986eb..489815ad645 100644 --- a/Buildings/Fluid/Storage/Plant/package.order +++ b/Buildings/Fluid/Storage/Plant/package.order @@ -1,4 +1,3 @@ -CDWPlaceholder ChillerAndTank DummyUser TemperatureSource From 5890a6acf1e82f3c855eaea46937d7f7d8775b98 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Wed, 16 Feb 2022 13:13:45 -0800 Subject: [PATCH 030/463] moved the dummy consumer model --- .../{ => Examples/BaseClasses}/DummyUser.mo | 2 +- .../Examples/BaseClasses/PumChi1Control.mo | 79 ------------------- .../BaseClasses}/Validation/DummyUser.mo | 4 +- .../BaseClasses/Validation/package.mo | 4 + .../BaseClasses/Validation/package.order | 1 + .../Plant/Examples/BaseClasses/package.mo | 4 + .../Plant/Examples/BaseClasses/package.order | 3 +- .../Plant/Examples/OneSourceOneUser.mo | 2 +- .../Plant/Examples/TwoSourcesThreeUsers.mo | 6 +- .../Storage/Plant/Examples/package.order | 1 + .../Storage/Plant/Validation/package.order | 1 - Buildings/Fluid/Storage/Plant/package.order | 1 - 12 files changed, 19 insertions(+), 89 deletions(-) rename Buildings/Fluid/Storage/Plant/{ => Examples/BaseClasses}/DummyUser.mo (99%) delete mode 100644 Buildings/Fluid/Storage/Plant/Examples/BaseClasses/PumChi1Control.mo rename Buildings/Fluid/Storage/Plant/{ => Examples/BaseClasses}/Validation/DummyUser.mo (95%) create mode 100644 Buildings/Fluid/Storage/Plant/Examples/BaseClasses/Validation/package.mo create mode 100644 Buildings/Fluid/Storage/Plant/Examples/BaseClasses/Validation/package.order create mode 100644 Buildings/Fluid/Storage/Plant/Examples/BaseClasses/package.mo diff --git a/Buildings/Fluid/Storage/Plant/DummyUser.mo b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo similarity index 99% rename from Buildings/Fluid/Storage/Plant/DummyUser.mo rename to Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo index 28b141d0098..c924f6e4b76 100644 --- a/Buildings/Fluid/Storage/Plant/DummyUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo @@ -1,4 +1,4 @@ -within Buildings.Fluid.Storage.Plant; +within Buildings.Fluid.Storage.Plant.Examples.BaseClasses; model DummyUser "Dummy user model" /* For simplification, instead of setting up a heat exchanger to a room model, diff --git a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/PumChi1Control.mo b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/PumChi1Control.mo deleted file mode 100644 index d4df4bc9ac9..00000000000 --- a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/PumChi1Control.mo +++ /dev/null @@ -1,79 +0,0 @@ -within Buildings.Fluid.Storage.Plant.Examples.BaseClasses; -block PumChi1Control - "Control block" - extends Modelica.Blocks.Icons.Block; - - Buildings.Controls.Continuous.LimPID conPI( - controllerType=Modelica.Blocks.Types.SimpleController.PI, - Td=1, - k=1, - Ti=100, - reverseActing=true) "PI controller" annotation (Placement(transformation( - extent={{10,10},{-10,-10}}, - rotation=180, - origin={-30,40}))); - Buildings.Controls.OBC.CDL.Continuous.Hysteresis hysPum1(uLow=0.05, - uHigh=0.5) - "Primary pump shuts off at con.yVal = 0.05 and restarts at 0.5" annotation ( - Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=180, - origin={-70,-40}))); - Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToReaPum1(realTrue= - 1) "Primary pump signal" annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-30,-40}))); - Modelica.Blocks.Interfaces.RealInput us_dpCon - "Consumer pressure head setpoint" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-110,40}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-110,60}))); - Modelica.Blocks.Interfaces.RealInput um_dpCon - "Measured consumer pressure head" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-110,0}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-110,0}))); - Modelica.Blocks.Interfaces.RealInput yVal "Valve position" annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-110,-40}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-110,-60}))); - Buildings.Controls.OBC.CDL.Continuous.Min min "Turn-off signal overrides" annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={50,0}))); - Modelica.Blocks.Interfaces.RealOutput y "Normalised pump speed" annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={110,0}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={110,0}))); -equation - connect(conPI.u_s, us_dpCon) - annotation (Line(points={{-42,40},{-110,40}}, color={0,0,127})); - connect(hysPum1.u, yVal) - annotation (Line(points={{-82,-40},{-110,-40}}, color={0,0,127})); - connect(hysPum1.y, booToReaPum1.u) - annotation (Line(points={{-58,-40},{-42,-40}}, color={255,0,255})); - connect(conPI.y, min.u1) annotation (Line(points={{-19,40},{32,40},{32,6},{38, - 6}}, color={0,0,127})); - connect(booToReaPum1.y, min.u2) annotation (Line(points={{-18,-40},{32,-40},{32, - -6},{38,-6}}, color={0,0,127})); - connect(min.y, y) annotation (Line(points={{62,0},{110,0}}, color={0,0,127})); - connect(conPI.u_m, um_dpCon) - annotation (Line(points={{-30,28},{-30,0},{-110,0}}, color={0,0,127})); -end PumChi1Control; diff --git a/Buildings/Fluid/Storage/Plant/Validation/DummyUser.mo b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/Validation/DummyUser.mo similarity index 95% rename from Buildings/Fluid/Storage/Plant/Validation/DummyUser.mo rename to Buildings/Fluid/Storage/Plant/Examples/BaseClasses/Validation/DummyUser.mo index ec9838678e3..d7dcd8c1e78 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/DummyUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/Validation/DummyUser.mo @@ -1,4 +1,4 @@ -within Buildings.Fluid.Storage.Plant.Validation; +within Buildings.Fluid.Storage.Plant.Examples.BaseClasses.Validation; model DummyUser "Test model for the dummy user" extends Modelica.Icons.Example; @@ -24,7 +24,7 @@ model DummyUser "Test model for the dummy user" parameter Boolean allowFlowReversal=false "Flow reversal setting"; - Buildings.Fluid.Storage.Plant.DummyUser ideUsr( + Buildings.Fluid.Storage.Plant.Examples.BaseClasses.DummyUser ideUsr( redeclare package Medium = Medium, vol(T_start=15 + 273.15), m_flow_nominal=m_flow_nominal, diff --git a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/Validation/package.mo b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/Validation/package.mo new file mode 100644 index 00000000000..cde904dbceb --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/Validation/package.mo @@ -0,0 +1,4 @@ +within Buildings.Fluid.Storage.Plant.Examples.BaseClasses; +package Validation "Package of validation models" +extends Modelica.Icons.ExamplesPackage; +end Validation; diff --git a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/Validation/package.order b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/Validation/package.order new file mode 100644 index 00000000000..3212071c6a9 --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/Validation/package.order @@ -0,0 +1 @@ +DummyUser diff --git a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/package.mo b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/package.mo new file mode 100644 index 00000000000..b09ec6663c4 --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/package.mo @@ -0,0 +1,4 @@ +within Buildings.Fluid.Storage.Plant.Examples; +package BaseClasses "Package with base classes for the example models" +extends Modelica.Icons.BasesPackage; +end BaseClasses; diff --git a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/package.order b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/package.order index 41ba515620b..594c9635853 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/package.order +++ b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/package.order @@ -1 +1,2 @@ -PumChi1Control +DummyUser +Validation diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo index fdfba29ca5b..8057cadd22c 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo @@ -48,7 +48,7 @@ model OneSourceOneUser "(Draft) District system with one source and one user" final T_CHWR_nominal=T_CHWR_nominal) "Chiller and tank" annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); - Buildings.Fluid.Storage.Plant.DummyUser usr( + Buildings.Fluid.Storage.Plant.Examples.BaseClasses.DummyUser usr( redeclare package Medium = Medium2, m_flow_nominal=m_flow_nominal, p_a_nominal=p_CHWS_nominal - dp_nominal*0.35, diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index d6f74029493..33980f95256 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -49,7 +49,7 @@ model TwoSourcesThreeUsers extent={{-10,-10},{10,10}}, rotation=90, origin={-60,-60}))); - Buildings.Fluid.Storage.Plant.DummyUser usr1( + Buildings.Fluid.Storage.Plant.Examples.BaseClasses.DummyUser usr1( redeclare package Medium = Medium2, m_flow_nominal=m_flow_nominal, p_a_nominal=p_CHWS_nominal - dp_nominal*0.35, @@ -60,7 +60,7 @@ model TwoSourcesThreeUsers extent={{-10,-10},{10,10}}, rotation=-90, origin={60,60}))); - Buildings.Fluid.Storage.Plant.DummyUser usr2( + Buildings.Fluid.Storage.Plant.Examples.BaseClasses.DummyUser usr2( redeclare package Medium = Medium2, m_flow_nominal=m_flow_nominal, p_a_nominal=p_CHWS_nominal - dp_nominal*0.35, @@ -71,7 +71,7 @@ model TwoSourcesThreeUsers extent={{-10,-10},{10,10}}, rotation=-90, origin={60,0}))); - Buildings.Fluid.Storage.Plant.DummyUser usr3( + Buildings.Fluid.Storage.Plant.Examples.BaseClasses.DummyUser usr3( redeclare package Medium = Medium2, m_flow_nominal=m_flow_nominal, p_a_nominal=p_CHWS_nominal - dp_nominal*0.35, diff --git a/Buildings/Fluid/Storage/Plant/Examples/package.order b/Buildings/Fluid/Storage/Plant/Examples/package.order index c182e825891..da0cd7227d2 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/package.order +++ b/Buildings/Fluid/Storage/Plant/Examples/package.order @@ -1,2 +1,3 @@ OneSourceOneUser TwoSourcesThreeUsers +BaseClasses diff --git a/Buildings/Fluid/Storage/Plant/Validation/package.order b/Buildings/Fluid/Storage/Plant/Validation/package.order index ad74b08aa47..0541e3545f4 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/package.order +++ b/Buildings/Fluid/Storage/Plant/Validation/package.order @@ -1,3 +1,2 @@ ChillerAndTankNoRemoteCharging ChillerAndTankWithRemoteCharging -DummyUser diff --git a/Buildings/Fluid/Storage/Plant/package.order b/Buildings/Fluid/Storage/Plant/package.order index 489815ad645..64b608cc56b 100644 --- a/Buildings/Fluid/Storage/Plant/package.order +++ b/Buildings/Fluid/Storage/Plant/package.order @@ -1,5 +1,4 @@ ChillerAndTank -DummyUser TemperatureSource Examples Validation From dc0aab46a24331cfe7790f27ffae8c2be8f272cc Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Wed, 16 Feb 2022 14:51:59 -0800 Subject: [PATCH 031/463] corrected port connections --- .../BaseClasses/ReversiblePumpValveControl.mo | 14 +- .../Fluid/Storage/Plant/ChillerAndTank.mo | 160 +++++++++--------- .../Plant/Examples/OneSourceOneUser.mo | 42 ++--- .../Plant/Examples/TwoSourcesThreeUsers.mo | 104 ++++++------ .../Fluid/Storage/Plant/TemperatureSource.mo | 2 +- .../ChillerAndTankNoRemoteCharging.mo | 34 ++-- .../ChillerAndTankWithRemoteCharging.mo | 32 ++-- 7 files changed, 197 insertions(+), 191 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo index ff9b80c98f2..aa39d738e9c 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo @@ -46,7 +46,7 @@ block ReversiblePumpValveControl Controls.OBC.CDL.Interfaces.BooleanInput booFloDir "Flow direction, true = normal, false = reverse" annotation (Placement( transformation(extent={{-120,0},{-100,20}}), iconTransformation( - extent={{-140,-50},{-100,-10}}))); + extent={{-140,-60},{-100,-20}}))); Modelica.Blocks.Interfaces.RealInput us_mTan_flow "Tank mass flow rate setpoint" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -54,7 +54,7 @@ block ReversiblePumpValveControl origin={-70,110}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-110,30}))); + origin={-110,40}))); Modelica.Blocks.Interfaces.RealInput um_mTan_flow "Measured tank mass flow rate" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -62,7 +62,7 @@ block ReversiblePumpValveControl origin={10,110}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-110,70}))); + origin={-110,80}))); Controls.OBC.CDL.Continuous.Min minPum2 "Offline signal overrides all" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -81,7 +81,7 @@ block ReversiblePumpValveControl Controls.OBC.CDL.Interfaces.BooleanInput booOnOff "True = plant online, False = plant offline" annotation (Placement( transformation(extent={{-120,-90},{-100,-70}}), iconTransformation( - extent={{-140,-90},{-100,-50}}))); + extent={{-140,-100},{-100,-60}}))); Modelica.Blocks.Interfaces.RealOutput yPum2 "Normalised speed" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, @@ -89,7 +89,7 @@ block ReversiblePumpValveControl origin={-10,-110}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={-10,-110}))); + origin={0,-110}))); Modelica.Blocks.Interfaces.RealOutput yVal2 "Valve position" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, @@ -97,7 +97,7 @@ block ReversiblePumpValveControl origin={90,-110}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={70,-110}))); + origin={80,-110}))); Modelica.Blocks.Interfaces.RealOutput yVal1 "Valve position" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, @@ -105,7 +105,7 @@ block ReversiblePumpValveControl origin={40,-110}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={30,-110}))); + origin={40,-110}))); equation connect(conOne.y,swiOnOff. u1) annotation (Line(points={{-79,-10},{-66,-10},{-66, diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo index 14901c7f548..da7a803803a 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo @@ -28,17 +28,17 @@ model ChillerAndTank redeclare package Medium = Medium2, final dp_nominal=dp_nominal/10, final m_flow_nominal=mChi_flow_nominal) "Flow resistance on chiller branch" - annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + annotation (Placement(transformation(extent={{10,-10},{-10,10}}, rotation=0, - origin={70,-10}))); + origin={-70,-10}))); Buildings.Fluid.FixedResistances.PressureDrop preDro2( redeclare package Medium = Medium2, final allowFlowReversal=true, final dp_nominal=dp_nominal/10, final m_flow_nominal=mTan_flow_nominal) "Flow resistance on tank branch" - annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + annotation (Placement(transformation(extent={{10,-10},{-10,10}}, rotation=0, - origin={72,-70}))); + origin={-70,-70}))); Modelica.Blocks.Interfaces.RealInput set_mPum1_flow "Primary pump mass flow rate setpoint" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -54,7 +54,7 @@ model ChillerAndTank p_nominal=p_CHWS_nominal, T_a_nominal=T_CHWR_nominal, T_b_nominal=T_CHWS_nominal) "Ideal chiller" - annotation (Placement(transformation(extent={{20,-20},{40,0}}))); + annotation (Placement(transformation(extent={{-20,-20},{-40,0}}))); Buildings.Fluid.Storage.Plant.TemperatureSource ideTan( redeclare package Medium = Medium2, final allowFlowReversal=true, @@ -62,7 +62,7 @@ model ChillerAndTank p_nominal=p_CHWS_nominal, T_a_nominal=T_CHWR_nominal, T_b_nominal=T_CHWS_nominal) "Ideal tank" - annotation (Placement(transformation(extent={{18,-80},{38,-60}}))); + annotation (Placement(transformation(extent={{-20,-80},{-40,-60}}))); Buildings.Fluid.Movers.FlowControlled_m_flow pum1( redeclare package Medium = Medium2, per(pressure(dp=dp_nominal*{2,1.2,0}, V_flow=mChi_flow_nominal/1.2*{0,1.2,2})), @@ -72,14 +72,14 @@ model ChillerAndTank m_flow_nominal=mChi_flow_nominal, m_flow_start=0, T_start=T_CHWR_nominal) "Primary CHW pump" - annotation (Placement(transformation(extent={{-20,-20},{0,0}}))); + annotation (Placement(transformation(extent={{20,-20},{0,0}}))); Modelica.Blocks.Interfaces.RealOutput mTan_flow "Mass flow rate through the tank" annotation (Dialog(group= "Time varying output signal"), Placement(transformation( extent={{10,-10},{-10,10}}, rotation=90, - origin={10,-110}), iconTransformation( + origin={-10,-110}), iconTransformation( extent={{10,-10},{-10,10}}, rotation=180, origin={110,-20}))); @@ -92,29 +92,29 @@ model ChillerAndTank addPowerToMedium=false, y_start=0, T_start=T_CHWR_nominal) "Secondary pump" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, + extent={{10,-10},{-10,10}}, rotation=0, - origin={-78,-20}))); + origin={80,-20}))); Buildings.Fluid.Storage.Plant.BaseClasses.ReversiblePumpValveControl pum2Con if allowRemoteCharging "Control block for secondary pump-valve group" - annotation (Placement(transformation(extent={{-58,80},{-38,102}}))); + annotation (Placement(transformation(extent={{80,80},{60,102}}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanInput booOnOff if allowRemoteCharging "Plant status: true = online; false = offline" annotation (Placement( - transformation(extent={{-120,70},{-100,90}}), iconTransformation(extent= + transformation(extent={{120,70},{100,90}}), iconTransformation(extent= {{-140,-110},{-100,-70}}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanInput booFloDir if allowRemoteCharging "Flow direction: true = normal; false = reverse" annotation (Placement( - transformation(extent={{-120,90},{-100,110}}), iconTransformation( + transformation(extent={{120,90},{100,110}}), iconTransformation( extent={{-140,-40},{-100,0}}))); Modelica.Blocks.Interfaces.RealInput set_mTan_flow if allowRemoteCharging "Tank mass flow rate setpoint" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={-80,130}), iconTransformation( + origin={80,130}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-110,20}))); @@ -126,7 +126,7 @@ model ChillerAndTank dpValve_nominal=1, m_flow_nominal=mChi_flow_nominal+mTan_flow_nominal) if allowRemoteCharging "Valve in series to the pump (normal direction)" - annotation (Placement(transformation(extent={{-60,-20},{-40,0}}))); + annotation (Placement(transformation(extent={{60,-20},{40,0}}))); Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage val2( redeclare package Medium = Medium2, use_inputFilter=false, @@ -134,26 +134,26 @@ model ChillerAndTank dpValve_nominal=1, m_flow_nominal=mTan_flow_nominal) if allowRemoteCharging "Valve in parallel to the secondary pump (reverse direction)" - annotation (Placement(transformation(extent={{-40,-80},{-60,-60}}))); + annotation (Placement(transformation(extent={{40,-80},{60,-60}}))); Buildings.Controls.OBC.CDL.Continuous.Switch swiFloDirPum1 if allowRemoteCharging "Switches off pum1 when tank charged remotely" annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=-90, - origin={30,90}))); + origin={-10,90}))); Modelica.Blocks.Sources.Constant conZero(k=0) if allowRemoteCharging "Constant y = 0" annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=90, - origin={-10,90}))); + origin={-50,90}))); BaseClasses.FluidThrough pasVal1(redeclare package Medium = Medium2) if not allowRemoteCharging "Replaces val1 when remote charging not allowed" - annotation (Placement(transformation(extent={{-60,-42},{-40,-22}}))); + annotation (Placement(transformation(extent={{60,-42},{40,-22}}))); BaseClasses.SignalThrough pasSwiFloDirPum1 if not allowRemoteCharging "Replaces swiFloDirPum1 when remote charging not allowed" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={70,90}))); + origin={28,90}))); Modelica.Blocks.Interfaces.RealInput yPum2 if not allowRemoteCharging "Secondary pump speed input" annotation (Placement(transformation(extent={{-120,10},{-100,30}}), @@ -161,81 +161,87 @@ model ChillerAndTank rotation=-90, origin={-80,110}))); equation - connect(ideChi.port_b, preDro1.port_a) annotation (Line(points={{40,-10},{60,-10}}, - color={0,127,255})); connect(ideTan.port_b, preDro2.port_a) - annotation (Line(points={{38,-70},{62,-70}}, color={0,127,255})); - connect(pum1.port_b, ideChi.port_a) - annotation (Line(points={{0,-10},{20,-10}}, color={0,127,255})); - connect(ideTan.m_flow,mTan_flow) annotation (Line(points={{21,-59},{10,-59},{ - 10,-110}}, color={0,0,127})); - connect(booFloDir, pum2Con.booFloDir) annotation (Line(points={{-110,100},{-90, - 100},{-90,87.7},{-60,87.7}}, color={255,0,255})); - connect(pum2Con.yVal2, val2.y) annotation (Line(points={{-41,78.9},{-41,8},{-32, - 8},{-32,-52},{-50,-52},{-50,-58}}, + annotation (Line(points={{-40,-70},{-60,-70}}, + color={0,127,255})); + connect(ideTan.m_flow,mTan_flow) annotation (Line(points={{-24,-59},{-24,-50}, + {-10,-50},{-10,-110}}, color={0,0,127})); + connect(pum2Con.yVal2, val2.y) annotation (Line(points={{62,78.9},{62,78.9},{ + 62,34},{36,34},{36,-50},{50,-50},{50,-58}}, color={0,0,127})); - connect(pum2Con.yVal1, val1.y) annotation (Line(points={{-45,78.9},{-46,78.9}, - {-46,8},{-50,8},{-50,2}}, + connect(pum2Con.yVal1, val1.y) annotation (Line(points={{66,78.9},{66,78.9},{ + 66,26},{50,26},{50,2}}, color={0,0,127})); - connect(pum2Con.um_mTan_flow, ideTan.m_flow) annotation (Line(points={{-59,98.7}, - {-62,98.7},{-62,106},{-26,106},{-26,22},{10,22},{10,-59},{21,-59}}, + connect(pum2Con.um_mTan_flow, ideTan.m_flow) annotation (Line(points={{81,99.8}, + {86,99.8},{86,108},{54,108},{54,40},{-10,40},{-10,-50},{-24,-50},{-24, + -59}}, color={0,0,127})); - connect(pum2Con.us_mTan_flow, set_mTan_flow) annotation (Line(points={{-59,94.3}, - {-80,94.3},{-80,130}}, color={0,0,127})); + connect(pum2Con.us_mTan_flow, set_mTan_flow) annotation (Line(points={{81,95.4}, + {90,95.4},{90,118},{80,118},{80,130}}, + color={0,0,127})); connect(pum2.port_b, val1.port_a) - annotation (Line(points={{-68,-20},{-64,-20},{-64,-10},{-60,-10}}, + annotation (Line(points={{70,-20},{66,-20},{66,-10},{60,-10}}, color={0,127,255})); - connect(pum2.y, pum2Con.yPum2) annotation (Line(points={{-78,-8},{-78,20},{-49, - 20},{-49,78.9}}, color={0,0,127})); - connect(swiFloDirPum1.u2, booFloDir) annotation (Line(points={{30,102},{30,110}, - {-90,110},{-90,100},{-110,100}},color={255,0,255})); - connect(swiFloDirPum1.u1, set_mPum1_flow) annotation (Line(points={{38,102},{38, - 110},{40,110},{40,130}}, color={0,0,127})); + connect(pum2.y, pum2Con.yPum2) annotation (Line(points={{80,-8},{80,20},{70, + 20},{70,78.9}}, color={0,0,127})); + connect(swiFloDirPum1.u2, booFloDir) annotation (Line(points={{-10,102},{-10, + 110},{96,110},{96,100},{110,100}}, + color={255,0,255})); + connect(swiFloDirPum1.u1, set_mPum1_flow) annotation (Line(points={{-2,102},{ + -2,114},{40,114},{40,130}}, + color={0,0,127})); connect(pum1.m_flow_in,swiFloDirPum1. y) - annotation (Line(points={{-10,2},{-10,70},{30,70},{30,78}}, + annotation (Line(points={{10,2},{10,72},{-10,72},{-10,78}}, color={0,0,127})); - connect(conZero.y,swiFloDirPum1. u3) annotation (Line(points={{-10,101},{-10,106}, - {22,106},{22,102}}, color={0,0,127})); - connect(pum2Con.booOnOff, booOnOff) annotation (Line(points={{-60,83.3},{-60,84}, - {-80,84},{-80,80},{-110,80}},color={255,0,255})); - connect(pum2.port_b, pasVal1.port_a) annotation (Line(points={{-68,-20},{-64,-20}, - {-64,-32},{-60,-32}}, color={0,127,255})); - connect(pasSwiFloDirPum1.u, set_mPum1_flow) annotation (Line(points={{70,101}, - {70,110},{40,110},{40,130}}, color={0,0,127})); - connect(pasSwiFloDirPum1.y, pum1.m_flow_in) annotation (Line(points={{70,79},{ - 70,70},{-10,70},{-10,2}}, color={0,0,127})); + connect(conZero.y,swiFloDirPum1. u3) annotation (Line(points={{-50,101},{-50, + 110},{-18,110},{-18,102}}, + color={0,0,127})); + connect(pum2.port_b, pasVal1.port_a) annotation (Line(points={{70,-20},{66, + -20},{66,-32},{60,-32}}, color={0,127,255})); + connect(pasSwiFloDirPum1.u, set_mPum1_flow) annotation (Line(points={{28,101}, + {28,114},{40,114},{40,130}}, color={0,0,127})); + connect(pasSwiFloDirPum1.y, pum1.m_flow_in) annotation (Line(points={{28,79}, + {28,72},{10,72},{10,2}}, color={0,0,127})); connect(pum2.y, yPum2) - annotation (Line(points={{-78,-8},{-78,20},{-110,20}}, color={0,0,127})); - connect(preDro1.port_b, port_a2) annotation (Line(points={{80,-10},{86,-10},{86, - -60},{100,-60}}, color={0,127,255})); - connect(preDro2.port_b, port_a2) annotation (Line(points={{82,-70},{86,-70},{86, - -60},{100,-60}}, color={0,127,255})); - connect(pasVal1.port_b, pum1.port_a) annotation (Line(points={{-40,-32},{-26,-32}, - {-26,-10},{-20,-10}}, color={0,127,255})); - connect(val1.port_b, pum1.port_a) - annotation (Line(points={{-40,-10},{-20,-10}}, color={0,127,255})); - connect(val2.port_a, pum1.port_a) annotation (Line(points={{-40,-70},{-26,-70}, - {-26,-10},{-20,-10}}, color={0,127,255})); - connect(ideTan.port_a, pum1.port_a) annotation (Line(points={{18,-70},{-26,-70}, - {-26,-10},{-20,-10}}, color={0,127,255})); - connect(pum2.port_a, port_b2) annotation (Line(points={{-88,-20},{-88,-60},{-100, - -60}}, color={0,127,255})); - connect(val2.port_b, port_b2) annotation (Line(points={{-60,-70},{-88,-70},{-88, - -60},{-100,-60}}, color={0,127,255})); + annotation (Line(points={{80,-8},{80,20},{-110,20}}, color={0,0,127})); connect(port_b1, port_a1) annotation (Line(points={{100,60},{-100,60}}, color={0,127,255})); + connect(port_b2, preDro1.port_b) annotation (Line(points={{-100,-60},{-86,-60}, + {-86,-10},{-80,-10}}, color={0,127,255})); + connect(preDro2.port_b, port_b2) annotation (Line(points={{-80,-70},{-86,-70}, + {-86,-60},{-100,-60}}, color={0,127,255})); + connect(pum2.port_a, port_a2) + annotation (Line(points={{90,-20},{90,-60},{100,-60}}, color={0,127,255})); + connect(val2.port_b, port_a2) annotation (Line(points={{60,-70},{90,-70},{90, + -60},{100,-60}}, color={0,127,255})); + connect(preDro1.port_a, ideChi.port_b) + annotation (Line(points={{-60,-10},{-40,-10}}, color={0,127,255})); + connect(ideChi.port_a, pum1.port_b) + annotation (Line(points={{-20,-10},{0,-10}}, color={0,127,255})); + connect(pum1.port_a, val1.port_b) + annotation (Line(points={{20,-10},{40,-10}}, color={0,127,255})); + connect(pasVal1.port_b, pum1.port_a) annotation (Line(points={{40,-32},{30, + -32},{30,-10},{20,-10}}, color={0,127,255})); + connect(pum1.port_a, ideTan.port_a) annotation (Line(points={{20,-10},{30,-10}, + {30,-70},{-20,-70}}, color={0,127,255})); + connect(val2.port_a, pum1.port_a) annotation (Line(points={{40,-70},{30,-70}, + {30,-10},{20,-10}}, color={0,127,255})); + connect(pum2Con.booOnOff, booOnOff) annotation (Line(points={{82,82.2},{82,82}, + {96,82},{96,80},{110,80}}, color={255,0,255})); + connect(pum2Con.booFloDir, booFloDir) annotation (Line(points={{82,86.6},{82, + 86},{96,86},{96,100},{110,100}}, color={255,0,255})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,100}}), graphics={Line( points={{-30,-110},{30,-110}}, color={28,108,200}, pattern=LinePattern.Dash, visible=allowRemoteCharging), Polygon( - points={{-30,-110},{-10,-104},{-10,-116},{-30,-110}}, + points={{30,-110},{10,-104},{10,-116},{30,-110}}, fillColor={28,108,200}, fillPattern=FillPattern.Solid, pattern=LinePattern.None, visible=allowRemoteCharging), - Line(points={{-60,0},{-60,-20},{0,-20},{0,-60},{60,-60},{60,0}}, + Line(points={{-60,0},{-60,-60},{0,-60},{0,-20},{60,-20},{60,0}}, color={0, 0,0}), Line(points={{-100,0},{-60,0},{-60,60},{60,60},{60,0},{100,0}}, @@ -252,11 +258,11 @@ equation fillPattern=FillPattern.Solid), Line(points={{-30,-90},{30,-90}},color={28,108,200}), Polygon( - points={{30,-90},{10,-84},{10,-96},{30,-90}}, + points={{-30,-90},{-10,-84},{-10,-96},{-30,-90}}, fillColor={28,108,200}, fillPattern=FillPattern.Solid, pattern=LinePattern.None), - Line(points={{-16,74},{20,66}},color={0,0,0}), - Line(points={{20,54},{-14,44}},color={0,0,0})}), Diagram( + Line(points={{16,74},{-20,66}},color={0,0,0}), + Line(points={{-20,54},{14,44}},color={0,0,0})}), Diagram( coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,120}}))); end ChillerAndTank; diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo index 8057cadd22c..d46fadaa1cf 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo @@ -47,7 +47,7 @@ model OneSourceOneUser "(Draft) District system with one source and one user" final T_CHWS_nominal=T_CHWS_nominal, final T_CHWR_nominal=T_CHWR_nominal) "Chiller and tank" - annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); + annotation (Placement(transformation(extent={{-40,-10},{-60,10}}))); Buildings.Fluid.Storage.Plant.Examples.BaseClasses.DummyUser usr( redeclare package Medium = Medium2, m_flow_nominal=m_flow_nominal, @@ -108,18 +108,18 @@ model OneSourceOneUser "(Draft) District system with one source and one user" Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, - origin={-10,-70}))); + origin={50,-70}))); Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToReaPum1(realTrue= m_flow_nominal/2) "Primary pump signal" annotation (Placement( transformation( extent={{10,-10},{-10,10}}, rotation=0, - origin={-50,-70}))); + origin={-10,-70}))); Buildings.Fluid.Sources.MassFlowSource_T souCDW( - nPorts=1, redeclare package Medium = Medium1, m_flow=1, - T=305.15) "Source representing CDW supply line" + T=305.15, + nPorts=1) "Source representing CDW supply line" annotation (Placement(transformation(extent={{-10,10},{-30,30}}))); Buildings.Fluid.Sources.Boundary_pT sinCDW( redeclare final package Medium = Medium1, @@ -148,27 +148,27 @@ equation connect(usr.dp, gaiPum2.u) annotation (Line(points={{47,-9},{46,-9},{46,88},{-20, 88},{-20,82}}, color={0,0,127})); connect(conPI_pum2.y, cat.yPum2) - annotation (Line(points={{-50,29},{-50,20},{-58,20},{-58,11}}, + annotation (Line(points={{-50,29},{-50,20},{-42,20},{-42,11}}, color={0,0,127})); connect(hysPum1.y, booToReaPum1.u) - annotation (Line(points={{-22,-70},{-38,-70}}, - color={255,0,255})); + annotation (Line(points={{38,-70},{2,-70}}, color={255,0,255})); connect(booToReaPum1.y, cat.set_mPum1_flow) - annotation (Line(points={{-62,-70},{-68,-70},{-68,9},{-61,9}}, + annotation (Line(points={{-22,-70},{-30,-70},{-30,9},{-39,9}}, color={0,0,127})); - connect(hysPum1.u,usr. yVal_actual) annotation (Line(points={{2,-70},{22,-70}, - {22,-9},{43,-9}}, color={0,0,127})); + connect(hysPum1.u,usr. yVal_actual) annotation (Line(points={{62,-70},{68,-70}, + {68,-4},{43,-4},{43,-9}}, + color={0,0,127})); connect(gaiPum2.y, conPI_pum2.u_m) annotation (Line(points={{-20,59},{-20,40},{-38,40}}, color={0,0,127})); - connect(cat.port_b2, preDro2.port_b) annotation (Line(points={{-60,-6},{-64,-6}, - {-64,-40},{-10,-40}}, color={0,127,255})); - connect(cat.port_b2, sou_p.ports[1]) annotation (Line(points={{-60,-6},{-64,-6}, - {-64,-20},{-80,-20}}, color={0,127,255})); - connect(cat.port_a2, preDro1.port_a) annotation (Line(points={{-40,-6},{-18,-6}, - {-18,-20},{-10,-20}}, color={0,127,255})); - connect(souCDW.ports[1], cat.port_b1) annotation (Line(points={{-30,20},{-34, - 20},{-34,6},{-40,6}}, color={0,127,255})); - connect(sinCDW.ports[1], cat.port_a1) annotation (Line(points={{-80,20},{-66, - 20},{-66,6},{-60,6}}, color={0,127,255})); + connect(cat.port_b2, preDro1.port_a) annotation (Line(points={{-40,-6},{-16, + -6},{-16,-20},{-10,-20}}, color={0,127,255})); + connect(preDro2.port_b, cat.port_a2) annotation (Line(points={{-10,-40},{-66, + -40},{-66,-6},{-60,-6}}, color={0,127,255})); + connect(sou_p.ports[1], cat.port_a2) annotation (Line(points={{-80,-20},{-66, + -20},{-66,-6},{-60,-6}}, color={0,127,255})); + connect(cat.port_b1, sinCDW.ports[1]) annotation (Line(points={{-60,6},{-74,6}, + {-74,20},{-80,20}}, color={0,127,255})); + connect(cat.port_a1, souCDW.ports[1]) annotation (Line(points={{-40,6},{-34,6}, + {-34,20},{-30,20}}, color={0,127,255})); annotation(experiment(Tolerance=1e-06, StopTime=3600)); end OneSourceOneUser; diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index 33980f95256..26207caf674 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -46,7 +46,7 @@ model TwoSourcesThreeUsers final T_CHWR_nominal=T_CHWR_nominal) "Chiller and tank, tank can be charged remotely" annotation (Placement( transformation( - extent={{-10,-10},{10,10}}, + extent={{10,-10},{-10,10}}, rotation=90, origin={-60,-60}))); Buildings.Fluid.Storage.Plant.Examples.BaseClasses.DummyUser usr1( @@ -95,7 +95,7 @@ model TwoSourcesThreeUsers "Min of pressure head measured from all users" annotation (Placement(transformation(extent={{10,-10},{-10,10}}, rotation=90, - origin={-90,150}))); + origin={-10,130}))); Modelica.Blocks.Sources.Constant set_dpUsr(k=1) "Normalised consumer differential pressure setpoint" annotation (Placement(transformation(extent={{-10,-10},{10,10}}, @@ -115,7 +115,7 @@ model TwoSourcesThreeUsers annotation (Placement(transformation(extent={{60,-120},{40,-100}}))); Modelica.Blocks.Sources.Constant set_mChi2Pum1_flow(k=0.75*m_flow_nominal) "Placeholder, primary flow rate setpoint" - annotation (Placement(transformation(extent={{-100,-140},{-80,-120}}))); + annotation (Placement(transformation(extent={{-140,-80},{-120,-60}}))); Buildings.Fluid.Sources.Boundary_pT sou_p( redeclare final package Medium = Medium2, final p=p_CHWR_nominal, @@ -140,9 +140,9 @@ model TwoSourcesThreeUsers k=1, Ti=100, reverseActing=true) "PI controller" annotation (Placement(transformation( - extent={{10,10},{-10,-10}}, + extent={{10,-10},{-10,10}}, rotation=90, - origin={-60,120}))); + origin={-60,110}))); Buildings.Fluid.FixedResistances.PressureDrop preDroS2U3( redeclare package Medium = Medium2, final allowFlowReversal=true, @@ -224,39 +224,39 @@ model TwoSourcesThreeUsers startValue=true) "Flow direction: True = normal; False = reverse" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, - rotation=90, - origin={10,-210}))); + rotation=0, + origin={-80,10}))); Buildings.Controls.OBC.CDL.Continuous.Switch swiTanCha "Tank setpoint: True = positive (discharging); False = negative (charging)" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, - rotation=90, - origin={-50,-130}))); + rotation=0, + origin={-110,-10}))); Modelica.Blocks.Sources.Constant set_mTan_flow_discharge(k=0.75* m_flow_nominal) "Placeholder, tank flow rate setpoint when discharging" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, - rotation=90, - origin={-70,-170}))); + rotation=0, + origin={-140,10}))); Modelica.Blocks.Sources.Constant set_mTan_flow_charge(k=-0.75*m_flow_nominal) "Placeholder, tank flow rate setpoint when charging" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, - rotation=90, - origin={-30,-170}))); + rotation=0, + origin={-140,-30}))); Modelica.Blocks.Sources.BooleanTable booTanCha(table={3600/9*1,3600/9*6,3600/9 *8}, startValue=false) "Tank charging status (local or remote): True = discharging; False = charging" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, - rotation=90, - origin={-50,-210}))); + rotation=0, + origin={-170,-10}))); Buildings.Fluid.Sources.MassFlowSource_T souCDW( - nPorts=1, redeclare package Medium = Medium1, m_flow=1, - T=305.15) "Source representing CDW supply line" - annotation (Placement(transformation(extent={{-100,-40},{-80,-20}}))); + T=305.15, + nPorts=1) "Source representing CDW supply line" + annotation (Placement(transformation(extent={{-108,-50},{-88,-30}}))); Buildings.Fluid.Sources.Boundary_pT sinCDW( redeclare final package Medium = Medium1, final p=300000, @@ -265,7 +265,7 @@ model TwoSourcesThreeUsers Placement(transformation( extent={{10,10},{-10,-10}}, rotation=180, - origin={-90,-90}))); + origin={-100,-100}))); equation connect(set_TRet.y,usr1. TSet) annotation (Line(points={{41,110},{44,110},{44, 82},{65,82},{65,71}}, color={0,0,127})); @@ -280,11 +280,10 @@ equation 7},{86,-110},{62,-110}}, color={0,0,127})); connect(mulMax_yVal.y, hysCat.u) annotation (Line(points={{38,-110},{22,-110}}, color={0,0,127})); - connect(hysCat.y, cat.booOnOff) annotation (Line(points={{-2,-110},{-26,-110}, - {-26,-92},{-50,-92},{-50,-72},{-51,-72}}, - color={255,0,255})); - connect(set_mChi2Pum1_flow.y, cat.set_mPum1_flow) annotation (Line(points={{-79, - -130},{-69,-130},{-69,-71}}, color={0,0,127})); + connect(hysCat.y, cat.booOnOff) annotation (Line(points={{-2,-110},{-44,-110}, + {-44,-48},{-51,-48}}, color={255,0,255})); + connect(set_mChi2Pum1_flow.y, cat.set_mPum1_flow) annotation (Line(points={{-119, + -70},{-76,-70},{-76,-49},{-69,-49}}, color={0,0,127})); connect(preDroChi1.port_b, chi1.port_a) annotation (Line(points={{-70,40},{-80,40},{-80,50}}, color={0,127,255})); connect(chi1.port_b, pumChi1.port_a) @@ -292,9 +291,9 @@ equation connect(sou_p.ports[1], preDroChi1.port_b) annotation (Line(points={{-100,40},{-70,40}}, color={0,127,255})); connect(set_dpUsr.y, conPI_PumChi1.u_s) - annotation (Line(points={{-60,139},{-60,132}}, color={0,0,127})); + annotation (Line(points={{-60,139},{-60,122}}, color={0,0,127})); connect(conPI_PumChi1.y, pumChi1.y) - annotation (Line(points={{-60,109},{-60,92}}, color={0,0,127})); + annotation (Line(points={{-60,99},{-60,92}}, color={0,0,127})); connect(usr1.yVal_actual, mulMax_yVal.u[3]) annotation (Line(points={{71,67}, {86,67},{86,-110},{62,-110},{62,-109.333}},color={0,0,127})); connect(preDroS2U3.port_b,usr3. port_a) @@ -336,37 +335,38 @@ equation -60},{98,-60}}, color={0,0,127})); connect(gaiUsr1.y,mulMin_dpUsr. u[1]) annotation (Line(points={{121,60},{126, - 60},{126,162},{-89.3333,162}}, + 60},{126,142},{-9.33333,142}}, color={0,0,127})); connect(gaiUsr2.y,mulMin_dpUsr. u[2]) annotation (Line(points={{121,-1.38778e-15}, - {126,-1.38778e-15},{126,162},{-90,162}}, color={0,0,127})); + {126,-1.38778e-15},{126,142},{-10,142}}, color={0,0,127})); connect(gaiUsr3.y,mulMin_dpUsr. u[3]) annotation (Line(points={{121,-60},{126, - -60},{126,162},{-90.6667,162}}, color={0,0,127})); + -60},{126,142},{-10.6667,142}}, color={0,0,127})); connect(mulMin_dpUsr.y, conPI_PumChi1.u_m) - annotation (Line(points={{-90,138},{-90,120},{-72,120}}, color={0,0,127})); - connect(booFloDir.y, cat.booFloDir) annotation (Line(points={{10,-199},{10,-132}, - {-34,-132},{-34,-100},{-58,-100},{-58,-72}}, color={255,0,255})); - connect(set_mTan_flow_discharge.y, swiTanCha.u1) annotation (Line(points={{-70, - -159},{-70,-150},{-58,-150},{-58,-142}}, color={0,0,127})); - connect(set_mTan_flow_charge.y, swiTanCha.u3) annotation (Line(points={{-30,-159}, - {-30,-150},{-42,-150},{-42,-142}}, color={0,0,127})); + annotation (Line(points={{-10,118},{-10,110},{-48,110}}, color={0,0,127})); + connect(booFloDir.y, cat.booFloDir) annotation (Line(points={{-69,10},{-58,10}, + {-58,-48}}, color={255,0,255})); + connect(set_mTan_flow_discharge.y, swiTanCha.u1) annotation (Line(points={{-129,10}, + {-126,10},{-126,-2},{-122,-2}}, color={0,0,127})); + connect(set_mTan_flow_charge.y, swiTanCha.u3) annotation (Line(points={{-129,-30}, + {-126,-30},{-126,-18},{-122,-18}}, color={0,0,127})); connect(booTanCha.y, swiTanCha.u2) - annotation (Line(points={{-50,-199},{-50,-142}}, color={255,0,255})); - connect(swiTanCha.y, cat.set_mTan_flow) annotation (Line(points={{-50,-118},{-50, - -112},{-62,-112},{-62,-71}}, color={0,0,127})); - connect(preDroU3S2.port_b, cat.port_b2) annotation (Line(points={{10,-80},{-54, - -80},{-54,-70}}, color={0,127,255})); - connect(cat.port_b2, preDroU2S2.port_b) annotation (Line(points={{-54,-70},{-54, - -80},{4,-80},{4,-20},{10,-20}}, color={0,127,255})); - connect(preDroS2U3.port_a, cat.port_a2) annotation (Line(points={{-30,-40},{-54, - -40},{-54,-50}}, color={0,127,255})); - connect(preDroS2U2.port_a, cat.port_a2) - annotation (Line(points={{-30,0},{-54,0},{-54,-50}}, color={0,127,255})); - connect(souCDW.ports[1], cat.port_b1) annotation (Line(points={{-80,-30},{-66, - -30},{-66,-50}}, color={0,127,255})); - connect(cat.port_a1, sinCDW.ports[1]) annotation (Line(points={{-66,-70},{-66, - -90},{-80,-90}}, color={0,127,255})); + annotation (Line(points={{-159,-10},{-122,-10}}, color={255,0,255})); + connect(swiTanCha.y, cat.set_mTan_flow) annotation (Line(points={{-98,-10},{-62, + -10},{-62,-49}}, color={0,0,127})); + connect(sinCDW.ports[1], cat.port_b1) annotation (Line(points={{-90,-100},{ + -66,-100},{-66,-70}}, + color={0,127,255})); + connect(cat.port_a2, preDroU3S2.port_b) annotation (Line(points={{-54,-70},{-54, + -80},{10,-80}}, color={0,127,255})); + connect(cat.port_a2, preDroU2S2.port_b) annotation (Line(points={{-54,-70},{-54, + -80},{-4,-80},{-4,-20},{10,-20}}, color={0,127,255})); + connect(cat.port_a1, souCDW.ports[1]) annotation (Line(points={{-66,-50},{-66, + -40},{-88,-40}}, color={0,127,255})); + connect(cat.port_b2, preDroS2U3.port_a) annotation (Line(points={{-54,-50},{-54, + -40},{-30,-40}}, color={0,127,255})); + connect(cat.port_b2, preDroS2U2.port_a) annotation (Line(points={{-54,-50},{-54, + -40},{-36,-40},{-36,0},{-30,0}}, color={0,127,255})); annotation (experiment(Tolerance=1e-06, StopTime=3600,__Dymola_Algorithm="Dassl"), - Diagram(coordinateSystem(extent={{-120,-220},{140,180}})), Icon( + Diagram(coordinateSystem(extent={{-180,-140},{140,180}})), Icon( coordinateSystem(extent={{-100,-100},{100,100}}))); end TwoSourcesThreeUsers; diff --git a/Buildings/Fluid/Storage/Plant/TemperatureSource.mo b/Buildings/Fluid/Storage/Plant/TemperatureSource.mo index 61cba42d56d..19c7f859e3c 100644 --- a/Buildings/Fluid/Storage/Plant/TemperatureSource.mo +++ b/Buildings/Fluid/Storage/Plant/TemperatureSource.mo @@ -55,7 +55,7 @@ model TemperatureSource origin={-70,110}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=90, - origin={-70,110}))); + origin={-60,110}))); Buildings.Fluid.Sources.PropertySource_T proSouT( redeclare package Medium = Medium, final use_T_in=true, diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo index 962a52bcc44..99e9d178aba 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo @@ -33,18 +33,18 @@ model ChillerAndTankNoRemoteCharging "(Draft)" nPorts=1) "Source representing CHW return line" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, + extent={{10,-10},{-10,10}}, rotation=0, - origin={-70,-30}))); + origin={70,-30}))); Buildings.Fluid.Sources.Boundary_pT sin( redeclare final package Medium = Medium2, final p=p_CHWS_nominal, final T=T_CHWS_nominal, nPorts=1) "Sink representing CHW supply line" annotation (Placement(transformation( - extent={{-10,10},{10,-10}}, + extent={{10,10},{-10,-10}}, rotation=180, - origin={70,-30}))); + origin={-70,-30}))); Modelica.Blocks.Sources.TimeTable set_mPum2_flow(table=[0,1; 900,1; 900,-1; 1800,-1; 1800,0; 2700,0; 2700,1; 3600,1]) "Secondary mass flow rate setpoint" @@ -67,20 +67,20 @@ model ChillerAndTankNoRemoteCharging "(Draft)" rotation=180, origin={-10,90}))); Buildings.Fluid.Sources.MassFlowSource_T souCDW( - nPorts=1, redeclare package Medium = Medium1, m_flow=1, - T=305.15) "Source representing CDW supply line" - annotation (Placement(transformation(extent={{80,20},{60,40}}))); + T=305.15, + nPorts=1) "Source representing CDW supply line" + annotation (Placement(transformation(extent={{-80,20},{-60,40}}))); Buildings.Fluid.Sources.Boundary_pT sinCDW( redeclare final package Medium = Medium1, final p=300000, final T=310.15, nPorts=1) "Sink representing CDW return line" annotation ( Placement(transformation( - extent={{10,10},{-10,-10}}, + extent={{-10,10},{10,-10}}, rotation=180, - origin={-70,30}))); + origin={70,30}))); equation connect(gain2.y, conPID_Pum2.u_m) @@ -94,14 +94,14 @@ equation {-16,0},{-16,9},{-11,9}}, color={0,0,127})); connect(conPID_Pum2.y, cat.yPum2) annotation (Line(points={{-39,70},{-8,70},{-8,11}}, color={0,0,127})); - connect(sou.ports[1], cat.port_b2) annotation (Line(points={{-60,-30},{-16,-30}, - {-16,-6},{-10,-6}}, color={0,127,255})); - connect(cat.port_a2, sin.ports[1]) annotation (Line(points={{10,-6},{54,-6},{54, - -30},{60,-30}}, color={0,127,255})); - connect(souCDW.ports[1], cat.port_b1) annotation (Line(points={{60,30},{16,30}, - {16,6},{10,6}}, color={0,127,255})); - connect(cat.port_a1, sinCDW.ports[1]) annotation (Line(points={{-10,6},{-54,6}, - {-54,30},{-60,30}}, color={0,127,255})); + connect(sin.ports[1], cat.port_b2) annotation (Line(points={{-60,-30},{-16, + -30},{-16,-6},{-10,-6}}, color={0,127,255})); + connect(sou.ports[1], cat.port_a2) annotation (Line(points={{60,-30},{16,-30}, + {16,-6},{10,-6}}, color={0,127,255})); + connect(souCDW.ports[1], cat.port_a1) annotation (Line(points={{-60,30},{-20, + 30},{-20,6},{-10,6}}, color={0,127,255})); + connect(cat.port_b1, sinCDW.ports[1]) annotation (Line(points={{10,6},{54,6}, + {54,30},{60,30}}, color={0,127,255})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo index 34de70a8b25..904683f658a 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo @@ -45,9 +45,9 @@ model ChillerAndTankWithRemoteCharging nPorts=1) "Source, CHW return line" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, + extent={{10,-10},{-10,10}}, rotation=0, - origin={-70,-30}))); + origin={70,-30}))); Buildings.Fluid.Sources.Boundary_pT sin( redeclare final package Medium = Medium2, p=p_CHWS_nominal, @@ -55,9 +55,9 @@ model ChillerAndTankWithRemoteCharging nPorts=1) "Sink, CHW supply line" annotation (Placement(transformation( - extent={{-10,10},{10,-10}}, + extent={{10,10},{-10,-10}}, rotation=180, - origin={70,-30}))); + origin={-70,-30}))); Modelica.Blocks.Sources.TimeTable set_mTan_flow(table=[0,0; 3600/7,0; 3600/7, -1; 3600/7*3,-1; 3600/7*3,0; 3600/7*4,0; 3600/7*4,1; 3600/7*6,1; 3600/7 *6,-1]) @@ -78,15 +78,15 @@ model ChillerAndTankWithRemoteCharging final T=310.15, nPorts=1) "Sink representing CDW return line" annotation ( Placement(transformation( - extent={{10,10},{-10,-10}}, + extent={{-10,10},{10,-10}}, rotation=180, - origin={-70,30}))); + origin={70,30}))); Buildings.Fluid.Sources.MassFlowSource_T souCDW( - nPorts=1, redeclare package Medium = Medium1, m_flow=1, - T=305.15) "Source representing CDW supply line" - annotation (Placement(transformation(extent={{80,20},{60,40}}))); + T=305.15, + nPorts=1) "Source representing CDW supply line" + annotation (Placement(transformation(extent={{-80,20},{-60,40}}))); equation connect(booOnOff.y, cat.booOnOff) annotation (Line(points={{-59,-70},{-10,-70}, @@ -99,14 +99,14 @@ equation color={0,0,127})); connect(set_mChi_flow.y, cat.set_mPum1_flow) annotation (Line(points={{-59,90},{-9,90},{-9,9}}, color={0,0,127})); - connect(cat.port_b2, sou.ports[1]) annotation (Line(points={{-8,-6},{-54,-6},{ - -54,-30},{-60,-30}}, color={0,127,255})); - connect(cat.port_a2, sin.ports[1]) annotation (Line(points={{12,-6},{54,-6},{54, - -30},{60,-30}}, color={0,127,255})); - connect(souCDW.ports[1], cat.port_b1) annotation (Line(points={{60,30},{18,30}, - {18,6},{12,6}}, color={0,127,255})); - connect(cat.port_a1, sinCDW.ports[1]) annotation (Line(points={{-8,6},{-54,6}, + connect(cat.port_b2, sin.ports[1]) annotation (Line(points={{-8,-6},{-54,-6}, + {-54,-30},{-60,-30}}, color={0,127,255})); + connect(sou.ports[1], cat.port_a2) annotation (Line(points={{60,-30},{18,-30}, + {18,-6},{12,-6}}, color={0,127,255})); + connect(cat.port_a1, souCDW.ports[1]) annotation (Line(points={{-8,6},{-54,6}, {-54,30},{-60,30}}, color={0,127,255})); + connect(sinCDW.ports[1], cat.port_b1) annotation (Line(points={{60,30},{18,30}, + {18,6},{12,6}}, color={0,127,255})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), From 432a7f07d5fb9fdae2ea277191e9d2f1c9ca21e2 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Wed, 16 Feb 2022 16:02:04 -0800 Subject: [PATCH 032/463] replaced ideal chiller; made valve interlock --- .../BaseClasses/ReversiblePumpValveControl.mo | 229 ++++++++++-------- .../Fluid/Storage/Plant/ChillerAndTank.mo | 106 +++++--- .../Plant/Examples/TwoSourcesThreeUsers.mo | 8 +- 3 files changed, 205 insertions(+), 138 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo index aa39d738e9c..65a3e2aeaf7 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo @@ -4,31 +4,23 @@ block ReversiblePumpValveControl extends Modelica.Blocks.Icons.Block; Modelica.Blocks.Sources.Constant conOne(k=1) "Constant y = 1" - annotation (Placement(transformation(extent={{-100,-20},{-80,0}}))); - Controls.OBC.CDL.Continuous.Switch swiOnOff "Online/offline switch" - annotation (Placement(transformation(extent={{-60,-90},{-40,-70}}))); + annotation (Placement(transformation(extent={{-100,-90},{-80,-70}}))); Modelica.Blocks.Sources.Constant conZero(k=0) "Constant y = 0" - annotation (Placement(transformation(extent={{-100,-60},{-80,-40}}))); - Controls.OBC.CDL.Continuous.Switch swiFloDirPum2 "Flow direction of pum2" - annotation (Placement(transformation(extent={{-50,-40},{-30,-20}}))); - Controls.OBC.CDL.Continuous.Switch swiFloDirVal2 "Flow direction of val2" - annotation (Placement(transformation(extent={{50,-40},{70,-20}}))); - Controls.OBC.CDL.Continuous.Switch swiFloDirVal1 "Flow direction of val2" - annotation (Placement(transformation(extent={{0,-40},{20,-20}}))); - Controls.Continuous.LimPID conPI_pum2( + annotation (Placement(transformation(extent={{-100,-120},{-80,-100}}))); + Buildings.Controls.Continuous.LimPID conPI_pum2( controllerType=Modelica.Blocks.Types.SimpleController.PI, Td=1, k=5, Ti=50) "PI controller for pum2" annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=270, - origin={-70,60}))); + origin={-70,70}))); Modelica.Blocks.Math.Gain gaiPum2(k=1) "Gain" annotation (Placement( transformation( extent={{10,-10},{-10,10}}, rotation=90, origin={-70,30}))); - Controls.Continuous.LimPID conPI_val2( + Buildings.Controls.Continuous.LimPID conPI_val2( controllerType=Modelica.Blocks.Types.SimpleController.PI, Td=1, k=5, @@ -37,15 +29,15 @@ block ReversiblePumpValveControl "PI controller for val2" annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=270, - origin={-10,60}))); + origin={-10,68}))); Modelica.Blocks.Math.Gain gaiVal2(k=1) "Gain" annotation (Placement( transformation( extent={{10,-10},{-10,10}}, rotation=90, origin={-10,30}))); - Controls.OBC.CDL.Interfaces.BooleanInput booFloDir + Buildings.Controls.OBC.CDL.Interfaces.BooleanInput booFloDir "Flow direction, true = normal, false = reverse" annotation (Placement( - transformation(extent={{-120,0},{-100,20}}), iconTransformation( + transformation(extent={{-120,-10},{-100,10}}), iconTransformation( extent={{-140,-60},{-100,-20}}))); Modelica.Blocks.Interfaces.RealInput us_mTan_flow "Tank mass flow rate setpoint" annotation (Placement(transformation( @@ -63,30 +55,15 @@ block ReversiblePumpValveControl extent={{-10,-10},{10,10}}, rotation=0, origin={-110,80}))); - Controls.OBC.CDL.Continuous.Min minPum2 "Offline signal overrides all" - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={-10,-80}))); - Controls.OBC.CDL.Continuous.Min minVal2 "Offline signal overrides all" - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={90,-80}))); - Controls.OBC.CDL.Continuous.Min minVal1 "Offline signal overrides all" - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={40,-80}))); - Controls.OBC.CDL.Interfaces.BooleanInput booOnOff + Buildings.Controls.OBC.CDL.Interfaces.BooleanInput booOnOff "True = plant online, False = plant offline" annotation (Placement( - transformation(extent={{-120,-90},{-100,-70}}), iconTransformation( + transformation(extent={{-120,-30},{-100,-10}}), iconTransformation( extent={{-140,-100},{-100,-60}}))); Modelica.Blocks.Interfaces.RealOutput yPum2 "Normalised speed" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={-10,-110}), iconTransformation( + origin={-50,-170}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={0,-110}))); @@ -94,7 +71,7 @@ block ReversiblePumpValveControl Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={90,-110}), iconTransformation( + origin={70,-170}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={80,-110}))); @@ -102,81 +79,127 @@ block ReversiblePumpValveControl Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={40,-110}), iconTransformation( + origin={10,-170}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={40,-110}))); + Modelica.Blocks.Interfaces.RealInput yVal2_actual "Actual position of val2" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={110,70}), iconTransformation( + extent={{10,-10},{-10,10}}, + rotation=0, + origin={110,40}))); + Modelica.Blocks.Interfaces.RealInput yVal1_actual "Actual position of val1" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={110,30}), iconTransformation( + extent={{10,-10},{-10,10}}, + rotation=0, + origin={110,80}))); + Buildings.Controls.OBC.CDL.Continuous.LessThreshold lesThrVal1(t=0.05) + "yVal1_actual < 0.05" + annotation (Placement(transformation(extent={{80,20},{60,40}}))); + Buildings.Controls.OBC.CDL.Continuous.Switch swiPum1 + "Switch: true = on; false = off (y=0)." annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-50,-130}))); + Buildings.Controls.OBC.CDL.Continuous.Switch swiVal1 + "Switch: true = on (y=1); false = off (y=0)." annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={10,-128}))); + Buildings.Controls.OBC.CDL.Continuous.Switch swiVal2 + "Switch: true = on; false = off (y=0)." annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={70,-130}))); + Buildings.Controls.OBC.CDL.Logical.And andPum2 "Plant online AND normal direction" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-60,-50}))); + Buildings.Controls.OBC.CDL.Logical.And3 and3Val1 + "Plant online AND normal direction AND val2 closed" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={0,-50}))); + Buildings.Controls.OBC.CDL.Continuous.LessThreshold lesThrVal2(t=0.05) + "yVal1_actual < 0.05" + annotation (Placement(transformation(extent={{80,60},{60,80}}))); + Buildings.Controls.OBC.CDL.Logical.And3 and3Val2 + "Plant online AND normal direction AND val1 closed" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={60,-50}))); equation - connect(conOne.y,swiOnOff. u1) annotation (Line(points={{-79,-10},{-66,-10},{-66, - -72},{-62,-72}}, - color={0,0,127})); - connect(conZero.y,swiOnOff. u3) annotation (Line(points={{-79,-50},{-72,-50},{ - -72,-88},{-62,-88}}, - color={0,0,127})); - connect(conZero.y,swiFloDirPum2. u3) annotation (Line(points={{-79,-50},{-60, - -50},{-60,-38},{-52,-38}}, - color={0,0,127})); - connect(swiFloDirPum2.y, minPum2.u1) - annotation (Line(points={{-28,-30},{-22,-30},{-22,-62},{-4,-62},{-4,-68}}, - color={0,0,127})); - connect(swiFloDirVal2.y, minVal2.u1) - annotation (Line(points={{72,-30},{96,-30},{96,-68}}, - color={0,0,127})); - connect(swiFloDirVal1.y, minVal1.u1) - annotation (Line(points={{22,-30},{22,-60},{46,-60},{46,-68}}, - color={0,0,127})); - connect(conOne.y,swiFloDirVal1. u1) annotation (Line(points={{-79,-10},{-10, - -10},{-10,-22},{-2,-22}}, - color={0,0,127})); - connect(conZero.y,swiFloDirVal1. u3) annotation (Line(points={{-79,-50},{-10, - -50},{-10,-38},{-2,-38}}, - color={0,0,127})); - connect(conZero.y,swiFloDirVal2. u1) annotation (Line(points={{-79,-50},{42, - -50},{42,-22},{48,-22}}, - color={0,0,127})); - connect(booFloDir,swiFloDirPum2. u2) annotation (Line(points={{-110,10},{-62, - 10},{-62,-30},{-52,-30}}, - color={255,0,255})); connect(conPI_pum2.y,gaiPum2. u) - annotation (Line(points={{-70,49},{-70,42}}, color={0,0,127})); - connect(gaiPum2.y,swiFloDirPum2. u1) - annotation (Line(points={{-70,19},{-70,-22},{-52,-22}}, - color={0,0,127})); - connect(conPI_val2.y,gaiVal2. u) annotation (Line(points={{-10,49},{-10,45.5}, - {-10,45.5},{-10,42}}, color={0,0,127})); - connect(gaiVal2.y,swiFloDirVal2. u3) - annotation (Line(points={{-10,19},{-10,0},{30,0},{30,-38},{48,-38}}, - color={0,0,127})); + annotation (Line(points={{-70,59},{-70,42}}, color={0,0,127})); + connect(conPI_val2.y,gaiVal2. u) annotation (Line(points={{-10,57},{-10,42}}, + color={0,0,127})); connect(conPI_pum2.u_s, us_mTan_flow) - annotation (Line(points={{-70,72},{-70,110}}, color={0,0,127})); - connect(conPI_val2.u_s, us_mTan_flow) annotation (Line(points={{-10,72},{ - -10,96},{-70,96},{-70,110}}, - color={0,0,127})); - connect(conPI_val2.u_m, um_mTan_flow) annotation (Line(points={{2,60},{10, - 60},{10,110}}, color={0,0,127})); - connect(conPI_pum2.u_m, um_mTan_flow) annotation (Line(points={{-58,60},{ - -50,60},{-50,90},{10,90},{10,110}}, color={0,0,127})); - connect(swiOnOff.u2, booOnOff) - annotation (Line(points={{-62,-80},{-110,-80}}, color={255,0,255})); - connect(swiOnOff.y, minPum2.u2) annotation (Line(points={{-38,-80},{-34,-80},{ - -34,-56},{-16,-56},{-16,-68}}, color={0,0,127})); - connect(swiOnOff.y, minVal2.u2) annotation (Line(points={{-38,-80},{-34,-80}, - {-34,-56},{84,-56},{84,-68}},color={0,0,127})); - connect(swiOnOff.y, minVal1.u2) annotation (Line(points={{-38,-80},{-34,-80}, - {-34,-56},{34,-56},{34,-68}},color={0,0,127})); - connect(minPum2.y, yPum2) annotation (Line(points={{-10,-92},{-10,-110}}, - color={0,0,127})); - connect(minVal2.y, yVal2) - annotation (Line(points={{90,-92},{90,-110}}, color={0,0,127})); - connect(minVal1.y, yVal1) - annotation (Line(points={{40,-92},{40,-110}}, color={0,0,127})); - connect(swiFloDirVal2.u2, booFloDir) annotation (Line(points={{48,-30},{40, - -30},{40,10},{-110,10}}, color={255,0,255})); - connect(swiFloDirVal1.u2, booFloDir) annotation (Line(points={{-2,-30},{-20, - -30},{-20,10},{-110,10}},color={255,0,255})); + annotation (Line(points={{-70,82},{-70,110}}, color={0,0,127})); + connect(conPI_val2.u_s, us_mTan_flow) annotation (Line(points={{-10,80},{-10, + 88},{-70,88},{-70,110}}, color={0,0,127})); + connect(conPI_val2.u_m, um_mTan_flow) annotation (Line(points={{2,68},{10,68}, + {10,110}}, color={0,0,127})); + connect(conPI_pum2.u_m, um_mTan_flow) annotation (Line(points={{-58,70},{-52, + 70},{-52,94},{10,94},{10,110}}, color={0,0,127})); connect(yVal1, yVal1) - annotation (Line(points={{40,-110},{40,-110}}, color={0,0,127})); - annotation (Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), Icon( + annotation (Line(points={{10,-170},{10,-170}}, color={0,0,127})); + connect(swiPum1.y, yPum2) + annotation (Line(points={{-50,-142},{-50,-170}}, color={0,0,127})); + connect(conZero.y, swiPum1.u3) annotation (Line(points={{-79,-110},{-58,-110}, + {-58,-118}}, color={0,0,127})); + connect(conZero.y, swiVal1.u3) + annotation (Line(points={{-79,-110},{2,-110},{2,-116}}, color={0,0,127})); + connect(swiVal1.y, yVal1) + annotation (Line(points={{10,-140},{10,-170}}, color={0,0,127})); + connect(swiVal2.y, yVal2) + annotation (Line(points={{70,-142},{70,-170}}, color={0,0,127})); + connect(conZero.y, swiVal2.u3) annotation (Line(points={{-79,-110},{62,-110},{ + 62,-118}}, color={0,0,127})); + connect(conOne.y, swiVal1.u1) + annotation (Line(points={{-79,-80},{18,-80},{18,-116}}, color={0,0,127})); + connect(gaiPum2.y, swiPum1.u1) annotation (Line(points={{-70,19},{-70,10},{-42, + 10},{-42,-118}}, color={0,0,127})); + connect(gaiVal2.y, swiVal2.u1) annotation (Line(points={{-10,19},{-10,10},{78, + 10},{78,-118}}, color={0,0,127})); + connect(booOnOff, andPum2.u2) annotation (Line(points={{-110,-20},{-68,-20},{-68, + -38}}, color={255,0,255})); + connect(booFloDir, andPum2.u1) + annotation (Line(points={{-110,0},{-60,0},{-60,-38}}, color={255,0,255})); + connect(andPum2.y, swiPum1.u2) annotation (Line(points={{-60,-62},{-60,-70},{-50, + -70},{-50,-118}}, color={255,0,255})); + connect(booOnOff, and3Val1.u3) annotation (Line(points={{-110,-20},{-8,-20},{-8, + -38}}, color={255,0,255})); + connect(booFloDir, and3Val1.u2) annotation (Line(points={{-110,0},{0,0},{0,-20}, + {2.22045e-15,-20},{2.22045e-15,-38}}, color={255,0,255})); + connect(lesThrVal2.u, yVal2_actual) + annotation (Line(points={{82,70},{110,70}}, color={0,0,127})); + connect(lesThrVal2.y, and3Val1.u1) annotation (Line(points={{58,70},{34,70},{34, + 40},{8,40},{8,-38}}, color={255,0,255})); + connect(booOnOff, and3Val2.u3) annotation (Line(points={{-110,-20},{52,-20},{52, + -38}}, color={255,0,255})); + connect(and3Val2.u2, booFloDir) + annotation (Line(points={{60,-38},{60,0},{-110,0}}, color={255,0,255})); + connect(and3Val2.u1, lesThrVal1.y) annotation (Line(points={{68,-38},{68,16},{ + 52,16},{52,30},{58,30}}, color={255,0,255})); + connect(lesThrVal1.u, yVal1_actual) + annotation (Line(points={{82,30},{110,30}}, color={0,0,127})); + connect(and3Val1.y, swiVal1.u2) annotation (Line(points={{-2.22045e-15,-62},{ + -2.22045e-15,-70},{10,-70},{10,-116}}, color={255,0,255})); + connect(and3Val2.y, swiVal2.u2) annotation (Line(points={{60,-62},{60,-70},{ + 70,-70},{70,-118}}, color={255,0,255})); + annotation (Diagram(coordinateSystem(extent={{-100,-160},{100,100}})), Icon( coordinateSystem(extent={{-100,-100},{100,100}}))); end ReversiblePumpValveControl; diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo index da7a803803a..268d3b1aaf0 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo @@ -46,15 +46,8 @@ model ChillerAndTank origin={40,130}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-110,90}))); + origin={-110,100}))); - Buildings.Fluid.Storage.Plant.TemperatureSource ideChi( - redeclare package Medium = Medium2, - m_flow_nominal=mChi_flow_nominal, - p_nominal=p_CHWS_nominal, - T_a_nominal=T_CHWR_nominal, - T_b_nominal=T_CHWS_nominal) "Ideal chiller" - annotation (Placement(transformation(extent={{-20,-20},{-40,0}}))); Buildings.Fluid.Storage.Plant.TemperatureSource ideTan( redeclare package Medium = Medium2, final allowFlowReversal=true, @@ -103,8 +96,8 @@ model ChillerAndTank Buildings.Controls.OBC.CDL.Interfaces.BooleanInput booOnOff if allowRemoteCharging "Plant status: true = online; false = offline" annotation (Placement( - transformation(extent={{120,70},{100,90}}), iconTransformation(extent= - {{-140,-110},{-100,-70}}))); + transformation(extent={{120,70},{100,90}}), iconTransformation(extent={{-140, + -120},{-100,-80}}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanInput booFloDir if allowRemoteCharging "Flow direction: true = normal; false = reverse" annotation (Placement( @@ -121,7 +114,8 @@ model ChillerAndTank Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage val1( redeclare package Medium = Medium2, - use_inputFilter=false, + use_inputFilter=true, + y_start=0, l=1E-10, dpValve_nominal=1, m_flow_nominal=mChi_flow_nominal+mTan_flow_nominal) if allowRemoteCharging @@ -129,7 +123,8 @@ model ChillerAndTank annotation (Placement(transformation(extent={{60,-20},{40,0}}))); Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage val2( redeclare package Medium = Medium2, - use_inputFilter=false, + use_inputFilter=true, + y_start=0, l=1E-10, dpValve_nominal=1, m_flow_nominal=mTan_flow_nominal) if allowRemoteCharging @@ -141,7 +136,7 @@ model ChillerAndTank rotation=-90, origin={-10,90}))); Modelica.Blocks.Sources.Constant conZero(k=0) if allowRemoteCharging - "Constant y = 0" + "Constant y = 0" annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=90, origin={-50,90}))); @@ -156,10 +151,49 @@ model ChillerAndTank origin={28,90}))); Modelica.Blocks.Interfaces.RealInput yPum2 if not allowRemoteCharging "Secondary pump speed input" - annotation (Placement(transformation(extent={{-120,10},{-100,30}}), + annotation (Placement(transformation(extent={{120,10},{100,30}}), iconTransformation(extent={{-10,-10},{10,10}}, rotation=-90, origin={-80,110}))); + Buildings.Fluid.Chillers.ElectricEIR chi( + redeclare final package Medium1 = Medium1, + redeclare final package Medium2 = Medium2, + final dp1_nominal=0, + final dp2_nominal=0, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + final per=perChi) + "Water cooled chiller (ports indexed 1 are on condenser side)" + annotation (Placement(transformation(extent={{-40,0},{-20,20}}))); + Buildings.Controls.OBC.CDL.Logical.Sources.Constant onChi(k=true) + if not allowRemoteCharging "Placeholder, chiller always on" + annotation (Placement(transformation(extent={{-100,30},{-80,50}}))); + Modelica.Blocks.Sources.Constant set_TEvaLvg(k=T_CHWS_nominal) + "Evaporator leaving temperature setpoint" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-90,10}))); + replaceable parameter Buildings.Fluid.Chillers.Data.ElectricEIR.Generic perChi( + QEva_flow_nominal=-1E6, + COP_nominal=3, + PLRMax=1, + PLRMinUnl=0.3, + PLRMin=0.3, + etaMotor=1, + mEva_flow_nominal=mChi_flow_nominal, + mCon_flow_nominal=mChi_flow_nominal*1.2, + TEvaLvg_nominal=280.15, + capFunT={1,0,0,0,0,0}, + EIRFunT={1,0,0,0,0,0}, + EIRFunPLR={1,0,0}, + TEvaLvgMin=276.15, + TEvaLvgMax=288.15, + TConEnt_nominal=310.15, + TConEntMin=303.15, + TConEntMax=333.15) + "Chiller performance data" + annotation (choicesAllMatching=true, + Placement(transformation(extent={{-100,82},{-80,102}}))); equation connect(ideTan.port_b, preDro2.port_a) annotation (Line(points={{-40,-70},{-60,-70}}, @@ -173,7 +207,7 @@ equation 66,26},{50,26},{50,2}}, color={0,0,127})); connect(pum2Con.um_mTan_flow, ideTan.m_flow) annotation (Line(points={{81,99.8}, - {86,99.8},{86,108},{54,108},{54,40},{-10,40},{-10,-50},{-24,-50},{-24, + {86,99.8},{86,108},{46,108},{46,40},{-10,40},{-10,-50},{-24,-50},{-24, -59}}, color={0,0,127})); connect(pum2Con.us_mTan_flow, set_mTan_flow) annotation (Line(points={{81,95.4}, @@ -184,28 +218,24 @@ equation color={0,127,255})); connect(pum2.y, pum2Con.yPum2) annotation (Line(points={{80,-8},{80,20},{70, 20},{70,78.9}}, color={0,0,127})); - connect(swiFloDirPum1.u2, booFloDir) annotation (Line(points={{-10,102},{-10, - 110},{96,110},{96,100},{110,100}}, - color={255,0,255})); - connect(swiFloDirPum1.u1, set_mPum1_flow) annotation (Line(points={{-2,102},{ - -2,114},{40,114},{40,130}}, - color={0,0,127})); + connect(swiFloDirPum1.u2, booFloDir) annotation (Line(points={{-10,102},{-10,112}, + {96,112},{96,100},{110,100}}, color={255,0,255})); + connect(swiFloDirPum1.u1, set_mPum1_flow) annotation (Line(points={{-2,102},{-2, + 108},{40,108},{40,130}}, color={0,0,127})); connect(pum1.m_flow_in,swiFloDirPum1. y) annotation (Line(points={{10,2},{10,72},{-10,72},{-10,78}}, color={0,0,127})); - connect(conZero.y,swiFloDirPum1. u3) annotation (Line(points={{-50,101},{-50, - 110},{-18,110},{-18,102}}, + connect(conZero.y,swiFloDirPum1. u3) annotation (Line(points={{-50,101},{-50,108}, + {-18,108},{-18,102}}, color={0,0,127})); connect(pum2.port_b, pasVal1.port_a) annotation (Line(points={{70,-20},{66, -20},{66,-32},{60,-32}}, color={0,127,255})); connect(pasSwiFloDirPum1.u, set_mPum1_flow) annotation (Line(points={{28,101}, - {28,114},{40,114},{40,130}}, color={0,0,127})); + {28,108},{40,108},{40,130}}, color={0,0,127})); connect(pasSwiFloDirPum1.y, pum1.m_flow_in) annotation (Line(points={{28,79}, {28,72},{10,72},{10,2}}, color={0,0,127})); connect(pum2.y, yPum2) - annotation (Line(points={{80,-8},{80,20},{-110,20}}, color={0,0,127})); - connect(port_b1, port_a1) - annotation (Line(points={{100,60},{-100,60}}, color={0,127,255})); + annotation (Line(points={{80,-8},{80,20},{110,20}}, color={0,0,127})); connect(port_b2, preDro1.port_b) annotation (Line(points={{-100,-60},{-86,-60}, {-86,-10},{-80,-10}}, color={0,127,255})); connect(preDro2.port_b, port_b2) annotation (Line(points={{-80,-70},{-86,-70}, @@ -214,10 +244,6 @@ equation annotation (Line(points={{90,-20},{90,-60},{100,-60}}, color={0,127,255})); connect(val2.port_b, port_a2) annotation (Line(points={{60,-70},{90,-70},{90, -60},{100,-60}}, color={0,127,255})); - connect(preDro1.port_a, ideChi.port_b) - annotation (Line(points={{-60,-10},{-40,-10}}, color={0,127,255})); - connect(ideChi.port_a, pum1.port_b) - annotation (Line(points={{-20,-10},{0,-10}}, color={0,127,255})); connect(pum1.port_a, val1.port_b) annotation (Line(points={{20,-10},{40,-10}}, color={0,127,255})); connect(pasVal1.port_b, pum1.port_a) annotation (Line(points={{40,-32},{30, @@ -230,6 +256,24 @@ equation {96,82},{96,80},{110,80}}, color={255,0,255})); connect(pum2Con.booFloDir, booFloDir) annotation (Line(points={{82,86.6},{82, 86},{96,86},{96,100},{110,100}}, color={255,0,255})); + connect(preDro1.port_a, chi.port_b2) annotation (Line(points={{-60,-10},{-60,-6}, + {-40,-6},{-40,4}}, color={0,127,255})); + connect(pum1.port_b, chi.port_a2) annotation (Line(points={{0,-10},{-14,-10},{ + -14,4},{-20,4}}, color={0,127,255})); + connect(chi.on, booFloDir) annotation (Line(points={{-42,13},{-42,14},{-68,14}, + {-68,112},{96,112},{96,100},{110,100}}, color={255,0,255})); + connect(onChi.y, chi.on) annotation (Line(points={{-78,40},{-68,40},{-68,13},{ + -42,13}}, color={255,0,255})); + connect(set_TEvaLvg.y, chi.TSet) annotation (Line(points={{-79,10},{-50,10},{-50, + 7},{-42,7}}, color={0,0,127})); + connect(chi.port_a1, port_a1) annotation (Line(points={{-40,16},{-44,16},{-44, + 60},{-100,60}}, color={0,127,255})); + connect(chi.port_b1, port_b1) annotation (Line(points={{-20,16},{-16,16},{-16, + 60},{100,60}}, color={0,127,255})); + connect(val1.y_actual, pum2Con.yVal1_actual) annotation (Line(points={{45,-3}, + {42,-3},{42,30},{54,30},{54,99.8},{59,99.8}}, color={0,0,127})); + connect(val2.y_actual, pum2Con.yVal2_actual) annotation (Line(points={{55,-63}, + {60,-63},{60,-44},{96,-44},{96,8},{59,8},{59,95.4}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,100}}), graphics={Line( points={{-30,-110},{30,-110}}, diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index 26207caf674..5f30c4c9713 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -244,8 +244,8 @@ model TwoSourcesThreeUsers extent={{-10,-10},{10,10}}, rotation=0, origin={-140,-30}))); - Modelica.Blocks.Sources.BooleanTable booTanCha(table={3600/9*1,3600/9*6,3600/9 - *8}, startValue=false) + Modelica.Blocks.Sources.BooleanTable booTanCha(table={3600/9*1,3600/9*6,3600/ + 9*8},startValue=false) "Tank charging status (local or remote): True = discharging; False = charging" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -281,9 +281,9 @@ equation connect(mulMax_yVal.y, hysCat.u) annotation (Line(points={{38,-110},{22,-110}}, color={0,0,127})); connect(hysCat.y, cat.booOnOff) annotation (Line(points={{-2,-110},{-44,-110}, - {-44,-48},{-51,-48}}, color={255,0,255})); + {-44,-48},{-50,-48}}, color={255,0,255})); connect(set_mChi2Pum1_flow.y, cat.set_mPum1_flow) annotation (Line(points={{-119, - -70},{-76,-70},{-76,-49},{-69,-49}}, color={0,0,127})); + -70},{-76,-70},{-76,-49},{-70,-49}}, color={0,0,127})); connect(preDroChi1.port_b, chi1.port_a) annotation (Line(points={{-70,40},{-80,40},{-80,50}}, color={0,127,255})); connect(chi1.port_b, pumChi1.port_a) From b488a811a4336f818cd3ce924cb72bd4d6e62db5 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Thu, 17 Feb 2022 13:13:59 -0800 Subject: [PATCH 033/463] replaced ideal tank with model --- .../BaseClasses/ReversiblePumpValveControl.mo | 44 +++++--- .../Fluid/Storage/Plant/ChillerAndTank.mo | 101 ++++++++++-------- .../Plant/Examples/TwoSourcesThreeUsers.mo | 2 +- 3 files changed, 88 insertions(+), 59 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo index 65a3e2aeaf7..fd2cb4cf40e 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo @@ -25,7 +25,7 @@ block ReversiblePumpValveControl Td=1, k=5, Ti=50, - reverseActing=false) + reverseActing=true) "PI controller for val2" annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=270, @@ -120,11 +120,6 @@ block ReversiblePumpValveControl extent={{-10,-10},{10,10}}, rotation=-90, origin={70,-130}))); - Buildings.Controls.OBC.CDL.Logical.And andPum2 "Plant online AND normal direction" - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={-60,-50}))); Buildings.Controls.OBC.CDL.Logical.And3 and3Val1 "Plant online AND normal direction AND val2 closed" annotation (Placement( transformation( @@ -140,6 +135,18 @@ block ReversiblePumpValveControl extent={{-10,-10},{10,10}}, rotation=-90, origin={60,-50}))); + Buildings.Controls.OBC.CDL.Logical.Not notVal2 + "Reverses flow direction signal for val2" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={50,-16}))); + Buildings.Controls.OBC.CDL.Logical.And3 and3Pum2 + "Plant online AND normal direction AND val2 closed" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-60,-50}))); equation connect(conPI_pum2.y,gaiPum2. u) @@ -174,12 +181,6 @@ equation 10},{-42,-118}}, color={0,0,127})); connect(gaiVal2.y, swiVal2.u1) annotation (Line(points={{-10,19},{-10,10},{78, 10},{78,-118}}, color={0,0,127})); - connect(booOnOff, andPum2.u2) annotation (Line(points={{-110,-20},{-68,-20},{-68, - -38}}, color={255,0,255})); - connect(booFloDir, andPum2.u1) - annotation (Line(points={{-110,0},{-60,0},{-60,-38}}, color={255,0,255})); - connect(andPum2.y, swiPum1.u2) annotation (Line(points={{-60,-62},{-60,-70},{-50, - -70},{-50,-118}}, color={255,0,255})); connect(booOnOff, and3Val1.u3) annotation (Line(points={{-110,-20},{-8,-20},{-8, -38}}, color={255,0,255})); connect(booFloDir, and3Val1.u2) annotation (Line(points={{-110,0},{0,0},{0,-20}, @@ -188,10 +189,9 @@ equation annotation (Line(points={{82,70},{110,70}}, color={0,0,127})); connect(lesThrVal2.y, and3Val1.u1) annotation (Line(points={{58,70},{34,70},{34, 40},{8,40},{8,-38}}, color={255,0,255})); - connect(booOnOff, and3Val2.u3) annotation (Line(points={{-110,-20},{52,-20},{52, - -38}}, color={255,0,255})); - connect(and3Val2.u2, booFloDir) - annotation (Line(points={{60,-38},{60,0},{-110,0}}, color={255,0,255})); + connect(booOnOff, and3Val2.u3) annotation (Line(points={{-110,-20},{20,-20},{ + 20,-34},{52,-34},{52,-38}}, + color={255,0,255})); connect(and3Val2.u1, lesThrVal1.y) annotation (Line(points={{68,-38},{68,16},{ 52,16},{52,30},{58,30}}, color={255,0,255})); connect(lesThrVal1.u, yVal1_actual) @@ -200,6 +200,18 @@ equation -2.22045e-15,-70},{10,-70},{10,-116}}, color={255,0,255})); connect(and3Val2.y, swiVal2.u2) annotation (Line(points={{60,-62},{60,-70},{ 70,-70},{70,-118}}, color={255,0,255})); + connect(and3Val2.u2, notVal2.y) + annotation (Line(points={{60,-38},{60,-28},{50,-28}}, color={255,0,255})); + connect(notVal2.u, booFloDir) + annotation (Line(points={{50,-4},{50,0},{-110,0}}, color={255,0,255})); + connect(and3Pum2.u3, booOnOff) annotation (Line(points={{-68,-38},{-68,-20},{ + -110,-20}}, color={255,0,255})); + connect(and3Pum2.u2, booFloDir) + annotation (Line(points={{-60,-38},{-60,0},{-110,0}}, color={255,0,255})); + connect(and3Pum2.u1, lesThrVal2.y) annotation (Line(points={{-52,-38},{-52, + -30},{8,-30},{8,40},{34,40},{34,70},{58,70}}, color={255,0,255})); + connect(and3Pum2.y, swiPum1.u2) annotation (Line(points={{-60,-62},{-60,-70}, + {-50,-70},{-50,-118}}, color={255,0,255})); annotation (Diagram(coordinateSystem(extent={{-100,-160},{100,100}})), Icon( coordinateSystem(extent={{-100,-100},{100,100}}))); end ReversiblePumpValveControl; diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo index 268d3b1aaf0..815a1e24a3b 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo @@ -24,6 +24,28 @@ model ChillerAndTank parameter Modelica.Units.SI.Temperature T_CHWR_nominal=12+273.15 "Nominal temperature of CHW return"; + replaceable parameter Buildings.Fluid.Chillers.Data.ElectricEIR.Generic perChi( + QEva_flow_nominal=-1E6, + COP_nominal=3, + PLRMax=1, + PLRMinUnl=0.3, + PLRMin=0.3, + etaMotor=1, + mEva_flow_nominal=mChi_flow_nominal, + mCon_flow_nominal=mChi_flow_nominal*1.2, + TEvaLvg_nominal=280.15, + capFunT={1,0,0,0,0,0}, + EIRFunT={1,0,0,0,0,0}, + EIRFunPLR={1,0,0}, + TEvaLvgMin=276.15, + TEvaLvgMax=288.15, + TConEnt_nominal=310.15, + TConEntMin=303.15, + TConEntMax=333.15) + "Chiller performance data" + annotation (choicesAllMatching=true, + Placement(transformation(extent={{-100,82},{-80,102}}))); + Buildings.Fluid.FixedResistances.PressureDrop preDro1( redeclare package Medium = Medium2, final dp_nominal=dp_nominal/10, @@ -48,14 +70,6 @@ model ChillerAndTank rotation=0, origin={-110,100}))); - Buildings.Fluid.Storage.Plant.TemperatureSource ideTan( - redeclare package Medium = Medium2, - final allowFlowReversal=true, - m_flow_nominal=mTan_flow_nominal, - p_nominal=p_CHWS_nominal, - T_a_nominal=T_CHWR_nominal, - T_b_nominal=T_CHWS_nominal) "Ideal tank" - annotation (Placement(transformation(extent={{-20,-80},{-40,-60}}))); Buildings.Fluid.Movers.FlowControlled_m_flow pum1( redeclare package Medium = Medium2, per(pressure(dp=dp_nominal*{2,1.2,0}, V_flow=mChi_flow_nominal/1.2*{0,1.2,2})), @@ -116,6 +130,7 @@ model ChillerAndTank redeclare package Medium = Medium2, use_inputFilter=true, y_start=0, + dpFixed_nominal=0.1*dp_nominal, l=1E-10, dpValve_nominal=1, m_flow_nominal=mChi_flow_nominal+mTan_flow_nominal) if allowRemoteCharging @@ -125,6 +140,7 @@ model ChillerAndTank redeclare package Medium = Medium2, use_inputFilter=true, y_start=0, + dpFixed_nominal=0.1*dp_nominal, l=1E-10, dpValve_nominal=1, m_flow_nominal=mTan_flow_nominal) if allowRemoteCharging @@ -140,10 +156,11 @@ model ChillerAndTank annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=90, origin={-50,90}))); - BaseClasses.FluidThrough pasVal1(redeclare package Medium = Medium2) + Buildings.Fluid.Storage.Plant.BaseClasses.FluidThrough pasVal1(redeclare + package Medium = Medium2) if not allowRemoteCharging "Replaces val1 when remote charging not allowed" annotation (Placement(transformation(extent={{60,-42},{40,-22}}))); - BaseClasses.SignalThrough pasSwiFloDirPum1 if not allowRemoteCharging + Buildings.Fluid.Storage.Plant.BaseClasses.SignalThrough pasSwiFloDirPum1 if not allowRemoteCharging "Replaces swiFloDirPum1 when remote charging not allowed" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, @@ -161,6 +178,8 @@ model ChillerAndTank final dp1_nominal=0, final dp2_nominal=0, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + p2_start=p_CHWS_nominal, + T2_start=T_CHWS_nominal, final per=perChi) "Water cooled chiller (ports indexed 1 are on condenser side)" annotation (Placement(transformation(extent={{-40,0},{-20,20}}))); @@ -173,43 +192,32 @@ model ChillerAndTank extent={{-10,-10},{10,10}}, rotation=0, origin={-90,10}))); - replaceable parameter Buildings.Fluid.Chillers.Data.ElectricEIR.Generic perChi( - QEva_flow_nominal=-1E6, - COP_nominal=3, - PLRMax=1, - PLRMinUnl=0.3, - PLRMin=0.3, - etaMotor=1, - mEva_flow_nominal=mChi_flow_nominal, - mCon_flow_nominal=mChi_flow_nominal*1.2, - TEvaLvg_nominal=280.15, - capFunT={1,0,0,0,0,0}, - EIRFunT={1,0,0,0,0,0}, - EIRFunPLR={1,0,0}, - TEvaLvgMin=276.15, - TEvaLvgMax=288.15, - TConEnt_nominal=310.15, - TConEntMin=303.15, - TConEntMax=333.15) - "Chiller performance data" - annotation (choicesAllMatching=true, - Placement(transformation(extent={{-100,82},{-80,102}}))); + Buildings.Fluid.Storage.Stratified tan( + redeclare package Medium = Medium2, + allowFlowReversal=true, + hTan=3, + dIns=0.3, + VTan=1, + nSeg=7, + show_T=true, + m_flow_nominal=mTan_flow_nominal, + p_start=p_CHWS_nominal, + T_start=T_CHWS_nominal, + TFlu_start=linspace( + T_CHWR_nominal, + T_CHWS_nominal, + tan.nSeg)) "Tank" + annotation (Placement(transformation(extent={{-20,-80},{-40,-60}}))); + Modelica.Fluid.Sensors.MassFlowRate sen_m_flow(redeclare package Medium = Medium2, final + allowFlowReversal=true) "Flow rate sensor" + annotation (Placement(transformation(extent={{20,-80},{0,-60}}))); equation - connect(ideTan.port_b, preDro2.port_a) - annotation (Line(points={{-40,-70},{-60,-70}}, - color={0,127,255})); - connect(ideTan.m_flow,mTan_flow) annotation (Line(points={{-24,-59},{-24,-50}, - {-10,-50},{-10,-110}}, color={0,0,127})); connect(pum2Con.yVal2, val2.y) annotation (Line(points={{62,78.9},{62,78.9},{ 62,34},{36,34},{36,-50},{50,-50},{50,-58}}, color={0,0,127})); connect(pum2Con.yVal1, val1.y) annotation (Line(points={{66,78.9},{66,78.9},{ 66,26},{50,26},{50,2}}, color={0,0,127})); - connect(pum2Con.um_mTan_flow, ideTan.m_flow) annotation (Line(points={{81,99.8}, - {86,99.8},{86,108},{46,108},{46,40},{-10,40},{-10,-50},{-24,-50},{-24, - -59}}, - color={0,0,127})); connect(pum2Con.us_mTan_flow, set_mTan_flow) annotation (Line(points={{81,95.4}, {90,95.4},{90,118},{80,118},{80,130}}, color={0,0,127})); @@ -248,8 +256,6 @@ equation annotation (Line(points={{20,-10},{40,-10}}, color={0,127,255})); connect(pasVal1.port_b, pum1.port_a) annotation (Line(points={{40,-32},{30, -32},{30,-10},{20,-10}}, color={0,127,255})); - connect(pum1.port_a, ideTan.port_a) annotation (Line(points={{20,-10},{30,-10}, - {30,-70},{-20,-70}}, color={0,127,255})); connect(val2.port_a, pum1.port_a) annotation (Line(points={{40,-70},{30,-70}, {30,-10},{20,-10}}, color={0,127,255})); connect(pum2Con.booOnOff, booOnOff) annotation (Line(points={{82,82.2},{82,82}, @@ -274,6 +280,17 @@ equation {42,-3},{42,30},{54,30},{54,99.8},{59,99.8}}, color={0,0,127})); connect(val2.y_actual, pum2Con.yVal2_actual) annotation (Line(points={{55,-63}, {60,-63},{60,-44},{96,-44},{96,8},{59,8},{59,95.4}}, color={0,0,127})); + connect(sen_m_flow.m_flow, mTan_flow) annotation (Line(points={{10,-59},{10, + -56},{-10,-56},{-10,-110}}, color={0,0,127})); + connect(sen_m_flow.m_flow, pum2Con.um_mTan_flow) annotation (Line(points={{10, + -59},{10,-56},{-10,-56},{-10,64},{50,64},{50,108},{88,108},{88,99.8}, + {81,99.8}}, color={0,0,127})); + connect(preDro2.port_a, tan.port_b) + annotation (Line(points={{-60,-70},{-40,-70}}, color={0,127,255})); + connect(sen_m_flow.port_a, pum1.port_a) annotation (Line(points={{20,-70},{30, + -70},{30,-10},{20,-10}}, color={0,127,255})); + connect(sen_m_flow.port_b, tan.port_a) + annotation (Line(points={{0,-70},{-20,-70}}, color={0,127,255})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,100}}), graphics={Line( points={{-30,-110},{30,-110}}, diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index 5f30c4c9713..137070e91e9 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -283,7 +283,7 @@ equation connect(hysCat.y, cat.booOnOff) annotation (Line(points={{-2,-110},{-44,-110}, {-44,-48},{-50,-48}}, color={255,0,255})); connect(set_mChi2Pum1_flow.y, cat.set_mPum1_flow) annotation (Line(points={{-119, - -70},{-76,-70},{-76,-49},{-70,-49}}, color={0,0,127})); + -70},{-80,-70},{-80,-49},{-70,-49}}, color={0,0,127})); connect(preDroChi1.port_b, chi1.port_a) annotation (Line(points={{-70,40},{-80,40},{-80,50}}, color={0,127,255})); connect(chi1.port_b, pumChi1.port_a) From 67d4c3e3b0c8ad1a63fc9eeb967c8aa9fe8fbcb9 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Thu, 17 Feb 2022 14:04:31 -0800 Subject: [PATCH 034/463] replaced ideal chill with chiller model --- .../Fluid/Storage/Plant/ChillerAndTank.mo | 7 +- .../Plant/Examples/OneSourceOneUser.mo | 2 +- .../Plant/Examples/TwoSourcesThreeUsers.mo | 87 ++++++++++---- .../Fluid/Storage/Plant/TemperatureSource.mo | 111 ------------------ Buildings/Fluid/Storage/Plant/package.order | 1 - 5 files changed, 67 insertions(+), 141 deletions(-) delete mode 100644 Buildings/Fluid/Storage/Plant/TemperatureSource.mo diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo index 815a1e24a3b..2257596d7bf 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo @@ -194,7 +194,7 @@ model ChillerAndTank origin={-90,10}))); Buildings.Fluid.Storage.Stratified tan( redeclare package Medium = Medium2, - allowFlowReversal=true, + final allowFlowReversal=true, hTan=3, dIns=0.3, VTan=1, @@ -208,8 +208,9 @@ model ChillerAndTank T_CHWS_nominal, tan.nSeg)) "Tank" annotation (Placement(transformation(extent={{-20,-80},{-40,-60}}))); - Modelica.Fluid.Sensors.MassFlowRate sen_m_flow(redeclare package Medium = Medium2, final - allowFlowReversal=true) "Flow rate sensor" + Modelica.Fluid.Sensors.MassFlowRate sen_m_flow( + redeclare package Medium = Medium2, + final allowFlowReversal=true) "Flow rate sensor" annotation (Placement(transformation(extent={{20,-80},{0,-60}}))); equation connect(pum2Con.yVal2, val2.y) annotation (Line(points={{62,78.9},{62,78.9},{ diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo index d46fadaa1cf..f55bffa3941 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo @@ -153,7 +153,7 @@ equation connect(hysPum1.y, booToReaPum1.u) annotation (Line(points={{38,-70},{2,-70}}, color={255,0,255})); connect(booToReaPum1.y, cat.set_mPum1_flow) - annotation (Line(points={{-22,-70},{-30,-70},{-30,9},{-39,9}}, + annotation (Line(points={{-22,-70},{-30,-70},{-30,10},{-39,10}}, color={0,0,127})); connect(hysPum1.u,usr. yVal_actual) annotation (Line(points={{62,-70},{68,-70}, {68,-4},{43,-4},{43,-9}}, diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index 137070e91e9..f64569528ad 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -24,17 +24,6 @@ model TwoSourcesThreeUsers parameter Modelica.Units.SI.Power QCooLoa_flow_nominal=5*4200*1.01 "Nominal cooling load of one consumer"; - Buildings.Fluid.Storage.Plant.TemperatureSource chi1( - redeclare final package Medium = Medium2, - allowFlowReversal=true, - m_flow_nominal=1.5*m_flow_nominal, - p_nominal=p_CHWR_nominal, - T_a_nominal=T_CHWR_nominal, - T_b_nominal=T_CHWS_nominal) "Dummy chill source as chiller 1" annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=90, - origin={-80,60}))); Buildings.Fluid.Storage.Plant.ChillerAndTank cat( redeclare final package Medium1 = Medium1, redeclare final package Medium2 = Medium2, @@ -123,7 +112,7 @@ model TwoSourcesThreeUsers nPorts=1) "Pressurisation point" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-110,40}))); + origin={-170,40}))); Buildings.Fluid.FixedResistances.PressureDrop preDroChi1( redeclare package Medium = Medium2, final allowFlowReversal=allowFlowReversal, @@ -251,21 +240,62 @@ model TwoSourcesThreeUsers extent={{-10,-10},{10,10}}, rotation=0, origin={-170,-10}))); - Buildings.Fluid.Sources.MassFlowSource_T souCDW( + Buildings.Fluid.Sources.MassFlowSource_T souCDW2( redeclare package Medium = Medium1, m_flow=1, T=305.15, nPorts=1) "Source representing CDW supply line" annotation (Placement(transformation(extent={{-108,-50},{-88,-30}}))); - Buildings.Fluid.Sources.Boundary_pT sinCDW( + Buildings.Fluid.Sources.Boundary_pT sinCDW2( redeclare final package Medium = Medium1, final p=300000, final T=310.15, - nPorts=1) "Sink representing CDW return line" annotation ( - Placement(transformation( + nPorts=1) "Sink representing CDW return line" annotation (Placement( + transformation( extent={{10,10},{-10,-10}}, rotation=180, origin={-100,-100}))); + Buildings.Fluid.Chillers.ElectricEIR chi1( + redeclare final package Medium1 = Medium1, + redeclare final package Medium2 = Medium2, + m1_flow_nominal=1.2*chi1.m2_flow_nominal, + m2_flow_nominal=1.5*m_flow_nominal, + final dp1_nominal=0, + final dp2_nominal=0, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + p2_start=p_CHWS_nominal, + T2_start=T_CHWS_nominal, + final per=cat.perChi) + "Placeholder chiller" annotation ( + Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=90, + origin={-110,60}))); + Buildings.Fluid.Sources.MassFlowSource_T souCDW1( + redeclare package Medium = Medium1, + m_flow=1, + T=305.15, + nPorts=1) "Source representing CDW supply line" + annotation (Placement(transformation(extent={{-160,100},{-140,120}}))); + Buildings.Fluid.Sources.Boundary_pT sinCDW1( + redeclare final package Medium = Medium1, + final p=300000, + final T=310.15, + nPorts=1) "Sink representing CDW return line" annotation (Placement( + transformation( + extent={{10,10},{-10,-10}}, + rotation=180, + origin={-150,70}))); + Modelica.Blocks.Sources.Constant set_TEvaLvg_chi1(k=T_CHWS_nominal) + "Constant setpoint" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-90,150}))); + Buildings.Controls.OBC.CDL.Logical.Sources.Constant chi1On(k=true) + "Placeholder, chi1 always on" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-120,150}))); equation connect(set_TRet.y,usr1. TSet) annotation (Line(points={{41,110},{44,110},{44, 82},{65,82},{65,71}}, color={0,0,127})); @@ -284,12 +314,8 @@ equation {-44,-48},{-50,-48}}, color={255,0,255})); connect(set_mChi2Pum1_flow.y, cat.set_mPum1_flow) annotation (Line(points={{-119, -70},{-80,-70},{-80,-49},{-70,-49}}, color={0,0,127})); - connect(preDroChi1.port_b, chi1.port_a) - annotation (Line(points={{-70,40},{-80,40},{-80,50}}, color={0,127,255})); - connect(chi1.port_b, pumChi1.port_a) - annotation (Line(points={{-80,70},{-80,80},{-70,80}}, color={0,127,255})); connect(sou_p.ports[1], preDroChi1.port_b) - annotation (Line(points={{-100,40},{-70,40}}, color={0,127,255})); + annotation (Line(points={{-160,40},{-70,40}}, color={0,127,255})); connect(set_dpUsr.y, conPI_PumChi1.u_s) annotation (Line(points={{-60,139},{-60,122}}, color={0,0,127})); connect(conPI_PumChi1.y, pumChi1.y) @@ -353,19 +379,30 @@ equation annotation (Line(points={{-159,-10},{-122,-10}}, color={255,0,255})); connect(swiTanCha.y, cat.set_mTan_flow) annotation (Line(points={{-98,-10},{-62, -10},{-62,-49}}, color={0,0,127})); - connect(sinCDW.ports[1], cat.port_b1) annotation (Line(points={{-90,-100},{ - -66,-100},{-66,-70}}, - color={0,127,255})); + connect(sinCDW2.ports[1], cat.port_b1) annotation (Line(points={{-90,-100},{-66, + -100},{-66,-70}}, color={0,127,255})); connect(cat.port_a2, preDroU3S2.port_b) annotation (Line(points={{-54,-70},{-54, -80},{10,-80}}, color={0,127,255})); connect(cat.port_a2, preDroU2S2.port_b) annotation (Line(points={{-54,-70},{-54, -80},{-4,-80},{-4,-20},{10,-20}}, color={0,127,255})); - connect(cat.port_a1, souCDW.ports[1]) annotation (Line(points={{-66,-50},{-66, + connect(cat.port_a1, souCDW2.ports[1]) annotation (Line(points={{-66,-50},{-66, -40},{-88,-40}}, color={0,127,255})); connect(cat.port_b2, preDroS2U3.port_a) annotation (Line(points={{-54,-50},{-54, -40},{-30,-40}}, color={0,127,255})); connect(cat.port_b2, preDroS2U2.port_a) annotation (Line(points={{-54,-50},{-54, -40},{-36,-40},{-36,0},{-30,0}}, color={0,127,255})); + connect(preDroChi1.port_b, chi1.port_a2) annotation (Line(points={{-70,40},{ + -104,40},{-104,50}}, color={0,127,255})); + connect(chi1.port_b2, pumChi1.port_a) annotation (Line(points={{-104,70},{ + -104,80},{-70,80}}, color={0,127,255})); + connect(chi1.port_a1, souCDW1.ports[1]) annotation (Line(points={{-116,70},{ + -134,70},{-134,110},{-140,110}}, color={0,127,255})); + connect(sinCDW1.ports[1], chi1.port_b1) annotation (Line(points={{-140,70},{ + -140,44},{-116,44},{-116,50}}, color={0,127,255})); + connect(set_TEvaLvg_chi1.y, chi1.TSet) annotation (Line(points={{-90,139},{ + -90,82},{-107,82},{-107,72}}, color={0,0,127})); + connect(chi1On.y, chi1.on) annotation (Line(points={{-120,138},{-120,78},{ + -113,78},{-113,72}}, color={255,0,255})); annotation (experiment(Tolerance=1e-06, StopTime=3600,__Dymola_Algorithm="Dassl"), Diagram(coordinateSystem(extent={{-180,-140},{140,180}})), Icon( coordinateSystem(extent={{-100,-100},{100,100}}))); diff --git a/Buildings/Fluid/Storage/Plant/TemperatureSource.mo b/Buildings/Fluid/Storage/Plant/TemperatureSource.mo deleted file mode 100644 index 19c7f859e3c..00000000000 --- a/Buildings/Fluid/Storage/Plant/TemperatureSource.mo +++ /dev/null @@ -1,111 +0,0 @@ -within Buildings.Fluid.Storage.Plant; -model TemperatureSource - "An ideal source that sets fluid temperature to the prescribed value" - - replaceable package Medium = - Modelica.Media.Interfaces.PartialMedium "Medium in the component"; - - parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=1 - "Nominal mass flow rate"; - parameter Modelica.Units.SI.AbsolutePressure p_nominal=800000 - "Nominal pressure"; - parameter Modelica.Units.SI.Temperature T_a_nominal=12+273.15 - "Nominal temperature at port_a"; - parameter Modelica.Units.SI.Temperature T_b_nominal=7+273.15 - "Nominal temperature at port_b"; - parameter Boolean allowFlowReversal=false - "Flow reversal setting"; - - Buildings.Fluid.Sensors.TemperatureTwoPort T_a( - redeclare package Medium = Medium, - allowFlowReversal=allowFlowReversal, - m_flow_nominal=m_flow_nominal, - T_start=T_a_nominal, - tauHeaTra=1) "Temperature sensor to port_a" - annotation (Placement(transformation(extent={{-40,-10},{-20,10}}))); - Buildings.Fluid.Sensors.TemperatureTwoPort T_b( - redeclare package Medium = Medium, - allowFlowReversal=allowFlowReversal, - m_flow_nominal=m_flow_nominal, - T_start=T_b_nominal, - tauHeaTra=1) "Temperature sensor to port_b" - annotation (Placement(transformation(extent={{20,-10},{40,10}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_a( - p(start=p_nominal), - redeclare package Medium = Medium, - h_outflow(start=Medium.h_default, nominal=Medium.h_default)) - "Fluid connector a (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{-110,-10},{-90,10}}), - iconTransformation(extent={{-110,-10},{-90,10}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b( - p(start=p_nominal), - redeclare package Medium = Medium, - h_outflow(start=Medium.h_default, nominal=Medium.h_default)) - "Fluid connector b (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{110,-10},{90,10}}), - iconTransformation(extent={{110,-10},{90,10}}))); - Buildings.Fluid.Sensors.MassFlowRate mVol_flow( - redeclare package Medium = Medium, - final allowFlowReversal=true) "Flow rate sensor" - annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); - Modelica.Blocks.Interfaces.RealOutput m_flow "Mass flow rate" annotation ( - Dialog(group="Time varying output signal"), Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=90, - origin={-70,110}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=90, - origin={-60,110}))); - Buildings.Fluid.Sources.PropertySource_T proSouT( - redeclare package Medium = Medium, - final use_T_in=true, - final allowFlowReversal=allowFlowReversal) - "Property source that prescribes the temperature" - annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - Modelica.Blocks.Sources.RealExpression setT( - y(final unit="K", final displayUnit="degC")= - if m_flow<0 and allowFlowReversal then - 12+273.15 - else - 7+273.15) "Set temperature" - annotation (Placement(transformation(extent={{-40,30},{-20,50}}))); -equation - connect(T_b.port_b, port_b) - annotation (Line(points={{40,0},{100,0}}, color={0,127,255})); - connect(T_a.port_a, mVol_flow.port_b) - annotation (Line(points={{-40,0},{-60,0}}, color={0,127,255})); - connect(mVol_flow.port_a, port_a) - annotation (Line(points={{-80,0},{-100,0}}, color={0,127,255})); - connect(mVol_flow.m_flow, m_flow) - annotation (Line(points={{-70,11},{-70,110}}, color={0,0,127})); - connect(T_a.port_b, proSouT.port_a) - annotation (Line(points={{-20,0},{-10,0}}, color={0,127,255})); - connect(proSouT.port_b, T_b.port_a) - annotation (Line(points={{10,0},{20,0}}, color={0,127,255})); - connect(setT.y, proSouT.T_in) - annotation (Line(points={{-19,40},{-4,40},{-4,12}}, color={0,0,127})); -annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={Ellipse( - extent={{-100,100},{100,-100}}, - lineColor={28,108,200}, - fillPattern=FillPattern.Sphere, - fillColor={28,108,200}), Text( - extent={{-80,80},{80,-80}}, - textColor={255,255,255}, - textString="T", - textStyle={TextStyle.Bold}), - Polygon( - points={{20,-104},{60,-119},{20,-134},{20,-104}}, - lineColor={0,128,255}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid, - visible=not allowFlowReversal), - Line( - points={{55,-119},{-60,-119}}, - color={0,128,255}, - visible=not allowFlowReversal), - Text( - extent={{-74,-130},{80,-172}}, - textColor={0,0,255}, - textString="%name")}), Diagram( - coordinateSystem(preserveAspectRatio=false))); -end TemperatureSource; diff --git a/Buildings/Fluid/Storage/Plant/package.order b/Buildings/Fluid/Storage/Plant/package.order index 64b608cc56b..27d0441d404 100644 --- a/Buildings/Fluid/Storage/Plant/package.order +++ b/Buildings/Fluid/Storage/Plant/package.order @@ -1,5 +1,4 @@ ChillerAndTank -TemperatureSource Examples Validation BaseClasses From 1563aa6afaba1e402c9e78767cb5d1be2f5fbb93 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Thu, 17 Feb 2022 16:27:13 -0800 Subject: [PATCH 035/463] corrected valve parameterisation --- Buildings/Fluid/Storage/Plant/ChillerAndTank.mo | 10 ++++------ .../Storage/Plant/Examples/BaseClasses/DummyUser.mo | 4 ++-- .../Storage/Plant/Examples/TwoSourcesThreeUsers.mo | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo index 2257596d7bf..53228f3498b 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo @@ -130,19 +130,17 @@ model ChillerAndTank redeclare package Medium = Medium2, use_inputFilter=true, y_start=0, - dpFixed_nominal=0.1*dp_nominal, l=1E-10, - dpValve_nominal=1, - m_flow_nominal=mChi_flow_nominal+mTan_flow_nominal) if allowRemoteCharging + dpValve_nominal=6000, + m_flow_nominal=m2_flow_nominal) if allowRemoteCharging "Valve in series to the pump (normal direction)" annotation (Placement(transformation(extent={{60,-20},{40,0}}))); Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage val2( redeclare package Medium = Medium2, use_inputFilter=true, y_start=0, - dpFixed_nominal=0.1*dp_nominal, l=1E-10, - dpValve_nominal=1, + dpValve_nominal=6000, m_flow_nominal=mTan_flow_nominal) if allowRemoteCharging "Valve in parallel to the secondary pump (reverse direction)" annotation (Placement(transformation(extent={{40,-80},{60,-60}}))); @@ -157,7 +155,7 @@ model ChillerAndTank rotation=90, origin={-50,90}))); Buildings.Fluid.Storage.Plant.BaseClasses.FluidThrough pasVal1(redeclare - package Medium = Medium2) + package Medium = Medium2) if not allowRemoteCharging "Replaces val1 when remote charging not allowed" annotation (Placement(transformation(extent={{60,-42},{40,-22}}))); Buildings.Fluid.Storage.Plant.BaseClasses.SignalThrough pasSwiFloDirPum1 if not allowRemoteCharging diff --git a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo index c924f6e4b76..4e26a8b6af7 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo @@ -25,7 +25,7 @@ the consumer control valve simply tracks the return CHW temperature. redeclare package Medium = Medium, use_inputFilter=false, l=1E-10, - dpValve_nominal=1, + dpValve_nominal=6000, m_flow_nominal=m_flow_nominal, y_start=0) "User control valve" annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); @@ -39,7 +39,7 @@ the consumer control valve simply tracks the return CHW temperature. energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, m_flow_nominal=m_flow_nominal, allowFlowReversal=true, - V=1, + V=0.5, p_start=p_a_nominal, T_start=T_b_nominal) "Volume representing the consumer" annotation ( diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index f64569528ad..f725f01ae31 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -21,7 +21,7 @@ model TwoSourcesThreeUsers "Nominal temperature of CHW supply"; parameter Boolean allowFlowReversal=false "Flow reversal setting"; - parameter Modelica.Units.SI.Power QCooLoa_flow_nominal=5*4200*1.01 + parameter Modelica.Units.SI.Power QCooLoa_flow_nominal=5*4200*0.85 "Nominal cooling load of one consumer"; Buildings.Fluid.Storage.Plant.ChillerAndTank cat( From 5deadb6c6278b0330e4b712814cd9447e70a1066 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Fri, 18 Feb 2022 07:43:14 -0800 Subject: [PATCH 036/463] corrected val2 reverse acting setting --- .../Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo index fd2cb4cf40e..9e2076f1c16 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo @@ -25,7 +25,7 @@ block ReversiblePumpValveControl Td=1, k=5, Ti=50, - reverseActing=true) + reverseActing=false) "PI controller for val2" annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=270, From 69a065e5242a5844e091cf1e24c357aed5edb908 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Fri, 18 Feb 2022 08:25:49 -0800 Subject: [PATCH 037/463] documentation and unit test OneSourceOneUser --- .../Fluid/Storage/Plant/ChillerAndTank.mo | 47 +++++----- .../Plant/Examples/BaseClasses/DummyUser.mo | 8 +- .../Plant/Examples/OneSourceOneUser.mo | 89 ++++++++++--------- ...torage_Plant_Examples_OneSourceOneUser.txt | 18 ++++ .../Plant/Examples/OneSourceOneUser.mos | 24 +++++ ...torage.Plant.Examples.OneSourceOneUser.mos | 7 ++ 6 files changed, 122 insertions(+), 71 deletions(-) create mode 100644 Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_OneSourceOneUser.txt create mode 100644 Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos create mode 100644 Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.OneSourceOneUser.mos diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo index 53228f3498b..a02421fe1ee 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo @@ -103,9 +103,8 @@ model ChillerAndTank rotation=0, origin={80,-20}))); - Buildings.Fluid.Storage.Plant.BaseClasses.ReversiblePumpValveControl pum2Con - if allowRemoteCharging - "Control block for secondary pump-valve group" + Buildings.Fluid.Storage.Plant.BaseClasses.ReversiblePumpValveControl conPum2Gro + if allowRemoteCharging "Control block for secondary pump-valve group" annotation (Placement(transformation(extent={{80,80},{60,102}}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanInput booOnOff if allowRemoteCharging @@ -211,20 +210,17 @@ model ChillerAndTank final allowFlowReversal=true) "Flow rate sensor" annotation (Placement(transformation(extent={{20,-80},{0,-60}}))); equation - connect(pum2Con.yVal2, val2.y) annotation (Line(points={{62,78.9},{62,78.9},{ - 62,34},{36,34},{36,-50},{50,-50},{50,-58}}, - color={0,0,127})); - connect(pum2Con.yVal1, val1.y) annotation (Line(points={{66,78.9},{66,78.9},{ - 66,26},{50,26},{50,2}}, - color={0,0,127})); - connect(pum2Con.us_mTan_flow, set_mTan_flow) annotation (Line(points={{81,95.4}, - {90,95.4},{90,118},{80,118},{80,130}}, - color={0,0,127})); + connect(conPum2Gro.yVal2, val2.y) annotation (Line(points={{62,78.9},{62,78.9}, + {62,34},{36,34},{36,-50},{50,-50},{50,-58}}, color={0,0,127})); + connect(conPum2Gro.yVal1, val1.y) annotation (Line(points={{66,78.9},{66,78.9}, + {66,26},{50,26},{50,2}}, color={0,0,127})); + connect(conPum2Gro.us_mTan_flow, set_mTan_flow) annotation (Line(points={{81, + 95.4},{90,95.4},{90,118},{80,118},{80,130}}, color={0,0,127})); connect(pum2.port_b, val1.port_a) annotation (Line(points={{70,-20},{66,-20},{66,-10},{60,-10}}, color={0,127,255})); - connect(pum2.y, pum2Con.yPum2) annotation (Line(points={{80,-8},{80,20},{70, - 20},{70,78.9}}, color={0,0,127})); + connect(pum2.y, conPum2Gro.yPum2) annotation (Line(points={{80,-8},{80,20},{ + 70,20},{70,78.9}}, color={0,0,127})); connect(swiFloDirPum1.u2, booFloDir) annotation (Line(points={{-10,102},{-10,112}, {96,112},{96,100},{110,100}}, color={255,0,255})); connect(swiFloDirPum1.u1, set_mPum1_flow) annotation (Line(points={{-2,102},{-2, @@ -257,10 +253,10 @@ equation -32},{30,-10},{20,-10}}, color={0,127,255})); connect(val2.port_a, pum1.port_a) annotation (Line(points={{40,-70},{30,-70}, {30,-10},{20,-10}}, color={0,127,255})); - connect(pum2Con.booOnOff, booOnOff) annotation (Line(points={{82,82.2},{82,82}, - {96,82},{96,80},{110,80}}, color={255,0,255})); - connect(pum2Con.booFloDir, booFloDir) annotation (Line(points={{82,86.6},{82, - 86},{96,86},{96,100},{110,100}}, color={255,0,255})); + connect(conPum2Gro.booOnOff, booOnOff) annotation (Line(points={{82,82.2},{82, + 82},{96,82},{96,80},{110,80}}, color={255,0,255})); + connect(conPum2Gro.booFloDir, booFloDir) annotation (Line(points={{82,86.6},{ + 82,86},{96,86},{96,100},{110,100}}, color={255,0,255})); connect(preDro1.port_a, chi.port_b2) annotation (Line(points={{-60,-10},{-60,-6}, {-40,-6},{-40,4}}, color={0,127,255})); connect(pum1.port_b, chi.port_a2) annotation (Line(points={{0,-10},{-14,-10},{ @@ -275,15 +271,16 @@ equation 60},{-100,60}}, color={0,127,255})); connect(chi.port_b1, port_b1) annotation (Line(points={{-20,16},{-16,16},{-16, 60},{100,60}}, color={0,127,255})); - connect(val1.y_actual, pum2Con.yVal1_actual) annotation (Line(points={{45,-3}, - {42,-3},{42,30},{54,30},{54,99.8},{59,99.8}}, color={0,0,127})); - connect(val2.y_actual, pum2Con.yVal2_actual) annotation (Line(points={{55,-63}, - {60,-63},{60,-44},{96,-44},{96,8},{59,8},{59,95.4}}, color={0,0,127})); + connect(val1.y_actual, conPum2Gro.yVal1_actual) annotation (Line(points={{45, + -3},{42,-3},{42,30},{54,30},{54,99.8},{59,99.8}}, color={0,0,127})); + connect(val2.y_actual, conPum2Gro.yVal2_actual) annotation (Line(points={{55, + -63},{60,-63},{60,-44},{96,-44},{96,8},{59,8},{59,95.4}}, color={0,0, + 127})); connect(sen_m_flow.m_flow, mTan_flow) annotation (Line(points={{10,-59},{10, -56},{-10,-56},{-10,-110}}, color={0,0,127})); - connect(sen_m_flow.m_flow, pum2Con.um_mTan_flow) annotation (Line(points={{10, - -59},{10,-56},{-10,-56},{-10,64},{50,64},{50,108},{88,108},{88,99.8}, - {81,99.8}}, color={0,0,127})); + connect(sen_m_flow.m_flow, conPum2Gro.um_mTan_flow) annotation (Line(points={ + {10,-59},{10,-56},{-10,-56},{-10,64},{50,64},{50,108},{88,108},{88, + 99.8},{81,99.8}}, color={0,0,127})); connect(preDro2.port_a, tan.port_b) annotation (Line(points={{-60,-70},{-40,-70}}, color={0,127,255})); connect(sen_m_flow.port_a, pum1.port_a) annotation (Line(points={{20,-70},{30, diff --git a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo index 4e26a8b6af7..ba9de048dad 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo @@ -91,7 +91,7 @@ the consumer control valve simply tracks the return CHW temperature. origin={-110,80}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-110,90}))); + origin={-110,80}))); Modelica.Blocks.Interfaces.RealInput TSet "CHW return setpoint" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, @@ -99,7 +99,7 @@ the consumer control valve simply tracks the return CHW temperature. origin={-110,60}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-110,50}))); + origin={-110,40}))); Modelica.Blocks.Interfaces.RealOutput yVal_actual "Consumer control valve actuator position" annotation (Placement( transformation( @@ -108,7 +108,7 @@ the consumer control valve simply tracks the return CHW temperature. origin={110,40}), iconTransformation( extent={{10,-10},{-10,10}}, rotation=-90, - origin={-70,110}))); + origin={-60,110}))); Buildings.Fluid.Sensors.RelativePressure dpSen(redeclare package Medium = Medium) "Differential pressure sensor" annotation (Placement(transformation(extent={{-10,-60},{10,-40}}))); @@ -120,7 +120,7 @@ the consumer control valve simply tracks the return CHW temperature. origin={110,-80}), iconTransformation( extent={{10,-10},{-10,10}}, rotation=-90, - origin={-30,110}))); + origin={-20,110}))); equation connect(val.port_b, vol.ports[1]) annotation (Line(points={{-60,0},{1,0}}, color={0,127,255})); diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo index f55bffa3941..003abeeb903 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo @@ -1,18 +1,5 @@ within Buildings.Fluid.Storage.Plant.Examples; -model OneSourceOneUser "(Draft) District system with one source and one user" -/* -- Controls - - Primary pump: - Tracks consumer control valve position con.yVal, - closes at y.Val < 0.05, - reopens at y.Val > 0.5. - Secondary pump: - Maintains constant consumer pressure head con.dp. -- Pressure - - Assuming the plant takes 10% of total pressure head, - supply and return pipes 30% each, - consumer 30%. -*/ +model OneSourceOneUser "(Draft) Simple system model with one source and one user" extends Modelica.Icons.Example; package Medium1 = Buildings.Media.Water "Medium model for CDW"; @@ -33,7 +20,7 @@ model OneSourceOneUser "(Draft) District system with one source and one user" "Nominal temperature of CHW supply"; parameter Boolean allowFlowReversal=false "Flow reversal setting"; - parameter Modelica.Units.SI.Power QCooLoa_flow_nominal=5*4200*1.01 + parameter Modelica.Units.SI.Power QCooLoa_flow_nominal=5*4200*0.9 "Nominal cooling load of one consumer"; Buildings.Fluid.Storage.Plant.ChillerAndTank cat( @@ -85,8 +72,8 @@ model OneSourceOneUser "(Draft) District system with one source and one user" final dp_nominal=dp_nominal*0.3, final m_flow_nominal=m_flow_nominal) "Flow resistance of the consumer" annotation (Placement(transformation(extent={{10,-50},{-10,-30}}))); - Modelica.Blocks.Sources.Constant set_dpCon(k=1) - "Normalised consumer differential pressure setpoint" + Modelica.Blocks.Sources.Constant set_dpUsr(k=1) + "Normalised differential pressure setpoint of the user" annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=-90, origin={-50,70}))); @@ -103,18 +90,6 @@ model OneSourceOneUser "(Draft) District system with one source and one user" extent={{-10,-10},{10,10}}, rotation=270, origin={-20,70}))); - Buildings.Controls.OBC.CDL.Continuous.Hysteresis hysPum1(uLow=0.05, uHigh=0.5) - "Primary pump shuts off at con.yVal = 0.05 and restarts at 0.5" annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=180, - origin={50,-70}))); - Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToReaPum1(realTrue= - m_flow_nominal/2) "Primary pump signal" annotation (Placement( - transformation( - extent={{10,-10},{-10,10}}, - rotation=0, - origin={-10,-70}))); Buildings.Fluid.Sources.MassFlowSource_T souCDW( redeclare package Medium = Medium1, m_flow=1, @@ -130,12 +105,15 @@ model OneSourceOneUser "(Draft) District system with one source and one user" extent={{10,10},{-10,-10}}, rotation=180, origin={-90,20}))); + Modelica.Blocks.Sources.Constant set_mChi_flow(k=m_flow_nominal/2) + "Primary pump flow rate setpoint" + annotation (Placement(transformation(extent={{-60,-80},{-40,-60}}))); equation connect(set_TRet.y,usr. TSet) - annotation (Line(points={{21,30},{32,30},{32,-15},{39,-15}}, + annotation (Line(points={{21,30},{32,30},{32,-16},{39,-16}}, color={0,0,127})); connect(preQCooLoa_flow.y,usr. QCooLoa_flow) - annotation (Line(points={{21,60},{34,60},{34,-11},{39,-11}}, + annotation (Line(points={{21,60},{34,60},{34,-12},{39,-12}}, color={0,0,127})); connect(preDro1.port_b,usr. port_a) annotation (Line(points={{10,-20},{40,-20}}, @@ -143,21 +121,13 @@ equation connect(usr.port_b, preDro2.port_a) annotation (Line(points={{60,-20},{60,-40},{10,-40}}, color={0,127,255})); - connect(set_dpCon.y, conPI_pum2.u_s) + connect(set_dpUsr.y, conPI_pum2.u_s) annotation (Line(points={{-50,59},{-50,52}}, color={0,0,127})); - connect(usr.dp, gaiPum2.u) annotation (Line(points={{47,-9},{46,-9},{46,88},{-20, + connect(usr.dp, gaiPum2.u) annotation (Line(points={{48,-9},{48,-9},{48,88},{-20, 88},{-20,82}}, color={0,0,127})); connect(conPI_pum2.y, cat.yPum2) annotation (Line(points={{-50,29},{-50,20},{-42,20},{-42,11}}, color={0,0,127})); - connect(hysPum1.y, booToReaPum1.u) - annotation (Line(points={{38,-70},{2,-70}}, color={255,0,255})); - connect(booToReaPum1.y, cat.set_mPum1_flow) - annotation (Line(points={{-22,-70},{-30,-70},{-30,10},{-39,10}}, - color={0,0,127})); - connect(hysPum1.u,usr. yVal_actual) annotation (Line(points={{62,-70},{68,-70}, - {68,-4},{43,-4},{43,-9}}, - color={0,0,127})); connect(gaiPum2.y, conPI_pum2.u_m) annotation (Line(points={{-20,59},{-20,40},{-38,40}}, color={0,0,127})); connect(cat.port_b2, preDro1.port_a) annotation (Line(points={{-40,-6},{-16, @@ -170,5 +140,40 @@ equation {-74,20},{-80,20}}, color={0,127,255})); connect(cat.port_a1, souCDW.ports[1]) annotation (Line(points={{-40,6},{-34,6}, {-34,20},{-30,20}}, color={0,127,255})); - annotation(experiment(Tolerance=1e-06, StopTime=3600)); + connect(set_mChi_flow.y, cat.set_mPum1_flow) annotation (Line(points={{-39,-70}, + {-26,-70},{-26,10},{-39,10}}, color={0,0,127})); + annotation(__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos" + "Simulate and plot"), +experiment(Tolerance=1e-06, StopTime=3600), Documentation(info=" +

+(Draft) This is a simple system model with only one source and one user. +The source uses the plant model + +Buildings.Fluid.Storage.Plant.ChillerAndTank +which is configured here not to allow charging the tank remotely. +It is therefore equivalent to having the tank in place of the common pipe. +

+The primary and secondary pumps are controlled as such: +
    +
  • +The primary pump is set to a constant flow rate at all time. +
  • +
  • +The secondary pump is set to track the available head at the user. +
  • +
+

+Under these settings, the tank is charged whenever the chiller outputs more than +needed by the user and discharges whenever the chiller outputs less than needed. +The capacity of the tank is not considered. +

+", revisions=" +
    +
  • +February 18, 2022 by Hongxiang Fu:
    +First implementation. This is for +#2859. +
  • +
+")); end OneSourceOneUser; diff --git a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_OneSourceOneUser.txt b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_OneSourceOneUser.txt new file mode 100644 index 00000000000..fe05546e0da --- /dev/null +++ b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_OneSourceOneUser.txt @@ -0,0 +1,18 @@ +last-generated=2022-02-18 +statistics-initialization= +{ + "nonlinear": "1, 1", + "numerical Jacobians": "0" +} +statistics-simulation= +{ + "linear": "0", + "nonlinear": "1, 1", + "number of continuous time states": "18", + "numerical Jacobians": "0" +} +time=[0e+00, 3.6e+03] +cat.pum1.m_flow=[0e+00, 4.999552965164185e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01] +cat.mTan_flow=[0e+00, -4.999552965164185e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, 3.070253729820251e-01, 3.801476955413818e-01, 4.042422771453857e-01, 4.133095443248749e-01, 4.116810858249664e-01, 4.068382084369659e-01, 4.039308428764343e-01, 4.029046595096588e-01, 4.027837216854095e-01, 4.030833542346954e-01, 4.036327600479126e-01, 4.043649435043335e-01, 4.052524566650391e-01, 4.062803983688354e-01, 4.074440896511078e-01, 4.087449312210083e-01, 4.101872742176056e-01, 4.117770195007324e-01, 4.135231971740723e-01, 4.154362380504608e-01, 4.175280034542084e-01, 4.19810950756073e-01, 4.222981929779053e-01, 4.250039756298065e-01, 4.279427826404572e-01, 4.3112912774086e-01, 4.345769584178925e-01, 4.382987320423126e-01, 4.423046112060547e-01, 4.466004967689514e-01, 4.511853456497192e-01, 4.560467004776001e-01, 4.611557424068451e-01, -2.495844215154648e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01] +cat.pum2.m_flow=[0e+00, 2.685441527781159e-17, 2.846835714946586e-17, 2.968915331086347e-17, 3.060780024683016e-17, 3.129707330765835e-17, 3.181324393605879e-17, 3.219923949710053e-17, 3.248755826268956e-17, 3.270277411446361e-17, 3.286331001902545e-17, 3.298302952344148e-17, 3.30722988551482e-17, 3.313882402873216e-17, 3.318841846953839e-17, 3.322536697313991e-17, 3.325289885264813e-17, 3.327341624056189e-17, 3.328869261211452e-17, 3.33000779260657e-17, 3.33085647991505e-17, 3.331488115030795e-17, 3.331957953618725e-17, 3.332310001687428e-17, 3.332569736399769e-17, 3.332765612768822e-17, 3.332910203939896e-17, 3.333017737419528e-17, 3.333098801119558e-17, 3.333158358123662e-17, 3.33320302587674e-17, 3.333237105717977e-17, 3.333261921136354e-17, 3.33328011910983e-17, 8.070253729820251e-01, 8.801476955413818e-01, 9.042422771453857e-01, 9.133095741271973e-01, 9.11681056022644e-01, 9.068382382392883e-01, 9.039308428764343e-01, 9.029046297073364e-01, 9.027836918830872e-01, 9.030833840370178e-01, 9.036327600479126e-01, 9.043649435043335e-01, 9.052524566650391e-01, 9.062803983688354e-01, 9.074441194534302e-01, 9.087449312210083e-01, 9.101872444152832e-01, 9.117770195007324e-01, 9.135231971740723e-01, 9.154362678527832e-01, 9.175280332565308e-01, 9.19810950756073e-01, 9.222981929779053e-01, 9.250039458274841e-01, 9.279427528381348e-01, 9.311291575431824e-01, 9.345769286155701e-01, 9.382987022399902e-01, 9.423046112060547e-01, 9.466004967689514e-01, 9.511853456497192e-01, 9.560467004776001e-01, 9.611557126045227e-01, 2.504155933856964e-01, 4.018970826141172e-17, 3.840118495839447e-17, 3.709147680731476e-17, 3.612321557820713e-17, 3.540609961796041e-17, 3.487430520215007e-17, 3.447951174811321e-17, 3.418617695928966e-17, 3.396810237131863e-17, 3.380589225319698e-17, 3.368519667565814e-17, 3.359535162624508e-17, 3.352846911063649e-17, 3.34786662203159e-17, 3.344158205909392e-17, 3.341396084407955e-17, 3.339339051660658e-17, 3.337806782293965e-17, 3.336665934793132e-17, 3.335817247484653e-17, 3.335185281496662e-17, 3.334715112036487e-17, 3.334364387456765e-17, 3.334102336638708e-17, 3.333907122014145e-17, 3.333761207354091e-17, 3.333652350385479e-17, 3.333571286685449e-17, 3.333511067936855e-17, 3.333466069311532e-17, 3.33343232034254e-17, 3.333407174051918e-17, 3.333388314333952e-17] +usr.yVal_actual=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 5.981393730204358e-29, 9.361883059536155e-27, 1.084409862033361e-25, 2.619365550651089e-25, 3.747764761949902e-25, 5.952006312813308e-25, 1.146984231883947e-24, 2.270877518995943e-24, 3.095083337075383e-24, 3.40938228500967e-24, 3.977788910518523e-24, 4.668797142473205e-24, 4.863926620545053e-24, 4.875582829280599e-24, 5.181501116173044e-24, 5.432287492121403e-24, 5.377198968527104e-24, 5.399369509837888e-24, 5.572160024795688e-24, 5.614924963328625e-24, 5.552657805496815e-24, 5.601739942158761e-24, 5.675222729910551e-24, 5.6530269450508e-24, 5.607265123938929e-24, 5.496122116571888e-24, 5.367015563101606e-24, 5.371074646889421e-24, 5.481725010621152e-24, 8.00154447555542e-01, 9.586917757987976e-01, 9.685896039009094e-01, 9.215241670608521e-01, 8.659662008285522e-01, 8.281725645065308e-01, 8.080700635910034e-01, 7.975633144378662e-01, 7.917240858078003e-01, 7.884074449539185e-01, 7.866719961166382e-01, 7.860251069068909e-01, 7.861832976341248e-01, 7.869639992713928e-01, 7.882546782493591e-01, 7.899894714355469e-01, 7.921320199966431e-01, 7.946657538414001e-01, 7.975941896438599e-01, 8.009347915649414e-01, 8.047181963920593e-01, 8.089867234230042e-01, 8.137947916984558e-01, 8.192115426063538e-01, 8.253225088119507e-01, 8.322330117225647e-01, 8.4007328748703e-01, 8.490056395530701e-01, 8.592343926429749e-01, 8.710204362869263e-01, 8.847000002861023e-01, 9.00714635848999e-01, 9.196481704711914e-01, 2.209393084049225e-01, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos new file mode 100644 index 00000000000..e3a32069e13 --- /dev/null +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos @@ -0,0 +1,24 @@ +simulateModel("Buildings.Fluid.Storage.Plant.Examples.OneSourceOneUser", + stopTime=3600, + tolerance=1e-06, + method="dassl", + resultFile="OneSourceOneUser"); +// Plot commands +createPlot(id=1, + position={15, 15, 1027, 480}, + y={"cat.pum1.m_flow", "cat.mTan_flow", "cat.pum2.m_flow"}, + range={0.0, 3600.0, -1.0, 1.0}, + grid=true, + subPlot=101, + colors={{28,108,200}, {238,46,47}, {0,140,72}}, + timeUnit="s", + displayUnits={"kg/s", "kg/s", "kg/s"}); +createPlot(id=1, + position={15, 15, 1027, 480}, + y={"usr.yVal_actual"}, + range={0.0, 3600.0, -0.2, 1.2}, + autoscale=false, + grid=true, + subPlot=102, + colors={{28,108,200}}, + timeUnit="s"); diff --git a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.OneSourceOneUser.mos b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.OneSourceOneUser.mos new file mode 100644 index 00000000000..7bc7d9fb1a9 --- /dev/null +++ b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.OneSourceOneUser.mos @@ -0,0 +1,7 @@ +compareVars := + { + "cat.pum1.m_flow", + "cat.mTan_flow", + "cat.pum2.m_flow", + "usr.yVal_actual" + }; From f3d46d773b61c2338bcce3e279420135d10869e3 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Fri, 18 Feb 2022 08:48:54 -0800 Subject: [PATCH 038/463] documentation and unit test NoRemote --- .../ChillerAndTankNoRemoteCharging.mo | 42 +++++++++++++------ ...idation_ChillerAndTankNoRemoteCharging.txt | 17 ++++++++ .../ChillerAndTankNoRemoteCharging.mos | 15 +++++++ ...idation.ChillerAndTankNoRemoteCharging.mos | 6 +++ 4 files changed, 67 insertions(+), 13 deletions(-) create mode 100644 Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ChillerAndTankNoRemoteCharging.txt create mode 100644 Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mos create mode 100644 Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ChillerAndTankNoRemoteCharging.mos diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo index 99e9d178aba..9a884c460a3 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo @@ -1,5 +1,6 @@ within Buildings.Fluid.Storage.Plant.Validation; -model ChillerAndTankNoRemoteCharging "(Draft)" +model ChillerAndTankNoRemoteCharging + "(Draft) Validation model of the plant not allowing remote charging" extends Modelica.Icons.Example; package Medium1 = Buildings.Media.Water "Medium model"; @@ -48,7 +49,7 @@ model ChillerAndTankNoRemoteCharging "(Draft)" Modelica.Blocks.Sources.TimeTable set_mPum2_flow(table=[0,1; 900,1; 900,-1; 1800,-1; 1800,0; 2700,0; 2700,1; 3600,1]) "Secondary mass flow rate setpoint" - annotation (Placement(transformation(extent={{-100,60},{-80,80}}))); + annotation (Placement(transformation(extent={{-100,40},{-80,60}}))); Modelica.Blocks.Sources.Constant set_mPum1_flow(k=cat.m1_flow_nominal) "Primary pump mass flow rate setpoint" annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); @@ -59,20 +60,20 @@ model ChillerAndTankNoRemoteCharging "(Draft)" transformation( extent={{10,-10},{-10,10}}, rotation=180, - origin={-50,70}))); + origin={-50,50}))); Modelica.Blocks.Math.Gain gain2(k=1/cat.m2_flow_nominal) "Gain" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=180, - origin={-10,90}))); + origin={-10,70}))); Buildings.Fluid.Sources.MassFlowSource_T souCDW( redeclare package Medium = Medium1, m_flow=1, T=305.15, nPorts=1) "Source representing CDW supply line" annotation (Placement(transformation(extent={{-80,20},{-60,40}}))); - Buildings.Fluid.Sources.Boundary_pT sinCDW( + Buildings.Fluid.Sources.Boundary_pT sinCDW( redeclare final package Medium = Medium1, final p=300000, final T=310.15, @@ -84,16 +85,16 @@ model ChillerAndTankNoRemoteCharging "(Draft)" equation connect(gain2.y, conPID_Pum2.u_m) - annotation (Line(points={{-21,90},{-50,90},{-50,82}}, + annotation (Line(points={{-21,70},{-50,70},{-50,62}}, color={0,0,127})); - connect(cat.mTan_flow, gain2.u) annotation (Line(points={{11,-2},{14,-2},{14,90}, - {2,90}}, color={0,0,127})); + connect(cat.mTan_flow, gain2.u) annotation (Line(points={{11,-2},{16,-2},{16,70}, + {2,70}}, color={0,0,127})); connect(set_mPum2_flow.y, conPID_Pum2.u_s) - annotation (Line(points={{-79,70},{-62,70}}, color={0,0,127})); + annotation (Line(points={{-79,50},{-62,50}}, color={0,0,127})); connect(set_mPum1_flow.y, cat.set_mPum1_flow) annotation (Line(points={{-59,0}, - {-16,0},{-16,9},{-11,9}}, color={0,0,127})); + {-16,0},{-16,10},{-11,10}}, color={0,0,127})); connect(conPID_Pum2.y, cat.yPum2) - annotation (Line(points={{-39,70},{-8,70},{-8,11}}, color={0,0,127})); + annotation (Line(points={{-39,50},{-8,50},{-8,11}}, color={0,0,127})); connect(sin.ports[1], cat.port_b2) annotation (Line(points={{-60,-30},{-16, -30},{-16,-6},{-10,-6}}, color={0,127,255})); connect(sou.ports[1], cat.port_a2) annotation (Line(points={{60,-30},{16,-30}, @@ -102,8 +103,23 @@ equation 30},{-20,6},{-10,6}}, color={0,127,255})); connect(cat.port_b1, sinCDW.ports[1]) annotation (Line(points={{10,6},{54,6}, {54,30},{60,30}}, color={0,127,255})); - annotation ( + annotation (__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mos" + "Simulate and plot"), experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), - Icon(coordinateSystem(extent={{-100,-100},{100,100}}))); + Icon(coordinateSystem(extent={{-100,-100},{100,100}})), + Documentation(info=" +

+(Draft) This is a validation model where the plant is configured not to allow +remotely charging the tank. +

+", revisions=" +
    +
  • +February 18, 2022 by Hongxiang Fu:
    +First implementation. This is for +#2859. +
  • +
+")); end ChillerAndTankNoRemoteCharging; diff --git a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ChillerAndTankNoRemoteCharging.txt b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ChillerAndTankNoRemoteCharging.txt new file mode 100644 index 00000000000..5f858ad5628 --- /dev/null +++ b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ChillerAndTankNoRemoteCharging.txt @@ -0,0 +1,17 @@ +last-generated=2022-02-18 +statistics-initialization= +{ + "nonlinear": "1, 0, 1", + "numerical Jacobians": "0" +} +statistics-simulation= +{ + "linear": "0", + "nonlinear": "1, 1", + "number of continuous time states": "16", + "numerical Jacobians": "0" +} +time=[0e+00, 3.6e+03] +cat.pum1.m_flow=[0e+00, 1.999821186065674e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00] +cat.mTan_flow=[-3.162276983261108e+00, 1.815570831298828e+00, 1.977542042732239e+00, 1.997248411178589e+00, 1.999664306640625e+00, 1.999959826469421e+00, 1.999994993209839e+00, 1.999999284744263e+00, 2.000000238418579e+00, 2e+00, 1.99999988079071e+00, 2e+00, 1.999999761581421e+00, 2e+00, 1.99999988079071e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, -1.951377511024475e+00, -1.993082284927368e+00, -1.999021768569946e+00, -1.999862432479858e+00, -1.999980926513672e+00, -1.999997138977051e+00, -2.000000715255737e+00, -2e+00, -1.999999403953552e+00, -2.000000476837158e+00, -2.000000476837158e+00, -1.999998927116394e+00, -2e+00, -2.000000953674316e+00, -2e+00, -1.99999988079071e+00, -2.000000238418579e+00, -1.99999988079071e+00, -2e+00, -2e+00, -2e+00, -2e+00, -1.99999988079071e+00, -2e+00, -2e+00, -2.489950321614742e-02, -2.032148186117411e-03, -1.879055344033986e-04, -1.676656029303538e-05, -1.455567371522176e-06, -1.450179496487167e-07, -6.123531903767798e-08, -2.721677105910203e-09, -6.098621163630469e-09, 2.251656416873971e-09, -1.193770859941878e-08, -1.652811754127015e-08, -4.03019306816077e-09, 2.976728932790884e-11, 8.669558404506006e-10, 6.49326703516806e-10, 4.43692749207969e-10, 2.380789732026045e-10, 7.956457714897169e-11, 5.455449286762004e-11, 2.956459729808181e-11, 9.932860089989504e-12, 7.596583084801267e-12, 5.341053120611061e-12, 3.004775681741956e-12, 1.97849702835083e+00, 1.997369408607483e+00, 1.999676585197449e+00, 1.999956130981445e+00, 1.999992489814758e+00, 1.999998211860657e+00, 1.999999284744263e+00, 2.000000476837158e+00, 2.000000476837158e+00, 1.99999988079071e+00, 1.999999523162842e+00, 1.99999988079071e+00, 2.000000715255737e+00, 2.000000476837158e+00, 1.999999403953552e+00, 1.999999046325684e+00, 1.99999988079071e+00, 1.999999403953552e+00, 2.000000238418579e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2.000000238418579e+00, 2e+00] +cat.pum2.m_flow=[-3.162276983261108e+00, 3.815392017364502e+00, 3.977541923522949e+00, 3.997248411178589e+00, 3.999664306640625e+00, 3.999959707260132e+00, 3.999994993209839e+00, 3.999999284744263e+00, 4e+00, 4e+00, 3.999999761581421e+00, 4e+00, 3.999999761581421e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4.86225001513958e-02, 6.917736027389729e-03, 9.782627457752774e-04, 1.375945721520111e-04, 1.907924888655543e-05, 2.89514468931884e-06, -8.173752803486423e-07, -2.749661831558114e-08, 6.047547458365443e-07, -4.714861177035345e-07, -5.0687401653704e-07, 1.041804466694884e-06, -3.431835793321625e-08, -8.8085664629034e-07, -7.954825065326077e-08, 1.744794673186334e-07, -2.87328987269575e-07, 6.874531521816607e-08, 5.706207417688347e-08, -1.596565546435613e-08, -5.446603168479669e-08, -8.744642343572195e-08, 9.183665383716288e-08, -1.045633482021913e-07, 4.004360931730844e-08, 1.975100517272949e+00, 1.997967839241028e+00, 1.999812126159668e+00, 1.999983191490173e+00, 1.999998569488525e+00, 1.99999988079071e+00, 1.99999988079071e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 3.97849702835083e+00, 3.997369527816772e+00, 3.999676704406738e+00, 3.999956130981445e+00, 3.999992370605469e+00, 3.999998092651367e+00, 3.999999284744263e+00, 4.000000476837158e+00, 4.000000476837158e+00, 4e+00, 3.999999523162842e+00, 4e+00, 4.000000476837158e+00, 4.000000476837158e+00, 3.999999284744263e+00, 3.999999046325684e+00, 4e+00, 3.999999523162842e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00] diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mos new file mode 100644 index 00000000000..b4b3d759238 --- /dev/null +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mos @@ -0,0 +1,15 @@ +simulateModel("Buildings.Fluid.Storage.Plant.Validation.ChillerAndTankNoRemoteCharging", + stopTime=3600, + tolerance=1e-06, + method="dassl", + resultFile="ChillerAndTankNoRemoteCharging"); +// Plot commands +createPlot(id=1, + position={15, 15, 961, 426}, + y={"cat.pum1.m_flow", "cat.mTan_flow", "cat.pum2.m_flow"}, + range={0.0, 3600.0, -4.0, 6.0}, + grid=true, + colors={{28,108,200}, {238,46,47}, {0,140,72}}, + timeUnit="s", + displayUnits={"kg/s", "kg/s", "kg/s"}); + diff --git a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ChillerAndTankNoRemoteCharging.mos b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ChillerAndTankNoRemoteCharging.mos new file mode 100644 index 00000000000..2cd09ae83bb --- /dev/null +++ b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ChillerAndTankNoRemoteCharging.mos @@ -0,0 +1,6 @@ +compareVars := + { + "cat.pum1.m_flow", + "cat.mTan_flow", + "cat.pum2.m_flow" + }; From 43e97deb9966bbb888d4baf6efb148741ae137e7 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Fri, 18 Feb 2022 09:20:25 -0800 Subject: [PATCH 039/463] documentation and unit test WithRemote --- .../ChillerAndTankWithRemoteCharging.mo | 106 +++++++++++++++--- ...ation_ChillerAndTankWithRemoteCharging.txt | 17 +++ .../ChillerAndTankWithRemoteCharging.mos | 14 +++ ...ation.ChillerAndTankWithRemoteCharging.mos | 6 + 4 files changed, 130 insertions(+), 13 deletions(-) create mode 100644 Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ChillerAndTankWithRemoteCharging.txt create mode 100644 Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mos create mode 100644 Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ChillerAndTankWithRemoteCharging.mos diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo index 904683f658a..01bf6a63a77 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo @@ -1,16 +1,8 @@ within Buildings.Fluid.Storage.Plant.Validation; model ChillerAndTankWithRemoteCharging - "(Draft)" + "(Draft) Validation model of the plant allowing remote charging" /* - Operation modes implemented in time tables: - plant | chiller | tank | flow direction | tank flow rate - 1. offline off off N/A 0 - 2. offline on charging N/A -1 - 3. online on charging normal -1 - 4. online on off normal 0 - 5. online on discharging normal 1 - 6. online off discharging normal 1 - 7. online off charging reverse -1 + */ extends Modelica.Icons.Example; @@ -90,7 +82,7 @@ model ChillerAndTankWithRemoteCharging equation connect(booOnOff.y, cat.booOnOff) annotation (Line(points={{-59,-70},{-10,-70}, - {-10,-9}}, color={255,0,255})); + {-10,-10}}, color={255,0,255})); connect(booFloDir.y,cat.booFloDir) annotation (Line(points={{-59,0},{-56,0}, {-56,-2},{-10,-2}}, color={255,0,255})); @@ -98,7 +90,7 @@ equation annotation (Line(points={{-59,60},{-14,60},{-14,2},{-9,2}}, color={0,0,127})); connect(set_mChi_flow.y, cat.set_mPum1_flow) - annotation (Line(points={{-59,90},{-9,90},{-9,9}}, color={0,0,127})); + annotation (Line(points={{-59,90},{-9,90},{-9,10}}, color={0,0,127})); connect(cat.port_b2, sin.ports[1]) annotation (Line(points={{-8,-6},{-54,-6}, {-54,-30},{-60,-30}}, color={0,127,255})); connect(sou.ports[1], cat.port_a2) annotation (Line(points={{60,-30},{18,-30}, @@ -110,5 +102,93 @@ equation annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), - Icon(coordinateSystem(extent={{-100,-100},{100,100}}))); + Icon(coordinateSystem(extent={{-100,-100},{100,100}})), + __Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mos" + "Simulate and plot"), + Documentation(info=" +

+(Draft) This is a validation model where the plant is configured to allow +remotely charging the tank. +

+Operation modes implemented in time tables: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PlantChillerTankFlow directionTank flow rate setpoint
1.offlineoffoffN/A0
2.offlineonchargingN/A-1
3.offlineonchargingnormal-1
4.onlineonoffnormal0
5.onlineondischargingnormal1
6.onlineoffdischargingnormal1
7.onlineoffchargingreverse-1
+", revisions=" +
    +
  • +February 18, 2022 by Hongxiang Fu:
    +First implementation. This is for +#2859. +
  • +
+")); end ChillerAndTankWithRemoteCharging; diff --git a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ChillerAndTankWithRemoteCharging.txt b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ChillerAndTankWithRemoteCharging.txt new file mode 100644 index 00000000000..b5b879bee83 --- /dev/null +++ b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ChillerAndTankWithRemoteCharging.txt @@ -0,0 +1,17 @@ +last-generated=2022-02-18 +statistics-initialization= +{ + "nonlinear": "2, 0, 1", + "numerical Jacobians": "0" +} +statistics-simulation= +{ + "linear": "0", + "nonlinear": "2, 1", + "number of continuous time states": "21", + "numerical Jacobians": "0" +} +time=[0e+00, 3.6e+03] +cat.pum1.m_flow=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 9.901783466339111e-01, 9.999966621398926e-01, 9.999997615814209e-01, 9.999998807907104e-01, 9.999999403953552e-01, 9.999999403953552e-01, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 3.073412366211414e-02, 6.693091108900262e-06, -5.542994188645345e-11, -8.607626417189707e-11, -2.716230296240241e-10, -6.555429116206213e-11, -7.279420122241476e-12, 3.332944814235517e-12, 9.881994528226912e-12, -1.704754718466484e-12, 7.765381762094015e-13, -8.036884417521317e-13, -5.336645838779908e-13, 8.070588874932103e-14, 5.904567148938425e-15, 7.842849905399825e-19, 7.616250091517132e-23, 8.356131627698031e-27, 8.881296163965407e-31, 9.294270507770152e-35, 9.61375805343609e-39, 3.930642192431112e-42, 8.814167340603099e-43, 5.605193857299268e-45, -0e+00, -0e+00, -0e+00, -0e+00, -0e+00] +cat.mTan_flow=[-3.33333325719238e-16, -3.33333325719238e-16, -3.33333325719238e-16, -3.33333325719238e-16, -3.33333325719238e-16, -3.33333325719238e-16, -3.33333325719238e-16, -3.33333325719238e-16, -3.33333325719238e-16, -3.33333325719238e-16, -3.33333325719238e-16, -3.33333325719238e-16, -3.33333325719238e-16, -3.33333325719238e-16, -3.33333325719238e-16, -9.901783466339111e-01, -9.999966621398926e-01, -9.999997615814209e-01, -9.999998807907104e-01, -9.999999403953552e-01, -9.999999403953552e-01, -1e+00, -1e+00, -1e+00, -1e+00, -1e+00, -1e+00, -1e+00, -1e+00, -1.024686574935913e+00, -1.043086647987366e+00, -1.021176218986511e+00, -1.010402798652649e+00, -1.005110025405884e+00, -1.00251042842865e+00, -1.001232624053955e+00, -1.000605463981628e+00, -1.000297427177429e+00, -1.00014591217041e+00, -1.00007152557373e+00, -1.000035047531128e+00, -1.000016689300537e+00, -1.000007629394531e+00, -1.880103200674057e-01, -5.261019337922335e-03, -2.562662120908499e-03, -1.248308690264821e-03, -6.080908933654428e-04, -2.962449216283858e-04, -1.443218934582546e-04, -7.030835695331916e-05, -3.425246177357621e-05, -1.672041253186762e-05, -8.174435606633779e-06, -3.950395239371557e-06, -1.905852968775426e-06, -1.001239525066918e-06, -5.709385959562496e-07, 9.950401782989502e-01, 9.976197481155396e-01, 9.988314509391785e-01, 9.994263052940369e-01, 9.99718189239502e-01, 9.99861478805542e-01, 9.999319314956665e-01, 9.99966561794281e-01, 9.99983549118042e-01, 9.999918937683105e-01, 9.999960064888e-01, 9.999980330467224e-01, 9.999990463256836e-01, 9.999995231628418e-01, 1.00039005279541e+00, 1.000199675559998e+00, 1.000097274780273e+00, 1.00004780292511e+00, 1.000023484230042e+00, 1.000011920928955e+00, 1.000005722045898e+00, 1.00000274181366e+00, 1.000001430511475e+00, 1.000000715255737e+00, 1.000000357627869e+00, 1.00000011920929e+00, 1.00000011920929e+00, 1e+00, -2.914130926132202e+00, -7.7321857213974e-01, -6.831806898117065e-01, -9.602615833282471e-01, -1.015051364898682e+00, -1.003048658370972e+00, -1.001908183097839e+00, -1.000933766365051e+00, -1.000456094741821e+00, -1.000229835510254e+00, -1.000115036964417e+00, -1.000054121017456e+00, -1.000027060508728e+00, -1.000013113021851e+00, -1.000006318092346e+00] +cat.pum2.m_flow=[-2.222222171461587e-16, -2.222222171461587e-16, -2.222222171461587e-16, -2.222222171461587e-16, -2.222222171461587e-16, -2.222222171461587e-16, -2.222222171461587e-16, -2.222222171461587e-16, -2.222222171461587e-16, -2.222222171461587e-16, -2.222222171461587e-16, -2.222222171461587e-16, -2.222222171461587e-16, -2.222222171461587e-16, -2.222222171461587e-16, -2.004343724557406e-16, -2.000001489562645e-16, -2.000000166073665e-16, -2.000000033724767e-16, -2.000000033724767e-16, -2.000000033724767e-16, -2.000000033724767e-16, -2.000000033724767e-16, -2.000000033724767e-16, -2.000000033724767e-16, -2.000000033724767e-16, -2.000000033724767e-16, -2.000000033724767e-16, -2.000000033724767e-16, -2.468659542500973e-02, -4.308666288852692e-02, -2.117623388767242e-02, -1.040274649858475e-02, -5.110021680593491e-03, -2.510400954633951e-03, -1.232640584930778e-03, -6.054604309611022e-04, -2.973998780362308e-04, -1.458620827179402e-04, -7.148591976147145e-05, -3.502097024465911e-05, -1.666733805905096e-05, -7.660745723114815e-06, 8.119896650314331e-01, 9.947389960289001e-01, 9.974373579025269e-01, 9.98751699924469e-01, 9.993919134140015e-01, 9.997037649154663e-01, 9.998556971549988e-01, 9.99929666519165e-01, 9.999657273292542e-01, 9.999832510948181e-01, 9.999918341636658e-01, 9.999960660934448e-01, 9.999980926513672e-01, 9.999989867210388e-01, 9.999994039535522e-01, 1.99504017829895e+00, 1.99761974811554e+00, 1.998831391334534e+00, 1.999426364898682e+00, 1.999718189239502e+00, 1.999861478805542e+00, 1.999931931495667e+00, 1.999966502189636e+00, 1.999983549118042e+00, 1.999991893768311e+00, 1.999996066093445e+00, 1.999998092651367e+00, 1.999999046325684e+00, 1.999999523162842e+00, 1.031124234199524e+00, 1.000206351280212e+00, 1.000097274780273e+00, 1.00004780292511e+00, 1.000023484230042e+00, 1.000011920928955e+00, 1.000005722045898e+00, 1.00000274181366e+00, 1.000001430511475e+00, 1.000000715255737e+00, 1.000000357627869e+00, 1.00000011920929e+00, 1.00000011920929e+00, 1e+00, -2.914130926132202e+00, -7.7321857213974e-01, -4.020783007144928e-01, -1.479509174823761e-01, -1.650157012045383e-02, -3.057940048165619e-04, -3.992808615294052e-06, -4.984685020303914e-08, -6.021414478141196e-10, -7.21512476500874e-12, -9.158407539289204e-14, -2.058481914790503e-15, -3.136944962602327e-16, -2.107064204164323e-16, -2.01174335144506e-16] diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mos new file mode 100644 index 00000000000..0ee89ab6b9e --- /dev/null +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mos @@ -0,0 +1,14 @@ +simulateModel("Buildings.Fluid.Storage.Plant.Validation.ChillerAndTankWithRemoteCharging", + stopTime=3600, + tolerance=1e-06, + method="dassl", + resultFile="ChillerAndTankWithRemoteCharging"); +// Plot commands +createPlot(id=1, + position={15, 15, 929, 372}, + y={"cat.pum1.m_flow", "cat.mTan_flow", "cat.pum2.m_flow"}, + range={0.0, 3600.0, -4.0, 3.0}, + grid=true, + colors={{28,108,200}, {238,46,47}, {0,140,72}}, + timeUnit="s", + displayUnits={"kg/s", "kg/s", "kg/s"}); diff --git a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ChillerAndTankWithRemoteCharging.mos b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ChillerAndTankWithRemoteCharging.mos new file mode 100644 index 00000000000..2cd09ae83bb --- /dev/null +++ b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ChillerAndTankWithRemoteCharging.mos @@ -0,0 +1,6 @@ +compareVars := + { + "cat.pum1.m_flow", + "cat.mTan_flow", + "cat.pum2.m_flow" + }; From 9b7d770474ff79c7ec599737a61b3119bd00208c Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Fri, 18 Feb 2022 10:10:55 -0800 Subject: [PATCH 040/463] documentation BaseClasses --- .../Storage/Plant/BaseClasses/FluidThrough.mo | 8 +++ .../BaseClasses/ReversiblePumpValveControl.mo | 63 ++++++++++++++++++- .../Plant/BaseClasses/SignalThrough.mo | 8 +++ .../Plant/Examples/OneSourceOneUser.mo | 2 + 4 files changed, 80 insertions(+), 1 deletion(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/FluidThrough.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/FluidThrough.mo index b7d0b8e6abe..ec720a715cb 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/FluidThrough.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/FluidThrough.mo @@ -14,5 +14,13 @@ equation Documentation(info=" Fluid directly passes through the two ports. This is used to replace conditionally-enabled components with a connection. +", revisions=" +
    +
  • +February 18, 2022 by Hongxiang Fu:
    +First implementation. This is for +#2859. +
  • +
")); end FluidThrough; diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo index 9e2076f1c16..8a1ecc3d0a1 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo @@ -213,5 +213,66 @@ equation connect(and3Pum2.y, swiPum1.u2) annotation (Line(points={{-60,-62},{-60,-70}, {-50,-70},{-50,-118}}, color={255,0,255})); annotation (Diagram(coordinateSystem(extent={{-100,-160},{100,100}})), Icon( - coordinateSystem(extent={{-100,-100},{100,100}}))); + coordinateSystem(extent={{-100,-100},{100,100}})), + Documentation(revisions=" +
    +
  • +February 18, 2022 by Hongxiang Fu:
    +First implementation. This is for +#2859. +
  • +
+", info=" +

+This is a control block for the secondary pump-valve group in + +Buildings.Fluid.Storage.Plant.ChillerAndTank. +This block is conditionally enabled when the plant is configured to allow +remotely charging the tank. +

+

+The secondary pump and two control valves are controlled as such: +

+
    +
  • +The pump is controlled to track a flow rate setpoint of the tank +(can be both positive [discharging] or negative [charging]) +under the following conditions: +
      +
    • +The plant is online, AND +
    • +
    • +the flow direction is \"normal\" (= true), AND +
    • +
    • +val2 (in parallel to the pump) is at most 5% open. +
    • +
    +Otherwise the pump is off. +
  • +
  • +The valve in series with the pump (val1) is controlled to open fully +under the same conditions that allow the pump to be on. +Otherwise the valve is closed. +
  • +
  • +The valve in parallel with the pump (val2) is controlled +to track a negative flow rate setpoint of the tank (charging) +under the following conditions: +
      +
    • +The plant is online, AND +
    • +
    • +the flow direction is \"reverse\" (= false), AND +
    • +
    • +val1 (in series to the pump) is at most 5% open. +
    • +
    +Otherwise the valve is closed. +
  • +
+")); end ReversiblePumpValveControl; diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/SignalThrough.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/SignalThrough.mo index 71cae8696f9..e8333d1062c 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/SignalThrough.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/SignalThrough.mo @@ -23,5 +23,13 @@ equation Documentation(info=" Signal directly passes through from the input to the output. This is used to replace conditionally-enabled blocks with a connection. +", revisions=" +
    +
  • +February 18, 2022 by Hongxiang Fu:
    +First implementation. This is for +#2859. +
  • +
")); end SignalThrough; diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo index 003abeeb903..bf20814c354 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo @@ -153,7 +153,9 @@ Buildings.Fluid.Storage.Plant.ChillerAndTank which is configured here not to allow charging the tank remotely. It is therefore equivalent to having the tank in place of the common pipe.

+

The primary and secondary pumps are controlled as such: +

  • The primary pump is set to a constant flow rate at all time. From 1c515690acb59bcc57a533eb4b5745bca8942881 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Fri, 18 Feb 2022 10:14:58 -0800 Subject: [PATCH 041/463] documentation and unit test DummyUser --- .../BaseClasses/Validation/DummyUser.mo | 29 +++++++++++++++---- ...mples_BaseClasses_Validation_DummyUser.txt | 15 ++++++++++ .../BaseClasses/Validation/DummyUser.mos | 13 +++++++++ ...mples.BaseClasses.Validation.DummyUser.mos | 4 +++ 4 files changed, 55 insertions(+), 6 deletions(-) create mode 100644 Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_BaseClasses_Validation_DummyUser.txt create mode 100644 Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/BaseClasses/Validation/DummyUser.mos create mode 100644 Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.BaseClasses.Validation.DummyUser.mos diff --git a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/Validation/DummyUser.mo b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/Validation/DummyUser.mo index d7dcd8c1e78..c32742a4eab 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/Validation/DummyUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/Validation/DummyUser.mo @@ -23,6 +23,8 @@ model DummyUser "Test model for the dummy user" "Nominal temperature of CHW supply"; parameter Boolean allowFlowReversal=false "Flow reversal setting"; + parameter Modelica.Units.SI.Power QCooLoa_flow_nominal=5*4200*0.9 + "Nominal cooling load of one consumer"; Buildings.Fluid.Storage.Plant.Examples.BaseClasses.DummyUser ideUsr( redeclare package Medium = Medium, @@ -54,20 +56,35 @@ model DummyUser "Test model for the dummy user" extent={{10,10},{-10,-10}}, rotation=180, origin={-70,0}))); - Modelica.Blocks.Sources.TimeTable preQCooLoa_flow(table=[0*3600,0; 0.5*3600, - 0; 0.5*3600,5*4200*1.01; 0.75*3600,5*4200*1.01; 0.75*3600,0; 1*3600,0]) + Modelica.Blocks.Sources.TimeTable preQCooLoa_flow(table=[0*3600,0; 0.5*3600,0; + 0.5*3600,QCooLoa_flow_nominal; 0.75*3600,QCooLoa_flow_nominal; 0.75*3600, + 0; 1*3600,0]) "Placeholder, prescribed cooling load" annotation (Placement(transformation(extent={{-60,80},{-40,100}}))); equation connect(set_TRet.y,ideUsr. TSet) - annotation (Line(points={{-59,50},{-30,50},{-30,5},{-11,5}}, + annotation (Line(points={{-59,50},{-30,50},{-30,4},{-11,4}}, color={0,0,127})); connect(sou.ports[1],ideUsr. port_a) annotation (Line(points={{-60, -6.66134e-16},{-35.1,-6.66134e-16},{-35.1,0},{-10,0}}, color={0,127,255})); connect(ideUsr.port_b, sin.ports[1]) annotation (Line(points={{10,0},{60,0}}, color={0,127,255})); - connect(preQCooLoa_flow.y,ideUsr. QCooLoa_flow) annotation (Line(points={{-39, - 90},{-18,90},{-18,9},{-11,9}}, color={0,0,127})); -annotation(experiment(Tolerance=1e-06, StopTime=3600)); + connect(preQCooLoa_flow.y,ideUsr. QCooLoa_flow) annotation (Line(points={{-39,90}, + {-18,90},{-18,8},{-11,8}}, color={0,0,127})); +annotation(__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/BaseClasses/Validation/DummyUser.mos" + "Simulate and plot"), +experiment(Tolerance=1e-06, StopTime=3600), Documentation(info=" +

    +This is a simple test model for the ideal user. +

    +", revisions=" +
      +
    • +February 18, 2022 by Hongxiang Fu:
      +First implementation. This is for +#2859. +
    • +
    +")); end DummyUser; diff --git a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_BaseClasses_Validation_DummyUser.txt b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_BaseClasses_Validation_DummyUser.txt new file mode 100644 index 00000000000..6d3fdc65b15 --- /dev/null +++ b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_BaseClasses_Validation_DummyUser.txt @@ -0,0 +1,15 @@ +last-generated=2022-02-18 +statistics-initialization= +{ + "nonlinear": "1, 0", + "numerical Jacobians": "0" +} +statistics-simulation= +{ + "linear": " ", + "nonlinear": "1", + "number of continuous time states": "2", + "numerical Jacobians": "0" +} +time=[0e+00, 3.6e+03] +ideUsr.yVal_actual=[1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1.272909430554137e-04, 1.241715071955696e-04, 1.219527548528276e-04, 1.197708115796559e-04, 1.176342339022085e-04, 1.155391364591196e-04, 1.134615013143048e-04, 1.114163678721525e-04, 1.094104663934559e-04, 1.074407337000594e-04, 1.055070024449378e-04, 1.036086250678636e-04, 1.017520044115372e-04, 9.994534048018977e-05, 9.819325350690633e-05, 9.647602564655244e-05, 9.475364640820771e-05, 9.303280967287719e-05, 9.131900878855959e-05, 8.969323971541598e-05, 8.812700252747163e-05, 8.662965410621837e-05, 8.512233762303367e-05, 8.362649532500654e-05, 8.213629917008802e-05, 8.066956070251763e-05, 7.922919758129865e-05, 7.780796295264736e-05, 7.640321564394981e-05, 7.501013897126541e-05, 7.362718315562233e-05, 7.225717854453251e-05, 7.093447493389249e-05, 6.96592396707274e-05, 6.844638846814632e-05, 6.724944250890985e-05, 6.608083640458062e-05, 6.493459659395739e-05, 6.38013007119298e-05, 6.266939453780651e-05, 6.152515561552718e-05, 6.039172876626253e-05, 5.92983269598335e-05, 5.821061495225877e-05, 5.969988703727722e-01, 6.163977384567261e-01, 6.180650591850281e-01, 6.184282302856445e-01, 6.186715960502625e-01, 6.18894636631012e-01, 6.19111955165863e-01, 6.193211078643799e-01, 6.195241212844849e-01, 6.197197437286377e-01, 6.199082732200623e-01, 6.200908422470093e-01, 6.202675104141235e-01, 6.204381585121155e-01, 6.20603084564209e-01, 6.207624673843384e-01, 6.20916485786438e-01, 6.210653185844421e-01, 6.212091445922852e-01, 6.213481426239014e-01, 6.214824914932251e-01, 6.216122508049011e-01, 6.217376589775085e-01, 6.218587756156921e-01, 6.219757795333862e-01, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/BaseClasses/Validation/DummyUser.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/BaseClasses/Validation/DummyUser.mos new file mode 100644 index 00000000000..a20cd768f45 --- /dev/null +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/BaseClasses/Validation/DummyUser.mos @@ -0,0 +1,13 @@ +simulateModel("Buildings.Fluid.Storage.Plant.Examples.BaseClasses.Validation.DummyUser", + stopTime=3600, + tolerance=1e-06, + method="dassl", + resultFile="DummyUser"); +// Plot commands +createPlot(id=1, + position={75, 75, 843, 372}, + y={"ideUsr.yVal_actual"}, + range={0.0, 3600.0, -0.2, 1.2}, + grid=true, + colors={{28,108,200}}, + timeUnit="s"); diff --git a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.BaseClasses.Validation.DummyUser.mos b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.BaseClasses.Validation.DummyUser.mos new file mode 100644 index 00000000000..732efaff8af --- /dev/null +++ b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.BaseClasses.Validation.DummyUser.mos @@ -0,0 +1,4 @@ +compareVars := + { + "ideUsr.yVal_actual" + }; From f7de3fb0b7ea5aa1b9e65ebf3f6678b8f829d991 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Fri, 18 Feb 2022 10:34:28 -0800 Subject: [PATCH 042/463] documentation and inheritance DummyUser --- .../Plant/Examples/BaseClasses/DummyUser.mo | 68 +++++++++---------- .../Plant/Examples/OneSourceOneUser.mo | 4 +- .../Plant/Examples/TwoSourcesThreeUsers.mo | 38 +++++------ 3 files changed, 52 insertions(+), 58 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo index ba9de048dad..110ce1a5122 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo @@ -1,14 +1,8 @@ within Buildings.Fluid.Storage.Plant.Examples.BaseClasses; model DummyUser "Dummy user model" -/* -For simplification, instead of setting up a heat exchanger to a room model, -the consumer control valve simply tracks the return CHW temperature. -*/ - replaceable package Medium = - Modelica.Media.Interfaces.PartialMedium "Medium in the component"; + extends Buildings.Fluid.Interfaces.PartialTwoPortInterface( + m_flow_nominal=1); - parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=1 - "Nominal mass flow rate"; parameter Modelica.Units.SI.AbsolutePressure p_a_nominal=800000 "Nominal pressure of the CHW supply line"; parameter Modelica.Units.SI.AbsolutePressure p_b_nominal=300000 @@ -70,20 +64,6 @@ the consumer control valve simply tracks the return CHW temperature. extent={{10,-10},{-10,10}}, rotation=180, origin={-10,60}))); - Modelica.Fluid.Interfaces.FluidPort_a port_a( - p(start=p_a_nominal), - redeclare package Medium = Medium, - h_outflow(start=Medium.h_default, nominal=Medium.h_default)) - "Fluid connector a (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{-110,-10},{-90,10}}), - iconTransformation(extent={{-110,-10},{-90,10}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b( - p(start=p_b_nominal), - redeclare package Medium = Medium, - h_outflow(start=Medium.h_default, nominal=Medium.h_default)) - "Fluid connector b (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{110,-10},{90,10}}), - iconTransformation(extent={{110,-10},{90,10}}))); Modelica.Blocks.Interfaces.RealInput QCooLoa_flow "Cooling load of the consumer" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -109,12 +89,12 @@ the consumer control valve simply tracks the return CHW temperature. extent={{10,-10},{-10,10}}, rotation=-90, origin={-60,110}))); - Buildings.Fluid.Sensors.RelativePressure dpSen(redeclare package Medium = Medium) + Buildings.Fluid.Sensors.RelativePressure dpSen( + redeclare package Medium = Medium) "Differential pressure sensor" annotation (Placement(transformation(extent={{-10,-60},{10,-40}}))); - Modelica.Blocks.Interfaces.RealOutput dp - "Differential pressure of the consumer" annotation (Placement( - transformation( + Modelica.Blocks.Interfaces.RealOutput dpUsr + "Differential pressure of the user" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={110,-80}), iconTransformation( @@ -138,26 +118,26 @@ equation {-70,12}}, color={0,0,127})); connect(TUsr.T, conPI.u_m) annotation (Line(points={{19,-30},{-50,-30},{-50,48}}, color={0,0,127})); - connect(val.port_a, port_a) - annotation (Line(points={{-80,0},{-100,0}}, color={0,127,255})); - connect(preDro.port_b, port_b) - annotation (Line(points={{80,0},{100,0}}, color={0,127,255})); connect(heaCon.Q_flow, QCooLoa_flow) annotation (Line(points={{22,80},{-110,80}}, color={0,0,127})); connect(conPI.u_s, TSet) annotation (Line(points={{-62,60},{-110,60}}, color={0,0,127})); - connect(port_a, dpSen.port_a) annotation (Line( - points={{-100,0},{-100,-50},{-10,-50}}, + connect(dpSen.p_rel, dpUsr) + annotation (Line(points={{0,-59},{0,-80},{110,-80}}, color={0,0,127})); + connect(val.y_actual, yVal_actual) + annotation (Line(points={{-65,7},{-65,40},{110,40}}, color={0,0,127})); + connect(val.port_a, port_a) + annotation (Line(points={{-80,0},{-100,0}}, color={0,127,255})); + connect(dpSen.port_a, port_a) annotation (Line( + points={{-10,-50},{-100,-50},{-100,0}}, color={0,127,255}, pattern=LinePattern.Dash)); + connect(preDro.port_b, port_b) + annotation (Line(points={{80,0},{100,0}}, color={0,127,255})); connect(dpSen.port_b, port_b) annotation (Line( points={{10,-50},{100,-50},{100,0}}, color={0,127,255}, pattern=LinePattern.Dash)); - connect(dpSen.p_rel, dp) - annotation (Line(points={{0,-59},{0,-80},{110,-80}}, color={0,0,127})); - connect(val.y_actual, yVal_actual) - annotation (Line(points={{-65,7},{-65,40},{110,40}}, color={0,0,127})); annotation (Icon(graphics={Ellipse( extent={{-100,100},{100,-100}}, lineColor={28,108,200}, @@ -165,5 +145,19 @@ equation fillPattern=FillPattern.Sphere), Text( extent={{-58,-104},{62,-132}}, textColor={0,0,127}, - textString="%name")})); + textString="%name")}), Documentation(info=" +

    +(Draft) +For simplicity, instead of setting up a heat exchanger to a room model, +the consumer control valve simply tracks the return CHW temperature. +

    +", revisions=" +
      +
    • +February 18, 2022 by Hongxiang Fu:
      +First implementation. This is for +#2859. +
    • +
    +")); end DummyUser; diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo index bf20814c354..097ae210f27 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo @@ -123,8 +123,8 @@ equation color={0,127,255})); connect(set_dpUsr.y, conPI_pum2.u_s) annotation (Line(points={{-50,59},{-50,52}}, color={0,0,127})); - connect(usr.dp, gaiPum2.u) annotation (Line(points={{48,-9},{48,-9},{48,88},{-20, - 88},{-20,82}}, color={0,0,127})); + connect(usr.dpUsr, gaiPum2.u) annotation (Line(points={{48,-9},{48,-9},{48,88}, + {-20,88},{-20,82}}, color={0,0,127})); connect(conPI_pum2.y, cat.yPum2) annotation (Line(points={{-50,29},{-50,20},{-42,20},{-42,11}}, color={0,0,127})); diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index f725f01ae31..b8ca0fc46aa 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -298,16 +298,17 @@ model TwoSourcesThreeUsers origin={-120,150}))); equation connect(set_TRet.y,usr1. TSet) annotation (Line(points={{41,110},{44,110},{44, - 82},{65,82},{65,71}}, color={0,0,127})); + 82},{64,82},{64,71}}, color={0,0,127})); connect(set_TRet.y,usr2. TSet) annotation (Line(points={{41,110},{44,110},{44, - 22},{65,22},{65,11}}, color={0,0,127})); + 22},{64,22},{64,11}}, color={0,0,127})); connect(set_TRet.y,usr3. TSet) annotation (Line(points={{41,110},{44,110},{44, - -38},{65,-38},{65,-49}}, color={0,0,127})); - connect(usr3.yVal_actual, mulMax_yVal.u[1]) annotation (Line(points={{71,-53}, - {86,-53},{86,-110},{74,-110},{74,-110.667},{62,-110.667}}, color={0,0, + -38},{64,-38},{64,-49}}, color={0,0,127})); + connect(usr3.yVal_actual, mulMax_yVal.u[1]) annotation (Line(points={{71,-54}, + {86,-54},{86,-110},{74,-110},{74,-110.667},{62,-110.667}}, color={0,0, 127})); - connect(usr2.yVal_actual, mulMax_yVal.u[2]) annotation (Line(points={{71,7},{86, - 7},{86,-110},{62,-110}}, color={0,0,127})); + connect(usr2.yVal_actual, mulMax_yVal.u[2]) annotation (Line(points={{71,6},{ + 86,6},{86,-110},{62,-110}}, + color={0,0,127})); connect(mulMax_yVal.y, hysCat.u) annotation (Line(points={{38,-110},{22,-110}}, color={0,0,127})); connect(hysCat.y, cat.booOnOff) annotation (Line(points={{-2,-110},{-44,-110}, @@ -320,8 +321,8 @@ equation annotation (Line(points={{-60,139},{-60,122}}, color={0,0,127})); connect(conPI_PumChi1.y, pumChi1.y) annotation (Line(points={{-60,99},{-60,92}}, color={0,0,127})); - connect(usr1.yVal_actual, mulMax_yVal.u[3]) annotation (Line(points={{71,67}, - {86,67},{86,-110},{62,-110},{62,-109.333}},color={0,0,127})); + connect(usr1.yVal_actual, mulMax_yVal.u[3]) annotation (Line(points={{71,66}, + {86,66},{86,-110},{62,-110},{62,-109.333}},color={0,0,127})); connect(preDroS2U3.port_b,usr3. port_a) annotation (Line(points={{-10,-40},{60,-40},{60,-50}}, color={0,127,255})); connect(usr3.port_b,preDroU3S2. port_a) @@ -348,18 +349,17 @@ equation connect(preDroU1S1.port_b, preDroChi1.port_a) annotation (Line(points={{10,40},{-50,40}}, color={0,127,255})); connect(set_QCooLoa1_flow.y,usr1. QCooLoa_flow) - annotation (Line(points={{99,90},{69,90},{69,71}}, color={0,0,127})); + annotation (Line(points={{99,90},{68,90},{68,71}}, color={0,0,127})); connect(set_QCooLoa2_flow.y,usr2. QCooLoa_flow) - annotation (Line(points={{99,30},{69,30},{69,11}}, color={0,0,127})); + annotation (Line(points={{99,30},{68,30},{68,11}}, color={0,0,127})); connect(set_QCooLoa3_flow.y,usr3. QCooLoa_flow) - annotation (Line(points={{99,-30},{69,-30},{69,-49}}, color={0,0,127})); - connect(usr1.dp,gaiUsr1. u) - annotation (Line(points={{71,63},{71,60},{98,60}}, color={0,0,127})); - connect(usr2.dp,gaiUsr2. u) annotation (Line(points={{71,3},{71,1.55431e-15},{ - 98,1.55431e-15}}, color={0,0,127})); - connect(usr3.dp,gaiUsr3. u) annotation (Line(points={{71,-57},{72,-57},{72, - -60},{98,-60}}, - color={0,0,127})); + annotation (Line(points={{99,-30},{68,-30},{68,-49}}, color={0,0,127})); + connect(usr1.dpUsr, gaiUsr1.u) + annotation (Line(points={{71,62},{71,60},{98,60}}, color={0,0,127})); + connect(usr2.dpUsr, gaiUsr2.u) annotation (Line(points={{71,2},{71, + 1.55431e-15},{98,1.55431e-15}}, color={0,0,127})); + connect(usr3.dpUsr, gaiUsr3.u) annotation (Line(points={{71,-58},{72,-58},{72, + -60},{98,-60}}, color={0,0,127})); connect(gaiUsr1.y,mulMin_dpUsr. u[1]) annotation (Line(points={{121,60},{126, 60},{126,142},{-9.33333,142}}, color={0,0,127})); From db211c057ff63d54e7fcc23b979bcb9012377f26 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Fri, 18 Feb 2022 11:10:42 -0800 Subject: [PATCH 043/463] improved parameterisation --- Buildings/Fluid/Storage/Plant/ChillerAndTank.mo | 2 +- .../Storage/Plant/Examples/BaseClasses/DummyUser.mo | 7 +++---- .../Storage/Plant/Examples/TwoSourcesThreeUsers.mo | 11 +++++------ 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo index a02421fe1ee..1dc486041be 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo @@ -194,7 +194,7 @@ model ChillerAndTank final allowFlowReversal=true, hTan=3, dIns=0.3, - VTan=1, + VTan=10, nSeg=7, show_T=true, m_flow_nominal=mTan_flow_nominal, diff --git a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo index 110ce1a5122..6604764e194 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo @@ -18,8 +18,8 @@ model DummyUser "Dummy user model" Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage val( redeclare package Medium = Medium, use_inputFilter=false, - l=1E-10, - dpValve_nominal=6000, + l=1E-5, + dpValve_nominal=0.1*dp_nominal, m_flow_nominal=m_flow_nominal, y_start=0) "User control valve" annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); @@ -89,8 +89,7 @@ model DummyUser "Dummy user model" extent={{10,-10},{-10,10}}, rotation=-90, origin={-60,110}))); - Buildings.Fluid.Sensors.RelativePressure dpSen( - redeclare package Medium = Medium) + Buildings.Fluid.Sensors.RelativePressure dpSen(redeclare package Medium = Medium) "Differential pressure sensor" annotation (Placement(transformation(extent={{-10,-60},{10,-40}}))); Modelica.Blocks.Interfaces.RealOutput dpUsr diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index b8ca0fc46aa..8af468bab5e 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -21,7 +21,7 @@ model TwoSourcesThreeUsers "Nominal temperature of CHW supply"; parameter Boolean allowFlowReversal=false "Flow reversal setting"; - parameter Modelica.Units.SI.Power QCooLoa_flow_nominal=5*4200*0.85 + parameter Modelica.Units.SI.Power QCooLoa_flow_nominal=5*4200*0.5 "Nominal cooling load of one consumer"; Buildings.Fluid.Storage.Plant.ChillerAndTank cat( @@ -306,9 +306,8 @@ equation connect(usr3.yVal_actual, mulMax_yVal.u[1]) annotation (Line(points={{71,-54}, {86,-54},{86,-110},{74,-110},{74,-110.667},{62,-110.667}}, color={0,0, 127})); - connect(usr2.yVal_actual, mulMax_yVal.u[2]) annotation (Line(points={{71,6},{ - 86,6},{86,-110},{62,-110}}, - color={0,0,127})); + connect(usr2.yVal_actual, mulMax_yVal.u[2]) annotation (Line(points={{71,6},{86, + 6},{86,-110},{62,-110}}, color={0,0,127})); connect(mulMax_yVal.y, hysCat.u) annotation (Line(points={{38,-110},{22,-110}}, color={0,0,127})); connect(hysCat.y, cat.booOnOff) annotation (Line(points={{-2,-110},{-44,-110}, @@ -356,8 +355,8 @@ equation annotation (Line(points={{99,-30},{68,-30},{68,-49}}, color={0,0,127})); connect(usr1.dpUsr, gaiUsr1.u) annotation (Line(points={{71,62},{71,60},{98,60}}, color={0,0,127})); - connect(usr2.dpUsr, gaiUsr2.u) annotation (Line(points={{71,2},{71, - 1.55431e-15},{98,1.55431e-15}}, color={0,0,127})); + connect(usr2.dpUsr, gaiUsr2.u) annotation (Line(points={{71,2},{71,1.55431e-15}, + {98,1.55431e-15}}, color={0,0,127})); connect(usr3.dpUsr, gaiUsr3.u) annotation (Line(points={{71,-58},{72,-58},{72, -60},{98,-60}}, color={0,0,127})); connect(gaiUsr1.y,mulMin_dpUsr. u[1]) annotation (Line(points={{121,60},{126, From d9969be1ffec431b0185c8c1796e88cb7d46f83f Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Fri, 18 Feb 2022 12:23:34 -0800 Subject: [PATCH 044/463] added check valves to prevent pump back flow --- .../Fluid/Storage/Plant/ChillerAndTank.mo | 152 ++++++++++-------- .../Plant/Examples/BaseClasses/DummyUser.mo | 6 +- .../Plant/Examples/TwoSourcesThreeUsers.mo | 63 ++++---- 3 files changed, 113 insertions(+), 108 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo index 1dc486041be..6b37135274f 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo @@ -46,21 +46,14 @@ model ChillerAndTank annotation (choicesAllMatching=true, Placement(transformation(extent={{-100,82},{-80,102}}))); - Buildings.Fluid.FixedResistances.PressureDrop preDro1( - redeclare package Medium = Medium2, - final dp_nominal=dp_nominal/10, - final m_flow_nominal=mChi_flow_nominal) "Flow resistance on chiller branch" - annotation (Placement(transformation(extent={{10,-10},{-10,10}}, - rotation=0, - origin={-70,-10}))); Buildings.Fluid.FixedResistances.PressureDrop preDro2( redeclare package Medium = Medium2, final allowFlowReversal=true, final dp_nominal=dp_nominal/10, final m_flow_nominal=mTan_flow_nominal) "Flow resistance on tank branch" annotation (Placement(transformation(extent={{10,-10},{-10,10}}, - rotation=0, - origin={-70,-70}))); + rotation=-90, + origin={-80,-80}))); Modelica.Blocks.Interfaces.RealInput set_mPum1_flow "Primary pump mass flow rate setpoint" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -79,14 +72,14 @@ model ChillerAndTank m_flow_nominal=mChi_flow_nominal, m_flow_start=0, T_start=T_CHWR_nominal) "Primary CHW pump" - annotation (Placement(transformation(extent={{20,-20},{0,0}}))); + annotation (Placement(transformation(extent={{-10,-42},{-30,-22}}))); Modelica.Blocks.Interfaces.RealOutput mTan_flow "Mass flow rate through the tank" annotation (Dialog(group= "Time varying output signal"), Placement(transformation( extent={{10,-10},{-10,10}}, rotation=90, - origin={-10,-110}), iconTransformation( + origin={0,-110}), iconTransformation( extent={{10,-10},{-10,10}}, rotation=180, origin={110,-20}))); @@ -129,20 +122,20 @@ model ChillerAndTank redeclare package Medium = Medium2, use_inputFilter=true, y_start=0, - l=1E-10, - dpValve_nominal=6000, + l=1E-5, + dpValve_nominal=0.1*dp_nominal, m_flow_nominal=m2_flow_nominal) if allowRemoteCharging "Valve in series to the pump (normal direction)" - annotation (Placement(transformation(extent={{60,-20},{40,0}}))); + annotation (Placement(transformation(extent={{30,-20},{10,0}}))); Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage val2( redeclare package Medium = Medium2, use_inputFilter=true, y_start=0, - l=1E-10, - dpValve_nominal=6000, + l=1E-5, + dpValve_nominal=0.1*dp_nominal, m_flow_nominal=mTan_flow_nominal) if allowRemoteCharging "Valve in parallel to the secondary pump (reverse direction)" - annotation (Placement(transformation(extent={{40,-80},{60,-60}}))); + annotation (Placement(transformation(extent={{10,-80},{30,-60}}))); Buildings.Controls.OBC.CDL.Continuous.Switch swiFloDirPum1 if allowRemoteCharging "Switches off pum1 when tank charged remotely" annotation (Placement(transformation(extent={{-10,-10},{10,10}}, @@ -156,7 +149,7 @@ model ChillerAndTank Buildings.Fluid.Storage.Plant.BaseClasses.FluidThrough pasVal1(redeclare package Medium = Medium2) if not allowRemoteCharging "Replaces val1 when remote charging not allowed" - annotation (Placement(transformation(extent={{60,-42},{40,-22}}))); + annotation (Placement(transformation(extent={{30,-42},{10,-22}}))); Buildings.Fluid.Storage.Plant.BaseClasses.SignalThrough pasSwiFloDirPum1 if not allowRemoteCharging "Replaces swiFloDirPum1 when remote charging not allowed" annotation ( Placement(transformation( @@ -179,7 +172,7 @@ model ChillerAndTank T2_start=T_CHWS_nominal, final per=perChi) "Water cooled chiller (ports indexed 1 are on condenser side)" - annotation (Placement(transformation(extent={{-40,0},{-20,20}}))); + annotation (Placement(transformation(extent={{-60,0},{-40,20}}))); Buildings.Controls.OBC.CDL.Logical.Sources.Constant onChi(k=true) if not allowRemoteCharging "Placeholder, chiller always on" annotation (Placement(transformation(extent={{-100,30},{-80,50}}))); @@ -204,21 +197,34 @@ model ChillerAndTank T_CHWR_nominal, T_CHWS_nominal, tan.nSeg)) "Tank" - annotation (Placement(transformation(extent={{-20,-80},{-40,-60}}))); + annotation (Placement(transformation(extent={{-40,-80},{-60,-60}}))); Modelica.Fluid.Sensors.MassFlowRate sen_m_flow( redeclare package Medium = Medium2, final allowFlowReversal=true) "Flow rate sensor" - annotation (Placement(transformation(extent={{20,-80},{0,-60}}))); + annotation (Placement(transformation(extent={{-10,-80},{-30,-60}}))); + Buildings.Fluid.FixedResistances.CheckValve cheValPum1( + redeclare package Medium = Medium2, + m_flow_nominal=mChi_flow_nominal, + dpValve_nominal=0.1*dp_nominal, + dpFixed_nominal=0.1*dp_nominal) "Check valve with series resistance" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-70,-30}))); + Buildings.Fluid.FixedResistances.CheckValve cheValPum2( + redeclare package Medium = Medium2, + m_flow_nominal=m2_flow_nominal, + dpValve_nominal=0.1*dp_nominal, + dpFixed_nominal=0.1*dp_nominal) "Check valve" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={50,-20}))); equation - connect(conPum2Gro.yVal2, val2.y) annotation (Line(points={{62,78.9},{62,78.9}, - {62,34},{36,34},{36,-50},{50,-50},{50,-58}}, color={0,0,127})); - connect(conPum2Gro.yVal1, val1.y) annotation (Line(points={{66,78.9},{66,78.9}, - {66,26},{50,26},{50,2}}, color={0,0,127})); + connect(conPum2Gro.yVal1, val1.y) annotation (Line(points={{66,78.9},{66,56}, + {20,56},{20,2}}, color={0,0,127})); connect(conPum2Gro.us_mTan_flow, set_mTan_flow) annotation (Line(points={{81, 95.4},{90,95.4},{90,118},{80,118},{80,130}}, color={0,0,127})); - connect(pum2.port_b, val1.port_a) - annotation (Line(points={{70,-20},{66,-20},{66,-10},{60,-10}}, - color={0,127,255})); connect(pum2.y, conPum2Gro.yPum2) annotation (Line(points={{80,-8},{80,20},{ 70,20},{70,78.9}}, color={0,0,127})); connect(swiFloDirPum1.u2, booFloDir) annotation (Line(points={{-10,102},{-10,112}, @@ -226,67 +232,75 @@ equation connect(swiFloDirPum1.u1, set_mPum1_flow) annotation (Line(points={{-2,102},{-2, 108},{40,108},{40,130}}, color={0,0,127})); connect(pum1.m_flow_in,swiFloDirPum1. y) - annotation (Line(points={{10,2},{10,72},{-10,72},{-10,78}}, + annotation (Line(points={{-20,-20},{-20,72},{-10,72},{-10,78}}, color={0,0,127})); connect(conZero.y,swiFloDirPum1. u3) annotation (Line(points={{-50,101},{-50,108}, {-18,108},{-18,102}}, color={0,0,127})); - connect(pum2.port_b, pasVal1.port_a) annotation (Line(points={{70,-20},{66, - -20},{66,-32},{60,-32}}, color={0,127,255})); connect(pasSwiFloDirPum1.u, set_mPum1_flow) annotation (Line(points={{28,101}, {28,108},{40,108},{40,130}}, color={0,0,127})); connect(pasSwiFloDirPum1.y, pum1.m_flow_in) annotation (Line(points={{28,79}, - {28,72},{10,72},{10,2}}, color={0,0,127})); + {28,72},{-20,72},{-20,-20}}, color={0,0,127})); connect(pum2.y, yPum2) annotation (Line(points={{80,-8},{80,20},{110,20}}, color={0,0,127})); - connect(port_b2, preDro1.port_b) annotation (Line(points={{-100,-60},{-86,-60}, - {-86,-10},{-80,-10}}, color={0,127,255})); - connect(preDro2.port_b, port_b2) annotation (Line(points={{-80,-70},{-86,-70}, - {-86,-60},{-100,-60}}, color={0,127,255})); connect(pum2.port_a, port_a2) annotation (Line(points={{90,-20},{90,-60},{100,-60}}, color={0,127,255})); - connect(val2.port_b, port_a2) annotation (Line(points={{60,-70},{90,-70},{90, + connect(val2.port_b, port_a2) annotation (Line(points={{30,-70},{90,-70},{90, -60},{100,-60}}, color={0,127,255})); - connect(pum1.port_a, val1.port_b) - annotation (Line(points={{20,-10},{40,-10}}, color={0,127,255})); - connect(pasVal1.port_b, pum1.port_a) annotation (Line(points={{40,-32},{30, - -32},{30,-10},{20,-10}}, color={0,127,255})); - connect(val2.port_a, pum1.port_a) annotation (Line(points={{40,-70},{30,-70}, - {30,-10},{20,-10}}, color={0,127,255})); connect(conPum2Gro.booOnOff, booOnOff) annotation (Line(points={{82,82.2},{82, 82},{96,82},{96,80},{110,80}}, color={255,0,255})); connect(conPum2Gro.booFloDir, booFloDir) annotation (Line(points={{82,86.6},{ 82,86},{96,86},{96,100},{110,100}}, color={255,0,255})); - connect(preDro1.port_a, chi.port_b2) annotation (Line(points={{-60,-10},{-60,-6}, - {-40,-6},{-40,4}}, color={0,127,255})); - connect(pum1.port_b, chi.port_a2) annotation (Line(points={{0,-10},{-14,-10},{ - -14,4},{-20,4}}, color={0,127,255})); - connect(chi.on, booFloDir) annotation (Line(points={{-42,13},{-42,14},{-68,14}, - {-68,112},{96,112},{96,100},{110,100}}, color={255,0,255})); - connect(onChi.y, chi.on) annotation (Line(points={{-78,40},{-68,40},{-68,13},{ - -42,13}}, color={255,0,255})); - connect(set_TEvaLvg.y, chi.TSet) annotation (Line(points={{-79,10},{-50,10},{-50, - 7},{-42,7}}, color={0,0,127})); - connect(chi.port_a1, port_a1) annotation (Line(points={{-40,16},{-44,16},{-44, + connect(pum1.port_b, chi.port_a2) annotation (Line(points={{-30,-32},{-40,-32}, + {-40,4}}, color={0,127,255})); + connect(chi.on, booFloDir) annotation (Line(points={{-62,13},{-62,12},{-72,12}, + {-72,112},{96,112},{96,100},{110,100}}, color={255,0,255})); + connect(onChi.y, chi.on) annotation (Line(points={{-78,40},{-72,40},{-72,13}, + {-62,13}},color={255,0,255})); + connect(set_TEvaLvg.y, chi.TSet) annotation (Line(points={{-79,10},{-79,7},{ + -62,7}}, color={0,0,127})); + connect(chi.port_a1, port_a1) annotation (Line(points={{-60,16},{-64,16},{-64, 60},{-100,60}}, color={0,127,255})); - connect(chi.port_b1, port_b1) annotation (Line(points={{-20,16},{-16,16},{-16, + connect(chi.port_b1, port_b1) annotation (Line(points={{-40,16},{-32,16},{-32, 60},{100,60}}, color={0,127,255})); - connect(val1.y_actual, conPum2Gro.yVal1_actual) annotation (Line(points={{45, - -3},{42,-3},{42,30},{54,30},{54,99.8},{59,99.8}}, color={0,0,127})); - connect(val2.y_actual, conPum2Gro.yVal2_actual) annotation (Line(points={{55, - -63},{60,-63},{60,-44},{96,-44},{96,8},{59,8},{59,95.4}}, color={0,0, - 127})); - connect(sen_m_flow.m_flow, mTan_flow) annotation (Line(points={{10,-59},{10, - -56},{-10,-56},{-10,-110}}, color={0,0,127})); - connect(sen_m_flow.m_flow, conPum2Gro.um_mTan_flow) annotation (Line(points={ - {10,-59},{10,-56},{-10,-56},{-10,64},{50,64},{50,108},{88,108},{88, - 99.8},{81,99.8}}, color={0,0,127})); + connect(val1.y_actual, conPum2Gro.yVal1_actual) annotation (Line(points={{15,-3}, + {14,-3},{14,68},{46,68},{46,99.8},{59,99.8}}, color={0,0,127})); + connect(sen_m_flow.m_flow, mTan_flow) annotation (Line(points={{-20,-59},{-20, + -56},{0,-56},{0,-110}}, color={0,0,127})); + connect(sen_m_flow.m_flow, conPum2Gro.um_mTan_flow) annotation (Line(points={{-20,-59}, + {-20,-56},{0,-56},{0,70},{44,70},{44,108},{88,108},{88,99.8},{81,99.8}}, + color={0,0,127})); connect(preDro2.port_a, tan.port_b) - annotation (Line(points={{-60,-70},{-40,-70}}, color={0,127,255})); - connect(sen_m_flow.port_a, pum1.port_a) annotation (Line(points={{20,-70},{30, - -70},{30,-10},{20,-10}}, color={0,127,255})); + annotation (Line(points={{-80,-90},{-80,-92},{-66,-92},{-66,-70},{-60,-70}}, + color={0,127,255})); connect(sen_m_flow.port_b, tan.port_a) - annotation (Line(points={{0,-70},{-20,-70}}, color={0,127,255})); + annotation (Line(points={{-30,-70},{-40,-70}}, + color={0,127,255})); + connect(port_b2, preDro2.port_b) annotation (Line(points={{-100,-60},{-80,-60}, + {-80,-70}}, color={0,127,255})); + connect(chi.port_b2, cheValPum1.port_a) + annotation (Line(points={{-60,4},{-70,4},{-70,-20}}, color={0,127,255})); + connect(cheValPum1.port_b, port_b2) annotation (Line(points={{-70,-40},{-70, + -60},{-100,-60}}, color={0,127,255})); + connect(val2.port_a, pum1.port_a) annotation (Line(points={{10,-70},{4,-70},{ + 4,-32},{-10,-32}}, color={0,127,255})); + connect(sen_m_flow.port_a, pum1.port_a) annotation (Line(points={{-10,-70},{4, + -70},{4,-32},{-10,-32}}, color={0,127,255})); + connect(pasVal1.port_b, pum1.port_a) + annotation (Line(points={{10,-32},{-10,-32}}, color={0,127,255})); + connect(val1.port_b, pum1.port_a) annotation (Line(points={{10,-10},{4,-10},{ + 4,-32},{-10,-32}}, color={0,127,255})); + connect(pum2.port_b, cheValPum2.port_a) + annotation (Line(points={{70,-20},{60,-20}}, color={0,127,255})); + connect(pasVal1.port_a, cheValPum2.port_b) annotation (Line(points={{30,-32}, + {34,-32},{34,-20},{40,-20}}, color={0,127,255})); + connect(val1.port_a, cheValPum2.port_b) annotation (Line(points={{30,-10},{34, + -10},{34,-20},{40,-20}}, color={0,127,255})); + connect(conPum2Gro.yVal2, val2.y) annotation (Line(points={{62,78.9},{62,4},{ + 94,4},{94,-44},{20,-44},{20,-58}}, color={0,0,127})); + connect(conPum2Gro.yVal2_actual, val2.y_actual) annotation (Line(points={{59, + 95.4},{54,95.4},{54,96},{48,96},{48,6},{96,6},{96,-46},{60,-46},{60, + -63},{25,-63}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,100}}), graphics={Line( points={{-30,-110},{30,-110}}, diff --git a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo index 6604764e194..0355af4d1cd 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo @@ -141,10 +141,8 @@ equation extent={{-100,100},{100,-100}}, lineColor={28,108,200}, fillColor={244,125,35}, - fillPattern=FillPattern.Sphere), Text( - extent={{-58,-104},{62,-132}}, - textColor={0,0,127}, - textString="%name")}), Documentation(info=" + fillPattern=FillPattern.Sphere)}), + Documentation(info="

    (Draft) For simplicity, instead of setting up a heat exchanger to a room model, diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index 8af468bab5e..9907937e19e 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -13,14 +13,12 @@ model TwoSourcesThreeUsers parameter Modelica.Units.SI.AbsolutePressure p_CHWS_nominal= p_CHWR_nominal+dp_nominal "Nominal pressure at CHW supply line"; - parameter Modelica.Units.SI.AbsolutePressure p_CHWR_nominal=500000 + parameter Modelica.Units.SI.AbsolutePressure p_CHWR_nominal=300000 "Nominal pressure at CHW return line"; parameter Modelica.Units.SI.Temperature T_CHWR_nominal=12+273.15 "Nominal temperature of CHW return"; parameter Modelica.Units.SI.Temperature T_CHWS_nominal=7+273.15 "Nominal temperature of CHW supply"; - parameter Boolean allowFlowReversal=false - "Flow reversal setting"; parameter Modelica.Units.SI.Power QCooLoa_flow_nominal=5*4200*0.5 "Nominal cooling load of one consumer"; @@ -75,11 +73,10 @@ model TwoSourcesThreeUsers redeclare package Medium = Medium2, per(pressure(dp=dp_nominal*{2,1.2,0}, V_flow=(m_flow_nominal*1.5)/1.2*{0,1.2,2})), energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - allowFlowReversal=true, addPowerToMedium=false, final y_start=1, T_start=T_CHWR_nominal) "Supply pump for chiller 1" annotation (Placement( - transformation(extent={{-70,70},{-50,90}}, rotation=0))); + transformation(extent={{-50,30},{-70,50}}, rotation=0))); Buildings.Controls.OBC.CDL.Continuous.MultiMin mulMin_dpUsr(nin=3) "Min of pressure head measured from all users" annotation (Placement(transformation(extent={{10,-10},{-10,10}}, @@ -112,17 +109,7 @@ model TwoSourcesThreeUsers nPorts=1) "Pressurisation point" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-170,40}))); - Buildings.Fluid.FixedResistances.PressureDrop preDroChi1( - redeclare package Medium = Medium2, - final allowFlowReversal=allowFlowReversal, - final dp_nominal=dp_nominal/10, - final m_flow_nominal=1.5*m_flow_nominal) - "Flow resistance" annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=180, - origin={-60,40}))); + origin={-170,30}))); Buildings.Controls.Continuous.LimPID conPI_PumChi1( controllerType=Modelica.Blocks.Types.SimpleController.PI, Td=1, @@ -258,8 +245,8 @@ model TwoSourcesThreeUsers Buildings.Fluid.Chillers.ElectricEIR chi1( redeclare final package Medium1 = Medium1, redeclare final package Medium2 = Medium2, - m1_flow_nominal=1.2*chi1.m2_flow_nominal, - m2_flow_nominal=1.5*m_flow_nominal, + final m1_flow_nominal=1.2*chi1.m2_flow_nominal, + final m2_flow_nominal=1.5*m_flow_nominal, final dp1_nominal=0, final dp2_nominal=0, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, @@ -296,6 +283,12 @@ model TwoSourcesThreeUsers extent={{-10,-10},{10,10}}, rotation=-90, origin={-120,150}))); + Buildings.Fluid.FixedResistances.CheckValve cheValChi1Pum( + redeclare package Medium = Medium2, + m_flow_nominal=chi1.vol2.m_flow_nominal, + dpValve_nominal=0.1*dp_nominal, + dpFixed_nominal=0.1*dp_nominal) "Check valve with series resistance" + annotation (Placement(transformation(extent={{-90,70},{-70,90}}))); equation connect(set_TRet.y,usr1. TSet) annotation (Line(points={{41,110},{44,110},{44, 82},{64,82},{64,71}}, color={0,0,127})); @@ -314,12 +307,10 @@ equation {-44,-48},{-50,-48}}, color={255,0,255})); connect(set_mChi2Pum1_flow.y, cat.set_mPum1_flow) annotation (Line(points={{-119, -70},{-80,-70},{-80,-49},{-70,-49}}, color={0,0,127})); - connect(sou_p.ports[1], preDroChi1.port_b) - annotation (Line(points={{-160,40},{-70,40}}, color={0,127,255})); connect(set_dpUsr.y, conPI_PumChi1.u_s) annotation (Line(points={{-60,139},{-60,122}}, color={0,0,127})); connect(conPI_PumChi1.y, pumChi1.y) - annotation (Line(points={{-60,99},{-60,92}}, color={0,0,127})); + annotation (Line(points={{-60,99},{-60,52}}, color={0,0,127})); connect(usr1.yVal_actual, mulMax_yVal.u[3]) annotation (Line(points={{71,66}, {86,66},{86,-110},{62,-110},{62,-109.333}},color={0,0,127})); connect(preDroS2U3.port_b,usr3. port_a) @@ -331,22 +322,14 @@ equation color={0,127,255})); connect(usr2.port_b,preDroU2S2. port_a) annotation (Line(points={{60,-10},{60,-20},{30,-20}}, color={0,127,255})); - connect(pumChi1.port_b,preDroS1U2. port_a) annotation (Line(points={{-50,80},{ - -36,80},{-36,20},{-30,20}}, color={0,127,255})); connect(preDroS1U2.port_b,usr2. port_a) annotation (Line(points={{-10,20},{60, 20},{60,10}}, color={0,127,255})); connect(usr2.port_b,preDroU2S1. port_a) annotation (Line(points={{60,-10},{60, -20},{34,-20},{34,0},{30,0}}, color={0,127,255})); - connect(preDroU2S1.port_b, preDroChi1.port_a) annotation (Line(points={{10,0}, - {4,0},{4,40},{-50,40}}, color={0,127,255})); - connect(pumChi1.port_b,preDroS1U1. port_a) - annotation (Line(points={{-50,80},{-30,80}}, color={0,127,255})); connect(preDroS1U1.port_b,usr1. port_a) annotation (Line(points={{-10,80},{60,80},{60,70}}, color={0,127,255})); connect(usr1.port_b,preDroU1S1. port_a) annotation (Line(points={{60,50},{60,40},{30,40}}, color={0,127,255})); - connect(preDroU1S1.port_b, preDroChi1.port_a) - annotation (Line(points={{10,40},{-50,40}}, color={0,127,255})); connect(set_QCooLoa1_flow.y,usr1. QCooLoa_flow) annotation (Line(points={{99,90},{68,90},{68,71}}, color={0,0,127})); connect(set_QCooLoa2_flow.y,usr2. QCooLoa_flow) @@ -390,18 +373,28 @@ equation -40},{-30,-40}}, color={0,127,255})); connect(cat.port_b2, preDroS2U2.port_a) annotation (Line(points={{-54,-50},{-54, -40},{-36,-40},{-36,0},{-30,0}}, color={0,127,255})); - connect(preDroChi1.port_b, chi1.port_a2) annotation (Line(points={{-70,40},{ - -104,40},{-104,50}}, color={0,127,255})); - connect(chi1.port_b2, pumChi1.port_a) annotation (Line(points={{-104,70},{ - -104,80},{-70,80}}, color={0,127,255})); connect(chi1.port_a1, souCDW1.ports[1]) annotation (Line(points={{-116,70},{ -134,70},{-134,110},{-140,110}}, color={0,127,255})); connect(sinCDW1.ports[1], chi1.port_b1) annotation (Line(points={{-140,70},{ -140,44},{-116,44},{-116,50}}, color={0,127,255})); - connect(set_TEvaLvg_chi1.y, chi1.TSet) annotation (Line(points={{-90,139},{ - -90,82},{-107,82},{-107,72}}, color={0,0,127})); + connect(set_TEvaLvg_chi1.y, chi1.TSet) annotation (Line(points={{-90,139},{-90, + 112},{-107,112},{-107,72}}, color={0,0,127})); connect(chi1On.y, chi1.on) annotation (Line(points={{-120,138},{-120,78},{ -113,78},{-113,72}}, color={255,0,255})); + connect(chi1.port_b2, cheValChi1Pum.port_a) annotation (Line(points={{-104,70}, + {-104,80},{-90,80}}, color={0,127,255})); + connect(preDroU1S1.port_b, pumChi1.port_a) + annotation (Line(points={{10,40},{-50,40}}, color={0,127,255})); + connect(pumChi1.port_b, chi1.port_a2) annotation (Line(points={{-70,40},{-104, + 40},{-104,50}}, color={0,127,255})); + connect(preDroU2S1.port_b, pumChi1.port_a) annotation (Line(points={{10,0},{4, + 0},{4,40},{-50,40}}, color={0,127,255})); + connect(cheValChi1Pum.port_b, preDroS1U1.port_a) + annotation (Line(points={{-70,80},{-30,80}}, color={0,127,255})); + connect(sou_p.ports[1], pumChi1.port_a) + annotation (Line(points={{-160,30},{-50,30},{-50,40}}, color={0,127,255})); + connect(cheValChi1Pum.port_b, preDroS1U2.port_a) annotation (Line(points={{-70, + 80},{-36,80},{-36,20},{-30,20}}, color={0,127,255})); annotation (experiment(Tolerance=1e-06, StopTime=3600,__Dymola_Algorithm="Dassl"), Diagram(coordinateSystem(extent={{-180,-140},{140,180}})), Icon( coordinateSystem(extent={{-100,-100},{100,100}}))); From 10263d5a75f2ceebe4ba7c9503c9fc33bceeef58 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Fri, 18 Feb 2022 12:25:21 -0800 Subject: [PATCH 045/463] updated unit test results --- ...Plant_Examples_BaseClasses_Validation_DummyUser.txt | 4 ++-- ...s_Fluid_Storage_Plant_Examples_OneSourceOneUser.txt | 10 +++++----- ...Plant_Validation_ChillerAndTankNoRemoteCharging.txt | 10 +++++----- ...ant_Validation_ChillerAndTankWithRemoteCharging.txt | 10 +++++----- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_BaseClasses_Validation_DummyUser.txt b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_BaseClasses_Validation_DummyUser.txt index 6d3fdc65b15..9deff7d334a 100644 --- a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_BaseClasses_Validation_DummyUser.txt +++ b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_BaseClasses_Validation_DummyUser.txt @@ -1,7 +1,7 @@ last-generated=2022-02-18 statistics-initialization= { - "nonlinear": "1, 0", + "nonlinear": "1", "numerical Jacobians": "0" } statistics-simulation= @@ -12,4 +12,4 @@ statistics-simulation= "numerical Jacobians": "0" } time=[0e+00, 3.6e+03] -ideUsr.yVal_actual=[1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1.272909430554137e-04, 1.241715071955696e-04, 1.219527548528276e-04, 1.197708115796559e-04, 1.176342339022085e-04, 1.155391364591196e-04, 1.134615013143048e-04, 1.114163678721525e-04, 1.094104663934559e-04, 1.074407337000594e-04, 1.055070024449378e-04, 1.036086250678636e-04, 1.017520044115372e-04, 9.994534048018977e-05, 9.819325350690633e-05, 9.647602564655244e-05, 9.475364640820771e-05, 9.303280967287719e-05, 9.131900878855959e-05, 8.969323971541598e-05, 8.812700252747163e-05, 8.662965410621837e-05, 8.512233762303367e-05, 8.362649532500654e-05, 8.213629917008802e-05, 8.066956070251763e-05, 7.922919758129865e-05, 7.780796295264736e-05, 7.640321564394981e-05, 7.501013897126541e-05, 7.362718315562233e-05, 7.225717854453251e-05, 7.093447493389249e-05, 6.96592396707274e-05, 6.844638846814632e-05, 6.724944250890985e-05, 6.608083640458062e-05, 6.493459659395739e-05, 6.38013007119298e-05, 6.266939453780651e-05, 6.152515561552718e-05, 6.039172876626253e-05, 5.92983269598335e-05, 5.821061495225877e-05, 5.969988703727722e-01, 6.163977384567261e-01, 6.180650591850281e-01, 6.184282302856445e-01, 6.186715960502625e-01, 6.18894636631012e-01, 6.19111955165863e-01, 6.193211078643799e-01, 6.195241212844849e-01, 6.197197437286377e-01, 6.199082732200623e-01, 6.200908422470093e-01, 6.202675104141235e-01, 6.204381585121155e-01, 6.20603084564209e-01, 6.207624673843384e-01, 6.20916485786438e-01, 6.210653185844421e-01, 6.212091445922852e-01, 6.213481426239014e-01, 6.214824914932251e-01, 6.216122508049011e-01, 6.217376589775085e-01, 6.218587756156921e-01, 6.219757795333862e-01, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] +ideUsr.yVal_actual=[1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 2.372759878635403e-01, 3.455205296631902e-04, 3.444691537879407e-04, 3.38253885274753e-04, 3.321156546007842e-04, 3.260757948737592e-04, 3.201467043254524e-04, 3.143229987472296e-04, 3.086034848820418e-04, 3.029869694728404e-04, 2.97472404781729e-04, 2.92060780338943e-04, 2.86752445390448e-04, 2.81542626908049e-04, 2.764197124633938e-04, 2.713825961109251e-04, 2.664401254151016e-04, 2.615947742015123e-04, 2.568438067100942e-04, 2.521721762605011e-04, 2.475813671480864e-04, 2.430696767987683e-04, 2.386392297921702e-04, 2.342864027014002e-04, 2.300100459251553e-04, 2.258091699331999e-04, 2.216824941569939e-04, 2.176290436182171e-04, 2.136479306500405e-04, 2.09738194826059e-04, 2.05898453714326e-04, 2.021282853092998e-04, 1.984270056709647e-04, 1.947939890669659e-04, 1.912260340759531e-04, 1.877176546258852e-04, 1.842694910010323e-04, 1.808793604141101e-04, 1.775449200067669e-04, 1.742706663208082e-04, 1.710602518869564e-04, 1.679099950706586e-04, 1.648203178774565e-04, 1.617918896954507e-04, 8.601984977722168e-01, 8.841497898101807e-01, 8.862190246582031e-01, 8.866633772850037e-01, 8.869857788085938e-01, 8.873108625411987e-01, 8.876166939735413e-01, 8.87906014919281e-01, 8.881837725639343e-01, 8.884551525115967e-01, 8.887191414833069e-01, 8.889741897583008e-01, 8.8922119140625e-01, 8.894597291946411e-01, 8.896902799606323e-01, 8.899130821228027e-01, 8.901284337043762e-01, 8.903366923332214e-01, 8.905380964279175e-01, 8.907328248023987e-01, 8.909211158752441e-01, 8.911030888557434e-01, 8.912789821624756e-01, 8.914490342140198e-01, 8.916133642196655e-01, 2.971347793936729e-02, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] diff --git a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_OneSourceOneUser.txt b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_OneSourceOneUser.txt index fe05546e0da..337e08b98b1 100644 --- a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_OneSourceOneUser.txt +++ b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_OneSourceOneUser.txt @@ -1,18 +1,18 @@ last-generated=2022-02-18 statistics-initialization= { - "nonlinear": "1, 1", + "nonlinear": "1, 0, 1, 1", "numerical Jacobians": "0" } statistics-simulation= { "linear": "0", - "nonlinear": "1, 1", + "nonlinear": "1, 1, 1", "number of continuous time states": "18", "numerical Jacobians": "0" } time=[0e+00, 3.6e+03] cat.pum1.m_flow=[0e+00, 4.999552965164185e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01] -cat.mTan_flow=[0e+00, -4.999552965164185e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, 3.070253729820251e-01, 3.801476955413818e-01, 4.042422771453857e-01, 4.133095443248749e-01, 4.116810858249664e-01, 4.068382084369659e-01, 4.039308428764343e-01, 4.029046595096588e-01, 4.027837216854095e-01, 4.030833542346954e-01, 4.036327600479126e-01, 4.043649435043335e-01, 4.052524566650391e-01, 4.062803983688354e-01, 4.074440896511078e-01, 4.087449312210083e-01, 4.101872742176056e-01, 4.117770195007324e-01, 4.135231971740723e-01, 4.154362380504608e-01, 4.175280034542084e-01, 4.19810950756073e-01, 4.222981929779053e-01, 4.250039756298065e-01, 4.279427826404572e-01, 4.3112912774086e-01, 4.345769584178925e-01, 4.382987320423126e-01, 4.423046112060547e-01, 4.466004967689514e-01, 4.511853456497192e-01, 4.560467004776001e-01, 4.611557424068451e-01, -2.495844215154648e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01, -5e-01] -cat.pum2.m_flow=[0e+00, 2.685441527781159e-17, 2.846835714946586e-17, 2.968915331086347e-17, 3.060780024683016e-17, 3.129707330765835e-17, 3.181324393605879e-17, 3.219923949710053e-17, 3.248755826268956e-17, 3.270277411446361e-17, 3.286331001902545e-17, 3.298302952344148e-17, 3.30722988551482e-17, 3.313882402873216e-17, 3.318841846953839e-17, 3.322536697313991e-17, 3.325289885264813e-17, 3.327341624056189e-17, 3.328869261211452e-17, 3.33000779260657e-17, 3.33085647991505e-17, 3.331488115030795e-17, 3.331957953618725e-17, 3.332310001687428e-17, 3.332569736399769e-17, 3.332765612768822e-17, 3.332910203939896e-17, 3.333017737419528e-17, 3.333098801119558e-17, 3.333158358123662e-17, 3.33320302587674e-17, 3.333237105717977e-17, 3.333261921136354e-17, 3.33328011910983e-17, 8.070253729820251e-01, 8.801476955413818e-01, 9.042422771453857e-01, 9.133095741271973e-01, 9.11681056022644e-01, 9.068382382392883e-01, 9.039308428764343e-01, 9.029046297073364e-01, 9.027836918830872e-01, 9.030833840370178e-01, 9.036327600479126e-01, 9.043649435043335e-01, 9.052524566650391e-01, 9.062803983688354e-01, 9.074441194534302e-01, 9.087449312210083e-01, 9.101872444152832e-01, 9.117770195007324e-01, 9.135231971740723e-01, 9.154362678527832e-01, 9.175280332565308e-01, 9.19810950756073e-01, 9.222981929779053e-01, 9.250039458274841e-01, 9.279427528381348e-01, 9.311291575431824e-01, 9.345769286155701e-01, 9.382987022399902e-01, 9.423046112060547e-01, 9.466004967689514e-01, 9.511853456497192e-01, 9.560467004776001e-01, 9.611557126045227e-01, 2.504155933856964e-01, 4.018970826141172e-17, 3.840118495839447e-17, 3.709147680731476e-17, 3.612321557820713e-17, 3.540609961796041e-17, 3.487430520215007e-17, 3.447951174811321e-17, 3.418617695928966e-17, 3.396810237131863e-17, 3.380589225319698e-17, 3.368519667565814e-17, 3.359535162624508e-17, 3.352846911063649e-17, 3.34786662203159e-17, 3.344158205909392e-17, 3.341396084407955e-17, 3.339339051660658e-17, 3.337806782293965e-17, 3.336665934793132e-17, 3.335817247484653e-17, 3.335185281496662e-17, 3.334715112036487e-17, 3.334364387456765e-17, 3.334102336638708e-17, 3.333907122014145e-17, 3.333761207354091e-17, 3.333652350385479e-17, 3.333571286685449e-17, 3.333511067936855e-17, 3.333466069311532e-17, 3.33343232034254e-17, 3.333407174051918e-17, 3.333388314333952e-17] -usr.yVal_actual=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 5.981393730204358e-29, 9.361883059536155e-27, 1.084409862033361e-25, 2.619365550651089e-25, 3.747764761949902e-25, 5.952006312813308e-25, 1.146984231883947e-24, 2.270877518995943e-24, 3.095083337075383e-24, 3.40938228500967e-24, 3.977788910518523e-24, 4.668797142473205e-24, 4.863926620545053e-24, 4.875582829280599e-24, 5.181501116173044e-24, 5.432287492121403e-24, 5.377198968527104e-24, 5.399369509837888e-24, 5.572160024795688e-24, 5.614924963328625e-24, 5.552657805496815e-24, 5.601739942158761e-24, 5.675222729910551e-24, 5.6530269450508e-24, 5.607265123938929e-24, 5.496122116571888e-24, 5.367015563101606e-24, 5.371074646889421e-24, 5.481725010621152e-24, 8.00154447555542e-01, 9.586917757987976e-01, 9.685896039009094e-01, 9.215241670608521e-01, 8.659662008285522e-01, 8.281725645065308e-01, 8.080700635910034e-01, 7.975633144378662e-01, 7.917240858078003e-01, 7.884074449539185e-01, 7.866719961166382e-01, 7.860251069068909e-01, 7.861832976341248e-01, 7.869639992713928e-01, 7.882546782493591e-01, 7.899894714355469e-01, 7.921320199966431e-01, 7.946657538414001e-01, 7.975941896438599e-01, 8.009347915649414e-01, 8.047181963920593e-01, 8.089867234230042e-01, 8.137947916984558e-01, 8.192115426063538e-01, 8.253225088119507e-01, 8.322330117225647e-01, 8.4007328748703e-01, 8.490056395530701e-01, 8.592343926429749e-01, 8.710204362869263e-01, 8.847000002861023e-01, 9.00714635848999e-01, 9.196481704711914e-01, 2.209393084049225e-01, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] +cat.mTan_flow=[0e+00, -4.999551773071289e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, 2.893969416618347e-01, 3.502776920795441e-01, 3.745021224021912e-01, 3.929356634616852e-01, 4.070073962211609e-01, 4.177742600440979e-01, 4.260265231132507e-01, 4.318293333053589e-01, 4.110586643218994e-01, 4.04619425535202e-01, 4.037973880767822e-01, 4.040806889533997e-01, 4.045733213424683e-01, 4.05122309923172e-01, 4.056960344314575e-01, 4.062855541706085e-01, 4.068860113620758e-01, 4.074938297271729e-01, 4.081068336963654e-01, 4.087235927581787e-01, 4.093431234359741e-01, 4.099647402763367e-01, 4.105879962444305e-01, 4.112125039100647e-01, 4.118382036685944e-01, 4.1246497631073e-01, 4.130928516387939e-01, 4.137217998504639e-01, 4.143518507480621e-01, 4.149830341339111e-01, 4.156154692173004e-01, 4.162492156028748e-01, 4.168843924999237e-01, -2.810051441192627e-01, -4.999998211860657e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01] +cat.pum2.m_flow=[0e+00, 1.074058886274543e-07, 1.138643952458551e-07, 1.187495826115992e-07, 1.224258596721484e-07, 1.251844281568992e-07, 1.272499758897538e-07, 1.287942552608001e-07, 1.299478924465802e-07, 1.308092549834328e-07, 1.314519266770731e-07, 1.319312588066168e-07, 1.322886333809947e-07, 1.32554973220067e-07, 1.327534278061648e-07, 1.329012917494765e-07, 1.330114258735193e-07, 1.330933798726619e-07, 1.331544439153731e-07, 1.331999754938806e-07, 1.332339252257952e-07, 1.332592489688977e-07, 1.332781209839595e-07, 1.332921755192729e-07, 1.33302648919198e-07, 1.333104506784366e-07, 1.333162771288698e-07, 1.333206256504127e-07, 1.333238657252878e-07, 1.333262673597346e-07, 1.333280721382835e-07, 1.333294079586267e-07, 1.333304027184568e-07, 1.333311558937567e-07, 7.893969416618347e-01, 8.502776622772217e-01, 8.745021224021912e-01, 8.929356932640076e-01, 9.070073962211609e-01, 9.177742600440979e-01, 9.260265231132507e-01, 9.318293333053589e-01, 9.110586643218994e-01, 9.046193957328796e-01, 9.037973880767822e-01, 9.040806889533997e-01, 9.045733213424683e-01, 9.051223397254944e-01, 9.056960344314575e-01, 9.062855839729309e-01, 9.068859815597534e-01, 9.074938297271729e-01, 9.08106803894043e-01, 9.087235927581787e-01, 9.093431234359741e-01, 9.099647402763367e-01, 9.105879664421082e-01, 9.112125039100647e-01, 9.11838173866272e-01, 9.1246497631073e-01, 9.130928516387939e-01, 9.137217998504639e-01, 9.143518209457397e-01, 9.149830341339111e-01, 9.15615439414978e-01, 9.162492156028748e-01, 9.168843626976013e-01, 2.189948409795761e-01, 1.645939136096786e-07, 1.559465090394951e-07, 1.500950190802541e-07, 1.457720912867444e-07, 1.425723468173601e-07, 1.40200498321974e-07, 1.384403276460944e-07, 1.371328863797316e-07, 1.361610628691778e-07, 1.354383414309268e-07, 1.349006595319224e-07, 1.345004392305782e-07, 1.34202508661474e-07, 1.339806772193697e-07, 1.338154902441602e-07, 1.336924668748907e-07, 1.336008494945418e-07, 1.335326089701994e-07, 1.334817625320284e-07, 1.334439048150671e-07, 1.334157104793121e-07, 1.333947636794619e-07, 1.333791459501299e-07, 1.333675356818276e-07, 1.333588670604513e-07, 1.333524011215559e-07, 1.33347555220098e-07, 1.333439456630003e-07, 1.333412456006045e-07, 1.333392418700896e-07, 1.333377497303445e-07, 1.33336627072822e-07, 1.333357886323938e-07] +usr.yVal_actual=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 9.211110472679138e-01, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 9.946639537811279e-01, 9.245693683624268e-01, 9.071856737136841e-01, 9.031168222427368e-01, 9.018986821174622e-01, 9.015378952026367e-01, 9.016034603118896e-01, 9.019418358802795e-01, 9.024718403816223e-01, 9.031393527984619e-01, 9.039061665534973e-01, 9.047455191612244e-01, 9.056385159492493e-01, 9.065719246864319e-01, 9.075362086296082e-01, 9.08524751663208e-01, 9.095327258110046e-01, 9.105567336082458e-01, 9.115946888923645e-01, 9.126449227333069e-01, 9.137066006660461e-01, 9.147792458534241e-01, 9.158623814582825e-01, 9.169560670852661e-01, 9.180601239204407e-01, 9.191747307777405e-01, 2.95667439699173e-01, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] diff --git a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ChillerAndTankNoRemoteCharging.txt b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ChillerAndTankNoRemoteCharging.txt index 5f858ad5628..6e3d764aa4a 100644 --- a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ChillerAndTankNoRemoteCharging.txt +++ b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ChillerAndTankNoRemoteCharging.txt @@ -1,17 +1,17 @@ last-generated=2022-02-18 statistics-initialization= { - "nonlinear": "1, 0, 1", + "nonlinear": "2, 0, 1, 1", "numerical Jacobians": "0" } statistics-simulation= { "linear": "0", - "nonlinear": "1, 1", + "nonlinear": "1, 1, 1", "number of continuous time states": "16", "numerical Jacobians": "0" } time=[0e+00, 3.6e+03] -cat.pum1.m_flow=[0e+00, 1.999821186065674e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00] -cat.mTan_flow=[-3.162276983261108e+00, 1.815570831298828e+00, 1.977542042732239e+00, 1.997248411178589e+00, 1.999664306640625e+00, 1.999959826469421e+00, 1.999994993209839e+00, 1.999999284744263e+00, 2.000000238418579e+00, 2e+00, 1.99999988079071e+00, 2e+00, 1.999999761581421e+00, 2e+00, 1.99999988079071e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, -1.951377511024475e+00, -1.993082284927368e+00, -1.999021768569946e+00, -1.999862432479858e+00, -1.999980926513672e+00, -1.999997138977051e+00, -2.000000715255737e+00, -2e+00, -1.999999403953552e+00, -2.000000476837158e+00, -2.000000476837158e+00, -1.999998927116394e+00, -2e+00, -2.000000953674316e+00, -2e+00, -1.99999988079071e+00, -2.000000238418579e+00, -1.99999988079071e+00, -2e+00, -2e+00, -2e+00, -2e+00, -1.99999988079071e+00, -2e+00, -2e+00, -2.489950321614742e-02, -2.032148186117411e-03, -1.879055344033986e-04, -1.676656029303538e-05, -1.455567371522176e-06, -1.450179496487167e-07, -6.123531903767798e-08, -2.721677105910203e-09, -6.098621163630469e-09, 2.251656416873971e-09, -1.193770859941878e-08, -1.652811754127015e-08, -4.03019306816077e-09, 2.976728932790884e-11, 8.669558404506006e-10, 6.49326703516806e-10, 4.43692749207969e-10, 2.380789732026045e-10, 7.956457714897169e-11, 5.455449286762004e-11, 2.956459729808181e-11, 9.932860089989504e-12, 7.596583084801267e-12, 5.341053120611061e-12, 3.004775681741956e-12, 1.97849702835083e+00, 1.997369408607483e+00, 1.999676585197449e+00, 1.999956130981445e+00, 1.999992489814758e+00, 1.999998211860657e+00, 1.999999284744263e+00, 2.000000476837158e+00, 2.000000476837158e+00, 1.99999988079071e+00, 1.999999523162842e+00, 1.99999988079071e+00, 2.000000715255737e+00, 2.000000476837158e+00, 1.999999403953552e+00, 1.999999046325684e+00, 1.99999988079071e+00, 1.999999403953552e+00, 2.000000238418579e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2.000000238418579e+00, 2e+00] -cat.pum2.m_flow=[-3.162276983261108e+00, 3.815392017364502e+00, 3.977541923522949e+00, 3.997248411178589e+00, 3.999664306640625e+00, 3.999959707260132e+00, 3.999994993209839e+00, 3.999999284744263e+00, 4e+00, 4e+00, 3.999999761581421e+00, 4e+00, 3.999999761581421e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4.86225001513958e-02, 6.917736027389729e-03, 9.782627457752774e-04, 1.375945721520111e-04, 1.907924888655543e-05, 2.89514468931884e-06, -8.173752803486423e-07, -2.749661831558114e-08, 6.047547458365443e-07, -4.714861177035345e-07, -5.0687401653704e-07, 1.041804466694884e-06, -3.431835793321625e-08, -8.8085664629034e-07, -7.954825065326077e-08, 1.744794673186334e-07, -2.87328987269575e-07, 6.874531521816607e-08, 5.706207417688347e-08, -1.596565546435613e-08, -5.446603168479669e-08, -8.744642343572195e-08, 9.183665383716288e-08, -1.045633482021913e-07, 4.004360931730844e-08, 1.975100517272949e+00, 1.997967839241028e+00, 1.999812126159668e+00, 1.999983191490173e+00, 1.999998569488525e+00, 1.99999988079071e+00, 1.99999988079071e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 3.97849702835083e+00, 3.997369527816772e+00, 3.999676704406738e+00, 3.999956130981445e+00, 3.999992370605469e+00, 3.999998092651367e+00, 3.999999284744263e+00, 4.000000476837158e+00, 4.000000476837158e+00, 4e+00, 3.999999523162842e+00, 4e+00, 4.000000476837158e+00, 4.000000476837158e+00, 3.999999284744263e+00, 3.999999046325684e+00, 4e+00, 3.999999523162842e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00, 4e+00] +cat.pum1.m_flow=[0e+00, 1.999821424484253e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00] +cat.mTan_flow=[-1.405874849297106e-03, 1.710717439651489e+00, 1.734940767288208e+00, 1.734954833984375e+00, 1.734955191612244e+00, 1.734954595565796e+00, 1.734954714775085e+00, 1.734955072402954e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954595565796e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, -1.927103996276855e+00, -1.988791942596436e+00, -1.997898459434509e+00, -1.999399185180664e+00, -1.999738454818726e+00, -1.999849796295166e+00, -1.99989914894104e+00, -1.999925851821899e+00, -1.999942064285278e+00, -1.999952673912048e+00, -1.99996018409729e+00, -1.999965667724609e+00, -1.999969959259033e+00, -1.999973297119141e+00, -1.9999760389328e+00, -1.999978184700012e+00, -1.999979972839355e+00, -1.99998152256012e+00, -1.999982953071594e+00, -1.9999840259552e+00, -1.999985098838806e+00, -1.999985933303833e+00, -1.99998676776886e+00, -1.999987483024597e+00, -1.999988079071045e+00, -3.463954105973244e-02, -3.821860766038299e-03, -4.146151768509299e-04, -4.441050623427091e-05, -4.910070401820078e-06, -1.501270219250436e-07, -2.728233994275797e-07, -3.502605849803331e-08, 5.74102436701196e-08, -1.034929031362708e-08, 3.200042009154913e-09, 3.435048356870141e-10, -3.678815030383475e-09, -7.299594817489208e-10, 4.498274669417768e-11, 3.058595043903267e-11, 1.619188463863885e-11, 3.536669871892495e-12, 2.942911756301236e-12, 2.349993463712785e-12, 1.753296618133005e-12, 1.161637734788112e-12, 5.666202099532947e-13, 1.491743198151624e-13, 4.536133499529436e-14, 1.733797311782837e+00, 1.734954714775085e+00, 1.734954476356506e+00, 1.734953999519348e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954833984375e+00, 1.734954833984375e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00] +cat.pum2.m_flow=[-1.405874849297106e-03, 3.710538864135742e+00, 3.734940767288208e+00, 3.734954833984375e+00, 3.734955072402954e+00, 3.734954595565796e+00, 3.734954595565796e+00, 3.734955072402954e+00, 3.734954833984375e+00, 3.734954595565796e+00, 3.734954833984375e+00, 3.734954595565796e+00, 3.734954595565796e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 7.289598137140274e-02, 1.120809186249966e-02, 2.101586200296871e-03, 6.008680793456733e-04, 2.615965786390007e-04, 1.502470404375345e-04, 1.008531544357538e-04, 7.415458094328642e-05, 5.797366611659527e-05, 4.735854963655584e-05, 3.987475429312326e-05, 3.43233004969079e-05, 3.005949292855803e-05, 2.67077030002838e-05, 2.401932033535559e-05, 2.181750278396066e-05, 1.998077277676202e-05, 1.842482197389472e-05, 1.708855415927246e-05, 1.592809894646052e-05, 1.49121624417603e-05, 1.401423742208863e-05, 1.321873878623592e-05, 1.250972309208009e-05, 1.187621637654956e-05, 1.965360403060913e+00, 1.996178150177002e+00, 1.999585390090942e+00, 1.999955534934998e+00, 1.999995112419128e+00, 1.99999988079071e+00, 1.999999761581421e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 3.733797311782837e+00, 3.734954595565796e+00, 3.734954595565796e+00, 3.734954118728638e+00, 3.734954833984375e+00, 3.734954595565796e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00] diff --git a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ChillerAndTankWithRemoteCharging.txt b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ChillerAndTankWithRemoteCharging.txt index b5b879bee83..3ec2205b553 100644 --- a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ChillerAndTankWithRemoteCharging.txt +++ b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ChillerAndTankWithRemoteCharging.txt @@ -1,17 +1,17 @@ last-generated=2022-02-18 statistics-initialization= { - "nonlinear": "2, 0, 1", + "nonlinear": "2, 0, 1, 1", "numerical Jacobians": "0" } statistics-simulation= { "linear": "0", - "nonlinear": "2, 1", + "nonlinear": "2, 1, 1", "number of continuous time states": "21", "numerical Jacobians": "0" } time=[0e+00, 3.6e+03] -cat.pum1.m_flow=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 9.901783466339111e-01, 9.999966621398926e-01, 9.999997615814209e-01, 9.999998807907104e-01, 9.999999403953552e-01, 9.999999403953552e-01, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 3.073412366211414e-02, 6.693091108900262e-06, -5.542994188645345e-11, -8.607626417189707e-11, -2.716230296240241e-10, -6.555429116206213e-11, -7.279420122241476e-12, 3.332944814235517e-12, 9.881994528226912e-12, -1.704754718466484e-12, 7.765381762094015e-13, -8.036884417521317e-13, -5.336645838779908e-13, 8.070588874932103e-14, 5.904567148938425e-15, 7.842849905399825e-19, 7.616250091517132e-23, 8.356131627698031e-27, 8.881296163965407e-31, 9.294270507770152e-35, 9.61375805343609e-39, 3.930642192431112e-42, 8.814167340603099e-43, 5.605193857299268e-45, -0e+00, -0e+00, -0e+00, -0e+00, -0e+00] -cat.mTan_flow=[-3.33333325719238e-16, -3.33333325719238e-16, -3.33333325719238e-16, -3.33333325719238e-16, -3.33333325719238e-16, -3.33333325719238e-16, -3.33333325719238e-16, -3.33333325719238e-16, -3.33333325719238e-16, -3.33333325719238e-16, -3.33333325719238e-16, -3.33333325719238e-16, -3.33333325719238e-16, -3.33333325719238e-16, -3.33333325719238e-16, -9.901783466339111e-01, -9.999966621398926e-01, -9.999997615814209e-01, -9.999998807907104e-01, -9.999999403953552e-01, -9.999999403953552e-01, -1e+00, -1e+00, -1e+00, -1e+00, -1e+00, -1e+00, -1e+00, -1e+00, -1.024686574935913e+00, -1.043086647987366e+00, -1.021176218986511e+00, -1.010402798652649e+00, -1.005110025405884e+00, -1.00251042842865e+00, -1.001232624053955e+00, -1.000605463981628e+00, -1.000297427177429e+00, -1.00014591217041e+00, -1.00007152557373e+00, -1.000035047531128e+00, -1.000016689300537e+00, -1.000007629394531e+00, -1.880103200674057e-01, -5.261019337922335e-03, -2.562662120908499e-03, -1.248308690264821e-03, -6.080908933654428e-04, -2.962449216283858e-04, -1.443218934582546e-04, -7.030835695331916e-05, -3.425246177357621e-05, -1.672041253186762e-05, -8.174435606633779e-06, -3.950395239371557e-06, -1.905852968775426e-06, -1.001239525066918e-06, -5.709385959562496e-07, 9.950401782989502e-01, 9.976197481155396e-01, 9.988314509391785e-01, 9.994263052940369e-01, 9.99718189239502e-01, 9.99861478805542e-01, 9.999319314956665e-01, 9.99966561794281e-01, 9.99983549118042e-01, 9.999918937683105e-01, 9.999960064888e-01, 9.999980330467224e-01, 9.999990463256836e-01, 9.999995231628418e-01, 1.00039005279541e+00, 1.000199675559998e+00, 1.000097274780273e+00, 1.00004780292511e+00, 1.000023484230042e+00, 1.000011920928955e+00, 1.000005722045898e+00, 1.00000274181366e+00, 1.000001430511475e+00, 1.000000715255737e+00, 1.000000357627869e+00, 1.00000011920929e+00, 1.00000011920929e+00, 1e+00, -2.914130926132202e+00, -7.7321857213974e-01, -6.831806898117065e-01, -9.602615833282471e-01, -1.015051364898682e+00, -1.003048658370972e+00, -1.001908183097839e+00, -1.000933766365051e+00, -1.000456094741821e+00, -1.000229835510254e+00, -1.000115036964417e+00, -1.000054121017456e+00, -1.000027060508728e+00, -1.000013113021851e+00, -1.000006318092346e+00] -cat.pum2.m_flow=[-2.222222171461587e-16, -2.222222171461587e-16, -2.222222171461587e-16, -2.222222171461587e-16, -2.222222171461587e-16, -2.222222171461587e-16, -2.222222171461587e-16, -2.222222171461587e-16, -2.222222171461587e-16, -2.222222171461587e-16, -2.222222171461587e-16, -2.222222171461587e-16, -2.222222171461587e-16, -2.222222171461587e-16, -2.222222171461587e-16, -2.004343724557406e-16, -2.000001489562645e-16, -2.000000166073665e-16, -2.000000033724767e-16, -2.000000033724767e-16, -2.000000033724767e-16, -2.000000033724767e-16, -2.000000033724767e-16, -2.000000033724767e-16, -2.000000033724767e-16, -2.000000033724767e-16, -2.000000033724767e-16, -2.000000033724767e-16, -2.000000033724767e-16, -2.468659542500973e-02, -4.308666288852692e-02, -2.117623388767242e-02, -1.040274649858475e-02, -5.110021680593491e-03, -2.510400954633951e-03, -1.232640584930778e-03, -6.054604309611022e-04, -2.973998780362308e-04, -1.458620827179402e-04, -7.148591976147145e-05, -3.502097024465911e-05, -1.666733805905096e-05, -7.660745723114815e-06, 8.119896650314331e-01, 9.947389960289001e-01, 9.974373579025269e-01, 9.98751699924469e-01, 9.993919134140015e-01, 9.997037649154663e-01, 9.998556971549988e-01, 9.99929666519165e-01, 9.999657273292542e-01, 9.999832510948181e-01, 9.999918341636658e-01, 9.999960660934448e-01, 9.999980926513672e-01, 9.999989867210388e-01, 9.999994039535522e-01, 1.99504017829895e+00, 1.99761974811554e+00, 1.998831391334534e+00, 1.999426364898682e+00, 1.999718189239502e+00, 1.999861478805542e+00, 1.999931931495667e+00, 1.999966502189636e+00, 1.999983549118042e+00, 1.999991893768311e+00, 1.999996066093445e+00, 1.999998092651367e+00, 1.999999046325684e+00, 1.999999523162842e+00, 1.031124234199524e+00, 1.000206351280212e+00, 1.000097274780273e+00, 1.00004780292511e+00, 1.000023484230042e+00, 1.000011920928955e+00, 1.000005722045898e+00, 1.00000274181366e+00, 1.000001430511475e+00, 1.000000715255737e+00, 1.000000357627869e+00, 1.00000011920929e+00, 1.00000011920929e+00, 1e+00, -2.914130926132202e+00, -7.7321857213974e-01, -4.020783007144928e-01, -1.479509174823761e-01, -1.650157012045383e-02, -3.057940048165619e-04, -3.992808615294052e-06, -4.984685020303914e-08, -6.021414478141196e-10, -7.21512476500874e-12, -9.158407539289204e-14, -2.058481914790503e-15, -3.136944962602327e-16, -2.107064204164323e-16, -2.01174335144506e-16] +cat.pum1.m_flow=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 9.901783466339111e-01, 9.999966621398926e-01, 9.999997615814209e-01, 9.999998807907104e-01, 9.999999403953552e-01, 9.999999403953552e-01, 1.00000011920929e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 3.073466755449772e-02, 6.861325800855411e-06, 1.318177678122368e-09, -3.764059810368314e-12, 2.581148619493212e-12, 4.337341033208708e-13, 9.765097259452349e-14, 4.721079586024034e-15, -1.161481562241429e-14, 1.938633274907713e-14, -2.732920252338715e-15, 5.10808459858067e-16, -2.51081609040958e-16, 1.700699221276786e-16, -5.95751979413911e-18, -5.198573170567294e-22, -6.457490878027597e-26, -5.681643423061059e-30, -4.877551719086363e-34, -4.214989192656818e-38, -3.734460407425637e-42, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, -0e+00, 0e+00, 0e+00] +cat.mTan_flow=[-3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -9.901787042617798e-01, -9.999970197677612e-01, -1.00000011920929e+00, -1.000000238418579e+00, -1.000000357627869e+00, -1.000000238418579e+00, -1.000000476837158e+00, -1.000000357627869e+00, -1.000000357627869e+00, -1.000000357627869e+00, -1.000000357627869e+00, -1.000000357627869e+00, -1.000000357627869e+00, -1.000000357627869e+00, -1.001257061958313e+00, -1.001254200935364e+00, -1.00125253200531e+00, -1.001250743865967e+00, -1.001248955726624e+00, -1.001246929168701e+00, -1.001244902610779e+00, -1.001242637634277e+00, -1.001240372657776e+00, -1.001237988471985e+00, -1.001235485076904e+00, -1.001232862472534e+00, -1.001230120658875e+00, -1.001227378845215e+00, -1.000674843788147e+00, -5.952231213450432e-02, -2.912065014243126e-02, -1.426701992750168e-02, -6.99062692001462e-03, -3.426197916269302e-03, -1.679294626228511e-03, -8.231080137193203e-04, -4.034376761410385e-04, -1.978223299374804e-04, -9.762997069628909e-05, -4.743236422655152e-05, -2.238212073280001e-05, -1.086261454474875e-05, -5.532525847229408e-06, 9.870973229408264e-01, 9.935631155967712e-01, 9.968100786209106e-01, 9.984188079833984e-01, 9.992182850837708e-01, 9.996134042739868e-01, 9.998087882995605e-01, 9.999048709869385e-01, 9.999517798423767e-01, 9.999758005142212e-01, 9.99988317489624e-01, 9.999943375587463e-01, 9.99997079372406e-01, 9.999983906745911e-01, 1.009098649024963e+00, 1.004485368728638e+00, 1.002213478088379e+00, 1.001092076301575e+00, 1.000539064407349e+00, 1.00026547908783e+00, 1.000131249427795e+00, 1.000064849853516e+00, 1.000032067298889e+00, 1.000015735626221e+00, 1.00000786781311e+00, 1.000003933906555e+00, 1.000001907348633e+00, 1.000000953674316e+00, -1.298328978009522e-03, -1.405618968419731e-03, -1.010759621858597e-01, -1.07781457901001e+00, -9.684461355209351e-01, -9.93242621421814e-01, -9.956064820289612e-01, -9.979210495948792e-01, -9.989652633666992e-01, -9.99487578868866e-01, -9.997451305389404e-01, -9.998742341995239e-01, -9.999381899833679e-01, -9.999697804450989e-01, -9.999846816062927e-01] +cat.pum2.m_flow=[-2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.404756287432974e-07, -2.399546588094381e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -1.256993738934398e-03, -1.254053087905049e-03, -1.252415706403553e-03, -1.25066633336246e-03, -1.248805900104344e-03, -1.246835570782423e-03, -1.244755811057985e-03, -1.242567552253604e-03, -1.240271609276533e-03, -1.237868680618703e-03, -1.235359814018011e-03, -1.232745940797031e-03, -1.230027875863016e-03, -1.227206783369184e-03, -6.746912258677185e-04, 9.404778480529785e-01, 9.708794951438904e-01, 9.857330918312073e-01, 9.930095076560974e-01, 9.965739250183105e-01, 9.983208179473877e-01, 9.991770386695862e-01, 9.995967149734497e-01, 9.9980229139328e-01, 9.999024868011475e-01, 9.999526739120483e-01, 9.999777674674988e-01, 9.999892711639404e-01, 9.999945759773254e-01, 1.987097501754761e+00, 1.993563294410706e+00, 1.9968101978302e+00, 1.998418927192688e+00, 1.999218463897705e+00, 1.999613523483276e+00, 1.99980890750885e+00, 1.999904990196228e+00, 1.999951958656311e+00, 1.999975919723511e+00, 1.999988436698914e+00, 1.999994516372681e+00, 1.99999725818634e+00, 1.999998569488525e+00, 1.039833426475525e+00, 1.004492402076721e+00, 1.002213716506958e+00, 1.001092314720154e+00, 1.000539183616638e+00, 1.000265598297119e+00, 1.000131368637085e+00, 1.000064969062805e+00, 1.000032186508179e+00, 1.0000159740448e+00, 1.000008106231689e+00, 1.000004053115845e+00, 1.000002145767212e+00, 1.000001072883606e+00, -1.29819568246603e-03, -1.405485672876239e-03, -1.402487047016621e-03, -1.233650604262948e-03, -8.664834313094616e-04, -4.151752000325359e-05, -1.396627567373798e-06, -3.217834034785483e-07, -2.483978960299282e-07, -2.4087069050438e-07, -2.400690846116049e-07, -2.399721950041567e-07, -2.399577283540566e-07, -2.399560230514908e-07, -2.399555683041399e-07] From 80777b42f69231acfd2072c5e36d904e2120af2b Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Fri, 18 Feb 2022 14:38:25 -0800 Subject: [PATCH 046/463] documentation and unit test TwoSourcesThreeUsers --- .../Plant/Examples/TwoSourcesThreeUsers.mo | 114 ++++++++++++++++-- .../ChillerAndTankWithRemoteCharging.mo | 3 - ...ge_Plant_Examples_TwoSourcesThreeUsers.txt | 23 ++++ .../Plant/Examples/TwoSourcesThreeUsers.mos | 31 +++++ ...ge.Plant.Examples.TwoSourcesThreeUsers.mos | 12 ++ 5 files changed, 173 insertions(+), 10 deletions(-) create mode 100644 Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_TwoSourcesThreeUsers.txt create mode 100644 Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos create mode 100644 Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.TwoSourcesThreeUsers.mos diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index 9907937e19e..f36cd7d206d 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -1,6 +1,6 @@ within Buildings.Fluid.Storage.Plant.Examples; model TwoSourcesThreeUsers - "(Draft) District model with two sources and three users" + "(Draft) District system model with two sources and three users" extends Modelica.Icons.Example; package Medium1 = Buildings.Media.Water "Medium model for CDW"; @@ -19,14 +19,14 @@ model TwoSourcesThreeUsers "Nominal temperature of CHW return"; parameter Modelica.Units.SI.Temperature T_CHWS_nominal=7+273.15 "Nominal temperature of CHW supply"; - parameter Modelica.Units.SI.Power QCooLoa_flow_nominal=5*4200*0.5 + parameter Modelica.Units.SI.Power QCooLoa_flow_nominal=5*4200*0.6 "Nominal cooling load of one consumer"; Buildings.Fluid.Storage.Plant.ChillerAndTank cat( redeclare final package Medium1 = Medium1, redeclare final package Medium2 = Medium2, - final mChi_flow_nominal=0.75*m_flow_nominal, - final mTan_flow_nominal=0.75*m_flow_nominal, + final mChi_flow_nominal=0.3*m_flow_nominal, + final mTan_flow_nominal=0.3*m_flow_nominal, final p_CHWS_nominal=p_CHWS_nominal, final p_CHWR_nominal=p_CHWR_nominal, final T_CHWS_nominal=T_CHWS_nominal, @@ -246,7 +246,7 @@ model TwoSourcesThreeUsers redeclare final package Medium1 = Medium1, redeclare final package Medium2 = Medium2, final m1_flow_nominal=1.2*chi1.m2_flow_nominal, - final m2_flow_nominal=1.5*m_flow_nominal, + final m2_flow_nominal=0.7*m_flow_nominal, final dp1_nominal=0, final dp2_nominal=0, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, @@ -395,7 +395,107 @@ equation annotation (Line(points={{-160,30},{-50,30},{-50,40}}, color={0,127,255})); connect(cheValChi1Pum.port_b, preDroS1U2.port_a) annotation (Line(points={{-70, 80},{-36,80},{-36,20},{-30,20}}, color={0,127,255})); - annotation (experiment(Tolerance=1e-06, StopTime=3600,__Dymola_Algorithm="Dassl"), + annotation (__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos" + "Simulate and plot"), + experiment(Tolerance=1e-06, StopTime=3600,__Dymola_Algorithm="Dassl"), Diagram(coordinateSystem(extent={{-180,-140},{140,180}})), Icon( - coordinateSystem(extent={{-100,-100},{100,100}}))); + coordinateSystem(extent={{-100,-100},{100,100}})), + Documentation(info=" +

    +(Draft) +This is a district system model with two CHW sources and three users +as described in +#2859. +

    +

    +The first source is a simplified CHW plant with only a chiller, +a single supply pump, and a check valve (with series resistance built in). +This supply pump is controlled to ensure that all users have enough pressure head. +The system is pressurised before this supply pump. +

    +

    +The second source has a chiller and a stratified CHW tank. Its piping is arranged +in a way that allows the tank to be charged remotely by the other source. +Its supply pump is controlled to maintain the flow rate setpoint of the tank. +This plant is offline when the most open control valve of all users is less than +5% open and is back online when this value is more than 50%. +

    +

    +The timetables give the system the following behaviour: +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Time slots123456789
    User 1-Has loadHas loadHas load-----
    User 2--Has loadHas loadHas load----
    User 3---Has loadHas loadHas loadHas load--
    Tank
    (being charged)
    Local-----RemoteRemote-
    +", revisions=" +
      +
    • +February 18, 2022 by Hongxiang Fu:
      +First implementation. This is for +#2859. +
    • +
    +")); end TwoSourcesThreeUsers; diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo index 01bf6a63a77..15c76b0b51b 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo @@ -1,9 +1,6 @@ within Buildings.Fluid.Storage.Plant.Validation; model ChillerAndTankWithRemoteCharging "(Draft) Validation model of the plant allowing remote charging" -/* - -*/ extends Modelica.Icons.Example; diff --git a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_TwoSourcesThreeUsers.txt b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_TwoSourcesThreeUsers.txt new file mode 100644 index 00000000000..69ec2e440e4 --- /dev/null +++ b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_TwoSourcesThreeUsers.txt @@ -0,0 +1,23 @@ +last-generated=2022-02-18 +statistics-initialization= +{ + "nonlinear": "6, 0, 0, 0, 1, 1", + "numerical Jacobians": "0" +} +statistics-simulation= +{ + "linear": "0", + "nonlinear": "5, 1, 1", + "number of continuous time states": "33", + "numerical Jacobians": "0" +} +time=[0e+00, 3.6e+03] +pumChi1.m_flow=[2.90360344479268e-06, 2.574263646692998e-07, 2.841550212906441e-07, 3.041250238311477e-07, 3.1895160645945e-07, 3.299363697806257e-07, 3.380644102435326e-07, 3.440725322434446e-07, 3.48510639014421e-07, 3.517874063163617e-07, 3.54205752728376e-07, 3.559900392247073e-07, 3.943333625793457e-01, -4.101347585674375e-04, -6.165397935546935e-04, -6.312931654974818e-04, -6.325669819489121e-04, -6.326818256638944e-04, -6.326654111035168e-04, -6.326350849121809e-04, -6.326043512672186e-04, -6.325736176222563e-04, -6.325450958684087e-04, 1.676010340452194e-01, 2.260444015264511e-01, 2.280271947383881e-01, 2.296319901943207e-01, 2.309540957212448e-01, 2.3201884329319e-01, 2.328718602657318e-01, 2.335596978664398e-01, 2.341222614049911e-01, 2.345906794071198e-01, 2.349889278411865e-01, 6.076617836952209e-01, 6.48245096206665e-01, 6.502888202667236e-01, 6.512425541877747e-01, 6.520718932151794e-01, 6.528275609016418e-01, 6.53529942035675e-01, 6.541922688484192e-01, 6.548252105712891e-01, 6.554367542266846e-01, 6.560323238372803e-01, 9.176848828792572e-02, 4.775870547746308e-05, 2.880391664803028e-03, 2.49257986433804e-03, 2.490735845640302e-03, 2.735406626015902e-03, 3.157721599563956e-03, 3.707779105752707e-03, 4.348243586719036e-03, 5.058615934103732e-03, 5.812733899801975e-03, -6.395064992830209e-04, -8.454701746813953e-04, -8.459485834464431e-04, -8.459427626803517e-04, -8.459385135211051e-04, -8.459388627670705e-04, -8.459365926682949e-04, -8.45934497192502e-04, -8.459328673779964e-04, -8.459310047328472e-04, -8.459292585030198e-04, 3.49773645401001e-01, 6.095951795578003e-01, 6.278272271156311e-01, 8.526263236999512e-01, 9.942406415939331e-01, 1.00286340713501e+00, 1.00541627407074e+00, 1.006456851959229e+00, 1.006974339485168e+00, 1.007259845733643e+00, 1.007426261901855e+00, 8.565613031387329e-01, 2.290953099727631e-01, 2.2487448528409e-02, 1.25402444973588e-02, 3.783038817346096e-03, 9.858713019639254e-05, 2.056120820270735e-06, 5.082055736238544e-07, 4.589337549987249e-07, 4.506961204242543e-07, 4.46475212356745e-07, 4.379380413865874e-07, 3.667765611226059e-07, 3.652176587820577e-07, 3.641101784523926e-07, 3.632943617049023e-07, 3.626925320077135e-07, 3.622492954491463e-07, 3.619223889472778e-07, 3.61681372851308e-07, 3.615036234805302e-07, 3.613725994000561e-07, 3.612759940097021e-07] +cat.pum1.m_flow=[0e+00, 7.499329447746277e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 1.377374976873398e-01, 4.026739043183625e-05, 6.58272858444775e-09, 8.910557296355759e-13, 1.052406276181252e-16, -5.700009189518855e-20, 2.319422353975646e-20, 3.069957089516106e-20, 8.852726022438318e-21, 3.036209453383328e-21, 1.406305430596601e-20, -1.103355236646582e-21, -1.165023434678379e-25, -1.193496604819255e-29, -1.265150774327442e-33, -7.832539269203836e-38, -7.257324746738228e-42, -4.203895392974451e-45, -1.401298464324817e-45, -0e+00, 0e+00, 0e+00, 2.080670595169067e-01, 7.497284412384033e-01, 7.499998807907104e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01] +cat.mTan_flow=[-2.397192702119355e-07, -7.499328851699829e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -5.513091683387756e-01, -7.352462410926819e-02, -1.417060196399689e-01, -1.474320441484451e-01, -1.477603018283844e-01, -1.477708965539932e-01, -1.477505415678024e-01, -1.477271020412445e-01, -1.477043628692627e-01, -1.47681713104248e-01, -1.476610749959946e-01, 2.484844624996185e-01, 2.320588976144791e-01, 2.286417037248611e-01, 2.26160004734993e-01, 2.243344783782959e-01, 2.229963392019272e-01, 2.220179736614227e-01, 2.213034778833389e-01, 2.207819074392319e-01, 2.204015105962753e-01, 2.201240658760071e-01, 4.022278189659119e-01, 4.10429835319519e-01, 4.098312556743622e-01, 4.092541038990021e-01, 4.088490903377533e-01, 4.085736870765686e-01, 4.083927273750305e-01, 4.082804620265961e-01, 4.08218115568161e-01, 4.081920683383942e-01, 4.0819251537323e-01, 4.507285356521606e-01, 4.582361280918121e-01, 4.601562023162842e-01, 4.618924558162689e-01, 4.631564021110535e-01, 4.640700817108154e-01, 4.647232592105865e-01, 4.651826024055481e-01, 4.654980897903442e-01, 4.657061100006104e-01, 4.658348560333252e-01, 1.348630785942009e-01, -1.46227702498436e-01, -1.469586342573166e-01, -1.469497382640839e-01, -1.469432860612869e-01, -1.469438225030899e-01, -1.469403356313705e-01, -1.469371169805527e-01, -1.469346880912781e-01, -1.469318419694901e-01, -1.46929144859314e-01, -1.377610415220261e-01, -2.340786013519391e-04, -2.388485707342625e-02, -2.614861726760864e-01, -4.026770293712616e-01, -4.114053547382355e-01, -4.097591936588287e-01, -4.082532227039337e-01, -4.073703587055206e-01, -4.068644344806671e-01, -4.065663814544678e-01, -4.868537485599518e-01, -2.290947288274765e-01, -2.248694002628326e-02, -1.253976486623287e-02, -3.782580140978098e-03, -9.814348595682532e-05, -1.623605271561246e-06, -8.416171226599545e-08, -4.121969965353856e-08, -3.764507638948089e-08, -3.685830307631477e-08, -2.080670893192291e-01, -7.497284412384033e-01, -7.499998211860657e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01] +cat.pum2.m_flow=[-1.598027523641576e-07, 3.168741358194893e-08, 3.022457661927547e-08, 2.912550911560174e-08, 2.830951295607065e-08, 2.770495477477652e-08, 2.725762016098088e-08, 2.692695844075388e-08, 2.668270049355215e-08, 2.650236119450256e-08, 2.636926588195365e-08, 2.627106532315793e-08, 1.986908316612244e-01, 6.76475465297699e-01, 6.082940697669983e-01, 6.025680303573608e-01, 6.022397875785828e-01, 6.022291779518127e-01, 6.022495031356812e-01, 6.022729873657227e-01, 6.022956967353821e-01, 6.023183465003967e-01, 6.02338969707489e-01, 9.984844923019409e-01, 9.820589423179626e-01, 9.786417484283447e-01, 9.761600494384766e-01, 9.743345379829407e-01, 9.729964137077332e-01, 9.720180034637451e-01, 9.713035225868225e-01, 9.707819819450378e-01, 9.704015851020813e-01, 9.701241254806519e-01, 1.152227878570557e+00, 1.160429835319519e+00, 1.159831285476685e+00, 1.159254193305969e+00, 1.158849120140076e+00, 1.158573746681213e+00, 1.158392786979675e+00, 1.158280491828918e+00, 1.158218145370483e+00, 1.158192038536072e+00, 1.15819251537323e+00, 1.200728535652161e+00, 1.208236217498779e+00, 1.210156202316284e+00, 1.211892485618591e+00, 1.213156461715698e+00, 1.214070081710815e+00, 1.214723348617554e+00, 1.215182662010193e+00, 1.215498089790344e+00, 1.21570611000061e+00, 1.215834856033325e+00, 8.848631381988457e-01, 6.037723422050476e-01, 6.030414700508118e-01, 6.030503511428833e-01, 6.03056788444519e-01, 6.030562520027161e-01, 6.03059709072113e-01, 6.030629277229309e-01, 6.030653715133667e-01, 6.030682325363159e-01, 6.030709147453308e-01, -2.353951094846707e-05, -1.937928318511695e-04, -1.971050223801285e-04, -1.464236993342638e-04, -6.103904888732359e-05, -2.231381813544431e-06, -7.690326953024851e-08, -1.944775540607679e-08, -1.526295001497147e-08, -1.477478228650853e-08, -1.466873911226685e-08, -2.110327379512e-08, -2.758277517500574e-08, -3.032659279256222e-08, -2.867624182556483e-08, -2.749059468953874e-08, -2.661316500507382e-08, -2.594599912697504e-08, -2.543780830421838e-08, -2.50580907135145e-08, -2.477836424930047e-08, -2.457235304120786e-08, -2.057371695229904e-08, 2.564437195928804e-08, 2.576321733727127e-08, 2.582416591678793e-08, 2.586906333590377e-08, 2.590218706188807e-08, 2.592657999400672e-08, 2.5944572712433e-08, 2.59578367689528e-08, 2.596761916606738e-08, 2.597483117483534e-08, 2.598014781085567e-08] +cat.tan.sta_a.T=[2.851499938964844e+02, 2.851358337402344e+02, 2.851199951171875e+02, 2.851041564941406e+02, 2.850882873535156e+02, 2.850724487304688e+02, 2.850566101074219e+02, 2.85040771484375e+02, 2.8502490234375e+02, 2.850090637207031e+02, 2.849932250976562e+02, 2.849773864746094e+02, 2.849624328613281e+02, 2.8495751953125e+02, 2.849550476074219e+02, 2.849519653320312e+02, 2.849488220214844e+02, 2.849456787109375e+02, 2.849425354003906e+02, 2.849393615722656e+02, 2.849362182617188e+02, 2.849330749511719e+02, 2.84929931640625e+02, 2.851579284667969e+02, 2.85159423828125e+02, 2.851607666015625e+02, 2.851620178222656e+02, 2.851631164550781e+02, 2.851641235351562e+02, 2.851650390625e+02, 2.851658630371094e+02, 2.851666259765625e+02, 2.851672973632812e+02, 2.851679077148438e+02, 2.851685791015625e+02, 2.851696472167969e+02, 2.851706237792969e+02, 2.851714782714844e+02, 2.851722717285156e+02, 2.851729431152344e+02, 2.851735534667969e+02, 2.85174072265625e+02, 2.851745300292969e+02, 2.851748962402344e+02, 2.851752014160156e+02, 2.851754760742188e+02, 2.851759338378906e+02, 2.851763610839844e+02, 2.851767272949219e+02, 2.851770324707031e+02, 2.851773071289062e+02, 2.851775207519531e+02, 2.851776733398438e+02, 2.851777954101562e+02, 2.851778564453125e+02, 2.851778869628906e+02, 2.851776428222656e+02, 2.849915161132812e+02, 2.84989013671875e+02, 2.849865112304688e+02, 2.849840087890625e+02, 2.849814758300781e+02, 2.849789733886719e+02, 2.849764709472656e+02, 2.849739379882812e+02, 2.84971435546875e+02, 2.849689025878906e+02, 2.849668884277344e+02, 2.84966552734375e+02, 2.849664611816406e+02, 2.8496435546875e+02, 2.849582824707031e+02, 2.849512939453125e+02, 2.849442443847656e+02, 2.849372253417969e+02, 2.849302062988281e+02, 2.849231567382812e+02, 2.849161376953125e+02, 2.84908935546875e+02, 2.849020385742188e+02, 2.849006958007812e+02, 2.84900390625e+02, 2.849002075195312e+02, 2.849001770019531e+02, 2.84900146484375e+02, 2.849001159667969e+02, 2.849000854492188e+02, 2.849000549316406e+02, 2.849000549316406e+02, 2.848998718261719e+02, 2.848883361816406e+02, 2.84875244140625e+02, 2.848621520996094e+02, 2.848489685058594e+02, 2.848357849121094e+02, 2.848225402832031e+02, 2.848092346191406e+02, 2.847959289550781e+02, 2.847825317382812e+02, 2.847691345214844e+02, 2.847557067871094e+02] +cat.tan.sta_b.T=[2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801526489257812e+02, 2.80156494140625e+02, 2.801602478027344e+02, 2.801639709472656e+02, 2.801676635742188e+02, 2.801713256835938e+02, 2.801749877929688e+02, 2.801786193847656e+02, 2.801822814941406e+02, 2.801859130859375e+02, 2.801895751953125e+02, 2.801947021484375e+02, 2.802014770507812e+02, 2.802082824707031e+02, 2.80215087890625e+02, 2.802218933105469e+02, 2.802287292480469e+02, 2.802355651855469e+02, 2.80242431640625e+02, 2.802492980957031e+02, 2.802561950683594e+02, 2.802630920410156e+02, 2.80270263671875e+02, 2.802779846191406e+02, 2.802857971191406e+02, 2.802936706542969e+02, 2.803015747070312e+02, 2.803095092773438e+02, 2.803175048828125e+02, 2.803255004882812e+02, 2.803335266113281e+02, 2.803415832519531e+02, 2.803496704101562e+02, 2.803565368652344e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.823220520019531e+02, 2.805564880371094e+02, 2.801500244140625e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.824280395507812e+02, 2.803103942871094e+02, 2.801579895019531e+02, 2.801504211425781e+02, 2.801500244140625e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02] +usr1.yVal_actual=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 6.488844752311707e-01, 5.539206266403198e-01, 4.350397884845734e-01, 4.276768267154694e-01, 4.271436929702759e-01, 4.271065294742584e-01, 4.27122563123703e-01, 4.271441102027893e-01, 4.271654188632965e-01, 4.271866381168365e-01, 4.272061288356781e-01, 6.888272166252136e-01, 6.746571063995361e-01, 6.620320677757263e-01, 6.535302400588989e-01, 6.477266550064087e-01, 6.436936259269714e-01, 6.408606767654419e-01, 6.388573050498962e-01, 6.374360918998718e-01, 6.364284157752991e-01, 6.357159018516541e-01, 6.436357498168945e-01, 6.421707272529602e-01, 6.397469639778137e-01, 6.379788517951965e-01, 6.367138028144836e-01, 6.358070969581604e-01, 6.351565718650818e-01, 6.346895694732666e-01, 6.343544125556946e-01, 6.341143846511841e-01, 6.339432001113892e-01, 1.29819929599762e-01, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] +usr2.yVal_actual=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 5.383833646774292e-01, 5.251340270042419e-01, 5.21766185760498e-01, 5.19461452960968e-01, 5.178165435791016e-01, 5.166453719139099e-01, 5.158153772354126e-01, 5.152313709259033e-01, 5.148248672485352e-01, 5.145469903945923e-01, 5.143622756004333e-01, 5.412585735321045e-01, 5.422655344009399e-01, 5.414134860038757e-01, 5.408165454864502e-01, 5.404288768768311e-01, 5.401930212974548e-01, 5.400669574737549e-01, 5.40020227432251e-01, 5.400309562683105e-01, 5.400833487510681e-01, 5.401660799980164e-01, 5.981610417366028e-01, 6.167843341827393e-01, 6.213207244873047e-01, 6.254279613494873e-01, 6.28542959690094e-01, 6.308589577674866e-01, 6.325575113296509e-01, 6.337833404541016e-01, 6.346506476402283e-01, 6.352471113204956e-01, 6.356417536735535e-01, 8.419466018676491e-02, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] +usr3.yVal_actual=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 5.100061297416687e-01, 5.51994264125824e-01, 5.524903535842896e-01, 5.521496534347534e-01, 5.519714951515198e-01, 5.519320368766785e-01, 5.519936680793762e-01, 5.521286725997925e-01, 5.523170232772827e-01, 5.525442957878113e-01, 5.528001189231873e-01, 5.908713340759277e-01, 6.161829829216003e-01, 6.223897337913513e-01, 6.263647675514221e-01, 6.294692158699036e-01, 6.31896436214447e-01, 6.33799135684967e-01, 6.352988481521606e-01, 6.364914178848267e-01, 6.374523043632507e-01, 6.382352709770203e-01, 4.771136343479139e-01, 3.802154660224915e-01, 3.797430098056793e-01, 3.797487616539001e-01, 3.797529339790344e-01, 3.797525763511658e-01, 3.797548115253448e-01, 3.79756897687912e-01, 3.797584772109985e-01, 3.797603249549866e-01, 3.797620534896851e-01, 7.145386934280396e-01, 6.906818151473999e-01, 6.737698912620544e-01, 6.976684331893921e-01, 7.212141156196594e-01, 7.626041769981384e-01, 7.912420034408569e-01, 8.07513952255249e-01, 8.168110251426697e-01, 8.222786784172058e-01, 8.255812525749207e-01, 4.133987128734589e-01, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos new file mode 100644 index 00000000000..633f5841479 --- /dev/null +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos @@ -0,0 +1,31 @@ +simulateModel("Buildings.Fluid.Storage.Plant.Examples.TwoSourcesThreeUsers", + stopTime=3600, + tolerance=1e-06, + method="dassl", + resultFile="TwoSourcesThreeUsers"); +// Plot commands +createPlot(id=1, + position={15, 15, 914, 538}, + y={"pumChi1.m_flow", "cat.pum1.m_flow", "cat.mTan_flow", "cat.pum2.m_flow"}, + range={0.0, 3600.0, -2.0, 2.0}, + grid=true, + subPlot=101, + colors={{28,108,200}, {238,46,47}, {0,140,72}, {217,67,180}}, + timeUnit="s", + displayUnits={"kg/s", "kg/s", "kg/s", "kg/s"}); +createPlot(id=1, + position={15, 15, 914, 538}, + y={"cat.tan.sta_a.T", "cat.tan.sta_b.T"}, + range={0.0, 3600.0, 5.0, 15.0}, + grid=true, + subPlot=102, + colors={{28,108,200}, {238,46,47}}, + timeUnit="s", + displayUnits={"degC", "degC"}); +createPlot(id=2, + position={375, 90, 919, 372}, + y={"usr1.yVal_actual", "usr2.yVal_actual", "usr3.yVal_actual"}, + range={0.0, 3600.0, -0.2, 1.2}, + grid=true, + colors={{28,108,200}, {238,46,47}, {0,140,72}}, + timeUnit="s"); diff --git a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.TwoSourcesThreeUsers.mos b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.TwoSourcesThreeUsers.mos new file mode 100644 index 00000000000..bf77d8db7dd --- /dev/null +++ b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.TwoSourcesThreeUsers.mos @@ -0,0 +1,12 @@ +compareVars := + { + "pumChi1.m_flow", + "cat.pum1.m_flow", + "cat.mTan_flow", + "cat.pum2.m_flow", + "cat.tan.sta_a.T", + "cat.tan.sta_b.T", + "usr1.yVal_actual", + "usr2.yVal_actual", + "usr3.yVal_actual" + }; From 634beeae1d008b76e45700d2f6380b26fa21d369 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Fri, 18 Feb 2022 14:54:43 -0800 Subject: [PATCH 047/463] corrected valve control logic --- .../BaseClasses/ReversiblePumpValveControl.mo | 70 +++++++++---------- .../ChillerAndTankWithRemoteCharging.mo | 16 ++--- ...ge_Plant_Examples_TwoSourcesThreeUsers.txt | 12 ++-- 3 files changed, 48 insertions(+), 50 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo index 8a1ecc3d0a1..5a97c4bb379 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo @@ -36,7 +36,7 @@ block ReversiblePumpValveControl rotation=90, origin={-10,30}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanInput booFloDir - "Flow direction, true = normal, false = reverse" annotation (Placement( + "Flow direction: true = normal; false = reverse" annotation (Placement( transformation(extent={{-120,-10},{-100,10}}), iconTransformation( extent={{-140,-60},{-100,-20}}))); Modelica.Blocks.Interfaces.RealInput us_mTan_flow @@ -56,7 +56,7 @@ block ReversiblePumpValveControl rotation=0, origin={-110,80}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanInput booOnOff - "True = plant online, False = plant offline" annotation (Placement( + "Plant output: true = on; false = off" annotation (Placement( transformation(extent={{-120,-30},{-100,-10}}), iconTransformation( extent={{-140,-100},{-100,-60}}))); Modelica.Blocks.Interfaces.RealOutput yPum2 "Normalised speed" annotation ( @@ -100,7 +100,7 @@ block ReversiblePumpValveControl rotation=0, origin={110,80}))); Buildings.Controls.OBC.CDL.Continuous.LessThreshold lesThrVal1(t=0.05) - "yVal1_actual < 0.05" + "yVal1_actual less than threshold" annotation (Placement(transformation(extent={{80,20},{60,40}}))); Buildings.Controls.OBC.CDL.Continuous.Switch swiPum1 "Switch: true = on; false = off (y=0)." annotation (Placement( @@ -113,7 +113,7 @@ block ReversiblePumpValveControl transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={10,-128}))); + origin={10,-130}))); Buildings.Controls.OBC.CDL.Continuous.Switch swiVal2 "Switch: true = on; false = off (y=0)." annotation (Placement( transformation( @@ -121,32 +121,31 @@ block ReversiblePumpValveControl rotation=-90, origin={70,-130}))); Buildings.Controls.OBC.CDL.Logical.And3 and3Val1 - "Plant online AND normal direction AND val2 closed" annotation (Placement( + "Plant on AND normal direction AND val2 closed" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={0,-50}))); Buildings.Controls.OBC.CDL.Continuous.LessThreshold lesThrVal2(t=0.05) - "yVal1_actual < 0.05" + "yVal1_actual less than threshold" annotation (Placement(transformation(extent={{80,60},{60,80}}))); - Buildings.Controls.OBC.CDL.Logical.And3 and3Val2 - "Plant online AND normal direction AND val1 closed" annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={60,-50}))); - Buildings.Controls.OBC.CDL.Logical.Not notVal2 + Buildings.Controls.OBC.CDL.Logical.Not notFloDirVal2 "Reverses flow direction signal for val2" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={50,-16}))); + origin={60,-16}))); Buildings.Controls.OBC.CDL.Logical.And3 and3Pum2 - "Plant online AND normal direction AND val2 closed" annotation (Placement( + "Plant on AND normal direction AND val2 closed" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={-60,-50}))); + Buildings.Controls.OBC.CDL.Logical.And andVal2 "Reverse direction AND val1 closed" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={60,-50}))); equation connect(conPI_pum2.y,gaiPum2. u) @@ -168,15 +167,15 @@ equation connect(conZero.y, swiPum1.u3) annotation (Line(points={{-79,-110},{-58,-110}, {-58,-118}}, color={0,0,127})); connect(conZero.y, swiVal1.u3) - annotation (Line(points={{-79,-110},{2,-110},{2,-116}}, color={0,0,127})); + annotation (Line(points={{-79,-110},{2,-110},{2,-118}}, color={0,0,127})); connect(swiVal1.y, yVal1) - annotation (Line(points={{10,-140},{10,-170}}, color={0,0,127})); + annotation (Line(points={{10,-142},{10,-170}}, color={0,0,127})); connect(swiVal2.y, yVal2) annotation (Line(points={{70,-142},{70,-170}}, color={0,0,127})); connect(conZero.y, swiVal2.u3) annotation (Line(points={{-79,-110},{62,-110},{ 62,-118}}, color={0,0,127})); connect(conOne.y, swiVal1.u1) - annotation (Line(points={{-79,-80},{18,-80},{18,-116}}, color={0,0,127})); + annotation (Line(points={{-79,-80},{18,-80},{18,-118}}, color={0,0,127})); connect(gaiPum2.y, swiPum1.u1) annotation (Line(points={{-70,19},{-70,10},{-42, 10},{-42,-118}}, color={0,0,127})); connect(gaiVal2.y, swiVal2.u1) annotation (Line(points={{-10,19},{-10,10},{78, @@ -189,21 +188,12 @@ equation annotation (Line(points={{82,70},{110,70}}, color={0,0,127})); connect(lesThrVal2.y, and3Val1.u1) annotation (Line(points={{58,70},{34,70},{34, 40},{8,40},{8,-38}}, color={255,0,255})); - connect(booOnOff, and3Val2.u3) annotation (Line(points={{-110,-20},{20,-20},{ - 20,-34},{52,-34},{52,-38}}, - color={255,0,255})); - connect(and3Val2.u1, lesThrVal1.y) annotation (Line(points={{68,-38},{68,16},{ - 52,16},{52,30},{58,30}}, color={255,0,255})); connect(lesThrVal1.u, yVal1_actual) annotation (Line(points={{82,30},{110,30}}, color={0,0,127})); - connect(and3Val1.y, swiVal1.u2) annotation (Line(points={{-2.22045e-15,-62},{ - -2.22045e-15,-70},{10,-70},{10,-116}}, color={255,0,255})); - connect(and3Val2.y, swiVal2.u2) annotation (Line(points={{60,-62},{60,-70},{ - 70,-70},{70,-118}}, color={255,0,255})); - connect(and3Val2.u2, notVal2.y) - annotation (Line(points={{60,-38},{60,-28},{50,-28}}, color={255,0,255})); - connect(notVal2.u, booFloDir) - annotation (Line(points={{50,-4},{50,0},{-110,0}}, color={255,0,255})); + connect(and3Val1.y, swiVal1.u2) annotation (Line(points={{-2.22045e-15,-62},{-2.22045e-15, + -70},{10,-70},{10,-118}}, color={255,0,255})); + connect(notFloDirVal2.u, booFloDir) + annotation (Line(points={{60,-4},{60,0},{-110,0}}, color={255,0,255})); connect(and3Pum2.u3, booOnOff) annotation (Line(points={{-68,-38},{-68,-20},{ -110,-20}}, color={255,0,255})); connect(and3Pum2.u2, booFloDir) @@ -212,6 +202,13 @@ equation -30},{8,-30},{8,40},{34,40},{34,70},{58,70}}, color={255,0,255})); connect(and3Pum2.y, swiPum1.u2) annotation (Line(points={{-60,-62},{-60,-70}, {-50,-70},{-50,-118}}, color={255,0,255})); + connect(notFloDirVal2.y, andVal2.u1) + annotation (Line(points={{60,-28},{60,-38}}, color={255,0,255})); + connect(lesThrVal1.y, andVal2.u2) annotation (Line(points={{58,30},{46,30},{46, + -32},{52,-32},{52,-38}}, + color={255,0,255})); + connect(andVal2.y, swiVal2.u2) annotation (Line(points={{60,-62},{60,-70},{70, + -70},{70,-118}}, color={255,0,255})); annotation (Diagram(coordinateSystem(extent={{-100,-160},{100,100}})), Icon( coordinateSystem(extent={{-100,-100},{100,100}})), Documentation(revisions=" @@ -240,7 +237,7 @@ The pump is controlled to track a flow rate setpoint of the tank under the following conditions:
    • -The plant is online, AND +The plant is on, AND
    • the flow direction is \"normal\" (= true), AND @@ -262,10 +259,7 @@ to track a negative flow rate setpoint of the tank (charging) under the following conditions:
      • -The plant is online, AND -
      • -
      • -the flow direction is \"reverse\" (= false), AND +The flow direction is \"reverse\" (= false), AND
      • val1 (in series to the pump) is at most 5% open. @@ -274,5 +268,9 @@ the flow direction is \"reverse\" (= false), AND Otherwise the valve is closed.
      +

      +Note that val2 is not commanded to be closed when the plant is \"off\" to allow +remotely charging the tank. +

      ")); end ReversiblePumpValveControl; diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo index 15c76b0b51b..db0277386df 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo @@ -56,7 +56,7 @@ model ChillerAndTankWithRemoteCharging "Flow direction: True = normal; False = reverse" annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); Modelica.Blocks.Sources.BooleanTable booOnOff(table={3600/7*2}) - "True = online; False = offline" + "True = on; False = off" annotation (Placement(transformation(extent={{-80,-80},{-60,-60}}))); Modelica.Blocks.Sources.TimeTable set_mChi_flow(table=[0,0; 3600/7,0; 3600/7, 1; 3600/7*5,1; 3600/7*5,0]) "Chiller flow rate setpoint" @@ -123,7 +123,7 @@ Operation modes implemented in time tables: 1. - offline + off off off N/A @@ -131,7 +131,7 @@ Operation modes implemented in time tables: 2. - offline + off on charging N/A @@ -139,7 +139,7 @@ Operation modes implemented in time tables: 3. - offline + on on charging normal @@ -147,7 +147,7 @@ Operation modes implemented in time tables: 4. - online + on on off normal @@ -155,7 +155,7 @@ Operation modes implemented in time tables: 5. - online + on on discharging normal @@ -163,7 +163,7 @@ Operation modes implemented in time tables: 6. - online + on off discharging normal @@ -171,7 +171,7 @@ Operation modes implemented in time tables: 7. - online + on off charging reverse diff --git a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_TwoSourcesThreeUsers.txt b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_TwoSourcesThreeUsers.txt index 69ec2e440e4..aea09608699 100644 --- a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_TwoSourcesThreeUsers.txt +++ b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_TwoSourcesThreeUsers.txt @@ -12,12 +12,12 @@ statistics-simulation= "numerical Jacobians": "0" } time=[0e+00, 3.6e+03] -pumChi1.m_flow=[2.90360344479268e-06, 2.574263646692998e-07, 2.841550212906441e-07, 3.041250238311477e-07, 3.1895160645945e-07, 3.299363697806257e-07, 3.380644102435326e-07, 3.440725322434446e-07, 3.48510639014421e-07, 3.517874063163617e-07, 3.54205752728376e-07, 3.559900392247073e-07, 3.943333625793457e-01, -4.101347585674375e-04, -6.165397935546935e-04, -6.312931654974818e-04, -6.325669819489121e-04, -6.326818256638944e-04, -6.326654111035168e-04, -6.326350849121809e-04, -6.326043512672186e-04, -6.325736176222563e-04, -6.325450958684087e-04, 1.676010340452194e-01, 2.260444015264511e-01, 2.280271947383881e-01, 2.296319901943207e-01, 2.309540957212448e-01, 2.3201884329319e-01, 2.328718602657318e-01, 2.335596978664398e-01, 2.341222614049911e-01, 2.345906794071198e-01, 2.349889278411865e-01, 6.076617836952209e-01, 6.48245096206665e-01, 6.502888202667236e-01, 6.512425541877747e-01, 6.520718932151794e-01, 6.528275609016418e-01, 6.53529942035675e-01, 6.541922688484192e-01, 6.548252105712891e-01, 6.554367542266846e-01, 6.560323238372803e-01, 9.176848828792572e-02, 4.775870547746308e-05, 2.880391664803028e-03, 2.49257986433804e-03, 2.490735845640302e-03, 2.735406626015902e-03, 3.157721599563956e-03, 3.707779105752707e-03, 4.348243586719036e-03, 5.058615934103732e-03, 5.812733899801975e-03, -6.395064992830209e-04, -8.454701746813953e-04, -8.459485834464431e-04, -8.459427626803517e-04, -8.459385135211051e-04, -8.459388627670705e-04, -8.459365926682949e-04, -8.45934497192502e-04, -8.459328673779964e-04, -8.459310047328472e-04, -8.459292585030198e-04, 3.49773645401001e-01, 6.095951795578003e-01, 6.278272271156311e-01, 8.526263236999512e-01, 9.942406415939331e-01, 1.00286340713501e+00, 1.00541627407074e+00, 1.006456851959229e+00, 1.006974339485168e+00, 1.007259845733643e+00, 1.007426261901855e+00, 8.565613031387329e-01, 2.290953099727631e-01, 2.2487448528409e-02, 1.25402444973588e-02, 3.783038817346096e-03, 9.858713019639254e-05, 2.056120820270735e-06, 5.082055736238544e-07, 4.589337549987249e-07, 4.506961204242543e-07, 4.46475212356745e-07, 4.379380413865874e-07, 3.667765611226059e-07, 3.652176587820577e-07, 3.641101784523926e-07, 3.632943617049023e-07, 3.626925320077135e-07, 3.622492954491463e-07, 3.619223889472778e-07, 3.61681372851308e-07, 3.615036234805302e-07, 3.613725994000561e-07, 3.612759940097021e-07] -cat.pum1.m_flow=[0e+00, 7.499329447746277e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 1.377374976873398e-01, 4.026739043183625e-05, 6.58272858444775e-09, 8.910557296355759e-13, 1.052406276181252e-16, -5.700009189518855e-20, 2.319422353975646e-20, 3.069957089516106e-20, 8.852726022438318e-21, 3.036209453383328e-21, 1.406305430596601e-20, -1.103355236646582e-21, -1.165023434678379e-25, -1.193496604819255e-29, -1.265150774327442e-33, -7.832539269203836e-38, -7.257324746738228e-42, -4.203895392974451e-45, -1.401298464324817e-45, -0e+00, 0e+00, 0e+00, 2.080670595169067e-01, 7.497284412384033e-01, 7.499998807907104e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01] -cat.mTan_flow=[-2.397192702119355e-07, -7.499328851699829e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -5.513091683387756e-01, -7.352462410926819e-02, -1.417060196399689e-01, -1.474320441484451e-01, -1.477603018283844e-01, -1.477708965539932e-01, -1.477505415678024e-01, -1.477271020412445e-01, -1.477043628692627e-01, -1.47681713104248e-01, -1.476610749959946e-01, 2.484844624996185e-01, 2.320588976144791e-01, 2.286417037248611e-01, 2.26160004734993e-01, 2.243344783782959e-01, 2.229963392019272e-01, 2.220179736614227e-01, 2.213034778833389e-01, 2.207819074392319e-01, 2.204015105962753e-01, 2.201240658760071e-01, 4.022278189659119e-01, 4.10429835319519e-01, 4.098312556743622e-01, 4.092541038990021e-01, 4.088490903377533e-01, 4.085736870765686e-01, 4.083927273750305e-01, 4.082804620265961e-01, 4.08218115568161e-01, 4.081920683383942e-01, 4.0819251537323e-01, 4.507285356521606e-01, 4.582361280918121e-01, 4.601562023162842e-01, 4.618924558162689e-01, 4.631564021110535e-01, 4.640700817108154e-01, 4.647232592105865e-01, 4.651826024055481e-01, 4.654980897903442e-01, 4.657061100006104e-01, 4.658348560333252e-01, 1.348630785942009e-01, -1.46227702498436e-01, -1.469586342573166e-01, -1.469497382640839e-01, -1.469432860612869e-01, -1.469438225030899e-01, -1.469403356313705e-01, -1.469371169805527e-01, -1.469346880912781e-01, -1.469318419694901e-01, -1.46929144859314e-01, -1.377610415220261e-01, -2.340786013519391e-04, -2.388485707342625e-02, -2.614861726760864e-01, -4.026770293712616e-01, -4.114053547382355e-01, -4.097591936588287e-01, -4.082532227039337e-01, -4.073703587055206e-01, -4.068644344806671e-01, -4.065663814544678e-01, -4.868537485599518e-01, -2.290947288274765e-01, -2.248694002628326e-02, -1.253976486623287e-02, -3.782580140978098e-03, -9.814348595682532e-05, -1.623605271561246e-06, -8.416171226599545e-08, -4.121969965353856e-08, -3.764507638948089e-08, -3.685830307631477e-08, -2.080670893192291e-01, -7.497284412384033e-01, -7.499998211860657e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01] -cat.pum2.m_flow=[-1.598027523641576e-07, 3.168741358194893e-08, 3.022457661927547e-08, 2.912550911560174e-08, 2.830951295607065e-08, 2.770495477477652e-08, 2.725762016098088e-08, 2.692695844075388e-08, 2.668270049355215e-08, 2.650236119450256e-08, 2.636926588195365e-08, 2.627106532315793e-08, 1.986908316612244e-01, 6.76475465297699e-01, 6.082940697669983e-01, 6.025680303573608e-01, 6.022397875785828e-01, 6.022291779518127e-01, 6.022495031356812e-01, 6.022729873657227e-01, 6.022956967353821e-01, 6.023183465003967e-01, 6.02338969707489e-01, 9.984844923019409e-01, 9.820589423179626e-01, 9.786417484283447e-01, 9.761600494384766e-01, 9.743345379829407e-01, 9.729964137077332e-01, 9.720180034637451e-01, 9.713035225868225e-01, 9.707819819450378e-01, 9.704015851020813e-01, 9.701241254806519e-01, 1.152227878570557e+00, 1.160429835319519e+00, 1.159831285476685e+00, 1.159254193305969e+00, 1.158849120140076e+00, 1.158573746681213e+00, 1.158392786979675e+00, 1.158280491828918e+00, 1.158218145370483e+00, 1.158192038536072e+00, 1.15819251537323e+00, 1.200728535652161e+00, 1.208236217498779e+00, 1.210156202316284e+00, 1.211892485618591e+00, 1.213156461715698e+00, 1.214070081710815e+00, 1.214723348617554e+00, 1.215182662010193e+00, 1.215498089790344e+00, 1.21570611000061e+00, 1.215834856033325e+00, 8.848631381988457e-01, 6.037723422050476e-01, 6.030414700508118e-01, 6.030503511428833e-01, 6.03056788444519e-01, 6.030562520027161e-01, 6.03059709072113e-01, 6.030629277229309e-01, 6.030653715133667e-01, 6.030682325363159e-01, 6.030709147453308e-01, -2.353951094846707e-05, -1.937928318511695e-04, -1.971050223801285e-04, -1.464236993342638e-04, -6.103904888732359e-05, -2.231381813544431e-06, -7.690326953024851e-08, -1.944775540607679e-08, -1.526295001497147e-08, -1.477478228650853e-08, -1.466873911226685e-08, -2.110327379512e-08, -2.758277517500574e-08, -3.032659279256222e-08, -2.867624182556483e-08, -2.749059468953874e-08, -2.661316500507382e-08, -2.594599912697504e-08, -2.543780830421838e-08, -2.50580907135145e-08, -2.477836424930047e-08, -2.457235304120786e-08, -2.057371695229904e-08, 2.564437195928804e-08, 2.576321733727127e-08, 2.582416591678793e-08, 2.586906333590377e-08, 2.590218706188807e-08, 2.592657999400672e-08, 2.5944572712433e-08, 2.59578367689528e-08, 2.596761916606738e-08, 2.597483117483534e-08, 2.598014781085567e-08] -cat.tan.sta_a.T=[2.851499938964844e+02, 2.851358337402344e+02, 2.851199951171875e+02, 2.851041564941406e+02, 2.850882873535156e+02, 2.850724487304688e+02, 2.850566101074219e+02, 2.85040771484375e+02, 2.8502490234375e+02, 2.850090637207031e+02, 2.849932250976562e+02, 2.849773864746094e+02, 2.849624328613281e+02, 2.8495751953125e+02, 2.849550476074219e+02, 2.849519653320312e+02, 2.849488220214844e+02, 2.849456787109375e+02, 2.849425354003906e+02, 2.849393615722656e+02, 2.849362182617188e+02, 2.849330749511719e+02, 2.84929931640625e+02, 2.851579284667969e+02, 2.85159423828125e+02, 2.851607666015625e+02, 2.851620178222656e+02, 2.851631164550781e+02, 2.851641235351562e+02, 2.851650390625e+02, 2.851658630371094e+02, 2.851666259765625e+02, 2.851672973632812e+02, 2.851679077148438e+02, 2.851685791015625e+02, 2.851696472167969e+02, 2.851706237792969e+02, 2.851714782714844e+02, 2.851722717285156e+02, 2.851729431152344e+02, 2.851735534667969e+02, 2.85174072265625e+02, 2.851745300292969e+02, 2.851748962402344e+02, 2.851752014160156e+02, 2.851754760742188e+02, 2.851759338378906e+02, 2.851763610839844e+02, 2.851767272949219e+02, 2.851770324707031e+02, 2.851773071289062e+02, 2.851775207519531e+02, 2.851776733398438e+02, 2.851777954101562e+02, 2.851778564453125e+02, 2.851778869628906e+02, 2.851776428222656e+02, 2.849915161132812e+02, 2.84989013671875e+02, 2.849865112304688e+02, 2.849840087890625e+02, 2.849814758300781e+02, 2.849789733886719e+02, 2.849764709472656e+02, 2.849739379882812e+02, 2.84971435546875e+02, 2.849689025878906e+02, 2.849668884277344e+02, 2.84966552734375e+02, 2.849664611816406e+02, 2.8496435546875e+02, 2.849582824707031e+02, 2.849512939453125e+02, 2.849442443847656e+02, 2.849372253417969e+02, 2.849302062988281e+02, 2.849231567382812e+02, 2.849161376953125e+02, 2.84908935546875e+02, 2.849020385742188e+02, 2.849006958007812e+02, 2.84900390625e+02, 2.849002075195312e+02, 2.849001770019531e+02, 2.84900146484375e+02, 2.849001159667969e+02, 2.849000854492188e+02, 2.849000549316406e+02, 2.849000549316406e+02, 2.848998718261719e+02, 2.848883361816406e+02, 2.84875244140625e+02, 2.848621520996094e+02, 2.848489685058594e+02, 2.848357849121094e+02, 2.848225402832031e+02, 2.848092346191406e+02, 2.847959289550781e+02, 2.847825317382812e+02, 2.847691345214844e+02, 2.847557067871094e+02] -cat.tan.sta_b.T=[2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801526489257812e+02, 2.80156494140625e+02, 2.801602478027344e+02, 2.801639709472656e+02, 2.801676635742188e+02, 2.801713256835938e+02, 2.801749877929688e+02, 2.801786193847656e+02, 2.801822814941406e+02, 2.801859130859375e+02, 2.801895751953125e+02, 2.801947021484375e+02, 2.802014770507812e+02, 2.802082824707031e+02, 2.80215087890625e+02, 2.802218933105469e+02, 2.802287292480469e+02, 2.802355651855469e+02, 2.80242431640625e+02, 2.802492980957031e+02, 2.802561950683594e+02, 2.802630920410156e+02, 2.80270263671875e+02, 2.802779846191406e+02, 2.802857971191406e+02, 2.802936706542969e+02, 2.803015747070312e+02, 2.803095092773438e+02, 2.803175048828125e+02, 2.803255004882812e+02, 2.803335266113281e+02, 2.803415832519531e+02, 2.803496704101562e+02, 2.803565368652344e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.823220520019531e+02, 2.805564880371094e+02, 2.801500244140625e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.824280395507812e+02, 2.803103942871094e+02, 2.801579895019531e+02, 2.801504211425781e+02, 2.801500244140625e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02] +pumChi1.m_flow=[2.90360344479268e-06, 2.574263646692998e-07, 2.841550212906441e-07, 3.041250238311477e-07, 3.1895160645945e-07, 3.299363697806257e-07, 3.380644102435326e-07, 3.440725322434446e-07, 3.48510639014421e-07, 3.517874063163617e-07, 3.54205752728376e-07, 3.559900392247073e-07, 3.943333625793457e-01, -4.101347585674375e-04, -6.165397935546935e-04, -6.312931654974818e-04, -6.325669819489121e-04, -6.326818256638944e-04, -6.326654111035168e-04, -6.326350849121809e-04, -6.326043512672186e-04, -6.325736176222563e-04, -6.325450958684087e-04, 1.676010340452194e-01, 2.260444015264511e-01, 2.280271947383881e-01, 2.296319901943207e-01, 2.309540957212448e-01, 2.3201884329319e-01, 2.328718602657318e-01, 2.335596978664398e-01, 2.341222614049911e-01, 2.345906794071198e-01, 2.349889278411865e-01, 6.076617836952209e-01, 6.48245096206665e-01, 6.502888202667236e-01, 6.512425541877747e-01, 6.520718932151794e-01, 6.528275609016418e-01, 6.53529942035675e-01, 6.541922688484192e-01, 6.548252105712891e-01, 6.554367542266846e-01, 6.560323238372803e-01, 9.176848828792572e-02, 4.775870547746308e-05, 2.880391664803028e-03, 2.49257986433804e-03, 2.490735845640302e-03, 2.735406626015902e-03, 3.157721599563956e-03, 3.707779105752707e-03, 4.348243586719036e-03, 5.058615934103732e-03, 5.812733899801975e-03, -6.395064992830209e-04, -8.454701746813953e-04, -8.459485834464431e-04, -8.459427626803517e-04, -8.459385135211051e-04, -8.459388627670705e-04, -8.459365926682949e-04, -8.45934497192502e-04, -8.459328673779964e-04, -8.459310047328472e-04, -8.459292585030198e-04, 3.49773645401001e-01, 6.095951795578003e-01, 6.278272271156311e-01, 8.526263236999512e-01, 9.942406415939331e-01, 1.00286340713501e+00, 1.00541627407074e+00, 1.006456851959229e+00, 1.006974339485168e+00, 1.007259845733643e+00, 1.007426261901855e+00, 8.565613031387329e-01, 4.098342657089233e-01, 4.015297591686249e-01, 3.931047022342682e-01, 3.867296576499939e-01, 3.819189965724945e-01, 3.782961070537567e-01, 3.755727410316467e-01, 3.735280632972717e-01, 3.719945549964905e-01, 3.708451986312866e-01, 2.734200358390808e-01, -3.069724480155855e-04, -3.066363860853016e-04, -3.04735527606681e-04, -2.008696901611984e-04, -4.965816970070591e-06, 1.967203928643357e-07, 3.207404404292902e-07, 3.358420030963316e-07, 3.429668993248924e-07, 3.477166785614827e-07, 3.511994748350844e-07] +cat.pum1.m_flow=[0e+00, 7.499329447746277e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 1.377374976873398e-01, 4.026739043183625e-05, 6.58272858444775e-09, 8.910557296355759e-13, 1.052406276181252e-16, -5.700009189518855e-20, 2.319422353975646e-20, 3.069957089516106e-20, 8.852726022438318e-21, 3.036209453383328e-21, 1.406305430596601e-20, -1.103355236646582e-21, -1.163546046114319e-25, -1.166273810750257e-29, 8.640745813852737e-34, 1.589861992698616e-35, 6.388502210652006e-37, -3.749615730577003e-37, 1.759805878710538e-37, 1.701286421697685e-37, 3.645850588228645e-37, -1.643032762977545e-37, 2.080670148134232e-01, 7.497294545173645e-01, 7.499999403953552e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01] +cat.mTan_flow=[-2.397192702119355e-07, -7.499328851699829e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -5.513091683387756e-01, -7.352462410926819e-02, -1.417060196399689e-01, -1.474320441484451e-01, -1.477603018283844e-01, -1.477708965539932e-01, -1.477505415678024e-01, -1.477271020412445e-01, -1.477043628692627e-01, -1.47681713104248e-01, -1.476610749959946e-01, 2.484844624996185e-01, 2.320588976144791e-01, 2.286417037248611e-01, 2.26160004734993e-01, 2.243344783782959e-01, 2.229963392019272e-01, 2.220179736614227e-01, 2.213034778833389e-01, 2.207819074392319e-01, 2.204015105962753e-01, 2.201240658760071e-01, 4.022278189659119e-01, 4.10429835319519e-01, 4.098312556743622e-01, 4.092541038990021e-01, 4.088490903377533e-01, 4.085736870765686e-01, 4.083927273750305e-01, 4.082804620265961e-01, 4.08218115568161e-01, 4.081920683383942e-01, 4.0819251537323e-01, 4.507285356521606e-01, 4.582361280918121e-01, 4.601562023162842e-01, 4.618924558162689e-01, 4.631564021110535e-01, 4.640700817108154e-01, 4.647232592105865e-01, 4.651826024055481e-01, 4.654980897903442e-01, 4.657061100006104e-01, 4.658348560333252e-01, 1.348630785942009e-01, -1.46227702498436e-01, -1.469586342573166e-01, -1.469497382640839e-01, -1.469432860612869e-01, -1.469438225030899e-01, -1.469403356313705e-01, -1.469371169805527e-01, -1.469346880912781e-01, -1.469318419694901e-01, -1.46929144859314e-01, -1.377610415220261e-01, -2.340786013519391e-04, -2.388485707342625e-02, -2.614861726760864e-01, -4.026770293712616e-01, -4.114053547382355e-01, -4.097591936588287e-01, -4.082532227039337e-01, -4.073703587055206e-01, -4.068644344806671e-01, -4.065663814544678e-01, -4.868537485599518e-01, -4.098336398601532e-01, -4.015291631221771e-01, -3.931041061878204e-01, -3.867290914058685e-01, -3.819184303283691e-01, -3.782955706119537e-01, -3.755722045898438e-01, -3.735275268554688e-01, -3.719940483570099e-01, -3.70844691991806e-01, -4.814865291118622e-01, -7.494215965270996e-01, -7.496924996376038e-01, -7.496944665908813e-01, -7.49798595905304e-01, -7.49994695186615e-01, -7.499998211860657e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01] +cat.pum2.m_flow=[-1.598027523641576e-07, 3.168741358194893e-08, 3.022457661927547e-08, 2.912550911560174e-08, 2.830951295607065e-08, 2.770495477477652e-08, 2.725762016098088e-08, 2.692695844075388e-08, 2.668270049355215e-08, 2.650236119450256e-08, 2.636926588195365e-08, 2.627106532315793e-08, 1.986908316612244e-01, 6.76475465297699e-01, 6.082940697669983e-01, 6.025680303573608e-01, 6.022397875785828e-01, 6.022291779518127e-01, 6.022495031356812e-01, 6.022729873657227e-01, 6.022956967353821e-01, 6.023183465003967e-01, 6.02338969707489e-01, 9.984844923019409e-01, 9.820589423179626e-01, 9.786417484283447e-01, 9.761600494384766e-01, 9.743345379829407e-01, 9.729964137077332e-01, 9.720180034637451e-01, 9.713035225868225e-01, 9.707819819450378e-01, 9.704015851020813e-01, 9.701241254806519e-01, 1.152227878570557e+00, 1.160429835319519e+00, 1.159831285476685e+00, 1.159254193305969e+00, 1.158849120140076e+00, 1.158573746681213e+00, 1.158392786979675e+00, 1.158280491828918e+00, 1.158218145370483e+00, 1.158192038536072e+00, 1.15819251537323e+00, 1.200728535652161e+00, 1.208236217498779e+00, 1.210156202316284e+00, 1.211892485618591e+00, 1.213156461715698e+00, 1.214070081710815e+00, 1.214723348617554e+00, 1.215182662010193e+00, 1.215498089790344e+00, 1.21570611000061e+00, 1.215834856033325e+00, 8.848631381988457e-01, 6.037723422050476e-01, 6.030414700508118e-01, 6.030503511428833e-01, 6.03056788444519e-01, 6.030562520027161e-01, 6.03059709072113e-01, 6.030629277229309e-01, 6.030653715133667e-01, 6.030682325363159e-01, 6.030709147453308e-01, -2.353951094846707e-05, -1.937928318511695e-04, -1.971050223801285e-04, -1.464236993342638e-04, -6.103904888732359e-05, -2.231381813544431e-06, -7.690326953024851e-08, -1.944775540607679e-08, -1.526295001497147e-08, -1.477478228650853e-08, -1.466873911226685e-08, -2.110327379512e-08, -1.493039647471051e-08, -1.432879059848347e-08, -1.373350588806943e-08, -1.329165044694491e-08, -1.296302531983429e-08, -1.271825844639807e-08, -1.253579817728223e-08, -1.239967595267899e-08, -1.229807278235739e-08, -1.222219481178399e-08, -8.288473019035791e-09, 1.879545130645255e-11, 1.101986835116975e-10, 4.194764535725426e-10, 1.731700471907516e-08, 2.927218289983102e-08, 2.845510849169841e-08, 2.781371399862564e-08, 2.733815307465193e-08, 2.698647705301482e-08, 2.672665111447259e-08, 2.653480279946052e-08] +cat.tan.sta_a.T=[2.851499938964844e+02, 2.851358337402344e+02, 2.851199951171875e+02, 2.851041564941406e+02, 2.850882873535156e+02, 2.850724487304688e+02, 2.850566101074219e+02, 2.85040771484375e+02, 2.8502490234375e+02, 2.850090637207031e+02, 2.849932250976562e+02, 2.849773864746094e+02, 2.849624328613281e+02, 2.8495751953125e+02, 2.849550476074219e+02, 2.849519653320312e+02, 2.849488220214844e+02, 2.849456787109375e+02, 2.849425354003906e+02, 2.849393615722656e+02, 2.849362182617188e+02, 2.849330749511719e+02, 2.84929931640625e+02, 2.851579284667969e+02, 2.85159423828125e+02, 2.851607666015625e+02, 2.851620178222656e+02, 2.851631164550781e+02, 2.851641235351562e+02, 2.851650390625e+02, 2.851658630371094e+02, 2.851666259765625e+02, 2.851672973632812e+02, 2.851679077148438e+02, 2.851685791015625e+02, 2.851696472167969e+02, 2.851706237792969e+02, 2.851714782714844e+02, 2.851722717285156e+02, 2.851729431152344e+02, 2.851735534667969e+02, 2.85174072265625e+02, 2.851745300292969e+02, 2.851748962402344e+02, 2.851752014160156e+02, 2.851754760742188e+02, 2.851759338378906e+02, 2.851763610839844e+02, 2.851767272949219e+02, 2.851770324707031e+02, 2.851773071289062e+02, 2.851775207519531e+02, 2.851776733398438e+02, 2.851777954101562e+02, 2.851778564453125e+02, 2.851778869628906e+02, 2.851776428222656e+02, 2.849915161132812e+02, 2.84989013671875e+02, 2.849865112304688e+02, 2.849840087890625e+02, 2.849814758300781e+02, 2.849789733886719e+02, 2.849764709472656e+02, 2.849739379882812e+02, 2.84971435546875e+02, 2.849689025878906e+02, 2.849668884277344e+02, 2.84966552734375e+02, 2.849664611816406e+02, 2.8496435546875e+02, 2.849582824707031e+02, 2.849512939453125e+02, 2.849442443847656e+02, 2.849372253417969e+02, 2.849302062988281e+02, 2.849231567382812e+02, 2.849161376953125e+02, 2.84908935546875e+02, 2.84901611328125e+02, 2.8489453125e+02, 2.848876037597656e+02, 2.848807983398438e+02, 2.848740844726562e+02, 2.84867431640625e+02, 2.848608093261719e+02, 2.848542175292969e+02, 2.8484765625e+02, 2.848411254882812e+02, 2.8483447265625e+02, 2.848223876953125e+02, 2.848091125488281e+02, 2.847957763671875e+02, 2.847824096679688e+02, 2.847690124511719e+02, 2.847555541992188e+02, 2.847420654296875e+02, 2.847285461425781e+02, 2.847149658203125e+02, 2.847013854980469e+02, 2.84687744140625e+02] +cat.tan.sta_b.T=[2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801526489257812e+02, 2.80156494140625e+02, 2.801602478027344e+02, 2.801639709472656e+02, 2.801676635742188e+02, 2.801713256835938e+02, 2.801749877929688e+02, 2.801786193847656e+02, 2.801822814941406e+02, 2.801859130859375e+02, 2.801895751953125e+02, 2.801947021484375e+02, 2.802014770507812e+02, 2.802082824707031e+02, 2.80215087890625e+02, 2.802218933105469e+02, 2.802287292480469e+02, 2.802355651855469e+02, 2.80242431640625e+02, 2.802492980957031e+02, 2.802561950683594e+02, 2.802630920410156e+02, 2.80270263671875e+02, 2.802779846191406e+02, 2.802857971191406e+02, 2.802936706542969e+02, 2.803015747070312e+02, 2.803095092773438e+02, 2.803175048828125e+02, 2.803255004882812e+02, 2.803335266113281e+02, 2.803415832519531e+02, 2.803496704101562e+02, 2.803565368652344e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.823220520019531e+02, 2.805564880371094e+02, 2.801500244140625e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.811344299316406e+02, 2.803103942871094e+02, 2.801579895019531e+02, 2.80150390625e+02, 2.801500244140625e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02] usr1.yVal_actual=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 6.488844752311707e-01, 5.539206266403198e-01, 4.350397884845734e-01, 4.276768267154694e-01, 4.271436929702759e-01, 4.271065294742584e-01, 4.27122563123703e-01, 4.271441102027893e-01, 4.271654188632965e-01, 4.271866381168365e-01, 4.272061288356781e-01, 6.888272166252136e-01, 6.746571063995361e-01, 6.620320677757263e-01, 6.535302400588989e-01, 6.477266550064087e-01, 6.436936259269714e-01, 6.408606767654419e-01, 6.388573050498962e-01, 6.374360918998718e-01, 6.364284157752991e-01, 6.357159018516541e-01, 6.436357498168945e-01, 6.421707272529602e-01, 6.397469639778137e-01, 6.379788517951965e-01, 6.367138028144836e-01, 6.358070969581604e-01, 6.351565718650818e-01, 6.346895694732666e-01, 6.343544125556946e-01, 6.341143846511841e-01, 6.339432001113892e-01, 1.29819929599762e-01, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] usr2.yVal_actual=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 5.383833646774292e-01, 5.251340270042419e-01, 5.21766185760498e-01, 5.19461452960968e-01, 5.178165435791016e-01, 5.166453719139099e-01, 5.158153772354126e-01, 5.152313709259033e-01, 5.148248672485352e-01, 5.145469903945923e-01, 5.143622756004333e-01, 5.412585735321045e-01, 5.422655344009399e-01, 5.414134860038757e-01, 5.408165454864502e-01, 5.404288768768311e-01, 5.401930212974548e-01, 5.400669574737549e-01, 5.40020227432251e-01, 5.400309562683105e-01, 5.400833487510681e-01, 5.401660799980164e-01, 5.981610417366028e-01, 6.167843341827393e-01, 6.213207244873047e-01, 6.254279613494873e-01, 6.28542959690094e-01, 6.308589577674866e-01, 6.325575113296509e-01, 6.337833404541016e-01, 6.346506476402283e-01, 6.352471113204956e-01, 6.356417536735535e-01, 8.419466018676491e-02, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] usr3.yVal_actual=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 5.100061297416687e-01, 5.51994264125824e-01, 5.524903535842896e-01, 5.521496534347534e-01, 5.519714951515198e-01, 5.519320368766785e-01, 5.519936680793762e-01, 5.521286725997925e-01, 5.523170232772827e-01, 5.525442957878113e-01, 5.528001189231873e-01, 5.908713340759277e-01, 6.161829829216003e-01, 6.223897337913513e-01, 6.263647675514221e-01, 6.294692158699036e-01, 6.31896436214447e-01, 6.33799135684967e-01, 6.352988481521606e-01, 6.364914178848267e-01, 6.374523043632507e-01, 6.382352709770203e-01, 4.771136343479139e-01, 3.802154660224915e-01, 3.797430098056793e-01, 3.797487616539001e-01, 3.797529339790344e-01, 3.797525763511658e-01, 3.797548115253448e-01, 3.79756897687912e-01, 3.797584772109985e-01, 3.797603249549866e-01, 3.797620534896851e-01, 7.145386934280396e-01, 6.906818151473999e-01, 6.737698912620544e-01, 6.976684331893921e-01, 7.212141156196594e-01, 7.626041769981384e-01, 7.912420034408569e-01, 8.07513952255249e-01, 8.168110251426697e-01, 8.222786784172058e-01, 8.255812525749207e-01, 4.133987128734589e-01, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] From 963e2e330a1c7d890c82a4289eaff1554feb7e17 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Fri, 18 Feb 2022 15:40:38 -0800 Subject: [PATCH 048/463] documentation ChillerAndTank --- .../BaseClasses/ReversiblePumpValveControl.mo | 45 --------- .../Fluid/Storage/Plant/ChillerAndTank.mo | 95 +++++++++++++++++-- 2 files changed, 87 insertions(+), 53 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo index 5a97c4bb379..803042526e6 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo @@ -227,50 +227,5 @@ Buildings.Fluid.Storage.Plant.ChillerAndTank. This block is conditionally enabled when the plant is configured to allow remotely charging the tank.

      -

      -The secondary pump and two control valves are controlled as such: -

      -
        -
      • -The pump is controlled to track a flow rate setpoint of the tank -(can be both positive [discharging] or negative [charging]) -under the following conditions: -
          -
        • -The plant is on, AND -
        • -
        • -the flow direction is \"normal\" (= true), AND -
        • -
        • -val2 (in parallel to the pump) is at most 5% open. -
        • -
        -Otherwise the pump is off. -
      • -
      • -The valve in series with the pump (val1) is controlled to open fully -under the same conditions that allow the pump to be on. -Otherwise the valve is closed. -
      • -
      • -The valve in parallel with the pump (val2) is controlled -to track a negative flow rate setpoint of the tank (charging) -under the following conditions: -
          -
        • -The flow direction is \"reverse\" (= false), AND -
        • -
        • -val1 (in series to the pump) is at most 5% open. -
        • -
        -Otherwise the valve is closed. -
      • -
      -

      -Note that val2 is not commanded to be closed when the plant is \"off\" to allow -remotely charging the tank. -

      ")); end ReversiblePumpValveControl; diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo index 6b37135274f..cb4dcdefd6e 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo @@ -100,10 +100,10 @@ model ChillerAndTank if allowRemoteCharging "Control block for secondary pump-valve group" annotation (Placement(transformation(extent={{80,80},{60,102}}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanInput booOnOff - if allowRemoteCharging - "Plant status: true = online; false = offline" annotation (Placement( - transformation(extent={{120,70},{100,90}}), iconTransformation(extent={{-140, - -120},{-100,-80}}))); + if allowRemoteCharging "Plant status: true = on; false = off" + annotation (Placement( + transformation(extent={{120,70},{100,90}}), + iconTransformation(extent={{-140,-120},{-100,-80}}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanInput booFloDir if allowRemoteCharging "Flow direction: true = normal; false = reverse" annotation (Placement( @@ -124,7 +124,8 @@ model ChillerAndTank y_start=0, l=1E-5, dpValve_nominal=0.1*dp_nominal, - m_flow_nominal=m2_flow_nominal) if allowRemoteCharging + m_flow_nominal=m2_flow_nominal) + if allowRemoteCharging "Valve in series to the pump (normal direction)" annotation (Placement(transformation(extent={{30,-20},{10,0}}))); Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage val2( @@ -147,10 +148,11 @@ model ChillerAndTank rotation=90, origin={-50,90}))); Buildings.Fluid.Storage.Plant.BaseClasses.FluidThrough pasVal1(redeclare - package Medium = Medium2) + package Medium = Medium2) if not allowRemoteCharging "Replaces val1 when remote charging not allowed" annotation (Placement(transformation(extent={{30,-42},{10,-22}}))); - Buildings.Fluid.Storage.Plant.BaseClasses.SignalThrough pasSwiFloDirPum1 if not allowRemoteCharging + Buildings.Fluid.Storage.Plant.BaseClasses.SignalThrough pasSwiFloDirPum1 + if not allowRemoteCharging "Replaces swiFloDirPum1 when remote charging not allowed" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, @@ -335,5 +337,82 @@ equation pattern=LinePattern.None), Line(points={{16,74},{-20,66}},color={0,0,0}), Line(points={{-20,54},{14,44}},color={0,0,0})}), Diagram( - coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,120}}))); + coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,120}})), + Documentation(info=" +

      +This plant model has a chiller and a stratified tank. +By setting allowRemoteCharging = false, +this model is effectively replacing a common pipe with a tank. +By setting allowRemoteCharging = true, +the tank can be charged by the CHW network instead of its own chiller. +

      +

      +When remote charging is enabled, the plant's operation mode is determined by +two boolean inputs: +

      +
        +
      • +booFloDir determines the direction flow direction of the plant. +It has reverse flow when and only when the tank is being charged remotely. +
      • +
      • +booOnOff determines whether the plant outputs CHW to the network. +When it is off, the plant still allows the tank to be charged remotely +(if the flow direction is set to reverse at the same time). +
      • +
      +

      +When remote charging is allowed, the secondary pump and two conditionally-enabled +control valves are controlled by + +Buildings.Fluid.Storage.Plant.BaseClasses.ReversiblePumpValveControl as such: +

      +
        +
      • +The pump is controlled to track a flow rate setpoint of the tank +(can be both positive [discharging] or negative [charging]) +under the following conditions: +
          +
        • +The plant is on, AND +
        • +
        • +the flow direction is \"normal\" (= true), AND +
        • +
        • +val2 (in parallel to the pump) is at most 5% open. +
        • +
        +Otherwise the pump is off. +
      • +
      • +The valve in series with the pump (val1) is controlled to open fully +under the same conditions that allow the pump to be on. +Otherwise the valve is closed. +
      • +
      • +The valve in parallel with the pump (val2) is controlled +to track a negative flow rate setpoint of the tank (charging) +under the following conditions: +
          +
        • +The flow direction is \"reverse\" (= false), AND +
        • +
        • +val1 (in series to the pump) is at most 5% open. +
        • +
        +Otherwise the valve is closed. +Not that it is NOT closed when the plant is \"off\". +
      • +
      +", revisions=" +
        +
      • +February 18, 2022 by Hongxiang Fu:
        +First implementation. This is for +#2859. +
      • +
      +")); end ChillerAndTank; From bcf8c008e6ab08bc127bed5c8d399048fe87d59b Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Mon, 14 Mar 2022 08:15:45 -0700 Subject: [PATCH 049/463] deleted SignalThrough and reused same MSL block --- .../Plant/BaseClasses/SignalThrough.mo | 35 ------------------- .../Storage/Plant/BaseClasses/package.order | 1 - .../Fluid/Storage/Plant/ChillerAndTank.mo | 2 +- 3 files changed, 1 insertion(+), 37 deletions(-) delete mode 100644 Buildings/Fluid/Storage/Plant/BaseClasses/SignalThrough.mo diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/SignalThrough.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/SignalThrough.mo deleted file mode 100644 index e8333d1062c..00000000000 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/SignalThrough.mo +++ /dev/null @@ -1,35 +0,0 @@ -within Buildings.Fluid.Storage.Plant.BaseClasses; -block SignalThrough "Signal passes through" - extends Modelica.Blocks.Icons.Block; - Modelica.Blocks.Interfaces.RealInput u "Signal in" annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-110,0}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-110,0}))); - Modelica.Blocks.Interfaces.RealOutput y "Signal out" annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={110,0}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={110,0}))); -equation - connect(u, y) annotation (Line(points={{-110,0},{110,0}}, color={0,0,127})); - annotation (Icon(graphics={Line(points={{-100,0},{100,0}}, color={28,108,200})}), - Documentation(info=" -Signal directly passes through from the input to the output. -This is used to replace conditionally-enabled blocks with a connection. -", revisions=" -
        -
      • -February 18, 2022 by Hongxiang Fu:
        -First implementation. This is for -#2859. -
      • -
      -")); -end SignalThrough; diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/package.order b/Buildings/Fluid/Storage/Plant/BaseClasses/package.order index fa58381dc71..38284a38b19 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/package.order +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/package.order @@ -1,3 +1,2 @@ FluidThrough ReversiblePumpValveControl -SignalThrough diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo index cb4dcdefd6e..7da3e815428 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo @@ -151,7 +151,7 @@ model ChillerAndTank package Medium = Medium2) if not allowRemoteCharging "Replaces val1 when remote charging not allowed" annotation (Placement(transformation(extent={{30,-42},{10,-22}}))); - Buildings.Fluid.Storage.Plant.BaseClasses.SignalThrough pasSwiFloDirPum1 + Modelica.Blocks.Routing.RealPassThrough pasSwiFloDirPum1 if not allowRemoteCharging "Replaces swiFloDirPum1 when remote charging not allowed" annotation ( Placement(transformation( From 74be359a2b7264914be40890b17980fcd0c20a78 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Mon, 14 Mar 2022 08:16:17 -0700 Subject: [PATCH 050/463] renamed FluidThrough to FluidPassThrough --- .../BaseClasses/{FluidThrough.mo => FluidPassThrough.mo} | 4 ++-- Buildings/Fluid/Storage/Plant/BaseClasses/package.order | 2 +- Buildings/Fluid/Storage/Plant/ChillerAndTank.mo | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) rename Buildings/Fluid/Storage/Plant/BaseClasses/{FluidThrough.mo => FluidPassThrough.mo} (90%) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/FluidThrough.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/FluidPassThrough.mo similarity index 90% rename from Buildings/Fluid/Storage/Plant/BaseClasses/FluidThrough.mo rename to Buildings/Fluid/Storage/Plant/BaseClasses/FluidPassThrough.mo index ec720a715cb..95562989999 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/FluidThrough.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/FluidPassThrough.mo @@ -1,5 +1,5 @@ within Buildings.Fluid.Storage.Plant.BaseClasses; -model FluidThrough "Fluid passes through" +model FluidPassThrough "Pass a fluid through without modification" extends Interfaces.PartialTwoPort; equation connect(port_a, port_b) annotation (Line(points={{-100,0},{0,0},{0,0},{100,0}}, @@ -23,4 +23,4 @@ First implementation. This is for
    ")); -end FluidThrough; +end FluidPassThrough; diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/package.order b/Buildings/Fluid/Storage/Plant/BaseClasses/package.order index 38284a38b19..cfbfab08682 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/package.order +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/package.order @@ -1,2 +1,2 @@ -FluidThrough +FluidPassThrough ReversiblePumpValveControl diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo index 7da3e815428..0694f292dd5 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo @@ -147,9 +147,9 @@ model ChillerAndTank annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=90, origin={-50,90}))); - Buildings.Fluid.Storage.Plant.BaseClasses.FluidThrough pasVal1(redeclare - package Medium = Medium2) - if not allowRemoteCharging "Replaces val1 when remote charging not allowed" + Buildings.Fluid.Storage.Plant.BaseClasses.FluidPassThrough pasVal1(redeclare + package Medium = Medium2) if not allowRemoteCharging + "Replaces val1 when remote charging not allowed" annotation (Placement(transformation(extent={{30,-42},{10,-22}}))); Modelica.Blocks.Routing.RealPassThrough pasSwiFloDirPum1 if not allowRemoteCharging From 4e7a37b77e20ab02bd23882506c3506c14494553 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Mon, 14 Mar 2022 08:48:27 -0700 Subject: [PATCH 051/463] renamed pum1/2 and val1/2 --- .../Fluid/Storage/Plant/ChillerAndTank.mo | 95 +++++++++---------- 1 file changed, 47 insertions(+), 48 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo index 0694f292dd5..58b9dd612e5 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo @@ -63,7 +63,7 @@ model ChillerAndTank rotation=0, origin={-110,100}))); - Buildings.Fluid.Movers.FlowControlled_m_flow pum1( + Buildings.Fluid.Movers.FlowControlled_m_flow pumPri( redeclare package Medium = Medium2, per(pressure(dp=dp_nominal*{2,1.2,0}, V_flow=mChi_flow_nominal/1.2*{0,1.2,2})), energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, @@ -83,7 +83,7 @@ model ChillerAndTank extent={{10,-10},{-10,10}}, rotation=180, origin={110,-20}))); - Buildings.Fluid.Movers.SpeedControlled_y pum2( + Buildings.Fluid.Movers.SpeedControlled_y pumSec( redeclare package Medium = Medium2, per(pressure(dp=dp_nominal*{2,1.2,0}, V_flow=(mChi_flow_nominal + mTan_flow_nominal)/1.2*{0,1.2,2})), @@ -91,7 +91,8 @@ model ChillerAndTank allowFlowReversal=true, addPowerToMedium=false, y_start=0, - T_start=T_CHWR_nominal) "Secondary pump" annotation (Placement(transformation( + T_start=T_CHWR_nominal) "Secondary CHW pump" annotation (Placement( + transformation( extent={{10,-10},{-10,10}}, rotation=0, origin={80,-20}))); @@ -118,24 +119,23 @@ model ChillerAndTank rotation=0, origin={-110,20}))); - Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage val1( + Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valDis( redeclare package Medium = Medium2, use_inputFilter=true, y_start=0, l=1E-5, dpValve_nominal=0.1*dp_nominal, - m_flow_nominal=m2_flow_nominal) - if allowRemoteCharging - "Valve in series to the pump (normal direction)" + m_flow_nominal=m2_flow_nominal) if allowRemoteCharging + "Discharge valve, in series to the pump (normal direction)" annotation (Placement(transformation(extent={{30,-20},{10,0}}))); - Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage val2( + Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valCha( redeclare package Medium = Medium2, use_inputFilter=true, y_start=0, l=1E-5, dpValve_nominal=0.1*dp_nominal, m_flow_nominal=mTan_flow_nominal) if allowRemoteCharging - "Valve in parallel to the secondary pump (reverse direction)" + "Charging valve, in parallel to the secondary pump (reverse direction)" annotation (Placement(transformation(extent={{10,-80},{30,-60}}))); Buildings.Controls.OBC.CDL.Continuous.Switch swiFloDirPum1 if allowRemoteCharging "Switches off pum1 when tank charged remotely" @@ -147,9 +147,9 @@ model ChillerAndTank annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=90, origin={-50,90}))); - Buildings.Fluid.Storage.Plant.BaseClasses.FluidPassThrough pasVal1(redeclare - package Medium = Medium2) if not allowRemoteCharging - "Replaces val1 when remote charging not allowed" + Buildings.Fluid.Storage.Plant.BaseClasses.FluidPassThrough pasValDis( + redeclare package Medium = Medium2) if not allowRemoteCharging + "Replaces valDis when remote charging not allowed" annotation (Placement(transformation(extent={{30,-42},{10,-22}}))); Modelica.Blocks.Routing.RealPassThrough pasSwiFloDirPum1 if not allowRemoteCharging @@ -204,7 +204,7 @@ model ChillerAndTank redeclare package Medium = Medium2, final allowFlowReversal=true) "Flow rate sensor" annotation (Placement(transformation(extent={{-10,-80},{-30,-60}}))); - Buildings.Fluid.FixedResistances.CheckValve cheValPum1( + Buildings.Fluid.FixedResistances.CheckValve cheValPumPri( redeclare package Medium = Medium2, m_flow_nominal=mChi_flow_nominal, dpValve_nominal=0.1*dp_nominal, @@ -213,7 +213,7 @@ model ChillerAndTank extent={{-10,-10},{10,10}}, rotation=-90, origin={-70,-30}))); - Buildings.Fluid.FixedResistances.CheckValve cheValPum2( + Buildings.Fluid.FixedResistances.CheckValve cheValPumSec( redeclare package Medium = Medium2, m_flow_nominal=m2_flow_nominal, dpValve_nominal=0.1*dp_nominal, @@ -223,38 +223,37 @@ model ChillerAndTank rotation=180, origin={50,-20}))); equation - connect(conPum2Gro.yVal1, val1.y) annotation (Line(points={{66,78.9},{66,56}, - {20,56},{20,2}}, color={0,0,127})); + connect(conPum2Gro.yVal1, valDis.y) annotation (Line(points={{66,78.9},{66,56}, + {20,56},{20,2}}, color={0,0,127})); connect(conPum2Gro.us_mTan_flow, set_mTan_flow) annotation (Line(points={{81, 95.4},{90,95.4},{90,118},{80,118},{80,130}}, color={0,0,127})); - connect(pum2.y, conPum2Gro.yPum2) annotation (Line(points={{80,-8},{80,20},{ + connect(pumSec.y, conPum2Gro.yPum2) annotation (Line(points={{80,-8},{80,20},{ 70,20},{70,78.9}}, color={0,0,127})); connect(swiFloDirPum1.u2, booFloDir) annotation (Line(points={{-10,102},{-10,112}, {96,112},{96,100},{110,100}}, color={255,0,255})); connect(swiFloDirPum1.u1, set_mPum1_flow) annotation (Line(points={{-2,102},{-2, 108},{40,108},{40,130}}, color={0,0,127})); - connect(pum1.m_flow_in,swiFloDirPum1. y) - annotation (Line(points={{-20,-20},{-20,72},{-10,72},{-10,78}}, - color={0,0,127})); + connect(pumPri.m_flow_in, swiFloDirPum1.y) annotation (Line(points={{-20,-20}, + {-20,72},{-10,72},{-10,78}}, color={0,0,127})); connect(conZero.y,swiFloDirPum1. u3) annotation (Line(points={{-50,101},{-50,108}, {-18,108},{-18,102}}, color={0,0,127})); - connect(pasSwiFloDirPum1.u, set_mPum1_flow) annotation (Line(points={{28,101}, + connect(pasSwiFloDirPum1.u, set_mPum1_flow) annotation (Line(points={{28,102}, {28,108},{40,108},{40,130}}, color={0,0,127})); - connect(pasSwiFloDirPum1.y, pum1.m_flow_in) annotation (Line(points={{28,79}, + connect(pasSwiFloDirPum1.y, pumPri.m_flow_in) annotation (Line(points={{28,79}, {28,72},{-20,72},{-20,-20}}, color={0,0,127})); - connect(pum2.y, yPum2) - annotation (Line(points={{80,-8},{80,20},{110,20}}, color={0,0,127})); - connect(pum2.port_a, port_a2) + connect(pumSec.y, yPum2) + annotation (Line(points={{80,-8},{80,20},{110,20}}, color={0,0,127})); + connect(pumSec.port_a, port_a2) annotation (Line(points={{90,-20},{90,-60},{100,-60}}, color={0,127,255})); - connect(val2.port_b, port_a2) annotation (Line(points={{30,-70},{90,-70},{90, + connect(valCha.port_b, port_a2) annotation (Line(points={{30,-70},{90,-70},{90, -60},{100,-60}}, color={0,127,255})); connect(conPum2Gro.booOnOff, booOnOff) annotation (Line(points={{82,82.2},{82, 82},{96,82},{96,80},{110,80}}, color={255,0,255})); connect(conPum2Gro.booFloDir, booFloDir) annotation (Line(points={{82,86.6},{ 82,86},{96,86},{96,100},{110,100}}, color={255,0,255})); - connect(pum1.port_b, chi.port_a2) annotation (Line(points={{-30,-32},{-40,-32}, - {-40,4}}, color={0,127,255})); + connect(pumPri.port_b, chi.port_a2) + annotation (Line(points={{-30,-32},{-40,-32},{-40,4}}, color={0,127,255})); connect(chi.on, booFloDir) annotation (Line(points={{-62,13},{-62,12},{-72,12}, {-72,112},{96,112},{96,100},{110,100}}, color={255,0,255})); connect(onChi.y, chi.on) annotation (Line(points={{-78,40},{-72,40},{-72,13}, @@ -265,8 +264,8 @@ equation 60},{-100,60}}, color={0,127,255})); connect(chi.port_b1, port_b1) annotation (Line(points={{-40,16},{-32,16},{-32, 60},{100,60}}, color={0,127,255})); - connect(val1.y_actual, conPum2Gro.yVal1_actual) annotation (Line(points={{15,-3}, - {14,-3},{14,68},{46,68},{46,99.8},{59,99.8}}, color={0,0,127})); + connect(valDis.y_actual, conPum2Gro.yVal1_actual) annotation (Line(points={{15, + -3},{14,-3},{14,68},{46,68},{46,99.8},{59,99.8}}, color={0,0,127})); connect(sen_m_flow.m_flow, mTan_flow) annotation (Line(points={{-20,-59},{-20, -56},{0,-56},{0,-110}}, color={0,0,127})); connect(sen_m_flow.m_flow, conPum2Gro.um_mTan_flow) annotation (Line(points={{-20,-59}, @@ -280,29 +279,29 @@ equation color={0,127,255})); connect(port_b2, preDro2.port_b) annotation (Line(points={{-100,-60},{-80,-60}, {-80,-70}}, color={0,127,255})); - connect(chi.port_b2, cheValPum1.port_a) + connect(chi.port_b2, cheValPumPri.port_a) annotation (Line(points={{-60,4},{-70,4},{-70,-20}}, color={0,127,255})); - connect(cheValPum1.port_b, port_b2) annotation (Line(points={{-70,-40},{-70, + connect(cheValPumPri.port_b, port_b2) annotation (Line(points={{-70,-40},{-70, -60},{-100,-60}}, color={0,127,255})); - connect(val2.port_a, pum1.port_a) annotation (Line(points={{10,-70},{4,-70},{ - 4,-32},{-10,-32}}, color={0,127,255})); - connect(sen_m_flow.port_a, pum1.port_a) annotation (Line(points={{-10,-70},{4, - -70},{4,-32},{-10,-32}}, color={0,127,255})); - connect(pasVal1.port_b, pum1.port_a) + connect(valCha.port_a, pumPri.port_a) annotation (Line(points={{10,-70},{4,-70}, + {4,-32},{-10,-32}}, color={0,127,255})); + connect(sen_m_flow.port_a, pumPri.port_a) annotation (Line(points={{-10,-70},{ + 4,-70},{4,-32},{-10,-32}}, color={0,127,255})); + connect(pasValDis.port_b, pumPri.port_a) annotation (Line(points={{10,-32},{-10,-32}}, color={0,127,255})); - connect(val1.port_b, pum1.port_a) annotation (Line(points={{10,-10},{4,-10},{ - 4,-32},{-10,-32}}, color={0,127,255})); - connect(pum2.port_b, cheValPum2.port_a) + connect(valDis.port_b, pumPri.port_a) annotation (Line(points={{10,-10},{4,-10}, + {4,-32},{-10,-32}}, color={0,127,255})); + connect(pumSec.port_b, cheValPumSec.port_a) annotation (Line(points={{70,-20},{60,-20}}, color={0,127,255})); - connect(pasVal1.port_a, cheValPum2.port_b) annotation (Line(points={{30,-32}, + connect(pasValDis.port_a, cheValPumSec.port_b) annotation (Line(points={{30,-32}, {34,-32},{34,-20},{40,-20}}, color={0,127,255})); - connect(val1.port_a, cheValPum2.port_b) annotation (Line(points={{30,-10},{34, - -10},{34,-20},{40,-20}}, color={0,127,255})); - connect(conPum2Gro.yVal2, val2.y) annotation (Line(points={{62,78.9},{62,4},{ - 94,4},{94,-44},{20,-44},{20,-58}}, color={0,0,127})); - connect(conPum2Gro.yVal2_actual, val2.y_actual) annotation (Line(points={{59, - 95.4},{54,95.4},{54,96},{48,96},{48,6},{96,6},{96,-46},{60,-46},{60, - -63},{25,-63}}, color={0,0,127})); + connect(valDis.port_a, cheValPumSec.port_b) annotation (Line(points={{30,-10}, + {34,-10},{34,-20},{40,-20}}, color={0,127,255})); + connect(conPum2Gro.yVal2, valCha.y) annotation (Line(points={{62,78.9},{62,4}, + {94,4},{94,-44},{20,-44},{20,-58}}, color={0,0,127})); + connect(conPum2Gro.yVal2_actual, valCha.y_actual) annotation (Line(points={{59, + 95.4},{54,95.4},{54,96},{48,96},{48,6},{96,6},{96,-46},{60,-46},{60,-63}, + {25,-63}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,100}}), graphics={Line( points={{-30,-110},{30,-110}}, From 5556d125354e57205d766dcd4bcb390b4de4a8b7 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Mon, 14 Mar 2022 08:55:21 -0700 Subject: [PATCH 052/463] added condenser nominal flow --- .../Fluid/Storage/Plant/ChillerAndTank.mo | 24 ++++++++++--------- .../Plant/Examples/OneSourceOneUser.mo | 3 ++- .../Plant/Examples/TwoSourcesThreeUsers.mo | 3 ++- .../ChillerAndTankNoRemoteCharging.mo | 3 ++- .../ChillerAndTankWithRemoteCharging.mo | 3 ++- 5 files changed, 21 insertions(+), 15 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo index 58b9dd612e5..815a822d323 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo @@ -2,16 +2,18 @@ within Buildings.Fluid.Storage.Plant; model ChillerAndTank "(Draft) Model of a plant with a chiller and a tank where the tank can potentially be charged remotely" extends Buildings.Fluid.Interfaces.PartialFourPortInterface( - final m1_flow_nominal = m2_flow_nominal, - final m2_flow_nominal = mChi_flow_nominal + mTan_flow_nominal); + final m1_flow_nominal = mCon_flow_nominal, + final m2_flow_nominal = mEva_flow_nominal + mTan_flow_nominal); parameter Boolean allowRemoteCharging = true "Turns the plant to a prosumer"; - parameter Modelica.Units.SI.MassFlowRate mChi_flow_nominal=1 - "Nominal mass flow rate for the chiller branch"; + parameter Modelica.Units.SI.MassFlowRate mEva_flow_nominal=1 + "Nominal mass flow rate for CHW chiller branch"; + parameter Modelica.Units.SI.MassFlowRate mCon_flow_nominal=1 + "Nominal mass flow rate for CDW loop"; parameter Modelica.Units.SI.MassFlowRate mTan_flow_nominal=1 - "Nominal mass flow rate for the tank branch"; + "Nominal mass flow rate for CHW tank branch"; parameter Modelica.Units.SI.PressureDifference dp_nominal= p_CHWS_nominal-p_CHWR_nominal "Nominal pressure difference"; @@ -31,8 +33,8 @@ model ChillerAndTank PLRMinUnl=0.3, PLRMin=0.3, etaMotor=1, - mEva_flow_nominal=mChi_flow_nominal, - mCon_flow_nominal=mChi_flow_nominal*1.2, + mEva_flow_nominal=mEva_flow_nominal, + mCon_flow_nominal=mEva_flow_nominal*1.2, TEvaLvg_nominal=280.15, capFunT={1,0,0,0,0,0}, EIRFunT={1,0,0,0,0,0}, @@ -65,11 +67,11 @@ model ChillerAndTank Buildings.Fluid.Movers.FlowControlled_m_flow pumPri( redeclare package Medium = Medium2, - per(pressure(dp=dp_nominal*{2,1.2,0}, V_flow=mChi_flow_nominal/1.2*{0,1.2,2})), + per(pressure(dp=dp_nominal*{2,1.2,0}, V_flow=mEva_flow_nominal/1.2*{0,1.2,2})), energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, allowFlowReversal=true, addPowerToMedium=false, - m_flow_nominal=mChi_flow_nominal, + m_flow_nominal=mEva_flow_nominal, m_flow_start=0, T_start=T_CHWR_nominal) "Primary CHW pump" annotation (Placement(transformation(extent={{-10,-42},{-30,-22}}))); @@ -85,7 +87,7 @@ model ChillerAndTank origin={110,-20}))); Buildings.Fluid.Movers.SpeedControlled_y pumSec( redeclare package Medium = Medium2, - per(pressure(dp=dp_nominal*{2,1.2,0}, V_flow=(mChi_flow_nominal + + per(pressure(dp=dp_nominal*{2,1.2,0}, V_flow=(mEva_flow_nominal + mTan_flow_nominal)/1.2*{0,1.2,2})), energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, allowFlowReversal=true, @@ -206,7 +208,7 @@ model ChillerAndTank annotation (Placement(transformation(extent={{-10,-80},{-30,-60}}))); Buildings.Fluid.FixedResistances.CheckValve cheValPumPri( redeclare package Medium = Medium2, - m_flow_nominal=mChi_flow_nominal, + m_flow_nominal=mEva_flow_nominal, dpValve_nominal=0.1*dp_nominal, dpFixed_nominal=0.1*dp_nominal) "Check valve with series resistance" annotation (Placement(transformation( diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo index 097ae210f27..dc67cc50192 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo @@ -27,7 +27,8 @@ model OneSourceOneUser "(Draft) Simple system model with one source and one user redeclare final package Medium1=Medium1, redeclare final package Medium2=Medium2, final allowRemoteCharging=false, - final mChi_flow_nominal=m_flow_nominal/2, + final mEva_flow_nominal=m_flow_nominal/2, + final mCon_flow_nominal=m_flow_nominal/2, final mTan_flow_nominal=m_flow_nominal/2, final p_CHWS_nominal=p_CHWS_nominal, final p_CHWR_nominal=p_CHWR_nominal, diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index f36cd7d206d..4c465420e7c 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -25,7 +25,8 @@ model TwoSourcesThreeUsers Buildings.Fluid.Storage.Plant.ChillerAndTank cat( redeclare final package Medium1 = Medium1, redeclare final package Medium2 = Medium2, - final mChi_flow_nominal=0.3*m_flow_nominal, + final mEva_flow_nominal=0.3*m_flow_nominal, + final mCon_flow_nominal=0.3*m_flow_nominal, final mTan_flow_nominal=0.3*m_flow_nominal, final p_CHWS_nominal=p_CHWS_nominal, final p_CHWR_nominal=p_CHWR_nominal, diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo index 9a884c460a3..8f0062cbc41 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo @@ -19,7 +19,8 @@ model ChillerAndTankNoRemoteCharging redeclare final package Medium1=Medium1, redeclare final package Medium2=Medium2, final allowRemoteCharging=false, - final mChi_flow_nominal=1, + final mEva_flow_nominal=1, + final mCon_flow_nominal=1, final mTan_flow_nominal=1, final p_CHWS_nominal=p_CHWS_nominal, final p_CHWR_nominal=p_CHWR_nominal, diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo index db0277386df..5b9f4ef7672 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo @@ -20,7 +20,8 @@ model ChillerAndTankWithRemoteCharging redeclare final package Medium1 = Medium1, redeclare final package Medium2 = Medium2, final allowRemoteCharging=true, - final mChi_flow_nominal=1, + final mEva_flow_nominal=1, + final mCon_flow_nominal=1, final mTan_flow_nominal=1, final p_CHWS_nominal=p_CHWS_nominal, final p_CHWR_nominal=p_CHWR_nominal, From 7d4b4d3ee9463aaf34d7be76e01376b545deeed8 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Mon, 14 Mar 2022 08:56:37 -0700 Subject: [PATCH 053/463] improved description of allowRemoteCharging --- Buildings/Fluid/Storage/Plant/ChillerAndTank.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo index 815a822d323..24f5852696e 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo @@ -6,7 +6,7 @@ model ChillerAndTank final m2_flow_nominal = mEva_flow_nominal + mTan_flow_nominal); parameter Boolean allowRemoteCharging = true - "Turns the plant to a prosumer"; + "= true if the tank is allowed to be charged by a remote source"; parameter Modelica.Units.SI.MassFlowRate mEva_flow_nominal=1 "Nominal mass flow rate for CHW chiller branch"; From 5486bed2c655d46548144cf9931967e26036894e Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Mon, 14 Mar 2022 10:52:51 -0700 Subject: [PATCH 054/463] removed default values for nominal values --- Buildings/Fluid/Storage/Plant/ChillerAndTank.mo | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo index 24f5852696e..41ac0c1958d 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo @@ -8,11 +8,11 @@ model ChillerAndTank parameter Boolean allowRemoteCharging = true "= true if the tank is allowed to be charged by a remote source"; - parameter Modelica.Units.SI.MassFlowRate mEva_flow_nominal=1 + parameter Modelica.Units.SI.MassFlowRate mEva_flow_nominal(min=0) "Nominal mass flow rate for CHW chiller branch"; - parameter Modelica.Units.SI.MassFlowRate mCon_flow_nominal=1 + parameter Modelica.Units.SI.MassFlowRate mCon_flow_nominal(min=0) "Nominal mass flow rate for CDW loop"; - parameter Modelica.Units.SI.MassFlowRate mTan_flow_nominal=1 + parameter Modelica.Units.SI.MassFlowRate mTan_flow_nominal(min=0) "Nominal mass flow rate for CHW tank branch"; parameter Modelica.Units.SI.PressureDifference dp_nominal= p_CHWS_nominal-p_CHWR_nominal From e06e2a617891b1c9900b45ce542564e6dab7dbee Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Mon, 14 Mar 2022 10:53:02 -0700 Subject: [PATCH 055/463] updated var names in unit tests --- ...mples_BaseClasses_Validation_DummyUser.txt | 2 +- ...torage_Plant_Examples_OneSourceOneUser.txt | 6 ++--- ...ge_Plant_Examples_TwoSourcesThreeUsers.txt | 22 +++++++++---------- ...idation_ChillerAndTankNoRemoteCharging.txt | 8 +++---- ...ation_ChillerAndTankWithRemoteCharging.txt | 8 +++---- .../Plant/Examples/OneSourceOneUser.mos | 2 +- .../Plant/Examples/TwoSourcesThreeUsers.mos | 2 +- .../ChillerAndTankNoRemoteCharging.mos | 2 +- .../ChillerAndTankWithRemoteCharging.mos | 2 +- ...torage.Plant.Examples.OneSourceOneUser.mos | 4 ++-- ...ge.Plant.Examples.TwoSourcesThreeUsers.mos | 4 ++-- ...idation.ChillerAndTankNoRemoteCharging.mos | 4 ++-- ...ation.ChillerAndTankWithRemoteCharging.mos | 4 ++-- 13 files changed, 35 insertions(+), 35 deletions(-) diff --git a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_BaseClasses_Validation_DummyUser.txt b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_BaseClasses_Validation_DummyUser.txt index 9deff7d334a..6c2cb37fb8f 100644 --- a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_BaseClasses_Validation_DummyUser.txt +++ b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_BaseClasses_Validation_DummyUser.txt @@ -1,4 +1,4 @@ -last-generated=2022-02-18 +last-generated=2022-03-14 statistics-initialization= { "nonlinear": "1", diff --git a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_OneSourceOneUser.txt b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_OneSourceOneUser.txt index 337e08b98b1..36d198026d6 100644 --- a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_OneSourceOneUser.txt +++ b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_OneSourceOneUser.txt @@ -1,4 +1,4 @@ -last-generated=2022-02-18 +last-generated=2022-03-14 statistics-initialization= { "nonlinear": "1, 0, 1, 1", @@ -12,7 +12,7 @@ statistics-simulation= "numerical Jacobians": "0" } time=[0e+00, 3.6e+03] -cat.pum1.m_flow=[0e+00, 4.999552965164185e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01] +cat.pumPri.m_flow=[0e+00, 4.999552965164185e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01] cat.mTan_flow=[0e+00, -4.999551773071289e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, 2.893969416618347e-01, 3.502776920795441e-01, 3.745021224021912e-01, 3.929356634616852e-01, 4.070073962211609e-01, 4.177742600440979e-01, 4.260265231132507e-01, 4.318293333053589e-01, 4.110586643218994e-01, 4.04619425535202e-01, 4.037973880767822e-01, 4.040806889533997e-01, 4.045733213424683e-01, 4.05122309923172e-01, 4.056960344314575e-01, 4.062855541706085e-01, 4.068860113620758e-01, 4.074938297271729e-01, 4.081068336963654e-01, 4.087235927581787e-01, 4.093431234359741e-01, 4.099647402763367e-01, 4.105879962444305e-01, 4.112125039100647e-01, 4.118382036685944e-01, 4.1246497631073e-01, 4.130928516387939e-01, 4.137217998504639e-01, 4.143518507480621e-01, 4.149830341339111e-01, 4.156154692173004e-01, 4.162492156028748e-01, 4.168843924999237e-01, -2.810051441192627e-01, -4.999998211860657e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01] -cat.pum2.m_flow=[0e+00, 1.074058886274543e-07, 1.138643952458551e-07, 1.187495826115992e-07, 1.224258596721484e-07, 1.251844281568992e-07, 1.272499758897538e-07, 1.287942552608001e-07, 1.299478924465802e-07, 1.308092549834328e-07, 1.314519266770731e-07, 1.319312588066168e-07, 1.322886333809947e-07, 1.32554973220067e-07, 1.327534278061648e-07, 1.329012917494765e-07, 1.330114258735193e-07, 1.330933798726619e-07, 1.331544439153731e-07, 1.331999754938806e-07, 1.332339252257952e-07, 1.332592489688977e-07, 1.332781209839595e-07, 1.332921755192729e-07, 1.33302648919198e-07, 1.333104506784366e-07, 1.333162771288698e-07, 1.333206256504127e-07, 1.333238657252878e-07, 1.333262673597346e-07, 1.333280721382835e-07, 1.333294079586267e-07, 1.333304027184568e-07, 1.333311558937567e-07, 7.893969416618347e-01, 8.502776622772217e-01, 8.745021224021912e-01, 8.929356932640076e-01, 9.070073962211609e-01, 9.177742600440979e-01, 9.260265231132507e-01, 9.318293333053589e-01, 9.110586643218994e-01, 9.046193957328796e-01, 9.037973880767822e-01, 9.040806889533997e-01, 9.045733213424683e-01, 9.051223397254944e-01, 9.056960344314575e-01, 9.062855839729309e-01, 9.068859815597534e-01, 9.074938297271729e-01, 9.08106803894043e-01, 9.087235927581787e-01, 9.093431234359741e-01, 9.099647402763367e-01, 9.105879664421082e-01, 9.112125039100647e-01, 9.11838173866272e-01, 9.1246497631073e-01, 9.130928516387939e-01, 9.137217998504639e-01, 9.143518209457397e-01, 9.149830341339111e-01, 9.15615439414978e-01, 9.162492156028748e-01, 9.168843626976013e-01, 2.189948409795761e-01, 1.645939136096786e-07, 1.559465090394951e-07, 1.500950190802541e-07, 1.457720912867444e-07, 1.425723468173601e-07, 1.40200498321974e-07, 1.384403276460944e-07, 1.371328863797316e-07, 1.361610628691778e-07, 1.354383414309268e-07, 1.349006595319224e-07, 1.345004392305782e-07, 1.34202508661474e-07, 1.339806772193697e-07, 1.338154902441602e-07, 1.336924668748907e-07, 1.336008494945418e-07, 1.335326089701994e-07, 1.334817625320284e-07, 1.334439048150671e-07, 1.334157104793121e-07, 1.333947636794619e-07, 1.333791459501299e-07, 1.333675356818276e-07, 1.333588670604513e-07, 1.333524011215559e-07, 1.33347555220098e-07, 1.333439456630003e-07, 1.333412456006045e-07, 1.333392418700896e-07, 1.333377497303445e-07, 1.33336627072822e-07, 1.333357886323938e-07] +cat.pumSec.m_flow=[0e+00, 1.074058886274543e-07, 1.138643952458551e-07, 1.187495826115992e-07, 1.224258596721484e-07, 1.251844281568992e-07, 1.272499758897538e-07, 1.287942552608001e-07, 1.299478924465802e-07, 1.308092549834328e-07, 1.314519266770731e-07, 1.319312588066168e-07, 1.322886333809947e-07, 1.32554973220067e-07, 1.327534278061648e-07, 1.329012917494765e-07, 1.330114258735193e-07, 1.330933798726619e-07, 1.331544439153731e-07, 1.331999754938806e-07, 1.332339252257952e-07, 1.332592489688977e-07, 1.332781209839595e-07, 1.332921755192729e-07, 1.33302648919198e-07, 1.333104506784366e-07, 1.333162771288698e-07, 1.333206256504127e-07, 1.333238657252878e-07, 1.333262673597346e-07, 1.333280721382835e-07, 1.333294079586267e-07, 1.333304027184568e-07, 1.333311558937567e-07, 7.893969416618347e-01, 8.502776622772217e-01, 8.745021224021912e-01, 8.929356932640076e-01, 9.070073962211609e-01, 9.177742600440979e-01, 9.260265231132507e-01, 9.318293333053589e-01, 9.110586643218994e-01, 9.046193957328796e-01, 9.037973880767822e-01, 9.040806889533997e-01, 9.045733213424683e-01, 9.051223397254944e-01, 9.056960344314575e-01, 9.062855839729309e-01, 9.068859815597534e-01, 9.074938297271729e-01, 9.08106803894043e-01, 9.087235927581787e-01, 9.093431234359741e-01, 9.099647402763367e-01, 9.105879664421082e-01, 9.112125039100647e-01, 9.11838173866272e-01, 9.1246497631073e-01, 9.130928516387939e-01, 9.137217998504639e-01, 9.143518209457397e-01, 9.149830341339111e-01, 9.15615439414978e-01, 9.162492156028748e-01, 9.168843626976013e-01, 2.189948409795761e-01, 1.645939136096786e-07, 1.559465090394951e-07, 1.500950190802541e-07, 1.457720912867444e-07, 1.425723468173601e-07, 1.40200498321974e-07, 1.384403276460944e-07, 1.371328863797316e-07, 1.361610628691778e-07, 1.354383414309268e-07, 1.349006595319224e-07, 1.345004392305782e-07, 1.34202508661474e-07, 1.339806772193697e-07, 1.338154902441602e-07, 1.336924668748907e-07, 1.336008494945418e-07, 1.335326089701994e-07, 1.334817625320284e-07, 1.334439048150671e-07, 1.334157104793121e-07, 1.333947636794619e-07, 1.333791459501299e-07, 1.333675356818276e-07, 1.333588670604513e-07, 1.333524011215559e-07, 1.33347555220098e-07, 1.333439456630003e-07, 1.333412456006045e-07, 1.333392418700896e-07, 1.333377497303445e-07, 1.33336627072822e-07, 1.333357886323938e-07] usr.yVal_actual=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 9.211110472679138e-01, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 9.946639537811279e-01, 9.245693683624268e-01, 9.071856737136841e-01, 9.031168222427368e-01, 9.018986821174622e-01, 9.015378952026367e-01, 9.016034603118896e-01, 9.019418358802795e-01, 9.024718403816223e-01, 9.031393527984619e-01, 9.039061665534973e-01, 9.047455191612244e-01, 9.056385159492493e-01, 9.065719246864319e-01, 9.075362086296082e-01, 9.08524751663208e-01, 9.095327258110046e-01, 9.105567336082458e-01, 9.115946888923645e-01, 9.126449227333069e-01, 9.137066006660461e-01, 9.147792458534241e-01, 9.158623814582825e-01, 9.169560670852661e-01, 9.180601239204407e-01, 9.191747307777405e-01, 2.95667439699173e-01, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] diff --git a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_TwoSourcesThreeUsers.txt b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_TwoSourcesThreeUsers.txt index aea09608699..3934bfb6052 100644 --- a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_TwoSourcesThreeUsers.txt +++ b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_TwoSourcesThreeUsers.txt @@ -1,7 +1,7 @@ -last-generated=2022-02-18 +last-generated=2022-03-14 statistics-initialization= { - "nonlinear": "6, 0, 0, 0, 1, 1", + "nonlinear": "5, 0, 0, 0, 1, 1", "numerical Jacobians": "0" } statistics-simulation= @@ -12,12 +12,12 @@ statistics-simulation= "numerical Jacobians": "0" } time=[0e+00, 3.6e+03] -pumChi1.m_flow=[2.90360344479268e-06, 2.574263646692998e-07, 2.841550212906441e-07, 3.041250238311477e-07, 3.1895160645945e-07, 3.299363697806257e-07, 3.380644102435326e-07, 3.440725322434446e-07, 3.48510639014421e-07, 3.517874063163617e-07, 3.54205752728376e-07, 3.559900392247073e-07, 3.943333625793457e-01, -4.101347585674375e-04, -6.165397935546935e-04, -6.312931654974818e-04, -6.325669819489121e-04, -6.326818256638944e-04, -6.326654111035168e-04, -6.326350849121809e-04, -6.326043512672186e-04, -6.325736176222563e-04, -6.325450958684087e-04, 1.676010340452194e-01, 2.260444015264511e-01, 2.280271947383881e-01, 2.296319901943207e-01, 2.309540957212448e-01, 2.3201884329319e-01, 2.328718602657318e-01, 2.335596978664398e-01, 2.341222614049911e-01, 2.345906794071198e-01, 2.349889278411865e-01, 6.076617836952209e-01, 6.48245096206665e-01, 6.502888202667236e-01, 6.512425541877747e-01, 6.520718932151794e-01, 6.528275609016418e-01, 6.53529942035675e-01, 6.541922688484192e-01, 6.548252105712891e-01, 6.554367542266846e-01, 6.560323238372803e-01, 9.176848828792572e-02, 4.775870547746308e-05, 2.880391664803028e-03, 2.49257986433804e-03, 2.490735845640302e-03, 2.735406626015902e-03, 3.157721599563956e-03, 3.707779105752707e-03, 4.348243586719036e-03, 5.058615934103732e-03, 5.812733899801975e-03, -6.395064992830209e-04, -8.454701746813953e-04, -8.459485834464431e-04, -8.459427626803517e-04, -8.459385135211051e-04, -8.459388627670705e-04, -8.459365926682949e-04, -8.45934497192502e-04, -8.459328673779964e-04, -8.459310047328472e-04, -8.459292585030198e-04, 3.49773645401001e-01, 6.095951795578003e-01, 6.278272271156311e-01, 8.526263236999512e-01, 9.942406415939331e-01, 1.00286340713501e+00, 1.00541627407074e+00, 1.006456851959229e+00, 1.006974339485168e+00, 1.007259845733643e+00, 1.007426261901855e+00, 8.565613031387329e-01, 4.098342657089233e-01, 4.015297591686249e-01, 3.931047022342682e-01, 3.867296576499939e-01, 3.819189965724945e-01, 3.782961070537567e-01, 3.755727410316467e-01, 3.735280632972717e-01, 3.719945549964905e-01, 3.708451986312866e-01, 2.734200358390808e-01, -3.069724480155855e-04, -3.066363860853016e-04, -3.04735527606681e-04, -2.008696901611984e-04, -4.965816970070591e-06, 1.967203928643357e-07, 3.207404404292902e-07, 3.358420030963316e-07, 3.429668993248924e-07, 3.477166785614827e-07, 3.511994748350844e-07] -cat.pum1.m_flow=[0e+00, 7.499329447746277e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 1.377374976873398e-01, 4.026739043183625e-05, 6.58272858444775e-09, 8.910557296355759e-13, 1.052406276181252e-16, -5.700009189518855e-20, 2.319422353975646e-20, 3.069957089516106e-20, 8.852726022438318e-21, 3.036209453383328e-21, 1.406305430596601e-20, -1.103355236646582e-21, -1.163546046114319e-25, -1.166273810750257e-29, 8.640745813852737e-34, 1.589861992698616e-35, 6.388502210652006e-37, -3.749615730577003e-37, 1.759805878710538e-37, 1.701286421697685e-37, 3.645850588228645e-37, -1.643032762977545e-37, 2.080670148134232e-01, 7.497294545173645e-01, 7.499999403953552e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01] -cat.mTan_flow=[-2.397192702119355e-07, -7.499328851699829e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -5.513091683387756e-01, -7.352462410926819e-02, -1.417060196399689e-01, -1.474320441484451e-01, -1.477603018283844e-01, -1.477708965539932e-01, -1.477505415678024e-01, -1.477271020412445e-01, -1.477043628692627e-01, -1.47681713104248e-01, -1.476610749959946e-01, 2.484844624996185e-01, 2.320588976144791e-01, 2.286417037248611e-01, 2.26160004734993e-01, 2.243344783782959e-01, 2.229963392019272e-01, 2.220179736614227e-01, 2.213034778833389e-01, 2.207819074392319e-01, 2.204015105962753e-01, 2.201240658760071e-01, 4.022278189659119e-01, 4.10429835319519e-01, 4.098312556743622e-01, 4.092541038990021e-01, 4.088490903377533e-01, 4.085736870765686e-01, 4.083927273750305e-01, 4.082804620265961e-01, 4.08218115568161e-01, 4.081920683383942e-01, 4.0819251537323e-01, 4.507285356521606e-01, 4.582361280918121e-01, 4.601562023162842e-01, 4.618924558162689e-01, 4.631564021110535e-01, 4.640700817108154e-01, 4.647232592105865e-01, 4.651826024055481e-01, 4.654980897903442e-01, 4.657061100006104e-01, 4.658348560333252e-01, 1.348630785942009e-01, -1.46227702498436e-01, -1.469586342573166e-01, -1.469497382640839e-01, -1.469432860612869e-01, -1.469438225030899e-01, -1.469403356313705e-01, -1.469371169805527e-01, -1.469346880912781e-01, -1.469318419694901e-01, -1.46929144859314e-01, -1.377610415220261e-01, -2.340786013519391e-04, -2.388485707342625e-02, -2.614861726760864e-01, -4.026770293712616e-01, -4.114053547382355e-01, -4.097591936588287e-01, -4.082532227039337e-01, -4.073703587055206e-01, -4.068644344806671e-01, -4.065663814544678e-01, -4.868537485599518e-01, -4.098336398601532e-01, -4.015291631221771e-01, -3.931041061878204e-01, -3.867290914058685e-01, -3.819184303283691e-01, -3.782955706119537e-01, -3.755722045898438e-01, -3.735275268554688e-01, -3.719940483570099e-01, -3.70844691991806e-01, -4.814865291118622e-01, -7.494215965270996e-01, -7.496924996376038e-01, -7.496944665908813e-01, -7.49798595905304e-01, -7.49994695186615e-01, -7.499998211860657e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01] -cat.pum2.m_flow=[-1.598027523641576e-07, 3.168741358194893e-08, 3.022457661927547e-08, 2.912550911560174e-08, 2.830951295607065e-08, 2.770495477477652e-08, 2.725762016098088e-08, 2.692695844075388e-08, 2.668270049355215e-08, 2.650236119450256e-08, 2.636926588195365e-08, 2.627106532315793e-08, 1.986908316612244e-01, 6.76475465297699e-01, 6.082940697669983e-01, 6.025680303573608e-01, 6.022397875785828e-01, 6.022291779518127e-01, 6.022495031356812e-01, 6.022729873657227e-01, 6.022956967353821e-01, 6.023183465003967e-01, 6.02338969707489e-01, 9.984844923019409e-01, 9.820589423179626e-01, 9.786417484283447e-01, 9.761600494384766e-01, 9.743345379829407e-01, 9.729964137077332e-01, 9.720180034637451e-01, 9.713035225868225e-01, 9.707819819450378e-01, 9.704015851020813e-01, 9.701241254806519e-01, 1.152227878570557e+00, 1.160429835319519e+00, 1.159831285476685e+00, 1.159254193305969e+00, 1.158849120140076e+00, 1.158573746681213e+00, 1.158392786979675e+00, 1.158280491828918e+00, 1.158218145370483e+00, 1.158192038536072e+00, 1.15819251537323e+00, 1.200728535652161e+00, 1.208236217498779e+00, 1.210156202316284e+00, 1.211892485618591e+00, 1.213156461715698e+00, 1.214070081710815e+00, 1.214723348617554e+00, 1.215182662010193e+00, 1.215498089790344e+00, 1.21570611000061e+00, 1.215834856033325e+00, 8.848631381988457e-01, 6.037723422050476e-01, 6.030414700508118e-01, 6.030503511428833e-01, 6.03056788444519e-01, 6.030562520027161e-01, 6.03059709072113e-01, 6.030629277229309e-01, 6.030653715133667e-01, 6.030682325363159e-01, 6.030709147453308e-01, -2.353951094846707e-05, -1.937928318511695e-04, -1.971050223801285e-04, -1.464236993342638e-04, -6.103904888732359e-05, -2.231381813544431e-06, -7.690326953024851e-08, -1.944775540607679e-08, -1.526295001497147e-08, -1.477478228650853e-08, -1.466873911226685e-08, -2.110327379512e-08, -1.493039647471051e-08, -1.432879059848347e-08, -1.373350588806943e-08, -1.329165044694491e-08, -1.296302531983429e-08, -1.271825844639807e-08, -1.253579817728223e-08, -1.239967595267899e-08, -1.229807278235739e-08, -1.222219481178399e-08, -8.288473019035791e-09, 1.879545130645255e-11, 1.101986835116975e-10, 4.194764535725426e-10, 1.731700471907516e-08, 2.927218289983102e-08, 2.845510849169841e-08, 2.781371399862564e-08, 2.733815307465193e-08, 2.698647705301482e-08, 2.672665111447259e-08, 2.653480279946052e-08] -cat.tan.sta_a.T=[2.851499938964844e+02, 2.851358337402344e+02, 2.851199951171875e+02, 2.851041564941406e+02, 2.850882873535156e+02, 2.850724487304688e+02, 2.850566101074219e+02, 2.85040771484375e+02, 2.8502490234375e+02, 2.850090637207031e+02, 2.849932250976562e+02, 2.849773864746094e+02, 2.849624328613281e+02, 2.8495751953125e+02, 2.849550476074219e+02, 2.849519653320312e+02, 2.849488220214844e+02, 2.849456787109375e+02, 2.849425354003906e+02, 2.849393615722656e+02, 2.849362182617188e+02, 2.849330749511719e+02, 2.84929931640625e+02, 2.851579284667969e+02, 2.85159423828125e+02, 2.851607666015625e+02, 2.851620178222656e+02, 2.851631164550781e+02, 2.851641235351562e+02, 2.851650390625e+02, 2.851658630371094e+02, 2.851666259765625e+02, 2.851672973632812e+02, 2.851679077148438e+02, 2.851685791015625e+02, 2.851696472167969e+02, 2.851706237792969e+02, 2.851714782714844e+02, 2.851722717285156e+02, 2.851729431152344e+02, 2.851735534667969e+02, 2.85174072265625e+02, 2.851745300292969e+02, 2.851748962402344e+02, 2.851752014160156e+02, 2.851754760742188e+02, 2.851759338378906e+02, 2.851763610839844e+02, 2.851767272949219e+02, 2.851770324707031e+02, 2.851773071289062e+02, 2.851775207519531e+02, 2.851776733398438e+02, 2.851777954101562e+02, 2.851778564453125e+02, 2.851778869628906e+02, 2.851776428222656e+02, 2.849915161132812e+02, 2.84989013671875e+02, 2.849865112304688e+02, 2.849840087890625e+02, 2.849814758300781e+02, 2.849789733886719e+02, 2.849764709472656e+02, 2.849739379882812e+02, 2.84971435546875e+02, 2.849689025878906e+02, 2.849668884277344e+02, 2.84966552734375e+02, 2.849664611816406e+02, 2.8496435546875e+02, 2.849582824707031e+02, 2.849512939453125e+02, 2.849442443847656e+02, 2.849372253417969e+02, 2.849302062988281e+02, 2.849231567382812e+02, 2.849161376953125e+02, 2.84908935546875e+02, 2.84901611328125e+02, 2.8489453125e+02, 2.848876037597656e+02, 2.848807983398438e+02, 2.848740844726562e+02, 2.84867431640625e+02, 2.848608093261719e+02, 2.848542175292969e+02, 2.8484765625e+02, 2.848411254882812e+02, 2.8483447265625e+02, 2.848223876953125e+02, 2.848091125488281e+02, 2.847957763671875e+02, 2.847824096679688e+02, 2.847690124511719e+02, 2.847555541992188e+02, 2.847420654296875e+02, 2.847285461425781e+02, 2.847149658203125e+02, 2.847013854980469e+02, 2.84687744140625e+02] -cat.tan.sta_b.T=[2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801526489257812e+02, 2.80156494140625e+02, 2.801602478027344e+02, 2.801639709472656e+02, 2.801676635742188e+02, 2.801713256835938e+02, 2.801749877929688e+02, 2.801786193847656e+02, 2.801822814941406e+02, 2.801859130859375e+02, 2.801895751953125e+02, 2.801947021484375e+02, 2.802014770507812e+02, 2.802082824707031e+02, 2.80215087890625e+02, 2.802218933105469e+02, 2.802287292480469e+02, 2.802355651855469e+02, 2.80242431640625e+02, 2.802492980957031e+02, 2.802561950683594e+02, 2.802630920410156e+02, 2.80270263671875e+02, 2.802779846191406e+02, 2.802857971191406e+02, 2.802936706542969e+02, 2.803015747070312e+02, 2.803095092773438e+02, 2.803175048828125e+02, 2.803255004882812e+02, 2.803335266113281e+02, 2.803415832519531e+02, 2.803496704101562e+02, 2.803565368652344e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.823220520019531e+02, 2.805564880371094e+02, 2.801500244140625e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.811344299316406e+02, 2.803103942871094e+02, 2.801579895019531e+02, 2.80150390625e+02, 2.801500244140625e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02] -usr1.yVal_actual=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 6.488844752311707e-01, 5.539206266403198e-01, 4.350397884845734e-01, 4.276768267154694e-01, 4.271436929702759e-01, 4.271065294742584e-01, 4.27122563123703e-01, 4.271441102027893e-01, 4.271654188632965e-01, 4.271866381168365e-01, 4.272061288356781e-01, 6.888272166252136e-01, 6.746571063995361e-01, 6.620320677757263e-01, 6.535302400588989e-01, 6.477266550064087e-01, 6.436936259269714e-01, 6.408606767654419e-01, 6.388573050498962e-01, 6.374360918998718e-01, 6.364284157752991e-01, 6.357159018516541e-01, 6.436357498168945e-01, 6.421707272529602e-01, 6.397469639778137e-01, 6.379788517951965e-01, 6.367138028144836e-01, 6.358070969581604e-01, 6.351565718650818e-01, 6.346895694732666e-01, 6.343544125556946e-01, 6.341143846511841e-01, 6.339432001113892e-01, 1.29819929599762e-01, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] -usr2.yVal_actual=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 5.383833646774292e-01, 5.251340270042419e-01, 5.21766185760498e-01, 5.19461452960968e-01, 5.178165435791016e-01, 5.166453719139099e-01, 5.158153772354126e-01, 5.152313709259033e-01, 5.148248672485352e-01, 5.145469903945923e-01, 5.143622756004333e-01, 5.412585735321045e-01, 5.422655344009399e-01, 5.414134860038757e-01, 5.408165454864502e-01, 5.404288768768311e-01, 5.401930212974548e-01, 5.400669574737549e-01, 5.40020227432251e-01, 5.400309562683105e-01, 5.400833487510681e-01, 5.401660799980164e-01, 5.981610417366028e-01, 6.167843341827393e-01, 6.213207244873047e-01, 6.254279613494873e-01, 6.28542959690094e-01, 6.308589577674866e-01, 6.325575113296509e-01, 6.337833404541016e-01, 6.346506476402283e-01, 6.352471113204956e-01, 6.356417536735535e-01, 8.419466018676491e-02, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] -usr3.yVal_actual=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 5.100061297416687e-01, 5.51994264125824e-01, 5.524903535842896e-01, 5.521496534347534e-01, 5.519714951515198e-01, 5.519320368766785e-01, 5.519936680793762e-01, 5.521286725997925e-01, 5.523170232772827e-01, 5.525442957878113e-01, 5.528001189231873e-01, 5.908713340759277e-01, 6.161829829216003e-01, 6.223897337913513e-01, 6.263647675514221e-01, 6.294692158699036e-01, 6.31896436214447e-01, 6.33799135684967e-01, 6.352988481521606e-01, 6.364914178848267e-01, 6.374523043632507e-01, 6.382352709770203e-01, 4.771136343479139e-01, 3.802154660224915e-01, 3.797430098056793e-01, 3.797487616539001e-01, 3.797529339790344e-01, 3.797525763511658e-01, 3.797548115253448e-01, 3.79756897687912e-01, 3.797584772109985e-01, 3.797603249549866e-01, 3.797620534896851e-01, 7.145386934280396e-01, 6.906818151473999e-01, 6.737698912620544e-01, 6.976684331893921e-01, 7.212141156196594e-01, 7.626041769981384e-01, 7.912420034408569e-01, 8.07513952255249e-01, 8.168110251426697e-01, 8.222786784172058e-01, 8.255812525749207e-01, 4.133987128734589e-01, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] +pumChi1.m_flow=[2.90360344479268e-06, 2.574263646692998e-07, 2.841550212906441e-07, 3.041250238311477e-07, 3.1895160645945e-07, 3.299363697806257e-07, 3.380644102435326e-07, 3.440725322434446e-07, 3.48510639014421e-07, 3.517874063163617e-07, 3.54205752728376e-07, 3.559900392247073e-07, 3.943337500095367e-01, -4.10140841268003e-04, -6.16540084592998e-04, -6.31289032753557e-04, -6.325681461021304e-04, -6.326810689643025e-04, -6.326647126115859e-04, -6.326397997327149e-04, -6.326213479042053e-04, -6.325903814285994e-04, -6.325431168079376e-04, 1.675708591938019e-01, 2.260440289974213e-01, 2.280283123254776e-01, 2.296321243047714e-01, 2.309542894363403e-01, 2.32018455862999e-01, 2.328717708587646e-01, 2.335598915815353e-01, 2.341226041316986e-01, 2.345907241106033e-01, 2.349893003702164e-01, 6.076529026031494e-01, 6.482539772987366e-01, 6.502906084060669e-01, 6.512424349784851e-01, 6.520713567733765e-01, 6.528275609016418e-01, 6.535298824310303e-01, 6.541922688484192e-01, 6.548252105712891e-01, 6.554366946220398e-01, 6.560323238372803e-01, 9.17685329914093e-02, 4.856726445723325e-05, 2.878637285903096e-03, 2.492164727300406e-03, 2.491752617061138e-03, 2.735200105234981e-03, 3.158671548590064e-03, 3.706743940711021e-03, 4.349087364971638e-03, 5.058011505752806e-03, 5.814099684357648e-03, -6.395039381459407e-04, -8.45471047796309e-04, -8.459430537186563e-04, -8.459382806904614e-04, -8.45935195684433e-04, -8.459387463517487e-04, -8.459198288619518e-04, -8.459252421744168e-04, -8.459212840534747e-04, -8.459092932753265e-04, -8.459198870696127e-04, 3.497742414474487e-01, 6.095962524414062e-01, 6.278272867202759e-01, 8.526261448860168e-01, 9.942407011985779e-01, 1.00286340713501e+00, 1.00541627407074e+00, 1.006456851959229e+00, 1.006974339485168e+00, 1.007259845733643e+00, 1.007426261901855e+00, 8.565613031387329e-01, 4.098342657089233e-01, 4.015297591686249e-01, 3.931047022342682e-01, 3.867296576499939e-01, 3.819189965724945e-01, 3.782961070537567e-01, 3.755727410316467e-01, 3.735280632972717e-01, 3.719945549964905e-01, 3.708451986312866e-01, 2.734200358390808e-01, -3.069724480155855e-04, -3.066363860853016e-04, -3.04735527606681e-04, -2.008696901611984e-04, -4.965816970070591e-06, 1.967203928643357e-07, 3.207404404292902e-07, 3.358420030963316e-07, 3.429668993248924e-07, 3.477166785614827e-07, 3.511994748350844e-07] +cat.pumPri.m_flow=[0e+00, 7.499329447746277e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 1.377374976873398e-01, 4.028871262562461e-05, 6.11594508370672e-09, 8.178415627016489e-13, 9.589251393187564e-17, -5.241664857811528e-20, 2.131046832868325e-20, 2.791871569155422e-20, 8.096430103178397e-21, 2.786891844932625e-21, 1.268689556972913e-20, -1.000228674819164e-21, -1.051826085602722e-25, -1.052073086358831e-29, 7.793363160413643e-34, 1.436635041330859e-35, 5.767932813674552e-37, -3.384748102721405e-37, 1.585378299480751e-37, 1.533693815857489e-37, 3.285943332729002e-37, -1.48092192462591e-37, 2.080670148134232e-01, 7.497294545173645e-01, 7.499999403953552e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01] +cat.mTan_flow=[-2.397192702119355e-07, -7.499328851699829e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -5.513092279434204e-01, -7.352642714977264e-02, -1.417062282562256e-01, -1.47429570555687e-01, -1.477609425783157e-01, -1.477706134319305e-01, -1.477497816085815e-01, -1.477304697036743e-01, -1.477168351411819e-01, -1.476941257715225e-01, -1.476595401763916e-01, 2.484887391328812e-01, 2.320592701435089e-01, 2.286417335271835e-01, 2.261601090431213e-01, 2.243345677852631e-01, 2.229965180158615e-01, 2.220178097486496e-01, 2.213031202554703e-01, 2.207816392183304e-01, 2.204013913869858e-01, 2.201240062713623e-01, 4.022259712219238e-01, 4.104315042495728e-01, 4.098311066627502e-01, 4.092541038990021e-01, 4.088491499423981e-01, 4.08573716878891e-01, 4.083926975727081e-01, 4.082804918289185e-01, 4.082181751728058e-01, 4.081921577453613e-01, 4.081925749778748e-01, 4.50728565454483e-01, 4.582363963127136e-01, 4.601563215255737e-01, 4.618923962116241e-01, 4.631562829017639e-01, 4.64070051908493e-01, 4.647231996059418e-01, 4.651826918125153e-01, 4.654979407787323e-01, 4.65706080198288e-01, 4.65834766626358e-01, 1.34865850210183e-01, -1.462289988994598e-01, -1.469501852989197e-01, -1.469429582357407e-01, -1.469381898641586e-01, -1.46943598985672e-01, -1.469147652387619e-01, -1.469229906797409e-01, -1.469169110059738e-01, -1.46898627281189e-01, -1.469148546457291e-01, -1.377610415220261e-01, -2.341001381864771e-04, -2.388481236994267e-02, -2.614859640598297e-01, -4.026769697666168e-01, -4.114053547382355e-01, -4.097591936588287e-01, -4.082532227039337e-01, -4.073703587055206e-01, -4.068644344806671e-01, -4.065663814544678e-01, -4.868537485599518e-01, -4.098336398601532e-01, -4.015291631221771e-01, -3.931041061878204e-01, -3.867290914058685e-01, -3.819184303283691e-01, -3.782955706119537e-01, -3.755722045898438e-01, -3.735275268554688e-01, -3.719940483570099e-01, -3.70844691991806e-01, -4.814865291118622e-01, -7.494215965270996e-01, -7.496924996376038e-01, -7.496944665908813e-01, -7.49798595905304e-01, -7.49994695186615e-01, -7.499998211860657e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01] +cat.pumSec.m_flow=[-1.598027523641576e-07, 3.168741358194893e-08, 3.022457661927547e-08, 2.912550911560174e-08, 2.830951295607065e-08, 2.770495477477652e-08, 2.725762016098088e-08, 2.692695844075388e-08, 2.668270049355215e-08, 2.650236119450256e-08, 2.636926588195365e-08, 2.627106532315793e-08, 1.986907869577408e-01, 6.764736175537109e-01, 6.082938313484192e-01, 6.025704741477966e-01, 6.022391319274902e-01, 6.022294759750366e-01, 6.022502779960632e-01, 6.022695899009705e-01, 6.02283239364624e-01, 6.023059487342834e-01, 6.023405194282532e-01, 9.984887838363647e-01, 9.820592999458313e-01, 9.786417484283447e-01, 9.761601686477661e-01, 9.743345975875854e-01, 9.729965925216675e-01, 9.720178246498108e-01, 9.713031649589539e-01, 9.70781683921814e-01, 9.70401406288147e-01, 9.701240658760071e-01, 1.152225971221924e+00, 1.160431504249573e+00, 1.159831166267395e+00, 1.159254193305969e+00, 1.158849239349365e+00, 1.158573746681213e+00, 1.158392786979675e+00, 1.158280491828918e+00, 1.158218264579773e+00, 1.158192157745361e+00, 1.15819263458252e+00, 1.20072865486145e+00, 1.208236455917358e+00, 1.210156321525574e+00, 1.211892366409302e+00, 1.213156342506409e+00, 1.214070081710815e+00, 1.214723229408264e+00, 1.215182781219482e+00, 1.215497970581055e+00, 1.21570611000061e+00, 1.215834856033325e+00, 8.848658800125053e-01, 6.037710905075073e-01, 6.030498743057251e-01, 6.030570864677429e-01, 6.03061854839325e-01, 6.030564904212952e-01, 6.030852794647217e-01, 6.030770540237427e-01, 6.030831336975098e-01, 6.031014323234558e-01, 6.030852198600769e-01, -2.35395291383611e-05, -1.937930501298979e-04, -1.971048914128914e-04, -1.464236411266029e-04, -6.103887426434085e-05, -2.231362941529369e-06, -7.690280767747026e-08, -1.944771987894001e-08, -1.526294646225779e-08, -1.477478228650853e-08, -1.466873911226685e-08, -2.110327379512e-08, -1.493039647471051e-08, -1.432878971030505e-08, -1.373350588806943e-08, -1.329165044694491e-08, -1.296302531983429e-08, -1.271825844639807e-08, -1.253579728910381e-08, -1.239967595267899e-08, -1.229807278235739e-08, -1.222219481178399e-08, -8.288473019035791e-09, 1.879545130645255e-11, 1.101986835116975e-10, 4.194764535725426e-10, 1.731700471907516e-08, 2.927218289983102e-08, 2.845510849169841e-08, 2.781371399862564e-08, 2.733815307465193e-08, 2.698647705301482e-08, 2.672665111447259e-08, 2.653480279946052e-08] +cat.tan.sta_a.T=[2.851499938964844e+02, 2.851358337402344e+02, 2.851199951171875e+02, 2.851041564941406e+02, 2.850882873535156e+02, 2.850724487304688e+02, 2.850566101074219e+02, 2.85040771484375e+02, 2.8502490234375e+02, 2.850090637207031e+02, 2.849932250976562e+02, 2.849773864746094e+02, 2.849624328613281e+02, 2.8495751953125e+02, 2.849550476074219e+02, 2.849519653320312e+02, 2.849488220214844e+02, 2.849456787109375e+02, 2.849425354003906e+02, 2.849393615722656e+02, 2.849362182617188e+02, 2.849330749511719e+02, 2.84929931640625e+02, 2.851579284667969e+02, 2.85159423828125e+02, 2.851607666015625e+02, 2.851620178222656e+02, 2.851631164550781e+02, 2.851641235351562e+02, 2.851650390625e+02, 2.851658630371094e+02, 2.851666259765625e+02, 2.851672973632812e+02, 2.851679077148438e+02, 2.851685791015625e+02, 2.851696472167969e+02, 2.851706237792969e+02, 2.851715087890625e+02, 2.851722717285156e+02, 2.851729431152344e+02, 2.851735534667969e+02, 2.85174072265625e+02, 2.851745300292969e+02, 2.851748962402344e+02, 2.851752014160156e+02, 2.851754760742188e+02, 2.851759338378906e+02, 2.851763610839844e+02, 2.851767272949219e+02, 2.851770324707031e+02, 2.851773071289062e+02, 2.851775207519531e+02, 2.851776733398438e+02, 2.851777954101562e+02, 2.851778564453125e+02, 2.851778869628906e+02, 2.851776428222656e+02, 2.849915161132812e+02, 2.84989013671875e+02, 2.849865112304688e+02, 2.849840087890625e+02, 2.849814758300781e+02, 2.849789733886719e+02, 2.849764709472656e+02, 2.849739379882812e+02, 2.84971435546875e+02, 2.849689025878906e+02, 2.849668884277344e+02, 2.84966552734375e+02, 2.849664611816406e+02, 2.8496435546875e+02, 2.849582824707031e+02, 2.849512939453125e+02, 2.849442443847656e+02, 2.849372253417969e+02, 2.849302062988281e+02, 2.849231567382812e+02, 2.849161376953125e+02, 2.84908935546875e+02, 2.84901611328125e+02, 2.8489453125e+02, 2.848876037597656e+02, 2.848807983398438e+02, 2.848740844726562e+02, 2.84867431640625e+02, 2.848608093261719e+02, 2.848542175292969e+02, 2.8484765625e+02, 2.848411254882812e+02, 2.8483447265625e+02, 2.848223876953125e+02, 2.848091125488281e+02, 2.847957763671875e+02, 2.847824096679688e+02, 2.847690124511719e+02, 2.847555541992188e+02, 2.847420654296875e+02, 2.847285461425781e+02, 2.847149658203125e+02, 2.847013854980469e+02, 2.84687744140625e+02] +cat.tan.sta_b.T=[2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801526489257812e+02, 2.80156494140625e+02, 2.801602478027344e+02, 2.801639709472656e+02, 2.801676635742188e+02, 2.801713256835938e+02, 2.801749877929688e+02, 2.801786193847656e+02, 2.801822814941406e+02, 2.801859130859375e+02, 2.801895751953125e+02, 2.801947021484375e+02, 2.802014770507812e+02, 2.802082824707031e+02, 2.80215087890625e+02, 2.802218933105469e+02, 2.802287292480469e+02, 2.802355651855469e+02, 2.80242431640625e+02, 2.802492980957031e+02, 2.802561950683594e+02, 2.802630920410156e+02, 2.80270263671875e+02, 2.802779846191406e+02, 2.802857971191406e+02, 2.802936706542969e+02, 2.803015747070312e+02, 2.803095092773438e+02, 2.803175048828125e+02, 2.803255004882812e+02, 2.803335266113281e+02, 2.803415832519531e+02, 2.803496704101562e+02, 2.803565368652344e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.823220520019531e+02, 2.80556640625e+02, 2.801500244140625e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.811344299316406e+02, 2.803103942871094e+02, 2.801579895019531e+02, 2.80150390625e+02, 2.801500244140625e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02] +usr1.yVal_actual=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 6.488844156265259e-01, 5.539174675941467e-01, 4.350395798683167e-01, 4.276793599128723e-01, 4.271430373191833e-01, 4.271068871021271e-01, 4.271231591701508e-01, 4.27143007516861e-01, 4.271536767482758e-01, 4.27216112613678e-01, 4.272075295448303e-01, 6.888259053230286e-01, 6.746588945388794e-01, 6.620333194732666e-01, 6.535307168960571e-01, 6.477271318435669e-01, 6.436940431594849e-01, 6.408599615097046e-01, 6.388561725616455e-01, 6.374353766441345e-01, 6.364281177520752e-01, 6.357160210609436e-01, 6.436352133750916e-01, 6.421710252761841e-01, 6.397469043731689e-01, 6.379788517951965e-01, 6.367138028144836e-01, 6.358070969581604e-01, 6.35156512260437e-01, 6.346896290779114e-01, 6.343546509742737e-01, 6.341146230697632e-01, 6.339433193206787e-01, 1.298200935125351e-01, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] +usr2.yVal_actual=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 5.383826494216919e-01, 5.251342058181763e-01, 5.217663049697876e-01, 5.194615721702576e-01, 5.178166627883911e-01, 5.166454315185547e-01, 5.15815258026123e-01, 5.152310729026794e-01, 5.148246288299561e-01, 5.145468711853027e-01, 5.143622756004333e-01, 5.412582755088806e-01, 5.422661304473877e-01, 5.414133667945862e-01, 5.408165454864502e-01, 5.404288768768311e-01, 5.401930809020996e-01, 5.400668978691101e-01, 5.40020227432251e-01, 5.400310158729553e-01, 5.400834083557129e-01, 5.401661396026611e-01, 5.981611013412476e-01, 6.167853474617004e-01, 6.21320366859436e-01, 6.254275441169739e-01, 6.285431385040283e-01, 6.308587193489075e-01, 6.325578093528748e-01, 6.337830424308777e-01, 6.346504092216492e-01, 6.352473497390747e-01, 6.356410384178162e-01, 8.419773727655144e-02, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] +usr3.yVal_actual=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 5.099976062774658e-01, 5.52003026008606e-01, 5.524908304214478e-01, 5.521496534347534e-01, 5.519715547561646e-01, 5.519320368766785e-01, 5.519936084747314e-01, 5.521286725997925e-01, 5.523170828819275e-01, 5.525444149971008e-01, 5.52800178527832e-01, 5.908713936805725e-01, 6.161836981773376e-01, 6.223894953727722e-01, 6.263645887374878e-01, 6.294692158699036e-01, 6.318963766098022e-01, 6.337991952896118e-01, 6.352988481521606e-01, 6.364914774894714e-01, 6.374514698982239e-01, 6.382364630699158e-01, 4.771148860454542e-01, 3.802146315574646e-01, 3.797484636306763e-01, 3.797513544559479e-01, 3.797562122344971e-01, 3.797527253627777e-01, 3.797430396080017e-01, 3.79766047000885e-01, 3.797699809074402e-01, 3.797850608825684e-01, 3.797740638256073e-01, 7.14540421962738e-01, 6.906828284263611e-01, 6.737702488899231e-01, 6.97668731212616e-01, 7.212142944335938e-01, 7.626042366027832e-01, 7.912420630455017e-01, 8.075140118598938e-01, 8.168110251426697e-01, 8.222786784172058e-01, 8.255812525749207e-01, 4.133987128734589e-01, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] diff --git a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ChillerAndTankNoRemoteCharging.txt b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ChillerAndTankNoRemoteCharging.txt index 6e3d764aa4a..088c37b7282 100644 --- a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ChillerAndTankNoRemoteCharging.txt +++ b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ChillerAndTankNoRemoteCharging.txt @@ -1,4 +1,4 @@ -last-generated=2022-02-18 +last-generated=2022-03-14 statistics-initialization= { "nonlinear": "2, 0, 1, 1", @@ -12,6 +12,6 @@ statistics-simulation= "numerical Jacobians": "0" } time=[0e+00, 3.6e+03] -cat.pum1.m_flow=[0e+00, 1.999821424484253e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00] -cat.mTan_flow=[-1.405874849297106e-03, 1.710717439651489e+00, 1.734940767288208e+00, 1.734954833984375e+00, 1.734955191612244e+00, 1.734954595565796e+00, 1.734954714775085e+00, 1.734955072402954e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954595565796e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, -1.927103996276855e+00, -1.988791942596436e+00, -1.997898459434509e+00, -1.999399185180664e+00, -1.999738454818726e+00, -1.999849796295166e+00, -1.99989914894104e+00, -1.999925851821899e+00, -1.999942064285278e+00, -1.999952673912048e+00, -1.99996018409729e+00, -1.999965667724609e+00, -1.999969959259033e+00, -1.999973297119141e+00, -1.9999760389328e+00, -1.999978184700012e+00, -1.999979972839355e+00, -1.99998152256012e+00, -1.999982953071594e+00, -1.9999840259552e+00, -1.999985098838806e+00, -1.999985933303833e+00, -1.99998676776886e+00, -1.999987483024597e+00, -1.999988079071045e+00, -3.463954105973244e-02, -3.821860766038299e-03, -4.146151768509299e-04, -4.441050623427091e-05, -4.910070401820078e-06, -1.501270219250436e-07, -2.728233994275797e-07, -3.502605849803331e-08, 5.74102436701196e-08, -1.034929031362708e-08, 3.200042009154913e-09, 3.435048356870141e-10, -3.678815030383475e-09, -7.299594817489208e-10, 4.498274669417768e-11, 3.058595043903267e-11, 1.619188463863885e-11, 3.536669871892495e-12, 2.942911756301236e-12, 2.349993463712785e-12, 1.753296618133005e-12, 1.161637734788112e-12, 5.666202099532947e-13, 1.491743198151624e-13, 4.536133499529436e-14, 1.733797311782837e+00, 1.734954714775085e+00, 1.734954476356506e+00, 1.734953999519348e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954833984375e+00, 1.734954833984375e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00, 1.734954714775085e+00] -cat.pum2.m_flow=[-1.405874849297106e-03, 3.710538864135742e+00, 3.734940767288208e+00, 3.734954833984375e+00, 3.734955072402954e+00, 3.734954595565796e+00, 3.734954595565796e+00, 3.734955072402954e+00, 3.734954833984375e+00, 3.734954595565796e+00, 3.734954833984375e+00, 3.734954595565796e+00, 3.734954595565796e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 7.289598137140274e-02, 1.120809186249966e-02, 2.101586200296871e-03, 6.008680793456733e-04, 2.615965786390007e-04, 1.502470404375345e-04, 1.008531544357538e-04, 7.415458094328642e-05, 5.797366611659527e-05, 4.735854963655584e-05, 3.987475429312326e-05, 3.43233004969079e-05, 3.005949292855803e-05, 2.67077030002838e-05, 2.401932033535559e-05, 2.181750278396066e-05, 1.998077277676202e-05, 1.842482197389472e-05, 1.708855415927246e-05, 1.592809894646052e-05, 1.49121624417603e-05, 1.401423742208863e-05, 1.321873878623592e-05, 1.250972309208009e-05, 1.187621637654956e-05, 1.965360403060913e+00, 1.996178150177002e+00, 1.999585390090942e+00, 1.999955534934998e+00, 1.999995112419128e+00, 1.99999988079071e+00, 1.999999761581421e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 3.733797311782837e+00, 3.734954595565796e+00, 3.734954595565796e+00, 3.734954118728638e+00, 3.734954833984375e+00, 3.734954595565796e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00, 3.734954833984375e+00] +cat.pumPri.m_flow=[0e+00, 9.999105930328369e-01, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00] +cat.mTan_flow=[-1.405874849297106e-03, 1.783565163612366e+00, 1.969470977783203e+00, 1.995680689811707e+00, 1.999389171600342e+00, 1.99991500377655e+00, 1.999987363815308e+00, 1.999999165534973e+00, 1.999999761581421e+00, 2e+00, 1.99999988079071e+00, 1.999999761581421e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, -1.001265048980713e+00, -1.001265048980713e+00, -1.001265048980713e+00, -1.001265048980713e+00, -1.001265048980713e+00, -1.001265048980713e+00, -1.001265048980713e+00, -1.001265048980713e+00, -1.001265048980713e+00, -1.001265048980713e+00, -1.001265048980713e+00, -1.001265048980713e+00, -1.001265048980713e+00, -1.001265048980713e+00, -1.001265048980713e+00, -1.001265048980713e+00, -1.001265048980713e+00, -1.001265048980713e+00, -1.001265048980713e+00, -1.001265048980713e+00, -1.001265048980713e+00, -1.001265048980713e+00, -1.001265048980713e+00, -1.001265048980713e+00, -1.001265048980713e+00, -1.209599897265434e-01, -1.15881310775876e-02, -1.1714679421857e-03, -1.181488478323431e-04, -1.312221775151542e-05, -5.81720257741816e-07, 2.010617947689752e-07, 2.70192348494902e-08, 1.204610526883698e-07, -1.627231114298411e-07, -2.546464088482026e-07, -4.904287820295394e-08, 2.612597249651571e-08, 2.566911128099036e-08, 2.401761456383156e-08, 2.741509241843687e-08, 2.471356452815598e-08, 1.875023869502002e-08, 1.608727373536567e-08, 1.342430611117607e-08, 1.07613402633433e-08, 8.098376191867374e-09, 5.435412120391447e-09, 2.772446272558682e-09, 6.08828820691798e-10, 1.94982647895813e+00, 1.992952942848206e+00, 1.999007105827332e+00, 1.999859213829041e+00, 1.999979257583618e+00, 1.999996662139893e+00, 2e+00, 1.999999761581421e+00, 1.999999761581421e+00, 1.999999642372131e+00, 1.99999988079071e+00, 2e+00, 1.99999988079071e+00, 1.99999988079071e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00] +cat.pumSec.m_flow=[-1.405874849297106e-03, 2.783475637435913e+00, 2.969470977783203e+00, 2.995680570602417e+00, 2.999389171600342e+00, 2.99991512298584e+00, 2.999987363815308e+00, 2.999999046325684e+00, 2.999999761581421e+00, 3e+00, 3e+00, 2.999999761581421e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, -1.265001250430942e-03, -1.265011727809906e-03, -1.265011727809906e-03, -1.265011727809906e-03, -1.265011727809906e-03, -1.265011727809906e-03, -1.265011727809906e-03, -1.265011727809906e-03, -1.265011727809906e-03, -1.265011727809906e-03, -1.265011727809906e-03, -1.265011727809906e-03, -1.265011727809906e-03, -1.265011727809906e-03, -1.265011727809906e-03, -1.265011727809906e-03, -1.265011727809906e-03, -1.265011727809906e-03, -1.265011727809906e-03, -1.265011727809906e-03, -1.265011727809906e-03, -1.265011727809906e-03, -1.265011727809906e-03, -1.265011727809906e-03, -1.265011727809906e-03, 8.79040002822876e-01, 9.884118437767029e-01, 9.988285303115845e-01, 9.998818635940552e-01, 9.999868869781494e-01, 9.999994039535522e-01, 1.000000238418579e+00, 1e+00, 1.00000011920929e+00, 9.999998211860657e-01, 9.999997615814209e-01, 9.999999403953552e-01, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 2.94982647895813e+00, 2.992953062057495e+00, 2.999006986618042e+00, 2.999859094619751e+00, 2.999979257583618e+00, 2.999996662139893e+00, 3e+00, 2.999999761581421e+00, 2.999999761581421e+00, 2.999999523162842e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00, 3e+00] diff --git a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ChillerAndTankWithRemoteCharging.txt b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ChillerAndTankWithRemoteCharging.txt index 3ec2205b553..89911a9e328 100644 --- a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ChillerAndTankWithRemoteCharging.txt +++ b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ChillerAndTankWithRemoteCharging.txt @@ -1,4 +1,4 @@ -last-generated=2022-02-18 +last-generated=2022-03-14 statistics-initialization= { "nonlinear": "2, 0, 1, 1", @@ -12,6 +12,6 @@ statistics-simulation= "numerical Jacobians": "0" } time=[0e+00, 3.6e+03] -cat.pum1.m_flow=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 9.901783466339111e-01, 9.999966621398926e-01, 9.999997615814209e-01, 9.999998807907104e-01, 9.999999403953552e-01, 9.999999403953552e-01, 1.00000011920929e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 3.073466755449772e-02, 6.861325800855411e-06, 1.318177678122368e-09, -3.764059810368314e-12, 2.581148619493212e-12, 4.337341033208708e-13, 9.765097259452349e-14, 4.721079586024034e-15, -1.161481562241429e-14, 1.938633274907713e-14, -2.732920252338715e-15, 5.10808459858067e-16, -2.51081609040958e-16, 1.700699221276786e-16, -5.95751979413911e-18, -5.198573170567294e-22, -6.457490878027597e-26, -5.681643423061059e-30, -4.877551719086363e-34, -4.214989192656818e-38, -3.734460407425637e-42, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, -0e+00, 0e+00, 0e+00] -cat.mTan_flow=[-3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -9.901787042617798e-01, -9.999970197677612e-01, -1.00000011920929e+00, -1.000000238418579e+00, -1.000000357627869e+00, -1.000000238418579e+00, -1.000000476837158e+00, -1.000000357627869e+00, -1.000000357627869e+00, -1.000000357627869e+00, -1.000000357627869e+00, -1.000000357627869e+00, -1.000000357627869e+00, -1.000000357627869e+00, -1.001257061958313e+00, -1.001254200935364e+00, -1.00125253200531e+00, -1.001250743865967e+00, -1.001248955726624e+00, -1.001246929168701e+00, -1.001244902610779e+00, -1.001242637634277e+00, -1.001240372657776e+00, -1.001237988471985e+00, -1.001235485076904e+00, -1.001232862472534e+00, -1.001230120658875e+00, -1.001227378845215e+00, -1.000674843788147e+00, -5.952231213450432e-02, -2.912065014243126e-02, -1.426701992750168e-02, -6.99062692001462e-03, -3.426197916269302e-03, -1.679294626228511e-03, -8.231080137193203e-04, -4.034376761410385e-04, -1.978223299374804e-04, -9.762997069628909e-05, -4.743236422655152e-05, -2.238212073280001e-05, -1.086261454474875e-05, -5.532525847229408e-06, 9.870973229408264e-01, 9.935631155967712e-01, 9.968100786209106e-01, 9.984188079833984e-01, 9.992182850837708e-01, 9.996134042739868e-01, 9.998087882995605e-01, 9.999048709869385e-01, 9.999517798423767e-01, 9.999758005142212e-01, 9.99988317489624e-01, 9.999943375587463e-01, 9.99997079372406e-01, 9.999983906745911e-01, 1.009098649024963e+00, 1.004485368728638e+00, 1.002213478088379e+00, 1.001092076301575e+00, 1.000539064407349e+00, 1.00026547908783e+00, 1.000131249427795e+00, 1.000064849853516e+00, 1.000032067298889e+00, 1.000015735626221e+00, 1.00000786781311e+00, 1.000003933906555e+00, 1.000001907348633e+00, 1.000000953674316e+00, -1.298328978009522e-03, -1.405618968419731e-03, -1.010759621858597e-01, -1.07781457901001e+00, -9.684461355209351e-01, -9.93242621421814e-01, -9.956064820289612e-01, -9.979210495948792e-01, -9.989652633666992e-01, -9.99487578868866e-01, -9.997451305389404e-01, -9.998742341995239e-01, -9.999381899833679e-01, -9.999697804450989e-01, -9.999846816062927e-01] -cat.pum2.m_flow=[-2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.404756287432974e-07, -2.399546588094381e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -1.256993738934398e-03, -1.254053087905049e-03, -1.252415706403553e-03, -1.25066633336246e-03, -1.248805900104344e-03, -1.246835570782423e-03, -1.244755811057985e-03, -1.242567552253604e-03, -1.240271609276533e-03, -1.237868680618703e-03, -1.235359814018011e-03, -1.232745940797031e-03, -1.230027875863016e-03, -1.227206783369184e-03, -6.746912258677185e-04, 9.404778480529785e-01, 9.708794951438904e-01, 9.857330918312073e-01, 9.930095076560974e-01, 9.965739250183105e-01, 9.983208179473877e-01, 9.991770386695862e-01, 9.995967149734497e-01, 9.9980229139328e-01, 9.999024868011475e-01, 9.999526739120483e-01, 9.999777674674988e-01, 9.999892711639404e-01, 9.999945759773254e-01, 1.987097501754761e+00, 1.993563294410706e+00, 1.9968101978302e+00, 1.998418927192688e+00, 1.999218463897705e+00, 1.999613523483276e+00, 1.99980890750885e+00, 1.999904990196228e+00, 1.999951958656311e+00, 1.999975919723511e+00, 1.999988436698914e+00, 1.999994516372681e+00, 1.99999725818634e+00, 1.999998569488525e+00, 1.039833426475525e+00, 1.004492402076721e+00, 1.002213716506958e+00, 1.001092314720154e+00, 1.000539183616638e+00, 1.000265598297119e+00, 1.000131368637085e+00, 1.000064969062805e+00, 1.000032186508179e+00, 1.0000159740448e+00, 1.000008106231689e+00, 1.000004053115845e+00, 1.000002145767212e+00, 1.000001072883606e+00, -1.29819568246603e-03, -1.405485672876239e-03, -1.402487047016621e-03, -1.233650604262948e-03, -8.664834313094616e-04, -4.151752000325359e-05, -1.396627567373798e-06, -3.217834034785483e-07, -2.483978960299282e-07, -2.4087069050438e-07, -2.400690846116049e-07, -2.399721950041567e-07, -2.399577283540566e-07, -2.399560230514908e-07, -2.399555683041399e-07] +cat.pumPri.m_flow=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 9.901783466339111e-01, 9.999966621398926e-01, 9.999997615814209e-01, 9.999998807907104e-01, 9.999999403953552e-01, 9.999999403953552e-01, 1.00000011920929e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 3.073466755449772e-02, 6.861325800855411e-06, 1.318177678122368e-09, -3.764060244049183e-12, 2.58114753529104e-12, 4.337337509551648e-13, 9.765081674046119e-14, 4.721024952398937e-15, -1.161481816351314e-14, 1.938632936094534e-14, -2.732919193547531e-15, 5.108081422207117e-16, -2.510814502222804e-16, 1.700699088927888e-16, -5.957516899006966e-18, -5.198569636470439e-22, -6.457485331349358e-26, -5.681637780688175e-30, -4.877545749779113e-34, -4.214983026943575e-38, -3.734460407425637e-42, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, -0e+00, 0e+00, 0e+00] +cat.mTan_flow=[-3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -9.901787042617798e-01, -9.999970197677612e-01, -1.00000011920929e+00, -1.000000238418579e+00, -1.000000357627869e+00, -1.000000238418579e+00, -1.000000476837158e+00, -1.000000357627869e+00, -1.000000357627869e+00, -1.000000357627869e+00, -1.000000357627869e+00, -1.000000357627869e+00, -1.000000357627869e+00, -1.000000357627869e+00, -1.001257061958313e+00, -1.001254200935364e+00, -1.00125253200531e+00, -1.001250743865967e+00, -1.001248955726624e+00, -1.001246929168701e+00, -1.001244902610779e+00, -1.001242637634277e+00, -1.001240372657776e+00, -1.001237988471985e+00, -1.001235485076904e+00, -1.001232862472534e+00, -1.001230120658875e+00, -1.001227378845215e+00, -1.000674843788147e+00, -5.952229723334312e-02, -2.911732345819473e-02, -1.426455099135637e-02, -6.988788489252329e-03, -3.425858682021499e-03, -1.679470879025757e-03, -8.233278640545905e-04, -4.035925958305597e-04, -1.98243316845037e-04, -9.859548299573362e-05, -4.902779255644398e-05, -2.407912506896527e-05, -1.200878887175345e-05, -6.03699118073564e-06, 9.870970845222473e-01, 9.935629963874817e-01, 9.968100190162659e-01, 9.984187483787537e-01, 9.992182850837708e-01, 9.996134042739868e-01, 9.998087882995605e-01, 9.999048709869385e-01, 9.999517798423767e-01, 9.999758005142212e-01, 9.99988317489624e-01, 9.999943375587463e-01, 9.99997079372406e-01, 9.999983906745911e-01, 1.009098649024963e+00, 1.004485368728638e+00, 1.002213478088379e+00, 1.001092076301575e+00, 1.000539064407349e+00, 1.00026547908783e+00, 1.000131249427795e+00, 1.000064849853516e+00, 1.000032067298889e+00, 1.000015735626221e+00, 1.00000786781311e+00, 1.000003933906555e+00, 1.000001907348633e+00, 1.000000953674316e+00, -1.298328978009522e-03, -1.405618968419731e-03, -1.010759621858597e-01, -1.07781457901001e+00, -9.684461355209351e-01, -9.93242621421814e-01, -9.956064820289612e-01, -9.979210495948792e-01, -9.989652633666992e-01, -9.99487578868866e-01, -9.997451305389404e-01, -9.998742341995239e-01, -9.999381899833679e-01, -9.999697804450989e-01, -9.999846816062927e-01] +cat.pumSec.m_flow=[-2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.404756287432974e-07, -2.399546588094381e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -1.256993738934398e-03, -1.254053087905049e-03, -1.252415706403553e-03, -1.25066633336246e-03, -1.248805900104344e-03, -1.246835570782423e-03, -1.244755811057985e-03, -1.242567552253604e-03, -1.240271609276533e-03, -1.237868680618703e-03, -1.235359814018011e-03, -1.232745940797031e-03, -1.230027875863016e-03, -1.227206783369184e-03, -6.746912258677185e-04, 9.404778480529785e-01, 9.708828330039978e-01, 9.857355952262878e-01, 9.930113554000854e-01, 9.965742826461792e-01, 9.983206391334534e-01, 9.991768002510071e-01, 9.995965361595154e-01, 9.998018741607666e-01, 9.999015331268311e-01, 9.999511241912842e-01, 9.999760389328003e-01, 9.999881386756897e-01, 9.999940991401672e-01, 1.987097263336182e+00, 1.993563055992126e+00, 1.9968101978302e+00, 1.998418927192688e+00, 1.999218463897705e+00, 1.999613523483276e+00, 1.99980890750885e+00, 1.999904990196228e+00, 1.999951958656311e+00, 1.999975919723511e+00, 1.999988436698914e+00, 1.999994516372681e+00, 1.99999725818634e+00, 1.999998569488525e+00, 1.039833426475525e+00, 1.004492402076721e+00, 1.002213716506958e+00, 1.001092314720154e+00, 1.000539183616638e+00, 1.000265598297119e+00, 1.000131368637085e+00, 1.000064969062805e+00, 1.000032186508179e+00, 1.0000159740448e+00, 1.000008106231689e+00, 1.000004053115845e+00, 1.000002145767212e+00, 1.000001072883606e+00, -1.29819568246603e-03, -1.405485672876239e-03, -1.402487047016621e-03, -1.233650604262948e-03, -8.664834313094616e-04, -4.151752000325359e-05, -1.396627567373798e-06, -3.217834034785483e-07, -2.483978960299282e-07, -2.4087069050438e-07, -2.400690846116049e-07, -2.399721950041567e-07, -2.399577283540566e-07, -2.399560230514908e-07, -2.399555683041399e-07] diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos index e3a32069e13..9779f6a207a 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos @@ -6,7 +6,7 @@ simulateModel("Buildings.Fluid.Storage.Plant.Examples.OneSourceOneUser", // Plot commands createPlot(id=1, position={15, 15, 1027, 480}, - y={"cat.pum1.m_flow", "cat.mTan_flow", "cat.pum2.m_flow"}, + y={"cat.pumPri.m_flow", "cat.mTan_flow", "cat.pumSec.m_flow"}, range={0.0, 3600.0, -1.0, 1.0}, grid=true, subPlot=101, diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos index 633f5841479..6ea2c0ebe3d 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos @@ -6,7 +6,7 @@ simulateModel("Buildings.Fluid.Storage.Plant.Examples.TwoSourcesThreeUsers", // Plot commands createPlot(id=1, position={15, 15, 914, 538}, - y={"pumChi1.m_flow", "cat.pum1.m_flow", "cat.mTan_flow", "cat.pum2.m_flow"}, + y={"pumChi1.m_flow", "cat.pumPri.m_flow", "cat.mTan_flow", "cat.pumSec.m_flow"}, range={0.0, 3600.0, -2.0, 2.0}, grid=true, subPlot=101, diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mos index b4b3d759238..0754bb0c779 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mos @@ -6,7 +6,7 @@ simulateModel("Buildings.Fluid.Storage.Plant.Validation.ChillerAndTankNoRemoteCh // Plot commands createPlot(id=1, position={15, 15, 961, 426}, - y={"cat.pum1.m_flow", "cat.mTan_flow", "cat.pum2.m_flow"}, + y={"cat.pumPri.m_flow", "cat.mTan_flow", "cat.pumSec.m_flow"}, range={0.0, 3600.0, -4.0, 6.0}, grid=true, colors={{28,108,200}, {238,46,47}, {0,140,72}}, diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mos index 0ee89ab6b9e..547c7571983 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mos @@ -6,7 +6,7 @@ simulateModel("Buildings.Fluid.Storage.Plant.Validation.ChillerAndTankWithRemote // Plot commands createPlot(id=1, position={15, 15, 929, 372}, - y={"cat.pum1.m_flow", "cat.mTan_flow", "cat.pum2.m_flow"}, + y={"cat.pumPri.m_flow", "cat.mTan_flow", "cat.pumSec.m_flow"}, range={0.0, 3600.0, -4.0, 3.0}, grid=true, colors={{28,108,200}, {238,46,47}, {0,140,72}}, diff --git a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.OneSourceOneUser.mos b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.OneSourceOneUser.mos index 7bc7d9fb1a9..36012e2bed6 100644 --- a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.OneSourceOneUser.mos +++ b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.OneSourceOneUser.mos @@ -1,7 +1,7 @@ compareVars := { - "cat.pum1.m_flow", + "cat.pumPri.m_flow", "cat.mTan_flow", - "cat.pum2.m_flow", + "cat.pumSec.m_flow", "usr.yVal_actual" }; diff --git a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.TwoSourcesThreeUsers.mos b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.TwoSourcesThreeUsers.mos index bf77d8db7dd..3921ab588a5 100644 --- a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.TwoSourcesThreeUsers.mos +++ b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.TwoSourcesThreeUsers.mos @@ -1,9 +1,9 @@ compareVars := { "pumChi1.m_flow", - "cat.pum1.m_flow", + "cat.pumPri.m_flow", "cat.mTan_flow", - "cat.pum2.m_flow", + "cat.pumSec.m_flow", "cat.tan.sta_a.T", "cat.tan.sta_b.T", "usr1.yVal_actual", diff --git a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ChillerAndTankNoRemoteCharging.mos b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ChillerAndTankNoRemoteCharging.mos index 2cd09ae83bb..f12ab9cb76d 100644 --- a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ChillerAndTankNoRemoteCharging.mos +++ b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ChillerAndTankNoRemoteCharging.mos @@ -1,6 +1,6 @@ compareVars := { - "cat.pum1.m_flow", + "cat.pumPri.m_flow", "cat.mTan_flow", - "cat.pum2.m_flow" + "cat.pumSec.m_flow" }; diff --git a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ChillerAndTankWithRemoteCharging.mos b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ChillerAndTankWithRemoteCharging.mos index 2cd09ae83bb..f12ab9cb76d 100644 --- a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ChillerAndTankWithRemoteCharging.mos +++ b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ChillerAndTankWithRemoteCharging.mos @@ -1,6 +1,6 @@ compareVars := { - "cat.pum1.m_flow", + "cat.pumPri.m_flow", "cat.mTan_flow", - "cat.pum2.m_flow" + "cat.pumSec.m_flow" }; From 01411d35b3530912822972887b55bf5e5e70fb7e Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Mon, 14 Mar 2022 13:12:14 -0700 Subject: [PATCH 056/463] removed nominal values for main line pressures --- Buildings/Fluid/Storage/Plant/ChillerAndTank.mo | 12 +++--------- .../Fluid/Storage/Plant/Examples/OneSourceOneUser.mo | 3 +-- .../Storage/Plant/Examples/TwoSourcesThreeUsers.mo | 3 +-- .../Validation/ChillerAndTankNoRemoteCharging.mo | 3 +-- .../Validation/ChillerAndTankWithRemoteCharging.mo | 3 +-- 5 files changed, 7 insertions(+), 17 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo index 41ac0c1958d..09307fda022 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo @@ -14,13 +14,8 @@ model ChillerAndTank "Nominal mass flow rate for CDW loop"; parameter Modelica.Units.SI.MassFlowRate mTan_flow_nominal(min=0) "Nominal mass flow rate for CHW tank branch"; - parameter Modelica.Units.SI.PressureDifference dp_nominal= - p_CHWS_nominal-p_CHWR_nominal + parameter Modelica.Units.SI.PressureDifference dp_nominal "Nominal pressure difference"; - parameter Modelica.Units.SI.AbsolutePressure p_CHWS_nominal=800000 - "Nominal pressure of the CHW supply line"; - parameter Modelica.Units.SI.AbsolutePressure p_CHWR_nominal=300000 - "Nominal pressure of the CHW return line"; parameter Modelica.Units.SI.Temperature T_CHWS_nominal=7+273.15 "Nominal temperature of CHW supply"; parameter Modelica.Units.SI.Temperature T_CHWR_nominal=12+273.15 @@ -172,10 +167,10 @@ model ChillerAndTank final dp1_nominal=0, final dp2_nominal=0, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - p2_start=p_CHWS_nominal, + p2_start=500000, T2_start=T_CHWS_nominal, final per=perChi) - "Water cooled chiller (ports indexed 1 are on condenser side)" + "Water cooled chiller (ports indexed 1 are on condenser side) (placeholder, to be removed from template)" annotation (Placement(transformation(extent={{-60,0},{-40,20}}))); Buildings.Controls.OBC.CDL.Logical.Sources.Constant onChi(k=true) if not allowRemoteCharging "Placeholder, chiller always on" @@ -195,7 +190,6 @@ model ChillerAndTank nSeg=7, show_T=true, m_flow_nominal=mTan_flow_nominal, - p_start=p_CHWS_nominal, T_start=T_CHWS_nominal, TFlu_start=linspace( T_CHWR_nominal, diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo index dc67cc50192..5dea20b4e18 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo @@ -30,8 +30,7 @@ model OneSourceOneUser "(Draft) Simple system model with one source and one user final mEva_flow_nominal=m_flow_nominal/2, final mCon_flow_nominal=m_flow_nominal/2, final mTan_flow_nominal=m_flow_nominal/2, - final p_CHWS_nominal=p_CHWS_nominal, - final p_CHWR_nominal=p_CHWR_nominal, + final dp_nominal=p_CHWS_nominal-p_CHWR_nominal, final T_CHWS_nominal=T_CHWS_nominal, final T_CHWR_nominal=T_CHWR_nominal) "Chiller and tank" diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index 4c465420e7c..9d419718d22 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -28,8 +28,7 @@ model TwoSourcesThreeUsers final mEva_flow_nominal=0.3*m_flow_nominal, final mCon_flow_nominal=0.3*m_flow_nominal, final mTan_flow_nominal=0.3*m_flow_nominal, - final p_CHWS_nominal=p_CHWS_nominal, - final p_CHWR_nominal=p_CHWR_nominal, + final dp_nominal=dp_nominal, final T_CHWS_nominal=T_CHWS_nominal, final T_CHWR_nominal=T_CHWR_nominal) "Chiller and tank, tank can be charged remotely" annotation (Placement( diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo index 8f0062cbc41..066245f2acf 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo @@ -22,8 +22,7 @@ model ChillerAndTankNoRemoteCharging final mEva_flow_nominal=1, final mCon_flow_nominal=1, final mTan_flow_nominal=1, - final p_CHWS_nominal=p_CHWS_nominal, - final p_CHWR_nominal=p_CHWR_nominal, + final dp_nominal=p_CHWS_nominal-p_CHWR_nominal, final T_CHWS_nominal=T_CHWS_nominal, final T_CHWR_nominal=T_CHWR_nominal) "Plant with chiller and tank" diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo index 5b9f4ef7672..2dbd3984543 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo @@ -23,8 +23,7 @@ model ChillerAndTankWithRemoteCharging final mEva_flow_nominal=1, final mCon_flow_nominal=1, final mTan_flow_nominal=1, - final p_CHWS_nominal=p_CHWS_nominal, - final p_CHWR_nominal=p_CHWR_nominal, + final dp_nominal=p_CHWS_nominal-p_CHWR_nominal, final T_CHWS_nominal=T_CHWS_nominal, final T_CHWR_nominal=T_CHWR_nominal) "Plant with chiller and tank" annotation (Placement(transformation(extent={{-8,-10},{12,10}}))); From 2b6480fda54c3a0a1f7ab9f94be450314c055401 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Mon, 14 Mar 2022 13:51:09 -0700 Subject: [PATCH 057/463] removed dp_nominal values in the lower model --- .../Fluid/Storage/Plant/ChillerAndTank.mo | 23 +++++++------------ .../Plant/Examples/OneSourceOneUser.mo | 9 +++++++- .../Plant/Examples/TwoSourcesThreeUsers.mo | 9 +++++++- .../ChillerAndTankNoRemoteCharging.mo | 9 +++++++- .../ChillerAndTankWithRemoteCharging.mo | 10 +++++++- 5 files changed, 41 insertions(+), 19 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo index 09307fda022..18147b4e07a 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo @@ -43,12 +43,12 @@ model ChillerAndTank annotation (choicesAllMatching=true, Placement(transformation(extent={{-100,82},{-80,102}}))); - Buildings.Fluid.FixedResistances.PressureDrop preDro2( + Buildings.Fluid.FixedResistances.PressureDrop preDroTan( redeclare package Medium = Medium2, final allowFlowReversal=true, - final dp_nominal=dp_nominal/10, final m_flow_nominal=mTan_flow_nominal) "Flow resistance on tank branch" - annotation (Placement(transformation(extent={{10,-10},{-10,10}}, + annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, rotation=-90, origin={-80,-80}))); Modelica.Blocks.Interfaces.RealInput set_mPum1_flow @@ -121,7 +121,6 @@ model ChillerAndTank use_inputFilter=true, y_start=0, l=1E-5, - dpValve_nominal=0.1*dp_nominal, m_flow_nominal=m2_flow_nominal) if allowRemoteCharging "Discharge valve, in series to the pump (normal direction)" annotation (Placement(transformation(extent={{30,-20},{10,0}}))); @@ -130,7 +129,6 @@ model ChillerAndTank use_inputFilter=true, y_start=0, l=1E-5, - dpValve_nominal=0.1*dp_nominal, m_flow_nominal=mTan_flow_nominal) if allowRemoteCharging "Charging valve, in parallel to the secondary pump (reverse direction)" annotation (Placement(transformation(extent={{10,-80},{30,-60}}))); @@ -202,18 +200,14 @@ model ChillerAndTank annotation (Placement(transformation(extent={{-10,-80},{-30,-60}}))); Buildings.Fluid.FixedResistances.CheckValve cheValPumPri( redeclare package Medium = Medium2, - m_flow_nominal=mEva_flow_nominal, - dpValve_nominal=0.1*dp_nominal, - dpFixed_nominal=0.1*dp_nominal) "Check valve with series resistance" + m_flow_nominal=mEva_flow_nominal) "Check valve with series resistance" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={-70,-30}))); Buildings.Fluid.FixedResistances.CheckValve cheValPumSec( redeclare package Medium = Medium2, - m_flow_nominal=m2_flow_nominal, - dpValve_nominal=0.1*dp_nominal, - dpFixed_nominal=0.1*dp_nominal) "Check valve" annotation (Placement( + m_flow_nominal=m2_flow_nominal) "Check valve" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=180, @@ -267,13 +261,12 @@ equation connect(sen_m_flow.m_flow, conPum2Gro.um_mTan_flow) annotation (Line(points={{-20,-59}, {-20,-56},{0,-56},{0,70},{44,70},{44,108},{88,108},{88,99.8},{81,99.8}}, color={0,0,127})); - connect(preDro2.port_a, tan.port_b) - annotation (Line(points={{-80,-90},{-80,-92},{-66,-92},{-66,-70},{-60,-70}}, - color={0,127,255})); + connect(preDroTan.port_a, tan.port_b) annotation (Line(points={{-80,-90},{-80, + -92},{-66,-92},{-66,-70},{-60,-70}}, color={0,127,255})); connect(sen_m_flow.port_b, tan.port_a) annotation (Line(points={{-30,-70},{-40,-70}}, color={0,127,255})); - connect(port_b2, preDro2.port_b) annotation (Line(points={{-100,-60},{-80,-60}, + connect(port_b2, preDroTan.port_b) annotation (Line(points={{-100,-60},{-80,-60}, {-80,-70}}, color={0,127,255})); connect(chi.port_b2, cheValPumPri.port_a) annotation (Line(points={{-60,4},{-70,4},{-70,-20}}, color={0,127,255})); diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo index 5dea20b4e18..aaea25033f9 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo @@ -32,7 +32,14 @@ model OneSourceOneUser "(Draft) Simple system model with one source and one user final mTan_flow_nominal=m_flow_nominal/2, final dp_nominal=p_CHWS_nominal-p_CHWR_nominal, final T_CHWS_nominal=T_CHWS_nominal, - final T_CHWR_nominal=T_CHWR_nominal) + final T_CHWR_nominal=T_CHWR_nominal, + final preDroTan(final dp_nominal=cat.dp_nominal*0.1), + final valCha(final dpValve_nominal=cat.dp_nominal*0.1), + final valDis(final dpValve_nominal=cat.dp_nominal*0.1), + final cheValPumPri(final dpValve_nominal=cat.dp_nominal*0.1, + final dpFixed_nominal=cat.dp_nominal*0.1), + final cheValPumSec(final dpValve_nominal=cat.dp_nominal*0.1, + final dpFixed_nominal=cat.dp_nominal*0.1)) "Chiller and tank" annotation (Placement(transformation(extent={{-40,-10},{-60,10}}))); Buildings.Fluid.Storage.Plant.Examples.BaseClasses.DummyUser usr( diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index 9d419718d22..ae7d71f9610 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -30,7 +30,14 @@ model TwoSourcesThreeUsers final mTan_flow_nominal=0.3*m_flow_nominal, final dp_nominal=dp_nominal, final T_CHWS_nominal=T_CHWS_nominal, - final T_CHWR_nominal=T_CHWR_nominal) + final T_CHWR_nominal=T_CHWR_nominal, + final preDroTan(final dp_nominal=cat.dp_nominal*0.1), + final valCha(final dpValve_nominal=cat.dp_nominal*0.1), + final valDis(final dpValve_nominal=cat.dp_nominal*0.1), + final cheValPumPri(final dpValve_nominal=cat.dp_nominal*0.1, + final dpFixed_nominal=cat.dp_nominal*0.1), + final cheValPumSec(final dpValve_nominal=cat.dp_nominal*0.1, + final dpFixed_nominal=cat.dp_nominal*0.1)) "Chiller and tank, tank can be charged remotely" annotation (Placement( transformation( extent={{10,-10},{-10,10}}, diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo index 066245f2acf..495c6ea1ffc 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo @@ -24,7 +24,14 @@ model ChillerAndTankNoRemoteCharging final mTan_flow_nominal=1, final dp_nominal=p_CHWS_nominal-p_CHWR_nominal, final T_CHWS_nominal=T_CHWS_nominal, - final T_CHWR_nominal=T_CHWR_nominal) + final T_CHWR_nominal=T_CHWR_nominal, + final preDroTan(final dp_nominal=cat.dp_nominal*0.1), + final valCha(final dpValve_nominal=cat.dp_nominal*0.1), + final valDis(final dpValve_nominal=cat.dp_nominal*0.1), + final cheValPumPri(final dpValve_nominal=cat.dp_nominal*0.1, + final dpFixed_nominal=cat.dp_nominal*0.1), + final cheValPumSec(final dpValve_nominal=cat.dp_nominal*0.1, + final dpFixed_nominal=cat.dp_nominal*0.1)) "Plant with chiller and tank" annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); Buildings.Fluid.Sources.Boundary_pT sou( diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo index 2dbd3984543..d6a899bbbe2 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo @@ -25,7 +25,15 @@ model ChillerAndTankWithRemoteCharging final mTan_flow_nominal=1, final dp_nominal=p_CHWS_nominal-p_CHWR_nominal, final T_CHWS_nominal=T_CHWS_nominal, - final T_CHWR_nominal=T_CHWR_nominal) "Plant with chiller and tank" + final T_CHWR_nominal=T_CHWR_nominal, + final preDroTan(final dp_nominal=cat.dp_nominal*0.1), + final valCha(final dpValve_nominal=cat.dp_nominal*0.1), + final valDis(final dpValve_nominal=cat.dp_nominal*0.1), + final cheValPumPri(final dpValve_nominal=cat.dp_nominal*0.1, + final dpFixed_nominal=cat.dp_nominal*0.1), + final cheValPumSec(final dpValve_nominal=cat.dp_nominal*0.1, + final dpFixed_nominal=cat.dp_nominal*0.1)) + "Plant with chiller and tank" annotation (Placement(transformation(extent={{-8,-10},{12,10}}))); Buildings.Fluid.Sources.Boundary_pT sou( redeclare final package Medium = Medium2, From 39a7c2013a0627cb61fc4bdc277dd5e157c9b7e6 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Mon, 14 Mar 2022 14:19:37 -0700 Subject: [PATCH 058/463] renaming components for clarity [ci skip] --- .../Fluid/Storage/Plant/ChillerAndTank.mo | 64 +++++++++---------- .../Plant/Examples/OneSourceOneUser.mo | 26 ++++---- .../Plant/Examples/TwoSourcesThreeUsers.mo | 6 +- .../ChillerAndTankNoRemoteCharging.mo | 26 ++++---- .../ChillerAndTankWithRemoteCharging.mo | 2 +- 5 files changed, 60 insertions(+), 64 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo index 18147b4e07a..9b064355736 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo @@ -51,11 +51,11 @@ model ChillerAndTank extent={{10,-10},{-10,10}}, rotation=-90, origin={-80,-80}))); - Modelica.Blocks.Interfaces.RealInput set_mPum1_flow + Modelica.Blocks.Interfaces.RealInput set_mPumPri_flow "Primary pump mass flow rate setpoint" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={40,130}), iconTransformation( + origin={40,130}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-110,100}))); @@ -94,7 +94,7 @@ model ChillerAndTank rotation=0, origin={80,-20}))); - Buildings.Fluid.Storage.Plant.BaseClasses.ReversiblePumpValveControl conPum2Gro + Buildings.Fluid.Storage.Plant.BaseClasses.ReversiblePumpValveControl conPumSecGro if allowRemoteCharging "Control block for secondary pump-valve group" annotation (Placement(transformation(extent={{80,80},{60,102}}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanInput booOnOff @@ -153,10 +153,10 @@ model ChillerAndTank extent={{-10,-10},{10,10}}, rotation=-90, origin={28,90}))); - Modelica.Blocks.Interfaces.RealInput yPum2 if not allowRemoteCharging - "Secondary pump speed input" - annotation (Placement(transformation(extent={{120,10},{100,30}}), - iconTransformation(extent={{-10,-10},{10,10}}, + Modelica.Blocks.Interfaces.RealInput yPumSec if not allowRemoteCharging + "Secondary pump speed input" annotation (Placement(transformation(extent={{ + 120,10},{100,30}}), iconTransformation( + extent={{-10,-10},{10,10}}, rotation=-90, origin={-80,110}))); Buildings.Fluid.Chillers.ElectricEIR chi( @@ -213,35 +213,35 @@ model ChillerAndTank rotation=180, origin={50,-20}))); equation - connect(conPum2Gro.yVal1, valDis.y) annotation (Line(points={{66,78.9},{66,56}, - {20,56},{20,2}}, color={0,0,127})); - connect(conPum2Gro.us_mTan_flow, set_mTan_flow) annotation (Line(points={{81, - 95.4},{90,95.4},{90,118},{80,118},{80,130}}, color={0,0,127})); - connect(pumSec.y, conPum2Gro.yPum2) annotation (Line(points={{80,-8},{80,20},{ - 70,20},{70,78.9}}, color={0,0,127})); + connect(conPumSecGro.yVal1, valDis.y) annotation (Line(points={{66,78.9},{66, + 56},{20,56},{20,2}}, color={0,0,127})); + connect(conPumSecGro.us_mTan_flow, set_mTan_flow) annotation (Line(points={{ + 81,95.4},{90,95.4},{90,118},{80,118},{80,130}}, color={0,0,127})); + connect(pumSec.y, conPumSecGro.yPum2) annotation (Line(points={{80,-8},{80,20}, + {70,20},{70,78.9}}, color={0,0,127})); connect(swiFloDirPum1.u2, booFloDir) annotation (Line(points={{-10,102},{-10,112}, {96,112},{96,100},{110,100}}, color={255,0,255})); - connect(swiFloDirPum1.u1, set_mPum1_flow) annotation (Line(points={{-2,102},{-2, - 108},{40,108},{40,130}}, color={0,0,127})); + connect(swiFloDirPum1.u1, set_mPumPri_flow) annotation (Line(points={{-2,102}, + {-2,108},{40,108},{40,130}}, color={0,0,127})); connect(pumPri.m_flow_in, swiFloDirPum1.y) annotation (Line(points={{-20,-20}, {-20,72},{-10,72},{-10,78}}, color={0,0,127})); connect(conZero.y,swiFloDirPum1. u3) annotation (Line(points={{-50,101},{-50,108}, {-18,108},{-18,102}}, color={0,0,127})); - connect(pasSwiFloDirPum1.u, set_mPum1_flow) annotation (Line(points={{28,102}, - {28,108},{40,108},{40,130}}, color={0,0,127})); + connect(pasSwiFloDirPum1.u, set_mPumPri_flow) annotation (Line(points={{28, + 102},{28,108},{40,108},{40,130}}, color={0,0,127})); connect(pasSwiFloDirPum1.y, pumPri.m_flow_in) annotation (Line(points={{28,79}, {28,72},{-20,72},{-20,-20}}, color={0,0,127})); - connect(pumSec.y, yPum2) + connect(pumSec.y, yPumSec) annotation (Line(points={{80,-8},{80,20},{110,20}}, color={0,0,127})); connect(pumSec.port_a, port_a2) annotation (Line(points={{90,-20},{90,-60},{100,-60}}, color={0,127,255})); connect(valCha.port_b, port_a2) annotation (Line(points={{30,-70},{90,-70},{90, -60},{100,-60}}, color={0,127,255})); - connect(conPum2Gro.booOnOff, booOnOff) annotation (Line(points={{82,82.2},{82, - 82},{96,82},{96,80},{110,80}}, color={255,0,255})); - connect(conPum2Gro.booFloDir, booFloDir) annotation (Line(points={{82,86.6},{ - 82,86},{96,86},{96,100},{110,100}}, color={255,0,255})); + connect(conPumSecGro.booOnOff, booOnOff) annotation (Line(points={{82,82.2},{ + 82,82},{96,82},{96,80},{110,80}}, color={255,0,255})); + connect(conPumSecGro.booFloDir, booFloDir) annotation (Line(points={{82,86.6}, + {82,86},{96,86},{96,100},{110,100}}, color={255,0,255})); connect(pumPri.port_b, chi.port_a2) annotation (Line(points={{-30,-32},{-40,-32},{-40,4}}, color={0,127,255})); connect(chi.on, booFloDir) annotation (Line(points={{-62,13},{-62,12},{-72,12}, @@ -254,13 +254,13 @@ equation 60},{-100,60}}, color={0,127,255})); connect(chi.port_b1, port_b1) annotation (Line(points={{-40,16},{-32,16},{-32, 60},{100,60}}, color={0,127,255})); - connect(valDis.y_actual, conPum2Gro.yVal1_actual) annotation (Line(points={{15, - -3},{14,-3},{14,68},{46,68},{46,99.8},{59,99.8}}, color={0,0,127})); + connect(valDis.y_actual, conPumSecGro.yVal1_actual) annotation (Line(points={ + {15,-3},{14,-3},{14,68},{46,68},{46,99.8},{59,99.8}}, color={0,0,127})); connect(sen_m_flow.m_flow, mTan_flow) annotation (Line(points={{-20,-59},{-20, -56},{0,-56},{0,-110}}, color={0,0,127})); - connect(sen_m_flow.m_flow, conPum2Gro.um_mTan_flow) annotation (Line(points={{-20,-59}, - {-20,-56},{0,-56},{0,70},{44,70},{44,108},{88,108},{88,99.8},{81,99.8}}, - color={0,0,127})); + connect(sen_m_flow.m_flow, conPumSecGro.um_mTan_flow) annotation (Line(points + ={{-20,-59},{-20,-56},{0,-56},{0,70},{44,70},{44,108},{88,108},{88,99.8}, + {81,99.8}}, color={0,0,127})); connect(preDroTan.port_a, tan.port_b) annotation (Line(points={{-80,-90},{-80, -92},{-66,-92},{-66,-70},{-60,-70}}, color={0,127,255})); connect(sen_m_flow.port_b, tan.port_a) @@ -286,11 +286,11 @@ equation {34,-32},{34,-20},{40,-20}}, color={0,127,255})); connect(valDis.port_a, cheValPumSec.port_b) annotation (Line(points={{30,-10}, {34,-10},{34,-20},{40,-20}}, color={0,127,255})); - connect(conPum2Gro.yVal2, valCha.y) annotation (Line(points={{62,78.9},{62,4}, - {94,4},{94,-44},{20,-44},{20,-58}}, color={0,0,127})); - connect(conPum2Gro.yVal2_actual, valCha.y_actual) annotation (Line(points={{59, - 95.4},{54,95.4},{54,96},{48,96},{48,6},{96,6},{96,-46},{60,-46},{60,-63}, - {25,-63}}, color={0,0,127})); + connect(conPumSecGro.yVal2, valCha.y) annotation (Line(points={{62,78.9},{62, + 4},{94,4},{94,-44},{20,-44},{20,-58}}, color={0,0,127})); + connect(conPumSecGro.yVal2_actual, valCha.y_actual) annotation (Line(points={ + {59,95.4},{54,95.4},{54,96},{48,96},{48,6},{96,6},{96,-46},{60,-46},{ + 60,-63},{25,-63}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,100}}), graphics={Line( points={{-30,-110},{30,-110}}, diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo index aaea25033f9..97a243a0907 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo @@ -57,13 +57,12 @@ model OneSourceOneUser "(Draft) Simple system model with one source and one user 1200,QCooLoa_flow_nominal; 2400,QCooLoa_flow_nominal; 2400,0; 1*3600,0]) "Placeholder, prescribed cooling load" annotation (Placement(transformation(extent={{0,50},{20,70}}))); - Buildings.Controls.Continuous.LimPID conPI_pum2( + Buildings.Controls.Continuous.LimPID conPI_pumSec( controllerType=Modelica.Blocks.Types.SimpleController.PI, Td=1, k=1, Ti=100, - reverseActing=true) - "PI controller for pum2" annotation (Placement(transformation( + reverseActing=true) "PI controller" annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=270, origin={-50,40}))); @@ -92,7 +91,7 @@ model OneSourceOneUser "(Draft) Simple system model with one source and one user extent={{-10,-10},{10,10}}, rotation=0, origin={-90,-20}))); - Modelica.Blocks.Math.Gain gaiPum2(k=1/usr.dp_nominal) "Gain" annotation ( + Modelica.Blocks.Math.Gain gaiPumSec(k=1/usr.dp_nominal) "Gain" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=270, @@ -128,14 +127,13 @@ equation connect(usr.port_b, preDro2.port_a) annotation (Line(points={{60,-20},{60,-40},{10,-40}}, color={0,127,255})); - connect(set_dpUsr.y, conPI_pum2.u_s) - annotation (Line(points={{-50,59},{-50,52}}, color={0,0,127})); - connect(usr.dpUsr, gaiPum2.u) annotation (Line(points={{48,-9},{48,-9},{48,88}, - {-20,88},{-20,82}}, color={0,0,127})); - connect(conPI_pum2.y, cat.yPum2) - annotation (Line(points={{-50,29},{-50,20},{-42,20},{-42,11}}, - color={0,0,127})); - connect(gaiPum2.y, conPI_pum2.u_m) + connect(set_dpUsr.y, conPI_pumSec.u_s) + annotation (Line(points={{-50,59},{-50,52}}, color={0,0,127})); + connect(usr.dpUsr, gaiPumSec.u) annotation (Line(points={{48,-9},{48,-9},{48, + 88},{-20,88},{-20,82}}, color={0,0,127})); + connect(conPI_pumSec.y, cat.yPumSec) annotation (Line(points={{-50,29},{-50, + 20},{-42,20},{-42,11}}, color={0,0,127})); + connect(gaiPumSec.y, conPI_pumSec.u_m) annotation (Line(points={{-20,59},{-20,40},{-38,40}}, color={0,0,127})); connect(cat.port_b2, preDro1.port_a) annotation (Line(points={{-40,-6},{-16, -6},{-16,-20},{-10,-20}}, color={0,127,255})); @@ -147,8 +145,8 @@ equation {-74,20},{-80,20}}, color={0,127,255})); connect(cat.port_a1, souCDW.ports[1]) annotation (Line(points={{-40,6},{-34,6}, {-34,20},{-30,20}}, color={0,127,255})); - connect(set_mChi_flow.y, cat.set_mPum1_flow) annotation (Line(points={{-39,-70}, - {-26,-70},{-26,10},{-39,10}}, color={0,0,127})); + connect(set_mChi_flow.y, cat.set_mPumPri_flow) annotation (Line(points={{-39, + -70},{-26,-70},{-26,10},{-39,10}}, color={0,0,127})); annotation(__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos" "Simulate and plot"), experiment(Tolerance=1e-06, StopTime=3600), Documentation(info=" diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index ae7d71f9610..8458a1f14e8 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -106,7 +106,7 @@ model TwoSourcesThreeUsers Buildings.Controls.OBC.CDL.Continuous.MultiMax mulMax_yVal(nin=3) "Max of valve positions" annotation (Placement(transformation(extent={{60,-120},{40,-100}}))); - Modelica.Blocks.Sources.Constant set_mChi2Pum1_flow(k=0.75*m_flow_nominal) + Modelica.Blocks.Sources.Constant set_mChi2PumPri_flow(k=0.75*m_flow_nominal) "Placeholder, primary flow rate setpoint" annotation (Placement(transformation(extent={{-140,-80},{-120,-60}}))); Buildings.Fluid.Sources.Boundary_pT sou_p( @@ -312,8 +312,8 @@ equation annotation (Line(points={{38,-110},{22,-110}}, color={0,0,127})); connect(hysCat.y, cat.booOnOff) annotation (Line(points={{-2,-110},{-44,-110}, {-44,-48},{-50,-48}}, color={255,0,255})); - connect(set_mChi2Pum1_flow.y, cat.set_mPum1_flow) annotation (Line(points={{-119, - -70},{-80,-70},{-80,-49},{-70,-49}}, color={0,0,127})); + connect(set_mChi2PumPri_flow.y, cat.set_mPumPri_flow) annotation (Line(points + ={{-119,-70},{-80,-70},{-80,-49},{-70,-49}}, color={0,0,127})); connect(set_dpUsr.y, conPI_PumChi1.u_s) annotation (Line(points={{-60,139},{-60,122}}, color={0,0,127})); connect(conPI_PumChi1.y, pumChi1.y) diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo index 495c6ea1ffc..6159aa334eb 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo @@ -53,18 +53,17 @@ model ChillerAndTankNoRemoteCharging extent={{10,10},{-10,-10}}, rotation=180, origin={-70,-30}))); - Modelica.Blocks.Sources.TimeTable set_mPum2_flow(table=[0,1; 900,1; 900,-1; + Modelica.Blocks.Sources.TimeTable set_mPumSec_flow(table=[0,1; 900,1; 900,-1; 1800,-1; 1800,0; 2700,0; 2700,1; 3600,1]) - "Secondary mass flow rate setpoint" + "Secondary mass flow rate setpoint" annotation (Placement(transformation(extent={{-100,40},{-80,60}}))); - Modelica.Blocks.Sources.Constant set_mPum1_flow(k=cat.m1_flow_nominal) + Modelica.Blocks.Sources.Constant set_mPumPri_flow(k=cat.m1_flow_nominal) "Primary pump mass flow rate setpoint" annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); - Buildings.Controls.Continuous.LimPID conPID_Pum2( + Buildings.Controls.Continuous.LimPID conPID_PumSec( Td=1, k=1, - Ti=15) "PI controller for the secondary pump" annotation (Placement( - transformation( + Ti=15) "PI controller" annotation (Placement(transformation( extent={{10,-10},{-10,10}}, rotation=180, origin={-50,50}))); @@ -91,16 +90,15 @@ model ChillerAndTankNoRemoteCharging origin={70,30}))); equation - connect(gain2.y, conPID_Pum2.u_m) - annotation (Line(points={{-21,70},{-50,70},{-50,62}}, - color={0,0,127})); + connect(gain2.y, conPID_PumSec.u_m) + annotation (Line(points={{-21,70},{-50,70},{-50,62}}, color={0,0,127})); connect(cat.mTan_flow, gain2.u) annotation (Line(points={{11,-2},{16,-2},{16,70}, {2,70}}, color={0,0,127})); - connect(set_mPum2_flow.y, conPID_Pum2.u_s) - annotation (Line(points={{-79,50},{-62,50}}, color={0,0,127})); - connect(set_mPum1_flow.y, cat.set_mPum1_flow) annotation (Line(points={{-59,0}, - {-16,0},{-16,10},{-11,10}}, color={0,0,127})); - connect(conPID_Pum2.y, cat.yPum2) + connect(set_mPumSec_flow.y, conPID_PumSec.u_s) + annotation (Line(points={{-79,50},{-62,50}}, color={0,0,127})); + connect(set_mPumPri_flow.y, cat.set_mPumPri_flow) annotation (Line(points={{-59, + 0},{-16,0},{-16,10},{-11,10}}, color={0,0,127})); + connect(conPID_PumSec.y, cat.yPumSec) annotation (Line(points={{-39,50},{-8,50},{-8,11}}, color={0,0,127})); connect(sin.ports[1], cat.port_b2) annotation (Line(points={{-60,-30},{-16, -30},{-16,-6},{-10,-6}}, color={0,127,255})); diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo index d6a899bbbe2..b0404a82752 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo @@ -94,7 +94,7 @@ equation connect(set_mTan_flow.y, cat.set_mTan_flow) annotation (Line(points={{-59,60},{-14,60},{-14,2},{-9,2}}, color={0,0,127})); - connect(set_mChi_flow.y, cat.set_mPum1_flow) + connect(set_mChi_flow.y, cat.set_mPumPri_flow) annotation (Line(points={{-59,90},{-9,90},{-9,10}}, color={0,0,127})); connect(cat.port_b2, sin.ports[1]) annotation (Line(points={{-8,-6},{-54,-6}, {-54,-30},{-60,-30}}, color={0,127,255})); From 22d3d306b9cd333123e2dfc1186ac8e901cdc029 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Mon, 14 Mar 2022 15:13:27 -0700 Subject: [PATCH 059/463] removed Td from PI controllers --- .../Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo | 2 -- Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo | 1 - Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo | 1 - Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo | 1 - .../Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo | 1 - 5 files changed, 6 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo index 803042526e6..bbda2185808 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo @@ -9,7 +9,6 @@ block ReversiblePumpValveControl annotation (Placement(transformation(extent={{-100,-120},{-80,-100}}))); Buildings.Controls.Continuous.LimPID conPI_pum2( controllerType=Modelica.Blocks.Types.SimpleController.PI, - Td=1, k=5, Ti=50) "PI controller for pum2" annotation (Placement(transformation( extent={{-10,10},{10,-10}}, @@ -22,7 +21,6 @@ block ReversiblePumpValveControl origin={-70,30}))); Buildings.Controls.Continuous.LimPID conPI_val2( controllerType=Modelica.Blocks.Types.SimpleController.PI, - Td=1, k=5, Ti=50, reverseActing=false) diff --git a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo index 0355af4d1cd..8920dfebfbd 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo @@ -52,7 +52,6 @@ model DummyUser "Dummy user model" annotation (Placement(transformation(extent={{60,-10},{80,10}}))); Buildings.Controls.Continuous.LimPID conPI( controllerType=Modelica.Blocks.Types.SimpleController.PI, - Td=1, k=10, Ti=1000, reverseActing=false) "PI controller" annotation (Placement(transformation( diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo index 97a243a0907..ffbec75d18c 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo @@ -59,7 +59,6 @@ model OneSourceOneUser "(Draft) Simple system model with one source and one user annotation (Placement(transformation(extent={{0,50},{20,70}}))); Buildings.Controls.Continuous.LimPID conPI_pumSec( controllerType=Modelica.Blocks.Types.SimpleController.PI, - Td=1, k=1, Ti=100, reverseActing=true) "PI controller" annotation (Placement(transformation( diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index 8458a1f14e8..f4f55c86d2f 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -119,7 +119,6 @@ model TwoSourcesThreeUsers origin={-170,30}))); Buildings.Controls.Continuous.LimPID conPI_PumChi1( controllerType=Modelica.Blocks.Types.SimpleController.PI, - Td=1, k=1, Ti=100, reverseActing=true) "PI controller" annotation (Placement(transformation( diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo index 6159aa334eb..5d145e7c11a 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo @@ -61,7 +61,6 @@ model ChillerAndTankNoRemoteCharging "Primary pump mass flow rate setpoint" annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); Buildings.Controls.Continuous.LimPID conPID_PumSec( - Td=1, k=1, Ti=15) "PI controller" annotation (Placement(transformation( extent={{10,-10},{-10,10}}, From 2492e51b59c9167197dfb2360c1ba879e48b94ef Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Mon, 14 Mar 2022 15:22:08 -0700 Subject: [PATCH 060/463] renamed components in ReversiblePumpValveControl --- .../BaseClasses/ReversiblePumpValveControl.mo | 153 +++++++++--------- .../Fluid/Storage/Plant/ChillerAndTank.mo | 24 +-- 2 files changed, 87 insertions(+), 90 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo index bbda2185808..d240743ce81 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo @@ -3,32 +3,31 @@ block ReversiblePumpValveControl "Control block for the secondary pump-valve group" extends Modelica.Blocks.Icons.Block; - Modelica.Blocks.Sources.Constant conOne(k=1) "Constant y = 1" + Modelica.Blocks.Sources.Constant one(k=1) "Constant y = 1" annotation (Placement(transformation(extent={{-100,-90},{-80,-70}}))); - Modelica.Blocks.Sources.Constant conZero(k=0) "Constant y = 0" + Modelica.Blocks.Sources.Constant zero(k=0) "Constant y = 0" annotation (Placement(transformation(extent={{-100,-120},{-80,-100}}))); - Buildings.Controls.Continuous.LimPID conPI_pum2( + Buildings.Controls.Continuous.LimPID conPI_pumSec( controllerType=Modelica.Blocks.Types.SimpleController.PI, k=5, - Ti=50) "PI controller for pum2" annotation (Placement(transformation( + Ti=50) "PI controller" annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=270, origin={-70,70}))); - Modelica.Blocks.Math.Gain gaiPum2(k=1) "Gain" annotation (Placement( + Modelica.Blocks.Math.Gain gaiPumSec(k=1) "Gain" annotation (Placement( transformation( extent={{10,-10},{-10,10}}, rotation=90, origin={-70,30}))); - Buildings.Controls.Continuous.LimPID conPI_val2( + Buildings.Controls.Continuous.LimPID conPI_valCha( controllerType=Modelica.Blocks.Types.SimpleController.PI, k=5, Ti=50, - reverseActing=false) - "PI controller for val2" annotation (Placement(transformation( + reverseActing=false) "PI controller" annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=270, origin={-10,68}))); - Modelica.Blocks.Math.Gain gaiVal2(k=1) "Gain" annotation (Placement( + Modelica.Blocks.Math.Gain gaiValCha(k=1) "Gain" annotation (Placement( transformation( extent={{10,-10},{-10,10}}, rotation=90, @@ -57,7 +56,7 @@ block ReversiblePumpValveControl "Plant output: true = on; false = off" annotation (Placement( transformation(extent={{-120,-30},{-100,-10}}), iconTransformation( extent={{-140,-100},{-100,-60}}))); - Modelica.Blocks.Interfaces.RealOutput yPum2 "Normalised speed" annotation ( + Modelica.Blocks.Interfaces.RealOutput yPumSec "Normalised speed" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, @@ -65,7 +64,7 @@ block ReversiblePumpValveControl extent={{-10,-10},{10,10}}, rotation=-90, origin={0,-110}))); - Modelica.Blocks.Interfaces.RealOutput yVal2 "Valve position" annotation ( + Modelica.Blocks.Interfaces.RealOutput yValCha "Valve position" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, @@ -73,7 +72,7 @@ block ReversiblePumpValveControl extent={{-10,-10},{10,10}}, rotation=-90, origin={80,-110}))); - Modelica.Blocks.Interfaces.RealOutput yVal1 "Valve position" annotation ( + Modelica.Blocks.Interfaces.RealOutput yValDis "Valve position" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, @@ -81,7 +80,7 @@ block ReversiblePumpValveControl extent={{-10,-10},{10,10}}, rotation=-90, origin={40,-110}))); - Modelica.Blocks.Interfaces.RealInput yVal2_actual "Actual position of val2" + Modelica.Blocks.Interfaces.RealInput yValCha_actual "Actual valve position" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, @@ -89,7 +88,7 @@ block ReversiblePumpValveControl extent={{10,-10},{-10,10}}, rotation=0, origin={110,40}))); - Modelica.Blocks.Interfaces.RealInput yVal1_actual "Actual position of val1" + Modelica.Blocks.Interfaces.RealInput yValDis_actual "Actual valve position" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, @@ -97,116 +96,114 @@ block ReversiblePumpValveControl extent={{10,-10},{-10,10}}, rotation=0, origin={110,80}))); - Buildings.Controls.OBC.CDL.Continuous.LessThreshold lesThrVal1(t=0.05) - "yVal1_actual less than threshold" + Buildings.Controls.OBC.CDL.Continuous.LessThreshold lesThrValDis(t=0.05) + "Actual valve position less than a threshold" annotation (Placement(transformation(extent={{80,20},{60,40}}))); - Buildings.Controls.OBC.CDL.Continuous.Switch swiPum1 - "Switch: true = on; false = off (y=0)." annotation (Placement( + Buildings.Controls.OBC.CDL.Continuous.Switch swiPumPri + "Switch: true = on (y>0); false = off (y=0)." annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={-50,-130}))); - Buildings.Controls.OBC.CDL.Continuous.Switch swiVal1 + Buildings.Controls.OBC.CDL.Continuous.Switch swiValDis "Switch: true = on (y=1); false = off (y=0)." annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={10,-130}))); - Buildings.Controls.OBC.CDL.Continuous.Switch swiVal2 - "Switch: true = on; false = off (y=0)." annotation (Placement( + Buildings.Controls.OBC.CDL.Continuous.Switch swiValCha + "Switch: true = on (y>0); false = off (y=0)." annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={70,-130}))); - Buildings.Controls.OBC.CDL.Logical.And3 and3Val1 - "Plant on AND normal direction AND val2 closed" annotation (Placement( + Buildings.Controls.OBC.CDL.Logical.And3 and3ValDis + "Plant on AND normal direction AND valCha closed" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={0,-50}))); - Buildings.Controls.OBC.CDL.Continuous.LessThreshold lesThrVal2(t=0.05) - "yVal1_actual less than threshold" + Buildings.Controls.OBC.CDL.Continuous.LessThreshold lesThrValCha(t=0.05) + "Actual valve position less than a threshold" annotation (Placement(transformation(extent={{80,60},{60,80}}))); - Buildings.Controls.OBC.CDL.Logical.Not notFloDirVal2 - "Reverses flow direction signal for val2" annotation (Placement( - transformation( + Buildings.Controls.OBC.CDL.Logical.Not notFloDirValCha + "Reverses flow direction signal" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={60,-16}))); - Buildings.Controls.OBC.CDL.Logical.And3 and3Pum2 - "Plant on AND normal direction AND val2 closed" annotation (Placement( + Buildings.Controls.OBC.CDL.Logical.And3 and3PumSec + "Plant on AND normal direction AND valCha closed" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={-60,-50}))); - Buildings.Controls.OBC.CDL.Logical.And andVal2 "Reverse direction AND val1 closed" - annotation (Placement(transformation( + Buildings.Controls.OBC.CDL.Logical.And andValCha + "Reverse direction AND valDis closed" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={60,-50}))); equation - connect(conPI_pum2.y,gaiPum2. u) - annotation (Line(points={{-70,59},{-70,42}}, color={0,0,127})); - connect(conPI_val2.y,gaiVal2. u) annotation (Line(points={{-10,57},{-10,42}}, - color={0,0,127})); - connect(conPI_pum2.u_s, us_mTan_flow) - annotation (Line(points={{-70,82},{-70,110}}, color={0,0,127})); - connect(conPI_val2.u_s, us_mTan_flow) annotation (Line(points={{-10,80},{-10, - 88},{-70,88},{-70,110}}, color={0,0,127})); - connect(conPI_val2.u_m, um_mTan_flow) annotation (Line(points={{2,68},{10,68}, - {10,110}}, color={0,0,127})); - connect(conPI_pum2.u_m, um_mTan_flow) annotation (Line(points={{-58,70},{-52, - 70},{-52,94},{10,94},{10,110}}, color={0,0,127})); - connect(yVal1, yVal1) + connect(conPI_pumSec.y, gaiPumSec.u) + annotation (Line(points={{-70,59},{-70,42}}, color={0,0,127})); + connect(conPI_valCha.y, gaiValCha.u) + annotation (Line(points={{-10,57},{-10,42}}, color={0,0,127})); + connect(conPI_pumSec.u_s, us_mTan_flow) + annotation (Line(points={{-70,82},{-70,110}}, color={0,0,127})); + connect(conPI_valCha.u_s, us_mTan_flow) annotation (Line(points={{-10,80},{-10, + 88},{-70,88},{-70,110}}, color={0,0,127})); + connect(conPI_valCha.u_m, um_mTan_flow) + annotation (Line(points={{2,68},{10,68},{10,110}}, color={0,0,127})); + connect(conPI_pumSec.u_m, um_mTan_flow) annotation (Line(points={{-58,70},{-52, + 70},{-52,94},{10,94},{10,110}}, color={0,0,127})); + connect(yValDis, yValDis) annotation (Line(points={{10,-170},{10,-170}}, color={0,0,127})); - connect(swiPum1.y, yPum2) + connect(swiPumPri.y, yPumSec) annotation (Line(points={{-50,-142},{-50,-170}}, color={0,0,127})); - connect(conZero.y, swiPum1.u3) annotation (Line(points={{-79,-110},{-58,-110}, + connect(zero.y, swiPumPri.u3) annotation (Line(points={{-79,-110},{-58,-110}, {-58,-118}}, color={0,0,127})); - connect(conZero.y, swiVal1.u3) + connect(zero.y, swiValDis.u3) annotation (Line(points={{-79,-110},{2,-110},{2,-118}}, color={0,0,127})); - connect(swiVal1.y, yVal1) + connect(swiValDis.y, yValDis) annotation (Line(points={{10,-142},{10,-170}}, color={0,0,127})); - connect(swiVal2.y, yVal2) + connect(swiValCha.y, yValCha) annotation (Line(points={{70,-142},{70,-170}}, color={0,0,127})); - connect(conZero.y, swiVal2.u3) annotation (Line(points={{-79,-110},{62,-110},{ + connect(zero.y, swiValCha.u3) annotation (Line(points={{-79,-110},{62,-110},{ 62,-118}}, color={0,0,127})); - connect(conOne.y, swiVal1.u1) + connect(one.y, swiValDis.u1) annotation (Line(points={{-79,-80},{18,-80},{18,-118}}, color={0,0,127})); - connect(gaiPum2.y, swiPum1.u1) annotation (Line(points={{-70,19},{-70,10},{-42, - 10},{-42,-118}}, color={0,0,127})); - connect(gaiVal2.y, swiVal2.u1) annotation (Line(points={{-10,19},{-10,10},{78, - 10},{78,-118}}, color={0,0,127})); - connect(booOnOff, and3Val1.u3) annotation (Line(points={{-110,-20},{-8,-20},{-8, - -38}}, color={255,0,255})); - connect(booFloDir, and3Val1.u2) annotation (Line(points={{-110,0},{0,0},{0,-20}, - {2.22045e-15,-20},{2.22045e-15,-38}}, color={255,0,255})); - connect(lesThrVal2.u, yVal2_actual) + connect(gaiPumSec.y, swiPumPri.u1) annotation (Line(points={{-70,19},{-70,10}, + {-42,10},{-42,-118}}, color={0,0,127})); + connect(gaiValCha.y, swiValCha.u1) annotation (Line(points={{-10,19},{-10,10}, + {78,10},{78,-118}}, color={0,0,127})); + connect(booOnOff, and3ValDis.u3) annotation (Line(points={{-110,-20},{-8,-20}, + {-8,-38}}, color={255,0,255})); + connect(booFloDir, and3ValDis.u2) annotation (Line(points={{-110,0},{0,0},{0, + -20},{2.22045e-15,-20},{2.22045e-15,-38}}, color={255,0,255})); + connect(lesThrValCha.u, yValCha_actual) annotation (Line(points={{82,70},{110,70}}, color={0,0,127})); - connect(lesThrVal2.y, and3Val1.u1) annotation (Line(points={{58,70},{34,70},{34, - 40},{8,40},{8,-38}}, color={255,0,255})); - connect(lesThrVal1.u, yVal1_actual) + connect(lesThrValCha.y, and3ValDis.u1) annotation (Line(points={{58,70},{34, + 70},{34,40},{8,40},{8,-38}}, color={255,0,255})); + connect(lesThrValDis.u, yValDis_actual) annotation (Line(points={{82,30},{110,30}}, color={0,0,127})); - connect(and3Val1.y, swiVal1.u2) annotation (Line(points={{-2.22045e-15,-62},{-2.22045e-15, - -70},{10,-70},{10,-118}}, color={255,0,255})); - connect(notFloDirVal2.u, booFloDir) + connect(and3ValDis.y, swiValDis.u2) annotation (Line(points={{-2.22045e-15,-62}, + {-2.22045e-15,-70},{10,-70},{10,-118}}, color={255,0,255})); + connect(notFloDirValCha.u, booFloDir) annotation (Line(points={{60,-4},{60,0},{-110,0}}, color={255,0,255})); - connect(and3Pum2.u3, booOnOff) annotation (Line(points={{-68,-38},{-68,-20},{ - -110,-20}}, color={255,0,255})); - connect(and3Pum2.u2, booFloDir) + connect(and3PumSec.u3, booOnOff) annotation (Line(points={{-68,-38},{-68,-20}, + {-110,-20}}, color={255,0,255})); + connect(and3PumSec.u2, booFloDir) annotation (Line(points={{-60,-38},{-60,0},{-110,0}}, color={255,0,255})); - connect(and3Pum2.u1, lesThrVal2.y) annotation (Line(points={{-52,-38},{-52, + connect(and3PumSec.u1, lesThrValCha.y) annotation (Line(points={{-52,-38},{-52, -30},{8,-30},{8,40},{34,40},{34,70},{58,70}}, color={255,0,255})); - connect(and3Pum2.y, swiPum1.u2) annotation (Line(points={{-60,-62},{-60,-70}, + connect(and3PumSec.y, swiPumPri.u2) annotation (Line(points={{-60,-62},{-60,-70}, {-50,-70},{-50,-118}}, color={255,0,255})); - connect(notFloDirVal2.y, andVal2.u1) + connect(notFloDirValCha.y, andValCha.u1) annotation (Line(points={{60,-28},{60,-38}}, color={255,0,255})); - connect(lesThrVal1.y, andVal2.u2) annotation (Line(points={{58,30},{46,30},{46, - -32},{52,-32},{52,-38}}, - color={255,0,255})); - connect(andVal2.y, swiVal2.u2) annotation (Line(points={{60,-62},{60,-70},{70, - -70},{70,-118}}, color={255,0,255})); + connect(lesThrValDis.y, andValCha.u2) annotation (Line(points={{58,30},{46,30}, + {46,-32},{52,-32},{52,-38}}, color={255,0,255})); + connect(andValCha.y, swiValCha.u2) annotation (Line(points={{60,-62},{60,-70}, + {70,-70},{70,-118}}, color={255,0,255})); annotation (Diagram(coordinateSystem(extent={{-100,-160},{100,100}})), Icon( coordinateSystem(extent={{-100,-100},{100,100}})), Documentation(revisions=" diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo index 9b064355736..c75d518861e 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo @@ -213,12 +213,12 @@ model ChillerAndTank rotation=180, origin={50,-20}))); equation - connect(conPumSecGro.yVal1, valDis.y) annotation (Line(points={{66,78.9},{66, - 56},{20,56},{20,2}}, color={0,0,127})); + connect(conPumSecGro.yValDis, valDis.y) annotation (Line(points={{66,78.9},{ + 66,56},{20,56},{20,2}}, color={0,0,127})); connect(conPumSecGro.us_mTan_flow, set_mTan_flow) annotation (Line(points={{ 81,95.4},{90,95.4},{90,118},{80,118},{80,130}}, color={0,0,127})); - connect(pumSec.y, conPumSecGro.yPum2) annotation (Line(points={{80,-8},{80,20}, - {70,20},{70,78.9}}, color={0,0,127})); + connect(pumSec.y, conPumSecGro.yPumSec) annotation (Line(points={{80,-8},{80, + 20},{70,20},{70,78.9}}, color={0,0,127})); connect(swiFloDirPum1.u2, booFloDir) annotation (Line(points={{-10,102},{-10,112}, {96,112},{96,100},{110,100}}, color={255,0,255})); connect(swiFloDirPum1.u1, set_mPumPri_flow) annotation (Line(points={{-2,102}, @@ -254,12 +254,12 @@ equation 60},{-100,60}}, color={0,127,255})); connect(chi.port_b1, port_b1) annotation (Line(points={{-40,16},{-32,16},{-32, 60},{100,60}}, color={0,127,255})); - connect(valDis.y_actual, conPumSecGro.yVal1_actual) annotation (Line(points={ - {15,-3},{14,-3},{14,68},{46,68},{46,99.8},{59,99.8}}, color={0,0,127})); + connect(valDis.y_actual, conPumSecGro.yValDis_actual) annotation (Line(points + ={{15,-3},{14,-3},{14,68},{46,68},{46,99.8},{59,99.8}}, color={0,0,127})); connect(sen_m_flow.m_flow, mTan_flow) annotation (Line(points={{-20,-59},{-20, -56},{0,-56},{0,-110}}, color={0,0,127})); - connect(sen_m_flow.m_flow, conPumSecGro.um_mTan_flow) annotation (Line(points - ={{-20,-59},{-20,-56},{0,-56},{0,70},{44,70},{44,108},{88,108},{88,99.8}, + connect(sen_m_flow.m_flow, conPumSecGro.um_mTan_flow) annotation (Line(points= + {{-20,-59},{-20,-56},{0,-56},{0,70},{44,70},{44,108},{88,108},{88,99.8}, {81,99.8}}, color={0,0,127})); connect(preDroTan.port_a, tan.port_b) annotation (Line(points={{-80,-90},{-80, -92},{-66,-92},{-66,-70},{-60,-70}}, color={0,127,255})); @@ -286,10 +286,10 @@ equation {34,-32},{34,-20},{40,-20}}, color={0,127,255})); connect(valDis.port_a, cheValPumSec.port_b) annotation (Line(points={{30,-10}, {34,-10},{34,-20},{40,-20}}, color={0,127,255})); - connect(conPumSecGro.yVal2, valCha.y) annotation (Line(points={{62,78.9},{62, - 4},{94,4},{94,-44},{20,-44},{20,-58}}, color={0,0,127})); - connect(conPumSecGro.yVal2_actual, valCha.y_actual) annotation (Line(points={ - {59,95.4},{54,95.4},{54,96},{48,96},{48,6},{96,6},{96,-46},{60,-46},{ + connect(conPumSecGro.yValCha, valCha.y) annotation (Line(points={{62,78.9},{ + 62,4},{94,4},{94,-44},{20,-44},{20,-58}}, color={0,0,127})); + connect(conPumSecGro.yValCha_actual, valCha.y_actual) annotation (Line(points + ={{59,95.4},{54,95.4},{54,96},{48,96},{48,6},{96,6},{96,-46},{60,-46},{ 60,-63},{25,-63}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,100}}), graphics={Line( From 2745baca08bacea1f13c85839b277405b1e9caca Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Mon, 14 Mar 2022 15:24:23 -0700 Subject: [PATCH 061/463] removed unnecessary gain blocks --- .../BaseClasses/ReversiblePumpValveControl.mo | 22 ++++--------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo index d240743ce81..dfa2b5c149f 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo @@ -14,11 +14,6 @@ block ReversiblePumpValveControl extent={{-10,10},{10,-10}}, rotation=270, origin={-70,70}))); - Modelica.Blocks.Math.Gain gaiPumSec(k=1) "Gain" annotation (Placement( - transformation( - extent={{10,-10},{-10,10}}, - rotation=90, - origin={-70,30}))); Buildings.Controls.Continuous.LimPID conPI_valCha( controllerType=Modelica.Blocks.Types.SimpleController.PI, k=5, @@ -27,11 +22,6 @@ block ReversiblePumpValveControl extent={{-10,10},{10,-10}}, rotation=270, origin={-10,68}))); - Modelica.Blocks.Math.Gain gaiValCha(k=1) "Gain" annotation (Placement( - transformation( - extent={{10,-10},{-10,10}}, - rotation=90, - origin={-10,30}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanInput booFloDir "Flow direction: true = normal; false = reverse" annotation (Placement( transformation(extent={{-120,-10},{-100,10}}), iconTransformation( @@ -144,10 +134,6 @@ block ReversiblePumpValveControl origin={60,-50}))); equation - connect(conPI_pumSec.y, gaiPumSec.u) - annotation (Line(points={{-70,59},{-70,42}}, color={0,0,127})); - connect(conPI_valCha.y, gaiValCha.u) - annotation (Line(points={{-10,57},{-10,42}}, color={0,0,127})); connect(conPI_pumSec.u_s, us_mTan_flow) annotation (Line(points={{-70,82},{-70,110}}, color={0,0,127})); connect(conPI_valCha.u_s, us_mTan_flow) annotation (Line(points={{-10,80},{-10, @@ -172,10 +158,6 @@ equation 62,-118}}, color={0,0,127})); connect(one.y, swiValDis.u1) annotation (Line(points={{-79,-80},{18,-80},{18,-118}}, color={0,0,127})); - connect(gaiPumSec.y, swiPumPri.u1) annotation (Line(points={{-70,19},{-70,10}, - {-42,10},{-42,-118}}, color={0,0,127})); - connect(gaiValCha.y, swiValCha.u1) annotation (Line(points={{-10,19},{-10,10}, - {78,10},{78,-118}}, color={0,0,127})); connect(booOnOff, and3ValDis.u3) annotation (Line(points={{-110,-20},{-8,-20}, {-8,-38}}, color={255,0,255})); connect(booFloDir, and3ValDis.u2) annotation (Line(points={{-110,0},{0,0},{0, @@ -204,6 +186,10 @@ equation {46,-32},{52,-32},{52,-38}}, color={255,0,255})); connect(andValCha.y, swiValCha.u2) annotation (Line(points={{60,-62},{60,-70}, {70,-70},{70,-118}}, color={255,0,255})); + connect(conPI_pumSec.y, swiPumPri.u1) annotation (Line(points={{-70,59},{-70, + 10},{-42,10},{-42,-118}}, color={0,0,127})); + connect(conPI_valCha.y, swiValCha.u1) annotation (Line(points={{-10,57},{-10, + 10},{78,10},{78,-118}}, color={0,0,127})); annotation (Diagram(coordinateSystem(extent={{-100,-160},{100,100}})), Icon( coordinateSystem(extent={{-100,-100},{100,100}})), Documentation(revisions=" From 2f4d8893837c3f18deaa85929a226392bd57fe48 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Mon, 14 Mar 2022 15:26:39 -0700 Subject: [PATCH 062/463] combined duplicating And3 block --- .../BaseClasses/ReversiblePumpValveControl.mo | 36 +++++++------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo index dfa2b5c149f..f9a7e08dda7 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo @@ -107,12 +107,12 @@ block ReversiblePumpValveControl extent={{-10,-10},{10,10}}, rotation=-90, origin={70,-130}))); - Buildings.Controls.OBC.CDL.Logical.And3 and3ValDis + Buildings.Controls.OBC.CDL.Logical.And3 and3 "Plant on AND normal direction AND valCha closed" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={0,-50}))); + origin={10,-50}))); Buildings.Controls.OBC.CDL.Continuous.LessThreshold lesThrValCha(t=0.05) "Actual valve position less than a threshold" annotation (Placement(transformation(extent={{80,60},{60,80}}))); @@ -121,12 +121,6 @@ block ReversiblePumpValveControl extent={{-10,-10},{10,10}}, rotation=-90, origin={60,-16}))); - Buildings.Controls.OBC.CDL.Logical.And3 and3PumSec - "Plant on AND normal direction AND valCha closed" annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={-60,-50}))); Buildings.Controls.OBC.CDL.Logical.And andValCha "Reverse direction AND valDis closed" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -158,28 +152,20 @@ equation 62,-118}}, color={0,0,127})); connect(one.y, swiValDis.u1) annotation (Line(points={{-79,-80},{18,-80},{18,-118}}, color={0,0,127})); - connect(booOnOff, and3ValDis.u3) annotation (Line(points={{-110,-20},{-8,-20}, - {-8,-38}}, color={255,0,255})); - connect(booFloDir, and3ValDis.u2) annotation (Line(points={{-110,0},{0,0},{0, - -20},{2.22045e-15,-20},{2.22045e-15,-38}}, color={255,0,255})); + connect(booOnOff, and3.u3) + annotation (Line(points={{-110,-20},{2,-20},{2,-38}}, color={255,0,255})); + connect(booFloDir, and3.u2) + annotation (Line(points={{-110,0},{10,0},{10,-38}}, color={255,0,255})); connect(lesThrValCha.u, yValCha_actual) annotation (Line(points={{82,70},{110,70}}, color={0,0,127})); - connect(lesThrValCha.y, and3ValDis.u1) annotation (Line(points={{58,70},{34, - 70},{34,40},{8,40},{8,-38}}, color={255,0,255})); + connect(lesThrValCha.y, and3.u1) + annotation (Line(points={{58,70},{18,70},{18,-38}}, color={255,0,255})); connect(lesThrValDis.u, yValDis_actual) annotation (Line(points={{82,30},{110,30}}, color={0,0,127})); - connect(and3ValDis.y, swiValDis.u2) annotation (Line(points={{-2.22045e-15,-62}, - {-2.22045e-15,-70},{10,-70},{10,-118}}, color={255,0,255})); + connect(and3.y, swiValDis.u2) annotation (Line(points={{10,-62},{10,-90},{10, + -90},{10,-118}}, color={255,0,255})); connect(notFloDirValCha.u, booFloDir) annotation (Line(points={{60,-4},{60,0},{-110,0}}, color={255,0,255})); - connect(and3PumSec.u3, booOnOff) annotation (Line(points={{-68,-38},{-68,-20}, - {-110,-20}}, color={255,0,255})); - connect(and3PumSec.u2, booFloDir) - annotation (Line(points={{-60,-38},{-60,0},{-110,0}}, color={255,0,255})); - connect(and3PumSec.u1, lesThrValCha.y) annotation (Line(points={{-52,-38},{-52, - -30},{8,-30},{8,40},{34,40},{34,70},{58,70}}, color={255,0,255})); - connect(and3PumSec.y, swiPumPri.u2) annotation (Line(points={{-60,-62},{-60,-70}, - {-50,-70},{-50,-118}}, color={255,0,255})); connect(notFloDirValCha.y, andValCha.u1) annotation (Line(points={{60,-28},{60,-38}}, color={255,0,255})); connect(lesThrValDis.y, andValCha.u2) annotation (Line(points={{58,30},{46,30}, @@ -190,6 +176,8 @@ equation 10},{-42,10},{-42,-118}}, color={0,0,127})); connect(conPI_valCha.y, swiValCha.u1) annotation (Line(points={{-10,57},{-10, 10},{78,10},{78,-118}}, color={0,0,127})); + connect(and3.y, swiPumPri.u2) annotation (Line(points={{10,-62},{10,-100},{ + -50,-100},{-50,-118}}, color={255,0,255})); annotation (Diagram(coordinateSystem(extent={{-100,-160},{100,100}})), Icon( coordinateSystem(extent={{-100,-100},{100,100}})), Documentation(revisions=" From cd4e82c57e6570cad9ca21d2d915d441c75bc91d Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Mon, 14 Mar 2022 15:33:26 -0700 Subject: [PATCH 063/463] replaced a switch with BooleanToReal --- .../BaseClasses/ReversiblePumpValveControl.mo | 40 ++++++++----------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo index f9a7e08dda7..4baa2050f7f 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo @@ -3,8 +3,6 @@ block ReversiblePumpValveControl "Control block for the secondary pump-valve group" extends Modelica.Blocks.Icons.Block; - Modelica.Blocks.Sources.Constant one(k=1) "Constant y = 1" - annotation (Placement(transformation(extent={{-100,-90},{-80,-70}}))); Modelica.Blocks.Sources.Constant zero(k=0) "Constant y = 0" annotation (Placement(transformation(extent={{-100,-120},{-80,-100}}))); Buildings.Controls.Continuous.LimPID conPI_pumSec( @@ -95,9 +93,9 @@ block ReversiblePumpValveControl extent={{-10,-10},{10,10}}, rotation=-90, origin={-50,-130}))); - Buildings.Controls.OBC.CDL.Continuous.Switch swiValDis - "Switch: true = on (y=1); false = off (y=0)." annotation (Placement( - transformation( + Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToReaValDis + "True to 1, false to 0" + annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={10,-130}))); @@ -140,18 +138,12 @@ equation annotation (Line(points={{10,-170},{10,-170}}, color={0,0,127})); connect(swiPumPri.y, yPumSec) annotation (Line(points={{-50,-142},{-50,-170}}, color={0,0,127})); - connect(zero.y, swiPumPri.u3) annotation (Line(points={{-79,-110},{-58,-110}, - {-58,-118}}, color={0,0,127})); - connect(zero.y, swiValDis.u3) - annotation (Line(points={{-79,-110},{2,-110},{2,-118}}, color={0,0,127})); - connect(swiValDis.y, yValDis) - annotation (Line(points={{10,-142},{10,-170}}, color={0,0,127})); + connect(zero.y, swiPumPri.u3) annotation (Line(points={{-79,-110},{-58,-110},{ + -58,-118}}, color={0,0,127})); connect(swiValCha.y, yValCha) annotation (Line(points={{70,-142},{70,-170}}, color={0,0,127})); - connect(zero.y, swiValCha.u3) annotation (Line(points={{-79,-110},{62,-110},{ - 62,-118}}, color={0,0,127})); - connect(one.y, swiValDis.u1) - annotation (Line(points={{-79,-80},{18,-80},{18,-118}}, color={0,0,127})); + connect(zero.y, swiValCha.u3) annotation (Line(points={{-79,-110},{62,-110},{62, + -118}}, color={0,0,127})); connect(booOnOff, and3.u3) annotation (Line(points={{-110,-20},{2,-20},{2,-38}}, color={255,0,255})); connect(booFloDir, and3.u2) @@ -162,8 +154,6 @@ equation annotation (Line(points={{58,70},{18,70},{18,-38}}, color={255,0,255})); connect(lesThrValDis.u, yValDis_actual) annotation (Line(points={{82,30},{110,30}}, color={0,0,127})); - connect(and3.y, swiValDis.u2) annotation (Line(points={{10,-62},{10,-90},{10, - -90},{10,-118}}, color={255,0,255})); connect(notFloDirValCha.u, booFloDir) annotation (Line(points={{60,-4},{60,0},{-110,0}}, color={255,0,255})); connect(notFloDirValCha.y, andValCha.u1) @@ -172,12 +162,16 @@ equation {46,-32},{52,-32},{52,-38}}, color={255,0,255})); connect(andValCha.y, swiValCha.u2) annotation (Line(points={{60,-62},{60,-70}, {70,-70},{70,-118}}, color={255,0,255})); - connect(conPI_pumSec.y, swiPumPri.u1) annotation (Line(points={{-70,59},{-70, - 10},{-42,10},{-42,-118}}, color={0,0,127})); - connect(conPI_valCha.y, swiValCha.u1) annotation (Line(points={{-10,57},{-10, - 10},{78,10},{78,-118}}, color={0,0,127})); - connect(and3.y, swiPumPri.u2) annotation (Line(points={{10,-62},{10,-100},{ - -50,-100},{-50,-118}}, color={255,0,255})); + connect(conPI_pumSec.y, swiPumPri.u1) annotation (Line(points={{-70,59},{-70,10}, + {-42,10},{-42,-118}}, color={0,0,127})); + connect(conPI_valCha.y, swiValCha.u1) annotation (Line(points={{-10,57},{-10,10}, + {78,10},{78,-118}}, color={0,0,127})); + connect(and3.y, swiPumPri.u2) annotation (Line(points={{10,-62},{10,-100},{-50, + -100},{-50,-118}}, color={255,0,255})); + connect(booToReaValDis.y, yValDis) + annotation (Line(points={{10,-142},{10,-170}}, color={0,0,127})); + connect(and3.y, booToReaValDis.u) annotation (Line(points={{10,-62},{10,-90},{ + 10,-90},{10,-118}}, color={255,0,255})); annotation (Diagram(coordinateSystem(extent={{-100,-160},{100,100}})), Icon( coordinateSystem(extent={{-100,-100},{100,100}})), Documentation(revisions=" From 2be027b8ac3519e2d3edd6d96e0f7f1a2bef8c90 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Mon, 14 Mar 2022 16:08:37 -0700 Subject: [PATCH 064/463] renamed signals --- .../BaseClasses/ReversiblePumpValveControl.mo | 32 ++++++------- .../Fluid/Storage/Plant/ChillerAndTank.mo | 47 +++++++++---------- .../Plant/Examples/OneSourceOneUser.mo | 4 +- .../Plant/Examples/TwoSourcesThreeUsers.mo | 12 ++--- .../ChillerAndTankNoRemoteCharging.mo | 2 +- .../ChillerAndTankWithRemoteCharging.mo | 15 +++--- 6 files changed, 55 insertions(+), 57 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo index 4baa2050f7f..76f703b911a 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo @@ -24,7 +24,7 @@ block ReversiblePumpValveControl "Flow direction: true = normal; false = reverse" annotation (Placement( transformation(extent={{-120,-10},{-100,10}}), iconTransformation( extent={{-140,-60},{-100,-20}}))); - Modelica.Blocks.Interfaces.RealInput us_mTan_flow + Modelica.Blocks.Interfaces.RealInput mTanSet_flow "Tank mass flow rate setpoint" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, @@ -40,10 +40,10 @@ block ReversiblePumpValveControl extent={{-10,-10},{10,10}}, rotation=0, origin={-110,80}))); - Buildings.Controls.OBC.CDL.Interfaces.BooleanInput booOnOff - "Plant output: true = on; false = off" annotation (Placement( - transformation(extent={{-120,-30},{-100,-10}}), iconTransformation( - extent={{-140,-100},{-100,-60}}))); + Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uOnl + "= true if plant is online (either outputting CHW to the network or being charged remotely)" + annotation (Placement(transformation(extent={{-120,-30},{-100,-10}}), + iconTransformation(extent={{-140,-100},{-100,-60}}))); Modelica.Blocks.Interfaces.RealOutput yPumSec "Normalised speed" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, @@ -84,8 +84,8 @@ block ReversiblePumpValveControl extent={{10,-10},{-10,10}}, rotation=0, origin={110,80}))); - Buildings.Controls.OBC.CDL.Continuous.LessThreshold lesThrValDis(t=0.05) - "Actual valve position less than a threshold" + Buildings.Controls.OBC.CDL.Continuous.LessThreshold isValDisClo(t=0.05) + "= true if valve closed" annotation (Placement(transformation(extent={{80,20},{60,40}}))); Buildings.Controls.OBC.CDL.Continuous.Switch swiPumPri "Switch: true = on (y>0); false = off (y=0)." annotation (Placement( @@ -111,8 +111,8 @@ block ReversiblePumpValveControl extent={{-10,-10},{10,10}}, rotation=-90, origin={10,-50}))); - Buildings.Controls.OBC.CDL.Continuous.LessThreshold lesThrValCha(t=0.05) - "Actual valve position less than a threshold" + Buildings.Controls.OBC.CDL.Continuous.LessThreshold isValChaClo(t=0.05) + "= true if valve closed" annotation (Placement(transformation(extent={{80,60},{60,80}}))); Buildings.Controls.OBC.CDL.Logical.Not notFloDirValCha "Reverses flow direction signal" annotation (Placement(transformation( @@ -126,9 +126,9 @@ block ReversiblePumpValveControl origin={60,-50}))); equation - connect(conPI_pumSec.u_s, us_mTan_flow) + connect(conPI_pumSec.u_s,mTanSet_flow) annotation (Line(points={{-70,82},{-70,110}}, color={0,0,127})); - connect(conPI_valCha.u_s, us_mTan_flow) annotation (Line(points={{-10,80},{-10, + connect(conPI_valCha.u_s,mTanSet_flow) annotation (Line(points={{-10,80},{-10, 88},{-70,88},{-70,110}}, color={0,0,127})); connect(conPI_valCha.u_m, um_mTan_flow) annotation (Line(points={{2,68},{10,68},{10,110}}, color={0,0,127})); @@ -144,21 +144,21 @@ equation annotation (Line(points={{70,-142},{70,-170}}, color={0,0,127})); connect(zero.y, swiValCha.u3) annotation (Line(points={{-79,-110},{62,-110},{62, -118}}, color={0,0,127})); - connect(booOnOff, and3.u3) + connect(uOnl, and3.u3) annotation (Line(points={{-110,-20},{2,-20},{2,-38}}, color={255,0,255})); connect(booFloDir, and3.u2) annotation (Line(points={{-110,0},{10,0},{10,-38}}, color={255,0,255})); - connect(lesThrValCha.u, yValCha_actual) + connect(isValChaClo.u, yValCha_actual) annotation (Line(points={{82,70},{110,70}}, color={0,0,127})); - connect(lesThrValCha.y, and3.u1) + connect(isValChaClo.y, and3.u1) annotation (Line(points={{58,70},{18,70},{18,-38}}, color={255,0,255})); - connect(lesThrValDis.u, yValDis_actual) + connect(isValDisClo.u, yValDis_actual) annotation (Line(points={{82,30},{110,30}}, color={0,0,127})); connect(notFloDirValCha.u, booFloDir) annotation (Line(points={{60,-4},{60,0},{-110,0}}, color={255,0,255})); connect(notFloDirValCha.y, andValCha.u1) annotation (Line(points={{60,-28},{60,-38}}, color={255,0,255})); - connect(lesThrValDis.y, andValCha.u2) annotation (Line(points={{58,30},{46,30}, + connect(isValDisClo.y, andValCha.u2) annotation (Line(points={{58,30},{46,30}, {46,-32},{52,-32},{52,-38}}, color={255,0,255})); connect(andValCha.y, swiValCha.u2) annotation (Line(points={{60,-62},{60,-70}, {70,-70},{70,-118}}, color={255,0,255})); diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo index c75d518861e..875386aeb2e 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo @@ -51,7 +51,7 @@ model ChillerAndTank extent={{10,-10},{-10,10}}, rotation=-90, origin={-80,-80}))); - Modelica.Blocks.Interfaces.RealInput set_mPumPri_flow + Modelica.Blocks.Interfaces.RealInput mPumPriSet_flow "Primary pump mass flow rate setpoint" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, @@ -97,21 +97,21 @@ model ChillerAndTank Buildings.Fluid.Storage.Plant.BaseClasses.ReversiblePumpValveControl conPumSecGro if allowRemoteCharging "Control block for secondary pump-valve group" annotation (Placement(transformation(extent={{80,80},{60,102}}))); - Buildings.Controls.OBC.CDL.Interfaces.BooleanInput booOnOff - if allowRemoteCharging "Plant status: true = on; false = off" - annotation (Placement( - transformation(extent={{120,70},{100,90}}), + Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uOnl if + allowRemoteCharging + "= true if plant is online (either outputting CHW to the network or being charged remotely)" + annotation (Placement(transformation(extent={{120,70},{100,90}}), iconTransformation(extent={{-140,-120},{-100,-80}}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanInput booFloDir if allowRemoteCharging "Flow direction: true = normal; false = reverse" annotation (Placement( transformation(extent={{120,90},{100,110}}), iconTransformation( extent={{-140,-40},{-100,0}}))); - Modelica.Blocks.Interfaces.RealInput set_mTan_flow if allowRemoteCharging + Modelica.Blocks.Interfaces.RealInput mTanSet_flow if allowRemoteCharging "Tank mass flow rate setpoint" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={80,130}), iconTransformation( + origin={80,130}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-110,20}))); @@ -137,9 +137,9 @@ model ChillerAndTank annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=-90, origin={-10,90}))); - Modelica.Blocks.Sources.Constant conZero(k=0) if allowRemoteCharging - "Constant y = 0" - annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + Modelica.Blocks.Sources.Constant zero(k=0) if allowRemoteCharging + "Constant y = 0" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=90, origin={-50,90}))); Buildings.Fluid.Storage.Plant.BaseClasses.FluidPassThrough pasValDis( @@ -215,21 +215,20 @@ model ChillerAndTank equation connect(conPumSecGro.yValDis, valDis.y) annotation (Line(points={{66,78.9},{ 66,56},{20,56},{20,2}}, color={0,0,127})); - connect(conPumSecGro.us_mTan_flow, set_mTan_flow) annotation (Line(points={{ - 81,95.4},{90,95.4},{90,118},{80,118},{80,130}}, color={0,0,127})); + connect(conPumSecGro.mTanSet_flow, mTanSet_flow) annotation (Line(points={{81, + 95.4},{90,95.4},{90,118},{80,118},{80,130}}, color={0,0,127})); connect(pumSec.y, conPumSecGro.yPumSec) annotation (Line(points={{80,-8},{80, 20},{70,20},{70,78.9}}, color={0,0,127})); connect(swiFloDirPum1.u2, booFloDir) annotation (Line(points={{-10,102},{-10,112}, {96,112},{96,100},{110,100}}, color={255,0,255})); - connect(swiFloDirPum1.u1, set_mPumPri_flow) annotation (Line(points={{-2,102}, + connect(swiFloDirPum1.u1, mPumPriSet_flow) annotation (Line(points={{-2,102}, {-2,108},{40,108},{40,130}}, color={0,0,127})); connect(pumPri.m_flow_in, swiFloDirPum1.y) annotation (Line(points={{-20,-20}, {-20,72},{-10,72},{-10,78}}, color={0,0,127})); - connect(conZero.y,swiFloDirPum1. u3) annotation (Line(points={{-50,101},{-50,108}, - {-18,108},{-18,102}}, - color={0,0,127})); - connect(pasSwiFloDirPum1.u, set_mPumPri_flow) annotation (Line(points={{28, - 102},{28,108},{40,108},{40,130}}, color={0,0,127})); + connect(zero.y, swiFloDirPum1.u3) annotation (Line(points={{-50,101},{-50,108}, + {-18,108},{-18,102}}, color={0,0,127})); + connect(pasSwiFloDirPum1.u, mPumPriSet_flow) annotation (Line(points={{28,102}, + {28,108},{40,108},{40,130}}, color={0,0,127})); connect(pasSwiFloDirPum1.y, pumPri.m_flow_in) annotation (Line(points={{28,79}, {28,72},{-20,72},{-20,-20}}, color={0,0,127})); connect(pumSec.y, yPumSec) @@ -238,8 +237,8 @@ equation annotation (Line(points={{90,-20},{90,-60},{100,-60}}, color={0,127,255})); connect(valCha.port_b, port_a2) annotation (Line(points={{30,-70},{90,-70},{90, -60},{100,-60}}, color={0,127,255})); - connect(conPumSecGro.booOnOff, booOnOff) annotation (Line(points={{82,82.2},{ - 82,82},{96,82},{96,80},{110,80}}, color={255,0,255})); + connect(conPumSecGro.uOnl, uOnl) annotation (Line(points={{82,82.2},{82,82},{ + 96,82},{96,80},{110,80}}, color={255,0,255})); connect(conPumSecGro.booFloDir, booFloDir) annotation (Line(points={{82,86.6}, {82,86},{96,86},{96,100},{110,100}}, color={255,0,255})); connect(pumPri.port_b, chi.port_a2) @@ -254,8 +253,8 @@ equation 60},{-100,60}}, color={0,127,255})); connect(chi.port_b1, port_b1) annotation (Line(points={{-40,16},{-32,16},{-32, 60},{100,60}}, color={0,127,255})); - connect(valDis.y_actual, conPumSecGro.yValDis_actual) annotation (Line(points - ={{15,-3},{14,-3},{14,68},{46,68},{46,99.8},{59,99.8}}, color={0,0,127})); + connect(valDis.y_actual, conPumSecGro.yValDis_actual) annotation (Line(points= + {{15,-3},{14,-3},{14,68},{46,68},{46,99.8},{59,99.8}}, color={0,0,127})); connect(sen_m_flow.m_flow, mTan_flow) annotation (Line(points={{-20,-59},{-20, -56},{0,-56},{0,-110}}, color={0,0,127})); connect(sen_m_flow.m_flow, conPumSecGro.um_mTan_flow) annotation (Line(points= @@ -288,8 +287,8 @@ equation {34,-10},{34,-20},{40,-20}}, color={0,127,255})); connect(conPumSecGro.yValCha, valCha.y) annotation (Line(points={{62,78.9},{ 62,4},{94,4},{94,-44},{20,-44},{20,-58}}, color={0,0,127})); - connect(conPumSecGro.yValCha_actual, valCha.y_actual) annotation (Line(points - ={{59,95.4},{54,95.4},{54,96},{48,96},{48,6},{96,6},{96,-46},{60,-46},{ + connect(conPumSecGro.yValCha_actual, valCha.y_actual) annotation (Line(points= + {{59,95.4},{54,95.4},{54,96},{48,96},{48,6},{96,6},{96,-46},{60,-46},{ 60,-63},{25,-63}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,100}}), graphics={Line( diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo index ffbec75d18c..3a034891120 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo @@ -144,8 +144,8 @@ equation {-74,20},{-80,20}}, color={0,127,255})); connect(cat.port_a1, souCDW.ports[1]) annotation (Line(points={{-40,6},{-34,6}, {-34,20},{-30,20}}, color={0,127,255})); - connect(set_mChi_flow.y, cat.set_mPumPri_flow) annotation (Line(points={{-39, - -70},{-26,-70},{-26,10},{-39,10}}, color={0,0,127})); + connect(set_mChi_flow.y, cat.mPumPriSet_flow) annotation (Line(points={{-39,-70}, + {-26,-70},{-26,10},{-39,10}}, color={0,0,127})); annotation(__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos" "Simulate and plot"), experiment(Tolerance=1e-06, StopTime=3600), Documentation(info=" diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index f4f55c86d2f..437a8000811 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -309,10 +309,10 @@ equation 6},{86,-110},{62,-110}}, color={0,0,127})); connect(mulMax_yVal.y, hysCat.u) annotation (Line(points={{38,-110},{22,-110}}, color={0,0,127})); - connect(hysCat.y, cat.booOnOff) annotation (Line(points={{-2,-110},{-44,-110}, - {-44,-48},{-50,-48}}, color={255,0,255})); - connect(set_mChi2PumPri_flow.y, cat.set_mPumPri_flow) annotation (Line(points - ={{-119,-70},{-80,-70},{-80,-49},{-70,-49}}, color={0,0,127})); + connect(hysCat.y, cat.uOnl) annotation (Line(points={{-2,-110},{-44,-110},{-44, + -48},{-50,-48}}, color={255,0,255})); + connect(set_mChi2PumPri_flow.y, cat.mPumPriSet_flow) annotation (Line(points= + {{-119,-70},{-80,-70},{-80,-49},{-70,-49}}, color={0,0,127})); connect(set_dpUsr.y, conPI_PumChi1.u_s) annotation (Line(points={{-60,139},{-60,122}}, color={0,0,127})); connect(conPI_PumChi1.y, pumChi1.y) @@ -365,8 +365,8 @@ equation {-126,-30},{-126,-18},{-122,-18}}, color={0,0,127})); connect(booTanCha.y, swiTanCha.u2) annotation (Line(points={{-159,-10},{-122,-10}}, color={255,0,255})); - connect(swiTanCha.y, cat.set_mTan_flow) annotation (Line(points={{-98,-10},{-62, - -10},{-62,-49}}, color={0,0,127})); + connect(swiTanCha.y, cat.mTanSet_flow) + annotation (Line(points={{-98,-10},{-62,-10},{-62,-49}}, color={0,0,127})); connect(sinCDW2.ports[1], cat.port_b1) annotation (Line(points={{-90,-100},{-66, -100},{-66,-70}}, color={0,127,255})); connect(cat.port_a2, preDroU3S2.port_b) annotation (Line(points={{-54,-70},{-54, diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo index 5d145e7c11a..3f738a6a4fa 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo @@ -95,7 +95,7 @@ equation {2,70}}, color={0,0,127})); connect(set_mPumSec_flow.y, conPID_PumSec.u_s) annotation (Line(points={{-79,50},{-62,50}}, color={0,0,127})); - connect(set_mPumPri_flow.y, cat.set_mPumPri_flow) annotation (Line(points={{-59, + connect(set_mPumPri_flow.y, cat.mPumPriSet_flow) annotation (Line(points={{-59, 0},{-16,0},{-16,10},{-11,10}}, color={0,0,127})); connect(conPID_PumSec.y, cat.yPumSec) annotation (Line(points={{-39,50},{-8,50},{-8,11}}, color={0,0,127})); diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo index b0404a82752..9b4c8b28006 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo @@ -63,8 +63,8 @@ model ChillerAndTankWithRemoteCharging Modelica.Blocks.Sources.BooleanTable booFloDir(table={0,3600/7*6}) "Flow direction: True = normal; False = reverse" annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); - Modelica.Blocks.Sources.BooleanTable booOnOff(table={3600/7*2}) - "True = on; False = off" + Modelica.Blocks.Sources.BooleanTable uOnl(table={3600/7*2}) + "True = plant online (outputting CHW to the network); False = offline" annotation (Placement(transformation(extent={{-80,-80},{-60,-60}}))); Modelica.Blocks.Sources.TimeTable set_mChi_flow(table=[0,0; 3600/7,0; 3600/7, 1; 3600/7*5,1; 3600/7*5,0]) "Chiller flow rate setpoint" @@ -86,15 +86,14 @@ model ChillerAndTankWithRemoteCharging annotation (Placement(transformation(extent={{-80,20},{-60,40}}))); equation - connect(booOnOff.y, cat.booOnOff) annotation (Line(points={{-59,-70},{-10,-70}, - {-10,-10}}, color={255,0,255})); + connect(uOnl.y, cat.uOnl) annotation (Line(points={{-59,-70},{-10,-70},{-10,-10}}, + color={255,0,255})); connect(booFloDir.y,cat.booFloDir) annotation (Line(points={{-59,0},{-56,0}, {-56,-2},{-10,-2}}, color={255,0,255})); - connect(set_mTan_flow.y, cat.set_mTan_flow) - annotation (Line(points={{-59,60},{-14,60},{-14,2},{-9,2}}, - color={0,0,127})); - connect(set_mChi_flow.y, cat.set_mPumPri_flow) + connect(set_mTan_flow.y, cat.mTanSet_flow) annotation (Line(points={{-59,60}, + {-14,60},{-14,2},{-9,2}}, color={0,0,127})); + connect(set_mChi_flow.y, cat.mPumPriSet_flow) annotation (Line(points={{-59,90},{-9,90},{-9,10}}, color={0,0,127})); connect(cat.port_b2, sin.ports[1]) annotation (Line(points={{-8,-6},{-54,-6}, {-54,-30},{-60,-30}}, color={0,127,255})); From 2a61cbaac16c7f058adf8f2a9b44099c4d657803 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Tue, 15 Mar 2022 07:50:17 -0700 Subject: [PATCH 065/463] changed description of constant sources --- .../Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo | 2 +- Buildings/Fluid/Storage/Plant/ChillerAndTank.mo | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo index 76f703b911a..55a9dc792e7 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo @@ -3,7 +3,7 @@ block ReversiblePumpValveControl "Control block for the secondary pump-valve group" extends Modelica.Blocks.Icons.Block; - Modelica.Blocks.Sources.Constant zero(k=0) "Constant y = 0" + Modelica.Blocks.Sources.Constant zero(k=0) "Constant 0" annotation (Placement(transformation(extent={{-100,-120},{-80,-100}}))); Buildings.Controls.Continuous.LimPID conPI_pumSec( controllerType=Modelica.Blocks.Types.SimpleController.PI, diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo index 875386aeb2e..231ac72d6fe 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo @@ -97,8 +97,8 @@ model ChillerAndTank Buildings.Fluid.Storage.Plant.BaseClasses.ReversiblePumpValveControl conPumSecGro if allowRemoteCharging "Control block for secondary pump-valve group" annotation (Placement(transformation(extent={{80,80},{60,102}}))); - Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uOnl if - allowRemoteCharging + Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uOnl + if allowRemoteCharging "= true if plant is online (either outputting CHW to the network or being charged remotely)" annotation (Placement(transformation(extent={{120,70},{100,90}}), iconTransformation(extent={{-140,-120},{-100,-80}}))); @@ -138,7 +138,7 @@ model ChillerAndTank rotation=-90, origin={-10,90}))); Modelica.Blocks.Sources.Constant zero(k=0) if allowRemoteCharging - "Constant y = 0" annotation (Placement(transformation( + "Constant 0" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=90, origin={-50,90}))); From aff111ff03a5aff9ccfcd3eee412b184d3f9e6c6 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Tue, 15 Mar 2022 08:08:14 -0700 Subject: [PATCH 066/463] renamed variables --- .../BaseClasses/ReversiblePumpValveControl.mo | 20 +++++++++---------- .../Fluid/Storage/Plant/ChillerAndTank.mo | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo index 55a9dc792e7..efa4d33c998 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo @@ -32,14 +32,14 @@ block ReversiblePumpValveControl extent={{-10,-10},{10,10}}, rotation=0, origin={-110,40}))); - Modelica.Blocks.Interfaces.RealInput um_mTan_flow - "Measured tank mass flow rate" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={10,110}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-110,80}))); + Modelica.Blocks.Interfaces.RealInput mTan_flow "Measured tank mass flow rate" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={10,110}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-110,80}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uOnl "= true if plant is online (either outputting CHW to the network or being charged remotely)" annotation (Placement(transformation(extent={{-120,-30},{-100,-10}}), @@ -130,9 +130,9 @@ equation annotation (Line(points={{-70,82},{-70,110}}, color={0,0,127})); connect(conPI_valCha.u_s,mTanSet_flow) annotation (Line(points={{-10,80},{-10, 88},{-70,88},{-70,110}}, color={0,0,127})); - connect(conPI_valCha.u_m, um_mTan_flow) + connect(conPI_valCha.u_m, mTan_flow) annotation (Line(points={{2,68},{10,68},{10,110}}, color={0,0,127})); - connect(conPI_pumSec.u_m, um_mTan_flow) annotation (Line(points={{-58,70},{-52, + connect(conPI_pumSec.u_m, mTan_flow) annotation (Line(points={{-58,70},{-52, 70},{-52,94},{10,94},{10,110}}, color={0,0,127})); connect(yValDis, yValDis) annotation (Line(points={{10,-170},{10,-170}}, color={0,0,127})); diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo index 231ac72d6fe..bee1744c79b 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo @@ -257,8 +257,8 @@ equation {{15,-3},{14,-3},{14,68},{46,68},{46,99.8},{59,99.8}}, color={0,0,127})); connect(sen_m_flow.m_flow, mTan_flow) annotation (Line(points={{-20,-59},{-20, -56},{0,-56},{0,-110}}, color={0,0,127})); - connect(sen_m_flow.m_flow, conPumSecGro.um_mTan_flow) annotation (Line(points= - {{-20,-59},{-20,-56},{0,-56},{0,70},{44,70},{44,108},{88,108},{88,99.8}, + connect(sen_m_flow.m_flow, conPumSecGro.mTan_flow) annotation (Line(points={{ + -20,-59},{-20,-56},{0,-56},{0,70},{44,70},{44,108},{88,108},{88,99.8}, {81,99.8}}, color={0,0,127})); connect(preDroTan.port_a, tan.port_b) annotation (Line(points={{-80,-90},{-80, -92},{-66,-92},{-66,-70},{-60,-70}}, color={0,127,255})); From 84a647c4d2ab6ce5b98c12458cb6416926bdf9e1 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Tue, 15 Mar 2022 08:28:18 -0700 Subject: [PATCH 067/463] removed unnecessary gain block in DummyUser --- .../Plant/Examples/BaseClasses/DummyUser.mo | 27 +++++++------------ 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo index 8920dfebfbd..af8e0b49f79 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo @@ -22,7 +22,7 @@ model DummyUser "Dummy user model" dpValve_nominal=0.1*dp_nominal, m_flow_nominal=m_flow_nominal, y_start=0) "User control valve" - annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow heaCon "Prescribed heat flow" annotation (Placement(transformation(extent={{22,70},{42,90}}))); @@ -57,12 +57,7 @@ model DummyUser "Dummy user model" reverseActing=false) "PI controller" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-50,60}))); - Modelica.Blocks.Math.Gain gain(k=1) "Gain" annotation (Placement( - transformation( - extent={{10,-10},{-10,10}}, - rotation=180, - origin={-10,60}))); + origin={-70,40}))); Modelica.Blocks.Interfaces.RealInput QCooLoa_flow "Cooling load of the consumer" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -75,7 +70,7 @@ model DummyUser "Dummy user model" Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-110,60}), iconTransformation( + origin={-110,40}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-110,40}))); @@ -101,7 +96,7 @@ model DummyUser "Dummy user model" origin={-20,110}))); equation connect(val.port_b, vol.ports[1]) - annotation (Line(points={{-60,0},{1,0}}, color={0,127,255})); + annotation (Line(points={{-30,0},{0,0}}, color={0,127,255})); connect(heaCon.port, vol.heatPort) annotation (Line(points={{42,80},{54,80},{54,-10},{10,-10}}, color={191,0,0})); @@ -110,22 +105,18 @@ equation color={191,0,0})); connect(preDro.port_a, vol.ports[2]) annotation (Line(points={{60,0},{-1,0}}, color={0,127,255})); - connect(conPI.y, gain.u) - annotation (Line(points={{-39,60},{-22,60}}, color={0,0,127})); - connect(gain.y, val.y) annotation (Line(points={{1,60},{6,60},{6,18},{-70,18}, - {-70,12}}, color={0,0,127})); connect(TUsr.T, conPI.u_m) - annotation (Line(points={{19,-30},{-50,-30},{-50,48}}, color={0,0,127})); + annotation (Line(points={{19,-30},{-70,-30},{-70,28}}, color={0,0,127})); connect(heaCon.Q_flow, QCooLoa_flow) annotation (Line(points={{22,80},{-110,80}}, color={0,0,127})); connect(conPI.u_s, TSet) - annotation (Line(points={{-62,60},{-110,60}}, color={0,0,127})); + annotation (Line(points={{-82,40},{-110,40}}, color={0,0,127})); connect(dpSen.p_rel, dpUsr) annotation (Line(points={{0,-59},{0,-80},{110,-80}}, color={0,0,127})); connect(val.y_actual, yVal_actual) - annotation (Line(points={{-65,7},{-65,40},{110,40}}, color={0,0,127})); + annotation (Line(points={{-35,7},{-35,40},{110,40}}, color={0,0,127})); connect(val.port_a, port_a) - annotation (Line(points={{-80,0},{-100,0}}, color={0,127,255})); + annotation (Line(points={{-50,0},{-100,0}}, color={0,127,255})); connect(dpSen.port_a, port_a) annotation (Line( points={{-10,-50},{-100,-50},{-100,0}}, color={0,127,255}, @@ -136,6 +127,8 @@ equation points={{10,-50},{100,-50},{100,0}}, color={0,127,255}, pattern=LinePattern.Dash)); + connect(conPI.y, val.y) + annotation (Line(points={{-59,40},{-40,40},{-40,12}}, color={0,0,127})); annotation (Icon(graphics={Ellipse( extent={{-100,100},{100,-100}}, lineColor={28,108,200}, From 3b78e690e8b74c02fd622a2fb8550f758a5437f7 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Tue, 15 Mar 2022 09:11:32 -0700 Subject: [PATCH 068/463] renamed booFloDir to uRemCha and refactored models Because "normal flow direction" implies "NOT remote charging", this change reverses the boolean signal. --- .../BaseClasses/ReversiblePumpValveControl.mo | 81 ++++++++++--------- .../Fluid/Storage/Plant/ChillerAndTank.mo | 65 ++++++++------- .../Plant/Examples/TwoSourcesThreeUsers.mo | 10 +-- .../ChillerAndTankWithRemoteCharging.mo | 9 +-- 4 files changed, 89 insertions(+), 76 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo index efa4d33c998..2981fa52c07 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo @@ -11,7 +11,7 @@ block ReversiblePumpValveControl Ti=50) "PI controller" annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=270, - origin={-70,70}))); + origin={-70,50}))); Buildings.Controls.Continuous.LimPID conPI_valCha( controllerType=Modelica.Blocks.Types.SimpleController.PI, k=5, @@ -19,11 +19,11 @@ block ReversiblePumpValveControl reverseActing=false) "PI controller" annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=270, - origin={-10,68}))); - Buildings.Controls.OBC.CDL.Interfaces.BooleanInput booFloDir - "Flow direction: true = normal; false = reverse" annotation (Placement( - transformation(extent={{-120,-10},{-100,10}}), iconTransformation( - extent={{-140,-60},{-100,-20}}))); + origin={-10,50}))); + Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uRemCha + "Tank is being charged remotely" annotation (Placement(transformation( + extent={{-120,-10},{-100,10}}), iconTransformation(extent={{-140,-60}, + {-100,-20}}))); Modelica.Blocks.Interfaces.RealInput mTanSet_flow "Tank mass flow rate setpoint" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -110,30 +110,31 @@ block ReversiblePumpValveControl transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={10,-50}))); + origin={10,-70}))); Buildings.Controls.OBC.CDL.Continuous.LessThreshold isValChaClo(t=0.05) "= true if valve closed" annotation (Placement(transformation(extent={{80,60},{60,80}}))); - Buildings.Controls.OBC.CDL.Logical.Not notFloDirValCha - "Reverses flow direction signal" annotation (Placement(transformation( + Buildings.Controls.OBC.CDL.Logical.Not notRemCha + "Tank is not being charged remotely" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={60,-16}))); + origin={10,-30}))); Buildings.Controls.OBC.CDL.Logical.And andValCha "Reverse direction AND valDis closed" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={60,-50}))); + origin={60,-70}))); equation connect(conPI_pumSec.u_s,mTanSet_flow) - annotation (Line(points={{-70,82},{-70,110}}, color={0,0,127})); - connect(conPI_valCha.u_s,mTanSet_flow) annotation (Line(points={{-10,80},{-10, - 88},{-70,88},{-70,110}}, color={0,0,127})); + annotation (Line(points={{-70,62},{-70,110}}, color={0,0,127})); + connect(conPI_valCha.u_s,mTanSet_flow) annotation (Line(points={{-10,62},{ + -10,90},{-70,90},{-70,110}}, + color={0,0,127})); connect(conPI_valCha.u_m, mTan_flow) - annotation (Line(points={{2,68},{10,68},{10,110}}, color={0,0,127})); - connect(conPI_pumSec.u_m, mTan_flow) annotation (Line(points={{-58,70},{-52, - 70},{-52,94},{10,94},{10,110}}, color={0,0,127})); + annotation (Line(points={{2,50},{10,50},{10,110}}, color={0,0,127})); + connect(conPI_pumSec.u_m, mTan_flow) annotation (Line(points={{-58,50},{-42, + 50},{-42,80},{10,80},{10,110}}, color={0,0,127})); connect(yValDis, yValDis) annotation (Line(points={{10,-170},{10,-170}}, color={0,0,127})); connect(swiPumPri.y, yPumSec) @@ -145,33 +146,39 @@ equation connect(zero.y, swiValCha.u3) annotation (Line(points={{-79,-110},{62,-110},{62, -118}}, color={0,0,127})); connect(uOnl, and3.u3) - annotation (Line(points={{-110,-20},{2,-20},{2,-38}}, color={255,0,255})); - connect(booFloDir, and3.u2) - annotation (Line(points={{-110,0},{10,0},{10,-38}}, color={255,0,255})); + annotation (Line(points={{-110,-20},{-20,-20},{-20,-50},{2,-50},{2,-58}}, + color={255,0,255})); connect(isValChaClo.u, yValCha_actual) annotation (Line(points={{82,70},{110,70}}, color={0,0,127})); connect(isValChaClo.y, and3.u1) - annotation (Line(points={{58,70},{18,70},{18,-38}}, color={255,0,255})); + annotation (Line(points={{58,70},{40,70},{40,-50},{18,-50},{18,-58}}, + color={255,0,255})); connect(isValDisClo.u, yValDis_actual) annotation (Line(points={{82,30},{110,30}}, color={0,0,127})); - connect(notFloDirValCha.u, booFloDir) - annotation (Line(points={{60,-4},{60,0},{-110,0}}, color={255,0,255})); - connect(notFloDirValCha.y, andValCha.u1) - annotation (Line(points={{60,-28},{60,-38}}, color={255,0,255})); - connect(isValDisClo.y, andValCha.u2) annotation (Line(points={{58,30},{46,30}, - {46,-32},{52,-32},{52,-38}}, color={255,0,255})); - connect(andValCha.y, swiValCha.u2) annotation (Line(points={{60,-62},{60,-70}, - {70,-70},{70,-118}}, color={255,0,255})); - connect(conPI_pumSec.y, swiPumPri.u1) annotation (Line(points={{-70,59},{-70,10}, - {-42,10},{-42,-118}}, color={0,0,127})); - connect(conPI_valCha.y, swiValCha.u1) annotation (Line(points={{-10,57},{-10,10}, - {78,10},{78,-118}}, color={0,0,127})); - connect(and3.y, swiPumPri.u2) annotation (Line(points={{10,-62},{10,-100},{-50, - -100},{-50,-118}}, color={255,0,255})); + connect(isValDisClo.y, andValCha.u2) annotation (Line(points={{58,30},{52,30}, + {52,-58}}, color={255,0,255})); + connect(andValCha.y, swiValCha.u2) annotation (Line(points={{60,-82},{60,-100}, + {70,-100},{70,-118}},color={255,0,255})); + connect(conPI_pumSec.y, swiPumPri.u1) annotation (Line(points={{-70,39},{-70, + 10},{-42,10},{-42,-118}}, + color={0,0,127})); + connect(conPI_valCha.y, swiValCha.u1) annotation (Line(points={{-10,39},{-10, + 10},{78,10},{78,-118}}, + color={0,0,127})); + connect(and3.y, swiPumPri.u2) annotation (Line(points={{10,-82},{10,-100},{ + -50,-100},{-50,-118}}, + color={255,0,255})); connect(booToReaValDis.y, yValDis) annotation (Line(points={{10,-142},{10,-170}}, color={0,0,127})); - connect(and3.y, booToReaValDis.u) annotation (Line(points={{10,-62},{10,-90},{ - 10,-90},{10,-118}}, color={255,0,255})); + connect(and3.y, booToReaValDis.u) annotation (Line(points={{10,-82},{10,-100}, + {10,-100},{10,-118}}, + color={255,0,255})); + connect(uRemCha, notRemCha.u) + annotation (Line(points={{-110,0},{10,0},{10,-18}}, color={255,0,255})); + connect(notRemCha.y, and3.u2) + annotation (Line(points={{10,-42},{10,-58}}, color={255,0,255})); + connect(andValCha.u1, uRemCha) + annotation (Line(points={{60,-58},{60,0},{-110,0}}, color={255,0,255})); annotation (Diagram(coordinateSystem(extent={{-100,-160},{100,100}})), Icon( coordinateSystem(extent={{-100,-100},{100,100}})), Documentation(revisions=" diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo index bee1744c79b..efae80eaaae 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo @@ -55,7 +55,7 @@ model ChillerAndTank "Primary pump mass flow rate setpoint" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={40,130}), iconTransformation( + origin={40,150}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-110,100}))); @@ -102,16 +102,21 @@ model ChillerAndTank "= true if plant is online (either outputting CHW to the network or being charged remotely)" annotation (Placement(transformation(extent={{120,70},{100,90}}), iconTransformation(extent={{-140,-120},{-100,-80}}))); - Buildings.Controls.OBC.CDL.Interfaces.BooleanInput booFloDir - if allowRemoteCharging - "Flow direction: true = normal; false = reverse" annotation (Placement( - transformation(extent={{120,90},{100,110}}), iconTransformation( + Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uRemCha + if allowRemoteCharging "Tank is being charged remotely" annotation ( + Placement(transformation(extent={{120,90},{100,110}}), iconTransformation( extent={{-140,-40},{-100,0}}))); + Buildings.Controls.OBC.CDL.Logical.Not notRemCha if allowRemoteCharging + "Tank is not being charged remotely" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={10,130}))); Modelica.Blocks.Interfaces.RealInput mTanSet_flow if allowRemoteCharging "Tank mass flow rate setpoint" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={80,130}), iconTransformation( + origin={80,150}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-110,20}))); @@ -136,7 +141,7 @@ model ChillerAndTank if allowRemoteCharging "Switches off pum1 when tank charged remotely" annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=-90, - origin={-10,90}))); + origin={-20,90}))); Modelica.Blocks.Sources.Constant zero(k=0) if allowRemoteCharging "Constant 0" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -152,7 +157,7 @@ model ChillerAndTank Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={28,90}))); + origin={10,90}))); Modelica.Blocks.Interfaces.RealInput yPumSec if not allowRemoteCharging "Secondary pump speed input" annotation (Placement(transformation(extent={{ 120,10},{100,30}}), iconTransformation( @@ -215,22 +220,20 @@ model ChillerAndTank equation connect(conPumSecGro.yValDis, valDis.y) annotation (Line(points={{66,78.9},{ 66,56},{20,56},{20,2}}, color={0,0,127})); - connect(conPumSecGro.mTanSet_flow, mTanSet_flow) annotation (Line(points={{81, - 95.4},{90,95.4},{90,118},{80,118},{80,130}}, color={0,0,127})); + connect(conPumSecGro.mTanSet_flow, mTanSet_flow) annotation (Line(points={{81,95.4}, + {90,95.4},{90,138},{80,138},{80,150}}, color={0,0,127})); connect(pumSec.y, conPumSecGro.yPumSec) annotation (Line(points={{80,-8},{80, 20},{70,20},{70,78.9}}, color={0,0,127})); - connect(swiFloDirPum1.u2, booFloDir) annotation (Line(points={{-10,102},{-10,112}, - {96,112},{96,100},{110,100}}, color={255,0,255})); - connect(swiFloDirPum1.u1, mPumPriSet_flow) annotation (Line(points={{-2,102}, - {-2,108},{40,108},{40,130}}, color={0,0,127})); + connect(swiFloDirPum1.u1, mPumPriSet_flow) annotation (Line(points={{-12,102}, + {-12,108},{40,108},{40,150}},color={0,0,127})); connect(pumPri.m_flow_in, swiFloDirPum1.y) annotation (Line(points={{-20,-20}, - {-20,72},{-10,72},{-10,78}}, color={0,0,127})); - connect(zero.y, swiFloDirPum1.u3) annotation (Line(points={{-50,101},{-50,108}, - {-18,108},{-18,102}}, color={0,0,127})); - connect(pasSwiFloDirPum1.u, mPumPriSet_flow) annotation (Line(points={{28,102}, - {28,108},{40,108},{40,130}}, color={0,0,127})); - connect(pasSwiFloDirPum1.y, pumPri.m_flow_in) annotation (Line(points={{28,79}, - {28,72},{-20,72},{-20,-20}}, color={0,0,127})); + {-20,78}}, color={0,0,127})); + connect(zero.y, swiFloDirPum1.u3) annotation (Line(points={{-50,101},{-50,106}, + {-28,106},{-28,102}}, color={0,0,127})); + connect(pasSwiFloDirPum1.u, mPumPriSet_flow) annotation (Line(points={{10,102}, + {10,108},{40,108},{40,150}}, color={0,0,127})); + connect(pasSwiFloDirPum1.y, pumPri.m_flow_in) annotation (Line(points={{10,79}, + {10,72},{-20,72},{-20,-20}}, color={0,0,127})); connect(pumSec.y, yPumSec) annotation (Line(points={{80,-8},{80,20},{110,20}}, color={0,0,127})); connect(pumSec.port_a, port_a2) @@ -239,12 +242,10 @@ equation -60},{100,-60}}, color={0,127,255})); connect(conPumSecGro.uOnl, uOnl) annotation (Line(points={{82,82.2},{82,82},{ 96,82},{96,80},{110,80}}, color={255,0,255})); - connect(conPumSecGro.booFloDir, booFloDir) annotation (Line(points={{82,86.6}, - {82,86},{96,86},{96,100},{110,100}}, color={255,0,255})); + connect(conPumSecGro.uRemCha, uRemCha) annotation (Line(points={{82,86.6},{82, + 86},{96,86},{96,100},{110,100}}, color={255,0,255})); connect(pumPri.port_b, chi.port_a2) annotation (Line(points={{-30,-32},{-40,-32},{-40,4}}, color={0,127,255})); - connect(chi.on, booFloDir) annotation (Line(points={{-62,13},{-62,12},{-72,12}, - {-72,112},{96,112},{96,100},{110,100}}, color={255,0,255})); connect(onChi.y, chi.on) annotation (Line(points={{-78,40},{-72,40},{-72,13}, {-62,13}},color={255,0,255})); connect(set_TEvaLvg.y, chi.TSet) annotation (Line(points={{-79,10},{-79,7},{ @@ -257,9 +258,9 @@ equation {{15,-3},{14,-3},{14,68},{46,68},{46,99.8},{59,99.8}}, color={0,0,127})); connect(sen_m_flow.m_flow, mTan_flow) annotation (Line(points={{-20,-59},{-20, -56},{0,-56},{0,-110}}, color={0,0,127})); - connect(sen_m_flow.m_flow, conPumSecGro.mTan_flow) annotation (Line(points={{ - -20,-59},{-20,-56},{0,-56},{0,70},{44,70},{44,108},{88,108},{88,99.8}, - {81,99.8}}, color={0,0,127})); + connect(sen_m_flow.m_flow, conPumSecGro.mTan_flow) annotation (Line(points={{-20, + -59},{-20,-56},{0,-56},{0,70},{44,70},{44,108},{88,108},{88,99.8},{81, + 99.8}}, color={0,0,127})); connect(preDroTan.port_a, tan.port_b) annotation (Line(points={{-80,-90},{-80, -92},{-66,-92},{-66,-70},{-60,-70}}, color={0,127,255})); connect(sen_m_flow.port_b, tan.port_a) @@ -290,6 +291,12 @@ equation connect(conPumSecGro.yValCha_actual, valCha.y_actual) annotation (Line(points= {{59,95.4},{54,95.4},{54,96},{48,96},{48,6},{96,6},{96,-46},{60,-46},{ 60,-63},{25,-63}}, color={0,0,127})); + connect(notRemCha.u, uRemCha) annotation (Line(points={{22,130},{96,130},{96,100}, + {110,100}}, color={255,0,255})); + connect(notRemCha.y, swiFloDirPum1.u2) annotation (Line(points={{-2,130},{-20, + 130},{-20,102}}, color={255,0,255})); + connect(chi.on, notRemCha.y) annotation (Line(points={{-62,13},{-62,12},{-72,12}, + {-72,130},{-2,130}}, color={255,0,255})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,100}}), graphics={Line( points={{-30,-110},{30,-110}}, @@ -324,7 +331,7 @@ equation pattern=LinePattern.None), Line(points={{16,74},{-20,66}},color={0,0,0}), Line(points={{-20,54},{14,44}},color={0,0,0})}), Diagram( - coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,120}})), + coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,140}})), Documentation(info="

    This plant model has a chiller and a stratified tank. diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index 437a8000811..5805490e705 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -202,9 +202,9 @@ model TwoSourcesThreeUsers extent={{10,-10},{-10,10}}, rotation=180, origin={110,-60}))); - Modelica.Blocks.Sources.BooleanTable booFloDir(table={3600/9*6,3600/9*8}, - startValue=true) "Flow direction: True = normal; False = reverse" - annotation (Placement(transformation( + Modelica.Blocks.Sources.BooleanTable uRemCha(table={3600/9*6,3600/9*8}, + startValue=false) "Tank is being charged remotely" annotation (Placement( + transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-80,10}))); @@ -357,8 +357,8 @@ equation -60},{126,142},{-10.6667,142}}, color={0,0,127})); connect(mulMin_dpUsr.y, conPI_PumChi1.u_m) annotation (Line(points={{-10,118},{-10,110},{-48,110}}, color={0,0,127})); - connect(booFloDir.y, cat.booFloDir) annotation (Line(points={{-69,10},{-58,10}, - {-58,-48}}, color={255,0,255})); + connect(uRemCha.y, cat.uRemCha) + annotation (Line(points={{-69,10},{-58,10},{-58,-48}}, color={255,0,255})); connect(set_mTan_flow_discharge.y, swiTanCha.u1) annotation (Line(points={{-129,10}, {-126,10},{-126,-2},{-122,-2}}, color={0,0,127})); connect(set_mTan_flow_charge.y, swiTanCha.u3) annotation (Line(points={{-129,-30}, diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo index 9b4c8b28006..a767428765c 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo @@ -60,8 +60,8 @@ model ChillerAndTankWithRemoteCharging *6,-1]) "Tank flow rate setpoint" annotation (Placement(transformation(extent={{-80,50},{-60,70}}))); - Modelica.Blocks.Sources.BooleanTable booFloDir(table={0,3600/7*6}) - "Flow direction: True = normal; False = reverse" + Modelica.Blocks.Sources.BooleanTable uRemCha(table={0,3600/7*6}, startValue= + true) "Tank is being charged remotely" annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); Modelica.Blocks.Sources.BooleanTable uOnl(table={3600/7*2}) "True = plant online (outputting CHW to the network); False = offline" @@ -88,9 +88,8 @@ equation connect(uOnl.y, cat.uOnl) annotation (Line(points={{-59,-70},{-10,-70},{-10,-10}}, color={255,0,255})); - connect(booFloDir.y,cat.booFloDir) annotation (Line(points={{-59,0},{-56,0}, - {-56,-2},{-10,-2}}, - color={255,0,255})); + connect(uRemCha.y, cat.uRemCha) annotation (Line(points={{-59,0},{-56,0},{-56, + -2},{-10,-2}}, color={255,0,255})); connect(set_mTan_flow.y, cat.mTanSet_flow) annotation (Line(points={{-59,60}, {-14,60},{-14,2},{-9,2}}, color={0,0,127})); connect(set_mChi_flow.y, cat.mPumPriSet_flow) From dadb2ff0d1aec2cf5e2b38febad922aa6f047d0c Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Tue, 15 Mar 2022 09:17:05 -0700 Subject: [PATCH 069/463] updated descriptions [ci skip] --- .../Plant/BaseClasses/ReversiblePumpValveControl.mo | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo index 2981fa52c07..e4de9d95efb 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo @@ -88,25 +88,26 @@ block ReversiblePumpValveControl "= true if valve closed" annotation (Placement(transformation(extent={{80,20},{60,40}}))); Buildings.Controls.OBC.CDL.Continuous.Switch swiPumPri - "Switch: true = on (y>0); false = off (y=0)." annotation (Placement( + "True = on (y>0); false = off (y=0)." annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={-50,-130}))); Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToReaValDis - "True to 1, false to 0" + "True = 1, false = 0" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={10,-130}))); Buildings.Controls.OBC.CDL.Continuous.Switch swiValCha - "Switch: true = on (y>0); false = off (y=0)." annotation (Placement( + "True = on (y>0); false = off (y=0)." annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={70,-130}))); Buildings.Controls.OBC.CDL.Logical.And3 and3 - "Plant on AND normal direction AND valCha closed" annotation (Placement( + "Plant online AND not charging remotely AND valCha closed" + annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=-90, @@ -120,7 +121,7 @@ block ReversiblePumpValveControl rotation=-90, origin={10,-30}))); Buildings.Controls.OBC.CDL.Logical.And andValCha - "Reverse direction AND valDis closed" annotation (Placement(transformation( + "Charging remotely AND valDis closed" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={60,-70}))); From ddf6b7c369d97f7ca94c09cfaf9983fd65084e9c Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Tue, 15 Mar 2022 09:44:16 -0700 Subject: [PATCH 070/463] improved desc. of "plant online" signal [ci skip] --- .../Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo | 2 +- Buildings/Fluid/Storage/Plant/ChillerAndTank.mo | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo index e4de9d95efb..d18709d196f 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo @@ -41,7 +41,7 @@ block ReversiblePumpValveControl rotation=0, origin={-110,80}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uOnl - "= true if plant is online (either outputting CHW to the network or being charged remotely)" + "= true if plant is online (not cut off from the network by valve)" annotation (Placement(transformation(extent={{-120,-30},{-100,-10}}), iconTransformation(extent={{-140,-100},{-100,-60}}))); Modelica.Blocks.Interfaces.RealOutput yPumSec "Normalised speed" annotation ( diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo index efae80eaaae..f4ed574eefc 100644 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo +++ b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo @@ -99,7 +99,7 @@ model ChillerAndTank annotation (Placement(transformation(extent={{80,80},{60,102}}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uOnl if allowRemoteCharging - "= true if plant is online (either outputting CHW to the network or being charged remotely)" + "= true if plant is online (not cut off from the network by valve)" annotation (Placement(transformation(extent={{120,70},{100,90}}), iconTransformation(extent={{-140,-120},{-100,-80}}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uRemCha From ff5d9cac3e90bf46e5cb93efeb9f6efbb72866e9 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Wed, 16 Mar 2022 16:07:01 -0700 Subject: [PATCH 071/463] restructured models Both the chiller and the control block were moved out of the model. The model is renamed from "ChillerAndTank" to "TankBranch". Example and validation models (except TwoSourcesThreeUsers) have been refactored. --- .../BaseClasses/ReversiblePumpValveControl.mo | 34 +- .../Fluid/Storage/Plant/ChillerAndTank.mo | 412 ------------------ .../Examples/BaseClasses/ChillerBranch.mo | 159 +++++++ .../Plant/Examples/BaseClasses/package.order | 1 + .../Plant/Examples/OneSourceOneUser.mo | 143 +++--- Buildings/Fluid/Storage/Plant/TankBranch.mo | 316 ++++++++++++++ .../BaseClasses/PartialTankBranch.mo | 95 ++++ .../Plant/Validation/BaseClasses/package.mo | 4 + .../Validation/BaseClasses/package.order | 1 + .../ChillerAndTankNoRemoteCharging.mo | 129 ------ .../ChillerAndTankWithRemoteCharging.mo | 197 --------- .../Plant/Validation/NoRemoteCharging.mo | 53 +++ .../Plant/Validation/WithRemoteCharging.mo | 142 ++++++ .../Storage/Plant/Validation/package.order | 5 +- Buildings/Fluid/Storage/Plant/package.order | 2 +- 15 files changed, 860 insertions(+), 833 deletions(-) delete mode 100644 Buildings/Fluid/Storage/Plant/ChillerAndTank.mo create mode 100644 Buildings/Fluid/Storage/Plant/Examples/BaseClasses/ChillerBranch.mo create mode 100644 Buildings/Fluid/Storage/Plant/TankBranch.mo create mode 100644 Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialTankBranch.mo create mode 100644 Buildings/Fluid/Storage/Plant/Validation/BaseClasses/package.mo create mode 100644 Buildings/Fluid/Storage/Plant/Validation/BaseClasses/package.order delete mode 100644 Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo delete mode 100644 Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo create mode 100644 Buildings/Fluid/Storage/Plant/Validation/NoRemoteCharging.mo create mode 100644 Buildings/Fluid/Storage/Plant/Validation/WithRemoteCharging.mo diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo index d18709d196f..0348992b82a 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo @@ -22,8 +22,10 @@ block ReversiblePumpValveControl origin={-10,50}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uRemCha "Tank is being charged remotely" annotation (Placement(transformation( - extent={{-120,-10},{-100,10}}), iconTransformation(extent={{-140,-60}, - {-100,-20}}))); + extent={{-120,-10},{-100,10}}), iconTransformation(extent={{-20,-20}, + {20,20}}, + rotation=90, + origin={-80,-120}))); Modelica.Blocks.Interfaces.RealInput mTanSet_flow "Tank mass flow rate setpoint" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -31,7 +33,7 @@ block ReversiblePumpValveControl origin={-70,110}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-110,40}))); + origin={-110,-40}))); Modelica.Blocks.Interfaces.RealInput mTan_flow "Measured tank mass flow rate" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -39,51 +41,53 @@ block ReversiblePumpValveControl origin={10,110}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-110,80}))); + origin={-110,0}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uOnl "= true if plant is online (not cut off from the network by valve)" annotation (Placement(transformation(extent={{-120,-30},{-100,-10}}), - iconTransformation(extent={{-140,-100},{-100,-60}}))); + iconTransformation(extent={{-20,-20},{20,20}}, + rotation=90, + origin={-40,-120}))); Modelica.Blocks.Interfaces.RealOutput yPumSec "Normalised speed" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={-50,-170}), iconTransformation( extent={{-10,-10},{10,10}}, - rotation=-90, - origin={0,-110}))); + rotation=0, + origin={110,0}))); Modelica.Blocks.Interfaces.RealOutput yValCha "Valve position" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={70,-170}), iconTransformation( extent={{-10,-10},{10,10}}, - rotation=-90, - origin={80,-110}))); + rotation=0, + origin={110,40}))); Modelica.Blocks.Interfaces.RealOutput yValDis "Valve position" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={10,-170}), iconTransformation( extent={{-10,-10},{10,10}}, - rotation=-90, - origin={40,-110}))); + rotation=0, + origin={110,80}))); Modelica.Blocks.Interfaces.RealInput yValCha_actual "Actual valve position" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, origin={110,70}), iconTransformation( - extent={{10,-10},{-10,10}}, + extent={{-10,-10},{10,10}}, rotation=0, - origin={110,40}))); + origin={-110,40}))); Modelica.Blocks.Interfaces.RealInput yValDis_actual "Actual valve position" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, origin={110,30}), iconTransformation( - extent={{10,-10},{-10,10}}, + extent={{-10,-10},{10,10}}, rotation=0, - origin={110,80}))); + origin={-110,80}))); Buildings.Controls.OBC.CDL.Continuous.LessThreshold isValDisClo(t=0.05) "= true if valve closed" annotation (Placement(transformation(extent={{80,20},{60,40}}))); diff --git a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo b/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo deleted file mode 100644 index f4ed574eefc..00000000000 --- a/Buildings/Fluid/Storage/Plant/ChillerAndTank.mo +++ /dev/null @@ -1,412 +0,0 @@ -within Buildings.Fluid.Storage.Plant; -model ChillerAndTank - "(Draft) Model of a plant with a chiller and a tank where the tank can potentially be charged remotely" - extends Buildings.Fluid.Interfaces.PartialFourPortInterface( - final m1_flow_nominal = mCon_flow_nominal, - final m2_flow_nominal = mEva_flow_nominal + mTan_flow_nominal); - - parameter Boolean allowRemoteCharging = true - "= true if the tank is allowed to be charged by a remote source"; - - parameter Modelica.Units.SI.MassFlowRate mEva_flow_nominal(min=0) - "Nominal mass flow rate for CHW chiller branch"; - parameter Modelica.Units.SI.MassFlowRate mCon_flow_nominal(min=0) - "Nominal mass flow rate for CDW loop"; - parameter Modelica.Units.SI.MassFlowRate mTan_flow_nominal(min=0) - "Nominal mass flow rate for CHW tank branch"; - parameter Modelica.Units.SI.PressureDifference dp_nominal - "Nominal pressure difference"; - parameter Modelica.Units.SI.Temperature T_CHWS_nominal=7+273.15 - "Nominal temperature of CHW supply"; - parameter Modelica.Units.SI.Temperature T_CHWR_nominal=12+273.15 - "Nominal temperature of CHW return"; - - replaceable parameter Buildings.Fluid.Chillers.Data.ElectricEIR.Generic perChi( - QEva_flow_nominal=-1E6, - COP_nominal=3, - PLRMax=1, - PLRMinUnl=0.3, - PLRMin=0.3, - etaMotor=1, - mEva_flow_nominal=mEva_flow_nominal, - mCon_flow_nominal=mEva_flow_nominal*1.2, - TEvaLvg_nominal=280.15, - capFunT={1,0,0,0,0,0}, - EIRFunT={1,0,0,0,0,0}, - EIRFunPLR={1,0,0}, - TEvaLvgMin=276.15, - TEvaLvgMax=288.15, - TConEnt_nominal=310.15, - TConEntMin=303.15, - TConEntMax=333.15) - "Chiller performance data" - annotation (choicesAllMatching=true, - Placement(transformation(extent={{-100,82},{-80,102}}))); - - Buildings.Fluid.FixedResistances.PressureDrop preDroTan( - redeclare package Medium = Medium2, - final allowFlowReversal=true, - final m_flow_nominal=mTan_flow_nominal) "Flow resistance on tank branch" - annotation (Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=-90, - origin={-80,-80}))); - Modelica.Blocks.Interfaces.RealInput mPumPriSet_flow - "Primary pump mass flow rate setpoint" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={40,150}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-110,100}))); - - Buildings.Fluid.Movers.FlowControlled_m_flow pumPri( - redeclare package Medium = Medium2, - per(pressure(dp=dp_nominal*{2,1.2,0}, V_flow=mEva_flow_nominal/1.2*{0,1.2,2})), - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - allowFlowReversal=true, - addPowerToMedium=false, - m_flow_nominal=mEva_flow_nominal, - m_flow_start=0, - T_start=T_CHWR_nominal) "Primary CHW pump" - annotation (Placement(transformation(extent={{-10,-42},{-30,-22}}))); - - Modelica.Blocks.Interfaces.RealOutput mTan_flow - "Mass flow rate through the tank" annotation (Dialog(group= - "Time varying output signal"), Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=90, - origin={0,-110}), iconTransformation( - extent={{10,-10},{-10,10}}, - rotation=180, - origin={110,-20}))); - Buildings.Fluid.Movers.SpeedControlled_y pumSec( - redeclare package Medium = Medium2, - per(pressure(dp=dp_nominal*{2,1.2,0}, V_flow=(mEva_flow_nominal + - mTan_flow_nominal)/1.2*{0,1.2,2})), - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - allowFlowReversal=true, - addPowerToMedium=false, - y_start=0, - T_start=T_CHWR_nominal) "Secondary CHW pump" annotation (Placement( - transformation( - extent={{10,-10},{-10,10}}, - rotation=0, - origin={80,-20}))); - - Buildings.Fluid.Storage.Plant.BaseClasses.ReversiblePumpValveControl conPumSecGro - if allowRemoteCharging "Control block for secondary pump-valve group" - annotation (Placement(transformation(extent={{80,80},{60,102}}))); - Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uOnl - if allowRemoteCharging - "= true if plant is online (not cut off from the network by valve)" - annotation (Placement(transformation(extent={{120,70},{100,90}}), - iconTransformation(extent={{-140,-120},{-100,-80}}))); - Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uRemCha - if allowRemoteCharging "Tank is being charged remotely" annotation ( - Placement(transformation(extent={{120,90},{100,110}}), iconTransformation( - extent={{-140,-40},{-100,0}}))); - Buildings.Controls.OBC.CDL.Logical.Not notRemCha if allowRemoteCharging - "Tank is not being charged remotely" - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=180, - origin={10,130}))); - Modelica.Blocks.Interfaces.RealInput mTanSet_flow if allowRemoteCharging - "Tank mass flow rate setpoint" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={80,150}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-110,20}))); - - Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valDis( - redeclare package Medium = Medium2, - use_inputFilter=true, - y_start=0, - l=1E-5, - m_flow_nominal=m2_flow_nominal) if allowRemoteCharging - "Discharge valve, in series to the pump (normal direction)" - annotation (Placement(transformation(extent={{30,-20},{10,0}}))); - Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valCha( - redeclare package Medium = Medium2, - use_inputFilter=true, - y_start=0, - l=1E-5, - m_flow_nominal=mTan_flow_nominal) if allowRemoteCharging - "Charging valve, in parallel to the secondary pump (reverse direction)" - annotation (Placement(transformation(extent={{10,-80},{30,-60}}))); - Buildings.Controls.OBC.CDL.Continuous.Switch swiFloDirPum1 - if allowRemoteCharging "Switches off pum1 when tank charged remotely" - annotation (Placement(transformation(extent={{-10,-10},{10,10}}, - rotation=-90, - origin={-20,90}))); - Modelica.Blocks.Sources.Constant zero(k=0) if allowRemoteCharging - "Constant 0" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=90, - origin={-50,90}))); - Buildings.Fluid.Storage.Plant.BaseClasses.FluidPassThrough pasValDis( - redeclare package Medium = Medium2) if not allowRemoteCharging - "Replaces valDis when remote charging not allowed" - annotation (Placement(transformation(extent={{30,-42},{10,-22}}))); - Modelica.Blocks.Routing.RealPassThrough pasSwiFloDirPum1 - if not allowRemoteCharging - "Replaces swiFloDirPum1 when remote charging not allowed" annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={10,90}))); - Modelica.Blocks.Interfaces.RealInput yPumSec if not allowRemoteCharging - "Secondary pump speed input" annotation (Placement(transformation(extent={{ - 120,10},{100,30}}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={-80,110}))); - Buildings.Fluid.Chillers.ElectricEIR chi( - redeclare final package Medium1 = Medium1, - redeclare final package Medium2 = Medium2, - final dp1_nominal=0, - final dp2_nominal=0, - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - p2_start=500000, - T2_start=T_CHWS_nominal, - final per=perChi) - "Water cooled chiller (ports indexed 1 are on condenser side) (placeholder, to be removed from template)" - annotation (Placement(transformation(extent={{-60,0},{-40,20}}))); - Buildings.Controls.OBC.CDL.Logical.Sources.Constant onChi(k=true) - if not allowRemoteCharging "Placeholder, chiller always on" - annotation (Placement(transformation(extent={{-100,30},{-80,50}}))); - Modelica.Blocks.Sources.Constant set_TEvaLvg(k=T_CHWS_nominal) - "Evaporator leaving temperature setpoint" annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-90,10}))); - Buildings.Fluid.Storage.Stratified tan( - redeclare package Medium = Medium2, - final allowFlowReversal=true, - hTan=3, - dIns=0.3, - VTan=10, - nSeg=7, - show_T=true, - m_flow_nominal=mTan_flow_nominal, - T_start=T_CHWS_nominal, - TFlu_start=linspace( - T_CHWR_nominal, - T_CHWS_nominal, - tan.nSeg)) "Tank" - annotation (Placement(transformation(extent={{-40,-80},{-60,-60}}))); - Modelica.Fluid.Sensors.MassFlowRate sen_m_flow( - redeclare package Medium = Medium2, - final allowFlowReversal=true) "Flow rate sensor" - annotation (Placement(transformation(extent={{-10,-80},{-30,-60}}))); - Buildings.Fluid.FixedResistances.CheckValve cheValPumPri( - redeclare package Medium = Medium2, - m_flow_nominal=mEva_flow_nominal) "Check valve with series resistance" - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={-70,-30}))); - Buildings.Fluid.FixedResistances.CheckValve cheValPumSec( - redeclare package Medium = Medium2, - m_flow_nominal=m2_flow_nominal) "Check valve" annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=180, - origin={50,-20}))); -equation - connect(conPumSecGro.yValDis, valDis.y) annotation (Line(points={{66,78.9},{ - 66,56},{20,56},{20,2}}, color={0,0,127})); - connect(conPumSecGro.mTanSet_flow, mTanSet_flow) annotation (Line(points={{81,95.4}, - {90,95.4},{90,138},{80,138},{80,150}}, color={0,0,127})); - connect(pumSec.y, conPumSecGro.yPumSec) annotation (Line(points={{80,-8},{80, - 20},{70,20},{70,78.9}}, color={0,0,127})); - connect(swiFloDirPum1.u1, mPumPriSet_flow) annotation (Line(points={{-12,102}, - {-12,108},{40,108},{40,150}},color={0,0,127})); - connect(pumPri.m_flow_in, swiFloDirPum1.y) annotation (Line(points={{-20,-20}, - {-20,78}}, color={0,0,127})); - connect(zero.y, swiFloDirPum1.u3) annotation (Line(points={{-50,101},{-50,106}, - {-28,106},{-28,102}}, color={0,0,127})); - connect(pasSwiFloDirPum1.u, mPumPriSet_flow) annotation (Line(points={{10,102}, - {10,108},{40,108},{40,150}}, color={0,0,127})); - connect(pasSwiFloDirPum1.y, pumPri.m_flow_in) annotation (Line(points={{10,79}, - {10,72},{-20,72},{-20,-20}}, color={0,0,127})); - connect(pumSec.y, yPumSec) - annotation (Line(points={{80,-8},{80,20},{110,20}}, color={0,0,127})); - connect(pumSec.port_a, port_a2) - annotation (Line(points={{90,-20},{90,-60},{100,-60}}, color={0,127,255})); - connect(valCha.port_b, port_a2) annotation (Line(points={{30,-70},{90,-70},{90, - -60},{100,-60}}, color={0,127,255})); - connect(conPumSecGro.uOnl, uOnl) annotation (Line(points={{82,82.2},{82,82},{ - 96,82},{96,80},{110,80}}, color={255,0,255})); - connect(conPumSecGro.uRemCha, uRemCha) annotation (Line(points={{82,86.6},{82, - 86},{96,86},{96,100},{110,100}}, color={255,0,255})); - connect(pumPri.port_b, chi.port_a2) - annotation (Line(points={{-30,-32},{-40,-32},{-40,4}}, color={0,127,255})); - connect(onChi.y, chi.on) annotation (Line(points={{-78,40},{-72,40},{-72,13}, - {-62,13}},color={255,0,255})); - connect(set_TEvaLvg.y, chi.TSet) annotation (Line(points={{-79,10},{-79,7},{ - -62,7}}, color={0,0,127})); - connect(chi.port_a1, port_a1) annotation (Line(points={{-60,16},{-64,16},{-64, - 60},{-100,60}}, color={0,127,255})); - connect(chi.port_b1, port_b1) annotation (Line(points={{-40,16},{-32,16},{-32, - 60},{100,60}}, color={0,127,255})); - connect(valDis.y_actual, conPumSecGro.yValDis_actual) annotation (Line(points= - {{15,-3},{14,-3},{14,68},{46,68},{46,99.8},{59,99.8}}, color={0,0,127})); - connect(sen_m_flow.m_flow, mTan_flow) annotation (Line(points={{-20,-59},{-20, - -56},{0,-56},{0,-110}}, color={0,0,127})); - connect(sen_m_flow.m_flow, conPumSecGro.mTan_flow) annotation (Line(points={{-20, - -59},{-20,-56},{0,-56},{0,70},{44,70},{44,108},{88,108},{88,99.8},{81, - 99.8}}, color={0,0,127})); - connect(preDroTan.port_a, tan.port_b) annotation (Line(points={{-80,-90},{-80, - -92},{-66,-92},{-66,-70},{-60,-70}}, color={0,127,255})); - connect(sen_m_flow.port_b, tan.port_a) - annotation (Line(points={{-30,-70},{-40,-70}}, - color={0,127,255})); - connect(port_b2, preDroTan.port_b) annotation (Line(points={{-100,-60},{-80,-60}, - {-80,-70}}, color={0,127,255})); - connect(chi.port_b2, cheValPumPri.port_a) - annotation (Line(points={{-60,4},{-70,4},{-70,-20}}, color={0,127,255})); - connect(cheValPumPri.port_b, port_b2) annotation (Line(points={{-70,-40},{-70, - -60},{-100,-60}}, color={0,127,255})); - connect(valCha.port_a, pumPri.port_a) annotation (Line(points={{10,-70},{4,-70}, - {4,-32},{-10,-32}}, color={0,127,255})); - connect(sen_m_flow.port_a, pumPri.port_a) annotation (Line(points={{-10,-70},{ - 4,-70},{4,-32},{-10,-32}}, color={0,127,255})); - connect(pasValDis.port_b, pumPri.port_a) - annotation (Line(points={{10,-32},{-10,-32}}, color={0,127,255})); - connect(valDis.port_b, pumPri.port_a) annotation (Line(points={{10,-10},{4,-10}, - {4,-32},{-10,-32}}, color={0,127,255})); - connect(pumSec.port_b, cheValPumSec.port_a) - annotation (Line(points={{70,-20},{60,-20}}, color={0,127,255})); - connect(pasValDis.port_a, cheValPumSec.port_b) annotation (Line(points={{30,-32}, - {34,-32},{34,-20},{40,-20}}, color={0,127,255})); - connect(valDis.port_a, cheValPumSec.port_b) annotation (Line(points={{30,-10}, - {34,-10},{34,-20},{40,-20}}, color={0,127,255})); - connect(conPumSecGro.yValCha, valCha.y) annotation (Line(points={{62,78.9},{ - 62,4},{94,4},{94,-44},{20,-44},{20,-58}}, color={0,0,127})); - connect(conPumSecGro.yValCha_actual, valCha.y_actual) annotation (Line(points= - {{59,95.4},{54,95.4},{54,96},{48,96},{48,6},{96,6},{96,-46},{60,-46},{ - 60,-63},{25,-63}}, color={0,0,127})); - connect(notRemCha.u, uRemCha) annotation (Line(points={{22,130},{96,130},{96,100}, - {110,100}}, color={255,0,255})); - connect(notRemCha.y, swiFloDirPum1.u2) annotation (Line(points={{-2,130},{-20, - 130},{-20,102}}, color={255,0,255})); - connect(chi.on, notRemCha.y) annotation (Line(points={{-62,13},{-62,12},{-72,12}, - {-72,130},{-2,130}}, color={255,0,255})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, - {100,100}}), graphics={Line( - points={{-30,-110},{30,-110}}, - color={28,108,200}, - pattern=LinePattern.Dash, - visible=allowRemoteCharging), Polygon( - points={{30,-110},{10,-104},{10,-116},{30,-110}}, - fillColor={28,108,200}, - fillPattern=FillPattern.Solid, - pattern=LinePattern.None, - visible=allowRemoteCharging), - Line(points={{-60,0},{-60,-60},{0,-60},{0,-20},{60,-20},{60,0}}, - color={0, - 0,0}), - Line(points={{-100,0},{-60,0},{-60,60},{60,60},{60,0},{100,0}}, - color={0,0,0}), - Ellipse( - extent={{-22,80},{22,38}}, - lineColor={0,0,0}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-20,-8},{20,-70}}, - lineColor={0,0,0}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Line(points={{-30,-90},{30,-90}},color={28,108,200}), - Polygon( - points={{-30,-90},{-10,-84},{-10,-96},{-30,-90}}, - fillColor={28,108,200}, - fillPattern=FillPattern.Solid, - pattern=LinePattern.None), - Line(points={{16,74},{-20,66}},color={0,0,0}), - Line(points={{-20,54},{14,44}},color={0,0,0})}), Diagram( - coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,140}})), - Documentation(info=" -

    -This plant model has a chiller and a stratified tank. -By setting allowRemoteCharging = false, -this model is effectively replacing a common pipe with a tank. -By setting allowRemoteCharging = true, -the tank can be charged by the CHW network instead of its own chiller. -

    -

    -When remote charging is enabled, the plant's operation mode is determined by -two boolean inputs: -

    -
      -
    • -booFloDir determines the direction flow direction of the plant. -It has reverse flow when and only when the tank is being charged remotely. -
    • -
    • -booOnOff determines whether the plant outputs CHW to the network. -When it is off, the plant still allows the tank to be charged remotely -(if the flow direction is set to reverse at the same time). -
    • -
    -

    -When remote charging is allowed, the secondary pump and two conditionally-enabled -control valves are controlled by - -Buildings.Fluid.Storage.Plant.BaseClasses.ReversiblePumpValveControl as such: -

    -
      -
    • -The pump is controlled to track a flow rate setpoint of the tank -(can be both positive [discharging] or negative [charging]) -under the following conditions: -
        -
      • -The plant is on, AND -
      • -
      • -the flow direction is \"normal\" (= true), AND -
      • -
      • -val2 (in parallel to the pump) is at most 5% open. -
      • -
      -Otherwise the pump is off. -
    • -
    • -The valve in series with the pump (val1) is controlled to open fully -under the same conditions that allow the pump to be on. -Otherwise the valve is closed. -
    • -
    • -The valve in parallel with the pump (val2) is controlled -to track a negative flow rate setpoint of the tank (charging) -under the following conditions: -
        -
      • -The flow direction is \"reverse\" (= false), AND -
      • -
      • -val1 (in series to the pump) is at most 5% open. -
      • -
      -Otherwise the valve is closed. -Not that it is NOT closed when the plant is \"off\". -
    • -
    -", revisions=" -
      -
    • -February 18, 2022 by Hongxiang Fu:
      -First implementation. This is for -#2859. -
    • -
    -")); -end ChillerAndTank; diff --git a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/ChillerBranch.mo b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/ChillerBranch.mo new file mode 100644 index 00000000000..a399b8744b1 --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/ChillerBranch.mo @@ -0,0 +1,159 @@ +within Buildings.Fluid.Storage.Plant.Examples.BaseClasses; +model ChillerBranch + "A branch with a pump, a check valve, and a chiller" + extends Interfaces.PartialTwoPortInterface; + + package MediumCDW = Buildings.Media.Water "Medium model for CDW"; + + parameter Modelica.Units.SI.Temperature T_a_nominal=12+273.15 + "Nominal temperature of CHW supply"; + parameter Modelica.Units.SI.Temperature T_b_nominal=7+273.15 + "Nominal temperature of CHW return"; + parameter Modelica.Units.SI.PressureDifference dp_nominal=500000 + "Nominal pressure difference"; + + Buildings.Fluid.Movers.FlowControlled_m_flow pum( + redeclare package Medium = Medium, + per(pressure(dp=dp_nominal*{2,1.2,0}, V_flow=m_flow_nominal/1.2*{0,1.2,2})), + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + m_flow_nominal=m_flow_nominal, + allowFlowReversal=true, + addPowerToMedium=false, + m_flow_start=0, + T_start=T_a_nominal) "Primary CHW pump" + annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); + + Buildings.Fluid.FixedResistances.CheckValve cheVal( + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal) "Check valve with series resistance" + annotation (Placement(transformation(extent={{-40,-10},{-20,10}}, rotation=0))); + Buildings.Fluid.Chillers.ElectricEIR chi( + redeclare final package Medium1 = MediumCDW, + redeclare final package Medium2 = Medium, + final dp1_nominal=0, + final dp2_nominal=0, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + p2_start=500000, + T2_start=T_b_nominal, + final per=perChi) + "Water cooled chiller (ports indexed 1 are on condenser side)" + annotation (Placement(transformation(extent={{40,0},{20,20}}))); + Buildings.Controls.OBC.CDL.Logical.Sources.Constant onChi(k=true) + "Placeholder, chiller always on" + annotation (Placement(transformation(extent={{20,-80},{40,-60}}))); + Modelica.Blocks.Sources.Constant set_TEvaLvg(k=T_b_nominal) + "Evaporator leaving temperature setpoint" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={30,-30}))); + Buildings.Fluid.Sources.MassFlowSource_T souCDW( + redeclare package Medium = MediumCDW, + m_flow=1.2*m_flow_nominal, + T=305.15, + nPorts=1) "Source representing CDW supply line" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={50,50}))); + Buildings.Fluid.Sources.Boundary_pT sinCDW( + redeclare final package Medium = MediumCDW, + final p=300000, + final T=310.15, + nPorts=1) "Sink representing CDW return line" annotation (Placement( + transformation( + extent={{10,10},{-10,-10}}, + rotation=90, + origin={10,50}))); + Modelica.Blocks.Interfaces.RealInput mPumSet_flow + "Primary pump mass flow rate setpoint" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-110,28}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-110,40}))); + replaceable parameter + Buildings.Fluid.Chillers.Data.ElectricEIR.Generic perChi( + QEva_flow_nominal=-1E6, + COP_nominal=3, + PLRMax=1, + PLRMinUnl=0.3, + PLRMin=0.3, + etaMotor=1, + mEva_flow_nominal=0.7*m_flow_nominal, + mCon_flow_nominal=1.2*perChi.mEva_flow_nominal, + TEvaLvg_nominal=280.15, + capFunT={1,0,0,0,0,0}, + EIRFunT={1,0,0,0,0,0}, + EIRFunPLR={1,0,0}, + TEvaLvgMin=276.15, + TEvaLvgMax=288.15, + TConEnt_nominal=310.15, + TConEntMin=303.15, + TConEntMax=333.15) + "Chiller performance data" + annotation (choicesAllMatching=true, + Placement(transformation(extent={{-40,60},{-20,80}}))); +equation + connect(port_a, pum.port_a) + annotation (Line(points={{-100,0},{-80,0}}, color={0,127,255})); + connect(pum.port_b, cheVal.port_a) + annotation (Line(points={{-60,0},{-40,0}}, color={0,127,255})); + connect(port_b, port_b) + annotation (Line(points={{100,0},{100,0}}, color={0,127,255})); + connect(onChi.y, chi.on) annotation (Line(points={{42,-70},{56,-70},{56,13},{ + 42,13}}, + color={255,0,255})); + connect(set_TEvaLvg.y, chi.TSet) annotation (Line(points={{41,-30},{50,-30},{ + 50,7},{42,7}}, + color={0,0,127})); + connect(pum.m_flow_in, mPumSet_flow) + annotation (Line(points={{-70,12},{-70,28},{-110,28}}, color={0,0,127})); + connect(souCDW.ports[1], chi.port_a1) + annotation (Line(points={{50,40},{50,16},{40,16}}, color={0,127,255})); + connect(sinCDW.ports[1], chi.port_b1) + annotation (Line(points={{10,40},{10,16},{20,16}}, color={0,127,255})); + connect(cheVal.port_b, chi.port_a2) annotation (Line(points={{-20,0},{12,0},{ + 12,4},{20,4}}, color={0,127,255})); + connect(chi.port_b2, port_b) annotation (Line(points={{40,4},{84,4},{84,0},{ + 100,0}}, color={0,127,255})); + annotation (Icon(graphics={ + Ellipse(extent={{-80,20},{-40,-20}}, lineColor={28,108,200}), + Polygon(points={{-72,16},{-72,-16},{-40,0},{-72,16}}, lineColor={28,108, + 200}), + Line(points={{-20,-20},{-20,20},{20,-20},{20,20}}, color={28,108,200}), + Line(points={{-20,30},{20,30}}, color={28,108,200}), + Polygon( + points={{20,30},{10,34},{10,26},{20,30}}, + lineColor={28,108,200}, + fillColor={28,108,200}, + fillPattern=FillPattern.Solid), + Ellipse(extent={{40,20},{80,-20}}, lineColor={28,108,200}), + Line(points={{48,16},{78,8}}, color={28,108,200}), + Line(points={{48,-16},{78,-8}}, color={28,108,200}), + Line( + points={{-80,0},{-100,0}}, + color={28,108,200}, + thickness=1), + Line( + points={{-20,0},{-40,0}}, + color={28,108,200}, + thickness=1), + Line( + points={{40,0},{20,0}}, + color={28,108,200}, + thickness=1), + Line( + points={{100,0},{80,0}}, + color={28,108,200}, + thickness=1), + Line( + points={{-100,40},{-60,40},{-60,20}}, + color={28,108,200}, + pattern=LinePattern.Dash), + Text( + extent={{-100,40},{-40,60}}, + textColor={28,108,200}, + textString="m_flow")})); +end ChillerBranch; diff --git a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/package.order b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/package.order index 594c9635853..e03a1843b36 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/package.order +++ b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/package.order @@ -1,2 +1,3 @@ +ChillerBranch DummyUser Validation diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo index 3a034891120..0cbd02445c0 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo @@ -2,15 +2,14 @@ within Buildings.Fluid.Storage.Plant.Examples; model OneSourceOneUser "(Draft) Simple system model with one source and one user" extends Modelica.Icons.Example; - package Medium1 = Buildings.Media.Water "Medium model for CDW"; - package Medium2 = Buildings.Media.Water "Medium model for CHW"; + package Medium = Buildings.Media.Water "Medium model for CDW"; parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=1 "Nominal mass flow rate"; - parameter Modelica.Units.SI.PressureDifference dp_nominal= - p_CHWS_nominal-p_CHWR_nominal + parameter Modelica.Units.SI.PressureDifference dp_nominal=500000 "Nominal pressure difference"; - parameter Modelica.Units.SI.AbsolutePressure p_CHWS_nominal=800000 + parameter Modelica.Units.SI.AbsolutePressure p_CHWS_nominal= + p_CHWR_nominal+dp_nominal "Nominal pressure at CHW supply line"; parameter Modelica.Units.SI.AbsolutePressure p_CHWR_nominal=300000 "Nominal pressure at CHW return line"; @@ -23,40 +22,45 @@ model OneSourceOneUser "(Draft) Simple system model with one source and one user parameter Modelica.Units.SI.Power QCooLoa_flow_nominal=5*4200*0.9 "Nominal cooling load of one consumer"; - Buildings.Fluid.Storage.Plant.ChillerAndTank cat( - redeclare final package Medium1=Medium1, - redeclare final package Medium2=Medium2, + Buildings.Fluid.Storage.Plant.TankBranch tanBra( + redeclare final package Medium = Medium, final allowRemoteCharging=false, - final mEva_flow_nominal=m_flow_nominal/2, - final mCon_flow_nominal=m_flow_nominal/2, + final m_flow_nominal=m_flow_nominal, final mTan_flow_nominal=m_flow_nominal/2, - final dp_nominal=p_CHWS_nominal-p_CHWR_nominal, + final dp_nominal=dp_nominal, final T_CHWS_nominal=T_CHWS_nominal, final T_CHWR_nominal=T_CHWR_nominal, - final preDroTan(final dp_nominal=cat.dp_nominal*0.1), - final valCha(final dpValve_nominal=cat.dp_nominal*0.1), - final valDis(final dpValve_nominal=cat.dp_nominal*0.1), - final cheValPumPri(final dpValve_nominal=cat.dp_nominal*0.1, - final dpFixed_nominal=cat.dp_nominal*0.1), - final cheValPumSec(final dpValve_nominal=cat.dp_nominal*0.1, - final dpFixed_nominal=cat.dp_nominal*0.1)) - "Chiller and tank" - annotation (Placement(transformation(extent={{-40,-10},{-60,10}}))); + final preDroTan(final dp_nominal=dp_nominal*0.1), + final valCha(final dpValve_nominal=dp_nominal*0.1), + final valDis(final dpValve_nominal=dp_nominal*0.1), + final cheVal(final dpValve_nominal=dp_nominal*0.1, + final dpFixed_nominal=dp_nominal*0.1)) + "Tank branch" + annotation (Placement(transformation(extent={{-20,-12},{0,8}}))); + Buildings.Fluid.Storage.Plant.Examples.BaseClasses.ChillerBranch chiBra( + redeclare final package Medium = Medium, + final m_flow_nominal=tanBra.m_flow_nominal - tanBra.mTan_flow_nominal, + final dp_nominal=dp_nominal, + final T_a_nominal=T_CHWR_nominal, + final T_b_nominal=T_CHWS_nominal, + final cheVal(final dpValve_nominal=0.1*chiBra.dp_nominal, + final dpFixed_nominal=0.1*chiBra.dp_nominal)) + "Chiller branch" + annotation (Placement(transformation(extent={{-20,18},{0,38}}))); Buildings.Fluid.Storage.Plant.Examples.BaseClasses.DummyUser usr( - redeclare package Medium = Medium2, + redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, p_a_nominal=p_CHWS_nominal - dp_nominal*0.35, p_b_nominal=p_CHWR_nominal + dp_nominal*0.35, T_a_nominal=T_CHWS_nominal, T_b_nominal=T_CHWR_nominal) "User" - annotation (Placement(transformation(extent={{40,-30},{60,-10}}))); - Modelica.Blocks.Sources.Constant set_TRet(k=12 + 273.15) - "CHW return setpoint" - annotation (Placement(transformation(extent={{0,20},{20,40}}))); + annotation (Placement(transformation(extent={{60,-30},{80,-10}}))); + Modelica.Blocks.Sources.Constant TRetSet(k=12 + 273.15) "CHW return setpoint" + annotation (Placement(transformation(extent={{20,0},{40,20}}))); Modelica.Blocks.Sources.TimeTable preQCooLoa_flow(table=[0*3600,0; 1200,0; 1200,QCooLoa_flow_nominal; 2400,QCooLoa_flow_nominal; 2400,0; 1*3600,0]) - "Placeholder, prescribed cooling load" - annotation (Placement(transformation(extent={{0,50},{20,70}}))); + "Prescribed cooling load" + annotation (Placement(transformation(extent={{20,40},{40,60}}))); Buildings.Controls.Continuous.LimPID conPI_pumSec( controllerType=Modelica.Blocks.Types.SimpleController.PI, k=1, @@ -64,26 +68,26 @@ model OneSourceOneUser "(Draft) Simple system model with one source and one user reverseActing=true) "PI controller" annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=270, - origin={-50,40}))); + origin={-90,50}))); Buildings.Fluid.FixedResistances.PressureDrop preDro1( - redeclare package Medium = Medium2, + redeclare package Medium = Medium, final allowFlowReversal=true, final dp_nominal=dp_nominal*0.3, final m_flow_nominal=m_flow_nominal) "Flow resistance of the consumer" - annotation (Placement(transformation(extent={{-10,-30},{10,-10}}))); + annotation (Placement(transformation(extent={{10,-30},{30,-10}}))); Buildings.Fluid.FixedResistances.PressureDrop preDro2( - redeclare package Medium = Medium2, + redeclare package Medium = Medium, final allowFlowReversal=true, final dp_nominal=dp_nominal*0.3, final m_flow_nominal=m_flow_nominal) "Flow resistance of the consumer" - annotation (Placement(transformation(extent={{10,-50},{-10,-30}}))); + annotation (Placement(transformation(extent={{30,-50},{10,-30}}))); Modelica.Blocks.Sources.Constant set_dpUsr(k=1) "Normalised differential pressure setpoint of the user" annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=-90, - origin={-50,70}))); + origin={-90,90}))); Buildings.Fluid.Sources.Boundary_pT sou_p( - redeclare final package Medium = Medium2, + redeclare final package Medium = Medium, final p=p_CHWR_nominal, final T=T_CHWR_nominal, nPorts=1) "Pressurisation point" annotation (Placement(transformation( @@ -93,59 +97,44 @@ model OneSourceOneUser "(Draft) Simple system model with one source and one user Modelica.Blocks.Math.Gain gaiPumSec(k=1/usr.dp_nominal) "Gain" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, - rotation=270, - origin={-20,70}))); - Buildings.Fluid.Sources.MassFlowSource_T souCDW( - redeclare package Medium = Medium1, - m_flow=1, - T=305.15, - nPorts=1) "Source representing CDW supply line" - annotation (Placement(transformation(extent={{-10,10},{-30,30}}))); - Buildings.Fluid.Sources.Boundary_pT sinCDW( - redeclare final package Medium = Medium1, - final p=300000, - final T=310.15, - nPorts=1) "Sink representing CDW return line" annotation ( - Placement(transformation( - extent={{10,10},{-10,-10}}, rotation=180, - origin={-90,20}))); - Modelica.Blocks.Sources.Constant set_mChi_flow(k=m_flow_nominal/2) - "Primary pump flow rate setpoint" - annotation (Placement(transformation(extent={{-60,-80},{-40,-60}}))); + origin={-50,90}))); + Modelica.Blocks.Sources.Constant mSet_flow(k=m_flow_nominal/2) + "Flow rate setpoint" + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); equation - connect(set_TRet.y,usr. TSet) - annotation (Line(points={{21,30},{32,30},{32,-16},{39,-16}}, - color={0,0,127})); + connect(TRetSet.y, usr.TSet) annotation (Line(points={{41,10},{52,10},{52,-16}, + {59,-16}}, color={0,0,127})); connect(preQCooLoa_flow.y,usr. QCooLoa_flow) - annotation (Line(points={{21,60},{34,60},{34,-12},{39,-12}}, + annotation (Line(points={{41,50},{54,50},{54,-12},{59,-12}}, color={0,0,127})); connect(preDro1.port_b,usr. port_a) - annotation (Line(points={{10,-20},{40,-20}}, + annotation (Line(points={{30,-20},{60,-20}}, color={0,127,255})); connect(usr.port_b, preDro2.port_a) - annotation (Line(points={{60,-20},{60,-40},{10,-40}}, + annotation (Line(points={{80,-20},{84,-20},{84,-40},{30,-40}}, color={0,127,255})); connect(set_dpUsr.y, conPI_pumSec.u_s) - annotation (Line(points={{-50,59},{-50,52}}, color={0,0,127})); - connect(usr.dpUsr, gaiPumSec.u) annotation (Line(points={{48,-9},{48,-9},{48, - 88},{-20,88},{-20,82}}, color={0,0,127})); - connect(conPI_pumSec.y, cat.yPumSec) annotation (Line(points={{-50,29},{-50, - 20},{-42,20},{-42,11}}, color={0,0,127})); + annotation (Line(points={{-90,79},{-90,62}}, color={0,0,127})); + connect(usr.dpUsr, gaiPumSec.u) annotation (Line(points={{68,-9},{68,90},{-38, + 90}}, color={0,0,127})); connect(gaiPumSec.y, conPI_pumSec.u_m) - annotation (Line(points={{-20,59},{-20,40},{-38,40}}, color={0,0,127})); - connect(cat.port_b2, preDro1.port_a) annotation (Line(points={{-40,-6},{-16, - -6},{-16,-20},{-10,-20}}, color={0,127,255})); - connect(preDro2.port_b, cat.port_a2) annotation (Line(points={{-10,-40},{-66, - -40},{-66,-6},{-60,-6}}, color={0,127,255})); - connect(sou_p.ports[1], cat.port_a2) annotation (Line(points={{-80,-20},{-66, - -20},{-66,-6},{-60,-6}}, color={0,127,255})); - connect(cat.port_b1, sinCDW.ports[1]) annotation (Line(points={{-60,6},{-74,6}, - {-74,20},{-80,20}}, color={0,127,255})); - connect(cat.port_a1, souCDW.ports[1]) annotation (Line(points={{-40,6},{-34,6}, - {-34,20},{-30,20}}, color={0,127,255})); - connect(set_mChi_flow.y, cat.mPumPriSet_flow) annotation (Line(points={{-39,-70}, - {-26,-70},{-26,10},{-39,10}}, color={0,0,127})); + annotation (Line(points={{-61,90},{-70,90},{-70,50},{-78,50}}, + color={0,0,127})); + connect(preDro2.port_b, tanBra.port_1) annotation (Line(points={{10,-40},{-26, + -40},{-26,-8},{-20,-8}}, color={0,127,255})); + connect(tanBra.port_2, preDro1.port_a) annotation (Line(points={{0,-8},{6,-8}, + {6,-20},{10,-20}}, color={0,127,255})); + connect(sou_p.ports[1], tanBra.port_1) annotation (Line(points={{-80,-20},{-26, + -20},{-26,-8},{-20,-8}}, color={0,127,255})); + connect(conPI_pumSec.y, tanBra.yPum) + annotation (Line(points={{-90,39},{-90,0},{-21,0}}, color={0,0,127})); + connect(tanBra.port_3, chiBra.port_a) annotation (Line(points={{-14,8},{-28,8}, + {-28,28},{-20,28}}, color={0,127,255})); + connect(chiBra.mPumSet_flow, mSet_flow.y) annotation (Line(points={{-21,32},{-32, + 32},{-32,50},{-39,50}}, color={0,0,127})); + connect(tanBra.port_4, chiBra.port_b) annotation (Line(points={{-6,8.2},{-6,8}, + {8,8},{8,28},{0,28}}, color={0,127,255})); annotation(__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos" "Simulate and plot"), experiment(Tolerance=1e-06, StopTime=3600), Documentation(info=" diff --git a/Buildings/Fluid/Storage/Plant/TankBranch.mo b/Buildings/Fluid/Storage/Plant/TankBranch.mo new file mode 100644 index 00000000000..380e43e0d4b --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/TankBranch.mo @@ -0,0 +1,316 @@ +within Buildings.Fluid.Storage.Plant; +model TankBranch + "(Draft) Model of the tank branch where the tank can potentially be charged remotely" + + replaceable package Medium = + Modelica.Media.Interfaces.PartialMedium "Medium package"; + + parameter Boolean allowRemoteCharging = true + "= true if the tank is allowed to be charged by a remote source"; + + parameter Modelica.Units.SI.MassFlowRate m_flow_nominal(min=0) + "Nominal mass flow rate"; + parameter Modelica.Units.SI.MassFlowRate mTan_flow_nominal(min=0) + "Nominal mass flow rate for CHW tank branch"; + parameter Modelica.Units.SI.PressureDifference dp_nominal + "Nominal pressure difference"; + parameter Modelica.Units.SI.Temperature T_CHWS_nominal=7+273.15 + "Nominal temperature of CHW supply"; + parameter Modelica.Units.SI.Temperature T_CHWR_nominal=12+273.15 + "Nominal temperature of CHW return"; + + Buildings.Fluid.FixedResistances.PressureDrop preDroTan( + redeclare package Medium = Medium, + final allowFlowReversal=true, + final m_flow_nominal=mTan_flow_nominal) "Flow resistance on tank branch" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={50,30}))); + Modelica.Blocks.Interfaces.RealOutput mTan_flow + "Mass flow rate through the tank" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={-30,110}), iconTransformation( + extent={{10,-10},{-10,10}}, + rotation=180, + origin={110,20}))); + Buildings.Fluid.Movers.SpeedControlled_y pum( + redeclare package Medium = Medium, + per(pressure(dp=dp_nominal*{2,1.2,0}, V_flow=(m_flow_nominal)/1.2*{0,1.2,2})), + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + allowFlowReversal=true, + addPowerToMedium=false, + y_start=0, + T_start=T_CHWR_nominal) "Secondary CHW pump" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-70,-40}))); + + Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valDis( + redeclare package Medium = Medium, + dpValve_nominal=0.1*dp_nominal, + use_inputFilter=true, + y_start=0, + l=1E-5, + m_flow_nominal=m_flow_nominal) + if allowRemoteCharging + "Discharge valve, in series to the pump (normal direction)" + annotation (Placement(transformation(extent={{0,-42},{20,-22}}))); + Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valCha( + redeclare package Medium = Medium, + dpValve_nominal=0.1*dp_nominal, + use_inputFilter=true, + y_start=0, + l=1E-5, + m_flow_nominal=mTan_flow_nominal) if allowRemoteCharging + "Charging valve, in parallel to the secondary pump (reverse direction)" + annotation (Placement(transformation(extent={{20,-90},{0,-70}}))); + Buildings.Fluid.Storage.Plant.BaseClasses.FluidPassThrough pasValDis( + redeclare package Medium = Medium) if not allowRemoteCharging + "Replaces valDis when remote charging not allowed" + annotation (Placement(transformation(extent={{0,-60},{20,-40}}))); + Buildings.Fluid.Storage.Stratified tan( + redeclare package Medium = Medium, + final allowFlowReversal=true, + hTan=3, + dIns=0.3, + VTan=10, + nSeg=7, + show_T=true, + m_flow_nominal=mTan_flow_nominal, + T_start=T_CHWS_nominal, + TFlu_start=linspace( + T_CHWR_nominal, + T_CHWS_nominal, + tan.nSeg)) "Tank" + annotation (Placement(transformation(extent={{0,20},{20,40}}))); + Modelica.Fluid.Sensors.MassFlowRate sen_m_flow( + redeclare package Medium = Medium, + final allowFlowReversal=true) "Flow rate sensor" + annotation (Placement(transformation(extent={{-40,20},{-20,40}}))); + Buildings.Fluid.FixedResistances.CheckValve cheVal( + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal, + dpValve_nominal=0.1*dp_nominal, + dpFixed_nominal=0.1*dp_nominal) "Check valve" annotation (Placement( + transformation( + extent={{10,-10},{-10,10}}, + rotation=180, + origin={-30,-40}))); + Modelica.Fluid.Interfaces.FluidPort_a port_1( + redeclare package Medium = Medium) + "Port that connects CHW return line to the warmer side of the tank" + annotation (Placement(transformation(extent={{-110,-70},{-90,-50}}), + iconTransformation(extent={{-110,-70},{-90,-50}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_2( + redeclare package Medium = Medium) + "Port that connects the cooler side of the tank to the CHW supply line" + annotation (Placement(transformation(extent={{90,-70},{110,-50}}), + iconTransformation(extent={{90,-70},{110,-50}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_3( + redeclare package Medium = Medium) + "Port that connects the warmer side of the tank to the chiller inlet" + annotation (Placement(transformation(extent={{-70,90},{-50,110}}), + iconTransformation(extent={{-50,90},{-30,110}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_4( + redeclare package Medium = Medium) + "Port that connects the chiller outlet to the warmer side of the tank" + annotation (Placement(transformation(extent={{50,90},{70,110}}), + iconTransformation(extent={{30,92},{50,112}}))); + Modelica.Blocks.Interfaces.RealOutput yValCha_actual if allowRemoteCharging + "Actual valve position" + annotation (Placement( + transformation( + extent={{10,-10},{-10,10}}, + rotation=90, + origin={-20,-110}), iconTransformation( + extent={{10,-10},{-10,10}}, + rotation=180, + origin={110,60}))); + Modelica.Blocks.Interfaces.RealOutput yValDis_actual if allowRemoteCharging + "Actual valve position" + annotation (Placement( + transformation( + extent={{10,-10},{-10,10}}, + rotation=90, + origin={40,-110}), iconTransformation( + extent={{10,-10},{-10,10}}, + rotation=180, + origin={110,100}))); + Modelica.Blocks.Interfaces.RealInput yValCha if allowRemoteCharging + "Valve position input" annotation (Placement(transformation(extent={{10,10}, + {-10,-10}}, + rotation=-90, + origin={-40,-110}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-110,60}))); + Modelica.Blocks.Interfaces.RealInput yValDis if allowRemoteCharging + "Valve position input" annotation (Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=-90, + origin={60,-110}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-110,100}))); + Modelica.Blocks.Interfaces.RealInput yPum "Secondary pump speed input" + annotation (Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=180, + origin={-110,-20}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-110,20}))); +equation + connect(sen_m_flow.m_flow, mTan_flow) annotation (Line(points={{-30,41},{-30,110}}, + color={0,0,127})); + connect(preDroTan.port_a, tan.port_b) annotation (Line(points={{40,30},{20,30}}, + color={0,127,255})); + connect(sen_m_flow.port_b, tan.port_a) + annotation (Line(points={{-20,30},{0,30}}, color={0,127,255})); + connect(pum.port_b, cheVal.port_a) + annotation (Line(points={{-60,-40},{-40,-40}}, color={0,127,255})); + connect(pasValDis.port_a, cheVal.port_b) annotation (Line(points={{0,-50},{-10, + -50},{-10,-40},{-20,-40}}, color={0,127,255})); + connect(valDis.port_a, cheVal.port_b) annotation (Line(points={{0,-32},{-10,-32}, + {-10,-40},{-20,-40}}, color={0,127,255})); + connect(preDroTan.port_b, port_2) annotation (Line(points={{60,30},{70,30},{70, + -60},{100,-60}}, color={0,127,255})); + connect(pum.port_a, port_1) annotation (Line(points={{-80,-40},{-90,-40},{-90, + -60},{-100,-60}}, color={0,127,255})); + connect(valCha.port_b, port_1) annotation (Line(points={{0,-80},{-90,-80},{-90, + -60},{-100,-60}}, color={0,127,255})); + connect(port_2, port_2) + annotation (Line(points={{100,-60},{100,-60}}, color={0,127,255})); + connect(sen_m_flow.port_a, valCha.port_a) annotation (Line(points={{-40,30},{-60, + 30},{-60,0},{30,0},{30,-80},{20,-80}}, color={0,127,255})); + connect(pasValDis.port_b, sen_m_flow.port_a) annotation (Line(points={{20,-50}, + {30,-50},{30,0},{-60,0},{-60,30},{-40,30}}, color={0,127,255})); + connect(valDis.port_b, sen_m_flow.port_a) annotation (Line(points={{20,-32},{30, + -32},{30,0},{-60,0},{-60,30},{-40,30}}, color={0,127,255})); + connect(sen_m_flow.port_a, port_3) annotation (Line(points={{-40,30},{-60,30}, + {-60,100}}, color={0,127,255})); + connect(preDroTan.port_b, port_4) annotation (Line(points={{60,30},{70,30},{70, + 86},{60,86},{60,100}}, + color={0,127,255})); + connect(valCha.y_actual, yValCha_actual) + annotation (Line(points={{5,-73},{-20,-73},{-20,-110}}, color={0,0,127})); + connect(valDis.y_actual, yValDis_actual) + annotation (Line(points={{15,-25},{40,-25},{40,-110}}, color={0,0,127})); + connect(valCha.y, yValCha) + annotation (Line(points={{10,-68},{-40,-68},{-40,-110}}, color={0,0,127})); + connect(yValDis, valDis.y) + annotation (Line(points={{60,-110},{60,-20},{10,-20}}, color={0,0,127})); + connect(pum.y, yPum) annotation (Line(points={{-70,-28},{-70,-20},{-110,-20}}, + color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, + {100,100}}), graphics={Line( + points={{-30,-92},{30,-92}}, + color={28,108,200}, + pattern=LinePattern.Dash, + visible=allowRemoteCharging), Polygon( + points={{-30,-92},{-10,-86},{-10,-98},{-30,-92}}, + fillColor={28,108,200}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None, + visible=allowRemoteCharging), + Line(points={{-30,-72},{30,-72}},color={28,108,200}), + Polygon( + points={{30,-72},{10,-66},{10,-78},{30,-72}}, + fillColor={28,108,200}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None), + Line(points={{-100,-60},{-40,-60},{-40,-30},{0,-30},{0,30},{40,30},{40,-60}, + {100,-60}}, color={0,0,0}), + Rectangle( + extent={{-20,40},{20,-40}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line(points={{-40,100},{-40,-30}}, color={0,0,0}), + Line(points={{40,100},{40,30}}, color={0,0,0}), + Text( + extent={{-62,-124},{62,-100}}, + textColor={0,0,127}, + textString="%name")}), Diagram( + coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}})), + Documentation(info=" +

    +This plant model has a chiller and a stratified tank. +By setting allowRemoteCharging = false, +this model is effectively replacing a common pipe with a tank. +By setting allowRemoteCharging = true, +the tank can be charged by the CHW network instead of its own chiller. +

    +

    +When remote charging is enabled, the plant's operation mode is determined by +two boolean inputs: +

    +
      +
    • +booFloDir determines the direction flow direction of the plant. +It has reverse flow when and only when the tank is being charged remotely. +
    • +
    • +booOnOff determines whether the plant outputs CHW to the network. +When it is off, the plant still allows the tank to be charged remotely +(if the flow direction is set to reverse at the same time). +
    • +
    +

    +When remote charging is allowed, the secondary pump and two conditionally-enabled +control valves are controlled by + +Buildings.Fluid.Storage.Plant.BaseClasses.ReversiblePumpValveControl as such: +

    +
      +
    • +The pump is controlled to track a flow rate setpoint of the tank +(can be both positive [discharging] or negative [charging]) +under the following conditions: +
        +
      • +The plant is on, AND +
      • +
      • +the flow direction is \"normal\" (= true), AND +
      • +
      • +val2 (in parallel to the pump) is at most 5% open. +
      • +
      +Otherwise the pump is off. +
    • +
    • +The valve in series with the pump (val1) is controlled to open fully +under the same conditions that allow the pump to be on. +Otherwise the valve is closed. +
    • +
    • +The valve in parallel with the pump (val2) is controlled +to track a negative flow rate setpoint of the tank (charging) +under the following conditions: +
        +
      • +The flow direction is \"reverse\" (= false), AND +
      • +
      • +val1 (in series to the pump) is at most 5% open. +
      • +
      +Otherwise the valve is closed. +Not that it is NOT closed when the plant is \"off\". +
    • +
    +", revisions=" +
      +
    • +February 18, 2022 by Hongxiang Fu:
      +First implementation. This is for +#2859. +
    • +
    +")); +end TankBranch; diff --git a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialTankBranch.mo b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialTankBranch.mo new file mode 100644 index 00000000000..0864ae6f71d --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialTankBranch.mo @@ -0,0 +1,95 @@ +within Buildings.Fluid.Storage.Plant.Validation.BaseClasses; +partial model PartialTankBranch "(Draft)" + + package Medium = Buildings.Media.Water "Medium model"; + + parameter Modelica.Units.SI.AbsolutePressure p_CHWS_nominal=800000 + "Nominal pressure of the CHW supply line"; + parameter Modelica.Units.SI.AbsolutePressure p_CHWR_nominal=300000 + "Nominal pressure of the CHW return line"; + parameter Modelica.Units.SI.Temperature T_CHWS_nominal=7+273.15 + "Nominal temperature of CHW supply"; + parameter Modelica.Units.SI.Temperature T_CHWR_nominal=12+273.15 + "Nominal temperature of CHW return"; + + Buildings.Fluid.Storage.Plant.TankBranch tanBra( + cheVal(final dpValve_nominal=tanBra.dp_nominal*0.1, final dpFixed_nominal= + tanBra.dp_nominal*0.1), + redeclare final package Medium = Medium, + final m_flow_nominal=2, + final mTan_flow_nominal=1, + final dp_nominal=p_CHWS_nominal - p_CHWR_nominal, + final T_CHWS_nominal=T_CHWS_nominal, + final T_CHWR_nominal=T_CHWR_nominal, + final preDroTan(final dp_nominal=tanBra.dp_nominal*0.1), + final valCha(final dpValve_nominal=tanBra.dp_nominal*0.1), + final valDis(final dpValve_nominal=tanBra.dp_nominal*0.1)) "Tank branch" + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + Buildings.Fluid.Sources.Boundary_pT sou( + redeclare final package Medium = Medium, + final p=p_CHWR_nominal, + final T=T_CHWR_nominal, + nPorts=1) + "Source representing CHW return line" + annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=-90, + origin={-20,-30}))); + Buildings.Fluid.Sources.Boundary_pT sin( + redeclare final package Medium = Medium, + final p=p_CHWS_nominal, + final T=T_CHWS_nominal, + nPorts=1) "Sink representing CHW supply line" + annotation (Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=270, + origin={20,-30}))); + Buildings.Fluid.Sources.MassFlowSource_T souChi( + redeclare package Medium = Medium, + final T=T_CHWS_nominal, + nPorts=1) "Source representing chiller branch outlet" + annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + rotation=-90, + origin={20,30}))); + Buildings.Fluid.Sources.MassFlowSource_T sinChi( + redeclare package Medium = Medium, + final use_m_flow_in=true, + final T=T_CHWR_nominal, + nPorts=1) "Sink representing chiller branch inlet" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-20,30}))); + Modelica.Blocks.Sources.RealExpression mSinChi_flow( + final y=souChi.ports[1].m_flow) + "Mass flow rate" + annotation (Placement(transformation(extent={{-40,38},{-20,58}}))); +equation + + connect(sou.ports[1], tanBra.port_1) + annotation (Line(points={{-20,-20},{-20,-6},{-10,-6}}, color={0,127,255})); + connect(sin.ports[1], tanBra.port_2) + annotation (Line(points={{20,-20},{20,-6},{10,-6}}, color={0,127,255})); + connect(tanBra.port_4, souChi.ports[1]) annotation (Line(points={{4,10.2},{4, + 16},{20,16},{20,20}}, color={0,127,255})); + connect(sinChi.ports[1], tanBra.port_3) annotation (Line(points={{-20,20},{-20, + 16},{-4,16},{-4,10}}, color={0,127,255})); + connect(mSinChi_flow.y, sinChi.m_flow_in) + annotation (Line(points={{-19,48},{-12,48},{-12,42}}, color={0,0,127})); + annotation ( + Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), + Icon(coordinateSystem(extent={{-100,-100},{100,100}})), + Documentation(info=" +

    +Documentation pending. +

    +", revisions=" +
      +
    • +March 15, 2022 by Hongxiang Fu:
      +First implementation. This is for +#2859. +
    • +
    +")); +end PartialTankBranch; diff --git a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/package.mo b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/package.mo new file mode 100644 index 00000000000..872a6241c59 --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/package.mo @@ -0,0 +1,4 @@ +within Buildings.Fluid.Storage.Plant.Validation; +package BaseClasses "Package with base classes" + extends Modelica.Icons.BasesPackage; +end BaseClasses; diff --git a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/package.order b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/package.order new file mode 100644 index 00000000000..3d1a76431ec --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/package.order @@ -0,0 +1 @@ +PartialTankBranch diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo deleted file mode 100644 index 3f738a6a4fa..00000000000 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mo +++ /dev/null @@ -1,129 +0,0 @@ -within Buildings.Fluid.Storage.Plant.Validation; -model ChillerAndTankNoRemoteCharging - "(Draft) Validation model of the plant not allowing remote charging" - extends Modelica.Icons.Example; - - package Medium1 = Buildings.Media.Water "Medium model"; - package Medium2 = Buildings.Media.Water "Medium model"; - - parameter Modelica.Units.SI.AbsolutePressure p_CHWS_nominal=800000 - "Nominal pressure of the CHW supply line"; - parameter Modelica.Units.SI.AbsolutePressure p_CHWR_nominal=300000 - "Nominal pressure of the CHW return line"; - parameter Modelica.Units.SI.Temperature T_CHWS_nominal=7+273.15 - "Nominal temperature of CHW supply"; - parameter Modelica.Units.SI.Temperature T_CHWR_nominal=12+273.15 - "Nominal temperature of CHW return"; - - Buildings.Fluid.Storage.Plant.ChillerAndTank cat( - redeclare final package Medium1=Medium1, - redeclare final package Medium2=Medium2, - final allowRemoteCharging=false, - final mEva_flow_nominal=1, - final mCon_flow_nominal=1, - final mTan_flow_nominal=1, - final dp_nominal=p_CHWS_nominal-p_CHWR_nominal, - final T_CHWS_nominal=T_CHWS_nominal, - final T_CHWR_nominal=T_CHWR_nominal, - final preDroTan(final dp_nominal=cat.dp_nominal*0.1), - final valCha(final dpValve_nominal=cat.dp_nominal*0.1), - final valDis(final dpValve_nominal=cat.dp_nominal*0.1), - final cheValPumPri(final dpValve_nominal=cat.dp_nominal*0.1, - final dpFixed_nominal=cat.dp_nominal*0.1), - final cheValPumSec(final dpValve_nominal=cat.dp_nominal*0.1, - final dpFixed_nominal=cat.dp_nominal*0.1)) - "Plant with chiller and tank" - annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - Buildings.Fluid.Sources.Boundary_pT sou( - redeclare final package Medium = Medium2, - final p=p_CHWR_nominal, - final T=T_CHWR_nominal, - nPorts=1) - "Source representing CHW return line" - annotation (Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=0, - origin={70,-30}))); - Buildings.Fluid.Sources.Boundary_pT sin( - redeclare final package Medium = Medium2, - final p=p_CHWS_nominal, - final T=T_CHWS_nominal, - nPorts=1) "Sink representing CHW supply line" - annotation (Placement(transformation( - extent={{10,10},{-10,-10}}, - rotation=180, - origin={-70,-30}))); - Modelica.Blocks.Sources.TimeTable set_mPumSec_flow(table=[0,1; 900,1; 900,-1; - 1800,-1; 1800,0; 2700,0; 2700,1; 3600,1]) - "Secondary mass flow rate setpoint" - annotation (Placement(transformation(extent={{-100,40},{-80,60}}))); - Modelica.Blocks.Sources.Constant set_mPumPri_flow(k=cat.m1_flow_nominal) - "Primary pump mass flow rate setpoint" - annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); - Buildings.Controls.Continuous.LimPID conPID_PumSec( - k=1, - Ti=15) "PI controller" annotation (Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=180, - origin={-50,50}))); - Modelica.Blocks.Math.Gain gain2(k=1/cat.m2_flow_nominal) "Gain" - annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=180, - origin={-10,70}))); - Buildings.Fluid.Sources.MassFlowSource_T souCDW( - redeclare package Medium = Medium1, - m_flow=1, - T=305.15, - nPorts=1) "Source representing CDW supply line" - annotation (Placement(transformation(extent={{-80,20},{-60,40}}))); - Buildings.Fluid.Sources.Boundary_pT sinCDW( - redeclare final package Medium = Medium1, - final p=300000, - final T=310.15, - nPorts=1) "Sink representing CDW return line" annotation ( - Placement(transformation( - extent={{-10,10},{10,-10}}, - rotation=180, - origin={70,30}))); -equation - - connect(gain2.y, conPID_PumSec.u_m) - annotation (Line(points={{-21,70},{-50,70},{-50,62}}, color={0,0,127})); - connect(cat.mTan_flow, gain2.u) annotation (Line(points={{11,-2},{16,-2},{16,70}, - {2,70}}, color={0,0,127})); - connect(set_mPumSec_flow.y, conPID_PumSec.u_s) - annotation (Line(points={{-79,50},{-62,50}}, color={0,0,127})); - connect(set_mPumPri_flow.y, cat.mPumPriSet_flow) annotation (Line(points={{-59, - 0},{-16,0},{-16,10},{-11,10}}, color={0,0,127})); - connect(conPID_PumSec.y, cat.yPumSec) - annotation (Line(points={{-39,50},{-8,50},{-8,11}}, color={0,0,127})); - connect(sin.ports[1], cat.port_b2) annotation (Line(points={{-60,-30},{-16, - -30},{-16,-6},{-10,-6}}, color={0,127,255})); - connect(sou.ports[1], cat.port_a2) annotation (Line(points={{60,-30},{16,-30}, - {16,-6},{10,-6}}, color={0,127,255})); - connect(souCDW.ports[1], cat.port_a1) annotation (Line(points={{-60,30},{-20, - 30},{-20,6},{-10,6}}, color={0,127,255})); - connect(cat.port_b1, sinCDW.ports[1]) annotation (Line(points={{10,6},{54,6}, - {54,30},{60,30}}, color={0,127,255})); - annotation (__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mos" - "Simulate and plot"), - experiment(Tolerance=1e-06, StopTime=3600), - Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), - Icon(coordinateSystem(extent={{-100,-100},{100,100}})), - Documentation(info=" -

    -(Draft) This is a validation model where the plant is configured not to allow -remotely charging the tank. -

    -", revisions=" -
      -
    • -February 18, 2022 by Hongxiang Fu:
      -First implementation. This is for -#2859. -
    • -
    -")); -end ChillerAndTankNoRemoteCharging; diff --git a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo deleted file mode 100644 index a767428765c..00000000000 --- a/Buildings/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mo +++ /dev/null @@ -1,197 +0,0 @@ -within Buildings.Fluid.Storage.Plant.Validation; -model ChillerAndTankWithRemoteCharging - "(Draft) Validation model of the plant allowing remote charging" - - extends Modelica.Icons.Example; - - package Medium1 = Buildings.Media.Water "Medium model"; - package Medium2 = Buildings.Media.Water "Medium model"; - - parameter Modelica.Units.SI.AbsolutePressure p_CHWS_nominal=800000 - "Nominal pressure of the CHW supply line"; - parameter Modelica.Units.SI.AbsolutePressure p_CHWR_nominal=300000 - "Nominal pressure of the CHW return line"; - parameter Modelica.Units.SI.Temperature T_CHWS_nominal=7+273.15 - "Nominal temperature of CHW supply"; - parameter Modelica.Units.SI.Temperature T_CHWR_nominal=12+273.15 - "Nominal temperature of CHW return"; - - Buildings.Fluid.Storage.Plant.ChillerAndTank cat( - redeclare final package Medium1 = Medium1, - redeclare final package Medium2 = Medium2, - final allowRemoteCharging=true, - final mEva_flow_nominal=1, - final mCon_flow_nominal=1, - final mTan_flow_nominal=1, - final dp_nominal=p_CHWS_nominal-p_CHWR_nominal, - final T_CHWS_nominal=T_CHWS_nominal, - final T_CHWR_nominal=T_CHWR_nominal, - final preDroTan(final dp_nominal=cat.dp_nominal*0.1), - final valCha(final dpValve_nominal=cat.dp_nominal*0.1), - final valDis(final dpValve_nominal=cat.dp_nominal*0.1), - final cheValPumPri(final dpValve_nominal=cat.dp_nominal*0.1, - final dpFixed_nominal=cat.dp_nominal*0.1), - final cheValPumSec(final dpValve_nominal=cat.dp_nominal*0.1, - final dpFixed_nominal=cat.dp_nominal*0.1)) - "Plant with chiller and tank" - annotation (Placement(transformation(extent={{-8,-10},{12,10}}))); - Buildings.Fluid.Sources.Boundary_pT sou( - redeclare final package Medium = Medium2, - p=p_CHWR_nominal, - T=T_CHWR_nominal, - nPorts=1) - "Source, CHW return line" - annotation (Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=0, - origin={70,-30}))); - Buildings.Fluid.Sources.Boundary_pT sin( - redeclare final package Medium = Medium2, - p=p_CHWS_nominal, - T=T_CHWS_nominal, - nPorts=1) - "Sink, CHW supply line" - annotation (Placement(transformation( - extent={{10,10},{-10,-10}}, - rotation=180, - origin={-70,-30}))); - Modelica.Blocks.Sources.TimeTable set_mTan_flow(table=[0,0; 3600/7,0; 3600/7, - -1; 3600/7*3,-1; 3600/7*3,0; 3600/7*4,0; 3600/7*4,1; 3600/7*6,1; 3600/7 - *6,-1]) - "Tank flow rate setpoint" - annotation (Placement(transformation(extent={{-80,50},{-60,70}}))); - Modelica.Blocks.Sources.BooleanTable uRemCha(table={0,3600/7*6}, startValue= - true) "Tank is being charged remotely" - annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); - Modelica.Blocks.Sources.BooleanTable uOnl(table={3600/7*2}) - "True = plant online (outputting CHW to the network); False = offline" - annotation (Placement(transformation(extent={{-80,-80},{-60,-60}}))); - Modelica.Blocks.Sources.TimeTable set_mChi_flow(table=[0,0; 3600/7,0; 3600/7, - 1; 3600/7*5,1; 3600/7*5,0]) "Chiller flow rate setpoint" - annotation (Placement(transformation(extent={{-80,80},{-60,100}}))); - Buildings.Fluid.Sources.Boundary_pT sinCDW( - redeclare final package Medium = Medium1, - final p=300000, - final T=310.15, - nPorts=1) "Sink representing CDW return line" annotation ( - Placement(transformation( - extent={{-10,10},{10,-10}}, - rotation=180, - origin={70,30}))); - Buildings.Fluid.Sources.MassFlowSource_T souCDW( - redeclare package Medium = Medium1, - m_flow=1, - T=305.15, - nPorts=1) "Source representing CDW supply line" - annotation (Placement(transformation(extent={{-80,20},{-60,40}}))); -equation - - connect(uOnl.y, cat.uOnl) annotation (Line(points={{-59,-70},{-10,-70},{-10,-10}}, - color={255,0,255})); - connect(uRemCha.y, cat.uRemCha) annotation (Line(points={{-59,0},{-56,0},{-56, - -2},{-10,-2}}, color={255,0,255})); - connect(set_mTan_flow.y, cat.mTanSet_flow) annotation (Line(points={{-59,60}, - {-14,60},{-14,2},{-9,2}}, color={0,0,127})); - connect(set_mChi_flow.y, cat.mPumPriSet_flow) - annotation (Line(points={{-59,90},{-9,90},{-9,10}}, color={0,0,127})); - connect(cat.port_b2, sin.ports[1]) annotation (Line(points={{-8,-6},{-54,-6}, - {-54,-30},{-60,-30}}, color={0,127,255})); - connect(sou.ports[1], cat.port_a2) annotation (Line(points={{60,-30},{18,-30}, - {18,-6},{12,-6}}, color={0,127,255})); - connect(cat.port_a1, souCDW.ports[1]) annotation (Line(points={{-8,6},{-54,6}, - {-54,30},{-60,30}}, color={0,127,255})); - connect(sinCDW.ports[1], cat.port_b1) annotation (Line(points={{60,30},{18,30}, - {18,6},{12,6}}, color={0,127,255})); - annotation ( - experiment(Tolerance=1e-06, StopTime=3600), - Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), - Icon(coordinateSystem(extent={{-100,-100},{100,100}})), - __Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mos" - "Simulate and plot"), - Documentation(info=" -

    -(Draft) This is a validation model where the plant is configured to allow -remotely charging the tank. -

    -Operation modes implemented in time tables: -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PlantChillerTankFlow directionTank flow rate setpoint
    1.offoffoffN/A0
    2.offonchargingN/A-1
    3.ononchargingnormal-1
    4.ononoffnormal0
    5.onondischargingnormal1
    6.onoffdischargingnormal1
    7.onoffchargingreverse-1
    -", revisions=" -
      -
    • -February 18, 2022 by Hongxiang Fu:
      -First implementation. This is for -#2859. -
    • -
    -")); -end ChillerAndTankWithRemoteCharging; diff --git a/Buildings/Fluid/Storage/Plant/Validation/NoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/NoRemoteCharging.mo new file mode 100644 index 00000000000..d961f01b2cf --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/Validation/NoRemoteCharging.mo @@ -0,0 +1,53 @@ +within Buildings.Fluid.Storage.Plant.Validation; +model NoRemoteCharging + "(Draft) Validation model of the plant not allowing remote charging" + extends Modelica.Icons.Example; + extends + Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialTankBranch( + tanBra(final allowRemoteCharging=false), + souChi(final m_flow=1)); + + Modelica.Blocks.Sources.TimeTable set_mPumSec_flow(table=[0,1; 900,1; 900,-1; + 1800,-1; 1800,0; 2700,0; 2700,1; 3600,1]) + "Secondary mass flow rate setpoint" + annotation (Placement(transformation(extent={{-100,0},{-80,20}}))); + Buildings.Controls.Continuous.LimPID conPID_PumSec( + k=1, + Ti=15) "PI controller" annotation (Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=180, + origin={-50,10}))); + Modelica.Blocks.Math.Gain gai(k=1/tanBra.mTan_flow_nominal) "Gain" + annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=270, + origin={-50,-30}))); +equation + connect(gai.y, conPID_PumSec.u_m) + annotation (Line(points={{-50,-19},{-50,-2}}, color={0,0,127})); + connect(set_mPumSec_flow.y, conPID_PumSec.u_s) + annotation (Line(points={{-79,10},{-62,10}}, color={0,0,127})); + connect(conPID_PumSec.y, tanBra.yPum) annotation (Line(points={{-39,10},{-39, + 8},{-16,8},{-16,2},{-11,2}}, color={0,0,127})); + connect(tanBra.mTan_flow, gai.u) annotation (Line(points={{11,2},{36,2},{36,-48}, + {-50,-48},{-50,-42}}, color={0,0,127})); + annotation (__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/NoRemoteCharging.mos" + "Simulate and plot"), + experiment(Tolerance=1e-06, StopTime=3600), + Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), + Icon(coordinateSystem(extent={{-100,-100},{100,100}})), + Documentation(info=" +

    +(Draft) This is a validation model where the plant is configured not to allow +remotely charging the tank. +

    +", revisions=" +
      +
    • +February 18, 2022 by Hongxiang Fu:
      +First implementation. This is for +#2859. +
    • +
    +")); +end NoRemoteCharging; diff --git a/Buildings/Fluid/Storage/Plant/Validation/WithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/WithRemoteCharging.mo new file mode 100644 index 00000000000..0aed495b45f --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/Validation/WithRemoteCharging.mo @@ -0,0 +1,142 @@ +within Buildings.Fluid.Storage.Plant.Validation; +model WithRemoteCharging + "(Draft) Validation model of the plant allowing remote charging" + extends Modelica.Icons.Example; + extends + Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialTankBranch( + tanBra(final allowRemoteCharging=true), + souChi(final use_m_flow_in=true)); + + Modelica.Blocks.Sources.TimeTable set_mTan_flow(table=[0,0; 3600/7,0; 3600/7, + -1; 3600/7*3,-1; 3600/7*3,0; 3600/7*4,0; 3600/7*4,1; 3600/7*6,1; 3600/7 + *6,-1]) + "Tank flow rate setpoint" + annotation (Placement(transformation(extent={{-100,-40},{-80,-20}}))); + Modelica.Blocks.Sources.BooleanTable uRemCha(table={0,3600/7*6}, startValue= + true) "Tank is being charged remotely" + annotation (Placement(transformation(extent={{-100,-70},{-80,-50}}))); + Modelica.Blocks.Sources.BooleanTable uOnl(table={3600/7*2}) + "True = plant online (outputting CHW to the network); False = offline" + annotation (Placement(transformation(extent={{-100,-100},{-80,-80}}))); + Modelica.Blocks.Sources.TimeTable set_mChi_flow(table=[0,0; 3600/7,0; 3600/7, + 1; 3600/7*5,1; 3600/7*5,0]) "Chiller flow rate setpoint" + annotation (Placement(transformation(extent={{0,60},{20,80}}))); + Buildings.Fluid.Storage.Plant.BaseClasses.ReversiblePumpValveControl + conPumSecGro "Control block for secondary pump-valve group" + annotation (Placement(transformation(extent={{-60,-8},{-40,12}}))); +equation + connect(set_mTan_flow.y, conPumSecGro.mTanSet_flow) annotation (Line(points={{-79,-30}, + {-70,-30},{-70,-2},{-61,-2}}, color={0,0,127})); + connect(tanBra.mTan_flow, conPumSecGro.mTan_flow) annotation (Line(points={{ + 11,2},{58,2},{58,98},{-78,98},{-78,2},{-61,2}}, color={0,0,127})); + connect(tanBra.yPum, conPumSecGro.yPumSec) + annotation (Line(points={{-11,2},{-39,2}}, color={0,0,127})); + connect(conPumSecGro.yValCha, tanBra.yValCha) + annotation (Line(points={{-39,6},{-11,6}}, color={0,0,127})); + connect(tanBra.yValDis, conPumSecGro.yValDis) + annotation (Line(points={{-11,10},{-39,10}}, color={0,0,127})); + connect(uRemCha.y, conPumSecGro.uRemCha) annotation (Line(points={{-79,-60},{ + -58,-60},{-58,-10}}, + color={255,0,255})); + connect(uOnl.y, conPumSecGro.uOnl) annotation (Line(points={{-79,-90},{-54,-90}, + {-54,-10}}, color={255,0,255})); + connect(tanBra.yValCha_actual, conPumSecGro.yValCha_actual) annotation (Line( + points={{11,6},{54,6},{54,94},{-74,94},{-74,6},{-61,6}}, color={0,0,127})); + connect(tanBra.yValDis_actual, conPumSecGro.yValDis_actual) annotation (Line( + points={{11,10},{50,10},{50,90},{-70,90},{-70,10},{-61,10}}, color={0,0, + 127})); + connect(set_mChi_flow.y, souChi.m_flow_in) + annotation (Line(points={{21,70},{28,70},{28,42}}, color={0,0,127})); + annotation ( + experiment(Tolerance=1e-06, StopTime=3600), + Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), + Icon(coordinateSystem(extent={{-100,-100},{100,100}})), + __Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/WithRemoteCharging.mos" + "Simulate and plot"), + Documentation(info=" +

    +(Draft) This is a validation model where the plant is configured to allow +remotely charging the tank. +

    +Operation modes implemented in time tables: +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    PlantChillerTankFlow directionTank flow rate setpoint
    1.offoffoffN/A0
    2.offonchargingN/A-1
    3.ononchargingnormal-1
    4.ononoffnormal0
    5.onondischargingnormal1
    6.onoffdischargingnormal1
    7.onoffchargingreverse-1
    +", revisions=" +
      +
    • +February 18, 2022 by Hongxiang Fu:
      +First implementation. This is for +#2859. +
    • +
    +")); +end WithRemoteCharging; diff --git a/Buildings/Fluid/Storage/Plant/Validation/package.order b/Buildings/Fluid/Storage/Plant/Validation/package.order index 0541e3545f4..c7f0b547ae0 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/package.order +++ b/Buildings/Fluid/Storage/Plant/Validation/package.order @@ -1,2 +1,3 @@ -ChillerAndTankNoRemoteCharging -ChillerAndTankWithRemoteCharging +NoRemoteCharging +WithRemoteCharging +BaseClasses diff --git a/Buildings/Fluid/Storage/Plant/package.order b/Buildings/Fluid/Storage/Plant/package.order index 27d0441d404..1bd95e85bd1 100644 --- a/Buildings/Fluid/Storage/Plant/package.order +++ b/Buildings/Fluid/Storage/Plant/package.order @@ -1,4 +1,4 @@ -ChillerAndTank +TankBranch Examples Validation BaseClasses From eea61119795560121a81462a04684620ab42da8b Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Wed, 16 Mar 2022 16:10:55 -0700 Subject: [PATCH 072/463] update unit tests (except TwoSourcesThreeUsers) --- ..._Storage_Plant_Examples_OneSourceOneUser.txt | 12 ++++++------ ...torage_Plant_Validation_NoRemoteCharging.txt | 17 +++++++++++++++++ ...rage_Plant_Validation_WithRemoteCharging.txt | 17 +++++++++++++++++ .../Storage/Plant/Examples/OneSourceOneUser.mos | 2 +- ...oRemoteCharging.mos => NoRemoteCharging.mos} | 8 ++++---- ...emoteCharging.mos => WithRemoteCharging.mos} | 6 +++--- ....Storage.Plant.Examples.OneSourceOneUser.mos | 6 +++--- ...alidation.ChillerAndTankNoRemoteCharging.mos | 6 ------ ...idation.ChillerAndTankWithRemoteCharging.mos | 6 ------ ...torage.Plant.Validation.NoRemoteCharging.mos | 6 ++++++ ...rage.Plant.Validation.WithRemoteCharging.mos | 6 ++++++ 11 files changed, 63 insertions(+), 29 deletions(-) create mode 100644 Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_NoRemoteCharging.txt create mode 100644 Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_WithRemoteCharging.txt rename Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/{ChillerAndTankNoRemoteCharging.mos => NoRemoteCharging.mos} (50%) rename Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/{ChillerAndTankWithRemoteCharging.mos => WithRemoteCharging.mos} (56%) delete mode 100644 Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ChillerAndTankNoRemoteCharging.mos delete mode 100644 Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ChillerAndTankWithRemoteCharging.mos create mode 100644 Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.NoRemoteCharging.mos create mode 100644 Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.WithRemoteCharging.mos diff --git a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_OneSourceOneUser.txt b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_OneSourceOneUser.txt index 36d198026d6..78d63c98d16 100644 --- a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_OneSourceOneUser.txt +++ b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_OneSourceOneUser.txt @@ -1,7 +1,7 @@ -last-generated=2022-03-14 +last-generated=2022-03-16 statistics-initialization= { - "nonlinear": "1, 0, 1, 1", + "nonlinear": "2, 0, 1, 1", "numerical Jacobians": "0" } statistics-simulation= @@ -12,7 +12,7 @@ statistics-simulation= "numerical Jacobians": "0" } time=[0e+00, 3.6e+03] -cat.pumPri.m_flow=[0e+00, 4.999552965164185e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01] -cat.mTan_flow=[0e+00, -4.999551773071289e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, 2.893969416618347e-01, 3.502776920795441e-01, 3.745021224021912e-01, 3.929356634616852e-01, 4.070073962211609e-01, 4.177742600440979e-01, 4.260265231132507e-01, 4.318293333053589e-01, 4.110586643218994e-01, 4.04619425535202e-01, 4.037973880767822e-01, 4.040806889533997e-01, 4.045733213424683e-01, 4.05122309923172e-01, 4.056960344314575e-01, 4.062855541706085e-01, 4.068860113620758e-01, 4.074938297271729e-01, 4.081068336963654e-01, 4.087235927581787e-01, 4.093431234359741e-01, 4.099647402763367e-01, 4.105879962444305e-01, 4.112125039100647e-01, 4.118382036685944e-01, 4.1246497631073e-01, 4.130928516387939e-01, 4.137217998504639e-01, 4.143518507480621e-01, 4.149830341339111e-01, 4.156154692173004e-01, 4.162492156028748e-01, 4.168843924999237e-01, -2.810051441192627e-01, -4.999998211860657e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01] -cat.pumSec.m_flow=[0e+00, 1.074058886274543e-07, 1.138643952458551e-07, 1.187495826115992e-07, 1.224258596721484e-07, 1.251844281568992e-07, 1.272499758897538e-07, 1.287942552608001e-07, 1.299478924465802e-07, 1.308092549834328e-07, 1.314519266770731e-07, 1.319312588066168e-07, 1.322886333809947e-07, 1.32554973220067e-07, 1.327534278061648e-07, 1.329012917494765e-07, 1.330114258735193e-07, 1.330933798726619e-07, 1.331544439153731e-07, 1.331999754938806e-07, 1.332339252257952e-07, 1.332592489688977e-07, 1.332781209839595e-07, 1.332921755192729e-07, 1.33302648919198e-07, 1.333104506784366e-07, 1.333162771288698e-07, 1.333206256504127e-07, 1.333238657252878e-07, 1.333262673597346e-07, 1.333280721382835e-07, 1.333294079586267e-07, 1.333304027184568e-07, 1.333311558937567e-07, 7.893969416618347e-01, 8.502776622772217e-01, 8.745021224021912e-01, 8.929356932640076e-01, 9.070073962211609e-01, 9.177742600440979e-01, 9.260265231132507e-01, 9.318293333053589e-01, 9.110586643218994e-01, 9.046193957328796e-01, 9.037973880767822e-01, 9.040806889533997e-01, 9.045733213424683e-01, 9.051223397254944e-01, 9.056960344314575e-01, 9.062855839729309e-01, 9.068859815597534e-01, 9.074938297271729e-01, 9.08106803894043e-01, 9.087235927581787e-01, 9.093431234359741e-01, 9.099647402763367e-01, 9.105879664421082e-01, 9.112125039100647e-01, 9.11838173866272e-01, 9.1246497631073e-01, 9.130928516387939e-01, 9.137217998504639e-01, 9.143518209457397e-01, 9.149830341339111e-01, 9.15615439414978e-01, 9.162492156028748e-01, 9.168843626976013e-01, 2.189948409795761e-01, 1.645939136096786e-07, 1.559465090394951e-07, 1.500950190802541e-07, 1.457720912867444e-07, 1.425723468173601e-07, 1.40200498321974e-07, 1.384403276460944e-07, 1.371328863797316e-07, 1.361610628691778e-07, 1.354383414309268e-07, 1.349006595319224e-07, 1.345004392305782e-07, 1.34202508661474e-07, 1.339806772193697e-07, 1.338154902441602e-07, 1.336924668748907e-07, 1.336008494945418e-07, 1.335326089701994e-07, 1.334817625320284e-07, 1.334439048150671e-07, 1.334157104793121e-07, 1.333947636794619e-07, 1.333791459501299e-07, 1.333675356818276e-07, 1.333588670604513e-07, 1.333524011215559e-07, 1.33347555220098e-07, 1.333439456630003e-07, 1.333412456006045e-07, 1.333392418700896e-07, 1.333377497303445e-07, 1.33336627072822e-07, 1.333357886323938e-07] -usr.yVal_actual=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 9.211110472679138e-01, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 9.946639537811279e-01, 9.245693683624268e-01, 9.071856737136841e-01, 9.031168222427368e-01, 9.018986821174622e-01, 9.015378952026367e-01, 9.016034603118896e-01, 9.019418358802795e-01, 9.024718403816223e-01, 9.031393527984619e-01, 9.039061665534973e-01, 9.047455191612244e-01, 9.056385159492493e-01, 9.065719246864319e-01, 9.075362086296082e-01, 9.08524751663208e-01, 9.095327258110046e-01, 9.105567336082458e-01, 9.115946888923645e-01, 9.126449227333069e-01, 9.137066006660461e-01, 9.147792458534241e-01, 9.158623814582825e-01, 9.169560670852661e-01, 9.180601239204407e-01, 9.191747307777405e-01, 2.95667439699173e-01, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] +chiBra.m_flow=[0e+00, 4.999552965164185e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01, 5e-01] +tanBra.mTan_flow=[0e+00, -4.999551773071289e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, 2.893969118595123e-01, 3.502776324748993e-01, 3.745020627975464e-01, 3.929356336593628e-01, 4.070073962211609e-01, 4.177742600440979e-01, 4.260265231132507e-01, 4.31829422712326e-01, 4.110587537288666e-01, 4.04619425535202e-01, 4.037974178791046e-01, 4.040806889533997e-01, 4.045733511447906e-01, 4.05122309923172e-01, 4.056960344314575e-01, 4.062855541706085e-01, 4.068860113620758e-01, 4.074938297271729e-01, 4.081068336963654e-01, 4.087235927581787e-01, 4.093431234359741e-01, 4.099647402763367e-01, 4.105879962444305e-01, 4.112125039100647e-01, 4.118382036685944e-01, 4.1246497631073e-01, 4.130928516387939e-01, 4.137217998504639e-01, 4.143518507480621e-01, 4.149830341339111e-01, 4.156154692173004e-01, 4.162492156028748e-01, 4.168843924999237e-01, -2.810051441192627e-01, -4.999998211860657e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998509883881e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01, -4.999998807907104e-01] +tanBra.pum.m_flow=[0e+00, 1.074193249905875e-07, 1.138746412721048e-07, 1.187569793614784e-07, 1.22431416116342e-07, 1.251885208830572e-07, 1.272531306995006e-07, 1.28796955323196e-07, 1.299502088158988e-07, 1.30811088183691e-07, 1.314534330276729e-07, 1.319324240967035e-07, 1.322895428756965e-07, 1.325555700759651e-07, 1.327538541318063e-07, 1.329015901774255e-07, 1.330116958797589e-07, 1.330937067223203e-07, 1.331548276084504e-07, 1.332003449761032e-07, 1.33234237864599e-07, 1.332594905534279e-07, 1.332782773033614e-07, 1.332922892061106e-07, 1.33302748395181e-07, 1.333105359435649e-07, 1.333163339722887e-07, 1.333206682829768e-07, 1.333238941469972e-07, 1.333262957814441e-07, 1.333280863491382e-07, 1.333294221694814e-07, 1.333304027184568e-07, 1.333311274720472e-07, 7.893968820571899e-01, 8.502776026725769e-01, 8.745020627975464e-01, 8.929356336593628e-01, 9.070073962211609e-01, 9.177742600440979e-01, 9.260265231132507e-01, 9.318294525146484e-01, 9.110587239265442e-01, 9.046193957328796e-01, 9.037973880767822e-01, 9.040806889533997e-01, 9.045733213424683e-01, 9.051223397254944e-01, 9.056960344314575e-01, 9.062855839729309e-01, 9.068859815597534e-01, 9.074938297271729e-01, 9.08106803894043e-01, 9.087235927581787e-01, 9.093431234359741e-01, 9.099647402763367e-01, 9.105879664421082e-01, 9.112125039100647e-01, 9.11838173866272e-01, 9.1246497631073e-01, 9.130928516387939e-01, 9.137217998504639e-01, 9.143518209457397e-01, 9.149830341339111e-01, 9.15615439414978e-01, 9.162492156028748e-01, 9.168843626976013e-01, 2.189948409795761e-01, 1.645938851879691e-07, 1.559465232503499e-07, 1.500948343391428e-07, 1.457721339193085e-07, 1.425725457693261e-07, 1.402011520212909e-07, 1.384413650384886e-07, 1.371335400790485e-07, 1.361614749839646e-07, 1.354385688046023e-07, 1.349009863815809e-07, 1.345005529174159e-07, 1.342024944506193e-07, 1.339805777433867e-07, 1.338153907681772e-07, 1.336923389771982e-07, 1.336007642294135e-07, 1.335325094942164e-07, 1.334817198994642e-07, 1.334438479716482e-07, 1.33415667846748e-07, 1.333946499926242e-07, 1.333790180524375e-07, 1.333673367298616e-07, 1.333586681084853e-07, 1.333522021695899e-07, 1.33347356268132e-07, 1.33343760921889e-07, 1.333410892812026e-07, 1.333390997615425e-07, 1.333376218326521e-07, 1.33336527596839e-07, 1.333357033672655e-07] +usr.yVal_actual=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 9.211111068725586e-01, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 9.946646094322205e-01, 9.245695471763611e-01, 9.071856737136841e-01, 9.031168222427368e-01, 9.018986821174622e-01, 9.015378952026367e-01, 9.016034603118896e-01, 9.019418358802795e-01, 9.024717807769775e-01, 9.031393527984619e-01, 9.039061665534973e-01, 9.047455191612244e-01, 9.056385159492493e-01, 9.065719246864319e-01, 9.075362086296082e-01, 9.08524751663208e-01, 9.095327258110046e-01, 9.105567336082458e-01, 9.115946888923645e-01, 9.126449227333069e-01, 9.137066006660461e-01, 9.147792458534241e-01, 9.158623814582825e-01, 9.169560670852661e-01, 9.180601239204407e-01, 9.191747307777405e-01, 2.95667439699173e-01, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] diff --git a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_NoRemoteCharging.txt b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_NoRemoteCharging.txt new file mode 100644 index 00000000000..fd9f5b528e2 --- /dev/null +++ b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_NoRemoteCharging.txt @@ -0,0 +1,17 @@ +last-generated=2022-03-16 +statistics-initialization= +{ + "nonlinear": "2, 0", + "numerical Jacobians": "0" +} +statistics-simulation= +{ + "linear": "0", + "nonlinear": "1", + "number of continuous time states": "11", + "numerical Jacobians": "0" +} +time=[0e+00, 3.6e+03] +sinChi.ports[1].m_flow=[1e+00, 1e+00] +tanBra.mTan_flow=[-1.001265048980713e+00, 9.169799089431763e-01, 9.912211894989014e-01, 9.99064028263092e-01, 9.998988509178162e-01, 9.999899864196777e-01, 9.999997615814209e-01, 1e+00, 9.999998807907104e-01, 9.999999403953552e-01, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, -9.93547260761261e-01, -9.991814494132996e-01, -9.998003840446472e-01, -9.999150633811951e-01, -9.999505281448364e-01, -9.99966025352478e-01, -9.999744892120361e-01, -9.999796748161316e-01, -9.999831318855286e-01, -9.999855160713196e-01, -9.999873638153076e-01, -9.999887943267822e-01, -9.99989926815033e-01, -9.999908804893494e-01, -9.999916553497314e-01, -9.99992311000824e-01, -9.99992847442627e-01, -9.999933242797852e-01, -9.999937415122986e-01, -9.999940991401672e-01, -9.999944567680359e-01, -9.999947547912598e-01, -9.999949932098389e-01, -9.99995231628418e-01, -9.999954700469971e-01, -3.814061172306538e-03, -3.726346185430884e-04, -3.494125849101692e-05, -3.209917167623604e-06, -2.561800442890629e-07, 1.16928468685273e-07, 5.044782014351767e-08, 2.315961644683284e-08, 1.511626024353063e-08, 7.072901819782373e-09, 3.143152405016281e-09, 2.630249795743111e-09, 2.117349184871387e-09, 1.604451238534921e-09, 1.091548518239449e-09, 5.786517376371592e-10, 2.286907885284961e-10, 2.636106888331824e-10, 2.985306724045955e-10, 3.334509612873404e-10, 3.683706673029974e-10, 4.032903455630787e-10, 4.382101348454626e-10, 4.731260383472602e-10, 5.080453280292829e-10, 9.93556797504425e-01, 9.993329048156738e-01, 9.999270439147949e-01, 9.999919533729553e-01, 9.999989867210388e-01, 9.999997019767761e-01, 9.999998211860657e-01, 9.999998807907104e-01, 9.999998211860657e-01, 9.999999403953552e-01, 1e+00, 1e+00, 9.999999403953552e-01, 9.999999403953552e-01, 9.999999403953552e-01, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00] +tanBra.pum.m_flow=[-1.265011727809906e-03, 1.916979908943176e+00, 1.991221189498901e+00, 1.999064087867737e+00, 1.999898910522461e+00, 1.999989986419678e+00, 1.999999761581421e+00, 2e+00, 1.99999988079071e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 6.45271735265851e-03, 8.185562910512053e-04, 1.996251667151222e-04, 8.496473310515285e-05, 4.949296999257058e-05, 3.397498585400172e-05, 2.551296347519383e-05, 2.032646989391651e-05, 1.688100019237027e-05, 1.445524867449421e-05, 1.263249578187242e-05, 1.120394153986126e-05, 1.005525246000616e-05, 9.117648914980236e-06, 8.340445674548391e-06, 7.686961907893419e-06, 7.131500751711428e-06, 6.654043318121694e-06, 6.239014510356355e-06, 5.874962425878039e-06, 5.551251888391562e-06, 5.263710590952542e-06, 5.005094863008708e-06, 4.770889972860459e-06, 4.557946340355556e-06, 9.961859583854675e-01, 9.996273517608643e-01, 9.999650716781616e-01, 9.999967813491821e-01, 9.999997615814209e-01, 1.00000011920929e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1.99355673789978e+00, 1.999332904815674e+00, 1.999927043914795e+00, 1.9999920129776e+00, 1.999998927116394e+00, 1.999999761581421e+00, 1.99999988079071e+00, 1.99999988079071e+00, 1.99999988079071e+00, 1.99999988079071e+00, 2e+00, 2e+00, 1.99999988079071e+00, 1.99999988079071e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00, 2e+00] diff --git a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_WithRemoteCharging.txt b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_WithRemoteCharging.txt new file mode 100644 index 00000000000..f2e3277cbd3 --- /dev/null +++ b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_WithRemoteCharging.txt @@ -0,0 +1,17 @@ +last-generated=2022-03-16 +statistics-initialization= +{ + "nonlinear": "2, 0", + "numerical Jacobians": "0" +} +statistics-simulation= +{ + "linear": "0", + "nonlinear": "2", + "number of continuous time states": "16", + "numerical Jacobians": "0" +} +time=[0e+00, 3.6e+03] +sinChi.ports[1].m_flow=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] +tanBra.mTan_flow=[-3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -3.999494424533623e-07, -1.000000357627869e+00, -1.000000357627869e+00, -1.000000357627869e+00, -1.000000357627869e+00, -1.000000357627869e+00, -1.000000357627869e+00, -1.000000357627869e+00, -1.000000357627869e+00, -1.000000357627869e+00, -1.000000357627869e+00, -1.000000357627869e+00, -1.000000357627869e+00, -1.000000357627869e+00, -1.000000357627869e+00, -1.001264810562134e+00, -1.001264691352844e+00, -1.001264333724976e+00, -1.001263856887817e+00, -1.00126326084137e+00, -1.001262545585632e+00, -1.001261830329895e+00, -1.001260876655579e+00, -1.001259803771973e+00, -1.001258611679077e+00, -1.001257300376892e+00, -1.001255989074707e+00, -1.001254439353943e+00, -1.001252770423889e+00, -1.00075089931488e+00, -6.383970379829407e-02, -3.128929436206818e-02, -1.532898377627134e-02, -7.51072634011507e-03, -3.681338625028729e-03, -1.804253668524325e-03, -8.843700052239001e-04, -4.334535624366254e-04, -2.124786988133565e-04, -1.047123005264439e-04, -5.195966878090964e-05, -2.584225148893882e-05, -1.277988030778937e-05, -6.348328952299198e-06, 9.871014952659607e-01, 9.935625791549683e-01, 9.968105554580688e-01, 9.984189867973328e-01, 9.992181062698364e-01, 9.996131658554077e-01, 9.99808669090271e-01, 9.999050498008728e-01, 9.999520182609558e-01, 9.999757409095764e-01, 9.99988317489624e-01, 9.999945163726807e-01, 9.999972581863403e-01, 9.999985098838806e-01, 1.002025008201599e+00, 1.002872467041016e+00, 1.001416325569153e+00, 1.000699520111084e+00, 1.000344753265381e+00, 1.000169396400452e+00, 1.000083327293396e+00, 1.000041007995605e+00, 1.000020503997803e+00, 1.00001049041748e+00, 1.00000524520874e+00, 1.00000274181366e+00, 1.000001549720764e+00, 1.000000834465027e+00, -1.298325718380511e-03, -1.405618968419731e-03, -1.010758504271507e-01, -1.07829761505127e+00, -9.686154127120972e-01, -9.933347105979919e-01, -9.95650589466095e-01, -9.979424476623535e-01, -9.989730715751648e-01, -9.994922280311584e-01, -9.997453093528748e-01, -9.998751878738403e-01, -9.999383687973022e-01, -9.99968945980072e-01, -9.999845623970032e-01] +tanBra.pum.m_flow=[-2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.666160980879795e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -2.399544882791815e-07, -1.264673774130642e-03, -1.264615915715694e-03, -1.264256425201893e-03, -1.26377958804369e-03, -1.263186568394303e-03, -1.262477948330343e-03, -1.26165384426713e-03, -1.260714721865952e-03, -1.259660813957453e-03, -1.258492702618241e-03, -1.257210853509605e-03, -1.255815732292831e-03, -1.254307804629207e-03, -1.252687652595341e-03, -7.508368580602109e-04, 9.361604452133179e-01, 9.687108397483826e-01, 9.846711754798889e-01, 9.924893975257874e-01, 9.963188171386719e-01, 9.981958866119385e-01, 9.991157650947571e-01, 9.995666742324829e-01, 9.997876286506653e-01, 9.998953938484192e-01, 9.999481439590454e-01, 9.999743103981018e-01, 9.999873638153076e-01, 9.999938011169434e-01, 1.987101674079895e+00, 1.993562698364258e+00, 1.996810674667358e+00, 1.998419165611267e+00, 1.999218225479126e+00, 1.999613285064697e+00, 1.999808788299561e+00, 1.999905228614807e+00, 1.99995219707489e+00, 1.999975919723511e+00, 1.999988436698914e+00, 1.99999463558197e+00, 1.99999737739563e+00, 1.999998688697815e+00, 1.002025127410889e+00, 1.002872586250305e+00, 1.001416563987732e+00, 1.000699639320374e+00, 1.00034487247467e+00, 1.000169634819031e+00, 1.000083446502686e+00, 1.000041127204895e+00, 1.000020623207092e+00, 1.00001060962677e+00, 1.00000536441803e+00, 1.000002980232239e+00, 1.000001668930054e+00, 1.000000953674316e+00, -1.298192422837019e-03, -1.405485672876239e-03, -1.402487047016621e-03, -1.233505201525986e-03, -8.664502529427409e-04, -4.15162940043956e-05, -1.396603693137877e-06, -3.217810160549561e-07, -2.483992886936903e-07, -2.408941384146601e-07, -2.400672087787825e-07, -2.399688412424439e-07, -2.39959007330981e-07, -2.399566767508077e-07, -2.399553693521739e-07] diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos index 9779f6a207a..a0186b77826 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos @@ -6,7 +6,7 @@ simulateModel("Buildings.Fluid.Storage.Plant.Examples.OneSourceOneUser", // Plot commands createPlot(id=1, position={15, 15, 1027, 480}, - y={"cat.pumPri.m_flow", "cat.mTan_flow", "cat.pumSec.m_flow"}, + y={"chiBra.m_flow", "tanBra.mTan_flow", "tanBra.pum.m_flow"}, range={0.0, 3600.0, -1.0, 1.0}, grid=true, subPlot=101, diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/NoRemoteCharging.mos similarity index 50% rename from Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mos rename to Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/NoRemoteCharging.mos index 0754bb0c779..11b5d17c049 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ChillerAndTankNoRemoteCharging.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/NoRemoteCharging.mos @@ -1,13 +1,13 @@ -simulateModel("Buildings.Fluid.Storage.Plant.Validation.ChillerAndTankNoRemoteCharging", +simulateModel("Buildings.Fluid.Storage.Plant.Validation.NoRemoteCharging", stopTime=3600, tolerance=1e-06, method="dassl", - resultFile="ChillerAndTankNoRemoteCharging"); + resultFile="NoRemoteCharging"); // Plot commands createPlot(id=1, position={15, 15, 961, 426}, - y={"cat.pumPri.m_flow", "cat.mTan_flow", "cat.pumSec.m_flow"}, - range={0.0, 3600.0, -4.0, 6.0}, + y={"sinChi.ports[1].m_flow", "tanBra.mTan_flow", "tanBra.pum.m_flow"}, + range={0.0, 3600.0, -1.5, 2.5}, grid=true, colors={{28,108,200}, {238,46,47}, {0,140,72}}, timeUnit="s", diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/WithRemoteCharging.mos similarity index 56% rename from Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mos rename to Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/WithRemoteCharging.mos index 547c7571983..ddf7bfac2c0 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ChillerAndTankWithRemoteCharging.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/WithRemoteCharging.mos @@ -1,12 +1,12 @@ -simulateModel("Buildings.Fluid.Storage.Plant.Validation.ChillerAndTankWithRemoteCharging", +simulateModel("Buildings.Fluid.Storage.Plant.Validation.WithRemoteCharging", stopTime=3600, tolerance=1e-06, method="dassl", - resultFile="ChillerAndTankWithRemoteCharging"); + resultFile="WithRemoteCharging"); // Plot commands createPlot(id=1, position={15, 15, 929, 372}, - y={"cat.pumPri.m_flow", "cat.mTan_flow", "cat.pumSec.m_flow"}, + y={"sinChi.ports[1].m_flow", "tanBra.mTan_flow", "tanBra.pum.m_flow"}, range={0.0, 3600.0, -4.0, 3.0}, grid=true, colors={{28,108,200}, {238,46,47}, {0,140,72}}, diff --git a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.OneSourceOneUser.mos b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.OneSourceOneUser.mos index 36012e2bed6..995e26a1b25 100644 --- a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.OneSourceOneUser.mos +++ b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.OneSourceOneUser.mos @@ -1,7 +1,7 @@ compareVars := { - "cat.pumPri.m_flow", - "cat.mTan_flow", - "cat.pumSec.m_flow", + "chiBra.m_flow", + "tanBra.mTan_flow", + "tanBra.pum.m_flow", "usr.yVal_actual" }; diff --git a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ChillerAndTankNoRemoteCharging.mos b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ChillerAndTankNoRemoteCharging.mos deleted file mode 100644 index f12ab9cb76d..00000000000 --- a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ChillerAndTankNoRemoteCharging.mos +++ /dev/null @@ -1,6 +0,0 @@ -compareVars := - { - "cat.pumPri.m_flow", - "cat.mTan_flow", - "cat.pumSec.m_flow" - }; diff --git a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ChillerAndTankWithRemoteCharging.mos b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ChillerAndTankWithRemoteCharging.mos deleted file mode 100644 index f12ab9cb76d..00000000000 --- a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ChillerAndTankWithRemoteCharging.mos +++ /dev/null @@ -1,6 +0,0 @@ -compareVars := - { - "cat.pumPri.m_flow", - "cat.mTan_flow", - "cat.pumSec.m_flow" - }; diff --git a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.NoRemoteCharging.mos b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.NoRemoteCharging.mos new file mode 100644 index 00000000000..825c5ef761a --- /dev/null +++ b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.NoRemoteCharging.mos @@ -0,0 +1,6 @@ +compareVars := + { + "sinChi.ports[1].m_flow", + "tanBra.mTan_flow", + "tanBra.pum.m_flow" + }; diff --git a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.WithRemoteCharging.mos b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.WithRemoteCharging.mos new file mode 100644 index 00000000000..825c5ef761a --- /dev/null +++ b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.WithRemoteCharging.mos @@ -0,0 +1,6 @@ +compareVars := + { + "sinChi.ports[1].m_flow", + "tanBra.mTan_flow", + "tanBra.pum.m_flow" + }; From 05dcef4ee6921847c1b13c5ec7b267bdca298ef9 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Thu, 17 Mar 2022 10:30:35 -0700 Subject: [PATCH 073/463] changed TwoSourcesThreeUsers --- .../Examples/BaseClasses/ChillerBranch.mo | 9 +- .../Plant/Examples/TwoSourcesThreeUsers.mo | 543 ++++++++++-------- ...ge_Plant_Examples_TwoSourcesThreeUsers.txt | 22 +- .../Plant/Examples/TwoSourcesThreeUsers.mos | 4 +- ...ge.Plant.Examples.TwoSourcesThreeUsers.mos | 12 +- 5 files changed, 324 insertions(+), 266 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/ChillerBranch.mo b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/ChillerBranch.mo index a399b8744b1..fa56b31c3c8 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/ChillerBranch.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/ChillerBranch.mo @@ -38,8 +38,8 @@ model ChillerBranch final per=perChi) "Water cooled chiller (ports indexed 1 are on condenser side)" annotation (Placement(transformation(extent={{40,0},{20,20}}))); - Buildings.Controls.OBC.CDL.Logical.Sources.Constant onChi(k=true) - "Placeholder, chiller always on" + Buildings.Controls.OBC.CDL.Logical.Sources.Constant on(k=true) + "Placeholder, chiller always on" annotation (Placement(transformation(extent={{20,-80},{40,-60}}))); Modelica.Blocks.Sources.Constant set_TEvaLvg(k=T_b_nominal) "Evaporator leaving temperature setpoint" annotation (Placement( @@ -102,9 +102,8 @@ equation annotation (Line(points={{-60,0},{-40,0}}, color={0,127,255})); connect(port_b, port_b) annotation (Line(points={{100,0},{100,0}}, color={0,127,255})); - connect(onChi.y, chi.on) annotation (Line(points={{42,-70},{56,-70},{56,13},{ - 42,13}}, - color={255,0,255})); + connect(on.y, chi.on) annotation (Line(points={{42,-70},{56,-70},{56,13},{42, + 13}}, color={255,0,255})); connect(set_TEvaLvg.y, chi.TSet) annotation (Line(points={{41,-30},{50,-30},{ 50,7},{42,7}}, color={0,0,127})); diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index 5805490e705..9ff9a62aea2 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -3,8 +3,8 @@ model TwoSourcesThreeUsers "(Draft) District system model with two sources and three users" extends Modelica.Icons.Example; - package Medium1 = Buildings.Media.Water "Medium model for CDW"; - package Medium2 = Buildings.Media.Water "Medium model for CHW"; + package MediumCHW = Buildings.Media.Water "Medium model for CHW"; + package MediumCDW1 = Buildings.Media.Water "Medium model for CDW of chi1"; parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=1 "Nominal mass flow rate"; @@ -22,29 +22,184 @@ model TwoSourcesThreeUsers parameter Modelica.Units.SI.Power QCooLoa_flow_nominal=5*4200*0.6 "Nominal cooling load of one consumer"; - Buildings.Fluid.Storage.Plant.ChillerAndTank cat( - redeclare final package Medium1 = Medium1, - redeclare final package Medium2 = Medium2, - final mEva_flow_nominal=0.3*m_flow_nominal, - final mCon_flow_nominal=0.3*m_flow_nominal, - final mTan_flow_nominal=0.3*m_flow_nominal, +// First source: chiller only + Buildings.Fluid.Chillers.ElectricEIR chi1( + redeclare final package Medium1 = MediumCDW1, + redeclare final package Medium2 = MediumCHW, + m1_flow_nominal=1.2*chi1.m2_flow_nominal, + m2_flow_nominal=m_flow_nominal, + final dp1_nominal=0, + final dp2_nominal=0, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + p2_start=500000, + T2_start=T_CHWS_nominal, + final per=perChi1) + "Water cooled chiller (ports indexed 1 are on condenser side)" + annotation (Placement(transformation(extent={{10,-10},{-10,10}}, + rotation=90, + origin={-130,70}))); + parameter Buildings.Fluid.Chillers.Data.ElectricEIR.Generic perChi1( + QEva_flow_nominal=-1E6, + COP_nominal=3, + PLRMax=1, + PLRMinUnl=0.3, + PLRMin=0.3, + etaMotor=1, + mEva_flow_nominal=0.7*m_flow_nominal, + mCon_flow_nominal=1.2*perChi1.mEva_flow_nominal, + TEvaLvg_nominal=280.15, + capFunT={1,0,0,0,0,0}, + EIRFunT={1,0,0,0,0,0}, + EIRFunPLR={1,0,0}, + TEvaLvgMin=276.15, + TEvaLvgMax=288.15, + TConEnt_nominal=310.15, + TConEntMin=303.15, + TConEntMax=333.15) "Chiller performance data" annotation ( + choicesAllMatching=true, Placement(transformation(extent={{-180,120},{-160, + 140}}))); + Buildings.Fluid.Movers.SpeedControlled_y pumSup1( + redeclare package Medium = MediumCHW, + per(pressure( + dp=dp_nominal*{2,1.2,0}, + V_flow=(1.5*m_flow_nominal)/1.2*{0,1.2,2})), + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + allowFlowReversal=true, + addPowerToMedium=false, + y_start=0, + T_start=T_CHWR_nominal) "CHW supply pump for chi1" + annotation (Placement( + transformation( + extent={{10,-10},{-10,10}}, + rotation=0, + origin={-70,40}))); + Buildings.Fluid.FixedResistances.CheckValve cheValPumChi1( + redeclare package Medium = MediumCHW, + m_flow_nominal=chi1.m2_flow_nominal, + dpValve_nominal=0.1*dp_nominal, + dpFixed_nominal=0.1*dp_nominal) "Check valve" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={-110,40}))); + Buildings.Controls.Continuous.LimPID conPI_pumChi1( + controllerType=Modelica.Blocks.Types.SimpleController.PI, + k=1, + Ti=100, + reverseActing=true) "PI controller" annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=90, + origin={-10,110}))); + Modelica.Blocks.Sources.Constant set_TRet(k=12 + 273.15) + "CHW return setpoint" + annotation (Placement(transformation(extent={{20,100},{40,120}}))); + Buildings.Fluid.Sources.Boundary_pT sou_p( + redeclare final package Medium = MediumCHW, + final p=p_CHWR_nominal, + final T=T_CHWR_nominal, + nPorts=1) "Pressurisation point" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-170,10}))); + Buildings.Fluid.Sources.MassFlowSource_T souCDW1( + redeclare package Medium = MediumCDW1, + m_flow=1.2*chi1.m2_flow_nominal, + T=305.15, + nPorts=1) "Source representing CDW supply line" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-170,90}))); + Buildings.Fluid.Sources.Boundary_pT sinCDW1( + redeclare final package Medium = MediumCDW1, + final p=300000, + final T=310.15, + nPorts=1) "Sink representing CDW return line" annotation (Placement( + transformation( + extent={{10,10},{-10,-10}}, + rotation=180, + origin={-170,50}))); + Modelica.Blocks.Sources.Constant TEvaLvgSet(k=T_CHWS_nominal) + "Evaporator leaving temperature setpoint" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-90,130}))); + Buildings.Controls.OBC.CDL.Logical.Sources.Constant on(k=true) + "Placeholder, chiller always on" + annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-130,130}))); + +// Second source: chiller and tank + Buildings.Fluid.Storage.Plant.TankBranch tanBra( + redeclare final package Medium = MediumCHW, + final m_flow_nominal=1.5*m_flow_nominal, + final mTan_flow_nominal=0.75*m_flow_nominal, final dp_nominal=dp_nominal, final T_CHWS_nominal=T_CHWS_nominal, final T_CHWR_nominal=T_CHWR_nominal, - final preDroTan(final dp_nominal=cat.dp_nominal*0.1), - final valCha(final dpValve_nominal=cat.dp_nominal*0.1), - final valDis(final dpValve_nominal=cat.dp_nominal*0.1), - final cheValPumPri(final dpValve_nominal=cat.dp_nominal*0.1, - final dpFixed_nominal=cat.dp_nominal*0.1), - final cheValPumSec(final dpValve_nominal=cat.dp_nominal*0.1, - final dpFixed_nominal=cat.dp_nominal*0.1)) - "Chiller and tank, tank can be charged remotely" annotation (Placement( + final preDroTan(final dp_nominal=tanBra.dp_nominal*0.1), + final valCha(final dpValve_nominal=tanBra.dp_nominal*0.1), + final valDis(final dpValve_nominal=tanBra.dp_nominal*0.1), + final cheVal(final dpValve_nominal=0.1*tanBra.dp_nominal, + final dpFixed_nominal=0.1*tanBra.dp_nominal)) + "Tank branch, tank can be charged remotely" annotation (Placement( transformation( - extent={{10,-10},{-10,10}}, + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-70,-60}))); + Buildings.Fluid.Storage.Plant.Examples.BaseClasses.ChillerBranch chiBra2( + redeclare final package Medium = MediumCHW, + final m_flow_nominal=tanBra.m_flow_nominal - tanBra.mTan_flow_nominal, + final dp_nominal=dp_nominal, + final T_a_nominal=T_CHWR_nominal, + final T_b_nominal=T_CHWS_nominal, + final cheVal(final dpValve_nominal=0.1*chiBra2.dp_nominal, + final dpFixed_nominal=0.1*chiBra2.dp_nominal)) "Chiller branch" + annotation (Placement(transformation(extent={{-80,-20},{-60,0}}))); + Modelica.Blocks.Sources.BooleanTable uRemCha(table={3600/9*6,3600/9*8}, + startValue=false) "Tank is being charged remotely" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-170,-70}))); + Modelica.Blocks.Sources.BooleanTable uTanDis(table={3600/9*1,3600/9*6,3600/9* + 8}, startValue=false) + "True = discharging; false = charging (either local or remote)" annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-170,-110}))); + Buildings.Fluid.Storage.Plant.BaseClasses.ReversiblePumpValveControl conPumSecGro + "Control block for secondary pump-valve group" + annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + rotation=0, + origin={-110,-58}))); + Buildings.Controls.OBC.CDL.Conversions.BooleanToReal mTanSet_flow( + realTrue=0.75*m_flow_nominal, + realFalse=-0.75*m_flow_nominal) + "Set a positive flow rate when tank discharging and negative when charging" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={-130,-90}))); + Buildings.Controls.OBC.CDL.Conversions.BooleanToReal mChiBra2Set_flow( + realTrue=0, realFalse=chiBra2.m_flow_nominal) + "Set the flow rate to a constant value whenever the tank is not being charged remotely" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-110,-10}))); + Buildings.Controls.OBC.CDL.Logical.Or or2 "Tank charging remotely OR there is load" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=90, - origin={-60,-60}))); + origin={-100,-90}))); + +// Users Buildings.Fluid.Storage.Plant.Examples.BaseClasses.DummyUser usr1( - redeclare package Medium = Medium2, + redeclare package Medium = MediumCHW, m_flow_nominal=m_flow_nominal, p_a_nominal=p_CHWS_nominal - dp_nominal*0.35, p_b_nominal=p_CHWR_nominal + dp_nominal*0.35, @@ -55,7 +210,7 @@ model TwoSourcesThreeUsers rotation=-90, origin={60,60}))); Buildings.Fluid.Storage.Plant.Examples.BaseClasses.DummyUser usr2( - redeclare package Medium = Medium2, + redeclare package Medium = MediumCHW, m_flow_nominal=m_flow_nominal, p_a_nominal=p_CHWS_nominal - dp_nominal*0.35, p_b_nominal=p_CHWR_nominal + dp_nominal*0.35, @@ -66,7 +221,7 @@ model TwoSourcesThreeUsers rotation=-90, origin={60,0}))); Buildings.Fluid.Storage.Plant.Examples.BaseClasses.DummyUser usr3( - redeclare package Medium = Medium2, + redeclare package Medium = MediumCHW, m_flow_nominal=m_flow_nominal, p_a_nominal=p_CHWS_nominal - dp_nominal*0.35, p_b_nominal=p_CHWR_nominal + dp_nominal*0.35, @@ -76,27 +231,16 @@ model TwoSourcesThreeUsers extent={{-10,-10},{10,10}}, rotation=-90, origin={60,-60}))); - Buildings.Fluid.Movers.SpeedControlled_y pumChi1( - redeclare package Medium = Medium2, - per(pressure(dp=dp_nominal*{2,1.2,0}, V_flow=(m_flow_nominal*1.5)/1.2*{0,1.2,2})), - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - addPowerToMedium=false, - final y_start=1, - T_start=T_CHWR_nominal) "Supply pump for chiller 1" annotation (Placement( - transformation(extent={{-50,30},{-70,50}}, rotation=0))); Buildings.Controls.OBC.CDL.Continuous.MultiMin mulMin_dpUsr(nin=3) "Min of pressure head measured from all users" annotation (Placement(transformation(extent={{10,-10},{-10,10}}, - rotation=90, - origin={-10,130}))); + rotation=0, + origin={70,130}))); Modelica.Blocks.Sources.Constant set_dpUsr(k=1) "Normalised consumer differential pressure setpoint" annotation (Placement(transformation(extent={{-10,-10},{10,10}}, - rotation=-90, - origin={-60,150}))); - Modelica.Blocks.Sources.Constant set_TRet(k=12 + 273.15) - "CHW return setpoint" - annotation (Placement(transformation(extent={{20,100},{40,120}}))); + rotation=0, + origin={-50,130}))); Buildings.Controls.OBC.CDL.Continuous.Hysteresis hysCat(uLow=0.05, uHigh=0.5) "Shut off at con.yVal = 0.05 and restarts at 0.5" annotation (Placement( transformation( @@ -106,195 +250,86 @@ model TwoSourcesThreeUsers Buildings.Controls.OBC.CDL.Continuous.MultiMax mulMax_yVal(nin=3) "Max of valve positions" annotation (Placement(transformation(extent={{60,-120},{40,-100}}))); - Modelica.Blocks.Sources.Constant set_mChi2PumPri_flow(k=0.75*m_flow_nominal) - "Placeholder, primary flow rate setpoint" - annotation (Placement(transformation(extent={{-140,-80},{-120,-60}}))); - Buildings.Fluid.Sources.Boundary_pT sou_p( - redeclare final package Medium = Medium2, - final p=p_CHWR_nominal, - final T=T_CHWR_nominal, - nPorts=1) "Pressurisation point" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-170,30}))); - Buildings.Controls.Continuous.LimPID conPI_PumChi1( - controllerType=Modelica.Blocks.Types.SimpleController.PI, - k=1, - Ti=100, - reverseActing=true) "PI controller" annotation (Placement(transformation( + Modelica.Blocks.Sources.TimeTable set_QCooLoa1_flow(table=[0,0; 3600/9*1,0; + 3600/9*1,QCooLoa_flow_nominal; 3600/9*4,QCooLoa_flow_nominal; 3600/9*4, + 0; 3600,0]) + "Cooling load" + annotation (Placement(transformation(extent={{120,80},{100,100}}))); + Modelica.Blocks.Sources.TimeTable set_QCooLoa2_flow(table=[0,0; 3600/9*2,0; + 3600/9*2,QCooLoa_flow_nominal; 3600/9*5,QCooLoa_flow_nominal; 3600/9*5, + 0; 3600,0]) + "Cooling load" + annotation (Placement(transformation(extent={{120,20},{100,40}}))); + Modelica.Blocks.Sources.TimeTable set_QCooLoa3_flow(table=[0,0; 3600/9*3,0; + 3600/9*3,QCooLoa_flow_nominal; 3600/9*7,QCooLoa_flow_nominal; 3600/9*7, + 0; 3600,0]) "Cooling load" + annotation (Placement(transformation(extent={{120,-40},{100,-20}}))); + Modelica.Blocks.Math.Gain gaiUsr1(k=1/usr1.dp_nominal) + "Gain to normalise dp measurement" annotation (Placement(transformation( extent={{10,-10},{-10,10}}, - rotation=90, - origin={-60,110}))); + rotation=180, + origin={110,60}))); + Modelica.Blocks.Math.Gain gaiUsr2(k=1/usr2.dp_nominal) + "Gain to normalise dp measurement" annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=180, + origin={110,0}))); + Modelica.Blocks.Math.Gain gaiUsr3(k=1/usr3.dp_nominal) + "Gain to normalise dp measurement" annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=180, + origin={110,-60}))); + +// District pipe network Buildings.Fluid.FixedResistances.PressureDrop preDroS2U3( - redeclare package Medium = Medium2, + redeclare package Medium = MediumCHW, final allowFlowReversal=true, final dp_nominal=0.3*dp_nominal, final m_flow_nominal=m_flow_nominal) "Flow resistance source 2 to user 3" annotation (Placement(transformation(extent={{-30,-50},{-10,-30}}))); Buildings.Fluid.FixedResistances.PressureDrop preDroU3S2( - redeclare package Medium = Medium2, + redeclare package Medium = MediumCHW, final allowFlowReversal=true, final dp_nominal=0.3*dp_nominal, final m_flow_nominal=m_flow_nominal) "Flow resistance user 3 to source 2" annotation (Placement(transformation(extent={{30,-90},{10,-70}}))); Buildings.Fluid.FixedResistances.PressureDrop preDroS2U2( - redeclare package Medium = Medium2, + redeclare package Medium = MediumCHW, final allowFlowReversal=true, final dp_nominal=0.3*dp_nominal, final m_flow_nominal=m_flow_nominal) "Flow resistance source 2 to user 2" annotation (Placement(transformation(extent={{-30,-10},{-10,10}}))); Buildings.Fluid.FixedResistances.PressureDrop preDroU2S2( - redeclare package Medium = Medium2, + redeclare package Medium = MediumCHW, final allowFlowReversal=true, final dp_nominal=0.3*dp_nominal, final m_flow_nominal=m_flow_nominal) "Flow resistance user 2 to source 2" annotation (Placement(transformation(extent={{30,-30},{10,-10}}))); Buildings.Fluid.FixedResistances.PressureDrop preDroS1U2( - redeclare package Medium = Medium2, + redeclare package Medium = MediumCHW, final allowFlowReversal=true, final dp_nominal=0.3*dp_nominal, final m_flow_nominal=m_flow_nominal) "Flow resistance source 1 to user 2" annotation (Placement(transformation(extent={{-30,10},{-10,30}}))); Buildings.Fluid.FixedResistances.PressureDrop preDroU2S1( - redeclare package Medium = Medium2, + redeclare package Medium = MediumCHW, final allowFlowReversal=true, final dp_nominal=0.3*dp_nominal, final m_flow_nominal=m_flow_nominal) "Flow resistance user 2 to source 1" annotation (Placement(transformation(extent={{30,-10},{10,10}}))); Buildings.Fluid.FixedResistances.PressureDrop preDroS1U1( - redeclare package Medium = Medium2, + redeclare package Medium = MediumCHW, final allowFlowReversal=true, final dp_nominal=0.3*dp_nominal, final m_flow_nominal=m_flow_nominal) "Flow resistance source 1 to user 3" annotation (Placement(transformation(extent={{-30,70},{-10,90}}))); Buildings.Fluid.FixedResistances.PressureDrop preDroU1S1( - redeclare package Medium = Medium2, + redeclare package Medium = MediumCHW, final allowFlowReversal=true, final dp_nominal=0.3*dp_nominal, final m_flow_nominal=m_flow_nominal) "Flow resistance user 1 to source 1" annotation (Placement(transformation(extent={{30,30},{10,50}}))); - Modelica.Blocks.Sources.TimeTable set_QCooLoa1_flow(table=[0,0; 3600/9*1,0; - 3600/9*1,QCooLoa_flow_nominal; 3600/9*4,QCooLoa_flow_nominal; 3600/9*4, - 0; 3600,0]) - "Cooling load" - annotation (Placement(transformation(extent={{120,80},{100,100}}))); - Modelica.Blocks.Sources.TimeTable set_QCooLoa2_flow(table=[0,0; 3600/9*2,0; - 3600/9*2,QCooLoa_flow_nominal; 3600/9*5,QCooLoa_flow_nominal; 3600/9*5, - 0; 3600,0]) - "Cooling load" - annotation (Placement(transformation(extent={{120,20},{100,40}}))); - Modelica.Blocks.Sources.TimeTable set_QCooLoa3_flow(table=[0,0; 3600/9*3,0; - 3600/9*3,QCooLoa_flow_nominal; 3600/9*7,QCooLoa_flow_nominal; 3600/9*7, - 0; 3600,0]) "Cooling load" - annotation (Placement(transformation(extent={{120,-40},{100,-20}}))); - Modelica.Blocks.Math.Gain gaiUsr1(k=1/usr1.dp_nominal) - "Gain to normalise dp measurement" annotation (Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=180, - origin={110,60}))); - Modelica.Blocks.Math.Gain gaiUsr2(k=1/usr2.dp_nominal) - "Gain to normalise dp measurement" annotation (Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=180, - origin={110,0}))); - Modelica.Blocks.Math.Gain gaiUsr3(k=1/usr3.dp_nominal) - "Gain to normalise dp measurement" annotation (Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=180, - origin={110,-60}))); - Modelica.Blocks.Sources.BooleanTable uRemCha(table={3600/9*6,3600/9*8}, - startValue=false) "Tank is being charged remotely" annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-80,10}))); - Buildings.Controls.OBC.CDL.Continuous.Switch swiTanCha - "Tank setpoint: True = positive (discharging); False = negative (charging)" - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-110,-10}))); - Modelica.Blocks.Sources.Constant set_mTan_flow_discharge(k=0.75* - m_flow_nominal) "Placeholder, tank flow rate setpoint when discharging" - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-140,10}))); - Modelica.Blocks.Sources.Constant set_mTan_flow_charge(k=-0.75*m_flow_nominal) - "Placeholder, tank flow rate setpoint when charging" annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-140,-30}))); - Modelica.Blocks.Sources.BooleanTable booTanCha(table={3600/9*1,3600/9*6,3600/ - 9*8},startValue=false) - "Tank charging status (local or remote): True = discharging; False = charging" - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-170,-10}))); - Buildings.Fluid.Sources.MassFlowSource_T souCDW2( - redeclare package Medium = Medium1, - m_flow=1, - T=305.15, - nPorts=1) "Source representing CDW supply line" - annotation (Placement(transformation(extent={{-108,-50},{-88,-30}}))); - Buildings.Fluid.Sources.Boundary_pT sinCDW2( - redeclare final package Medium = Medium1, - final p=300000, - final T=310.15, - nPorts=1) "Sink representing CDW return line" annotation (Placement( - transformation( - extent={{10,10},{-10,-10}}, - rotation=180, - origin={-100,-100}))); - Buildings.Fluid.Chillers.ElectricEIR chi1( - redeclare final package Medium1 = Medium1, - redeclare final package Medium2 = Medium2, - final m1_flow_nominal=1.2*chi1.m2_flow_nominal, - final m2_flow_nominal=0.7*m_flow_nominal, - final dp1_nominal=0, - final dp2_nominal=0, - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - p2_start=p_CHWS_nominal, - T2_start=T_CHWS_nominal, - final per=cat.perChi) - "Placeholder chiller" annotation ( - Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=90, - origin={-110,60}))); - Buildings.Fluid.Sources.MassFlowSource_T souCDW1( - redeclare package Medium = Medium1, - m_flow=1, - T=305.15, - nPorts=1) "Source representing CDW supply line" - annotation (Placement(transformation(extent={{-160,100},{-140,120}}))); - Buildings.Fluid.Sources.Boundary_pT sinCDW1( - redeclare final package Medium = Medium1, - final p=300000, - final T=310.15, - nPorts=1) "Sink representing CDW return line" annotation (Placement( - transformation( - extent={{10,10},{-10,-10}}, - rotation=180, - origin={-150,70}))); - Modelica.Blocks.Sources.Constant set_TEvaLvg_chi1(k=T_CHWS_nominal) - "Constant setpoint" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={-90,150}))); - Buildings.Controls.OBC.CDL.Logical.Sources.Constant chi1On(k=true) - "Placeholder, chi1 always on" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={-120,150}))); - Buildings.Fluid.FixedResistances.CheckValve cheValChi1Pum( - redeclare package Medium = Medium2, - m_flow_nominal=chi1.vol2.m_flow_nominal, - dpValve_nominal=0.1*dp_nominal, - dpFixed_nominal=0.1*dp_nominal) "Check valve with series resistance" - annotation (Placement(transformation(extent={{-90,70},{-70,90}}))); + equation connect(set_TRet.y,usr1. TSet) annotation (Line(points={{41,110},{44,110},{44, 82},{64,82},{64,71}}, color={0,0,127})); @@ -309,14 +344,9 @@ equation 6},{86,-110},{62,-110}}, color={0,0,127})); connect(mulMax_yVal.y, hysCat.u) annotation (Line(points={{38,-110},{22,-110}}, color={0,0,127})); - connect(hysCat.y, cat.uOnl) annotation (Line(points={{-2,-110},{-44,-110},{-44, - -48},{-50,-48}}, color={255,0,255})); - connect(set_mChi2PumPri_flow.y, cat.mPumPriSet_flow) annotation (Line(points= - {{-119,-70},{-80,-70},{-80,-49},{-70,-49}}, color={0,0,127})); - connect(set_dpUsr.y, conPI_PumChi1.u_s) - annotation (Line(points={{-60,139},{-60,122}}, color={0,0,127})); - connect(conPI_PumChi1.y, pumChi1.y) - annotation (Line(points={{-60,99},{-60,52}}, color={0,0,127})); + connect(set_dpUsr.y,conPI_pumChi1. u_s) + annotation (Line(points={{-39,130},{-10,130},{-10,122}}, + color={0,0,127})); connect(usr1.yVal_actual, mulMax_yVal.u[3]) annotation (Line(points={{71,66}, {86,66},{86,-110},{62,-110},{62,-109.333}},color={0,0,127})); connect(preDroS2U3.port_b,usr3. port_a) @@ -349,62 +379,91 @@ equation connect(usr3.dpUsr, gaiUsr3.u) annotation (Line(points={{71,-58},{72,-58},{72, -60},{98,-60}}, color={0,0,127})); connect(gaiUsr1.y,mulMin_dpUsr. u[1]) annotation (Line(points={{121,60},{126, - 60},{126,142},{-9.33333,142}}, + 60},{126,129.333},{82,129.333}}, color={0,0,127})); connect(gaiUsr2.y,mulMin_dpUsr. u[2]) annotation (Line(points={{121,-1.38778e-15}, - {126,-1.38778e-15},{126,142},{-10,142}}, color={0,0,127})); + {126,-1.38778e-15},{126,130},{82,130}}, color={0,0,127})); connect(gaiUsr3.y,mulMin_dpUsr. u[3]) annotation (Line(points={{121,-60},{126, - -60},{126,142},{-10.6667,142}}, color={0,0,127})); - connect(mulMin_dpUsr.y, conPI_PumChi1.u_m) - annotation (Line(points={{-10,118},{-10,110},{-48,110}}, color={0,0,127})); - connect(uRemCha.y, cat.uRemCha) - annotation (Line(points={{-69,10},{-58,10},{-58,-48}}, color={255,0,255})); - connect(set_mTan_flow_discharge.y, swiTanCha.u1) annotation (Line(points={{-129,10}, - {-126,10},{-126,-2},{-122,-2}}, color={0,0,127})); - connect(set_mTan_flow_charge.y, swiTanCha.u3) annotation (Line(points={{-129,-30}, - {-126,-30},{-126,-18},{-122,-18}}, color={0,0,127})); - connect(booTanCha.y, swiTanCha.u2) - annotation (Line(points={{-159,-10},{-122,-10}}, color={255,0,255})); - connect(swiTanCha.y, cat.mTanSet_flow) - annotation (Line(points={{-98,-10},{-62,-10},{-62,-49}}, color={0,0,127})); - connect(sinCDW2.ports[1], cat.port_b1) annotation (Line(points={{-90,-100},{-66, - -100},{-66,-70}}, color={0,127,255})); - connect(cat.port_a2, preDroU3S2.port_b) annotation (Line(points={{-54,-70},{-54, - -80},{10,-80}}, color={0,127,255})); - connect(cat.port_a2, preDroU2S2.port_b) annotation (Line(points={{-54,-70},{-54, - -80},{-4,-80},{-4,-20},{10,-20}}, color={0,127,255})); - connect(cat.port_a1, souCDW2.ports[1]) annotation (Line(points={{-66,-50},{-66, - -40},{-88,-40}}, color={0,127,255})); - connect(cat.port_b2, preDroS2U3.port_a) annotation (Line(points={{-54,-50},{-54, - -40},{-30,-40}}, color={0,127,255})); - connect(cat.port_b2, preDroS2U2.port_a) annotation (Line(points={{-54,-50},{-54, - -40},{-36,-40},{-36,0},{-30,0}}, color={0,127,255})); - connect(chi1.port_a1, souCDW1.ports[1]) annotation (Line(points={{-116,70},{ - -134,70},{-134,110},{-140,110}}, color={0,127,255})); - connect(sinCDW1.ports[1], chi1.port_b1) annotation (Line(points={{-140,70},{ - -140,44},{-116,44},{-116,50}}, color={0,127,255})); - connect(set_TEvaLvg_chi1.y, chi1.TSet) annotation (Line(points={{-90,139},{-90, - 112},{-107,112},{-107,72}}, color={0,0,127})); - connect(chi1On.y, chi1.on) annotation (Line(points={{-120,138},{-120,78},{ - -113,78},{-113,72}}, color={255,0,255})); - connect(chi1.port_b2, cheValChi1Pum.port_a) annotation (Line(points={{-104,70}, - {-104,80},{-90,80}}, color={0,127,255})); - connect(preDroU1S1.port_b, pumChi1.port_a) - annotation (Line(points={{10,40},{-50,40}}, color={0,127,255})); - connect(pumChi1.port_b, chi1.port_a2) annotation (Line(points={{-70,40},{-104, - 40},{-104,50}}, color={0,127,255})); - connect(preDroU2S1.port_b, pumChi1.port_a) annotation (Line(points={{10,0},{4, - 0},{4,40},{-50,40}}, color={0,127,255})); - connect(cheValChi1Pum.port_b, preDroS1U1.port_a) - annotation (Line(points={{-70,80},{-30,80}}, color={0,127,255})); - connect(sou_p.ports[1], pumChi1.port_a) - annotation (Line(points={{-160,30},{-50,30},{-50,40}}, color={0,127,255})); - connect(cheValChi1Pum.port_b, preDroS1U2.port_a) annotation (Line(points={{-70, - 80},{-36,80},{-36,20},{-30,20}}, color={0,127,255})); + -60},{126,130.667},{82,130.667}}, + color={0,0,127})); + connect(mulMin_dpUsr.y,conPI_pumChi1. u_m) + annotation (Line(points={{58,130},{8,130},{8,110},{2,110}}, + color={0,0,127})); + connect(preDroU3S2.port_b, tanBra.port_1) annotation (Line(points={{10,-80},{ + -80,-80},{-80,-66}}, color={0,127,255})); + connect(preDroU2S2.port_b, tanBra.port_1) annotation (Line(points={{10,-20},{ + -4,-20},{-4,-80},{-80,-80},{-80,-66}}, color={0,127,255})); + connect(tanBra.port_2, preDroS2U3.port_a) annotation (Line(points={{-60,-66}, + {-36,-66},{-36,-40},{-30,-40}}, color={0,127,255})); + connect(tanBra.port_2, preDroS2U2.port_a) annotation (Line(points={{-60,-66}, + {-36,-66},{-36,0},{-30,0}}, color={0,127,255})); + connect(conPumSecGro.yValDis, tanBra.yValDis) + annotation (Line(points={{-99,-50},{-81,-50}}, color={0,0,127})); + connect(conPumSecGro.yValCha, tanBra.yValCha) + annotation (Line(points={{-99,-54},{-81,-54}}, color={0,0,127})); + connect(conPumSecGro.yPumSec, tanBra.yPum) + annotation (Line(points={{-99,-58},{-81,-58}}, color={0,0,127})); + connect(uRemCha.y, conPumSecGro.uRemCha) annotation (Line(points={{-159,-70},{ + -118,-70}}, color={255,0,255})); + connect(tanBra.yValDis_actual, conPumSecGro.yValDis_actual) annotation (Line( + points={{-59,-50},{-56,-50},{-56,-40},{-126,-40},{-126,-50},{-121,-50}}, + color={0,0,127})); + connect(tanBra.yValCha_actual, conPumSecGro.yValCha_actual) annotation (Line( + points={{-59,-54},{-52,-54},{-52,-36},{-130,-36},{-130,-54},{-121,-54}}, + color={0,0,127})); + connect(tanBra.mTan_flow, conPumSecGro.mTan_flow) annotation (Line(points={{-59, + -58},{-48,-58},{-48,-32},{-134,-32},{-134,-58},{-121,-58}}, color={0, + 0,127})); + connect(uTanDis.y, mTanSet_flow.u) annotation (Line(points={{-159,-110},{-130, + -110},{-130,-102}}, color={255,0,255})); + connect(mTanSet_flow.y, conPumSecGro.mTanSet_flow) annotation (Line(points={{-130, + -78},{-130,-62},{-121,-62}}, color={0,0,127})); + connect(mChiBra2Set_flow.u, uRemCha.y) annotation (Line(points={{-122,-10},{-148, + -10},{-148,-70},{-159,-70}}, + color={255,0,255})); + connect(tanBra.port_3, chiBra2.port_a) annotation (Line(points={{-74,-50},{-74, + -26},{-86,-26},{-86,-10},{-80,-10}}, color={0,127,255})); + connect(tanBra.port_4, chiBra2.port_b) annotation (Line(points={{-66,-49.8},{ + -66,-26},{-54,-26},{-54,-10},{-60,-10}}, color={0,127,255})); + connect(chiBra2.mPumSet_flow,mChiBra2Set_flow. y) + annotation (Line(points={{-81,-6},{-92,-6},{-92,-10},{-98,-10}}, + color={0,0,127})); + connect(conPI_pumChi1.y,pumSup1. y) annotation (Line(points={{-10,99},{-10,94}, + {-42,94},{-42,58},{-70,58},{-70,52}}, + color={0,0,127})); + connect(preDroU1S1.port_b, pumSup1.port_a) + annotation (Line(points={{10,40},{-60,40}}, color={0,127,255})); + connect(preDroU2S1.port_b, pumSup1.port_a) annotation (Line(points={{10,0},{4, + 0},{4,40},{-60,40}}, color={0,127,255})); + connect(pumSup1.port_b, cheValPumChi1.port_a) + annotation (Line(points={{-80,40},{-100,40}}, color={0,127,255})); + connect(sou_p.ports[1], pumSup1.port_a) annotation (Line(points={{-160,10},{-54, + 10},{-54,40},{-60,40}}, color={0,127,255})); + connect(cheValPumChi1.port_b, chi1.port_a2) annotation (Line(points={{-120,40}, + {-124,40},{-124,60}}, color={0,127,255})); + connect(chi1.port_b2, preDroS1U1.port_a) annotation (Line(points={{-124,80},{ + -30,80}}, color={0,127,255})); + connect(souCDW1.ports[1], chi1.port_a1) annotation (Line(points={{-160,90},{ + -136,90},{-136,80}}, color={0,127,255})); + connect(chi1.port_b1, sinCDW1.ports[1]) annotation (Line(points={{-136,60},{ + -136,50},{-160,50}}, color={0,127,255})); + connect(TEvaLvgSet.y, chi1.TSet) + annotation (Line(points={{-90,119},{-90,88},{-127,88},{-127,82}}, + color={0,0,127})); + connect(on.y, chi1.on) annotation (Line(points={{-130,118},{-133,118},{-133, + 82}}, color={255,0,255})); + connect(preDroS1U2.port_a, chi1.port_b2) annotation (Line(points={{-30,20},{-36, + 20},{-36,80},{-124,80}}, color={0,127,255})); + connect(uRemCha.y, or2.u1) annotation (Line(points={{-159,-70},{-118,-70},{-118, + -110},{-100,-110},{-100,-102}}, color={255,0,255})); + connect(conPumSecGro.uOnl, or2.y) annotation (Line(points={{-114,-70},{-114,-74}, + {-100,-74},{-100,-78}}, color={255,0,255})); + connect(hysCat.y, or2.u2) annotation (Line(points={{-2,-110},{-92,-110},{-92,-102}}, + color={255,0,255})); annotation (__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos" "Simulate and plot"), experiment(Tolerance=1e-06, StopTime=3600,__Dymola_Algorithm="Dassl"), - Diagram(coordinateSystem(extent={{-180,-140},{140,180}})), Icon( + Diagram(coordinateSystem(extent={{-180,-120},{140,140}})), Icon( coordinateSystem(extent={{-100,-100},{100,100}})), Documentation(info="

    diff --git a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_TwoSourcesThreeUsers.txt b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_TwoSourcesThreeUsers.txt index 3934bfb6052..5a90d9837d8 100644 --- a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_TwoSourcesThreeUsers.txt +++ b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_TwoSourcesThreeUsers.txt @@ -1,7 +1,7 @@ -last-generated=2022-03-14 +last-generated=2022-03-17 statistics-initialization= { - "nonlinear": "5, 0, 0, 0, 1, 1", + "nonlinear": "6, 0, 0, 0, 0, 1, 1", "numerical Jacobians": "0" } statistics-simulation= @@ -12,12 +12,12 @@ statistics-simulation= "numerical Jacobians": "0" } time=[0e+00, 3.6e+03] -pumChi1.m_flow=[2.90360344479268e-06, 2.574263646692998e-07, 2.841550212906441e-07, 3.041250238311477e-07, 3.1895160645945e-07, 3.299363697806257e-07, 3.380644102435326e-07, 3.440725322434446e-07, 3.48510639014421e-07, 3.517874063163617e-07, 3.54205752728376e-07, 3.559900392247073e-07, 3.943337500095367e-01, -4.10140841268003e-04, -6.16540084592998e-04, -6.31289032753557e-04, -6.325681461021304e-04, -6.326810689643025e-04, -6.326647126115859e-04, -6.326397997327149e-04, -6.326213479042053e-04, -6.325903814285994e-04, -6.325431168079376e-04, 1.675708591938019e-01, 2.260440289974213e-01, 2.280283123254776e-01, 2.296321243047714e-01, 2.309542894363403e-01, 2.32018455862999e-01, 2.328717708587646e-01, 2.335598915815353e-01, 2.341226041316986e-01, 2.345907241106033e-01, 2.349893003702164e-01, 6.076529026031494e-01, 6.482539772987366e-01, 6.502906084060669e-01, 6.512424349784851e-01, 6.520713567733765e-01, 6.528275609016418e-01, 6.535298824310303e-01, 6.541922688484192e-01, 6.548252105712891e-01, 6.554366946220398e-01, 6.560323238372803e-01, 9.17685329914093e-02, 4.856726445723325e-05, 2.878637285903096e-03, 2.492164727300406e-03, 2.491752617061138e-03, 2.735200105234981e-03, 3.158671548590064e-03, 3.706743940711021e-03, 4.349087364971638e-03, 5.058011505752806e-03, 5.814099684357648e-03, -6.395039381459407e-04, -8.45471047796309e-04, -8.459430537186563e-04, -8.459382806904614e-04, -8.45935195684433e-04, -8.459387463517487e-04, -8.459198288619518e-04, -8.459252421744168e-04, -8.459212840534747e-04, -8.459092932753265e-04, -8.459198870696127e-04, 3.497742414474487e-01, 6.095962524414062e-01, 6.278272867202759e-01, 8.526261448860168e-01, 9.942407011985779e-01, 1.00286340713501e+00, 1.00541627407074e+00, 1.006456851959229e+00, 1.006974339485168e+00, 1.007259845733643e+00, 1.007426261901855e+00, 8.565613031387329e-01, 4.098342657089233e-01, 4.015297591686249e-01, 3.931047022342682e-01, 3.867296576499939e-01, 3.819189965724945e-01, 3.782961070537567e-01, 3.755727410316467e-01, 3.735280632972717e-01, 3.719945549964905e-01, 3.708451986312866e-01, 2.734200358390808e-01, -3.069724480155855e-04, -3.066363860853016e-04, -3.04735527606681e-04, -2.008696901611984e-04, -4.965816970070591e-06, 1.967203928643357e-07, 3.207404404292902e-07, 3.358420030963316e-07, 3.429668993248924e-07, 3.477166785614827e-07, 3.511994748350844e-07] -cat.pumPri.m_flow=[0e+00, 7.499329447746277e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 1.377374976873398e-01, 4.028871262562461e-05, 6.11594508370672e-09, 8.178415627016489e-13, 9.589251393187564e-17, -5.241664857811528e-20, 2.131046832868325e-20, 2.791871569155422e-20, 8.096430103178397e-21, 2.786891844932625e-21, 1.268689556972913e-20, -1.000228674819164e-21, -1.051826085602722e-25, -1.052073086358831e-29, 7.793363160413643e-34, 1.436635041330859e-35, 5.767932813674552e-37, -3.384748102721405e-37, 1.585378299480751e-37, 1.533693815857489e-37, 3.285943332729002e-37, -1.48092192462591e-37, 2.080670148134232e-01, 7.497294545173645e-01, 7.499999403953552e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01] -cat.mTan_flow=[-2.397192702119355e-07, -7.499328851699829e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -5.513092279434204e-01, -7.352642714977264e-02, -1.417062282562256e-01, -1.47429570555687e-01, -1.477609425783157e-01, -1.477706134319305e-01, -1.477497816085815e-01, -1.477304697036743e-01, -1.477168351411819e-01, -1.476941257715225e-01, -1.476595401763916e-01, 2.484887391328812e-01, 2.320592701435089e-01, 2.286417335271835e-01, 2.261601090431213e-01, 2.243345677852631e-01, 2.229965180158615e-01, 2.220178097486496e-01, 2.213031202554703e-01, 2.207816392183304e-01, 2.204013913869858e-01, 2.201240062713623e-01, 4.022259712219238e-01, 4.104315042495728e-01, 4.098311066627502e-01, 4.092541038990021e-01, 4.088491499423981e-01, 4.08573716878891e-01, 4.083926975727081e-01, 4.082804918289185e-01, 4.082181751728058e-01, 4.081921577453613e-01, 4.081925749778748e-01, 4.50728565454483e-01, 4.582363963127136e-01, 4.601563215255737e-01, 4.618923962116241e-01, 4.631562829017639e-01, 4.64070051908493e-01, 4.647231996059418e-01, 4.651826918125153e-01, 4.654979407787323e-01, 4.65706080198288e-01, 4.65834766626358e-01, 1.34865850210183e-01, -1.462289988994598e-01, -1.469501852989197e-01, -1.469429582357407e-01, -1.469381898641586e-01, -1.46943598985672e-01, -1.469147652387619e-01, -1.469229906797409e-01, -1.469169110059738e-01, -1.46898627281189e-01, -1.469148546457291e-01, -1.377610415220261e-01, -2.341001381864771e-04, -2.388481236994267e-02, -2.614859640598297e-01, -4.026769697666168e-01, -4.114053547382355e-01, -4.097591936588287e-01, -4.082532227039337e-01, -4.073703587055206e-01, -4.068644344806671e-01, -4.065663814544678e-01, -4.868537485599518e-01, -4.098336398601532e-01, -4.015291631221771e-01, -3.931041061878204e-01, -3.867290914058685e-01, -3.819184303283691e-01, -3.782955706119537e-01, -3.755722045898438e-01, -3.735275268554688e-01, -3.719940483570099e-01, -3.70844691991806e-01, -4.814865291118622e-01, -7.494215965270996e-01, -7.496924996376038e-01, -7.496944665908813e-01, -7.49798595905304e-01, -7.49994695186615e-01, -7.499998211860657e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01, -7.499999403953552e-01] -cat.pumSec.m_flow=[-1.598027523641576e-07, 3.168741358194893e-08, 3.022457661927547e-08, 2.912550911560174e-08, 2.830951295607065e-08, 2.770495477477652e-08, 2.725762016098088e-08, 2.692695844075388e-08, 2.668270049355215e-08, 2.650236119450256e-08, 2.636926588195365e-08, 2.627106532315793e-08, 1.986907869577408e-01, 6.764736175537109e-01, 6.082938313484192e-01, 6.025704741477966e-01, 6.022391319274902e-01, 6.022294759750366e-01, 6.022502779960632e-01, 6.022695899009705e-01, 6.02283239364624e-01, 6.023059487342834e-01, 6.023405194282532e-01, 9.984887838363647e-01, 9.820592999458313e-01, 9.786417484283447e-01, 9.761601686477661e-01, 9.743345975875854e-01, 9.729965925216675e-01, 9.720178246498108e-01, 9.713031649589539e-01, 9.70781683921814e-01, 9.70401406288147e-01, 9.701240658760071e-01, 1.152225971221924e+00, 1.160431504249573e+00, 1.159831166267395e+00, 1.159254193305969e+00, 1.158849239349365e+00, 1.158573746681213e+00, 1.158392786979675e+00, 1.158280491828918e+00, 1.158218264579773e+00, 1.158192157745361e+00, 1.15819263458252e+00, 1.20072865486145e+00, 1.208236455917358e+00, 1.210156321525574e+00, 1.211892366409302e+00, 1.213156342506409e+00, 1.214070081710815e+00, 1.214723229408264e+00, 1.215182781219482e+00, 1.215497970581055e+00, 1.21570611000061e+00, 1.215834856033325e+00, 8.848658800125053e-01, 6.037710905075073e-01, 6.030498743057251e-01, 6.030570864677429e-01, 6.03061854839325e-01, 6.030564904212952e-01, 6.030852794647217e-01, 6.030770540237427e-01, 6.030831336975098e-01, 6.031014323234558e-01, 6.030852198600769e-01, -2.35395291383611e-05, -1.937930501298979e-04, -1.971048914128914e-04, -1.464236411266029e-04, -6.103887426434085e-05, -2.231362941529369e-06, -7.690280767747026e-08, -1.944771987894001e-08, -1.526294646225779e-08, -1.477478228650853e-08, -1.466873911226685e-08, -2.110327379512e-08, -1.493039647471051e-08, -1.432878971030505e-08, -1.373350588806943e-08, -1.329165044694491e-08, -1.296302531983429e-08, -1.271825844639807e-08, -1.253579728910381e-08, -1.239967595267899e-08, -1.229807278235739e-08, -1.222219481178399e-08, -8.288473019035791e-09, 1.879545130645255e-11, 1.101986835116975e-10, 4.194764535725426e-10, 1.731700471907516e-08, 2.927218289983102e-08, 2.845510849169841e-08, 2.781371399862564e-08, 2.733815307465193e-08, 2.698647705301482e-08, 2.672665111447259e-08, 2.653480279946052e-08] -cat.tan.sta_a.T=[2.851499938964844e+02, 2.851358337402344e+02, 2.851199951171875e+02, 2.851041564941406e+02, 2.850882873535156e+02, 2.850724487304688e+02, 2.850566101074219e+02, 2.85040771484375e+02, 2.8502490234375e+02, 2.850090637207031e+02, 2.849932250976562e+02, 2.849773864746094e+02, 2.849624328613281e+02, 2.8495751953125e+02, 2.849550476074219e+02, 2.849519653320312e+02, 2.849488220214844e+02, 2.849456787109375e+02, 2.849425354003906e+02, 2.849393615722656e+02, 2.849362182617188e+02, 2.849330749511719e+02, 2.84929931640625e+02, 2.851579284667969e+02, 2.85159423828125e+02, 2.851607666015625e+02, 2.851620178222656e+02, 2.851631164550781e+02, 2.851641235351562e+02, 2.851650390625e+02, 2.851658630371094e+02, 2.851666259765625e+02, 2.851672973632812e+02, 2.851679077148438e+02, 2.851685791015625e+02, 2.851696472167969e+02, 2.851706237792969e+02, 2.851715087890625e+02, 2.851722717285156e+02, 2.851729431152344e+02, 2.851735534667969e+02, 2.85174072265625e+02, 2.851745300292969e+02, 2.851748962402344e+02, 2.851752014160156e+02, 2.851754760742188e+02, 2.851759338378906e+02, 2.851763610839844e+02, 2.851767272949219e+02, 2.851770324707031e+02, 2.851773071289062e+02, 2.851775207519531e+02, 2.851776733398438e+02, 2.851777954101562e+02, 2.851778564453125e+02, 2.851778869628906e+02, 2.851776428222656e+02, 2.849915161132812e+02, 2.84989013671875e+02, 2.849865112304688e+02, 2.849840087890625e+02, 2.849814758300781e+02, 2.849789733886719e+02, 2.849764709472656e+02, 2.849739379882812e+02, 2.84971435546875e+02, 2.849689025878906e+02, 2.849668884277344e+02, 2.84966552734375e+02, 2.849664611816406e+02, 2.8496435546875e+02, 2.849582824707031e+02, 2.849512939453125e+02, 2.849442443847656e+02, 2.849372253417969e+02, 2.849302062988281e+02, 2.849231567382812e+02, 2.849161376953125e+02, 2.84908935546875e+02, 2.84901611328125e+02, 2.8489453125e+02, 2.848876037597656e+02, 2.848807983398438e+02, 2.848740844726562e+02, 2.84867431640625e+02, 2.848608093261719e+02, 2.848542175292969e+02, 2.8484765625e+02, 2.848411254882812e+02, 2.8483447265625e+02, 2.848223876953125e+02, 2.848091125488281e+02, 2.847957763671875e+02, 2.847824096679688e+02, 2.847690124511719e+02, 2.847555541992188e+02, 2.847420654296875e+02, 2.847285461425781e+02, 2.847149658203125e+02, 2.847013854980469e+02, 2.84687744140625e+02] -cat.tan.sta_b.T=[2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801526489257812e+02, 2.80156494140625e+02, 2.801602478027344e+02, 2.801639709472656e+02, 2.801676635742188e+02, 2.801713256835938e+02, 2.801749877929688e+02, 2.801786193847656e+02, 2.801822814941406e+02, 2.801859130859375e+02, 2.801895751953125e+02, 2.801947021484375e+02, 2.802014770507812e+02, 2.802082824707031e+02, 2.80215087890625e+02, 2.802218933105469e+02, 2.802287292480469e+02, 2.802355651855469e+02, 2.80242431640625e+02, 2.802492980957031e+02, 2.802561950683594e+02, 2.802630920410156e+02, 2.80270263671875e+02, 2.802779846191406e+02, 2.802857971191406e+02, 2.802936706542969e+02, 2.803015747070312e+02, 2.803095092773438e+02, 2.803175048828125e+02, 2.803255004882812e+02, 2.803335266113281e+02, 2.803415832519531e+02, 2.803496704101562e+02, 2.803565368652344e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.823220520019531e+02, 2.80556640625e+02, 2.801500244140625e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.811344299316406e+02, 2.803103942871094e+02, 2.801579895019531e+02, 2.80150390625e+02, 2.801500244140625e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02] -usr1.yVal_actual=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 6.488844156265259e-01, 5.539174675941467e-01, 4.350395798683167e-01, 4.276793599128723e-01, 4.271430373191833e-01, 4.271068871021271e-01, 4.271231591701508e-01, 4.27143007516861e-01, 4.271536767482758e-01, 4.27216112613678e-01, 4.272075295448303e-01, 6.888259053230286e-01, 6.746588945388794e-01, 6.620333194732666e-01, 6.535307168960571e-01, 6.477271318435669e-01, 6.436940431594849e-01, 6.408599615097046e-01, 6.388561725616455e-01, 6.374353766441345e-01, 6.364281177520752e-01, 6.357160210609436e-01, 6.436352133750916e-01, 6.421710252761841e-01, 6.397469043731689e-01, 6.379788517951965e-01, 6.367138028144836e-01, 6.358070969581604e-01, 6.35156512260437e-01, 6.346896290779114e-01, 6.343546509742737e-01, 6.341146230697632e-01, 6.339433193206787e-01, 1.298200935125351e-01, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] -usr2.yVal_actual=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 5.383826494216919e-01, 5.251342058181763e-01, 5.217663049697876e-01, 5.194615721702576e-01, 5.178166627883911e-01, 5.166454315185547e-01, 5.15815258026123e-01, 5.152310729026794e-01, 5.148246288299561e-01, 5.145468711853027e-01, 5.143622756004333e-01, 5.412582755088806e-01, 5.422661304473877e-01, 5.414133667945862e-01, 5.408165454864502e-01, 5.404288768768311e-01, 5.401930809020996e-01, 5.400668978691101e-01, 5.40020227432251e-01, 5.400310158729553e-01, 5.400834083557129e-01, 5.401661396026611e-01, 5.981611013412476e-01, 6.167853474617004e-01, 6.21320366859436e-01, 6.254275441169739e-01, 6.285431385040283e-01, 6.308587193489075e-01, 6.325578093528748e-01, 6.337830424308777e-01, 6.346504092216492e-01, 6.352473497390747e-01, 6.356410384178162e-01, 8.419773727655144e-02, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] -usr3.yVal_actual=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 5.099976062774658e-01, 5.52003026008606e-01, 5.524908304214478e-01, 5.521496534347534e-01, 5.519715547561646e-01, 5.519320368766785e-01, 5.519936084747314e-01, 5.521286725997925e-01, 5.523170828819275e-01, 5.525444149971008e-01, 5.52800178527832e-01, 5.908713936805725e-01, 6.161836981773376e-01, 6.223894953727722e-01, 6.263645887374878e-01, 6.294692158699036e-01, 6.318963766098022e-01, 6.337991952896118e-01, 6.352988481521606e-01, 6.364914774894714e-01, 6.374514698982239e-01, 6.382364630699158e-01, 4.771148860454542e-01, 3.802146315574646e-01, 3.797484636306763e-01, 3.797513544559479e-01, 3.797562122344971e-01, 3.797527253627777e-01, 3.797430396080017e-01, 3.79766047000885e-01, 3.797699809074402e-01, 3.797850608825684e-01, 3.797740638256073e-01, 7.14540421962738e-01, 6.906828284263611e-01, 6.737702488899231e-01, 6.97668731212616e-01, 7.212142944335938e-01, 7.626042366027832e-01, 7.912420630455017e-01, 8.075140118598938e-01, 8.168110251426697e-01, 8.222786784172058e-01, 8.255812525749207e-01, 4.133987128734589e-01, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] +pumSup1.m_flow=[0e+00, 3.395724661459099e-07, 3.707935718466615e-07, 3.939663884011679e-07, 4.111720386390516e-07, 4.239228132973949e-07, 4.333582808158098e-07, 4.403334230573819e-07, 4.454860516034387e-07, 4.492903258324077e-07, 4.520979075550713e-07, 4.541699922810949e-07, 1.743939220905304e-01, -1.021799747832119e-03, -1.062299590557814e-03, -1.064246520400047e-03, -1.064441166818142e-03, -1.064440933987498e-03, -1.064417883753777e-03, -1.064392970874906e-03, -1.064368523657322e-03, -1.064344891346991e-03, -1.064322073943913e-03, -5.52300363779068e-04, -4.883318324573338e-04, -4.796678258571774e-04, -4.773791297338903e-04, -4.760364245157689e-04, -4.748204082716256e-04, -4.736211558338255e-04, -4.724188183899969e-04, -4.712110967375338e-04, -4.699959245044738e-04, -4.687732725869864e-04, 3.112171292304993e-01, 3.29583466053009e-01, 3.290439546108246e-01, 3.289910852909088e-01, 3.295218348503113e-01, 3.304218649864197e-01, 3.315965533256531e-01, 3.329825401306152e-01, 3.345317244529724e-01, 3.362044394016266e-01, 3.379718363285065e-01, -5.837455973960459e-04, -1.073811086826026e-03, -1.075328444130719e-03, -1.074796658940613e-03, -1.074262429028749e-03, -1.073724240995944e-03, -1.073181978426874e-03, -1.072635059244931e-03, -1.072084065526724e-03, -1.071529346518219e-03, -1.070969388820231e-03, -1.369107514619827e-03, -1.370023237541318e-03, -1.370026264339685e-03, -1.370023819617927e-03, -1.370023004710674e-03, -1.370022189803421e-03, -1.370021724142134e-03, -1.37002021074295e-03, -1.370019279420376e-03, -1.370019861496985e-03, -1.370018231682479e-03, 2.744049727916718e-01, 6.054959893226624e-01, 6.60353422164917e-01, 1.0856614112854e+00, 1.137050628662109e+00, 1.140512466430664e+00, 1.14094340801239e+00, 1.140996098518372e+00, 1.141002535820007e+00, 1.141003370285034e+00, 1.141003489494324e+00, 1.141003489494324e+00, 1.141003489494324e+00, 1.141003489494324e+00, 7.342177033424377e-01, 7.666278481483459e-01, 7.509837746620178e-01, 7.481977343559265e-01, 7.484555840492249e-01, 7.490237355232239e-01, 7.494016289710999e-01, 7.496161460876465e-01, 6.983734369277954e-01, 6.168107688426971e-02, 2.718095108866692e-02, 1.265902351588011e-02, 4.393224080558866e-04, 7.232778898469405e-06, 6.452740421991621e-07, 4.886591113972827e-07, 4.747679724914633e-07, 4.701667535300658e-07, 4.673529190313275e-07, 4.654340273191337e-07] +chiBra2.m_flow=[0e+00, 7.499329447746277e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 1.377374678850174e-01, 4.027182149002329e-05, 6.34175423286365e-09, 8.054307004332073e-13, 8.732322718829169e-17, 6.774715716313163e-19, -3.754955888399381e-19, -2.395863762280548e-19, -6.609365026050198e-20, 2.374121449126562e-20, -1.131466135313442e-18, 6.056602712622631e-21, 8.584747372849197e-22, -2.582677592240762e-23, -2.766249194013347e-27, -3.234298179945682e-31, -3.623129867665756e-35, -3.722267709487547e-39, -4.273960316190692e-43, 2.942726775082116e-44, 1.401298464324817e-45, 0e+00, 2.080636769533157e-01, 7.497302293777466e-01, 7.499999403953552e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01] +tanBra.mTan_flow=[0e+00, -7.499330043792725e-01, -7.500000596046448e-01, -7.500000596046448e-01, -7.500000596046448e-01, -7.500000596046448e-01, -7.500000596046448e-01, -7.500000596046448e-01, -7.500000596046448e-01, -7.500000596046448e-01, -7.500000596046448e-01, -7.500000596046448e-01, -3.34062397480011e-01, -1.278934478759766e-01, -1.469698250293732e-01, -1.473181396722794e-01, -1.473227143287659e-01, -1.473022252321243e-01, -1.472792625427246e-01, -1.472568958997726e-01, -1.472352594137192e-01, -1.47214338183403e-01, -1.471941918134689e-01, 4.092696905136108e-01, 4.489437639713287e-01, 4.539777040481567e-01, 4.553443491458893e-01, 4.561694860458374e-01, 4.569239318370819e-01, 4.576673805713654e-01, 4.584127962589264e-01, 4.591610729694366e-01, 4.599132239818573e-01, 4.606696665287018e-01, 7.336759567260742e-01, 7.518929839134216e-01, 7.502970099449158e-01, 7.496464848518372e-01, 7.494518160820007e-01, 7.494602799415588e-01, 7.495453357696533e-01, 7.496495842933655e-01, 7.497466802597046e-01, 7.498302459716797e-01, 7.498968243598938e-01, 7.265728116035461e-01, 4.808606803417206e-01, 4.787430763244629e-01, 4.796172082424164e-01, 4.804975986480713e-01, 4.813818633556366e-01, 4.822733104228973e-01, 4.831712245941162e-01, 4.840753972530365e-01, 4.849832057952881e-01, 4.858996868133545e-01, -1.385104209184649e-01, -1.465650647878647e-01, -1.465908586978912e-01, -1.465695798397064e-01, -1.465628445148468e-01, -1.465552151203156e-01, -1.465511918067932e-01, -1.465386152267456e-01, -1.465303897857666e-01, -1.46535187959671e-01, -1.465213000774384e-01, -1.377834677696228e-01, -5.401287926360965e-04, -5.992262065410614e-02, -5.551571249961853e-01, -6.8583083152771e-01, -7.026323080062866e-01, -7.047574520111084e-01, -7.050180435180664e-01, -7.050498127937317e-01, -7.050536274909973e-01, -7.050538063049316e-01, -7.050541639328003e-01, -7.050542235374451e-01, -7.050542235374451e-01, -6.308442950248718e-01, -7.666268944740295e-01, -7.50982940196991e-01, -7.481968998908997e-01, -7.48454749584198e-01, -7.49022901058197e-01, -7.49400794506073e-01, -7.496153116226196e-01, -9.064362645149231e-01, -8.114108443260193e-01, -7.771804332733154e-01, -7.626585960388184e-01, -7.504388689994812e-01, -7.500067949295044e-01, -7.500002384185791e-01, -7.500000596046448e-01, -7.500000596046448e-01, -7.500000596046448e-01, -7.500000596046448e-01, -7.500000596046448e-01] +tanBra.pum.m_flow=[0e+00, -2.525248810059111e-08, -2.907192531154124e-08, -3.190893949067686e-08, -3.401540382697021e-08, -3.557646266472148e-08, -3.673163462281082e-08, -3.758558975164306e-08, -3.821642025059191e-08, -3.868217035574162e-08, -3.902589895687925e-08, -3.9279580477114e-08, 4.159376621246338e-01, 6.221067309379578e-01, 6.030303835868835e-01, 6.026820540428162e-01, 6.026774644851685e-01, 6.026979684829712e-01, 6.027209162712097e-01, 6.027433276176453e-01, 6.027649641036987e-01, 6.027858257293701e-01, 6.02806031703949e-01, 1.1592698097229e+00, 1.198943972587585e+00, 1.203977823257446e+00, 1.205344557762146e+00, 1.206169724464417e+00, 1.206924080848694e+00, 1.207667589187622e+00, 1.208413004875183e+00, 1.209161281585693e+00, 1.209913372993469e+00, 1.210669875144958e+00, 1.483676075935364e+00, 1.501893043518066e+00, 1.500297069549561e+00, 1.499646544456482e+00, 1.499451875686646e+00, 1.499460339546204e+00, 1.499545454978943e+00, 1.49964964389801e+00, 1.499746799468994e+00, 1.499830365180969e+00, 1.499897003173828e+00, 1.476572871208191e+00, 1.230860829353333e+00, 1.228743314743042e+00, 1.229617357254028e+00, 1.23049783706665e+00, 1.231382012367249e+00, 1.232273459434509e+00, 1.233171463012695e+00, 1.234075546264648e+00, 1.234983325004578e+00, 1.235899806022644e+00, 6.114897727966306e-01, 6.034350991249084e-01, 6.034093499183655e-01, 6.034306287765503e-01, 6.034373641014099e-01, 6.034449934959412e-01, 6.034489870071411e-01, 6.034615635871887e-01, 6.034697890281677e-01, 6.034650206565857e-01, 6.034789085388184e-01, -4.598509258357808e-05, -4.998095682822168e-04, -4.962249076925218e-04, -2.640515740495175e-04, -7.083019590936601e-05, -2.605489498819225e-06, -9.166085845890848e-08, -2.333348803063018e-08, -1.829977058775967e-08, -1.775560143357779e-08, -1.77452186278515e-08, -1.767785384743092e-08, -1.767195811908095e-08, -1.767147850273432e-08, -5.759201471278175e-08, -4.597435676600981e-08, -4.48521433327187e-08, -4.348834181655548e-08, -4.244678564191418e-08, -4.171925738205573e-08, -4.121686103530919e-08, -4.086554739046733e-08, -4.309796963752888e-08, -4.971923317498295e-08, -4.828208943763457e-08, -4.662432928626004e-08, -4.547683474243058e-08, -4.411604948018066e-08, -4.306172129986408e-08, -4.22556176715716e-08, -4.166017930629096e-08, -4.122149732666003e-08, -4.08982643307354e-08, -4.066008330028126e-08] +tanBra.tan.sta_a.T=[2.851499938964844e+02, 2.851358337402344e+02, 2.851199951171875e+02, 2.851041564941406e+02, 2.850882873535156e+02, 2.850724487304688e+02, 2.850566101074219e+02, 2.85040771484375e+02, 2.8502490234375e+02, 2.850090637207031e+02, 2.849932250976562e+02, 2.849773864746094e+02, 2.849631958007812e+02, 2.849611206054688e+02, 2.849580688476562e+02, 2.849549255371094e+02, 2.849518127441406e+02, 2.849486694335938e+02, 2.849455261230469e+02, 2.849423828125e+02, 2.849392700195312e+02, 2.849361267089844e+02, 2.849329833984375e+02, 2.851532592773438e+02, 2.851538696289062e+02, 2.851545104980469e+02, 2.851550903320312e+02, 2.851556701660156e+02, 2.851561889648438e+02, 2.851567077636719e+02, 2.851571655273438e+02, 2.851576232910156e+02, 2.851580505371094e+02, 2.851584167480469e+02, 2.85158935546875e+02, 2.8515966796875e+02, 2.851603088378906e+02, 2.851609191894531e+02, 2.851614685058594e+02, 2.851619873046875e+02, 2.851624450683594e+02, 2.851628723144531e+02, 2.851632690429688e+02, 2.851636352539062e+02, 2.851639709472656e+02, 2.851641845703125e+02, 2.851642456054688e+02, 2.851642761230469e+02, 2.851642761230469e+02, 2.851642761230469e+02, 2.851642761230469e+02, 2.851642456054688e+02, 2.851642456054688e+02, 2.851642150878906e+02, 2.851641540527344e+02, 2.851641235351562e+02, 2.850184631347656e+02, 2.850162963867188e+02, 2.850140991210938e+02, 2.850119018554688e+02, 2.850097045898438e+02, 2.850075073242188e+02, 2.850053100585938e+02, 2.850030822753906e+02, 2.850008850097656e+02, 2.849986877441406e+02, 2.849964599609375e+02, 2.849946899414062e+02, 2.84994384765625e+02, 2.849941711425781e+02, 2.849899291992188e+02, 2.84980224609375e+02, 2.849696655273438e+02, 2.849589233398438e+02, 2.849481201171875e+02, 2.84937255859375e+02, 2.849263305664062e+02, 2.849153442382812e+02, 2.849043273925781e+02, 2.848932495117188e+02, 2.848821105957031e+02, 2.848700256347656e+02, 2.848587646484375e+02, 2.848468017578125e+02, 2.848347473144531e+02, 2.848226318359375e+02, 2.848104553222656e+02, 2.847982482910156e+02, 2.847859497070312e+02, 2.847734985351562e+02, 2.847584228515625e+02, 2.847453308105469e+02, 2.847324523925781e+02, 2.847198181152344e+02, 2.847072143554688e+02, 2.846945495605469e+02, 2.846818542480469e+02, 2.846691284179688e+02, 2.846563110351562e+02, 2.846434936523438e+02, 2.846305847167969e+02] +tanBra.tan.sta_b.T=[2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801539001464844e+02, 2.801610412597656e+02, 2.8016845703125e+02, 2.801759338378906e+02, 2.801834411621094e+02, 2.801910095214844e+02, 2.801985778808594e+02, 2.802062072753906e+02, 2.802138366699219e+02, 2.802215270996094e+02, 2.80229248046875e+02, 2.802400512695312e+02, 2.802527465820312e+02, 2.802654724121094e+02, 2.802781982421875e+02, 2.802909851074219e+02, 2.803038330078125e+02, 2.803167114257812e+02, 2.803296508789062e+02, 2.803426513671875e+02, 2.803556823730469e+02, 2.803687744140625e+02, 2.803818359375e+02, 2.803916320800781e+02, 2.804000549316406e+02, 2.804085083007812e+02, 2.804170227050781e+02, 2.80425537109375e+02, 2.804341125488281e+02, 2.804426879882812e+02, 2.804513244628906e+02, 2.804599609375e+02, 2.804686584472656e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801506652832031e+02, 2.801503601074219e+02, 2.801501159667969e+02, 2.801500244140625e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02] +usr1.yVal_actual=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 6.459543704986572e-01, 4.170984029769897e-01, 4.003250896930695e-01, 3.998368084430695e-01, 3.99804413318634e-01, 3.998155295848846e-01, 3.998315334320068e-01, 3.998474776744843e-01, 3.998629152774811e-01, 3.998778760433197e-01, 3.998923003673553e-01, 5.017361640930176e-01, 5.463769435882568e-01, 5.536584258079529e-01, 5.555331707000732e-01, 5.565879940986633e-01, 5.575311779975891e-01, 5.584660768508911e-01, 5.594067573547363e-01, 5.60356080532074e-01, 5.613165497779846e-01, 5.622875094413757e-01, 7.463064789772034e-01, 7.139545083045959e-01, 6.871318817138672e-01, 6.708506345748901e-01, 6.604197025299072e-01, 6.534668803215027e-01, 6.487339735031128e-01, 6.454798579216003e-01, 6.432370543479919e-01, 6.416981816291809e-01, 6.406551003456116e-01, 9.191801398992538e-02, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] +usr2.yVal_actual=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 4.304940104484558e-01, 4.498492181301117e-01, 4.520609378814697e-01, 4.5273357629776e-01, 4.531791806221008e-01, 4.53599214553833e-01, 4.540135264396667e-01, 4.544304311275482e-01, 4.548496305942535e-01, 4.552712440490723e-01, 4.556961357593536e-01, 5.653213858604431e-01, 5.486000180244446e-01, 5.424073934555054e-01, 5.381427407264709e-01, 5.351747274398804e-01, 5.33166229724884e-01, 5.318551063537598e-01, 5.310487747192383e-01, 5.306078791618347e-01, 5.304321050643921e-01, 5.304490923881531e-01, 4.946472346782684e-01, 3.832661509513855e-01, 3.825566172599792e-01, 3.828198611736298e-01, 3.830846548080444e-01, 3.833508491516113e-01, 3.83619099855423e-01, 3.838894367218018e-01, 3.841616809368134e-01, 3.844352066516876e-01, 3.847113251686096e-01, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] +usr3.yVal_actual=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 4.581530094146729e-01, 4.817582368850708e-01, 4.791752099990845e-01, 4.770678281784058e-01, 4.756242334842682e-01, 4.747262299060822e-01, 4.742512702941895e-01, 4.740960001945496e-01, 4.741798937320709e-01, 4.744415283203125e-01, 4.748351275920868e-01, 4.58635538816452e-01, 3.829712271690369e-01, 3.823499083518982e-01, 3.826169371604919e-01, 3.828858137130737e-01, 3.831558525562286e-01, 3.834279477596283e-01, 3.837019205093384e-01, 3.839777410030365e-01, 3.84254664182663e-01, 3.8453409075737e-01, 3.643192648887633e-01, 3.601286113262177e-01, 3.601105809211731e-01, 3.601225614547729e-01, 3.601261079311371e-01, 3.601298332214355e-01, 3.601325452327728e-01, 3.601387739181519e-01, 3.601439297199249e-01, 3.601404428482056e-01, 3.601474761962891e-01, 6.125434041023254e-01, 6.704702377319336e-01, 6.659795641899109e-01, 7.626306414604187e-01, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1.074094846844673e-01, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos index 6ea2c0ebe3d..f0731093709 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos @@ -6,7 +6,7 @@ simulateModel("Buildings.Fluid.Storage.Plant.Examples.TwoSourcesThreeUsers", // Plot commands createPlot(id=1, position={15, 15, 914, 538}, - y={"pumChi1.m_flow", "cat.pumPri.m_flow", "cat.mTan_flow", "cat.pumSec.m_flow"}, + y={"pumSup1.m_flow", "chiBra2.m_flow", "tanBra.mTan_flow", "tanBra.pum.m_flow"}, range={0.0, 3600.0, -2.0, 2.0}, grid=true, subPlot=101, @@ -15,7 +15,7 @@ createPlot(id=1, displayUnits={"kg/s", "kg/s", "kg/s", "kg/s"}); createPlot(id=1, position={15, 15, 914, 538}, - y={"cat.tan.sta_a.T", "cat.tan.sta_b.T"}, + y={"tanBra.tan.sta_a.T", "tanBra.tan.sta_b.T"}, range={0.0, 3600.0, 5.0, 15.0}, grid=true, subPlot=102, diff --git a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.TwoSourcesThreeUsers.mos b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.TwoSourcesThreeUsers.mos index 3921ab588a5..56e1e86eec2 100644 --- a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.TwoSourcesThreeUsers.mos +++ b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.TwoSourcesThreeUsers.mos @@ -1,11 +1,11 @@ compareVars := { - "pumChi1.m_flow", - "cat.pumPri.m_flow", - "cat.mTan_flow", - "cat.pumSec.m_flow", - "cat.tan.sta_a.T", - "cat.tan.sta_b.T", + "pumSup1.m_flow", + "chiBra2.m_flow", + "tanBra.mTan_flow", + "tanBra.pum.m_flow", + "tanBra.tan.sta_a.T", + "tanBra.tan.sta_b.T", "usr1.yVal_actual", "usr2.yVal_actual", "usr3.yVal_actual" From 0edc736842909d702f728661e94fa60bf6e8edc8 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Thu, 17 Mar 2022 10:41:12 -0700 Subject: [PATCH 074/463] changed pressure parameterisation of DummyUser --- .../Plant/Examples/BaseClasses/DummyUser.mo | 11 ++---- .../BaseClasses/Validation/DummyUser.mo | 34 ++++++++----------- .../Plant/Examples/OneSourceOneUser.mo | 12 +++---- .../Plant/Examples/TwoSourcesThreeUsers.mo | 18 ++++------ ...ge_Plant_Examples_TwoSourcesThreeUsers.txt | 18 +++++----- 5 files changed, 36 insertions(+), 57 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo index af8e0b49f79..be825935634 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/DummyUser.mo @@ -3,16 +3,11 @@ model DummyUser "Dummy user model" extends Buildings.Fluid.Interfaces.PartialTwoPortInterface( m_flow_nominal=1); - parameter Modelica.Units.SI.AbsolutePressure p_a_nominal=800000 - "Nominal pressure of the CHW supply line"; - parameter Modelica.Units.SI.AbsolutePressure p_b_nominal=300000 - "Nominal pressure of the CHW return line"; parameter Modelica.Units.SI.Temperature T_a_nominal=7+273.15 "Nominal temperature of CHW supply"; parameter Modelica.Units.SI.Temperature T_b_nominal=12+273.15 "Nominal temperature of CHW return"; - final parameter Modelica.Units.SI.PressureDifference dp_nominal= - p_a_nominal-p_b_nominal + parameter Modelica.Units.SI.PressureDifference dp_nominal=500000 "Nominal pressure difference"; Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage val( @@ -34,7 +29,7 @@ model DummyUser "Dummy user model" m_flow_nominal=m_flow_nominal, allowFlowReversal=true, V=0.5, - p_start=p_a_nominal, + p_start=500000, T_start=T_b_nominal) "Volume representing the consumer" annotation ( Placement(transformation( @@ -96,7 +91,7 @@ model DummyUser "Dummy user model" origin={-20,110}))); equation connect(val.port_b, vol.ports[1]) - annotation (Line(points={{-30,0},{0,0}}, color={0,127,255})); + annotation (Line(points={{-30,0},{1,0}}, color={0,127,255})); connect(heaCon.port, vol.heatPort) annotation (Line(points={{42,80},{54,80},{54,-10},{10,-10}}, color={191,0,0})); diff --git a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/Validation/DummyUser.mo b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/Validation/DummyUser.mo index c32742a4eab..e78ea1f90a1 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/Validation/DummyUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/Validation/DummyUser.mo @@ -6,20 +6,15 @@ model DummyUser "Test model for the dummy user" parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=1 "Nominal mass flow rate"; - parameter Modelica.Units.SI.PressureDifference dp_nominal= - p_CHWS_nominal-p_CHWR_nominal + parameter Modelica.Units.SI.PressureDifference dp_nominal=500000 "Nominal pressure difference"; - parameter Modelica.Units.SI.AbsolutePressure p_CHWS_nominal=800000 - "Nominal pressure at CHW supply line"; - parameter Modelica.Units.SI.AbsolutePressure p_CHWR_nominal=300000 - "Nominal pressure at CHW return line"; + parameter Modelica.Units.SI.AbsolutePressure p_Pressurisation=300000 + "Pressurisation point"; parameter Modelica.Units.SI.Temperature T_CHWR_nominal( - final displayUnit="degC")= - 12+273.15 + final displayUnit="degC")=12+273.15 "Nominal temperature of CHW return"; parameter Modelica.Units.SI.Temperature T_CHWS_nominal( - final displayUnit="degC")= - 7+273.15 + final displayUnit="degC")=7+273.15 "Nominal temperature of CHW supply"; parameter Boolean allowFlowReversal=false "Flow reversal setting"; @@ -28,20 +23,19 @@ model DummyUser "Test model for the dummy user" Buildings.Fluid.Storage.Plant.Examples.BaseClasses.DummyUser ideUsr( redeclare package Medium = Medium, - vol(T_start=15 + 273.15), - m_flow_nominal=m_flow_nominal, - p_a_nominal=p_CHWS_nominal, - p_b_nominal=p_CHWR_nominal, - T_a_nominal=T_CHWS_nominal, - T_b_nominal=T_CHWR_nominal) "Ideal user" annotation (Placement( + final vol(final T_start=15 + 273.15), + final m_flow_nominal=m_flow_nominal, + final dp_nominal=dp_nominal, + final T_a_nominal=T_CHWS_nominal, + final T_b_nominal=T_CHWR_nominal) "Ideal user" annotation (Placement( transformation(extent={{-10,-10},{10,10}}, rotation=0))); Modelica.Blocks.Sources.Constant set_TRet(k=12 + 273.15) "CHW return setpoint" annotation (Placement(transformation(extent={{-80,40},{-60,60}}))); Buildings.Fluid.Sources.Boundary_pT sin( redeclare final package Medium = Medium, - p=p_CHWR_nominal, - T=T_CHWR_nominal, + final p=p_Pressurisation, + final T=T_CHWR_nominal, nPorts=1) "Sink representing CHW return line" annotation (Placement(transformation( extent={{10,-10},{-10,10}}, @@ -49,8 +43,8 @@ model DummyUser "Test model for the dummy user" origin={70,0}))); Buildings.Fluid.Sources.Boundary_pT sou( redeclare final package Medium = Medium, - p=p_CHWS_nominal, - T=T_CHWS_nominal, + final p=p_Pressurisation+dp_nominal, + final T=T_CHWS_nominal, nPorts=1) "Source representing CHW supply line" annotation (Placement( transformation( extent={{10,10},{-10,-10}}, diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo index 0cbd02445c0..7815b41fb35 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo @@ -8,11 +8,8 @@ model OneSourceOneUser "(Draft) Simple system model with one source and one user "Nominal mass flow rate"; parameter Modelica.Units.SI.PressureDifference dp_nominal=500000 "Nominal pressure difference"; - parameter Modelica.Units.SI.AbsolutePressure p_CHWS_nominal= - p_CHWR_nominal+dp_nominal - "Nominal pressure at CHW supply line"; - parameter Modelica.Units.SI.AbsolutePressure p_CHWR_nominal=300000 - "Nominal pressure at CHW return line"; + parameter Modelica.Units.SI.AbsolutePressure p_Pressurisation=300000 + "Pressurisation point"; parameter Modelica.Units.SI.Temperature T_CHWR_nominal=12+273.15 "Nominal temperature of CHW return"; parameter Modelica.Units.SI.Temperature T_CHWS_nominal=7+273.15 @@ -50,8 +47,7 @@ model OneSourceOneUser "(Draft) Simple system model with one source and one user Buildings.Fluid.Storage.Plant.Examples.BaseClasses.DummyUser usr( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, - p_a_nominal=p_CHWS_nominal - dp_nominal*0.35, - p_b_nominal=p_CHWR_nominal + dp_nominal*0.35, + dp_nominal=0.3*dp_nominal, T_a_nominal=T_CHWS_nominal, T_b_nominal=T_CHWR_nominal) "User" annotation (Placement(transformation(extent={{60,-30},{80,-10}}))); @@ -88,7 +84,7 @@ model OneSourceOneUser "(Draft) Simple system model with one source and one user origin={-90,90}))); Buildings.Fluid.Sources.Boundary_pT sou_p( redeclare final package Medium = Medium, - final p=p_CHWR_nominal, + final p=p_Pressurisation, final T=T_CHWR_nominal, nPorts=1) "Pressurisation point" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index 9ff9a62aea2..6875cac9109 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -10,11 +10,8 @@ model TwoSourcesThreeUsers "Nominal mass flow rate"; parameter Modelica.Units.SI.PressureDifference dp_nominal=500000 "Nominal pressure difference"; - parameter Modelica.Units.SI.AbsolutePressure p_CHWS_nominal= - p_CHWR_nominal+dp_nominal - "Nominal pressure at CHW supply line"; - parameter Modelica.Units.SI.AbsolutePressure p_CHWR_nominal=300000 - "Nominal pressure at CHW return line"; + parameter Modelica.Units.SI.AbsolutePressure p_Pressurisation=300000 + "Pressurisation point"; parameter Modelica.Units.SI.Temperature T_CHWR_nominal=12+273.15 "Nominal temperature of CHW return"; parameter Modelica.Units.SI.Temperature T_CHWS_nominal=7+273.15 @@ -95,7 +92,7 @@ model TwoSourcesThreeUsers annotation (Placement(transformation(extent={{20,100},{40,120}}))); Buildings.Fluid.Sources.Boundary_pT sou_p( redeclare final package Medium = MediumCHW, - final p=p_CHWR_nominal, + final p=p_Pressurisation, final T=T_CHWR_nominal, nPorts=1) "Pressurisation point" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -201,8 +198,7 @@ model TwoSourcesThreeUsers Buildings.Fluid.Storage.Plant.Examples.BaseClasses.DummyUser usr1( redeclare package Medium = MediumCHW, m_flow_nominal=m_flow_nominal, - p_a_nominal=p_CHWS_nominal - dp_nominal*0.35, - p_b_nominal=p_CHWR_nominal + dp_nominal*0.35, + dp_nominal=0.7*dp_nominal, T_a_nominal=T_CHWS_nominal, T_b_nominal=T_CHWR_nominal) "Dummy user 1" annotation (Placement( transformation( @@ -212,8 +208,7 @@ model TwoSourcesThreeUsers Buildings.Fluid.Storage.Plant.Examples.BaseClasses.DummyUser usr2( redeclare package Medium = MediumCHW, m_flow_nominal=m_flow_nominal, - p_a_nominal=p_CHWS_nominal - dp_nominal*0.35, - p_b_nominal=p_CHWR_nominal + dp_nominal*0.35, + dp_nominal=0.7*dp_nominal, T_a_nominal=T_CHWS_nominal, T_b_nominal=T_CHWR_nominal) "Dummy usr 2" annotation (Placement( transformation( @@ -223,8 +218,7 @@ model TwoSourcesThreeUsers Buildings.Fluid.Storage.Plant.Examples.BaseClasses.DummyUser usr3( redeclare package Medium = MediumCHW, m_flow_nominal=m_flow_nominal, - p_a_nominal=p_CHWS_nominal - dp_nominal*0.35, - p_b_nominal=p_CHWR_nominal + dp_nominal*0.35, + dp_nominal=0.7*dp_nominal, T_a_nominal=T_CHWS_nominal, T_b_nominal=T_CHWR_nominal) "Dummy user 3" annotation (Placement( transformation( diff --git a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_TwoSourcesThreeUsers.txt b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_TwoSourcesThreeUsers.txt index 5a90d9837d8..53ba97ca06d 100644 --- a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_TwoSourcesThreeUsers.txt +++ b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_TwoSourcesThreeUsers.txt @@ -12,12 +12,12 @@ statistics-simulation= "numerical Jacobians": "0" } time=[0e+00, 3.6e+03] -pumSup1.m_flow=[0e+00, 3.395724661459099e-07, 3.707935718466615e-07, 3.939663884011679e-07, 4.111720386390516e-07, 4.239228132973949e-07, 4.333582808158098e-07, 4.403334230573819e-07, 4.454860516034387e-07, 4.492903258324077e-07, 4.520979075550713e-07, 4.541699922810949e-07, 1.743939220905304e-01, -1.021799747832119e-03, -1.062299590557814e-03, -1.064246520400047e-03, -1.064441166818142e-03, -1.064440933987498e-03, -1.064417883753777e-03, -1.064392970874906e-03, -1.064368523657322e-03, -1.064344891346991e-03, -1.064322073943913e-03, -5.52300363779068e-04, -4.883318324573338e-04, -4.796678258571774e-04, -4.773791297338903e-04, -4.760364245157689e-04, -4.748204082716256e-04, -4.736211558338255e-04, -4.724188183899969e-04, -4.712110967375338e-04, -4.699959245044738e-04, -4.687732725869864e-04, 3.112171292304993e-01, 3.29583466053009e-01, 3.290439546108246e-01, 3.289910852909088e-01, 3.295218348503113e-01, 3.304218649864197e-01, 3.315965533256531e-01, 3.329825401306152e-01, 3.345317244529724e-01, 3.362044394016266e-01, 3.379718363285065e-01, -5.837455973960459e-04, -1.073811086826026e-03, -1.075328444130719e-03, -1.074796658940613e-03, -1.074262429028749e-03, -1.073724240995944e-03, -1.073181978426874e-03, -1.072635059244931e-03, -1.072084065526724e-03, -1.071529346518219e-03, -1.070969388820231e-03, -1.369107514619827e-03, -1.370023237541318e-03, -1.370026264339685e-03, -1.370023819617927e-03, -1.370023004710674e-03, -1.370022189803421e-03, -1.370021724142134e-03, -1.37002021074295e-03, -1.370019279420376e-03, -1.370019861496985e-03, -1.370018231682479e-03, 2.744049727916718e-01, 6.054959893226624e-01, 6.60353422164917e-01, 1.0856614112854e+00, 1.137050628662109e+00, 1.140512466430664e+00, 1.14094340801239e+00, 1.140996098518372e+00, 1.141002535820007e+00, 1.141003370285034e+00, 1.141003489494324e+00, 1.141003489494324e+00, 1.141003489494324e+00, 1.141003489494324e+00, 7.342177033424377e-01, 7.666278481483459e-01, 7.509837746620178e-01, 7.481977343559265e-01, 7.484555840492249e-01, 7.490237355232239e-01, 7.494016289710999e-01, 7.496161460876465e-01, 6.983734369277954e-01, 6.168107688426971e-02, 2.718095108866692e-02, 1.265902351588011e-02, 4.393224080558866e-04, 7.232778898469405e-06, 6.452740421991621e-07, 4.886591113972827e-07, 4.747679724914633e-07, 4.701667535300658e-07, 4.673529190313275e-07, 4.654340273191337e-07] -chiBra2.m_flow=[0e+00, 7.499329447746277e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 1.377374678850174e-01, 4.027182149002329e-05, 6.34175423286365e-09, 8.054307004332073e-13, 8.732322718829169e-17, 6.774715716313163e-19, -3.754955888399381e-19, -2.395863762280548e-19, -6.609365026050198e-20, 2.374121449126562e-20, -1.131466135313442e-18, 6.056602712622631e-21, 8.584747372849197e-22, -2.582677592240762e-23, -2.766249194013347e-27, -3.234298179945682e-31, -3.623129867665756e-35, -3.722267709487547e-39, -4.273960316190692e-43, 2.942726775082116e-44, 1.401298464324817e-45, 0e+00, 2.080636769533157e-01, 7.497302293777466e-01, 7.499999403953552e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01] -tanBra.mTan_flow=[0e+00, -7.499330043792725e-01, -7.500000596046448e-01, -7.500000596046448e-01, -7.500000596046448e-01, -7.500000596046448e-01, -7.500000596046448e-01, -7.500000596046448e-01, -7.500000596046448e-01, -7.500000596046448e-01, -7.500000596046448e-01, -7.500000596046448e-01, -3.34062397480011e-01, -1.278934478759766e-01, -1.469698250293732e-01, -1.473181396722794e-01, -1.473227143287659e-01, -1.473022252321243e-01, -1.472792625427246e-01, -1.472568958997726e-01, -1.472352594137192e-01, -1.47214338183403e-01, -1.471941918134689e-01, 4.092696905136108e-01, 4.489437639713287e-01, 4.539777040481567e-01, 4.553443491458893e-01, 4.561694860458374e-01, 4.569239318370819e-01, 4.576673805713654e-01, 4.584127962589264e-01, 4.591610729694366e-01, 4.599132239818573e-01, 4.606696665287018e-01, 7.336759567260742e-01, 7.518929839134216e-01, 7.502970099449158e-01, 7.496464848518372e-01, 7.494518160820007e-01, 7.494602799415588e-01, 7.495453357696533e-01, 7.496495842933655e-01, 7.497466802597046e-01, 7.498302459716797e-01, 7.498968243598938e-01, 7.265728116035461e-01, 4.808606803417206e-01, 4.787430763244629e-01, 4.796172082424164e-01, 4.804975986480713e-01, 4.813818633556366e-01, 4.822733104228973e-01, 4.831712245941162e-01, 4.840753972530365e-01, 4.849832057952881e-01, 4.858996868133545e-01, -1.385104209184649e-01, -1.465650647878647e-01, -1.465908586978912e-01, -1.465695798397064e-01, -1.465628445148468e-01, -1.465552151203156e-01, -1.465511918067932e-01, -1.465386152267456e-01, -1.465303897857666e-01, -1.46535187959671e-01, -1.465213000774384e-01, -1.377834677696228e-01, -5.401287926360965e-04, -5.992262065410614e-02, -5.551571249961853e-01, -6.8583083152771e-01, -7.026323080062866e-01, -7.047574520111084e-01, -7.050180435180664e-01, -7.050498127937317e-01, -7.050536274909973e-01, -7.050538063049316e-01, -7.050541639328003e-01, -7.050542235374451e-01, -7.050542235374451e-01, -6.308442950248718e-01, -7.666268944740295e-01, -7.50982940196991e-01, -7.481968998908997e-01, -7.48454749584198e-01, -7.49022901058197e-01, -7.49400794506073e-01, -7.496153116226196e-01, -9.064362645149231e-01, -8.114108443260193e-01, -7.771804332733154e-01, -7.626585960388184e-01, -7.504388689994812e-01, -7.500067949295044e-01, -7.500002384185791e-01, -7.500000596046448e-01, -7.500000596046448e-01, -7.500000596046448e-01, -7.500000596046448e-01, -7.500000596046448e-01] -tanBra.pum.m_flow=[0e+00, -2.525248810059111e-08, -2.907192531154124e-08, -3.190893949067686e-08, -3.401540382697021e-08, -3.557646266472148e-08, -3.673163462281082e-08, -3.758558975164306e-08, -3.821642025059191e-08, -3.868217035574162e-08, -3.902589895687925e-08, -3.9279580477114e-08, 4.159376621246338e-01, 6.221067309379578e-01, 6.030303835868835e-01, 6.026820540428162e-01, 6.026774644851685e-01, 6.026979684829712e-01, 6.027209162712097e-01, 6.027433276176453e-01, 6.027649641036987e-01, 6.027858257293701e-01, 6.02806031703949e-01, 1.1592698097229e+00, 1.198943972587585e+00, 1.203977823257446e+00, 1.205344557762146e+00, 1.206169724464417e+00, 1.206924080848694e+00, 1.207667589187622e+00, 1.208413004875183e+00, 1.209161281585693e+00, 1.209913372993469e+00, 1.210669875144958e+00, 1.483676075935364e+00, 1.501893043518066e+00, 1.500297069549561e+00, 1.499646544456482e+00, 1.499451875686646e+00, 1.499460339546204e+00, 1.499545454978943e+00, 1.49964964389801e+00, 1.499746799468994e+00, 1.499830365180969e+00, 1.499897003173828e+00, 1.476572871208191e+00, 1.230860829353333e+00, 1.228743314743042e+00, 1.229617357254028e+00, 1.23049783706665e+00, 1.231382012367249e+00, 1.232273459434509e+00, 1.233171463012695e+00, 1.234075546264648e+00, 1.234983325004578e+00, 1.235899806022644e+00, 6.114897727966306e-01, 6.034350991249084e-01, 6.034093499183655e-01, 6.034306287765503e-01, 6.034373641014099e-01, 6.034449934959412e-01, 6.034489870071411e-01, 6.034615635871887e-01, 6.034697890281677e-01, 6.034650206565857e-01, 6.034789085388184e-01, -4.598509258357808e-05, -4.998095682822168e-04, -4.962249076925218e-04, -2.640515740495175e-04, -7.083019590936601e-05, -2.605489498819225e-06, -9.166085845890848e-08, -2.333348803063018e-08, -1.829977058775967e-08, -1.775560143357779e-08, -1.77452186278515e-08, -1.767785384743092e-08, -1.767195811908095e-08, -1.767147850273432e-08, -5.759201471278175e-08, -4.597435676600981e-08, -4.48521433327187e-08, -4.348834181655548e-08, -4.244678564191418e-08, -4.171925738205573e-08, -4.121686103530919e-08, -4.086554739046733e-08, -4.309796963752888e-08, -4.971923317498295e-08, -4.828208943763457e-08, -4.662432928626004e-08, -4.547683474243058e-08, -4.411604948018066e-08, -4.306172129986408e-08, -4.22556176715716e-08, -4.166017930629096e-08, -4.122149732666003e-08, -4.08982643307354e-08, -4.066008330028126e-08] -tanBra.tan.sta_a.T=[2.851499938964844e+02, 2.851358337402344e+02, 2.851199951171875e+02, 2.851041564941406e+02, 2.850882873535156e+02, 2.850724487304688e+02, 2.850566101074219e+02, 2.85040771484375e+02, 2.8502490234375e+02, 2.850090637207031e+02, 2.849932250976562e+02, 2.849773864746094e+02, 2.849631958007812e+02, 2.849611206054688e+02, 2.849580688476562e+02, 2.849549255371094e+02, 2.849518127441406e+02, 2.849486694335938e+02, 2.849455261230469e+02, 2.849423828125e+02, 2.849392700195312e+02, 2.849361267089844e+02, 2.849329833984375e+02, 2.851532592773438e+02, 2.851538696289062e+02, 2.851545104980469e+02, 2.851550903320312e+02, 2.851556701660156e+02, 2.851561889648438e+02, 2.851567077636719e+02, 2.851571655273438e+02, 2.851576232910156e+02, 2.851580505371094e+02, 2.851584167480469e+02, 2.85158935546875e+02, 2.8515966796875e+02, 2.851603088378906e+02, 2.851609191894531e+02, 2.851614685058594e+02, 2.851619873046875e+02, 2.851624450683594e+02, 2.851628723144531e+02, 2.851632690429688e+02, 2.851636352539062e+02, 2.851639709472656e+02, 2.851641845703125e+02, 2.851642456054688e+02, 2.851642761230469e+02, 2.851642761230469e+02, 2.851642761230469e+02, 2.851642761230469e+02, 2.851642456054688e+02, 2.851642456054688e+02, 2.851642150878906e+02, 2.851641540527344e+02, 2.851641235351562e+02, 2.850184631347656e+02, 2.850162963867188e+02, 2.850140991210938e+02, 2.850119018554688e+02, 2.850097045898438e+02, 2.850075073242188e+02, 2.850053100585938e+02, 2.850030822753906e+02, 2.850008850097656e+02, 2.849986877441406e+02, 2.849964599609375e+02, 2.849946899414062e+02, 2.84994384765625e+02, 2.849941711425781e+02, 2.849899291992188e+02, 2.84980224609375e+02, 2.849696655273438e+02, 2.849589233398438e+02, 2.849481201171875e+02, 2.84937255859375e+02, 2.849263305664062e+02, 2.849153442382812e+02, 2.849043273925781e+02, 2.848932495117188e+02, 2.848821105957031e+02, 2.848700256347656e+02, 2.848587646484375e+02, 2.848468017578125e+02, 2.848347473144531e+02, 2.848226318359375e+02, 2.848104553222656e+02, 2.847982482910156e+02, 2.847859497070312e+02, 2.847734985351562e+02, 2.847584228515625e+02, 2.847453308105469e+02, 2.847324523925781e+02, 2.847198181152344e+02, 2.847072143554688e+02, 2.846945495605469e+02, 2.846818542480469e+02, 2.846691284179688e+02, 2.846563110351562e+02, 2.846434936523438e+02, 2.846305847167969e+02] -tanBra.tan.sta_b.T=[2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801539001464844e+02, 2.801610412597656e+02, 2.8016845703125e+02, 2.801759338378906e+02, 2.801834411621094e+02, 2.801910095214844e+02, 2.801985778808594e+02, 2.802062072753906e+02, 2.802138366699219e+02, 2.802215270996094e+02, 2.80229248046875e+02, 2.802400512695312e+02, 2.802527465820312e+02, 2.802654724121094e+02, 2.802781982421875e+02, 2.802909851074219e+02, 2.803038330078125e+02, 2.803167114257812e+02, 2.803296508789062e+02, 2.803426513671875e+02, 2.803556823730469e+02, 2.803687744140625e+02, 2.803818359375e+02, 2.803916320800781e+02, 2.804000549316406e+02, 2.804085083007812e+02, 2.804170227050781e+02, 2.80425537109375e+02, 2.804341125488281e+02, 2.804426879882812e+02, 2.804513244628906e+02, 2.804599609375e+02, 2.804686584472656e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801506652832031e+02, 2.801503601074219e+02, 2.801501159667969e+02, 2.801500244140625e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02] -usr1.yVal_actual=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 6.459543704986572e-01, 4.170984029769897e-01, 4.003250896930695e-01, 3.998368084430695e-01, 3.99804413318634e-01, 3.998155295848846e-01, 3.998315334320068e-01, 3.998474776744843e-01, 3.998629152774811e-01, 3.998778760433197e-01, 3.998923003673553e-01, 5.017361640930176e-01, 5.463769435882568e-01, 5.536584258079529e-01, 5.555331707000732e-01, 5.565879940986633e-01, 5.575311779975891e-01, 5.584660768508911e-01, 5.594067573547363e-01, 5.60356080532074e-01, 5.613165497779846e-01, 5.622875094413757e-01, 7.463064789772034e-01, 7.139545083045959e-01, 6.871318817138672e-01, 6.708506345748901e-01, 6.604197025299072e-01, 6.534668803215027e-01, 6.487339735031128e-01, 6.454798579216003e-01, 6.432370543479919e-01, 6.416981816291809e-01, 6.406551003456116e-01, 9.191801398992538e-02, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] -usr2.yVal_actual=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 4.304940104484558e-01, 4.498492181301117e-01, 4.520609378814697e-01, 4.5273357629776e-01, 4.531791806221008e-01, 4.53599214553833e-01, 4.540135264396667e-01, 4.544304311275482e-01, 4.548496305942535e-01, 4.552712440490723e-01, 4.556961357593536e-01, 5.653213858604431e-01, 5.486000180244446e-01, 5.424073934555054e-01, 5.381427407264709e-01, 5.351747274398804e-01, 5.33166229724884e-01, 5.318551063537598e-01, 5.310487747192383e-01, 5.306078791618347e-01, 5.304321050643921e-01, 5.304490923881531e-01, 4.946472346782684e-01, 3.832661509513855e-01, 3.825566172599792e-01, 3.828198611736298e-01, 3.830846548080444e-01, 3.833508491516113e-01, 3.83619099855423e-01, 3.838894367218018e-01, 3.841616809368134e-01, 3.844352066516876e-01, 3.847113251686096e-01, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] -usr3.yVal_actual=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 4.581530094146729e-01, 4.817582368850708e-01, 4.791752099990845e-01, 4.770678281784058e-01, 4.756242334842682e-01, 4.747262299060822e-01, 4.742512702941895e-01, 4.740960001945496e-01, 4.741798937320709e-01, 4.744415283203125e-01, 4.748351275920868e-01, 4.58635538816452e-01, 3.829712271690369e-01, 3.823499083518982e-01, 3.826169371604919e-01, 3.828858137130737e-01, 3.831558525562286e-01, 3.834279477596283e-01, 3.837019205093384e-01, 3.839777410030365e-01, 3.84254664182663e-01, 3.8453409075737e-01, 3.643192648887633e-01, 3.601286113262177e-01, 3.601105809211731e-01, 3.601225614547729e-01, 3.601261079311371e-01, 3.601298332214355e-01, 3.601325452327728e-01, 3.601387739181519e-01, 3.601439297199249e-01, 3.601404428482056e-01, 3.601474761962891e-01, 6.125434041023254e-01, 6.704702377319336e-01, 6.659795641899109e-01, 7.626306414604187e-01, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1.074094846844673e-01, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] +pumSup1.m_flow=[0e+00, 3.682384601688682e-07, 4.183336557161965e-07, 4.570195528685872e-07, 4.866511744694435e-07, 5.092527999295271e-07, 5.264398623694433e-07, 5.394840627559461e-07, 5.493685080182331e-07, 5.568504093389492e-07, 5.625092285299615e-07, 5.667866389558185e-07, 2.370962798595428e-01, -1.02650816552341e-03, -1.062432420440018e-03, -1.064502401277423e-03, -1.064698095433414e-03, -1.064689829945564e-03, -1.064658397808671e-03, -1.06462521944195e-03, -1.064592739567161e-03, -1.064561307430267e-03, -1.064531039446592e-03, -5.748440162278712e-04, -2.672636765055358e-04, -3.496059434837662e-05, 3.527660295367241e-02, 4.912943020462994e-02, 6.033746898174289e-02, 6.925318390130997e-02, 7.624568790197372e-02, 8.170176297426224e-02, 8.595915883779526e-02, 8.929400891065598e-02, 2.926747798919678e-01, 3.273143470287323e-01, 3.251822888851166e-01, 3.246727287769318e-01, 3.253082633018494e-01, 3.265558183193207e-01, 3.281334936618805e-01, 3.298918902873993e-01, 3.317521214485168e-01, 3.336717188358307e-01, 3.356277346611023e-01, -8.123792940750718e-04, -1.075853942893445e-03, -1.076338114216924e-03, -1.075812266208231e-03, -1.07527885120362e-03, -1.074742060154676e-03, -1.074201427400112e-03, -1.073656720109284e-03, -1.07310782186687e-03, -1.072554849088192e-03, -1.071997918188572e-03, -1.343236071988941e-03, -1.370038371533155e-03, -1.370040467008948e-03, -1.37003802228719e-03, -1.370036974549294e-03, -1.370033365674317e-03, -1.370033016428351e-03, -1.370033249258995e-03, -1.370031735859811e-03, -1.370030222460628e-03, -1.370029174722731e-03, 3.315761685371399e-01, 6.189941167831421e-01, 6.787878274917603e-01, 1.081329107284546e+00, 1.128029942512512e+00, 1.129578471183777e+00, 1.131399750709534e+00, 1.132268905639648e+00, 1.132739424705505e+00, 1.13299560546875e+00, 1.133134603500366e+00, 1.133209943771362e+00, 1.133251070976257e+00, 1.133273243904114e+00, 1.133285403251648e+00, 1.00748348236084e+00, 7.809529304504395e-01, 7.440788745880127e-01, 7.468692064285278e-01, 7.514137029647827e-01, 7.512231469154358e-01, 7.502415180206299e-01, 7.020224928855896e-01, 8.854828774929047e-02, 4.434092715382576e-02, 1.80867612361908e-02, 8.980836719274521e-04, 1.448385955882259e-05, 9.540339078739635e-07, 6.226896971384122e-07, 5.970157985757396e-07, 5.914587291044882e-07, 5.883863991584803e-07, 5.862727903149789e-07] +chiBra2.m_flow=[0e+00, 7.499328851699829e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 1.377373933792114e-01, 4.040718340547755e-05, 8.681285912359726e-09, 1.140846423407227e-12, 1.651618161845932e-16, 1.535416368871338e-20, -3.215030513349842e-21, 9.186827977601475e-23, -1.154648638778284e-22, 1.256087947036292e-22, 6.665683744778486e-24, -2.686873308691509e-25, -4.423649692186785e-26, 9.387511794492105e-27, -1.919542718097297e-28, 2.711771427798951e-31, 2.788875844565854e-35, 2.828917517705047e-39, 2.844635882579379e-43, 0e+00, 0e+00, 0e+00, 2.080636471509933e-01, 7.497290968894958e-01, 7.499999403953552e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01, 7.5e-01] +tanBra.mTan_flow=[0e+00, -7.499330043792725e-01, -7.500001192092896e-01, -7.500001192092896e-01, -7.500001192092896e-01, -7.500001788139343e-01, -7.500001788139343e-01, -7.500001788139343e-01, -7.500001788139343e-01, -7.500001788139343e-01, -7.500001788139343e-01, -7.500001788139343e-01, -3.974629044532776e-01, -1.327143460512161e-01, -1.470968872308731e-01, -1.475463211536407e-01, -1.475509852170944e-01, -1.475232690572739e-01, -1.474929749965668e-01, -1.474632173776627e-01, -1.474343836307526e-01, -1.474066525697708e-01, -1.473797857761383e-01, 3.898389935493469e-01, 4.418643414974213e-01, 4.505376815795898e-01, 4.280976057052612e-01, 4.119131863117217e-01, 3.994326889514923e-01, 3.898648321628571e-01, 3.825786113739014e-01, 3.77055436372757e-01, 3.728825449943542e-01, 3.697375357151031e-01, 7.321470975875854e-01, 7.408843636512756e-01, 7.451974749565125e-01, 7.474600076675415e-01, 7.486563324928284e-01, 7.492945194244385e-01, 7.496379613876343e-01, 7.498257756233215e-01, 7.49930202960968e-01, 7.499898672103882e-01, 7.500248551368713e-01, 6.620296239852905e-01, 4.777297377586365e-01, 4.770644307136536e-01, 4.779334366321564e-01, 4.788138866424561e-01, 4.796990156173706e-01, 4.805895984172821e-01, 4.814857244491577e-01, 4.823878109455109e-01, 4.832955598831177e-01, 4.842089116573334e-01, -3.00148921087815e-03, -1.466972231864929e-01, -1.46715059876442e-01, -1.466939151287079e-01, -1.466851830482483e-01, -1.466533690690994e-01, -1.466495990753174e-01, -1.466521471738815e-01, -1.466384381055832e-01, -1.466255486011505e-01, -1.46616518497467e-01, -1.378796398639679e-01, -7.160836830735207e-04, -7.214805483818054e-02, -5.942865014076233e-01, -7.291600704193115e-01, -7.352108955383301e-01, -7.424048781394958e-01, -7.458674907684326e-01, -7.477498650550842e-01, -7.487776279449463e-01, -7.493355870246887e-01, -7.496384382247925e-01, -7.498037815093994e-01, -7.498930692672729e-01, -7.499417662620544e-01, -8.342301249504089e-01, -7.809523344039917e-01, -7.440782785415649e-01, -7.468686103820801e-01, -7.51413106918335e-01, -7.51222550868988e-01, -7.502409219741821e-01, -9.100855588912964e-01, -8.382769227027893e-01, -7.943404316902161e-01, -7.68086314201355e-01, -7.508976459503174e-01, -7.50014066696167e-01, -7.50000536441803e-01, -7.500002384185791e-01, -7.500001788139343e-01, -7.500001788139343e-01, -7.500001788139343e-01, -7.500001788139343e-01] +tanBra.pum.m_flow=[0e+00, -7.139090030250372e-08, -8.288413511081671e-08, -9.176156368084776e-08, -9.856127292096062e-08, -1.037477801446585e-07, -1.0769176839176e-07, -1.106850859855513e-07, -1.129533089283541e-07, -1.146702217624807e-07, -1.15968774139219e-07, -1.169503320852527e-07, 3.525371849536896e-01, 6.172858476638794e-01, 6.029033064842224e-01, 6.02453887462616e-01, 6.024492383003235e-01, 6.024768948554993e-01, 6.025072336196899e-01, 6.025369763374329e-01, 6.025658249855042e-01, 6.025935411453247e-01, 6.026204228401184e-01, 1.139839172363281e+00, 1.191864490509033e+00, 1.200537800788879e+00, 1.17809784412384e+00, 1.161913394927979e+00, 1.149432897567749e+00, 1.139865040779114e+00, 1.132578730583191e+00, 1.127055644989014e+00, 1.122882723808289e+00, 1.11973774433136e+00, 1.482147216796875e+00, 1.49088454246521e+00, 1.495197653770447e+00, 1.497460126876831e+00, 1.498656511306763e+00, 1.499294638633728e+00, 1.499638080596924e+00, 1.499825954437256e+00, 1.499930381774902e+00, 1.499989986419678e+00, 1.500025033950806e+00, 1.41202986240387e+00, 1.227729916572571e+00, 1.227064609527588e+00, 1.227933645248413e+00, 1.228814125061035e+00, 1.22969913482666e+00, 1.230589747428894e+00, 1.231485843658447e+00, 1.232388019561768e+00, 1.233295679092407e+00, 1.234209060668945e+00, 7.469987273216204e-01, 6.033029556274414e-01, 6.032851338386536e-01, 6.033062934875488e-01, 6.03314995765686e-01, 6.033468246459961e-01, 6.033505797386169e-01, 6.033480763435364e-01, 6.033617854118347e-01, 6.033746600151062e-01, 6.033836603164673e-01, -1.422180648660287e-04, -6.75612420309335e-04, -7.168837473727763e-04, -3.025619953405112e-04, -8.270661055576056e-05, -3.363728183103376e-06, -1.128753339685318e-07, -2.756983263907387e-08, -2.138186516731366e-08, -2.057007186806459e-08, -2.039713997703529e-08, -2.032872004065212e-08, -2.029328882713344e-08, -2.027439549578958e-08, -2.026409617883473e-08, -9.092409669619883e-08, -1.254339423439887e-07, -1.257965749346113e-07, -1.229968233928957e-07, -1.21884383474935e-07, -1.215595801795644e-07, -1.212505509329276e-07, -1.256512121017295e-07, -1.375103266809674e-07, -1.346979843219742e-07, -1.322464129316359e-07, -1.300954437510882e-07, -1.277429078072601e-07, -1.258850517160681e-07, -1.244368377228966e-07, -1.233399871125584e-07, -1.225133274829204e-07, -1.218901815036588e-07, -1.214201859056629e-07] +tanBra.tan.sta_a.T=[2.851499938964844e+02, 2.851358337402344e+02, 2.851199951171875e+02, 2.851041564941406e+02, 2.850882873535156e+02, 2.850724487304688e+02, 2.850566101074219e+02, 2.85040771484375e+02, 2.8502490234375e+02, 2.850090637207031e+02, 2.849932250976562e+02, 2.849773864746094e+02, 2.849627990722656e+02, 2.849596557617188e+02, 2.849566040039062e+02, 2.849534606933594e+02, 2.849503173828125e+02, 2.849471740722656e+02, 2.849440612792969e+02, 2.8494091796875e+02, 2.849377746582031e+02, 2.849346313476562e+02, 2.849314880371094e+02, 2.851541137695312e+02, 2.851549072265625e+02, 2.851557312011719e+02, 2.85156494140625e+02, 2.851571655273438e+02, 2.851578063964844e+02, 2.851583557128906e+02, 2.851588745117188e+02, 2.851593627929688e+02, 2.851598205566406e+02, 2.851602172851562e+02, 2.851607055664062e+02, 2.85161376953125e+02, 2.851619873046875e+02, 2.851625671386719e+02, 2.851631164550781e+02, 2.851636047363281e+02, 2.851640625e+02, 2.851644897460938e+02, 2.851648864746094e+02, 2.851652526855469e+02, 2.851655883789062e+02, 2.851658325195312e+02, 2.851659851074219e+02, 2.851661376953125e+02, 2.85166259765625e+02, 2.851663513183594e+02, 2.851664428710938e+02, 2.851665344238281e+02, 2.851665954589844e+02, 2.851666259765625e+02, 2.851666870117188e+02, 2.851667175292969e+02, 2.850157775878906e+02, 2.850138549804688e+02, 2.850116271972656e+02, 2.850093994140625e+02, 2.850071716308594e+02, 2.850049438476562e+02, 2.85002685546875e+02, 2.850004577636719e+02, 2.849982299804688e+02, 2.849959716796875e+02, 2.849937133789062e+02, 2.849918518066406e+02, 2.849915466308594e+02, 2.849913024902344e+02, 2.849863891601562e+02, 2.849758911132812e+02, 2.849646301269531e+02, 2.849531860351562e+02, 2.849416198730469e+02, 2.84929931640625e+02, 2.849181518554688e+02, 2.849063110351562e+02, 2.848944091796875e+02, 2.848824462890625e+02, 2.848704223632812e+02, 2.848583679199219e+02, 2.84845458984375e+02, 2.848333740234375e+02, 2.848210754394531e+02, 2.848087463378906e+02, 2.847963562011719e+02, 2.84783935546875e+02, 2.84771484375e+02, 2.847588500976562e+02, 2.84742919921875e+02, 2.847293090820312e+02, 2.847160339355469e+02, 2.847032165527344e+02, 2.846904296875e+02, 2.846776123046875e+02, 2.846647644042969e+02, 2.8465185546875e+02, 2.846388854980469e+02, 2.846259155273438e+02, 2.846128845214844e+02] +tanBra.tan.sta_b.T=[2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801534118652344e+02, 2.801603393554688e+02, 2.801676635742188e+02, 2.801748657226562e+02, 2.801817626953125e+02, 2.801884460449219e+02, 2.801949768066406e+02, 2.802013854980469e+02, 2.802077026367188e+02, 2.802139282226562e+02, 2.802201232910156e+02, 2.802294616699219e+02, 2.802418212890625e+02, 2.802543640136719e+02, 2.802669677734375e+02, 2.802796630859375e+02, 2.802924499511719e+02, 2.803052673339844e+02, 2.803181457519531e+02, 2.803310852050781e+02, 2.803440551757812e+02, 2.803570861816406e+02, 2.80369873046875e+02, 2.80379150390625e+02, 2.803875122070312e+02, 2.803959045410156e+02, 2.804043273925781e+02, 2.804128112792969e+02, 2.804212951660156e+02, 2.804298095703125e+02, 2.804383850097656e+02, 2.804469604492188e+02, 2.804555969238281e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801506652832031e+02, 2.801503295898438e+02, 2.801501159667969e+02, 2.801500244140625e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02, 2.801499938964844e+02] +usr1.yVal_actual=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 6.41156792640686e-01, 5.404684543609619e-01, 5.251849889755249e-01, 5.245451927185059e-01, 5.245080590248108e-01, 5.245265960693359e-01, 5.2455073595047e-01, 5.245749354362488e-01, 5.245983600616455e-01, 5.246209502220154e-01, 5.246428251266479e-01, 6.280064582824707e-01, 7.002472281455994e-01, 7.202270030975342e-01, 7.013391852378845e-01, 6.809322237968445e-01, 6.675747036933899e-01, 6.584793329238892e-01, 6.521137952804565e-01, 6.475862860679626e-01, 6.443362236022949e-01, 6.419934034347534e-01, 6.410610675811768e-01, 6.395081281661987e-01, 6.386056542396545e-01, 6.38007640838623e-01, 6.376240849494934e-01, 6.373976469039917e-01, 6.37286901473999e-01, 6.372615098953247e-01, 6.372989416122437e-01, 6.373826265335083e-01, 6.375001668930054e-01, 1.169224977493286e-01, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] +usr2.yVal_actual=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 5.482962727546692e-01, 5.801566243171692e-01, 5.845592617988586e-01, 5.780819058418274e-01, 5.725043416023254e-01, 5.684823393821716e-01, 5.655529499053955e-01, 5.634220838546753e-01, 5.618778467178345e-01, 5.607662200927734e-01, 5.599749088287354e-01, 5.743375420570374e-01, 5.794874429702759e-01, 5.790917873382568e-01, 5.789182782173157e-01, 5.789588689804077e-01, 5.791423320770264e-01, 5.794235467910767e-01, 5.797733068466187e-01, 5.801724195480347e-01, 5.806078314781189e-01, 5.810703635215759e-01, 5.538818836212158e-01, 5.049773454666138e-01, 5.046695470809937e-01, 5.049616098403931e-01, 5.052576661109924e-01, 5.055554509162903e-01, 5.058552622795105e-01, 5.061570405960083e-01, 5.064610838890076e-01, 5.067671537399292e-01, 5.070752501487732e-01, 6.83151781558969e-02, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] +usr3.yVal_actual=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 5.116496086120605e-01, 5.400435924530029e-01, 5.396100878715515e-01, 5.393895506858826e-01, 5.395047664642334e-01, 5.398209691047668e-01, 5.40260374546051e-01, 5.407784581184387e-01, 5.41348934173584e-01, 5.419557690620422e-01, 5.425889492034912e-01, 5.30870258808136e-01, 5.045622587203979e-01, 5.044167637825012e-01, 5.047140121459961e-01, 5.050151348114014e-01, 5.053178668022156e-01, 5.056224465370178e-01, 5.059288740158081e-01, 5.062373280525208e-01, 5.06547749042511e-01, 5.06860077381134e-01, 4.868187010288237e-01, 4.802944660186768e-01, 4.802842438220978e-01, 4.802963733673096e-01, 4.803010225296021e-01, 4.803195893764496e-01, 4.803218245506287e-01, 4.803203642368317e-01, 4.80328232049942e-01, 4.803356230258942e-01, 4.803408086299896e-01, 7.311335206031799e-01, 7.850530743598938e-01, 7.359024286270142e-01, 8.759254813194275e-01, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 2.914471328258514e-01, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00] From 3a8df70ee3276e3df2e7cfdaf48e680a9b1e8232 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Thu, 17 Mar 2022 10:57:47 -0700 Subject: [PATCH 075/463] improved diagram [ci skip] --- .../Plant/Examples/TwoSourcesThreeUsers.mo | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index 6875cac9109..a49b5c868b4 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -160,14 +160,14 @@ model TwoSourcesThreeUsers transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-170,-70}))); + origin={-170,-110}))); Modelica.Blocks.Sources.BooleanTable uTanDis(table={3600/9*1,3600/9*6,3600/9* 8}, startValue=false) "True = discharging; false = charging (either local or remote)" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, - rotation=0, - origin={-170,-110}))); + rotation=-90, + origin={-170,-20}))); Buildings.Fluid.Storage.Plant.BaseClasses.ReversiblePumpValveControl conPumSecGro "Control block for secondary pump-valve group" annotation (Placement(transformation(extent={{-10,-10},{10,10}}, @@ -179,8 +179,8 @@ model TwoSourcesThreeUsers "Set a positive flow rate when tank discharging and negative when charging" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, - rotation=90, - origin={-130,-90}))); + rotation=-90, + origin={-170,-50}))); Buildings.Controls.OBC.CDL.Conversions.BooleanToReal mChiBra2Set_flow( realTrue=0, realFalse=chiBra2.m_flow_nominal) "Set the flow rate to a constant value whenever the tank is not being charged remotely" @@ -397,8 +397,8 @@ equation annotation (Line(points={{-99,-54},{-81,-54}}, color={0,0,127})); connect(conPumSecGro.yPumSec, tanBra.yPum) annotation (Line(points={{-99,-58},{-81,-58}}, color={0,0,127})); - connect(uRemCha.y, conPumSecGro.uRemCha) annotation (Line(points={{-159,-70},{ - -118,-70}}, color={255,0,255})); + connect(uRemCha.y, conPumSecGro.uRemCha) annotation (Line(points={{-159,-110}, + {-118,-110},{-118,-70}}, color={255,0,255})); connect(tanBra.yValDis_actual, conPumSecGro.yValDis_actual) annotation (Line( points={{-59,-50},{-56,-50},{-56,-40},{-126,-40},{-126,-50},{-121,-50}}, color={0,0,127})); @@ -408,12 +408,13 @@ equation connect(tanBra.mTan_flow, conPumSecGro.mTan_flow) annotation (Line(points={{-59, -58},{-48,-58},{-48,-32},{-134,-32},{-134,-58},{-121,-58}}, color={0, 0,127})); - connect(uTanDis.y, mTanSet_flow.u) annotation (Line(points={{-159,-110},{-130, - -110},{-130,-102}}, color={255,0,255})); - connect(mTanSet_flow.y, conPumSecGro.mTanSet_flow) annotation (Line(points={{-130, - -78},{-130,-62},{-121,-62}}, color={0,0,127})); - connect(mChiBra2Set_flow.u, uRemCha.y) annotation (Line(points={{-122,-10},{-148, - -10},{-148,-70},{-159,-70}}, + connect(uTanDis.y, mTanSet_flow.u) annotation (Line(points={{-170,-31},{-170, + -38}}, color={255,0,255})); + connect(mTanSet_flow.y, conPumSecGro.mTanSet_flow) annotation (Line(points={{-170, + -62},{-170,-68},{-126,-68},{-126,-62},{-121,-62}}, + color={0,0,127})); + connect(mChiBra2Set_flow.u, uRemCha.y) annotation (Line(points={{-122,-10},{ + -140,-10},{-140,-110},{-159,-110}}, color={255,0,255})); connect(tanBra.port_3, chiBra2.port_a) annotation (Line(points={{-74,-50},{-74, -26},{-86,-26},{-86,-10},{-80,-10}}, color={0,127,255})); @@ -448,8 +449,8 @@ equation 82}}, color={255,0,255})); connect(preDroS1U2.port_a, chi1.port_b2) annotation (Line(points={{-30,20},{-36, 20},{-36,80},{-124,80}}, color={0,127,255})); - connect(uRemCha.y, or2.u1) annotation (Line(points={{-159,-70},{-118,-70},{-118, - -110},{-100,-110},{-100,-102}}, color={255,0,255})); + connect(uRemCha.y, or2.u1) annotation (Line(points={{-159,-110},{-100,-110},{ + -100,-102}}, color={255,0,255})); connect(conPumSecGro.uOnl, or2.y) annotation (Line(points={{-114,-70},{-114,-74}, {-100,-74},{-100,-78}}, color={255,0,255})); connect(hysCat.y, or2.u2) annotation (Line(points={{-2,-110},{-92,-110},{-92,-102}}, From 88506a36fa72917725a5fbfeb21804764d8f7548 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Thu, 7 Apr 2022 16:22:13 -0700 Subject: [PATCH 076/463] moved the supply pump and valves out of tank model --- .../Plant/BaseClasses/NominalValues.mo | 32 +++ .../BaseClasses/ReversiblePumpValveControl.mo | 158 +++++------ .../Storage/Plant/BaseClasses/package.order | 1 + .../Examples/BaseClasses/ChillerBranch.mo | 162 +++++++----- .../Plant/Examples/OneSourceOneUser.mo | 136 +++++----- .../Plant/Examples/TwoSourcesThreeUsers.mo | 160 ++++++------ .../Storage/Plant/SupplyPumpClosedTank.mo | 219 ++++++++++++++++ Buildings/Fluid/Storage/Plant/TankBranch.mo | 247 ++++-------------- .../BaseClasses/PartialTankBranch.mo | 88 +++---- .../Plant/Validation/NoRemoteCharging.mo | 25 +- .../Plant/Validation/WithRemoteCharging.mo | 55 ++-- Buildings/Fluid/Storage/Plant/package.order | 1 + .../Plant/Examples/OneSourceOneUser.mos | 2 +- .../Plant/Examples/TwoSourcesThreeUsers.mos | 2 +- .../Plant/Validation/NoRemoteCharging.mos | 2 +- .../Plant/Validation/WithRemoteCharging.mos | 2 +- 16 files changed, 724 insertions(+), 568 deletions(-) create mode 100644 Buildings/Fluid/Storage/Plant/BaseClasses/NominalValues.mo create mode 100644 Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/NominalValues.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/NominalValues.mo new file mode 100644 index 00000000000..2b6c78e3450 --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/NominalValues.mo @@ -0,0 +1,32 @@ +within Buildings.Fluid.Storage.Plant.BaseClasses; +record NominalValues "Nominal values" + extends Modelica.Icons.Record; + + parameter Boolean allowRemoteCharging = true + "= true if the tank is allowed to be charged by a remote source" + annotation(dialog(group="Plant configuration")); + + final parameter Modelica.Units.SI.MassFlowRate m_flow_nominal= + mTan_flow_nominal+mChi_flow_nominal + "Nominal mass flow rate" + annotation(enable=false); + parameter Modelica.Units.SI.MassFlowRate mTan_flow_nominal(min=0) + "Nominal mass flow rate for CHW tank branch" + annotation(dialog(group="Nominal values")); + parameter Modelica.Units.SI.MassFlowRate mChi_flow_nominal(min=0) + "Nominal mass flow rate for CHW tank branch" + annotation(dialog(group="Nominal values")); + parameter Modelica.Units.SI.PressureDifference dp_nominal(final displayUnit="Pa") + "Nominal pressure difference" + annotation(dialog(group="Nominal values")); + parameter Modelica.Units.SI.Temperature T_CHWS_nominal=7+273.15 + "Nominal temperature of CHW supply" + annotation(dialog(group="Nominal values")); + parameter Modelica.Units.SI.Temperature T_CHWR_nominal=12+273.15 + "Nominal temperature of CHW return" + annotation(dialog(group="Nominal values")); + + annotation ( + defaultComponentPrefixes = "parameter", + defaultComponentName = "nom"); +end NominalValues; diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo index 0348992b82a..e4f05a88201 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo @@ -10,87 +10,93 @@ block ReversiblePumpValveControl k=5, Ti=50) "PI controller" annotation (Placement(transformation( extent={{-10,10},{10,-10}}, - rotation=270, - origin={-70,50}))); + rotation=0, + origin={-70,30}))); Buildings.Controls.Continuous.LimPID conPI_valCha( controllerType=Modelica.Blocks.Types.SimpleController.PI, k=5, Ti=50, reverseActing=false) "PI controller" annotation (Placement(transformation( extent={{-10,10},{10,-10}}, - rotation=270, - origin={-10,50}))); + rotation=0, + origin={-10,30}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uRemCha "Tank is being charged remotely" annotation (Placement(transformation( - extent={{-120,-10},{-100,10}}), iconTransformation(extent={{-20,-20}, - {20,20}}, - rotation=90, - origin={-80,-120}))); + extent={{-10,-10},{10,10}}, + rotation=180, + origin={110,40}), iconTransformation(extent={{20,-20},{ + -20,20}}, + rotation=0, + origin={120,80}))); Modelica.Blocks.Interfaces.RealInput mTanSet_flow "Tank mass flow rate setpoint" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, - rotation=-90, - origin={-70,110}), iconTransformation( + rotation=0, + origin={-110,80}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-110,-40}))); + origin={-110,80}))); Modelica.Blocks.Interfaces.RealInput mTan_flow "Measured tank mass flow rate" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, - rotation=-90, - origin={10,110}), iconTransformation( + rotation=0, + origin={-110,60}),iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-110,0}))); + origin={-110,40}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uOnl "= true if plant is online (not cut off from the network by valve)" - annotation (Placement(transformation(extent={{-120,-30},{-100,-10}}), - iconTransformation(extent={{-20,-20},{20,20}}, - rotation=90, - origin={-40,-120}))); - Modelica.Blocks.Interfaces.RealOutput yPumSec "Normalised speed" annotation ( + annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + rotation=180, + origin={110,-40}), + iconTransformation(extent={{20,-20},{-20,20}}, + rotation=0, + origin={120,40}))); + Modelica.Blocks.Interfaces.RealOutput yPum "Normalised speed" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={-50,-170}), iconTransformation( extent={{-10,-10},{10,10}}, - rotation=0, - origin={110,0}))); + rotation=-90, + origin={0,-110}))); Modelica.Blocks.Interfaces.RealOutput yValCha "Valve position" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={70,-170}), iconTransformation( + origin={10,-170}), iconTransformation( extent={{-10,-10},{10,10}}, - rotation=0, - origin={110,40}))); + rotation=-90, + origin={40,-110}))); Modelica.Blocks.Interfaces.RealOutput yValDis "Valve position" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={10,-170}), iconTransformation( + origin={70,-170}), iconTransformation( extent={{-10,-10},{10,10}}, - rotation=0, - origin={110,80}))); + rotation=-90, + origin={80,-110}))); Modelica.Blocks.Interfaces.RealInput yValCha_actual "Actual valve position" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, + extent={{10,-10},{-10,10}}, rotation=180, - origin={110,70}), iconTransformation( + origin={-110,-10}), + iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-110,40}))); + origin={-110,-40}))); Modelica.Blocks.Interfaces.RealInput yValDis_actual "Actual valve position" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, + extent={{10,-10},{-10,10}}, rotation=180, - origin={110,30}), iconTransformation( + origin={-110,-50}), + iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-110,80}))); + origin={-110,0}))); Buildings.Controls.OBC.CDL.Continuous.LessThreshold isValDisClo(t=0.05) "= true if valve closed" - annotation (Placement(transformation(extent={{80,20},{60,40}}))); + annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}))); Buildings.Controls.OBC.CDL.Continuous.Switch swiPumPri "True = on (y>0); false = off (y=0)." annotation (Placement( transformation( @@ -102,88 +108,88 @@ block ReversiblePumpValveControl annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={10,-130}))); + origin={70,-130}))); Buildings.Controls.OBC.CDL.Continuous.Switch swiValCha "True = on (y>0); false = off (y=0)." annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={70,-130}))); + origin={10,-130}))); Buildings.Controls.OBC.CDL.Logical.And3 and3 "Plant online AND not charging remotely AND valCha closed" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={10,-70}))); + origin={70,-70}))); Buildings.Controls.OBC.CDL.Continuous.LessThreshold isValChaClo(t=0.05) "= true if valve closed" - annotation (Placement(transformation(extent={{80,60},{60,80}}))); + annotation (Placement(transformation(extent={{-80,-20},{-60,0}}))); Buildings.Controls.OBC.CDL.Logical.Not notRemCha "Tank is not being charged remotely" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={10,-30}))); + origin={70,10}))); Buildings.Controls.OBC.CDL.Logical.And andValCha "Charging remotely AND valDis closed" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={60,-70}))); + origin={10,-70}))); equation connect(conPI_pumSec.u_s,mTanSet_flow) - annotation (Line(points={{-70,62},{-70,110}}, color={0,0,127})); - connect(conPI_valCha.u_s,mTanSet_flow) annotation (Line(points={{-10,62},{ - -10,90},{-70,90},{-70,110}}, + annotation (Line(points={{-82,30},{-88,30},{-88,80},{-110,80}}, + color={0,0,127})); + connect(conPI_valCha.u_s,mTanSet_flow) annotation (Line(points={{-22,30},{ + -34,30},{-34,80},{-110,80}}, color={0,0,127})); connect(conPI_valCha.u_m, mTan_flow) - annotation (Line(points={{2,50},{10,50},{10,110}}, color={0,0,127})); - connect(conPI_pumSec.u_m, mTan_flow) annotation (Line(points={{-58,50},{-42, - 50},{-42,80},{10,80},{10,110}}, color={0,0,127})); + annotation (Line(points={{-10,42},{-10,60},{-110,60}}, + color={0,0,127})); + connect(conPI_pumSec.u_m, mTan_flow) annotation (Line(points={{-70,42},{-70, + 60},{-110,60}}, color={0,0,127})); connect(yValDis, yValDis) - annotation (Line(points={{10,-170},{10,-170}}, color={0,0,127})); - connect(swiPumPri.y, yPumSec) + annotation (Line(points={{70,-170},{70,-170}}, color={0,0,127})); + connect(swiPumPri.y, yPum) annotation (Line(points={{-50,-142},{-50,-170}}, color={0,0,127})); connect(zero.y, swiPumPri.u3) annotation (Line(points={{-79,-110},{-58,-110},{ -58,-118}}, color={0,0,127})); connect(swiValCha.y, yValCha) - annotation (Line(points={{70,-142},{70,-170}}, color={0,0,127})); - connect(zero.y, swiValCha.u3) annotation (Line(points={{-79,-110},{62,-110},{62, + annotation (Line(points={{10,-142},{10,-170}}, color={0,0,127})); + connect(zero.y, swiValCha.u3) annotation (Line(points={{-79,-110},{2,-110},{2, -118}}, color={0,0,127})); - connect(uOnl, and3.u3) - annotation (Line(points={{-110,-20},{-20,-20},{-20,-50},{2,-50},{2,-58}}, - color={255,0,255})); connect(isValChaClo.u, yValCha_actual) - annotation (Line(points={{82,70},{110,70}}, color={0,0,127})); - connect(isValChaClo.y, and3.u1) - annotation (Line(points={{58,70},{40,70},{40,-50},{18,-50},{18,-58}}, - color={255,0,255})); + annotation (Line(points={{-82,-10},{-110,-10}}, + color={0,0,127})); connect(isValDisClo.u, yValDis_actual) - annotation (Line(points={{82,30},{110,30}}, color={0,0,127})); - connect(isValDisClo.y, andValCha.u2) annotation (Line(points={{58,30},{52,30}, - {52,-58}}, color={255,0,255})); - connect(andValCha.y, swiValCha.u2) annotation (Line(points={{60,-82},{60,-100}, - {70,-100},{70,-118}},color={255,0,255})); - connect(conPI_pumSec.y, swiPumPri.u1) annotation (Line(points={{-70,39},{-70, - 10},{-42,10},{-42,-118}}, - color={0,0,127})); - connect(conPI_valCha.y, swiValCha.u1) annotation (Line(points={{-10,39},{-10, - 10},{78,10},{78,-118}}, + annotation (Line(points={{-82,-50},{-110,-50}}, + color={0,0,127})); + connect(isValDisClo.y, andValCha.u2) annotation (Line(points={{-58,-50},{2, + -50},{2,-58}}, color={255,0,255})); + connect(andValCha.y, swiValCha.u2) annotation (Line(points={{10,-82},{10,-100}, + {10,-100},{10,-118}},color={255,0,255})); + connect(conPI_pumSec.y, swiPumPri.u1) annotation (Line(points={{-59,30},{-42, + 30},{-42,-118}}, color={0,0,127})); + connect(conPI_valCha.y, swiValCha.u1) annotation (Line(points={{1,30},{30,30}, + {30,-100},{18,-100},{18,-118}}, color={0,0,127})); - connect(and3.y, swiPumPri.u2) annotation (Line(points={{10,-82},{10,-100},{ - -50,-100},{-50,-118}}, + connect(and3.y, swiPumPri.u2) annotation (Line(points={{70,-82},{70,-114},{ + -50,-114},{-50,-118}}, color={255,0,255})); connect(booToReaValDis.y, yValDis) - annotation (Line(points={{10,-142},{10,-170}}, color={0,0,127})); - connect(and3.y, booToReaValDis.u) annotation (Line(points={{10,-82},{10,-100}, - {10,-100},{10,-118}}, + annotation (Line(points={{70,-142},{70,-170}}, color={0,0,127})); + connect(and3.y, booToReaValDis.u) annotation (Line(points={{70,-82},{70,-118}}, color={255,0,255})); connect(uRemCha, notRemCha.u) - annotation (Line(points={{-110,0},{10,0},{10,-18}}, color={255,0,255})); - connect(notRemCha.y, and3.u2) - annotation (Line(points={{10,-42},{10,-58}}, color={255,0,255})); + annotation (Line(points={{110,40},{70,40},{70,22}}, color={255,0,255})); connect(andValCha.u1, uRemCha) - annotation (Line(points={{60,-58},{60,0},{-110,0}}, color={255,0,255})); + annotation (Line(points={{10,-58},{10,40},{110,40}},color={255,0,255})); + connect(and3.u3, isValChaClo.y) + annotation (Line(points={{62,-58},{62,-10},{-58,-10}}, color={255,0,255})); + connect(notRemCha.y, and3.u2) + annotation (Line(points={{70,-2},{70,-58}}, color={255,0,255})); + connect(and3.u1, uOnl) + annotation (Line(points={{78,-58},{78,-40},{110,-40}}, color={255,0,255})); annotation (Diagram(coordinateSystem(extent={{-100,-160},{100,100}})), Icon( coordinateSystem(extent={{-100,-100},{100,100}})), Documentation(revisions=" diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/package.order b/Buildings/Fluid/Storage/Plant/BaseClasses/package.order index cfbfab08682..7f4c2dabda2 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/package.order +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/package.order @@ -1,2 +1,3 @@ FluidPassThrough +NominalValues ReversiblePumpValveControl diff --git a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/ChillerBranch.mo b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/ChillerBranch.mo index fa56b31c3c8..84cd35a7cb2 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/ChillerBranch.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/ChillerBranch.mo @@ -1,32 +1,32 @@ within Buildings.Fluid.Storage.Plant.Examples.BaseClasses; model ChillerBranch "A branch with a pump, a check valve, and a chiller" - extends Interfaces.PartialTwoPortInterface; - + replaceable package Medium = + Modelica.Media.Interfaces.PartialMedium "Medium package"; package MediumCDW = Buildings.Media.Water "Medium model for CDW"; - parameter Modelica.Units.SI.Temperature T_a_nominal=12+273.15 - "Nominal temperature of CHW supply"; - parameter Modelica.Units.SI.Temperature T_b_nominal=7+273.15 - "Nominal temperature of CHW return"; - parameter Modelica.Units.SI.PressureDifference dp_nominal=500000 - "Nominal pressure difference"; + parameter Buildings.Fluid.Storage.Plant.BaseClasses.NominalValues nom + "Nominal values"; Buildings.Fluid.Movers.FlowControlled_m_flow pum( redeclare package Medium = Medium, - per(pressure(dp=dp_nominal*{2,1.2,0}, V_flow=m_flow_nominal/1.2*{0,1.2,2})), + per(pressure(dp=nom.dp_nominal*{2,1.2,0}, + V_flow=nom.m_flow_nominal/1.2*{0,1.2,2})), energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - m_flow_nominal=m_flow_nominal, + m_flow_nominal=nom.mChi_flow_nominal, allowFlowReversal=true, addPowerToMedium=false, m_flow_start=0, - T_start=T_a_nominal) "Primary CHW pump" - annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); + T_start=nom.T_CHWR_nominal) "Primary CHW pump" + annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + rotation=90, + origin={0,-50}))); Buildings.Fluid.FixedResistances.CheckValve cheVal( redeclare package Medium = Medium, - m_flow_nominal=m_flow_nominal) "Check valve with series resistance" - annotation (Placement(transformation(extent={{-40,-10},{-20,10}}, rotation=0))); + m_flow_nominal=nom.m_flow_nominal) "Check valve with series resistance" + annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=90, + origin={0,-10}))); Buildings.Fluid.Chillers.ElectricEIR chi( redeclare final package Medium1 = MediumCDW, redeclare final package Medium2 = Medium, @@ -34,28 +34,28 @@ model ChillerBranch final dp2_nominal=0, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, p2_start=500000, - T2_start=T_b_nominal, + T2_start=nom.T_CHWS_nominal, final per=perChi) "Water cooled chiller (ports indexed 1 are on condenser side)" - annotation (Placement(transformation(extent={{40,0},{20,20}}))); + annotation (Placement(transformation(extent={{20,20},{0,40}}))); Buildings.Controls.OBC.CDL.Logical.Sources.Constant on(k=true) "Placeholder, chiller always on" - annotation (Placement(transformation(extent={{20,-80},{40,-60}}))); - Modelica.Blocks.Sources.Constant set_TEvaLvg(k=T_b_nominal) + annotation (Placement(transformation(extent={{20,-40},{40,-20}}))); + Modelica.Blocks.Sources.Constant set_TEvaLvg(k=nom.T_CHWS_nominal) "Evaporator leaving temperature setpoint" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={30,-30}))); + origin={30,0}))); Buildings.Fluid.Sources.MassFlowSource_T souCDW( redeclare package Medium = MediumCDW, - m_flow=1.2*m_flow_nominal, + m_flow=1.2*nom.m_flow_nominal, T=305.15, nPorts=1) "Source representing CDW supply line" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={50,50}))); + origin={30,70}))); Buildings.Fluid.Sources.Boundary_pT sinCDW( redeclare final package Medium = MediumCDW, final p=300000, @@ -64,15 +64,15 @@ model ChillerBranch transformation( extent={{10,10},{-10,-10}}, rotation=90, - origin={10,50}))); + origin={-10,70}))); Modelica.Blocks.Interfaces.RealInput mPumSet_flow "Primary pump mass flow rate setpoint" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-110,28}), iconTransformation( extent={{-10,-10},{10,10}}, - rotation=0, - origin={-110,40}))); + rotation=90, + origin={40,-110}))); replaceable parameter Buildings.Fluid.Chillers.Data.ElectricEIR.Generic perChi( QEva_flow_nominal=-1E6, @@ -81,7 +81,7 @@ model ChillerBranch PLRMinUnl=0.3, PLRMin=0.3, etaMotor=1, - mEva_flow_nominal=0.7*m_flow_nominal, + mEva_flow_nominal=0.7*nom.m_flow_nominal, mCon_flow_nominal=1.2*perChi.mEva_flow_nominal, TEvaLvg_nominal=280.15, capFunT={1,0,0,0,0,0}, @@ -94,65 +94,89 @@ model ChillerBranch TConEntMax=333.15) "Chiller performance data" annotation (choicesAllMatching=true, - Placement(transformation(extent={{-40,60},{-20,80}}))); + Placement(transformation(extent={{-80,60},{-60,80}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a( + p(start=Medium.p_default), + redeclare final package Medium = Medium, + h_outflow(start=Medium.h_default, nominal=Medium.h_default)) + "Fluid connector a (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{90,-70},{110,-50}}), + iconTransformation(extent={{90,-70},{110,-50}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b( + p(start=Medium.p_default), + redeclare final package Medium = Medium, + h_outflow(start=Medium.h_default, nominal=Medium.h_default)) + "Fluid connector b (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{110,50},{90,70}}), + iconTransformation(extent={{110,50},{90,70}}))); equation - connect(port_a, pum.port_a) - annotation (Line(points={{-100,0},{-80,0}}, color={0,127,255})); connect(pum.port_b, cheVal.port_a) - annotation (Line(points={{-60,0},{-40,0}}, color={0,127,255})); - connect(port_b, port_b) - annotation (Line(points={{100,0},{100,0}}, color={0,127,255})); - connect(on.y, chi.on) annotation (Line(points={{42,-70},{56,-70},{56,13},{42, - 13}}, color={255,0,255})); - connect(set_TEvaLvg.y, chi.TSet) annotation (Line(points={{41,-30},{50,-30},{ - 50,7},{42,7}}, - color={0,0,127})); + annotation (Line(points={{6.10623e-16,-40},{6.10623e-16,-30},{-5.55112e-16,-30}, + {-5.55112e-16,-20}}, color={0,127,255})); + connect(on.y, chi.on) annotation (Line(points={{42,-30},{48,-30},{48,33},{22,33}}, + color={255,0,255})); + connect(set_TEvaLvg.y, chi.TSet) annotation (Line(points={{41,0},{46,0},{46,27}, + {22,27}}, color={0,0,127})); connect(pum.m_flow_in, mPumSet_flow) - annotation (Line(points={{-70,12},{-70,28},{-110,28}}, color={0,0,127})); + annotation (Line(points={{-12,-50},{-96,-50},{-96,28},{-110,28}}, + color={0,0,127})); connect(souCDW.ports[1], chi.port_a1) - annotation (Line(points={{50,40},{50,16},{40,16}}, color={0,127,255})); + annotation (Line(points={{30,60},{30,36},{20,36}}, color={0,127,255})); connect(sinCDW.ports[1], chi.port_b1) - annotation (Line(points={{10,40},{10,16},{20,16}}, color={0,127,255})); - connect(cheVal.port_b, chi.port_a2) annotation (Line(points={{-20,0},{12,0},{ - 12,4},{20,4}}, color={0,127,255})); - connect(chi.port_b2, port_b) annotation (Line(points={{40,4},{84,4},{84,0},{ - 100,0}}, color={0,127,255})); + annotation (Line(points={{-10,60},{-10,36},{0,36}},color={0,127,255})); + connect(cheVal.port_b, chi.port_a2) annotation (Line(points={{6.10623e-16,0},{ + 6.10623e-16,16},{0,16},{0,24}}, + color={0,127,255})); + connect(pum.port_a, port_a) annotation (Line(points={{-5.55112e-16,-60},{100,-60}}, + color={0,127,255})); + connect(chi.port_b2, port_b) annotation (Line(points={{20,24},{86,24},{86,60}, + {100,60}}, color={0,127,255})); annotation (Icon(graphics={ - Ellipse(extent={{-80,20},{-40,-20}}, lineColor={28,108,200}), - Polygon(points={{-72,16},{-72,-16},{-40,0},{-72,16}}, lineColor={28,108, - 200}), - Line(points={{-20,-20},{-20,20},{20,-20},{20,20}}, color={28,108,200}), - Line(points={{-20,30},{20,30}}, color={28,108,200}), - Polygon( - points={{20,30},{10,34},{10,26},{20,30}}, - lineColor={28,108,200}, - fillColor={28,108,200}, - fillPattern=FillPattern.Solid), - Ellipse(extent={{40,20},{80,-20}}, lineColor={28,108,200}), - Line(points={{48,16},{78,8}}, color={28,108,200}), - Line(points={{48,-16},{78,-8}}, color={28,108,200}), - Line( - points={{-80,0},{-100,0}}, - color={28,108,200}, - thickness=1), + Ellipse(extent={{-20,20},{20,-20}}, lineColor={28,108,200}, + origin={40,-60}, + rotation=90), + Polygon(points={{-16,16},{-16,-16},{16,0},{-16,16}}, lineColor={28,108, + 200}, + origin={36,-60}, + rotation=180), + Line(points={{-20,-20},{-20,20},{20,-20},{20,20}}, color={28,108,200}, + rotation=90), + Line(points={{-20,0},{20,0}}, color={28,108,200}, + origin={-30,0}, + rotation=90), + Ellipse(extent={{-20,20},{20,-20}},lineColor={28,108,200}, + origin={40,60}, + rotation=90), + Line(points={{64,35},{56,5}}, color={28,108,200}, + origin={63,12}, + rotation=90), + Text( + extent={{40,-100},{100,-80}}, + textColor={28,108,200}, + textString="m_flow"), Line( - points={{-20,0},{-40,0}}, + points={{60,-60},{90,-60}}, color={28,108,200}, thickness=1), Line( - points={{40,0},{20,0}}, + points={{20,-60},{0,-60},{0,-20}}, color={28,108,200}, thickness=1), + Polygon( + points={{-30,20},{-34,10},{-26,10},{-30,20}}, + lineColor={28,108,200}, + fillColor={28,108,200}, + fillPattern=FillPattern.Solid), + Line(points={{-35,-64},{-5,-56}}, + color={28,108,200}, + origin={63,108}, + rotation=0), Line( - points={{100,0},{80,0}}, + points={{60,60},{90,60}}, color={28,108,200}, thickness=1), Line( - points={{-100,40},{-60,40},{-60,20}}, + points={{20,60},{0,60},{0,20}}, color={28,108,200}, - pattern=LinePattern.Dash), - Text( - extent={{-100,40},{-40,60}}, - textColor={28,108,200}, - textString="m_flow")})); + thickness=1)})); end ChillerBranch; diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo index 7815b41fb35..6a2a145ca6b 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo @@ -4,54 +4,51 @@ model OneSourceOneUser "(Draft) Simple system model with one source and one user package Medium = Buildings.Media.Water "Medium model for CDW"; - parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=1 - "Nominal mass flow rate"; - parameter Modelica.Units.SI.PressureDifference dp_nominal=500000 - "Nominal pressure difference"; parameter Modelica.Units.SI.AbsolutePressure p_Pressurisation=300000 "Pressurisation point"; - parameter Modelica.Units.SI.Temperature T_CHWR_nominal=12+273.15 - "Nominal temperature of CHW return"; - parameter Modelica.Units.SI.Temperature T_CHWS_nominal=7+273.15 - "Nominal temperature of CHW supply"; - parameter Boolean allowFlowReversal=false - "Flow reversal setting"; - parameter Modelica.Units.SI.Power QCooLoa_flow_nominal=5*4200*0.9 + parameter Modelica.Units.SI.Power QCooLoa_flow_nominal=5*4200*0.1 "Nominal cooling load of one consumer"; + Buildings.Fluid.Storage.Plant.BaseClasses.NominalValues nom( + final allowRemoteCharging=false, + mTan_flow_nominal=0.5, + mChi_flow_nominal=0.5, + dp_nominal=500000, + T_CHWS_nominal=280.15, + T_CHWR_nominal=285.15) "Nominal values" + annotation (Placement(transformation(extent={{-80,60},{-60,80}}))); + Buildings.Fluid.Storage.Plant.TankBranch tanBra( redeclare final package Medium = Medium, - final allowRemoteCharging=false, - final m_flow_nominal=m_flow_nominal, - final mTan_flow_nominal=m_flow_nominal/2, - final dp_nominal=dp_nominal, - final T_CHWS_nominal=T_CHWS_nominal, - final T_CHWR_nominal=T_CHWR_nominal, - final preDroTan(final dp_nominal=dp_nominal*0.1), - final valCha(final dpValve_nominal=dp_nominal*0.1), - final valDis(final dpValve_nominal=dp_nominal*0.1), - final cheVal(final dpValve_nominal=dp_nominal*0.1, - final dpFixed_nominal=dp_nominal*0.1)) - "Tank branch" - annotation (Placement(transformation(extent={{-20,-12},{0,8}}))); + final nom=nom, + final preDroTan(final dp_nominal=nom.dp_nominal*0.1)) "Tank branch" + annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); Buildings.Fluid.Storage.Plant.Examples.BaseClasses.ChillerBranch chiBra( redeclare final package Medium = Medium, - final m_flow_nominal=tanBra.m_flow_nominal - tanBra.mTan_flow_nominal, - final dp_nominal=dp_nominal, - final T_a_nominal=T_CHWR_nominal, - final T_b_nominal=T_CHWS_nominal, - final cheVal(final dpValve_nominal=0.1*chiBra.dp_nominal, - final dpFixed_nominal=0.1*chiBra.dp_nominal)) + final nom=nom, + final cheVal(final dpValve_nominal=0.1*nom.dp_nominal, + final dpFixed_nominal=0.1*nom.dp_nominal)) "Chiller branch" - annotation (Placement(transformation(extent={{-20,18},{0,38}}))); + annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + rotation=0, + origin={-80,0}))); + Buildings.Fluid.Storage.Plant.SupplyPumpClosedTank supPum( + redeclare final package Medium = Medium, + final nom=nom, + final valCha(final dpValve_nominal=nom.dp_nominal*0.1), + final valDis(final dpValve_nominal=nom.dp_nominal*0.1)) + "Supply pump and valves" + annotation (Placement(transformation(extent={{-30,-10},{-10,10}}))); + Buildings.Fluid.Storage.Plant.Examples.BaseClasses.DummyUser usr( redeclare package Medium = Medium, - m_flow_nominal=m_flow_nominal, - dp_nominal=0.3*dp_nominal, - T_a_nominal=T_CHWS_nominal, - T_b_nominal=T_CHWR_nominal) "User" + m_flow_nominal=nom.m_flow_nominal, + dp_nominal=0.3*nom.dp_nominal, + T_a_nominal=nom.T_CHWS_nominal, + T_b_nominal=nom.T_CHWR_nominal) "User" annotation (Placement(transformation(extent={{60,-30},{80,-10}}))); - Modelica.Blocks.Sources.Constant TRetSet(k=12 + 273.15) "CHW return setpoint" + Modelica.Blocks.Sources.Constant TRetSet(k=nom.T_CHWR_nominal) + "CHW return setpoint" annotation (Placement(transformation(extent={{20,0},{40,20}}))); Modelica.Blocks.Sources.TimeTable preQCooLoa_flow(table=[0*3600,0; 1200,0; 1200,QCooLoa_flow_nominal; 2400,QCooLoa_flow_nominal; 2400,0; 1*3600,0]) @@ -64,40 +61,41 @@ model OneSourceOneUser "(Draft) Simple system model with one source and one user reverseActing=true) "PI controller" annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=270, - origin={-90,50}))); + origin={-10,50}))); Buildings.Fluid.FixedResistances.PressureDrop preDro1( redeclare package Medium = Medium, final allowFlowReversal=true, - final dp_nominal=dp_nominal*0.3, - final m_flow_nominal=m_flow_nominal) "Flow resistance of the consumer" + final dp_nominal=nom.dp_nominal*0.3, + final m_flow_nominal=nom.m_flow_nominal) "Flow resistance of the consumer" annotation (Placement(transformation(extent={{10,-30},{30,-10}}))); Buildings.Fluid.FixedResistances.PressureDrop preDro2( redeclare package Medium = Medium, final allowFlowReversal=true, - final dp_nominal=dp_nominal*0.3, - final m_flow_nominal=m_flow_nominal) "Flow resistance of the consumer" + final dp_nominal=nom.dp_nominal*0.3, + final m_flow_nominal=nom.m_flow_nominal) "Flow resistance of the consumer" annotation (Placement(transformation(extent={{30,-50},{10,-30}}))); Modelica.Blocks.Sources.Constant set_dpUsr(k=1) "Normalised differential pressure setpoint of the user" annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=-90, - origin={-90,90}))); + origin={-10,90}))); Buildings.Fluid.Sources.Boundary_pT sou_p( redeclare final package Medium = Medium, final p=p_Pressurisation, - final T=T_CHWR_nominal, + final T=nom.T_CHWR_nominal, nPorts=1) "Pressurisation point" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-90,-20}))); + origin={-70,-70}))); Modelica.Blocks.Math.Gain gaiPumSec(k=1/usr.dp_nominal) "Gain" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, - origin={-50,90}))); - Modelica.Blocks.Sources.Constant mSet_flow(k=m_flow_nominal/2) - "Flow rate setpoint" - annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + origin={30,90}))); + Modelica.Blocks.Sources.Constant mSet_flow(k=nom.mChi_flow_nominal) + "Chiller branch flow rate setpoint" + annotation (Placement(transformation(extent={{-100,-40},{-80,-20}}))); + equation connect(TRetSet.y, usr.TSet) annotation (Line(points={{41,10},{52,10},{52,-16}, {59,-16}}, color={0,0,127})); @@ -111,26 +109,32 @@ equation annotation (Line(points={{80,-20},{84,-20},{84,-40},{30,-40}}, color={0,127,255})); connect(set_dpUsr.y, conPI_pumSec.u_s) - annotation (Line(points={{-90,79},{-90,62}}, color={0,0,127})); - connect(usr.dpUsr, gaiPumSec.u) annotation (Line(points={{68,-9},{68,90},{-38, - 90}}, color={0,0,127})); + annotation (Line(points={{-10,79},{-10,70.5},{-10,70.5},{-10,62}}, + color={0,0,127})); + connect(usr.dpUsr, gaiPumSec.u) annotation (Line(points={{68,-9},{68,90},{42,90}}, + color={0,0,127})); connect(gaiPumSec.y, conPI_pumSec.u_m) - annotation (Line(points={{-61,90},{-70,90},{-70,50},{-78,50}}, + annotation (Line(points={{19,90},{8,90},{8,50},{2,50}}, color={0,0,127})); - connect(preDro2.port_b, tanBra.port_1) annotation (Line(points={{10,-40},{-26, - -40},{-26,-8},{-20,-8}}, color={0,127,255})); - connect(tanBra.port_2, preDro1.port_a) annotation (Line(points={{0,-8},{6,-8}, - {6,-20},{10,-20}}, color={0,127,255})); - connect(sou_p.ports[1], tanBra.port_1) annotation (Line(points={{-80,-20},{-26, - -20},{-26,-8},{-20,-8}}, color={0,127,255})); - connect(conPI_pumSec.y, tanBra.yPum) - annotation (Line(points={{-90,39},{-90,0},{-21,0}}, color={0,0,127})); - connect(tanBra.port_3, chiBra.port_a) annotation (Line(points={{-14,8},{-28,8}, - {-28,28},{-20,28}}, color={0,127,255})); - connect(chiBra.mPumSet_flow, mSet_flow.y) annotation (Line(points={{-21,32},{-32, - 32},{-32,50},{-39,50}}, color={0,0,127})); - connect(tanBra.port_4, chiBra.port_b) annotation (Line(points={{-6,8.2},{-6,8}, - {8,8},{8,28},{0,28}}, color={0,127,255})); + connect(tanBra.port_chiInl, chiBra.port_a) + annotation (Line(points={{-60,-6},{-70,-6}}, color={0,127,255})); + connect(tanBra.port_chiOut, chiBra.port_b) + annotation (Line(points={{-60,6},{-70,6}}, color={0,127,255})); + connect(mSet_flow.y, chiBra.mPumSet_flow) + annotation (Line(points={{-79,-30},{-76,-30},{-76,-11}}, color={0,0,127})); + connect(tanBra.port_CHWR, supPum.port_chiInl) + annotation (Line(points={{-40,-6},{-30,-6}}, color={0,127,255})); + connect(tanBra.port_CHWS, supPum.port_chiOut) + annotation (Line(points={{-40,6},{-30,6}}, color={0,127,255})); + connect(supPum.port_CHWR, preDro2.port_b) annotation (Line(points={{-10,-6},{0, + -6},{0,-40},{10,-40}}, color={0,127,255})); + connect(supPum.port_CHWS, preDro1.port_a) annotation (Line(points={{-10,6},{4, + 6},{4,-20},{10,-20}}, color={0,127,255})); + connect(conPI_pumSec.y, supPum.yPum) + annotation (Line(points={{-10,39},{-10,16},{-20,16},{-20,11}}, + color={0,0,127})); + connect(sou_p.ports[1], tanBra.port_CHWR) annotation (Line(points={{-60,-70},{ + -34,-70},{-34,-6},{-40,-6}}, color={0,127,255})); annotation(__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos" "Simulate and plot"), experiment(Tolerance=1e-06, StopTime=3600), Documentation(info=" diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index a49b5c868b4..2c54d718911 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -52,7 +52,8 @@ model TwoSourcesThreeUsers TEvaLvgMax=288.15, TConEnt_nominal=310.15, TConEntMin=303.15, - TConEntMax=333.15) "Chiller performance data" annotation ( + TConEntMax=333.15) "Performance data for the chiller in plant 1" + annotation ( choicesAllMatching=true, Placement(transformation(extent={{-180,120},{-160, 140}}))); Buildings.Fluid.Movers.SpeedControlled_y pumSup1( @@ -97,7 +98,7 @@ model TwoSourcesThreeUsers nPorts=1) "Pressurisation point" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-170,10}))); + origin={-170,20}))); Buildings.Fluid.Sources.MassFlowSource_T souCDW1( redeclare package Medium = MediumCDW1, m_flow=1.2*chi1.m2_flow_nominal, @@ -129,70 +130,74 @@ model TwoSourcesThreeUsers origin={-130,130}))); // Second source: chiller and tank + Buildings.Fluid.Storage.Plant.BaseClasses.NominalValues nomPla2( + final allowRemoteCharging=true, + mTan_flow_nominal=0.75*m_flow_nominal, + mChi_flow_nominal=0.75*m_flow_nominal, + dp_nominal=dp_nominal, + T_CHWS_nominal=T_CHWS_nominal, + T_CHWR_nominal=T_CHWS_nominal) "Nominal values for the second plant" + annotation (Placement(transformation(extent={{-180,-60},{-160,-40}}))); Buildings.Fluid.Storage.Plant.TankBranch tanBra( redeclare final package Medium = MediumCHW, - final m_flow_nominal=1.5*m_flow_nominal, - final mTan_flow_nominal=0.75*m_flow_nominal, - final dp_nominal=dp_nominal, - final T_CHWS_nominal=T_CHWS_nominal, - final T_CHWR_nominal=T_CHWR_nominal, - final preDroTan(final dp_nominal=tanBra.dp_nominal*0.1), - final valCha(final dpValve_nominal=tanBra.dp_nominal*0.1), - final valDis(final dpValve_nominal=tanBra.dp_nominal*0.1), - final cheVal(final dpValve_nominal=0.1*tanBra.dp_nominal, - final dpFixed_nominal=0.1*tanBra.dp_nominal)) + final nom=nomPla2, + final preDroTan(final dp_nominal=nomPla2.dp_nominal*0.1)) "Tank branch, tank can be charged remotely" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-70,-60}))); + origin={-100,-60}))); Buildings.Fluid.Storage.Plant.Examples.BaseClasses.ChillerBranch chiBra2( redeclare final package Medium = MediumCHW, - final m_flow_nominal=tanBra.m_flow_nominal - tanBra.mTan_flow_nominal, - final dp_nominal=dp_nominal, - final T_a_nominal=T_CHWR_nominal, - final T_b_nominal=T_CHWS_nominal, - final cheVal(final dpValve_nominal=0.1*chiBra2.dp_nominal, - final dpFixed_nominal=0.1*chiBra2.dp_nominal)) "Chiller branch" - annotation (Placement(transformation(extent={{-80,-20},{-60,0}}))); + final nom=nomPla2, + final cheVal(final dpValve_nominal=0.1*nomPla2.dp_nominal, + final dpFixed_nominal=0.1*nomPla2.dp_nominal)) "Chiller branch" + annotation (Placement(transformation(extent={{-140,-70},{-120,-50}}))); + Buildings.Fluid.Storage.Plant.SupplyPumpClosedTank supPum( + redeclare final package Medium = MediumCHW, + final nom=nomPla2, + final valCha(final dpValve_nominal=nomPla2.dp_nominal*0.1), + final valDis(final dpValve_nominal=nomPla2.dp_nominal*0.1)) + "Supply pump and valves" + annotation (Placement(transformation(extent={{-80,-70},{-60,-50}}))); Modelica.Blocks.Sources.BooleanTable uRemCha(table={3600/9*6,3600/9*8}, startValue=false) "Tank is being charged remotely" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-170,-110}))); + origin={-170,-90}))); Modelica.Blocks.Sources.BooleanTable uTanDis(table={3600/9*1,3600/9*6,3600/9* 8}, startValue=false) "True = discharging; false = charging (either local or remote)" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, - rotation=-90, - origin={-170,-20}))); + rotation=0, + origin={-170,-10}))); Buildings.Fluid.Storage.Plant.BaseClasses.ReversiblePumpValveControl conPumSecGro "Control block for secondary pump-valve group" annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0, - origin={-110,-58}))); + origin={-70,-30}))); Buildings.Controls.OBC.CDL.Conversions.BooleanToReal mTanSet_flow( - realTrue=0.75*m_flow_nominal, - realFalse=-0.75*m_flow_nominal) + realTrue=nomPla2.mTan_flow_nominal, + realFalse=-nomPla2.mTan_flow_nominal) "Set a positive flow rate when tank discharging and negative when charging" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, - rotation=-90, - origin={-170,-50}))); + rotation=0, + origin={-130,-10}))); Buildings.Controls.OBC.CDL.Conversions.BooleanToReal mChiBra2Set_flow( - realTrue=0, realFalse=chiBra2.m_flow_nominal) + realTrue=0, realFalse=nomPla2.mChi_flow_nominal) "Set the flow rate to a constant value whenever the tank is not being charged remotely" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-110,-10}))); + origin={-140,-90}))); Buildings.Controls.OBC.CDL.Logical.Or or2 "Tank charging remotely OR there is load" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=90, - origin={-100,-90}))); + origin={-50,-90}))); // Users Buildings.Fluid.Storage.Plant.Examples.BaseClasses.DummyUser usr1( @@ -383,45 +388,16 @@ equation connect(mulMin_dpUsr.y,conPI_pumChi1. u_m) annotation (Line(points={{58,130},{8,130},{8,110},{2,110}}, color={0,0,127})); - connect(preDroU3S2.port_b, tanBra.port_1) annotation (Line(points={{10,-80},{ - -80,-80},{-80,-66}}, color={0,127,255})); - connect(preDroU2S2.port_b, tanBra.port_1) annotation (Line(points={{10,-20},{ - -4,-20},{-4,-80},{-80,-80},{-80,-66}}, color={0,127,255})); - connect(tanBra.port_2, preDroS2U3.port_a) annotation (Line(points={{-60,-66}, - {-36,-66},{-36,-40},{-30,-40}}, color={0,127,255})); - connect(tanBra.port_2, preDroS2U2.port_a) annotation (Line(points={{-60,-66}, - {-36,-66},{-36,0},{-30,0}}, color={0,127,255})); - connect(conPumSecGro.yValDis, tanBra.yValDis) - annotation (Line(points={{-99,-50},{-81,-50}}, color={0,0,127})); - connect(conPumSecGro.yValCha, tanBra.yValCha) - annotation (Line(points={{-99,-54},{-81,-54}}, color={0,0,127})); - connect(conPumSecGro.yPumSec, tanBra.yPum) - annotation (Line(points={{-99,-58},{-81,-58}}, color={0,0,127})); - connect(uRemCha.y, conPumSecGro.uRemCha) annotation (Line(points={{-159,-110}, - {-118,-110},{-118,-70}}, color={255,0,255})); - connect(tanBra.yValDis_actual, conPumSecGro.yValDis_actual) annotation (Line( - points={{-59,-50},{-56,-50},{-56,-40},{-126,-40},{-126,-50},{-121,-50}}, - color={0,0,127})); - connect(tanBra.yValCha_actual, conPumSecGro.yValCha_actual) annotation (Line( - points={{-59,-54},{-52,-54},{-52,-36},{-130,-36},{-130,-54},{-121,-54}}, - color={0,0,127})); - connect(tanBra.mTan_flow, conPumSecGro.mTan_flow) annotation (Line(points={{-59, - -58},{-48,-58},{-48,-32},{-134,-32},{-134,-58},{-121,-58}}, color={0, - 0,127})); - connect(uTanDis.y, mTanSet_flow.u) annotation (Line(points={{-170,-31},{-170, - -38}}, color={255,0,255})); - connect(mTanSet_flow.y, conPumSecGro.mTanSet_flow) annotation (Line(points={{-170, - -62},{-170,-68},{-126,-68},{-126,-62},{-121,-62}}, - color={0,0,127})); - connect(mChiBra2Set_flow.u, uRemCha.y) annotation (Line(points={{-122,-10},{ - -140,-10},{-140,-110},{-159,-110}}, - color={255,0,255})); - connect(tanBra.port_3, chiBra2.port_a) annotation (Line(points={{-74,-50},{-74, - -26},{-86,-26},{-86,-10},{-80,-10}}, color={0,127,255})); - connect(tanBra.port_4, chiBra2.port_b) annotation (Line(points={{-66,-49.8},{ - -66,-26},{-54,-26},{-54,-10},{-60,-10}}, color={0,127,255})); + connect(uTanDis.y, mTanSet_flow.u) annotation (Line(points={{-159,-10},{-142,-10}}, + color={255,0,255})); + connect(mChiBra2Set_flow.u, uRemCha.y) annotation (Line(points={{-152,-90},{-159, + -90}}, color={255,0,255})); + connect(tanBra.port_chiInl, chiBra2.port_a) annotation (Line(points={{-110,-66}, + {-120,-66}}, color={0,127,255})); + connect(tanBra.port_chiOut, chiBra2.port_b) annotation (Line(points={{-110,-54}, + {-120,-54}}, color={0,127,255})); connect(chiBra2.mPumSet_flow,mChiBra2Set_flow. y) - annotation (Line(points={{-81,-6},{-92,-6},{-92,-10},{-98,-10}}, + annotation (Line(points={{-126,-71},{-126,-90},{-128,-90}}, color={0,0,127})); connect(conPI_pumChi1.y,pumSup1. y) annotation (Line(points={{-10,99},{-10,94}, {-42,94},{-42,58},{-70,58},{-70,52}}, @@ -432,8 +408,8 @@ equation 0},{4,40},{-60,40}}, color={0,127,255})); connect(pumSup1.port_b, cheValPumChi1.port_a) annotation (Line(points={{-80,40},{-100,40}}, color={0,127,255})); - connect(sou_p.ports[1], pumSup1.port_a) annotation (Line(points={{-160,10},{-54, - 10},{-54,40},{-60,40}}, color={0,127,255})); + connect(sou_p.ports[1], pumSup1.port_a) annotation (Line(points={{-160,20},{-54, + 20},{-54,40},{-60,40}}, color={0,127,255})); connect(cheValPumChi1.port_b, chi1.port_a2) annotation (Line(points={{-120,40}, {-124,40},{-124,60}}, color={0,127,255})); connect(chi1.port_b2, preDroS1U1.port_a) annotation (Line(points={{-124,80},{ @@ -449,13 +425,43 @@ equation 82}}, color={255,0,255})); connect(preDroS1U2.port_a, chi1.port_b2) annotation (Line(points={{-30,20},{-36, 20},{-36,80},{-124,80}}, color={0,127,255})); - connect(uRemCha.y, or2.u1) annotation (Line(points={{-159,-110},{-100,-110},{ - -100,-102}}, color={255,0,255})); - connect(conPumSecGro.uOnl, or2.y) annotation (Line(points={{-114,-70},{-114,-74}, - {-100,-74},{-100,-78}}, color={255,0,255})); - connect(hysCat.y, or2.u2) annotation (Line(points={{-2,-110},{-92,-110},{-92,-102}}, + connect(uRemCha.y, or2.u1) annotation (Line(points={{-159,-90},{-156,-90},{-156, + -110},{-50,-110},{-50,-102}}, color={255,0,255})); + connect(hysCat.y, or2.u2) annotation (Line(points={{-2,-110},{-42,-110},{-42,-102}}, + color={255,0,255})); + connect(tanBra.port_CHWR, supPum.port_chiInl) + annotation (Line(points={{-90,-66},{-80,-66}}, color={0,127,255})); + connect(tanBra.port_CHWS, supPum.port_chiOut) + annotation (Line(points={{-90,-54},{-80,-54}}, color={0,127,255})); + connect(preDroU3S2.port_b, supPum.port_CHWR) annotation (Line(points={{10,-80}, + {-36,-80},{-36,-66},{-60,-66}}, color={0,127,255})); + connect(preDroU2S2.port_b, supPum.port_CHWR) annotation (Line(points={{10,-20}, + {4,-20},{4,-80},{-36,-80},{-36,-66},{-60,-66}}, color={0,127,255})); + connect(supPum.port_CHWS, preDroS2U3.port_a) annotation (Line(points={{-60,-54}, + {-36,-54},{-36,-40},{-30,-40}}, color={0,127,255})); + connect(supPum.port_CHWS, preDroS2U2.port_a) annotation (Line(points={{-60,-54}, + {-36,-54},{-36,0},{-30,0}}, color={0,127,255})); + connect(conPumSecGro.yValDis, supPum.yValDis) + annotation (Line(points={{-62,-41},{-62,-49}}, color={0,0,127})); + connect(conPumSecGro.yValCha, supPum.yValCha) + annotation (Line(points={{-66,-41},{-66,-49}}, color={0,0,127})); + connect(conPumSecGro.yPum, supPum.yPum) + annotation (Line(points={{-70,-41},{-70,-49}}, color={0,0,127})); + connect(tanBra.mTan_flow, conPumSecGro.mTan_flow) + annotation (Line(points={{-92,-49},{-92,-26},{-81,-26}}, color={0,0,127})); + connect(supPum.yValCha_actual, conPumSecGro.yValCha_actual) annotation (Line( + points={{-76,-49},{-76,-44},{-84,-44},{-84,-34},{-81,-34}}, color={0,0,127})); + connect(supPum.yValDis_actual, conPumSecGro.yValDis_actual) annotation (Line( + points={{-80,-49},{-80,-48},{-88,-48},{-88,-30},{-81,-30}}, color={0,0,127})); + connect(conPumSecGro.uOnl, or2.y) annotation (Line(points={{-58,-26},{-50,-26}, + {-50,-78}}, color={255,0,255})); + connect(mTanSet_flow.y, conPumSecGro.mTanSet_flow) annotation (Line(points={{-118, + -10},{-88,-10},{-88,-22},{-81,-22}}, color={0,0,127})); + connect(uRemCha.y, conPumSecGro.uRemCha) annotation (Line(points={{-159,-90},{ + -156,-90},{-156,-30},{-106,-30},{-106,-14},{-50,-14},{-50,-22},{-58,-22}}, color={255,0,255})); - annotation (__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos" + annotation ( + __Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos" "Simulate and plot"), experiment(Tolerance=1e-06, StopTime=3600,__Dymola_Algorithm="Dassl"), Diagram(coordinateSystem(extent={{-180,-120},{140,140}})), Icon( diff --git a/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo b/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo new file mode 100644 index 00000000000..c053125f198 --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo @@ -0,0 +1,219 @@ +within Buildings.Fluid.Storage.Plant; +model SupplyPumpClosedTank + "(Draft) Model section with supply pump and valves for a closed tank" + + replaceable package Medium = + Modelica.Media.Interfaces.PartialMedium "Medium package"; + + parameter Buildings.Fluid.Storage.Plant.BaseClasses.NominalValues nom + "Nominal values"; + + Buildings.Fluid.Movers.SpeedControlled_y pum( + redeclare package Medium = Medium, + per(pressure(dp=nom.dp_nominal*{2,1.2,0}, + V_flow=(nom.m_flow_nominal)/1.2*{0,1.2,2})), + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + allowFlowReversal=true, + addPowerToMedium=false, + y_start=0, + T_start=nom.T_CHWR_nominal) "Secondary CHW pump" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-50,60}))); + + Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valDis( + redeclare package Medium = Medium, + dpValve_nominal=0.1*nom.dp_nominal, + use_inputFilter=true, + y_start=0, + l=1E-5, + m_flow_nominal=nom.m_flow_nominal) + if nom.allowRemoteCharging + "Discharge valve, in series to the pump (normal direction)" + annotation (Placement(transformation(extent={{20,50},{40,70}}))); + Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valCha( + redeclare package Medium = Medium, + dpValve_nominal=0.1*nom.dp_nominal, + use_inputFilter=true, + y_start=0, + l=1E-5, + m_flow_nominal=nom.mTan_flow_nominal) if nom.allowRemoteCharging + "Charging valve, in parallel to the secondary pump (reverse direction)" + annotation (Placement(transformation(extent={{40,-30},{20,-10}}))); + Buildings.Fluid.Storage.Plant.BaseClasses.FluidPassThrough pasValDis( + redeclare package Medium = Medium) if not nom.allowRemoteCharging + "Replaces valDis when remote charging not allowed" + annotation (Placement(transformation(extent={{20,10},{40,30}}))); + Buildings.Fluid.FixedResistances.CheckValve cheVal( + redeclare package Medium = Medium, + m_flow_nominal=nom.m_flow_nominal, + dpValve_nominal=0.1*nom.dp_nominal, + dpFixed_nominal=0.1*nom.dp_nominal) "Check valve" annotation (Placement( + transformation( + extent={{10,-10},{-10,10}}, + rotation=180, + origin={-10,60}))); + Modelica.Fluid.Interfaces.FluidPort_a port_CHWR(redeclare package Medium = + Medium) "Port that connects to the CHW return line" annotation ( + Placement(transformation(extent={{90,-70},{110,-50}}), iconTransformation( + extent={{90,-70},{110,-50}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_CHWS(redeclare package Medium = + Medium) "Port that connects to the CHW supply line" annotation ( + Placement(transformation(extent={{90,50},{110,70}}), iconTransformation( + extent={{90,50},{110,70}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_chiInl(redeclare package Medium = + Medium) "Port that connects to the chiller inlet" annotation (Placement( + transformation(extent={{-110,-70},{-90,-50}}), iconTransformation( + extent={{-110,-70},{-90,-50}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_chiOut(redeclare package Medium = + Medium) "Port that connects to the chiller outlet" annotation ( + Placement(transformation(extent={{-110,50},{-90,70}}), iconTransformation( + extent={{-110,50},{-90,70}}))); + Modelica.Blocks.Interfaces.RealOutput yValCha_actual + if nom.allowRemoteCharging "Actual valve position" + annotation (Placement( + transformation( + extent={{10,-10},{-10,10}}, + rotation=270, + origin={-40,110}), iconTransformation( + extent={{10,-10},{-10,10}}, + rotation=270, + origin={-60,110}))); + Modelica.Blocks.Interfaces.RealOutput yValDis_actual + if nom.allowRemoteCharging "Actual valve position" + annotation (Placement( + transformation( + extent={{10,-10},{-10,10}}, + rotation=270, + origin={-80,110}), iconTransformation( + extent={{10,-10},{-10,10}}, + rotation=270, + origin={-100,110}))); + Modelica.Blocks.Interfaces.RealInput yValCha if nom.allowRemoteCharging + "Valve position input" annotation (Placement(transformation(extent={{10,10}, + {-10,-10}}, + rotation=90, + origin={40,110}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={40,110}))); + Modelica.Blocks.Interfaces.RealInput yValDis if nom.allowRemoteCharging + "Valve position input" annotation (Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=90, + origin={80,110}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={80,110}))); + Modelica.Blocks.Interfaces.RealInput yPum "Secondary pump speed input" + annotation (Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=90, + origin={0,110}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={0,110}))); +equation + connect(pum.port_b, cheVal.port_a) + annotation (Line(points={{-40,60},{-20,60}}, color={0,127,255})); + connect(pasValDis.port_a, cheVal.port_b) annotation (Line(points={{20,20},{10, + 20},{10,60},{-1.77636e-15,60}}, + color={0,127,255})); + connect(valDis.port_a, cheVal.port_b) annotation (Line(points={{20,60},{0,60}}, + color={0,127,255})); + connect(port_CHWS, port_CHWS) + annotation (Line(points={{100,60},{100,60}}, color={0,127,255})); + connect(pum.port_a, port_chiOut) + annotation (Line(points={{-60,60},{-100,60}}, color={0,127,255})); + connect(valCha.port_a, port_CHWS) annotation (Line(points={{40,-20},{80,-20},{ + 80,60},{100,60}}, color={0,127,255})); + connect(pasValDis.port_b, port_CHWS) annotation (Line(points={{40,20},{58,20}, + {58,60},{100,60}}, color={0,127,255})); + connect(valDis.port_b, port_CHWS) + annotation (Line(points={{40,60},{100,60}}, color={0,127,255})); + connect(port_CHWR, port_chiInl) + annotation (Line(points={{100,-60},{-100,-60}}, color={0,127,255})); + connect(valCha.port_b, port_chiOut) annotation (Line(points={{20,-20},{-78,-20}, + {-78,60},{-100,60}}, color={0,127,255})); + connect(pum.y, yPum) annotation (Line(points={{-50,72},{-50,90},{0,90},{0,110}}, + color={0,0,127})); + connect(valDis.y, yValDis) annotation (Line(points={{30,72},{30,80},{80,80},{ + 80,110}}, color={0,0,127})); + connect(valCha.y, yValCha) annotation (Line(points={{30,-8},{30,0},{48,0},{48, + 96},{40,96},{40,110}}, color={0,0,127})); + connect(valDis.y_actual, yValDis_actual) + annotation (Line(points={{35,67},{44,67},{44,84},{-80,84},{-80,110}}, + color={0,0,127})); + connect(valCha.y_actual, yValCha_actual) annotation (Line(points={{25,-13},{ + 24,-13},{24,-14},{-66,-14},{-66,96},{-40,96},{-40,110}}, + color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, + {100,100}}), graphics={Line( + points={{-30,-92},{30,-92}}, + color={28,108,200}, + pattern=LinePattern.Dash, + visible=nom.allowRemoteCharging), Polygon( + points={{-30,-92},{-10,-86},{-10,-98},{-30,-92}}, + fillColor={28,108,200}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None, + visible=nom.allowRemoteCharging), + Line(points={{-30,-72},{30,-72}},color={28,108,200}), + Polygon( + points={{30,-72},{10,-66},{10,-78},{30,-72}}, + fillColor={28,108,200}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None), + Text( + extent={{-62,-124},{62,-100}}, + textColor={0,0,127}, + textString="%name"), + Line(points={{-100,60},{100,60}}, color={28,108,200}), + Line(points={{-100,-60},{100,-60}}, color={28,108,200}), + Ellipse( + extent={{-60,80},{-20,40}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{40,60},{20,70},{20,50},{40,60}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{40,60},{60,70},{60,50},{40,60}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line(points={{80,60},{80,20},{-80,20},{-80,60}}, color={28,108,200}), + Polygon( + points={{40,20},{20,30},{20,10},{40,20}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{40,20},{60,30},{60,10},{40,20}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-20,60},{-50,76},{-50,44},{-20,60}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.None)}), Diagram( + coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}})), + Documentation(info=" +

    +Documentation pending. +

    +", revisions=" +
      +
    • +February 18, 2022 by Hongxiang Fu:
      +First implementation. This is for +#2859. +
    • +
    +")); +end SupplyPumpClosedTank; diff --git a/Buildings/Fluid/Storage/Plant/TankBranch.mo b/Buildings/Fluid/Storage/Plant/TankBranch.mo index 380e43e0d4b..e374311822b 100644 --- a/Buildings/Fluid/Storage/Plant/TankBranch.mo +++ b/Buildings/Fluid/Storage/Plant/TankBranch.mo @@ -5,72 +5,26 @@ model TankBranch replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium package"; - parameter Boolean allowRemoteCharging = true - "= true if the tank is allowed to be charged by a remote source"; - - parameter Modelica.Units.SI.MassFlowRate m_flow_nominal(min=0) - "Nominal mass flow rate"; - parameter Modelica.Units.SI.MassFlowRate mTan_flow_nominal(min=0) - "Nominal mass flow rate for CHW tank branch"; - parameter Modelica.Units.SI.PressureDifference dp_nominal - "Nominal pressure difference"; - parameter Modelica.Units.SI.Temperature T_CHWS_nominal=7+273.15 - "Nominal temperature of CHW supply"; - parameter Modelica.Units.SI.Temperature T_CHWR_nominal=12+273.15 - "Nominal temperature of CHW return"; + parameter Buildings.Fluid.Storage.Plant.BaseClasses.NominalValues nom + "Nominal values"; Buildings.Fluid.FixedResistances.PressureDrop preDroTan( redeclare package Medium = Medium, final allowFlowReversal=true, - final m_flow_nominal=mTan_flow_nominal) "Flow resistance on tank branch" + final m_flow_nominal=nom.mTan_flow_nominal) "Flow resistance on tank branch" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, - rotation=0, - origin={50,30}))); + rotation=90, + origin={30,30}))); Modelica.Blocks.Interfaces.RealOutput mTan_flow "Mass flow rate through the tank" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=90, - origin={-30,110}), iconTransformation( + origin={80,110}), iconTransformation( extent={{10,-10},{-10,10}}, - rotation=180, - origin={110,20}))); - Buildings.Fluid.Movers.SpeedControlled_y pum( - redeclare package Medium = Medium, - per(pressure(dp=dp_nominal*{2,1.2,0}, V_flow=(m_flow_nominal)/1.2*{0,1.2,2})), - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - allowFlowReversal=true, - addPowerToMedium=false, - y_start=0, - T_start=T_CHWR_nominal) "Secondary CHW pump" annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-70,-40}))); + rotation=270, + origin={80,110}))); - Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valDis( - redeclare package Medium = Medium, - dpValve_nominal=0.1*dp_nominal, - use_inputFilter=true, - y_start=0, - l=1E-5, - m_flow_nominal=m_flow_nominal) - if allowRemoteCharging - "Discharge valve, in series to the pump (normal direction)" - annotation (Placement(transformation(extent={{0,-42},{20,-22}}))); - Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valCha( - redeclare package Medium = Medium, - dpValve_nominal=0.1*dp_nominal, - use_inputFilter=true, - y_start=0, - l=1E-5, - m_flow_nominal=mTan_flow_nominal) if allowRemoteCharging - "Charging valve, in parallel to the secondary pump (reverse direction)" - annotation (Placement(transformation(extent={{20,-90},{0,-70}}))); - Buildings.Fluid.Storage.Plant.BaseClasses.FluidPassThrough pasValDis( - redeclare package Medium = Medium) if not allowRemoteCharging - "Replaces valDis when remote charging not allowed" - annotation (Placement(transformation(extent={{0,-60},{20,-40}}))); Buildings.Fluid.Storage.Stratified tan( redeclare package Medium = Medium, final allowFlowReversal=true, @@ -79,162 +33,71 @@ model TankBranch VTan=10, nSeg=7, show_T=true, - m_flow_nominal=mTan_flow_nominal, - T_start=T_CHWS_nominal, + m_flow_nominal=nom.mTan_flow_nominal, + T_start=nom.T_CHWS_nominal, TFlu_start=linspace( - T_CHWR_nominal, - T_CHWS_nominal, + nom.T_CHWR_nominal, + nom.T_CHWS_nominal, tan.nSeg)) "Tank" - annotation (Placement(transformation(extent={{0,20},{20,40}}))); + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); Modelica.Fluid.Sensors.MassFlowRate sen_m_flow( redeclare package Medium = Medium, final allowFlowReversal=true) "Flow rate sensor" - annotation (Placement(transformation(extent={{-40,20},{-20,40}}))); - Buildings.Fluid.FixedResistances.CheckValve cheVal( - redeclare package Medium = Medium, - m_flow_nominal=m_flow_nominal, - dpValve_nominal=0.1*dp_nominal, - dpFixed_nominal=0.1*dp_nominal) "Check valve" annotation (Placement( - transformation( - extent={{10,-10},{-10,10}}, - rotation=180, - origin={-30,-40}))); - Modelica.Fluid.Interfaces.FluidPort_a port_1( - redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{-10,10},{10,-10}}, + rotation=90, + origin={-30,-30}))); + Modelica.Fluid.Interfaces.FluidPort_a port_CHWR(redeclare package Medium = + Medium) "Port that connects CHW return line to the warmer side of the tank" - annotation (Placement(transformation(extent={{-110,-70},{-90,-50}}), - iconTransformation(extent={{-110,-70},{-90,-50}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_2( - redeclare package Medium = Medium) - "Port that connects the cooler side of the tank to the CHW supply line" annotation (Placement(transformation(extent={{90,-70},{110,-50}}), iconTransformation(extent={{90,-70},{110,-50}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_3( - redeclare package Medium = Medium) + Modelica.Fluid.Interfaces.FluidPort_b port_CHWS(redeclare package Medium = + Medium) + "Port that connects the cooler side of the tank to the CHW supply line" + annotation (Placement(transformation(extent={{90,50},{110,70}}), + iconTransformation(extent={{90,50},{110,70}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_chiInl(redeclare package Medium = + Medium) "Port that connects the warmer side of the tank to the chiller inlet" - annotation (Placement(transformation(extent={{-70,90},{-50,110}}), - iconTransformation(extent={{-50,90},{-30,110}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_4( - redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{-110,-70},{-90,-50}}), + iconTransformation(extent={{-110,-70},{-90,-50}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_chiOut(redeclare package Medium = + Medium) "Port that connects the chiller outlet to the warmer side of the tank" - annotation (Placement(transformation(extent={{50,90},{70,110}}), - iconTransformation(extent={{30,92},{50,112}}))); - Modelica.Blocks.Interfaces.RealOutput yValCha_actual if allowRemoteCharging - "Actual valve position" - annotation (Placement( - transformation( - extent={{10,-10},{-10,10}}, - rotation=90, - origin={-20,-110}), iconTransformation( - extent={{10,-10},{-10,10}}, - rotation=180, - origin={110,60}))); - Modelica.Blocks.Interfaces.RealOutput yValDis_actual if allowRemoteCharging - "Actual valve position" - annotation (Placement( - transformation( - extent={{10,-10},{-10,10}}, - rotation=90, - origin={40,-110}), iconTransformation( - extent={{10,-10},{-10,10}}, - rotation=180, - origin={110,100}))); - Modelica.Blocks.Interfaces.RealInput yValCha if allowRemoteCharging - "Valve position input" annotation (Placement(transformation(extent={{10,10}, - {-10,-10}}, - rotation=-90, - origin={-40,-110}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-110,60}))); - Modelica.Blocks.Interfaces.RealInput yValDis if allowRemoteCharging - "Valve position input" annotation (Placement(transformation( - extent={{10,10},{-10,-10}}, - rotation=-90, - origin={60,-110}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-110,100}))); - Modelica.Blocks.Interfaces.RealInput yPum "Secondary pump speed input" - annotation (Placement(transformation( - extent={{10,10},{-10,-10}}, - rotation=180, - origin={-110,-20}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-110,20}))); + annotation (Placement(transformation(extent={{-110,50},{-90,70}}), + iconTransformation(extent={{-110,50},{-90,70}}))); equation - connect(sen_m_flow.m_flow, mTan_flow) annotation (Line(points={{-30,41},{-30,110}}, - color={0,0,127})); - connect(preDroTan.port_a, tan.port_b) annotation (Line(points={{40,30},{20,30}}, - color={0,127,255})); + connect(sen_m_flow.m_flow, mTan_flow) annotation (Line(points={{-19,-30},{80,-30}, + {80,110}}, color={0,0,127})); + connect(preDroTan.port_a, tan.port_b) annotation (Line(points={{30,20},{30,0}, + {10,0}}, color={0,127,255})); connect(sen_m_flow.port_b, tan.port_a) - annotation (Line(points={{-20,30},{0,30}}, color={0,127,255})); - connect(pum.port_b, cheVal.port_a) - annotation (Line(points={{-60,-40},{-40,-40}}, color={0,127,255})); - connect(pasValDis.port_a, cheVal.port_b) annotation (Line(points={{0,-50},{-10, - -50},{-10,-40},{-20,-40}}, color={0,127,255})); - connect(valDis.port_a, cheVal.port_b) annotation (Line(points={{0,-32},{-10,-32}, - {-10,-40},{-20,-40}}, color={0,127,255})); - connect(preDroTan.port_b, port_2) annotation (Line(points={{60,30},{70,30},{70, - -60},{100,-60}}, color={0,127,255})); - connect(pum.port_a, port_1) annotation (Line(points={{-80,-40},{-90,-40},{-90, + annotation (Line(points={{-30,-20},{-30,0},{-10,0}}, + color={0,127,255})); + connect(preDroTan.port_b, port_CHWS) + annotation (Line(points={{30,40},{30,60},{100,60}}, color={0,127,255})); + connect(port_CHWS, port_CHWS) + annotation (Line(points={{100,60},{100,60}}, color={0,127,255})); + connect(sen_m_flow.port_a, port_chiInl) annotation (Line(points={{-30,-40},{-30, -60},{-100,-60}}, color={0,127,255})); - connect(valCha.port_b, port_1) annotation (Line(points={{0,-80},{-90,-80},{-90, - -60},{-100,-60}}, color={0,127,255})); - connect(port_2, port_2) - annotation (Line(points={{100,-60},{100,-60}}, color={0,127,255})); - connect(sen_m_flow.port_a, valCha.port_a) annotation (Line(points={{-40,30},{-60, - 30},{-60,0},{30,0},{30,-80},{20,-80}}, color={0,127,255})); - connect(pasValDis.port_b, sen_m_flow.port_a) annotation (Line(points={{20,-50}, - {30,-50},{30,0},{-60,0},{-60,30},{-40,30}}, color={0,127,255})); - connect(valDis.port_b, sen_m_flow.port_a) annotation (Line(points={{20,-32},{30, - -32},{30,0},{-60,0},{-60,30},{-40,30}}, color={0,127,255})); - connect(sen_m_flow.port_a, port_3) annotation (Line(points={{-40,30},{-60,30}, - {-60,100}}, color={0,127,255})); - connect(preDroTan.port_b, port_4) annotation (Line(points={{60,30},{70,30},{70, - 86},{60,86},{60,100}}, - color={0,127,255})); - connect(valCha.y_actual, yValCha_actual) - annotation (Line(points={{5,-73},{-20,-73},{-20,-110}}, color={0,0,127})); - connect(valDis.y_actual, yValDis_actual) - annotation (Line(points={{15,-25},{40,-25},{40,-110}}, color={0,0,127})); - connect(valCha.y, yValCha) - annotation (Line(points={{10,-68},{-40,-68},{-40,-110}}, color={0,0,127})); - connect(yValDis, valDis.y) - annotation (Line(points={{60,-110},{60,-20},{10,-20}}, color={0,0,127})); - connect(pum.y, yPum) annotation (Line(points={{-70,-28},{-70,-20},{-110,-20}}, - color={0,0,127})); + connect(preDroTan.port_b, port_chiOut) + annotation (Line(points={{30,40},{30,60},{-100,60}}, color={0,127,255})); + connect(port_CHWR, sen_m_flow.port_a) annotation (Line(points={{100,-60},{-30, + -60},{-30,-40}}, color={0,127,255})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, - {100,100}}), graphics={Line( - points={{-30,-92},{30,-92}}, - color={28,108,200}, - pattern=LinePattern.Dash, - visible=allowRemoteCharging), Polygon( - points={{-30,-92},{-10,-86},{-10,-98},{-30,-92}}, - fillColor={28,108,200}, - fillPattern=FillPattern.Solid, - pattern=LinePattern.None, - visible=allowRemoteCharging), - Line(points={{-30,-72},{30,-72}},color={28,108,200}), - Polygon( - points={{30,-72},{10,-66},{10,-78},{30,-72}}, - fillColor={28,108,200}, - fillPattern=FillPattern.Solid, - pattern=LinePattern.None), - Line(points={{-100,-60},{-40,-60},{-40,-30},{0,-30},{0,30},{40,30},{40,-60}, - {100,-60}}, color={0,0,0}), + {100,100}}), graphics={ + Text( + extent={{-62,-122},{62,-98}}, + textColor={0,0,127}, + textString="%name"), + Line(points={{-100,-60},{100,-60}}, color={28,108,200}), + Line(points={{-100,60},{100,60}}, color={28,108,200}), + Line(points={{0,60},{0,-60}}, color={28,108,200}), Rectangle( extent={{-20,40},{20,-40}}, lineColor={0,0,0}, fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Line(points={{-40,100},{-40,-30}}, color={0,0,0}), - Line(points={{40,100},{40,30}}, color={0,0,0}), - Text( - extent={{-62,-124},{62,-100}}, - textColor={0,0,127}, - textString="%name")}), Diagram( + fillPattern=FillPattern.Solid)}), Diagram( coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}})), Documentation(info="

    diff --git a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialTankBranch.mo b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialTankBranch.mo index 0864ae6f71d..84998bf5634 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialTankBranch.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialTankBranch.mo @@ -3,79 +3,79 @@ partial model PartialTankBranch "(Draft)" package Medium = Buildings.Media.Water "Medium model"; - parameter Modelica.Units.SI.AbsolutePressure p_CHWS_nominal=800000 - "Nominal pressure of the CHW supply line"; - parameter Modelica.Units.SI.AbsolutePressure p_CHWR_nominal=300000 - "Nominal pressure of the CHW return line"; - parameter Modelica.Units.SI.Temperature T_CHWS_nominal=7+273.15 - "Nominal temperature of CHW supply"; - parameter Modelica.Units.SI.Temperature T_CHWR_nominal=12+273.15 - "Nominal temperature of CHW return"; + Buildings.Fluid.Storage.Plant.BaseClasses.NominalValues nom( + mTan_flow_nominal=1, + mChi_flow_nominal=1, + dp_nominal=500000, + T_CHWS_nominal=280.15, + T_CHWR_nominal=285.15) "Nominal values" + annotation (Placement(transformation(extent={{60,60},{80,80}}))); + Buildings.Fluid.Storage.Plant.SupplyPumpClosedTank supPum(redeclare final + package Medium = Medium, final nom=nom) "Supply pump and valves" + annotation (Placement(transformation(extent={{10,-10},{30,10}}))); Buildings.Fluid.Storage.Plant.TankBranch tanBra( - cheVal(final dpValve_nominal=tanBra.dp_nominal*0.1, final dpFixed_nominal= - tanBra.dp_nominal*0.1), redeclare final package Medium = Medium, - final m_flow_nominal=2, - final mTan_flow_nominal=1, - final dp_nominal=p_CHWS_nominal - p_CHWR_nominal, - final T_CHWS_nominal=T_CHWS_nominal, - final T_CHWR_nominal=T_CHWR_nominal, - final preDroTan(final dp_nominal=tanBra.dp_nominal*0.1), - final valCha(final dpValve_nominal=tanBra.dp_nominal*0.1), - final valDis(final dpValve_nominal=tanBra.dp_nominal*0.1)) "Tank branch" - annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + final nom=nom, + final preDroTan(final dp_nominal=nom.dp_nominal*0.1)) "Tank branch" + annotation (Placement(transformation(extent={{-30,-10},{-10,10}}))); Buildings.Fluid.Sources.Boundary_pT sou( redeclare final package Medium = Medium, - final p=p_CHWR_nominal, - final T=T_CHWR_nominal, + final p=300000, + final T=nom.T_CHWR_nominal, nPorts=1) "Source representing CHW return line" annotation (Placement(transformation( extent={{10,-10},{-10,10}}, - rotation=-90, - origin={-20,-30}))); + rotation=0, + origin={50,-30}))); Buildings.Fluid.Sources.Boundary_pT sin( redeclare final package Medium = Medium, - final p=p_CHWS_nominal, - final T=T_CHWS_nominal, + final p=300000+nom.dp_nominal, + final T=nom.T_CHWS_nominal, nPorts=1) "Sink representing CHW supply line" annotation (Placement(transformation( - extent={{10,10},{-10,-10}}, - rotation=270, - origin={20,-30}))); + extent={{10,-10},{-10,10}}, + rotation=0, + origin={50,30}))); Buildings.Fluid.Sources.MassFlowSource_T souChi( redeclare package Medium = Medium, - final T=T_CHWS_nominal, + final T=nom.T_CHWS_nominal, nPorts=1) "Source representing chiller branch outlet" annotation (Placement(transformation(extent={{-10,-10},{10,10}}, - rotation=-90, - origin={20,30}))); + rotation=0, + origin={-50,30}))); Buildings.Fluid.Sources.MassFlowSource_T sinChi( redeclare package Medium = Medium, final use_m_flow_in=true, - final T=T_CHWR_nominal, + final T=nom.T_CHWR_nominal, nPorts=1) "Sink representing chiller branch inlet" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, - rotation=-90, - origin={-20,30}))); + rotation=0, + origin={-50,-30}))); Modelica.Blocks.Sources.RealExpression mSinChi_flow( final y=souChi.ports[1].m_flow) "Mass flow rate" - annotation (Placement(transformation(extent={{-40,38},{-20,58}}))); + annotation (Placement(transformation(extent={{-100,-10},{-80,10}}))); + equation - connect(sou.ports[1], tanBra.port_1) - annotation (Line(points={{-20,-20},{-20,-6},{-10,-6}}, color={0,127,255})); - connect(sin.ports[1], tanBra.port_2) - annotation (Line(points={{20,-20},{20,-6},{10,-6}}, color={0,127,255})); - connect(tanBra.port_4, souChi.ports[1]) annotation (Line(points={{4,10.2},{4, - 16},{20,16},{20,20}}, color={0,127,255})); - connect(sinChi.ports[1], tanBra.port_3) annotation (Line(points={{-20,20},{-20, - 16},{-4,16},{-4,10}}, color={0,127,255})); connect(mSinChi_flow.y, sinChi.m_flow_in) - annotation (Line(points={{-19,48},{-12,48},{-12,42}}, color={0,0,127})); + annotation (Line(points={{-79,0},{-70,0},{-70,-22},{-62,-22}}, + color={0,0,127})); + connect(sinChi.ports[1], tanBra.port_chiInl) annotation (Line(points={{-40,-30}, + {-32,-30},{-32,-6},{-30,-6}}, color={0,127,255})); + connect(souChi.ports[1], tanBra.port_chiOut) annotation (Line(points={{-40,30}, + {-32,30},{-32,6},{-30,6}}, color={0,127,255})); + connect(sou.ports[1], supPum.port_CHWR) annotation (Line(points={{40,-30},{32, + -30},{32,-6},{30,-6}}, color={0,127,255})); + connect(sin.ports[1], supPum.port_CHWS) annotation (Line(points={{40,30},{32,30}, + {32,6},{30,6}}, color={0,127,255})); + connect(tanBra.port_CHWR, supPum.port_chiInl) + annotation (Line(points={{-10,-6},{10,-6}}, color={0,127,255})); + connect(supPum.port_chiOut, tanBra.port_CHWS) + annotation (Line(points={{10,6},{-10,6}}, color={0,127,255})); annotation ( Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), Icon(coordinateSystem(extent={{-100,-100},{100,100}})), diff --git a/Buildings/Fluid/Storage/Plant/Validation/NoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/NoRemoteCharging.mo index d961f01b2cf..1cee22dc8ea 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/NoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/NoRemoteCharging.mo @@ -4,33 +4,34 @@ model NoRemoteCharging extends Modelica.Icons.Example; extends Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialTankBranch( - tanBra(final allowRemoteCharging=false), - souChi(final m_flow=1)); + nom(final allowRemoteCharging=false), + souChi(final m_flow=nom.mChi_flow_nominal)); Modelica.Blocks.Sources.TimeTable set_mPumSec_flow(table=[0,1; 900,1; 900,-1; 1800,-1; 1800,0; 2700,0; 2700,1; 3600,1]) "Secondary mass flow rate setpoint" - annotation (Placement(transformation(extent={{-100,0},{-80,20}}))); + annotation (Placement(transformation(extent={{-60,60},{-40,80}}))); Buildings.Controls.Continuous.LimPID conPID_PumSec( k=1, Ti=15) "PI controller" annotation (Placement(transformation( extent={{10,10},{-10,-10}}, rotation=180, - origin={-50,10}))); - Modelica.Blocks.Math.Gain gai(k=1/tanBra.mTan_flow_nominal) "Gain" + origin={-10,70}))); + Modelica.Blocks.Math.Gain gai(k=1/nom.mTan_flow_nominal) "Gain" annotation (Placement(transformation( extent={{10,-10},{-10,10}}, rotation=270, - origin={-50,-30}))); + origin={-10,30}))); + equation connect(gai.y, conPID_PumSec.u_m) - annotation (Line(points={{-50,-19},{-50,-2}}, color={0,0,127})); + annotation (Line(points={{-10,41},{-10,58}}, color={0,0,127})); connect(set_mPumSec_flow.y, conPID_PumSec.u_s) - annotation (Line(points={{-79,10},{-62,10}}, color={0,0,127})); - connect(conPID_PumSec.y, tanBra.yPum) annotation (Line(points={{-39,10},{-39, - 8},{-16,8},{-16,2},{-11,2}}, color={0,0,127})); - connect(tanBra.mTan_flow, gai.u) annotation (Line(points={{11,2},{36,2},{36,-48}, - {-50,-48},{-50,-42}}, color={0,0,127})); + annotation (Line(points={{-39,70},{-22,70}}, color={0,0,127})); + connect(tanBra.mTan_flow, gai.u) annotation (Line(points={{-12,11},{-12,14},{-10, + 14},{-10,18}}, color={0,0,127})); + connect(supPum.yPum, conPID_PumSec.y) + annotation (Line(points={{20,11},{20,70},{1,70}}, color={0,0,127})); annotation (__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/NoRemoteCharging.mos" "Simulate and plot"), experiment(Tolerance=1e-06, StopTime=3600), diff --git a/Buildings/Fluid/Storage/Plant/Validation/WithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/WithRemoteCharging.mo index 0aed495b45f..568d6fd2530 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/WithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/WithRemoteCharging.mo @@ -4,49 +4,48 @@ model WithRemoteCharging extends Modelica.Icons.Example; extends Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialTankBranch( - tanBra(final allowRemoteCharging=true), + nom(final allowRemoteCharging=true), souChi(final use_m_flow_in=true)); Modelica.Blocks.Sources.TimeTable set_mTan_flow(table=[0,0; 3600/7,0; 3600/7, -1; 3600/7*3,-1; 3600/7*3,0; 3600/7*4,0; 3600/7*4,1; 3600/7*6,1; 3600/7 *6,-1]) "Tank flow rate setpoint" - annotation (Placement(transformation(extent={{-100,-40},{-80,-20}}))); + annotation (Placement(transformation(extent={{-100,60},{-80,80}}))); Modelica.Blocks.Sources.BooleanTable uRemCha(table={0,3600/7*6}, startValue= true) "Tank is being charged remotely" - annotation (Placement(transformation(extent={{-100,-70},{-80,-50}}))); + annotation (Placement(transformation(extent={{100,80},{80,100}}))); Modelica.Blocks.Sources.BooleanTable uOnl(table={3600/7*2}) "True = plant online (outputting CHW to the network); False = offline" - annotation (Placement(transformation(extent={{-100,-100},{-80,-80}}))); + annotation (Placement(transformation(extent={{100,40},{80,60}}))); Modelica.Blocks.Sources.TimeTable set_mChi_flow(table=[0,0; 3600/7,0; 3600/7, 1; 3600/7*5,1; 3600/7*5,0]) "Chiller flow rate setpoint" - annotation (Placement(transformation(extent={{0,60},{20,80}}))); + annotation (Placement(transformation(extent={{-100,20},{-80,40}}))); Buildings.Fluid.Storage.Plant.BaseClasses.ReversiblePumpValveControl - conPumSecGro "Control block for secondary pump-valve group" - annotation (Placement(transformation(extent={{-60,-8},{-40,12}}))); + conPumSec "Control block for the secondary pump and near-by valves" + annotation (Placement(transformation(extent={{10,40},{30,60}}))); equation - connect(set_mTan_flow.y, conPumSecGro.mTanSet_flow) annotation (Line(points={{-79,-30}, - {-70,-30},{-70,-2},{-61,-2}}, color={0,0,127})); - connect(tanBra.mTan_flow, conPumSecGro.mTan_flow) annotation (Line(points={{ - 11,2},{58,2},{58,98},{-78,98},{-78,2},{-61,2}}, color={0,0,127})); - connect(tanBra.yPum, conPumSecGro.yPumSec) - annotation (Line(points={{-11,2},{-39,2}}, color={0,0,127})); - connect(conPumSecGro.yValCha, tanBra.yValCha) - annotation (Line(points={{-39,6},{-11,6}}, color={0,0,127})); - connect(tanBra.yValDis, conPumSecGro.yValDis) - annotation (Line(points={{-11,10},{-39,10}}, color={0,0,127})); - connect(uRemCha.y, conPumSecGro.uRemCha) annotation (Line(points={{-79,-60},{ - -58,-60},{-58,-10}}, - color={255,0,255})); - connect(uOnl.y, conPumSecGro.uOnl) annotation (Line(points={{-79,-90},{-54,-90}, - {-54,-10}}, color={255,0,255})); - connect(tanBra.yValCha_actual, conPumSecGro.yValCha_actual) annotation (Line( - points={{11,6},{54,6},{54,94},{-74,94},{-74,6},{-61,6}}, color={0,0,127})); - connect(tanBra.yValDis_actual, conPumSecGro.yValDis_actual) annotation (Line( - points={{11,10},{50,10},{50,90},{-70,90},{-70,10},{-61,10}}, color={0,0, - 127})); connect(set_mChi_flow.y, souChi.m_flow_in) - annotation (Line(points={{21,70},{28,70},{28,42}}, color={0,0,127})); + annotation (Line(points={{-79,30},{-70,30},{-70,38},{-62,38}}, + color={0,0,127})); + connect(set_mTan_flow.y, conPumSec.mTanSet_flow) + annotation (Line(points={{-79,70},{6,70},{6,58},{9,58}}, color={0,0,127})); + connect(tanBra.mTan_flow, conPumSec.mTan_flow) + annotation (Line(points={{-12,11},{-12,54},{9,54}}, color={0,0,127})); + connect(supPum.yValCha_actual, conPumSec.yValCha_actual) annotation (Line( + points={{14,11},{14,36},{4,36},{4,46},{9,46}}, color={0,0,127})); + connect(supPum.yValDis_actual, conPumSec.yValDis_actual) annotation (Line( + points={{10,11},{10,34},{2,34},{2,50},{9,50}}, color={0,0,127})); + connect(conPumSec.uOnl, uOnl.y) annotation (Line(points={{32,54},{74,54},{74, + 50},{79,50}}, color={255,0,255})); + connect(conPumSec.uRemCha, uRemCha.y) + annotation (Line(points={{32,58},{32,90},{79,90}}, color={255,0,255})); + connect(conPumSec.yPum, supPum.yPum) + annotation (Line(points={{20,39},{20,11}}, color={0,0,127})); + connect(conPumSec.yValCha, supPum.yValCha) + annotation (Line(points={{24,39},{24,11}}, color={0,0,127})); + connect(conPumSec.yValDis, supPum.yValDis) + annotation (Line(points={{28,39},{28,11}}, color={0,0,127})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), diff --git a/Buildings/Fluid/Storage/Plant/package.order b/Buildings/Fluid/Storage/Plant/package.order index 1bd95e85bd1..aad35ba052f 100644 --- a/Buildings/Fluid/Storage/Plant/package.order +++ b/Buildings/Fluid/Storage/Plant/package.order @@ -1,3 +1,4 @@ +SupplyPumpClosedTank TankBranch Examples Validation diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos index a0186b77826..4c6ccc6553e 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos @@ -6,7 +6,7 @@ simulateModel("Buildings.Fluid.Storage.Plant.Examples.OneSourceOneUser", // Plot commands createPlot(id=1, position={15, 15, 1027, 480}, - y={"chiBra.m_flow", "tanBra.mTan_flow", "tanBra.pum.m_flow"}, + y={"chiBra.pum.m_flow", "tanBra.mTan_flow", "supPum.pum.m_flow"}, range={0.0, 3600.0, -1.0, 1.0}, grid=true, subPlot=101, diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos index f0731093709..0510bc7858f 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos @@ -6,7 +6,7 @@ simulateModel("Buildings.Fluid.Storage.Plant.Examples.TwoSourcesThreeUsers", // Plot commands createPlot(id=1, position={15, 15, 914, 538}, - y={"pumSup1.m_flow", "chiBra2.m_flow", "tanBra.mTan_flow", "tanBra.pum.m_flow"}, + y={"pumSup1.m_flow", "chiBra2.pum.m_flow", "tanBra.mTan_flow", "supPum.pum.m_flow"}, range={0.0, 3600.0, -2.0, 2.0}, grid=true, subPlot=101, diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/NoRemoteCharging.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/NoRemoteCharging.mos index 11b5d17c049..cb9aadda472 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/NoRemoteCharging.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/NoRemoteCharging.mos @@ -6,7 +6,7 @@ simulateModel("Buildings.Fluid.Storage.Plant.Validation.NoRemoteCharging", // Plot commands createPlot(id=1, position={15, 15, 961, 426}, - y={"sinChi.ports[1].m_flow", "tanBra.mTan_flow", "tanBra.pum.m_flow"}, + y={"sinChi.ports[1].m_flow", "tanBra.mTan_flow", "supPum.pum.m_flow"}, range={0.0, 3600.0, -1.5, 2.5}, grid=true, colors={{28,108,200}, {238,46,47}, {0,140,72}}, diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/WithRemoteCharging.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/WithRemoteCharging.mos index ddf7bfac2c0..d8eb43cb6e4 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/WithRemoteCharging.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/WithRemoteCharging.mos @@ -6,7 +6,7 @@ simulateModel("Buildings.Fluid.Storage.Plant.Validation.WithRemoteCharging", // Plot commands createPlot(id=1, position={15, 15, 929, 372}, - y={"sinChi.ports[1].m_flow", "tanBra.mTan_flow", "tanBra.pum.m_flow"}, + y={"sinChi.ports[1].m_flow", "tanBra.mTan_flow", "supPum.pum.m_flow"}, range={0.0, 3600.0, -4.0, 3.0}, grid=true, colors={{28,108,200}, {238,46,47}, {0,140,72}}, From 61d64b27e829e9affe6f9f5d2da1590f44422a46 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Mon, 11 Apr 2022 09:32:50 -0700 Subject: [PATCH 077/463] added a base class for branch port configurations --- .../Plant/BaseClasses/NominalValues.mo | 4 - .../Plant/BaseClasses/PartialBranchPorts.mo | 58 +++++++++++ .../Storage/Plant/BaseClasses/package.order | 1 + .../Plant/Examples/OneSourceOneUser.mo | 2 +- .../Plant/Examples/TwoSourcesThreeUsers.mo | 2 +- .../Storage/Plant/SupplyPumpClosedTank.mo | 96 ++++++++----------- Buildings/Fluid/Storage/Plant/TankBranch.mo | 41 +------- .../Plant/Validation/NoRemoteCharging.mo | 4 +- .../Plant/Validation/WithRemoteCharging.mo | 4 +- 9 files changed, 110 insertions(+), 102 deletions(-) create mode 100644 Buildings/Fluid/Storage/Plant/BaseClasses/PartialBranchPorts.mo diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/NominalValues.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/NominalValues.mo index 2b6c78e3450..8f0e79b7471 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/NominalValues.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/NominalValues.mo @@ -2,10 +2,6 @@ within Buildings.Fluid.Storage.Plant.BaseClasses; record NominalValues "Nominal values" extends Modelica.Icons.Record; - parameter Boolean allowRemoteCharging = true - "= true if the tank is allowed to be charged by a remote source" - annotation(dialog(group="Plant configuration")); - final parameter Modelica.Units.SI.MassFlowRate m_flow_nominal= mTan_flow_nominal+mChi_flow_nominal "Nominal mass flow rate" diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/PartialBranchPorts.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/PartialBranchPorts.mo new file mode 100644 index 00000000000..c48cd820993 --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/PartialBranchPorts.mo @@ -0,0 +1,58 @@ +within Buildings.Fluid.Storage.Plant.BaseClasses; +model PartialBranchPorts + "(Draft) Common port configuration used by plant branches" + + replaceable package Medium = + Modelica.Media.Interfaces.PartialMedium "Medium package"; + + parameter Buildings.Fluid.Storage.Plant.BaseClasses.NominalValues nom + "Nominal values"; + + Modelica.Fluid.Interfaces.FluidPort_a port_CHWR(redeclare package Medium = + Medium) + "Port that connects CHW return line to the warmer side of the tank" + annotation (Placement(transformation(extent={{90,-70},{110,-50}}), + iconTransformation(extent={{90,-70},{110,-50}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_CHWS(redeclare package Medium = + Medium) + "Port that connects the cooler side of the tank to the CHW supply line" + annotation (Placement(transformation(extent={{90,50},{110,70}}), + iconTransformation(extent={{90,50},{110,70}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_chiInl(redeclare package Medium = + Medium) + "Port that connects the warmer side of the tank to the chiller inlet" + annotation (Placement(transformation(extent={{-110,-70},{-90,-50}}), + iconTransformation(extent={{-110,-70},{-90,-50}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_chiOut(redeclare package Medium = + Medium) + "Port that connects the chiller outlet to the warmer side of the tank" + annotation (Placement(transformation(extent={{-110,50},{-90,70}}), + iconTransformation(extent={{-110,50},{-90,70}}))); +equation + connect(port_CHWS, port_CHWS) + annotation (Line(points={{100,60},{100,60}}, color={0,127,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, + {100,100}}), graphics={ + Text( + extent={{-62,-122},{62,-98}}, + textColor={0,0,127}, + textString="%name"), Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid)}), Diagram( + coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}})), + Documentation(info=" +

    +Documentation pending. +

    +", revisions=" +
      +
    • +April 11, 2022 by Hongxiang Fu:
      +First implementation. This is for +#2859. +
    • +
    +")); +end PartialBranchPorts; diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/package.order b/Buildings/Fluid/Storage/Plant/BaseClasses/package.order index 7f4c2dabda2..369571cbc76 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/package.order +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/package.order @@ -1,3 +1,4 @@ FluidPassThrough NominalValues +PartialBranchPorts ReversiblePumpValveControl diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo index 6a2a145ca6b..0b557324323 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo @@ -10,7 +10,6 @@ model OneSourceOneUser "(Draft) Simple system model with one source and one user "Nominal cooling load of one consumer"; Buildings.Fluid.Storage.Plant.BaseClasses.NominalValues nom( - final allowRemoteCharging=false, mTan_flow_nominal=0.5, mChi_flow_nominal=0.5, dp_nominal=500000, @@ -34,6 +33,7 @@ model OneSourceOneUser "(Draft) Simple system model with one source and one user origin={-80,0}))); Buildings.Fluid.Storage.Plant.SupplyPumpClosedTank supPum( redeclare final package Medium = Medium, + final allowRemoteCharging=false, final nom=nom, final valCha(final dpValve_nominal=nom.dp_nominal*0.1), final valDis(final dpValve_nominal=nom.dp_nominal*0.1)) diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index 2c54d718911..7b03cc75d8b 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -131,7 +131,6 @@ model TwoSourcesThreeUsers // Second source: chiller and tank Buildings.Fluid.Storage.Plant.BaseClasses.NominalValues nomPla2( - final allowRemoteCharging=true, mTan_flow_nominal=0.75*m_flow_nominal, mChi_flow_nominal=0.75*m_flow_nominal, dp_nominal=dp_nominal, @@ -155,6 +154,7 @@ model TwoSourcesThreeUsers annotation (Placement(transformation(extent={{-140,-70},{-120,-50}}))); Buildings.Fluid.Storage.Plant.SupplyPumpClosedTank supPum( redeclare final package Medium = MediumCHW, + final allowRemoteCharging=true, final nom=nomPla2, final valCha(final dpValve_nominal=nomPla2.dp_nominal*0.1), final valDis(final dpValve_nominal=nomPla2.dp_nominal*0.1)) diff --git a/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo b/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo index c053125f198..839efc14a7d 100644 --- a/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo +++ b/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo @@ -2,11 +2,10 @@ within Buildings.Fluid.Storage.Plant; model SupplyPumpClosedTank "(Draft) Model section with supply pump and valves for a closed tank" - replaceable package Medium = - Modelica.Media.Interfaces.PartialMedium "Medium package"; + extends Buildings.Fluid.Storage.Plant.BaseClasses.PartialBranchPorts; - parameter Buildings.Fluid.Storage.Plant.BaseClasses.NominalValues nom - "Nominal values"; + parameter Boolean allowRemoteCharging = true + "= true if the tank is allowed to be charged by a remote source"; Buildings.Fluid.Movers.SpeedControlled_y pum( redeclare package Medium = Medium, @@ -29,7 +28,7 @@ model SupplyPumpClosedTank y_start=0, l=1E-5, m_flow_nominal=nom.m_flow_nominal) - if nom.allowRemoteCharging + if allowRemoteCharging "Discharge valve, in series to the pump (normal direction)" annotation (Placement(transformation(extent={{20,50},{40,70}}))); Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valCha( @@ -38,11 +37,11 @@ model SupplyPumpClosedTank use_inputFilter=true, y_start=0, l=1E-5, - m_flow_nominal=nom.mTan_flow_nominal) if nom.allowRemoteCharging + m_flow_nominal=nom.mTan_flow_nominal) if allowRemoteCharging "Charging valve, in parallel to the secondary pump (reverse direction)" annotation (Placement(transformation(extent={{40,-30},{20,-10}}))); Buildings.Fluid.Storage.Plant.BaseClasses.FluidPassThrough pasValDis( - redeclare package Medium = Medium) if not nom.allowRemoteCharging + redeclare package Medium = Medium) if not allowRemoteCharging "Replaces valDis when remote charging not allowed" annotation (Placement(transformation(extent={{20,10},{40,30}}))); Buildings.Fluid.FixedResistances.CheckValve cheVal( @@ -54,24 +53,8 @@ model SupplyPumpClosedTank extent={{10,-10},{-10,10}}, rotation=180, origin={-10,60}))); - Modelica.Fluid.Interfaces.FluidPort_a port_CHWR(redeclare package Medium = - Medium) "Port that connects to the CHW return line" annotation ( - Placement(transformation(extent={{90,-70},{110,-50}}), iconTransformation( - extent={{90,-70},{110,-50}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_CHWS(redeclare package Medium = - Medium) "Port that connects to the CHW supply line" annotation ( - Placement(transformation(extent={{90,50},{110,70}}), iconTransformation( - extent={{90,50},{110,70}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_chiInl(redeclare package Medium = - Medium) "Port that connects to the chiller inlet" annotation (Placement( - transformation(extent={{-110,-70},{-90,-50}}), iconTransformation( - extent={{-110,-70},{-90,-50}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_chiOut(redeclare package Medium = - Medium) "Port that connects to the chiller outlet" annotation ( - Placement(transformation(extent={{-110,50},{-90,70}}), iconTransformation( - extent={{-110,50},{-90,70}}))); Modelica.Blocks.Interfaces.RealOutput yValCha_actual - if nom.allowRemoteCharging "Actual valve position" + if allowRemoteCharging "Actual valve position" annotation (Placement( transformation( extent={{10,-10},{-10,10}}, @@ -81,7 +64,7 @@ model SupplyPumpClosedTank rotation=270, origin={-60,110}))); Modelica.Blocks.Interfaces.RealOutput yValDis_actual - if nom.allowRemoteCharging "Actual valve position" + if allowRemoteCharging "Actual valve position" annotation (Placement( transformation( extent={{10,-10},{-10,10}}, @@ -90,7 +73,7 @@ model SupplyPumpClosedTank extent={{10,-10},{-10,10}}, rotation=270, origin={-100,110}))); - Modelica.Blocks.Interfaces.RealInput yValCha if nom.allowRemoteCharging + Modelica.Blocks.Interfaces.RealInput yValCha if allowRemoteCharging "Valve position input" annotation (Placement(transformation(extent={{10,10}, {-10,-10}}, rotation=90, @@ -98,7 +81,7 @@ model SupplyPumpClosedTank extent={{-10,-10},{10,10}}, rotation=-90, origin={40,110}))); - Modelica.Blocks.Interfaces.RealInput yValDis if nom.allowRemoteCharging + Modelica.Blocks.Interfaces.RealInput yValDis if allowRemoteCharging "Valve position input" annotation (Placement(transformation( extent={{10,10},{-10,-10}}, rotation=90, @@ -122,20 +105,6 @@ equation color={0,127,255})); connect(valDis.port_a, cheVal.port_b) annotation (Line(points={{20,60},{0,60}}, color={0,127,255})); - connect(port_CHWS, port_CHWS) - annotation (Line(points={{100,60},{100,60}}, color={0,127,255})); - connect(pum.port_a, port_chiOut) - annotation (Line(points={{-60,60},{-100,60}}, color={0,127,255})); - connect(valCha.port_a, port_CHWS) annotation (Line(points={{40,-20},{80,-20},{ - 80,60},{100,60}}, color={0,127,255})); - connect(pasValDis.port_b, port_CHWS) annotation (Line(points={{40,20},{58,20}, - {58,60},{100,60}}, color={0,127,255})); - connect(valDis.port_b, port_CHWS) - annotation (Line(points={{40,60},{100,60}}, color={0,127,255})); - connect(port_CHWR, port_chiInl) - annotation (Line(points={{100,-60},{-100,-60}}, color={0,127,255})); - connect(valCha.port_b, port_chiOut) annotation (Line(points={{20,-20},{-78,-20}, - {-78,60},{-100,60}}, color={0,127,255})); connect(pum.y, yPum) annotation (Line(points={{-50,72},{-50,90},{0,90},{0,110}}, color={0,0,127})); connect(valDis.y, yValDis) annotation (Line(points={{30,72},{30,80},{80,80},{ @@ -148,27 +117,35 @@ equation connect(valCha.y_actual, yValCha_actual) annotation (Line(points={{25,-13},{ 24,-13},{24,-14},{-66,-14},{-66,96},{-40,96},{-40,110}}, color={0,0,127})); + connect(port_chiOut, pum.port_a) + annotation (Line(points={{-100,60},{-60,60}}, color={0,127,255})); + connect(port_chiOut, valCha.port_b) annotation (Line(points={{-100,60},{-80,60}, + {-80,-20},{20,-20}}, color={0,127,255})); + connect(valCha.port_a, port_CHWS) annotation (Line(points={{40,-20},{80,-20},{ + 80,60},{100,60}}, color={0,127,255})); + connect(pasValDis.port_b, port_CHWS) annotation (Line(points={{40,20},{80,20}, + {80,60},{100,60}}, color={0,127,255})); + connect(valDis.port_b, port_CHWS) + annotation (Line(points={{40,60},{100,60}}, color={0,127,255})); + connect(port_chiInl, port_CHWR) + annotation (Line(points={{-100,-60},{100,-60}}, color={0,127,255})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,100}}), graphics={Line( - points={{-30,-92},{30,-92}}, + points={{-20,0},{40,0}}, color={28,108,200}, pattern=LinePattern.Dash, - visible=nom.allowRemoteCharging), Polygon( - points={{-30,-92},{-10,-86},{-10,-98},{-30,-92}}, + visible=allowRemoteCharging), Polygon( + points={{-20,0},{0,6},{0,-6},{-20,0}}, fillColor={28,108,200}, fillPattern=FillPattern.Solid, pattern=LinePattern.None, - visible=nom.allowRemoteCharging), - Line(points={{-30,-72},{30,-72}},color={28,108,200}), + visible=allowRemoteCharging), + Line(points={{-20,80},{40,80}}, color={28,108,200}), Polygon( - points={{30,-72},{10,-66},{10,-78},{30,-72}}, + points={{40,80},{20,86},{20,74},{40,80}}, fillColor={28,108,200}, fillPattern=FillPattern.Solid, pattern=LinePattern.None), - Text( - extent={{-62,-124},{62,-100}}, - textColor={0,0,127}, - textString="%name"), Line(points={{-100,60},{100,60}}, color={28,108,200}), Line(points={{-100,-60},{100,-60}}, color={28,108,200}), Ellipse( @@ -180,23 +157,30 @@ equation points={{40,60},{20,70},{20,50},{40,60}}, lineColor={28,108,200}, fillColor={255,255,255}, - fillPattern=FillPattern.Solid), + fillPattern=FillPattern.Solid, + visible=allowRemoteCharging), Polygon( points={{40,60},{60,70},{60,50},{40,60}}, lineColor={28,108,200}, fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Line(points={{80,60},{80,20},{-80,20},{-80,60}}, color={28,108,200}), + fillPattern=FillPattern.Solid, + visible=allowRemoteCharging), + Line( + points={{80,60},{80,20},{-80,20},{-80,60}}, + color={28,108,200}, + visible=allowRemoteCharging), Polygon( points={{40,20},{20,30},{20,10},{40,20}}, lineColor={28,108,200}, fillColor={255,255,255}, - fillPattern=FillPattern.Solid), + fillPattern=FillPattern.Solid, + visible=allowRemoteCharging), Polygon( points={{40,20},{60,30},{60,10},{40,20}}, lineColor={28,108,200}, fillColor={255,255,255}, - fillPattern=FillPattern.Solid), + fillPattern=FillPattern.Solid, + visible=allowRemoteCharging), Polygon( points={{-20,60},{-50,76},{-50,44},{-20,60}}, lineColor={28,108,200}, diff --git a/Buildings/Fluid/Storage/Plant/TankBranch.mo b/Buildings/Fluid/Storage/Plant/TankBranch.mo index e374311822b..efd027315c6 100644 --- a/Buildings/Fluid/Storage/Plant/TankBranch.mo +++ b/Buildings/Fluid/Storage/Plant/TankBranch.mo @@ -1,12 +1,7 @@ within Buildings.Fluid.Storage.Plant; model TankBranch "(Draft) Model of the tank branch where the tank can potentially be charged remotely" - - replaceable package Medium = - Modelica.Media.Interfaces.PartialMedium "Medium package"; - - parameter Buildings.Fluid.Storage.Plant.BaseClasses.NominalValues nom - "Nominal values"; + extends Buildings.Fluid.Storage.Plant.BaseClasses.PartialBranchPorts; Buildings.Fluid.FixedResistances.PressureDrop preDroTan( redeclare package Medium = Medium, @@ -46,26 +41,6 @@ model TankBranch annotation (Placement(transformation(extent={{-10,10},{10,-10}}, rotation=90, origin={-30,-30}))); - Modelica.Fluid.Interfaces.FluidPort_a port_CHWR(redeclare package Medium = - Medium) - "Port that connects CHW return line to the warmer side of the tank" - annotation (Placement(transformation(extent={{90,-70},{110,-50}}), - iconTransformation(extent={{90,-70},{110,-50}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_CHWS(redeclare package Medium = - Medium) - "Port that connects the cooler side of the tank to the CHW supply line" - annotation (Placement(transformation(extent={{90,50},{110,70}}), - iconTransformation(extent={{90,50},{110,70}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_chiInl(redeclare package Medium = - Medium) - "Port that connects the warmer side of the tank to the chiller inlet" - annotation (Placement(transformation(extent={{-110,-70},{-90,-50}}), - iconTransformation(extent={{-110,-70},{-90,-50}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_chiOut(redeclare package Medium = - Medium) - "Port that connects the chiller outlet to the warmer side of the tank" - annotation (Placement(transformation(extent={{-110,50},{-90,70}}), - iconTransformation(extent={{-110,50},{-90,70}}))); equation connect(sen_m_flow.m_flow, mTan_flow) annotation (Line(points={{-19,-30},{80,-30}, {80,110}}, color={0,0,127})); @@ -74,22 +49,16 @@ equation connect(sen_m_flow.port_b, tan.port_a) annotation (Line(points={{-30,-20},{-30,0},{-10,0}}, color={0,127,255})); + connect(port_chiOut, port_CHWS) + annotation (Line(points={{-100,60},{100,60}}, color={0,127,255})); + connect(port_chiInl, port_CHWR) + annotation (Line(points={{-100,-60},{100,-60}}, color={0,127,255})); connect(preDroTan.port_b, port_CHWS) annotation (Line(points={{30,40},{30,60},{100,60}}, color={0,127,255})); - connect(port_CHWS, port_CHWS) - annotation (Line(points={{100,60},{100,60}}, color={0,127,255})); - connect(sen_m_flow.port_a, port_chiInl) annotation (Line(points={{-30,-40},{-30, - -60},{-100,-60}}, color={0,127,255})); - connect(preDroTan.port_b, port_chiOut) - annotation (Line(points={{30,40},{30,60},{-100,60}}, color={0,127,255})); connect(port_CHWR, sen_m_flow.port_a) annotation (Line(points={{100,-60},{-30, -60},{-30,-40}}, color={0,127,255})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,100}}), graphics={ - Text( - extent={{-62,-122},{62,-98}}, - textColor={0,0,127}, - textString="%name"), Line(points={{-100,-60},{100,-60}}, color={28,108,200}), Line(points={{-100,60},{100,60}}, color={28,108,200}), Line(points={{0,60},{0,-60}}, color={28,108,200}), diff --git a/Buildings/Fluid/Storage/Plant/Validation/NoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/NoRemoteCharging.mo index 1cee22dc8ea..d3ad9523eaa 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/NoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/NoRemoteCharging.mo @@ -4,8 +4,8 @@ model NoRemoteCharging extends Modelica.Icons.Example; extends Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialTankBranch( - nom(final allowRemoteCharging=false), - souChi(final m_flow=nom.mChi_flow_nominal)); + souChi(final m_flow=nom.mChi_flow_nominal), + supPum(final allowRemoteCharging=false)); Modelica.Blocks.Sources.TimeTable set_mPumSec_flow(table=[0,1; 900,1; 900,-1; 1800,-1; 1800,0; 2700,0; 2700,1; 3600,1]) diff --git a/Buildings/Fluid/Storage/Plant/Validation/WithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/WithRemoteCharging.mo index 568d6fd2530..4eac9f8ed6f 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/WithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/WithRemoteCharging.mo @@ -4,8 +4,8 @@ model WithRemoteCharging extends Modelica.Icons.Example; extends Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialTankBranch( - nom(final allowRemoteCharging=true), - souChi(final use_m_flow_in=true)); + souChi(final use_m_flow_in=true), + supPum(final allowRemoteCharging=true)); Modelica.Blocks.Sources.TimeTable set_mTan_flow(table=[0,0; 3600/7,0; 3600/7, -1; 3600/7*3,-1; 3600/7*3,0; 3600/7*4,0; 3600/7*4,1; 3600/7*6,1; 3600/7 From 2c2907fafe40db0d0df7e665ffc3b8fbe5c14ba2 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Mon, 11 Apr 2022 10:19:28 -0700 Subject: [PATCH 078/463] graphic and description improvements --- .../Storage/Plant/Examples/BaseClasses/ChillerBranch.mo | 7 ++++++- Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo | 7 +++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/ChillerBranch.mo b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/ChillerBranch.mo index 84cd35a7cb2..cf3498a39fc 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/ChillerBranch.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/ChillerBranch.mo @@ -132,6 +132,11 @@ equation connect(chi.port_b2, port_b) annotation (Line(points={{20,24},{86,24},{86,60}, {100,60}}, color={0,127,255})); annotation (Icon(graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), Ellipse(extent={{-20,20},{20,-20}}, lineColor={28,108,200}, origin={40,-60}, rotation=90), @@ -151,7 +156,7 @@ equation origin={63,12}, rotation=90), Text( - extent={{40,-100},{100,-80}}, + extent={{-18,-100},{42,-80}}, textColor={28,108,200}, textString="m_flow"), Line( diff --git a/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo b/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo index 839efc14a7d..330f5c64936 100644 --- a/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo +++ b/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo @@ -27,9 +27,8 @@ model SupplyPumpClosedTank use_inputFilter=true, y_start=0, l=1E-5, - m_flow_nominal=nom.m_flow_nominal) - if allowRemoteCharging - "Discharge valve, in series to the pump (normal direction)" + m_flow_nominal=nom.m_flow_nominal) if allowRemoteCharging + "Discharging valve, open when tank NOT being charged remotely" annotation (Placement(transformation(extent={{20,50},{40,70}}))); Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valCha( redeclare package Medium = Medium, @@ -38,7 +37,7 @@ model SupplyPumpClosedTank y_start=0, l=1E-5, m_flow_nominal=nom.mTan_flow_nominal) if allowRemoteCharging - "Charging valve, in parallel to the secondary pump (reverse direction)" + "Charging valve, open when tank is being charged remotely" annotation (Placement(transformation(extent={{40,-30},{20,-10}}))); Buildings.Fluid.Storage.Plant.BaseClasses.FluidPassThrough pasValDis( redeclare package Medium = Medium) if not allowRemoteCharging From edc2191d92303831032d6376eaaae9772faa48e9 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Mon, 11 Apr 2022 13:38:29 -0700 Subject: [PATCH 079/463] icon adjustments --- .../Examples/BaseClasses/ChillerBranch.mo | 13 +++++---- .../Storage/Plant/SupplyPumpClosedTank.mo | 27 +++++++++---------- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/ChillerBranch.mo b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/ChillerBranch.mo index cf3498a39fc..c1b60787813 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/ChillerBranch.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/ChillerBranch.mo @@ -137,22 +137,21 @@ equation lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), - Ellipse(extent={{-20,20},{20,-20}}, lineColor={28,108,200}, + Ellipse(extent={{-20,20},{20,-20}}, lineColor={0,0,0}, origin={40,-60}, rotation=90), - Polygon(points={{-16,16},{-16,-16},{16,0},{-16,16}}, lineColor={28,108, - 200}, + Polygon(points={{-16,16},{-16,-16},{16,0},{-16,16}}, lineColor={0,0,0}, origin={36,-60}, rotation=180), - Line(points={{-20,-20},{-20,20},{20,-20},{20,20}}, color={28,108,200}, + Line(points={{-20,-20},{-20,20},{20,-20},{20,20}}, color={0,0,0}, rotation=90), Line(points={{-20,0},{20,0}}, color={28,108,200}, origin={-30,0}, rotation=90), - Ellipse(extent={{-20,20},{20,-20}},lineColor={28,108,200}, + Ellipse(extent={{-20,20},{20,-20}},lineColor={0,0,0}, origin={40,60}, rotation=90), - Line(points={{64,35},{56,5}}, color={28,108,200}, + Line(points={{64,35},{56,5}}, color={0,0,0}, origin={63,12}, rotation=90), Text( @@ -173,7 +172,7 @@ equation fillColor={28,108,200}, fillPattern=FillPattern.Solid), Line(points={{-35,-64},{-5,-56}}, - color={28,108,200}, + color={0,0,0}, origin={63,108}, rotation=0), Line( diff --git a/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo b/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo index 330f5c64936..3a699d67cb1 100644 --- a/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo +++ b/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo @@ -61,7 +61,7 @@ model SupplyPumpClosedTank origin={-40,110}), iconTransformation( extent={{10,-10},{-10,10}}, rotation=270, - origin={-60,110}))); + origin={-40,110}))); Modelica.Blocks.Interfaces.RealOutput yValDis_actual if allowRemoteCharging "Actual valve position" annotation (Placement( @@ -71,7 +71,7 @@ model SupplyPumpClosedTank origin={-80,110}), iconTransformation( extent={{10,-10},{-10,10}}, rotation=270, - origin={-100,110}))); + origin={-80,110}))); Modelica.Blocks.Interfaces.RealInput yValCha if allowRemoteCharging "Valve position input" annotation (Placement(transformation(extent={{10,10}, {-10,-10}}, @@ -122,8 +122,9 @@ equation {-80,-20},{20,-20}}, color={0,127,255})); connect(valCha.port_a, port_CHWS) annotation (Line(points={{40,-20},{80,-20},{ 80,60},{100,60}}, color={0,127,255})); - connect(pasValDis.port_b, port_CHWS) annotation (Line(points={{40,20},{80,20}, - {80,60},{100,60}}, color={0,127,255})); + connect(pasValDis.port_b, port_CHWS) annotation (Line(points={{38.1818,20},{ + 80,20},{80,60},{100,60}}, + color={0,127,255})); connect(valDis.port_b, port_CHWS) annotation (Line(points={{40,60},{100,60}}, color={0,127,255})); connect(port_chiInl, port_CHWR) @@ -149,40 +150,38 @@ equation Line(points={{-100,-60},{100,-60}}, color={28,108,200}), Ellipse( extent={{-60,80},{-20,40}}, - lineColor={28,108,200}, + lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), Polygon( points={{40,60},{20,70},{20,50},{40,60}}, - lineColor={28,108,200}, + lineColor={0,0,0}, fillColor={255,255,255}, - fillPattern=FillPattern.Solid, - visible=allowRemoteCharging), + fillPattern=FillPattern.Solid), Polygon( points={{40,60},{60,70},{60,50},{40,60}}, - lineColor={28,108,200}, + lineColor={0,0,0}, fillColor={255,255,255}, - fillPattern=FillPattern.Solid, - visible=allowRemoteCharging), + fillPattern=FillPattern.Solid), Line( points={{80,60},{80,20},{-80,20},{-80,60}}, color={28,108,200}, visible=allowRemoteCharging), Polygon( points={{40,20},{20,30},{20,10},{40,20}}, - lineColor={28,108,200}, + lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid, visible=allowRemoteCharging), Polygon( points={{40,20},{60,30},{60,10},{40,20}}, - lineColor={28,108,200}, + lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid, visible=allowRemoteCharging), Polygon( points={{-20,60},{-50,76},{-50,44},{-20,60}}, - lineColor={28,108,200}, + lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.None)}), Diagram( coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}})), From 12aea2ec1935f6d2badc7032920dc887304e59b6 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Mon, 11 Apr 2022 15:41:58 -0700 Subject: [PATCH 080/463] refactored model to prepare for open tank model --- .../BaseClasses/ReversiblePumpValveControl.mo | 167 +++++++++++------- .../Storage/Plant/BaseClasses/package.order | 2 +- .../Plant/Examples/TwoSourcesThreeUsers.mo | 8 +- .../Storage/Plant/SupplyPumpClosedTank.mo | 5 +- .../BaseClasses/PartialClosedTank.mo | 40 +++++ .../{PartialTankBranch.mo => PartialPlant.mo} | 28 +-- .../Validation/BaseClasses/package.order | 3 +- ...rging.mo => ClosedTankNoRemoteCharging.mo} | 8 +- ...ing.mo => ClosedTankWithRemoteCharging.mo} | 25 +-- .../Storage/Plant/Validation/package.order | 4 +- ...Validation_ClosedTankNoRemoteCharging.txt} | 0 ...lidation_ClosedTankWithRemoteCharging.txt} | 0 ...ing.mos => ClosedTankNoRemoteCharging.mos} | 4 +- ...g.mos => ClosedTankWithRemoteCharging.mos} | 4 +- ...Validation.ClosedTankNoRemoteCharging.mos} | 0 ...lidation.ClosedTankWithRemoteCharging.mos} | 0 16 files changed, 186 insertions(+), 112 deletions(-) create mode 100644 Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialClosedTank.mo rename Buildings/Fluid/Storage/Plant/Validation/BaseClasses/{PartialTankBranch.mo => PartialPlant.mo} (70%) rename Buildings/Fluid/Storage/Plant/Validation/{NoRemoteCharging.mo => ClosedTankNoRemoteCharging.mo} (92%) rename Buildings/Fluid/Storage/Plant/Validation/{WithRemoteCharging.mo => ClosedTankWithRemoteCharging.mo} (85%) rename Buildings/Resources/ReferenceResults/Dymola/{Buildings_Fluid_Storage_Plant_Validation_NoRemoteCharging.txt => Buildings_Fluid_Storage_Plant_Validation_ClosedTankNoRemoteCharging.txt} (100%) rename Buildings/Resources/ReferenceResults/Dymola/{Buildings_Fluid_Storage_Plant_Validation_WithRemoteCharging.txt => Buildings_Fluid_Storage_Plant_Validation_ClosedTankWithRemoteCharging.txt} (100%) rename Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/{NoRemoteCharging.mos => ClosedTankNoRemoteCharging.mos} (72%) rename Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/{WithRemoteCharging.mos => ClosedTankWithRemoteCharging.mos} (71%) rename Buildings/Resources/Scripts/OpenModelica/compareVars/{Buildings.Fluid.Storage.Plant.Validation.NoRemoteCharging.mos => Buildings.Fluid.Storage.Plant.Validation.ClosedTankNoRemoteCharging.mos} (100%) rename Buildings/Resources/Scripts/OpenModelica/compareVars/{Buildings.Fluid.Storage.Plant.Validation.WithRemoteCharging.mos => Buildings.Fluid.Storage.Plant.Validation.ClosedTankWithRemoteCharging.mos} (100%) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo index e4f05a88201..d7e3c76d0d1 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo @@ -3,28 +3,33 @@ block ReversiblePumpValveControl "Control block for the secondary pump-valve group" extends Modelica.Blocks.Icons.Block; + parameter Boolean tankIsOpen = false "Tank is open"; + Modelica.Blocks.Sources.Constant zero(k=0) "Constant 0" - annotation (Placement(transformation(extent={{-100,-120},{-80,-100}}))); - Buildings.Controls.Continuous.LimPID conPI_pumSec( + annotation (Placement(transformation(extent={{-100,-100},{-80,-80}}))); + Buildings.Controls.Continuous.LimPID conPI_pumSecNor( controllerType=Modelica.Blocks.Types.SimpleController.PI, k=5, - Ti=50) "PI controller" annotation (Placement(transformation( + Ti=50, + reverseActing=false) "Normal-acting PI controller" annotation (Placement( + transformation( extent={{-10,10},{10,-10}}, - rotation=0, - origin={-70,30}))); + rotation=-90, + origin={-30,30}))); Buildings.Controls.Continuous.LimPID conPI_valCha( controllerType=Modelica.Blocks.Types.SimpleController.PI, k=5, Ti=50, - reverseActing=false) "PI controller" annotation (Placement(transformation( + reverseActing=false) if not tankIsOpen + "PI controller" annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=0, - origin={-10,30}))); + origin={-10,90}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uRemCha "Tank is being charged remotely" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, - origin={110,40}), iconTransformation(extent={{20,-20},{ + origin={130,40}), iconTransformation(extent={{20,-20},{ -20,20}}, rotation=0, origin={120,80}))); @@ -32,7 +37,7 @@ block ReversiblePumpValveControl "Tank mass flow rate setpoint" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-110,80}), iconTransformation( + origin={-130,90}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-110,80}))); @@ -40,7 +45,7 @@ block ReversiblePumpValveControl annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-110,60}),iconTransformation( + origin={-130,70}),iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-110,40}))); @@ -48,7 +53,7 @@ block ReversiblePumpValveControl "= true if plant is online (not cut off from the network by valve)" annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=180, - origin={110,-40}), + origin={130,-40}), iconTransformation(extent={{20,-20},{-20,20}}, rotation=0, origin={120,40}))); @@ -64,7 +69,7 @@ block ReversiblePumpValveControl Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={10,-170}), iconTransformation( + origin={30,-170}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={40,-110}))); @@ -72,7 +77,7 @@ block ReversiblePumpValveControl Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={70,-170}), iconTransformation( + origin={90,-170}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={80,-110}))); @@ -80,7 +85,7 @@ block ReversiblePumpValveControl annotation (Placement(transformation( extent={{10,-10},{-10,10}}, rotation=180, - origin={-110,-10}), + origin={-130,-10}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, @@ -89,17 +94,16 @@ block ReversiblePumpValveControl annotation (Placement(transformation( extent={{10,-10},{-10,10}}, rotation=180, - origin={-110,-50}), + origin={-130,-50}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-110,0}))); Buildings.Controls.OBC.CDL.Continuous.LessThreshold isValDisClo(t=0.05) "= true if valve closed" - annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}))); - Buildings.Controls.OBC.CDL.Continuous.Switch swiPumPri - "True = on (y>0); false = off (y=0)." annotation (Placement( - transformation( + annotation (Placement(transformation(extent={{-20,-60},{0,-40}}))); + Buildings.Controls.OBC.CDL.Continuous.Switch swiPum + "True = on (y>0); false = off (y=0)." annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={-50,-130}))); @@ -108,7 +112,7 @@ block ReversiblePumpValveControl annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={70,-130}))); + origin={90,-130}))); Buildings.Controls.OBC.CDL.Continuous.Switch swiValCha "True = on (y>0); false = off (y=0)." annotation (Placement( transformation( @@ -121,76 +125,115 @@ block ReversiblePumpValveControl transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={70,-70}))); + origin={90,-70}))); Buildings.Controls.OBC.CDL.Continuous.LessThreshold isValChaClo(t=0.05) "= true if valve closed" - annotation (Placement(transformation(extent={{-80,-20},{-60,0}}))); + annotation (Placement(transformation(extent={{40,-20},{60,0}}))); Buildings.Controls.OBC.CDL.Logical.Not notRemCha "Tank is not being charged remotely" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={70,10}))); + origin={90,10}))); Buildings.Controls.OBC.CDL.Logical.And andValCha "Charging remotely AND valDis closed" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={10,-70}))); + origin={30,-70}))); + Controls.OBC.CDL.Conversions.BooleanToReal booToReaValCha if tankIsOpen + "True = 1, false = 0" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={50,-130}))); + Controls.Continuous.LimPID conPI_pumSecRev( + controllerType=Modelica.Blocks.Types.SimpleController.PI, + k=5, + Ti=50, + reverseActing=true) "Reverse-acting PI controller" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-70,30}))); + Controls.OBC.CDL.Continuous.Switch swiPumPri1 + "True = mTanSet_flow > 0, reverse acting; false = mTanSet_flow < 0, normal acting" + annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-50,-70}))); + Controls.OBC.CDL.Continuous.LessThreshold isPos(t=0) + "= true if mTanSet_flow > 0" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-50,-30}))); equation - connect(conPI_pumSec.u_s,mTanSet_flow) - annotation (Line(points={{-82,30},{-88,30},{-88,80},{-110,80}}, - color={0,0,127})); - connect(conPI_valCha.u_s,mTanSet_flow) annotation (Line(points={{-22,30},{ - -34,30},{-34,80},{-110,80}}, - color={0,0,127})); + connect(conPI_pumSecNor.u_m, mTan_flow) annotation (Line(points={{-18,30},{-10, + 30},{-10,70},{-130,70}}, color={0,0,127})); + connect(conPI_pumSecNor.u_s, mTanSet_flow) + annotation (Line(points={{-30,42},{-30,90},{-130,90}}, color={0,0,127})); + connect(conPI_valCha.u_s,mTanSet_flow) annotation (Line(points={{-22,90},{-130, + 90}}, color={0,0,127})); connect(conPI_valCha.u_m, mTan_flow) - annotation (Line(points={{-10,42},{-10,60},{-110,60}}, + annotation (Line(points={{-10,102},{-10,110},{-90,110},{-90,70},{-130,70}}, color={0,0,127})); - connect(conPI_pumSec.u_m, mTan_flow) annotation (Line(points={{-70,42},{-70, - 60},{-110,60}}, color={0,0,127})); connect(yValDis, yValDis) - annotation (Line(points={{70,-170},{70,-170}}, color={0,0,127})); - connect(swiPumPri.y, yPum) + annotation (Line(points={{90,-170},{90,-170}}, color={0,0,127})); + connect(swiPum.y, yPum) annotation (Line(points={{-50,-142},{-50,-170}}, color={0,0,127})); - connect(zero.y, swiPumPri.u3) annotation (Line(points={{-79,-110},{-58,-110},{ - -58,-118}}, color={0,0,127})); + connect(zero.y, swiPum.u3) annotation (Line(points={{-79,-90},{-58,-90},{-58,-118}}, + color={0,0,127})); connect(swiValCha.y, yValCha) - annotation (Line(points={{10,-142},{10,-170}}, color={0,0,127})); - connect(zero.y, swiValCha.u3) annotation (Line(points={{-79,-110},{2,-110},{2, - -118}}, color={0,0,127})); + annotation (Line(points={{10,-142},{10,-154},{30,-154},{30,-170}}, + color={0,0,127})); + connect(zero.y, swiValCha.u3) annotation (Line(points={{-79,-90},{2,-90},{2,-118}}, + color={0,0,127})); connect(isValChaClo.u, yValCha_actual) - annotation (Line(points={{-82,-10},{-110,-10}}, + annotation (Line(points={{38,-10},{-130,-10}}, color={0,0,127})); connect(isValDisClo.u, yValDis_actual) - annotation (Line(points={{-82,-50},{-110,-50}}, + annotation (Line(points={{-22,-50},{-130,-50}}, color={0,0,127})); - connect(isValDisClo.y, andValCha.u2) annotation (Line(points={{-58,-50},{2, - -50},{2,-58}}, color={255,0,255})); - connect(andValCha.y, swiValCha.u2) annotation (Line(points={{10,-82},{10,-100}, - {10,-100},{10,-118}},color={255,0,255})); - connect(conPI_pumSec.y, swiPumPri.u1) annotation (Line(points={{-59,30},{-42, - 30},{-42,-118}}, color={0,0,127})); - connect(conPI_valCha.y, swiValCha.u1) annotation (Line(points={{1,30},{30,30}, - {30,-100},{18,-100},{18,-118}}, - color={0,0,127})); - connect(and3.y, swiPumPri.u2) annotation (Line(points={{70,-82},{70,-114},{ - -50,-114},{-50,-118}}, - color={255,0,255})); + connect(isValDisClo.y, andValCha.u2) annotation (Line(points={{2,-50},{22,-50}, + {22,-58}}, color={255,0,255})); + connect(andValCha.y, swiValCha.u2) annotation (Line(points={{30,-82},{30,-110}, + {10,-110},{10,-118}},color={255,0,255})); + connect(conPI_valCha.y, swiValCha.u1) annotation (Line(points={{1,90},{18,90}, + {18,-118}}, color={0,0,127})); + connect(and3.y, swiPum.u2) annotation (Line(points={{90,-82},{90,-100},{-50,-100}, + {-50,-118}}, color={255,0,255})); connect(booToReaValDis.y, yValDis) - annotation (Line(points={{70,-142},{70,-170}}, color={0,0,127})); - connect(and3.y, booToReaValDis.u) annotation (Line(points={{70,-82},{70,-118}}, + annotation (Line(points={{90,-142},{90,-170}}, color={0,0,127})); + connect(and3.y, booToReaValDis.u) annotation (Line(points={{90,-82},{90,-118}}, color={255,0,255})); connect(uRemCha, notRemCha.u) - annotation (Line(points={{110,40},{70,40},{70,22}}, color={255,0,255})); + annotation (Line(points={{130,40},{90,40},{90,22}}, color={255,0,255})); connect(andValCha.u1, uRemCha) - annotation (Line(points={{10,-58},{10,40},{110,40}},color={255,0,255})); + annotation (Line(points={{30,-58},{30,40},{130,40}},color={255,0,255})); connect(and3.u3, isValChaClo.y) - annotation (Line(points={{62,-58},{62,-10},{-58,-10}}, color={255,0,255})); + annotation (Line(points={{82,-58},{82,-10},{62,-10}}, color={255,0,255})); connect(notRemCha.y, and3.u2) - annotation (Line(points={{70,-2},{70,-58}}, color={255,0,255})); + annotation (Line(points={{90,-2},{90,-58}}, color={255,0,255})); connect(and3.u1, uOnl) - annotation (Line(points={{78,-58},{78,-40},{110,-40}}, color={255,0,255})); - annotation (Diagram(coordinateSystem(extent={{-100,-160},{100,100}})), Icon( + annotation (Line(points={{98,-58},{98,-40},{130,-40}}, color={255,0,255})); + connect(booToReaValCha.y, yValCha) annotation (Line(points={{50,-142},{50,-154}, + {30,-154},{30,-170}}, color={0,0,127})); + connect(andValCha.y, booToReaValCha.u) annotation (Line(points={{30,-82},{30,-110}, + {50,-110},{50,-118}}, color={255,0,255})); + connect(conPI_pumSecRev.u_m, mTan_flow) annotation (Line(points={{-82,30},{-90, + 30},{-90,70},{-130,70}}, color={0,0,127})); + connect(conPI_pumSecRev.u_s, mTanSet_flow) + annotation (Line(points={{-70,42},{-70,90},{-130,90}}, color={0,0,127})); + connect(conPI_pumSecNor.y, swiPumPri1.u1) + annotation (Line(points={{-30,19},{-30,-58},{-42,-58}}, color={0,0,127})); + connect(conPI_pumSecRev.y, swiPumPri1.u3) + annotation (Line(points={{-70,19},{-70,-58},{-58,-58}}, color={0,0,127})); + connect(isPos.u, mTanSet_flow) + annotation (Line(points={{-50,-18},{-50,90},{-130,90}}, color={0,0,127})); + connect(swiPumPri1.y, swiPum.u1) annotation (Line(points={{-50,-82},{-50,-96}, + {-42,-96},{-42,-118}}, color={0,0,127})); + connect(isPos.y, swiPumPri1.u2) + annotation (Line(points={{-50,-42},{-50,-58}}, color={255,0,255})); + annotation (Diagram(coordinateSystem(extent={{-120,-160},{120,120}})), Icon( coordinateSystem(extent={{-100,-100},{100,100}})), Documentation(revisions="
      diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/package.order b/Buildings/Fluid/Storage/Plant/BaseClasses/package.order index 369571cbc76..91e3c407f5c 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/package.order +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/package.order @@ -1,4 +1,4 @@ FluidPassThrough -NominalValues PartialBranchPorts ReversiblePumpValveControl +NominalValues diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index 7b03cc75d8b..04284344ecb 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -173,8 +173,8 @@ model TwoSourcesThreeUsers extent={{-10,-10},{10,10}}, rotation=0, origin={-170,-10}))); - Buildings.Fluid.Storage.Plant.BaseClasses.ReversiblePumpValveControl conPumSecGro - "Control block for secondary pump-valve group" + Buildings.Fluid.Storage.Plant.BaseClasses.ReversiblePumpValveControl conPumSecGro( + tankIsOpen=false) "Control block for secondary pump-valve group" annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0, origin={-70,-30}))); @@ -450,9 +450,9 @@ equation connect(tanBra.mTan_flow, conPumSecGro.mTan_flow) annotation (Line(points={{-92,-49},{-92,-26},{-81,-26}}, color={0,0,127})); connect(supPum.yValCha_actual, conPumSecGro.yValCha_actual) annotation (Line( - points={{-76,-49},{-76,-44},{-84,-44},{-84,-34},{-81,-34}}, color={0,0,127})); + points={{-74,-49},{-74,-44},{-84,-44},{-84,-34},{-81,-34}}, color={0,0,127})); connect(supPum.yValDis_actual, conPumSecGro.yValDis_actual) annotation (Line( - points={{-80,-49},{-80,-48},{-88,-48},{-88,-30},{-81,-30}}, color={0,0,127})); + points={{-78,-49},{-78,-48},{-88,-48},{-88,-30},{-81,-30}}, color={0,0,127})); connect(conPumSecGro.uOnl, or2.y) annotation (Line(points={{-58,-26},{-50,-26}, {-50,-78}}, color={255,0,255})); connect(mTanSet_flow.y, conPumSecGro.mTanSet_flow) annotation (Line(points={{-118, diff --git a/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo b/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo index 3a699d67cb1..105ac83a195 100644 --- a/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo +++ b/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo @@ -122,9 +122,8 @@ equation {-80,-20},{20,-20}}, color={0,127,255})); connect(valCha.port_a, port_CHWS) annotation (Line(points={{40,-20},{80,-20},{ 80,60},{100,60}}, color={0,127,255})); - connect(pasValDis.port_b, port_CHWS) annotation (Line(points={{38.1818,20},{ - 80,20},{80,60},{100,60}}, - color={0,127,255})); + connect(pasValDis.port_b, port_CHWS) annotation (Line(points={{40,20},{80,20}, + {80,60},{100,60}}, color={0,127,255})); connect(valDis.port_b, port_CHWS) annotation (Line(points={{40,60},{100,60}}, color={0,127,255})); connect(port_chiInl, port_CHWR) diff --git a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialClosedTank.mo b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialClosedTank.mo new file mode 100644 index 00000000000..6c831f1e92f --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialClosedTank.mo @@ -0,0 +1,40 @@ +within Buildings.Fluid.Storage.Plant.Validation.BaseClasses; +partial model PartialClosedTank "(Draft)" + + extends Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialPlant(sin( + nPorts=1), sou(nPorts=1)); + + Buildings.Fluid.Storage.Plant.SupplyPumpClosedTank supPum(redeclare final + package Medium = Medium, final nom=nom) "Supply pump and valves" + annotation (Placement(transformation(extent={{10,-10},{30,10}}))); + +equation + + connect(mSinChi_flow.y, sinChi.m_flow_in) + annotation (Line(points={{-79,0},{-70,0},{-70,-22},{-62,-22}}, + color={0,0,127})); + connect(tanBra.port_CHWS, supPum.port_chiOut) + annotation (Line(points={{-10,6},{10,6}}, color={0,127,255})); + connect(tanBra.port_CHWR, supPum.port_chiInl) + annotation (Line(points={{-10,-6},{10,-6}}, color={0,127,255})); + connect(supPum.port_CHWS, sin.ports[1]) annotation (Line(points={{30,6},{34,6}, + {34,30},{40,30}}, color={0,127,255})); + connect(supPum.port_CHWR, sou.ports[1]) annotation (Line(points={{30,-6},{34, + -6},{34,-30},{40,-30}}, color={0,127,255})); + annotation ( + Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), + Icon(coordinateSystem(extent={{-100,-100},{100,100}})), + Documentation(info=" +

      +Documentation pending. +

      +", revisions=" +
        +
      • +March 15, 2022 by Hongxiang Fu:
        +First implementation. This is for +#2859. +
      • +
      +")); +end PartialClosedTank; diff --git a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialTankBranch.mo b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo similarity index 70% rename from Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialTankBranch.mo rename to Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo index 84998bf5634..fe73d70f62e 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialTankBranch.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo @@ -1,5 +1,5 @@ within Buildings.Fluid.Storage.Plant.Validation.BaseClasses; -partial model PartialTankBranch "(Draft)" +partial model PartialPlant "(Draft)" package Medium = Buildings.Media.Water "Medium model"; @@ -11,9 +11,6 @@ partial model PartialTankBranch "(Draft)" T_CHWR_nominal=285.15) "Nominal values" annotation (Placement(transformation(extent={{60,60},{80,80}}))); - Buildings.Fluid.Storage.Plant.SupplyPumpClosedTank supPum(redeclare final - package Medium = Medium, final nom=nom) "Supply pump and valves" - annotation (Placement(transformation(extent={{10,-10},{30,10}}))); Buildings.Fluid.Storage.Plant.TankBranch tanBra( redeclare final package Medium = Medium, final nom=nom, @@ -22,8 +19,7 @@ partial model PartialTankBranch "(Draft)" Buildings.Fluid.Sources.Boundary_pT sou( redeclare final package Medium = Medium, final p=300000, - final T=nom.T_CHWR_nominal, - nPorts=1) + final T=nom.T_CHWR_nominal) "Source representing CHW return line" annotation (Placement(transformation( extent={{10,-10},{-10,10}}, @@ -32,8 +28,8 @@ partial model PartialTankBranch "(Draft)" Buildings.Fluid.Sources.Boundary_pT sin( redeclare final package Medium = Medium, final p=300000+nom.dp_nominal, - final T=nom.T_CHWS_nominal, - nPorts=1) "Sink representing CHW supply line" + final T=nom.T_CHWS_nominal) + "Sink representing CHW supply line" annotation (Placement(transformation( extent={{10,-10},{-10,10}}, rotation=0, @@ -64,18 +60,10 @@ equation connect(mSinChi_flow.y, sinChi.m_flow_in) annotation (Line(points={{-79,0},{-70,0},{-70,-22},{-62,-22}}, color={0,0,127})); - connect(sinChi.ports[1], tanBra.port_chiInl) annotation (Line(points={{-40,-30}, - {-32,-30},{-32,-6},{-30,-6}}, color={0,127,255})); connect(souChi.ports[1], tanBra.port_chiOut) annotation (Line(points={{-40,30}, - {-32,30},{-32,6},{-30,6}}, color={0,127,255})); - connect(sou.ports[1], supPum.port_CHWR) annotation (Line(points={{40,-30},{32, - -30},{32,-6},{30,-6}}, color={0,127,255})); - connect(sin.ports[1], supPum.port_CHWS) annotation (Line(points={{40,30},{32,30}, - {32,6},{30,6}}, color={0,127,255})); - connect(tanBra.port_CHWR, supPum.port_chiInl) - annotation (Line(points={{-10,-6},{10,-6}}, color={0,127,255})); - connect(supPum.port_chiOut, tanBra.port_CHWS) - annotation (Line(points={{10,6},{-10,6}}, color={0,127,255})); + {-34,30},{-34,6},{-30,6}}, color={0,127,255})); + connect(tanBra.port_chiInl, sinChi.ports[1]) annotation (Line(points={{-30,-6}, + {-34,-6},{-34,-30},{-40,-30}}, color={0,127,255})); annotation ( Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), Icon(coordinateSystem(extent={{-100,-100},{100,100}})), @@ -92,4 +80,4 @@ First implementation. This is for
    ")); -end PartialTankBranch; +end PartialPlant; diff --git a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/package.order b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/package.order index 3d1a76431ec..63b0b48c500 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/package.order +++ b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/package.order @@ -1 +1,2 @@ -PartialTankBranch +PartialClosedTank +PartialPlant diff --git a/Buildings/Fluid/Storage/Plant/Validation/NoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mo similarity index 92% rename from Buildings/Fluid/Storage/Plant/Validation/NoRemoteCharging.mo rename to Buildings/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mo index d3ad9523eaa..630ecf2207f 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/NoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mo @@ -1,9 +1,9 @@ within Buildings.Fluid.Storage.Plant.Validation; -model NoRemoteCharging +model ClosedTankNoRemoteCharging "(Draft) Validation model of the plant not allowing remote charging" extends Modelica.Icons.Example; extends - Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialTankBranch( + Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialClosedTank( souChi(final m_flow=nom.mChi_flow_nominal), supPum(final allowRemoteCharging=false)); @@ -32,7 +32,7 @@ equation 14},{-10,18}}, color={0,0,127})); connect(supPum.yPum, conPID_PumSec.y) annotation (Line(points={{20,11},{20,70},{1,70}}, color={0,0,127})); - annotation (__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/NoRemoteCharging.mos" + annotation (__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mos" "Simulate and plot"), experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), @@ -51,4 +51,4 @@ First implementation. This is for
")); -end NoRemoteCharging; +end ClosedTankNoRemoteCharging; diff --git a/Buildings/Fluid/Storage/Plant/Validation/WithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo similarity index 85% rename from Buildings/Fluid/Storage/Plant/Validation/WithRemoteCharging.mo rename to Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo index 4eac9f8ed6f..b5baa22cfba 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/WithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo @@ -1,9 +1,9 @@ within Buildings.Fluid.Storage.Plant.Validation; -model WithRemoteCharging +model ClosedTankWithRemoteCharging "(Draft) Validation model of the plant allowing remote charging" extends Modelica.Icons.Example; extends - Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialTankBranch( + Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialClosedTank( souChi(final use_m_flow_in=true), supPum(final allowRemoteCharging=true)); @@ -22,7 +22,8 @@ model WithRemoteCharging 1; 3600/7*5,1; 3600/7*5,0]) "Chiller flow rate setpoint" annotation (Placement(transformation(extent={{-100,20},{-80,40}}))); Buildings.Fluid.Storage.Plant.BaseClasses.ReversiblePumpValveControl - conPumSec "Control block for the secondary pump and near-by valves" + conPumSec(tankIsOpen=false) + "Control block for the secondary pump and near-by valves" annotation (Placement(transformation(extent={{10,40},{30,60}}))); equation connect(set_mChi_flow.y, souChi.m_flow_in) @@ -33,24 +34,26 @@ equation connect(tanBra.mTan_flow, conPumSec.mTan_flow) annotation (Line(points={{-12,11},{-12,54},{9,54}}, color={0,0,127})); connect(supPum.yValCha_actual, conPumSec.yValCha_actual) annotation (Line( - points={{14,11},{14,36},{4,36},{4,46},{9,46}}, color={0,0,127})); + points={{16,11},{16,36},{4,36},{4,46},{9,46}}, color={0,0,127})); connect(supPum.yValDis_actual, conPumSec.yValDis_actual) annotation (Line( - points={{10,11},{10,34},{2,34},{2,50},{9,50}}, color={0,0,127})); - connect(conPumSec.uOnl, uOnl.y) annotation (Line(points={{32,54},{74,54},{74, - 50},{79,50}}, color={255,0,255})); + points={{12,11},{12,34},{2,34},{2,50},{9,50}}, color={0,0,127})); + connect(conPumSec.uOnl, uOnl.y) annotation (Line(points={{32,54},{74,54},{74,50}, + {79,50}}, color={255,0,255})); connect(conPumSec.uRemCha, uRemCha.y) annotation (Line(points={{32,58},{32,90},{79,90}}, color={255,0,255})); connect(conPumSec.yPum, supPum.yPum) annotation (Line(points={{20,39},{20,11}}, color={0,0,127})); connect(conPumSec.yValCha, supPum.yValCha) - annotation (Line(points={{24,39},{24,11}}, color={0,0,127})); + annotation (Line(points={{24,39},{24,28},{24,28},{24,11}}, + color={0,0,127})); connect(conPumSec.yValDis, supPum.yValDis) - annotation (Line(points={{28,39},{28,11}}, color={0,0,127})); + annotation (Line(points={{28,39},{28,28},{28,28},{28,11}}, + color={0,0,127})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), Icon(coordinateSystem(extent={{-100,-100},{100,100}})), - __Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/WithRemoteCharging.mos" + __Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mos" "Simulate and plot"), Documentation(info="

@@ -138,4 +141,4 @@ First implementation. This is for ")); -end WithRemoteCharging; +end ClosedTankWithRemoteCharging; diff --git a/Buildings/Fluid/Storage/Plant/Validation/package.order b/Buildings/Fluid/Storage/Plant/Validation/package.order index c7f0b547ae0..b5244a92468 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/package.order +++ b/Buildings/Fluid/Storage/Plant/Validation/package.order @@ -1,3 +1,3 @@ -NoRemoteCharging -WithRemoteCharging +ClosedTankNoRemoteCharging +ClosedTankWithRemoteCharging BaseClasses diff --git a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_NoRemoteCharging.txt b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ClosedTankNoRemoteCharging.txt similarity index 100% rename from Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_NoRemoteCharging.txt rename to Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ClosedTankNoRemoteCharging.txt diff --git a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_WithRemoteCharging.txt b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ClosedTankWithRemoteCharging.txt similarity index 100% rename from Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_WithRemoteCharging.txt rename to Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ClosedTankWithRemoteCharging.txt diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/NoRemoteCharging.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mos similarity index 72% rename from Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/NoRemoteCharging.mos rename to Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mos index cb9aadda472..6886ab932f7 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/NoRemoteCharging.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mos @@ -1,8 +1,8 @@ -simulateModel("Buildings.Fluid.Storage.Plant.Validation.NoRemoteCharging", +simulateModel("Buildings.Fluid.Storage.Plant.Validation.ClosedTankNoRemoteCharging", stopTime=3600, tolerance=1e-06, method="dassl", - resultFile="NoRemoteCharging"); + resultFile="ClosedTankNoRemoteCharging"); // Plot commands createPlot(id=1, position={15, 15, 961, 426}, diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/WithRemoteCharging.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mos similarity index 71% rename from Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/WithRemoteCharging.mos rename to Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mos index d8eb43cb6e4..330dd2fc09a 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/WithRemoteCharging.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mos @@ -1,8 +1,8 @@ -simulateModel("Buildings.Fluid.Storage.Plant.Validation.WithRemoteCharging", +simulateModel("Buildings.Fluid.Storage.Plant.Validation.ClosedTankWithRemoteCharging", stopTime=3600, tolerance=1e-06, method="dassl", - resultFile="WithRemoteCharging"); + resultFile="ClosedTankWithRemoteCharging"); // Plot commands createPlot(id=1, position={15, 15, 929, 372}, diff --git a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.NoRemoteCharging.mos b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ClosedTankNoRemoteCharging.mos similarity index 100% rename from Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.NoRemoteCharging.mos rename to Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ClosedTankNoRemoteCharging.mos diff --git a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.WithRemoteCharging.mos b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ClosedTankWithRemoteCharging.mos similarity index 100% rename from Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.WithRemoteCharging.mos rename to Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ClosedTankWithRemoteCharging.mos From ac7c09dfb3070481d9bef644c37147133f4a5222 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Mon, 11 Apr 2022 16:20:02 -0700 Subject: [PATCH 081/463] draft OpenTank model --- .../BaseClasses/ReversiblePumpValveControl.mo | 2 +- .../Fluid/Storage/Plant/SupplyPumpOpenTank.mo | 321 ++++++++++++++++++ .../BaseClasses/PartialClosedTank.mo | 8 +- .../Validation/BaseClasses/PartialOpenTank.mo | 38 +++ .../Validation/BaseClasses/PartialPlant.mo | 2 + .../Validation/BaseClasses/package.order | 1 + .../Storage/Plant/Validation/OpenTank.mo | 66 ++++ .../Storage/Plant/Validation/package.order | 1 + Buildings/Fluid/Storage/Plant/package.order | 1 + .../Storage/Plant/Validation/OpenTank.mos | 14 + 10 files changed, 449 insertions(+), 5 deletions(-) create mode 100644 Buildings/Fluid/Storage/Plant/SupplyPumpOpenTank.mo create mode 100644 Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialOpenTank.mo create mode 100644 Buildings/Fluid/Storage/Plant/Validation/OpenTank.mo create mode 100644 Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/OpenTank.mos diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo index d7e3c76d0d1..c0f6a2db049 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo @@ -113,7 +113,7 @@ block ReversiblePumpValveControl extent={{-10,-10},{10,10}}, rotation=-90, origin={90,-130}))); - Buildings.Controls.OBC.CDL.Continuous.Switch swiValCha + Buildings.Controls.OBC.CDL.Continuous.Switch swiValCha if not tankIsOpen "True = on (y>0); false = off (y=0)." annotation (Placement( transformation( extent={{-10,-10},{10,10}}, diff --git a/Buildings/Fluid/Storage/Plant/SupplyPumpOpenTank.mo b/Buildings/Fluid/Storage/Plant/SupplyPumpOpenTank.mo new file mode 100644 index 00000000000..9b28f999f20 --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/SupplyPumpOpenTank.mo @@ -0,0 +1,321 @@ +within Buildings.Fluid.Storage.Plant; +model SupplyPumpOpenTank + "(Draft) Model section with supply pump and valves for an open tank" + + extends Buildings.Fluid.Storage.Plant.BaseClasses.PartialBranchPorts; + +/* parameter Boolean allowRemoteCharging = true + "= true if the tank is allowed to be charged by a remote source";*/ + + Buildings.Fluid.Movers.SpeedControlled_y pum( + redeclare package Medium = Medium, + per(pressure(dp=nom.dp_nominal*{2,1.2,0}, V_flow=(nom.m_flow_nominal)/1.2*{0, + 1.2,2})), + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + allowFlowReversal=true, + addPowerToMedium=false, + y_start=0, + T_start=nom.T_CHWR_nominal) "Secondary CHW pump" annotation (Placement( + transformation( + extent={{-30,-10},{-10,10}}, + rotation=0))); + Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valDis1( + redeclare package Medium = Medium, + dpValve_nominal=0.1*nom.dp_nominal, + use_inputFilter=true, + y_start=0, + l=1E-5, + m_flow_nominal=nom.m_flow_nominal) + "Discharging valve, open when the tank NOT being charged remotely" + annotation (Placement(transformation(extent={{10,-70},{-10,-50}}))); + Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valCha1( + redeclare package Medium = Medium, + dpValve_nominal=0.1*nom.dp_nominal, + use_inputFilter=true, + y_start=0, + l=1E-5, + m_flow_nominal=nom.m_flow_nominal) + "Charging valve, open when the tank is being charged remotely" + annotation (Placement(transformation(extent={{10,50},{-10,70}}))); + Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valDis2( + redeclare package Medium = Medium, + dpValve_nominal=0.1*nom.dp_nominal, + use_inputFilter=true, + y_start=0, + l=1E-5, + m_flow_nominal=nom.m_flow_nominal) + "Discharging valve, open when the tank NOT being charged remotely" + annotation (Placement(transformation( + extent={{-10,10},{10,-10}}, + rotation=-90, + origin={-40,20}))); + Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valDis3( + redeclare package Medium = Medium, + dpValve_nominal=0.1*nom.dp_nominal, + use_inputFilter=true, + y_start=0, + l=1E-5, + m_flow_nominal=nom.m_flow_nominal) + "Discharging valve, open when the tank NOT being charged remotely" + annotation (Placement(transformation( + extent={{-10,10},{10,-10}}, + rotation=90, + origin={40,20}))); + Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valCha2( + redeclare package Medium = Medium, + dpValve_nominal=0.1*nom.dp_nominal, + use_inputFilter=true, + y_start=0, + l=1E-5, + m_flow_nominal=nom.m_flow_nominal) + "Charging valve, open when the tank is being charged remotely" annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={-40,-20}))); + Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valCha3( + redeclare package Medium = Medium, + dpValve_nominal=0.1*nom.dp_nominal, + use_inputFilter=true, + y_start=0, + l=1E-5, + m_flow_nominal=nom.m_flow_nominal) + "Charging valve, open when the tank is being charged remotely" annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={40,-20}))); + FixedResistances.CheckValve cheVal( + redeclare package Medium = Medium, + m_flow_nominal=nom.m_flow_nominal, + dpValve_nominal=0.1*nom.dp_nominal, + dpFixed_nominal=0.1*nom.dp_nominal) "Check valve" annotation (Placement( + transformation( + extent={{10,-10},{-10,10}}, + rotation=180, + origin={20,0}))); + Modelica.Blocks.Interfaces.RealOutput yValDis_actual + "Actual valve position" + annotation (Placement( + transformation( + extent={{10,-10},{-10,10}}, + rotation=270, + origin={-80,150}), iconTransformation( + extent={{10,-10},{-10,10}}, + rotation=270, + origin={-80,110}))); + Modelica.Blocks.Interfaces.RealOutput yValCha_actual + "Actual valve position" + annotation (Placement( + transformation( + extent={{10,-10},{-10,10}}, + rotation=270, + origin={-40,150}), iconTransformation( + extent={{10,-10},{-10,10}}, + rotation=270, + origin={-40,110}))); + Modelica.Blocks.Interfaces.RealInput yPum "Secondary pump speed input" + annotation (Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=90, + origin={0,150}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={0,110}))); + Modelica.Blocks.Interfaces.RealInput yValCha + "Valve position input" annotation (Placement(transformation(extent={{10,10}, + {-10,-10}}, + rotation=90, + origin={40,150}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={40,110}))); + Modelica.Blocks.Interfaces.RealInput yValDis + "Valve position input" annotation (Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=90, + origin={80,150}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={80,110}))); + Controls.OBC.CDL.Continuous.MultiMax mulMaxDis(nin=3) + "Maximum valve position of discharging valves" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={-80,110}))); + Controls.OBC.CDL.Continuous.MultiMax mulMaxCha(nin=3) + "Maximum valve position of charging valves" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={-40,110}))); +equation + connect(port_chiOut, valCha1.port_b) + annotation (Line(points={{-100,60},{-10,60}}, color={0,127,255})); + connect(valCha1.port_a, port_CHWS) + annotation (Line(points={{10,60},{100,60}}, color={0,127,255})); + connect(port_CHWR, valDis1.port_a) + annotation (Line(points={{100,-60},{10,-60}}, color={0,127,255})); + connect(valDis1.port_b, port_chiInl) + annotation (Line(points={{-10,-60},{-100,-60}}, color={0,127,255})); + connect(port_chiInl, valCha2.port_a) annotation (Line(points={{-100,-60},{-40, + -60},{-40,-30}}, color={0,127,255})); + connect(valCha2.port_b, pum.port_a) + annotation (Line(points={{-40,-10},{-40,0},{-30,0}}, color={0,127,255})); + connect(valCha3.port_b, port_CHWR) + annotation (Line(points={{40,-30},{40,-60},{100,-60}}, color={0,127,255})); + connect(port_CHWS, valDis3.port_b) + annotation (Line(points={{100,60},{40,60},{40,30}}, color={0,127,255})); + connect(pum.port_a, valDis2.port_b) + annotation (Line(points={{-30,0},{-40,0},{-40,10}}, color={0,127,255})); + connect(valDis2.port_a, port_chiOut) + annotation (Line(points={{-40,30},{-40,60},{-100,60}}, color={0,127,255})); + connect(pum.port_b, cheVal.port_a) annotation (Line(points={{-10,0},{0,0},{0,1.72085e-15}, + {10,1.72085e-15}}, color={0,127,255})); + connect(cheVal.port_b, valDis3.port_a) annotation (Line(points={{30,-7.21645e-16}, + {40,-7.21645e-16},{40,10}}, color={0,127,255})); + connect(cheVal.port_b, valCha3.port_a) annotation (Line(points={{30,-7.21645e-16}, + {40,-7.21645e-16},{40,-10}}, color={0,127,255})); + connect(pum.y, yPum) annotation (Line(points={{-20,12},{-20,134},{0,134},{0,150}}, + color={0,0,127})); + connect(valCha1.y, yValCha) annotation (Line(points={{0,72},{0,80},{40,80},{40, + 150}}, color={0,0,127})); + connect(valCha3.y, yValCha) annotation (Line(points={{52,-20},{60,-20},{60,80}, + {40,80},{40,150}}, color={0,0,127})); + connect(valCha2.y, yValCha) annotation (Line(points={{-52,-20},{-56,-20},{-56, + -36},{60,-36},{60,80},{40,80},{40,150}}, color={0,0,127})); + connect(valDis2.y, yValDis) annotation (Line(points={{-52,20},{-60,20},{-60,-40}, + {80,-40},{80,150}}, color={0,0,127})); + connect(valDis3.y, yValDis) + annotation (Line(points={{52,20},{80,20},{80,150}}, color={0,0,127})); + connect(valDis1.y, yValDis) annotation (Line(points={{0,-48},{0,-40},{80,-40}, + {80,150}}, color={0,0,127})); + connect(valDis1.y_actual, mulMaxDis.u[1]) annotation (Line(points={{-5,-53},{ + -5,-52},{-79.3333,-52},{-79.3333,98}}, + color={0,0,127})); + connect(valDis3.y_actual, mulMaxDis.u[2]) annotation (Line(points={{47,25},{48, + 25},{48,40},{-80,40},{-80,98}}, color={0,0,127})); + connect(valDis2.y_actual, mulMaxDis.u[3]) annotation (Line(points={{-47,15},{ + -48,15},{-48,12},{-80,12},{-80,98},{-80.6667,98}}, + color={0,0,127})); + connect(mulMaxDis.y, yValDis_actual) + annotation (Line(points={{-80,122},{-80,150}}, color={0,0,127})); + connect(valCha2.y_actual, mulMaxCha.u[1]) annotation (Line(points={{-47,-15}, + {-68,-15},{-68,92},{-39.3333,92},{-39.3333,98}},color={0,0,127})); + connect(valCha1.y_actual, mulMaxCha.u[2]) annotation (Line(points={{-5,67},{-5, + 92},{-40,92},{-40,98}}, color={0,0,127})); + connect(valCha3.y_actual, mulMaxCha.u[3]) annotation (Line(points={{47,-25},{ + 46,-25},{46,-28},{68,-28},{68,92},{-40.6667,92},{-40.6667,98}}, + color={0, + 0,127})); + connect(mulMaxCha.y, yValCha_actual) + annotation (Line(points={{-40,122},{-40,150}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, + {100,100}}), graphics={ + Line(points={{-100,-60},{100,-60}}, color={28,108,200}), + Line(points={{-100,60},{100,60}}, color={28,108,200}), + Line(points={{-60,60},{-60,-60}}, color={28,108,200}), + Line(points={{60,60},{60,-60}}, color={28,108,200}), + Line(points={{-60,0},{60,0}}, color={28,108,200}), + Ellipse( + extent={{-20,20},{20,-20}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{20,0},{-10,16},{-10,-16},{20,0}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.None), + Polygon( + points={{10,0},{-10,10},{-10,-10},{10,0}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + origin={60,-40}, + rotation=90), + Polygon( + points={{-10,0},{10,10},{10,-10},{-10,0}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + origin={60,-20}, + rotation=90), + Polygon( + points={{0,60},{-20,70},{-20,50},{0,60}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{0,60},{20,70},{20,50},{0,60}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{0,-60},{-20,-50},{-20,-70},{0,-60}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{0,-60},{20,-50},{20,-70},{0,-60}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{10,0},{-10,10},{-10,-10},{10,0}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + origin={-60,20}, + rotation=90), + Polygon( + points={{-10,0},{10,10},{10,-10},{-10,0}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + origin={-60,40}, + rotation=90), + Polygon( + points={{10,0},{-10,10},{-10,-10},{10,0}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + origin={-60,-40}, + rotation=90), + Polygon( + points={{-10,0},{10,10},{10,-10},{-10,0}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + origin={-60,-20}, + rotation=90), + Polygon( + points={{10,0},{-10,10},{-10,-10},{10,0}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + origin={60,20}, + rotation=90), + Polygon( + points={{-10,0},{10,10},{10,-10},{-10,0}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + origin={60,40}, + rotation=90)}), Diagram( + coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,140}})), + Documentation(info=" +

+Documentation pending. +

+", revisions=" +
    +
  • +February 18, 2022 by Hongxiang Fu:
    +First implementation. This is for +#2859. +
  • +
+")); +end SupplyPumpOpenTank; diff --git a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialClosedTank.mo b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialClosedTank.mo index 6c831f1e92f..aa53101d3d0 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialClosedTank.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialClosedTank.mo @@ -1,11 +1,11 @@ within Buildings.Fluid.Storage.Plant.Validation.BaseClasses; partial model PartialClosedTank "(Draft)" - extends Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialPlant(sin( - nPorts=1), sou(nPorts=1)); + extends Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialPlant; - Buildings.Fluid.Storage.Plant.SupplyPumpClosedTank supPum(redeclare final - package Medium = Medium, final nom=nom) "Supply pump and valves" + Buildings.Fluid.Storage.Plant.SupplyPumpClosedTank supPum( + redeclare final package Medium = Medium, + final nom=nom) "Supply pump and valves" annotation (Placement(transformation(extent={{10,-10},{30,10}}))); equation diff --git a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialOpenTank.mo b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialOpenTank.mo new file mode 100644 index 00000000000..e6befdfddaa --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialOpenTank.mo @@ -0,0 +1,38 @@ +within Buildings.Fluid.Storage.Plant.Validation.BaseClasses; +partial model PartialOpenTank "(Draft)" + + extends Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialPlant; + + Buildings.Fluid.Storage.Plant.SupplyPumpOpenTank supPum(redeclare final + package Medium = Medium, final nom=nom) "Supply pump and valves" + annotation (Placement(transformation(extent={{10,-10},{30,10}}))); +equation + + connect(mSinChi_flow.y, sinChi.m_flow_in) + annotation (Line(points={{-79,0},{-70,0},{-70,-22},{-62,-22}}, + color={0,0,127})); + connect(tanBra.port_CHWS, supPum.port_chiOut) + annotation (Line(points={{-10,6},{10,6}}, color={0,127,255})); + connect(supPum.port_CHWS, sin.ports[1]) annotation (Line(points={{30,6},{34,6}, + {34,30},{40,30}}, color={0,127,255})); + connect(tanBra.port_CHWR, supPum.port_chiInl) + annotation (Line(points={{-10,-6},{10,-6}}, color={0,127,255})); + connect(supPum.port_CHWR, sou.ports[1]) annotation (Line(points={{30,-6},{34, + -6},{34,-30},{40,-30}}, color={0,127,255})); + annotation ( + Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), + Icon(coordinateSystem(extent={{-100,-100},{100,100}})), + Documentation(info=" +

+Documentation pending. +

+", revisions=" +
    +
  • +March 15, 2022 by Hongxiang Fu:
    +First implementation. This is for +#2859. +
  • +
+")); +end PartialOpenTank; diff --git a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo index fe73d70f62e..4154be67f8a 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo @@ -18,6 +18,7 @@ partial model PartialPlant "(Draft)" annotation (Placement(transformation(extent={{-30,-10},{-10,10}}))); Buildings.Fluid.Sources.Boundary_pT sou( redeclare final package Medium = Medium, + final nPorts=1, final p=300000, final T=nom.T_CHWR_nominal) "Source representing CHW return line" @@ -27,6 +28,7 @@ partial model PartialPlant "(Draft)" origin={50,-30}))); Buildings.Fluid.Sources.Boundary_pT sin( redeclare final package Medium = Medium, + final nPorts=1, final p=300000+nom.dp_nominal, final T=nom.T_CHWS_nominal) "Sink representing CHW supply line" diff --git a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/package.order b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/package.order index 63b0b48c500..01206510d13 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/package.order +++ b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/package.order @@ -1,2 +1,3 @@ PartialClosedTank +PartialOpenTank PartialPlant diff --git a/Buildings/Fluid/Storage/Plant/Validation/OpenTank.mo b/Buildings/Fluid/Storage/Plant/Validation/OpenTank.mo new file mode 100644 index 00000000000..586548fd73e --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/Validation/OpenTank.mo @@ -0,0 +1,66 @@ +within Buildings.Fluid.Storage.Plant.Validation; +model OpenTank "(Draft)" + extends Modelica.Icons.Example; + extends Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialOpenTank( + souChi(final use_m_flow_in=true)); + + Modelica.Blocks.Sources.TimeTable set_mTan_flow(table=[0,0; 3600/7,0; 3600/7, + -1; 3600/7*3,-1; 3600/7*3,0; 3600/7*4,0; 3600/7*4,1; 3600/7*6,1; 3600/7 + *6,-1]) + "Tank flow rate setpoint" + annotation (Placement(transformation(extent={{-100,60},{-80,80}}))); + Modelica.Blocks.Sources.BooleanTable uRemCha(table={0,3600/7*6}, startValue= + true) "Tank is being charged remotely" + annotation (Placement(transformation(extent={{100,80},{80,100}}))); + Modelica.Blocks.Sources.BooleanTable uOnl(table={3600/7*2}) + "True = plant online (outputting CHW to the network); False = offline" + annotation (Placement(transformation(extent={{100,40},{80,60}}))); + Modelica.Blocks.Sources.TimeTable set_mChi_flow(table=[0,0; 3600/7,0; 3600/7, + 1; 3600/7*5,1; 3600/7*5,0]) "Chiller flow rate setpoint" + annotation (Placement(transformation(extent={{-100,20},{-80,40}}))); + Buildings.Fluid.Storage.Plant.BaseClasses.ReversiblePumpValveControl + conPumSec(tankIsOpen=true) + "Control block for the secondary pump and near-by valves" + annotation (Placement(transformation(extent={{10,40},{30,60}}))); +equation + connect(set_mChi_flow.y, souChi.m_flow_in) + annotation (Line(points={{-79,30},{-70,30},{-70,38},{-62,38}}, + color={0,0,127})); + connect(set_mTan_flow.y, conPumSec.mTanSet_flow) + annotation (Line(points={{-79,70},{6,70},{6,58},{9,58}}, color={0,0,127})); + connect(conPumSec.uOnl, uOnl.y) annotation (Line(points={{32,54},{74,54},{74,50}, + {79,50}}, color={255,0,255})); + connect(conPumSec.uRemCha, uRemCha.y) + annotation (Line(points={{32,58},{32,90},{79,90}}, color={255,0,255})); + connect(tanBra.mTan_flow, conPumSec.mTan_flow) + annotation (Line(points={{-12,11},{-12,54},{9,54}}, color={0,0,127})); + connect(supPum.yValDis_actual, conPumSec.yValDis_actual) annotation (Line( + points={{12,11},{12,24},{2,24},{2,50},{9,50}}, color={0,0,127})); + connect(supPum.yValCha_actual, conPumSec.yValCha_actual) annotation (Line( + points={{16,11},{16,34},{6,34},{6,46},{9,46}}, color={0,0,127})); + connect(conPumSec.yPum, supPum.yPum) + annotation (Line(points={{20,39},{20,11}}, color={0,0,127})); + connect(conPumSec.yValCha, supPum.yValCha) + annotation (Line(points={{24,39},{24,11}}, color={0,0,127})); + connect(conPumSec.yValDis, supPum.yValDis) + annotation (Line(points={{28,39},{28,11}}, color={0,0,127})); + annotation ( + experiment(Tolerance=1e-06, StopTime=3600), + Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), + Icon(coordinateSystem(extent={{-100,-100},{100,100}})), + __Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/OpenTank.mos" + "Simulate and plot"), + Documentation(info=" +

+Documentation pending. +

+", revisions=" +
    +
  • +April 11, 2022 by Hongxiang Fu:
    +First implementation. This is for +#2859. +
  • +
+")); +end OpenTank; diff --git a/Buildings/Fluid/Storage/Plant/Validation/package.order b/Buildings/Fluid/Storage/Plant/Validation/package.order index b5244a92468..899190da35a 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/package.order +++ b/Buildings/Fluid/Storage/Plant/Validation/package.order @@ -1,3 +1,4 @@ ClosedTankNoRemoteCharging ClosedTankWithRemoteCharging +OpenTank BaseClasses diff --git a/Buildings/Fluid/Storage/Plant/package.order b/Buildings/Fluid/Storage/Plant/package.order index aad35ba052f..9eb95494788 100644 --- a/Buildings/Fluid/Storage/Plant/package.order +++ b/Buildings/Fluid/Storage/Plant/package.order @@ -1,4 +1,5 @@ SupplyPumpClosedTank +SupplyPumpOpenTank TankBranch Examples Validation diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/OpenTank.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/OpenTank.mos new file mode 100644 index 00000000000..792dc6bca7a --- /dev/null +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/OpenTank.mos @@ -0,0 +1,14 @@ +simulateModel("Buildings.Fluid.Storage.Plant.Validation.OpenTank", + stopTime=3600, + tolerance=1e-06, + method="dassl", + resultFile="OpenTank"); +// Plot commands +createPlot(id=1, + position={19, 23, 1004, 372}, + y={"sinChi.ports[1].m_flow", "tanBra.mTan_flow", "supPum.pum.m_flow"}, + range={0.0, 3600.0, -3.0, 3.0}, + grid=true, + colors={{28,108,200}, {238,46,47}, {0,140,72}}, + timeUnit="s", + displayUnits={"kg/s", "kg/s", "kg/s"}); From 5ab6680c7d367e4a47cce34cad2cef9aa38fa13e Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Tue, 12 Apr 2022 12:35:44 -0700 Subject: [PATCH 082/463] changed all isolation valves to linear valves --- .../Plant/Examples/TwoSourcesThreeUsers.mo | 2 +- .../Storage/Plant/SupplyPumpClosedTank.mo | 21 +++++++++---------- .../Fluid/Storage/Plant/SupplyPumpOpenTank.mo | 18 ++++++++-------- 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index 04284344ecb..6e59ee6020a 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -240,7 +240,7 @@ model TwoSourcesThreeUsers annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0, origin={-50,130}))); - Buildings.Controls.OBC.CDL.Continuous.Hysteresis hysCat(uLow=0.05, uHigh=0.5) + Buildings.Controls.OBC.CDL.Continuous.Hysteresis hysCat(uLow=0.05, uHigh=0.1) "Shut off at con.yVal = 0.05 and restarts at 0.5" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, diff --git a/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo b/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo index 105ac83a195..57887cb6588 100644 --- a/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo +++ b/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo @@ -20,8 +20,7 @@ model SupplyPumpClosedTank extent={{-10,-10},{10,10}}, rotation=0, origin={-50,60}))); - - Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valDis( + Buildings.Fluid.Actuators.Valves.TwoWayLinear valDis( redeclare package Medium = Medium, dpValve_nominal=0.1*nom.dp_nominal, use_inputFilter=true, @@ -96,23 +95,17 @@ model SupplyPumpClosedTank extent={{-10,-10},{10,10}}, rotation=-90, origin={0,110}))); + equation connect(pum.port_b, cheVal.port_a) annotation (Line(points={{-40,60},{-20,60}}, color={0,127,255})); connect(pasValDis.port_a, cheVal.port_b) annotation (Line(points={{20,20},{10, 20},{10,60},{-1.77636e-15,60}}, color={0,127,255})); - connect(valDis.port_a, cheVal.port_b) annotation (Line(points={{20,60},{0,60}}, - color={0,127,255})); connect(pum.y, yPum) annotation (Line(points={{-50,72},{-50,90},{0,90},{0,110}}, color={0,0,127})); - connect(valDis.y, yValDis) annotation (Line(points={{30,72},{30,80},{80,80},{ - 80,110}}, color={0,0,127})); connect(valCha.y, yValCha) annotation (Line(points={{30,-8},{30,0},{48,0},{48, 96},{40,96},{40,110}}, color={0,0,127})); - connect(valDis.y_actual, yValDis_actual) - annotation (Line(points={{35,67},{44,67},{44,84},{-80,84},{-80,110}}, - color={0,0,127})); connect(valCha.y_actual, yValCha_actual) annotation (Line(points={{25,-13},{ 24,-13},{24,-14},{-66,-14},{-66,96},{-40,96},{-40,110}}, color={0,0,127})); @@ -124,10 +117,16 @@ equation 80,60},{100,60}}, color={0,127,255})); connect(pasValDis.port_b, port_CHWS) annotation (Line(points={{40,20},{80,20}, {80,60},{100,60}}, color={0,127,255})); - connect(valDis.port_b, port_CHWS) - annotation (Line(points={{40,60},{100,60}}, color={0,127,255})); connect(port_chiInl, port_CHWR) annotation (Line(points={{-100,-60},{100,-60}}, color={0,127,255})); + connect(cheVal.port_b, valDis.port_a) + annotation (Line(points={{-1.77636e-15,60},{20,60}}, color={0,127,255})); + connect(valDis.port_b, port_CHWS) + annotation (Line(points={{40,60},{100,60}}, color={0,127,255})); + connect(valDis.y, yValDis) annotation (Line(points={{30,72},{30,80},{80,80},{ + 80,110}}, color={0,0,127})); + connect(valDis.y_actual, yValDis_actual) annotation (Line(points={{35,67},{44, + 67},{44,84},{-80,84},{-80,110}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,100}}), graphics={Line( points={{-20,0},{40,0}}, diff --git a/Buildings/Fluid/Storage/Plant/SupplyPumpOpenTank.mo b/Buildings/Fluid/Storage/Plant/SupplyPumpOpenTank.mo index 9b28f999f20..e3a1317686a 100644 --- a/Buildings/Fluid/Storage/Plant/SupplyPumpOpenTank.mo +++ b/Buildings/Fluid/Storage/Plant/SupplyPumpOpenTank.mo @@ -19,7 +19,7 @@ model SupplyPumpOpenTank transformation( extent={{-30,-10},{-10,10}}, rotation=0))); - Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valDis1( + Buildings.Fluid.Actuators.Valves.TwoWayLinear valDis1( redeclare package Medium = Medium, dpValve_nominal=0.1*nom.dp_nominal, use_inputFilter=true, @@ -28,7 +28,7 @@ model SupplyPumpOpenTank m_flow_nominal=nom.m_flow_nominal) "Discharging valve, open when the tank NOT being charged remotely" annotation (Placement(transformation(extent={{10,-70},{-10,-50}}))); - Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valCha1( + Buildings.Fluid.Actuators.Valves.TwoWayLinear valCha1( redeclare package Medium = Medium, dpValve_nominal=0.1*nom.dp_nominal, use_inputFilter=true, @@ -37,7 +37,7 @@ model SupplyPumpOpenTank m_flow_nominal=nom.m_flow_nominal) "Charging valve, open when the tank is being charged remotely" annotation (Placement(transformation(extent={{10,50},{-10,70}}))); - Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valDis2( + Buildings.Fluid.Actuators.Valves.TwoWayLinear valDis2( redeclare package Medium = Medium, dpValve_nominal=0.1*nom.dp_nominal, use_inputFilter=true, @@ -49,7 +49,7 @@ model SupplyPumpOpenTank extent={{-10,10},{10,-10}}, rotation=-90, origin={-40,20}))); - Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valDis3( + Buildings.Fluid.Actuators.Valves.TwoWayLinear valDis3( redeclare package Medium = Medium, dpValve_nominal=0.1*nom.dp_nominal, use_inputFilter=true, @@ -61,7 +61,7 @@ model SupplyPumpOpenTank extent={{-10,10},{10,-10}}, rotation=90, origin={40,20}))); - Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valCha2( + Buildings.Fluid.Actuators.Valves.TwoWayLinear valCha2( redeclare package Medium = Medium, dpValve_nominal=0.1*nom.dp_nominal, use_inputFilter=true, @@ -73,7 +73,7 @@ model SupplyPumpOpenTank extent={{-10,-10},{10,10}}, rotation=90, origin={-40,-20}))); - Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valCha3( + Buildings.Fluid.Actuators.Valves.TwoWayLinear valCha3( redeclare package Medium = Medium, dpValve_nominal=0.1*nom.dp_nominal, use_inputFilter=true, @@ -85,7 +85,7 @@ model SupplyPumpOpenTank extent={{-10,-10},{10,10}}, rotation=-90, origin={40,-20}))); - FixedResistances.CheckValve cheVal( + Buildings.Fluid.FixedResistances.CheckValve cheVal( redeclare package Medium = Medium, m_flow_nominal=nom.m_flow_nominal, dpValve_nominal=0.1*nom.dp_nominal, @@ -138,13 +138,13 @@ model SupplyPumpOpenTank extent={{-10,-10},{10,10}}, rotation=-90, origin={80,110}))); - Controls.OBC.CDL.Continuous.MultiMax mulMaxDis(nin=3) + Buildings.Controls.OBC.CDL.Continuous.MultiMax mulMaxDis(nin=3) "Maximum valve position of discharging valves" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=90, origin={-80,110}))); - Controls.OBC.CDL.Continuous.MultiMax mulMaxCha(nin=3) + Buildings.Controls.OBC.CDL.Continuous.MultiMax mulMaxCha(nin=3) "Maximum valve position of charging valves" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, From a54daa49f14e4b90311e9934465bd369114539e2 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Wed, 13 Apr 2022 13:24:29 -0700 Subject: [PATCH 083/463] controls for the open tank --- .../Plant/BaseClasses/PumpValveControl.mo | 356 ++++++++++++++++++ .../BaseClasses/ReversiblePumpValveControl.mo | 255 ------------- .../Storage/Plant/BaseClasses/package.order | 2 +- .../Plant/Examples/TwoSourcesThreeUsers.mo | 40 +- .../Storage/Plant/SupplyPumpClosedTank.mo | 29 +- .../Fluid/Storage/Plant/SupplyPumpOpenTank.mo | 132 ++++--- Buildings/Fluid/Storage/Plant/TankBranch.mo | 3 +- .../BaseClasses/PartialClosedTank.mo | 6 +- .../Validation/BaseClasses/PartialOpenTank.mo | 38 -- .../Validation/BaseClasses/PartialPlant.mo | 21 +- .../Validation/BaseClasses/package.order | 1 - .../ClosedTankWithRemoteCharging.mo | 49 ++- .../Storage/Plant/Validation/OpenTank.mo | 107 ++++-- 13 files changed, 603 insertions(+), 436 deletions(-) create mode 100644 Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo delete mode 100644 Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo delete mode 100644 Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialOpenTank.mo diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo new file mode 100644 index 00000000000..f680771db3c --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo @@ -0,0 +1,356 @@ +within Buildings.Fluid.Storage.Plant.BaseClasses; +block PumpValveControl + "Control block for the supply pump and nearby valves" + extends Modelica.Blocks.Icons.Block; + + parameter Boolean tankIsOpen = false "Tank is open"; + + Modelica.Blocks.Sources.Constant zero(k=0) "Constant 0" + annotation (Placement(transformation(extent={{-120,-100},{-100,-80}}))); + Buildings.Controls.Continuous.LimPID conPI_pumSecNor( + controllerType=Modelica.Blocks.Types.SimpleController.PI, + k=5, + Ti=50, + reverseActing=false) "Normal-acting PI controller" annotation (Placement( + transformation( + extent={{-10,10},{10,-10}}, + rotation=-90, + origin={-40,10}))); + Buildings.Controls.Continuous.LimPID conPI_valCha( + controllerType=Modelica.Blocks.Types.SimpleController.PI, + k=5, + Ti=50, + reverseActing=false) if not tankIsOpen "PI controller" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-10,50}))); + Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uRemCha + "Tank is being charged remotely" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={130,110}), iconTransformation(extent={{20,-20},{ + -20,20}}, + rotation=0, + origin={120,100}))); + Modelica.Blocks.Interfaces.RealInput mTanSet_flow + "Tank mass flow rate setpoint" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-130,70}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-110,20}))); + Modelica.Blocks.Interfaces.RealInput mTan_flow "Measured tank mass flow rate" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-130,50}),iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-110,-20}))); + Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uOnl + "= true if plant is online (not cut off from the network by valve)" + annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + rotation=180, + origin={130,50}), + iconTransformation(extent={{20,-20},{-20,20}}, + rotation=0, + origin={120,60}))); + Modelica.Blocks.Interfaces.RealOutput yPum "Normalised speed" annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-70,-170}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-40,-110}))); + Modelica.Blocks.Interfaces.RealOutput yValChaMod + "Valve position, modulating signal" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-20,-170}),iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={0,-110}))); + Modelica.Blocks.Interfaces.RealOutput yValDisOn + "Valve position, on-off signal" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={90,-170}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={80,-110}))); + Modelica.Blocks.Interfaces.RealInput yValCha_actual "Actual valve position" + annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=180, + origin={-130,-10}), + iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-110,-100}))); + Modelica.Blocks.Interfaces.RealInput yValDis_actual "Actual valve position" + annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=180, + origin={-130,-50}), + iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-110,-60}))); + Buildings.Controls.OBC.CDL.Continuous.LessThreshold isValDisClo(t=0.05) + "= true if valve closed" + annotation (Placement(transformation(extent={{20,20},{40,40}}))); + Buildings.Controls.OBC.CDL.Continuous.Switch swiPum + "True = on (y>0); false = off (y=0)." annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-70,-130}))); + Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToReaValDis + "True = 1, false = 0" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={90,-130}))); + Buildings.Controls.OBC.CDL.Continuous.Switch swiValCha + "True = on (y>0); false = off (y=0)." annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-20,-130}))); + Buildings.Controls.OBC.CDL.Logical.And3 and3 + "Plant online AND not charging remotely AND valCha closed" + annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={110,30}))); + Buildings.Controls.OBC.CDL.Continuous.LessThreshold isValChaClo(t=0.05) + "= true if valve closed" + annotation (Placement(transformation(extent={{20,60},{40,80}}))); + Buildings.Controls.OBC.CDL.Logical.Not notRemCha + "Tank is not being charged remotely" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={110,90}))); + Buildings.Controls.OBC.CDL.Logical.And andValCha + "Charging remotely AND valDis closed" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={70,10}))); + Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToReaValCha if tankIsOpen + "True = 1, false = 0" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={10,-130}))); + Buildings.Controls.Continuous.LimPID conPI_pumSecRev( + controllerType=Modelica.Blocks.Types.SimpleController.PI, + k=5, + Ti=50, + reverseActing=true) "Reverse-acting PI controller" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-80,10}))); + Buildings.Controls.OBC.CDL.Continuous.Switch swiPumAct + "True = mTanSet_flow > 0, reverse acting; false = mTanSet_flow < 0, normal acting" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-60,-70}))); + Buildings.Controls.OBC.CDL.Continuous.LessThreshold isPos(t=0) + "= true if mTanSet_flow > 0" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-60,-30}))); + Modelica.Blocks.Interfaces.RealOutput yValChaOn if tankIsOpen + "Valve position, on-off signal" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={10,-170}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={20,-110}))); + Modelica.Blocks.Interfaces.RealOutput yValDisMod if tankIsOpen + "Valve position, modulating signal" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={60,-170}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={60,-110}))); + Buildings.Controls.OBC.CDL.Continuous.Switch swiValDis if tankIsOpen + "True = on (y>0); false = off (y=0)." annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={60,-130}))); + Modelica.Blocks.Interfaces.RealInput pCHWSSet if tankIsOpen + "Pressure setpoint at supply line" annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=0, + origin={130,-10}), iconTransformation( + extent={{10,-10},{-10,10}}, + rotation=0, + origin={110,20}))); + Modelica.Blocks.Interfaces.RealInput pCHWRSet if tankIsOpen + "Pressure setpoint at return line" annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=0, + origin={130,-30}), iconTransformation( + extent={{10,-10},{-10,10}}, + rotation=0, + origin={110,-20}))); + Modelica.Blocks.Interfaces.RealInput pCHWS if tankIsOpen + "Pressure at supply line" annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=0, + origin={130,-50}), iconTransformation( + extent={{10,-10},{-10,10}}, + rotation=0, + origin={110,-100}))); + Modelica.Blocks.Interfaces.RealInput pCHWR if tankIsOpen + "Pressure at return line" annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=0, + origin={130,-70}), iconTransformation( + extent={{10,-10},{-10,10}}, + rotation=0, + origin={110,-60}))); + Buildings.Controls.Continuous.LimPID conPI_valChaMod( + controllerType=Modelica.Blocks.Types.SimpleController.PI, + k=5, + Ti=50, + reverseActing=false) if tankIsOpen "PI controller" annotation (Placement( + transformation( + extent={{-10,10},{10,-10}}, + rotation=-90, + origin={30,-50}))); + Buildings.Controls.Continuous.LimPID conPI_valDisMod( + controllerType=Modelica.Blocks.Types.SimpleController.PI, + k=5, + Ti=50, + reverseActing=false) if tankIsOpen "PI controller" annotation (Placement( + transformation( + extent={{-10,10},{10,-10}}, + rotation=-90, + origin={90,-70}))); + +equation + connect(conPI_pumSecNor.u_m, mTan_flow) annotation (Line(points={{-28,10},{ + -22,10},{-22,-8},{-100,-8},{-100,50},{-130,50}}, + color={0,0,127})); + connect(conPI_pumSecNor.u_s, mTanSet_flow) + annotation (Line(points={{-40,22},{-40,70},{-130,70}}, color={0,0,127})); + connect(conPI_valCha.u_s,mTanSet_flow) annotation (Line(points={{-10,62},{ + -10,70},{-130,70}}, color={0,0,127})); + connect(conPI_valCha.u_m, mTan_flow) + annotation (Line(points={{-22,50},{-130,50}}, color={0,0,127})); + connect(yValDisOn, yValDisOn) + annotation (Line(points={{90,-170},{90,-170}}, color={0,0,127})); + connect(swiPum.y, yPum) + annotation (Line(points={{-70,-142},{-70,-170}}, color={0,0,127})); + connect(zero.y, swiPum.u3) annotation (Line(points={{-99,-90},{-78,-90},{-78, + -118}}, + color={0,0,127})); + connect(swiValCha.y, yValChaMod) + annotation (Line(points={{-20,-142},{-20,-170}}, + color={0,0,127})); + connect(zero.y, swiValCha.u3) annotation (Line(points={{-99,-90},{-28,-90},{ + -28,-118}}, + color={0,0,127})); + connect(isValChaClo.u, yValCha_actual) + annotation (Line(points={{18,70},{14,70},{14,110},{-112,110},{-112,-10},{ + -130,-10}}, color={0,0,127})); + connect(isValDisClo.u, yValDis_actual) + annotation (Line(points={{18,30},{8,30},{8,104},{-106,104},{-106,-50},{-130, + -50}}, color={0,0,127})); + connect(isValDisClo.y, andValCha.u2) annotation (Line(points={{42,30},{62,30}, + {62,22}}, color={255,0,255})); + connect(andValCha.y, swiValCha.u2) annotation (Line(points={{70,-2},{70,-80}, + {10,-80},{10,-112},{-20,-112},{-20,-118}}, + color={255,0,255})); + connect(conPI_valCha.y, swiValCha.u1) annotation (Line(points={{-10,39},{-10, + -70},{-12,-70},{-12,-118}}, + color={0,0,127})); + connect(and3.y, swiPum.u2) annotation (Line(points={{110,18},{110,-100},{-70, + -100},{-70,-118}}, + color={255,0,255})); + connect(booToReaValDis.y, yValDisOn) + annotation (Line(points={{90,-142},{90,-170}}, color={0,0,127})); + connect(and3.y, booToReaValDis.u) annotation (Line(points={{110,18},{110,-100}, + {90,-100},{90,-118}}, + color={255,0,255})); + connect(uRemCha, notRemCha.u) + annotation (Line(points={{130,110},{110,110},{110,102}}, + color={255,0,255})); + connect(andValCha.u1, uRemCha) + annotation (Line(points={{70,22},{70,110},{130,110}}, + color={255,0,255})); + connect(and3.u3, isValChaClo.y) + annotation (Line(points={{102,42},{102,70},{42,70}}, color={255,0,255})); + connect(notRemCha.y, and3.u2) + annotation (Line(points={{110,78},{110,42}},color={255,0,255})); + connect(andValCha.y, booToReaValCha.u) annotation (Line(points={{70,-2},{70, + -80},{10,-80},{10,-118}}, + color={255,0,255})); + connect(conPI_pumSecRev.u_m, mTan_flow) annotation (Line(points={{-92,10},{ + -100,10},{-100,50},{-130,50}}, + color={0,0,127})); + connect(conPI_pumSecRev.u_s, mTanSet_flow) + annotation (Line(points={{-80,22},{-80,70},{-130,70}}, color={0,0,127})); + connect(conPI_pumSecNor.y, swiPumAct.u1) + annotation (Line(points={{-40,-1},{-40,-58},{-52,-58}}, color={0,0,127})); + connect(conPI_pumSecRev.y, swiPumAct.u3) + annotation (Line(points={{-80,-1},{-80,-58},{-68,-58}}, color={0,0,127})); + connect(isPos.u, mTanSet_flow) + annotation (Line(points={{-60,-18},{-60,70},{-130,70}}, color={0,0,127})); + connect(swiPumAct.y, swiPum.u1) annotation (Line(points={{-60,-82},{-60,-110}, + {-62,-110},{-62,-118}}, color={0,0,127})); + connect(isPos.y, swiPumAct.u2) + annotation (Line(points={{-60,-42},{-60,-58}}, color={255,0,255})); + connect(yValChaOn, booToReaValCha.y) + annotation (Line(points={{10,-170},{10,-142}}, color={0,0,127})); + + connect(swiValDis.u2, and3.y) annotation (Line(points={{60,-118},{60,-100},{ + 110,-100},{110,18}}, color={255,0,255})); + connect(swiValDis.y, yValDisMod) + annotation (Line(points={{60,-142},{60,-170}}, color={0,0,127})); + connect(zero.y, swiValDis.u3) + annotation (Line(points={{-99,-90},{52,-90},{52,-118}}, color={0,0,127})); + connect(conPI_valChaMod.u_m, pCHWS) + annotation (Line(points={{42,-50},{130,-50}}, color={0,0,127})); + connect(conPI_valChaMod.u_s, pCHWSSet) + annotation (Line(points={{30,-38},{30,-10},{130,-10}}, color={0,0,127})); + connect(conPI_valChaMod.y, swiValCha.u1) annotation (Line(points={{30,-61},{ + 30,-70},{-12,-70},{-12,-118}}, color={0,0,127})); + connect(pCHWR, conPI_valDisMod.u_m) + annotation (Line(points={{130,-70},{102,-70}}, color={0,0,127})); + connect(conPI_valDisMod.u_s, pCHWRSet) + annotation (Line(points={{90,-58},{90,-30},{130,-30}}, color={0,0,127})); + connect(conPI_valDisMod.y, swiValDis.u1) annotation (Line(points={{90,-81},{ + 90,-90},{68,-90},{68,-118}}, color={0,0,127})); + connect(and3.u1, uOnl) + annotation (Line(points={{118,42},{118,50},{130,50}}, color={255,0,255})); + annotation ( + defaultComponentName="conPumVal", + Diagram(coordinateSystem(extent={{-120,-160},{120,120}})), Icon( + coordinateSystem(extent={{-100,-100},{100,100}})), + Documentation(revisions=" +
    +
  • +February 18, 2022 by Hongxiang Fu:
    +First implementation. This is for +#2859. +
  • +
+", info=" +

+This is a control block for the secondary pump-valve group in + +Buildings.Fluid.Storage.Plant.ChillerAndTank. +This block is conditionally enabled when the plant is configured to allow +remotely charging the tank. +

+")); +end PumpValveControl; diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo deleted file mode 100644 index c0f6a2db049..00000000000 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/ReversiblePumpValveControl.mo +++ /dev/null @@ -1,255 +0,0 @@ -within Buildings.Fluid.Storage.Plant.BaseClasses; -block ReversiblePumpValveControl - "Control block for the secondary pump-valve group" - extends Modelica.Blocks.Icons.Block; - - parameter Boolean tankIsOpen = false "Tank is open"; - - Modelica.Blocks.Sources.Constant zero(k=0) "Constant 0" - annotation (Placement(transformation(extent={{-100,-100},{-80,-80}}))); - Buildings.Controls.Continuous.LimPID conPI_pumSecNor( - controllerType=Modelica.Blocks.Types.SimpleController.PI, - k=5, - Ti=50, - reverseActing=false) "Normal-acting PI controller" annotation (Placement( - transformation( - extent={{-10,10},{10,-10}}, - rotation=-90, - origin={-30,30}))); - Buildings.Controls.Continuous.LimPID conPI_valCha( - controllerType=Modelica.Blocks.Types.SimpleController.PI, - k=5, - Ti=50, - reverseActing=false) if not tankIsOpen - "PI controller" annotation (Placement(transformation( - extent={{-10,10},{10,-10}}, - rotation=0, - origin={-10,90}))); - Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uRemCha - "Tank is being charged remotely" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=180, - origin={130,40}), iconTransformation(extent={{20,-20},{ - -20,20}}, - rotation=0, - origin={120,80}))); - Modelica.Blocks.Interfaces.RealInput mTanSet_flow - "Tank mass flow rate setpoint" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-130,90}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-110,80}))); - Modelica.Blocks.Interfaces.RealInput mTan_flow "Measured tank mass flow rate" - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-130,70}),iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-110,40}))); - Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uOnl - "= true if plant is online (not cut off from the network by valve)" - annotation (Placement(transformation(extent={{-10,-10},{10,10}}, - rotation=180, - origin={130,-40}), - iconTransformation(extent={{20,-20},{-20,20}}, - rotation=0, - origin={120,40}))); - Modelica.Blocks.Interfaces.RealOutput yPum "Normalised speed" annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={-50,-170}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={0,-110}))); - Modelica.Blocks.Interfaces.RealOutput yValCha "Valve position" annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={30,-170}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={40,-110}))); - Modelica.Blocks.Interfaces.RealOutput yValDis "Valve position" annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={90,-170}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={80,-110}))); - Modelica.Blocks.Interfaces.RealInput yValCha_actual "Actual valve position" - annotation (Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=180, - origin={-130,-10}), - iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-110,-40}))); - Modelica.Blocks.Interfaces.RealInput yValDis_actual "Actual valve position" - annotation (Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=180, - origin={-130,-50}), - iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-110,0}))); - Buildings.Controls.OBC.CDL.Continuous.LessThreshold isValDisClo(t=0.05) - "= true if valve closed" - annotation (Placement(transformation(extent={{-20,-60},{0,-40}}))); - Buildings.Controls.OBC.CDL.Continuous.Switch swiPum - "True = on (y>0); false = off (y=0)." annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={-50,-130}))); - Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToReaValDis - "True = 1, false = 0" - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={90,-130}))); - Buildings.Controls.OBC.CDL.Continuous.Switch swiValCha if not tankIsOpen - "True = on (y>0); false = off (y=0)." annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={10,-130}))); - Buildings.Controls.OBC.CDL.Logical.And3 and3 - "Plant online AND not charging remotely AND valCha closed" - annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={90,-70}))); - Buildings.Controls.OBC.CDL.Continuous.LessThreshold isValChaClo(t=0.05) - "= true if valve closed" - annotation (Placement(transformation(extent={{40,-20},{60,0}}))); - Buildings.Controls.OBC.CDL.Logical.Not notRemCha - "Tank is not being charged remotely" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={90,10}))); - Buildings.Controls.OBC.CDL.Logical.And andValCha - "Charging remotely AND valDis closed" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={30,-70}))); - Controls.OBC.CDL.Conversions.BooleanToReal booToReaValCha if tankIsOpen - "True = 1, false = 0" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={50,-130}))); - Controls.Continuous.LimPID conPI_pumSecRev( - controllerType=Modelica.Blocks.Types.SimpleController.PI, - k=5, - Ti=50, - reverseActing=true) "Reverse-acting PI controller" - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={-70,30}))); - Controls.OBC.CDL.Continuous.Switch swiPumPri1 - "True = mTanSet_flow > 0, reverse acting; false = mTanSet_flow < 0, normal acting" - annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={-50,-70}))); - Controls.OBC.CDL.Continuous.LessThreshold isPos(t=0) - "= true if mTanSet_flow > 0" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={-50,-30}))); -equation - - connect(conPI_pumSecNor.u_m, mTan_flow) annotation (Line(points={{-18,30},{-10, - 30},{-10,70},{-130,70}}, color={0,0,127})); - connect(conPI_pumSecNor.u_s, mTanSet_flow) - annotation (Line(points={{-30,42},{-30,90},{-130,90}}, color={0,0,127})); - connect(conPI_valCha.u_s,mTanSet_flow) annotation (Line(points={{-22,90},{-130, - 90}}, color={0,0,127})); - connect(conPI_valCha.u_m, mTan_flow) - annotation (Line(points={{-10,102},{-10,110},{-90,110},{-90,70},{-130,70}}, - color={0,0,127})); - connect(yValDis, yValDis) - annotation (Line(points={{90,-170},{90,-170}}, color={0,0,127})); - connect(swiPum.y, yPum) - annotation (Line(points={{-50,-142},{-50,-170}}, color={0,0,127})); - connect(zero.y, swiPum.u3) annotation (Line(points={{-79,-90},{-58,-90},{-58,-118}}, - color={0,0,127})); - connect(swiValCha.y, yValCha) - annotation (Line(points={{10,-142},{10,-154},{30,-154},{30,-170}}, - color={0,0,127})); - connect(zero.y, swiValCha.u3) annotation (Line(points={{-79,-90},{2,-90},{2,-118}}, - color={0,0,127})); - connect(isValChaClo.u, yValCha_actual) - annotation (Line(points={{38,-10},{-130,-10}}, - color={0,0,127})); - connect(isValDisClo.u, yValDis_actual) - annotation (Line(points={{-22,-50},{-130,-50}}, - color={0,0,127})); - connect(isValDisClo.y, andValCha.u2) annotation (Line(points={{2,-50},{22,-50}, - {22,-58}}, color={255,0,255})); - connect(andValCha.y, swiValCha.u2) annotation (Line(points={{30,-82},{30,-110}, - {10,-110},{10,-118}},color={255,0,255})); - connect(conPI_valCha.y, swiValCha.u1) annotation (Line(points={{1,90},{18,90}, - {18,-118}}, color={0,0,127})); - connect(and3.y, swiPum.u2) annotation (Line(points={{90,-82},{90,-100},{-50,-100}, - {-50,-118}}, color={255,0,255})); - connect(booToReaValDis.y, yValDis) - annotation (Line(points={{90,-142},{90,-170}}, color={0,0,127})); - connect(and3.y, booToReaValDis.u) annotation (Line(points={{90,-82},{90,-118}}, - color={255,0,255})); - connect(uRemCha, notRemCha.u) - annotation (Line(points={{130,40},{90,40},{90,22}}, color={255,0,255})); - connect(andValCha.u1, uRemCha) - annotation (Line(points={{30,-58},{30,40},{130,40}},color={255,0,255})); - connect(and3.u3, isValChaClo.y) - annotation (Line(points={{82,-58},{82,-10},{62,-10}}, color={255,0,255})); - connect(notRemCha.y, and3.u2) - annotation (Line(points={{90,-2},{90,-58}}, color={255,0,255})); - connect(and3.u1, uOnl) - annotation (Line(points={{98,-58},{98,-40},{130,-40}}, color={255,0,255})); - connect(booToReaValCha.y, yValCha) annotation (Line(points={{50,-142},{50,-154}, - {30,-154},{30,-170}}, color={0,0,127})); - connect(andValCha.y, booToReaValCha.u) annotation (Line(points={{30,-82},{30,-110}, - {50,-110},{50,-118}}, color={255,0,255})); - connect(conPI_pumSecRev.u_m, mTan_flow) annotation (Line(points={{-82,30},{-90, - 30},{-90,70},{-130,70}}, color={0,0,127})); - connect(conPI_pumSecRev.u_s, mTanSet_flow) - annotation (Line(points={{-70,42},{-70,90},{-130,90}}, color={0,0,127})); - connect(conPI_pumSecNor.y, swiPumPri1.u1) - annotation (Line(points={{-30,19},{-30,-58},{-42,-58}}, color={0,0,127})); - connect(conPI_pumSecRev.y, swiPumPri1.u3) - annotation (Line(points={{-70,19},{-70,-58},{-58,-58}}, color={0,0,127})); - connect(isPos.u, mTanSet_flow) - annotation (Line(points={{-50,-18},{-50,90},{-130,90}}, color={0,0,127})); - connect(swiPumPri1.y, swiPum.u1) annotation (Line(points={{-50,-82},{-50,-96}, - {-42,-96},{-42,-118}}, color={0,0,127})); - connect(isPos.y, swiPumPri1.u2) - annotation (Line(points={{-50,-42},{-50,-58}}, color={255,0,255})); - annotation (Diagram(coordinateSystem(extent={{-120,-160},{120,120}})), Icon( - coordinateSystem(extent={{-100,-100},{100,100}})), - Documentation(revisions=" -
    -
  • -February 18, 2022 by Hongxiang Fu:
    -First implementation. This is for -#2859. -
  • -
-", info=" -

-This is a control block for the secondary pump-valve group in - -Buildings.Fluid.Storage.Plant.ChillerAndTank. -This block is conditionally enabled when the plant is configured to allow -remotely charging the tank. -

-")); -end ReversiblePumpValveControl; diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/package.order b/Buildings/Fluid/Storage/Plant/BaseClasses/package.order index 91e3c407f5c..f1475a368d3 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/package.order +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/package.order @@ -1,4 +1,4 @@ FluidPassThrough PartialBranchPorts -ReversiblePumpValveControl +PumpValveControl NominalValues diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index 6e59ee6020a..b9c988630fc 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -173,11 +173,12 @@ model TwoSourcesThreeUsers extent={{-10,-10},{10,10}}, rotation=0, origin={-170,-10}))); - Buildings.Fluid.Storage.Plant.BaseClasses.ReversiblePumpValveControl conPumSecGro( - tankIsOpen=false) "Control block for secondary pump-valve group" - annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + Buildings.Fluid.Storage.Plant.BaseClasses.PumpValveControl conPumSecGro( + tankIsOpen=false) "Control block for secondary pump-valve group" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=0, - origin={-70,-30}))); + origin={-70,-20}))); Buildings.Controls.OBC.CDL.Conversions.BooleanToReal mTanSet_flow( realTrue=nomPla2.mTan_flow_nominal, realFalse=-nomPla2.mTan_flow_nominal) @@ -425,8 +426,9 @@ equation 82}}, color={255,0,255})); connect(preDroS1U2.port_a, chi1.port_b2) annotation (Line(points={{-30,20},{-36, 20},{-36,80},{-124,80}}, color={0,127,255})); - connect(uRemCha.y, or2.u1) annotation (Line(points={{-159,-90},{-156,-90},{-156, - -110},{-50,-110},{-50,-102}}, color={255,0,255})); + connect(uRemCha.y, or2.u1) annotation (Line(points={{-159,-90},{-156,-90},{ + -156,-116},{-50,-116},{-50,-102}}, + color={255,0,255})); connect(hysCat.y, or2.u2) annotation (Line(points={{-2,-110},{-42,-110},{-42,-102}}, color={255,0,255})); connect(tanBra.port_CHWR, supPum.port_chiInl) @@ -441,25 +443,27 @@ equation {-36,-54},{-36,-40},{-30,-40}}, color={0,127,255})); connect(supPum.port_CHWS, preDroS2U2.port_a) annotation (Line(points={{-60,-54}, {-36,-54},{-36,0},{-30,0}}, color={0,127,255})); - connect(conPumSecGro.yValDis, supPum.yValDis) - annotation (Line(points={{-62,-41},{-62,-49}}, color={0,0,127})); - connect(conPumSecGro.yValCha, supPum.yValCha) - annotation (Line(points={{-66,-41},{-66,-49}}, color={0,0,127})); + connect(conPumSecGro.yValDisOn, supPum.yValDis) + annotation (Line(points={{-62,-31},{-62,-49}}, color={0,0,127})); connect(conPumSecGro.yPum, supPum.yPum) - annotation (Line(points={{-70,-41},{-70,-49}}, color={0,0,127})); + annotation (Line(points={{-74,-31},{-74,-36},{-70,-36},{-70,-49}}, + color={0,0,127})); connect(tanBra.mTan_flow, conPumSecGro.mTan_flow) - annotation (Line(points={{-92,-49},{-92,-26},{-81,-26}}, color={0,0,127})); + annotation (Line(points={{-92,-49},{-92,-22},{-81,-22}}, color={0,0,127})); connect(supPum.yValCha_actual, conPumSecGro.yValCha_actual) annotation (Line( - points={{-74,-49},{-74,-44},{-84,-44},{-84,-34},{-81,-34}}, color={0,0,127})); + points={{-74,-49},{-74,-40},{-81,-40},{-81,-30}}, color={0,0,127})); connect(supPum.yValDis_actual, conPumSecGro.yValDis_actual) annotation (Line( - points={{-78,-49},{-78,-48},{-88,-48},{-88,-30},{-81,-30}}, color={0,0,127})); - connect(conPumSecGro.uOnl, or2.y) annotation (Line(points={{-58,-26},{-50,-26}, + points={{-78,-49},{-78,-44},{-86,-44},{-86,-26},{-81,-26}}, color={0,0,127})); + connect(conPumSecGro.uOnl, or2.y) annotation (Line(points={{-58,-14},{-50,-14}, {-50,-78}}, color={255,0,255})); connect(mTanSet_flow.y, conPumSecGro.mTanSet_flow) annotation (Line(points={{-118, - -10},{-88,-10},{-88,-22},{-81,-22}}, color={0,0,127})); - connect(uRemCha.y, conPumSecGro.uRemCha) annotation (Line(points={{-159,-90},{ - -156,-90},{-156,-30},{-106,-30},{-106,-14},{-50,-14},{-50,-22},{-58,-22}}, + -10},{-86,-10},{-86,-18},{-81,-18}}, color={0,0,127})); + connect(uRemCha.y, conPumSecGro.uRemCha) annotation (Line(points={{-159,-90}, + {-156,-90},{-156,-116},{-32,-116},{-32,-60},{-46,-60},{-46,-10},{-58, + -10}}, color={255,0,255})); + connect(conPumSecGro.yValChaMod, supPum.yValCha) + annotation (Line(points={{-70,-31},{-66,-31},{-66,-49}}, color={0,0,127})); annotation ( __Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos" "Simulate and plot"), diff --git a/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo b/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo index 57887cb6588..b0d6d8ce00e 100644 --- a/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo +++ b/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo @@ -57,17 +57,17 @@ model SupplyPumpClosedTank transformation( extent={{10,-10},{-10,10}}, rotation=270, - origin={-40,110}), iconTransformation( + origin={-70,110}), iconTransformation( extent={{10,-10},{-10,10}}, rotation=270, origin={-40,110}))); - Modelica.Blocks.Interfaces.RealOutput yValDis_actual - if allowRemoteCharging "Actual valve position" + Modelica.Blocks.Interfaces.RealOutput yValDis_actual if allowRemoteCharging + "Actual valve position" annotation (Placement( transformation( extent={{10,-10},{-10,10}}, rotation=270, - origin={-80,110}), iconTransformation( + origin={-90,110}), iconTransformation( extent={{10,-10},{-10,10}}, rotation=270, origin={-80,110}))); @@ -75,7 +75,7 @@ model SupplyPumpClosedTank "Valve position input" annotation (Placement(transformation(extent={{10,10}, {-10,-10}}, rotation=90, - origin={40,110}), iconTransformation( + origin={60,110}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={40,110}))); @@ -91,7 +91,7 @@ model SupplyPumpClosedTank annotation (Placement(transformation( extent={{10,10},{-10,-10}}, rotation=90, - origin={0,110}), iconTransformation( + origin={40,110}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={0,110}))); @@ -102,13 +102,12 @@ equation connect(pasValDis.port_a, cheVal.port_b) annotation (Line(points={{20,20},{10, 20},{10,60},{-1.77636e-15,60}}, color={0,127,255})); - connect(pum.y, yPum) annotation (Line(points={{-50,72},{-50,90},{0,90},{0,110}}, - color={0,0,127})); - connect(valCha.y, yValCha) annotation (Line(points={{30,-8},{30,0},{48,0},{48, - 96},{40,96},{40,110}}, color={0,0,127})); + connect(pum.y, yPum) annotation (Line(points={{-50,72},{-50,96},{40,96},{40, + 110}}, color={0,0,127})); + connect(valCha.y, yValCha) annotation (Line(points={{30,-8},{30,0},{60,0},{60, + 110}}, color={0,0,127})); connect(valCha.y_actual, yValCha_actual) annotation (Line(points={{25,-13},{ - 24,-13},{24,-14},{-66,-14},{-66,96},{-40,96},{-40,110}}, - color={0,0,127})); + 24,-13},{24,0},{-70,0},{-70,110}}, color={0,0,127})); connect(port_chiOut, pum.port_a) annotation (Line(points={{-100,60},{-60,60}}, color={0,127,255})); connect(port_chiOut, valCha.port_b) annotation (Line(points={{-100,60},{-80,60}, @@ -125,8 +124,10 @@ equation annotation (Line(points={{40,60},{100,60}}, color={0,127,255})); connect(valDis.y, yValDis) annotation (Line(points={{30,72},{30,80},{80,80},{ 80,110}}, color={0,0,127})); - connect(valDis.y_actual, yValDis_actual) annotation (Line(points={{35,67},{44, - 67},{44,84},{-80,84},{-80,110}}, color={0,0,127})); + connect(valDis.y_actual, yValDis_actual) annotation (Line(points={{35,67},{40, + 67},{40,86},{-90,86},{-90,110}}, color={0,0,127})); + connect(yValDis_actual, yValDis_actual) + annotation (Line(points={{-90,110},{-90,110}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,100}}), graphics={Line( points={{-20,0},{40,0}}, diff --git a/Buildings/Fluid/Storage/Plant/SupplyPumpOpenTank.mo b/Buildings/Fluid/Storage/Plant/SupplyPumpOpenTank.mo index e3a1317686a..2fae54a648e 100644 --- a/Buildings/Fluid/Storage/Plant/SupplyPumpOpenTank.mo +++ b/Buildings/Fluid/Storage/Plant/SupplyPumpOpenTank.mo @@ -4,13 +4,10 @@ model SupplyPumpOpenTank extends Buildings.Fluid.Storage.Plant.BaseClasses.PartialBranchPorts; -/* parameter Boolean allowRemoteCharging = true - "= true if the tank is allowed to be charged by a remote source";*/ - Buildings.Fluid.Movers.SpeedControlled_y pum( redeclare package Medium = Medium, - per(pressure(dp=nom.dp_nominal*{2,1.2,0}, V_flow=(nom.m_flow_nominal)/1.2*{0, - 1.2,2})), + per(pressure(dp=nom.dp_nominal*{1.8,1,0}, V_flow=(nom.m_flow_nominal)/1.2*{0, + 1,1.8})), energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, allowFlowReversal=true, addPowerToMedium=false, @@ -94,8 +91,7 @@ model SupplyPumpOpenTank extent={{10,-10},{-10,10}}, rotation=180, origin={20,0}))); - Modelica.Blocks.Interfaces.RealOutput yValDis_actual - "Actual valve position" + Modelica.Blocks.Interfaces.RealOutput yValDis_actual "Actual valve position" annotation (Placement( transformation( extent={{10,-10},{-10,10}}, @@ -103,41 +99,40 @@ model SupplyPumpOpenTank origin={-80,150}), iconTransformation( extent={{10,-10},{-10,10}}, rotation=270, - origin={-80,110}))); - Modelica.Blocks.Interfaces.RealOutput yValCha_actual - "Actual valve position" + origin={-100,110}))); + Modelica.Blocks.Interfaces.RealOutput yValCha_actual "Actual valve position" annotation (Placement( transformation( extent={{10,-10},{-10,10}}, rotation=270, - origin={-40,150}), iconTransformation( + origin={-50,150}), iconTransformation( extent={{10,-10},{-10,10}}, rotation=270, - origin={-40,110}))); + origin={-60,110}))); Modelica.Blocks.Interfaces.RealInput yPum "Secondary pump speed input" annotation (Placement(transformation( extent={{10,10},{-10,-10}}, rotation=90, - origin={0,150}), iconTransformation( + origin={-20,150}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={0,110}))); - Modelica.Blocks.Interfaces.RealInput yValCha - "Valve position input" annotation (Placement(transformation(extent={{10,10}, - {-10,-10}}, + origin={-20,110}))); + Modelica.Blocks.Interfaces.RealInput yValChaOn + "Valve position input, on-off signal" annotation (Placement(transformation( + extent={{10,10},{-10,-10}}, rotation=90, - origin={40,150}), iconTransformation( + origin={40,150}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={40,110}))); - Modelica.Blocks.Interfaces.RealInput yValDis - "Valve position input" annotation (Placement(transformation( + Modelica.Blocks.Interfaces.RealInput yValDisOn + "Valve position input, on-off signal" annotation (Placement(transformation( extent={{10,10},{-10,-10}}, rotation=90, - origin={80,150}), iconTransformation( + origin={100,150}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={80,110}))); + origin={100,110}))); Buildings.Controls.OBC.CDL.Continuous.MultiMax mulMaxDis(nin=3) "Maximum valve position of discharging valves" annotation (Placement( transformation( @@ -149,7 +144,49 @@ model SupplyPumpOpenTank transformation( extent={{-10,-10},{10,10}}, rotation=90, - origin={-40,110}))); + origin={-50,110}))); + Modelica.Blocks.Interfaces.RealInput yValChaMod + "Valve position input, modulating signal" annotation (Placement( + transformation( + extent={{10,10},{-10,-10}}, + rotation=90, + origin={20,150}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={20,110}))); + Modelica.Blocks.Interfaces.RealInput yValDisMod + "Valve position input, modulating signal" annotation (Placement( + transformation( + extent={{10,10},{-10,-10}}, + rotation=90, + origin={80,150}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={80,110}))); + Modelica.Blocks.Interfaces.RealOutput pCHWS + "Absolute pressure at the supply line" annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=180, + origin={110,30}), iconTransformation( + extent={{10,-10},{-10,10}}, + rotation=180, + origin={110,30}))); + Modelica.Blocks.Interfaces.RealOutput pCHWR + "Absolute pressure at the return line" annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=180, + origin={110,-30}), iconTransformation( + extent={{10,-10},{-10,10}}, + rotation=180, + origin={110,-30}))); + Buildings.Fluid.Sensors.Pressure senPreCHWR( + redeclare final package Medium = Medium) + "Pressure sensor" + annotation (Placement(transformation(extent={{70,-40},{90,-20}}))); + Buildings.Fluid.Sensors.Pressure senPreCHWS( + redeclare final package Medium = Medium) + "Pressure sensor" + annotation (Placement(transformation(extent={{70,40},{90,20}}))); equation connect(port_chiOut, valCha1.port_b) annotation (Line(points={{-100,60},{-10,60}}, color={0,127,255})); @@ -177,20 +214,16 @@ equation {40,-7.21645e-16},{40,10}}, color={0,127,255})); connect(cheVal.port_b, valCha3.port_a) annotation (Line(points={{30,-7.21645e-16}, {40,-7.21645e-16},{40,-10}}, color={0,127,255})); - connect(pum.y, yPum) annotation (Line(points={{-20,12},{-20,134},{0,134},{0,150}}, + connect(pum.y, yPum) annotation (Line(points={{-20,12},{-20,150}}, color={0,0,127})); - connect(valCha1.y, yValCha) annotation (Line(points={{0,72},{0,80},{40,80},{40, - 150}}, color={0,0,127})); - connect(valCha3.y, yValCha) annotation (Line(points={{52,-20},{60,-20},{60,80}, - {40,80},{40,150}}, color={0,0,127})); - connect(valCha2.y, yValCha) annotation (Line(points={{-52,-20},{-56,-20},{-56, - -36},{60,-36},{60,80},{40,80},{40,150}}, color={0,0,127})); - connect(valDis2.y, yValDis) annotation (Line(points={{-52,20},{-60,20},{-60,-40}, - {80,-40},{80,150}}, color={0,0,127})); - connect(valDis3.y, yValDis) - annotation (Line(points={{52,20},{80,20},{80,150}}, color={0,0,127})); - connect(valDis1.y, yValDis) annotation (Line(points={{0,-48},{0,-40},{80,-40}, - {80,150}}, color={0,0,127})); + connect(valCha3.y, yValChaOn) annotation (Line(points={{52,-20},{60,-20},{60,100}, + {40,100},{40,150}}, color={0,0,127})); + connect(valCha2.y, yValChaOn) annotation (Line(points={{-52,-20},{-52,-36},{60, + -36},{60,100},{40,100},{40,150}}, color={0,0,127})); + connect(valDis2.y, yValDisOn) annotation (Line(points={{-52,20},{-52,86},{76,86}, + {76,112},{100,112},{100,150}}, color={0,0,127})); + connect(valDis3.y, yValDisOn) annotation (Line(points={{52,20},{52,86},{76,86}, + {76,112},{100,112},{100,150}}, color={0,0,127})); connect(valDis1.y_actual, mulMaxDis.u[1]) annotation (Line(points={{-5,-53},{ -5,-52},{-79.3333,-52},{-79.3333,98}}, color={0,0,127})); @@ -202,15 +235,28 @@ equation connect(mulMaxDis.y, yValDis_actual) annotation (Line(points={{-80,122},{-80,150}}, color={0,0,127})); connect(valCha2.y_actual, mulMaxCha.u[1]) annotation (Line(points={{-47,-15}, - {-68,-15},{-68,92},{-39.3333,92},{-39.3333,98}},color={0,0,127})); - connect(valCha1.y_actual, mulMaxCha.u[2]) annotation (Line(points={{-5,67},{-5, - 92},{-40,92},{-40,98}}, color={0,0,127})); - connect(valCha3.y_actual, mulMaxCha.u[3]) annotation (Line(points={{47,-25},{ - 46,-25},{46,-28},{68,-28},{68,92},{-40.6667,92},{-40.6667,98}}, - color={0, + {-60,-15},{-60,90},{-49.3333,90},{-49.3333,98}},color={0,0,127})); + connect(valCha3.y_actual, mulMaxCha.u[2]) annotation (Line(points={{47,-25},{46, + -25},{46,-40},{-60,-40},{-60,90},{-50,90},{-50,98}}, color={0, 0,127})); connect(mulMaxCha.y, yValCha_actual) - annotation (Line(points={{-40,122},{-40,150}}, color={0,0,127})); + annotation (Line(points={{-50,122},{-50,150}}, color={0,0,127})); + connect(valCha1.y_actual, mulMaxCha.u[3]) annotation (Line(points={{-5,67},{ + -6,67},{-6,68},{-60,68},{-60,90},{-50.6667,90},{-50.6667,98}}, + color={0,0, + 127})); + connect(valCha1.y, yValChaMod) annotation (Line(points={{0,72},{0,134},{20,134}, + {20,150}}, color={0,0,127})); + connect(valDis1.y, yValDisMod) annotation (Line(points={{0,-48},{68,-48},{68,120}, + {80,120},{80,150}}, color={0,0,127})); + connect(senPreCHWR.port, port_CHWR) + annotation (Line(points={{80,-40},{80,-60},{100,-60}}, color={0,127,255})); + connect(senPreCHWR.p, pCHWR) + annotation (Line(points={{91,-30},{110,-30}}, color={0,0,127})); + connect(senPreCHWS.p, pCHWS) + annotation (Line(points={{91,30},{110,30}}, color={0,0,127})); + connect(senPreCHWS.port, port_CHWS) + annotation (Line(points={{80,40},{80,60},{100,60}}, color={0,127,255})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,100}}), graphics={ Line(points={{-100,-60},{100,-60}}, color={28,108,200}), diff --git a/Buildings/Fluid/Storage/Plant/TankBranch.mo b/Buildings/Fluid/Storage/Plant/TankBranch.mo index efd027315c6..7d9bb497d09 100644 --- a/Buildings/Fluid/Storage/Plant/TankBranch.mo +++ b/Buildings/Fluid/Storage/Plant/TankBranch.mo @@ -6,7 +6,8 @@ model TankBranch Buildings.Fluid.FixedResistances.PressureDrop preDroTan( redeclare package Medium = Medium, final allowFlowReversal=true, - final m_flow_nominal=nom.mTan_flow_nominal) "Flow resistance on tank branch" + final m_flow_nominal=nom.mTan_flow_nominal) + "Flow resistance on tank branch" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=90, diff --git a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialClosedTank.mo b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialClosedTank.mo index aa53101d3d0..11ce95c6207 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialClosedTank.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialClosedTank.mo @@ -11,16 +11,16 @@ partial model PartialClosedTank "(Draft)" equation connect(mSinChi_flow.y, sinChi.m_flow_in) - annotation (Line(points={{-79,0},{-70,0},{-70,-22},{-62,-22}}, + annotation (Line(points={{-69,-12},{-70,-12},{-70,-12},{-62,-12}}, color={0,0,127})); connect(tanBra.port_CHWS, supPum.port_chiOut) annotation (Line(points={{-10,6},{10,6}}, color={0,127,255})); connect(tanBra.port_CHWR, supPum.port_chiInl) annotation (Line(points={{-10,-6},{10,-6}}, color={0,127,255})); connect(supPum.port_CHWS, sin.ports[1]) annotation (Line(points={{30,6},{34,6}, - {34,30},{40,30}}, color={0,127,255})); + {34,20},{80,20}}, color={0,127,255})); connect(supPum.port_CHWR, sou.ports[1]) annotation (Line(points={{30,-6},{34, - -6},{34,-30},{40,-30}}, color={0,127,255})); + -6},{34,-20},{80,-20}}, color={0,127,255})); annotation ( Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), Icon(coordinateSystem(extent={{-100,-100},{100,100}})), diff --git a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialOpenTank.mo b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialOpenTank.mo deleted file mode 100644 index e6befdfddaa..00000000000 --- a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialOpenTank.mo +++ /dev/null @@ -1,38 +0,0 @@ -within Buildings.Fluid.Storage.Plant.Validation.BaseClasses; -partial model PartialOpenTank "(Draft)" - - extends Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialPlant; - - Buildings.Fluid.Storage.Plant.SupplyPumpOpenTank supPum(redeclare final - package Medium = Medium, final nom=nom) "Supply pump and valves" - annotation (Placement(transformation(extent={{10,-10},{30,10}}))); -equation - - connect(mSinChi_flow.y, sinChi.m_flow_in) - annotation (Line(points={{-79,0},{-70,0},{-70,-22},{-62,-22}}, - color={0,0,127})); - connect(tanBra.port_CHWS, supPum.port_chiOut) - annotation (Line(points={{-10,6},{10,6}}, color={0,127,255})); - connect(supPum.port_CHWS, sin.ports[1]) annotation (Line(points={{30,6},{34,6}, - {34,30},{40,30}}, color={0,127,255})); - connect(tanBra.port_CHWR, supPum.port_chiInl) - annotation (Line(points={{-10,-6},{10,-6}}, color={0,127,255})); - connect(supPum.port_CHWR, sou.ports[1]) annotation (Line(points={{30,-6},{34, - -6},{34,-30},{40,-30}}, color={0,127,255})); - annotation ( - Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), - Icon(coordinateSystem(extent={{-100,-100},{100,100}})), - Documentation(info=" -

-Documentation pending. -

-", revisions=" -
    -
  • -March 15, 2022 by Hongxiang Fu:
    -First implementation. This is for -#2859. -
  • -
-")); -end PartialOpenTank; diff --git a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo index 4154be67f8a..53cc959aebb 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo @@ -9,7 +9,7 @@ partial model PartialPlant "(Draft)" dp_nominal=500000, T_CHWS_nominal=280.15, T_CHWR_nominal=285.15) "Nominal values" - annotation (Placement(transformation(extent={{60,60},{80,80}}))); + annotation (Placement(transformation(extent={{60,-80},{80,-60}}))); Buildings.Fluid.Storage.Plant.TankBranch tanBra( redeclare final package Medium = Medium, @@ -25,7 +25,7 @@ partial model PartialPlant "(Draft)" annotation (Placement(transformation( extent={{10,-10},{-10,10}}, rotation=0, - origin={50,-30}))); + origin={90,-20}))); Buildings.Fluid.Sources.Boundary_pT sin( redeclare final package Medium = Medium, final nPorts=1, @@ -35,14 +35,14 @@ partial model PartialPlant "(Draft)" annotation (Placement(transformation( extent={{10,-10},{-10,10}}, rotation=0, - origin={50,30}))); + origin={90,20}))); Buildings.Fluid.Sources.MassFlowSource_T souChi( redeclare package Medium = Medium, final T=nom.T_CHWS_nominal, nPorts=1) "Source representing chiller branch outlet" annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0, - origin={-50,30}))); + origin={-50,20}))); Buildings.Fluid.Sources.MassFlowSource_T sinChi( redeclare package Medium = Medium, final use_m_flow_in=true, @@ -51,21 +51,20 @@ partial model PartialPlant "(Draft)" transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-50,-30}))); + origin={-50,-20}))); Modelica.Blocks.Sources.RealExpression mSinChi_flow( final y=souChi.ports[1].m_flow) "Mass flow rate" - annotation (Placement(transformation(extent={{-100,-10},{-80,10}}))); + annotation (Placement(transformation(extent={{-90,-22},{-70,-2}}))); equation connect(mSinChi_flow.y, sinChi.m_flow_in) - annotation (Line(points={{-79,0},{-70,0},{-70,-22},{-62,-22}}, - color={0,0,127})); - connect(souChi.ports[1], tanBra.port_chiOut) annotation (Line(points={{-40,30}, - {-34,30},{-34,6},{-30,6}}, color={0,127,255})); + annotation (Line(points={{-69,-12},{-62,-12}}, color={0,0,127})); + connect(souChi.ports[1], tanBra.port_chiOut) annotation (Line(points={{-40,20}, + {-36,20},{-36,6},{-30,6}}, color={0,127,255})); connect(tanBra.port_chiInl, sinChi.ports[1]) annotation (Line(points={{-30,-6}, - {-34,-6},{-34,-30},{-40,-30}}, color={0,127,255})); + {-36,-6},{-36,-20},{-40,-20}}, color={0,127,255})); annotation ( Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), Icon(coordinateSystem(extent={{-100,-100},{100,100}})), diff --git a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/package.order b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/package.order index 01206510d13..63b0b48c500 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/package.order +++ b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/package.order @@ -1,3 +1,2 @@ PartialClosedTank -PartialOpenTank PartialPlant diff --git a/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo index b5baa22cfba..bc1b8879e2f 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo @@ -14,41 +14,40 @@ model ClosedTankWithRemoteCharging annotation (Placement(transformation(extent={{-100,60},{-80,80}}))); Modelica.Blocks.Sources.BooleanTable uRemCha(table={0,3600/7*6}, startValue= true) "Tank is being charged remotely" - annotation (Placement(transformation(extent={{100,80},{80,100}}))); + annotation (Placement(transformation(extent={{80,80},{60,100}}))); Modelica.Blocks.Sources.BooleanTable uOnl(table={3600/7*2}) "True = plant online (outputting CHW to the network); False = offline" - annotation (Placement(transformation(extent={{100,40},{80,60}}))); + annotation (Placement(transformation(extent={{82,40},{62,60}}))); Modelica.Blocks.Sources.TimeTable set_mChi_flow(table=[0,0; 3600/7,0; 3600/7, 1; 3600/7*5,1; 3600/7*5,0]) "Chiller flow rate setpoint" annotation (Placement(transformation(extent={{-100,20},{-80,40}}))); - Buildings.Fluid.Storage.Plant.BaseClasses.ReversiblePumpValveControl - conPumSec(tankIsOpen=false) - "Control block for the secondary pump and near-by valves" + Buildings.Fluid.Storage.Plant.BaseClasses.PumpValveControl conPumVal( + tankIsOpen=false) + "Control block for the secondary pump and near-by valves" annotation (Placement(transformation(extent={{10,40},{30,60}}))); equation connect(set_mChi_flow.y, souChi.m_flow_in) - annotation (Line(points={{-79,30},{-70,30},{-70,38},{-62,38}}, + annotation (Line(points={{-79,30},{-70,30},{-70,28},{-62,28}}, color={0,0,127})); - connect(set_mTan_flow.y, conPumSec.mTanSet_flow) - annotation (Line(points={{-79,70},{6,70},{6,58},{9,58}}, color={0,0,127})); - connect(tanBra.mTan_flow, conPumSec.mTan_flow) - annotation (Line(points={{-12,11},{-12,54},{9,54}}, color={0,0,127})); - connect(supPum.yValCha_actual, conPumSec.yValCha_actual) annotation (Line( - points={{16,11},{16,36},{4,36},{4,46},{9,46}}, color={0,0,127})); - connect(supPum.yValDis_actual, conPumSec.yValDis_actual) annotation (Line( - points={{12,11},{12,34},{2,34},{2,50},{9,50}}, color={0,0,127})); - connect(conPumSec.uOnl, uOnl.y) annotation (Line(points={{32,54},{74,54},{74,50}, - {79,50}}, color={255,0,255})); - connect(conPumSec.uRemCha, uRemCha.y) - annotation (Line(points={{32,58},{32,90},{79,90}}, color={255,0,255})); - connect(conPumSec.yPum, supPum.yPum) - annotation (Line(points={{20,39},{20,11}}, color={0,0,127})); - connect(conPumSec.yValCha, supPum.yValCha) - annotation (Line(points={{24,39},{24,28},{24,28},{24,11}}, - color={0,0,127})); - connect(conPumSec.yValDis, supPum.yValDis) - annotation (Line(points={{28,39},{28,28},{28,28},{28,11}}, + connect(set_mTan_flow.y,conPumVal. mTanSet_flow) + annotation (Line(points={{-79,70},{6,70},{6,52},{9,52}}, color={0,0,127})); + connect(tanBra.mTan_flow,conPumVal. mTan_flow) + annotation (Line(points={{-12,11},{-12,48},{9,48}}, color={0,0,127})); + connect(supPum.yValCha_actual,conPumVal. yValCha_actual) annotation (Line( + points={{16,11},{16,18},{6,18},{6,40},{9,40}}, color={0,0,127})); + connect(supPum.yValDis_actual,conPumVal. yValDis_actual) annotation (Line( + points={{12,11},{12,14},{2,14},{2,44},{9,44}}, color={0,0,127})); + connect(conPumVal.uOnl, uOnl.y) annotation (Line(points={{32,56},{56,56},{56, + 50},{61,50}}, color={255,0,255})); + connect(conPumVal.uRemCha, uRemCha.y) + annotation (Line(points={{32,60},{32,90},{59,90}}, color={255,0,255})); + connect(conPumVal.yPum, supPum.yPum) + annotation (Line(points={{16,39},{16,22},{20,22},{20,11}}, color={0,0,127})); + connect(conPumVal.yValChaMod, supPum.yValCha) annotation (Line(points={{20,39}, + {20,26},{24,26},{24,11}}, color={0,0,127})); + connect(conPumVal.yValDisOn, supPum.yValDis) annotation (Line(points={{28,39}, + {28,30},{28,30},{28,11}}, color={0,0,127})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), diff --git a/Buildings/Fluid/Storage/Plant/Validation/OpenTank.mo b/Buildings/Fluid/Storage/Plant/Validation/OpenTank.mo index 586548fd73e..fe1bc722913 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/OpenTank.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/OpenTank.mo @@ -1,8 +1,9 @@ within Buildings.Fluid.Storage.Plant.Validation; model OpenTank "(Draft)" extends Modelica.Icons.Example; - extends Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialOpenTank( - souChi(final use_m_flow_in=true)); + extends Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialPlant( + souChi(final use_m_flow_in=true), + nom(final dp_nominal=300000)); Modelica.Blocks.Sources.TimeTable set_mTan_flow(table=[0,0; 3600/7,0; 3600/7, -1; 3600/7*3,-1; 3600/7*3,0; 3600/7*4,0; 3600/7*4,1; 3600/7*6,1; 3600/7 @@ -11,39 +12,93 @@ model OpenTank "(Draft)" annotation (Placement(transformation(extent={{-100,60},{-80,80}}))); Modelica.Blocks.Sources.BooleanTable uRemCha(table={0,3600/7*6}, startValue= true) "Tank is being charged remotely" - annotation (Placement(transformation(extent={{100,80},{80,100}}))); + annotation (Placement(transformation(extent={{-40,60},{-20,80}}))); Modelica.Blocks.Sources.BooleanTable uOnl(table={3600/7*2}) "True = plant online (outputting CHW to the network); False = offline" - annotation (Placement(transformation(extent={{100,40},{80,60}}))); + annotation (Placement(transformation(extent={{-60,80},{-40,100}}))); Modelica.Blocks.Sources.TimeTable set_mChi_flow(table=[0,0; 3600/7,0; 3600/7, 1; 3600/7*5,1; 3600/7*5,0]) "Chiller flow rate setpoint" annotation (Placement(transformation(extent={{-100,20},{-80,40}}))); - Buildings.Fluid.Storage.Plant.BaseClasses.ReversiblePumpValveControl - conPumSec(tankIsOpen=true) - "Control block for the secondary pump and near-by valves" + Buildings.Fluid.Storage.Plant.BaseClasses.PumpValveControl conPumVal( + tankIsOpen=true) + "Control block for the secondary pump and near-by valves" annotation (Placement(transformation(extent={{10,40},{30,60}}))); + Modelica.Blocks.Sources.Constant set_pCHWS(k=sin.p - 0.3*nom.dp_nominal) + "PSV setpoint on the supply line" + annotation (Placement(transformation(extent={{80,80},{60,100}}))); + Modelica.Blocks.Sources.Constant set_pCHWR(k=sou.p + 0.3*nom.dp_nominal) + "PSV setpoint on the return line" + annotation (Placement(transformation(extent={{80,40},{60,60}}))); + Buildings.Fluid.FixedResistances.PressureDrop preDroSup( + redeclare package Medium = Medium, + final allowFlowReversal=true, + final m_flow_nominal=nom.mTan_flow_nominal, + dp_nominal=0.3*nom.dp_nominal) "Flow resistance" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={60,20}))); + Buildings.Fluid.FixedResistances.PressureDrop preDroRet( + redeclare package Medium = Medium, + final allowFlowReversal=true, + final m_flow_nominal=nom.mTan_flow_nominal, + dp_nominal=0.3*nom.dp_nominal) "Flow resistance" annotation (Placement( + transformation( + extent={{10,-10},{-10,10}}, + rotation=0, + origin={60,-20}))); + Buildings.Fluid.Storage.Plant.SupplyPumpOpenTank supPum( + redeclare final package Medium = Medium, + final nom=nom) "Supply pump and valves" + annotation (Placement(transformation(extent={{8,-10},{28,10}}))); equation connect(set_mChi_flow.y, souChi.m_flow_in) - annotation (Line(points={{-79,30},{-70,30},{-70,38},{-62,38}}, + annotation (Line(points={{-79,30},{-70,30},{-70,28},{-62,28}}, color={0,0,127})); - connect(set_mTan_flow.y, conPumSec.mTanSet_flow) - annotation (Line(points={{-79,70},{6,70},{6,58},{9,58}}, color={0,0,127})); - connect(conPumSec.uOnl, uOnl.y) annotation (Line(points={{32,54},{74,54},{74,50}, - {79,50}}, color={255,0,255})); - connect(conPumSec.uRemCha, uRemCha.y) - annotation (Line(points={{32,58},{32,90},{79,90}}, color={255,0,255})); - connect(tanBra.mTan_flow, conPumSec.mTan_flow) - annotation (Line(points={{-12,11},{-12,54},{9,54}}, color={0,0,127})); - connect(supPum.yValDis_actual, conPumSec.yValDis_actual) annotation (Line( - points={{12,11},{12,24},{2,24},{2,50},{9,50}}, color={0,0,127})); - connect(supPum.yValCha_actual, conPumSec.yValCha_actual) annotation (Line( - points={{16,11},{16,34},{6,34},{6,46},{9,46}}, color={0,0,127})); - connect(conPumSec.yPum, supPum.yPum) - annotation (Line(points={{20,39},{20,11}}, color={0,0,127})); - connect(conPumSec.yValCha, supPum.yValCha) - annotation (Line(points={{24,39},{24,11}}, color={0,0,127})); - connect(conPumSec.yValDis, supPum.yValDis) - annotation (Line(points={{28,39},{28,11}}, color={0,0,127})); + connect(set_mTan_flow.y,conPumVal. mTanSet_flow) + annotation (Line(points={{-79,70},{-72,70},{-72,52},{9,52}}, + color={0,0,127})); + connect(conPumVal.uOnl, uOnl.y) annotation (Line(points={{32,56},{36,56},{36,90}, + {-39,90}}, color={255,0,255})); + connect(conPumVal.uRemCha, uRemCha.y) + annotation (Line(points={{32,60},{32,70},{-19,70}},color={255,0,255})); + connect(tanBra.mTan_flow,conPumVal. mTan_flow) + annotation (Line(points={{-12,11},{-12,48},{9,48}}, color={0,0,127})); + connect(supPum.yValDis_actual,conPumVal. yValDis_actual) annotation (Line( + points={{8,11},{8,16},{-2,16},{-2,44},{9,44}}, color={0,0,127})); + connect(supPum.yValCha_actual,conPumVal. yValCha_actual) annotation (Line( + points={{12,11},{12,20},{2,20},{2,40},{9,40}}, color={0,0,127})); + connect(supPum.yPum, conPumVal.yPum) annotation (Line(points={{16,11},{16,24}, + {16,24},{16,39}}, color={0,0,127})); + connect(supPum.yValChaMod, conPumVal.yValChaMod) annotation (Line(points={{20,11}, + {20,28},{20,28},{20,39}}, color={0,0,127})); + connect(conPumVal.yValChaOn, supPum.yValChaOn) annotation (Line(points={{22,39}, + {22,30},{22,30},{22,11}}, color={0,0,127})); + connect(supPum.yValDisMod, conPumVal.yValDisMod) annotation (Line(points={{26,11}, + {26,34},{26,34},{26,39}}, color={0,0,127})); + connect(conPumVal.yValDisOn, supPum.yValDisOn) annotation (Line(points={{28,39}, + {28,11}}, color={0,0,127})); + connect(conPumVal.pCHWS, supPum.pCHWS) + annotation (Line(points={{31,40},{36,40},{36,3},{29,3}}, color={0,0,127})); + connect(supPum.pCHWR, conPumVal.pCHWR) annotation (Line(points={{29,-3},{40, + -3},{40,44},{31,44}}, + color={0,0,127})); + connect(conPumVal.pCHWSSet, set_pCHWS.y) annotation (Line(points={{31,52},{50, + 52},{50,90},{59,90}}, color={0,0,127})); + connect(conPumVal.pCHWRSet, set_pCHWR.y) annotation (Line(points={{31,48},{54, + 48},{54,50},{59,50}}, color={0,0,127})); + connect(preDroSup.port_b, sin.ports[1]) + annotation (Line(points={{70,20},{80,20}}, color={0,127,255})); + connect(preDroSup.port_a, supPum.port_CHWS) annotation (Line(points={{50,20}, + {44,20},{44,6},{28,6}},color={0,127,255})); + connect(supPum.port_CHWR, preDroRet.port_b) annotation (Line(points={{28,-6}, + {44,-6},{44,-20},{50,-20}},color={0,127,255})); + connect(preDroRet.port_a, sou.ports[1]) + annotation (Line(points={{70,-20},{80,-20}}, color={0,127,255})); + connect(tanBra.port_CHWS, supPum.port_chiOut) + annotation (Line(points={{-10,6},{8,6}}, color={0,127,255})); + connect(supPum.port_chiInl, tanBra.port_CHWR) + annotation (Line(points={{8,-6},{-10,-6}}, color={0,127,255})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), From 29c76f1cdb7fb739034d2c4901bc58d48ee783c5 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Wed, 13 Apr 2022 13:48:08 -0700 Subject: [PATCH 084/463] icon adjustments --- .../Examples/BaseClasses/ChillerBranch.mo | 60 +++++++------------ 1 file changed, 23 insertions(+), 37 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/ChillerBranch.mo b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/ChillerBranch.mo index c1b60787813..8132e48de68 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/ChillerBranch.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/ChillerBranch.mo @@ -137,50 +137,36 @@ equation lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), - Ellipse(extent={{-20,20},{20,-20}}, lineColor={0,0,0}, - origin={40,-60}, - rotation=90), - Polygon(points={{-16,16},{-16,-16},{16,0},{-16,16}}, lineColor={0,0,0}, - origin={36,-60}, - rotation=180), - Line(points={{-20,-20},{-20,20},{20,-20},{20,20}}, color={0,0,0}, - rotation=90), - Line(points={{-20,0},{20,0}}, color={28,108,200}, - origin={-30,0}, - rotation=90), - Ellipse(extent={{-20,20},{20,-20}},lineColor={0,0,0}, - origin={40,60}, - rotation=90), - Line(points={{64,35},{56,5}}, color={0,0,0}, - origin={63,12}, - rotation=90), - Text( - extent={{-18,-100},{42,-80}}, - textColor={28,108,200}, - textString="m_flow"), Line( - points={{60,-60},{90,-60}}, + points={{100,60},{0,60},{0,20}}, color={28,108,200}, thickness=1), + Text( + extent={{-18,-94},{42,-74}}, + textColor={28,108,200}, + textString="m_flow"), Line( - points={{20,-60},{0,-60},{0,-20}}, + points={{100,-60},{0,-60},{0,28}}, color={28,108,200}, thickness=1), - Polygon( - points={{-30,20},{-34,10},{-26,10},{-30,20}}, - lineColor={28,108,200}, - fillColor={28,108,200}, + Ellipse(extent={{-20,20},{20,-20}},lineColor={0,0,0}, + origin={0,28}, + rotation=90, + fillColor={255,255,255}, fillPattern=FillPattern.Solid), + Line(points={{64,35},{56,5}}, color={0,0,0}, + origin={47,52}, + rotation=180), Line(points={{-35,-64},{-5,-56}}, color={0,0,0}, - origin={63,108}, - rotation=0), - Line( - points={{60,60},{90,60}}, - color={28,108,200}, - thickness=1), - Line( - points={{20,60},{0,60},{0,20}}, - color={28,108,200}, - thickness=1)})); + origin={73,12}, + rotation=-90), + Ellipse(extent={{-20,20},{20,-20}}, lineColor={0,0,0}, + origin={0,-28}, + rotation=90, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Polygon(points={{-16,16},{-16,-16},{16,0},{-16,16}}, lineColor={0,0,0}, + origin={0,-24}, + rotation=90)})); end ChillerBranch; From 54904874ee2d4dc669b050ddd8d20e3c5bd46e0a Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Wed, 13 Apr 2022 16:13:37 -0700 Subject: [PATCH 085/463] added a conditional volume to open tank to atmosph --- .../Plant/BaseClasses/NominalValues.mo | 16 ++++++++++---- .../Plant/Examples/TwoSourcesThreeUsers.mo | 17 ++++++++++---- Buildings/Fluid/Storage/Plant/TankBranch.mo | 22 +++++++++++++++++-- .../BaseClasses/PartialClosedTank.mo | 3 ++- .../ClosedTankWithRemoteCharging.mo | 2 +- .../Storage/Plant/Validation/OpenTank.mo | 5 +++-- 6 files changed, 51 insertions(+), 14 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/NominalValues.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/NominalValues.mo index 8f0e79b7471..12169806e5a 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/NominalValues.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/NominalValues.mo @@ -2,6 +2,10 @@ within Buildings.Fluid.Storage.Plant.BaseClasses; record NominalValues "Nominal values" extends Modelica.Icons.Record; + parameter Boolean tankIsOpen + "Tank is open" + annotation(dialog(group="Plant configuration")); + final parameter Modelica.Units.SI.MassFlowRate m_flow_nominal= mTan_flow_nominal+mChi_flow_nominal "Nominal mass flow rate" @@ -12,13 +16,17 @@ record NominalValues "Nominal values" parameter Modelica.Units.SI.MassFlowRate mChi_flow_nominal(min=0) "Nominal mass flow rate for CHW tank branch" annotation(dialog(group="Nominal values")); - parameter Modelica.Units.SI.PressureDifference dp_nominal(final displayUnit="Pa") + parameter Modelica.Units.SI.PressureDifference dp_nominal( + final displayUnit="Pa") "Nominal pressure difference" annotation(dialog(group="Nominal values")); - parameter Modelica.Units.SI.Temperature T_CHWS_nominal=7+273.15 - "Nominal temperature of CHW supply" + parameter Modelica.Units.SI.Temperature T_CHWS_nominal( + final displayUnit="degC")= + 7+273.15 "Nominal temperature of CHW supply" annotation(dialog(group="Nominal values")); - parameter Modelica.Units.SI.Temperature T_CHWR_nominal=12+273.15 + parameter Modelica.Units.SI.Temperature T_CHWR_nominal( + final displayUnit="degC")= + 12+273.15 "Nominal temperature of CHW return" annotation(dialog(group="Nominal values")); diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index b9c988630fc..dede25edf00 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -8,13 +8,21 @@ model TwoSourcesThreeUsers parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=1 "Nominal mass flow rate"; - parameter Modelica.Units.SI.PressureDifference dp_nominal=500000 + parameter Modelica.Units.SI.PressureDifference dp_nominal( + final displayUnit="Pa")= + 500000 "Nominal pressure difference"; - parameter Modelica.Units.SI.AbsolutePressure p_Pressurisation=300000 + parameter Modelica.Units.SI.AbsolutePressure p_Pressurisation( + final displayUnit="Pa")= + 300000 "Pressurisation point"; - parameter Modelica.Units.SI.Temperature T_CHWR_nominal=12+273.15 + parameter Modelica.Units.SI.Temperature T_CHWR_nominal( + final displayUnit="degC")= + 12+273.15 "Nominal temperature of CHW return"; - parameter Modelica.Units.SI.Temperature T_CHWS_nominal=7+273.15 + parameter Modelica.Units.SI.Temperature T_CHWS_nominal( + final displayUnit="degC")= + 7+273.15 "Nominal temperature of CHW supply"; parameter Modelica.Units.SI.Power QCooLoa_flow_nominal=5*4200*0.6 "Nominal cooling load of one consumer"; @@ -131,6 +139,7 @@ model TwoSourcesThreeUsers // Second source: chiller and tank Buildings.Fluid.Storage.Plant.BaseClasses.NominalValues nomPla2( + tankIsOpen=false, mTan_flow_nominal=0.75*m_flow_nominal, mChi_flow_nominal=0.75*m_flow_nominal, dp_nominal=dp_nominal, diff --git a/Buildings/Fluid/Storage/Plant/TankBranch.mo b/Buildings/Fluid/Storage/Plant/TankBranch.mo index 7d9bb497d09..29c51fca410 100644 --- a/Buildings/Fluid/Storage/Plant/TankBranch.mo +++ b/Buildings/Fluid/Storage/Plant/TankBranch.mo @@ -3,6 +3,8 @@ model TankBranch "(Draft) Model of the tank branch where the tank can potentially be charged remotely" extends Buildings.Fluid.Storage.Plant.BaseClasses.PartialBranchPorts; + final parameter Boolean tankIsOpen = nom.tankIsOpen "Tank is open"; + Buildings.Fluid.FixedResistances.PressureDrop preDroTan( redeclare package Medium = Medium, final allowFlowReversal=true, @@ -20,7 +22,6 @@ model TankBranch extent={{10,-10},{-10,10}}, rotation=270, origin={80,110}))); - Buildings.Fluid.Storage.Stratified tan( redeclare package Medium = Medium, final allowFlowReversal=true, @@ -42,6 +43,15 @@ model TankBranch annotation (Placement(transformation(extent={{-10,10},{10,-10}}, rotation=90, origin={-30,-30}))); + Buildings.Fluid.Sources.Boundary_pT atm( + redeclare final package Medium = Medium, + final p(displayUnit="Pa") = 101325, + final T=nom.T_CHWS_nominal, + final nPorts=1) if tankIsOpen + "Atmosphere pressure" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-10,90}))); equation connect(sen_m_flow.m_flow, mTan_flow) annotation (Line(points={{-19,-30},{80,-30}, {80,110}}, color={0,0,127})); @@ -58,6 +68,8 @@ equation annotation (Line(points={{30,40},{30,60},{100,60}}, color={0,127,255})); connect(port_CHWR, sen_m_flow.port_a) annotation (Line(points={{100,-60},{-30, -60},{-30,-40}}, color={0,127,255})); + connect(atm.ports[1], tan.port_a) + annotation (Line(points={{-10,80},{-10,0}}, color={0,127,255})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,100}}), graphics={ Line(points={{-100,-60},{100,-60}}, color={28,108,200}), @@ -67,7 +79,13 @@ equation extent={{-20,40},{20,-40}}, lineColor={0,0,0}, fillColor={255,255,255}, - fillPattern=FillPattern.Solid)}), Diagram( + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-26,36},{26,26}}, + lineColor={255,255,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + visible=tankIsOpen)}), Diagram( coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}})), Documentation(info="

diff --git a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialClosedTank.mo b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialClosedTank.mo index 11ce95c6207..4554e7cf692 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialClosedTank.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialClosedTank.mo @@ -1,7 +1,8 @@ within Buildings.Fluid.Storage.Plant.Validation.BaseClasses; partial model PartialClosedTank "(Draft)" - extends Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialPlant; + extends Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialPlant(nom( + final tankIsOpen=false)); Buildings.Fluid.Storage.Plant.SupplyPumpClosedTank supPum( redeclare final package Medium = Medium, diff --git a/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo index bc1b8879e2f..230dec31f83 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo @@ -22,7 +22,7 @@ model ClosedTankWithRemoteCharging 1; 3600/7*5,1; 3600/7*5,0]) "Chiller flow rate setpoint" annotation (Placement(transformation(extent={{-100,20},{-80,40}}))); Buildings.Fluid.Storage.Plant.BaseClasses.PumpValveControl conPumVal( - tankIsOpen=false) + final tankIsOpen=nom.tankIsOpen) "Control block for the secondary pump and near-by valves" annotation (Placement(transformation(extent={{10,40},{30,60}}))); equation diff --git a/Buildings/Fluid/Storage/Plant/Validation/OpenTank.mo b/Buildings/Fluid/Storage/Plant/Validation/OpenTank.mo index fe1bc722913..f6ed736fc06 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/OpenTank.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/OpenTank.mo @@ -3,7 +3,8 @@ model OpenTank "(Draft)" extends Modelica.Icons.Example; extends Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialPlant( souChi(final use_m_flow_in=true), - nom(final dp_nominal=300000)); + nom(final tankIsOpen=true, + final dp_nominal=300000)); Modelica.Blocks.Sources.TimeTable set_mTan_flow(table=[0,0; 3600/7,0; 3600/7, -1; 3600/7*3,-1; 3600/7*3,0; 3600/7*4,0; 3600/7*4,1; 3600/7*6,1; 3600/7 @@ -20,7 +21,7 @@ model OpenTank "(Draft)" 1; 3600/7*5,1; 3600/7*5,0]) "Chiller flow rate setpoint" annotation (Placement(transformation(extent={{-100,20},{-80,40}}))); Buildings.Fluid.Storage.Plant.BaseClasses.PumpValveControl conPumVal( - tankIsOpen=true) + final tankIsOpen=nom.tankIsOpen) "Control block for the secondary pump and near-by valves" annotation (Placement(transformation(extent={{10,40},{30,60}}))); Modelica.Blocks.Sources.Constant set_pCHWS(k=sin.p - 0.3*nom.dp_nominal) From 746ba4e34d01621129b9e7741e2a461cde103c66 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Thu, 14 Apr 2022 10:29:24 -0700 Subject: [PATCH 086/463] parameterisation adjustments --- .../Plant/BaseClasses/PartialBranchPorts.mo | 24 ++++++++++-------- .../Plant/Examples/OneSourceOneUser.mo | 3 ++- .../Storage/Plant/SupplyPumpClosedTank.mo | 8 +++--- .../Fluid/Storage/Plant/SupplyPumpOpenTank.mo | 25 +++++++++++-------- .../Validation/BaseClasses/PartialPlant.mo | 2 +- 5 files changed, 35 insertions(+), 27 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/PartialBranchPorts.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/PartialBranchPorts.mo index c48cd820993..f50841806de 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/PartialBranchPorts.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/PartialBranchPorts.mo @@ -8,29 +8,33 @@ model PartialBranchPorts parameter Buildings.Fluid.Storage.Plant.BaseClasses.NominalValues nom "Nominal values"; - Modelica.Fluid.Interfaces.FluidPort_a port_CHWR(redeclare package Medium = - Medium) + Modelica.Fluid.Interfaces.FluidPort_a port_CHWR( + redeclare final package Medium = Medium, + p(displayUnit="Pa")) "Port that connects CHW return line to the warmer side of the tank" annotation (Placement(transformation(extent={{90,-70},{110,-50}}), iconTransformation(extent={{90,-70},{110,-50}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_CHWS(redeclare package Medium = - Medium) + Modelica.Fluid.Interfaces.FluidPort_b port_CHWS( + redeclare final package Medium = Medium, + p(displayUnit="Pa")) "Port that connects the cooler side of the tank to the CHW supply line" annotation (Placement(transformation(extent={{90,50},{110,70}}), iconTransformation(extent={{90,50},{110,70}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_chiInl(redeclare package Medium = - Medium) + Modelica.Fluid.Interfaces.FluidPort_b port_chiInl( + redeclare final package Medium = Medium, + p(displayUnit="Pa")) "Port that connects the warmer side of the tank to the chiller inlet" annotation (Placement(transformation(extent={{-110,-70},{-90,-50}}), iconTransformation(extent={{-110,-70},{-90,-50}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_chiOut(redeclare package Medium = - Medium) + Modelica.Fluid.Interfaces.FluidPort_a port_chiOut( + redeclare final package Medium = Medium, + p(displayUnit="Pa")) "Port that connects the chiller outlet to the warmer side of the tank" annotation (Placement(transformation(extent={{-110,50},{-90,70}}), iconTransformation(extent={{-110,50},{-90,70}}))); + equation - connect(port_CHWS, port_CHWS) - annotation (Line(points={{100,60},{100,60}}, color={0,127,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,100}}), graphics={ Text( diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo index 0b557324323..5280644af18 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo @@ -10,9 +10,10 @@ model OneSourceOneUser "(Draft) Simple system model with one source and one user "Nominal cooling load of one consumer"; Buildings.Fluid.Storage.Plant.BaseClasses.NominalValues nom( + tankIsOpen=false, mTan_flow_nominal=0.5, mChi_flow_nominal=0.5, - dp_nominal=500000, + dp_nominal=300000, T_CHWS_nominal=280.15, T_CHWR_nominal=285.15) "Nominal values" annotation (Placement(transformation(extent={{-80,60},{-60,80}}))); diff --git a/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo b/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo index b0d6d8ce00e..4b50abef3a3 100644 --- a/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo +++ b/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo @@ -153,12 +153,12 @@ equation fillColor={255,255,255}, fillPattern=FillPattern.Solid), Polygon( - points={{40,60},{20,70},{20,50},{40,60}}, + points={{40,60},{24,70},{24,50},{40,60}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), Polygon( - points={{40,60},{60,70},{60,50},{40,60}}, + points={{40,60},{56,70},{56,50},{40,60}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), @@ -167,13 +167,13 @@ equation color={28,108,200}, visible=allowRemoteCharging), Polygon( - points={{40,20},{20,30},{20,10},{40,20}}, + points={{40,20},{24,30},{24,10},{40,20}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid, visible=allowRemoteCharging), Polygon( - points={{40,20},{60,30},{60,10},{40,20}}, + points={{40,20},{56,30},{56,10},{40,20}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid, diff --git a/Buildings/Fluid/Storage/Plant/SupplyPumpOpenTank.mo b/Buildings/Fluid/Storage/Plant/SupplyPumpOpenTank.mo index 2fae54a648e..9151f230dd2 100644 --- a/Buildings/Fluid/Storage/Plant/SupplyPumpOpenTank.mo +++ b/Buildings/Fluid/Storage/Plant/SupplyPumpOpenTank.mo @@ -275,62 +275,62 @@ equation fillColor={255,255,255}, fillPattern=FillPattern.None), Polygon( - points={{10,0},{-10,10},{-10,-10},{10,0}}, + points={{10,0},{-6,10},{-6,-10},{10,0}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid, origin={60,-40}, rotation=90), Polygon( - points={{-10,0},{10,10},{10,-10},{-10,0}}, + points={{-10,0},{6,10},{6,-10},{-10,0}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid, origin={60,-20}, rotation=90), Polygon( - points={{0,60},{-20,70},{-20,50},{0,60}}, + points={{0,60},{-16,70},{-16,50},{0,60}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), Polygon( - points={{0,60},{20,70},{20,50},{0,60}}, + points={{0,60},{16,70},{16,50},{0,60}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), Polygon( - points={{0,-60},{-20,-50},{-20,-70},{0,-60}}, + points={{0,-60},{-16,-50},{-16,-70},{0,-60}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), Polygon( - points={{0,-60},{20,-50},{20,-70},{0,-60}}, + points={{0,-60},{16,-50},{16,-70},{0,-60}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), Polygon( - points={{10,0},{-10,10},{-10,-10},{10,0}}, + points={{10,0},{-6,10},{-6,-10},{10,0}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid, origin={-60,20}, rotation=90), Polygon( - points={{-10,0},{10,10},{10,-10},{-10,0}}, + points={{-10,0},{6,10},{6,-10},{-10,0}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid, origin={-60,40}, rotation=90), Polygon( - points={{10,0},{-10,10},{-10,-10},{10,0}}, + points={{10,0},{-6,10},{-6,-10},{10,0}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid, origin={-60,-40}, rotation=90), Polygon( - points={{-10,0},{10,10},{10,-10},{-10,0}}, + points={{-10,0},{6,10},{6,-10},{-10,0}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid, @@ -349,7 +349,10 @@ equation fillColor={255,255,255}, fillPattern=FillPattern.Solid, origin={60,40}, - rotation=90)}), Diagram( + rotation=90), + Line(points={{0,60},{0,80},{26,80},{26,60}}, color={0,0,0}), + Line(points={{0,-60},{0,-80},{26,-80},{26,-60}}, color={0,0,0})}), + Diagram( coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,140}})), Documentation(info="

diff --git a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo index 53cc959aebb..cb0e7b2648a 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo @@ -6,7 +6,7 @@ partial model PartialPlant "(Draft)" Buildings.Fluid.Storage.Plant.BaseClasses.NominalValues nom( mTan_flow_nominal=1, mChi_flow_nominal=1, - dp_nominal=500000, + dp_nominal=300000, T_CHWS_nominal=280.15, T_CHWR_nominal=285.15) "Nominal values" annotation (Placement(transformation(extent={{60,-80},{80,-60}}))); From 5a764481e7dc945ac7cb091ac71d85031e65dc14 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Thu, 14 Apr 2022 10:30:31 -0700 Subject: [PATCH 087/463] split tank branch resistance to both sides --- .../Plant/Examples/OneSourceOneUser.mo | 5 ++- .../Plant/Examples/TwoSourcesThreeUsers.mo | 8 ++-- Buildings/Fluid/Storage/Plant/TankBranch.mo | 42 ++++++++++++------- .../Validation/BaseClasses/PartialPlant.mo | 5 ++- 4 files changed, 36 insertions(+), 24 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo index 5280644af18..fcfc0b9e4a3 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo @@ -19,9 +19,10 @@ model OneSourceOneUser "(Draft) Simple system model with one source and one user annotation (Placement(transformation(extent={{-80,60},{-60,80}}))); Buildings.Fluid.Storage.Plant.TankBranch tanBra( + preDroTanBot(final dp_nominal=nom.dp_nominal*0.05), + preDroTanTop(final dp_nominal=nom.dp_nominal*0.05), redeclare final package Medium = Medium, - final nom=nom, - final preDroTan(final dp_nominal=nom.dp_nominal*0.1)) "Tank branch" + final nom=nom) "Tank branch" annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); Buildings.Fluid.Storage.Plant.Examples.BaseClasses.ChillerBranch chiBra( redeclare final package Medium = Medium, diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index dede25edf00..14ebbbdcab1 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -147,11 +147,11 @@ model TwoSourcesThreeUsers T_CHWR_nominal=T_CHWS_nominal) "Nominal values for the second plant" annotation (Placement(transformation(extent={{-180,-60},{-160,-40}}))); Buildings.Fluid.Storage.Plant.TankBranch tanBra( + preDroTanBot(final dp_nominal=nomPla2.dp_nominal*0.05), + preDroTanTop(final dp_nominal=nomPla2.dp_nominal*0.05), redeclare final package Medium = MediumCHW, - final nom=nomPla2, - final preDroTan(final dp_nominal=nomPla2.dp_nominal*0.1)) - "Tank branch, tank can be charged remotely" annotation (Placement( - transformation( + final nom=nomPla2) "Tank branch, tank can be charged remotely" annotation ( + Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-100,-60}))); diff --git a/Buildings/Fluid/Storage/Plant/TankBranch.mo b/Buildings/Fluid/Storage/Plant/TankBranch.mo index 29c51fca410..cfe4d890c63 100644 --- a/Buildings/Fluid/Storage/Plant/TankBranch.mo +++ b/Buildings/Fluid/Storage/Plant/TankBranch.mo @@ -5,15 +5,15 @@ model TankBranch final parameter Boolean tankIsOpen = nom.tankIsOpen "Tank is open"; - Buildings.Fluid.FixedResistances.PressureDrop preDroTan( + Buildings.Fluid.FixedResistances.PressureDrop preDroTanBot( redeclare package Medium = Medium, final allowFlowReversal=true, final m_flow_nominal=nom.mTan_flow_nominal) - "Flow resistance on tank branch" - annotation (Placement(transformation( + "Flow resistance on tank branch near tank bottom" annotation (Placement( + transformation( extent={{-10,-10},{10,10}}, - rotation=90, - origin={30,30}))); + rotation=0, + origin={30,0}))); Modelica.Blocks.Interfaces.RealOutput mTan_flow "Mass flow rate through the tank" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -42,7 +42,7 @@ model TankBranch final allowFlowReversal=true) "Flow rate sensor" annotation (Placement(transformation(extent={{-10,10},{10,-10}}, rotation=90, - origin={-30,-30}))); + origin={50,30}))); Buildings.Fluid.Sources.Boundary_pT atm( redeclare final package Medium = Medium, final p(displayUnit="Pa") = 101325, @@ -52,24 +52,34 @@ model TankBranch extent={{-10,-10},{10,10}}, rotation=-90, origin={-10,90}))); + FixedResistances.PressureDrop preDroTanTop( + redeclare package Medium = Medium, + final allowFlowReversal=true, + final m_flow_nominal=nom.mTan_flow_nominal) + "Flow resistance on tank branch near tank top" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-30,0}))); equation - connect(sen_m_flow.m_flow, mTan_flow) annotation (Line(points={{-19,-30},{80,-30}, + connect(sen_m_flow.m_flow, mTan_flow) annotation (Line(points={{61,30},{80,30}, {80,110}}, color={0,0,127})); - connect(preDroTan.port_a, tan.port_b) annotation (Line(points={{30,20},{30,0}, - {10,0}}, color={0,127,255})); - connect(sen_m_flow.port_b, tan.port_a) - annotation (Line(points={{-30,-20},{-30,0},{-10,0}}, - color={0,127,255})); connect(port_chiOut, port_CHWS) annotation (Line(points={{-100,60},{100,60}}, color={0,127,255})); connect(port_chiInl, port_CHWR) annotation (Line(points={{-100,-60},{100,-60}}, color={0,127,255})); - connect(preDroTan.port_b, port_CHWS) - annotation (Line(points={{30,40},{30,60},{100,60}}, color={0,127,255})); - connect(port_CHWR, sen_m_flow.port_a) annotation (Line(points={{100,-60},{-30, - -60},{-30,-40}}, color={0,127,255})); connect(atm.ports[1], tan.port_a) annotation (Line(points={{-10,80},{-10,0}}, color={0,127,255})); + connect(preDroTanBot.port_b, sen_m_flow.port_a) + annotation (Line(points={{40,0},{50,0},{50,20}}, color={0,127,255})); + connect(tan.port_b, preDroTanBot.port_a) + annotation (Line(points={{10,0},{20,0}}, color={0,127,255})); + connect(preDroTanTop.port_b, tan.port_a) + annotation (Line(points={{-20,0},{-10,0}}, color={0,127,255})); + connect(preDroTanTop.port_a, port_chiInl) annotation (Line(points={{-40,0},{ + -78,0},{-78,-60},{-100,-60}}, color={0,127,255})); + connect(sen_m_flow.port_b, port_CHWS) + annotation (Line(points={{50,40},{50,60},{100,60}}, color={0,127,255})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,100}}), graphics={ Line(points={{-100,-60},{100,-60}}, color={28,108,200}), diff --git a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo index cb0e7b2648a..ed5166ca4f7 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo @@ -12,9 +12,10 @@ partial model PartialPlant "(Draft)" annotation (Placement(transformation(extent={{60,-80},{80,-60}}))); Buildings.Fluid.Storage.Plant.TankBranch tanBra( + preDroTanBot(final dp_nominal=nom.dp_nominal*0.05), + preDroTanTop(final dp_nominal=nom.dp_nominal*0.05), redeclare final package Medium = Medium, - final nom=nom, - final preDroTan(final dp_nominal=nom.dp_nominal*0.1)) "Tank branch" + final nom=nom) "Tank branch" annotation (Placement(transformation(extent={{-30,-10},{-10,10}}))); Buildings.Fluid.Sources.Boundary_pT sou( redeclare final package Medium = Medium, From b8ca7534fd7169496790d710a464a4c6329b9c80 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Mon, 18 Apr 2022 08:14:10 -0700 Subject: [PATCH 088/463] packaged ideal chiller to a model --- .../Plant/BaseClasses/PumpValveControl.mo | 268 +++++++++--------- .../Examples/BaseClasses/ChillerBranch.mo | 2 + .../Plant/Examples/TwoSourcesThreeUsers.mo | 11 +- Buildings/Fluid/Storage/Plant/TankBranch.mo | 61 ++-- .../BaseClasses/IdealChillerBranch.mo | 106 +++++++ .../BaseClasses/PartialClosedTank.mo | 15 +- .../Validation/BaseClasses/PartialPlant.mo | 38 +-- .../Validation/BaseClasses/package.order | 1 + .../Validation/ClosedTankNoRemoteCharging.mo | 10 +- .../ClosedTankWithRemoteCharging.mo | 22 +- .../Plant/Examples/OneSourceOneUser.mos | 2 +- .../Plant/Examples/TwoSourcesThreeUsers.mos | 2 +- .../Validation/ClosedTankNoRemoteCharging.mos | 2 +- .../ClosedTankWithRemoteCharging.mos | 2 +- 14 files changed, 324 insertions(+), 218 deletions(-) create mode 100644 Buildings/Fluid/Storage/Plant/Validation/BaseClasses/IdealChillerBranch.mo diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo index f680771db3c..50a22c46d15 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo @@ -7,29 +7,20 @@ block PumpValveControl Modelica.Blocks.Sources.Constant zero(k=0) "Constant 0" annotation (Placement(transformation(extent={{-120,-100},{-100,-80}}))); - Buildings.Controls.Continuous.LimPID conPI_pumSecNor( - controllerType=Modelica.Blocks.Types.SimpleController.PI, - k=5, - Ti=50, - reverseActing=false) "Normal-acting PI controller" annotation (Placement( - transformation( - extent={{-10,10},{10,-10}}, - rotation=-90, - origin={-40,10}))); Buildings.Controls.Continuous.LimPID conPI_valCha( controllerType=Modelica.Blocks.Types.SimpleController.PI, k=5, Ti=50, reverseActing=false) if not tankIsOpen "PI controller" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, + extent={{-10,10},{10,-10}}, rotation=-90, - origin={-10,50}))); + origin={10,10}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uRemCha "Tank is being charged remotely" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, - origin={130,110}), iconTransformation(extent={{20,-20},{ + origin={210,110}), iconTransformation(extent={{20,-20},{ -20,20}}, rotation=0, origin={120,100}))); @@ -37,15 +28,16 @@ block PumpValveControl "Tank mass flow rate setpoint" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-130,70}), iconTransformation( + origin={-130,88}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-110,20}))); - Modelica.Blocks.Interfaces.RealInput mTan_flow "Measured tank mass flow rate" - annotation (Placement(transformation( + origin={-110,40}))); + Modelica.Blocks.Interfaces.RealInput mTanBot_flow + "Flow rate measured at the bottom of the tank" annotation (Placement( + transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-130,50}),iconTransformation( + origin={-130,50}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-110,-20}))); @@ -53,7 +45,7 @@ block PumpValveControl "= true if plant is online (not cut off from the network by valve)" annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=180, - origin={130,50}), + origin={210,30}), iconTransformation(extent={{20,-20},{-20,20}}, rotation=0, origin={120,60}))); @@ -64,7 +56,7 @@ block PumpValveControl origin={-70,-170}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={-40,-110}))); + origin={-20,-110}))); Modelica.Blocks.Interfaces.RealOutput yValChaMod "Valve position, modulating signal" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -72,7 +64,7 @@ block PumpValveControl origin={-20,-170}),iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={0,-110}))); + origin={20,-110}))); Modelica.Blocks.Interfaces.RealOutput yValDisOn "Valve position, on-off signal" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -80,7 +72,7 @@ block PumpValveControl origin={90,-170}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={80,-110}))); + origin={100,-110}))); Modelica.Blocks.Interfaces.RealInput yValCha_actual "Actual valve position" annotation (Placement(transformation( extent={{10,-10},{-10,10}}, @@ -99,9 +91,9 @@ block PumpValveControl extent={{-10,-10},{10,10}}, rotation=0, origin={-110,-60}))); - Buildings.Controls.OBC.CDL.Continuous.LessThreshold isValDisClo(t=0.05) + Buildings.Controls.OBC.CDL.Continuous.LessThreshold isValDisClo(t=0.01) "= true if valve closed" - annotation (Placement(transformation(extent={{20,20},{40,40}}))); + annotation (Placement(transformation(extent={{40,100},{60,120}}))); Buildings.Controls.OBC.CDL.Continuous.Switch swiPum "True = on (y>0); false = off (y=0)." annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -120,50 +112,38 @@ block PumpValveControl rotation=-90, origin={-20,-130}))); Buildings.Controls.OBC.CDL.Logical.And3 and3 - "Plant online AND not charging remotely AND valCha closed" - annotation (Placement( - transformation( + "Plant online AND not charging remotely AND valCha closed" annotation ( + Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={110,30}))); - Buildings.Controls.OBC.CDL.Continuous.LessThreshold isValChaClo(t=0.05) + origin={170,10}))); + Buildings.Controls.OBC.CDL.Continuous.LessThreshold isValChaClo(t=0.01) "= true if valve closed" - annotation (Placement(transformation(extent={{20,60},{40,80}}))); + annotation (Placement(transformation(extent={{40,140},{60,160}}))); Buildings.Controls.OBC.CDL.Logical.Not notRemCha "Tank is not being charged remotely" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={110,90}))); + origin={180,70}))); Buildings.Controls.OBC.CDL.Logical.And andValCha "Charging remotely AND valDis closed" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={70,10}))); + origin={130,10}))); Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToReaValCha if tankIsOpen "True = 1, false = 0" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={10,-130}))); - Buildings.Controls.Continuous.LimPID conPI_pumSecRev( + Buildings.Controls.Continuous.LimPID conPI_pumSecNeg( controllerType=Modelica.Blocks.Types.SimpleController.PI, k=5, Ti=50, - reverseActing=true) "Reverse-acting PI controller" + reverseActing=true) "PI controller for negative tank flow" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={-80,10}))); - Buildings.Controls.OBC.CDL.Continuous.Switch swiPumAct - "True = mTanSet_flow > 0, reverse acting; false = mTanSet_flow < 0, normal acting" - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={-60,-70}))); - Buildings.Controls.OBC.CDL.Continuous.LessThreshold isPos(t=0) - "= true if mTanSet_flow > 0" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={-60,-30}))); + origin={-70,10}))); Modelica.Blocks.Interfaces.RealOutput yValChaOn if tankIsOpen "Valve position, on-off signal" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -171,7 +151,7 @@ block PumpValveControl origin={10,-170}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={20,-110}))); + origin={40,-110}))); Modelica.Blocks.Interfaces.RealOutput yValDisMod if tankIsOpen "Valve position, modulating signal" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -179,44 +159,12 @@ block PumpValveControl origin={60,-170}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={60,-110}))); + origin={80,-110}))); Buildings.Controls.OBC.CDL.Continuous.Switch swiValDis if tankIsOpen "True = on (y>0); false = off (y=0)." annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={60,-130}))); - Modelica.Blocks.Interfaces.RealInput pCHWSSet if tankIsOpen - "Pressure setpoint at supply line" annotation (Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=0, - origin={130,-10}), iconTransformation( - extent={{10,-10},{-10,10}}, - rotation=0, - origin={110,20}))); - Modelica.Blocks.Interfaces.RealInput pCHWRSet if tankIsOpen - "Pressure setpoint at return line" annotation (Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=0, - origin={130,-30}), iconTransformation( - extent={{10,-10},{-10,10}}, - rotation=0, - origin={110,-20}))); - Modelica.Blocks.Interfaces.RealInput pCHWS if tankIsOpen - "Pressure at supply line" annotation (Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=0, - origin={130,-50}), iconTransformation( - extent={{10,-10},{-10,10}}, - rotation=0, - origin={110,-100}))); - Modelica.Blocks.Interfaces.RealInput pCHWR if tankIsOpen - "Pressure at return line" annotation (Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=0, - origin={130,-70}), iconTransformation( - extent={{10,-10},{-10,10}}, - rotation=0, - origin={110,-60}))); Buildings.Controls.Continuous.LimPID conPI_valChaMod( controllerType=Modelica.Blocks.Types.SimpleController.PI, k=5, @@ -225,27 +173,63 @@ block PumpValveControl transformation( extent={{-10,10},{10,-10}}, rotation=-90, - origin={30,-50}))); + origin={50,10}))); Buildings.Controls.Continuous.LimPID conPI_valDisMod( controllerType=Modelica.Blocks.Types.SimpleController.PI, k=5, Ti=50, - reverseActing=false) if tankIsOpen "PI controller" annotation (Placement( + reverseActing=true) if tankIsOpen "PI controller" annotation (Placement( transformation( extent={{-10,10},{10,-10}}, rotation=-90, - origin={90,-70}))); + origin={90,10}))); + Modelica.Blocks.Interfaces.RealInput mTanTop_flow if tankIsOpen + "Flow rate measured at the top of the tank" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-130,68}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-110,0}))); + + Controls.Continuous.LimPID conPI_pumSecPos( + controllerType=Modelica.Blocks.Types.SimpleController.PI, + k=5, + Ti=50, + reverseActing=false) "PI controller for positive tank flow" annotation ( + Placement(transformation( + extent={{-10,10},{10,-10}}, + rotation=-90, + origin={-30,10}))); + Controls.OBC.CDL.Continuous.LessThreshold isPos(t=0) + "= true tank flow setpoint is positive" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-50,-30}))); + Controls.OBC.CDL.Continuous.Switch swiPum1 + "True = on (y>0); false = off (y=0)." annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={-50,-70}))); equation - connect(conPI_pumSecNor.u_m, mTan_flow) annotation (Line(points={{-28,10},{ - -22,10},{-22,-8},{-100,-8},{-100,50},{-130,50}}, + if tankIsOpen then + connect(uOnl, swiPum.u2) annotation (Line(points={{210,30},{190,30},{190, + -100},{-70,-100},{-70,-118}}, + color={255,0,255})); + else + connect(and3.y, swiPum.u2) annotation (Line(points={{170,-2},{170,-100},{-70, + -100},{-70,-118}}, color={255,0,255})); + end if; + + connect(conPI_valCha.u_s,mTanSet_flow) annotation (Line(points={{10,22},{10, + 28},{-70,28},{-70,88},{-130,88}}, color={0,0,127})); - connect(conPI_pumSecNor.u_s, mTanSet_flow) - annotation (Line(points={{-40,22},{-40,70},{-130,70}}, color={0,0,127})); - connect(conPI_valCha.u_s,mTanSet_flow) annotation (Line(points={{-10,62},{ - -10,70},{-130,70}}, color={0,0,127})); - connect(conPI_valCha.u_m, mTan_flow) - annotation (Line(points={{-22,50},{-130,50}}, color={0,0,127})); + connect(conPI_valCha.u_m, mTanBot_flow) annotation (Line(points={{22,10},{28, + 10},{28,50},{-130,50}}, + color={0,0,127})); connect(yValDisOn, yValDisOn) annotation (Line(points={{90,-170},{90,-170}}, color={0,0,127})); connect(swiPum.y, yPum) @@ -260,81 +244,83 @@ equation -28,-118}}, color={0,0,127})); connect(isValChaClo.u, yValCha_actual) - annotation (Line(points={{18,70},{14,70},{14,110},{-112,110},{-112,-10},{ - -130,-10}}, color={0,0,127})); + annotation (Line(points={{38,150},{-106,150},{-106,-10},{-130,-10}}, + color={0,0,127})); connect(isValDisClo.u, yValDis_actual) - annotation (Line(points={{18,30},{8,30},{8,104},{-106,104},{-106,-50},{-130, - -50}}, color={0,0,127})); - connect(isValDisClo.y, andValCha.u2) annotation (Line(points={{42,30},{62,30}, - {62,22}}, color={255,0,255})); - connect(andValCha.y, swiValCha.u2) annotation (Line(points={{70,-2},{70,-80}, + annotation (Line(points={{38,110},{-100,110},{-100,-50},{-130,-50}}, + color={0,0,127})); + connect(isValDisClo.y, andValCha.u2) annotation (Line(points={{62,110},{122, + 110},{122,22}}, color={255,0,255})); + connect(andValCha.y, swiValCha.u2) annotation (Line(points={{130,-2},{130,-80}, {10,-80},{10,-112},{-20,-112},{-20,-118}}, color={255,0,255})); - connect(conPI_valCha.y, swiValCha.u1) annotation (Line(points={{-10,39},{-10, - -70},{-12,-70},{-12,-118}}, + connect(conPI_valCha.y, swiValCha.u1) annotation (Line(points={{10,-1},{10, + -20},{-12,-20},{-12,-118}}, color={0,0,127})); - connect(and3.y, swiPum.u2) annotation (Line(points={{110,18},{110,-100},{-70, - -100},{-70,-118}}, - color={255,0,255})); connect(booToReaValDis.y, yValDisOn) annotation (Line(points={{90,-142},{90,-170}}, color={0,0,127})); - connect(and3.y, booToReaValDis.u) annotation (Line(points={{110,18},{110,-100}, - {90,-100},{90,-118}}, - color={255,0,255})); + connect(and3.y, booToReaValDis.u) annotation (Line(points={{170,-2},{170,-100}, + {90,-100},{90,-118}}, color={255,0,255})); connect(uRemCha, notRemCha.u) - annotation (Line(points={{130,110},{110,110},{110,102}}, + annotation (Line(points={{210,110},{180,110},{180,82}}, color={255,0,255})); connect(andValCha.u1, uRemCha) - annotation (Line(points={{70,22},{70,110},{130,110}}, + annotation (Line(points={{130,22},{130,110},{210,110}}, color={255,0,255})); connect(and3.u3, isValChaClo.y) - annotation (Line(points={{102,42},{102,70},{42,70}}, color={255,0,255})); - connect(notRemCha.y, and3.u2) - annotation (Line(points={{110,78},{110,42}},color={255,0,255})); - connect(andValCha.y, booToReaValCha.u) annotation (Line(points={{70,-2},{70, + annotation (Line(points={{162,22},{162,150},{62,150}}, color={255,0,255})); + connect(notRemCha.y, and3.u2) annotation (Line(points={{180,58},{180,40},{170, + 40},{170,22}}, color={255,0,255})); + connect(andValCha.y, booToReaValCha.u) annotation (Line(points={{130,-2},{130, -80},{10,-80},{10,-118}}, color={255,0,255})); - connect(conPI_pumSecRev.u_m, mTan_flow) annotation (Line(points={{-92,10},{ - -100,10},{-100,50},{-130,50}}, - color={0,0,127})); - connect(conPI_pumSecRev.u_s, mTanSet_flow) - annotation (Line(points={{-80,22},{-80,70},{-130,70}}, color={0,0,127})); - connect(conPI_pumSecNor.y, swiPumAct.u1) - annotation (Line(points={{-40,-1},{-40,-58},{-52,-58}}, color={0,0,127})); - connect(conPI_pumSecRev.y, swiPumAct.u3) - annotation (Line(points={{-80,-1},{-80,-58},{-68,-58}}, color={0,0,127})); - connect(isPos.u, mTanSet_flow) - annotation (Line(points={{-60,-18},{-60,70},{-130,70}}, color={0,0,127})); - connect(swiPumAct.y, swiPum.u1) annotation (Line(points={{-60,-82},{-60,-110}, - {-62,-110},{-62,-118}}, color={0,0,127})); - connect(isPos.y, swiPumAct.u2) - annotation (Line(points={{-60,-42},{-60,-58}}, color={255,0,255})); + connect(conPI_pumSecNeg.u_m, mTanBot_flow) annotation (Line(points={{-82,10},{ + -90,10},{-90,50},{-130,50}}, color={0,0,127})); + connect(conPI_pumSecNeg.u_s, mTanSet_flow) + annotation (Line(points={{-70,22},{-70,88},{-130,88}}, color={0,0,127})); connect(yValChaOn, booToReaValCha.y) annotation (Line(points={{10,-170},{10,-142}}, color={0,0,127})); connect(swiValDis.u2, and3.y) annotation (Line(points={{60,-118},{60,-100},{ - 110,-100},{110,18}}, color={255,0,255})); + 170,-100},{170,-2}}, color={255,0,255})); connect(swiValDis.y, yValDisMod) annotation (Line(points={{60,-142},{60,-170}}, color={0,0,127})); connect(zero.y, swiValDis.u3) annotation (Line(points={{-99,-90},{52,-90},{52,-118}}, color={0,0,127})); - connect(conPI_valChaMod.u_m, pCHWS) - annotation (Line(points={{42,-50},{130,-50}}, color={0,0,127})); - connect(conPI_valChaMod.u_s, pCHWSSet) - annotation (Line(points={{30,-38},{30,-10},{130,-10}}, color={0,0,127})); - connect(conPI_valChaMod.y, swiValCha.u1) annotation (Line(points={{30,-61},{ - 30,-70},{-12,-70},{-12,-118}}, color={0,0,127})); - connect(pCHWR, conPI_valDisMod.u_m) - annotation (Line(points={{130,-70},{102,-70}}, color={0,0,127})); - connect(conPI_valDisMod.u_s, pCHWRSet) - annotation (Line(points={{90,-58},{90,-30},{130,-30}}, color={0,0,127})); - connect(conPI_valDisMod.y, swiValDis.u1) annotation (Line(points={{90,-81},{ - 90,-90},{68,-90},{68,-118}}, color={0,0,127})); + connect(conPI_valChaMod.y, swiValCha.u1) annotation (Line(points={{50,-1},{50, + -20},{-12,-20},{-12,-118}}, color={0,0,127})); + connect(conPI_valDisMod.y, swiValDis.u1) annotation (Line(points={{90,-1},{90, + -20},{68,-20},{68,-118}}, color={0,0,127})); connect(and3.u1, uOnl) - annotation (Line(points={{118,42},{118,50},{130,50}}, color={255,0,255})); + annotation (Line(points={{178,22},{178,30},{210,30}}, color={255,0,255})); + connect(mTanSet_flow, conPI_valChaMod.u_s) + annotation (Line(points={{-130,88},{-70,88},{-70,28},{50,28},{50,22}}, + color={0,0,127})); + connect(mTanSet_flow, conPI_valDisMod.u_s) + annotation (Line(points={{-130,88},{-70,88},{-70,28},{90,28},{90,22}}, + color={0,0,127})); + + connect(conPI_pumSecPos.u_s, mTanSet_flow) annotation (Line(points={{-30,22}, + {-30,28},{-70,28},{-70,88},{-130,88}}, color={0,0,127})); + connect(conPI_pumSecPos.u_m, mTanBot_flow) annotation (Line(points={{-18,10}, + {-12,10},{-12,50},{-130,50}}, color={0,0,127})); + connect(mTanSet_flow, isPos.u) annotation (Line(points={{-130,88},{-70,88},{ + -70,28},{-50,28},{-50,-18}}, color={0,0,127})); + connect(swiPum1.y, swiPum.u1) annotation (Line(points={{-50,-82},{-50,-110},{ + -62,-110},{-62,-118}}, color={0,0,127})); + connect(isPos.y, swiPum1.u2) + annotation (Line(points={{-50,-42},{-50,-58}}, color={255,0,255})); + connect(conPI_pumSecPos.y, swiPum1.u1) annotation (Line(points={{-30,-1},{-30, + -50},{-42,-50},{-42,-58}}, color={0,0,127})); + connect(conPI_pumSecNeg.y, swiPum1.u3) annotation (Line(points={{-70,-1},{-70, + -50},{-58,-50},{-58,-58}}, color={0,0,127})); + connect(mTanTop_flow, conPI_valDisMod.u_m) annotation (Line(points={{-130,68}, + {108,68},{108,10},{102,10}}, color={0,0,127})); + connect(conPI_valChaMod.u_m, mTanBot_flow) annotation (Line(points={{62,10},{ + 70,10},{70,50},{-130,50}}, color={0,0,127})); annotation ( defaultComponentName="conPumVal", - Diagram(coordinateSystem(extent={{-120,-160},{120,120}})), Icon( + Diagram(coordinateSystem(extent={{-120,-160},{200,180}})), Icon( coordinateSystem(extent={{-100,-100},{100,100}})), Documentation(revisions="

    diff --git a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/ChillerBranch.mo b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/ChillerBranch.mo index 8132e48de68..08055f8fc6c 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/ChillerBranch.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/BaseClasses/ChillerBranch.mo @@ -8,6 +8,8 @@ model ChillerBranch parameter Buildings.Fluid.Storage.Plant.BaseClasses.NominalValues nom "Nominal values"; + Modelica.Units.SI.MassFlowRate m_flow=pum.m_flow "Mass flow rate"; + Buildings.Fluid.Movers.FlowControlled_m_flow pum( redeclare package Medium = Medium, per(pressure(dp=nom.dp_nominal*{2,1.2,0}, diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index 14ebbbdcab1..a5c4493d37f 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -453,11 +453,12 @@ equation connect(supPum.port_CHWS, preDroS2U2.port_a) annotation (Line(points={{-60,-54}, {-36,-54},{-36,0},{-30,0}}, color={0,127,255})); connect(conPumSecGro.yValDisOn, supPum.yValDis) - annotation (Line(points={{-62,-31},{-62,-49}}, color={0,0,127})); + annotation (Line(points={{-60,-31},{-60,-40},{-62,-40},{-62,-49}}, + color={0,0,127})); connect(conPumSecGro.yPum, supPum.yPum) - annotation (Line(points={{-74,-31},{-74,-36},{-70,-36},{-70,-49}}, + annotation (Line(points={{-72,-31},{-72,-36},{-70,-36},{-70,-49}}, color={0,0,127})); - connect(tanBra.mTan_flow, conPumSecGro.mTan_flow) + connect(tanBra.mTanBot_flow, conPumSecGro.mTanBot_flow) annotation (Line(points={{-92,-49},{-92,-22},{-81,-22}}, color={0,0,127})); connect(supPum.yValCha_actual, conPumSecGro.yValCha_actual) annotation (Line( points={{-74,-49},{-74,-40},{-81,-40},{-81,-30}}, color={0,0,127})); @@ -466,13 +467,13 @@ equation connect(conPumSecGro.uOnl, or2.y) annotation (Line(points={{-58,-14},{-50,-14}, {-50,-78}}, color={255,0,255})); connect(mTanSet_flow.y, conPumSecGro.mTanSet_flow) annotation (Line(points={{-118, - -10},{-86,-10},{-86,-18},{-81,-18}}, color={0,0,127})); + -10},{-86,-10},{-86,-16},{-81,-16}}, color={0,0,127})); connect(uRemCha.y, conPumSecGro.uRemCha) annotation (Line(points={{-159,-90}, {-156,-90},{-156,-116},{-32,-116},{-32,-60},{-46,-60},{-46,-10},{-58, -10}}, color={255,0,255})); connect(conPumSecGro.yValChaMod, supPum.yValCha) - annotation (Line(points={{-70,-31},{-66,-31},{-66,-49}}, color={0,0,127})); + annotation (Line(points={{-68,-31},{-66,-31},{-66,-49}}, color={0,0,127})); annotation ( __Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos" "Simulate and plot"), diff --git a/Buildings/Fluid/Storage/Plant/TankBranch.mo b/Buildings/Fluid/Storage/Plant/TankBranch.mo index cfe4d890c63..65de6a5d885 100644 --- a/Buildings/Fluid/Storage/Plant/TankBranch.mo +++ b/Buildings/Fluid/Storage/Plant/TankBranch.mo @@ -14,11 +14,12 @@ model TankBranch extent={{-10,-10},{10,10}}, rotation=0, origin={30,0}))); - Modelica.Blocks.Interfaces.RealOutput mTan_flow - "Mass flow rate through the tank" annotation (Placement(transformation( + Modelica.Blocks.Interfaces.RealOutput mTanBot_flow + "Mass flow rate measured at the bottom of the tank" annotation (Placement( + transformation( extent={{-10,-10},{10,10}}, rotation=90, - origin={80,110}), iconTransformation( + origin={70,110}), iconTransformation( extent={{10,-10},{-10,10}}, rotation=270, origin={80,110}))); @@ -37,10 +38,10 @@ model TankBranch nom.T_CHWS_nominal, tan.nSeg)) "Tank" annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - Modelica.Fluid.Sensors.MassFlowRate sen_m_flow( - redeclare package Medium = Medium, - final allowFlowReversal=true) "Flow rate sensor" - annotation (Placement(transformation(extent={{-10,10},{10,-10}}, + Modelica.Fluid.Sensors.MassFlowRate senFloBot(redeclare package Medium = + Medium, final allowFlowReversal=true) "Flow rate sensor at tank bottom" + annotation (Placement(transformation( + extent={{-10,10},{10,-10}}, rotation=90, origin={50,30}))); Buildings.Fluid.Sources.Boundary_pT atm( @@ -51,7 +52,7 @@ model TankBranch "Atmosphere pressure" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={-10,90}))); + origin={-10,30}))); FixedResistances.PressureDrop preDroTanTop( redeclare package Medium = Medium, final allowFlowReversal=true, @@ -61,25 +62,45 @@ model TankBranch extent={{-10,-10},{10,10}}, rotation=0, origin={-30,0}))); + Modelica.Fluid.Sensors.MassFlowRate senFloTop(redeclare package Medium = + Medium, final allowFlowReversal=true) "Flow rate sensor at tank top" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={-50,-30}))); + Modelica.Blocks.Interfaces.RealOutput mTanTop_flow + "Mass flow rate measured at the top of the tank" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={50,110}), iconTransformation( + extent={{10,-10},{-10,10}}, + rotation=270, + origin={40,110}))); equation - connect(sen_m_flow.m_flow, mTan_flow) annotation (Line(points={{61,30},{80,30}, - {80,110}}, color={0,0,127})); + connect(senFloBot.m_flow, mTanBot_flow) + annotation (Line(points={{61,30},{70,30},{70,110}}, color={0,0,127})); connect(port_chiOut, port_CHWS) annotation (Line(points={{-100,60},{100,60}}, color={0,127,255})); connect(port_chiInl, port_CHWR) annotation (Line(points={{-100,-60},{100,-60}}, color={0,127,255})); connect(atm.ports[1], tan.port_a) - annotation (Line(points={{-10,80},{-10,0}}, color={0,127,255})); - connect(preDroTanBot.port_b, sen_m_flow.port_a) + annotation (Line(points={{-10,20},{-10,10},{-10,10},{-10,0}}, + color={0,127,255})); + connect(preDroTanBot.port_b, senFloBot.port_a) annotation (Line(points={{40,0},{50,0},{50,20}}, color={0,127,255})); connect(tan.port_b, preDroTanBot.port_a) annotation (Line(points={{10,0},{20,0}}, color={0,127,255})); connect(preDroTanTop.port_b, tan.port_a) annotation (Line(points={{-20,0},{-10,0}}, color={0,127,255})); - connect(preDroTanTop.port_a, port_chiInl) annotation (Line(points={{-40,0},{ - -78,0},{-78,-60},{-100,-60}}, color={0,127,255})); - connect(sen_m_flow.port_b, port_CHWS) + connect(senFloBot.port_b, port_CHWS) annotation (Line(points={{50,40},{50,60},{100,60}}, color={0,127,255})); + connect(preDroTanTop.port_a, senFloTop.port_b) + annotation (Line(points={{-40,0},{-50,0},{-50,-20}}, color={0,127,255})); + connect(senFloTop.port_a, port_chiInl) annotation (Line(points={{-50,-40},{ + -50,-60},{-100,-60}}, color={0,127,255})); + connect(senFloTop.m_flow, mTanTop_flow) annotation (Line(points={{-61,-30},{ + -66,-30},{-66,70},{50,70},{50,110}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,100}}), graphics={ Line(points={{-100,-60},{100,-60}}, color={28,108,200}), @@ -95,7 +116,15 @@ equation lineColor={255,255,255}, fillColor={255,255,255}, fillPattern=FillPattern.Solid, - visible=tankIsOpen)}), Diagram( + visible=tankIsOpen), + Line( + points={{40,100},{40,40},{24,40}}, + color={0,0,0}, + pattern=LinePattern.Dash), + Line( + points={{80,100},{80,-40},{26,-40}}, + color={0,0,0}, + pattern=LinePattern.Dash)}), Diagram( coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}})), Documentation(info="

    diff --git a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/IdealChillerBranch.mo b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/IdealChillerBranch.mo new file mode 100644 index 00000000000..82daab0fd28 --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/IdealChillerBranch.mo @@ -0,0 +1,106 @@ +within Buildings.Fluid.Storage.Plant.Validation.BaseClasses; +model IdealChillerBranch + "A branch with an ideal temperature source and an ideal flow rate source" + replaceable package Medium = + Modelica.Media.Interfaces.PartialMedium "Medium package"; + + parameter Buildings.Fluid.Storage.Plant.BaseClasses.NominalValues nom + "Nominal values"; + + Modelica.Units.SI.MassFlowRate m_flow = mFloSou.m_flow "Mass flow rate"; + + Modelica.Blocks.Interfaces.RealInput mPumSet_flow + "Primary pump mass flow rate setpoint" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={-20,-110}),iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={40,-110}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a( + redeclare final package Medium = Medium, + p(displayUnit="Pa")) + "Fluid connector a (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{90,-70},{110,-50}}), + iconTransformation(extent={{90,-70},{110,-50}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b( + redeclare final package Medium = Medium, + p(displayUnit="Pa")) + "Fluid connector b (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{110,50},{90,70}}), + iconTransformation(extent={{110,50},{90,70}}))); + Buildings.Fluid.Movers.BaseClasses.IdealSource mFloSou( + redeclare final package Medium = Medium, + final control_m_flow=true, + final m_flow_small = nom.mChi_flow_nominal * 1E-5) "Ideal flow rate source" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={0,-30}))); + Buildings.Fluid.Sources.PropertySource_T temSou( + redeclare package Medium = Medium, + final use_T_in=true) "Ideal temperature source" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={0,30}))); + Modelica.Blocks.Sources.Constant set_TLvg(k=nom.T_CHWS_nominal) + "CHW supply temperature setpoint" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-50,30}))); +equation + connect(mPumSet_flow, mFloSou.m_flow_in) + annotation (Line(points={{-20,-110},{-20,-36},{-8,-36}}, color={0,0,127})); + connect(port_a, mFloSou.port_a) annotation (Line(points={{100,-60},{-5.55112e-16, + -60},{-5.55112e-16,-40}}, color={0,127,255})); + connect(mFloSou.port_b, temSou.port_a) annotation (Line(points={{6.10623e-16,-20}, + {6.10623e-16,0},{-5.55112e-16,0},{-5.55112e-16,20}}, color={0,127,255})); + connect(temSou.port_b, port_b) annotation (Line(points={{6.10623e-16,40},{6.10623e-16, + 60},{100,60}}, color={0,127,255})); + connect(set_TLvg.y, temSou.T_in) annotation (Line(points={{-39,30},{-20,30},{-20, + 26},{-12,26}}, color={0,0,127})); + annotation (Icon(graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line( + points={{100,60},{0,60},{0,20}}, + color={28,108,200}, + thickness=1), + Text( + extent={{-18,-94},{42,-74}}, + textColor={28,108,200}, + textString="m_flow"), + Line( + points={{100,-60},{0,-60},{0,28}}, + color={28,108,200}, + thickness=1), + Ellipse(extent={{-20,20},{20,-20}},lineColor={0,0,0}, + origin={0,28}, + rotation=90, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line(points={{64,35},{56,5}}, color={0,0,0}, + origin={47,52}, + rotation=180), + Line(points={{-35,-64},{-5,-56}}, + color={0,0,0}, + origin={73,12}, + rotation=-90), + Ellipse(extent={{-20,20},{20,-20}}, lineColor={0,0,0}, + origin={0,-28}, + rotation=90, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Polygon(points={{-16,16},{-16,-16},{16,0},{-16,16}}, lineColor={0,0,0}, + origin={0,-24}, + rotation=90), + Text( + extent={{-54,-32},{54,32}}, + textColor={28,108,200}, + textString="ideal", + origin={-58,-2}, + rotation=90)})); +end IdealChillerBranch; diff --git a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialClosedTank.mo b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialClosedTank.mo index 4554e7cf692..326b6a71634 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialClosedTank.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialClosedTank.mo @@ -2,7 +2,9 @@ within Buildings.Fluid.Storage.Plant.Validation.BaseClasses; partial model PartialClosedTank "(Draft)" extends Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialPlant(nom( - final tankIsOpen=false)); + final tankIsOpen=false), + sin(nPorts=1), + sou(nPorts=1)); Buildings.Fluid.Storage.Plant.SupplyPumpClosedTank supPum( redeclare final package Medium = Medium, @@ -11,17 +13,14 @@ partial model PartialClosedTank "(Draft)" equation - connect(mSinChi_flow.y, sinChi.m_flow_in) - annotation (Line(points={{-69,-12},{-70,-12},{-70,-12},{-62,-12}}, - color={0,0,127})); connect(tanBra.port_CHWS, supPum.port_chiOut) annotation (Line(points={{-10,6},{10,6}}, color={0,127,255})); connect(tanBra.port_CHWR, supPum.port_chiInl) annotation (Line(points={{-10,-6},{10,-6}}, color={0,127,255})); - connect(supPum.port_CHWS, sin.ports[1]) annotation (Line(points={{30,6},{34,6}, - {34,20},{80,20}}, color={0,127,255})); - connect(supPum.port_CHWR, sou.ports[1]) annotation (Line(points={{30,-6},{34, - -6},{34,-20},{80,-20}}, color={0,127,255})); + connect(supPum.port_CHWS, sin.ports[1]) annotation (Line(points={{30,6},{74,6}, + {74,20},{80,20}}, color={0,127,255})); + connect(supPum.port_CHWR, sou.ports[1]) annotation (Line(points={{30,-6},{74, + -6},{74,-20},{80,-20}}, color={0,127,255})); annotation ( Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), Icon(coordinateSystem(extent={{-100,-100},{100,100}})), diff --git a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo index ed5166ca4f7..17906bf2432 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo @@ -11,6 +11,11 @@ partial model PartialPlant "(Draft)" T_CHWR_nominal=285.15) "Nominal values" annotation (Placement(transformation(extent={{60,-80},{80,-60}}))); + Buildings.Fluid.Storage.Plant.Validation.BaseClasses.IdealChillerBranch + ideChiBra( + redeclare final package Medium = Medium, + final nom=nom) + annotation (Placement(transformation(extent={{-70,-10},{-50,10}}))); Buildings.Fluid.Storage.Plant.TankBranch tanBra( preDroTanBot(final dp_nominal=nom.dp_nominal*0.05), preDroTanTop(final dp_nominal=nom.dp_nominal*0.05), @@ -19,7 +24,6 @@ partial model PartialPlant "(Draft)" annotation (Placement(transformation(extent={{-30,-10},{-10,10}}))); Buildings.Fluid.Sources.Boundary_pT sou( redeclare final package Medium = Medium, - final nPorts=1, final p=300000, final T=nom.T_CHWR_nominal) "Source representing CHW return line" @@ -29,7 +33,6 @@ partial model PartialPlant "(Draft)" origin={90,-20}))); Buildings.Fluid.Sources.Boundary_pT sin( redeclare final package Medium = Medium, - final nPorts=1, final p=300000+nom.dp_nominal, final T=nom.T_CHWS_nominal) "Sink representing CHW supply line" @@ -37,35 +40,12 @@ partial model PartialPlant "(Draft)" extent={{10,-10},{-10,10}}, rotation=0, origin={90,20}))); - Buildings.Fluid.Sources.MassFlowSource_T souChi( - redeclare package Medium = Medium, - final T=nom.T_CHWS_nominal, - nPorts=1) "Source representing chiller branch outlet" - annotation (Placement(transformation(extent={{-10,-10},{10,10}}, - rotation=0, - origin={-50,20}))); - Buildings.Fluid.Sources.MassFlowSource_T sinChi( - redeclare package Medium = Medium, - final use_m_flow_in=true, - final T=nom.T_CHWR_nominal, - nPorts=1) "Sink representing chiller branch inlet" annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-50,-20}))); - Modelica.Blocks.Sources.RealExpression mSinChi_flow( - final y=souChi.ports[1].m_flow) - "Mass flow rate" - annotation (Placement(transformation(extent={{-90,-22},{-70,-2}}))); equation - - connect(mSinChi_flow.y, sinChi.m_flow_in) - annotation (Line(points={{-69,-12},{-62,-12}}, color={0,0,127})); - connect(souChi.ports[1], tanBra.port_chiOut) annotation (Line(points={{-40,20}, - {-36,20},{-36,6},{-30,6}}, color={0,127,255})); - connect(tanBra.port_chiInl, sinChi.ports[1]) annotation (Line(points={{-30,-6}, - {-36,-6},{-36,-20},{-40,-20}}, color={0,127,255})); + connect(ideChiBra.port_b, tanBra.port_chiOut) + annotation (Line(points={{-50,6},{-30,6}}, color={0,127,255})); + connect(ideChiBra.port_a, tanBra.port_chiInl) + annotation (Line(points={{-50,-6},{-30,-6}}, color={0,127,255})); annotation ( Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), Icon(coordinateSystem(extent={{-100,-100},{100,100}})), diff --git a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/package.order b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/package.order index 63b0b48c500..38510293295 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/package.order +++ b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/package.order @@ -1,2 +1,3 @@ +IdealChillerBranch PartialClosedTank PartialPlant diff --git a/Buildings/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mo index 630ecf2207f..ad6aac18cc0 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mo @@ -4,7 +4,6 @@ model ClosedTankNoRemoteCharging extends Modelica.Icons.Example; extends Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialClosedTank( - souChi(final m_flow=nom.mChi_flow_nominal), supPum(final allowRemoteCharging=false)); Modelica.Blocks.Sources.TimeTable set_mPumSec_flow(table=[0,1; 900,1; 900,-1; @@ -23,15 +22,20 @@ model ClosedTankNoRemoteCharging rotation=270, origin={-10,30}))); + Modelica.Blocks.Sources.Constant mSet_flow(k=nom.mChi_flow_nominal) + "Chiller branch flow rate setpoint" + annotation (Placement(transformation(extent={{-100,-40},{-80,-20}}))); equation connect(gai.y, conPID_PumSec.u_m) annotation (Line(points={{-10,41},{-10,58}}, color={0,0,127})); connect(set_mPumSec_flow.y, conPID_PumSec.u_s) annotation (Line(points={{-39,70},{-22,70}}, color={0,0,127})); - connect(tanBra.mTan_flow, gai.u) annotation (Line(points={{-12,11},{-12,14},{-10, - 14},{-10,18}}, color={0,0,127})); + connect(tanBra.mTanBot_flow, gai.u) annotation (Line(points={{-12,11},{-12,14}, + {-10,14},{-10,18}}, color={0,0,127})); connect(supPum.yPum, conPID_PumSec.y) annotation (Line(points={{20,11},{20,70},{1,70}}, color={0,0,127})); + connect(mSet_flow.y, ideChiBra.mPumSet_flow) + annotation (Line(points={{-79,-30},{-56,-30},{-56,-11}}, color={0,0,127})); annotation (__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mos" "Simulate and plot"), experiment(Tolerance=1e-06, StopTime=3600), diff --git a/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo index 230dec31f83..cb712d57448 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo @@ -4,7 +4,6 @@ model ClosedTankWithRemoteCharging extends Modelica.Icons.Example; extends Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialClosedTank( - souChi(final use_m_flow_in=true), supPum(final allowRemoteCharging=true)); Modelica.Blocks.Sources.TimeTable set_mTan_flow(table=[0,0; 3600/7,0; 3600/7, @@ -20,18 +19,15 @@ model ClosedTankWithRemoteCharging annotation (Placement(transformation(extent={{82,40},{62,60}}))); Modelica.Blocks.Sources.TimeTable set_mChi_flow(table=[0,0; 3600/7,0; 3600/7, 1; 3600/7*5,1; 3600/7*5,0]) "Chiller flow rate setpoint" - annotation (Placement(transformation(extent={{-100,20},{-80,40}}))); + annotation (Placement(transformation(extent={{-100,-40},{-80,-20}}))); Buildings.Fluid.Storage.Plant.BaseClasses.PumpValveControl conPumVal( final tankIsOpen=nom.tankIsOpen) "Control block for the secondary pump and near-by valves" annotation (Placement(transformation(extent={{10,40},{30,60}}))); equation - connect(set_mChi_flow.y, souChi.m_flow_in) - annotation (Line(points={{-79,30},{-70,30},{-70,28},{-62,28}}, - color={0,0,127})); connect(set_mTan_flow.y,conPumVal. mTanSet_flow) - annotation (Line(points={{-79,70},{6,70},{6,52},{9,52}}, color={0,0,127})); - connect(tanBra.mTan_flow,conPumVal. mTan_flow) + annotation (Line(points={{-79,70},{6,70},{6,54},{9,54}}, color={0,0,127})); + connect(tanBra.mTanBot_flow, conPumVal.mTanBot_flow) annotation (Line(points={{-12,11},{-12,48},{9,48}}, color={0,0,127})); connect(supPum.yValCha_actual,conPumVal. yValCha_actual) annotation (Line( points={{16,11},{16,18},{6,18},{6,40},{9,40}}, color={0,0,127})); @@ -42,12 +38,14 @@ equation connect(conPumVal.uRemCha, uRemCha.y) annotation (Line(points={{32,60},{32,90},{59,90}}, color={255,0,255})); connect(conPumVal.yPum, supPum.yPum) - annotation (Line(points={{16,39},{16,22},{20,22},{20,11}}, + annotation (Line(points={{18,39},{18,22},{20,22},{20,11}}, color={0,0,127})); - connect(conPumVal.yValChaMod, supPum.yValCha) annotation (Line(points={{20,39}, - {20,26},{24,26},{24,11}}, color={0,0,127})); - connect(conPumVal.yValDisOn, supPum.yValDis) annotation (Line(points={{28,39}, - {28,30},{28,30},{28,11}}, color={0,0,127})); + connect(conPumVal.yValChaMod, supPum.yValCha) annotation (Line(points={{22,39}, + {22,26},{24,26},{24,11}}, color={0,0,127})); + connect(conPumVal.yValDisOn, supPum.yValDis) annotation (Line(points={{30,39}, + {30,30},{28,30},{28,11}}, color={0,0,127})); + connect(set_mChi_flow.y, ideChiBra.mPumSet_flow) + annotation (Line(points={{-79,-30},{-56,-30},{-56,-11}}, color={0,0,127})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos index 4c6ccc6553e..8eb1424e9ea 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos @@ -6,7 +6,7 @@ simulateModel("Buildings.Fluid.Storage.Plant.Examples.OneSourceOneUser", // Plot commands createPlot(id=1, position={15, 15, 1027, 480}, - y={"chiBra.pum.m_flow", "tanBra.mTan_flow", "supPum.pum.m_flow"}, + y={"chiBra.m_flow", "tanBra.mTanTop_flow", "supPum.pum.m_flow"}, range={0.0, 3600.0, -1.0, 1.0}, grid=true, subPlot=101, diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos index 0510bc7858f..e8796aca3b5 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos @@ -6,7 +6,7 @@ simulateModel("Buildings.Fluid.Storage.Plant.Examples.TwoSourcesThreeUsers", // Plot commands createPlot(id=1, position={15, 15, 914, 538}, - y={"pumSup1.m_flow", "chiBra2.pum.m_flow", "tanBra.mTan_flow", "supPum.pum.m_flow"}, + y={"pumSup1.m_flow", "chiBra2.m_flow", "tanBra.mTanTop_flow", "supPum.pum.m_flow"}, range={0.0, 3600.0, -2.0, 2.0}, grid=true, subPlot=101, diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mos index 6886ab932f7..14272b4ab5e 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mos @@ -6,7 +6,7 @@ simulateModel("Buildings.Fluid.Storage.Plant.Validation.ClosedTankNoRemoteChargi // Plot commands createPlot(id=1, position={15, 15, 961, 426}, - y={"sinChi.ports[1].m_flow", "tanBra.mTan_flow", "supPum.pum.m_flow"}, + y={"ideChiBra.m_flow", "tanBra.mTanTop_flow", "supPum.pum.m_flow"}, range={0.0, 3600.0, -1.5, 2.5}, grid=true, colors={{28,108,200}, {238,46,47}, {0,140,72}}, diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mos index 330dd2fc09a..ba06c1292c2 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mos @@ -6,7 +6,7 @@ simulateModel("Buildings.Fluid.Storage.Plant.Validation.ClosedTankWithRemoteChar // Plot commands createPlot(id=1, position={15, 15, 929, 372}, - y={"sinChi.ports[1].m_flow", "tanBra.mTan_flow", "supPum.pum.m_flow"}, + y={"ideChiBra.m_flow", "tanBra.mTanTop_flow", "supPum.pum.m_flow"}, range={0.0, 3600.0, -4.0, 3.0}, grid=true, colors={{28,108,200}, {238,46,47}, {0,140,72}}, From 1bccd2c0289cd23d9f06ca1f55c80638f5a36cd5 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Mon, 18 Apr 2022 11:08:09 -0700 Subject: [PATCH 089/463] implemented enumeration for plant setup selection --- .../Plant/BaseClasses/NominalValues.mo | 4 +- .../Plant/BaseClasses/PumpValveControl.mo | 42 ++++++++++++----- .../Fluid/Storage/Plant/BaseClasses/Types.mo | 15 ++++++ .../Storage/Plant/BaseClasses/package.order | 1 + .../Plant/Examples/OneSourceOneUser.mo | 6 +-- .../Plant/Examples/TwoSourcesThreeUsers.mo | 44 +++++++++-------- ...lyPumpClosedTank.mo => SupplyPumpValve.mo} | 47 ++++++++++++++----- Buildings/Fluid/Storage/Plant/TankBranch.mo | 5 +- .../BaseClasses/IdealChillerBranch.mo | 6 ++- .../BaseClasses/PartialClosedTank.mo | 5 +- .../Validation/ClosedTankNoRemoteCharging.mo | 5 +- .../ClosedTankWithRemoteCharging.mo | 28 +++++------ Buildings/Fluid/Storage/Plant/package.order | 2 +- 13 files changed, 132 insertions(+), 78 deletions(-) create mode 100644 Buildings/Fluid/Storage/Plant/BaseClasses/Types.mo rename Buildings/Fluid/Storage/Plant/{SupplyPumpClosedTank.mo => SupplyPumpValve.mo} (82%) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/NominalValues.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/NominalValues.mo index 12169806e5a..8b6058950fa 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/NominalValues.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/NominalValues.mo @@ -2,8 +2,8 @@ within Buildings.Fluid.Storage.Plant.BaseClasses; record NominalValues "Nominal values" extends Modelica.Icons.Record; - parameter Boolean tankIsOpen - "Tank is open" + parameter Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup plaTyp + "Type of plant setup" annotation(dialog(group="Plant configuration")); final parameter Modelica.Units.SI.MassFlowRate m_flow_nominal= diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo index 50a22c46d15..551894bd965 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo @@ -3,7 +3,9 @@ block PumpValveControl "Control block for the supply pump and nearby valves" extends Modelica.Blocks.Icons.Block; - parameter Boolean tankIsOpen = false "Tank is open"; + //parameter Boolean tankIsOpen = false "Tank is open"; + parameter Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup plaTyp + "Type of plant setup"; Modelica.Blocks.Sources.Constant zero(k=0) "Constant 0" annotation (Placement(transformation(extent={{-120,-100},{-100,-80}}))); @@ -11,7 +13,12 @@ block PumpValveControl controllerType=Modelica.Blocks.Types.SimpleController.PI, k=5, Ti=50, - reverseActing=false) if not tankIsOpen "PI controller" + reverseActing=false) + if plaTyp == + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedLocal + or plaTyp == + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote + "PI controller" annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=-90, @@ -130,7 +137,8 @@ block PumpValveControl extent={{-10,-10},{10,10}}, rotation=-90, origin={130,10}))); - Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToReaValCha if tankIsOpen + Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToReaValCha + if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "True = 1, false = 0" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, @@ -144,7 +152,8 @@ block PumpValveControl extent={{-10,-10},{10,10}}, rotation=-90, origin={-70,10}))); - Modelica.Blocks.Interfaces.RealOutput yValChaOn if tankIsOpen + Modelica.Blocks.Interfaces.RealOutput yValChaOn + if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "Valve position, on-off signal" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, @@ -152,7 +161,8 @@ block PumpValveControl extent={{-10,-10},{10,10}}, rotation=-90, origin={40,-110}))); - Modelica.Blocks.Interfaces.RealOutput yValDisMod if tankIsOpen + Modelica.Blocks.Interfaces.RealOutput yValDisMod + if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "Valve position, modulating signal" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, @@ -160,7 +170,8 @@ block PumpValveControl extent={{-10,-10},{10,10}}, rotation=-90, origin={80,-110}))); - Buildings.Controls.OBC.CDL.Continuous.Switch swiValDis if tankIsOpen + Buildings.Controls.OBC.CDL.Continuous.Switch swiValDis + if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "True = on (y>0); false = off (y=0)." annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, @@ -169,7 +180,9 @@ block PumpValveControl controllerType=Modelica.Blocks.Types.SimpleController.PI, k=5, Ti=50, - reverseActing=false) if tankIsOpen "PI controller" annotation (Placement( + reverseActing=false) + if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + "PI controller" annotation (Placement( transformation( extent={{-10,10},{10,-10}}, rotation=-90, @@ -178,13 +191,16 @@ block PumpValveControl controllerType=Modelica.Blocks.Types.SimpleController.PI, k=5, Ti=50, - reverseActing=true) if tankIsOpen "PI controller" annotation (Placement( + reverseActing=true) + if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + "PI controller" annotation (Placement( transformation( extent={{-10,10},{10,-10}}, rotation=-90, origin={90,10}))); - Modelica.Blocks.Interfaces.RealInput mTanTop_flow if tankIsOpen + Modelica.Blocks.Interfaces.RealInput mTanTop_flow + if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "Flow rate measured at the top of the tank" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, @@ -194,7 +210,7 @@ block PumpValveControl rotation=0, origin={-110,0}))); - Controls.Continuous.LimPID conPI_pumSecPos( + Buildings.Controls.Continuous.LimPID conPI_pumSecPos( controllerType=Modelica.Blocks.Types.SimpleController.PI, k=5, Ti=50, @@ -203,19 +219,19 @@ block PumpValveControl extent={{-10,10},{10,-10}}, rotation=-90, origin={-30,10}))); - Controls.OBC.CDL.Continuous.LessThreshold isPos(t=0) + Buildings.Controls.OBC.CDL.Continuous.LessThreshold isPos(t=0) "= true tank flow setpoint is positive" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={-50,-30}))); - Controls.OBC.CDL.Continuous.Switch swiPum1 + Buildings.Controls.OBC.CDL.Continuous.Switch swiPum1 "True = on (y>0); false = off (y=0)." annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={-50,-70}))); equation - if tankIsOpen then + if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open then connect(uOnl, swiPum.u2) annotation (Line(points={{210,30},{190,30},{190, -100},{-70,-100},{-70,-118}}, color={255,0,255})); diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/Types.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/Types.mo new file mode 100644 index 00000000000..0b92f756619 --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/Types.mo @@ -0,0 +1,15 @@ +within Buildings.Fluid.Storage.Plant.BaseClasses; +package Types "Package with type definitions" + extends Modelica.Icons.TypesPackage; + + type Setup = enumeration( + ClosedLocal "A closed tank that only allows local charging", + ClosedRemote "A closed tank that allows remote charging", + Open "An open tank") + "Enumeration for plant setup"; + annotation (preferredView="info", Documentation(info=" +

    +This package contains type definitions the plant setup. +

    +")); +end Types; diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/package.order b/Buildings/Fluid/Storage/Plant/BaseClasses/package.order index f1475a368d3..2d6434d0c0d 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/package.order +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/package.order @@ -2,3 +2,4 @@ FluidPassThrough PartialBranchPorts PumpValveControl NominalValues +Types diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo index fcfc0b9e4a3..7b593e109cb 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo @@ -10,7 +10,8 @@ model OneSourceOneUser "(Draft) Simple system model with one source and one user "Nominal cooling load of one consumer"; Buildings.Fluid.Storage.Plant.BaseClasses.NominalValues nom( - tankIsOpen=false, + final plaTyp= + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedLocal, mTan_flow_nominal=0.5, mChi_flow_nominal=0.5, dp_nominal=300000, @@ -33,9 +34,8 @@ model OneSourceOneUser "(Draft) Simple system model with one source and one user annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0, origin={-80,0}))); - Buildings.Fluid.Storage.Plant.SupplyPumpClosedTank supPum( + Buildings.Fluid.Storage.Plant.SupplyPumpValve supPum( redeclare final package Medium = Medium, - final allowRemoteCharging=false, final nom=nom, final valCha(final dpValve_nominal=nom.dp_nominal*0.1), final valDis(final dpValve_nominal=nom.dp_nominal*0.1)) diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index a5c4493d37f..0059b4ac87d 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -139,7 +139,8 @@ model TwoSourcesThreeUsers // Second source: chiller and tank Buildings.Fluid.Storage.Plant.BaseClasses.NominalValues nomPla2( - tankIsOpen=false, + final plaTyp= + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote, mTan_flow_nominal=0.75*m_flow_nominal, mChi_flow_nominal=0.75*m_flow_nominal, dp_nominal=dp_nominal, @@ -161,9 +162,8 @@ model TwoSourcesThreeUsers final cheVal(final dpValve_nominal=0.1*nomPla2.dp_nominal, final dpFixed_nominal=0.1*nomPla2.dp_nominal)) "Chiller branch" annotation (Placement(transformation(extent={{-140,-70},{-120,-50}}))); - Buildings.Fluid.Storage.Plant.SupplyPumpClosedTank supPum( + Buildings.Fluid.Storage.Plant.SupplyPumpValve supPum( redeclare final package Medium = MediumCHW, - final allowRemoteCharging=true, final nom=nomPla2, final valCha(final dpValve_nominal=nomPla2.dp_nominal*0.1), final valDis(final dpValve_nominal=nomPla2.dp_nominal*0.1)) @@ -182,8 +182,8 @@ model TwoSourcesThreeUsers extent={{-10,-10},{10,10}}, rotation=0, origin={-170,-10}))); - Buildings.Fluid.Storage.Plant.BaseClasses.PumpValveControl conPumSecGro( - tankIsOpen=false) "Control block for secondary pump-valve group" + Buildings.Fluid.Storage.Plant.BaseClasses.PumpValveControl conSupPum(final + plaTyp=nomPla2.plaTyp) "Control block for the secondary pump and valves" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, @@ -452,27 +452,25 @@ equation {-36,-54},{-36,-40},{-30,-40}}, color={0,127,255})); connect(supPum.port_CHWS, preDroS2U2.port_a) annotation (Line(points={{-60,-54}, {-36,-54},{-36,0},{-30,0}}, color={0,127,255})); - connect(conPumSecGro.yValDisOn, supPum.yValDis) - annotation (Line(points={{-60,-31},{-60,-40},{-62,-40},{-62,-49}}, - color={0,0,127})); - connect(conPumSecGro.yPum, supPum.yPum) - annotation (Line(points={{-72,-31},{-72,-36},{-70,-36},{-70,-49}}, - color={0,0,127})); - connect(tanBra.mTanBot_flow, conPumSecGro.mTanBot_flow) + connect(conSupPum.yValDisOn, supPum.yValDis) annotation (Line(points={{-60,-31}, + {-60,-40},{-62,-40},{-62,-49}}, color={0,0,127})); + connect(conSupPum.yPum, supPum.yPum) annotation (Line(points={{-72,-31},{-72, + -36},{-70,-36},{-70,-49}}, color={0,0,127})); + connect(tanBra.mTanBot_flow, conSupPum.mTanBot_flow) annotation (Line(points={{-92,-49},{-92,-22},{-81,-22}}, color={0,0,127})); - connect(supPum.yValCha_actual, conPumSecGro.yValCha_actual) annotation (Line( - points={{-74,-49},{-74,-40},{-81,-40},{-81,-30}}, color={0,0,127})); - connect(supPum.yValDis_actual, conPumSecGro.yValDis_actual) annotation (Line( - points={{-78,-49},{-78,-44},{-86,-44},{-86,-26},{-81,-26}}, color={0,0,127})); - connect(conPumSecGro.uOnl, or2.y) annotation (Line(points={{-58,-14},{-50,-14}, - {-50,-78}}, color={255,0,255})); - connect(mTanSet_flow.y, conPumSecGro.mTanSet_flow) annotation (Line(points={{-118, + connect(supPum.yValCha_actual, conSupPum.yValCha_actual) annotation (Line( + points={{-74,-49},{-74,-40},{-81,-40},{-81,-30}}, color={0,0,127})); + connect(supPum.yValDis_actual, conSupPum.yValDis_actual) annotation (Line( + points={{-78,-49},{-78,-44},{-86,-44},{-86,-26},{-81,-26}}, color={0,0, + 127})); + connect(conSupPum.uOnl, or2.y) annotation (Line(points={{-58,-14},{-50,-14},{ + -50,-78}}, color={255,0,255})); + connect(mTanSet_flow.y, conSupPum.mTanSet_flow) annotation (Line(points={{-118, -10},{-86,-10},{-86,-16},{-81,-16}}, color={0,0,127})); - connect(uRemCha.y, conPumSecGro.uRemCha) annotation (Line(points={{-159,-90}, - {-156,-90},{-156,-116},{-32,-116},{-32,-60},{-46,-60},{-46,-10},{-58, - -10}}, + connect(uRemCha.y, conSupPum.uRemCha) annotation (Line(points={{-159,-90},{-156, + -90},{-156,-116},{-32,-116},{-32,-60},{-46,-60},{-46,-10},{-58,-10}}, color={255,0,255})); - connect(conPumSecGro.yValChaMod, supPum.yValCha) + connect(conSupPum.yValChaMod, supPum.yValCha) annotation (Line(points={{-68,-31},{-66,-31},{-66,-49}}, color={0,0,127})); annotation ( __Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos" diff --git a/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo b/Buildings/Fluid/Storage/Plant/SupplyPumpValve.mo similarity index 82% rename from Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo rename to Buildings/Fluid/Storage/Plant/SupplyPumpValve.mo index 4b50abef3a3..4da6839445e 100644 --- a/Buildings/Fluid/Storage/Plant/SupplyPumpClosedTank.mo +++ b/Buildings/Fluid/Storage/Plant/SupplyPumpValve.mo @@ -1,12 +1,9 @@ within Buildings.Fluid.Storage.Plant; -model SupplyPumpClosedTank - "(Draft) Model section with supply pump and valves for a closed tank" +model SupplyPumpValve + "(Draft) Plant section with supply pump and valves" extends Buildings.Fluid.Storage.Plant.BaseClasses.PartialBranchPorts; - parameter Boolean allowRemoteCharging = true - "= true if the tank is allowed to be charged by a remote source"; - Buildings.Fluid.Movers.SpeedControlled_y pum( redeclare package Medium = Medium, per(pressure(dp=nom.dp_nominal*{2,1.2,0}, @@ -26,7 +23,10 @@ model SupplyPumpClosedTank use_inputFilter=true, y_start=0, l=1E-5, - m_flow_nominal=nom.m_flow_nominal) if allowRemoteCharging + m_flow_nominal=nom.m_flow_nominal) + if nom.plaTyp == + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote + or nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "Discharging valve, open when tank NOT being charged remotely" annotation (Placement(transformation(extent={{20,50},{40,70}}))); Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valCha( @@ -35,11 +35,16 @@ model SupplyPumpClosedTank use_inputFilter=true, y_start=0, l=1E-5, - m_flow_nominal=nom.mTan_flow_nominal) if allowRemoteCharging + m_flow_nominal=nom.mTan_flow_nominal) + if nom.plaTyp == + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote + or nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "Charging valve, open when tank is being charged remotely" annotation (Placement(transformation(extent={{40,-30},{20,-10}}))); Buildings.Fluid.Storage.Plant.BaseClasses.FluidPassThrough pasValDis( - redeclare package Medium = Medium) if not allowRemoteCharging + redeclare package Medium = Medium) + if nom.plaTyp == + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedLocal "Replaces valDis when remote charging not allowed" annotation (Placement(transformation(extent={{20,10},{40,30}}))); Buildings.Fluid.FixedResistances.CheckValve cheVal( @@ -52,7 +57,11 @@ model SupplyPumpClosedTank rotation=180, origin={-10,60}))); Modelica.Blocks.Interfaces.RealOutput yValCha_actual - if allowRemoteCharging "Actual valve position" + if nom.plaTyp == + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote + or nom.plaTyp == + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + "Actual valve position" annotation (Placement( transformation( extent={{10,-10},{-10,10}}, @@ -61,7 +70,11 @@ model SupplyPumpClosedTank extent={{10,-10},{-10,10}}, rotation=270, origin={-40,110}))); - Modelica.Blocks.Interfaces.RealOutput yValDis_actual if allowRemoteCharging + Modelica.Blocks.Interfaces.RealOutput yValDis_actual + if nom.plaTyp == + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote + or nom.plaTyp == + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "Actual valve position" annotation (Placement( transformation( @@ -71,7 +84,11 @@ model SupplyPumpClosedTank extent={{10,-10},{-10,10}}, rotation=270, origin={-80,110}))); - Modelica.Blocks.Interfaces.RealInput yValCha if allowRemoteCharging + Modelica.Blocks.Interfaces.RealInput yValCha + if nom.plaTyp == + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote + or nom.plaTyp == + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "Valve position input" annotation (Placement(transformation(extent={{10,10}, {-10,-10}}, rotation=90, @@ -79,7 +96,11 @@ model SupplyPumpClosedTank extent={{-10,-10},{10,10}}, rotation=-90, origin={40,110}))); - Modelica.Blocks.Interfaces.RealInput yValDis if allowRemoteCharging + Modelica.Blocks.Interfaces.RealInput yValDis + if nom.plaTyp == + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote + or nom.plaTyp == + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "Valve position input" annotation (Placement(transformation( extent={{10,10},{-10,-10}}, rotation=90, @@ -197,4 +218,4 @@ First implementation. This is for
")); -end SupplyPumpClosedTank; +end SupplyPumpValve; diff --git a/Buildings/Fluid/Storage/Plant/TankBranch.mo b/Buildings/Fluid/Storage/Plant/TankBranch.mo index 65de6a5d885..8781d940e55 100644 --- a/Buildings/Fluid/Storage/Plant/TankBranch.mo +++ b/Buildings/Fluid/Storage/Plant/TankBranch.mo @@ -3,7 +3,8 @@ model TankBranch "(Draft) Model of the tank branch where the tank can potentially be charged remotely" extends Buildings.Fluid.Storage.Plant.BaseClasses.PartialBranchPorts; - final parameter Boolean tankIsOpen = nom.tankIsOpen "Tank is open"; + final parameter Boolean tankIsOpen = nom.plaTyp == + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "Tank is open"; Buildings.Fluid.FixedResistances.PressureDrop preDroTanBot( redeclare package Medium = Medium, @@ -53,7 +54,7 @@ model TankBranch extent={{-10,-10},{10,10}}, rotation=-90, origin={-10,30}))); - FixedResistances.PressureDrop preDroTanTop( + Buildings.Fluid.FixedResistances.PressureDrop preDroTanTop( redeclare package Medium = Medium, final allowFlowReversal=true, final m_flow_nominal=nom.mTan_flow_nominal) diff --git a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/IdealChillerBranch.mo b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/IdealChillerBranch.mo index 82daab0fd28..fda92e5df15 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/IdealChillerBranch.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/IdealChillerBranch.mo @@ -32,14 +32,16 @@ model IdealChillerBranch Buildings.Fluid.Movers.BaseClasses.IdealSource mFloSou( redeclare final package Medium = Medium, final control_m_flow=true, - final m_flow_small = nom.mChi_flow_nominal * 1E-5) "Ideal flow rate source" annotation (Placement( + final m_flow_small = nom.mChi_flow_nominal * 1E-5) "Ideal flow rate source" + annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=90, origin={0,-30}))); Buildings.Fluid.Sources.PropertySource_T temSou( redeclare package Medium = Medium, - final use_T_in=true) "Ideal temperature source" annotation (Placement(transformation( + final use_T_in=true) "Ideal temperature source" + annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=90, origin={0,30}))); diff --git a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialClosedTank.mo b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialClosedTank.mo index 326b6a71634..1b11b7970b0 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialClosedTank.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialClosedTank.mo @@ -1,12 +1,11 @@ within Buildings.Fluid.Storage.Plant.Validation.BaseClasses; partial model PartialClosedTank "(Draft)" - extends Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialPlant(nom( - final tankIsOpen=false), + extends Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialPlant( sin(nPorts=1), sou(nPorts=1)); - Buildings.Fluid.Storage.Plant.SupplyPumpClosedTank supPum( + Buildings.Fluid.Storage.Plant.SupplyPumpValve supPum( redeclare final package Medium = Medium, final nom=nom) "Supply pump and valves" annotation (Placement(transformation(extent={{10,-10},{30,10}}))); diff --git a/Buildings/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mo index ad6aac18cc0..125671c012d 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mo @@ -3,8 +3,9 @@ model ClosedTankNoRemoteCharging "(Draft) Validation model of the plant not allowing remote charging" extends Modelica.Icons.Example; extends - Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialClosedTank( - supPum(final allowRemoteCharging=false)); + Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialClosedTank(nom( + final plaTyp= + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedLocal)); Modelica.Blocks.Sources.TimeTable set_mPumSec_flow(table=[0,1; 900,1; 900,-1; 1800,-1; 1800,0; 2700,0; 2700,1; 3600,1]) diff --git a/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo index cb712d57448..0e19858de76 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo @@ -3,8 +3,9 @@ model ClosedTankWithRemoteCharging "(Draft) Validation model of the plant allowing remote charging" extends Modelica.Icons.Example; extends - Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialClosedTank( - supPum(final allowRemoteCharging=true)); + Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialClosedTank(nom( + final plaTyp= + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote)); Modelica.Blocks.Sources.TimeTable set_mTan_flow(table=[0,0; 3600/7,0; 3600/7, -1; 3600/7*3,-1; 3600/7*3,0; 3600/7*4,0; 3600/7*4,1; 3600/7*6,1; 3600/7 @@ -20,29 +21,28 @@ model ClosedTankWithRemoteCharging Modelica.Blocks.Sources.TimeTable set_mChi_flow(table=[0,0; 3600/7,0; 3600/7, 1; 3600/7*5,1; 3600/7*5,0]) "Chiller flow rate setpoint" annotation (Placement(transformation(extent={{-100,-40},{-80,-20}}))); - Buildings.Fluid.Storage.Plant.BaseClasses.PumpValveControl conPumVal( - final tankIsOpen=nom.tankIsOpen) - "Control block for the secondary pump and near-by valves" + Buildings.Fluid.Storage.Plant.BaseClasses.PumpValveControl conSupPum( + final plaTyp=nom.plaTyp) "Control block for the secondary pump and valves" annotation (Placement(transformation(extent={{10,40},{30,60}}))); equation - connect(set_mTan_flow.y,conPumVal. mTanSet_flow) + connect(set_mTan_flow.y,conSupPum. mTanSet_flow) annotation (Line(points={{-79,70},{6,70},{6,54},{9,54}}, color={0,0,127})); - connect(tanBra.mTanBot_flow, conPumVal.mTanBot_flow) + connect(tanBra.mTanBot_flow,conSupPum. mTanBot_flow) annotation (Line(points={{-12,11},{-12,48},{9,48}}, color={0,0,127})); - connect(supPum.yValCha_actual,conPumVal. yValCha_actual) annotation (Line( + connect(supPum.yValCha_actual,conSupPum. yValCha_actual) annotation (Line( points={{16,11},{16,18},{6,18},{6,40},{9,40}}, color={0,0,127})); - connect(supPum.yValDis_actual,conPumVal. yValDis_actual) annotation (Line( + connect(supPum.yValDis_actual,conSupPum. yValDis_actual) annotation (Line( points={{12,11},{12,14},{2,14},{2,44},{9,44}}, color={0,0,127})); - connect(conPumVal.uOnl, uOnl.y) annotation (Line(points={{32,56},{56,56},{56, + connect(conSupPum.uOnl, uOnl.y) annotation (Line(points={{32,56},{56,56},{56, 50},{61,50}}, color={255,0,255})); - connect(conPumVal.uRemCha, uRemCha.y) + connect(conSupPum.uRemCha, uRemCha.y) annotation (Line(points={{32,60},{32,90},{59,90}}, color={255,0,255})); - connect(conPumVal.yPum, supPum.yPum) + connect(conSupPum.yPum, supPum.yPum) annotation (Line(points={{18,39},{18,22},{20,22},{20,11}}, color={0,0,127})); - connect(conPumVal.yValChaMod, supPum.yValCha) annotation (Line(points={{22,39}, + connect(conSupPum.yValChaMod, supPum.yValCha) annotation (Line(points={{22,39}, {22,26},{24,26},{24,11}}, color={0,0,127})); - connect(conPumVal.yValDisOn, supPum.yValDis) annotation (Line(points={{30,39}, + connect(conSupPum.yValDisOn, supPum.yValDis) annotation (Line(points={{30,39}, {30,30},{28,30},{28,11}}, color={0,0,127})); connect(set_mChi_flow.y, ideChiBra.mPumSet_flow) annotation (Line(points={{-79,-30},{-56,-30},{-56,-11}}, color={0,0,127})); diff --git a/Buildings/Fluid/Storage/Plant/package.order b/Buildings/Fluid/Storage/Plant/package.order index 9eb95494788..66d9807af91 100644 --- a/Buildings/Fluid/Storage/Plant/package.order +++ b/Buildings/Fluid/Storage/Plant/package.order @@ -1,4 +1,4 @@ -SupplyPumpClosedTank +SupplyPumpValve SupplyPumpOpenTank TankBranch Examples From 602d94ac107ed6ad6e7a1144647e776fc1c90415 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Tue, 19 Apr 2022 16:25:35 -0700 Subject: [PATCH 090/463] vectorised valve signals to de-clutter --- .../Plant/BaseClasses/PumpValveControl.mo | 144 ++++++------------ .../Plant/Examples/OneSourceOneUser.mo | 10 +- .../Plant/Examples/TwoSourcesThreeUsers.mo | 22 +-- .../Fluid/Storage/Plant/SupplyPumpValve.mo | 138 ++++++----------- .../Validation/ClosedTankNoRemoteCharging.mo | 2 +- .../ClosedTankWithRemoteCharging.mo | 17 +-- .../Plant/Examples/OneSourceOneUser.mos | 2 +- .../Plant/Examples/TwoSourcesThreeUsers.mos | 2 +- .../Validation/ClosedTankNoRemoteCharging.mos | 2 +- .../ClosedTankWithRemoteCharging.mos | 2 +- 10 files changed, 119 insertions(+), 222 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo index 551894bd965..5fce1b3cb0c 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo @@ -4,7 +4,8 @@ block PumpValveControl extends Modelica.Blocks.Icons.Block; //parameter Boolean tankIsOpen = false "Tank is open"; - parameter Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup plaTyp + parameter Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup plaTyp= + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote "Type of plant setup"; Modelica.Blocks.Sources.Constant zero(k=0) "Constant 0" @@ -13,11 +14,7 @@ block PumpValveControl controllerType=Modelica.Blocks.Types.SimpleController.PI, k=5, Ti=50, - reverseActing=false) - if plaTyp == - Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedLocal - or plaTyp == - Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote + reverseActing=false) if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote "PI controller" annotation (Placement(transformation( extent={{-10,10},{10,-10}}, @@ -63,42 +60,17 @@ block PumpValveControl origin={-70,-170}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={-20,-110}))); - Modelica.Blocks.Interfaces.RealOutput yValChaMod - "Valve position, modulating signal" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={-20,-170}),iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={20,-110}))); - Modelica.Blocks.Interfaces.RealOutput yValDisOn - "Valve position, on-off signal" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={90,-170}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={100,-110}))); - Modelica.Blocks.Interfaces.RealInput yValCha_actual "Actual valve position" - annotation (Placement(transformation( + origin={0,-110}))); + Modelica.Blocks.Interfaces.RealInput ySup_actual[2] + "Actuale positions of the valves on the supply line" annotation (Placement( + transformation( extent={{10,-10},{-10,10}}, rotation=180, - origin={-130,-10}), - iconTransformation( + origin={-130,-10}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-110,-100}))); - Modelica.Blocks.Interfaces.RealInput yValDis_actual "Actual valve position" - annotation (Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=180, - origin={-130,-50}), - iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-110,-60}))); - Buildings.Controls.OBC.CDL.Continuous.LessThreshold isValDisClo(t=0.01) + Buildings.Controls.OBC.CDL.Continuous.LessThreshold isValOutClo(t=0.01) "= true if valve closed" annotation (Placement(transformation(extent={{40,100},{60,120}}))); Buildings.Controls.OBC.CDL.Continuous.Switch swiPum @@ -106,7 +78,8 @@ block PumpValveControl extent={{-10,-10},{10,10}}, rotation=-90, origin={-70,-130}))); - Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToReaValDis + Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToReaValOut if plaTyp == + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote "True = 1, false = 0" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -137,12 +110,6 @@ block PumpValveControl extent={{-10,-10},{10,10}}, rotation=-90, origin={130,10}))); - Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToReaValCha - if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open - "True = 1, false = 0" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={10,-130}))); Buildings.Controls.Continuous.LimPID conPI_pumSecNeg( controllerType=Modelica.Blocks.Types.SimpleController.PI, k=5, @@ -152,25 +119,7 @@ block PumpValveControl extent={{-10,-10},{10,10}}, rotation=-90, origin={-70,10}))); - Modelica.Blocks.Interfaces.RealOutput yValChaOn - if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open - "Valve position, on-off signal" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={10,-170}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={40,-110}))); - Modelica.Blocks.Interfaces.RealOutput yValDisMod - if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open - "Valve position, modulating signal" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={60,-170}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={80,-110}))); - Buildings.Controls.OBC.CDL.Continuous.Switch swiValDis + Buildings.Controls.OBC.CDL.Continuous.Switch swiValOut if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "True = on (y>0); false = off (y=0)." annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -187,7 +136,7 @@ block PumpValveControl extent={{-10,10},{10,-10}}, rotation=-90, origin={50,10}))); - Buildings.Controls.Continuous.LimPID conPI_valDisMod( + Buildings.Controls.Continuous.LimPID conPI_valOutMod( controllerType=Modelica.Blocks.Types.SimpleController.PI, k=5, Ti=50, @@ -225,11 +174,20 @@ block PumpValveControl extent={{-10,-10},{10,10}}, rotation=-90, origin={-50,-30}))); - Buildings.Controls.OBC.CDL.Continuous.Switch swiPum1 + Buildings.Controls.OBC.CDL.Continuous.Switch swiPumSet "True = on (y>0); false = off (y=0)." annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={-50,-70}))); + Modelica.Blocks.Interfaces.RealOutput yValSup[2] + "Control signals of valves on the supply line" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={40,-170}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={40,-110}))); equation if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open then connect(uOnl, swiPum.u2) annotation (Line(points={{210,30},{190,30},{190, @@ -246,36 +204,23 @@ equation connect(conPI_valCha.u_m, mTanBot_flow) annotation (Line(points={{22,10},{28, 10},{28,50},{-130,50}}, color={0,0,127})); - connect(yValDisOn, yValDisOn) - annotation (Line(points={{90,-170},{90,-170}}, color={0,0,127})); connect(swiPum.y, yPum) annotation (Line(points={{-70,-142},{-70,-170}}, color={0,0,127})); connect(zero.y, swiPum.u3) annotation (Line(points={{-99,-90},{-78,-90},{-78, -118}}, color={0,0,127})); - connect(swiValCha.y, yValChaMod) - annotation (Line(points={{-20,-142},{-20,-170}}, - color={0,0,127})); connect(zero.y, swiValCha.u3) annotation (Line(points={{-99,-90},{-28,-90},{ -28,-118}}, color={0,0,127})); - connect(isValChaClo.u, yValCha_actual) - annotation (Line(points={{38,150},{-106,150},{-106,-10},{-130,-10}}, - color={0,0,127})); - connect(isValDisClo.u, yValDis_actual) - annotation (Line(points={{38,110},{-100,110},{-100,-50},{-130,-50}}, - color={0,0,127})); - connect(isValDisClo.y, andValCha.u2) annotation (Line(points={{62,110},{122, + connect(isValOutClo.y, andValCha.u2) annotation (Line(points={{62,110},{122, 110},{122,22}}, color={255,0,255})); connect(andValCha.y, swiValCha.u2) annotation (Line(points={{130,-2},{130,-80}, - {10,-80},{10,-112},{-20,-112},{-20,-118}}, + {-20,-80},{-20,-118}}, color={255,0,255})); connect(conPI_valCha.y, swiValCha.u1) annotation (Line(points={{10,-1},{10, -20},{-12,-20},{-12,-118}}, color={0,0,127})); - connect(booToReaValDis.y, yValDisOn) - annotation (Line(points={{90,-142},{90,-170}}, color={0,0,127})); - connect(and3.y, booToReaValDis.u) annotation (Line(points={{170,-2},{170,-100}, + connect(and3.y,booToReaValOut. u) annotation (Line(points={{170,-2},{170,-100}, {90,-100},{90,-118}}, color={255,0,255})); connect(uRemCha, notRemCha.u) annotation (Line(points={{210,110},{180,110},{180,82}}, @@ -287,32 +232,25 @@ equation annotation (Line(points={{162,22},{162,150},{62,150}}, color={255,0,255})); connect(notRemCha.y, and3.u2) annotation (Line(points={{180,58},{180,40},{170, 40},{170,22}}, color={255,0,255})); - connect(andValCha.y, booToReaValCha.u) annotation (Line(points={{130,-2},{130, - -80},{10,-80},{10,-118}}, - color={255,0,255})); connect(conPI_pumSecNeg.u_m, mTanBot_flow) annotation (Line(points={{-82,10},{ -90,10},{-90,50},{-130,50}}, color={0,0,127})); connect(conPI_pumSecNeg.u_s, mTanSet_flow) annotation (Line(points={{-70,22},{-70,88},{-130,88}}, color={0,0,127})); - connect(yValChaOn, booToReaValCha.y) - annotation (Line(points={{10,-170},{10,-142}}, color={0,0,127})); - connect(swiValDis.u2, and3.y) annotation (Line(points={{60,-118},{60,-100},{ + connect(swiValOut.u2, and3.y) annotation (Line(points={{60,-118},{60,-100},{ 170,-100},{170,-2}}, color={255,0,255})); - connect(swiValDis.y, yValDisMod) - annotation (Line(points={{60,-142},{60,-170}}, color={0,0,127})); - connect(zero.y, swiValDis.u3) + connect(zero.y,swiValOut. u3) annotation (Line(points={{-99,-90},{52,-90},{52,-118}}, color={0,0,127})); connect(conPI_valChaMod.y, swiValCha.u1) annotation (Line(points={{50,-1},{50, -20},{-12,-20},{-12,-118}}, color={0,0,127})); - connect(conPI_valDisMod.y, swiValDis.u1) annotation (Line(points={{90,-1},{90, + connect(conPI_valOutMod.y,swiValOut. u1) annotation (Line(points={{90,-1},{90, -20},{68,-20},{68,-118}}, color={0,0,127})); connect(and3.u1, uOnl) annotation (Line(points={{178,22},{178,30},{210,30}}, color={255,0,255})); connect(mTanSet_flow, conPI_valChaMod.u_s) annotation (Line(points={{-130,88},{-70,88},{-70,28},{50,28},{50,22}}, color={0,0,127})); - connect(mTanSet_flow, conPI_valDisMod.u_s) + connect(mTanSet_flow,conPI_valOutMod. u_s) annotation (Line(points={{-130,88},{-70,88},{-70,28},{90,28},{90,22}}, color={0,0,127})); @@ -322,18 +260,28 @@ equation {-12,10},{-12,50},{-130,50}}, color={0,0,127})); connect(mTanSet_flow, isPos.u) annotation (Line(points={{-130,88},{-70,88},{ -70,28},{-50,28},{-50,-18}}, color={0,0,127})); - connect(swiPum1.y, swiPum.u1) annotation (Line(points={{-50,-82},{-50,-110},{ - -62,-110},{-62,-118}}, color={0,0,127})); - connect(isPos.y, swiPum1.u2) + connect(swiPumSet.y, swiPum.u1) annotation (Line(points={{-50,-82},{-50,-110}, + {-62,-110},{-62,-118}}, color={0,0,127})); + connect(isPos.y, swiPumSet.u2) annotation (Line(points={{-50,-42},{-50,-58}}, color={255,0,255})); - connect(conPI_pumSecPos.y, swiPum1.u1) annotation (Line(points={{-30,-1},{-30, + connect(conPI_pumSecPos.y, swiPumSet.u1) annotation (Line(points={{-30,-1},{-30, -50},{-42,-50},{-42,-58}}, color={0,0,127})); - connect(conPI_pumSecNeg.y, swiPum1.u3) annotation (Line(points={{-70,-1},{-70, + connect(conPI_pumSecNeg.y, swiPumSet.u3) annotation (Line(points={{-70,-1},{-70, -50},{-58,-50},{-58,-58}}, color={0,0,127})); - connect(mTanTop_flow, conPI_valDisMod.u_m) annotation (Line(points={{-130,68}, + connect(mTanTop_flow,conPI_valOutMod. u_m) annotation (Line(points={{-130,68}, {108,68},{108,10},{102,10}}, color={0,0,127})); connect(conPI_valChaMod.u_m, mTanBot_flow) annotation (Line(points={{62,10},{ 70,10},{70,50},{-130,50}}, color={0,0,127})); + connect(swiValCha.y, yValSup[2]) annotation (Line(points={{-20,-142},{-20,-152}, + {40,-152},{40,-167.5}}, color={0,0,127})); + connect(swiValOut.y, yValSup[1]) annotation (Line(points={{60,-142},{60,-152}, + {40,-152},{40,-172.5}}, color={0,0,127})); + connect(booToReaValOut.y, yValSup[1]) annotation (Line(points={{90,-142},{90,-152}, + {40,-152},{40,-172.5}}, color={0,0,127})); + connect(isValChaClo.u, ySup_actual[2]) annotation (Line(points={{38,150},{ + -100,150},{-100,-10},{-130,-10},{-130,-7.5}}, color={0,0,127})); + connect(isValOutClo.u, ySup_actual[1]) annotation (Line(points={{38,110},{ + -100,110},{-100,-10},{-130,-10},{-130,-12.5}}, color={0,0,127})); annotation ( defaultComponentName="conPumVal", Diagram(coordinateSystem(extent={{-120,-160},{200,180}})), Icon( diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo index 7b593e109cb..4876fc1bd81 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo @@ -37,9 +37,8 @@ model OneSourceOneUser "(Draft) Simple system model with one source and one user Buildings.Fluid.Storage.Plant.SupplyPumpValve supPum( redeclare final package Medium = Medium, final nom=nom, - final valCha(final dpValve_nominal=nom.dp_nominal*0.1), - final valDis(final dpValve_nominal=nom.dp_nominal*0.1)) - "Supply pump and valves" + valSupCha(final dpValve_nominal=nom.dp_nominal*0.1), + valSupOut(final dpValve_nominal=nom.dp_nominal*0.1)) "Supply pump and valves" annotation (Placement(transformation(extent={{-30,-10},{-10,10}}))); Buildings.Fluid.Storage.Plant.Examples.BaseClasses.DummyUser usr( @@ -132,9 +131,8 @@ equation -6},{0,-40},{10,-40}}, color={0,127,255})); connect(supPum.port_CHWS, preDro1.port_a) annotation (Line(points={{-10,6},{4, 6},{4,-20},{10,-20}}, color={0,127,255})); - connect(conPI_pumSec.y, supPum.yPum) - annotation (Line(points={{-10,39},{-10,16},{-20,16},{-20,11}}, - color={0,0,127})); + connect(conPI_pumSec.y, supPum.yPumSup) annotation (Line(points={{-10,39},{-10, + 16},{-20,16},{-20,11}}, color={0,0,127})); connect(sou_p.ports[1], tanBra.port_CHWR) annotation (Line(points={{-60,-70},{ -34,-70},{-34,-6},{-40,-6}}, color={0,127,255})); annotation(__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos" diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index 0059b4ac87d..b386828049a 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -165,9 +165,8 @@ model TwoSourcesThreeUsers Buildings.Fluid.Storage.Plant.SupplyPumpValve supPum( redeclare final package Medium = MediumCHW, final nom=nomPla2, - final valCha(final dpValve_nominal=nomPla2.dp_nominal*0.1), - final valDis(final dpValve_nominal=nomPla2.dp_nominal*0.1)) - "Supply pump and valves" + valSupCha(final dpValve_nominal=nomPla2.dp_nominal*0.1), + valSupOut(final dpValve_nominal=nomPla2.dp_nominal*0.1)) "Supply pump and valves" annotation (Placement(transformation(extent={{-80,-70},{-60,-50}}))); Modelica.Blocks.Sources.BooleanTable uRemCha(table={3600/9*6,3600/9*8}, startValue=false) "Tank is being charged remotely" annotation (Placement( @@ -452,17 +451,8 @@ equation {-36,-54},{-36,-40},{-30,-40}}, color={0,127,255})); connect(supPum.port_CHWS, preDroS2U2.port_a) annotation (Line(points={{-60,-54}, {-36,-54},{-36,0},{-30,0}}, color={0,127,255})); - connect(conSupPum.yValDisOn, supPum.yValDis) annotation (Line(points={{-60,-31}, - {-60,-40},{-62,-40},{-62,-49}}, color={0,0,127})); - connect(conSupPum.yPum, supPum.yPum) annotation (Line(points={{-72,-31},{-72, - -36},{-70,-36},{-70,-49}}, color={0,0,127})); connect(tanBra.mTanBot_flow, conSupPum.mTanBot_flow) annotation (Line(points={{-92,-49},{-92,-22},{-81,-22}}, color={0,0,127})); - connect(supPum.yValCha_actual, conSupPum.yValCha_actual) annotation (Line( - points={{-74,-49},{-74,-40},{-81,-40},{-81,-30}}, color={0,0,127})); - connect(supPum.yValDis_actual, conSupPum.yValDis_actual) annotation (Line( - points={{-78,-49},{-78,-44},{-86,-44},{-86,-26},{-81,-26}}, color={0,0, - 127})); connect(conSupPum.uOnl, or2.y) annotation (Line(points={{-58,-14},{-50,-14},{ -50,-78}}, color={255,0,255})); connect(mTanSet_flow.y, conSupPum.mTanSet_flow) annotation (Line(points={{-118, @@ -470,8 +460,12 @@ equation connect(uRemCha.y, conSupPum.uRemCha) annotation (Line(points={{-159,-90},{-156, -90},{-156,-116},{-32,-116},{-32,-60},{-46,-60},{-46,-10},{-58,-10}}, color={255,0,255})); - connect(conSupPum.yValChaMod, supPum.yValCha) - annotation (Line(points={{-68,-31},{-66,-31},{-66,-49}}, color={0,0,127})); + connect(conSupPum.ySup_actual, supPum.ySup_actual) annotation (Line(points={{ + -81,-30},{-84,-30},{-84,-38},{-78,-38},{-78,-49}}, color={0,0,127})); + connect(conSupPum.yPum, supPum.yPumSup) + annotation (Line(points={{-70,-31},{-70,-49}}, color={0,0,127})); + connect(conSupPum.yValSup, supPum.yValSup) + annotation (Line(points={{-66,-31},{-66,-49}}, color={0,0,127})); annotation ( __Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos" "Simulate and plot"), diff --git a/Buildings/Fluid/Storage/Plant/SupplyPumpValve.mo b/Buildings/Fluid/Storage/Plant/SupplyPumpValve.mo index 4da6839445e..3c0d030c925 100644 --- a/Buildings/Fluid/Storage/Plant/SupplyPumpValve.mo +++ b/Buildings/Fluid/Storage/Plant/SupplyPumpValve.mo @@ -4,50 +4,44 @@ model SupplyPumpValve extends Buildings.Fluid.Storage.Plant.BaseClasses.PartialBranchPorts; - Buildings.Fluid.Movers.SpeedControlled_y pum( + Buildings.Fluid.Movers.SpeedControlled_y pumSup( redeclare package Medium = Medium, - per(pressure(dp=nom.dp_nominal*{2,1.2,0}, - V_flow=(nom.m_flow_nominal)/1.2*{0,1.2,2})), + per(pressure(dp=nom.dp_nominal*{2,1.2,0}, V_flow=(nom.m_flow_nominal)/1.2*{ + 0,1.2,2})), energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, allowFlowReversal=true, addPowerToMedium=false, y_start=0, - T_start=nom.T_CHWR_nominal) "Secondary CHW pump" annotation (Placement( + T_start=nom.T_CHWR_nominal) "CHW supply pump" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-50,60}))); - Buildings.Fluid.Actuators.Valves.TwoWayLinear valDis( + Buildings.Fluid.Actuators.Valves.TwoWayLinear valSupOut( redeclare package Medium = Medium, dpValve_nominal=0.1*nom.dp_nominal, use_inputFilter=true, y_start=0, l=1E-5, - m_flow_nominal=nom.m_flow_nominal) - if nom.plaTyp == - Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote + m_flow_nominal=nom.m_flow_nominal) if nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote or nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open - "Discharging valve, open when tank NOT being charged remotely" + "Output valve, open when tank NOT being charged remotely" annotation (Placement(transformation(extent={{20,50},{40,70}}))); - Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valCha( + Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valSupCha( redeclare package Medium = Medium, dpValve_nominal=0.1*nom.dp_nominal, use_inputFilter=true, y_start=0, l=1E-5, - m_flow_nominal=nom.mTan_flow_nominal) - if nom.plaTyp == - Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote + m_flow_nominal=nom.mTan_flow_nominal) if nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote or nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open - "Charging valve, open when tank is being charged remotely" + "Charging valve, modulated when tank is being charged remotely" annotation (Placement(transformation(extent={{40,-30},{20,-10}}))); - Buildings.Fluid.Storage.Plant.BaseClasses.FluidPassThrough pasValDis( - redeclare package Medium = Medium) - if nom.plaTyp == - Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedLocal - "Replaces valDis when remote charging not allowed" + Buildings.Fluid.Storage.Plant.BaseClasses.FluidPassThrough pasValSupOut( + redeclare package Medium = Medium) if nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedLocal + "Replaces valSupOut when remote charging not allowed" annotation (Placement(transformation(extent={{20,10},{40,30}}))); - Buildings.Fluid.FixedResistances.CheckValve cheVal( + Buildings.Fluid.FixedResistances.CheckValve cheValSup( redeclare package Medium = Medium, m_flow_nominal=nom.m_flow_nominal, dpValve_nominal=0.1*nom.dp_nominal, @@ -56,99 +50,67 @@ model SupplyPumpValve extent={{10,-10},{-10,10}}, rotation=180, origin={-10,60}))); - Modelica.Blocks.Interfaces.RealOutput yValCha_actual - if nom.plaTyp == - Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote - or nom.plaTyp == - Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open - "Actual valve position" - annotation (Placement( - transformation( - extent={{10,-10},{-10,10}}, - rotation=270, - origin={-70,110}), iconTransformation( - extent={{10,-10},{-10,10}}, - rotation=270, - origin={-40,110}))); - Modelica.Blocks.Interfaces.RealOutput yValDis_actual - if nom.plaTyp == - Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote - or nom.plaTyp == - Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open - "Actual valve position" - annotation (Placement( - transformation( + Modelica.Blocks.Interfaces.RealOutput ySup_actual[2] if nom.plaTyp == + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote or nom.plaTyp + == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + "Actual positions of the valves connected to the supply line" annotation ( + Placement(transformation( extent={{10,-10},{-10,10}}, rotation=270, origin={-90,110}), iconTransformation( extent={{10,-10},{-10,10}}, rotation=270, origin={-80,110}))); - Modelica.Blocks.Interfaces.RealInput yValCha - if nom.plaTyp == - Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote - or nom.plaTyp == - Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open - "Valve position input" annotation (Placement(transformation(extent={{10,10}, - {-10,-10}}, - rotation=90, - origin={60,110}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={40,110}))); - Modelica.Blocks.Interfaces.RealInput yValDis - if nom.plaTyp == - Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote - or nom.plaTyp == - Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open - "Valve position input" annotation (Placement(transformation( + Modelica.Blocks.Interfaces.RealInput yValSup[2] if nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote + or nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + "Positions of the valves on the supply line" annotation (Placement( + transformation( extent={{10,10},{-10,-10}}, rotation=90, - origin={80,110}), iconTransformation( + origin={40,110}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={80,110}))); - Modelica.Blocks.Interfaces.RealInput yPum "Secondary pump speed input" + origin={40,110}))); + Modelica.Blocks.Interfaces.RealInput yPumSup "Secondary pump speed input" annotation (Placement(transformation( extent={{10,10},{-10,-10}}, rotation=90, - origin={40,110}), iconTransformation( + origin={20,110}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={0,110}))); equation - connect(pum.port_b, cheVal.port_a) - annotation (Line(points={{-40,60},{-20,60}}, color={0,127,255})); - connect(pasValDis.port_a, cheVal.port_b) annotation (Line(points={{20,20},{10, - 20},{10,60},{-1.77636e-15,60}}, - color={0,127,255})); - connect(pum.y, yPum) annotation (Line(points={{-50,72},{-50,96},{40,96},{40, - 110}}, color={0,0,127})); - connect(valCha.y, yValCha) annotation (Line(points={{30,-8},{30,0},{60,0},{60, - 110}}, color={0,0,127})); - connect(valCha.y_actual, yValCha_actual) annotation (Line(points={{25,-13},{ - 24,-13},{24,0},{-70,0},{-70,110}}, color={0,0,127})); - connect(port_chiOut, pum.port_a) + connect(pumSup.port_b, cheValSup.port_a) + annotation (Line(points={{-40,60},{-20,60}}, color={0,127,255})); + connect(pasValSupOut.port_a, cheValSup.port_b) annotation (Line(points={{20, + 20},{10,20},{10,60},{-1.77636e-15,60}}, color={0,127,255})); + connect(pumSup.y, yPumSup) annotation (Line(points={{-50,72},{-50,96},{20,96}, + {20,110}}, color={0,0,127})); + connect(port_chiOut, pumSup.port_a) annotation (Line(points={{-100,60},{-60,60}}, color={0,127,255})); - connect(port_chiOut, valCha.port_b) annotation (Line(points={{-100,60},{-80,60}, - {-80,-20},{20,-20}}, color={0,127,255})); - connect(valCha.port_a, port_CHWS) annotation (Line(points={{40,-20},{80,-20},{ - 80,60},{100,60}}, color={0,127,255})); - connect(pasValDis.port_b, port_CHWS) annotation (Line(points={{40,20},{80,20}, + connect(port_chiOut, valSupCha.port_b) annotation (Line(points={{-100,60},{-80, + 60},{-80,-20},{20,-20}}, color={0,127,255})); + connect(valSupCha.port_a, port_CHWS) annotation (Line(points={{40,-20},{80,-20}, {80,60},{100,60}}, color={0,127,255})); + connect(pasValSupOut.port_b, port_CHWS) annotation (Line(points={{40,20},{80, + 20},{80,60},{100,60}}, color={0,127,255})); connect(port_chiInl, port_CHWR) annotation (Line(points={{-100,-60},{100,-60}}, color={0,127,255})); - connect(cheVal.port_b, valDis.port_a) + connect(cheValSup.port_b, valSupOut.port_a) annotation (Line(points={{-1.77636e-15,60},{20,60}}, color={0,127,255})); - connect(valDis.port_b, port_CHWS) + connect(valSupOut.port_b, port_CHWS) annotation (Line(points={{40,60},{100,60}}, color={0,127,255})); - connect(valDis.y, yValDis) annotation (Line(points={{30,72},{30,80},{80,80},{ - 80,110}}, color={0,0,127})); - connect(valDis.y_actual, yValDis_actual) annotation (Line(points={{35,67},{40, - 67},{40,86},{-90,86},{-90,110}}, color={0,0,127})); - connect(yValDis_actual, yValDis_actual) + connect(ySup_actual, ySup_actual) annotation (Line(points={{-90,110},{-90,110}}, color={0,0,127})); + connect(valSupOut.y_actual, ySup_actual[1]) annotation (Line(points={{35,67}, + {40,67},{40,82},{-90,82},{-90,107.5}}, color={0,0,127})); + connect(valSupCha.y_actual, ySup_actual[2]) annotation (Line(points={{25,-13}, + {24,-13},{24,-12},{-90,-12},{-90,112.5}}, color={0,0,127})); + connect(valSupOut.y, yValSup[1]) annotation (Line(points={{30,72},{30,74},{46, + 74},{46,96},{40,96},{40,107.5}}, color={0,0,127})); + connect(valSupCha.y, yValSup[2]) annotation (Line(points={{30,-8},{30,0},{46, + 0},{46,96},{40,96},{40,112.5}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,100}}), graphics={Line( points={{-20,0},{40,0}}, diff --git a/Buildings/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mo index 125671c012d..5f54cfac61a 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mo @@ -33,7 +33,7 @@ equation annotation (Line(points={{-39,70},{-22,70}}, color={0,0,127})); connect(tanBra.mTanBot_flow, gai.u) annotation (Line(points={{-12,11},{-12,14}, {-10,14},{-10,18}}, color={0,0,127})); - connect(supPum.yPum, conPID_PumSec.y) + connect(supPum.yPumSup, conPID_PumSec.y) annotation (Line(points={{20,11},{20,70},{1,70}}, color={0,0,127})); connect(mSet_flow.y, ideChiBra.mPumSet_flow) annotation (Line(points={{-79,-30},{-56,-30},{-56,-11}}, color={0,0,127})); diff --git a/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo index 0e19858de76..5a49b3e2e25 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo @@ -29,23 +29,18 @@ equation annotation (Line(points={{-79,70},{6,70},{6,54},{9,54}}, color={0,0,127})); connect(tanBra.mTanBot_flow,conSupPum. mTanBot_flow) annotation (Line(points={{-12,11},{-12,48},{9,48}}, color={0,0,127})); - connect(supPum.yValCha_actual,conSupPum. yValCha_actual) annotation (Line( - points={{16,11},{16,18},{6,18},{6,40},{9,40}}, color={0,0,127})); - connect(supPum.yValDis_actual,conSupPum. yValDis_actual) annotation (Line( - points={{12,11},{12,14},{2,14},{2,44},{9,44}}, color={0,0,127})); connect(conSupPum.uOnl, uOnl.y) annotation (Line(points={{32,56},{56,56},{56, 50},{61,50}}, color={255,0,255})); connect(conSupPum.uRemCha, uRemCha.y) annotation (Line(points={{32,60},{32,90},{59,90}}, color={255,0,255})); - connect(conSupPum.yPum, supPum.yPum) - annotation (Line(points={{18,39},{18,22},{20,22},{20,11}}, - color={0,0,127})); - connect(conSupPum.yValChaMod, supPum.yValCha) annotation (Line(points={{22,39}, - {22,26},{24,26},{24,11}}, color={0,0,127})); - connect(conSupPum.yValDisOn, supPum.yValDis) annotation (Line(points={{30,39}, - {30,30},{28,30},{28,11}}, color={0,0,127})); connect(set_mChi_flow.y, ideChiBra.mPumSet_flow) annotation (Line(points={{-79,-30},{-56,-30},{-56,-11}}, color={0,0,127})); + connect(supPum.ySup_actual, conSupPum.ySup_actual) annotation (Line(points={{ + 12,11},{12,34},{4,34},{4,40},{9,40}}, color={0,0,127})); + connect(conSupPum.yPum, supPum.yPumSup) + annotation (Line(points={{20,39},{20,11}}, color={0,0,127})); + connect(conSupPum.yValSup, supPum.yValSup) + annotation (Line(points={{24,39},{24,11}}, color={0,0,127})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos index 8eb1424e9ea..d096c4afb8b 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos @@ -6,7 +6,7 @@ simulateModel("Buildings.Fluid.Storage.Plant.Examples.OneSourceOneUser", // Plot commands createPlot(id=1, position={15, 15, 1027, 480}, - y={"chiBra.m_flow", "tanBra.mTanTop_flow", "supPum.pum.m_flow"}, + y={"chiBra.m_flow", "tanBra.mTanTop_flow", "supPum.pumSup.m_flow"}, range={0.0, 3600.0, -1.0, 1.0}, grid=true, subPlot=101, diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos index e8796aca3b5..4bdb58b6197 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos @@ -6,7 +6,7 @@ simulateModel("Buildings.Fluid.Storage.Plant.Examples.TwoSourcesThreeUsers", // Plot commands createPlot(id=1, position={15, 15, 914, 538}, - y={"pumSup1.m_flow", "chiBra2.m_flow", "tanBra.mTanTop_flow", "supPum.pum.m_flow"}, + y={"pumSup1.m_flow", "chiBra2.m_flow", "tanBra.mTanTop_flow", "supPum.pumSup.m_flow"}, range={0.0, 3600.0, -2.0, 2.0}, grid=true, subPlot=101, diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mos index 14272b4ab5e..1da3d3aebca 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mos @@ -6,7 +6,7 @@ simulateModel("Buildings.Fluid.Storage.Plant.Validation.ClosedTankNoRemoteChargi // Plot commands createPlot(id=1, position={15, 15, 961, 426}, - y={"ideChiBra.m_flow", "tanBra.mTanTop_flow", "supPum.pum.m_flow"}, + y={"ideChiBra.m_flow", "tanBra.mTanTop_flow", "supPum.pumSup.m_flow"}, range={0.0, 3600.0, -1.5, 2.5}, grid=true, colors={{28,108,200}, {238,46,47}, {0,140,72}}, diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mos index ba06c1292c2..fcc7f9ef8d0 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mos @@ -6,7 +6,7 @@ simulateModel("Buildings.Fluid.Storage.Plant.Validation.ClosedTankWithRemoteChar // Plot commands createPlot(id=1, position={15, 15, 929, 372}, - y={"ideChiBra.m_flow", "tanBra.mTanTop_flow", "supPum.pum.m_flow"}, + y={"ideChiBra.m_flow", "tanBra.mTanTop_flow", "supPum.pumSup.m_flow"}, range={0.0, 3600.0, -4.0, 3.0}, grid=true, colors={{28,108,200}, {238,46,47}, {0,140,72}}, From b7a8b3f3f6da5a7a0e7400a4a15eabbf7bf43e95 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Wed, 20 Apr 2022 13:00:58 -0700 Subject: [PATCH 091/463] improved vectorisation --- .../Plant/BaseClasses/PumpValveControl.mo | 357 ++++++++++-------- .../Plant/Examples/TwoSourcesThreeUsers.mo | 10 +- .../Fluid/Storage/Plant/SupplyPumpValve.mo | 210 ++++++++--- Buildings/Fluid/Storage/Plant/TankBranch.mo | 16 +- .../ClosedTankWithRemoteCharging.mo | 8 +- 5 files changed, 378 insertions(+), 223 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo index 5fce1b3cb0c..4773fa4cebb 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo @@ -9,22 +9,21 @@ block PumpValveControl "Type of plant setup"; Modelica.Blocks.Sources.Constant zero(k=0) "Constant 0" - annotation (Placement(transformation(extent={{-120,-100},{-100,-80}}))); + annotation (Placement(transformation(extent={{-120,-120},{-100,-100}}))); Buildings.Controls.Continuous.LimPID conPI_valCha( controllerType=Modelica.Blocks.Types.SimpleController.PI, k=5, Ti=50, - reverseActing=false) if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote - "PI controller" + reverseActing=false) "PI controller" annotation (Placement(transformation( - extent={{-10,10},{10,-10}}, + extent={{-10,-10},{10,10}}, rotation=-90, - origin={10,10}))); + origin={30,10}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uRemCha "Tank is being charged remotely" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, - origin={210,110}), iconTransformation(extent={{20,-20},{ + origin={270,108}), iconTransformation(extent={{20,-20},{ -20,20}}, rotation=0, origin={120,100}))); @@ -32,7 +31,7 @@ block PumpValveControl "Tank mass flow rate setpoint" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-130,88}), iconTransformation( + origin={-150,88}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-110,40}))); @@ -41,7 +40,7 @@ block PumpValveControl transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-130,50}), iconTransformation( + origin={-150,50}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-110,-20}))); @@ -49,104 +48,87 @@ block PumpValveControl "= true if plant is online (not cut off from the network by valve)" annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=180, - origin={210,30}), + origin={270,28}), iconTransformation(extent={{20,-20},{-20,20}}, rotation=0, origin={120,60}))); - Modelica.Blocks.Interfaces.RealOutput yPum "Normalised speed" annotation ( - Placement(transformation( + Modelica.Blocks.Interfaces.RealOutput yPumSup + "Speed input of the supply pump" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={-70,-170}), iconTransformation( + origin={-70,-210}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={0,-110}))); + origin={-20,-110}))); Modelica.Blocks.Interfaces.RealInput ySup_actual[2] - "Actuale positions of the valves on the supply line" annotation (Placement( + "Positions of 1: valSupOut, 2: valSupCha" annotation (Placement( transformation( extent={{10,-10},{-10,10}}, rotation=180, - origin={-130,-10}), iconTransformation( + origin={-150,-10}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-110,-100}))); Buildings.Controls.OBC.CDL.Continuous.LessThreshold isValOutClo(t=0.01) "= true if valve closed" - annotation (Placement(transformation(extent={{40,100},{60,120}}))); - Buildings.Controls.OBC.CDL.Continuous.Switch swiPum + annotation (Placement(transformation(extent={{40,120},{60,140}}))); + Buildings.Controls.OBC.CDL.Continuous.Switch swiPumSup "True = on (y>0); false = off (y=0)." annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={-70,-130}))); - Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToReaValOut if plaTyp == - Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote + origin={-70,-170}))); + Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToReaValOut "True = 1, false = 0" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={90,-130}))); + origin={-10,-170}))); Buildings.Controls.OBC.CDL.Continuous.Switch swiValCha "True = on (y>0); false = off (y=0)." annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={-20,-130}))); - Buildings.Controls.OBC.CDL.Logical.And3 and3 - "Plant online AND not charging remotely AND valCha closed" annotation ( - Placement(transformation( + origin={30,-170}))); + Buildings.Controls.OBC.CDL.Logical.And3 and3Out + "Outputting = plant online AND no remote charging command AND charging valve(s) closed" + annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={170,10}))); + origin={230,10}))); Buildings.Controls.OBC.CDL.Continuous.LessThreshold isValChaClo(t=0.01) "= true if valve closed" - annotation (Placement(transformation(extent={{40,140},{60,160}}))); + annotation (Placement(transformation(extent={{40,200},{60,220}}))); Buildings.Controls.OBC.CDL.Logical.Not notRemCha "Tank is not being charged remotely" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={180,70}))); - Buildings.Controls.OBC.CDL.Logical.And andValCha - "Charging remotely AND valDis closed" annotation (Placement(transformation( + origin={240,70}))); + Buildings.Controls.OBC.CDL.Logical.And andCha + "Charging = remote charging command AND outputting valve(s) closed" + annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={130,10}))); - Buildings.Controls.Continuous.LimPID conPI_pumSecNeg( + origin={190,10}))); + Buildings.Controls.Continuous.LimPID conPI_pumRet( controllerType=Modelica.Blocks.Types.SimpleController.PI, k=5, Ti=50, - reverseActing=true) "PI controller for negative tank flow" - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={-70,10}))); - Buildings.Controls.OBC.CDL.Continuous.Switch swiValOut + reverseActing=true) if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open - "True = on (y>0); false = off (y=0)." annotation (Placement(transformation( + "PI controller" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={60,-130}))); - Buildings.Controls.Continuous.LimPID conPI_valChaMod( - controllerType=Modelica.Blocks.Types.SimpleController.PI, - k=5, - Ti=50, - reverseActing=false) - if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open - "PI controller" annotation (Placement( - transformation( - extent={{-10,10},{10,-10}}, - rotation=-90, - origin={50,10}))); - Buildings.Controls.Continuous.LimPID conPI_valOutMod( + origin={90,10}))); + Buildings.Controls.Continuous.LimPID conPI_valOut( controllerType=Modelica.Blocks.Types.SimpleController.PI, k=5, Ti=50, reverseActing=true) if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open - "PI controller" annotation (Placement( - transformation( - extent={{-10,10},{10,-10}}, + "PI controller" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=-90, - origin={90,10}))); + origin={130,10}))); Modelica.Blocks.Interfaces.RealInput mTanTop_flow if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open @@ -154,137 +136,188 @@ block PumpValveControl transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-130,68}), iconTransformation( + origin={-150,68}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-110,0}))); - Buildings.Controls.Continuous.LimPID conPI_pumSecPos( + Buildings.Controls.Continuous.LimPID conPI_pumSup( controllerType=Modelica.Blocks.Types.SimpleController.PI, k=5, Ti=50, - reverseActing=false) "PI controller for positive tank flow" annotation ( - Placement(transformation( - extent={{-10,10},{10,-10}}, + reverseActing=true) "PI controller" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=-90, - origin={-30,10}))); - Buildings.Controls.OBC.CDL.Continuous.LessThreshold isPos(t=0) - "= true tank flow setpoint is positive" annotation (Placement( + origin={-70,10}))); + Modelica.Blocks.Interfaces.RealOutput yValSup[2] + "Control signals for valves on the supply line" + annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={-50,-30}))); - Buildings.Controls.OBC.CDL.Continuous.Switch swiPumSet - "True = on (y>0); false = off (y=0)." annotation (Placement(transformation( + origin={10,-210}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={-50,-70}))); - Modelica.Blocks.Interfaces.RealOutput yValSup[2] - "Control signals of valves on the supply line" annotation (Placement( + origin={20,-110}))); + Modelica.Blocks.Interfaces.RealInput yRet_actual[2] + if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + "Positions of 1: valRetOut, 2: valRetCha" annotation (Placement( + transformation( + extent={{10,-10},{-10,10}}, + rotation=180, + origin={-150,10}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-110,-60}))); + Buildings.Controls.OBC.CDL.Continuous.Max maxCha + if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + "Max of charging valve positions" + annotation (Placement(transformation(extent={{-60,220},{-40,240}}))); + Modelica.Blocks.Routing.RealPassThrough pasCha if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote + "Real signal pass through" + annotation (Placement(transformation(extent={{-60,180},{-40,200}}))); + Modelica.Blocks.Routing.RealPassThrough pasOut if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote + "Real signal pass through" + annotation (Placement(transformation(extent={{-60,100},{-40,120}}))); + Buildings.Controls.OBC.CDL.Continuous.Max maxOut + if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + "Max of output valve positions" + annotation (Placement(transformation(extent={{-60,140},{-40,160}}))); + Modelica.Blocks.Interfaces.RealOutput yRet[2] + if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + "Control signals for valves on the return line" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={40,-170}), iconTransformation( + origin={170,-210}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={40,-110}))); + origin={100,-110}))); + Controls.OBC.CDL.Continuous.Switch swiPumSup1 + if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + "True = on (y>0); false = off (y=0)." annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={90,-170}))); + Modelica.Blocks.Interfaces.RealOutput yPumRet + if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + "Speed input of the auxilliary pump on the return line" annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={90,-210}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={60,-110}))); + Controls.OBC.CDL.Continuous.Switch swiValOut + if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + "True = on (y>0); false = off (y=0)." annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={150,-170}))); + Controls.OBC.CDL.Conversions.BooleanToReal booToReaValCha + if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + "True = 1, false = 0" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={190,-170}))); equation - if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open then - connect(uOnl, swiPum.u2) annotation (Line(points={{210,30},{190,30},{190, - -100},{-70,-100},{-70,-118}}, - color={255,0,255})); - else - connect(and3.y, swiPum.u2) annotation (Line(points={{170,-2},{170,-100},{-70, - -100},{-70,-118}}, color={255,0,255})); - end if; - - connect(conPI_valCha.u_s,mTanSet_flow) annotation (Line(points={{10,22},{10, - 28},{-70,28},{-70,88},{-130,88}}, - color={0,0,127})); - connect(conPI_valCha.u_m, mTanBot_flow) annotation (Line(points={{22,10},{28, - 10},{28,50},{-130,50}}, - color={0,0,127})); - connect(swiPum.y, yPum) - annotation (Line(points={{-70,-142},{-70,-170}}, color={0,0,127})); - connect(zero.y, swiPum.u3) annotation (Line(points={{-99,-90},{-78,-90},{-78, - -118}}, - color={0,0,127})); - connect(zero.y, swiValCha.u3) annotation (Line(points={{-99,-90},{-28,-90},{ - -28,-118}}, - color={0,0,127})); - connect(isValOutClo.y, andValCha.u2) annotation (Line(points={{62,110},{122, - 110},{122,22}}, color={255,0,255})); - connect(andValCha.y, swiValCha.u2) annotation (Line(points={{130,-2},{130,-80}, - {-20,-80},{-20,-118}}, - color={255,0,255})); - connect(conPI_valCha.y, swiValCha.u1) annotation (Line(points={{10,-1},{10, - -20},{-12,-20},{-12,-118}}, - color={0,0,127})); - connect(and3.y,booToReaValOut. u) annotation (Line(points={{170,-2},{170,-100}, - {90,-100},{90,-118}}, color={255,0,255})); + connect(conPI_valCha.u_s,mTanSet_flow) annotation (Line(points={{30,22},{30,88}, + {-150,88}}, color={0,0,127})); + connect(conPI_valCha.u_m, mTanBot_flow) annotation (Line(points={{18,10},{10,10}, + {10,50},{-150,50}}, color={0,0,127})); + connect(swiPumSup.y, yPumSup) + annotation (Line(points={{-70,-182},{-70,-210}}, color={0,0,127})); + connect(zero.y, swiPumSup.u3) annotation (Line(points={{-99,-110},{-78,-110},{ + -78,-158}}, color={0,0,127})); + connect(zero.y, swiValCha.u3) annotation (Line(points={{-99,-110},{22,-110},{22, + -158}}, color={0,0,127})); + connect(isValOutClo.y, andCha.u2) + annotation (Line(points={{62,130},{182,130},{182,22}}, color={255,0,255})); + connect(conPI_valCha.y, swiValCha.u1) annotation (Line(points={{30,-1},{30,-20}, + {38,-20},{38,-158}},color={0,0,127})); connect(uRemCha, notRemCha.u) - annotation (Line(points={{210,110},{180,110},{180,82}}, - color={255,0,255})); - connect(andValCha.u1, uRemCha) - annotation (Line(points={{130,22},{130,110},{210,110}}, + annotation (Line(points={{270,108},{240,108},{240,82}}, color={255,0,255})); - connect(and3.u3, isValChaClo.y) - annotation (Line(points={{162,22},{162,150},{62,150}}, color={255,0,255})); - connect(notRemCha.y, and3.u2) annotation (Line(points={{180,58},{180,40},{170, - 40},{170,22}}, color={255,0,255})); - connect(conPI_pumSecNeg.u_m, mTanBot_flow) annotation (Line(points={{-82,10},{ - -90,10},{-90,50},{-130,50}}, color={0,0,127})); - connect(conPI_pumSecNeg.u_s, mTanSet_flow) - annotation (Line(points={{-70,22},{-70,88},{-130,88}}, color={0,0,127})); + connect(andCha.u1, uRemCha) annotation (Line(points={{190,22},{190,108},{270,108}}, + color={255,0,255})); + connect(and3Out.u3, isValChaClo.y) + annotation (Line(points={{222,22},{222,210},{62,210}}, color={255,0,255})); + connect(notRemCha.y, and3Out.u2) annotation (Line(points={{240,58},{240,40},{230, + 40},{230,22}}, color={255,0,255})); + connect(conPI_pumRet.u_m, mTanBot_flow) annotation (Line(points={{78,10},{70,10}, + {70,50},{-150,50}}, color={0,0,127})); + connect(conPI_pumRet.u_s, mTanSet_flow) + annotation (Line(points={{90,22},{90,88},{-150,88}}, color={0,0,127})); - connect(swiValOut.u2, and3.y) annotation (Line(points={{60,-118},{60,-100},{ - 170,-100},{170,-2}}, color={255,0,255})); - connect(zero.y,swiValOut. u3) - annotation (Line(points={{-99,-90},{52,-90},{52,-118}}, color={0,0,127})); - connect(conPI_valChaMod.y, swiValCha.u1) annotation (Line(points={{50,-1},{50, - -20},{-12,-20},{-12,-118}}, color={0,0,127})); - connect(conPI_valOutMod.y,swiValOut. u1) annotation (Line(points={{90,-1},{90, - -20},{68,-20},{68,-118}}, color={0,0,127})); - connect(and3.u1, uOnl) - annotation (Line(points={{178,22},{178,30},{210,30}}, color={255,0,255})); - connect(mTanSet_flow, conPI_valChaMod.u_s) - annotation (Line(points={{-130,88},{-70,88},{-70,28},{50,28},{50,22}}, - color={0,0,127})); - connect(mTanSet_flow,conPI_valOutMod. u_s) - annotation (Line(points={{-130,88},{-70,88},{-70,28},{90,28},{90,22}}, - color={0,0,127})); + connect(and3Out.u1, uOnl) + annotation (Line(points={{238,22},{238,28},{270,28}}, color={255,0,255})); + connect(mTanSet_flow, conPI_valOut.u_s) + annotation (Line(points={{-150,88},{130,88},{130,22}}, color={0,0,127})); - connect(conPI_pumSecPos.u_s, mTanSet_flow) annotation (Line(points={{-30,22}, - {-30,28},{-70,28},{-70,88},{-130,88}}, color={0,0,127})); - connect(conPI_pumSecPos.u_m, mTanBot_flow) annotation (Line(points={{-18,10}, - {-12,10},{-12,50},{-130,50}}, color={0,0,127})); - connect(mTanSet_flow, isPos.u) annotation (Line(points={{-130,88},{-70,88},{ - -70,28},{-50,28},{-50,-18}}, color={0,0,127})); - connect(swiPumSet.y, swiPum.u1) annotation (Line(points={{-50,-82},{-50,-110}, - {-62,-110},{-62,-118}}, color={0,0,127})); - connect(isPos.y, swiPumSet.u2) - annotation (Line(points={{-50,-42},{-50,-58}}, color={255,0,255})); - connect(conPI_pumSecPos.y, swiPumSet.u1) annotation (Line(points={{-30,-1},{-30, - -50},{-42,-50},{-42,-58}}, color={0,0,127})); - connect(conPI_pumSecNeg.y, swiPumSet.u3) annotation (Line(points={{-70,-1},{-70, - -50},{-58,-50},{-58,-58}}, color={0,0,127})); - connect(mTanTop_flow,conPI_valOutMod. u_m) annotation (Line(points={{-130,68}, - {108,68},{108,10},{102,10}}, color={0,0,127})); - connect(conPI_valChaMod.u_m, mTanBot_flow) annotation (Line(points={{62,10},{ - 70,10},{70,50},{-130,50}}, color={0,0,127})); - connect(swiValCha.y, yValSup[2]) annotation (Line(points={{-20,-142},{-20,-152}, - {40,-152},{40,-167.5}}, color={0,0,127})); - connect(swiValOut.y, yValSup[1]) annotation (Line(points={{60,-142},{60,-152}, - {40,-152},{40,-172.5}}, color={0,0,127})); - connect(booToReaValOut.y, yValSup[1]) annotation (Line(points={{90,-142},{90,-152}, - {40,-152},{40,-172.5}}, color={0,0,127})); - connect(isValChaClo.u, ySup_actual[2]) annotation (Line(points={{38,150},{ - -100,150},{-100,-10},{-130,-10},{-130,-7.5}}, color={0,0,127})); - connect(isValOutClo.u, ySup_actual[1]) annotation (Line(points={{38,110},{ - -100,110},{-100,-10},{-130,-10},{-130,-12.5}}, color={0,0,127})); + connect(conPI_pumSup.u_s, mTanSet_flow) + annotation (Line(points={{-70,22},{-70,88},{-150,88}}, color={0,0,127})); + connect(conPI_pumSup.u_m, mTanBot_flow) annotation (Line(points={{-82,10},{-90, + 10},{-90,50},{-150,50}}, color={0,0,127})); + connect(mTanTop_flow, conPI_valOut.u_m) annotation (Line(points={{-150,68},{110, + 68},{110,10},{118,10}}, color={0,0,127})); + connect(pasCha.y, isValChaClo.u) annotation (Line(points={{-39,190},{32,190},{ + 32,210},{38,210}}, color={0,0,127})); + connect(maxCha.y, isValChaClo.u) annotation (Line(points={{-38,230},{32,230},{ + 32,210},{38,210}}, color={0,0,127})); + connect(pasOut.y, isValOutClo.u) annotation (Line(points={{-39,110},{32,110},{ + 32,130},{38,130}}, color={0,0,127})); + connect(maxOut.y, isValOutClo.u) annotation (Line(points={{-38,150},{32,150}, + {32,130},{38,130}}, color={0,0,127})); + connect(and3Out.y, swiPumSup.u2) annotation (Line(points={{230,-2},{230,-120}, + {-70,-120},{-70,-158}}, color={255,0,255})); + connect(yRet_actual[2], maxCha.u1) annotation (Line(points={{-150,12.5},{-150, + 12},{-120,12},{-120,236},{-62,236}}, + color={0,0,127})); + connect(maxOut.u1, yRet_actual[1]) annotation (Line(points={{-62,156},{-120, + 156},{-120,7.5},{-150,7.5}}, color={0,0,127})); + connect(conPI_pumSup.y, swiPumSup.u1) annotation (Line(points={{-70,-1},{-70,-20}, + {-62,-20},{-62,-158}}, color={0,0,127})); + connect(andCha.y, swiPumSup1.u2) annotation (Line(points={{190,-2},{190,-136}, + {90,-136},{90,-158}}, color={255,0,255})); + connect(conPI_pumRet.y, swiPumSup1.u1) annotation (Line(points={{90,-1},{90,-20}, + {98,-20},{98,-158}}, color={0,0,127})); + connect(swiPumSup1.u3, zero.y) annotation (Line(points={{82,-158},{82,-110},{-99, + -110}}, color={0,0,127})); + connect(swiPumSup1.y, yPumRet) + annotation (Line(points={{90,-182},{90,-210}}, color={0,0,127})); + connect(booToReaValCha.u, andCha.y) + annotation (Line(points={{190,-158},{190,-2}}, color={255,0,255})); + connect(swiValOut.u2, and3Out.y) annotation (Line(points={{150,-158},{150, + -120},{230,-120},{230,-2}}, + color={255,0,255})); + connect(conPI_valOut.y, swiValOut.u1) annotation (Line(points={{130,-1},{130,-20}, + {158,-20},{158,-158}}, color={0,0,127})); + connect(swiValOut.u3, zero.y) annotation (Line(points={{142,-158},{142,-110},{ + -99,-110}}, color={0,0,127})); + connect(booToReaValOut.u, and3Out.y) annotation (Line(points={{-10,-158},{-8, + -158},{-8,-120},{230,-120},{230,-2}}, color={255,0,255})); + connect(swiValCha.u2, andCha.y) annotation (Line(points={{30,-158},{30,-136}, + {190,-136},{190,-2}}, color={255,0,255})); + connect(maxCha.u2, ySup_actual[2]) annotation (Line(points={{-62,224},{-100, + 224},{-100,-7.5},{-150,-7.5}}, color={0,0,127})); + connect(pasCha.u, ySup_actual[2]) annotation (Line(points={{-62,190},{-100, + 190},{-100,-7.5},{-150,-7.5}}, color={0,0,127})); + connect(maxOut.u2, ySup_actual[1]) annotation (Line(points={{-62,144},{-100, + 144},{-100,-12.5},{-150,-12.5}}, color={0,0,127})); + connect(pasOut.u, ySup_actual[1]) annotation (Line(points={{-62,110},{-100, + 110},{-100,-12.5},{-150,-12.5}}, color={0,0,127})); + connect(booToReaValOut.y, yValSup[1]) annotation (Line(points={{-10,-182},{ + -10,-194},{10,-194},{10,-212.5}}, color={0,0,127})); + connect(swiValCha.y, yValSup[2]) annotation (Line(points={{30,-182},{30,-194}, + {10,-194},{10,-207.5}}, color={0,0,127})); + connect(swiValOut.y, yRet[1]) annotation (Line(points={{150,-182},{150,-194}, + {170,-194},{170,-212.5}}, color={0,0,127})); + connect(booToReaValCha.y, yRet[2]) annotation (Line(points={{190,-182},{190, + -194},{170,-194},{170,-207.5}}, color={0,0,127})); annotation ( defaultComponentName="conPumVal", - Diagram(coordinateSystem(extent={{-120,-160},{200,180}})), Icon( + Diagram(coordinateSystem(extent={{-140,-200},{260,240}})), Icon( coordinateSystem(extent={{-100,-100},{100,100}})), Documentation(revisions="
    diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo index b386828049a..ad554dc452d 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo @@ -460,12 +460,12 @@ equation connect(uRemCha.y, conSupPum.uRemCha) annotation (Line(points={{-159,-90},{-156, -90},{-156,-116},{-32,-116},{-32,-60},{-46,-60},{-46,-10},{-58,-10}}, color={255,0,255})); - connect(conSupPum.ySup_actual, supPum.ySup_actual) annotation (Line(points={{ - -81,-30},{-84,-30},{-84,-38},{-78,-38},{-78,-49}}, color={0,0,127})); - connect(conSupPum.yPum, supPum.yPumSup) - annotation (Line(points={{-70,-31},{-70,-49}}, color={0,0,127})); + connect(conSupPum.ySup_actual, supPum.ySup_actual) annotation (Line(points={{-81,-30}, + {-84,-30},{-84,-38},{-76,-38},{-76,-49}}, color={0,0,127})); + connect(conSupPum.yPumSup, supPum.yPumSup) + annotation (Line(points={{-72,-31},{-72,-49}}, color={0,0,127})); connect(conSupPum.yValSup, supPum.yValSup) - annotation (Line(points={{-66,-31},{-66,-49}}, color={0,0,127})); + annotation (Line(points={{-68,-31},{-68,-49}}, color={0,0,127})); annotation ( __Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos" "Simulate and plot"), diff --git a/Buildings/Fluid/Storage/Plant/SupplyPumpValve.mo b/Buildings/Fluid/Storage/Plant/SupplyPumpValve.mo index 3c0d030c925..e224f759b71 100644 --- a/Buildings/Fluid/Storage/Plant/SupplyPumpValve.mo +++ b/Buildings/Fluid/Storage/Plant/SupplyPumpValve.mo @@ -5,7 +5,7 @@ model SupplyPumpValve extends Buildings.Fluid.Storage.Plant.BaseClasses.PartialBranchPorts; Buildings.Fluid.Movers.SpeedControlled_y pumSup( - redeclare package Medium = Medium, + redeclare final package Medium = Medium, per(pressure(dp=nom.dp_nominal*{2,1.2,0}, V_flow=(nom.m_flow_nominal)/1.2*{ 0,1.2,2})), energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, @@ -18,99 +18,219 @@ model SupplyPumpValve rotation=0, origin={-50,60}))); Buildings.Fluid.Actuators.Valves.TwoWayLinear valSupOut( - redeclare package Medium = Medium, + redeclare final package Medium = Medium, dpValve_nominal=0.1*nom.dp_nominal, use_inputFilter=true, y_start=0, l=1E-5, - m_flow_nominal=nom.m_flow_nominal) if nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote - or nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + m_flow_nominal=nom.m_flow_nominal) + if nom.plaTyp == + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote + or nom.plaTyp == + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "Output valve, open when tank NOT being charged remotely" annotation (Placement(transformation(extent={{20,50},{40,70}}))); Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valSupCha( - redeclare package Medium = Medium, + redeclare final package Medium = Medium, dpValve_nominal=0.1*nom.dp_nominal, use_inputFilter=true, y_start=0, l=1E-5, - m_flow_nominal=nom.mTan_flow_nominal) if nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote - or nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + m_flow_nominal=nom.mTan_flow_nominal) + if nom.plaTyp == + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote + or nom.plaTyp == + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "Charging valve, modulated when tank is being charged remotely" - annotation (Placement(transformation(extent={{40,-30},{20,-10}}))); + annotation (Placement(transformation(extent={{40,-10},{20,10}}))); Buildings.Fluid.Storage.Plant.BaseClasses.FluidPassThrough pasValSupOut( - redeclare package Medium = Medium) if nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedLocal + redeclare final package Medium = Medium) + if nom.plaTyp == + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedLocal "Replaces valSupOut when remote charging not allowed" - annotation (Placement(transformation(extent={{20,10},{40,30}}))); + annotation (Placement(transformation(extent={{20,20},{40,40}}))); Buildings.Fluid.FixedResistances.CheckValve cheValSup( - redeclare package Medium = Medium, + redeclare final package Medium = Medium, m_flow_nominal=nom.m_flow_nominal, dpValve_nominal=0.1*nom.dp_nominal, dpFixed_nominal=0.1*nom.dp_nominal) "Check valve" annotation (Placement( transformation( - extent={{10,-10},{-10,10}}, + extent={{10,10},{-10,-10}}, rotation=180, origin={-10,60}))); - Modelica.Blocks.Interfaces.RealOutput ySup_actual[2] if nom.plaTyp == - Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote or nom.plaTyp - == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open - "Actual positions of the valves connected to the supply line" annotation ( + Modelica.Blocks.Interfaces.RealOutput ySup_actual[2] + if nom.plaTyp == + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote + or nom.plaTyp == + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + "Positions of 1: valSupOut, 2: valSupCha" annotation ( Placement(transformation( extent={{10,-10},{-10,10}}, rotation=270, - origin={-90,110}), iconTransformation( + origin={-70,110}), iconTransformation( extent={{10,-10},{-10,10}}, rotation=270, - origin={-80,110}))); - Modelica.Blocks.Interfaces.RealInput yValSup[2] if nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote - or nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + origin={-60,110}))); + Modelica.Blocks.Interfaces.RealInput yValSup[2] + if nom.plaTyp == + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote + or nom.plaTyp == + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "Positions of the valves on the supply line" annotation (Placement( transformation( extent={{10,10},{-10,-10}}, rotation=90, - origin={40,110}), iconTransformation( + origin={30,108}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={40,110}))); - Modelica.Blocks.Interfaces.RealInput yPumSup "Secondary pump speed input" + origin={20,110}))); + Modelica.Blocks.Interfaces.RealInput yPumSup "Speed input of the supply pump" annotation (Placement(transformation( extent={{10,10},{-10,-10}}, rotation=90, - origin={20,110}), iconTransformation( + origin={10,110}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={0,110}))); + origin={-20,110}))); + Buildings.Fluid.Movers.SpeedControlled_y pumRet( + redeclare final package Medium = Medium, + per(pressure(dp=nom.dp_nominal*{2,1.2,0}, V_flow=(nom.m_flow_nominal)/1.2*{0, + 1.2,2})), + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + allowFlowReversal=true, + addPowerToMedium=false, + y_start=0, + T_start=nom.T_CHWR_nominal) + if nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + "Auxilliary CHW pump on the return line" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-50,-60}))); + Buildings.Fluid.FixedResistances.CheckValve cheValRet( + redeclare final package Medium = Medium, + m_flow_nominal=nom.m_flow_nominal, + dpValve_nominal=0.1*nom.dp_nominal, + dpFixed_nominal=0.1*nom.dp_nominal) + if nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + "Check valve" annotation (Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=180, + origin={-10,-60}))); + Buildings.Fluid.Actuators.Valves.TwoWayLinear valRetCha( + redeclare final package Medium = Medium, + dpValve_nominal=0.1*nom.dp_nominal, + use_inputFilter=true, + y_start=0, + l=1E-5, + m_flow_nominal=nom.m_flow_nominal) + if nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + "Charging valve, open when tank is being charged remotely" + annotation (Placement(transformation(extent={{20,-70},{40,-50}}))); + Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valRetOut( + redeclare final package Medium = Medium, + dpValve_nominal=0.1*nom.dp_nominal, + use_inputFilter=true, + y_start=0, + l=1E-5, + m_flow_nominal=nom.mTan_flow_nominal) + if nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + "Output valve, modulated when tank NOT being charged remotely" + annotation (Placement(transformation(extent={{40,-100},{20,-80}}))); + Buildings.Fluid.Storage.Plant.BaseClasses.FluidPassThrough pasRet( + redeclare final package Medium = Medium) + if nom.plaTyp == + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedLocal + or nom.plaTyp == + Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote + "Replaces the pump and valves on the return branch when the tank is closed" + annotation (Placement(transformation(extent={{40,-40},{20,-20}}))); + Modelica.Blocks.Interfaces.RealOutput yRet_actual[2] + if nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + "Positions of 1: valRetOut, 2: valRetCha" annotation (Placement( + transformation( + extent={{10,-10},{-10,10}}, + rotation=270, + origin={-90,110}), iconTransformation( + extent={{10,-10},{-10,10}}, + rotation=270, + origin={-100,110}))); + Modelica.Blocks.Interfaces.RealInput yRet[2] + if nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + "Control signals for the valves on the return line" annotation (Placement( + transformation( + extent={{10,10},{-10,-10}}, + rotation=90, + origin={70,110}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={98,110}))); + Modelica.Blocks.Interfaces.RealInput yPumRet + if nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + "Speed input of the auxilliary pump on the return line" annotation ( + Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=90, + origin={50,110}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={60,110}))); equation connect(pumSup.port_b, cheValSup.port_a) annotation (Line(points={{-40,60},{-20,60}}, color={0,127,255})); - connect(pasValSupOut.port_a, cheValSup.port_b) annotation (Line(points={{20, - 20},{10,20},{10,60},{-1.77636e-15,60}}, color={0,127,255})); - connect(pumSup.y, yPumSup) annotation (Line(points={{-50,72},{-50,96},{20,96}, - {20,110}}, color={0,0,127})); + connect(pasValSupOut.port_a, cheValSup.port_b) annotation (Line(points={{20,30}, + {10,30},{10,60},{-1.77636e-15,60}}, color={0,127,255})); + connect(pumSup.y, yPumSup) annotation (Line(points={{-50,72},{-50,96},{10,96}, + {10,110}}, color={0,0,127})); connect(port_chiOut, pumSup.port_a) annotation (Line(points={{-100,60},{-60,60}}, color={0,127,255})); connect(port_chiOut, valSupCha.port_b) annotation (Line(points={{-100,60},{-80, - 60},{-80,-20},{20,-20}}, color={0,127,255})); - connect(valSupCha.port_a, port_CHWS) annotation (Line(points={{40,-20},{80,-20}, - {80,60},{100,60}}, color={0,127,255})); - connect(pasValSupOut.port_b, port_CHWS) annotation (Line(points={{40,20},{80, - 20},{80,60},{100,60}}, color={0,127,255})); - connect(port_chiInl, port_CHWR) - annotation (Line(points={{-100,-60},{100,-60}}, color={0,127,255})); + 60},{-80,0},{20,0}}, color={0,127,255})); + connect(valSupCha.port_a, port_CHWS) annotation (Line(points={{40,0},{60,0},{60, + 60},{100,60}}, color={0,127,255})); + connect(pasValSupOut.port_b, port_CHWS) annotation (Line(points={{40,30},{60,30}, + {60,60},{100,60}}, color={0,127,255})); connect(cheValSup.port_b, valSupOut.port_a) annotation (Line(points={{-1.77636e-15,60},{20,60}}, color={0,127,255})); connect(valSupOut.port_b, port_CHWS) annotation (Line(points={{40,60},{100,60}}, color={0,127,255})); connect(ySup_actual, ySup_actual) - annotation (Line(points={{-90,110},{-90,110}}, color={0,0,127})); - connect(valSupOut.y_actual, ySup_actual[1]) annotation (Line(points={{35,67}, - {40,67},{40,82},{-90,82},{-90,107.5}}, color={0,0,127})); - connect(valSupCha.y_actual, ySup_actual[2]) annotation (Line(points={{25,-13}, - {24,-13},{24,-12},{-90,-12},{-90,112.5}}, color={0,0,127})); - connect(valSupOut.y, yValSup[1]) annotation (Line(points={{30,72},{30,74},{46, - 74},{46,96},{40,96},{40,107.5}}, color={0,0,127})); - connect(valSupCha.y, yValSup[2]) annotation (Line(points={{30,-8},{30,0},{46, - 0},{46,96},{40,96},{40,112.5}}, color={0,0,127})); + annotation (Line(points={{-70,110},{-70,110}}, color={0,0,127})); + connect(valSupOut.y_actual, ySup_actual[1]) annotation (Line(points={{35,67},{ + 44,67},{44,22},{-70,22},{-70,107.5}}, color={0,0,127})); + connect(valSupCha.y_actual, ySup_actual[2]) annotation (Line(points={{25,7},{14, + 7},{14,22},{-70,22},{-70,112.5}}, color={0,0,127})); + connect(valSupOut.y, yValSup[1]) annotation (Line(points={{30,72},{30,105.5}}, + color={0,0,127})); + connect(valSupCha.y, yValSup[2]) annotation (Line(points={{30,12},{50,12},{50, + 80},{30,80},{30,110.5}}, color={0,0,127})); + connect(port_chiInl, pumRet.port_a) + annotation (Line(points={{-100,-60},{-60,-60}}, color={0,127,255})); + connect(pumRet.port_b, cheValRet.port_a) + annotation (Line(points={{-40,-60},{-20,-60}}, color={0,127,255})); + connect(cheValRet.port_b, valRetCha.port_a) + annotation (Line(points={{-1.77636e-15,-60},{20,-60}}, color={0,127,255})); + connect(valRetCha.port_b, port_CHWR) + annotation (Line(points={{40,-60},{100,-60}}, color={0,127,255})); + connect(valRetOut.port_a, port_CHWR) annotation (Line(points={{40,-90},{80,-90}, + {80,-60},{100,-60}}, color={0,127,255})); + connect(valRetOut.port_b, port_chiInl) annotation (Line(points={{20,-90},{-70, + -90},{-70,-60},{-100,-60}}, color={0,127,255})); + connect(port_CHWR, pasRet.port_a) annotation (Line(points={{100,-60},{90,-60}, + {90,-30},{40,-30}}, color={0,127,255})); + connect(pasRet.port_b, port_chiInl) annotation (Line(points={{20,-30},{-80,-30}, + {-80,-60},{-100,-60}}, color={0,127,255})); + connect(valRetCha.y_actual, yRet_actual[2]) annotation (Line(points={{35,-53}, + {52,-53},{52,-96},{-90,-96},{-90,112.5}}, color={0,0,127})); + connect(valRetOut.y_actual, yRet_actual[1]) annotation (Line(points={{25,-83}, + {14,-83},{14,-96},{-90,-96},{-90,107.5}}, color={0,0,127})); + connect(valRetOut.y, yRet[1]) + annotation (Line(points={{30,-78},{70,-78},{70,107.5}}, color={0,0,127})); + connect(valRetCha.y, yRet[2]) + annotation (Line(points={{30,-48},{70,-48},{70,112.5}}, color={0,0,127})); + connect(pumRet.y, yPumRet) annotation (Line(points={{-50,-48},{-50,-26},{66,-26}, + {66,96},{50,96},{50,110}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,100}}), graphics={Line( points={{-20,0},{40,0}}, diff --git a/Buildings/Fluid/Storage/Plant/TankBranch.mo b/Buildings/Fluid/Storage/Plant/TankBranch.mo index 8781d940e55..2f372ff9b50 100644 --- a/Buildings/Fluid/Storage/Plant/TankBranch.mo +++ b/Buildings/Fluid/Storage/Plant/TankBranch.mo @@ -7,7 +7,7 @@ model TankBranch Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "Tank is open"; Buildings.Fluid.FixedResistances.PressureDrop preDroTanBot( - redeclare package Medium = Medium, + redeclare final package Medium = Medium, final allowFlowReversal=true, final m_flow_nominal=nom.mTan_flow_nominal) "Flow resistance on tank branch near tank bottom" annotation (Placement( @@ -25,7 +25,7 @@ model TankBranch rotation=270, origin={80,110}))); Buildings.Fluid.Storage.Stratified tan( - redeclare package Medium = Medium, + redeclare final package Medium = Medium, final allowFlowReversal=true, hTan=3, dIns=0.3, @@ -39,8 +39,9 @@ model TankBranch nom.T_CHWS_nominal, tan.nSeg)) "Tank" annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - Modelica.Fluid.Sensors.MassFlowRate senFloBot(redeclare package Medium = - Medium, final allowFlowReversal=true) "Flow rate sensor at tank bottom" + Modelica.Fluid.Sensors.MassFlowRate senFloBot( + redeclare final package Medium = Medium, + final allowFlowReversal=true) "Flow rate sensor at tank bottom" annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=90, @@ -55,7 +56,7 @@ model TankBranch rotation=-90, origin={-10,30}))); Buildings.Fluid.FixedResistances.PressureDrop preDroTanTop( - redeclare package Medium = Medium, + redeclare final package Medium = Medium, final allowFlowReversal=true, final m_flow_nominal=nom.mTan_flow_nominal) "Flow resistance on tank branch near tank top" annotation (Placement( @@ -63,8 +64,9 @@ model TankBranch extent={{-10,-10},{10,10}}, rotation=0, origin={-30,0}))); - Modelica.Fluid.Sensors.MassFlowRate senFloTop(redeclare package Medium = - Medium, final allowFlowReversal=true) "Flow rate sensor at tank top" + Modelica.Fluid.Sensors.MassFlowRate senFloTop( + redeclare final package Medium = Medium, + final allowFlowReversal=true) "Flow rate sensor at tank top" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=90, diff --git a/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo index 5a49b3e2e25..86b1589774e 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo @@ -36,11 +36,11 @@ equation connect(set_mChi_flow.y, ideChiBra.mPumSet_flow) annotation (Line(points={{-79,-30},{-56,-30},{-56,-11}}, color={0,0,127})); connect(supPum.ySup_actual, conSupPum.ySup_actual) annotation (Line(points={{ - 12,11},{12,34},{4,34},{4,40},{9,40}}, color={0,0,127})); - connect(conSupPum.yPum, supPum.yPumSup) - annotation (Line(points={{20,39},{20,11}}, color={0,0,127})); + 14,11},{14,34},{4,34},{4,40},{9,40}}, color={0,0,127})); + connect(conSupPum.yPumSup, supPum.yPumSup) + annotation (Line(points={{18,39},{18,11}}, color={0,0,127})); connect(conSupPum.yValSup, supPum.yValSup) - annotation (Line(points={{24,39},{24,11}}, color={0,0,127})); + annotation (Line(points={{22,39},{22,11}}, color={0,0,127})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), From cbfed9a5ef346b69f72672827cf5b9a147170b23 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Wed, 20 Apr 2022 14:53:42 -0700 Subject: [PATCH 092/463] misc adjustments --- .../Plant/BaseClasses/PumpValveControl.mo | 13 ++- .../Fluid/Storage/Plant/SupplyPumpValve.mo | 40 ++++---- Buildings/Fluid/Storage/Plant/TankBranch.mo | 7 +- .../Validation/BaseClasses/PartialPlant.mo | 1 + .../Validation/ClosedTankNoRemoteCharging.mo | 2 +- .../ClosedTankWithRemoteCharging.mo | 4 +- .../Storage/Plant/Validation/OpenTank.mo | 91 ++++++++----------- .../Validation/ClosedTankNoRemoteCharging.mos | 2 +- .../ClosedTankWithRemoteCharging.mos | 2 +- 9 files changed, 79 insertions(+), 83 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo index 4773fa4cebb..a98dbdf9c76 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo @@ -3,7 +3,6 @@ block PumpValveControl "Control block for the supply pump and nearby valves" extends Modelica.Blocks.Icons.Block; - //parameter Boolean tankIsOpen = false "Tank is open"; parameter Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup plaTyp= Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote "Type of plant setup"; @@ -193,7 +192,7 @@ block PumpValveControl extent={{-10,-10},{10,10}}, rotation=-90, origin={100,-110}))); - Controls.OBC.CDL.Continuous.Switch swiPumSup1 + Buildings.Controls.OBC.CDL.Continuous.Switch swiPumSup1 if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "True = on (y>0); false = off (y=0)." annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -209,18 +208,24 @@ block PumpValveControl extent={{-10,-10},{10,10}}, rotation=-90, origin={60,-110}))); - Controls.OBC.CDL.Continuous.Switch swiValOut + Buildings.Controls.OBC.CDL.Continuous.Switch swiValOut if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "True = on (y>0); false = off (y=0)." annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={150,-170}))); - Controls.OBC.CDL.Conversions.BooleanToReal booToReaValCha + Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToReaValCha if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "True = 1, false = 0" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={190,-170}))); + +initial equation + assert(plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + or plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote, + "To use this block, the only values allowed for plaTyp is + .Open or .ClosedRemote"); equation connect(conPI_valCha.u_s,mTanSet_flow) annotation (Line(points={{30,22},{30,88}, {-150,88}}, color={0,0,127})); diff --git a/Buildings/Fluid/Storage/Plant/SupplyPumpValve.mo b/Buildings/Fluid/Storage/Plant/SupplyPumpValve.mo index e224f759b71..0de04c0e93b 100644 --- a/Buildings/Fluid/Storage/Plant/SupplyPumpValve.mo +++ b/Buildings/Fluid/Storage/Plant/SupplyPumpValve.mo @@ -4,6 +4,10 @@ model SupplyPumpValve extends Buildings.Fluid.Storage.Plant.BaseClasses.PartialBranchPorts; + parameter Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup plaTyp= + nom.plaTyp + "Type of plant setup"; + Buildings.Fluid.Movers.SpeedControlled_y pumSup( redeclare final package Medium = Medium, per(pressure(dp=nom.dp_nominal*{2,1.2,0}, V_flow=(nom.m_flow_nominal)/1.2*{ @@ -24,9 +28,9 @@ model SupplyPumpValve y_start=0, l=1E-5, m_flow_nominal=nom.m_flow_nominal) - if nom.plaTyp == + if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote - or nom.plaTyp == + or plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "Output valve, open when tank NOT being charged remotely" annotation (Placement(transformation(extent={{20,50},{40,70}}))); @@ -37,15 +41,15 @@ model SupplyPumpValve y_start=0, l=1E-5, m_flow_nominal=nom.mTan_flow_nominal) - if nom.plaTyp == + if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote - or nom.plaTyp == + or plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "Charging valve, modulated when tank is being charged remotely" annotation (Placement(transformation(extent={{40,-10},{20,10}}))); Buildings.Fluid.Storage.Plant.BaseClasses.FluidPassThrough pasValSupOut( redeclare final package Medium = Medium) - if nom.plaTyp == + if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedLocal "Replaces valSupOut when remote charging not allowed" annotation (Placement(transformation(extent={{20,20},{40,40}}))); @@ -59,9 +63,9 @@ model SupplyPumpValve rotation=180, origin={-10,60}))); Modelica.Blocks.Interfaces.RealOutput ySup_actual[2] - if nom.plaTyp == + if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote - or nom.plaTyp == + or plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "Positions of 1: valSupOut, 2: valSupCha" annotation ( Placement(transformation( @@ -72,9 +76,9 @@ model SupplyPumpValve rotation=270, origin={-60,110}))); Modelica.Blocks.Interfaces.RealInput yValSup[2] - if nom.plaTyp == + if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote - or nom.plaTyp == + or plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "Positions of the valves on the supply line" annotation (Placement( transformation( @@ -102,7 +106,7 @@ model SupplyPumpValve addPowerToMedium=false, y_start=0, T_start=nom.T_CHWR_nominal) - if nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "Auxilliary CHW pump on the return line" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, @@ -113,7 +117,7 @@ model SupplyPumpValve m_flow_nominal=nom.m_flow_nominal, dpValve_nominal=0.1*nom.dp_nominal, dpFixed_nominal=0.1*nom.dp_nominal) - if nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "Check valve" annotation (Placement(transformation( extent={{10,10},{-10,-10}}, rotation=180, @@ -125,7 +129,7 @@ model SupplyPumpValve y_start=0, l=1E-5, m_flow_nominal=nom.m_flow_nominal) - if nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "Charging valve, open when tank is being charged remotely" annotation (Placement(transformation(extent={{20,-70},{40,-50}}))); Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valRetOut( @@ -135,19 +139,19 @@ model SupplyPumpValve y_start=0, l=1E-5, m_flow_nominal=nom.mTan_flow_nominal) - if nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "Output valve, modulated when tank NOT being charged remotely" annotation (Placement(transformation(extent={{40,-100},{20,-80}}))); Buildings.Fluid.Storage.Plant.BaseClasses.FluidPassThrough pasRet( redeclare final package Medium = Medium) - if nom.plaTyp == + if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedLocal - or nom.plaTyp == + or plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote "Replaces the pump and valves on the return branch when the tank is closed" annotation (Placement(transformation(extent={{40,-40},{20,-20}}))); Modelica.Blocks.Interfaces.RealOutput yRet_actual[2] - if nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "Positions of 1: valRetOut, 2: valRetCha" annotation (Placement( transformation( extent={{10,-10},{-10,10}}, @@ -157,7 +161,7 @@ model SupplyPumpValve rotation=270, origin={-100,110}))); Modelica.Blocks.Interfaces.RealInput yRet[2] - if nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "Control signals for the valves on the return line" annotation (Placement( transformation( extent={{10,10},{-10,-10}}, @@ -167,7 +171,7 @@ model SupplyPumpValve rotation=-90, origin={98,110}))); Modelica.Blocks.Interfaces.RealInput yPumRet - if nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open + if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "Speed input of the auxilliary pump on the return line" annotation ( Placement(transformation( extent={{10,10},{-10,-10}}, diff --git a/Buildings/Fluid/Storage/Plant/TankBranch.mo b/Buildings/Fluid/Storage/Plant/TankBranch.mo index 2f372ff9b50..64180d3410a 100644 --- a/Buildings/Fluid/Storage/Plant/TankBranch.mo +++ b/Buildings/Fluid/Storage/Plant/TankBranch.mo @@ -3,7 +3,7 @@ model TankBranch "(Draft) Model of the tank branch where the tank can potentially be charged remotely" extends Buildings.Fluid.Storage.Plant.BaseClasses.PartialBranchPorts; - final parameter Boolean tankIsOpen = nom.plaTyp == + parameter Boolean tankIsOpen = nom.plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "Tank is open"; Buildings.Fluid.FixedResistances.PressureDrop preDroTanBot( @@ -71,7 +71,7 @@ model TankBranch extent={{-10,-10},{10,10}}, rotation=90, origin={-50,-30}))); - Modelica.Blocks.Interfaces.RealOutput mTanTop_flow + Modelica.Blocks.Interfaces.RealOutput mTanTop_flow if tankIsOpen "Mass flow rate measured at the top of the tank" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, @@ -123,7 +123,8 @@ equation Line( points={{40,100},{40,40},{24,40}}, color={0,0,0}, - pattern=LinePattern.Dash), + pattern=LinePattern.Dash, + visible=tankIsOpen), Line( points={{80,100},{80,-40},{26,-40}}, color={0,0,0}, diff --git a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo index 17906bf2432..aeed81637f1 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo @@ -15,6 +15,7 @@ partial model PartialPlant "(Draft)" ideChiBra( redeclare final package Medium = Medium, final nom=nom) + "Ideal chiller branch that generates flow rate and sets fluid temperature" annotation (Placement(transformation(extent={{-70,-10},{-50,10}}))); Buildings.Fluid.Storage.Plant.TankBranch tanBra( preDroTanBot(final dp_nominal=nom.dp_nominal*0.05), diff --git a/Buildings/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mo index 5f54cfac61a..ac508ac957c 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mo @@ -34,7 +34,7 @@ equation connect(tanBra.mTanBot_flow, gai.u) annotation (Line(points={{-12,11},{-12,14}, {-10,14},{-10,18}}, color={0,0,127})); connect(supPum.yPumSup, conPID_PumSec.y) - annotation (Line(points={{20,11},{20,70},{1,70}}, color={0,0,127})); + annotation (Line(points={{18,11},{18,70},{1,70}}, color={0,0,127})); connect(mSet_flow.y, ideChiBra.mPumSet_flow) annotation (Line(points={{-79,-30},{-56,-30},{-56,-11}}, color={0,0,127})); annotation (__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mos" diff --git a/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo index 86b1589774e..1e3d912b076 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo @@ -3,8 +3,8 @@ model ClosedTankWithRemoteCharging "(Draft) Validation model of the plant allowing remote charging" extends Modelica.Icons.Example; extends - Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialClosedTank(nom( - final plaTyp= + Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialClosedTank( + nom(final plaTyp= Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote)); Modelica.Blocks.Sources.TimeTable set_mTan_flow(table=[0,0; 3600/7,0; 3600/7, diff --git a/Buildings/Fluid/Storage/Plant/Validation/OpenTank.mo b/Buildings/Fluid/Storage/Plant/Validation/OpenTank.mo index f6ed736fc06..7c5a0f0885f 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/OpenTank.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/OpenTank.mo @@ -2,9 +2,11 @@ within Buildings.Fluid.Storage.Plant.Validation; model OpenTank "(Draft)" extends Modelica.Icons.Example; extends Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialPlant( - souChi(final use_m_flow_in=true), - nom(final tankIsOpen=true, - final dp_nominal=300000)); + nom( + final plaTyp=Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open, + final dp_nominal=300000), + sin(nPorts=1), + sou(nPorts=1)); Modelica.Blocks.Sources.TimeTable set_mTan_flow(table=[0,0; 3600/7,0; 3600/7, -1; 3600/7*3,-1; 3600/7*3,0; 3600/7*4,0; 3600/7*4,1; 3600/7*6,1; 3600/7 @@ -19,19 +21,13 @@ model OpenTank "(Draft)" annotation (Placement(transformation(extent={{-60,80},{-40,100}}))); Modelica.Blocks.Sources.TimeTable set_mChi_flow(table=[0,0; 3600/7,0; 3600/7, 1; 3600/7*5,1; 3600/7*5,0]) "Chiller flow rate setpoint" - annotation (Placement(transformation(extent={{-100,20},{-80,40}}))); + annotation (Placement(transformation(extent={{-100,-40},{-80,-20}}))); Buildings.Fluid.Storage.Plant.BaseClasses.PumpValveControl conPumVal( - final tankIsOpen=nom.tankIsOpen) + final plaTyp = nom.plaTyp) "Control block for the secondary pump and near-by valves" annotation (Placement(transformation(extent={{10,40},{30,60}}))); - Modelica.Blocks.Sources.Constant set_pCHWS(k=sin.p - 0.3*nom.dp_nominal) - "PSV setpoint on the supply line" - annotation (Placement(transformation(extent={{80,80},{60,100}}))); - Modelica.Blocks.Sources.Constant set_pCHWR(k=sou.p + 0.3*nom.dp_nominal) - "PSV setpoint on the return line" - annotation (Placement(transformation(extent={{80,40},{60,60}}))); Buildings.Fluid.FixedResistances.PressureDrop preDroSup( - redeclare package Medium = Medium, + redeclare final package Medium = Medium, final allowFlowReversal=true, final m_flow_nominal=nom.mTan_flow_nominal, dp_nominal=0.3*nom.dp_nominal) "Flow resistance" @@ -40,7 +36,7 @@ model OpenTank "(Draft)" rotation=0, origin={60,20}))); Buildings.Fluid.FixedResistances.PressureDrop preDroRet( - redeclare package Medium = Medium, + redeclare final package Medium = Medium, final allowFlowReversal=true, final m_flow_nominal=nom.mTan_flow_nominal, dp_nominal=0.3*nom.dp_nominal) "Flow resistance" annotation (Placement( @@ -48,58 +44,47 @@ model OpenTank "(Draft)" extent={{10,-10},{-10,10}}, rotation=0, origin={60,-20}))); - Buildings.Fluid.Storage.Plant.SupplyPumpOpenTank supPum( + Buildings.Fluid.Storage.Plant.SupplyPumpValve supPum( redeclare final package Medium = Medium, final nom=nom) "Supply pump and valves" - annotation (Placement(transformation(extent={{8,-10},{28,10}}))); + annotation (Placement(transformation(extent={{10,-10},{30,10}}))); equation - connect(set_mChi_flow.y, souChi.m_flow_in) - annotation (Line(points={{-79,30},{-70,30},{-70,28},{-62,28}}, - color={0,0,127})); - connect(set_mTan_flow.y,conPumVal. mTanSet_flow) - annotation (Line(points={{-79,70},{-72,70},{-72,52},{9,52}}, - color={0,0,127})); connect(conPumVal.uOnl, uOnl.y) annotation (Line(points={{32,56},{36,56},{36,90}, {-39,90}}, color={255,0,255})); connect(conPumVal.uRemCha, uRemCha.y) annotation (Line(points={{32,60},{32,70},{-19,70}},color={255,0,255})); - connect(tanBra.mTan_flow,conPumVal. mTan_flow) + connect(tanBra.port_CHWR, supPum.port_chiInl) + annotation (Line(points={{-10,-6},{10,-6}}, color={0,127,255})); + connect(supPum.port_chiOut, tanBra.port_CHWS) + annotation (Line(points={{10,6},{-10,6}}, color={0,127,255})); + connect(supPum.port_CHWS, preDroSup.port_a) annotation (Line(points={{30,6},{ + 44,6},{44,20},{50,20}}, color={0,127,255})); + connect(supPum.port_CHWR, preDroRet.port_b) annotation (Line(points={{30,-6}, + {44,-6},{44,-20},{50,-20}}, color={0,127,255})); + connect(tanBra.mTanTop_flow, conPumVal.mTanTop_flow) + annotation (Line(points={{-16,11},{-16,50},{9,50}}, color={0,0,127})); + connect(conPumVal.mTanSet_flow, set_mTan_flow.y) annotation (Line(points={{9, + 54},{-72,54},{-72,70},{-79,70}}, color={0,0,127})); + connect(set_mChi_flow.y, ideChiBra.mPumSet_flow) + annotation (Line(points={{-79,-30},{-56,-30},{-56,-11}}, color={0,0,127})); + connect(supPum.yRet_actual, conPumVal.yRet_actual) annotation (Line(points={{ + 10,11},{10,32},{2,32},{2,44},{9,44}}, color={0,0,127})); + connect(conPumVal.ySup_actual, supPum.ySup_actual) annotation (Line(points={{ + 9,40},{6,40},{6,36},{14,36},{14,11}}, color={0,0,127})); + connect(supPum.yPumSup, conPumVal.yPumSup) + annotation (Line(points={{18,11},{18,39}}, color={0,0,127})); + connect(conPumVal.yValSup, supPum.yValSup) + annotation (Line(points={{22,39},{22,11}}, color={0,0,127})); + connect(conPumVal.yPumRet, supPum.yPumRet) + annotation (Line(points={{26,39},{26,11}}, color={0,0,127})); + connect(conPumVal.yRet, supPum.yRet) + annotation (Line(points={{30,39},{30,11},{29.8,11}}, color={0,0,127})); + connect(tanBra.mTanBot_flow, conPumVal.mTanBot_flow) annotation (Line(points={{-12,11},{-12,48},{9,48}}, color={0,0,127})); - connect(supPum.yValDis_actual,conPumVal. yValDis_actual) annotation (Line( - points={{8,11},{8,16},{-2,16},{-2,44},{9,44}}, color={0,0,127})); - connect(supPum.yValCha_actual,conPumVal. yValCha_actual) annotation (Line( - points={{12,11},{12,20},{2,20},{2,40},{9,40}}, color={0,0,127})); - connect(supPum.yPum, conPumVal.yPum) annotation (Line(points={{16,11},{16,24}, - {16,24},{16,39}}, color={0,0,127})); - connect(supPum.yValChaMod, conPumVal.yValChaMod) annotation (Line(points={{20,11}, - {20,28},{20,28},{20,39}}, color={0,0,127})); - connect(conPumVal.yValChaOn, supPum.yValChaOn) annotation (Line(points={{22,39}, - {22,30},{22,30},{22,11}}, color={0,0,127})); - connect(supPum.yValDisMod, conPumVal.yValDisMod) annotation (Line(points={{26,11}, - {26,34},{26,34},{26,39}}, color={0,0,127})); - connect(conPumVal.yValDisOn, supPum.yValDisOn) annotation (Line(points={{28,39}, - {28,11}}, color={0,0,127})); - connect(conPumVal.pCHWS, supPum.pCHWS) - annotation (Line(points={{31,40},{36,40},{36,3},{29,3}}, color={0,0,127})); - connect(supPum.pCHWR, conPumVal.pCHWR) annotation (Line(points={{29,-3},{40, - -3},{40,44},{31,44}}, - color={0,0,127})); - connect(conPumVal.pCHWSSet, set_pCHWS.y) annotation (Line(points={{31,52},{50, - 52},{50,90},{59,90}}, color={0,0,127})); - connect(conPumVal.pCHWRSet, set_pCHWR.y) annotation (Line(points={{31,48},{54, - 48},{54,50},{59,50}}, color={0,0,127})); connect(preDroSup.port_b, sin.ports[1]) annotation (Line(points={{70,20},{80,20}}, color={0,127,255})); - connect(preDroSup.port_a, supPum.port_CHWS) annotation (Line(points={{50,20}, - {44,20},{44,6},{28,6}},color={0,127,255})); - connect(supPum.port_CHWR, preDroRet.port_b) annotation (Line(points={{28,-6}, - {44,-6},{44,-20},{50,-20}},color={0,127,255})); connect(preDroRet.port_a, sou.ports[1]) annotation (Line(points={{70,-20},{80,-20}}, color={0,127,255})); - connect(tanBra.port_CHWS, supPum.port_chiOut) - annotation (Line(points={{-10,6},{8,6}}, color={0,127,255})); - connect(supPum.port_chiInl, tanBra.port_CHWR) - annotation (Line(points={{8,-6},{-10,-6}}, color={0,127,255})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mos index 1da3d3aebca..f599cf79565 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mos @@ -6,7 +6,7 @@ simulateModel("Buildings.Fluid.Storage.Plant.Validation.ClosedTankNoRemoteChargi // Plot commands createPlot(id=1, position={15, 15, 961, 426}, - y={"ideChiBra.m_flow", "tanBra.mTanTop_flow", "supPum.pumSup.m_flow"}, + y={"ideChiBra.m_flow", "tanBra.mTanBot_flow", "supPum.pumSup.m_flow"}, range={0.0, 3600.0, -1.5, 2.5}, grid=true, colors={{28,108,200}, {238,46,47}, {0,140,72}}, diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mos index fcc7f9ef8d0..cb1ee794561 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mos @@ -6,7 +6,7 @@ simulateModel("Buildings.Fluid.Storage.Plant.Validation.ClosedTankWithRemoteChar // Plot commands createPlot(id=1, position={15, 15, 929, 372}, - y={"ideChiBra.m_flow", "tanBra.mTanTop_flow", "supPum.pumSup.m_flow"}, + y={"ideChiBra.m_flow", "tanBra.mTanBot_flow", "supPum.pumSup.m_flow"}, range={0.0, 3600.0, -4.0, 3.0}, grid=true, colors={{28,108,200}, {238,46,47}, {0,140,72}}, From 78fcf7c844b7081d8667fd09bf7e99e12c71a8c1 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Thu, 21 Apr 2022 08:02:37 -0700 Subject: [PATCH 093/463] open tank control --- .../Plant/BaseClasses/PumpValveControl.mo | 20 ++++++------- .../Storage/Plant/Validation/OpenTank.mo | 30 +++++++++++-------- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo index a98dbdf9c76..de128d51789 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo @@ -110,9 +110,9 @@ block PumpValveControl origin={190,10}))); Buildings.Controls.Continuous.LimPID conPI_pumRet( controllerType=Modelica.Blocks.Types.SimpleController.PI, - k=5, - Ti=50, - reverseActing=true) + k=1, + Ti=10, + reverseActing=false) if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "PI controller" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -192,7 +192,7 @@ block PumpValveControl extent={{-10,-10},{10,10}}, rotation=-90, origin={100,-110}))); - Buildings.Controls.OBC.CDL.Continuous.Switch swiPumSup1 + Buildings.Controls.OBC.CDL.Continuous.Switch swiPumRet if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "True = on (y>0); false = off (y=0)." annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -250,8 +250,6 @@ equation annotation (Line(points={{222,22},{222,210},{62,210}}, color={255,0,255})); connect(notRemCha.y, and3Out.u2) annotation (Line(points={{240,58},{240,40},{230, 40},{230,22}}, color={255,0,255})); - connect(conPI_pumRet.u_m, mTanBot_flow) annotation (Line(points={{78,10},{70,10}, - {70,50},{-150,50}}, color={0,0,127})); connect(conPI_pumRet.u_s, mTanSet_flow) annotation (Line(points={{90,22},{90,88},{-150,88}}, color={0,0,127})); @@ -283,13 +281,13 @@ equation 156},{-120,7.5},{-150,7.5}}, color={0,0,127})); connect(conPI_pumSup.y, swiPumSup.u1) annotation (Line(points={{-70,-1},{-70,-20}, {-62,-20},{-62,-158}}, color={0,0,127})); - connect(andCha.y, swiPumSup1.u2) annotation (Line(points={{190,-2},{190,-136}, + connect(andCha.y, swiPumRet.u2) annotation (Line(points={{190,-2},{190,-136}, {90,-136},{90,-158}}, color={255,0,255})); - connect(conPI_pumRet.y, swiPumSup1.u1) annotation (Line(points={{90,-1},{90,-20}, + connect(conPI_pumRet.y, swiPumRet.u1) annotation (Line(points={{90,-1},{90,-20}, {98,-20},{98,-158}}, color={0,0,127})); - connect(swiPumSup1.u3, zero.y) annotation (Line(points={{82,-158},{82,-110},{-99, + connect(swiPumRet.u3, zero.y) annotation (Line(points={{82,-158},{82,-110},{-99, -110}}, color={0,0,127})); - connect(swiPumSup1.y, yPumRet) + connect(swiPumRet.y, yPumRet) annotation (Line(points={{90,-182},{90,-210}}, color={0,0,127})); connect(booToReaValCha.u, andCha.y) annotation (Line(points={{190,-158},{190,-2}}, color={255,0,255})); @@ -320,6 +318,8 @@ equation {170,-194},{170,-212.5}}, color={0,0,127})); connect(booToReaValCha.y, yRet[2]) annotation (Line(points={{190,-182},{190, -194},{170,-194},{170,-207.5}}, color={0,0,127})); + connect(conPI_pumRet.u_m, mTanTop_flow) annotation (Line(points={{78,10},{70, + 10},{70,68},{-150,68}}, color={0,0,127})); annotation ( defaultComponentName="conPumVal", Diagram(coordinateSystem(extent={{-140,-200},{260,240}})), Icon( diff --git a/Buildings/Fluid/Storage/Plant/Validation/OpenTank.mo b/Buildings/Fluid/Storage/Plant/Validation/OpenTank.mo index 7c5a0f0885f..f0ac43bc62e 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/OpenTank.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/OpenTank.mo @@ -29,7 +29,7 @@ model OpenTank "(Draft)" Buildings.Fluid.FixedResistances.PressureDrop preDroSup( redeclare final package Medium = Medium, final allowFlowReversal=true, - final m_flow_nominal=nom.mTan_flow_nominal, + final m_flow_nominal=nom.m_flow_nominal, dp_nominal=0.3*nom.dp_nominal) "Flow resistance" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -38,7 +38,7 @@ model OpenTank "(Draft)" Buildings.Fluid.FixedResistances.PressureDrop preDroRet( redeclare final package Medium = Medium, final allowFlowReversal=true, - final m_flow_nominal=nom.mTan_flow_nominal, + final m_flow_nominal=nom.m_flow_nominal, dp_nominal=0.3*nom.dp_nominal) "Flow resistance" annotation (Placement( transformation( extent={{10,-10},{-10,10}}, @@ -46,7 +46,11 @@ model OpenTank "(Draft)" origin={60,-20}))); Buildings.Fluid.Storage.Plant.SupplyPumpValve supPum( redeclare final package Medium = Medium, - final nom=nom) "Supply pump and valves" + final nom=nom, + pumSup(per(pressure(V_flow=nom.m_flow_nominal*{0,1.6,2}, + dp=(sin.p-101325)*{2,1.6,0}))), + pumRet(per(pressure(V_flow=nom.mTan_flow_nominal*{0,1.6,2}, + dp=(sou.p-101325)*{2,1.6,0})))) "Supply pump and valves" annotation (Placement(transformation(extent={{10,-10},{30,10}}))); equation connect(conPumVal.uOnl, uOnl.y) annotation (Line(points={{32,56},{36,56},{36,90}, @@ -57,20 +61,20 @@ equation annotation (Line(points={{-10,-6},{10,-6}}, color={0,127,255})); connect(supPum.port_chiOut, tanBra.port_CHWS) annotation (Line(points={{10,6},{-10,6}}, color={0,127,255})); - connect(supPum.port_CHWS, preDroSup.port_a) annotation (Line(points={{30,6},{ - 44,6},{44,20},{50,20}}, color={0,127,255})); - connect(supPum.port_CHWR, preDroRet.port_b) annotation (Line(points={{30,-6}, - {44,-6},{44,-20},{50,-20}}, color={0,127,255})); + connect(supPum.port_CHWS, preDroSup.port_a) annotation (Line(points={{30,6},{44, + 6},{44,20},{50,20}}, color={0,127,255})); + connect(supPum.port_CHWR, preDroRet.port_b) annotation (Line(points={{30,-6},{ + 44,-6},{44,-20},{50,-20}}, color={0,127,255})); connect(tanBra.mTanTop_flow, conPumVal.mTanTop_flow) annotation (Line(points={{-16,11},{-16,50},{9,50}}, color={0,0,127})); - connect(conPumVal.mTanSet_flow, set_mTan_flow.y) annotation (Line(points={{9, - 54},{-72,54},{-72,70},{-79,70}}, color={0,0,127})); + connect(conPumVal.mTanSet_flow, set_mTan_flow.y) annotation (Line(points={{9,54}, + {-72,54},{-72,70},{-79,70}}, color={0,0,127})); connect(set_mChi_flow.y, ideChiBra.mPumSet_flow) annotation (Line(points={{-79,-30},{-56,-30},{-56,-11}}, color={0,0,127})); - connect(supPum.yRet_actual, conPumVal.yRet_actual) annotation (Line(points={{ - 10,11},{10,32},{2,32},{2,44},{9,44}}, color={0,0,127})); - connect(conPumVal.ySup_actual, supPum.ySup_actual) annotation (Line(points={{ - 9,40},{6,40},{6,36},{14,36},{14,11}}, color={0,0,127})); + connect(supPum.yRet_actual, conPumVal.yRet_actual) annotation (Line(points={{10, + 11},{10,32},{2,32},{2,44},{9,44}}, color={0,0,127})); + connect(conPumVal.ySup_actual, supPum.ySup_actual) annotation (Line(points={{9, + 40},{6,40},{6,36},{14,36},{14,11}}, color={0,0,127})); connect(supPum.yPumSup, conPumVal.yPumSup) annotation (Line(points={{18,11},{18,39}}, color={0,0,127})); connect(conPumVal.yValSup, supPum.yValSup) From 0a6e5914019d932a740e2e05b1662e1233d6b0a7 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Thu, 21 Apr 2022 08:19:19 -0700 Subject: [PATCH 094/463] adjusted controller gains --- .../Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo index de128d51789..ad311cd22d1 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo @@ -12,7 +12,7 @@ block PumpValveControl Buildings.Controls.Continuous.LimPID conPI_valCha( controllerType=Modelica.Blocks.Types.SimpleController.PI, k=5, - Ti=50, + Ti=10, reverseActing=false) "PI controller" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -110,7 +110,7 @@ block PumpValveControl origin={190,10}))); Buildings.Controls.Continuous.LimPID conPI_pumRet( controllerType=Modelica.Blocks.Types.SimpleController.PI, - k=1, + k=5, Ti=10, reverseActing=false) if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open @@ -121,7 +121,7 @@ block PumpValveControl Buildings.Controls.Continuous.LimPID conPI_valOut( controllerType=Modelica.Blocks.Types.SimpleController.PI, k=5, - Ti=50, + Ti=10, reverseActing=true) if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "PI controller" annotation (Placement(transformation( @@ -143,7 +143,7 @@ block PumpValveControl Buildings.Controls.Continuous.LimPID conPI_pumSup( controllerType=Modelica.Blocks.Types.SimpleController.PI, k=5, - Ti=50, + Ti=10, reverseActing=true) "PI controller" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, From 755f4504736e1a644cf52c23ec93f2a971c07dcc Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Thu, 21 Apr 2022 09:18:55 -0700 Subject: [PATCH 095/463] icon adjustements --- .../Fluid/Storage/Plant/SupplyPumpValve.mo | 85 +++++++++++++------ 1 file changed, 60 insertions(+), 25 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/SupplyPumpValve.mo b/Buildings/Fluid/Storage/Plant/SupplyPumpValve.mo index 0de04c0e93b..82cd6ebd9c6 100644 --- a/Buildings/Fluid/Storage/Plant/SupplyPumpValve.mo +++ b/Buildings/Fluid/Storage/Plant/SupplyPumpValve.mo @@ -236,22 +236,7 @@ equation connect(pumRet.y, yPumRet) annotation (Line(points={{-50,-48},{-50,-26},{66,-26}, {66,96},{50,96},{50,110}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, - {100,100}}), graphics={Line( - points={{-20,0},{40,0}}, - color={28,108,200}, - pattern=LinePattern.Dash, - visible=allowRemoteCharging), Polygon( - points={{-20,0},{0,6},{0,-6},{-20,0}}, - fillColor={28,108,200}, - fillPattern=FillPattern.Solid, - pattern=LinePattern.None, - visible=allowRemoteCharging), - Line(points={{-20,80},{40,80}}, color={28,108,200}), - Polygon( - points={{40,80},{20,86},{20,74},{40,80}}, - fillColor={28,108,200}, - fillPattern=FillPattern.Solid, - pattern=LinePattern.None), + {100,100}}), graphics={ Line(points={{-100,60},{100,60}}, color={28,108,200}), Line(points={{-100,-60},{100,-60}}, color={28,108,200}), Ellipse( @@ -263,33 +248,83 @@ equation points={{40,60},{24,70},{24,50},{40,60}}, lineColor={0,0,0}, fillColor={255,255,255}, - fillPattern=FillPattern.Solid), + fillPattern=FillPattern.Solid, + visible=plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote + or plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open), Polygon( points={{40,60},{56,70},{56,50},{40,60}}, lineColor={0,0,0}, fillColor={255,255,255}, - fillPattern=FillPattern.Solid), + fillPattern=FillPattern.Solid, + visible=plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote + or plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open), Line( - points={{80,60},{80,20},{-80,20},{-80,60}}, + points={{80,60},{80,32},{-80,32},{-80,60}}, color={28,108,200}, - visible=allowRemoteCharging), + visible=plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote + or plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open), Polygon( - points={{40,20},{24,30},{24,10},{40,20}}, + points={{40,32},{24,42},{24,22},{40,32}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid, - visible=allowRemoteCharging), + visible=plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote + or plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open), Polygon( - points={{40,20},{56,30},{56,10},{40,20}}, + points={{40,32},{56,42},{56,22},{40,32}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid, - visible=allowRemoteCharging), + visible=plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote + or plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open), Polygon( points={{-20,60},{-50,76},{-50,44},{-20,60}}, lineColor={0,0,0}, fillColor={255,255,255}, - fillPattern=FillPattern.None)}), Diagram( + fillPattern=FillPattern.None), + Ellipse( + extent={{-60,-40},{-20,-80}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + startAngle=0, + endAngle=360, + visible=plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open), + Polygon( + points={{40,-60},{24,-50},{24,-70},{40,-60}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + visible=plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open), + Polygon( + points={{40,-60},{56,-50},{56,-70},{40,-60}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + visible=plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open), + Line( + points={{80,-60},{80,-88},{-80,-88},{-80,-60}}, + color={28,108,200}, + visible=plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open), + Polygon( + points={{40,-88},{24,-78},{24,-98},{40,-88}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + visible=plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open), + Polygon( + points={{40,-88},{56,-78},{56,-98},{40,-88}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + visible=plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open), + Polygon( + points={{-20,-60},{-50,-44},{-50,-76},{-20,-60}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.None, + visible=plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open)}), + Diagram( coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}})), Documentation(info="

    From 23e4fc61f5e6520af37484b711a6a10044517bd1 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Thu, 21 Apr 2022 09:19:04 -0700 Subject: [PATCH 096/463] Dymola script --- .../Storage/Plant/Validation/OpenTank.mos | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/OpenTank.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/OpenTank.mos index 792dc6bca7a..99f4c888618 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/OpenTank.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/OpenTank.mos @@ -5,10 +5,20 @@ simulateModel("Buildings.Fluid.Storage.Plant.Validation.OpenTank", resultFile="OpenTank"); // Plot commands createPlot(id=1, - position={19, 23, 1004, 372}, - y={"sinChi.ports[1].m_flow", "tanBra.mTan_flow", "supPum.pum.m_flow"}, - range={0.0, 3600.0, -3.0, 3.0}, + position={10, 4, 1094, 494}, + y={"tanBra.mTanTop_flow", "tanBra.mTanBot_flow"}, + range={0.0, 3600.0, -2.0, 2.0}, grid=true, - colors={{28,108,200}, {238,46,47}, {0,140,72}}, - timeUnit="s", - displayUnits={"kg/s", "kg/s", "kg/s"}); + subPlot=101, + colors={{28,108,200}, {238,46,47}}, timeUnit="s"); +createPlot(id=1, + position={10, 4, 1094, 494}, + y={"supPum.valSupOut.y_actual", "supPum.valSupCha.y_actual", "supPum.valRetOut.y_actual", + "supPum.valRetCha.y_actual"}, + range={0.0, 3600.0, -0.5, 1.5}, + autoscale=false, + grid=true, + subPlot=102, + colors={{28,108,200}, {238,46,47}, {0,140,72}, {217,67,180}}, + timeUnit="s"); + From 50a5a04cf30f8a15aa94b7ca80912810f41862e8 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Thu, 21 Apr 2022 10:42:06 -0700 Subject: [PATCH 097/463] simplified the inheritance of validation models --- .../Plant/BaseClasses/PumpValveControl.mo | 105 +++-- .../Plant/Examples/OneSourceOneUser.mo | 5 +- .../Fluid/Storage/Plant/SupplyPumpOpenTank.mo | 370 ------------------ .../BaseClasses/PartialClosedTank.mo | 39 -- .../Validation/BaseClasses/PartialPlant.mo | 20 +- .../BaseClasses/RemoteChargingSchedule.mo | 30 ++ .../Validation/BaseClasses/package.order | 2 +- .../Validation/ClosedTankNoRemoteCharging.mo | 4 +- .../ClosedTankWithRemoteCharging.mo | 40 +- .../Storage/Plant/Validation/OpenTank.mo | 94 +---- Buildings/Fluid/Storage/Plant/package.order | 1 - .../Plant/Examples/OneSourceOneUser.mos | 2 +- .../Plant/Examples/TwoSourcesThreeUsers.mos | 2 +- .../Storage/Plant/Validation/OpenTank.mos | 18 +- 14 files changed, 149 insertions(+), 583 deletions(-) delete mode 100644 Buildings/Fluid/Storage/Plant/SupplyPumpOpenTank.mo delete mode 100644 Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialClosedTank.mo create mode 100644 Buildings/Fluid/Storage/Plant/Validation/BaseClasses/RemoteChargingSchedule.mo diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo index ad311cd22d1..4f969b09a8a 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo @@ -8,7 +8,7 @@ block PumpValveControl "Type of plant setup"; Modelica.Blocks.Sources.Constant zero(k=0) "Constant 0" - annotation (Placement(transformation(extent={{-120,-120},{-100,-100}}))); + annotation (Placement(transformation(extent={{-120,-60},{-100,-40}}))); Buildings.Controls.Continuous.LimPID conPI_valCha( controllerType=Modelica.Blocks.Types.SimpleController.PI, k=5, @@ -55,7 +55,7 @@ block PumpValveControl "Speed input of the supply pump" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={-70,-210}), iconTransformation( + origin={-70,-150}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={-20,-110}))); @@ -75,19 +75,19 @@ block PumpValveControl "True = on (y>0); false = off (y=0)." annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={-70,-170}))); + origin={-70,-110}))); Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToReaValOut "True = 1, false = 0" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={-10,-170}))); + origin={-10,-110}))); Buildings.Controls.OBC.CDL.Continuous.Switch swiValCha "True = on (y>0); false = off (y=0)." annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={30,-170}))); + origin={30,-110}))); Buildings.Controls.OBC.CDL.Logical.And3 and3Out "Outputting = plant online AND no remote charging command AND charging valve(s) closed" annotation (Placement(transformation( @@ -127,7 +127,7 @@ block PumpValveControl "PI controller" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={130,10}))); + origin={150,10}))); Modelica.Blocks.Interfaces.RealInput mTanTop_flow if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open @@ -154,7 +154,7 @@ block PumpValveControl transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={10,-210}), iconTransformation( + origin={10,-150}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={20,-110}))); @@ -188,7 +188,7 @@ block PumpValveControl transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={170,-210}), iconTransformation( + origin={170,-150}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={100,-110}))); @@ -197,14 +197,14 @@ block PumpValveControl "True = on (y>0); false = off (y=0)." annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={90,-170}))); + origin={90,-110}))); Modelica.Blocks.Interfaces.RealOutput yPumRet if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "Speed input of the auxilliary pump on the return line" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={90,-210}), iconTransformation( + origin={90,-150}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={60,-110}))); @@ -213,13 +213,13 @@ block PumpValveControl "True = on (y>0); false = off (y=0)." annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={150,-170}))); + origin={150,-110}))); Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToReaValCha if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "True = 1, false = 0" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, - origin={190,-170}))); + origin={190,-110}))); initial equation assert(plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open @@ -232,15 +232,15 @@ equation connect(conPI_valCha.u_m, mTanBot_flow) annotation (Line(points={{18,10},{10,10}, {10,50},{-150,50}}, color={0,0,127})); connect(swiPumSup.y, yPumSup) - annotation (Line(points={{-70,-182},{-70,-210}}, color={0,0,127})); - connect(zero.y, swiPumSup.u3) annotation (Line(points={{-99,-110},{-78,-110},{ - -78,-158}}, color={0,0,127})); - connect(zero.y, swiValCha.u3) annotation (Line(points={{-99,-110},{22,-110},{22, - -158}}, color={0,0,127})); + annotation (Line(points={{-70,-122},{-70,-150}}, color={0,0,127})); + connect(zero.y, swiPumSup.u3) annotation (Line(points={{-99,-50},{-78,-50},{-78, + -98}}, color={0,0,127})); + connect(zero.y, swiValCha.u3) annotation (Line(points={{-99,-50},{22,-50},{22, + -98}}, color={0,0,127})); connect(isValOutClo.y, andCha.u2) annotation (Line(points={{62,130},{182,130},{182,22}}, color={255,0,255})); connect(conPI_valCha.y, swiValCha.u1) annotation (Line(points={{30,-1},{30,-20}, - {38,-20},{38,-158}},color={0,0,127})); + {38,-20},{38,-98}}, color={0,0,127})); connect(uRemCha, notRemCha.u) annotation (Line(points={{270,108},{240,108},{240,82}}, color={255,0,255})); @@ -256,14 +256,14 @@ equation connect(and3Out.u1, uOnl) annotation (Line(points={{238,22},{238,28},{270,28}}, color={255,0,255})); connect(mTanSet_flow, conPI_valOut.u_s) - annotation (Line(points={{-150,88},{130,88},{130,22}}, color={0,0,127})); + annotation (Line(points={{-150,88},{150,88},{150,22}}, color={0,0,127})); connect(conPI_pumSup.u_s, mTanSet_flow) annotation (Line(points={{-70,22},{-70,88},{-150,88}}, color={0,0,127})); connect(conPI_pumSup.u_m, mTanBot_flow) annotation (Line(points={{-82,10},{-90, 10},{-90,50},{-150,50}}, color={0,0,127})); - connect(mTanTop_flow, conPI_valOut.u_m) annotation (Line(points={{-150,68},{110, - 68},{110,10},{118,10}}, color={0,0,127})); + connect(mTanTop_flow, conPI_valOut.u_m) annotation (Line(points={{-150,68},{130, + 68},{130,10},{138,10}}, color={0,0,127})); connect(pasCha.y, isValChaClo.u) annotation (Line(points={{-39,190},{32,190},{ 32,210},{38,210}}, color={0,0,127})); connect(maxCha.y, isValChaClo.u) annotation (Line(points={{-38,230},{32,230},{ @@ -272,36 +272,35 @@ equation 32,130},{38,130}}, color={0,0,127})); connect(maxOut.y, isValOutClo.u) annotation (Line(points={{-38,150},{32,150}, {32,130},{38,130}}, color={0,0,127})); - connect(and3Out.y, swiPumSup.u2) annotation (Line(points={{230,-2},{230,-120}, - {-70,-120},{-70,-158}}, color={255,0,255})); + connect(and3Out.y, swiPumSup.u2) annotation (Line(points={{230,-2},{230,-60},{ + -70,-60},{-70,-98}}, color={255,0,255})); connect(yRet_actual[2], maxCha.u1) annotation (Line(points={{-150,12.5},{-150, 12},{-120,12},{-120,236},{-62,236}}, color={0,0,127})); connect(maxOut.u1, yRet_actual[1]) annotation (Line(points={{-62,156},{-120, 156},{-120,7.5},{-150,7.5}}, color={0,0,127})); connect(conPI_pumSup.y, swiPumSup.u1) annotation (Line(points={{-70,-1},{-70,-20}, - {-62,-20},{-62,-158}}, color={0,0,127})); - connect(andCha.y, swiPumRet.u2) annotation (Line(points={{190,-2},{190,-136}, - {90,-136},{90,-158}}, color={255,0,255})); + {-62,-20},{-62,-98}}, color={0,0,127})); + connect(andCha.y, swiPumRet.u2) annotation (Line(points={{190,-2},{190,-76},{90, + -76},{90,-98}}, color={255,0,255})); connect(conPI_pumRet.y, swiPumRet.u1) annotation (Line(points={{90,-1},{90,-20}, - {98,-20},{98,-158}}, color={0,0,127})); - connect(swiPumRet.u3, zero.y) annotation (Line(points={{82,-158},{82,-110},{-99, - -110}}, color={0,0,127})); + {98,-20},{98,-98}}, color={0,0,127})); + connect(swiPumRet.u3, zero.y) + annotation (Line(points={{82,-98},{82,-50},{-99,-50}}, color={0,0,127})); connect(swiPumRet.y, yPumRet) - annotation (Line(points={{90,-182},{90,-210}}, color={0,0,127})); + annotation (Line(points={{90,-122},{90,-150}}, color={0,0,127})); connect(booToReaValCha.u, andCha.y) - annotation (Line(points={{190,-158},{190,-2}}, color={255,0,255})); - connect(swiValOut.u2, and3Out.y) annotation (Line(points={{150,-158},{150, - -120},{230,-120},{230,-2}}, - color={255,0,255})); - connect(conPI_valOut.y, swiValOut.u1) annotation (Line(points={{130,-1},{130,-20}, - {158,-20},{158,-158}}, color={0,0,127})); - connect(swiValOut.u3, zero.y) annotation (Line(points={{142,-158},{142,-110},{ - -99,-110}}, color={0,0,127})); - connect(booToReaValOut.u, and3Out.y) annotation (Line(points={{-10,-158},{-8, - -158},{-8,-120},{230,-120},{230,-2}}, color={255,0,255})); - connect(swiValCha.u2, andCha.y) annotation (Line(points={{30,-158},{30,-136}, - {190,-136},{190,-2}}, color={255,0,255})); + annotation (Line(points={{190,-98},{190,-2}}, color={255,0,255})); + connect(swiValOut.u2, and3Out.y) annotation (Line(points={{150,-98},{150,-60}, + {230,-60},{230,-2}}, color={255,0,255})); + connect(conPI_valOut.y, swiValOut.u1) annotation (Line(points={{150,-1},{150,-20}, + {158,-20},{158,-98}}, color={0,0,127})); + connect(swiValOut.u3, zero.y) annotation (Line(points={{142,-98},{142,-50},{-99, + -50}}, color={0,0,127})); + connect(booToReaValOut.u, and3Out.y) annotation (Line(points={{-10,-98},{-10,-60}, + {230,-60},{230,-2}}, color={255,0,255})); + connect(swiValCha.u2, andCha.y) annotation (Line(points={{30,-98},{30,-76},{190, + -76},{190,-2}}, color={255,0,255})); connect(maxCha.u2, ySup_actual[2]) annotation (Line(points={{-62,224},{-100, 224},{-100,-7.5},{-150,-7.5}}, color={0,0,127})); connect(pasCha.u, ySup_actual[2]) annotation (Line(points={{-62,190},{-100, @@ -310,19 +309,19 @@ equation 144},{-100,-12.5},{-150,-12.5}}, color={0,0,127})); connect(pasOut.u, ySup_actual[1]) annotation (Line(points={{-62,110},{-100, 110},{-100,-12.5},{-150,-12.5}}, color={0,0,127})); - connect(booToReaValOut.y, yValSup[1]) annotation (Line(points={{-10,-182},{ - -10,-194},{10,-194},{10,-212.5}}, color={0,0,127})); - connect(swiValCha.y, yValSup[2]) annotation (Line(points={{30,-182},{30,-194}, - {10,-194},{10,-207.5}}, color={0,0,127})); - connect(swiValOut.y, yRet[1]) annotation (Line(points={{150,-182},{150,-194}, - {170,-194},{170,-212.5}}, color={0,0,127})); - connect(booToReaValCha.y, yRet[2]) annotation (Line(points={{190,-182},{190, - -194},{170,-194},{170,-207.5}}, color={0,0,127})); - connect(conPI_pumRet.u_m, mTanTop_flow) annotation (Line(points={{78,10},{70, - 10},{70,68},{-150,68}}, color={0,0,127})); + connect(booToReaValOut.y, yValSup[1]) annotation (Line(points={{-10,-122},{-10, + -134},{10,-134},{10,-152.5}}, color={0,0,127})); + connect(swiValCha.y, yValSup[2]) annotation (Line(points={{30,-122},{30,-134}, + {10,-134},{10,-147.5}}, color={0,0,127})); + connect(swiValOut.y, yRet[1]) annotation (Line(points={{150,-122},{150,-134},{ + 170,-134},{170,-152.5}}, color={0,0,127})); + connect(booToReaValCha.y, yRet[2]) annotation (Line(points={{190,-122},{190,-134}, + {170,-134},{170,-147.5}}, color={0,0,127})); + connect(conPI_pumRet.u_m, mTanTop_flow) annotation (Line(points={{78,10},{70,10}, + {70,68},{-150,68}}, color={0,0,127})); annotation ( defaultComponentName="conPumVal", - Diagram(coordinateSystem(extent={{-140,-200},{260,240}})), Icon( + Diagram(coordinateSystem(extent={{-140,-140},{260,240}})), Icon( coordinateSystem(extent={{-100,-100},{100,100}})), Documentation(revisions="

      diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo index 4876fc1bd81..4dae0d4a6e1 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo @@ -131,8 +131,9 @@ equation -6},{0,-40},{10,-40}}, color={0,127,255})); connect(supPum.port_CHWS, preDro1.port_a) annotation (Line(points={{-10,6},{4, 6},{4,-20},{10,-20}}, color={0,127,255})); - connect(conPI_pumSec.y, supPum.yPumSup) annotation (Line(points={{-10,39},{-10, - 16},{-20,16},{-20,11}}, color={0,0,127})); + connect(conPI_pumSec.y, supPum.yPumSup) annotation (Line(points={{-10,39},{ + -10,16},{-22,16},{-22,11}}, + color={0,0,127})); connect(sou_p.ports[1], tanBra.port_CHWR) annotation (Line(points={{-60,-70},{ -34,-70},{-34,-6},{-40,-6}}, color={0,127,255})); annotation(__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos" diff --git a/Buildings/Fluid/Storage/Plant/SupplyPumpOpenTank.mo b/Buildings/Fluid/Storage/Plant/SupplyPumpOpenTank.mo deleted file mode 100644 index 9151f230dd2..00000000000 --- a/Buildings/Fluid/Storage/Plant/SupplyPumpOpenTank.mo +++ /dev/null @@ -1,370 +0,0 @@ -within Buildings.Fluid.Storage.Plant; -model SupplyPumpOpenTank - "(Draft) Model section with supply pump and valves for an open tank" - - extends Buildings.Fluid.Storage.Plant.BaseClasses.PartialBranchPorts; - - Buildings.Fluid.Movers.SpeedControlled_y pum( - redeclare package Medium = Medium, - per(pressure(dp=nom.dp_nominal*{1.8,1,0}, V_flow=(nom.m_flow_nominal)/1.2*{0, - 1,1.8})), - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - allowFlowReversal=true, - addPowerToMedium=false, - y_start=0, - T_start=nom.T_CHWR_nominal) "Secondary CHW pump" annotation (Placement( - transformation( - extent={{-30,-10},{-10,10}}, - rotation=0))); - Buildings.Fluid.Actuators.Valves.TwoWayLinear valDis1( - redeclare package Medium = Medium, - dpValve_nominal=0.1*nom.dp_nominal, - use_inputFilter=true, - y_start=0, - l=1E-5, - m_flow_nominal=nom.m_flow_nominal) - "Discharging valve, open when the tank NOT being charged remotely" - annotation (Placement(transformation(extent={{10,-70},{-10,-50}}))); - Buildings.Fluid.Actuators.Valves.TwoWayLinear valCha1( - redeclare package Medium = Medium, - dpValve_nominal=0.1*nom.dp_nominal, - use_inputFilter=true, - y_start=0, - l=1E-5, - m_flow_nominal=nom.m_flow_nominal) - "Charging valve, open when the tank is being charged remotely" - annotation (Placement(transformation(extent={{10,50},{-10,70}}))); - Buildings.Fluid.Actuators.Valves.TwoWayLinear valDis2( - redeclare package Medium = Medium, - dpValve_nominal=0.1*nom.dp_nominal, - use_inputFilter=true, - y_start=0, - l=1E-5, - m_flow_nominal=nom.m_flow_nominal) - "Discharging valve, open when the tank NOT being charged remotely" - annotation (Placement(transformation( - extent={{-10,10},{10,-10}}, - rotation=-90, - origin={-40,20}))); - Buildings.Fluid.Actuators.Valves.TwoWayLinear valDis3( - redeclare package Medium = Medium, - dpValve_nominal=0.1*nom.dp_nominal, - use_inputFilter=true, - y_start=0, - l=1E-5, - m_flow_nominal=nom.m_flow_nominal) - "Discharging valve, open when the tank NOT being charged remotely" - annotation (Placement(transformation( - extent={{-10,10},{10,-10}}, - rotation=90, - origin={40,20}))); - Buildings.Fluid.Actuators.Valves.TwoWayLinear valCha2( - redeclare package Medium = Medium, - dpValve_nominal=0.1*nom.dp_nominal, - use_inputFilter=true, - y_start=0, - l=1E-5, - m_flow_nominal=nom.m_flow_nominal) - "Charging valve, open when the tank is being charged remotely" annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=90, - origin={-40,-20}))); - Buildings.Fluid.Actuators.Valves.TwoWayLinear valCha3( - redeclare package Medium = Medium, - dpValve_nominal=0.1*nom.dp_nominal, - use_inputFilter=true, - y_start=0, - l=1E-5, - m_flow_nominal=nom.m_flow_nominal) - "Charging valve, open when the tank is being charged remotely" annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={40,-20}))); - Buildings.Fluid.FixedResistances.CheckValve cheVal( - redeclare package Medium = Medium, - m_flow_nominal=nom.m_flow_nominal, - dpValve_nominal=0.1*nom.dp_nominal, - dpFixed_nominal=0.1*nom.dp_nominal) "Check valve" annotation (Placement( - transformation( - extent={{10,-10},{-10,10}}, - rotation=180, - origin={20,0}))); - Modelica.Blocks.Interfaces.RealOutput yValDis_actual "Actual valve position" - annotation (Placement( - transformation( - extent={{10,-10},{-10,10}}, - rotation=270, - origin={-80,150}), iconTransformation( - extent={{10,-10},{-10,10}}, - rotation=270, - origin={-100,110}))); - Modelica.Blocks.Interfaces.RealOutput yValCha_actual "Actual valve position" - annotation (Placement( - transformation( - extent={{10,-10},{-10,10}}, - rotation=270, - origin={-50,150}), iconTransformation( - extent={{10,-10},{-10,10}}, - rotation=270, - origin={-60,110}))); - Modelica.Blocks.Interfaces.RealInput yPum "Secondary pump speed input" - annotation (Placement(transformation( - extent={{10,10},{-10,-10}}, - rotation=90, - origin={-20,150}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={-20,110}))); - Modelica.Blocks.Interfaces.RealInput yValChaOn - "Valve position input, on-off signal" annotation (Placement(transformation( - extent={{10,10},{-10,-10}}, - rotation=90, - origin={40,150}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={40,110}))); - Modelica.Blocks.Interfaces.RealInput yValDisOn - "Valve position input, on-off signal" annotation (Placement(transformation( - extent={{10,10},{-10,-10}}, - rotation=90, - origin={100,150}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={100,110}))); - Buildings.Controls.OBC.CDL.Continuous.MultiMax mulMaxDis(nin=3) - "Maximum valve position of discharging valves" annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=90, - origin={-80,110}))); - Buildings.Controls.OBC.CDL.Continuous.MultiMax mulMaxCha(nin=3) - "Maximum valve position of charging valves" annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=90, - origin={-50,110}))); - Modelica.Blocks.Interfaces.RealInput yValChaMod - "Valve position input, modulating signal" annotation (Placement( - transformation( - extent={{10,10},{-10,-10}}, - rotation=90, - origin={20,150}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={20,110}))); - Modelica.Blocks.Interfaces.RealInput yValDisMod - "Valve position input, modulating signal" annotation (Placement( - transformation( - extent={{10,10},{-10,-10}}, - rotation=90, - origin={80,150}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={80,110}))); - Modelica.Blocks.Interfaces.RealOutput pCHWS - "Absolute pressure at the supply line" annotation (Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=180, - origin={110,30}), iconTransformation( - extent={{10,-10},{-10,10}}, - rotation=180, - origin={110,30}))); - Modelica.Blocks.Interfaces.RealOutput pCHWR - "Absolute pressure at the return line" annotation (Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=180, - origin={110,-30}), iconTransformation( - extent={{10,-10},{-10,10}}, - rotation=180, - origin={110,-30}))); - Buildings.Fluid.Sensors.Pressure senPreCHWR( - redeclare final package Medium = Medium) - "Pressure sensor" - annotation (Placement(transformation(extent={{70,-40},{90,-20}}))); - Buildings.Fluid.Sensors.Pressure senPreCHWS( - redeclare final package Medium = Medium) - "Pressure sensor" - annotation (Placement(transformation(extent={{70,40},{90,20}}))); -equation - connect(port_chiOut, valCha1.port_b) - annotation (Line(points={{-100,60},{-10,60}}, color={0,127,255})); - connect(valCha1.port_a, port_CHWS) - annotation (Line(points={{10,60},{100,60}}, color={0,127,255})); - connect(port_CHWR, valDis1.port_a) - annotation (Line(points={{100,-60},{10,-60}}, color={0,127,255})); - connect(valDis1.port_b, port_chiInl) - annotation (Line(points={{-10,-60},{-100,-60}}, color={0,127,255})); - connect(port_chiInl, valCha2.port_a) annotation (Line(points={{-100,-60},{-40, - -60},{-40,-30}}, color={0,127,255})); - connect(valCha2.port_b, pum.port_a) - annotation (Line(points={{-40,-10},{-40,0},{-30,0}}, color={0,127,255})); - connect(valCha3.port_b, port_CHWR) - annotation (Line(points={{40,-30},{40,-60},{100,-60}}, color={0,127,255})); - connect(port_CHWS, valDis3.port_b) - annotation (Line(points={{100,60},{40,60},{40,30}}, color={0,127,255})); - connect(pum.port_a, valDis2.port_b) - annotation (Line(points={{-30,0},{-40,0},{-40,10}}, color={0,127,255})); - connect(valDis2.port_a, port_chiOut) - annotation (Line(points={{-40,30},{-40,60},{-100,60}}, color={0,127,255})); - connect(pum.port_b, cheVal.port_a) annotation (Line(points={{-10,0},{0,0},{0,1.72085e-15}, - {10,1.72085e-15}}, color={0,127,255})); - connect(cheVal.port_b, valDis3.port_a) annotation (Line(points={{30,-7.21645e-16}, - {40,-7.21645e-16},{40,10}}, color={0,127,255})); - connect(cheVal.port_b, valCha3.port_a) annotation (Line(points={{30,-7.21645e-16}, - {40,-7.21645e-16},{40,-10}}, color={0,127,255})); - connect(pum.y, yPum) annotation (Line(points={{-20,12},{-20,150}}, - color={0,0,127})); - connect(valCha3.y, yValChaOn) annotation (Line(points={{52,-20},{60,-20},{60,100}, - {40,100},{40,150}}, color={0,0,127})); - connect(valCha2.y, yValChaOn) annotation (Line(points={{-52,-20},{-52,-36},{60, - -36},{60,100},{40,100},{40,150}}, color={0,0,127})); - connect(valDis2.y, yValDisOn) annotation (Line(points={{-52,20},{-52,86},{76,86}, - {76,112},{100,112},{100,150}}, color={0,0,127})); - connect(valDis3.y, yValDisOn) annotation (Line(points={{52,20},{52,86},{76,86}, - {76,112},{100,112},{100,150}}, color={0,0,127})); - connect(valDis1.y_actual, mulMaxDis.u[1]) annotation (Line(points={{-5,-53},{ - -5,-52},{-79.3333,-52},{-79.3333,98}}, - color={0,0,127})); - connect(valDis3.y_actual, mulMaxDis.u[2]) annotation (Line(points={{47,25},{48, - 25},{48,40},{-80,40},{-80,98}}, color={0,0,127})); - connect(valDis2.y_actual, mulMaxDis.u[3]) annotation (Line(points={{-47,15},{ - -48,15},{-48,12},{-80,12},{-80,98},{-80.6667,98}}, - color={0,0,127})); - connect(mulMaxDis.y, yValDis_actual) - annotation (Line(points={{-80,122},{-80,150}}, color={0,0,127})); - connect(valCha2.y_actual, mulMaxCha.u[1]) annotation (Line(points={{-47,-15}, - {-60,-15},{-60,90},{-49.3333,90},{-49.3333,98}},color={0,0,127})); - connect(valCha3.y_actual, mulMaxCha.u[2]) annotation (Line(points={{47,-25},{46, - -25},{46,-40},{-60,-40},{-60,90},{-50,90},{-50,98}}, color={0, - 0,127})); - connect(mulMaxCha.y, yValCha_actual) - annotation (Line(points={{-50,122},{-50,150}}, color={0,0,127})); - connect(valCha1.y_actual, mulMaxCha.u[3]) annotation (Line(points={{-5,67},{ - -6,67},{-6,68},{-60,68},{-60,90},{-50.6667,90},{-50.6667,98}}, - color={0,0, - 127})); - connect(valCha1.y, yValChaMod) annotation (Line(points={{0,72},{0,134},{20,134}, - {20,150}}, color={0,0,127})); - connect(valDis1.y, yValDisMod) annotation (Line(points={{0,-48},{68,-48},{68,120}, - {80,120},{80,150}}, color={0,0,127})); - connect(senPreCHWR.port, port_CHWR) - annotation (Line(points={{80,-40},{80,-60},{100,-60}}, color={0,127,255})); - connect(senPreCHWR.p, pCHWR) - annotation (Line(points={{91,-30},{110,-30}}, color={0,0,127})); - connect(senPreCHWS.p, pCHWS) - annotation (Line(points={{91,30},{110,30}}, color={0,0,127})); - connect(senPreCHWS.port, port_CHWS) - annotation (Line(points={{80,40},{80,60},{100,60}}, color={0,127,255})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, - {100,100}}), graphics={ - Line(points={{-100,-60},{100,-60}}, color={28,108,200}), - Line(points={{-100,60},{100,60}}, color={28,108,200}), - Line(points={{-60,60},{-60,-60}}, color={28,108,200}), - Line(points={{60,60},{60,-60}}, color={28,108,200}), - Line(points={{-60,0},{60,0}}, color={28,108,200}), - Ellipse( - extent={{-20,20},{20,-20}}, - lineColor={0,0,0}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Polygon( - points={{20,0},{-10,16},{-10,-16},{20,0}}, - lineColor={0,0,0}, - fillColor={255,255,255}, - fillPattern=FillPattern.None), - Polygon( - points={{10,0},{-6,10},{-6,-10},{10,0}}, - lineColor={0,0,0}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid, - origin={60,-40}, - rotation=90), - Polygon( - points={{-10,0},{6,10},{6,-10},{-10,0}}, - lineColor={0,0,0}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid, - origin={60,-20}, - rotation=90), - Polygon( - points={{0,60},{-16,70},{-16,50},{0,60}}, - lineColor={0,0,0}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Polygon( - points={{0,60},{16,70},{16,50},{0,60}}, - lineColor={0,0,0}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Polygon( - points={{0,-60},{-16,-50},{-16,-70},{0,-60}}, - lineColor={0,0,0}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Polygon( - points={{0,-60},{16,-50},{16,-70},{0,-60}}, - lineColor={0,0,0}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Polygon( - points={{10,0},{-6,10},{-6,-10},{10,0}}, - lineColor={0,0,0}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid, - origin={-60,20}, - rotation=90), - Polygon( - points={{-10,0},{6,10},{6,-10},{-10,0}}, - lineColor={0,0,0}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid, - origin={-60,40}, - rotation=90), - Polygon( - points={{10,0},{-6,10},{-6,-10},{10,0}}, - lineColor={0,0,0}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid, - origin={-60,-40}, - rotation=90), - Polygon( - points={{-10,0},{6,10},{6,-10},{-10,0}}, - lineColor={0,0,0}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid, - origin={-60,-20}, - rotation=90), - Polygon( - points={{10,0},{-10,10},{-10,-10},{10,0}}, - lineColor={0,0,0}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid, - origin={60,20}, - rotation=90), - Polygon( - points={{-10,0},{10,10},{10,-10},{-10,0}}, - lineColor={0,0,0}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid, - origin={60,40}, - rotation=90), - Line(points={{0,60},{0,80},{26,80},{26,60}}, color={0,0,0}), - Line(points={{0,-60},{0,-80},{26,-80},{26,-60}}, color={0,0,0})}), - Diagram( - coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,140}})), - Documentation(info=" -

      -Documentation pending. -

      -", revisions=" -
        -
      • -February 18, 2022 by Hongxiang Fu:
        -First implementation. This is for -#2859. -
      • -
      -")); -end SupplyPumpOpenTank; diff --git a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialClosedTank.mo b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialClosedTank.mo deleted file mode 100644 index 1b11b7970b0..00000000000 --- a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialClosedTank.mo +++ /dev/null @@ -1,39 +0,0 @@ -within Buildings.Fluid.Storage.Plant.Validation.BaseClasses; -partial model PartialClosedTank "(Draft)" - - extends Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialPlant( - sin(nPorts=1), - sou(nPorts=1)); - - Buildings.Fluid.Storage.Plant.SupplyPumpValve supPum( - redeclare final package Medium = Medium, - final nom=nom) "Supply pump and valves" - annotation (Placement(transformation(extent={{10,-10},{30,10}}))); - -equation - - connect(tanBra.port_CHWS, supPum.port_chiOut) - annotation (Line(points={{-10,6},{10,6}}, color={0,127,255})); - connect(tanBra.port_CHWR, supPum.port_chiInl) - annotation (Line(points={{-10,-6},{10,-6}}, color={0,127,255})); - connect(supPum.port_CHWS, sin.ports[1]) annotation (Line(points={{30,6},{74,6}, - {74,20},{80,20}}, color={0,127,255})); - connect(supPum.port_CHWR, sou.ports[1]) annotation (Line(points={{30,-6},{74, - -6},{74,-20},{80,-20}}, color={0,127,255})); - annotation ( - Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), - Icon(coordinateSystem(extent={{-100,-100},{100,100}})), - Documentation(info=" -

      -Documentation pending. -

      -", revisions=" -
        -
      • -March 15, 2022 by Hongxiang Fu:
        -First implementation. This is for -#2859. -
      • -
      -")); -end PartialClosedTank; diff --git a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo index aeed81637f1..c8a178874fe 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/PartialPlant.mo @@ -23,10 +23,15 @@ partial model PartialPlant "(Draft)" redeclare final package Medium = Medium, final nom=nom) "Tank branch" annotation (Placement(transformation(extent={{-30,-10},{-10,10}}))); + Buildings.Fluid.Storage.Plant.SupplyPumpValve supPum( + redeclare final package Medium = Medium, + final nom=nom) "Supply pump and valves" + annotation (Placement(transformation(extent={{10,-10},{30,10}}))); Buildings.Fluid.Sources.Boundary_pT sou( redeclare final package Medium = Medium, final p=300000, - final T=nom.T_CHWR_nominal) + final T=nom.T_CHWR_nominal, + nPorts=1) "Source representing CHW return line" annotation (Placement(transformation( extent={{10,-10},{-10,10}}, @@ -35,18 +40,27 @@ partial model PartialPlant "(Draft)" Buildings.Fluid.Sources.Boundary_pT sin( redeclare final package Medium = Medium, final p=300000+nom.dp_nominal, - final T=nom.T_CHWS_nominal) - "Sink representing CHW supply line" + final T=nom.T_CHWS_nominal, + nPorts=1) "Sink representing CHW supply line" annotation (Placement(transformation( extent={{10,-10},{-10,10}}, rotation=0, origin={90,20}))); equation + + connect(tanBra.port_CHWS, supPum.port_chiOut) + annotation (Line(points={{-10,6},{10,6}}, color={0,127,255})); + connect(tanBra.port_CHWR, supPum.port_chiInl) + annotation (Line(points={{-10,-6},{10,-6}}, color={0,127,255})); connect(ideChiBra.port_b, tanBra.port_chiOut) annotation (Line(points={{-50,6},{-30,6}}, color={0,127,255})); connect(ideChiBra.port_a, tanBra.port_chiInl) annotation (Line(points={{-50,-6},{-30,-6}}, color={0,127,255})); + connect(supPum.port_CHWS, sin.ports[1]) annotation (Line(points={{30,6},{74,6}, + {74,20},{80,20}}, color={0,127,255})); + connect(supPum.port_CHWR, sou.ports[1]) annotation (Line(points={{30,-6},{74, + -6},{74,-20},{80,-20}}, color={0,127,255})); annotation ( Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), Icon(coordinateSystem(extent={{-100,-100},{100,100}})), diff --git a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/RemoteChargingSchedule.mo b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/RemoteChargingSchedule.mo new file mode 100644 index 00000000000..9c1bd891e83 --- /dev/null +++ b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/RemoteChargingSchedule.mo @@ -0,0 +1,30 @@ +within Buildings.Fluid.Storage.Plant.Validation.BaseClasses; +partial model RemoteChargingSchedule + "Schedules for validation models with remote charging" + Modelica.Blocks.Sources.BooleanTable uOnl(table={3600/7*2}) + "True = plant online (outputting CHW to the network); False = offline" + annotation (Placement(transformation(extent={{-100,80},{-80,100}}))); + Modelica.Blocks.Sources.BooleanTable uRemCha(table={0,3600/7*6}, startValue=true) + "Tank is being charged remotely" + annotation (Placement(transformation(extent={{-60,60},{-40,80}}))); + Modelica.Blocks.Sources.TimeTable set_mTan_flow(table=[0,0; 3600/7,0; 3600/7,-1; + 3600/7*3,-1; 3600/7*3,0; 3600/7*4,0; 3600/7*4,1; 3600/7*6,1; 3600/7*6,-1]) + "Tank flow rate setpoint" + annotation (Placement(transformation(extent={{-100,40},{-80,60}}))); + Modelica.Blocks.Sources.TimeTable set_mChi_flow(table=[0,0; 3600/7,0; 3600/7, + 1; 3600/7*2,1; 3600/7*2,2; 3600/7*3,2; 3600/7*3,1; 3600/7*5,1; 3600/7*5, + 0]) "Chiller flow rate setpoint" + annotation (Placement(transformation(extent={{-100,-40},{-80,-20}}))); + Buildings.Fluid.Storage.Plant.BaseClasses.PumpValveControl conPumVal + "Control block for the secondary pump and near-by valves" + annotation (Placement(transformation(extent={{10,40},{30,60}}))); +equation + connect(uRemCha.y, conPumVal.uRemCha) annotation (Line(points={{-39,70},{34,70}, + {34,60},{32,60}}, color={255,0,255})); + connect(uOnl.y, conPumVal.uOnl) annotation (Line(points={{-79,90},{38,90},{38, + 56},{32,56}}, color={255,0,255})); + connect(conPumVal.mTanSet_flow, set_mTan_flow.y) annotation (Line(points={{9,54}, + {-60,54},{-60,50},{-79,50}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end RemoteChargingSchedule; diff --git a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/package.order b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/package.order index 38510293295..79cf4d0c037 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/package.order +++ b/Buildings/Fluid/Storage/Plant/Validation/BaseClasses/package.order @@ -1,3 +1,3 @@ IdealChillerBranch -PartialClosedTank PartialPlant +RemoteChargingSchedule diff --git a/Buildings/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mo index ac508ac957c..8226a923e14 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mo @@ -3,8 +3,8 @@ model ClosedTankNoRemoteCharging "(Draft) Validation model of the plant not allowing remote charging" extends Modelica.Icons.Example; extends - Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialClosedTank(nom( - final plaTyp= + Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialPlant( + nom(final plaTyp= Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedLocal)); Modelica.Blocks.Sources.TimeTable set_mPumSec_flow(table=[0,1; 900,1; 900,-1; diff --git a/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo index 1e3d912b076..445ad32aba6 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo @@ -3,44 +3,24 @@ model ClosedTankWithRemoteCharging "(Draft) Validation model of the plant allowing remote charging" extends Modelica.Icons.Example; extends - Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialClosedTank( + Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialPlant( nom(final plaTyp= Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.ClosedRemote)); + extends + Buildings.Fluid.Storage.Plant.Validation.BaseClasses.RemoteChargingSchedule( + conPumVal(final plaTyp=nom.plaTyp)); - Modelica.Blocks.Sources.TimeTable set_mTan_flow(table=[0,0; 3600/7,0; 3600/7, - -1; 3600/7*3,-1; 3600/7*3,0; 3600/7*4,0; 3600/7*4,1; 3600/7*6,1; 3600/7 - *6,-1]) - "Tank flow rate setpoint" - annotation (Placement(transformation(extent={{-100,60},{-80,80}}))); - Modelica.Blocks.Sources.BooleanTable uRemCha(table={0,3600/7*6}, startValue= - true) "Tank is being charged remotely" - annotation (Placement(transformation(extent={{80,80},{60,100}}))); - Modelica.Blocks.Sources.BooleanTable uOnl(table={3600/7*2}) - "True = plant online (outputting CHW to the network); False = offline" - annotation (Placement(transformation(extent={{82,40},{62,60}}))); - Modelica.Blocks.Sources.TimeTable set_mChi_flow(table=[0,0; 3600/7,0; 3600/7, - 1; 3600/7*5,1; 3600/7*5,0]) "Chiller flow rate setpoint" - annotation (Placement(transformation(extent={{-100,-40},{-80,-20}}))); - Buildings.Fluid.Storage.Plant.BaseClasses.PumpValveControl conSupPum( - final plaTyp=nom.plaTyp) "Control block for the secondary pump and valves" - annotation (Placement(transformation(extent={{10,40},{30,60}}))); equation - connect(set_mTan_flow.y,conSupPum. mTanSet_flow) - annotation (Line(points={{-79,70},{6,70},{6,54},{9,54}}, color={0,0,127})); - connect(tanBra.mTanBot_flow,conSupPum. mTanBot_flow) + connect(tanBra.mTanBot_flow,conPumVal. mTanBot_flow) annotation (Line(points={{-12,11},{-12,48},{9,48}}, color={0,0,127})); - connect(conSupPum.uOnl, uOnl.y) annotation (Line(points={{32,56},{56,56},{56, - 50},{61,50}}, color={255,0,255})); - connect(conSupPum.uRemCha, uRemCha.y) - annotation (Line(points={{32,60},{32,90},{59,90}}, color={255,0,255})); - connect(set_mChi_flow.y, ideChiBra.mPumSet_flow) - annotation (Line(points={{-79,-30},{-56,-30},{-56,-11}}, color={0,0,127})); - connect(supPum.ySup_actual, conSupPum.ySup_actual) annotation (Line(points={{ + connect(supPum.ySup_actual,conPumVal. ySup_actual) annotation (Line(points={{ 14,11},{14,34},{4,34},{4,40},{9,40}}, color={0,0,127})); - connect(conSupPum.yPumSup, supPum.yPumSup) + connect(conPumVal.yPumSup, supPum.yPumSup) annotation (Line(points={{18,39},{18,11}}, color={0,0,127})); - connect(conSupPum.yValSup, supPum.yValSup) + connect(conPumVal.yValSup, supPum.yValSup) annotation (Line(points={{22,39},{22,11}}, color={0,0,127})); + connect(set_mChi_flow.y, ideChiBra.mPumSet_flow) + annotation (Line(points={{-79,-30},{-56,-30},{-56,-11}}, color={0,0,127})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), diff --git a/Buildings/Fluid/Storage/Plant/Validation/OpenTank.mo b/Buildings/Fluid/Storage/Plant/Validation/OpenTank.mo index f0ac43bc62e..0f8a01e19b1 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/OpenTank.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/OpenTank.mo @@ -5,90 +5,38 @@ model OpenTank "(Draft)" nom( final plaTyp=Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open, final dp_nominal=300000), - sin(nPorts=1), - sou(nPorts=1)); + supPum( + pumSup(per(pressure(V_flow=nom.m_flow_nominal*{0,1.6,2}, + dp=(sin.p-101325)*{2,1.6,0}))), + pumRet(per(pressure(V_flow=nom.mTan_flow_nominal*{0,1.6,2}, + dp=(sou.p-101325)*{2,1.6,0}))))); + extends + Buildings.Fluid.Storage.Plant.Validation.BaseClasses.RemoteChargingSchedule( + conPumVal(final plaTyp=nom.plaTyp)); - Modelica.Blocks.Sources.TimeTable set_mTan_flow(table=[0,0; 3600/7,0; 3600/7, - -1; 3600/7*3,-1; 3600/7*3,0; 3600/7*4,0; 3600/7*4,1; 3600/7*6,1; 3600/7 - *6,-1]) - "Tank flow rate setpoint" - annotation (Placement(transformation(extent={{-100,60},{-80,80}}))); - Modelica.Blocks.Sources.BooleanTable uRemCha(table={0,3600/7*6}, startValue= - true) "Tank is being charged remotely" - annotation (Placement(transformation(extent={{-40,60},{-20,80}}))); - Modelica.Blocks.Sources.BooleanTable uOnl(table={3600/7*2}) - "True = plant online (outputting CHW to the network); False = offline" - annotation (Placement(transformation(extent={{-60,80},{-40,100}}))); - Modelica.Blocks.Sources.TimeTable set_mChi_flow(table=[0,0; 3600/7,0; 3600/7, - 1; 3600/7*5,1; 3600/7*5,0]) "Chiller flow rate setpoint" - annotation (Placement(transformation(extent={{-100,-40},{-80,-20}}))); - Buildings.Fluid.Storage.Plant.BaseClasses.PumpValveControl conPumVal( - final plaTyp = nom.plaTyp) - "Control block for the secondary pump and near-by valves" - annotation (Placement(transformation(extent={{10,40},{30,60}}))); - Buildings.Fluid.FixedResistances.PressureDrop preDroSup( - redeclare final package Medium = Medium, - final allowFlowReversal=true, - final m_flow_nominal=nom.m_flow_nominal, - dp_nominal=0.3*nom.dp_nominal) "Flow resistance" - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={60,20}))); - Buildings.Fluid.FixedResistances.PressureDrop preDroRet( - redeclare final package Medium = Medium, - final allowFlowReversal=true, - final m_flow_nominal=nom.m_flow_nominal, - dp_nominal=0.3*nom.dp_nominal) "Flow resistance" annotation (Placement( - transformation( - extent={{10,-10},{-10,10}}, - rotation=0, - origin={60,-20}))); - Buildings.Fluid.Storage.Plant.SupplyPumpValve supPum( - redeclare final package Medium = Medium, - final nom=nom, - pumSup(per(pressure(V_flow=nom.m_flow_nominal*{0,1.6,2}, - dp=(sin.p-101325)*{2,1.6,0}))), - pumRet(per(pressure(V_flow=nom.mTan_flow_nominal*{0,1.6,2}, - dp=(sou.p-101325)*{2,1.6,0})))) "Supply pump and valves" - annotation (Placement(transformation(extent={{10,-10},{30,10}}))); equation - connect(conPumVal.uOnl, uOnl.y) annotation (Line(points={{32,56},{36,56},{36,90}, - {-39,90}}, color={255,0,255})); - connect(conPumVal.uRemCha, uRemCha.y) - annotation (Line(points={{32,60},{32,70},{-19,70}},color={255,0,255})); connect(tanBra.port_CHWR, supPum.port_chiInl) annotation (Line(points={{-10,-6},{10,-6}}, color={0,127,255})); connect(supPum.port_chiOut, tanBra.port_CHWS) annotation (Line(points={{10,6},{-10,6}}, color={0,127,255})); - connect(supPum.port_CHWS, preDroSup.port_a) annotation (Line(points={{30,6},{44, - 6},{44,20},{50,20}}, color={0,127,255})); - connect(supPum.port_CHWR, preDroRet.port_b) annotation (Line(points={{30,-6},{ - 44,-6},{44,-20},{50,-20}}, color={0,127,255})); - connect(tanBra.mTanTop_flow, conPumVal.mTanTop_flow) - annotation (Line(points={{-16,11},{-16,50},{9,50}}, color={0,0,127})); - connect(conPumVal.mTanSet_flow, set_mTan_flow.y) annotation (Line(points={{9,54}, - {-72,54},{-72,70},{-79,70}}, color={0,0,127})); connect(set_mChi_flow.y, ideChiBra.mPumSet_flow) annotation (Line(points={{-79,-30},{-56,-30},{-56,-11}}, color={0,0,127})); + connect(conPumVal.mTanTop_flow, tanBra.mTanTop_flow) + annotation (Line(points={{9,50},{-16,50},{-16,11}}, color={0,0,127})); + connect(conPumVal.mTanBot_flow, tanBra.mTanBot_flow) + annotation (Line(points={{9,48},{-12,48},{-12,11}}, color={0,0,127})); + connect(supPum.ySup_actual, conPumVal.ySup_actual) annotation (Line(points={{14, + 11},{14,34},{4,34},{4,40},{9,40}}, color={0,0,127})); connect(supPum.yRet_actual, conPumVal.yRet_actual) annotation (Line(points={{10, - 11},{10,32},{2,32},{2,44},{9,44}}, color={0,0,127})); - connect(conPumVal.ySup_actual, supPum.ySup_actual) annotation (Line(points={{9, - 40},{6,40},{6,36},{14,36},{14,11}}, color={0,0,127})); - connect(supPum.yPumSup, conPumVal.yPumSup) - annotation (Line(points={{18,11},{18,39}}, color={0,0,127})); - connect(conPumVal.yValSup, supPum.yValSup) - annotation (Line(points={{22,39},{22,11}}, color={0,0,127})); + 11},{10,30},{0,30},{0,44},{9,44}}, color={0,0,127})); + connect(conPumVal.yPumSup, supPum.yPumSup) + annotation (Line(points={{18,39},{18,11}}, color={0,0,127})); + connect(supPum.yValSup, conPumVal.yValSup) + annotation (Line(points={{22,11},{22,39}}, color={0,0,127})); connect(conPumVal.yPumRet, supPum.yPumRet) annotation (Line(points={{26,39},{26,11}}, color={0,0,127})); - connect(conPumVal.yRet, supPum.yRet) - annotation (Line(points={{30,39},{30,11},{29.8,11}}, color={0,0,127})); - connect(tanBra.mTanBot_flow, conPumVal.mTanBot_flow) - annotation (Line(points={{-12,11},{-12,48},{9,48}}, color={0,0,127})); - connect(preDroSup.port_b, sin.ports[1]) - annotation (Line(points={{70,20},{80,20}}, color={0,127,255})); - connect(preDroRet.port_a, sou.ports[1]) - annotation (Line(points={{70,-20},{80,-20}}, color={0,127,255})); + connect(supPum.yRet, conPumVal.yRet) annotation (Line(points={{29.8,11},{29.8, + 10},{30,10},{30,39}}, color={0,0,127})); annotation ( experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), diff --git a/Buildings/Fluid/Storage/Plant/package.order b/Buildings/Fluid/Storage/Plant/package.order index 66d9807af91..118df7a6d58 100644 --- a/Buildings/Fluid/Storage/Plant/package.order +++ b/Buildings/Fluid/Storage/Plant/package.order @@ -1,5 +1,4 @@ SupplyPumpValve -SupplyPumpOpenTank TankBranch Examples Validation diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos index d096c4afb8b..8cdc58970d3 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos @@ -6,7 +6,7 @@ simulateModel("Buildings.Fluid.Storage.Plant.Examples.OneSourceOneUser", // Plot commands createPlot(id=1, position={15, 15, 1027, 480}, - y={"chiBra.m_flow", "tanBra.mTanTop_flow", "supPum.pumSup.m_flow"}, + y={"chiBra.m_flow", "tanBra.mTanBot_flow", "supPum.pumSup.m_flow"}, range={0.0, 3600.0, -1.0, 1.0}, grid=true, subPlot=101, diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos index 4bdb58b6197..575d5d64e21 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos @@ -6,7 +6,7 @@ simulateModel("Buildings.Fluid.Storage.Plant.Examples.TwoSourcesThreeUsers", // Plot commands createPlot(id=1, position={15, 15, 914, 538}, - y={"pumSup1.m_flow", "chiBra2.m_flow", "tanBra.mTanTop_flow", "supPum.pumSup.m_flow"}, + y={"pumSup1.m_flow", "chiBra2.m_flow", "tanBra.mTanBot_flow", "supPum.pumSup.m_flow"}, range={0.0, 3600.0, -2.0, 2.0}, grid=true, subPlot=101, diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/OpenTank.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/OpenTank.mos index 99f4c888618..c9824e7862c 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/OpenTank.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/OpenTank.mos @@ -5,16 +5,20 @@ simulateModel("Buildings.Fluid.Storage.Plant.Validation.OpenTank", resultFile="OpenTank"); // Plot commands createPlot(id=1, - position={10, 4, 1094, 494}, - y={"tanBra.mTanTop_flow", "tanBra.mTanBot_flow"}, - range={0.0, 3600.0, -2.0, 2.0}, + position={14, 11, 1094, 494}, + y={"tanBra.mTanTop_flow", "tanBra.mTanBot_flow", + "supPum.pumSup.m_flow", "supPum.pumRet.m_flow"}, + range={0.0, 3600.0, -2.0, 4.0}, + autoscale=false, grid=true, subPlot=101, - colors={{28,108,200}, {238,46,47}}, timeUnit="s"); + colors={{28,108,200}, {238,46,47}, {0,140,72}, {217,67,180}}, + timeUnit="s", + displayUnits={"kg/s", "kg/s", "kg/s", "kg/s"}); createPlot(id=1, - position={10, 4, 1094, 494}, - y={"supPum.valSupOut.y_actual", "supPum.valSupCha.y_actual", "supPum.valRetOut.y_actual", - "supPum.valRetCha.y_actual"}, + position={14, 11, 1094, 494}, + y={"supPum.valSupOut.y_actual", "supPum.valSupCha.y_actual", + "supPum.valRetOut.y_actual", "supPum.valRetCha.y_actual"}, range={0.0, 3600.0, -0.5, 1.5}, autoscale=false, grid=true, From a78a98dea6d97eedc3d9806d7f29e1959d1fadf4 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Thu, 21 Apr 2022 10:48:37 -0700 Subject: [PATCH 098/463] renamed models to be more concise --- .../{TwoSourcesThreeUsers.mo => ClosedDualSource.mo} | 6 +++--- .../Examples/{OneSourceOneUser.mo => ClosedSingleSource.mo} | 6 +++--- Buildings/Fluid/Storage/Plant/Examples/package.order | 4 ++-- .../{ClosedTankNoRemoteCharging.mo => ClosedLocal.mo} | 6 +++--- .../{ClosedTankWithRemoteCharging.mo => ClosedRemote.mo} | 6 +++--- .../Fluid/Storage/Plant/Validation/{OpenTank.mo => Open.mo} | 6 +++--- Buildings/Fluid/Storage/Plant/Validation/package.order | 6 +++--- ...dings_Fluid_Storage_Plant_Examples_ClosedDualSource.txt} | 0 ...ngs_Fluid_Storage_Plant_Examples_ClosedSingleSource.txt} | 0 ...uildings_Fluid_Storage_Plant_Validation_ClosedLocal.txt} | 0 ...ildings_Fluid_Storage_Plant_Validation_ClosedRemote.txt} | 0 .../{TwoSourcesThreeUsers.mos => ClosedDualSource.mos} | 4 ++-- .../{OneSourceOneUser.mos => ClosedSingleSource.mos} | 4 ++-- .../{ClosedTankNoRemoteCharging.mos => ClosedLocal.mos} | 4 ++-- .../{ClosedTankWithRemoteCharging.mos => ClosedRemote.mos} | 4 ++-- .../Storage/Plant/Validation/{OpenTank.mos => Open.mos} | 4 ++-- ...dings.Fluid.Storage.Plant.Examples.ClosedDualSource.mos} | 0 ...ngs.Fluid.Storage.Plant.Examples.ClosedSingleSource.mos} | 0 ...uildings.Fluid.Storage.Plant.Validation.ClosedLocal.mos} | 0 ...ildings.Fluid.Storage.Plant.Validation.ClosedRemote.mos} | 0 20 files changed, 30 insertions(+), 30 deletions(-) rename Buildings/Fluid/Storage/Plant/Examples/{TwoSourcesThreeUsers.mo => ClosedDualSource.mo} (99%) rename Buildings/Fluid/Storage/Plant/Examples/{OneSourceOneUser.mo => ClosedSingleSource.mo} (97%) rename Buildings/Fluid/Storage/Plant/Validation/{ClosedTankNoRemoteCharging.mo => ClosedLocal.mo} (94%) rename Buildings/Fluid/Storage/Plant/Validation/{ClosedTankWithRemoteCharging.mo => ClosedRemote.mo} (95%) rename Buildings/Fluid/Storage/Plant/Validation/{OpenTank.mo => Open.mo} (96%) rename Buildings/Resources/ReferenceResults/Dymola/{Buildings_Fluid_Storage_Plant_Examples_TwoSourcesThreeUsers.txt => Buildings_Fluid_Storage_Plant_Examples_ClosedDualSource.txt} (100%) rename Buildings/Resources/ReferenceResults/Dymola/{Buildings_Fluid_Storage_Plant_Examples_OneSourceOneUser.txt => Buildings_Fluid_Storage_Plant_Examples_ClosedSingleSource.txt} (100%) rename Buildings/Resources/ReferenceResults/Dymola/{Buildings_Fluid_Storage_Plant_Validation_ClosedTankNoRemoteCharging.txt => Buildings_Fluid_Storage_Plant_Validation_ClosedLocal.txt} (100%) rename Buildings/Resources/ReferenceResults/Dymola/{Buildings_Fluid_Storage_Plant_Validation_ClosedTankWithRemoteCharging.txt => Buildings_Fluid_Storage_Plant_Validation_ClosedRemote.txt} (100%) rename Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/{TwoSourcesThreeUsers.mos => ClosedDualSource.mos} (88%) rename Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/{OneSourceOneUser.mos => ClosedSingleSource.mos} (82%) rename Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/{ClosedTankNoRemoteCharging.mos => ClosedLocal.mos} (72%) rename Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/{ClosedTankWithRemoteCharging.mos => ClosedRemote.mos} (71%) rename Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/{OpenTank.mos => Open.mos} (89%) rename Buildings/Resources/Scripts/OpenModelica/compareVars/{Buildings.Fluid.Storage.Plant.Examples.TwoSourcesThreeUsers.mos => Buildings.Fluid.Storage.Plant.Examples.ClosedDualSource.mos} (100%) rename Buildings/Resources/Scripts/OpenModelica/compareVars/{Buildings.Fluid.Storage.Plant.Examples.OneSourceOneUser.mos => Buildings.Fluid.Storage.Plant.Examples.ClosedSingleSource.mos} (100%) rename Buildings/Resources/Scripts/OpenModelica/compareVars/{Buildings.Fluid.Storage.Plant.Validation.ClosedTankNoRemoteCharging.mos => Buildings.Fluid.Storage.Plant.Validation.ClosedLocal.mos} (100%) rename Buildings/Resources/Scripts/OpenModelica/compareVars/{Buildings.Fluid.Storage.Plant.Validation.ClosedTankWithRemoteCharging.mos => Buildings.Fluid.Storage.Plant.Validation.ClosedRemote.mos} (100%) diff --git a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo b/Buildings/Fluid/Storage/Plant/Examples/ClosedDualSource.mo similarity index 99% rename from Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo rename to Buildings/Fluid/Storage/Plant/Examples/ClosedDualSource.mo index ad554dc452d..ba7f59184a0 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/ClosedDualSource.mo @@ -1,5 +1,5 @@ within Buildings.Fluid.Storage.Plant.Examples; -model TwoSourcesThreeUsers +model ClosedDualSource "(Draft) District system model with two sources and three users" extends Modelica.Icons.Example; @@ -467,7 +467,7 @@ equation connect(conSupPum.yValSup, supPum.yValSup) annotation (Line(points={{-68,-31},{-68,-49}}, color={0,0,127})); annotation ( - __Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos" + __Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/ClosedDualSource.mos" "Simulate and plot"), experiment(Tolerance=1e-06, StopTime=3600,__Dymola_Algorithm="Dassl"), Diagram(coordinateSystem(extent={{-180,-120},{140,140}})), Icon( @@ -570,4 +570,4 @@ First implementation. This is for
    ")); -end TwoSourcesThreeUsers; +end ClosedDualSource; diff --git a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo b/Buildings/Fluid/Storage/Plant/Examples/ClosedSingleSource.mo similarity index 97% rename from Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo rename to Buildings/Fluid/Storage/Plant/Examples/ClosedSingleSource.mo index 4dae0d4a6e1..760e053b503 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/OneSourceOneUser.mo +++ b/Buildings/Fluid/Storage/Plant/Examples/ClosedSingleSource.mo @@ -1,5 +1,5 @@ within Buildings.Fluid.Storage.Plant.Examples; -model OneSourceOneUser "(Draft) Simple system model with one source and one user" +model ClosedSingleSource "(Draft) Simple system model with one source and one user" extends Modelica.Icons.Example; package Medium = Buildings.Media.Water "Medium model for CDW"; @@ -136,7 +136,7 @@ equation color={0,0,127})); connect(sou_p.ports[1], tanBra.port_CHWR) annotation (Line(points={{-60,-70},{ -34,-70},{-34,-6},{-40,-6}}, color={0,127,255})); - annotation(__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos" + annotation(__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/ClosedSingleSource.mos" "Simulate and plot"), experiment(Tolerance=1e-06, StopTime=3600), Documentation(info="

    @@ -172,4 +172,4 @@ First implementation. This is for

")); -end OneSourceOneUser; +end ClosedSingleSource; diff --git a/Buildings/Fluid/Storage/Plant/Examples/package.order b/Buildings/Fluid/Storage/Plant/Examples/package.order index da0cd7227d2..3cb009bd24b 100644 --- a/Buildings/Fluid/Storage/Plant/Examples/package.order +++ b/Buildings/Fluid/Storage/Plant/Examples/package.order @@ -1,3 +1,3 @@ -OneSourceOneUser -TwoSourcesThreeUsers +ClosedDualSource +ClosedSingleSource BaseClasses diff --git a/Buildings/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ClosedLocal.mo similarity index 94% rename from Buildings/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mo rename to Buildings/Fluid/Storage/Plant/Validation/ClosedLocal.mo index 8226a923e14..3b16172baaa 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ClosedLocal.mo @@ -1,5 +1,5 @@ within Buildings.Fluid.Storage.Plant.Validation; -model ClosedTankNoRemoteCharging +model ClosedLocal "(Draft) Validation model of the plant not allowing remote charging" extends Modelica.Icons.Example; extends @@ -37,7 +37,7 @@ equation annotation (Line(points={{18,11},{18,70},{1,70}}, color={0,0,127})); connect(mSet_flow.y, ideChiBra.mPumSet_flow) annotation (Line(points={{-79,-30},{-56,-30},{-56,-11}}, color={0,0,127})); - annotation (__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mos" + annotation (__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedLocal.mos" "Simulate and plot"), experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), @@ -56,4 +56,4 @@ First implementation. This is for ")); -end ClosedTankNoRemoteCharging; +end ClosedLocal; diff --git a/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo b/Buildings/Fluid/Storage/Plant/Validation/ClosedRemote.mo similarity index 95% rename from Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo rename to Buildings/Fluid/Storage/Plant/Validation/ClosedRemote.mo index 445ad32aba6..89083965997 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/ClosedRemote.mo @@ -1,5 +1,5 @@ within Buildings.Fluid.Storage.Plant.Validation; -model ClosedTankWithRemoteCharging +model ClosedRemote "(Draft) Validation model of the plant allowing remote charging" extends Modelica.Icons.Example; extends @@ -25,7 +25,7 @@ equation experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), Icon(coordinateSystem(extent={{-100,-100},{100,100}})), - __Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mos" + __Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedRemote.mos" "Simulate and plot"), Documentation(info="

@@ -113,4 +113,4 @@ First implementation. This is for ")); -end ClosedTankWithRemoteCharging; +end ClosedRemote; diff --git a/Buildings/Fluid/Storage/Plant/Validation/OpenTank.mo b/Buildings/Fluid/Storage/Plant/Validation/Open.mo similarity index 96% rename from Buildings/Fluid/Storage/Plant/Validation/OpenTank.mo rename to Buildings/Fluid/Storage/Plant/Validation/Open.mo index 0f8a01e19b1..203b20b98d7 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/OpenTank.mo +++ b/Buildings/Fluid/Storage/Plant/Validation/Open.mo @@ -1,5 +1,5 @@ within Buildings.Fluid.Storage.Plant.Validation; -model OpenTank "(Draft)" +model Open "(Draft)" extends Modelica.Icons.Example; extends Buildings.Fluid.Storage.Plant.Validation.BaseClasses.PartialPlant( nom( @@ -41,7 +41,7 @@ equation experiment(Tolerance=1e-06, StopTime=3600), Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), Icon(coordinateSystem(extent={{-100,-100},{100,100}})), - __Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/OpenTank.mos" + __Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/Open.mos" "Simulate and plot"), Documentation(info="

@@ -56,4 +56,4 @@ First implementation. This is for ")); -end OpenTank; +end Open; diff --git a/Buildings/Fluid/Storage/Plant/Validation/package.order b/Buildings/Fluid/Storage/Plant/Validation/package.order index 899190da35a..5765e3da9df 100644 --- a/Buildings/Fluid/Storage/Plant/Validation/package.order +++ b/Buildings/Fluid/Storage/Plant/Validation/package.order @@ -1,4 +1,4 @@ -ClosedTankNoRemoteCharging -ClosedTankWithRemoteCharging -OpenTank +ClosedLocal +ClosedRemote +Open BaseClasses diff --git a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_TwoSourcesThreeUsers.txt b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_ClosedDualSource.txt similarity index 100% rename from Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_TwoSourcesThreeUsers.txt rename to Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_ClosedDualSource.txt diff --git a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_OneSourceOneUser.txt b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_ClosedSingleSource.txt similarity index 100% rename from Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_OneSourceOneUser.txt rename to Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Examples_ClosedSingleSource.txt diff --git a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ClosedTankNoRemoteCharging.txt b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ClosedLocal.txt similarity index 100% rename from Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ClosedTankNoRemoteCharging.txt rename to Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ClosedLocal.txt diff --git a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ClosedTankWithRemoteCharging.txt b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ClosedRemote.txt similarity index 100% rename from Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ClosedTankWithRemoteCharging.txt rename to Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Storage_Plant_Validation_ClosedRemote.txt diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/ClosedDualSource.mos similarity index 88% rename from Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos rename to Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/ClosedDualSource.mos index 575d5d64e21..f8e56aa307a 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/TwoSourcesThreeUsers.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/ClosedDualSource.mos @@ -1,8 +1,8 @@ -simulateModel("Buildings.Fluid.Storage.Plant.Examples.TwoSourcesThreeUsers", +simulateModel("Buildings.Fluid.Storage.Plant.Examples.ClosedDualSource", stopTime=3600, tolerance=1e-06, method="dassl", - resultFile="TwoSourcesThreeUsers"); + resultFile="ClosedDualSource"); // Plot commands createPlot(id=1, position={15, 15, 914, 538}, diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/ClosedSingleSource.mos similarity index 82% rename from Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos rename to Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/ClosedSingleSource.mos index 8cdc58970d3..23504802308 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/OneSourceOneUser.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Examples/ClosedSingleSource.mos @@ -1,8 +1,8 @@ -simulateModel("Buildings.Fluid.Storage.Plant.Examples.OneSourceOneUser", +simulateModel("Buildings.Fluid.Storage.Plant.Examples.ClosedSingleSource", stopTime=3600, tolerance=1e-06, method="dassl", - resultFile="OneSourceOneUser"); + resultFile="ClosedSingleSource"); // Plot commands createPlot(id=1, position={15, 15, 1027, 480}, diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedLocal.mos similarity index 72% rename from Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mos rename to Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedLocal.mos index f599cf79565..46fa70c81b3 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankNoRemoteCharging.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedLocal.mos @@ -1,8 +1,8 @@ -simulateModel("Buildings.Fluid.Storage.Plant.Validation.ClosedTankNoRemoteCharging", +simulateModel("Buildings.Fluid.Storage.Plant.Validation.ClosedLocal", stopTime=3600, tolerance=1e-06, method="dassl", - resultFile="ClosedTankNoRemoteCharging"); + resultFile="ClosedLocal"); // Plot commands createPlot(id=1, position={15, 15, 961, 426}, diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedRemote.mos similarity index 71% rename from Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mos rename to Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedRemote.mos index cb1ee794561..d786dac2775 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedTankWithRemoteCharging.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/ClosedRemote.mos @@ -1,8 +1,8 @@ -simulateModel("Buildings.Fluid.Storage.Plant.Validation.ClosedTankWithRemoteCharging", +simulateModel("Buildings.Fluid.Storage.Plant.Validation.ClosedRemote", stopTime=3600, tolerance=1e-06, method="dassl", - resultFile="ClosedTankWithRemoteCharging"); + resultFile="ClosedRemote"); // Plot commands createPlot(id=1, position={15, 15, 929, 372}, diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/OpenTank.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/Open.mos similarity index 89% rename from Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/OpenTank.mos rename to Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/Open.mos index c9824e7862c..d1dfdd10169 100644 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/OpenTank.mos +++ b/Buildings/Resources/Scripts/Dymola/Fluid/Storage/Plant/Validation/Open.mos @@ -1,8 +1,8 @@ -simulateModel("Buildings.Fluid.Storage.Plant.Validation.OpenTank", +simulateModel("Buildings.Fluid.Storage.Plant.Validation.Open", stopTime=3600, tolerance=1e-06, method="dassl", - resultFile="OpenTank"); + resultFile="Open"); // Plot commands createPlot(id=1, position={14, 11, 1094, 494}, diff --git a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.TwoSourcesThreeUsers.mos b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.ClosedDualSource.mos similarity index 100% rename from Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.TwoSourcesThreeUsers.mos rename to Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.ClosedDualSource.mos diff --git a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.OneSourceOneUser.mos b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.ClosedSingleSource.mos similarity index 100% rename from Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.OneSourceOneUser.mos rename to Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Examples.ClosedSingleSource.mos diff --git a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ClosedTankNoRemoteCharging.mos b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ClosedLocal.mos similarity index 100% rename from Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ClosedTankNoRemoteCharging.mos rename to Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ClosedLocal.mos diff --git a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ClosedTankWithRemoteCharging.mos b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ClosedRemote.mos similarity index 100% rename from Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ClosedTankWithRemoteCharging.mos rename to Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Storage.Plant.Validation.ClosedRemote.mos From 91e62266471317020f2fd536e8ad0f9ed6f46201 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Thu, 21 Apr 2022 15:15:23 -0700 Subject: [PATCH 099/463] added on/offline signal to return flow control --- .../Plant/BaseClasses/PumpValveControl.mo | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo index 4f969b09a8a..3d60b034c90 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/PumpValveControl.mo @@ -33,7 +33,7 @@ block PumpValveControl origin={-150,88}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-110,40}))); + origin={-110,80}))); Modelica.Blocks.Interfaces.RealInput mTanBot_flow "Flow rate measured at the bottom of the tank" annotation (Placement( transformation( @@ -42,7 +42,7 @@ block PumpValveControl origin={-150,50}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-110,-20}))); + origin={-110,0}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uOnl "= true if plant is online (not cut off from the network by valve)" annotation (Placement(transformation(extent={{-10,-10},{10,10}}, @@ -67,7 +67,7 @@ block PumpValveControl origin={-150,-10}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-110,-100}))); + origin={-110,-80}))); Buildings.Controls.OBC.CDL.Continuous.LessThreshold isValOutClo(t=0.01) "= true if valve closed" annotation (Placement(transformation(extent={{40,120},{60,140}}))); @@ -102,7 +102,7 @@ block PumpValveControl extent={{-10,-10},{10,10}}, rotation=-90, origin={240,70}))); - Buildings.Controls.OBC.CDL.Logical.And andCha + Buildings.Controls.OBC.CDL.Logical.And3 and3Cha "Charging = remote charging command AND outputting valve(s) closed" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -138,7 +138,7 @@ block PumpValveControl origin={-150,68}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-110,0}))); + origin={-110,40}))); Buildings.Controls.Continuous.LimPID conPI_pumSup( controllerType=Modelica.Blocks.Types.SimpleController.PI, @@ -167,7 +167,7 @@ block PumpValveControl origin={-150,10}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-110,-60}))); + origin={-110,-40}))); Buildings.Controls.OBC.CDL.Continuous.Max maxCha if plaTyp == Buildings.Fluid.Storage.Plant.BaseClasses.Types.Setup.Open "Max of charging valve positions" @@ -237,15 +237,11 @@ equation -98}}, color={0,0,127})); connect(zero.y, swiValCha.u3) annotation (Line(points={{-99,-50},{22,-50},{22, -98}}, color={0,0,127})); - connect(isValOutClo.y, andCha.u2) - annotation (Line(points={{62,130},{182,130},{182,22}}, color={255,0,255})); connect(conPI_valCha.y, swiValCha.u1) annotation (Line(points={{30,-1},{30,-20}, {38,-20},{38,-98}}, color={0,0,127})); connect(uRemCha, notRemCha.u) annotation (Line(points={{270,108},{240,108},{240,82}}, color={255,0,255})); - connect(andCha.u1, uRemCha) annotation (Line(points={{190,22},{190,108},{270,108}}, - color={255,0,255})); connect(and3Out.u3, isValChaClo.y) annotation (Line(points={{222,22},{222,210},{62,210}}, color={255,0,255})); connect(notRemCha.y, and3Out.u2) annotation (Line(points={{240,58},{240,40},{230, @@ -281,16 +277,12 @@ equation 156},{-120,7.5},{-150,7.5}}, color={0,0,127})); connect(conPI_pumSup.y, swiPumSup.u1) annotation (Line(points={{-70,-1},{-70,-20}, {-62,-20},{-62,-98}}, color={0,0,127})); - connect(andCha.y, swiPumRet.u2) annotation (Line(points={{190,-2},{190,-76},{90, - -76},{90,-98}}, color={255,0,255})); connect(conPI_pumRet.y, swiPumRet.u1) annotation (Line(points={{90,-1},{90,-20}, {98,-20},{98,-98}}, color={0,0,127})); connect(swiPumRet.u3, zero.y) annotation (Line(points={{82,-98},{82,-50},{-99,-50}}, color={0,0,127})); connect(swiPumRet.y, yPumRet) annotation (Line(points={{90,-122},{90,-150}}, color={0,0,127})); - connect(booToReaValCha.u, andCha.y) - annotation (Line(points={{190,-98},{190,-2}}, color={255,0,255})); connect(swiValOut.u2, and3Out.y) annotation (Line(points={{150,-98},{150,-60}, {230,-60},{230,-2}}, color={255,0,255})); connect(conPI_valOut.y, swiValOut.u1) annotation (Line(points={{150,-1},{150,-20}, @@ -299,8 +291,6 @@ equation -50}}, color={0,0,127})); connect(booToReaValOut.u, and3Out.y) annotation (Line(points={{-10,-98},{-10,-60}, {230,-60},{230,-2}}, color={255,0,255})); - connect(swiValCha.u2, andCha.y) annotation (Line(points={{30,-98},{30,-76},{190, - -76},{190,-2}}, color={255,0,255})); connect(maxCha.u2, ySup_actual[2]) annotation (Line(points={{-62,224},{-100, 224},{-100,-7.5},{-150,-7.5}}, color={0,0,127})); connect(pasCha.u, ySup_actual[2]) annotation (Line(points={{-62,190},{-100, @@ -319,6 +309,18 @@ equation {170,-134},{170,-147.5}}, color={0,0,127})); connect(conPI_pumRet.u_m, mTanTop_flow) annotation (Line(points={{78,10},{70,10}, {70,68},{-150,68}}, color={0,0,127})); + connect(and3Cha.u2, uRemCha) annotation (Line(points={{190,22},{190,108},{270, + 108}}, color={255,0,255})); + connect(and3Cha.u3, isValOutClo.y) + annotation (Line(points={{182,22},{182,130},{62,130}}, color={255,0,255})); + connect(and3Cha.u1, uOnl) + annotation (Line(points={{198,22},{198,28},{270,28}}, color={255,0,255})); + connect(booToReaValCha.u, and3Cha.y) + annotation (Line(points={{190,-98},{190,-2}}, color={255,0,255})); + connect(and3Cha.y, swiPumRet.u2) annotation (Line(points={{190,-2},{190,-70}, + {90,-70},{90,-98}}, color={255,0,255})); + connect(swiValCha.u2, and3Cha.y) annotation (Line(points={{30,-98},{30,-70},{ + 190,-70},{190,-2}}, color={255,0,255})); annotation ( defaultComponentName="conPumVal", Diagram(coordinateSystem(extent={{-140,-140},{260,240}})), Icon( From 8c8e1c33aad3123f25faeed8be32ae34cd641261 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Thu, 21 Apr 2022 16:14:06 -0700 Subject: [PATCH 100/463] improved documentations --- .../Plant/BaseClasses/FluidPassThrough.mo | 2 +- .../Plant/BaseClasses/PartialBranchPorts.mo | 5 +- .../Plant/BaseClasses/PumpValveControl.mo | 14 +-- .../Fluid/Storage/Plant/BaseClasses/Types.mo | 4 +- .../Plant/Examples/BaseClasses/DummyUser.mo | 2 +- .../Plant/Examples/ClosedDualSource.mo | 8 +- .../Plant/Examples/ClosedSingleSource.mo | 11 +- .../Fluid/Storage/Plant/SupplyPumpValve.mo | 97 ++++++++++++++++- Buildings/Fluid/Storage/Plant/TankBranch.mo | 101 ++++-------------- .../BaseClasses/IdealChillerBranch.mo | 13 ++- .../Validation/BaseClasses/PartialPlant.mo | 4 +- .../BaseClasses/RemoteChargingSchedule.mo | 90 +++++++++++++++- .../Storage/Plant/Validation/ClosedLocal.mo | 8 +- .../Storage/Plant/Validation/ClosedRemote.mo | 92 ++-------------- .../Fluid/Storage/Plant/Validation/Open.mo | 18 ++-- .../BaseClasses/Validation/DummyUser.mos | 6 +- .../Plant/Examples/ClosedDualSource.mos | 6 +- .../Plant/Examples/ClosedSingleSource.mos | 6 +- .../Storage/Plant/Validation/ClosedLocal.mos | 6 +- .../Storage/Plant/Validation/ClosedRemote.mos | 6 +- .../Fluid/Storage/Plant/Validation/Open.mos | 6 +- 21 files changed, 283 insertions(+), 222 deletions(-) diff --git a/Buildings/Fluid/Storage/Plant/BaseClasses/FluidPassThrough.mo b/Buildings/Fluid/Storage/Plant/BaseClasses/FluidPassThrough.mo index 95562989999..05f329c2f00 100644 --- a/Buildings/Fluid/Storage/Plant/BaseClasses/FluidPassThrough.mo +++ b/Buildings/Fluid/Storage/Plant/BaseClasses/FluidPassThrough.mo @@ -13,7 +13,7 @@ equation thickness=1)}), Diagram(coordinateSystem(preserveAspectRatio=false)), Documentation(info=" Fluid directly passes through the two ports. -This is used to replace conditionally-enabled components with a connection. +This is used to replace conditionally-enabled components with a direct connection. ", revisions="