Skip to content

Commit

Permalink
Merge branch 'master' into issue1920_wetCoil_simplify_mWat_flow
Browse files Browse the repository at this point in the history
  • Loading branch information
mwetter committed May 7, 2020
2 parents f874726 + 9983852 commit 183bab1
Show file tree
Hide file tree
Showing 51 changed files with 217 additions and 156 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
@@ -1,7 +1,7 @@
dist: trusty
sudo: false
dist: bionic

language: python

python:
- "3.6"

Expand Down
Expand Up @@ -20,7 +20,7 @@ model Enable_FreProSta
"Outdoor air temperature is slightly below the cutoff"
annotation (Placement(transformation(extent={{-80,140},{-60,160}})));
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant TOutCut(
final k=TOutCutoff)
final k=TOutCutoff) "OA temperature high limit cutoff"
annotation (Placement(transformation(extent={{-80,100},{-60,120}})));
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant hOutBelowCutoff(
final k=hOutCutoff - 1000)
Expand All @@ -46,14 +46,16 @@ model Enable_FreProSta
final k=0) "Minimal allowed economizer damper position"
annotation (Placement(transformation(extent={{-110,-90},{-90,-70}})));
Buildings.Controls.OBC.CDL.Logical.Sources.Constant supFanSta(k=true)
"Supply fan status"
annotation (Placement(transformation(extent={{-140,-40},{-120,-20}})));

Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1(period=1800)
"Boolean pulse for generating freeze protection stage"
annotation (Placement(transformation(extent={{-20,-160},{0,-140}})));
Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger freProSta1(
integerTrue=Buildings.Controls.OBC.ASHRAE.G36_PR1.Types.FreezeProtectionStages.stage0,
integerFalse=Buildings.Controls.OBC.ASHRAE.G36_PR1.Types.FreezeProtectionStages.stage1)
"Freese protection stage changes from stage 0 to stage 1"
"Freeze protection stage changes from stage 0 to stage 1"
annotation (Placement(transformation(extent={{20,-160},{40,-140}})));

equation
Expand Down
Expand Up @@ -13,13 +13,16 @@ model Modulation_TSup
"Control signal for supply air temperature loop"
annotation (Placement(transformation(extent={{-60,60},{-40,80}})));
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant outDamPosMin(
final k=0.1)
final k=0.1) "Outdoor air damper minimum position"
annotation (Placement(transformation(extent={{-80,-20},{-60,0}})));
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant outDamPosMax(final k=0.8)
"Outdoor air damper maximum position"
annotation (Placement(transformation(extent={{-80,16},{-60,36}})));
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant retDamPosMin(final k=0.2)
"Return air damper minimum position"
annotation (Placement(transformation(extent={{-80,-80},{-60,-60}})));
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant retDamPosMax(final k=0.6)
"Return air damper maximum position"
annotation (Placement(transformation(extent={{-80,-50},{-60,-30}})));

Buildings.Controls.OBC.ASHRAE.G36_PR1.AHUs.MultiZone.VAV.Economizers.Subsequences.Modulation
Expand All @@ -35,25 +38,26 @@ model Modulation_TSup

