diff --git a/Buildings/Fluid/Humidifiers/BaseClasses/PLRToPulse.mo b/Buildings/Fluid/Humidifiers/BaseClasses/PLRToPulse.mo deleted file mode 100644 index 5a218e6d4ed..00000000000 --- a/Buildings/Fluid/Humidifiers/BaseClasses/PLRToPulse.mo +++ /dev/null @@ -1,130 +0,0 @@ -within Buildings.Fluid.Humidifiers.BaseClasses; -block PLRToPulse - "Converts an input for part load ratio value into an enable signal" - - parameter Modelica.Units.SI.Time tPer = 15*60 - "Time period for PLR sampling"; - - parameter Modelica.Units.SI.Time tDel = 1e-6 - "Delay time of the enable signal"; - - Buildings.Controls.OBC.CDL.Interfaces.RealInput uPLR - "Part load ratio input" - annotation (Placement(transformation(extent={{-140,-20},{-100,20}}), - iconTransformation(extent={{-140,-20},{-100,20}}))); - - Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yEna - "Component enable signal" - annotation (Placement(transformation(extent={{100,-20},{140,20}}), - iconTransformation(extent={{100,-20},{140,20}}))); - -protected - Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai( - final k=tPer) - "Calculate runtime from PLR signal" - annotation (Placement(transformation(extent={{-20,60},{0,80}}))); - - Buildings.Controls.OBC.CDL.Discrete.TriggeredSampler triSam - "Sample the part load ratio signal" - annotation (Placement(transformation(extent={{-60,60},{-40,80}}))); - - Buildings.Controls.OBC.CDL.Logical.Timer tim - "Check component runtime" - annotation (Placement(transformation(extent={{-20,30},{0,50}}))); - - Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul( - final width=tDel/tPer, - final period=tPer) - "Outputs true signals for 1e-6 second duration at required timestep interval" - annotation (Placement(transformation(extent={{-60,-50},{-40,-30}}))); - - Buildings.Controls.OBC.CDL.Reals.Less les - "Check if component runtime has exceeded required runtime from PLR" - annotation (Placement(transformation(extent={{20,40},{40,60}}))); - - Buildings.Controls.OBC.CDL.Logical.Latch lat - "Output a true signal from start of currrent time period, until the required - run-time is achieved" - annotation (Placement(transformation(extent={{-50,30},{-30,50}}))); - - Buildings.Controls.OBC.CDL.Logical.Pre pre1 - "Pre block for looping back latch reset signal" - annotation (Placement(transformation(extent={{50,20},{70,40}}))); - - Buildings.Controls.OBC.CDL.Logical.And andRes - "Lets true signal pass only when latch is not being reset" - annotation (Placement(transformation(extent={{-20,-50},{0,-30}}))); - - Buildings.Controls.OBC.CDL.Logical.Not notRes - "Check if the latch signal is being reset" - annotation (Placement(transformation(extent={{-60,-80},{-40,-60}}))); - - Buildings.Controls.OBC.CDL.Logical.TrueDelay truDel( - final delayTime=tDel) - "Delay the enable signal by 1e-6 seconds, which is also the duration for - which the pulse signal is held. Required when PLR input is zero" - annotation (Placement(transformation(extent={{40,-20},{60,0}}))); - -equation - connect(triSam.y, gai.u) - annotation (Line(points={{-38,70},{-22,70}}, color={0,0,127})); - connect(uPLR, triSam.u) - annotation (Line(points={{-120,0},{-90,0},{-90,70},{-62,70}},color={0,0,127})); - connect(gai.y, les.u1) - annotation (Line(points={{2,70},{14,70},{14,50},{18,50}}, color={0,0,127})); - connect(tim.y, les.u2) - annotation (Line(points={{2,40},{10,40},{10,42},{18,42}}, color={0,0,127})); - connect(lat.y, tim.u) - annotation (Line(points={{-28,40},{-22,40}}, color={255,0,255})); - connect(les.y, pre1.u) annotation (Line(points={{42,50},{46,50},{46,30},{48, - 30}}, color={255,0,255})); - connect(pre1.y, lat.clr) annotation (Line(points={{72,30},{76,30},{76,10},{-60, - 10},{-60,34},{-52,34}}, color={255,0,255})); - connect(booPul.y, andRes.u1) - annotation (Line(points={{-38,-40},{-22,-40}}, color={255,0,255})); - connect(andRes.y, triSam.trigger) - annotation (Line(points={{2,-40},{10,-40},{10,-20},{-70,-20},{-70,54},{-50,54},{-50,58}}, - color={255,0,255})); - connect(andRes.y, lat.u) - annotation (Line(points={{2,-40},{10,-40},{10,-20},{-70,-20},{-70,40},{-52,40}}, - color={255,0,255})); - connect(notRes.y, andRes.u2) - annotation (Line(points={{-38,-70},{-30,-70},{-30,-48},{-22,-48}}, - color={255,0,255})); - connect(pre1.y, notRes.u) annotation (Line(points={{72,30},{76,30},{76,-90},{ - -70,-90},{-70,-70},{-62,-70}}, color={255,0,255})); - connect(lat.y, truDel.u) - annotation (Line(points={{-28,40},{-26,40},{-26,-10},{38,-10}}, - color={255,0,255})); - connect(truDel.y, yEna) - annotation (Line(points={{62,-10},{92,-10},{92,0},{120,0}}, - color={255,0,255})); - -annotation (Icon( - coordinateSystem(preserveAspectRatio=false), - graphics={Rectangle(extent={{-100,100},{100,-100}},lineColor={0,0,0}, - fillColor={255,255,255},fillPattern = FillPattern.Solid), - Text( - extent={{-160,140},{160,100}}, - textString="%name", - textColor={0,0,255})}), - Diagram(defaultComponentName="plrToPul", - coordinateSystem(preserveAspectRatio=false)), - Documentation(info=" -
-This block calculates the time duration for which the DX coil needs to be kept enabled
-based on the part-load ratio input signal uPLR
for the constant simulation
-run period tPer
, and then generates an output enable signal
-yEna
for a duration uPLR * tPer
. Once the component has been kept enabled for
-the calculated duration, the component is kept disabled until the start of the next period.
-
-This model validates - -Buildings.Fluid.Humidifiers.BaseClasses.PLRToPulse -by providing it a time-varying input signal for the part-load ratio, and then -comparing the enabled time results against required calculated values. -
-", -revisions=" --This package contains validation models for the classes in the baseclasses package. -
-")); -end Validation; diff --git a/Buildings/Fluid/Humidifiers/BaseClasses/Validation/package.order b/Buildings/Fluid/Humidifiers/BaseClasses/Validation/package.order deleted file mode 100644 index 906d832c8e3..00000000000 --- a/Buildings/Fluid/Humidifiers/BaseClasses/Validation/package.order +++ /dev/null @@ -1 +0,0 @@ -PLRToPulse diff --git a/Buildings/Fluid/Humidifiers/BaseClasses/package.order b/Buildings/Fluid/Humidifiers/BaseClasses/package.order index f2d3665398e..446742d0717 100644 --- a/Buildings/Fluid/Humidifiers/BaseClasses/package.order +++ b/Buildings/Fluid/Humidifiers/BaseClasses/package.order @@ -1,3 +1 @@ -PLRToPulse PerformanceCurveModifier -Validation diff --git a/Buildings/Fluid/Humidifiers/Validation/DXDehumidifier.mo b/Buildings/Fluid/Humidifiers/Validation/DXDehumidifier.mo index 885ce76e131..1625702ebd1 100644 --- a/Buildings/Fluid/Humidifiers/Validation/DXDehumidifier.mo +++ b/Buildings/Fluid/Humidifiers/Validation/DXDehumidifier.mo @@ -25,12 +25,6 @@ model DXDehumidifier "Validation model for DX dehumidifier" "DX dehumidifier" annotation (Placement(transformation(extent={{-50,-28},{-30,-8}}))); - Buildings.Fluid.Humidifiers.BaseClasses.PLRToPulse plrToPul( - final tPer=3600, - final tDel=0.1) - "Convert PLR signal to on-off signal" - annotation (Placement(transformation(extent={{-120,60},{-100,80}}))); - Buildings.Fluid.Sources.MassFlowSource_T boundary( redeclare package Medium = Medium, final use_Xi_in=true, @@ -137,6 +131,14 @@ model DXDehumidifier "Validation model for DX dehumidifier" "Reader for energy plus reference results" annotation (Placement(transformation(extent={{-160,60},{-140,80}}))); +protected + Controls.OBC.CDL.Discrete.Sampler sam(final samplePeriod=3600) + "Sampling the part load ratio" + annotation (Placement(transformation(extent={{-120,60},{-100,80}}))); +protected + Controls.OBC.CDL.Logical.VariablePulse plrToPul(final period=3600) + "Convert part load ratio signal to on-off signal" + annotation (Placement(transformation(extent={{-88,60},{-68,80}}))); equation connect(watRemRatMod.y, mWatMod.u) annotation (Line(points={{41,40},{58,40}}, color={0,0,127})); @@ -150,18 +152,12 @@ equation annotation (Line(points={{41,-40},{58,-40}}, color={0,0,127})); connect(dehHeaRat_engPlu.y, QHea_engPlu.u) annotation (Line(points={{121,-40},{138,-40}}, color={0,0,127})); - connect(plrToPul.yEna, dxDeh.uEna) annotation (Line(points={{-98,70},{-54,70}, - {-54,-14},{-51,-14}}, color={255,0,255})); connect(toTotAirIn.XiTotalAir, boundary.Xi_in[1]) annotation (Line(points={{-99,-50}, {-90,-50},{-90,-22},{-84,-22}}, color={0,0,127})); connect(TIn_K.Kelvin, boundary.T_in) annotation (Line(points={{-99,19.8},{-90, 19.8},{-90,-14},{-84,-14}}, color={0,0,127})); connect(booToReaFanEna.y, gai.u) annotation (Line(points={{-138,-10},{-122,-10}}, color={0,0,127})); - connect(plrToPul.yEna, booToReaFanEna.u) annotation (Line(points={{-98,70},{-80, - 70},{-80,40},{-170,40},{-170,-10},{-162,-10}}, color={255,0,255})); - connect(datRea.y[8], plrToPul.uPLR) - annotation (Line(points={{-139,70},{-122,70}}, color={0,0,127})); connect(datRea.y[11], TIn_K.Celsius) annotation (Line(points={{-139,70},{-130, 70},{-130,19.6},{-122,19.6}}, color={0,0,127})); connect(datRea.y[10], toTotAirIn.XiDry) annotation (Line(points={{-139,70},{ @@ -173,6 +169,14 @@ equation connect(sin.ports[1], dxDeh.port_b) annotation (Line(points={{-20,-18},{-30,-18}}, color={0,127,255})); + connect(datRea.y[8], sam.u) + annotation (Line(points={{-139,70},{-122,70}}, color={0,0,127})); + connect(sam.y, plrToPul.u) + annotation (Line(points={{-98,70},{-90,70}}, color={0,0,127})); + connect(plrToPul.y, booToReaFanEna.u) annotation (Line(points={{-66,70},{-56, + 70},{-56,40},{-170,40},{-170,-10},{-162,-10}}, color={255,0,255})); + connect(plrToPul.y, dxDeh.uEna) annotation (Line(points={{-66,70},{-56,70},{ + -56,-14},{-51,-14}}, color={255,0,255})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,100}})), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-180,-100},{180,100}})), diff --git a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Humidifiers_BaseClasses_Validation_PLRToPulse.txt b/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Humidifiers_BaseClasses_Validation_PLRToPulse.txt deleted file mode 100644 index 13ba9f7eba7..00000000000 --- a/Buildings/Resources/ReferenceResults/Dymola/Buildings_Fluid_Humidifiers_BaseClasses_Validation_PLRToPulse.txt +++ /dev/null @@ -1,12 +0,0 @@ -last-generated=2024-11-20 -statistics-simulation= -{ - "linear": " ", - "nonlinear": " ", - "numerical Jacobians": "0" -} -time=[0e+00, 7.2e+03] -plrToPul.uPLR=[0e+00, 1.600000075995922e-02, 3.200000151991844e-02, 4.800000041723251e-02, 6.400000303983688e-02, 7.999999821186066e-02, 9.600000083446503e-02, 1.120000034570694e-01, 1.280000060796738e-01, 1.439999938011169e-01, 1.599999964237213e-01, 1.759999990463257e-01, 1.920000016689301e-01, 2.080000042915344e-01, 2.240000069141388e-01, 2.39999994635582e-01, 2.560000121593475e-01, 2.720000147819519e-01, 2.879999876022339e-01, 3.039999902248383e-01, 3.199999928474426e-01, 3.35999995470047e-01, 3.519999980926514e-01, 3.680000007152557e-01, 3.840000033378601e-01, 4.000000059604645e-01, 4.160000085830688e-01, 4.320000112056733e-01, 4.480000138282776e-01, 4.639999866485596e-01, 4.799999892711639e-01, 4.959999918937683e-01, 5.120000243186951e-01, 5.279999971389771e-01, 5.440000295639038e-01, 5.600000023841858e-01, 5.759999752044678e-01, 5.920000076293945e-01, 6.079999804496765e-01, 6.240000128746033e-01, 6.399999856948853e-01, 6.56000018119812e-01, 6.71999990940094e-01, 6.880000233650208e-01, 7.039999961853027e-01, 7.200000286102295e-01, 7.360000014305115e-01, 7.519999742507935e-01, 7.680000066757202e-01, 7.839999794960022e-01, 8.00000011920929e-01, 8.159999847412109e-01, 8.320000171661377e-01, 8.479999899864197e-01, 8.640000224113465e-01, 8.799999952316285e-01, 8.960000276565553e-01, 9.120000004768372e-01, 9.279999732971191e-01, 9.440000057220459e-01, 9.599999785423279e-01, 9.760000109672546e-01, 9.919999837875366e-01, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00] -plrToPul.yEna=[1e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 1e+00, 1e+00, 1e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 0e+00, 0e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00, 1e+00] -gaiTim.y=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 1.8e+02, 1.8e+02, 1.8e+02, 1.8e+02, 1.8e+02, 1.8e+02, 1.8e+02, 1.8e+02, 1.8e+02, 1.8e+02, 1.8e+02, 1.8e+02, 1.8e+02, 3.6e+02, 3.6e+02, 3.6e+02, 3.6e+02, 3.6e+02, 3.6e+02, 3.6e+02, 3.6e+02, 3.6e+02, 3.6e+02, 3.6e+02, 3.6e+02, 5.4e+02, 5.4e+02, 5.4e+02, 5.4e+02, 5.4e+02, 5.4e+02, 5.4e+02, 5.4e+02, 5.4e+02, 5.4e+02, 5.4e+02, 5.4e+02, 5.4e+02, 7.2e+02, 7.2e+02, 7.2e+02, 7.2e+02, 7.2e+02, 7.2e+02, 7.2e+02, 7.2e+02, 7.2e+02, 7.2e+02, 7.2e+02, 7.2e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02, 9e+02] -timEna.y=[0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 3.6e+01, 1.080000000000001e+02, 1.8e+02, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 7.2e+01, 1.440000000000002e+02, 2.160000000000002e+02, 2.88e+02, 3.6e+02, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 3.6e+01, 1.08e+02, 1.8e+02, 2.52e+02, 3.24e+02, 3.96e+02, 4.68e+02, 5.4e+02, 0e+00, 0e+00, 0e+00, 0e+00, 0e+00, 7.2e+01, 1.44e+02, 2.16e+02, 2.880000000000005e+02, 3.600000000000005e+02, 4.320000000000005e+02, 5.04e+02, 5.76e+02, 6.48e+02, 7.2e+02, 0e+00, 0e+00, 3.6e+01, 1.08e+02, 1.8e+02, 2.52e+02, 3.24e+02, 3.96e+02, 4.68e+02, 5.4e+02, 6.12e+02, 6.84e+02, 7.56e+02, 8.28e+02, 9e+02, 7.2e+01, 1.44e+02, 2.16e+02, 2.88e+02, 3.6e+02, 4.32e+02, 5.04e+02, 5.76e+02, 6.48e+02, 7.2e+02, 7.92e+02, 8.64e+02, 3.6e+01, 1.08e+02, 1.8e+02, 2.52e+02, 3.24e+02, 3.96e+02, 4.68e+02, 5.4e+02, 6.12e+02, 6.84e+02, 7.56e+02, 8.28e+02, 9e+02] diff --git a/Buildings/Resources/Scripts/Dymola/Fluid/Humidifiers/BaseClasses/Validation/PLRToPulse.mos b/Buildings/Resources/Scripts/Dymola/Fluid/Humidifiers/BaseClasses/Validation/PLRToPulse.mos deleted file mode 100644 index e18a74b2e80..00000000000 --- a/Buildings/Resources/Scripts/Dymola/Fluid/Humidifiers/BaseClasses/Validation/PLRToPulse.mos +++ /dev/null @@ -1,7 +0,0 @@ -// Script generated by Dymola Wed Mar 22 20:15:01 2023 -// Plot commands -simulateModel("Buildings.Fluid.Humidifiers.BaseClasses.Validation.PLRToPulse", stopTime=7200, tolerance=1e-06, resultFile="PLRToPulse"); - -createPlot(id=1, position={0, 0, 851, 828}, y={"plrToPul.uPLR"}, range={0.0, 7200.0, -0.2, 1.2}, grid=true, colors={{28,108,200}}); -createPlot(id=1, position={0, 0, 851, 272}, y={"plrToPul.yEna"}, range={0.0, 7200.0, -0.2, 1.2}, grid=true, subPlot=2, colors={{28,108,200}}); -createPlot(id=1, position={0, 0, 851, 273}, y={"gaiTim.y", "timEna.y"}, range={0.0, 7200.0, -200.0, 1000.0}, grid=true, subPlot=3, colors={{28,108,200}, {238,46,47}}); diff --git a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Humidifiers.BaseClasses.Validation.PLRToPulse.mos b/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Humidifiers.BaseClasses.Validation.PLRToPulse.mos deleted file mode 100644 index ec35b634a0f..00000000000 --- a/Buildings/Resources/Scripts/OpenModelica/compareVars/Buildings.Fluid.Humidifiers.BaseClasses.Validation.PLRToPulse.mos +++ /dev/null @@ -1,7 +0,0 @@ -compareVars := - { - "plrToPul.uPLR", - "plrToPul.yEna", - "gaiTim.y", - "timEna.y" - };