From 9e4eb4e9028cb510bdebd8f08f254345de0aa644 Mon Sep 17 00:00:00 2001
From: junkewang001
Date: Thu, 30 Mar 2023 16:33:34 -0700
Subject: [PATCH 01/20] Deleted modifiers in extIndSig blocks
---
.../SetPoints/MinimumFlowSetPoint.mo | 20 ++++++-------------
.../Validation/MinimumFlowSetPoint.mo | 12 +++--------
2 files changed, 9 insertions(+), 23 deletions(-)
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/MinimumFlowSetPoint.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/MinimumFlowSetPoint.mo
index 3e3d1c94743..4508c64b5d7 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/MinimumFlowSetPoint.mo
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/MinimumFlowSetPoint.mo
@@ -175,9 +175,7 @@ protected
annotation (Placement(transformation(extent={{60,-60},{80,-40}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor extIndSig1(
- final allowOutOfRange=true,
- final nin=nSta,
- final outOfRangeValue=1e-6)
+ final nin=nSta)
"Extract flow ratio of previous setpoint during stage-up"
annotation (Placement(transformation(extent={{60,70},{80,90}})));
@@ -204,9 +202,7 @@ protected
annotation (Placement(transformation(extent={{60,30},{80,50}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor extIndSig3(
- final allowOutOfRange=true,
- final nin=nBoi,
- final outOfRangeValue=1e-6)
+ final nin=nBoi)
"Extract max flowrate of boiler being disabled during stage-up"
annotation (Placement(transformation(extent={{-20,40},{0,60}})));
@@ -248,9 +244,7 @@ protected
annotation (Placement(transformation(extent={{-90,-310},{-70,-290}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor extIndSig4(
- final allowOutOfRange=true,
- final nin=nSta,
- final outOfRangeValue=1e-6)
+ final nin=nSta)
"Extract flow ratio of previous setpoint during stage-down"
annotation (Placement(transformation(extent={{60,-280},{80,-260}})));
@@ -259,9 +253,7 @@ protected
annotation (Placement(transformation(extent={{100,-260},{120,-240}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor extIndSig5(
- final allowOutOfRange=true,
- final nin=nBoi,
- final outOfRangeValue=1e-6)
+ final nin=nBoi)
"Extract max flowrate of boiler being disabled during stage-down"
annotation (Placement(transformation(extent={{-40,-270},{-20,-250}})));
@@ -369,8 +361,8 @@ equation
connect(uStaSet, extIndSig.index) annotation (Line(points={{-160,-90},{70,-90},
{70,-62}}, color={255,127,0}));
- connect(matMax.y, extIndSig1.u) annotation (Line(points={{42,-150},{52,-150},{
- 52,80},{58,80}},
+ connect(matMax.y, extIndSig1.u) annotation (Line(points={{42,-150},{52,-150},
+ {52,80},{58,80}},
color={0,0,127}));
connect(conInt.y,subInt. u2) annotation (Line(points={{-98,70},{-72,70},{-72,
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/Validation/MinimumFlowSetPoint.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/Validation/MinimumFlowSetPoint.mo
index f3966daa1ab..b1e81266798 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/Validation/MinimumFlowSetPoint.mo
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/Validation/MinimumFlowSetPoint.mo
@@ -54,9 +54,7 @@ protected
annotation (Placement(transformation(extent={{-90,90},{-70,110}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor extIndSig(
- final allowOutOfRange=true,
- final nin=3,
- final outOfRangeValue=0)
+ final nin=3)
"Extract scalar out of vector"
annotation (Placement(transformation(extent={{-60,90},{-40,110}})));
@@ -93,9 +91,7 @@ protected
annotation (Placement(transformation(extent={{-90,-30},{-70,-10}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor extIndSig1(
- final allowOutOfRange=true,
- final nin=3,
- final outOfRangeValue=0)
+ final nin=3)
"Extract scalar out of vector"
annotation (Placement(transformation(extent={{-60,-30},{-40,-10}})));
@@ -121,9 +117,7 @@ protected
annotation (Placement(transformation(extent={{-90,-60},{-70,-40}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor extIndSig2(
- final allowOutOfRange=true,
- final nin=3,
- final outOfRangeValue=0)
+ final nin=3)
"Extract scalar out of vector"
annotation (Placement(transformation(extent={{-60,-60},{-40,-40}})));
From e99851316aa074a1600dba7f31823c4e4b388bdf Mon Sep 17 00:00:00 2001
From: junkewang001
Date: Thu, 30 Mar 2023 16:34:19 -0700
Subject: [PATCH 02/20] Changed the input of stage0 from 0 to 1
---
.../Staging/SetPoints/Subsequences/Validation/Capacities.mo | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/Capacities.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/Capacities.mo
index eb07c310468..a034b3b938d 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/Capacities.mo
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/Capacities.mo
@@ -37,8 +37,7 @@ protected
"Minimum stage capacities"
annotation (Placement(transformation(extent={{-140,60},{-120,80}})));
- Buildings.Controls.OBC.CDL.Integers.Sources.Constant stage0(
- final k=0)
+ Buildings.Controls.OBC.CDL.Integers.Sources.Constant stage0(final k=1)
"Boiler stage"
annotation (Placement(transformation(extent={{-140,20},{-120,40}})));
@@ -72,8 +71,7 @@ protected
"Boiler stage"
annotation (Placement(transformation(extent={{20,-20},{40,0}})));
- Buildings.Controls.OBC.CDL.Integers.Sources.Constant stage6(
- final k=3)
+ Buildings.Controls.OBC.CDL.Integers.Sources.Constant stage6(final k=2)
"Boiler stage"
annotation (Placement(transformation(extent={{-60,-20},{-40,0}})));
From eaa16cb85026e13c75f394ba478a9392df7bb98e Mon Sep 17 00:00:00 2001
From: junkewang001
Date: Thu, 30 Mar 2023 17:45:04 -0700
Subject: [PATCH 03/20] Deleted modifiers of allowOutOfRange and
outOfRangeValue in components
---
.../Pumps/SecondaryPumps/Controller.mo | 15 ++++++--------
.../SetPoints/MinimumFlowSetPoint.mo | 20 +++++++++++++------
.../Validation/MinimumFlowSetPoint.mo | 12 ++++++++---
3 files changed, 29 insertions(+), 18 deletions(-)
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Pumps/SecondaryPumps/Controller.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Pumps/SecondaryPumps/Controller.mo
index 5261b8728dc..91851905713 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Pumps/SecondaryPumps/Controller.mo
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Pumps/SecondaryPumps/Controller.mo
@@ -382,9 +382,7 @@ protected
annotation (Placement(transformation(extent={{-40,220},{-20,240}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor nexLagPum(
- final allowOutOfRange=true,
- final nin=nPum,
- final outOfRangeValue=0)
+ final nin=nPum)
"Next lag pump"
annotation (Placement(transformation(extent={{-80,-60},{-60,-40}})));
@@ -393,9 +391,7 @@ protected
annotation (Placement(transformation(extent={{-8,-60},{12,-40}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor lasLagPum(
- final allowOutOfRange=true,
- final nin=nPum,
- final outOfRangeValue=0)
+ final nin=nPum)
"Last lag pump"
annotation (Placement(transformation(extent={{-80,-110},{-60,-90}})));
@@ -421,7 +417,7 @@ protected
annotation (Placement(transformation(extent={{-250,-166},{-230,-146}})));
Buildings.Controls.OBC.CDL.Integers.MultiSum mulSumInt1(
- final nin=nPumPri) if not have_varSecPum
+ final nin=nPumPri) if not have_varSecPum
"Sum of integer inputs"
annotation (Placement(transformation(extent={{-200,-166},{-180,-146}})));
@@ -735,8 +731,9 @@ equation
0},{274,-264},{-74,-264},{-74,-326},{-62,-326}}, color={255,0,255}));
connect(logSwi.y, pumSpeRemDp.uHotWatPum) annotation (Line(points={{214,0},{274,
0},{274,-264},{-74,-264},{-74,-362},{-62,-362}}, color={255,0,255}));
- connect(booToInt1.y, mulSumInt1.u[1:2]) annotation (Line(points={{-228,-156},{
- -216,-156},{-216,-159.5},{-202,-159.5}}, color={255,127,0}));
+ connect(booToInt1.y, mulSumInt1.u[1:2]) annotation (Line(points={{-228,-156},
+ {-216,-156},{-216,-154.25},{-202,-154.25}},
+ color={255,127,0}));
connect(min.y, yPumSpe)
annotation (Line(points={{182,-400},{300,-400}}, color={0,0,127}));
annotation (defaultComponentName="secPumCon",
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/MinimumFlowSetPoint.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/MinimumFlowSetPoint.mo
index 4508c64b5d7..3e3d1c94743 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/MinimumFlowSetPoint.mo
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/MinimumFlowSetPoint.mo
@@ -175,7 +175,9 @@ protected
annotation (Placement(transformation(extent={{60,-60},{80,-40}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor extIndSig1(
- final nin=nSta)
+ final allowOutOfRange=true,
+ final nin=nSta,
+ final outOfRangeValue=1e-6)
"Extract flow ratio of previous setpoint during stage-up"
annotation (Placement(transformation(extent={{60,70},{80,90}})));
@@ -202,7 +204,9 @@ protected
annotation (Placement(transformation(extent={{60,30},{80,50}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor extIndSig3(
- final nin=nBoi)
+ final allowOutOfRange=true,
+ final nin=nBoi,
+ final outOfRangeValue=1e-6)
"Extract max flowrate of boiler being disabled during stage-up"
annotation (Placement(transformation(extent={{-20,40},{0,60}})));
@@ -244,7 +248,9 @@ protected
annotation (Placement(transformation(extent={{-90,-310},{-70,-290}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor extIndSig4(
- final nin=nSta)
+ final allowOutOfRange=true,
+ final nin=nSta,
+ final outOfRangeValue=1e-6)
"Extract flow ratio of previous setpoint during stage-down"
annotation (Placement(transformation(extent={{60,-280},{80,-260}})));
@@ -253,7 +259,9 @@ protected
annotation (Placement(transformation(extent={{100,-260},{120,-240}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor extIndSig5(
- final nin=nBoi)
+ final allowOutOfRange=true,
+ final nin=nBoi,
+ final outOfRangeValue=1e-6)
"Extract max flowrate of boiler being disabled during stage-down"
annotation (Placement(transformation(extent={{-40,-270},{-20,-250}})));
@@ -361,8 +369,8 @@ equation
connect(uStaSet, extIndSig.index) annotation (Line(points={{-160,-90},{70,-90},
{70,-62}}, color={255,127,0}));
- connect(matMax.y, extIndSig1.u) annotation (Line(points={{42,-150},{52,-150},
- {52,80},{58,80}},
+ connect(matMax.y, extIndSig1.u) annotation (Line(points={{42,-150},{52,-150},{
+ 52,80},{58,80}},
color={0,0,127}));
connect(conInt.y,subInt. u2) annotation (Line(points={{-98,70},{-72,70},{-72,
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/Validation/MinimumFlowSetPoint.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/Validation/MinimumFlowSetPoint.mo
index b1e81266798..f3966daa1ab 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/Validation/MinimumFlowSetPoint.mo
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/Validation/MinimumFlowSetPoint.mo
@@ -54,7 +54,9 @@ protected
annotation (Placement(transformation(extent={{-90,90},{-70,110}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor extIndSig(
- final nin=3)
+ final allowOutOfRange=true,
+ final nin=3,
+ final outOfRangeValue=0)
"Extract scalar out of vector"
annotation (Placement(transformation(extent={{-60,90},{-40,110}})));
@@ -91,7 +93,9 @@ protected
annotation (Placement(transformation(extent={{-90,-30},{-70,-10}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor extIndSig1(
- final nin=3)
+ final allowOutOfRange=true,
+ final nin=3,
+ final outOfRangeValue=0)
"Extract scalar out of vector"
annotation (Placement(transformation(extent={{-60,-30},{-40,-10}})));
@@ -117,7 +121,9 @@ protected
annotation (Placement(transformation(extent={{-90,-60},{-70,-40}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor extIndSig2(
- final nin=3)
+ final allowOutOfRange=true,
+ final nin=3,
+ final outOfRangeValue=0)
"Extract scalar out of vector"
annotation (Placement(transformation(extent={{-60,-60},{-40,-40}})));
From 8b8109d477d1a86c1c516da8039c162acfaba817 Mon Sep 17 00:00:00 2001
From: Devaprasad
Date: Mon, 3 Apr 2023 19:57:42 -0700
Subject: [PATCH 04/20] Added new class and modified existing class to fix zero
index error on real extractor
---
.../SetPoints/Subsequences/Capacities.mo | 88 ++++++++----
.../Validation/ZeroStageIndexCorrection.mo | 84 +++++++++++
.../Subsequences/Validation/package.order | 1 +
.../Subsequences/ZeroStageIndexCorrection.mo | 134 ++++++++++++++++++
.../SetPoints/Subsequences/package.order | 1 +
.../Validation/ZeroStageIndexCorrection.mos | 8 ++
6 files changed, 292 insertions(+), 24 deletions(-)
create mode 100644 Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/ZeroStageIndexCorrection.mo
create mode 100644 Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/ZeroStageIndexCorrection.mo
create mode 100644 Buildings/Resources/Scripts/Dymola/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/ZeroStageIndexCorrection.mos
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Capacities.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Capacities.mo
index 090ff09856b..e93073cb958 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Capacities.mo
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Capacities.mo
@@ -89,6 +89,26 @@ protected
final parameter Real larGai = 10
"Large gain";
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroStageIndexCorrection zerStaIndCor
+ "Modify real extractor inputs and outputs"
+ annotation (Placement(transformation(extent={{-120,110},{-100,130}})));
+
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroStageIndexCorrection zerStaIndCor1
+ "Modify real extractor inputs and outputs"
+ annotation (Placement(transformation(extent={{-20,40},{0,60}})));
+
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroStageIndexCorrection zerStaIndCor2
+ "Modify real extractor inputs and outputs"
+ annotation (Placement(transformation(extent={{-120,-10},{-100,10}})));
+
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroStageIndexCorrection zerStaIndCor3
+ "Modify real extractor inputs and outputs"
+ annotation (Placement(transformation(extent={{-40,-60},{-20,-40}})));
+
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroStageIndexCorrection zerStaIndCor4
+ "Modify real extractor inputs and outputs"
+ annotation (Placement(transformation(extent={{-40,-100},{-20,-80}})));
+
Buildings.Controls.OBC.CDL.Routing.RealExtractor cap(
final nin=nSta)
"Extracts the design capacity at the current stage"
@@ -135,17 +155,9 @@ protected
equation
connect(swi2.y, yUpDes) annotation (Line(points={{182,60},{220,60}}, color={0,0,127}));
- connect(upCap.y, swi2.u3) annotation (
- Line(points={{22,80},{80,80},{80,52},{158,52}}, color={0,0,127}));
connect(yMin, yMin)
annotation (Line(points={{220,-20},{220,-20}}, color={0,0,127}));
- connect(upCapMin.y, swi4.u3) annotation (Line(points={{22,-30},{40,-30},{40,-98},
- {158,-98}}, color={0,0,127}));
connect(swi4.y, yUpMin) annotation (Line(points={{182,-90},{220,-90}}, color={0,0,127}));
- connect(capMin.y, yMin) annotation (Line(points={{22,-70},{80,-70},{80,-20},{220,
- -20}}, color={0,0,127}));
- connect(dowCap.y, swi1.u3) annotation (Line(points={{-78,80},{-40,80},{-40,12},
- {98,12}}, color={0,0,127}));
connect(uMinCap, upCapMin.u) annotation (Line(points={{-220,-180},{-120,-180},
{-120,-30},{-2,-30}}, color={0,0,127}));
connect(uMinCap, capMin.u) annotation (Line(points={{-220,-180},{-120,-180},{-120,
@@ -162,30 +174,58 @@ equation
{158,60}}, color={255,0,255}));
connect(uHig, swi4.u2) annotation (Line(points={{-220,-120},{140,-120},{140,-90},
{158,-90}}, color={255,0,255}));
- connect(cap.y, gai.u) annotation (Line(points={{-78,150},{-70,150},{-70,120},{
- -62,120}}, color={0,0,127}));
connect(gai.y, swi2.u1) annotation (Line(points={{-38,120},{100,120},{100,68},
{158,68}}, color={0,0,127}));
connect(gai.y, swi4.u1) annotation (Line(points={{-38,120},{60,120},{60,-82},{
158,-82}}, color={0,0,127}));
connect(swi1.y, yDowDes) annotation (Line(points={{122,20},{220,20}}, color={0,0,127}));
- connect(u, cap.index) annotation (Line(points={{-220,120},{-90,120},{-90,138}},
- color={255,127,0}));
- connect(uDown, dowCap.index) annotation (Line(points={{-220,0},{-90,0},{-90,68}},
- color={255,127,0}));
- connect(uUp, upCap.index) annotation (Line(points={{-220,60},{10,60},{10,68}},
- color={255,127,0}));
- connect(uUp, upCapMin.index) annotation (Line(points={{-220,60},{-60,60},{-60,
- -50},{10,-50},{10,-42}}, color={255,127,0}));
- connect(cap.y, yDes) annotation (Line(points={{-78,150},{220,150}},
- color={0,0,127}));
- connect(capMin.y, swi1.u1) annotation (Line(points={{22,-70},{80,-70},{80,28},
- {98,28}},color={0,0,127}));
- connect(u, capMin.index) annotation (Line(points={{-220,120},{-160,120},{-160,
- -90},{10,-90},{10,-82}}, color={255,127,0}));
connect(yUpMin, yUpMin)
annotation (Line(points={{220,-90},{220,-90}}, color={0,0,127}));
+ connect(u, zerStaIndCor.uInd) annotation (Line(points={{-220,120},{-160,120},{
+ -160,124},{-122,124}}, color={255,127,0}));
+ connect(zerStaIndCor.yIndMod, cap.index) annotation (Line(points={{-98,124},{-90,
+ 124},{-90,138}}, color={255,127,0}));
+ connect(cap.y, zerStaIndCor.uCap) annotation (Line(points={{-78,150},{-74,150},
+ {-74,172},{-130,172},{-130,116},{-122,116}}, color={0,0,127}));
+ connect(zerStaIndCor.yCapMod, gai.u) annotation (Line(points={{-98,116},{-70,116},
+ {-70,120},{-62,120}}, color={0,0,127}));
+ connect(zerStaIndCor.yCapMod, yDes) annotation (Line(points={{-98,116},{-70,116},
+ {-70,150},{220,150}}, color={0,0,127}));
+ connect(zerStaIndCor1.yIndMod, upCap.index)
+ annotation (Line(points={{2,54},{10,54},{10,68}}, color={255,127,0}));
+ connect(uUp, zerStaIndCor1.uInd) annotation (Line(points={{-220,60},{-60,60},{
+ -60,54},{-22,54}}, color={255,127,0}));
+ connect(upCap.y, zerStaIndCor1.uCap) annotation (Line(points={{22,80},{30,80},
+ {30,100},{-30,100},{-30,46},{-22,46}}, color={0,0,127}));
+ connect(zerStaIndCor1.yCapMod, swi2.u3) annotation (Line(points={{2,46},{20,46},
+ {20,52},{158,52}}, color={0,0,127}));
+ connect(uDown, zerStaIndCor2.uInd) annotation (Line(points={{-220,0},{-128,0},
+ {-128,4},{-122,4}}, color={255,127,0}));
+ connect(zerStaIndCor2.yIndMod, dowCap.index)
+ annotation (Line(points={{-98,4},{-90,4},{-90,68}}, color={255,127,0}));
+ connect(dowCap.y, zerStaIndCor2.uCap) annotation (Line(points={{-78,80},{-70,80},
+ {-70,100},{-132,100},{-132,-4},{-122,-4}}, color={0,0,127}));
+ connect(zerStaIndCor2.yCapMod, swi1.u3) annotation (Line(points={{-98,-4},{-80,
+ -4},{-80,12},{98,12}}, color={0,0,127}));
+ connect(uUp, zerStaIndCor3.uInd) annotation (Line(points={{-220,60},{-60,60},{
+ -60,-46},{-42,-46}}, color={255,127,0}));
+ connect(zerStaIndCor3.yIndMod, upCapMin.index) annotation (Line(points={{-18,-46},
+ {-10,-46},{-10,-50},{10,-50},{10,-42}}, color={255,127,0}));
+ connect(upCapMin.y, zerStaIndCor3.uCap) annotation (Line(points={{22,-30},{30,
+ -30},{30,-10},{-50,-10},{-50,-54},{-42,-54}}, color={0,0,127}));
+ connect(zerStaIndCor3.yCapMod, swi4.u3) annotation (Line(points={{-18,-54},{40,
+ -54},{40,-98},{158,-98}}, color={0,0,127}));
+ connect(u, zerStaIndCor4.uInd) annotation (Line(points={{-220,120},{-160,120},
+ {-160,-86},{-42,-86}}, color={255,127,0}));
+ connect(zerStaIndCor4.yIndMod, capMin.index)
+ annotation (Line(points={{-18,-86},{10,-86},{10,-82}}, color={255,127,0}));
+ connect(zerStaIndCor4.yCapMod, swi1.u1) annotation (Line(points={{-18,-94},{70,
+ -94},{70,28},{98,28}}, color={0,0,127}));
+ connect(zerStaIndCor4.yCapMod, yMin) annotation (Line(points={{-18,-94},{70,-94},
+ {70,-20},{220,-20}}, color={0,0,127}));
+ connect(capMin.y, zerStaIndCor4.uCap) annotation (Line(points={{22,-70},{30,-70},
+ {30,-110},{-50,-110},{-50,-94},{-42,-94}}, color={0,0,127}));
annotation (defaultComponentName = "cap",
Icon(graphics={
Rectangle(
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/ZeroStageIndexCorrection.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/ZeroStageIndexCorrection.mo
new file mode 100644
index 00000000000..b1c0684a949
--- /dev/null
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/ZeroStageIndexCorrection.mo
@@ -0,0 +1,84 @@
+within Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.Validation;
+model ZeroStageIndexCorrection
+ "Validation model for zero stage index correction block"
+
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroStageIndexCorrection
+ zerStaIndCor
+ "Validation instance with zero index signal"
+ annotation (Placement(transformation(extent={{-40,-10},{-20,10}})));
+
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroStageIndexCorrection
+ zerStaIndCor1
+ "Validation instance with index signal one"
+ annotation (Placement(transformation(extent={{60,-10},{80,10}})));
+
+protected
+ Buildings.Controls.OBC.CDL.Continuous.Sources.Constant conCap(
+ final k=10)
+ "Constant capacity value"
+ annotation (Placement(transformation(extent={{-80,-50},{-60,-30}})));
+
+ Buildings.Controls.OBC.CDL.Integers.Sources.Constant conIntZer(
+ final k=0)
+ "Zero integer signal"
+ annotation (Placement(transformation(extent={{-80,30},{-60,50}})));
+
+ Buildings.Controls.OBC.CDL.Integers.Sources.Constant conIntOne(
+ final k=1)
+ "Constant integer one signal"
+ annotation (Placement(transformation(extent={{20,30},{40,50}})));
+
+equation
+
+ connect(conCap.y, zerStaIndCor.uCap) annotation (Line(points={{-58,-40},{-50,-40},
+ {-50,-4},{-42,-4}}, color={0,0,127}));
+ connect(conCap.y, zerStaIndCor1.uCap) annotation (Line(points={{-58,-40},{50,-40},
+ {50,-4},{58,-4}}, color={0,0,127}));
+ connect(conIntZer.y, zerStaIndCor.uInd) annotation (Line(points={{-58,40},{-50,
+ 40},{-50,4},{-42,4}}, color={255,127,0}));
+ connect(conIntOne.y, zerStaIndCor1.uInd) annotation (Line(points={{42,40},{50,
+ 40},{50,4},{58,4}}, color={255,127,0}));
+annotation (
+ __Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/Up.mos"
+ "Simulate and plot"),
+ Documentation(info="
+
+ This example validates
+
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroStageIndexCorrection.
+
+
+ It contains two instances:
+
+ -
+ zerStaIndCor: Gets a zero index input signal.
+
+ -
+ zerStaIndCor1: Gets a non-zero index input signal.
+
+
+ The model simulates and plots these two instances to demonstrate that the block
+ is performing the modifications correctly.
+
+ ", revisions="
+
Date: Tue, 4 Apr 2023 03:20:17 +0000
Subject: [PATCH 05/20] Updated class name for zero index correction
---
.../Staging/SetPoints/Subsequences/Capacities.mo | 10 +++++-----
...tageIndexCorrection.mo => ZeroIndexCorrection.mo} | 12 ++++++------
.../SetPoints/Subsequences/Validation/package.order | 2 +-
...tageIndexCorrection.mo => ZeroIndexCorrection.mo} | 4 ++--
.../Staging/SetPoints/Subsequences/package.order | 2 +-
Buildings/Controls/OBC/ASHRAE/package.order | 2 +-
...geIndexCorrection.mos => ZeroIndexCorrection.mos} | 2 +-
7 files changed, 17 insertions(+), 17 deletions(-)
rename Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/{ZeroStageIndexCorrection.mo => ZeroIndexCorrection.mo} (91%)
rename Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/{ZeroStageIndexCorrection.mo => ZeroIndexCorrection.mo} (98%)
rename Buildings/Resources/Scripts/Dymola/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/{ZeroStageIndexCorrection.mos => ZeroIndexCorrection.mos} (86%)
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Capacities.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Capacities.mo
index e93073cb958..cb71cb28ccf 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Capacities.mo
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Capacities.mo
@@ -89,23 +89,23 @@ protected
final parameter Real larGai = 10
"Large gain";
- Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroStageIndexCorrection zerStaIndCor
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroIndexCorrection zerStaIndCor
"Modify real extractor inputs and outputs"
annotation (Placement(transformation(extent={{-120,110},{-100,130}})));
- Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroStageIndexCorrection zerStaIndCor1
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroIndexCorrection zerStaIndCor1
"Modify real extractor inputs and outputs"
annotation (Placement(transformation(extent={{-20,40},{0,60}})));
- Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroStageIndexCorrection zerStaIndCor2
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroIndexCorrection zerStaIndCor2
"Modify real extractor inputs and outputs"
annotation (Placement(transformation(extent={{-120,-10},{-100,10}})));
- Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroStageIndexCorrection zerStaIndCor3
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroIndexCorrection zerStaIndCor3
"Modify real extractor inputs and outputs"
annotation (Placement(transformation(extent={{-40,-60},{-20,-40}})));
- Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroStageIndexCorrection zerStaIndCor4
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroIndexCorrection zerStaIndCor4
"Modify real extractor inputs and outputs"
annotation (Placement(transformation(extent={{-40,-100},{-20,-80}})));
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/ZeroStageIndexCorrection.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/ZeroIndexCorrection.mo
similarity index 91%
rename from Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/ZeroStageIndexCorrection.mo
rename to Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/ZeroIndexCorrection.mo
index b1c0684a949..1a95dea8648 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/ZeroStageIndexCorrection.mo
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/ZeroIndexCorrection.mo
@@ -1,13 +1,13 @@
within Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.Validation;
-model ZeroStageIndexCorrection
+model ZeroIndexCorrection
"Validation model for zero stage index correction block"
- Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroStageIndexCorrection
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroIndexCorrection
zerStaIndCor
"Validation instance with zero index signal"
annotation (Placement(transformation(extent={{-40,-10},{-20,10}})));
- Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroStageIndexCorrection
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroIndexCorrection
zerStaIndCor1
"Validation instance with index signal one"
annotation (Placement(transformation(extent={{60,-10},{80,10}})));
@@ -44,8 +44,8 @@ annotation (
Documentation(info="
This example validates
-
- Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroStageIndexCorrection.
+
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroIndexCorrection.
It contains two instances:
@@ -81,4 +81,4 @@ annotation (
points = {{-36,60},{64,0},{-36,-60},{-36,60}})}),
Diagram(coordinateSystem(preserveAspectRatio=false,
extent={{-100,-100},{100,100}})));
-end ZeroStageIndexCorrection;
+end ZeroIndexCorrection;
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/package.order b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/package.order
index da53e4f6340..c8f1ed9e93e 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/package.order
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/package.order
@@ -8,4 +8,4 @@ EfficiencyCondition
FailsafeCondition
Status
Up
-ZeroStageIndexCorrection
+ZeroIndexCorrection
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/ZeroStageIndexCorrection.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/ZeroIndexCorrection.mo
similarity index 98%
rename from Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/ZeroStageIndexCorrection.mo
rename to Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/ZeroIndexCorrection.mo
index 0a98d501895..3cc6a4af5cd 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/ZeroStageIndexCorrection.mo
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/ZeroIndexCorrection.mo
@@ -1,5 +1,5 @@
within Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences;
-block ZeroStageIndexCorrection
+block ZeroIndexCorrection
"Block to pass the correct capacity details when index signal is zero, while avoiding assert errors"
Buildings.Controls.OBC.CDL.Interfaces.IntegerInput uInd
@@ -131,4 +131,4 @@ equation
"));
-end ZeroStageIndexCorrection;
+end ZeroIndexCorrection;
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/package.order b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/package.order
index 6b048a66b4e..825e9992adc 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/package.order
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/package.order
@@ -8,5 +8,5 @@ EfficiencyCondition
FailsafeCondition
Status
Up
+ZeroIndexCorrection
Validation
-ZeroStageIndexCorrection
diff --git a/Buildings/Controls/OBC/ASHRAE/package.order b/Buildings/Controls/OBC/ASHRAE/package.order
index a20c96ab04e..4d8c195216a 100644
--- a/Buildings/Controls/OBC/ASHRAE/package.order
+++ b/Buildings/Controls/OBC/ASHRAE/package.order
@@ -1,2 +1,2 @@
G36
-PrimarySystem
\ No newline at end of file
+PrimarySystem
diff --git a/Buildings/Resources/Scripts/Dymola/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/ZeroStageIndexCorrection.mos b/Buildings/Resources/Scripts/Dymola/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/ZeroIndexCorrection.mos
similarity index 86%
rename from Buildings/Resources/Scripts/Dymola/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/ZeroStageIndexCorrection.mos
rename to Buildings/Resources/Scripts/Dymola/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/ZeroIndexCorrection.mos
index d19f5bf7472..08be92554cd 100644
--- a/Buildings/Resources/Scripts/Dymola/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/ZeroStageIndexCorrection.mos
+++ b/Buildings/Resources/Scripts/Dymola/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/ZeroIndexCorrection.mos
@@ -1,4 +1,4 @@
-simulateModel("Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.Validation.ZeroStageIndexCorrection", method="cvode", stopTime=10, tolerance=1e-06, resultFile="ZeroStageIndexCorrection");
+simulateModel("Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.Validation.ZeroIndexCorrection", method="cvode", stopTime=10, tolerance=1e-06, resultFile="ZeroIndexCorrection");
createPlot(id=1, position={95, 95, 534, 336}, y={"zerStaIndCor.uInd"}, range={0.0, 10.0, -1.5, 1.5}, grid=true, colors={{28,108,200}});
createPlot(id=1, position={95, 95, 534, 108}, y={"zerStaIndCor.yIndMod"}, range={0.0, 10.0, 0.8500000000000001, 1.1500000000000001}, grid=true, subPlot=2, colors={{28,108,200}});
From a936cfdad7a2063e8eb5d426172835be0c53fa6a Mon Sep 17 00:00:00 2001
From: root
Date: Tue, 4 Apr 2023 03:32:13 +0000
Subject: [PATCH 06/20] Moved zero index correction to the generic package
---
.../Validation/ZeroIndexCorrection.mo | 10 +++++-----
.../BoilerPlant/Generic/Validation/package.order | 1 +
.../Subsequences => Generic}/ZeroIndexCorrection.mo | 2 +-
.../PrimarySystem/BoilerPlant/Generic/package.order | 1 +
.../Staging/SetPoints/Subsequences/Capacities.mo | 10 +++++-----
.../SetPoints/Subsequences/Validation/package.order | 1 -
.../Staging/SetPoints/Subsequences/package.order | 1 -
.../Validation/ZeroIndexCorrection.mos | 2 +-
8 files changed, 14 insertions(+), 14 deletions(-)
rename Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/{Staging/SetPoints/Subsequences => Generic}/Validation/ZeroIndexCorrection.mo (85%)
rename Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/{Staging/SetPoints/Subsequences => Generic}/ZeroIndexCorrection.mo (98%)
rename Buildings/Resources/Scripts/Dymola/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/{Staging/SetPoints/Subsequences => Generic}/Validation/ZeroIndexCorrection.mos (87%)
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/ZeroIndexCorrection.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/Validation/ZeroIndexCorrection.mo
similarity index 85%
rename from Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/ZeroIndexCorrection.mo
rename to Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/Validation/ZeroIndexCorrection.mo
index 1a95dea8648..fa06e87d28c 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/ZeroIndexCorrection.mo
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/Validation/ZeroIndexCorrection.mo
@@ -1,13 +1,13 @@
-within Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.Validation;
+within Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.Validation;
model ZeroIndexCorrection
"Validation model for zero stage index correction block"
- Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroIndexCorrection
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection
zerStaIndCor
"Validation instance with zero index signal"
annotation (Placement(transformation(extent={{-40,-10},{-20,10}})));
- Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroIndexCorrection
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection
zerStaIndCor1
"Validation instance with index signal one"
annotation (Placement(transformation(extent={{60,-10},{80,10}})));
@@ -44,8 +44,8 @@ annotation (
Documentation(info="
This example validates
-
- Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroIndexCorrection.
+
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection.
It contains two instances:
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/Validation/package.order b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/Validation/package.order
index cbfd9cb3843..0c367abad16 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/Validation/package.order
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/Validation/package.order
@@ -1,3 +1,4 @@
PlantDisable
PlantEnable
RotationController
+ZeroIndexCorrection
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/ZeroIndexCorrection.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/ZeroIndexCorrection.mo
similarity index 98%
rename from Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/ZeroIndexCorrection.mo
rename to Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/ZeroIndexCorrection.mo
index 3cc6a4af5cd..ae079343d57 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/ZeroIndexCorrection.mo
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/ZeroIndexCorrection.mo
@@ -1,4 +1,4 @@
-within Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences;
+within Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic;
block ZeroIndexCorrection
"Block to pass the correct capacity details when index signal is zero, while avoiding assert errors"
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/package.order b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/package.order
index a2175baf07d..1593843a624 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/package.order
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/package.order
@@ -1,6 +1,7 @@
PlantDisable
PlantEnable
RotationController
+ZeroIndexCorrection
EquipmentRotation
Subsequences
Validation
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Capacities.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Capacities.mo
index cb71cb28ccf..b62d96dadd4 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Capacities.mo
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Capacities.mo
@@ -89,23 +89,23 @@ protected
final parameter Real larGai = 10
"Large gain";
- Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroIndexCorrection zerStaIndCor
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection zerStaIndCor
"Modify real extractor inputs and outputs"
annotation (Placement(transformation(extent={{-120,110},{-100,130}})));
- Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroIndexCorrection zerStaIndCor1
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection zerStaIndCor1
"Modify real extractor inputs and outputs"
annotation (Placement(transformation(extent={{-20,40},{0,60}})));
- Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroIndexCorrection zerStaIndCor2
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection zerStaIndCor2
"Modify real extractor inputs and outputs"
annotation (Placement(transformation(extent={{-120,-10},{-100,10}})));
- Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroIndexCorrection zerStaIndCor3
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection zerStaIndCor3
"Modify real extractor inputs and outputs"
annotation (Placement(transformation(extent={{-40,-60},{-20,-40}})));
- Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.ZeroIndexCorrection zerStaIndCor4
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection zerStaIndCor4
"Modify real extractor inputs and outputs"
annotation (Placement(transformation(extent={{-40,-100},{-20,-80}})));
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/package.order b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/package.order
index c8f1ed9e93e..369181c67db 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/package.order
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/package.order
@@ -8,4 +8,3 @@ EfficiencyCondition
FailsafeCondition
Status
Up
-ZeroIndexCorrection
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/package.order b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/package.order
index 825e9992adc..d1db2c14227 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/package.order
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/package.order
@@ -8,5 +8,4 @@ EfficiencyCondition
FailsafeCondition
Status
Up
-ZeroIndexCorrection
Validation
diff --git a/Buildings/Resources/Scripts/Dymola/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/ZeroIndexCorrection.mos b/Buildings/Resources/Scripts/Dymola/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/Validation/ZeroIndexCorrection.mos
similarity index 87%
rename from Buildings/Resources/Scripts/Dymola/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/ZeroIndexCorrection.mos
rename to Buildings/Resources/Scripts/Dymola/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/Validation/ZeroIndexCorrection.mos
index 08be92554cd..b91d361fb33 100644
--- a/Buildings/Resources/Scripts/Dymola/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Validation/ZeroIndexCorrection.mos
+++ b/Buildings/Resources/Scripts/Dymola/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/Validation/ZeroIndexCorrection.mos
@@ -1,4 +1,4 @@
-simulateModel("Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Staging.SetPoints.Subsequences.Validation.ZeroIndexCorrection", method="cvode", stopTime=10, tolerance=1e-06, resultFile="ZeroIndexCorrection");
+simulateModel("Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.Validation.ZeroIndexCorrection", method="cvode", stopTime=10, tolerance=1e-06, resultFile="ZeroIndexCorrection");
createPlot(id=1, position={95, 95, 534, 336}, y={"zerStaIndCor.uInd"}, range={0.0, 10.0, -1.5, 1.5}, grid=true, colors={{28,108,200}});
createPlot(id=1, position={95, 95, 534, 108}, y={"zerStaIndCor.yIndMod"}, range={0.0, 10.0, 0.8500000000000001, 1.1500000000000001}, grid=true, subPlot=2, colors={{28,108,200}});
From b91833cf8e7ce9415652416aae4c5dd2b3088e98 Mon Sep 17 00:00:00 2001
From: Devaprasad
Date: Mon, 3 Apr 2023 22:11:01 -0700
Subject: [PATCH 07/20] Updated models to resolve errors logged during unit
test
---
.../Pumps/SecondaryPumps/Controller.mo | 54 +++++----
.../SetPoints/MinimumFlowSetPoint.mo | 99 ++++++++++-------
.../Validation/MinimumFlowSetPoint.mo | 104 ++++++++++--------
.../Staging/SetPoints/Subsequences/Down.mo | 72 +++++++-----
.../Subsequences/EfficiencyCondition.mo | 23 +++-
5 files changed, 213 insertions(+), 139 deletions(-)
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Pumps/SecondaryPumps/Controller.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Pumps/SecondaryPumps/Controller.mo
index 5261b8728dc..b1940abba29 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Pumps/SecondaryPumps/Controller.mo
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Pumps/SecondaryPumps/Controller.mo
@@ -337,6 +337,16 @@ protected
parameter Integer pumInd[nPum]={i for i in 1:nPum}
"Pump index, {1,2,...,n}";
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection
+ zerStaIndCor
+ "Block to resolve zero index errors"
+ annotation (Placement(transformation(extent={{-102,-84},{-82,-64}})));
+
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection
+ zerStaIndCor1
+ "Block to resolve zero index errors"
+ annotation (Placement(transformation(extent={{-114,-134},{-94,-114}})));
+
Buildings.Controls.OBC.CDL.Discrete.UnitDelay uniDel(
final samplePeriod=1) if have_varSecPum and not have_secFloSen
"Unit delay for pump speed"
@@ -382,9 +392,7 @@ protected
annotation (Placement(transformation(extent={{-40,220},{-20,240}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor nexLagPum(
- final allowOutOfRange=true,
- final nin=nPum,
- final outOfRangeValue=0)
+ final nin=nPum)
"Next lag pump"
annotation (Placement(transformation(extent={{-80,-60},{-60,-40}})));
@@ -393,9 +401,7 @@ protected
annotation (Placement(transformation(extent={{-8,-60},{12,-40}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor lasLagPum(
- final allowOutOfRange=true,
- final nin=nPum,
- final outOfRangeValue=0)
+ final nin=nPum)
"Last lag pump"
annotation (Placement(transformation(extent={{-80,-110},{-60,-90}})));
@@ -414,7 +420,7 @@ protected
Buildings.Controls.OBC.CDL.Integers.Add addInt
"Integer add"
- annotation (Placement(transformation(extent={{-120,-80},{-100,-60}})));
+ annotation (Placement(transformation(extent={{-132,-80},{-112,-60}})));
Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt1[nPumPri] if not have_varSecPum
"Convert boolean to integer"
@@ -562,20 +568,14 @@ equation
connect(booToInt.y, mulSumInt.u)
annotation (Line(points={{-228,-120},{-202,-120}}, color={255,127,0}));
- connect(addInt.y, nexLagPum.index)
- annotation (Line(points={{-98,-70},{-70,-70},{-70,-62}}, color={255,127,0}));
-
connect(mulSumInt.y, addInt.u2)
- annotation (Line(points={{-178,-120},{-128,-120},{-128,-76},{-122,-76}},
+ annotation (Line(points={{-178,-120},{-166,-120},{-166,-76},{-134,-76}},
color={255,127,0}));
connect(conInt.y, addInt.u1)
- annotation (Line(points={{-252,200},{-140,200},{-140,-64},{-122,-64}},
+ annotation (Line(points={{-252,200},{-140,200},{-140,-64},{-134,-64}},
color={255,127,0}));
- connect(mulSumInt.y, lasLagPum.index)
- annotation (Line(points={{-178,-120},{-70,-120},{-70,-112}}, color={255,127,0}));
-
connect(reaToInt.y, chaPumSta1.uNexLagPum) annotation (Line(points={{-18,230},
{46,230},{46,74},{56,74}}, color={255,127,0}));
@@ -663,12 +663,6 @@ equation
connect(or2.y, chaPumSta3.uLasLagPumSta) annotation (Line(points={{56,-218},{58,
-218},{58,-167},{60,-167}}, color={255,0,255}));
- connect(nexLagPum.y, reaToInt1.u)
- annotation (Line(points={{-58,-50},{-10,-50}}, color={0,0,127}));
-
- connect(lasLagPum.y, reaToInt2.u)
- annotation (Line(points={{-58,-100},{-10,-100}}, color={0,0,127}));
-
connect(mulSumInt.y, intLesEquThr.u) annotation (Line(points={{-178,-120},{-166,
-120},{-166,-218},{-160,-218}}, color={255,127,0}));
@@ -736,9 +730,25 @@ equation
connect(logSwi.y, pumSpeRemDp.uHotWatPum) annotation (Line(points={{214,0},{274,
0},{274,-264},{-74,-264},{-74,-362},{-62,-362}}, color={255,0,255}));
connect(booToInt1.y, mulSumInt1.u[1:2]) annotation (Line(points={{-228,-156},{
- -216,-156},{-216,-159.5},{-202,-159.5}}, color={255,127,0}));
+ -216,-156},{-216,-156},{-202,-156}}, color={255,127,0}));
connect(min.y, yPumSpe)
annotation (Line(points={{182,-400},{300,-400}}, color={0,0,127}));
+ connect(addInt.y, zerStaIndCor.uInd)
+ annotation (Line(points={{-110,-70},{-104,-70}}, color={255,127,0}));
+ connect(zerStaIndCor.yIndMod, nexLagPum.index) annotation (Line(points={{-80,-70},
+ {-70,-70},{-70,-62}}, color={255,127,0}));
+ connect(zerStaIndCor.yCapMod, reaToInt1.u) annotation (Line(points={{-80,-78},
+ {-46,-78},{-46,-50},{-10,-50}}, color={0,0,127}));
+ connect(nexLagPum.y, zerStaIndCor.uCap) annotation (Line(points={{-58,-50},{-52,
+ -50},{-52,-32},{-108,-32},{-108,-78},{-104,-78}}, color={0,0,127}));
+ connect(mulSumInt.y, zerStaIndCor1.uInd)
+ annotation (Line(points={{-178,-120},{-116,-120}}, color={255,127,0}));
+ connect(zerStaIndCor1.yIndMod, lasLagPum.index) annotation (Line(points={{-92,
+ -120},{-70,-120},{-70,-112}}, color={255,127,0}));
+ connect(zerStaIndCor1.yCapMod, reaToInt2.u) annotation (Line(points={{-92,-128},
+ {-44,-128},{-44,-100},{-10,-100}}, color={0,0,127}));
+ connect(lasLagPum.y, zerStaIndCor1.uCap) annotation (Line(points={{-58,-100},{
+ -50,-100},{-50,-86},{-122,-86},{-122,-128},{-116,-128}}, color={0,0,127}));
annotation (defaultComponentName="secPumCon",
Diagram(coordinateSystem(preserveAspectRatio=false,
extent={{-280,-440},{280,260}}),
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/MinimumFlowSetPoint.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/MinimumFlowSetPoint.mo
index 3e3d1c94743..1f48b7b1bca 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/MinimumFlowSetPoint.mo
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/MinimumFlowSetPoint.mo
@@ -76,6 +76,22 @@ protected
"Boiler maximum design flowrate expanded for element-wise multiplication
with the staging matrix";
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection zerStaIndCor
+ "Block to resolve errors caused by zero index"
+ annotation (Placement(transformation(extent={{-80,20},{-60,40}})));
+
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection zerStaIndCor1
+ "Block to resolve errors caused by zero index"
+ annotation (Placement(transformation(extent={{-110,-288},{-90,-268}})));
+
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection zerStaIndCor2
+ "Block to resolve errors caused by zero index"
+ annotation (Placement(transformation(extent={{-40,-310},{-20,-290}})));
+
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection zerStaIndCor3
+ "Block to resolve errors caused by zero index"
+ annotation (Placement(transformation(extent={{-8,70},{12,90}})));
+
Buildings.Controls.OBC.CDL.Continuous.IntegratorWithReset intWitRes
"Used to break algebraic loop and sample the minimum flow setpoint at the start
of stage change process to use as reference for calculations"
@@ -175,9 +191,7 @@ protected
annotation (Placement(transformation(extent={{60,-60},{80,-40}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor extIndSig1(
- final allowOutOfRange=true,
- final nin=nSta,
- final outOfRangeValue=1e-6)
+ final nin=nSta)
"Extract flow ratio of previous setpoint during stage-up"
annotation (Placement(transformation(extent={{60,70},{80,90}})));
@@ -204,11 +218,9 @@ protected
annotation (Placement(transformation(extent={{60,30},{80,50}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor extIndSig3(
- final allowOutOfRange=true,
- final nin=nBoi,
- final outOfRangeValue=1e-6)
+ final nin=nBoi)
"Extract max flowrate of boiler being disabled during stage-up"
- annotation (Placement(transformation(extent={{-20,40},{0,60}})));
+ annotation (Placement(transformation(extent={{-12,40},{8,60}})));
Buildings.Controls.OBC.CDL.Continuous.Switch swi
"Pass minimum flow setpoint based on whether stage-up involves a boiler being disabled"
@@ -245,12 +257,10 @@ protected
Buildings.Controls.OBC.CDL.Integers.Add addInt1
"Previous stage during stage change"
- annotation (Placement(transformation(extent={{-90,-310},{-70,-290}})));
+ annotation (Placement(transformation(extent={{-80,-310},{-60,-290}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor extIndSig4(
- final allowOutOfRange=true,
- final nin=nSta,
- final outOfRangeValue=1e-6)
+ final nin=nSta)
"Extract flow ratio of previous setpoint during stage-down"
annotation (Placement(transformation(extent={{60,-280},{80,-260}})));
@@ -259,9 +269,7 @@ protected
annotation (Placement(transformation(extent={{100,-260},{120,-240}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor extIndSig5(
- final allowOutOfRange=true,
- final nin=nBoi,
- final outOfRangeValue=1e-6)
+ final nin=nBoi)
"Extract max flowrate of boiler being disabled during stage-down"
annotation (Placement(transformation(extent={{-40,-270},{-20,-250}})));
@@ -381,9 +389,6 @@ equation
-128,100},{-72,100},{-72,86},{-62,86}},
color={255,127,0}));
- connect(subInt.y, extIndSig1.index) annotation (Line(points={{-38,80},{40,80},
- {40,60},{70,60},{70,68}},color={255,127,0}));
-
connect(matGai.y, extIndSig2.u)
annotation (Line(points={{-18,-220},{-2,-220}},
color={0,0,127}));
@@ -392,7 +397,7 @@ equation
{-128,-240},{10,-240},{10,-232}}, color={255,127,0}));
connect(con3.y, extIndSig3.u) annotation (Line(points={{-58,-220},{-54,-220},{
- -54,50},{-22,50}}, color={0,0,127}));
+ -54,50},{-14,50}}, color={0,0,127}));
connect(max.y, pro2.u1) annotation (Line(points={{122,100},{130,100},{130,76},
{138,76}}, color={0,0,127}));
@@ -445,36 +450,21 @@ equation
connect(pro3.y, swi2.u3) annotation (Line(points={{114,-90},{120,-90},{120,-158},
{138,-158}}, color={0,0,127}));
- connect(extIndSig3.y, add2.u1) annotation (Line(points={{2,50},{40,50},{40,46},
- {58,46}}, color={0,0,127}));
-
connect(extIndSig2.y, add2.u2) annotation (Line(points={{22,-220},{46,-220},{46,
34},{58,34}}, color={0,0,127}));
- connect(uLasDisBoi, extIndSig3.index)
- annotation (Line(points={{-160,30},{-10,30},{-10,38}}, color={255,127,0}));
-
connect(extIndSig.y, max.u2) annotation (Line(points={{82,-50},{88,-50},{88,94},
{98,94}}, color={0,0,127}));
- connect(extIndSig1.y, max.u1) annotation (Line(points={{82,80},{84,80},{84,106},
- {98,106}}, color={0,0,127}));
-
connect(conInt1.y, addInt1.u2) annotation (Line(points={{-108,-320},{-100,-320},
- {-100,-306},{-92,-306}}, color={255,127,0}));
+ {-100,-306},{-82,-306}}, color={255,127,0}));
connect(uStaSet, addInt1.u1) annotation (Line(points={{-160,-90},{-128,-90},{-128,
- -294},{-92,-294}}, color={255,127,0}));
+ -294},{-82,-294}}, color={255,127,0}));
connect(matMax.y, extIndSig4.u) annotation (Line(points={{42,-150},{52,-150},{
52,-270},{58,-270}}, color={0,0,127}));
- connect(addInt1.y, extIndSig4.index) annotation (Line(points={{-68,-300},{70,-300},
- {70,-282}}, color={255,127,0}));
-
- connect(extIndSig4.y, max1.u2) annotation (Line(points={{82,-270},{88,-270},{88,
- -256},{98,-256}}, color={0,0,127}));
-
connect(extIndSig.y, max1.u1) annotation (Line(points={{82,-50},{88,-50},{88,-244},
{98,-244}}, color={0,0,127}));
@@ -484,9 +474,6 @@ equation
connect(extIndSig2.y, add1.u1) annotation (Line(points={{22,-220},{46,-220},{46,
-294},{98,-294}}, color={0,0,127}));
- connect(extIndSig5.y, add1.u2) annotation (Line(points={{-18,-260},{0,-260},{0,
- -306},{98,-306}}, color={0,0,127}));
-
connect(max1.y, pro4.u1) annotation (Line(points={{122,-250},{130,-250},{130,-264},
{138,-264}}, color={0,0,127}));
@@ -496,9 +483,6 @@ equation
connect(pro4.y, swi2.u1) annotation (Line(points={{162,-270},{166,-270},{166,-170},
{132,-170},{132,-142},{138,-142}}, color={0,0,127}));
- connect(uLasDisBoi, extIndSig5.index) annotation (Line(points={{-160,30},{-134,
- 30},{-134,-280},{-30,-280},{-30,-272}}, color={255,127,0}));
-
connect(swi.y, lin.f2) annotation (Line(points={{162,10},{166,10},{166,-8},{258,
-8}}, color={0,0,127}));
connect(swi2.y, lin1.f2) annotation (Line(points={{162,-150},{254,-150},{254,-148},
@@ -563,6 +547,39 @@ equation
172,-136},{258,-136}}, color={0,0,127}));
connect(intWitRes.y, sub3.u2) annotation (Line(points={{162,-100},{172,-100},{
172,-136},{220,-136},{220,-206},{228,-206}}, color={0,0,127}));
+ connect(uLasDisBoi, zerStaIndCor.uInd) annotation (Line(points={{-160,30},{-86,
+ 30},{-86,34},{-82,34}}, color={255,127,0}));
+ connect(zerStaIndCor.yIndMod, extIndSig3.index)
+ annotation (Line(points={{-58,34},{-2,34},{-2,38}}, color={255,127,0}));
+ connect(zerStaIndCor.yCapMod, add2.u1) annotation (Line(points={{-58,26},{38,26},
+ {38,46},{58,46}}, color={0,0,127}));
+ connect(extIndSig3.y, zerStaIndCor.uCap) annotation (Line(points={{10,50},{20,
+ 50},{20,66},{-90,66},{-90,26},{-82,26}}, color={0,0,127}));
+ connect(uLasDisBoi, zerStaIndCor1.uInd) annotation (Line(points={{-160,30},{-132,
+ 30},{-132,-274},{-112,-274}}, color={255,127,0}));
+ connect(zerStaIndCor1.yIndMod, extIndSig5.index) annotation (Line(points={{-88,
+ -274},{-30,-274},{-30,-272}}, color={255,127,0}));
+ connect(zerStaIndCor1.yCapMod, add1.u2) annotation (Line(points={{-88,-282},{0,
+ -282},{0,-306},{98,-306}}, color={0,0,127}));
+ connect(extIndSig5.y, zerStaIndCor1.uCap) annotation (Line(points={{-18,-260},
+ {-10,-260},{-10,-244},{-120,-244},{-120,-282},{-112,-282}}, color={0,0,
+ 127}));
+ connect(addInt1.y, zerStaIndCor2.uInd) annotation (Line(points={{-58,-300},{-50,
+ -300},{-50,-296},{-42,-296}}, color={255,127,0}));
+ connect(zerStaIndCor2.yIndMod, extIndSig4.index) annotation (Line(points={{-18,
+ -296},{70,-296},{70,-282}}, color={255,127,0}));
+ connect(zerStaIndCor2.yCapMod, max1.u2) annotation (Line(points={{-18,-304},{90,
+ -304},{90,-256},{98,-256}}, color={0,0,127}));
+ connect(extIndSig4.y, zerStaIndCor2.uCap) annotation (Line(points={{82,-270},{
+ 86,-270},{86,-320},{-50,-320},{-50,-304},{-42,-304}}, color={0,0,127}));
+ connect(subInt.y, zerStaIndCor3.uInd) annotation (Line(points={{-38,80},{-20,80},
+ {-20,84},{-10,84}}, color={255,127,0}));
+ connect(zerStaIndCor3.yIndMod, extIndSig1.index) annotation (Line(points={{14,
+ 84},{30,84},{30,60},{70,60},{70,68}}, color={255,127,0}));
+ connect(zerStaIndCor3.yCapMod, max.u1) annotation (Line(points={{14,76},{20,76},
+ {20,106},{98,106}}, color={0,0,127}));
+ connect(extIndSig1.y, zerStaIndCor3.uCap) annotation (Line(points={{82,80},{84,
+ 80},{84,100},{-14,100},{-14,76},{-10,76}}, color={0,0,127}));
annotation (
defaultComponentName="minBoiFloSet",
Icon(coordinateSystem(extent={{-100,-100},{100,100}}),
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/Validation/MinimumFlowSetPoint.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/Validation/MinimumFlowSetPoint.mo
index f3966daa1ab..41217b894bb 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/Validation/MinimumFlowSetPoint.mo
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/SetPoints/Validation/MinimumFlowSetPoint.mo
@@ -36,6 +36,21 @@ model MinimumFlowSetPoint "Validation model for MinimumFlowSetPoint sequence"
annotation (Placement(transformation(extent={{0,-90},{20,-70}})));
protected
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection
+ zerStaIndCor
+ "Block to resolve zero index errors"
+ annotation (Placement(transformation(extent={{-80,50},{-60,70}})));
+
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection
+ zerStaIndCor1
+ "Block to resolve zero index errors"
+ annotation (Placement(transformation(extent={{-90,-190},{-70,-170}})));
+
+ Buildings.Controls.OBC.ASHRAE.PrimarySystem.BoilerPlant.Generic.ZeroIndexCorrection
+ zerStaIndCor2
+ "Block to resolve zero index errors"
+ annotation (Placement(transformation(extent={{-20,-60},{0,-40}})));
+
Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ram(
final height=3,
final duration=45,
@@ -54,9 +69,7 @@ protected
annotation (Placement(transformation(extent={{-90,90},{-70,110}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor extIndSig(
- final allowOutOfRange=true,
- final nin=3,
- final outOfRangeValue=0)
+ final nin=3)
"Extract scalar out of vector"
annotation (Placement(transformation(extent={{-60,90},{-40,110}})));
@@ -90,22 +103,20 @@ protected
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant con2[3](
final k={2,1,0})
"Last boiler being disabled during stage change"
- annotation (Placement(transformation(extent={{-90,-30},{-70,-10}})));
+ annotation (Placement(transformation(extent={{-90,-150},{-70,-130}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor extIndSig1(
- final allowOutOfRange=true,
- final nin=3,
- final outOfRangeValue=0)
+ final nin=3)
"Extract scalar out of vector"
- annotation (Placement(transformation(extent={{-60,-30},{-40,-10}})));
+ annotation (Placement(transformation(extent={{-60,-150},{-40,-130}})));
Buildings.Controls.OBC.CDL.Conversions.RealToInteger reaToInt3
"Real to Integer conversion"
- annotation (Placement(transformation(extent={{20,-30},{40,-10}})));
+ annotation (Placement(transformation(extent={{20,-150},{40,-130}})));
Buildings.Controls.OBC.CDL.Continuous.GreaterThreshold greThr1
"Check if current stage setpoint involves boilers being turned on and off"
- annotation (Placement(transformation(extent={{-30,-60},{-10,-40}})));
+ annotation (Placement(transformation(extent={{20,-30},{40,-10}})));
Buildings.Controls.OBC.CDL.Integers.Change cha2
"Detect change in setpoint"
@@ -118,14 +129,12 @@ protected
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant con3[3](
final k={1,0,0})
"Vector indicating if stage change involves boilers being turned on and off"
- annotation (Placement(transformation(extent={{-90,-60},{-70,-40}})));
+ annotation (Placement(transformation(extent={{-90,-30},{-70,-10}})));
Buildings.Controls.OBC.CDL.Routing.RealExtractor extIndSig2(
- final allowOutOfRange=true,
- final nin=3,
- final outOfRangeValue=0)
+ final nin=3)
"Extract scalar out of vector"
- annotation (Placement(transformation(extent={{-60,-60},{-40,-40}})));
+ annotation (Placement(transformation(extent={{-30,-30},{-10,-10}})));
equation
connect(ram.y, reaToInt.u)
@@ -137,18 +146,9 @@ equation
connect(con1.y, extIndSig.u)
annotation (Line(points={{-68,100},{-62,100}}, color={0,0,127}));
- connect(reaToInt.y, extIndSig.index) annotation (Line(points={{-38,20},{64,20},
- {64,86},{-50,86},{-50,88}}, color={255,127,0}));
-
- connect(extIndSig.y, reaToInt1.u)
- annotation (Line(points={{-38,100},{18,100}}, color={0,0,127}));
-
connect(reaToInt1.y, minBoiFloSet.uLasDisBoi) annotation (Line(points={{42,100},
{66,100},{66,66},{68,66}}, color={255,127,0}));
- connect(extIndSig.y, greThr.u) annotation (Line(points={{-38,100},{-34,100},{-34,
- 70},{-32,70}}, color={0,0,127}));
-
connect(greThr.y, minBoiFloSet.uOnOff) annotation (Line(points={{-8,70},{60,70},
{60,62},{68,62}}, color={255,0,255}));
@@ -171,19 +171,14 @@ equation
{64,-100},{64,-66},{68,-66}}, color={255,127,0}));
connect(con2.y, extIndSig1.u)
- annotation (Line(points={{-68,-20},{-62,-20}}, color={0,0,127}));
-
- connect(reaToInt2.y, extIndSig1.index) annotation (Line(points={{-38,-100},{64,
- -100},{64,-34},{-50,-34},{-50,-32}}, color={255,127,0}));
-
- connect(extIndSig1.y, reaToInt3.u)
- annotation (Line(points={{-38,-20},{18,-20}}, color={0,0,127}));
+ annotation (Line(points={{-68,-140},{-62,-140}},
+ color={0,0,127}));
- connect(reaToInt3.y, minBoiFloSet1.uLasDisBoi) annotation (Line(points={{42,-20},
- {66,-20},{66,-54},{68,-54}}, color={255,127,0}));
+ connect(reaToInt3.y, minBoiFloSet1.uLasDisBoi) annotation (Line(points={{42,-140},
+ {56,-140},{56,-54},{68,-54}},color={255,127,0}));
- connect(greThr1.y, minBoiFloSet1.uOnOff) annotation (Line(points={{-8,-50},{60,
- -50},{60,-58},{68,-58}}, color={255,0,255}));
+ connect(greThr1.y, minBoiFloSet1.uOnOff) annotation (Line(points={{42,-20},{60,
+ -20},{60,-58},{68,-58}}, color={255,0,255}));
connect(reaToInt2.y, cha2.u) annotation (Line(points={{-38,-100},{-36,-100},{-36,
-80},{-32,-80}}, color={255,127,0}));
@@ -198,14 +193,35 @@ equation
{60,-80},{60,-62},{68,-62}}, color={255,0,255}));
connect(con3.y, extIndSig2.u)
- annotation (Line(points={{-68,-50},{-62,-50}}, color={0,0,127}));
-
- connect(extIndSig2.y, greThr1.u)
- annotation (Line(points={{-38,-50},{-32,-50}}, color={0,0,127}));
-
- connect(reaToInt2.y, extIndSig2.index) annotation (Line(points={{-38,-100},{64,
- -100},{64,-64},{-50,-64},{-50,-62}}, color={255,127,0}));
-
+ annotation (Line(points={{-68,-20},{-32,-20}}, color={0,0,127}));
+
+ connect(reaToInt.y, zerStaIndCor.uInd) annotation (Line(points={{-38,20},{64,20},
+ {64,84},{-90,84},{-90,64},{-82,64}}, color={255,127,0}));
+ connect(zerStaIndCor.yIndMod, extIndSig.index)
+ annotation (Line(points={{-58,64},{-50,64},{-50,88}}, color={255,127,0}));
+ connect(zerStaIndCor.yCapMod, reaToInt1.u) annotation (Line(points={{-58,56},{
+ -34,56},{-34,100},{18,100}}, color={0,0,127}));
+ connect(zerStaIndCor.yCapMod, greThr.u) annotation (Line(points={{-58,56},{-34,
+ 56},{-34,70},{-32,70}}, color={0,0,127}));
+ connect(extIndSig.y, zerStaIndCor.uCap) annotation (Line(points={{-38,100},{-36,
+ 100},{-36,80},{-86,80},{-86,56},{-82,56}}, color={0,0,127}));
+ connect(reaToInt2.y, zerStaIndCor1.uInd) annotation (Line(points={{-38,-100},{
+ -30,-100},{-30,-120},{-96,-120},{-96,-176},{-92,-176}}, color={255,127,
+ 0}));
+ connect(zerStaIndCor1.yIndMod, extIndSig1.index) annotation (Line(points={{-68,
+ -176},{-50,-176},{-50,-152}}, color={255,127,0}));
+ connect(zerStaIndCor1.yCapMod, reaToInt3.u) annotation (Line(points={{-68,-184},
+ {0,-184},{0,-140},{18,-140}}, color={0,0,127}));
+ connect(extIndSig1.y, zerStaIndCor1.uCap) annotation (Line(points={{-38,-140},
+ {-30,-140},{-30,-196},{-96,-196},{-96,-184},{-92,-184}}, color={0,0,127}));
+ connect(reaToInt2.y, zerStaIndCor2.uInd) annotation (Line(points={{-38,-100},{
+ -36,-100},{-36,-46},{-22,-46}}, color={255,127,0}));
+ connect(zerStaIndCor2.yIndMod, extIndSig2.index) annotation (Line(points={{2,-46},
+ {8,-46},{8,-34},{-20,-34},{-20,-32}}, color={255,127,0}));
+ connect(extIndSig2.y, zerStaIndCor2.uCap) annotation (Line(points={{-8,-20},{-4,
+ -20},{-4,0},{-40,0},{-40,-54},{-22,-54}}, color={0,0,127}));
+ connect(zerStaIndCor2.yCapMod, greThr1.u) annotation (Line(points={{2,-54},{12,
+ -54},{12,-20},{18,-20}}, color={0,0,127}));
annotation (
Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}),
graphics={Ellipse(
@@ -220,7 +236,7 @@ equation
fillPattern = FillPattern.Solid,
points={{-36,60},{64,0},{-36,-60},{-36,60}})}),
Diagram(coordinateSystem(
- preserveAspectRatio=false, extent={{-100,-120},{100,120}})),
+ preserveAspectRatio=false, extent={{-100,-220},{100,120}})),
experiment(
StopTime=10,
Interval=1,
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Down.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Down.mo
index 4e02a279727..a60c5085e1d 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Down.mo
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/Down.mo
@@ -234,19 +234,29 @@ block Down
annotation (Placement(transformation(extent={{-160,120},{-140,140}})));
protected
+ Buildings.Controls.OBC.CDL.Continuous.AddParameter addParDivZer(
+ final p=1e-6)
+ "Add small vcalue to input signal to prevent divide by zero"
+ annotation (Placement(transformation(extent={{-166,10},{-146,30}})));
+
+ Buildings.Controls.OBC.CDL.Continuous.AddParameter addParDivZer1(
+ final p=1e-6)
+ "Add small vcalue to input signal to prevent divide by zero"
+ annotation (Placement(transformation(extent={{-166,-66},{-146,-46}})));
+
Buildings.Controls.OBC.CDL.Logical.Not not1
"Logical Not"
annotation (Placement(transformation(extent={{-120,120},{-100,140}})));
Buildings.Controls.OBC.CDL.Continuous.Divide div
"Thermal capacity ratio"
- annotation (Placement(transformation(extent={{-150,34},{-130,54}})));
+ annotation (Placement(transformation(extent={{-150,44},{-130,64}})));
Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys(
final uLow=fraMinFir,
final uHigh=fraMinFir + sigDif)
"Hysteresis loop"
- annotation (Placement(transformation(extent={{-120,34},{-100,54}})));
+ annotation (Placement(transformation(extent={{-120,44},{-100,64}})));
Buildings.Controls.OBC.CDL.Logical.Or or2 if have_priOnl
"Logical Or"
@@ -254,13 +264,13 @@ protected
Buildings.Controls.OBC.CDL.Continuous.Divide div1
"Thermal capacity ratio"
- annotation (Placement(transformation(extent={{-160,-50},{-140,-30}})));
+ annotation (Placement(transformation(extent={{-160,-40},{-140,-20}})));
Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys1(
final uLow=fraDesCap,
final uHigh=fraDesCap + sigDif)
"Hysteresis loop"
- annotation (Placement(transformation(extent={{-130,-50},{-110,-30}})));
+ annotation (Placement(transformation(extent={{-130,-40},{-110,-20}})));
Buildings.Controls.OBC.CDL.Logical.And3 and3
"Logical And"
@@ -308,17 +318,17 @@ protected
Buildings.Controls.OBC.CDL.Logical.Not not2
"Logical Not"
- annotation (Placement(transformation(extent={{-90,34},{-70,54}})));
+ annotation (Placement(transformation(extent={{-90,44},{-70,64}})));
Buildings.Controls.OBC.CDL.Logical.Not not3
"Logical Not"
- annotation (Placement(transformation(extent={{-90,-50},{-70,-30}})));
+ annotation (Placement(transformation(extent={{-90,-40},{-70,-20}})));
Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys4(
final uLow=bypValClo,
final uHigh=bypValClo + sigDif) if have_priOnl
"Hysteresis loop"
- annotation (Placement(transformation(extent={{-158,-10},{-138,10}})));
+ annotation (Placement(transformation(extent={{-140,-10},{-120,10}})));
Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys2(
final uLow=sigDif,
@@ -386,7 +396,7 @@ protected
Buildings.Controls.OBC.CDL.Logical.And and5
"Turn on timer when hysteresis turns on and reset it when hysteresis turns
off or stage change process is completed"
- annotation (Placement(transformation(extent={{-50,-50},{-30,-30}})));
+ annotation (Placement(transformation(extent={{-50,-40},{-30,-20}})));
Buildings.Controls.OBC.CDL.Logical.And and6 if not have_priOnl
"Turn on timer when hysteresis turns on and reset it when hysteresis turns
@@ -408,15 +418,11 @@ equation
connect(faiSafCon.TSup, THotWatSup)
annotation (Line(points={{-162,130},{-170,130},{-170,120},{-200,120}},
color={0,0,127}));
- connect(div.u2, uCapMin) annotation (Line(points={{-152,38},{-160,38},{-160,30},
- {-200,30}}, color={0,0,127}));
connect(hys.u, div.y)
- annotation (Line(points={{-122,44},{-128,44}},
+ annotation (Line(points={{-122,54},{-124,54},{-124,54},{-128,54}},
color={0,0,127}));
- connect(div1.u2, uCapDowDes) annotation (Line(points={{-162,-46},{-172,-46},{-172,
- -30},{-200,-30}}, color={0,0,127}));
connect(hys1.u, div1.y)
- annotation (Line(points={{-132,-40},{-138,-40}},
+ annotation (Line(points={{-132,-30},{-134,-30},{-134,-30},{-138,-30}},
color={0,0,127}));
connect(and3.y, yStaDow)
annotation (Line(points={{202,0},{240,0}}, color={255,0,255}));
@@ -444,16 +450,18 @@ equation
color={255,0,255}));
connect(and3.u2, logSwi1.y) annotation (Line(points={{178,0},{134,0},{134,-20},
{170,-20},{170,-90},{162,-90}}, color={255,0,255}));
- connect(div.u1, uCapReq) annotation (Line(points={{-152,50},{-160,50},{-160,60},
- {-200,60}}, color={0,0,127}));
- connect(div1.u1, uCapReq) annotation (Line(points={{-162,-34},{-166,-34},{-166,
+ connect(div.u1, uCapReq) annotation (Line(points={{-152,60},{-200,60}},
+ color={0,0,127}));
+ connect(div1.u1, uCapReq) annotation (Line(points={{-162,-24},{-172,-24},{-172,
60},{-200,60}}, color={0,0,127}));
connect(not2.u, hys.y)
- annotation (Line(points={{-92,44},{-98,44}}, color={255,0,255}));
+ annotation (Line(points={{-92,54},{-94,54},{-94,54},{-98,54}},
+ color={255,0,255}));
connect(hys1.y, not3.u)
- annotation (Line(points={{-108,-40},{-92,-40}},color={255,0,255}));
+ annotation (Line(points={{-108,-30},{-104,-30},{-104,-30},{-92,-30}},
+ color={255,0,255}));
connect(hys4.u, uBypValPos)
- annotation (Line(points={{-160,0},{-200,0}}, color={0,0,127}));
+ annotation (Line(points={{-142,0},{-200,0}}, color={0,0,127}));
connect(hys2.y, not4.u)
annotation (Line(points={{-124,-80},{-122,-80}},
color={255,0,255}));
@@ -489,18 +497,20 @@ equation
connect(tim3.u, and1.y)
annotation (Line(points={{-22,44},{-28,44}}, color={255,0,255}));
connect(and1.u1, not2.y)
- annotation (Line(points={{-52,44},{-68,44}}, color={255,0,255}));
+ annotation (Line(points={{-52,44},{-60,44},{-60,54},{-68,54}},
+ color={255,0,255}));
connect(tim1.u, and4.y)
annotation (Line(points={{-22,0},{-28,0}}, color={255,0,255}));
connect(and5.y, tim.u)
- annotation (Line(points={{-28,-40},{30,-40},{30,-20},{48,-20}},
+ annotation (Line(points={{-28,-30},{30,-30},{30,-20},{48,-20}},
color={255,0,255}));
connect(tim2.u, and6.y)
annotation (Line(points={{-22,-100},{-28,-100}}, color={255,0,255}));
connect(hys4.y, and4.u1)
- annotation (Line(points={{-136,0},{-52,0}}, color={255,0,255}));
+ annotation (Line(points={{-118,0},{-52,0}}, color={255,0,255}));
connect(not3.y, and5.u1)
- annotation (Line(points={{-68,-40},{-52,-40}}, color={255,0,255}));
+ annotation (Line(points={{-68,-30},{-64,-30},{-64,-30},{-52,-30}},
+ color={255,0,255}));
connect(and2.y, and6.u1)
annotation (Line(points={{-68,-100},{-52,-100}}, color={255,0,255}));
connect(not5.u, uStaChaProEnd)
@@ -509,8 +519,8 @@ equation
-52,36}}, color={255,0,255}));
connect(not5.y, and4.u2) annotation (Line(points={{-98,90},{-60,90},{-60,-8},{
-52,-8}}, color={255,0,255}));
- connect(not5.y, and5.u2) annotation (Line(points={{-98,90},{-60,90},{-60,-48},
- {-52,-48}}, color={255,0,255}));
+ connect(not5.y, and5.u2) annotation (Line(points={{-98,90},{-60,90},{-60,-38},
+ {-52,-38}}, color={255,0,255}));
connect(not5.y, and6.u2) annotation (Line(points={{-98,90},{-60,90},{-60,-108},
{-52,-108}}, color={255,0,255}));
@@ -520,7 +530,7 @@ equation
{58,-98}}, color={255,0,255}));
connect(tim1.passed, or2.u2) annotation (Line(points={{2,-8},{50,-8},{50,10},{
58,10}}, color={255,0,255}));
- connect(and5.y, tim4.u) annotation (Line(points={{-28,-40},{30,-40},{30,-60},{
+ connect(and5.y, tim4.u) annotation (Line(points={{-28,-30},{30,-30},{30,-60},{
48,-60}}, color={255,0,255}));
connect(tim.passed, logSwi.u1) annotation (Line(points={{72,-28},{90,-28},{90,
-32},{98,-32}}, color={255,0,255}));
@@ -528,6 +538,14 @@ equation
-48},{98,-48}}, color={255,0,255}));
connect(tim2.passed, or1.u2) annotation (Line(points={{2,-108},{40,-108},{40,-106},
{58,-106}}, color={255,0,255}));
+ connect(uCapMin, addParDivZer.u) annotation (Line(points={{-200,30},{-176,30},
+ {-176,20},{-168,20}}, color={0,0,127}));
+ connect(addParDivZer.y, div.u2) annotation (Line(points={{-144,20},{-134,20},{
+ -134,40},{-160,40},{-160,48},{-152,48}}, color={0,0,127}));
+ connect(uCapDowDes, addParDivZer1.u) annotation (Line(points={{-200,-30},{-176,
+ -30},{-176,-56},{-168,-56}}, color={0,0,127}));
+ connect(addParDivZer1.y, div1.u2) annotation (Line(points={{-144,-56},{-132,-56},
+ {-132,-42},{-172,-42},{-172,-36},{-162,-36}}, color={0,0,127}));
annotation(defaultComponentName = "staDow",
Icon(coordinateSystem(extent={{-100,-160},{100,190}}),
graphics={
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/EfficiencyCondition.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/EfficiencyCondition.mo
index e697a0c036e..f514b8cfabb 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/EfficiencyCondition.mo
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Staging/SetPoints/Subsequences/EfficiencyCondition.mo
@@ -95,6 +95,16 @@ block EfficiencyCondition
iconTransformation(extent={{100,-20},{140,20}})));
protected
+ Buildings.Controls.OBC.CDL.Continuous.AddParameter addParDivZer(
+ final p=1e-6)
+ "Add small vcalue to input signal to prevent divide by zero"
+ annotation (Placement(transformation(extent={{-110,90},{-90,110}})));
+
+ Buildings.Controls.OBC.CDL.Continuous.AddParameter addParDivZer1(
+ final p=1e-6)
+ "Add small vcalue to input signal to prevent divide by zero"
+ annotation (Placement(transformation(extent={{-112,10},{-92,30}})));
+
Buildings.Controls.OBC.CDL.Continuous.Divide div
"Divider to get relative value of required heating capacity"
annotation (Placement(transformation(extent={{-80,20},{-60,40}})));
@@ -187,11 +197,6 @@ protected
annotation (Placement(transformation(extent={{-40,-190},{-20,-170}})));
equation
- connect(div.u2,uCapUpMin)
- annotation (Line(points={{-82,24},{-110,24},{-110,20},{-140,20}},
- color={0,0,127}));
- connect(div1.u2, uCapDes) annotation (Line(points={{-82,64},{-90,64},{-90,70},
- {-114,70},{-114,100},{-140,100}}, color={0,0,127}));
connect(sub1.u1, VHotWat_flow) annotation (Line(points={{-82,-34},{-110,-34},{
-110,-20},{-140,-20}}, color={0,0,127}));
connect(sub1.u2, VUpMinSet_flow) annotation (Line(points={{-82,-46},{-110,-46},
@@ -268,6 +273,14 @@ equation
{-110,-70},{-82,-70}}, color={0,0,127}));
connect(addPar.y, div2.u2) annotation (Line(points={{-58,-70},{-50,-70},{-50,-56},
{-42,-56}}, color={0,0,127}));
+ connect(uCapDes, addParDivZer.u)
+ annotation (Line(points={{-140,100},{-112,100}}, color={0,0,127}));
+ connect(addParDivZer.y, div1.u2) annotation (Line(points={{-88,100},{-86,100},
+ {-86,64},{-82,64}}, color={0,0,127}));
+ connect(uCapUpMin, addParDivZer1.u)
+ annotation (Line(points={{-140,20},{-114,20}}, color={0,0,127}));
+ connect(addParDivZer1.y, div.u2) annotation (Line(points={{-90,20},{-86,20},{-86,
+ 24},{-82,24}}, color={0,0,127}));
annotation (
defaultComponentName = "effCon",
Icon(
From 3823371dbf5059a1e57c7572b9f4f22823506c01 Mon Sep 17 00:00:00 2001
From: Devaprasad
Date: Mon, 3 Apr 2023 22:21:01 -0700
Subject: [PATCH 08/20] Added tolerance to model file
---
.../PrimarySystem/BoilerPlant/Generic/ZeroIndexCorrection.mo | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/ZeroIndexCorrection.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/ZeroIndexCorrection.mo
index ae079343d57..cd6f3c1a4ef 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/ZeroIndexCorrection.mo
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/BoilerPlant/Generic/ZeroIndexCorrection.mo
@@ -130,5 +130,6 @@ equation
First implementation.
- "));
+