equation
connect(retDamPosMax.y, mod.uRetDamPosMax)
annotation (Line(points={{-59,-40},{-20,-40},{-20,38},{39,38}},color={0,0,127}));
annotation (Line(points={{-58,-40},{-20,-40},{-20,39},{38,39}},color={0,0,127}));
connect(retDamPosMin.y, mod.uRetDamPosMin)
annotation (Line(points={{-59,-70},{-10,-70},{-10,34},{39,34}},color={0,0,127}));
annotation (Line(points={{-58,-70},{-10,-70},{-10,35},{38,35}},color={0,0,127}));
connect(outDamPosMax.y, mod.uOutDamPosMax)
annotation (Line(points={{-59,26},{39,26}},color={0,0,127}));
annotation (Line(points={{-58,26},{-10,26},{-10,25},{38,25}},
color={0,0,127}));
connect(outDamPosMin.y, mod.uOutDamPosMin)
annotation (Line(points={{-59,-10},{-34,-10},{-24,-10},{-24,22},{39,22}}, color={0,0,127}));
annotation (Line(points={{-58,-10},{-58,-10},{-24,-10},{-24,21},{38,21}}, color={0,0,127}));
connect(uTSup.y, mod.uTSup)
annotation (Line(points={{-39,70},{0,70},{0,30},{39,30}}, color={0,0,127}));
annotation (Line(points={{-38,70},{0,70},{0,30},{38,30}}, color={0,0,127}));
connect(retDamPosMax.y, modFre.uRetDamPosMax)
annotation (Line(points={{-59,-40},{-20,-40},{-20,-22},{39,-22}}, color={0,0,127}));
annotation (Line(points={{-58,-40},{-20,-40},{-20,-21},{38,-21}}, color={0,0,127}));
connect(outDamPosMin.y, modFre.uOutDamPosMin)
annotation (Line(points={{-59,-10},{-34,-10},{-34,-38},{39,-38}}, color={0,0,127}));
annotation (Line(points={{-58,-10},{-34,-10},{-34,-39},{38,-39}}, color={0,0,127}));
connect(uTSup.y, modFre.uTSup)
annotation (Line(points={{-39,70},{0,70},{0,-30},{39,-30}}, color={0,0,127}));
annotation (Line(points={{-38,70},{0,70},{0,-30},{38,-30}}, color={0,0,127}));
connect(outDamPosMaxFre.y, modFre.uOutDamPosMax)
annotation (Line(points={{21,-70},{30,-70},{30,-34},{39,-34}}, color={0,0,127}));
annotation (Line(points={{22,-70},{30,-70},{30,-35},{38,-35}}, color={0,0,127}));
connect(retDamPosMinFre.y, modFre.uRetDamPosMin)
annotation (Line(points={{25,0},{32,0},{32,-26},{39,-26}}, color={0,0,127}));
annotation (Line(points={{26,0},{32,0},{32,-25},{38,-25}}, color={0,0,127}));
annotation (
experiment(StopTime=900.0, Tolerance=1e-06),
__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Controls/OBC/ASHRAE/G36_PR1/AHUs/MultiZone/VAV/Economizers/Subsequences/Validation/Modulation_TSup.mos"
Expand Down
Expand Up @@ -102,7 +102,7 @@ protected
amplitude=20,
freqHz=1/1800,
offset=272.15,
startTime=0)
startTime=0) "Mixed air temerature"
annotation (Placement(transformation(extent={{90,-98},{110,-80}})));

equation
Expand Down
Expand Up @@ -60,7 +60,7 @@ protected
final k=TOutCutoff - 5) "Outdoor air temperature is slightly below the cutoff"
annotation (Placement(transformation(extent={{-120,100},{-100,120}})));
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant TOutCut1(
final k=TOutCutoff)
final k=TOutCutoff) "OA temperature high limit cutoff"
annotation (Placement(transformation(extent={{-120,60},{-100,80}})));
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant TMixMea(
final k=303.15)
Expand Down
Expand Up @@ -261,7 +261,7 @@ block Controller
final min=0,
final max=1,
final unit="1") = 1
"Physically fixed maximum position of the outdoor air (OA) damper"
"Physically fixed maximum position of the outdoor air damper"
annotation(Dialog(tab="Economizer", group="Commissioning"));
parameter Real outDamPhyPosMin(
final min=0,
Expand Down
Expand Up @@ -179,12 +179,14 @@ protected
annotation (Placement(transformation(extent={{4,100},{24,120}})));
Buildings.Controls.OBC.CDL.Integers.Sources.Constant conInt(
final k=Buildings.Controls.OBC.ASHRAE.G36_PR1.Types.FreezeProtectionStages.stage0)
"Freeze protection stage 0"
annotation (Placement(transformation(extent={{-120,30},{-100,50}})));
Buildings.Controls.OBC.CDL.Integers.Equal intEqu
"Logical block to check if the freeze protection is deactivated"
annotation (Placement(transformation(extent={{-80,50},{-60,70}})));
Buildings.Controls.OBC.CDL.Integers.Sources.Constant conInt1(
final k=Buildings.Controls.OBC.ASHRAE.G36_PR1.Types.ZoneStates.heating)
"Heating zone state"
annotation (Placement(transformation(extent={{-120,-30},{-100,-10}})));
Buildings.Controls.OBC.CDL.Integers.Equal intEqu1
"Logical block to check if the freeze protection is deactivated"
Expand Down
Expand Up @@ -48,7 +48,7 @@ block Limits "Single zone VAV AHU minimum outdoor air control - damper position
final min=0,
final max=1,
final unit="1") = 1
"Physically fixed maximum position of the outdoor air (OA) damper"
"Physically fixed maximum position of the outdoor air damper"
annotation(Dialog(tab="Commissioning", group="Physical damper position limits"));
parameter Real outDamPhyPosMin(
final min=0,
Expand Down Expand Up @@ -106,11 +106,11 @@ protected
annotation (Placement(transformation(extent={{-140,50},{-120,70}})));
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant outDamPhyPosMinSig(
final k=outDamPhyPosMin)
"Physically fixed minimum position of the outdoor air (OA) damper"
"Physically fixed minimum position of the outdoor air damper"
annotation (Placement(transformation(extent={{-40,-20},{-20,0}})));
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant outDamPhyPosMaxSig(
final k=outDamPhyPosMax)
"Physically fixed maximum position of the outdoor air (OA) damper"
"Physically fixed maximum position of the outdoor air damper"
annotation (Placement(transformation(extent={{-80,-20},{-60,0}})));
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant yFanMaxSig(
final k=yFanMax) "Maximum supply fan speed"
Expand Down
Expand Up @@ -60,7 +60,7 @@ protected
"Minimal allowed economizer damper position"
annotation (Placement(transformation(extent={{-60,-160},{-40,-140}})));
Buildings.Controls.OBC.CDL.Logical.Sources.Constant supFanSta(
final k=true)
final k=true) "Supply fan status"
annotation (Placement(transformation(extent={{-160,-40},{-140,-20}})));

equation
Expand Down
Expand Up @@ -96,7 +96,7 @@ protected
"Outdoor air temperature is below the cutoff"
annotation (Placement(transformation(extent={{-120,100},{-100,120}})));
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant TOutCut1(
final k=TOutCutoff)
final k=TOutCutoff) "Outdoor temperature high limit cutoff"
annotation (Placement(transformation(extent={{-120,60},{-100,80}})));
Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp TSup(
final height=4,
Expand All @@ -118,7 +118,7 @@ protected
amplitude=20,
freqHz=1/1800,
offset=272.15,
startTime=0)
startTime=0) "Mixed air temperature"
annotation (Placement(transformation(extent={{140,-78},{160,-60}})));

equation
Expand Down
Expand Up @@ -85,7 +85,7 @@ protected
"Outdoor air temperature is slightly below the cutoff"
annotation (Placement(transformation(extent={{-120,100},{-100,120}})));
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant TOutCut1(
final k=TOutCutoff)
final k=TOutCutoff) "Outdoor temperature high limit cutoff"
annotation (Placement(transformation(extent={{-120,60},{-100,80}})));
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant TSupSetSig(
final k=TSupSet) "Heating supply air temperature setpoint"
Expand Down
Expand Up @@ -36,8 +36,10 @@ model OperationMode "Validate block for selecting operation mode"
Buildings.Controls.OBC.CDL.Continuous.Sources.TimeTable occTim(
final table=[0,0; occSta,1; occEnd,0; 24*3600,0],
final smoothness=Buildings.Controls.OBC.CDL.Types.Smoothness.ConstantSegments)
"Occupancy schedule"
annotation (Placement(transformation(extent={{-140,50},{-120,70}})));
Buildings.Controls.OBC.CDL.Continuous.Sources.ModelTime modTim
"Standard time"
annotation (Placement(transformation(extent={{-160,230},{-140,250}})));
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant con(
final k=24*3600) "One day in second"
Expand Down
Expand Up @@ -9,6 +9,7 @@ model FreezeProtectionMixedAir
"Freeze protection set point temperature";

Buildings.Controls.OBC.ASHRAE.G36_PR1.Generic.FreezeProtectionMixedAir freProTMix(final TFreSet = TFreSet)
"Freeze protection signal based on mixed air temperature"
annotation (Placement(transformation(extent={{0,0},{20,20}})));

CDL.Continuous.Sources.Sine sin1(
Expand Down
Expand Up @@ -338,7 +338,7 @@ protected
Buildings.Controls.OBC.CDL.Logical.Switch swi6
"Output hot water valve position in case of low discharge air temperature"
annotation (Placement(transformation(extent={{-30,-90},{-10,-70}})));
Buildings.Controls.OBC.CDL.Logical.Or or2
Buildings.Controls.OBC.CDL.Logical.Or or2 "Logical not"
annotation (Placement(transformation(extent={{-68,-64},{-48,-44}})));
Buildings.Controls.OBC.CDL.Logical.Not not3 "Logical not"
annotation (Placement(transformation(extent={{-120,120},{-100,140}})));
Expand All @@ -348,6 +348,7 @@ protected
Buildings.Controls.OBC.CDL.Logical.Not not6 "Negation of input signal"
annotation (Placement(transformation(extent={{-40,-192},{-20,-172}})));
Buildings.Controls.OBC.CDL.Logical.And and1
"Check if it is not in heating mode and the discharge temperature is not too low"
annotation (Placement(transformation(extent={{20,-56},{40,-36}})));
Buildings.Controls.OBC.CDL.Continuous.Add add3 "Active airflow setpoint"
annotation (Placement(transformation(extent={{200,220},{220,240}})));
Expand Down Expand Up @@ -530,7 +531,7 @@ equation
connect(isUno.y, not5.u) annotation (Line(points={{242,-312},{266,-312},{266,-280},
{180,-280},{180,-250},{198,-250}}, color={255,0,255}));
connect(not5.y, conDam.trigger) annotation (Line(points={{222,-250},{232,-250},
{232,170},{282,170},{282,178}}, color={255,0,255}));
{232,170},{284,170},{284,178}}, color={255,0,255}));
connect(truHol2.y, or2.u2) annotation (Line(points={{-200,-210},{-88,-210},{-88,
-62},{-70,-62}}, color={255,0,255}));
connect(truDel3.y, not3.u)
Expand Down Expand Up @@ -560,7 +561,7 @@ equation
connect(not4.y, truDel3.u)
annotation (Line(points={{-180,130},{-162,130}}, color={255,0,255}));
connect(not5.y, conVal.trigger) annotation (Line(points={{222,-250},{232,-250},
{232,-132},{36,-132},{36,-92}}, color={255,0,255}));
{232,-132},{38,-132},{38,-92}}, color={255,0,255}));
connect(swi6.y, conVal.u_s)
annotation (Line(points={{-8,-80},{32,-80}}, color={0,0,127}));
connect(swi1.y, add4.u1) annotation (Line(points={{154,50},{168,50},{168,56},{
Expand Down
Expand Up @@ -351,6 +351,7 @@ protected
"Output 0 or 1 request "
annotation (Placement(transformation(extent={{100,-440},{120,-420}})));
Buildings.Controls.OBC.CDL.Logical.TrueHoldWithReset truHol(duration=samplePeriod)
"Hold true signal for sample period of time"
annotation (Placement(transformation(extent={{120,330},{140,350}})));
Buildings.Controls.OBC.CDL.Logical.LogicalSwitch logSwi "Logical switch"
annotation (Placement(transformation(extent={{120,300},{140,280}})));
Expand Down
3 changes: 2 additions & 1 deletion Buildings/Controls/OBC/CDL/Constants.mo
Expand Up @@ -5,7 +5,8 @@ package Constants "Package with constants"
"Biggest number such that 1.0 + eps = 1.0";
final constant Real small=1E-60
"Smallest number such that small and -small are representable on the machine";
final constant Real pi=2*Modelica.Math.asin(1.0); // 3.14159265358979;
final constant Real pi=2*Modelica.Math.asin(1.0)
"Constant number pi, 3.14159265358979";

annotation (
Documentation(info="<html>
Expand Down
5 changes: 3 additions & 2 deletions Buildings/Controls/OBC/CDL/Continuous/MatrixMax.mo
Expand Up @@ -18,8 +18,9 @@ equation
y = {max(u[i,:]) for i in 1:size(u, 1)};
else
y = {max(u[:,i]) for i in 1:size(u, 2)};
end if
annotation (
end if;

annotation (
defaultComponentName="matMax",
Documentation(info="<html>
<p>
Expand Down
5 changes: 3 additions & 2 deletions Buildings/Controls/OBC/CDL/Continuous/MatrixMin.mo
Expand Up @@ -18,8 +18,9 @@ equation
y = {min(u[i,:]) for i in 1:size(u, 1)};
else
y = {min(u[:,i]) for i in 1:size(u, 2)};
end if
annotation (
end if;

annotation (
defaultComponentName="matMin",
Documentation(info="<html>
<p>
Expand Down
Expand Up @@ -10,7 +10,7 @@ model Derivative "Validation model for the Derivative block"
annotation (Placement(transformation(extent={{-60,-10},{-40,10}})));

Buildings.Controls.OBC.CDL.Continuous.Derivative der1(
y_start=-10)
y_start=-10) "Approximate the derivative of the input"
annotation (Placement(transformation(extent={{40,-10},{60,10}})));

equation
Expand Down
8 changes: 4 additions & 4 deletions Buildings/Controls/OBC/CDL/Continuous/Validation/Greater.mo
Expand Up @@ -12,14 +12,14 @@ model Greater "Validation model for the Greater block"
annotation (Placement(transformation(extent={{-26,-32},{-6,-12}})));

Buildings.Controls.OBC.CDL.Continuous.Greater greater1
"Check if the first input is greater than the second input"
annotation (Placement(transformation(extent={{26,-10},{46,10}})));

equation
connect(ramp1.y, greater1.u1)
annotation (Line(points={{-5,20},{8,20},{8,0},{24,0}}, color={0,0,127}));
connect(ramp2.y, greater1.u2) annotation (Line(points={{-5,-22},{10,-22},{10,
-8},{24,-8}},
color={0,0,127}));
annotation (Line(points={{-4,20},{8,20},{8,0},{24,0}}, color={0,0,127}));
connect(ramp2.y, greater1.u2) annotation (Line(points={{-4,-22},{10,-22},{10,-8},
{24,-8}}, color={0,0,127}));
annotation (
experiment(StopTime=1.0, Tolerance=1e-06),
__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Controls/OBC/CDL/Continuous/Validation/Greater.mos"
Expand Down
Expand Up @@ -12,12 +12,13 @@ model GreaterEqual "Validation model for the GreaterEqual block"
annotation (Placement(transformation(extent={{-26,-30},{-6,-10}})));

Buildings.Controls.OBC.CDL.Continuous.GreaterEqual greEqu
"Check if the first input is greater than or equal to the second input"
annotation (Placement(transformation(extent={{26,-8},{46,12}})));

equation
connect(ramp1.y, greEqu.u1)
annotation (Line(points={{-5,22},{8,22},{8,2},{24,2}}, color={0,0,127}));
connect(ramp2.y, greEqu.u2) annotation (Line(points={{-5,-20},{10,-20},{10,-6},
annotation (Line(points={{-4,22},{8,22},{8,2},{24,2}}, color={0,0,127}));
connect(ramp2.y, greEqu.u2) annotation (Line(points={{-4,-20},{10,-20},{10,-6},
{24,-6}}, color={0,0,127}));
annotation (
experiment(StopTime=1.0, Tolerance=1e-06),
Expand Down
Expand Up @@ -7,11 +7,12 @@ model GreaterEqualThreshold "Validation model for the GreaterEqualThreshold blo
annotation (Placement(transformation(extent={{-26,-8},{-6,12}})));

Buildings.Controls.OBC.CDL.Continuous.GreaterEqualThreshold greEquThr
"Check if the input is greater than or equal to the threshold"
annotation (Placement(transformation(extent={{26,-8},{46,12}})));

equation
connect(ramp2.y, greEquThr.u)
annotation (Line(points={{-5,2},{8,2},{24,2}}, color={0,0,127}));
annotation (Line(points={{-4,2},{-4,2},{24,2}},color={0,0,127}));
annotation (
experiment(StopTime=1.0, Tolerance=1e-06),
__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Controls/OBC/CDL/Continuous/Validation/GreaterEqualThreshold.mos"
Expand Down
Expand Up @@ -7,11 +7,12 @@ model GreaterThreshold "Validation model for the GreaterThreshold block"
annotation (Placement(transformation(extent={{-26,-8},{-6,12}})));

Buildings.Controls.OBC.CDL.Continuous.GreaterThreshold greThr
"Check if the input is greater than the threshold"
annotation (Placement(transformation(extent={{26,-8},{46,12}})));

equation
connect(ramp2.y, greThr.u)
annotation (Line(points={{-5,2},{8,2},{24,2}}, color={0,0,127}));
annotation (Line(points={{-4,2},{-4,2},{24,2}},color={0,0,127}));
annotation (
experiment(StopTime=1.0, Tolerance=1e-06),
__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Controls/OBC/CDL/Continuous/Validation/GreaterThreshold.mos"
Expand Down
Expand Up @@ -2,7 +2,7 @@ within Buildings.Controls.OBC.CDL.Continuous.Validation;
model HysteresisWithHold "Validation model for the HysteresisWithHold block"
Modelica.Blocks.Sources.Sine pulse1(
amplitude = 0.2,
freqHz = 1/360)
freqHz = 1/360) "Generate sine wave signal"
annotation (Placement(transformation(extent={{-40,-10},{-20,10}})));
Buildings.Controls.OBC.CDL.Continuous.HysteresisWithHold noHold(
trueHoldDuration = 0,
Expand Down
5 changes: 3 additions & 2 deletions Buildings/Controls/OBC/CDL/Continuous/Validation/Less.mo
Expand Up @@ -12,12 +12,13 @@ model Less "Validation model for the Less block"
annotation (Placement(transformation(extent={{-26,-30},{-6,-10}})));

Buildings.Controls.OBC.CDL.Continuous.Less less1
"Check if the first input is less than the second input"
annotation (Placement(transformation(extent={{26,-8},{46,12}})));

equation
connect(ramp1.y, less1.u1)
annotation (Line(points={{-5,22},{8,22},{8,2},{24,2}}, color={0,0,127}));
connect(ramp2.y, less1.u2) annotation (Line(points={{-5,-20},{10,-20},{10,-6},
annotation (Line(points={{-4,22},{8,22},{8,2},{24,2}}, color={0,0,127}));
connect(ramp2.y, less1.u2) annotation (Line(points={{-4,-20},{10,-20},{10,-6},
{24,-6}}, color={0,0,127}));
annotation (
experiment(StopTime=1.0, Tolerance=1e-06),
Expand Down

0 comments on commit 183bab1

Please sign in to comment.